-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement commands via secondary instance
- Loading branch information
1 parent
58899d4
commit a73a7d2
Showing
6 changed files
with
57 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "singleapplication"] | ||
path = singleapplication | ||
url = git@github.com:itay-grudev/SingleApplication.git |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,33 @@ | ||
#include "MainWindow.h" | ||
#include <QApplication> | ||
#include <QStyleFactory> | ||
#include <QLoggingCategory> | ||
#include <singleapplication.h> | ||
|
||
int main(int argc, char *argv[]) { | ||
QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true")); | ||
//QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true")); | ||
|
||
QCoreApplication::setOrganizationName("Dorian Rudolph"); | ||
QCoreApplication::setOrganizationDomain("dorianrudolph.com"); | ||
QCoreApplication::setApplicationName("QWalkingPad"); | ||
|
||
if (!Settings().getUseSystemTheme()) { | ||
if (argc == 1 && !Settings().getUseSystemTheme()) { | ||
QApplication::setStyle(QStyleFactory::create("Fusion")); | ||
QIcon::setThemeName("Fusion"); | ||
} | ||
|
||
QApplication a(argc, argv); | ||
MainWindow win; | ||
win.show(); | ||
return QApplication::exec(); | ||
SingleApplication app(argc, argv, true); | ||
|
||
if (app.isPrimary()) { | ||
if (argc > 1) return 1; | ||
MainWindow win; | ||
QObject::connect(&app, &SingleApplication::receivedMessage, &win, &MainWindow::receivedMessage); | ||
win.show(); | ||
return QApplication::exec(); | ||
} else { | ||
auto args = SingleApplication::arguments(); | ||
args.pop_front(); | ||
if (args.empty()) return 1; | ||
app.sendMessage(args.join(' ').toUtf8()); | ||
} | ||
|
||
} |
Submodule singleapplication
added at
c557da