Selaa lähdekoodia

Merge pull request #2 from adventurist/multiFileKdaemon

Multifile and KDaemon styling
Emmanuel Buckshi 5 vuotta sitten
vanhempi
commit
6dec68377b
19 muutettua tiedostoa jossa 1585 lisäystä ja 831 poistoa
  1. 1 0
      .gitignore
  2. 430 290
      argdialog.ui
  3. 3 1
      headers/instatask.fbs
  4. 42 16
      headers/instatask_generated.h
  5. 40 20
      headers/util.hpp
  6. BIN
      icons/quit.png
  7. 18 12
      include/argdialog.h
  8. 18 5
      include/client.hpp
  9. 18 9
      include/mainwindow.h
  10. 2 1
      kres.qrc
  11. 3 3
      ky_gui.pro.user
  12. 404 248
      mainwindow.ui
  13. 109 21
      src/argdialog.cpp
  14. 136 51
      src/client.cpp
  15. 8 2
      src/main.cpp
  16. 38 34
      src/mainwindow.cpp
  17. 13 0
      style/style.css
  18. 0 12
      style/style.qss
  19. 302 106
      ui_argdialog.h

+ 1 - 0
.gitignore

@@ -8,3 +8,4 @@ Makefile
 *.stash
 qrc_kres.*
 **/*.jpg
+assets

+ 430 - 290
argdialog.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>608</width>
-    <height>710</height>
+    <width>1366</width>
+    <height>671</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -21,323 +21,463 @@
    <string notr="true">border-color: rgb(0, 0, 0);
 background-color: rgb(0, 43, 54);</string>
   </property>
-  <widget class="QDialogButtonBox" name="argCommandButtons">
+  <widget class="QWidget" name="verticalLayoutWidget">
    <property name="geometry">
     <rect>
-     <x>330</x>
-     <y>510</y>
-     <width>211</width>
-     <height>32</height>
+     <x>10</x>
+     <y>10</y>
+     <width>701</width>
+     <height>591</height>
     </rect>
    </property>
-   <property name="sizePolicy">
-    <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-     <horstretch>0</horstretch>
-     <verstretch>0</verstretch>
-    </sizepolicy>
-   </property>
-   <property name="layoutDirection">
-    <enum>Qt::LeftToRight</enum>
-   </property>
-   <property name="autoFillBackground">
-    <bool>false</bool>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">background-color: rgb(255, 85, 0);
+   <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,1,0,0,0,0">
+    <item>
+     <widget class="QLabel" name="argDialogTitle">
+      <property name="font">
+       <font>
+        <pointsize>22</pointsize>
+        <weight>75</weight>
+        <bold>true</bold>
+       </font>
+      </property>
+      <property name="styleSheet">
+       <string notr="true">color: rgb(170, 0, 255);
+color:  rgb(255, 85, 0);
+ qproperty-alignment: 'AlignHCenter';
+</string>
+      </property>
+      <property name="text">
+       <string>Add Arguments</string>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <widget class="QLabel" name="label_2">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+          <horstretch>2</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>108</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
+color: rgb(131, 148, 150);
+font-weight: 700;</string>
+        </property>
+        <property name="text">
+         <string>Type</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="argType">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
+background-color: #2f535f;
+color: rgb(131, 148, 150);
+font-weight: 700;
+</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>
+      </item>
+     </layout>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout_2">
+      <item>
+       <widget class="QLabel" name="label_3">
+        <property name="minimumSize">
+         <size>
+          <width>108</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
+color: rgb(131, 148, 150);
+font-weight: 700;
+ qproperty-alignment: 'AlignVLeft';</string>
+        </property>
+        <property name="text">
+         <string>Input</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QTextEdit" name="argInput">
+        <property name="styleSheet">
+         <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
+background-color: #2f535f;
+color: rgb(131, 148, 150);
+font-weight: 700;
+</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+    <item>
+     <widget class="QPushButton" name="addArgument">
+      <property name="styleSheet">
+       <string notr="true">background-color: rgb(255, 85, 0);
 font: 87 11pt &quot;Noto Sans&quot;;
 color: rgb(0, 43, 54);
 font-weight: 700;
+padding: 4px;
+border-style: outset;
+border-width: 2px;
+border-radius: 4px;
+border-color: #00000f;
+min-width: 4em;
 padding: 4px;</string>
-   </property>
-   <property name="orientation">
-    <enum>Qt::Horizontal</enum>
-   </property>
-   <property name="standardButtons">
-    <set>QDialogButtonBox::Cancel|QDialogButtonBox::Save</set>
-   </property>
-   <property name="centerButtons">
-    <bool>true</bool>
-   </property>
-  </widget>
-  <widget class="QPushButton" name="addArgument">
-   <property name="geometry">
-    <rect>
-     <x>380</x>
-     <y>190</y>
-     <width>80</width>
-     <height>26</height>
-    </rect>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">background-color: rgb(255, 85, 0);
+      </property>
+      <property name="text">
+       <string>Add</string>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout_3">
+      <item alignment="Qt::AlignVCenter">
+       <widget class="QLabel" name="label_4">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>196</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
+color: rgb(131, 148, 150);
+font-weight: 700;</string>
+        </property>
+        <property name="text">
+         <string>Add file attachment</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPushButton" name="addFile">
+        <property name="styleSheet">
+         <string notr="true">background-color: rgb(255, 85, 0);
 font: 87 11pt &quot;Noto Sans&quot;;
 color: rgb(0, 43, 54);
 font-weight: 700;
+padding: 4px;
+border-style: outset;
+border-width: 2px;
+border-radius: 4px;
+border-color: #00000f;
+min-width: 4em;
 padding: 4px;</string>
-   </property>
-   <property name="text">
-    <string>Add</string>
-   </property>
-  </widget>
-  <widget class="QLabel" name="argDialogTitle">
-   <property name="geometry">
-    <rect>
-     <x>210</x>
-     <y>10</y>
-     <width>231</width>
-     <height>51</height>
-    </rect>
-   </property>
-   <property name="font">
-    <font>
-     <pointsize>22</pointsize>
-     <weight>75</weight>
-     <bold>true</bold>
-    </font>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">color: rgb(170, 0, 255);</string>
-   </property>
-   <property name="text">
-    <string>Add Arguments</string>
-   </property>
-  </widget>
-  <widget class="QPushButton" name="addFile">
-   <property name="geometry">
-    <rect>
-     <x>190</x>
-     <y>220</y>
-     <width>80</width>
-     <height>26</height>
-    </rect>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">background-color: rgb(255, 85, 0);
+        </property>
+        <property name="text">
+         <string>Choose</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout_4">
+      <item alignment="Qt::AlignVCenter">
+       <widget class="QLabel" name="label_5">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>52</width>
+          <height>0</height>
+         </size>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
+color: rgb(131, 148, 150);
+font-weight: 700;
+ qproperty-alignment: 'AlignHCenter';</string>
+        </property>
+        <property name="text">
+         <string>Time</string>
+        </property>
+       </widget>
+      </item>
+      <item alignment="Qt::AlignRight">
+       <widget class="QDateTimeEdit" name="dateTime">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>380</width>
+          <height>38</height>
+         </size>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">background-color: #00000f;
+color: #2f535f;
+font-weight: 700;
+font-size: 16pt;</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout_5">
+      <item>
+       <widget class="QPushButton" name="devTestButton">
+        <property name="styleSheet">
+         <string notr="true">background-color: rgb(130, 255, 121);
+background-color: rgb(2, 180, 43);
+font: 87 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 0, 0);
+font-weight: 700;
+padding: 4px;
+border-style: outset;
+border-width: 2px;
+border-radius: 4px;
+border-color: #00000f;
+min-width: 4em;
+padding: 4px;</string>
+        </property>
+        <property name="text">
+         <string>DEV TEST</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QDialogButtonBox" name="argCommandButtons">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="layoutDirection">
+         <enum>Qt::LeftToRight</enum>
+        </property>
+        <property name="autoFillBackground">
+         <bool>false</bool>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">background-color: rgb(255, 85, 0);
 font: 87 11pt &quot;Noto Sans&quot;;
 color: rgb(0, 43, 54);
 font-weight: 700;
+padding: 4px;
+border-style: outset;
+border-width: 2px;
+border-radius: 4px;
+border-color: #00000f;
+min-width: 4em;
 padding: 4px;</string>
-   </property>
-   <property name="text">
-    <string>File</string>
-   </property>
+        </property>
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="standardButtons">
+         <set>QDialogButtonBox::Cancel|QDialogButtonBox::Save</set>
+        </property>
+        <property name="centerButtons">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+   </layout>
   </widget>
-  <widget class="QLabel" name="label">
+  <widget class="QWidget" name="verticalLayoutWidget_2">
    <property name="geometry">
     <rect>
-     <x>60</x>
-     <y>290</y>
-     <width>111</width>
-     <height>18</height>
-    </rect>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
-color: rgb(131, 148, 150);
-font-weight: 700;</string>
-   </property>
-   <property name="text">
-    <string>Items to send</string>
-   </property>
-  </widget>
-  <widget class="QTableWidget" name="argList">
-   <property name="geometry">
-    <rect>
-     <x>60</x>
-     <y>320</y>
-     <width>481</width>
-     <height>171</height>
+     <x>710</x>
+     <y>10</y>
+     <width>641</width>
+     <height>591</height>
     </rect>
    </property>
-   <property name="styleSheet">
-    <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
-background-color: rgb(7, 54, 66);
+   <layout class="QVBoxLayout" name="verticalLayout_2">
+    <item>
+     <widget class="QLabel" name="label">
+      <property name="styleSheet">
+       <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
 color: rgb(131, 148, 150);
 font-weight: 700;
-</string>
-   </property>
-   <property name="columnCount">
-    <number>2</number>
-   </property>
-   <attribute name="horizontalHeaderCascadingSectionResizes">
-    <bool>false</bool>
-   </attribute>
-   <attribute name="horizontalHeaderMinimumSectionSize">
-    <number>100</number>
-   </attribute>
-   <attribute name="horizontalHeaderDefaultSectionSize">
-    <number>200</number>
-   </attribute>
-   <attribute name="verticalHeaderMinimumSectionSize">
-    <number>100</number>
-   </attribute>
-   <attribute name="verticalHeaderDefaultSectionSize">
-    <number>100</number>
-   </attribute>
-   <column/>
-   <column/>
-  </widget>
-  <widget class="QLabel" name="label_2">
-   <property name="geometry">
-    <rect>
-     <x>130</x>
-     <y>80</y>
-     <width>58</width>
-     <height>18</height>
-    </rect>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
-color: rgb(131, 148, 150);
-font-weight: 700;</string>
-   </property>
-   <property name="text">
-    <string>Type</string>
-   </property>
-  </widget>
-  <widget class="QLabel" name="label_3">
-   <property name="geometry">
-    <rect>
-     <x>110</x>
-     <y>130</y>
-     <width>51</width>
-     <height>20</height>
-    </rect>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
-color: rgb(131, 148, 150);
-font-weight: 700;</string>
-   </property>
-   <property name="text">
-    <string>Input</string>
-   </property>
-  </widget>
-  <widget class="QLabel" name="label_4">
-   <property name="geometry">
-    <rect>
-     <x>60</x>
-     <y>220</y>
-     <width>101</width>
-     <height>20</height>
-    </rect>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
-color: rgb(131, 148, 150);
-font-weight: 700;</string>
-   </property>
-   <property name="text">
-    <string>Attachment</string>
-   </property>
-  </widget>
-  <widget class="QTextEdit" name="argInput">
-   <property name="geometry">
-    <rect>
-     <x>190</x>
-     <y>130</y>
-     <width>281</width>
-     <height>51</height>
-    </rect>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
-background-color: rgb(7, 54, 66);
+padding-left: 8px;</string>
+      </property>
+      <property name="text">
+       <string>Items to send</string>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout_6" stretch="0,0,0">
+      <item>
+       <spacer name="horizontalSpacer">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::Maximum</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>20</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QTableWidget" name="argList">
+        <property name="styleSheet">
+         <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
+background-color: #2f535f;
 color: rgb(131, 148, 150);
 font-weight: 700;
-</string>
-   </property>
-  </widget>
-  <widget class="QLabel" name="label_5">
-   <property name="geometry">
-    <rect>
-     <x>120</x>
-     <y>260</y>
-     <width>41</width>
-     <height>20</height>
-    </rect>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
-color: rgb(131, 148, 150);
-font-weight: 700;</string>
-   </property>
-   <property name="text">
-    <string>Time</string>
-   </property>
-  </widget>
-  <widget class="QDateTimeEdit" name="dateTime">
-   <property name="geometry">
-    <rect>
-     <x>200</x>
-     <y>260</y>
-     <width>194</width>
-     <height>27</height>
-    </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">font: 87 11pt &quot;Noto Sans&quot;;
-background-color: rgb(7, 54, 66);
-color: rgb(131, 148, 150);
+padding-left: 2px;</string>
+        </property>
+        <property name="showGrid">
+         <bool>true</bool>
+        </property>
+        <property name="columnCount">
+         <number>3</number>
+        </property>
+        <attribute name="horizontalHeaderCascadingSectionResizes">
+         <bool>false</bool>
+        </attribute>
+        <attribute name="horizontalHeaderMinimumSectionSize">
+         <number>100</number>
+        </attribute>
+        <attribute name="horizontalHeaderDefaultSectionSize">
+         <number>200</number>
+        </attribute>
+        <attribute name="verticalHeaderMinimumSectionSize">
+         <number>100</number>
+        </attribute>
+        <attribute name="verticalHeaderDefaultSectionSize">
+         <number>100</number>
+        </attribute>
+        <column/>
+        <column/>
+        <column/>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer_2">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::Maximum</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>20</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout_7">
+      <item>
+       <widget class="QPushButton" name="default_args">
+        <property name="styleSheet">
+         <string notr="true">background-color: rgb(255, 85, 0);
+font: 87 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 43, 54);
 font-weight: 700;
-</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>81</width>
-     <height>31</height>
-    </rect>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">background-color: rgb(130, 255, 121);
-background-color: rgb(2, 180, 43);
+padding: 4px;
+border-style: outset;
+border-width: 2px;
+border-radius: 4px;
+border-color: #00000f;
+min-width: 4em;
+padding: 4px;</string>
+        </property>
+        <property name="text">
+         <string>Default</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPushButton" name="clear">
+        <property name="styleSheet">
+         <string notr="true">background-color: rgb(255, 85, 0);
 font: 87 11pt &quot;Noto Sans&quot;;
-color: rgb(0, 0, 0);
+color: rgb(0, 43, 54);
 font-weight: 700;
+padding: 4px;
+border-style: outset;
+border-width: 2px;
+border-radius: 4px;
+border-color: #00000f;
+min-width: 4em;
 padding: 4px;</string>
-   </property>
-   <property name="text">
-    <string>TEST</string>
-   </property>
+        </property>
+        <property name="text">
+         <string>Clear</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+   </layout>
   </widget>
  </widget>
  <resources/>

+ 3 - 1
headers/instatask.fbs

@@ -2,7 +2,7 @@ namespace IGData;
 
 table IGTask {
   id: int;
-  filename: string;
+  file_info: string;
   time: string;
   description: string;
   hashtags: string;
@@ -10,7 +10,9 @@ table IGTask {
   requested_by_phrase: string;
   promote_share: string;
   link_bio: string;
+  is_video: bool;
   mask: int;
+  header: string;
 }
 
 root_type IGTask;

+ 42 - 16
headers/instatask_generated.h

@@ -13,7 +13,7 @@ struct IGTask;
 struct IGTask FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
     VT_ID = 4,
-    VT_FILENAME = 6,
+    VT_FILE_INFO = 6,
     VT_TIME = 8,
     VT_DESCRIPTION = 10,
     VT_HASHTAGS = 12,
@@ -21,13 +21,15 @@ struct IGTask FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
     VT_REQUESTED_BY_PHRASE = 16,
     VT_PROMOTE_SHARE = 18,
     VT_LINK_BIO = 20,
-    VT_MASK = 22
+    VT_IS_VIDEO = 22,
+    VT_MASK = 24,
+    VT_HEADER = 26
   };
   int32_t id() const {
     return GetField<int32_t>(VT_ID, 0);
   }
-  const flatbuffers::String *filename() const {
-    return GetPointer<const flatbuffers::String *>(VT_FILENAME);
+  const flatbuffers::String *file_info() const {
+    return GetPointer<const flatbuffers::String *>(VT_FILE_INFO);
   }
   const flatbuffers::String *time() const {
     return GetPointer<const flatbuffers::String *>(VT_TIME);
@@ -50,14 +52,20 @@ struct IGTask FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
   const flatbuffers::String *link_bio() const {
     return GetPointer<const flatbuffers::String *>(VT_LINK_BIO);
   }
+  bool is_video() const {
+    return GetField<uint8_t>(VT_IS_VIDEO, 0) != 0;
+  }
   int32_t mask() const {
     return GetField<int32_t>(VT_MASK, 0);
   }
+  const flatbuffers::String *header() const {
+    return GetPointer<const flatbuffers::String *>(VT_HEADER);
+  }
   bool Verify(flatbuffers::Verifier &verifier) const {
     return VerifyTableStart(verifier) &&
            VerifyField<int32_t>(verifier, VT_ID) &&
-           VerifyOffset(verifier, VT_FILENAME) &&
-           verifier.VerifyString(filename()) &&
+           VerifyOffset(verifier, VT_FILE_INFO) &&
+           verifier.VerifyString(file_info()) &&
            VerifyOffset(verifier, VT_TIME) &&
            verifier.VerifyString(time()) &&
            VerifyOffset(verifier, VT_DESCRIPTION) &&
@@ -72,7 +80,10 @@ struct IGTask FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
            verifier.VerifyString(promote_share()) &&
            VerifyOffset(verifier, VT_LINK_BIO) &&
            verifier.VerifyString(link_bio()) &&
+           VerifyField<uint8_t>(verifier, VT_IS_VIDEO) &&
            VerifyField<int32_t>(verifier, VT_MASK) &&
+           VerifyOffset(verifier, VT_HEADER) &&
+           verifier.VerifyString(header()) &&
            verifier.EndTable();
   }
 };
@@ -83,8 +94,8 @@ struct IGTaskBuilder {
   void add_id(int32_t id) {
     fbb_.AddElement<int32_t>(IGTask::VT_ID, id, 0);
   }
-  void add_filename(flatbuffers::Offset<flatbuffers::String> filename) {
-    fbb_.AddOffset(IGTask::VT_FILENAME, filename);
+  void add_file_info(flatbuffers::Offset<flatbuffers::String> file_info) {
+    fbb_.AddOffset(IGTask::VT_FILE_INFO, file_info);
   }
   void add_time(flatbuffers::Offset<flatbuffers::String> time) {
     fbb_.AddOffset(IGTask::VT_TIME, time);
@@ -107,9 +118,15 @@ struct IGTaskBuilder {
   void add_link_bio(flatbuffers::Offset<flatbuffers::String> link_bio) {
     fbb_.AddOffset(IGTask::VT_LINK_BIO, link_bio);
   }
+  void add_is_video(bool is_video) {
+    fbb_.AddElement<uint8_t>(IGTask::VT_IS_VIDEO, static_cast<uint8_t>(is_video), 0);
+  }
   void add_mask(int32_t mask) {
     fbb_.AddElement<int32_t>(IGTask::VT_MASK, mask, 0);
   }
+  void add_header(flatbuffers::Offset<flatbuffers::String> header) {
+    fbb_.AddOffset(IGTask::VT_HEADER, header);
+  }
   explicit IGTaskBuilder(flatbuffers::FlatBufferBuilder &_fbb)
         : fbb_(_fbb) {
     start_ = fbb_.StartTable();
@@ -125,7 +142,7 @@ struct IGTaskBuilder {
 inline flatbuffers::Offset<IGTask> CreateIGTask(
     flatbuffers::FlatBufferBuilder &_fbb,
     int32_t id = 0,
-    flatbuffers::Offset<flatbuffers::String> filename = 0,
+    flatbuffers::Offset<flatbuffers::String> file_info = 0,
     flatbuffers::Offset<flatbuffers::String> time = 0,
     flatbuffers::Offset<flatbuffers::String> description = 0,
     flatbuffers::Offset<flatbuffers::String> hashtags = 0,
@@ -133,8 +150,11 @@ inline flatbuffers::Offset<IGTask> CreateIGTask(
     flatbuffers::Offset<flatbuffers::String> requested_by_phrase = 0,
     flatbuffers::Offset<flatbuffers::String> promote_share = 0,
     flatbuffers::Offset<flatbuffers::String> link_bio = 0,
-    int32_t mask = 0) {
+    bool is_video = false,
+    int32_t mask = 0,
+    flatbuffers::Offset<flatbuffers::String> header = 0) {
   IGTaskBuilder builder_(_fbb);
+  builder_.add_header(header);
   builder_.add_mask(mask);
   builder_.add_link_bio(link_bio);
   builder_.add_promote_share(promote_share);
@@ -143,15 +163,16 @@ inline flatbuffers::Offset<IGTask> CreateIGTask(
   builder_.add_hashtags(hashtags);
   builder_.add_description(description);
   builder_.add_time(time);
-  builder_.add_filename(filename);
+  builder_.add_file_info(file_info);
   builder_.add_id(id);
+  builder_.add_is_video(is_video);
   return builder_.Finish();
 }
 
 inline flatbuffers::Offset<IGTask> CreateIGTaskDirect(
     flatbuffers::FlatBufferBuilder &_fbb,
     int32_t id = 0,
-    const char *filename = nullptr,
+    const char *file_info = nullptr,
     const char *time = nullptr,
     const char *description = nullptr,
     const char *hashtags = nullptr,
@@ -159,8 +180,10 @@ inline flatbuffers::Offset<IGTask> CreateIGTaskDirect(
     const char *requested_by_phrase = nullptr,
     const char *promote_share = nullptr,
     const char *link_bio = nullptr,
-    int32_t mask = 0) {
-  auto filename__ = filename ? _fbb.CreateString(filename) : 0;
+    bool is_video = false,
+    int32_t mask = 0,
+    const char *header = nullptr) {
+  auto file_info__ = file_info ? _fbb.CreateString(file_info) : 0;
   auto time__ = time ? _fbb.CreateString(time) : 0;
   auto description__ = description ? _fbb.CreateString(description) : 0;
   auto hashtags__ = hashtags ? _fbb.CreateString(hashtags) : 0;
@@ -168,10 +191,11 @@ inline flatbuffers::Offset<IGTask> CreateIGTaskDirect(
   auto requested_by_phrase__ = requested_by_phrase ? _fbb.CreateString(requested_by_phrase) : 0;
   auto promote_share__ = promote_share ? _fbb.CreateString(promote_share) : 0;
   auto link_bio__ = link_bio ? _fbb.CreateString(link_bio) : 0;
+  auto header__ = header ? _fbb.CreateString(header) : 0;
   return IGData::CreateIGTask(
       _fbb,
       id,
-      filename__,
+      file_info__,
       time__,
       description__,
       hashtags__,
@@ -179,7 +203,9 @@ inline flatbuffers::Offset<IGTask> CreateIGTaskDirect(
       requested_by_phrase__,
       promote_share__,
       link_bio__,
-      mask);
+      is_video,
+      mask,
+      header__);
 }
 
 inline const IGData::IGTask *GetIGTask(const void *buf) {

+ 40 - 20
headers/util.hpp

@@ -1,12 +1,13 @@
 #ifndef UTIL_HPP
 #define UTIL_HPP
-
+#pragma GCC system_header
 #include <string>
 #include <charconv>
 #include <utility>
 #include <vector>
 #include <QDebug>
 #include <QVector>
+#include <QString>
 #include "rapidjson/writer.h"
 #include "rapidjson/prettywriter.h"
 #include "rapidjson/pointer.h"
@@ -14,6 +15,7 @@
 #include "rapidjson/document.h"
 #include "json.hpp"
 
+
 namespace Kontainer {
 /** Reverse Iterator */
 template <class T>
@@ -26,6 +28,17 @@ public:
 };
 }
 
+enum FileType {
+    VIDEO = 1,
+    IMAGE = 2
+};
+
+struct KFileData {
+    FileType type;
+    QString name;
+    QByteArray bytes;
+};
+
 namespace {
 using namespace rapidjson;
 using json = nlohmann::json;
@@ -52,22 +65,9 @@ static QString escapeText(QString s) {
     if (s.contains("\t")) {
         s.replace("\t", "\\t");
     }
-//    if (s.contains("🙋‍♀️")) {
-//        qDebug() << "Replacing woman raising hand emoji";
-//        s.replace("🙋‍♀️", ":woman raising hand:");
-//    }
-//    if (s.contains("❤️")) {
-//        qDebug() << "Replacing heart";
-//        s.replace("❤️", ":heart:");
-//    }
-//    if (s.contains("🔗")) {
-//        qDebug() << "Replacing link";
-//        s.replace("🔗", ":link:");
-//    }
-//    if (s.contains("⬆️")) {
-//        qDebug() << "Replacing arrow";
-//        s.replace("⬆️", ":arrow_up:");
-//    }
+    if (s.contains('"')) {
+        s.replace('"', "\\\"");
+    }
     return s;
 }
 
@@ -113,6 +113,11 @@ bool isEvent(const char* data) {
     d.Parse(data);
     return strcmp(d["type"].GetString(), "event") == 0;
 }
+
+bool isPong(const char* data) {
+    return strcmp(data, "PONG") == 0;
+}
+
 // TODO: This should be "message", no?
 bool isMessage(const char* data) {
     Document d;
@@ -305,7 +310,7 @@ bool isStopOperation(const char* data) {
 bool isNewSession(const char* data) {
     Document d;
     d.Parse(data);
-    if (d.HasMember("message")) {
+    if (d.IsObject() && d.HasMember("message")) {
         return strcmp(d["message"].GetString(), "New Session") == 0;
     }
     return false;
@@ -314,7 +319,7 @@ bool isNewSession(const char* data) {
 bool serverWaitingForFile(const char* data) {
     Document d;
     d.Parse(data);
-    if (d.HasMember("message")) {
+    if (d.IsObject() && d.HasMember("message")) {
         return strcmp(d["message"].GetString(), "File Ready") == 0;
     }
     return false;
@@ -340,5 +345,20 @@ inline size_t findNullIndex(uint8_t* data) {
     }
     return index;
 }
+
+namespace FileUtils {
+QString generatePreview(QString video_path, QString video_name) {
+    QString preview_name = video_name.left(video_name.size() - 4) + "-preview.jpg";
+//    QString command{
+//        "ffmpeg -ss 0 -i " + video_path + " -vf select=\"eq(pict_type\\,I)\" -vframes 1 ./assets/previews/" + preview_name};
+    QString command {
+        "ffmpeg -y -ss 0 -i " + video_path + " -vf \"scale=w=640:h=640:force_original_aspect_ratio=decrease,pad=w=640:h=640:x=(iw-ow)/2:y=(ih-oh/2):color=white\" -vframes 1 ./assets/previews/" + preview_name
+    };
+
+    std::system(command.toUtf8());
+
+    return preview_name;
+}
+}; // namespace FileUtils
 }
-#endif  // __UTIL_HPP__
+#endif  // UTIL_HPP

BIN
icons/quit.png


+ 18 - 12
include/argdialog.h

@@ -8,19 +8,20 @@
 #include <QPushButton>
 #include <string_view>
 #include <unordered_map>
+#include <QKeyEvent>
+#include <headers/util.hpp>
 
 namespace Args {
+const QString HEADER_TYPE = "header";
 const QString DESCRIPTION_TYPE = "description";
 const QString HASHTAG_TYPE = "hashtag";
 const QString PROMOTE_TYPE = "promote/share";
 const QString LINK_BIO_TYPE = "link/bio";
 const QString REQUESTED_BY_TYPE = "requested by";
 }  // namespace Args
+
 typedef std::string Str;
-//namespace Emoji {
-//    Str SmilingFaceEyes{"U+1F60A"};
-//    const char* SmilingFaceEyesBytes = "😊";
-//}
+
 typedef struct Task {
     int mask;
     std::vector<std::string> args;
@@ -29,23 +30,25 @@ typedef struct Task {
 typedef struct KFile {
   QString name;
   QString path;
+  FileType type;
 } KFile;
 
 typedef struct IGPost {
+  std::string header = "Learn to speak like native Korean speakers 🙆‍♀️🇰🇷";
   std::string description;
   std::string datetime;
-  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::string promote_share = "Share the post through IG story if you enjoy the phrase 🙋‍♀️";
+  std::string link_in_bio = "Subscribe to my YouTube channel (link 🔗in bio) to learn more about Korean language and culture ❤";
   std::vector<std::string> hashtags;
   std::vector<std::string> requested_by;
   const char *requested_by_phrase = "The phrase was requested by ";
-  KFile video;
+  std::vector<KFile> files;
+  bool is_video;
   bool isReady() {
-    return description.size() > 0 && datetime.size() > 0 &&
+      return header.size() > 0 && description.size() > 0 && datetime.size() > 0 &&
            promote_share.size() > 0 && link_in_bio.size() > 0 &&
-           hashtags.size() > 0 && requested_by.size() > 0 &&
-           video.path.size() > 0;
+             hashtags.size() > 0 && requested_by.size() > 0 && !files.empty() &&
+             files.at(0).path.size() > 0;
   }
 } IGPost;
 
@@ -58,14 +61,16 @@ class ArgDialog : public QDialog {
 
  public:
   explicit ArgDialog(QWidget *parent = nullptr);
+  virtual void keyPressEvent(QKeyEvent* e);
   ~ArgDialog();
 
  signals:
-  void uploadFile(QByteArray bytes);
+  void uploadFiles(QVector<KFileData> files);
   void taskRequestReady(Task task, bool file_pending);
 
  private:
   void clearPost();
+  void defaultPost();
   void clearTask();
   void addToArgList(QString value, QString type);
   void addOrReplaceInArgList(QString value, QString type);
@@ -74,6 +79,7 @@ class ArgDialog : public QDialog {
   void setTaskArguments();
   Ui::ArgDialog *ui;
   void addItem(QString value, QString type);
+  void addFile(QString path);
   Task m_task;
   IGPost m_ig_post;
 };

+ 18 - 5
include/client.hpp

@@ -10,11 +10,13 @@
 #include <QLabel>
 #include <QString>
 #include <QVector>
+#include <QQueue>
 #include <QThread>
 #include <QMetaType>
 #include <thread>
 #include <string>
 #include <utility>
+#include <headers/util.hpp>
 
 static constexpr int MESSAGE_UPDATE_TYPE = 1;
 static constexpr int COMMANDS_UPDATE_TYPE = 2;
@@ -29,13 +31,21 @@ enum TaskType {
 namespace TaskCode {
 static constexpr int IGTASKBYTE = 0xFF;
 static constexpr int GENMSGBYTE = 0xFE;
+static constexpr int PINGBYTE = 0xFD;
 }
 
 typedef std::map<int, std::string> CommandMap;
 typedef std::map<int, std::vector<std::string>> CommandArgMap;
 typedef QVector<QString> StringVec;
 
+struct SentFile {
+    int timestamp;
+    QString name;
+    FileType type;
+};
+
 Q_DECLARE_METATYPE(StringVec)
+Q_DECLARE_METATYPE(QVector<QByteArray>);
 
 class Client : public QDialog
 {
@@ -68,17 +78,19 @@ public:
 
 public slots:
     void sendMessage(const QString& s);
-    void sendEncoded(std::string message);
-    void sendFileEncoded(QByteArray bytes);
-    void sendTaskEncoded(TaskType type, std::vector<std::string> args);
     void setSelectedApp(std::vector<QString> app_names);
-    void sendFile(QByteArray bytes);
+    void sendFiles(QVector<KFileData> files);
+    void ping();
 
 signals:
     void messageReceived(int t, QString s, QVector<QString> args);
     void eventReceived(int t, std::string event, StringVec args);
 
 private:
+    void sendEncoded(std::string message);
+    void sendFileEncoded(QByteArray bytes);
+    void sendTaskEncoded(TaskType type, std::vector<std::string> args);
+    void processFileQueue();
     void handleMessages();
     void sendPackets(uint8_t* data, int size);
     int argc;
@@ -89,6 +101,7 @@ private:
     CommandMap m_commands;
     CommandArgMap m_command_arg_map;
     std::vector<int> selected_commands;
-    QByteArray outgoing_file;
+    QQueue<KFileData> outgoing_files;
+    std::vector<SentFile> sent_files;
 };
 #endif // CLIENT_HPP

+ 18 - 9
include/mainwindow.h

@@ -13,6 +13,7 @@
 #include <include/argdialog.h>
 #include <include/consoledialog.h>
 #include <QTableView>
+#include <QTimer>
 
 namespace ProcessState {
     static constexpr int READY = 1;
@@ -36,6 +37,8 @@ struct Process {
     }
 };
 
+struct Event {};
+
 namespace Ui {
 class MainWindow;
 }
@@ -49,24 +52,30 @@ public:
     virtual void keyPressEvent(QKeyEvent* e);
     ~MainWindow();
 private:
-    Ui::MainWindow *ui;
-    ArgDialog *arg_ui;
-    void connectUi();
-    void runApp();
-    void updateProcessResult(QString request_id, QString result);
-    QString parseMessage(const QString& s, StringVec v);
+    /** Process arguments */
     int cli_argc;
     char** cli_argv;
+    /** UI & Messages */
+    void connectUi();
+    QString parseMessage(const QString& s, StringVec v);
+    void updateProcessResult(QString request_id, QString result);
+    /** UI Members */
+    Ui::MainWindow *ui;
+    ArgDialog *arg_ui;
+    ConsoleDialog console_ui;
+    /** Client member */
     Client* q_client;
+    /** Models */
     std::vector<Process> m_processes;
-    QStandardItemModel* m_process_model;
     QList<QString> m_events;
-    ConsoleDialog m_console;
+    QStandardItemModel* m_process_model;
+    QStandardItemModel* m_event_model;
 
 private slots:
+    /** Receivers */
     void connectClient();
     void updateMessages(int t, const QString& s, StringVec v);
-    void handleInputEnterKey();
+    void handleKey();
 };
 
 

+ 2 - 1
kres.qrc

@@ -5,12 +5,13 @@
         <file>icons/task.png</file>
         <file>icons/execute.png</file>
         <file>icons/arguments.png</file>
+        <file>icons/quit.png</file>
     </qresource>
     <qresource prefix="/">
         <file>icons/log.png</file>
         <file>icons/send-button.png</file>
         <file>icons/disconnect.png</file>
-        <file>style/style.qss</file>
+        <file>style/style.css</file>
         <file>style/messagebox.css</file>
     </qresource>
 </RCC>

+ 3 - 3
ky_gui.pro.user

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 4.11.0, 2020-01-22T17:14:48. -->
+<!-- Written by QtCreator 4.11.0, 2020-02-23T23:01:18. -->
 <qtcreator>
  <data>
   <variable>EnvironmentId</variable>
@@ -335,7 +335,7 @@
     <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/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="RunConfiguration.Arguments">127.0.0.1 9009 test message</value>
+    <value type="QString" key="RunConfiguration.Arguments">159.203.0.24 9009 test message</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>
@@ -345,7 +345,7 @@
     <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>
+    <value type="QString" key="RunConfiguration.WorkingDirectory.default">/data/c/ky_gui</value>
    </valuemap>
    <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
   </valuemap>

+ 404 - 248
mainwindow.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>723</width>
-    <height>937</height>
+    <width>1366</width>
+    <height>810</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -20,17 +20,22 @@
   <property name="styleSheet">
    <string notr="true">font: 87 10pt &quot;Noto Sans&quot;;
 background-color: rgb(255, 85, 0);
-</string>
+background-color: rgb(196, 25, 0);</string>
   </property>
   <widget class="QWidget" name="centralWidget">
    <property name="styleSheet">
     <string notr="true">border-color: rgb(0, 0, 0);
-background-color: rgb(0, 43, 54);</string>
+background-color: rgb(0, 43, 54);
+QPushButton::hover:
+{
+   opacity: 0.7;
+}
+</string>
    </property>
    <widget class="QLabel" name="label">
     <property name="geometry">
      <rect>
-      <x>280</x>
+      <x>450</x>
       <y>10</y>
       <width>161</width>
       <height>31</height>
@@ -49,13 +54,13 @@ background-color: rgb(0, 43, 54);</string>
    <widget class="QWidget" name="verticalLayoutWidget">
     <property name="geometry">
      <rect>
-      <x>20</x>
+      <x>10</x>
       <y>50</y>
-      <width>681</width>
-      <height>828</height>
+      <width>721</width>
+      <height>691</height>
      </rect>
     </property>
-    <layout class="QVBoxLayout" name="verticalLayout" stretch="1,0,0,0,0,0,0">
+    <layout class="QVBoxLayout" name="verticalLayout" stretch="1,0,0,0,0">
      <property name="spacing">
       <number>4</number>
      </property>
@@ -68,7 +73,7 @@ background-color: rgb(0, 43, 54);</string>
         <number>0</number>
        </property>
        <item row="0" column="0">
-        <layout class="QVBoxLayout" name="verticalLayout_2" stretch="2,2,1,0,2,0">
+        <layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,0,0,0,2">
          <property name="spacing">
           <number>4</number>
          </property>
@@ -100,7 +105,7 @@ font-weight: 700;</string>
           <widget class="QComboBox" name="appList">
            <property name="styleSheet">
             <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
-background-color: rgb(7, 54, 66);
+background-color: #2f535f;
 color: rgb(131, 148, 150);
 font-weight: 700;
 </string>
@@ -120,11 +125,20 @@ font-weight: 700;
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
+             <property name="autoFillBackground">
+              <bool>false</bool>
+             </property>
              <property name="styleSheet">
               <string notr="true">background-color: rgb(255, 85, 0);
 font: 87 11pt &quot;Noto Sans&quot;;
 color: rgb(0, 43, 54);
 font-weight: 700;
+padding: 4px;
+border-style: outset;
+border-width: 2px;
+border-radius: 4px;
+border-color: #00000f;
+min-width: 4em;
 padding: 4px;</string>
              </property>
              <property name="text">
@@ -134,6 +148,9 @@ padding: 4px;</string>
               <iconset resource="kres.qrc">
                <normaloff>:/icons/icons/arguments.png</normaloff>:/icons/icons/arguments.png</iconset>
              </property>
+             <property name="flat">
+              <bool>false</bool>
+             </property>
             </widget>
            </item>
            <item>
@@ -144,11 +161,30 @@ padding: 4px;</string>
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
+             <property name="font">
+              <font>
+               <family>Noto Sans</family>
+               <pointsize>11</pointsize>
+               <weight>87</weight>
+               <italic>false</italic>
+               <bold>true</bold>
+               <kerning>true</kerning>
+              </font>
+             </property>
+             <property name="autoFillBackground">
+              <bool>false</bool>
+             </property>
              <property name="styleSheet">
               <string notr="true">background-color: rgb(255, 85, 0);
 font: 87 11pt &quot;Noto Sans&quot;;
 color: rgb(0, 43, 54);
 font-weight: 700;
+padding: 4px;
+border-style: outset;
+border-width: 2px;
+border-radius: 4px;
+border-color: #00000f;
+min-width: 4em;
 padding: 4px;</string>
              </property>
              <property name="text">
@@ -158,90 +194,17 @@ padding: 4px;</string>
               <iconset resource="kres.qrc">
                <normaloff>:/icons/icons/execute.png</normaloff>:/icons/icons/execute.png</iconset>
              </property>
-            </widget>
-           </item>
-          </layout>
-         </item>
-         <item>
-          <layout class="QHBoxLayout" name="horizontalLayout_6" stretch="0,0">
-           <property name="spacing">
-            <number>4</number>
-           </property>
-           <item>
-            <layout class="QVBoxLayout" name="verticalLayout_3">
-             <property name="spacing">
-              <number>4</number>
-             </property>
-             <item>
-              <widget class="QLabel" name="messagesTitle">
-               <property name="styleSheet">
-                <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
-color: rgb(131, 148, 150);
-font-weight: 700;</string>
-               </property>
-               <property name="text">
-                <string>History</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QTextEdit" name="messages">
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <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">font: 87 11pt &quot;Noto Sans&quot;;
-background-color: rgb(7, 54, 66);
-color: rgb(131, 148, 150);
-font-weight: 700;
-</string>
-               </property>
-               <property name="lineWrapMode">
-                <enum>QTextEdit::WidgetWidth</enum>
-               </property>
-               <property name="readOnly">
-                <bool>true</bool>
-               </property>
-               <property name="placeholderText">
-                <string notr="true"/>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QPushButton" name="viewConsole">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
+             <property name="checkable">
+              <bool>false</bool>
              </property>
-             <property name="styleSheet">
-              <string notr="true">background-color: rgb(157, 157, 157);
-font: 87 11pt &quot;Noto Sans&quot;;
-color: rgb(0, 0, 0);
-font-weight: 700;
-padding: 4px;</string>
+             <property name="checked">
+              <bool>false</bool>
              </property>
-             <property name="text">
-              <string>Console</string>
+             <property name="default">
+              <bool>false</bool>
              </property>
-             <property name="icon">
-              <iconset resource="kres.qrc">
-               <normaloff>:/icons/log.png</normaloff>:/icons/log.png</iconset>
+             <property name="flat">
+              <bool>false</bool>
              </property>
             </widget>
            </item>
@@ -272,7 +235,7 @@ font-weight: 700;</string>
            </property>
            <property name="styleSheet">
             <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
-background-color: rgb(7, 54, 66);
+background-color: #2f535f;
 color: rgb(131, 148, 150);
 font-weight: 700;
 </string>
@@ -302,7 +265,7 @@ font-weight: 700;</string>
       </widget>
      </item>
      <item>
-      <widget class="QListWidget" name="eventList">
+      <widget class="QListView" name="eventList">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
          <horstretch>0</horstretch>
@@ -311,7 +274,7 @@ font-weight: 700;</string>
        </property>
        <property name="styleSheet">
         <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
-background-color: rgb(7, 54, 66);
+background-color: #2f535f;
 color: rgb(131, 148, 150);
 font-weight: 700;
 </string>
@@ -334,150 +297,8 @@ font-weight: 700;
        <property name="wordWrap">
         <bool>true</bool>
        </property>
-       <property name="sortingEnabled">
-        <bool>false</bool>
-       </property>
       </widget>
      </item>
-     <item>
-      <layout class="QGridLayout" name="gridLayout_3" rowstretch="0,0,0" columnstretch="0">
-       <property name="sizeConstraint">
-        <enum>QLayout::SetMinimumSize</enum>
-       </property>
-       <property name="spacing">
-        <number>4</number>
-       </property>
-       <item row="2" column="0">
-        <layout class="QHBoxLayout" name="horizontalLayout">
-         <property name="spacing">
-          <number>4</number>
-         </property>
-        </layout>
-       </item>
-       <item row="1" column="0">
-        <widget class="QTextEdit" name="inputText">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="styleSheet">
-          <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
-background-color: rgb(7, 54, 66);
-color: rgb(131, 148, 150);
-font-weight: 700;
-</string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="0">
-        <widget class="QLabel" name="inputTitle">
-         <property name="styleSheet">
-          <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
-color: rgb(131, 148, 150);
-font-weight: 700;</string>
-         </property>
-         <property name="text">
-          <string>Input</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <layout class="QHBoxLayout" name="horizontalLayout_3">
-       <property name="spacing">
-        <number>4</number>
-       </property>
-       <item>
-        <widget class="QPushButton" name="disconnect">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Maximum" 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);
-background-color: rgb(255, 0, 4);
-font-weight: 700;
-padding: 4px;</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>
-        <widget class="QPushButton" name="tasks">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="styleSheet">
-          <string notr="true">background-color: rgb(255, 85, 0);
-font: 87 11pt &quot;Noto Sans&quot;;
-color: rgb(0, 43, 54);
-font-weight: 700;
-padding: 4px;</string>
-         </property>
-         <property name="text">
-          <string>Tasks</string>
-         </property>
-         <property name="icon">
-          <iconset resource="kres.qrc">
-           <normaloff>:/icons/icons/task.png</normaloff>:/icons/icons/task.png</iconset>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QPushButton" name="sendMessage">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="styleSheet">
-          <string notr="true">background-color: rgb(130, 255, 121);
-background-color: rgb(2, 180, 43);
-font: 87 11pt &quot;Noto Sans&quot;;
-color: rgb(0, 0, 0);
-font-weight: 700;
-padding: 4px;</string>
-         </property>
-         <property name="text">
-          <string>Send</string>
-         </property>
-         <property name="icon">
-          <iconset resource="kres.qrc">
-           <normaloff>:/icons/send-button.png</normaloff>:/icons/send-button.png</iconset>
-         </property>
-         <property name="checkable">
-          <bool>false</bool>
-         </property>
-         <property name="autoDefault">
-          <bool>false</bool>
-         </property>
-         <property name="default">
-          <bool>false</bool>
-         </property>
-         <property name="flat">
-          <bool>false</bool>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
      <item>
       <layout class="QHBoxLayout" name="horizontalLayout_5">
        <property name="spacing">
@@ -494,7 +315,7 @@ padding: 4px;</string>
         </sizepolicy>
        </property>
        <property name="styleSheet">
-        <string notr="true">background-color: rgb(94, 79, 255);
+        <string notr="true">background-color: #2f535f;
 font: 87 11pt &quot;Noto Sans&quot;;
 color: rgb(0, 0, 0);</string>
        </property>
@@ -508,9 +329,9 @@ color: rgb(0, 0, 0);</string>
    <widget class="ConnectionIndicator" name="led">
     <property name="geometry">
      <rect>
-      <x>30</x>
-      <y>20</y>
-      <width>41</width>
+      <x>830</x>
+      <y>110</y>
+      <width>40</width>
       <height>20</height>
      </rect>
     </property>
@@ -521,18 +342,50 @@ color: rgb(0, 0, 0);</string>
    <widget class="QPushButton" name="connect">
     <property name="geometry">
      <rect>
-      <x>590</x>
-      <y>10</y>
-      <width>111</width>
-      <height>31</height>
+      <x>0</x>
+      <y>0</y>
+      <width>79</width>
+      <height>79</height>
      </rect>
     </property>
+    <property name="minimumSize">
+     <size>
+      <width>79</width>
+      <height>79</height>
+     </size>
+    </property>
+    <property name="maximumSize">
+     <size>
+      <width>0</width>
+      <height>0</height>
+     </size>
+    </property>
+    <property name="font">
+     <font>
+      <family>Noto Sans</family>
+      <pointsize>36</pointsize>
+      <weight>87</weight>
+      <italic>false</italic>
+      <bold>true</bold>
+     </font>
+    </property>
+    <property name="autoFillBackground">
+     <bool>false</bool>
+    </property>
     <property name="styleSheet">
-     <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
+     <string notr="true">font: 87 36pt &quot;Noto Sans&quot;;
 color: rgb(0, 0, 0);
 background-color: rgb(2, 180, 43);
 font-weight: 700;
-padding: 4px;</string>
+padding: 4px;
+border-style: outset;
+border-width: 2px;
+border-radius: 6px;
+border-color: #00000f;
+min-width: 1em;
+min-height: 1em;
+padding: 4px;
+opacity: 0.3;</string>
     </property>
     <property name="text">
      <string>Connect</string>
@@ -541,14 +394,317 @@ padding: 4px;</string>
      <iconset resource="kres.qrc">
       <normaloff>:/icons/icons/start.png</normaloff>:/icons/icons/start.png</iconset>
     </property>
+    <property name="iconSize">
+     <size>
+      <width>64</width>
+      <height>64</height>
+     </size>
+    </property>
+    <property name="flat">
+     <bool>false</bool>
+    </property>
+   </widget>
+   <widget class="QWidget" name="verticalLayoutWidget_2">
+    <property name="geometry">
+     <rect>
+      <x>730</x>
+      <y>50</y>
+      <width>621</width>
+      <height>691</height>
+     </rect>
+    </property>
+    <layout class="QVBoxLayout" name="verticalLayout_4">
+     <property name="spacing">
+      <number>0</number>
+     </property>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_6" stretch="0">
+       <property name="spacing">
+        <number>4</number>
+       </property>
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout_3" stretch="0,3">
+         <property name="spacing">
+          <number>3</number>
+         </property>
+         <item>
+          <widget class="QLabel" name="messagesTitle">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="styleSheet">
+            <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
+color: rgb(131, 148, 150);
+font-weight: 700;</string>
+           </property>
+           <property name="text">
+            <string>History</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QTextEdit" name="messages">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <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">font: 87 11pt &quot;Noto Sans&quot;;
+background-color: #2f535f;
+color: rgb(131, 148, 150);
+font-weight: 700;
+</string>
+           </property>
+           <property name="lineWrapMode">
+            <enum>QTextEdit::WidgetWidth</enum>
+           </property>
+           <property name="readOnly">
+            <bool>true</bool>
+           </property>
+           <property name="placeholderText">
+            <string notr="true"/>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QGridLayout" name="gridLayout_3" rowstretch="0,0,0,0" columnstretch="0">
+       <property name="sizeConstraint">
+        <enum>QLayout::SetMinimumSize</enum>
+       </property>
+       <property name="spacing">
+        <number>4</number>
+       </property>
+       <item row="2" column="0">
+        <widget class="QTextEdit" name="inputText">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="styleSheet">
+          <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
+background-color: #2f535f;
+color: rgb(131, 148, 150);
+font-weight: 700;
+</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="0">
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <property name="spacing">
+          <number>4</number>
+         </property>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_3">
+           <property name="spacing">
+            <number>4</number>
+           </property>
+           <item>
+            <widget class="QPushButton" name="disconnect">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="autoFillBackground">
+              <bool>false</bool>
+             </property>
+             <property name="styleSheet">
+              <string notr="true">font: 87 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 0, 0);
+background-color: rgb(255, 0, 4);
+font-weight: 700;
+padding: 4px;
+border-style: outset;
+border-width: 2px;
+border-radius: 4px;
+border-color: #00000f;
+min-width: 4em;
+padding: 4px;</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>
+             <property name="flat">
+              <bool>false</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="viewConsole">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="autoFillBackground">
+              <bool>false</bool>
+             </property>
+             <property name="styleSheet">
+              <string notr="true">background-color: #c41900;
+font: 87 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 0, 0);
+font-weight: 700;
+padding: 4px;
+border-style: outset;
+border-width: 2px;
+border-radius: 4px;
+border-color: #00000f;
+min-width: 4em;
+padding: 4px;</string>
+             </property>
+             <property name="text">
+              <string>Console</string>
+             </property>
+             <property name="icon">
+              <iconset resource="kres.qrc">
+               <normaloff>:/icons/log.png</normaloff>:/icons/log.png</iconset>
+             </property>
+             <property name="flat">
+              <bool>false</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="tasks">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="autoFillBackground">
+              <bool>false</bool>
+             </property>
+             <property name="styleSheet">
+              <string notr="true">background-color: rgb(255, 85, 0);
+font: 87 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 43, 54);
+font-weight: 700;
+padding: 4px;
+border-style: outset;
+border-width: 2px;
+border-radius: 4px;
+border-color: #00000f;
+min-width: 4em;
+padding: 4px;</string>
+             </property>
+             <property name="text">
+              <string>Tasks</string>
+             </property>
+             <property name="icon">
+              <iconset resource="kres.qrc">
+               <normaloff>:/icons/icons/task.png</normaloff>:/icons/icons/task.png</iconset>
+             </property>
+             <property name="flat">
+              <bool>false</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="sendMessage">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="autoFillBackground">
+              <bool>false</bool>
+             </property>
+             <property name="styleSheet">
+              <string notr="true">background-color: rgb(130, 255, 121);
+background-color: rgb(2, 180, 43);
+font: 87 11pt &quot;Noto Sans&quot;;
+color: rgb(0, 0, 0);
+font-weight: 700;
+padding: 4px;
+border-style: outset;
+border-width: 2px;
+border-radius: 4px;
+border-color: #00000f;
+min-width: 4em;
+padding: 4px;</string>
+             </property>
+             <property name="text">
+              <string>Send</string>
+             </property>
+             <property name="icon">
+              <iconset resource="kres.qrc">
+               <normaloff>:/icons/send-button.png</normaloff>:/icons/send-button.png</iconset>
+             </property>
+             <property name="checkable">
+              <bool>false</bool>
+             </property>
+             <property name="autoDefault">
+              <bool>false</bool>
+             </property>
+             <property name="default">
+              <bool>false</bool>
+             </property>
+             <property name="flat">
+              <bool>false</bool>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item row="1" column="0">
+        <widget class="QLabel" name="inputTitle">
+         <property name="styleSheet">
+          <string notr="true">font: 75 11pt &quot;Noto Sans&quot;;
+color: rgb(131, 148, 150);
+font-weight: 700;</string>
+         </property>
+         <property name="text">
+          <string>Input</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
    </widget>
+   <zorder>label</zorder>
+   <zorder>verticalLayoutWidget</zorder>
+   <zorder>led</zorder>
+   <zorder>verticalLayoutWidget_2</zorder>
+   <zorder>connect</zorder>
   </widget>
   <widget class="QMenuBar" name="menuBar">
    <property name="geometry">
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>723</width>
+     <width>1366</width>
      <height>23</height>
     </rect>
    </property>

+ 109 - 21
src/argdialog.cpp

@@ -8,7 +8,7 @@
 #include <QTableWidgetItem>
 #include <QDateTime>
 #include <QCalendarWidget>
-#include <headers/util.hpp>
+#include <QMimeDatabase>
 
 ArgDialog::ArgDialog(QWidget *parent) :
     QDialog(parent),
@@ -24,16 +24,34 @@ ArgDialog::ArgDialog(QWidget *parent) :
         if (file_path.size() > 0) {
             auto slash_index = file_path.lastIndexOf("/") + 1;
             QString file_name = file_path.right(file_path.size() - slash_index);
-
+            QString dir = file_path.left(slash_index);
+            qDebug() << "Dir is " << dir;
+            QMimeDatabase db;
+            auto is_video = db.mimeTypeForFile(file_path).name().contains("video");
             addItem(file_name, "file");
+            m_ig_post.files.push_back(KFile{
+                .name=file_name, .path=file_path, .type = is_video ? FileType::VIDEO : FileType::IMAGE
+            });
 
-            m_ig_post.video.name = file_name;
-            m_ig_post.video.path = file_path;
+            if (!m_ig_post.is_video && is_video) {
+                qDebug() << "File discovered to be video";
+                m_ig_post.is_video = true; // rename to "sending_video"
+                QString preview_filename = FileUtils::generatePreview(file_path, file_name);
+                // TODO: create some way of verifying preview generation was successful
+                addFile("assets/previews/" + preview_filename);
+                addItem(preview_filename, "file");
+                addFile("assets/previews/" + preview_filename);
+                m_ig_post.files.push_back(KFile{
+                    .name=preview_filename, .path=QCoreApplication::applicationDirPath() + "/assets/previews/" + preview_filename, .type = is_video ? FileType::VIDEO : FileType::IMAGE
+                });
+            } else {
+                addFile(file_path);
+            }
         }
     });
 
     ui->argList->setHorizontalHeaderLabels(QStringList{"Value", "Type"});
-    ui->argList->setColumnWidth(0, 400);
+    ui->argList->setColumnWidth(0, 300);
     ui->argList->setColumnWidth(1, 40);
     ui->argList->verticalHeader()->setDefaultSectionSize(100);
 
@@ -73,21 +91,32 @@ ArgDialog::ArgDialog(QWidget *parent) :
         if (button->text() == "Save") {
             if (m_ig_post.isReady()) {
                 setTaskArguments();
-                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")
-                    );
+                QVector<KFileData> k_file_v{};
+                k_file_v.reserve(m_ig_post.files.size());
+
+                for (const auto& kfile : m_ig_post.files) {
+                    QFile file(kfile.path);
+                    if (file.open(QIODevice::ReadOnly)) {
+                        k_file_v.push_back(KFileData{
+                            .type = kfile.type,
+                            .name = kfile.name,
+                            .bytes = file.readAll()
+                        });
+                    } else {
+                        QMessageBox::warning(
+                            this,
+                            tr("File Error"),
+                            tr("Unable to read file")
+                        );
+                    }
                 }
+                if (!k_file_v.empty()) {
+                    emit ArgDialog::uploadFiles(k_file_v);
+                }
+
                 emit ArgDialog::taskRequestReady(m_task, true);
             }
+            defaultPost(); // reset m_ig_post to default values
         }
     });
 
@@ -101,9 +130,21 @@ ArgDialog::ArgDialog(QWidget *parent) :
             .link_in_bio = escapeText("Download a FREE PDF of 245 basic verbs (link 🔗 in bio 👆").toUtf8().constData(),
             .hashtags = {"love", "life"},
             .requested_by = {"unwillingagent"},
-            .video = {.name = "holy.jpg", .path = "/data/c/ky_gui/assets/holy.jpg"}
+            .files = {{ .name = "holy.jpg", .path = "/data/c/ky_gui/assets/holy.jpg", .type = FileType::IMAGE }}
         };
     });
+
+    QObject::connect(ui->clear, &QPushButton::clicked, this, [this]() {
+        clearPost();
+        ui->argList->setRowCount(0);
+        qDebug() << "Task cleared";
+    });
+
+    QObject::connect(ui->default_args, &QPushButton::clicked, this, [this]() {
+        defaultPost();
+        ui->argList->setRowCount(0);
+        qDebug() << "Task set to default values";
+    });
 }
 
 void ArgDialog::setTaskArguments() {
@@ -119,10 +160,10 @@ void ArgDialog::setTaskArguments() {
         requested_by += "@" + name + "";
     }
     if (m_ig_post.requested_by.size() > 1) {
-    requested_by.pop_back();
+        requested_by.pop_back();
     }
 
-    m_task.args.push_back(m_ig_post.video.name.toUtf8().constData());
+//    m_task.args.push_back(m_ig_post.file.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);
@@ -130,6 +171,8 @@ void ArgDialog::setTaskArguments() {
     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);
+    m_task.args.push_back(std::to_string(m_ig_post.is_video));
+    m_task.args.push_back(m_ig_post.header);
 }
 
 void ArgDialog::addItem(QString value, QString type) {
@@ -137,12 +180,33 @@ void ArgDialog::addItem(QString value, QString type) {
     QTableWidgetItem* item2 = new QTableWidgetItem(type);
     auto row = ui->argList->rowCount();
     ui->argList->insertRow(row);
+    QPushButton* q_pb = new QPushButton();
+    q_pb->setText("Delete");
+    q_pb->setIcon(std::move(QIcon(":/icons/icons/quit.png")));
+    QObject::connect(q_pb, &QPushButton::clicked, this, [this, row]() {
+        ui->argList->removeRow(row);
+    });
     ui->argList->setItem(row, 0, item);
     ui->argList->setItem(row, 1, item2);
+    ui->argList->setCellWidget(row, 2, q_pb);
+}
+
+void ArgDialog::addFile(QString path) {
+    auto row_count = ui->argList->rowCount();
+
+    QTableWidgetItem* file_item = new QTableWidgetItem();
+    QPixmap pm{path};
+    file_item->setData(
+        Qt::DecorationRole,
+        pm.scaledToHeight(ui->argList->rowHeight(0), Qt::TransformationMode::SmoothTransformation)
+    );
+    ui->argList->setItem(row_count - 1, 2, file_item);
+
 }
 
 void ArgDialog::clearPost() {
-    m_ig_post.video = KFile{};
+    m_ig_post.files.clear();
+    m_ig_post.header = "";
     m_ig_post.datetime = "";
     m_ig_post.hashtags = {};
     m_ig_post.description = "";
@@ -152,6 +216,18 @@ void ArgDialog::clearPost() {
     m_ig_post.requested_by_phrase = "";
 }
 
+void ArgDialog::defaultPost() {
+    m_ig_post.files.clear();
+    m_ig_post.header = "Learn to speak like native Korean speakers 🙆‍♀️🇰🇷";
+    m_ig_post.datetime = "";
+    m_ig_post.hashtags.clear();
+    m_ig_post.description = "";
+    m_ig_post.link_in_bio = "Subscribe to my YouTube channel (link 🔗in bio) to learn more about Korean language and culture ❤";
+    m_ig_post.requested_by.clear();
+    m_ig_post.promote_share = "Share the post through IG story if you enjoy the phrase 🙋‍♀️";
+    m_ig_post.requested_by_phrase = "The phrase was requested by ";
+}
+
 void ArgDialog::clearTask() {
     m_task.args = {};
     m_task.mask = -1;
@@ -219,6 +295,18 @@ void ArgDialog::addHashtag(QString tag) {
     }
 }
 
+void ArgDialog::keyPressEvent(QKeyEvent *e) {
+    if (Qt::ControlModifier) {
+        if(e->key()==Qt::Key_Return || e->key()==Qt::Key_Enter) {
+            ui->addArgument->clicked();
+            auto idx = ui->argType->currentIndex();
+            if (idx != (ui->argType->count() - 1)) {
+                ui->argType->setCurrentIndex(idx + 1);
+            }
+        }
+    }
+}
+
 ArgDialog::~ArgDialog()
 {
     delete ui;

+ 136 - 51
src/client.cpp

@@ -16,12 +16,10 @@
 #define FLATBUFFERS_DEBUG_VERIFICATION_FAILURE
 #include <headers/kmessage_codec.hpp>
 #include <headers/instatask_generated.h>
-#include <headers/util.hpp>
 
 using namespace KData;
 using namespace IGData;
 
-static const int MAX_BUFFER_SIZE = 2048;
 static const int MAX_PACKET_SIZE = 4096;
 static const int HEADER_SIZE = 4;
 
@@ -29,8 +27,8 @@ flatbuffers::FlatBufferBuilder builder(1024);
 
 /**
  * @brief Client::createMessageHandler
- * @param cb
- * @return
+ * @param [in] {std::function<void()>} cb A non-returning function to be called without parameter
+ * @returns {MessageHandler} A message loop handler
  */
 Client::MessageHandler Client::createMessageHandler(
     std::function<void()> cb) {
@@ -40,9 +38,9 @@ Client::MessageHandler Client::createMessageHandler(
 /**
  * @brief Client::Client
  * @constructor
- * @param parent
- * @param count
- * @param arguments
+ * @param [in] {QWidget*} parent
+ * @param [in] {int} count
+ * @param [in] {char**} arguments
  */
 Client::Client(QWidget *parent, int count, char** arguments) : QDialog(parent), argc(count), argv(arguments), m_client_socket_fd(-1), m_commands({}), executing(false) {
     qRegisterMetaType<QVector<QString>>("QVector<QString>");
@@ -60,33 +58,43 @@ Client::~Client() {
  * @brief Client::handleMessages
  */
 void Client::handleMessages() {
-    uint8_t receive_buffer[2048];
+    uint8_t receive_buffer[MAX_PACKET_SIZE];
     for (;;) {
-        memset(receive_buffer, 0, 2048);
+        memset(receive_buffer, 0, MAX_PACKET_SIZE);
         ssize_t bytes_received = 0;
-        bytes_received = recv(m_client_socket_fd, receive_buffer, 2048 - 2, 0);
-        receive_buffer[2047] = 0;
-        if (bytes_received == 0) {
+        bytes_received = recv(m_client_socket_fd, receive_buffer, MAX_PACKET_SIZE, 0);
+        if (bytes_received == 0) { // Finish message loop
             break;
         }
         size_t end_idx = findNullIndex(receive_buffer);
         std::string data_string{receive_buffer, receive_buffer + end_idx};
+        qDebug() << "Received data from KServer: \n" << data_string.c_str();
+        if (isPong(data_string.c_str())) {
+            qDebug() << "Server returned pong";
+            continue;
+        }
         StringVec s_v{};
-        if (isNewSession(data_string.c_str())) {
+        if (isNewSession(data_string.c_str())) { // Session Start
             m_commands = getArgMap(data_string.c_str());
-            for (const auto& [k, v] : m_commands) {
+            for (const auto& [k, v] : m_commands) { // Receive available commands
                 s_v.push_back(v.data());
             }
-            emit Client::messageReceived(COMMANDS_UPDATE_TYPE, "New Session", s_v);
-        } else if (serverWaitingForFile(data_string.c_str())) {
-            sendFileEncoded(outgoing_file);
-        } else if (isEvent(data_string.c_str())) {
+            emit Client::messageReceived(COMMANDS_UPDATE_TYPE, "New Session", s_v); // Update UI
+        } else if (serverWaitingForFile(data_string.c_str())) { // Server expects a file
+            processFileQueue();
+        } else if (isEvent(data_string.c_str())) { // Receiving event
             QString event = getEvent(data_string.c_str());
             QVector<QString> args = getArgs(data_string.c_str());
-            emit Client::messageReceived(EVENT_UPDATE_TYPE, event, args);
-            if (isUploadCompleteEvent(event.toUtf8().constData())) {
-                outgoing_file.clear();
-                sendTaskEncoded(TaskType::INSTAGRAM, m_task);
+            emit Client::messageReceived(EVENT_UPDATE_TYPE, event, args); // Update UI (event)
+            if (isUploadCompleteEvent(event.toUtf8().constData())) { // Upload complete
+                if (!args.isEmpty()) {
+                    sent_files.at(sent_files.size() - 1).timestamp = std::stoi(args.at(0).toUtf8().constData());
+                    if (outgoing_files.isEmpty()) {
+                        sendTaskEncoded(TaskType::INSTAGRAM, m_task);
+                    } else {
+                        sendEncoded(createOperation("FileUpload", {"Subsequent file"}));
+                    }
+                }
             }
         }
         std::string formatted_json = getJsonString(data_string);
@@ -97,9 +105,13 @@ void Client::handleMessages() {
 //    ::shutdown(m_client_socket_fd, SHUT_RDWR);
 }
 
+void Client::processFileQueue() {
+    KFileData outgoing_file = outgoing_files.dequeue();
+    sendFileEncoded(outgoing_file.bytes);
+    sent_files.push_back(SentFile{.name = outgoing_file.name, .type = outgoing_file.type });
+}
 /**
  * @brief Client::start
- * @return A meaningless integer
  */
 void Client::start() {
     if (m_client_socket_fd == -1) {
@@ -112,7 +124,6 @@ void Client::start() {
             if (port_value < 0 || end == argv[2]) {
                 return;
             }
-
             int socket_option = 1;
             // Free up the port to begin listening again
             setsockopt(m_client_socket_fd, SOL_SOCKET, SO_REUSEADDR, &socket_option,
@@ -148,7 +159,7 @@ void Client::start() {
 
 /**
  * @brief Client::sendMessage
- * @param s[in] <const QString&> The message to send
+ * @param [in] {const QString&} The message to send
  */
 void Client::sendMessage(const QString& s) {
     if (m_client_socket_fd != -1) {
@@ -162,6 +173,10 @@ void Client::sendMessage(const QString& s) {
     }
 }
 
+/**
+ * @brief Client::sendEncoded
+ * @param [in] {std::string message} The message to send
+ */
 void Client::sendEncoded(std::string message) {
     std::vector<uint8_t> fb_byte_vector{message.begin(), message.end()};
     auto byte_vector = builder.CreateVector(fb_byte_vector);
@@ -180,35 +195,62 @@ void Client::sendEncoded(std::string message) {
     send_buffer[3] = (size & 0xFF);
     send_buffer[4] = (TaskCode::GENMSGBYTE & 0xFF);
     std::memcpy(send_buffer + 5, encoded_message_buffer, size);
-    qDebug() << "Ready to send:";
+    qDebug() << "Sending encoded message";
     std::string message_to_send{};
     for (unsigned int i = 0; i < (size + 5); i++) {
         message_to_send += (char)*(send_buffer + i);
-        qDebug() << (char)*(send_buffer + i);
     }
-    qDebug() << "Final size: " << (size + 5);
+    qDebug() << "Encoded message size: " << (size + 5);
     // Send start operation
     ::send(m_client_socket_fd, send_buffer, size + 5, 0);
     builder.Clear();
 }
+/**
+ * @brief getTaskFileInfo
+ * @param [in] {std::vector<SentFile>} files The files to produce an information string from
+ * @return std::string A string with the following format denoting each file:
+ * `1580057341filename|image::`
+ */
+std::string getTaskFileInfo(std::vector<SentFile> files) {
+    std::string info{};
+    for (const auto& f : files) {
+        info += std::to_string(f.timestamp);
+        info += f.name.toUtf8().constData();
+        info += "|";
+        if (f.type == FileType::VIDEO) {
+            info += "video";
+        } else {
+            info += "image";
+        }
+        info += "::";
+    }
+    qDebug() << "File Info: " << info.c_str();
+    return info;
+}
 
+/**
+ * @brief Client::sendTaskEncoded
+ * @param [in] {TaskType}                 type The type of task
+ * @param [in] {std::vector<std::string>} args The task arguments
+ */
 void Client::sendTaskEncoded(TaskType type, std::vector<std::string> args) {
     if (type == TaskType::INSTAGRAM) {
         if (args.size() < 7) {
             qDebug() << "Not enough arguments to send an IGTask";
             return;
         }
-        auto filename = builder.CreateString(args.at(0).c_str(), args.at(0).size());
-        auto time = builder.CreateString(args.at(1).c_str(), args.at(1).size());
-        auto description = builder.CreateString(args.at(2).c_str(), args.at(2).size());
-        auto hashtags = builder.CreateString(args.at(3).c_str(), args.at(3).size());
-        auto requested_by = builder.CreateString(args.at(4).c_str(), args.at(4).size());
-        auto requested_by_phrase = builder.CreateString(args.at(5).c_str(), args.at(5).size());
-        auto promote_share = builder.CreateString(args.at(6).c_str(), args.at(6).size());
-        auto link_bio = builder.CreateString(args.at(7).c_str(), args.at(7).size());
-//        auto mask = std::stoi(args.at(8));
-
-        flatbuffers::Offset<IGTask> ig_task = CreateIGTask(builder, 96, filename, time, description, hashtags, requested_by, requested_by_phrase, promote_share, link_bio, 16);
+        auto file_info = builder.CreateString(getTaskFileInfo(sent_files));
+        auto time = builder.CreateString(args.at(0).c_str(), args.at(0).size());
+        auto description = builder.CreateString(args.at(1).c_str(), args.at(1).size());
+        auto hashtags = builder.CreateString(args.at(2).c_str(), args.at(2).size());
+        auto requested_by = builder.CreateString(args.at(3).c_str(), args.at(3).size());
+        auto requested_by_phrase = builder.CreateString(args.at(4).c_str(), args.at(4).size());
+        auto promote_share = builder.CreateString(args.at(5).c_str(), args.at(5).size());
+        auto link_bio = builder.CreateString(args.at(6).c_str(), args.at(6).size());
+        auto is_video = args.at(7) == "1";
+        auto header = builder.CreateString(args.at(8).c_str(), args.at(8).size());
+
+        flatbuffers::Offset<IGTask> ig_task = CreateIGTask(builder, 96, file_info, time, description, hashtags, requested_by, requested_by_phrase, promote_share, link_bio, is_video, 16, header);
 
         builder.Finish(ig_task);
 
@@ -234,9 +276,15 @@ void Client::sendTaskEncoded(TaskType type, std::vector<std::string> args) {
         // Send start operation
         ::send(m_client_socket_fd, send_buffer, size + 5, 0);
         builder.Clear();
+        sent_files.clear();
     }
 }
 
+/**
+ * @brief Client::sendPackets
+ * @param [in] {uint8_t*} data A pointer to a buffer of bytes
+ * @param [in] {int}      size The size of the buffer to be packetized and sent
+ */
 void Client::sendPackets(uint8_t* data, int size) {
     uint32_t total_size = static_cast<uint32_t>(size + HEADER_SIZE);
     uint32_t total_packets = static_cast<uint32_t>(ceil(
@@ -244,9 +292,7 @@ void Client::sendPackets(uint8_t* data, int size) {
             static_cast<double>(total_size) / static_cast<double>(MAX_PACKET_SIZE)) // total size / packet
         )
     );
-
     uint32_t idx = 0;
-
     for (; idx < total_packets; idx++) {
         bool is_first_packet = (idx == 0);
         bool is_last_packet = (idx == (total_packets - 1));
@@ -281,15 +327,32 @@ void Client::sendPackets(uint8_t* data, int size) {
         ::send(m_client_socket_fd, packet, packet_size, 0);
         if (is_last_packet) {
             // cleanup
-            outgoing_file.clear();
+            qDebug() << "Last packet of file sent";
         }
     }
 }
 
+void Client::ping() {
+    if (m_client_socket_fd != -1) {
+        uint8_t send_buffer[5];
+        memset(send_buffer, 0, 5);
+        send_buffer[4] = (TaskCode::PINGBYTE & 0xFF);
+        qDebug() << "Pinging server";
+        ::send(m_client_socket_fd, send_buffer, 5, 0);
+    }
+}
+
+/**
+ * @brief Client::sendFileEncoded
+ * @param [in] {QByteArray} bytes An array of bytes to send
+ */
 void Client::sendFileEncoded(QByteArray bytes) {
     sendPackets(reinterpret_cast<uint8_t*>(bytes.data()), bytes.size());
 }
 
+/**
+ * @brief Client::closeConnection
+ */
 void Client::closeConnection() {
     if (m_client_socket_fd != -1) {
         std::string stop_operation_string = createOperation("stop", {});
@@ -304,6 +367,10 @@ void Client::closeConnection() {
     qDebug() << "There is no active connection to close";
 }
 
+/**
+ * @brief Client::setSelectedApp
+ * @param [in] TYPE SHOULD CHANGE app_names
+ */
 void Client::setSelectedApp(std::vector<QString> app_names) {
     selected_commands.clear();
     for (const auto& name : app_names) {
@@ -316,6 +383,10 @@ void Client::setSelectedApp(std::vector<QString> app_names) {
     }
 }
 
+/**
+ * @brief Client::getSelectedApp
+ * @returns {int} The mask representing the selected application
+ */
 int Client::getSelectedApp() {
     if (selected_commands.size() == 1) {
         return selected_commands.at(0);
@@ -325,6 +396,11 @@ int Client::getSelectedApp() {
     return -1;
 }
 
+/**
+ * @brief Client::getAppName
+ * @param [in] {int} mask The mask representing the application
+ * @returns {QString} The application name
+ */
 QString Client::getAppName(int mask) {
     auto app = m_commands.find(mask);
     if (app != m_commands.end()) {
@@ -333,8 +409,9 @@ QString Client::getAppName(int mask) {
     return QString{""};
 }
 
-
-
+/**
+ * @brief Client::execute
+ */
 void Client::execute() {
     if (!selected_commands.empty()) {
         executing = true;
@@ -349,24 +426,32 @@ void Client::execute() {
     }
 }
 
+/**
+ * @brief Client::scheduleTask
+ * @param [in] {std::vector<std::string>} task_args The task arguments
+ * @param [in] {bool}                     file_pending A boolean indicating whether there are files being sent for this task
+ */
 void Client::scheduleTask(std::vector<std::string> task_args, bool file_pending) {
     if (file_pending) {
         m_task = task_args;
     } else {
         qDebug() << "Requesting a task to be scheduled";
-//        std::string operation_string = createOperation("Schedule", task_args);
         sendTaskEncoded(TaskType::INSTAGRAM, task_args);
     }
 }
 
-void Client::sendFile(QByteArray bytes) {
-    if (outgoing_file.isNull()) {
+/**
+ * @brief Client::sendFiles
+ * @param [in] {QVector<const QByteArray} files The files to be sent
+ */
+void Client::sendFiles(QVector<KFileData> files) {
+    if (outgoing_files.isEmpty()) {
+        for (const auto & file : files) {
+            outgoing_files.enqueue(file);
+        }
         std::string send_file_operation = createOperation("FileUpload", {});
-        int size = bytes.size();
-        qDebug() << size << " bytes to send";
         sendEncoded(send_file_operation);
-        outgoing_file = bytes;
     } else {
-        qDebug() << "Outgoing file buffer is not ready";
+        qDebug() << "Still attempting to send a different file";
     }
 }

+ 8 - 2
src/main.cpp

@@ -7,8 +7,14 @@ int main(int argc, char **argv)
     QFont font("Deja Sans Mono");
     font.setStyleHint(QFont::Monospace);
     a.setFont(font);
-    MainWindow w(argc, argv);
-    w.show();
+
+    int code = 0;
+
+    do {
+        MainWindow w(argc, argv);
+        w.show();
+        code = a.exec();
+    } while (code == 9);
 
     return a.exec();
 }

+ 38 - 34
src/mainwindow.cpp

@@ -12,11 +12,6 @@
 
 void infoMessageBox(QString text, QString title = "KYGUI") {
     QMessageBox box;
-    QFile q_style_file(":/style/messagebox.css");
-    q_style_file.open(QFile::ReadOnly | QFile::Text);
-    QString stylesheet = QString::fromUtf8(q_style_file.readAll());
-    box.setStyleSheet(stylesheet);
-    q_style_file.close();
     box.setWindowTitle(title);
     box.setText(text);
     box.setButtonText(0, "Close");
@@ -35,18 +30,23 @@ QString getTime() {
  */
 MainWindow::MainWindow(int argc, char** argv, QWidget *parent) :
     QMainWindow(parent),
-    ui(new Ui::MainWindow),
-    arg_ui(new ArgDialog),
     cli_argc(argc),
     cli_argv(argv),
+    ui(new Ui::MainWindow),
+    arg_ui(new ArgDialog),
     q_client(nullptr) {
     m_process_model = new QStandardItemModel(this);
+    m_event_model = new QStandardItemModel(this);
     q_client = new Client(this, cli_argc, cli_argv);
     ui->setupUi(this);
     this->setWindowTitle("KYGUI");
+
     QPushButton *button = this->findChild<QPushButton*>("connect");
+    button->setMaximumSize(1366, 768);
+    button->setMinimumSize(1366, 768);
     connect(button, &QPushButton::clicked, this, &MainWindow::connectClient);
     ui->processList->setModel(m_process_model);
+    ui->eventList->setModel(m_event_model);
 }
 
 /**
@@ -62,6 +62,7 @@ MainWindow::~MainWindow()
  * @brief MainWindow::buttonClicked
  */
 void MainWindow::connectClient() {
+    ui->connect->hide();
     qDebug() << "Connecting to KServer";
 
     QObject::connect(q_client, &Client::messageReceived, this, &MainWindow::updateMessages);
@@ -92,12 +93,10 @@ void MainWindow::connectClient() {
     QPushButton* disconnect_button = this->findChild<QPushButton*>("disconnect");
     QObject::connect(disconnect_button, &QPushButton::clicked, this, [this, progressBar]() {
         q_client->closeConnection();
-        progressBar->setValue(0);
-        ui->appList->clear();
-        ui->messages->clear();
-        ui->led->setState(false);
+        QApplication::exit(9);
     });
 
+
     QObject::connect(ui->execute, &QPushButton::clicked, this, [this]() {
         q_client->execute();
     });
@@ -110,8 +109,8 @@ void MainWindow::connectClient() {
         }
     });
 
-    QObject::connect(arg_ui, &ArgDialog::uploadFile, this, [this](QByteArray bytes) {
-        q_client->sendFile(bytes);
+    QObject::connect(arg_ui, &ArgDialog::uploadFiles, this, [this](QVector<KFileData> files) {
+        q_client->sendFiles(files);
     });
 
     QObject::connect(arg_ui, &ArgDialog::taskRequestReady, this, [this](Task task, bool file_pending) {
@@ -119,15 +118,15 @@ void MainWindow::connectClient() {
         auto mask = q_client->getSelectedApp();
         if (mask > -1) {
             if (q_client->getAppName(mask) == "Instagram") {
-                auto datetime = task.args.at(1);
+                auto datetime = task.args.at(0);
                 auto current_datetime = QDateTime::currentDateTime().toTime_t();
                 auto seconds_diff = std::stoi(datetime) - current_datetime;
-                qDebug() << "Time difference: " << seconds_diff;
-                if (seconds_diff > 3600) {
+//                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, file_pending);
-                }
+//                }
             }
         }
     });
@@ -138,12 +137,12 @@ void MainWindow::connectClient() {
     });
 
     QObject::connect(ui->viewConsole, &QPushButton::clicked, this, [this]() {
-        m_console.show();
+        console_ui.show();
     });
 
     // TODO: Handle enter key
     //    QObject::connect(static_cast<KTextEdit*>(ui->inputText), &KTextEdit::textInputEnter, this, &MainWindow::handleInputEnterKey);
-    QObject::connect(static_cast<KTextEdit*>(ui->inputText), &KTextEdit::textInputEnter, this, &MainWindow::handleInputEnterKey);
+    QObject::connect(static_cast<KTextEdit*>(ui->inputText), &KTextEdit::textInputEnter, this, &MainWindow::handleKey);
 
     QObject::connect(ui->processList, &QListView::clicked, this, [this](const QModelIndex &index) {
         auto process = m_processes.at(index.row());
@@ -155,9 +154,18 @@ void MainWindow::connectClient() {
         }
         infoMessageBox(process_info_text, "Process");
     });
+
+    QObject::connect(ui->eventList, &QListView::clicked, this, [this](const QModelIndex &index) {
+        auto event = m_events.at(index.row());
+        infoMessageBox(event, "Event");
+    });
+
+    QTimer *timer = new QTimer(this);
+    connect(timer, &QTimer::timeout, q_client, &Client::ping);
+    timer->start(30000);
 }
 
-void MainWindow::handleInputEnterKey() {
+void MainWindow::handleKey() {
     q_client->sendMessage(ui->inputText->toPlainText());
     ui->inputText->clear();
 }
@@ -176,11 +184,12 @@ QString MainWindow::parseMessage(const QString& message, StringVec v) {
 }
 
 QStandardItem* createProcessListItem(Process process) {
-
     return new QStandardItem(QString("%0 requested for execution. ID: %1\nStatus: %2\nTime: %3   Done: %4").arg(process.name).arg(process.id).arg(ProcessNames[process.state - 1]).arg(process.start).arg(process.end));
 }
 
-
+QStandardItem* createEventListItem(QString event) {
+    return new QStandardItem(event);
+}
 
 /**
  * @brief MainWindow::updateMessages
@@ -192,7 +201,7 @@ void MainWindow::updateMessages(int t, const QString& message, StringVec v) {
         qDebug() << "Updating message area";
         auto simple_message = timestamp_prefix + parseMessage(message, v);
         ui->messages->append(simple_message);
-        m_console.updateText(message);
+        console_ui.updateText(message);
     } else if (t == COMMANDS_UPDATE_TYPE) {
         if (message == "New Session") {
             ui->led->setState(true);
@@ -203,8 +212,6 @@ void MainWindow::updateMessages(int t, const QString& message, StringVec v) {
         for (const auto& s : v) {
             app_list->addItem(s);
         }
-        //TODO: We do this because a CommandLinkButton turns transparent by default, except when hovered or checked
-        ui->connect->setChecked(true);
     } else if (t == PROCESS_REQUEST_TYPE) {
         qDebug() << "Updating process list";
         m_processes.push_back(Process{ .name=v.at(1), .state=ProcessState::PENDING, .start=getTime(), .id=v.at(2) });
@@ -213,9 +220,6 @@ void MainWindow::updateMessages(int t, const QString& message, StringVec v) {
             m_process_model->setItem(row, createProcessListItem(process));
             row++;
         }
-
-        //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) {
         QString event_message{timestamp_prefix};
         if (!v.empty()) {
@@ -227,7 +231,10 @@ void MainWindow::updateMessages(int t, const QString& message, StringVec v) {
                 if (message == "Process Result") {
                     event_message += "\n";
                     auto app_name = q_client->getAppName(std::stoi(v.at(0).toUtf8().constData()));
-                    if (v.at(1).length() > 0) {
+                    auto process_it = std::find_if(m_processes.begin(), m_processes.end(), [v](const Process& process) {
+                        return process.id == v.at(1);
+                    });
+                    if (process_it != m_processes.end()) {
                         updateProcessResult(v.at(1), v.at(2));
                     } else { // new process, from scheduled task
                         Process new_process{ .name=app_name, .state=ProcessState::SUCCEEDED, .start=getTime(), .id="Scheduled task" };
@@ -250,11 +257,7 @@ void MainWindow::updateMessages(int t, const QString& message, StringVec v) {
             event_message += message;
         }
         m_events.push_front(event_message);
-        ui->eventList->clear();
-
-        for (const auto& i : Kontainer::ReverseIterator(m_events)) {
-            ui->eventList->addItem(i);
-        }
+        m_event_model->setItem(m_event_model->rowCount(), createEventListItem(event_message));
     } else {
         qDebug() << "Unknown update type. Cannot update UI";
     }
@@ -270,6 +273,7 @@ void MainWindow::updateProcessResult(QString id, QString result) { // We need to
             return;
         }
     }
+    // If we didn't return, it's a new process:
 }
 
 void MainWindow::keyPressEvent(QKeyEvent *e) {

+ 13 - 0
style/style.css

@@ -0,0 +1,13 @@
+QPushButton {
+      border-style: outset;
+      border-width: 2px;
+      border-radius: 10px;
+      border-color: beige;
+      min-width: 10em;
+      padding: 6px;
+}
+
+QPushButton:hover
+{
+   opacity: 0.7;
+}

+ 0 - 12
style/style.qss

@@ -1,12 +0,0 @@
-QMainWindow {
-  font: 87 10pt "Noto Sans";
-  background-color: rgb(255, 85, 0);
-}
-
-QWidget {
-  border-color: rgb(0, 0, 0);
-  background-color: rgb(0, 43, 54);
-}
-
-
-QMessageBox { background-color: rgb(255, 255, 255); }

+ 302 - 106
ui_argdialog.h

@@ -16,165 +16,359 @@
 #include <QtWidgets/QDateTimeEdit>
 #include <QtWidgets/QDialog>
 #include <QtWidgets/QDialogButtonBox>
+#include <QtWidgets/QHBoxLayout>
 #include <QtWidgets/QHeaderView>
 #include <QtWidgets/QLabel>
 #include <QtWidgets/QPushButton>
+#include <QtWidgets/QSpacerItem>
 #include <QtWidgets/QTableWidget>
 #include <QtWidgets/QTextEdit>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QWidget>
 
 QT_BEGIN_NAMESPACE
 
 class Ui_ArgDialog
 {
 public:
-    QDialogButtonBox *argCommandButtons;
-    QPushButton *addArgument;
+    QWidget *verticalLayoutWidget;
+    QVBoxLayout *verticalLayout;
     QLabel *argDialogTitle;
-    QPushButton *addFile;
-    QLabel *label;
-    QTableWidget *argList;
+    QHBoxLayout *horizontalLayout;
     QLabel *label_2;
+    QComboBox *argType;
+    QHBoxLayout *horizontalLayout_2;
     QLabel *label_3;
-    QLabel *label_4;
     QTextEdit *argInput;
+    QPushButton *addArgument;
+    QHBoxLayout *horizontalLayout_3;
+    QLabel *label_4;
+    QPushButton *addFile;
+    QHBoxLayout *horizontalLayout_4;
     QLabel *label_5;
     QDateTimeEdit *dateTime;
-    QComboBox *argType;
+    QHBoxLayout *horizontalLayout_5;
     QPushButton *devTestButton;
+    QDialogButtonBox *argCommandButtons;
+    QWidget *verticalLayoutWidget_2;
+    QVBoxLayout *verticalLayout_2;
+    QLabel *label;
+    QHBoxLayout *horizontalLayout_6;
+    QSpacerItem *horizontalSpacer;
+    QTableWidget *argList;
+    QSpacerItem *horizontalSpacer_2;
+    QHBoxLayout *horizontalLayout_7;
+    QPushButton *default_args;
+    QPushButton *clear;
 
     void setupUi(QDialog *ArgDialog)
     {
         if (ArgDialog->objectName().isEmpty())
             ArgDialog->setObjectName(QString::fromUtf8("ArgDialog"));
-        ArgDialog->resize(608, 710);
+        ArgDialog->resize(1366, 671);
         QIcon icon;
         icon.addFile(QString::fromUtf8("favicon.ico"), QSize(), QIcon::Normal, QIcon::Off);
         ArgDialog->setWindowIcon(icon);
         ArgDialog->setStyleSheet(QString::fromUtf8("border-color: rgb(0, 0, 0);\n"
 "background-color: rgb(0, 43, 54);"));
-        argCommandButtons = new QDialogButtonBox(ArgDialog);
-        argCommandButtons->setObjectName(QString::fromUtf8("argCommandButtons"));
-        argCommandButtons->setGeometry(QRect(330, 510, 211, 32));
-        QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
-        sizePolicy.setHorizontalStretch(0);
-        sizePolicy.setVerticalStretch(0);
-        sizePolicy.setHeightForWidth(argCommandButtons->sizePolicy().hasHeightForWidth());
-        argCommandButtons->setSizePolicy(sizePolicy);
-        argCommandButtons->setLayoutDirection(Qt::LeftToRight);
-        argCommandButtons->setAutoFillBackground(false);
-        argCommandButtons->setStyleSheet(QString::fromUtf8("background-color: rgb(255, 85, 0);\n"
-"font: 87 11pt \"Noto Sans\";\n"
-"color: rgb(0, 43, 54);\n"
-"font-weight: 700;\n"
-"padding: 4px;"));
-        argCommandButtons->setOrientation(Qt::Horizontal);
-        argCommandButtons->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Save);
-        argCommandButtons->setCenterButtons(true);
-        addArgument = new QPushButton(ArgDialog);
-        addArgument->setObjectName(QString::fromUtf8("addArgument"));
-        addArgument->setGeometry(QRect(380, 190, 80, 26));
-        addArgument->setStyleSheet(QString::fromUtf8("background-color: rgb(255, 85, 0);\n"
-"font: 87 11pt \"Noto Sans\";\n"
-"color: rgb(0, 43, 54);\n"
-"font-weight: 700;\n"
-"padding: 4px;"));
-        argDialogTitle = new QLabel(ArgDialog);
+        verticalLayoutWidget = new QWidget(ArgDialog);
+        verticalLayoutWidget->setObjectName(QString::fromUtf8("verticalLayoutWidget"));
+        verticalLayoutWidget->setGeometry(QRect(10, 10, 701, 591));
+        verticalLayout = new QVBoxLayout(verticalLayoutWidget);
+        verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
+        verticalLayout->setContentsMargins(0, 0, 0, 0);
+        argDialogTitle = new QLabel(verticalLayoutWidget);
         argDialogTitle->setObjectName(QString::fromUtf8("argDialogTitle"));
-        argDialogTitle->setGeometry(QRect(210, 10, 231, 51));
         QFont font;
         font.setPointSize(22);
         font.setBold(true);
         font.setWeight(75);
         argDialogTitle->setFont(font);
-        argDialogTitle->setStyleSheet(QString::fromUtf8("color: rgb(170, 0, 255);"));
-        addFile = new QPushButton(ArgDialog);
-        addFile->setObjectName(QString::fromUtf8("addFile"));
-        addFile->setGeometry(QRect(190, 220, 80, 26));
-        addFile->setStyleSheet(QString::fromUtf8("background-color: rgb(255, 85, 0);\n"
-"font: 87 11pt \"Noto Sans\";\n"
-"color: rgb(0, 43, 54);\n"
-"font-weight: 700;\n"
-"padding: 4px;"));
-        label = new QLabel(ArgDialog);
-        label->setObjectName(QString::fromUtf8("label"));
-        label->setGeometry(QRect(60, 290, 111, 18));
-        label->setStyleSheet(QString::fromUtf8("font: 75 11pt \"Noto Sans\";\n"
-"color: rgb(131, 148, 150);\n"
-"font-weight: 700;"));
-        argList = new QTableWidget(ArgDialog);
-        if (argList->columnCount() < 2)
-            argList->setColumnCount(2);
-        argList->setObjectName(QString::fromUtf8("argList"));
-        argList->setGeometry(QRect(60, 320, 481, 171));
-        argList->setStyleSheet(QString::fromUtf8("font: 87 11pt \"Noto Sans\";\n"
-"background-color: rgb(7, 54, 66);\n"
-"color: rgb(131, 148, 150);\n"
-"font-weight: 700;\n"
+        argDialogTitle->setStyleSheet(QString::fromUtf8("color: rgb(170, 0, 255);\n"
+"color:  rgb(255, 85, 0);\n"
+" qproperty-alignment: 'AlignHCenter';\n"
 ""));
-        argList->setColumnCount(2);
-        argList->horizontalHeader()->setCascadingSectionResizes(false);
-        argList->horizontalHeader()->setMinimumSectionSize(100);
-        argList->horizontalHeader()->setDefaultSectionSize(200);
-        argList->verticalHeader()->setMinimumSectionSize(100);
-        argList->verticalHeader()->setDefaultSectionSize(100);
-        label_2 = new QLabel(ArgDialog);
+
+        verticalLayout->addWidget(argDialogTitle);
+
+        horizontalLayout = new QHBoxLayout();
+        horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
+        label_2 = new QLabel(verticalLayoutWidget);
         label_2->setObjectName(QString::fromUtf8("label_2"));
-        label_2->setGeometry(QRect(130, 80, 58, 18));
+        QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
+        sizePolicy.setHorizontalStretch(2);
+        sizePolicy.setVerticalStretch(0);
+        sizePolicy.setHeightForWidth(label_2->sizePolicy().hasHeightForWidth());
+        label_2->setSizePolicy(sizePolicy);
+        label_2->setMinimumSize(QSize(108, 0));
         label_2->setStyleSheet(QString::fromUtf8("font: 75 11pt \"Noto Sans\";\n"
 "color: rgb(131, 148, 150);\n"
 "font-weight: 700;"));
-        label_3 = new QLabel(ArgDialog);
+
+        horizontalLayout->addWidget(label_2);
+
+        argType = new QComboBox(verticalLayoutWidget);
+        argType->addItem(QString());
+        argType->addItem(QString());
+        argType->addItem(QString());
+        argType->addItem(QString());
+        argType->addItem(QString());
+        argType->setObjectName(QString::fromUtf8("argType"));
+        QSizePolicy sizePolicy1(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
+        sizePolicy1.setHorizontalStretch(0);
+        sizePolicy1.setVerticalStretch(0);
+        sizePolicy1.setHeightForWidth(argType->sizePolicy().hasHeightForWidth());
+        argType->setSizePolicy(sizePolicy1);
+        argType->setStyleSheet(QString::fromUtf8("font: 87 11pt \"Noto Sans\";\n"
+"background-color: #2f535f;\n"
+"color: rgb(131, 148, 150);\n"
+"font-weight: 700;\n"
+""));
+
+        horizontalLayout->addWidget(argType);
+
+
+        verticalLayout->addLayout(horizontalLayout);
+
+        horizontalLayout_2 = new QHBoxLayout();
+        horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
+        label_3 = new QLabel(verticalLayoutWidget);
         label_3->setObjectName(QString::fromUtf8("label_3"));
-        label_3->setGeometry(QRect(110, 130, 51, 20));
+        label_3->setMinimumSize(QSize(108, 0));
         label_3->setStyleSheet(QString::fromUtf8("font: 75 11pt \"Noto Sans\";\n"
 "color: rgb(131, 148, 150);\n"
-"font-weight: 700;"));
-        label_4 = new QLabel(ArgDialog);
-        label_4->setObjectName(QString::fromUtf8("label_4"));
-        label_4->setGeometry(QRect(60, 220, 101, 20));
-        label_4->setStyleSheet(QString::fromUtf8("font: 75 11pt \"Noto Sans\";\n"
-"color: rgb(131, 148, 150);\n"
-"font-weight: 700;"));
-        argInput = new QTextEdit(ArgDialog);
+"font-weight: 700;\n"
+" qproperty-alignment: 'AlignVLeft';"));
+
+        horizontalLayout_2->addWidget(label_3);
+
+        argInput = new QTextEdit(verticalLayoutWidget);
         argInput->setObjectName(QString::fromUtf8("argInput"));
-        argInput->setGeometry(QRect(190, 130, 281, 51));
         argInput->setStyleSheet(QString::fromUtf8("font: 87 11pt \"Noto Sans\";\n"
-"background-color: rgb(7, 54, 66);\n"
+"background-color: #2f535f;\n"
 "color: rgb(131, 148, 150);\n"
 "font-weight: 700;\n"
 ""));
-        label_5 = new QLabel(ArgDialog);
+
+        horizontalLayout_2->addWidget(argInput);
+
+
+        verticalLayout->addLayout(horizontalLayout_2);
+
+        addArgument = new QPushButton(verticalLayoutWidget);
+        addArgument->setObjectName(QString::fromUtf8("addArgument"));
+        addArgument->setStyleSheet(QString::fromUtf8("background-color: rgb(255, 85, 0);\n"
+"font: 87 11pt \"Noto Sans\";\n"
+"color: rgb(0, 43, 54);\n"
+"font-weight: 700;\n"
+"padding: 4px;\n"
+"border-style: outset;\n"
+"border-width: 2px;\n"
+"border-radius: 4px;\n"
+"border-color: #00000f;\n"
+"min-width: 4em;\n"
+"padding: 4px;"));
+
+        verticalLayout->addWidget(addArgument);
+
+        horizontalLayout_3 = new QHBoxLayout();
+        horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3"));
+        label_4 = new QLabel(verticalLayoutWidget);
+        label_4->setObjectName(QString::fromUtf8("label_4"));
+        QSizePolicy sizePolicy2(QSizePolicy::Fixed, QSizePolicy::Preferred);
+        sizePolicy2.setHorizontalStretch(0);
+        sizePolicy2.setVerticalStretch(0);
+        sizePolicy2.setHeightForWidth(label_4->sizePolicy().hasHeightForWidth());
+        label_4->setSizePolicy(sizePolicy2);
+        label_4->setMinimumSize(QSize(196, 0));
+        label_4->setStyleSheet(QString::fromUtf8("font: 75 11pt \"Noto Sans\";\n"
+"color: rgb(131, 148, 150);\n"
+"font-weight: 700;"));
+
+        horizontalLayout_3->addWidget(label_4, 0, Qt::AlignVCenter);
+
+        addFile = new QPushButton(verticalLayoutWidget);
+        addFile->setObjectName(QString::fromUtf8("addFile"));
+        addFile->setStyleSheet(QString::fromUtf8("background-color: rgb(255, 85, 0);\n"
+"font: 87 11pt \"Noto Sans\";\n"
+"color: rgb(0, 43, 54);\n"
+"font-weight: 700;\n"
+"padding: 4px;\n"
+"border-style: outset;\n"
+"border-width: 2px;\n"
+"border-radius: 4px;\n"
+"border-color: #00000f;\n"
+"min-width: 4em;\n"
+"padding: 4px;"));
+
+        horizontalLayout_3->addWidget(addFile);
+
+
+        verticalLayout->addLayout(horizontalLayout_3);
+
+        horizontalLayout_4 = new QHBoxLayout();
+        horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4"));
+        label_5 = new QLabel(verticalLayoutWidget);
         label_5->setObjectName(QString::fromUtf8("label_5"));
-        label_5->setGeometry(QRect(120, 260, 41, 20));
+        sizePolicy2.setHeightForWidth(label_5->sizePolicy().hasHeightForWidth());
+        label_5->setSizePolicy(sizePolicy2);
+        label_5->setMinimumSize(QSize(52, 0));
         label_5->setStyleSheet(QString::fromUtf8("font: 75 11pt \"Noto Sans\";\n"
 "color: rgb(131, 148, 150);\n"
-"font-weight: 700;"));
-        dateTime = new QDateTimeEdit(ArgDialog);
+"font-weight: 700;\n"
+" qproperty-alignment: 'AlignHCenter';"));
+
+        horizontalLayout_4->addWidget(label_5, 0, Qt::AlignVCenter);
+
+        dateTime = new QDateTimeEdit(verticalLayoutWidget);
         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("font: 87 11pt \"Noto Sans\";\n"
-"background-color: rgb(7, 54, 66);\n"
-"color: rgb(131, 148, 150);\n"
+        sizePolicy1.setHeightForWidth(dateTime->sizePolicy().hasHeightForWidth());
+        dateTime->setSizePolicy(sizePolicy1);
+        dateTime->setMinimumSize(QSize(380, 38));
+        dateTime->setStyleSheet(QString::fromUtf8("background-color: #00000f;\n"
+"color: #2f535f;\n"
 "font-weight: 700;\n"
-""));
-        devTestButton = new QPushButton(ArgDialog);
+"font-size: 16pt;"));
+
+        horizontalLayout_4->addWidget(dateTime, 0, Qt::AlignRight);
+
+
+        verticalLayout->addLayout(horizontalLayout_4);
+
+        horizontalLayout_5 = new QHBoxLayout();
+        horizontalLayout_5->setObjectName(QString::fromUtf8("horizontalLayout_5"));
+        devTestButton = new QPushButton(verticalLayoutWidget);
         devTestButton->setObjectName(QString::fromUtf8("devTestButton"));
-        devTestButton->setGeometry(QRect(240, 590, 81, 31));
         devTestButton->setStyleSheet(QString::fromUtf8("background-color: rgb(130, 255, 121);\n"
 "background-color: rgb(2, 180, 43);\n"
 "font: 87 11pt \"Noto Sans\";\n"
 "color: rgb(0, 0, 0);\n"
 "font-weight: 700;\n"
+"padding: 4px;\n"
+"border-style: outset;\n"
+"border-width: 2px;\n"
+"border-radius: 4px;\n"
+"border-color: #00000f;\n"
+"min-width: 4em;\n"
+"padding: 4px;"));
+
+        horizontalLayout_5->addWidget(devTestButton);
+
+        argCommandButtons = new QDialogButtonBox(verticalLayoutWidget);
+        argCommandButtons->setObjectName(QString::fromUtf8("argCommandButtons"));
+        QSizePolicy sizePolicy3(QSizePolicy::Fixed, QSizePolicy::Fixed);
+        sizePolicy3.setHorizontalStretch(0);
+        sizePolicy3.setVerticalStretch(0);
+        sizePolicy3.setHeightForWidth(argCommandButtons->sizePolicy().hasHeightForWidth());
+        argCommandButtons->setSizePolicy(sizePolicy3);
+        argCommandButtons->setLayoutDirection(Qt::LeftToRight);
+        argCommandButtons->setAutoFillBackground(false);
+        argCommandButtons->setStyleSheet(QString::fromUtf8("background-color: rgb(255, 85, 0);\n"
+"font: 87 11pt \"Noto Sans\";\n"
+"color: rgb(0, 43, 54);\n"
+"font-weight: 700;\n"
+"padding: 4px;\n"
+"border-style: outset;\n"
+"border-width: 2px;\n"
+"border-radius: 4px;\n"
+"border-color: #00000f;\n"
+"min-width: 4em;\n"
+"padding: 4px;"));
+        argCommandButtons->setOrientation(Qt::Horizontal);
+        argCommandButtons->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Save);
+        argCommandButtons->setCenterButtons(true);
+
+        horizontalLayout_5->addWidget(argCommandButtons);
+
+
+        verticalLayout->addLayout(horizontalLayout_5);
+
+        verticalLayout->setStretch(2, 1);
+        verticalLayoutWidget_2 = new QWidget(ArgDialog);
+        verticalLayoutWidget_2->setObjectName(QString::fromUtf8("verticalLayoutWidget_2"));
+        verticalLayoutWidget_2->setGeometry(QRect(710, 10, 641, 591));
+        verticalLayout_2 = new QVBoxLayout(verticalLayoutWidget_2);
+        verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
+        verticalLayout_2->setContentsMargins(0, 0, 0, 0);
+        label = new QLabel(verticalLayoutWidget_2);
+        label->setObjectName(QString::fromUtf8("label"));
+        label->setStyleSheet(QString::fromUtf8("font: 75 11pt \"Noto Sans\";\n"
+"color: rgb(131, 148, 150);\n"
+"font-weight: 700;\n"
+"padding-left: 8px;"));
+
+        verticalLayout_2->addWidget(label);
+
+        horizontalLayout_6 = new QHBoxLayout();
+        horizontalLayout_6->setObjectName(QString::fromUtf8("horizontalLayout_6"));
+        horizontalSpacer = new QSpacerItem(20, 20, QSizePolicy::Maximum, QSizePolicy::Minimum);
+
+        horizontalLayout_6->addItem(horizontalSpacer);
+
+        argList = new QTableWidget(verticalLayoutWidget_2);
+        if (argList->columnCount() < 3)
+            argList->setColumnCount(3);
+        argList->setObjectName(QString::fromUtf8("argList"));
+        argList->setStyleSheet(QString::fromUtf8("font: 87 11pt \"Noto Sans\";\n"
+"background-color: #2f535f;\n"
+"color: rgb(131, 148, 150);\n"
+"font-weight: 700;\n"
+"padding-left: 2px;"));
+        argList->setShowGrid(true);
+        argList->setColumnCount(3);
+        argList->horizontalHeader()->setCascadingSectionResizes(false);
+        argList->horizontalHeader()->setMinimumSectionSize(100);
+        argList->horizontalHeader()->setDefaultSectionSize(200);
+        argList->verticalHeader()->setMinimumSectionSize(100);
+        argList->verticalHeader()->setDefaultSectionSize(100);
+
+        horizontalLayout_6->addWidget(argList);
+
+        horizontalSpacer_2 = new QSpacerItem(20, 20, QSizePolicy::Maximum, QSizePolicy::Minimum);
+
+        horizontalLayout_6->addItem(horizontalSpacer_2);
+
+
+        verticalLayout_2->addLayout(horizontalLayout_6);
+
+        horizontalLayout_7 = new QHBoxLayout();
+        horizontalLayout_7->setObjectName(QString::fromUtf8("horizontalLayout_7"));
+        default_args = new QPushButton(verticalLayoutWidget_2);
+        default_args->setObjectName(QString::fromUtf8("default_args"));
+        default_args->setStyleSheet(QString::fromUtf8("background-color: rgb(255, 85, 0);\n"
+"font: 87 11pt \"Noto Sans\";\n"
+"color: rgb(0, 43, 54);\n"
+"font-weight: 700;\n"
+"padding: 4px;\n"
+"border-style: outset;\n"
+"border-width: 2px;\n"
+"border-radius: 4px;\n"
+"border-color: #00000f;\n"
+"min-width: 4em;\n"
+"padding: 4px;"));
+
+        horizontalLayout_7->addWidget(default_args);
+
+        clear = new QPushButton(verticalLayoutWidget_2);
+        clear->setObjectName(QString::fromUtf8("clear"));
+        clear->setStyleSheet(QString::fromUtf8("background-color: rgb(255, 85, 0);\n"
+"font: 87 11pt \"Noto Sans\";\n"
+"color: rgb(0, 43, 54);\n"
+"font-weight: 700;\n"
+"padding: 4px;\n"
+"border-style: outset;\n"
+"border-width: 2px;\n"
+"border-radius: 4px;\n"
+"border-color: #00000f;\n"
+"min-width: 4em;\n"
 "padding: 4px;"));
 
+        horizontalLayout_7->addWidget(clear);
+
+
+        verticalLayout_2->addLayout(horizontalLayout_7);
+
+
         retranslateUi(ArgDialog);
         QObject::connect(argCommandButtons, SIGNAL(accepted()), ArgDialog, SLOT(accept()));
         QObject::connect(argCommandButtons, SIGNAL(rejected()), ArgDialog, SLOT(reject()));
@@ -185,21 +379,23 @@ public:
     void retranslateUi(QDialog *ArgDialog)
     {
         ArgDialog->setWindowTitle(QCoreApplication::translate("ArgDialog", "Dialog", nullptr));
-        addArgument->setText(QCoreApplication::translate("ArgDialog", "Add", nullptr));
         argDialogTitle->setText(QCoreApplication::translate("ArgDialog", "Add Arguments", nullptr));
-        addFile->setText(QCoreApplication::translate("ArgDialog", "File", nullptr));
-        label->setText(QCoreApplication::translate("ArgDialog", "Items to send", nullptr));
         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));
+        label_3->setText(QCoreApplication::translate("ArgDialog", "Input", nullptr));
+        addArgument->setText(QCoreApplication::translate("ArgDialog", "Add", nullptr));
+        label_4->setText(QCoreApplication::translate("ArgDialog", "Add file attachment", nullptr));
+        addFile->setText(QCoreApplication::translate("ArgDialog", "Choose", nullptr));
+        label_5->setText(QCoreApplication::translate("ArgDialog", "Time", nullptr));
+        devTestButton->setText(QCoreApplication::translate("ArgDialog", "DEV TEST", nullptr));
+        label->setText(QCoreApplication::translate("ArgDialog", "Items to send", nullptr));
+        default_args->setText(QCoreApplication::translate("ArgDialog", "Default", nullptr));
+        clear->setText(QCoreApplication::translate("ArgDialog", "Clear", nullptr));
     } // retranslateUi
 
 };