Browse Source

updating to send scheduled tasks
need to handle utf8
updated UI

logicp 5 years ago
parent
commit
1ec86b56f8
11 changed files with 682 additions and 230 deletions
  1. 66 14
      argdialog.cpp
  2. 11 10
      argdialog.h
  3. 58 41
      argdialog.ui
  4. 33 4
      client.cpp
  5. 13 2
      client.hpp
  6. 33 3
      headers/util.hpp
  7. 277 2
      ky_gui.pro.user
  8. 36 6
      mainwindow.cpp
  9. 2 0
      mainwindow.h
  10. 126 119
      mainwindow.ui
  11. 27 29
      ui_argdialog.h

+ 66 - 14
argdialog.cpp

@@ -22,19 +22,13 @@ ArgDialog::ArgDialog(QWidget *parent) :
                                                 tr("Open File"), "~", tr("All Files (*.*)"));
         qDebug() << "Selected file:" << file_path;
         if (file_path.size() > 0) {
-            QFile file(file_path);
-//            std::vector<char> byte_array{};
-//            if (file.open(QIODevice::ReadOnly)) {
-//                QByteArray bytes = file.readAll();
-//                emit ArgDialog::uploadFile(bytes);
-//            }
             auto slash_index = file_path.lastIndexOf("/") + 1;
             QString file_name = file_path.right(file_path.size() - slash_index);
 
             addItem(file_name, "file");
 
-            m_ig_post.video.name = file_name.toUtf8().constData();
-            m_ig_post.video.path = file_path.toUtf8().constData();
+            m_ig_post.video.name = file_name;
+            m_ig_post.video.path = file_path;
         }
     });
 
@@ -45,8 +39,7 @@ ArgDialog::ArgDialog(QWidget *parent) :
 
     QObject::connect(ui->addArgument, &QPushButton::clicked, this, [this]() {
         QString text = ui->argInput->toPlainText();
-        QList<QListWidgetItem*> types = ui->argType->selectedItems();
-        auto type = types.size() > 0 ? types.at(0)->text() : "Unknown type";
+        auto type = ui->argType->currentText();
         if (text.size() > 0) {
             if (type == Args::HASHTAG_TYPE) {
                 addHashtag(text);
@@ -66,17 +59,77 @@ ArgDialog::ArgDialog(QWidget *parent) :
         }
     });
 
-    ui->argType->setItemSelected(ui->argType->item(0), true);
     QDateTime date_time = QDateTime::currentDateTime();
 //    date_time.
     ui->dateTime->setDateTime(QDateTime::currentDateTime());
 
     QObject::connect(ui->dateTime, &QDateTimeEdit::dateTimeChanged, this, [this]() {
         auto date_time = ui->dateTime->dateTime();
+        m_ig_post.datetime = std::string{date_time.toString().toUtf8().data()};
         qDebug() << "Time changed to" << date_time;
     });
 
-//    QObject::connect(ui->ar)
+    QObject::connect(ui->argCommandButtons, static_cast<void (QDialogButtonBox::*)(QAbstractButton*)>(&QDialogButtonBox::clicked), this, [this](QAbstractButton* button) {
+        if (button->text() == "Save") {
+            if (m_ig_post.isReady()) {
+                setTaskArguments();
+                emit ArgDialog::taskRequestReady(m_task);
+                QFile file(m_ig_post.video.path);
+                std::vector<char> byte_array{};
+                if (file.open(QIODevice::ReadOnly)) {
+                    QByteArray bytes = file.readAll();
+//                    emit ArgDialog::uploadFile(bytes);
+                    qDebug() << "Would be sending file..";
+                } else {
+                    QMessageBox::warning(
+                        this,
+                        tr("File Error"),
+                        tr("Unable to read file")
+                    );
+                }
+            }
+        }
+    });
+
+    QObject::connect(ui->devTestButton, &QPushButton::clicked, this, [this]() {
+        clearPost();
+        KFile file = KFile{.name="videofile", .path="videopath"};
+        m_ig_post = IGPost{
+            .description = "asdasdas",
+            .datetime = "sdasadasd",
+            .promote_share = "dfgdfg",
+            .link_in_bio = "asdasd",
+            .hashtags = {"tag1", "tag2"},
+            .requested_by = {"person"},
+            .video = file
+        };
+    });
+}
+
+void ArgDialog::setTaskArguments() {
+    m_task.args.clear();
+    std::string hashtags{};
+    for (const auto & tag : m_ig_post.hashtags) {
+        hashtags += "#" + tag + " ";
+    }
+    hashtags.pop_back();
+
+    std::string requested_by{};
+    for (const auto & name : m_ig_post.requested_by) {
+        requested_by += "@" + name + "";
+    }
+    if (m_ig_post.requested_by.size() > 1) {
+    requested_by.pop_back();
+    }
+
+    m_task.args.push_back(m_ig_post.video.name.toUtf8().constData());
+    m_task.args.push_back(m_ig_post.datetime);
+    m_task.args.push_back(m_ig_post.description);
+    m_task.args.push_back(hashtags);
+    m_task.args.push_back(requested_by);
+    m_task.args.push_back(m_ig_post.requested_by_phrase);
+    m_task.args.push_back(m_ig_post.promote_share);
+    m_task.args.push_back(m_ig_post.link_in_bio);
 }
 
 void ArgDialog::addItem(QString value, QString type) {
@@ -102,7 +155,6 @@ void ArgDialog::clearPost() {
 void ArgDialog::clearTask() {
     m_task.args = {};
     m_task.mask = -1;
-    m_task.time = "";
 }
 
 void ArgDialog::addRequestedBy(QString value) {
@@ -110,7 +162,7 @@ void ArgDialog::addRequestedBy(QString value) {
         m_ig_post.requested_by.push_back(value.toUtf8().constData());
         addToArgList(value, "requested_by");
     } else {
-        const char* message = "You have already inputted this name under \"requested_by\"";
+        const char* message = "You have already inputed this name under \"requested_by\"";
         qDebug() << message;
         QMessageBox::warning(
             this,

+ 11 - 10
argdialog.h

@@ -21,23 +21,22 @@ typedef std::string Str;
 //    Str SmilingFaceEyes{"U+1F60A"};
 //    const char* SmilingFaceEyesBytes = "😊";
 //}
+typedef struct Task {
+    int mask;
+    std::vector<std::string> args;
+} Task;
 
 typedef struct KFile {
-  std::string_view name;
-  std::string_view path;
+  QString name;
+  QString path;
 } KFile;
 
-typedef struct Task {
-  QString time;
-  int mask;
-  std::vector<std::string> args;
-} Task;
-
 typedef struct IGPost {
   std::string description;
   std::string datetime;
-  std::string promote_share = "Share the post through IG story if you enjoy the phrase 🙋‍♀️";
-  std::string link_in_bio = "Download a FREE PDF of basic 245 verbs (link 🔗 in bio 👆)";
+  std::string promote_share = "Promote share";
+//  std::string link_in_bio = u8"Download a FREE PDF of basic 245 verbs (link 🔗 in bio 👆)";
+  std::string link_in_bio = "Link inbio";
   std::vector<std::string> hashtags;
   std::vector<std::string> requested_by;
   const char *requested_by_phrase = "The phrase was requested by ";
@@ -63,6 +62,7 @@ class ArgDialog : public QDialog {
 
  signals:
   void uploadFile(QByteArray bytes);
+  void taskRequestReady(Task task);
 
  private:
   void clearPost();
@@ -71,6 +71,7 @@ class ArgDialog : public QDialog {
   void addOrReplaceInArgList(QString value, QString type);
   void addHashtag(QString tag);
   void addRequestedBy(QString value);
+  void setTaskArguments();
   Ui::ArgDialog *ui;
   void addItem(QString value, QString type);
   Task m_task;

+ 58 - 41
argdialog.ui

@@ -155,47 +155,6 @@ selection-background-color: rgb(255, 0, 174);</string>
    <column/>
    <column/>
   </widget>
-  <widget class="QListWidget" name="argType">
-   <property name="geometry">
-    <rect>
-     <x>190</x>
-     <y>80</y>
-     <width>81</width>
-     <height>41</height>
-    </rect>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">background-color: rgb(255, 255, 255);
-color: rgb(5, 5, 5);
-font: 87 10pt &quot;Noto Sans&quot;;
-selection-background-color: rgb(255, 0, 174);</string>
-   </property>
-   <item>
-    <property name="text">
-     <string>description</string>
-    </property>
-   </item>
-   <item>
-    <property name="text">
-     <string>hashtag</string>
-    </property>
-   </item>
-   <item>
-    <property name="text">
-     <string>link/bio</string>
-    </property>
-   </item>
-   <item>
-    <property name="text">
-     <string>promote/share</string>
-    </property>
-   </item>
-   <item>
-    <property name="text">
-     <string>requested by</string>
-    </property>
-   </item>
-  </widget>
   <widget class="QLabel" name="label_2">
    <property name="geometry">
     <rect>
@@ -273,6 +232,64 @@ font: 87 10pt &quot;Noto Sans&quot;;</string>
     </rect>
    </property>
   </widget>
+  <widget class="QComboBox" name="argType">
+   <property name="geometry">
+    <rect>
+     <x>190</x>
+     <y>80</y>
+     <width>141</width>
+     <height>31</height>
+    </rect>
+   </property>
+   <property name="styleSheet">
+    <string notr="true">background-color: rgb(255, 255, 255);
+color: rgb(5, 5, 5);
+font: 87 10pt &quot;Noto Sans&quot;;
+selection-background-color: rgb(255, 0, 174);</string>
+   </property>
+   <item>
+    <property name="text">
+     <string>description</string>
+    </property>
+   </item>
+   <item>
+    <property name="text">
+     <string>hashtag</string>
+    </property>
+   </item>
+   <item>
+    <property name="text">
+     <string>requested by</string>
+    </property>
+   </item>
+   <item>
+    <property name="text">
+     <string>promote/share</string>
+    </property>
+   </item>
+   <item>
+    <property name="text">
+     <string>link/bio</string>
+    </property>
+   </item>
+  </widget>
+  <widget class="QPushButton" name="devTestButton">
+   <property name="geometry">
+    <rect>
+     <x>240</x>
+     <y>590</y>
+     <width>80</width>
+     <height>26</height>
+    </rect>
+   </property>
+   <property name="styleSheet">
+    <string notr="true">background-color: rgb(59, 255, 0);
+color: rgb(0, 0, 0);</string>
+   </property>
+   <property name="text">
+    <string>TEST</string>
+   </property>
+  </widget>
  </widget>
  <resources/>
  <connections>

+ 33 - 4
client.cpp

@@ -80,10 +80,10 @@ void Client::handleMessages() {
             emit Client::messageReceived(COMMANDS_UPDATE_TYPE, "", s_v);
         } else if (serverWaitingForFile(data_string.c_str())) {
             sendFileEncoded(outgoing_file);
-//        } else if (isEvent(data_string.c_str())) {
-            // get event
-            // get args
-            // Main window should have an events container
+        } else if (isEvent(data_string.c_str())) {
+            QString event = getEvent(data_string.c_str());
+            QVector<QString> args = getArgs(data_string.c_str());
+            emit Client::messageReceived(EVENT_UPDATE_TYPE, event, args);
         }
         std::string formatted_json = getJsonString(data_string);
         emit Client::messageReceived(MESSAGE_UPDATE_TYPE, QString::fromUtf8(formatted_json.data(), formatted_json.size()), {});
@@ -266,6 +266,25 @@ void Client::setSelectedApp(std::vector<QString> app_names) {
     }
 }
 
+int Client::getSelectedApp() {
+    if (selected_commands.size() == 1) {
+        return selected_commands.at(0);
+    } else {
+        QMessageBox::warning(this, tr("App Selection Error"), tr("Unable to retrieve app selection"));
+    }
+    return -1;
+}
+
+QString Client::getAppName(int mask) {
+    auto app = m_commands.find(mask);
+    if (app != m_commands.end()) {
+        return QString{app->second.c_str()};
+    }
+    return QString{""};
+}
+
+
+
 void Client::execute() {
     if (!selected_commands.empty()) {
         executing = true;
@@ -276,6 +295,16 @@ void Client::execute() {
     }
 }
 
+void Client::scheduleTask(std::vector<std::string> task_args) {
+    qDebug() << "Requesting a task to be scheduled";
+//    auto datetime = task_args.at(1);
+    std::string operation_string = createOperation("Schedule", task_args);
+//    qDebug() << "Operation string: " << operation_string.c_str();
+//    std::string message = createMessage(operation_string.c_str(), "");
+//    auto operation_string = createOperation("blah", {});
+    sendEncoded(operation_string);
+}
+
 void Client::sendFile(QByteArray bytes) {
     if (outgoing_file.isNull()) {
         std::string send_file_operation = createOperation("FileUpload", {});

+ 13 - 2
client.hpp

@@ -1,4 +1,7 @@
-#include <QDialog>
+#ifndef __CLIENT_HPP__
+#define __CLIENT_HPP__
+
+#include <QDialog>
 #include <QComboBox>
 #include <QPushButton>
 #include <QMessageBox>
@@ -15,10 +18,12 @@
 
 static constexpr int MESSAGE_UPDATE_TYPE = 1;
 static constexpr int COMMANDS_UPDATE_TYPE = 2;
+static constexpr int EVENT_UPDATE_TYPE = 3;
 
 typedef std::map<int, std::string> CommandMap;
 typedef std::map<int, std::vector<std::string>> CommandArgMap;
 typedef QVector<QString> StringVec;
+
 Q_DECLARE_METATYPE(StringVec)
 
 class Client : public QDialog
@@ -44,6 +49,10 @@ public:
     void start();
     void closeConnection();
     void execute();
+    QString getAppName(int mask);
+    int getSelectedApp();
+    // Move this to private after moving responsibilities to Client
+    void scheduleTask(std::vector<std::string> task_args);
     MessageHandler createMessageHandler(std::function<void()> cb);
 
 public slots:
@@ -54,7 +63,8 @@ public slots:
     void sendFile(QByteArray bytes);
 
 signals:
-    void messageReceived(int t, QString s,QVector<QString> args);
+    void messageReceived(int t, QString s, QVector<QString> args);
+    void eventReceived(int t, std::string event, StringVec args);
 
 private:
     void handleMessages();
@@ -68,3 +78,4 @@ private:
     std::vector<int> selected_commands;
     QByteArray outgoing_file;
 };
+#endif // __CLIENT_HPP__

+ 33 - 3
headers/util.hpp

@@ -1,11 +1,12 @@
-#ifndef __UTIL_HPP__
-#define __UTIL_HPP__
+#ifndef UTIL_HPP
+#define UTIL_HPP
 
 #include <string>
 #include <charconv>
 #include <utility>
 #include <vector>
 #include <QDebug>
+#include <QVector>
 #include "rapidjson/writer.h"
 #include "rapidjson/prettywriter.h"
 #include "rapidjson/pointer.h"
@@ -58,9 +59,16 @@ bool isOperation(const char* data) {
     return strcmp(d["type"].GetString(), "operation") == 0;
 }
 
+
+bool isEvent(const char* data) {
+    Document d;
+    d.Parse(data);
+    return strcmp(d["type"].GetString(), "event") == 0;
+}
+
 std::string createOperation(const char* op, std::vector<std::string> args) {
     StringBuffer s;
-    Writer<StringBuffer> w(s);
+    Writer<StringBuffer, Document::EncodingType, ASCII<>> w(s);
     w.StartObject();
     w.Key("type");
     w.String("operation");
@@ -87,6 +95,28 @@ std::string getOperation(const char* data) {
     return "";
 }
 
+QString getEvent(const char* data) {
+    Document d;
+    d.Parse(data);
+    if (d.HasMember("event")) {
+        return d["event"].GetString();
+    }
+    return "";
+}
+
+QVector<QString> getArgs(const char* data) {
+    Document d;
+    d.Parse(data);
+    QVector<QString> args{};
+    if (d.HasMember("args")) {
+        for (const auto& m : d["args"].GetArray()) {
+            args.push_back(m.GetString());
+        }
+    }
+    return args;
+}
+
+
 CommandMap getArgMap(const char* data) {
     Document d;
     d.Parse(data);

+ 277 - 2
ky_gui.pro.user

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 4.11.0, 2019-12-31T23:52:29. -->
+<!-- Written by QtCreator 4.11.0, 2020-01-05T16:02:29. -->
 <qtcreator>
  <data>
   <variable>EnvironmentId</variable>
@@ -350,9 +350,284 @@
    <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
   </valuemap>
  </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.1</variable>
+  <valuemap type="QVariantMap">
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Android custom</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Android custom</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5b81f117-6675-4c8b-85c8-b22939db6e38}</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/data/c/build-ky_gui-android_custom-Debug</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/data/c/build-ky_gui-android_custom-Release</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/data/c/build-ky_gui-android_custom-Profile</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
+      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">true</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
+      <value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DeviceCheckBuildStep</value>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.CheckForFreeDiskSpaceStep</value>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
+      <value type="QString" key="RemoteLinux.CheckForFreeDiskSpaceStep.PathToCheck">/</value>
+      <value type="qlonglong" key="RemoteLinux.CheckForFreeDiskSpaceStep.RequiredSpace">5242880</value>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.2">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">RemoteLinux.DirectUploadStep</value>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedFiles"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedHosts"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedRemotePaths"/>
+      <valuelist type="QVariantList" key="ProjectExplorer.RunConfiguration.LastDeployedSysroots"/>
+      <value type="bool" key="RemoteLinux.GenericDirectUploadStep.IgnoreMissingFiles">false</value>
+      <value type="bool" key="RemoteLinux.GenericDirectUploadStep.Incremental">true</value>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedLocalTimes"/>
+      <valuelist type="QVariantList" key="RemoteLinux.LastDeployedRemoteTimes"/>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">3</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.QNX.QNXDeployConfiguration</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+    <value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
+    <valuelist type="QVariantList" key="Analyzer.Perf.Events">
+     <value type="QString">cpu-cycles</value>
+    </valuelist>
+    <valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
+    <value type="int" key="Analyzer.Perf.Frequency">250</value>
+    <valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
+     <value type="QString">-e</value>
+     <value type="QString">cpu-cycles</value>
+     <value type="QString">--call-graph</value>
+     <value type="QString">dwarf,4096</value>
+     <value type="QString">-F</value>
+     <value type="QString">250</value>
+    </valuelist>
+    <value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
+    <value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
+    <value type="int" key="Analyzer.Perf.StackSize">4096</value>
+    <value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
+    <value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
+    <value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
+    <value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
+    <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
+    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
+    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
+    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
+    <value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
+    <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
+    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
+    <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
+    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
+    <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
+    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
+    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
+    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
+     <value type="int">0</value>
+     <value type="int">1</value>
+     <value type="int">2</value>
+     <value type="int">3</value>
+     <value type="int">4</value>
+     <value type="int">5</value>
+     <value type="int">6</value>
+     <value type="int">7</value>
+     <value type="int">8</value>
+     <value type="int">9</value>
+     <value type="int">10</value>
+     <value type="int">11</value>
+     <value type="int">12</value>
+     <value type="int">13</value>
+     <value type="int">14</value>
+    </valuelist>
+    <value type="int" key="PE.EnvironmentAspect.Base">1</value>
+    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">ky_gui2</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.QNX.QNXRunConfiguration./data/c/ky_gui/ky_gui.pro</value>
+    <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/data/c/ky_gui/ky_gui.pro</value>
+    <value type="QString" key="Qt4ProjectManager.QnxRunConfiguration.QtLibPath"></value>
+    <value type="int" key="RemoteLinux.EnvironmentAspect.Version">1</value>
+    <value type="QString" key="RemoteLinux.RunConfig.AlternateRemoteExecutable"></value>
+    <value type="bool" key="RemoteLinux.RunConfig.UseAlternateRemoteExecutable">false</value>
+    <value type="QString" key="RunConfiguration.Arguments"></value>
+    <value type="bool" key="RunConfiguration.Arguments.multi">false</value>
+    <value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
+    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory"></value>
+    <value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+  </valuemap>
+ </data>
  <data>
   <variable>ProjectExplorer.Project.TargetCount</variable>
-  <value type="int">1</value>
+  <value type="int">2</value>
  </data>
  <data>
   <variable>ProjectExplorer.Project.Updater.FileVersion</variable>

+ 36 - 6
mainwindow.cpp

@@ -5,6 +5,7 @@
 #include <QTextStream>
 #include <QString>
 #include <QLayout>
+#include <QDateTime>
 #include <vector>
 
 /**
@@ -30,6 +31,7 @@ MainWindow::MainWindow(int argc, char** argv, QWidget *parent) :
  */
 MainWindow::~MainWindow()
 {
+    delete q_client;
     delete ui;
 }
 
@@ -39,7 +41,7 @@ MainWindow::~MainWindow()
 void MainWindow::connectClient() {
     qDebug() << "Connecting to KServer";
 
-    Client* q_client = new Client(this, cli_argc, cli_argv);
+    q_client = new Client(this, cli_argc, cli_argv);
     QObject::connect(q_client, &Client::messageReceived, this, &MainWindow::updateMessages);
 
     QProgressBar* progressBar = ui->progressBar;
@@ -54,26 +56,26 @@ void MainWindow::connectClient() {
 
     QPushButton* send_message_button = this->findChild<QPushButton*>("sendMessage");
     // Handle mouse
-    QObject::connect(send_message_button, &QPushButton::clicked, this, [q_client, send_message_box]() {
+    QObject::connect(send_message_button, &QPushButton::clicked, this, [this, send_message_box]() {
         q_client->sendMessage(send_message_box->toPlainText());
         send_message_box->clear();
     });
 
-    QObject::connect(ui->appList,  static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this, q_client]() {
+    QObject::connect(ui->appList,  static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]() {
         QString app_name = ui->appList->currentText();
         // TODO: I know, it's awful. Fix this
         q_client->setSelectedApp(std::vector<QString>{{app_name}});
 
     });
     QPushButton* disconnect_button = this->findChild<QPushButton*>("disconnect");
-    QObject::connect(disconnect_button, &QPushButton::clicked, this, [this, q_client, progressBar]() {
+    QObject::connect(disconnect_button, &QPushButton::clicked, this, [this, progressBar]() {
         q_client->closeConnection();
         progressBar->setValue(0);
         ui->appList->clear();
         ui->messages->clear();
     });
 
-    QObject::connect(ui->execute, &QPushButton::clicked, this, [this, q_client]() {
+    QObject::connect(ui->execute, &QPushButton::clicked, this, [this]() {
         q_client->execute();
     });
 
@@ -85,10 +87,28 @@ void MainWindow::connectClient() {
         }
     });
 
-    QObject::connect(arg_ui, &ArgDialog::uploadFile, this, [q_client](QByteArray bytes) {
+    QObject::connect(arg_ui, &ArgDialog::uploadFile, this, [this](QByteArray bytes) {
         q_client->sendFile(bytes);
     });
 
+    QObject::connect(arg_ui, &ArgDialog::taskRequestReady, this, [this](Task task) {
+        // TODO: Maybe this should be handled by the Client class directly
+        auto mask = q_client->getSelectedApp();
+        if (mask > -1) {
+            if (q_client->getAppName(mask) == "Instagram") {
+                auto datetime = QDateTime::fromString(task.args.at(1).c_str());
+                auto current_datetime = QDateTime::currentDateTime();
+                auto seconds_diff = current_datetime.secsTo(datetime);
+                qDebug() << "Time difference: " << seconds_diff;
+                if (seconds_diff > 3600) {
+                    qDebug() << "Scheduling a task";
+                    task.args.push_back(std::to_string(mask));
+                    q_client->scheduleTask(task.args);
+                }
+            }
+        }
+    });
+
     // TODO: Handle enter key
     //    QObject::connect(send_message_box, &QTextEdit::keyReleaseEvent, this, [q_client, send_message_box]() {
     //        q_client->sendMessage(send_message_box->toPlainText());
@@ -113,6 +133,16 @@ void MainWindow::updateMessages(int t, const QString& message, StringVec v) {
         }
         //TODO: We do this because a CommandLinkButton turns transparent by default, except when hovered or checked
         ui->connect->setChecked(true);
+    } else if(t == EVENT_UPDATE_TYPE) {
+        auto mask = v.at(0);
+        auto event_message = q_client->getAppName(std::stoi(mask.toUtf8().constData()));
+        event_message += ": ";
+        event_message += v.at(1);
+        m_events.push_front(event_message);
+        ui->eventList->clear();
+        for (const auto& i : m_events) {
+            ui->eventList->addItem(i);
+        }
     } else {
         qDebug() << "Unknown update type. Cannot update UI";
     }

+ 2 - 0
mainwindow.h

@@ -28,6 +28,8 @@ private:
     void runApp();
     int cli_argc;
     char** cli_argv;
+    Client* q_client;
+    QList<QString> m_events;
 
 private slots:
     void connectClient();

+ 126 - 119
mainwindow.ui

@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>640</width>
-    <height>757</height>
+    <height>837</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -19,12 +19,13 @@
   </property>
   <property name="styleSheet">
    <string notr="true">font: 87 10pt &quot;Noto Sans&quot;;
-background-color: rgb(56, 56, 0);</string>
+background-color: rgb(255, 85, 0);
+</string>
   </property>
   <widget class="QWidget" name="centralWidget">
    <property name="styleSheet">
     <string notr="true">border-color: rgb(0, 0, 0);
-background-color: rgb(77, 77, 0);</string>
+background-color: rgb(255, 255, 255);</string>
    </property>
    <widget class="QLabel" name="label">
     <property name="geometry">
@@ -51,12 +52,12 @@ background-color: rgb(77, 77, 0);</string>
       <x>50</x>
       <y>60</y>
       <width>541</width>
-      <height>621</height>
+      <height>702</height>
      </rect>
     </property>
-    <layout class="QVBoxLayout" name="verticalLayout" stretch="6,3">
+    <layout class="QVBoxLayout" name="verticalLayout" stretch="6,0,0,3,0">
      <item>
-      <layout class="QGridLayout" name="gridLayout_2" rowstretch="5,0,0" columnstretch="0,0">
+      <layout class="QGridLayout" name="gridLayout_2" rowstretch="5" columnstretch="0,0">
        <property name="sizeConstraint">
         <enum>QLayout::SetNoConstraint</enum>
        </property>
@@ -66,66 +67,54 @@ background-color: rgb(77, 77, 0);</string>
        <item row="0" column="0">
         <layout class="QVBoxLayout" name="verticalLayout_2">
          <item>
-          <widget class="QLabel" name="messagesTitle">
+          <widget class="QPushButton" name="connect">
            <property name="styleSheet">
-            <string notr="true">font: 100 11pt &quot;Noto Sans&quot;;
-color: rgb(251,251, 251);</string>
+            <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 0, 0);
+background-color: rgb(94, 79, 255);
+</string>
            </property>
            <property name="text">
-            <string>Messages</string>
+            <string>Connect</string>
+           </property>
+           <property name="icon">
+            <iconset resource="kres.qrc">
+             <normaloff>:/icons/icons/start.png</normaloff>:/icons/icons/start.png</iconset>
            </property>
           </widget>
          </item>
          <item>
-          <widget class="QTextEdit" name="messages">
-           <property name="toolTip">
-            <string>Messages</string>
+          <widget class="QLabel" name="selectProcessTitle">
+           <property name="styleSheet">
+            <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 0, 0);</string>
            </property>
-           <property name="toolTipDuration">
-            <number>1</number>
+           <property name="text">
+            <string>Select process to execute</string>
            </property>
-           <property name="autoFillBackground">
+           <property name="scaledContents">
             <bool>false</bool>
            </property>
-           <property name="styleSheet">
-            <string notr="true">background-color: rgb(255, 255, 255);
-color: rgb(5, 5, 5);
-font: 87 10pt &quot;Noto Sans&quot;;</string>
-           </property>
-           <property name="lineWrapMode">
-            <enum>QTextEdit::WidgetWidth</enum>
-           </property>
-           <property name="readOnly">
-            <bool>true</bool>
+           <property name="alignment">
+            <set>Qt::AlignCenter</set>
            </property>
-           <property name="placeholderText">
-            <string/>
+           <property name="margin">
+            <number>0</number>
            </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item row="0" column="1">
-        <layout class="QGridLayout" name="gridLayout" rowstretch="1,0,0,0,0,0,0,0,0,0">
-         <item row="7" column="0">
-          <widget class="QListWidget" name="eventList">
-           <property name="styleSheet">
-            <string notr="true">background-color: rgb(255, 255, 255);
-color: rgb(5, 5, 5);
-font: 87 10pt &quot;Noto Sans&quot;;</string>
+           <property name="indent">
+            <number>-1</number>
            </property>
           </widget>
          </item>
-         <item row="3" column="0">
-          <widget class="QListWidget" name="processList">
+         <item>
+          <widget class="QComboBox" name="appList">
            <property name="styleSheet">
-            <string notr="true">background-color: rgb(255, 255, 255);
-color: rgb(5, 5, 5);
-font: 87 10pt &quot;Noto Sans&quot;;</string>
+            <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 0, 0);</string>
            </property>
           </widget>
          </item>
-         <item row="5" column="0">
+         <item>
           <layout class="QHBoxLayout" name="horizontalLayout_2">
            <property name="spacing">
             <number>6</number>
@@ -168,34 +157,37 @@ color: rgb(0, 0, 0);</string>
            </item>
           </layout>
          </item>
-         <item row="0" column="0">
-          <widget class="QLabel" name="selectProcessTitle">
+         <item>
+          <widget class="QLabel" name="eventListTitle">
            <property name="styleSheet">
-            <string notr="true">font: 100 11pt &quot;Noto Sans&quot;;
-color: rgb(251,251, 251);</string>
+            <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 0, 0);</string>
            </property>
            <property name="text">
-            <string>Select process to execute</string>
-           </property>
-           <property name="scaledContents">
-            <bool>false</bool>
+            <string>Events</string>
            </property>
-           <property name="alignment">
-            <set>Qt::AlignCenter</set>
+          </widget>
+         </item>
+         <item>
+          <widget class="QListWidget" name="eventList">
+           <property name="styleSheet">
+            <string notr="true">background-color: rgb(177, 177, 177);
+color: rgb(5, 5, 5);
+font: 87 10pt &quot;Noto Sans&quot;;</string>
            </property>
-           <property name="margin">
-            <number>0</number>
+           <property name="alternatingRowColors">
+            <bool>true</bool>
            </property>
-           <property name="indent">
-            <number>-1</number>
+           <property name="isWrapping" stdset="0">
+            <bool>true</bool>
            </property>
           </widget>
          </item>
-         <item row="2" column="0">
+         <item>
           <widget class="QLabel" name="processListTitle">
            <property name="styleSheet">
-            <string notr="true">font: 100 11pt &quot;Noto Sans&quot;;
-color: rgb(251,251, 251);</string>
+            <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 0, 0);</string>
            </property>
            <property name="text">
             <string>Processes</string>
@@ -205,69 +197,62 @@ color: rgb(251,251, 251);</string>
            </property>
           </widget>
          </item>
-         <item row="1" column="0">
-          <widget class="QComboBox" name="appList">
-           <property name="styleSheet">
-            <string notr="true">color: rgb(0, 0, 0);</string>
-           </property>
-          </widget>
-         </item>
-         <item row="8" column="0">
-          <widget class="QPushButton" name="connect">
-           <property name="styleSheet">
-            <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
-color: rgb(0, 0, 0);
-background-color: rgb(94, 79, 255);
-</string>
-           </property>
-           <property name="text">
-            <string>Connect</string>
-           </property>
-           <property name="icon">
-            <iconset resource="kres.qrc">
-             <normaloff>:/icons/icons/start.png</normaloff>:/icons/icons/start.png</iconset>
-           </property>
-          </widget>
-         </item>
-         <item row="9" column="0">
-          <widget class="QPushButton" name="disconnect">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="styleSheet">
-            <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
-color: rgb(0, 0, 0);
-background-color: rgb(255, 65, 68);</string>
-           </property>
-           <property name="text">
-            <string>Disconnect</string>
-           </property>
-           <property name="icon">
-            <iconset resource="kres.qrc">
-             <normaloff>:/icons/disconnect.png</normaloff>:/icons/disconnect.png</iconset>
-           </property>
-          </widget>
-         </item>
-         <item row="6" column="0">
-          <widget class="QLabel" name="eventListTitle">
+         <item>
+          <widget class="QListWidget" name="processList">
            <property name="styleSheet">
-            <string notr="true">font: 100 11pt &quot;Noto Sans&quot;;
-color: rgb(251,251, 251);</string>
-           </property>
-           <property name="text">
-            <string>Events</string>
+            <string notr="true">background-color: rgb(177, 177, 177);
+color: rgb(5, 5, 5);
+font: 87 10pt &quot;Noto Sans&quot;;</string>
            </property>
           </widget>
          </item>
         </layout>
        </item>
+       <item row="0" column="1">
+        <layout class="QGridLayout" name="gridLayout" rowstretch="1,0,0,0,0,0,0,0,0,0,0,0"/>
+       </item>
       </layout>
      </item>
      <item>
-      <layout class="QGridLayout" name="gridLayout_3" rowstretch="0,0,0,0" columnstretch="0,0">
+      <widget class="QLabel" name="messagesTitle">
+       <property name="styleSheet">
+        <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 0, 0);</string>
+       </property>
+       <property name="text">
+        <string>Messages</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QTextEdit" name="messages">
+       <property name="toolTip">
+        <string>Messages</string>
+       </property>
+       <property name="toolTipDuration">
+        <number>1</number>
+       </property>
+       <property name="autoFillBackground">
+        <bool>false</bool>
+       </property>
+       <property name="styleSheet">
+        <string notr="true">background-color: rgb(255, 255, 255);
+color: rgb(5, 5, 5);
+font: 87 10pt &quot;Noto Sans&quot;;</string>
+       </property>
+       <property name="lineWrapMode">
+        <enum>QTextEdit::WidgetWidth</enum>
+       </property>
+       <property name="readOnly">
+        <bool>true</bool>
+       </property>
+       <property name="placeholderText">
+        <string/>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <layout class="QGridLayout" name="gridLayout_3" rowstretch="0,0,0,0" columnstretch="0">
        <property name="sizeConstraint">
         <enum>QLayout::SetMinimumSize</enum>
        </property>
@@ -358,8 +343,8 @@ font: 87 10pt &quot;Noto Sans&quot;;</string>
        <item row="0" column="0">
         <widget class="QLabel" name="inputTitle">
          <property name="styleSheet">
-          <string notr="true">font: 100 11pt &quot;Noto Sans&quot;;
-color: rgb(251,251, 251);</string>
+          <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 0, 0);</string>
          </property>
          <property name="text">
           <string>Input</string>
@@ -368,6 +353,28 @@ color: rgb(251,251, 251);</string>
        </item>
       </layout>
      </item>
+     <item>
+      <widget class="QPushButton" name="disconnect">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="styleSheet">
+        <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 0, 0);
+background-color: rgb(255, 65, 68);</string>
+       </property>
+       <property name="text">
+        <string>Disconnect</string>
+       </property>
+       <property name="icon">
+        <iconset resource="kres.qrc">
+         <normaloff>:/icons/disconnect.png</normaloff>:/icons/disconnect.png</iconset>
+       </property>
+      </widget>
+     </item>
     </layout>
    </widget>
   </widget>

+ 27 - 29
ui_argdialog.h

@@ -12,12 +12,12 @@
 #include <QtCore/QVariant>
 #include <QtGui/QIcon>
 #include <QtWidgets/QApplication>
+#include <QtWidgets/QComboBox>
 #include <QtWidgets/QDateTimeEdit>
 #include <QtWidgets/QDialog>
 #include <QtWidgets/QDialogButtonBox>
 #include <QtWidgets/QHeaderView>
 #include <QtWidgets/QLabel>
-#include <QtWidgets/QListWidget>
 #include <QtWidgets/QPushButton>
 #include <QtWidgets/QTableWidget>
 #include <QtWidgets/QTextEdit>
@@ -33,13 +33,14 @@ public:
     QPushButton *addFile;
     QLabel *label;
     QTableWidget *argList;
-    QListWidget *argType;
     QLabel *label_2;
     QLabel *label_3;
     QLabel *label_4;
     QTextEdit *argInput;
     QLabel *label_5;
     QDateTimeEdit *dateTime;
+    QComboBox *argType;
+    QPushButton *devTestButton;
 
     void setupUi(QDialog *ArgDialog)
     {
@@ -97,18 +98,6 @@ public:
         argList->horizontalHeader()->setDefaultSectionSize(200);
         argList->verticalHeader()->setMinimumSectionSize(100);
         argList->verticalHeader()->setDefaultSectionSize(100);
-        argType = new QListWidget(ArgDialog);
-        new QListWidgetItem(argType);
-        new QListWidgetItem(argType);
-        new QListWidgetItem(argType);
-        new QListWidgetItem(argType);
-        new QListWidgetItem(argType);
-        argType->setObjectName(QString::fromUtf8("argType"));
-        argType->setGeometry(QRect(190, 80, 81, 41));
-        argType->setStyleSheet(QString::fromUtf8("background-color: rgb(255, 255, 255);\n"
-"color: rgb(5, 5, 5);\n"
-"font: 87 10pt \"Noto Sans\";\n"
-"selection-background-color: rgb(255, 0, 174);"));
         label_2 = new QLabel(ArgDialog);
         label_2->setObjectName(QString::fromUtf8("label_2"));
         label_2->setGeometry(QRect(130, 80, 58, 18));
@@ -130,6 +119,23 @@ public:
         dateTime = new QDateTimeEdit(ArgDialog);
         dateTime->setObjectName(QString::fromUtf8("dateTime"));
         dateTime->setGeometry(QRect(200, 260, 194, 27));
+        argType = new QComboBox(ArgDialog);
+        argType->addItem(QString());
+        argType->addItem(QString());
+        argType->addItem(QString());
+        argType->addItem(QString());
+        argType->addItem(QString());
+        argType->setObjectName(QString::fromUtf8("argType"));
+        argType->setGeometry(QRect(190, 80, 141, 31));
+        argType->setStyleSheet(QString::fromUtf8("background-color: rgb(255, 255, 255);\n"
+"color: rgb(5, 5, 5);\n"
+"font: 87 10pt \"Noto Sans\";\n"
+"selection-background-color: rgb(255, 0, 174);"));
+        devTestButton = new QPushButton(ArgDialog);
+        devTestButton->setObjectName(QString::fromUtf8("devTestButton"));
+        devTestButton->setGeometry(QRect(240, 590, 80, 26));
+        devTestButton->setStyleSheet(QString::fromUtf8("background-color: rgb(59, 255, 0);\n"
+"color: rgb(0, 0, 0);"));
 
         retranslateUi(ArgDialog);
         QObject::connect(argCommandButtons, SIGNAL(accepted()), ArgDialog, SLOT(accept()));
@@ -145,25 +151,17 @@ public:
         argDialogTitle->setText(QCoreApplication::translate("ArgDialog", "Add Arguments", nullptr));
         addFile->setText(QCoreApplication::translate("ArgDialog", "File", nullptr));
         label->setText(QCoreApplication::translate("ArgDialog", "Items to send", nullptr));
-
-        const bool __sortingEnabled = argType->isSortingEnabled();
-        argType->setSortingEnabled(false);
-        QListWidgetItem *___qlistwidgetitem = argType->item(0);
-        ___qlistwidgetitem->setText(QCoreApplication::translate("ArgDialog", "description", nullptr));
-        QListWidgetItem *___qlistwidgetitem1 = argType->item(1);
-        ___qlistwidgetitem1->setText(QCoreApplication::translate("ArgDialog", "hashtag", nullptr));
-        QListWidgetItem *___qlistwidgetitem2 = argType->item(2);
-        ___qlistwidgetitem2->setText(QCoreApplication::translate("ArgDialog", "link/bio", nullptr));
-        QListWidgetItem *___qlistwidgetitem3 = argType->item(3);
-        ___qlistwidgetitem3->setText(QCoreApplication::translate("ArgDialog", "promote/share", nullptr));
-        QListWidgetItem *___qlistwidgetitem4 = argType->item(4);
-        ___qlistwidgetitem4->setText(QCoreApplication::translate("ArgDialog", "requested by", nullptr));
-        argType->setSortingEnabled(__sortingEnabled);
-
         label_2->setText(QCoreApplication::translate("ArgDialog", "Type", nullptr));
         label_3->setText(QCoreApplication::translate("ArgDialog", "Input", nullptr));
         label_4->setText(QCoreApplication::translate("ArgDialog", "Attachment", nullptr));
         label_5->setText(QCoreApplication::translate("ArgDialog", "Time", nullptr));
+        argType->setItemText(0, QCoreApplication::translate("ArgDialog", "description", nullptr));
+        argType->setItemText(1, QCoreApplication::translate("ArgDialog", "hashtag", nullptr));
+        argType->setItemText(2, QCoreApplication::translate("ArgDialog", "requested by", nullptr));
+        argType->setItemText(3, QCoreApplication::translate("ArgDialog", "promote/share", nullptr));
+        argType->setItemText(4, QCoreApplication::translate("ArgDialog", "link/bio", nullptr));
+
+        devTestButton->setText(QCoreApplication::translate("ArgDialog", "TEST", nullptr));
     } // retranslateUi
 
 };