|
@@ -35,7 +35,9 @@ int main(int argc, char *argv[]) {
|
|
|
prctl(PR_SET_PDEATHSIG, SIGTERM);
|
|
|
|
|
|
// Set the path to the CLI - pass argument h (help) for now
|
|
|
- execl("../../cli/ccats-cli", "c", "127.0.0.1", (char *)NULL);
|
|
|
+ // TODO: Change hardcoded path
|
|
|
+ execl("../../cli/build/ccats-cli", "ccats-cli", "c", "127.0.0.1",
|
|
|
+ (char *)NULL);
|
|
|
|
|
|
exit(1);
|
|
|
}
|
|
@@ -43,7 +45,7 @@ int main(int argc, char *argv[]) {
|
|
|
close(outpipefd[0]);
|
|
|
close(inpipefd[1]);
|
|
|
|
|
|
- // ########## GUI CODE; DO NOT TOUCH ##########
|
|
|
+ // ########## GUI CODE ##########
|
|
|
|
|
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
|
|
|
@@ -55,22 +57,17 @@ int main(int argc, char *argv[]) {
|
|
|
if (engine.rootObjects().isEmpty())
|
|
|
return -1;
|
|
|
|
|
|
- QMLHandler fooBar;
|
|
|
+ QMLHandler qmlHandler;
|
|
|
|
|
|
- QObject *item =
|
|
|
- engine.rootObjects().first()->findChild<QObject *>("connectbutton");
|
|
|
- QObject *item2 =
|
|
|
- engine.rootObjects().first()->findChild<QObject *>("disconnectbutton");
|
|
|
+ QObject *statusButton =
|
|
|
+ engine.rootObjects().first()->findChild<QObject *>("getstatusbutton");
|
|
|
|
|
|
- QObject::connect(item, SIGNAL(clicked()), &fooBar, SLOT(onConnectClick()));
|
|
|
- QObject::connect(item2, SIGNAL(clicked()), &fooBar,
|
|
|
- SLOT(onDisconnectClick()));
|
|
|
+ QObject::connect(statusButton, SIGNAL(clicked()), &qmlHandler,
|
|
|
+ SLOT(onGetStatusClick()));
|
|
|
|
|
|
- QObject::connect(&fooBar, SIGNAL(setStatusMessage(QVariant)),
|
|
|
+ QObject::connect(&qmlHandler, SIGNAL(setStatusMessage(QVariant)),
|
|
|
engine.rootObjects().first(),
|
|
|
SLOT(setStatusMessage(QVariant)));
|
|
|
|
|
|
return app.exec();
|
|
|
-
|
|
|
- // ########## GUI CODE; DO NOT TOUCH ##########
|
|
|
}
|