From b59866c5f37137d4356525941c2fc0e2f26f96cc Mon Sep 17 00:00:00 2001 From: DoITCreative <> Date: Tue, 14 May 2019 18:16:26 +0300 Subject: [PATCH] UI fix --- aboutwindow.h | 6 +-- eepromwindow.cpp | 2 +- eepromwindow.h | 5 +- erroricon.h | 3 +- errorwindow.h | 5 +- main.cpp | 2 +- mainwindow.cpp | 2 - mainwindow.h | 5 +- mainwindow.ui | 116 +++++++++++++++++++++++++--------------------- parser.h | 3 +- repraptor.h | 2 +- sdwindow.h | 6 +-- sender.h | 5 +- settingswindow.h | 5 +- settingswindow.ui | 27 ++++++++--- 15 files changed, 103 insertions(+), 91 deletions(-) diff --git a/aboutwindow.h b/aboutwindow.h index 3acfa76..0ce8337 100644 --- a/aboutwindow.h +++ b/aboutwindow.h @@ -1,12 +1,10 @@ #ifndef ABOUTWINDOW_H #define ABOUTWINDOW_H - #include - #include "repraptor.h" namespace Ui { -class AboutWindow; + class AboutWindow; } class AboutWindow : public QDialog @@ -14,7 +12,7 @@ class AboutWindow : public QDialog Q_OBJECT public: - explicit AboutWindow(QWidget *parent = 0); + explicit AboutWindow(QWidget *parent = nullptr); ~AboutWindow(); private: diff --git a/eepromwindow.cpp b/eepromwindow.cpp index 555641a..c15a74c 100644 --- a/eepromwindow.cpp +++ b/eepromwindow.cpp @@ -53,7 +53,7 @@ EEPROMWindow::EEPROMWindow(QStringList eepromLines, QWidget *parent) : { case 0: edit->setValidator(new QIntValidator(-128, 255, this)); - case 1: + break; case 2: edit->setValidator(new QIntValidator(this)); break; diff --git a/eepromwindow.h b/eepromwindow.h index aa4b657..5602a17 100644 --- a/eepromwindow.h +++ b/eepromwindow.h @@ -1,6 +1,5 @@ #ifndef EEPROMWINDOW_H #define EEPROMWINDOW_H - #include #include @@ -9,7 +8,7 @@ using namespace RepRaptor; namespace Ui { -class EEPROMWindow; + class EEPROMWindow; } class EEPROMWindow : public QDialog @@ -17,7 +16,7 @@ class EEPROMWindow : public QDialog Q_OBJECT public: - explicit EEPROMWindow(QStringList eepromLines, QWidget *parent = 0); + explicit EEPROMWindow(QStringList eepromLines, QWidget *parent = nullptr); ~EEPROMWindow(); private: diff --git a/erroricon.h b/erroricon.h index 6693ec6..8797034 100644 --- a/erroricon.h +++ b/erroricon.h @@ -1,6 +1,5 @@ #ifndef ERRORICON_H #define ERRORICON_H - #include #include #include @@ -9,7 +8,7 @@ class ErrorIcon : public QWidget { Q_OBJECT public: - explicit ErrorIcon(QWidget *parent = 0); + explicit ErrorIcon(QWidget *parent = nullptr); ~ErrorIcon(); QTimer *animation; QString frame; diff --git a/errorwindow.h b/errorwindow.h index 2a59b22..eb347fd 100644 --- a/errorwindow.h +++ b/errorwindow.h @@ -1,13 +1,12 @@ #ifndef ERRORWINDOW_H #define ERRORWINDOW_H - #include #include "erroricon.h" #include "repraptor.h" namespace Ui { -class ErrorWindow; + class ErrorWindow; } class ErrorWindow : public QDialog @@ -15,7 +14,7 @@ class ErrorWindow : public QDialog Q_OBJECT public: - explicit ErrorWindow(QWidget *parent = 0, QString errorText = "Unknown error", int errType = 0); + explicit ErrorWindow(QWidget *parent = nullptr, QString errorText = "Unknown error", int errType = 0); ~ErrorWindow(); private: diff --git a/main.cpp b/main.cpp index 2ed518c..3292fcb 100644 --- a/main.cpp +++ b/main.cpp @@ -15,5 +15,5 @@ int main(int argc, char *argv[]) MainWindow w; w.show(); - return a.exec(); + return QApplication::exec(); } diff --git a/mainwindow.cpp b/mainwindow.cpp index 12ae90a..76f330a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -6,7 +6,6 @@ MainWindow::MainWindow(QWidget *parent) : ui(new Ui::MainWindow) { ui->setupUi(this); - //Set parents settings.setParent(this); gfile.setParent(this); @@ -207,7 +206,6 @@ MainWindow::~MainWindow() parserThread->wait(); senderThread->quit(); senderThread->wait(); - delete ui; } diff --git a/mainwindow.h b/mainwindow.h index ae95043..935e230 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -1,6 +1,5 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H - #include #include #include @@ -26,7 +25,7 @@ using namespace RepRaptor; namespace Ui { -class MainWindow; + class MainWindow; } class MainWindow : public QMainWindow @@ -34,7 +33,7 @@ class MainWindow : public QMainWindow Q_OBJECT public: - explicit MainWindow(QWidget *parent = 0); + explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); Parser *parserWorker; diff --git a/mainwindow.ui b/mainwindow.ui index db2cc91..aace310 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 791 - 514 + 800 + 600 @@ -16,6 +16,12 @@ 0 + + + 800 + 600 + + RepRaptor @@ -35,7 +41,7 @@ - 200 + 250 16777215 @@ -83,15 +89,21 @@ - + 0 0 + + + 0 + 0 + + - 261 - 500 + 320 + 16777215 @@ -314,7 +326,7 @@ - 9 + 12 @@ -354,34 +366,6 @@ - - - - Fan On - - - - - - - Fan Off - - - - - - - ATX On - - - - - - - ATX Off - - - @@ -462,6 +446,47 @@ + + + + + 16777215 + 15 + + + + Step Increment + + + + + + + Fan Off + + + + + + + ATX Off + + + + + + + ATX On + + + + + + + Fan On + + + @@ -897,19 +922,6 @@ STOP - - - - - 16777215 - 15 - - - - Step Increment - - - @@ -971,7 +983,7 @@ STOP - 200 + 250 16777215 @@ -1051,7 +1063,7 @@ STOP - 200 + 250 16777215 @@ -1129,8 +1141,8 @@ STOP 0 0 - 791 - 20 + 800 + 24 diff --git a/parser.h b/parser.h index e366304..0186698 100644 --- a/parser.h +++ b/parser.h @@ -1,6 +1,5 @@ #ifndef PARSETHREAD_H #define PARSETHREAD_H - #include #include @@ -13,7 +12,7 @@ class Parser : public QObject Q_OBJECT public: - explicit Parser(QObject *parent = 0); + explicit Parser(QObject *parent = nullptr); ~Parser(); protected: diff --git a/repraptor.h b/repraptor.h index 17b6e90..ce88b3f 100644 --- a/repraptor.h +++ b/repraptor.h @@ -4,10 +4,10 @@ #ifndef REPRAPTOR_H #define REPRAPTOR_H - #ifndef REPRAPTOR_VERSION #define REPRAPTOR_VERSION "0.3.9" #endif +#include namespace RepRaptor { diff --git a/sdwindow.h b/sdwindow.h index 8bc92de..aeb0872 100644 --- a/sdwindow.h +++ b/sdwindow.h @@ -1,10 +1,9 @@ #ifndef SDWINDOW_H #define SDWINDOW_H - #include namespace Ui { -class SDWindow; + class SDWindow; } class SDWindow : public QDialog @@ -12,7 +11,7 @@ class SDWindow : public QDialog Q_OBJECT public: - explicit SDWindow(QStringList files, QWidget *parent = 0); + explicit SDWindow(QStringList files, QWidget *parent = nullptr); ~SDWindow(); signals: @@ -20,7 +19,6 @@ class SDWindow : public QDialog private slots: void on_buttonBox_accepted(); - void on_fileslist_doubleClicked(const QModelIndex &); private: diff --git a/sender.h b/sender.h index 30f2dbc..679daa1 100644 --- a/sender.h +++ b/sender.h @@ -1,6 +1,5 @@ #ifndef SENDER_H #define SENDER_H - #include #include #include @@ -8,7 +7,6 @@ #include #include #include - #include "repraptor.h" using namespace RepRaptor; @@ -17,7 +15,7 @@ class Sender : public QObject { Q_OBJECT public: - explicit Sender(QObject *parent = 0); + explicit Sender(QObject *parent = nullptr); ~Sender(); protected: @@ -37,7 +35,6 @@ class Sender : public QObject QQueue userCommands; QStringList sentCommands; QVector gcode; - bool sendLine(QString s); signals: diff --git a/settingswindow.h b/settingswindow.h index ad03d5e..b90d1a1 100644 --- a/settingswindow.h +++ b/settingswindow.h @@ -1,6 +1,5 @@ #ifndef SETTINGSWINDOW_H #define SETTINGSWINDOW_H - #include #include #include "repraptor.h" @@ -8,7 +7,7 @@ using namespace RepRaptor; namespace Ui { -class SettingsWindow; + class SettingsWindow; } class SettingsWindow : public QDialog @@ -16,7 +15,7 @@ class SettingsWindow : public QDialog Q_OBJECT public: - explicit SettingsWindow(QWidget *parent = 0); + explicit SettingsWindow(QWidget *parent = nullptr); QSettings settings; diff --git a/settingswindow.ui b/settingswindow.ui index a33dfe3..7aab89b 100644 --- a/settingswindow.ui +++ b/settingswindow.ui @@ -6,10 +6,16 @@ 0 0 - 603 - 491 + 330 + 550 + + + 330 + 550 + + Settings @@ -27,7 +33,7 @@ - 0 + 2 @@ -232,12 +238,12 @@ 10 20 - 249 - 171 + 291 + 191 - + 0 0 @@ -261,6 +267,9 @@ X + + Qt::AlignCenter + @@ -309,6 +318,12 @@ + + + 0 + 0 + + Extruder feedrate