24 changed files with 6241 additions and 72 deletions
After Width: | Height: | Size: 244 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 8.4 KiB |
@ -0,0 +1,54 @@
@@ -0,0 +1,54 @@
|
||||
#include "QGCViewModeSelection.h" |
||||
#include "ui_QGCViewModeSelection.h" |
||||
#include "QGC.h" |
||||
#include "MainWindow.h" |
||||
|
||||
QGCViewModeSelection::QGCViewModeSelection(QWidget *parent) : |
||||
QWidget(parent), |
||||
selected(false), |
||||
ui(new Ui::QGCViewModeSelection) |
||||
{ |
||||
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->viewModeAPM, SIGNAL(clicked()), this, SLOT(selectAPM())); |
||||
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; |
||||
} |
||||
|
||||
void QGCViewModeSelection::selectAPM() { |
||||
emit customViewModeSelected(MainWindow::CUSTOM_MODE_APM); |
||||
mode = MainWindow::CUSTOM_MODE_APM; |
||||
selected = true; |
||||
} |
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
#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 selectAPM(); |
||||
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
|
@ -0,0 +1,191 @@
@@ -0,0 +1,191 @@
|
||||
<?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="3"> |
||||
<widget class="QLabel" name="label_3"> |
||||
<property name="text"> |
||||
<string>APM Autopilot</string> |
||||
</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="1" column="3"> |
||||
<widget class="QPushButton" name="viewModeAPM"> |
||||
<property name="text"> |
||||
<string/> |
||||
</property> |
||||
<property name="icon"> |
||||
<iconset resource="../../../qgroundcontrol.qrc"> |
||||
<normaloff>:/files/images/actions/qgroundcontrol-apm.svg</normaloff>:/files/images/actions/qgroundcontrol-apm.svg</iconset> |
||||
</property> |
||||
<property name="iconSize"> |
||||
<size> |
||||
<width>120</width> |
||||
<height>120</height> |
||||
</size> |
||||
</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> |
@ -0,0 +1,59 @@
@@ -0,0 +1,59 @@
|
||||
#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); |
||||
statusBar()->hide(); |
||||
|
||||
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; |
||||
} |
||||
|
||||
enum MainWindow::CUSTOM_MODE QGCWelcomeMainWindow::getCustomMode() |
||||
{ |
||||
// QGCViewModeSelection* s = new QGCViewModeSelection(this);
|
||||
// setCentralWidget(s);
|
||||
// show();
|
||||
// enum MainWindow::CUSTOM_MODE mode = MainWindow::CUSTOM_MODE_WIFI;// = s->waitForInput();
|
||||
// delete s;
|
||||
// return mode;
|
||||
} |
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
#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(); |
||||
|
||||
enum MainWindow::CUSTOM_MODE getCustomMode(); |
||||
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
|
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
<ui version="4.0"> |
||||
<author/> |
||||
<comment/> |
||||
<exportmacro/> |
||||
<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="QMenuBar" name="menubar"/> |
||||
<widget class="QWidget" name="centralwidget"/> |
||||
<widget class="QStatusBar" name="statusbar"/> |
||||
</widget> |
||||
<pixmapfunction/> |
||||
<connections/> |
||||
</ui> |
Loading…
Reference in new issue