13 changed files with 67 additions and 585 deletions
@ -1,14 +0,0 @@
@@ -1,14 +0,0 @@
|
||||
#include "QGCWelcomeWidget.h" |
||||
#include "ui_QGCWelcomeWidget.h" |
||||
|
||||
QGCWelcomeWidget::QGCWelcomeWidget(QWidget *parent) : |
||||
QWidget(parent), |
||||
ui(new Ui::QGCWelcomeWidget) |
||||
{ |
||||
ui->setupUi(this); |
||||
} |
||||
|
||||
QGCWelcomeWidget::~QGCWelcomeWidget() |
||||
{ |
||||
delete ui; |
||||
} |
@ -1,22 +0,0 @@
@@ -1,22 +0,0 @@
|
||||
#ifndef QGCWELCOMEWIDGET_H |
||||
#define QGCWELCOMEWIDGET_H |
||||
|
||||
#include <QWidget> |
||||
|
||||
namespace Ui { |
||||
class QGCWelcomeWidget; |
||||
} |
||||
|
||||
class QGCWelcomeWidget : public QWidget |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
explicit QGCWelcomeWidget(QWidget *parent = 0); |
||||
~QGCWelcomeWidget(); |
||||
|
||||
private: |
||||
Ui::QGCWelcomeWidget *ui; |
||||
}; |
||||
|
||||
#endif // QGCWELCOMEWIDGET_H
|
@ -1,66 +0,0 @@
@@ -1,66 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<ui version="4.0"> |
||||
<class>QGCWelcomeWidget</class> |
||||
<widget class="QWidget" name="QGCWelcomeWidget"> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>400</width> |
||||
<height>300</height> |
||||
</rect> |
||||
</property> |
||||
<property name="windowTitle"> |
||||
<string>Form</string> |
||||
</property> |
||||
<layout class="QGridLayout" name="gridLayout"> |
||||
<property name="leftMargin"> |
||||
<number>30</number> |
||||
</property> |
||||
<property name="rightMargin"> |
||||
<number>30</number> |
||||
</property> |
||||
<item row="0" column="0"> |
||||
<widget class="QToolButton" name="connectButton"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>100</width> |
||||
<height>100</height> |
||||
</size> |
||||
</property> |
||||
<property name="text"> |
||||
<string>...</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="0" column="1"> |
||||
<widget class="QToolButton" name="logreplayButton"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>100</width> |
||||
<height>100</height> |
||||
</size> |
||||
</property> |
||||
<property name="text"> |
||||
<string>...</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="0" column="2"> |
||||
<widget class="QToolButton" name="demoButton"> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>100</width> |
||||
<height>100</height> |
||||
</size> |
||||
</property> |
||||
<property name="text"> |
||||
<string>...</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
</layout> |
||||
</widget> |
||||
<resources/> |
||||
<connections/> |
||||
</ui> |
@ -1,47 +0,0 @@
@@ -1,47 +0,0 @@
|
||||
#include "QGCViewModeSelection.h" |
||||
#include "ui_QGCViewModeSelection.h" |
||||
#include "QGC.h" |
||||
#include "MainWindow.h" |
||||
|
||||
QGCViewModeSelection::QGCViewModeSelection(QWidget *parent) : |
||||
QWidget(parent), |
||||
ui(new Ui::QGCViewModeSelection), |
||||
selected(false) |
||||
{ |
||||
ui->setupUi(this); |
||||
|
||||
connect(ui->viewModeGeneric, SIGNAL(clicked()), this, SLOT(selectGeneric())); |
||||
connect(ui->viewModeAR, SIGNAL(clicked()), this, SLOT(selectWifi())); |
||||
connect(ui->viewModePX4, SIGNAL(clicked()), this, SLOT(selectPX4())); |
||||
connect(ui->notAgainCheckBox, SIGNAL(clicked(bool)), this, SIGNAL(settingsStorageRequested(bool))); |
||||
} |
||||
|
||||
QGCViewModeSelection::~QGCViewModeSelection() |
||||
{ |
||||
delete ui; |
||||
} |
||||
|
||||
enum MainWindow::CUSTOM_MODE QGCViewModeSelection::waitForInput() { |
||||
while (!selected) |
||||
QGC::SLEEP::msleep(200); |
||||
|
||||
return mode; |
||||
} |
||||
|
||||
void QGCViewModeSelection::selectGeneric() { |
||||
emit customViewModeSelected(MainWindow::CUSTOM_MODE_NONE); |
||||
mode = MainWindow::CUSTOM_MODE_NONE; |
||||
selected = true; |
||||
} |
||||
|
||||
void QGCViewModeSelection::selectWifi() { |
||||
emit customViewModeSelected(MainWindow::CUSTOM_MODE_WIFI); |
||||
mode = MainWindow::CUSTOM_MODE_WIFI; |
||||
selected = true; |
||||
} |
||||
|
||||
void QGCViewModeSelection::selectPX4() { |
||||
emit customViewModeSelected(MainWindow::CUSTOM_MODE_PX4); |
||||
mode = MainWindow::CUSTOM_MODE_PX4; |
||||
selected = true; |
||||
} |
@ -1,37 +0,0 @@
@@ -1,37 +0,0 @@
|
||||
#ifndef QGCVIEWMODESELECTION_H |
||||
#define QGCVIEWMODESELECTION_H |
||||
|
||||
#include <QWidget> |
||||
#include "MainWindow.h" |
||||
|
||||
namespace Ui { |
||||
class QGCViewModeSelection; |
||||
} |
||||
|
||||
class QGCViewModeSelection : public QWidget |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
explicit QGCViewModeSelection(QWidget *parent = 0); |
||||
~QGCViewModeSelection(); |
||||
|
||||
enum MainWindow::CUSTOM_MODE waitForInput(); |
||||
|
||||
public slots: |
||||
|
||||
void selectGeneric(); |
||||
void selectPX4(); |
||||
void selectWifi(); |
||||
|
||||
signals: |
||||
void customViewModeSelected(enum MainWindow::CUSTOM_MODE mode); |
||||
void settingsStorageRequested(bool requested); |
||||
|
||||
private: |
||||
Ui::QGCViewModeSelection *ui; |
||||
bool selected; |
||||
enum MainWindow::CUSTOM_MODE mode; |
||||
}; |
||||
|
||||
#endif // QGCVIEWMODESELECTION_H
|
@ -1,167 +0,0 @@
@@ -1,167 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<ui version="4.0"> |
||||
<class>QGCViewModeSelection</class> |
||||
<widget class="QWidget" name="QGCViewModeSelection"> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>750</width> |
||||
<height>409</height> |
||||
</rect> |
||||
</property> |
||||
<property name="windowTitle"> |
||||
<string>Form</string> |
||||
</property> |
||||
<layout class="QGridLayout" name="gridLayout_2"> |
||||
<item row="3" column="1"> |
||||
<widget class="QCheckBox" name="notAgainCheckBox"> |
||||
<property name="text"> |
||||
<string>Do not ask again on next startup. The selection can be changed any time in the preferences.</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="2" column="0"> |
||||
<spacer name="horizontalSpacer"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>47</width> |
||||
<height>20</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
<item row="2" column="2"> |
||||
<spacer name="horizontalSpacer_2"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>46</width> |
||||
<height>20</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
<item row="2" column="1"> |
||||
<widget class="QWidget" name="viewModeWidget" native="true"> |
||||
<layout class="QGridLayout" name="gridLayout"> |
||||
<item row="1" column="1"> |
||||
<widget class="QPushButton" name="viewModeAR"> |
||||
<property name="text"> |
||||
<string/> |
||||
</property> |
||||
<property name="icon"> |
||||
<iconset resource="../../../qgroundcontrol.qrc"> |
||||
<normaloff>:/files/images/actions/qgroundcontrol-wifi.svg</normaloff>:/files/images/actions/qgroundcontrol-wifi.svg</iconset> |
||||
</property> |
||||
<property name="iconSize"> |
||||
<size> |
||||
<width>120</width> |
||||
<height>120</height> |
||||
</size> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="2" column="2"> |
||||
<widget class="QLabel" name="label_2"> |
||||
<property name="text"> |
||||
<string>PX4 Autopilot</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="2" column="1"> |
||||
<widget class="QLabel" name="label_4"> |
||||
<property name="text"> |
||||
<string>WiFi / UDP</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="1" column="2"> |
||||
<widget class="QPushButton" name="viewModePX4"> |
||||
<property name="text"> |
||||
<string/> |
||||
</property> |
||||
<property name="icon"> |
||||
<iconset resource="../../../qgroundcontrol.qrc"> |
||||
<normaloff>:/files/images/actions/qgroundcontrol-px4.svg</normaloff>:/files/images/actions/qgroundcontrol-px4.svg</iconset> |
||||
</property> |
||||
<property name="iconSize"> |
||||
<size> |
||||
<width>120</width> |
||||
<height>120</height> |
||||
</size> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="1" column="0"> |
||||
<widget class="QPushButton" name="viewModeGeneric"> |
||||
<property name="text"> |
||||
<string/> |
||||
</property> |
||||
<property name="icon"> |
||||
<iconset resource="../../../qgroundcontrol.qrc"> |
||||
<normaloff>:/files/images/actions/qgroundcontrol-generic.svg</normaloff>:/files/images/actions/qgroundcontrol-generic.svg</iconset> |
||||
</property> |
||||
<property name="iconSize"> |
||||
<size> |
||||
<width>120</width> |
||||
<height>120</height> |
||||
</size> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="2" column="0"> |
||||
<widget class="QLabel" name="label"> |
||||
<property name="text"> |
||||
<string>Radio / Serial Link</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
</layout> |
||||
</widget> |
||||
</item> |
||||
<item row="1" column="1"> |
||||
<widget class="QLabel" name="viewModeHintLabel"> |
||||
<property name="text"> |
||||
<string>Please select the connection or autopilot you want to use QGroundControl with.</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item row="5" column="1"> |
||||
<spacer name="verticalSpacer_2"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Vertical</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>20</width> |
||||
<height>76</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
<item row="0" column="1"> |
||||
<spacer name="verticalSpacer"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Vertical</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>20</width> |
||||
<height>76</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
</layout> |
||||
</widget> |
||||
<resources> |
||||
<include location="../../../qgroundcontrol.qrc"/> |
||||
</resources> |
||||
<connections/> |
||||
</ui> |
@ -1,48 +0,0 @@
@@ -1,48 +0,0 @@
|
||||
#include "QGCWelcomeMainWindow.h" |
||||
#include "ui_QGCWelcomeMainWindow.h" |
||||
#include "MainWindow.h" |
||||
#include "QGCViewModeSelection.h" |
||||
|
||||
QGCWelcomeMainWindow::QGCWelcomeMainWindow(QWidget *parent) : |
||||
QMainWindow(parent), |
||||
ui(new Ui::QGCWelcomeMainWindow), |
||||
storeSettings(false) |
||||
{ |
||||
ui->setupUi(this); |
||||
|
||||
QString windowname = qApp->applicationName() + " " + qApp->applicationVersion(); |
||||
setWindowTitle(windowname); |
||||
|
||||
viewModeSelection = new QGCViewModeSelection(this); |
||||
|
||||
connect(viewModeSelection, SIGNAL(customViewModeSelected(MainWindow::CUSTOM_MODE)), this, SIGNAL(customViewModeSelected(MainWindow::CUSTOM_MODE))); |
||||
connect(viewModeSelection, SIGNAL(settingsStorageRequested(bool)), this, SIGNAL(settingsStorageRequested(bool))); |
||||
connect(viewModeSelection, SIGNAL(settingsStorageRequested(bool)), this, SLOT(setStoreSettings(bool))); |
||||
|
||||
setCentralWidget(viewModeSelection); |
||||
|
||||
// Load the new stylesheet.
|
||||
QFile styleSheet(":files/styles/style-dark.css"); |
||||
|
||||
// Attempt to open the stylesheet.
|
||||
if (styleSheet.open(QIODevice::ReadOnly | QIODevice::Text)) |
||||
{ |
||||
// Signal to the user that the app will pause to apply a new stylesheet
|
||||
qApp->setOverrideCursor(Qt::WaitCursor); |
||||
|
||||
qApp->setStyleSheet(styleSheet.readAll()); |
||||
|
||||
// Finally restore the cursor before returning.
|
||||
qApp->restoreOverrideCursor(); |
||||
} |
||||
|
||||
resize(780, 400); |
||||
show(); |
||||
|
||||
} |
||||
|
||||
QGCWelcomeMainWindow::~QGCWelcomeMainWindow() |
||||
{ |
||||
delete ui; |
||||
delete viewModeSelection; |
||||
} |
@ -1,41 +0,0 @@
@@ -1,41 +0,0 @@
|
||||
#ifndef QGCWELCOMEMAINWINDOW_H |
||||
#define QGCWELCOMEMAINWINDOW_H |
||||
|
||||
#include <QMainWindow> |
||||
#include "MainWindow.h" |
||||
#include "QGCViewModeSelection.h" |
||||
|
||||
namespace Ui { |
||||
class QGCWelcomeMainWindow; |
||||
} |
||||
|
||||
class QGCWelcomeMainWindow : public QMainWindow |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
explicit QGCWelcomeMainWindow(QWidget *parent = 0); |
||||
~QGCWelcomeMainWindow(); |
||||
|
||||
bool getStoreSettings() |
||||
{ |
||||
return storeSettings; |
||||
} |
||||
|
||||
public slots: |
||||
void setStoreSettings(bool settings) |
||||
{ |
||||
storeSettings = settings; |
||||
} |
||||
|
||||
signals: |
||||
void customViewModeSelected(enum MainWindow::CUSTOM_MODE mode); |
||||
void settingsStorageRequested(bool requested); |
||||
|
||||
private: |
||||
Ui::QGCWelcomeMainWindow *ui; |
||||
QGCViewModeSelection* viewModeSelection; |
||||
bool storeSettings; |
||||
}; |
||||
|
||||
#endif // QGCWELCOMEMAINWINDOW_H
|
@ -1,20 +0,0 @@
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<ui version="4.0"> |
||||
<class>QGCWelcomeMainWindow</class> |
||||
<widget class="QMainWindow" name="QGCWelcomeMainWindow"> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>800</width> |
||||
<height>600</height> |
||||
</rect> |
||||
</property> |
||||
<property name="windowTitle"> |
||||
<string>MainWindow</string> |
||||
</property> |
||||
<widget class="QWidget" name="centralwidget"/> |
||||
</widget> |
||||
<resources/> |
||||
<connections/> |
||||
</ui> |
Loading…
Reference in new issue