From 049171cd8f554f8ce544537fc7c10306a93b8308 Mon Sep 17 00:00:00 2001
From: Jake <j@kedrahos.com>
Date: Fri, 14 Apr 2017 19:02:29 -0500
Subject: [PATCH] Work on GUI

---
 groundStation/gui/MicroCART/mainwindow.cpp | 10 ++--------
 groundStation/gui/MicroCART/mainwindow.h   |  2 --
 groundStation/gui/MicroCART/mainwindow.ui  |  2 +-
 3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/groundStation/gui/MicroCART/mainwindow.cpp b/groundStation/gui/MicroCART/mainwindow.cpp
index 7846be25d..b4fbee582 100644
--- a/groundStation/gui/MicroCART/mainwindow.cpp
+++ b/groundStation/gui/MicroCART/mainwindow.cpp
@@ -26,9 +26,6 @@ MainWindow::MainWindow(QWidget *parent) :
     /* Set up environment variables */
     findChild<QLineEdit *>("socketPath")->setText(QProcessEnvironment::systemEnvironment().value("UCART_SOCKET"));
 
-    /* Idiot lights */
-    findChild<QLabel *>("noGraphWarning1")->setStyleSheet("QLabel {color : red; }");
-
     /* Create a thread for workers */
     QThread* workerThread = new QThread(this);
 
@@ -119,6 +116,7 @@ void MainWindow::updateTracker(float x, float y, float z, float p, float r, floa
 
 void MainWindow::on_pbStart_clicked()
 {
+    QProcessEnvironment::systemEnvironment().insert("UCART_SOCKET", findChild<QLineEdit *>("socketPath")->text());
     this->backendPid = startBackend(findChild<QLineEdit *>("backendPath")->text().toStdString().c_str(), &backendPipe);
     findChild<QPushButton *>("pbStart")->setEnabled(false);
     findChild<QPushButton *>("pbStop")->setEnabled(true);
@@ -127,6 +125,7 @@ void MainWindow::on_pbStart_clicked()
 
 void MainWindow::on_pbConnect_clicked()
 {
+    QProcessEnvironment::systemEnvironment().insert("UCART_SOCKET", findChild<QLineEdit *>("socketPath")->text());
     findChild<QPushButton *>("pbStart")->setEnabled(false);
     findChild<QPushButton *>("pbConnect")->setEnabled(false);
     findChild<QPushButton *>("pbStop")->setEnabled(true);
@@ -299,8 +298,3 @@ void MainWindow::newControlGraph(QString graph)
 {
     findChild<QLabel *>("graphImage")->setPixmap(QPixmap(graph));
 }
-
-void MainWindow::on_socketPath_returnPressed()
-{
-    QProcessEnvironment::systemEnvironment().insert("UCART_SOCKET", findChild<QLineEdit *>("socketPath")->text());
-}
diff --git a/groundStation/gui/MicroCART/mainwindow.h b/groundStation/gui/MicroCART/mainwindow.h
index 95d901e51..8e7d0351e 100644
--- a/groundStation/gui/MicroCART/mainwindow.h
+++ b/groundStation/gui/MicroCART/mainwindow.h
@@ -57,8 +57,6 @@ private slots:
 
     void on_pbDeleteSetpoint_clicked();
 
-    void on_socketPath_returnPressed();
-
 private:
     Ui::MainWindow *ui;
     pid_t backendPid;
diff --git a/groundStation/gui/MicroCART/mainwindow.ui b/groundStation/gui/MicroCART/mainwindow.ui
index 16d9d4abf..d2a155240 100644
--- a/groundStation/gui/MicroCART/mainwindow.ui
+++ b/groundStation/gui/MicroCART/mainwindow.ui
@@ -37,7 +37,7 @@
           <item row="0" column="1">
            <widget class="QLineEdit" name="socketPath">
             <property name="enabled">
-             <bool>true</bool>
+             <bool>false</bool>
             </property>
            </widget>
           </item>
-- 
GitLab