forked from varoudis/depthmapX
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from orange-vertex/open_from_filesystem_macos
Open from filesystem macos
- Loading branch information
Showing
10 changed files
with
135 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright (C) 2017 Petros Koutsolampros | ||
|
||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#include "GuiApp/coreapplication.h" | ||
#include <QSplashScreen> | ||
#include <QDesktopWidget> | ||
|
||
int CoreApplication::exec() { | ||
SettingsImpl settings(new DefaultSettingsFactory); | ||
|
||
if (!settings.readSetting(SettingTag::licenseAccepted, false).toBool()) | ||
{ | ||
auto dummy = MainWindowFactory::getLicenseDialog(); | ||
dummy->setModal(true); | ||
dummy->setWindowTitle(TITLE_BASE); | ||
dummy->exec(); | ||
if ( dummy->result() == QDialog::Rejected) { | ||
return 0; | ||
} | ||
settings.writeSetting(SettingTag::licenseAccepted, true); | ||
} | ||
|
||
QSplashScreen *splash = 0; | ||
int screenId = QApplication::desktop()->screenNumber(); | ||
splash = new QSplashScreen(QPixmap(QLatin1String("images/splash.png"))); | ||
if (QApplication::desktop()->isVirtualDesktop()) | ||
{ | ||
QRect srect(0, 0, splash->width(), splash->height()); | ||
splash->move(QApplication::desktop()->availableGeometry(screenId).center() - srect.center() ); | ||
} | ||
|
||
auto args = arguments(); | ||
QString fileToLoad = mFileToLoad; | ||
if (args.length() == 2) | ||
{ | ||
fileToLoad = args[1]; | ||
} | ||
|
||
mMainWindow = MainWindowFactory::getMainWindow(fileToLoad, settings); | ||
mMainWindow->show(); | ||
return QApplication::exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>NSPrincipalClass</key> | ||
<string>NSApplication</string> | ||
<key>CFBundleIconFile</key> | ||
<string>depthmapX.icns</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleExecutable</key> | ||
<string>depthmapX</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.spacegroupucl.depthmapX</string> | ||
<key>CFBundleDocumentTypes</key> | ||
<array> | ||
<dict> | ||
<key>CFBundleTypeExtensions</key> | ||
<array> | ||
<string>graph</string> | ||
</array> | ||
<key>CFBundleTypeName</key> | ||
<string>Graph File</string> | ||
<key>CFBundleTypeRole</key> | ||
<string>Editor</string> | ||
<key>CFBundleTypeIconFile</key> | ||
<string>graph.icns</string> | ||
</dict> | ||
</array> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters