Commit f27e3b7a authored by pixhawk's avatar pixhawk

Fixed custom widgets, now working as expected with default config

parent 126ad85e
[PIXHAWK%20Quadrotor%20Commands]
QGC_TOOL_WIDGET_ITEMS\1\TYPE=BUTTON
QGC_TOOL_WIDGET_ITEMS\1\QGC_ACTION_BUTTON_DESCRIPTION=CALIBRATE GYRO
QGC_TOOL_WIDGET_ITEMS\1\QGC_ACTION_BUTTON_BUTTONTEXT=Calibrate
QGC_TOOL_WIDGET_ITEMS\1\QGC_ACTION_BUTTON_ACTIONID=17
QGC_TOOL_WIDGET_ITEMS\2\TYPE=BUTTON
QGC_TOOL_WIDGET_ITEMS\2\QGC_ACTION_BUTTON_DESCRIPTION=Record logfile and images
QGC_TOOL_WIDGET_ITEMS\2\QGC_ACTION_BUTTON_BUTTONTEXT=Start
QGC_TOOL_WIDGET_ITEMS\2\QGC_ACTION_BUTTON_ACTIONID=21
QGC_TOOL_WIDGET_ITEMS\3\TYPE=BUTTON
QGC_TOOL_WIDGET_ITEMS\3\QGC_ACTION_BUTTON_DESCRIPTION=Stop recording
QGC_TOOL_WIDGET_ITEMS\3\QGC_ACTION_BUTTON_BUTTONTEXT=Stop
QGC_TOOL_WIDGET_ITEMS\3\QGC_ACTION_BUTTON_ACTIONID=23
QGC_TOOL_WIDGET_ITEMS\size=3
...@@ -84,6 +84,8 @@ macx { ...@@ -84,6 +84,8 @@ macx {
# Copy audio files if needed # Copy audio files if needed
QMAKE_POST_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/qgroundcontrol.app/Contents/MacOS QMAKE_POST_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
# Copy contributed files
QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
# Copy google earth starter file # Copy google earth starter file
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOS QMAKE_POST_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
# Copy CSS stylesheets # Copy CSS stylesheets
...@@ -219,6 +221,10 @@ message("Compiling for linux 32") ...@@ -219,6 +221,10 @@ message("Compiling for linux 32")
DEFINES += QGC_LIBFREENECT_ENABLED DEFINES += QGC_LIBFREENECT_ENABLED
} }
# Validated copy commands
QMAKE_POST_LINK += && cp -rf $$BASEDIR/audio $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$DESTDIR QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR
QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images
...@@ -293,6 +299,10 @@ linux-g++-64 { ...@@ -293,6 +299,10 @@ linux-g++-64 {
DEFINES += QGC_LIBFREENECT_ENABLED DEFINES += QGC_LIBFREENECT_ENABLED
} }
# Validated copy commands
QMAKE_POST_LINK += && cp -rf $$BASEDIR/audio $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$DESTDIR QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR
QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images
...@@ -369,6 +379,7 @@ DEFINES += QGC_OSG_ENABLED ...@@ -369,6 +379,7 @@ DEFINES += QGC_OSG_ENABLED
exists($$TARGETDIR/debug) { exists($$TARGETDIR/debug) {
QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\audio" "$$TARGETDIR_WIN\\debug\\audio" /E /I $$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\audio" "$$TARGETDIR_WIN\\debug\\audio" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\files" "$$TARGETDIR_WIN\\debug\\files" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\models" "$$TARGETDIR_WIN\\debug\\models" /E /I $$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\models" "$$TARGETDIR_WIN\\debug\\models" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\images\\earth.html" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\images\\earth.html" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$(QTDIR)\\plugins" "$$TARGETDIR_WIN\\debug" /E /I /EXCLUDE:copydebug.txt $$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /Y "$$(QTDIR)\\plugins" "$$TARGETDIR_WIN\\debug" /E /I /EXCLUDE:copydebug.txt $$escape_expand(\\n))
...@@ -388,6 +399,7 @@ DEFINES += QGC_OSG_ENABLED ...@@ -388,6 +399,7 @@ DEFINES += QGC_OSG_ENABLED
exists($$TARGETDIR/release) { exists($$TARGETDIR/release) {
QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\audio" "$$TARGETDIR_WIN\\release\\audio" /E /I $$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\audio" "$$TARGETDIR_WIN\\release\\audio" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\files" "$$TARGETDIR_WIN\\release\\files" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\models" "$$TARGETDIR_WIN\\release\\models" /E /I $$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\models" "$$TARGETDIR_WIN\\release\\models" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\images\\earth.html" "$$TARGETDIR_WIN\\release\\earth.html" $$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\images\\earth.html" "$$TARGETDIR_WIN\\release\\earth.html" $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$(QTDIR)\\plugins" "$$TARGETDIR_WIN\\release" /E /I /EXCLUDE:copyrelease.txt $$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /Y "$$(QTDIR)\\plugins" "$$TARGETDIR_WIN\\release" /E /I /EXCLUDE:copyrelease.txt $$escape_expand(\\n))
......
...@@ -326,9 +326,6 @@ void MainWindow::buildCustomWidget() ...@@ -326,9 +326,6 @@ void MainWindow::buildCustomWidget()
// Show custom widgets only if UAS is connected // Show custom widgets only if UAS is connected
if (UASManager::instance()->getActiveUAS() != NULL) if (UASManager::instance()->getActiveUAS() != NULL)
{ {
// Enable custom widgets
ui.actionNewCustomWidget->setEnabled(true);
// Create custom widgets // Create custom widgets
QList<QGCToolWidget*> widgets = QGCToolWidget::createWidgetsFromSettings(this); QList<QGCToolWidget*> widgets = QGCToolWidget::createWidgetsFromSettings(this);
...@@ -355,9 +352,6 @@ void MainWindow::buildCustomWidget() ...@@ -355,9 +352,6 @@ void MainWindow::buildCustomWidget()
widgets.at(i)->setMainMenuAction(showAction); widgets.at(i)->setMainMenuAction(showAction);
ui.menuTools->addAction(showAction); ui.menuTools->addAction(showAction);
// // Load visibility for view (default is off)
// dock->setVisible(tool->isVisible(currentView));
// Load dock widget location (default is bottom) // Load dock widget location (default is bottom)
Qt::DockWidgetArea location = static_cast <Qt::DockWidgetArea>(tool->getDockWidgetArea(currentView)); Qt::DockWidgetArea location = static_cast <Qt::DockWidgetArea>(tool->getDockWidgetArea(currentView));
...@@ -685,7 +679,7 @@ void MainWindow::loadCustomWidget() ...@@ -685,7 +679,7 @@ void MainWindow::loadCustomWidget()
{ {
QString widgetFileExtension(".qgw"); QString widgetFileExtension(".qgw");
QString fileName = QFileDialog::getOpenFileName(this, tr("Specify Widget File Name"), QDesktopServices::storageLocation(QDesktopServices::DesktopLocation), tr("QGroundControl Widget (*%1);;").arg(widgetFileExtension)); QString fileName = QFileDialog::getOpenFileName(this, tr("Specify Widget File Name"), QDesktopServices::storageLocation(QDesktopServices::DesktopLocation), tr("QGroundControl Widget (*%1);;").arg(widgetFileExtension));
loadCustomWidget(fileName); if (fileName != "") loadCustomWidget(fileName);
} }
void MainWindow::loadCustomWidget(const QString& fileName, bool singleinstance) void MainWindow::loadCustomWidget(const QString& fileName, bool singleinstance)
...@@ -699,7 +693,7 @@ void MainWindow::loadCustomWidget(const QString& fileName, bool singleinstance) ...@@ -699,7 +693,7 @@ void MainWindow::loadCustomWidget(const QString& fileName, bool singleinstance)
dock->setWidget(tool); dock->setWidget(tool);
tool->setParent(dock); tool->setParent(dock);
QAction* showAction = new QAction("Show Unnamed Tool", this); QAction* showAction = new QAction(tool->getTitle(), this);
showAction->setCheckable(true); showAction->setCheckable(true);
connect(dock, SIGNAL(visibilityChanged(bool)), showAction, SLOT(setChecked(bool))); connect(dock, SIGNAL(visibilityChanged(bool)), showAction, SLOT(setChecked(bool)));
connect(showAction, SIGNAL(triggered(bool)), dock, SLOT(setVisible(bool))); connect(showAction, SIGNAL(triggered(bool)), dock, SLOT(setVisible(bool)));
...@@ -734,7 +728,8 @@ void MainWindow::loadCustomWidgetsFromDefaults(const QString& systemType, const ...@@ -734,7 +728,8 @@ void MainWindow::loadCustomWidgetsFromDefaults(const QString& systemType, const
{ {
// Will only be loaded if not already a custom widget with // Will only be loaded if not already a custom widget with
// the same name is present // the same name is present
loadCustomWidget(file, true); qDebug() << "Tried to load file: " << file;
loadCustomWidget(defaultsDir+"/"+file, true);
} }
} }
} }
...@@ -776,9 +771,11 @@ void MainWindow::configureWindowName() ...@@ -776,9 +771,11 @@ void MainWindow::configureWindowName()
windowname.append(" (" + QHostInfo::localHostName() + ": "); windowname.append(" (" + QHostInfo::localHostName() + ": ");
for (int i = 0; i < hostAddresses.size(); i++) { for (int i = 0; i < hostAddresses.size(); i++)
{
// Exclude loopback IPv4 and all IPv6 addresses // Exclude loopback IPv4 and all IPv6 addresses
if (hostAddresses.at(i) != QHostAddress("127.0.0.1") && !hostAddresses.at(i).toString().contains(":")) { if (hostAddresses.at(i) != QHostAddress("127.0.0.1") && !hostAddresses.at(i).toString().contains(":"))
{
if(prevAddr) windowname.append("/"); if(prevAddr) windowname.append("/");
windowname.append(hostAddresses.at(i).toString()); windowname.append(hostAddresses.at(i).toString());
prevAddr = true; prevAddr = true;
...@@ -823,7 +820,8 @@ void MainWindow::saveScreen() ...@@ -823,7 +820,8 @@ void MainWindow::saveScreen()
QPixmap window = QPixmap::grabWindow(this->winId()); QPixmap window = QPixmap::grabWindow(this->winId());
QString format = "bmp"; QString format = "bmp";
if (!screenFileName.isEmpty()) { if (!screenFileName.isEmpty())
{
window.save(screenFileName, format.toAscii()); window.save(screenFileName, format.toAscii());
} }
} }
...@@ -969,8 +967,6 @@ void MainWindow::showInfoMessage(const QString& title, const QString& message) ...@@ -969,8 +967,6 @@ void MainWindow::showInfoMessage(const QString& title, const QString& message)
**/ **/
void MainWindow::connectCommonActions() void MainWindow::connectCommonActions()
{ {
ui.actionNewCustomWidget->setEnabled(false);
// Bind together the perspective actions // Bind together the perspective actions
QActionGroup* perspectives = new QActionGroup(ui.menuPerspectives); QActionGroup* perspectives = new QActionGroup(ui.menuPerspectives);
perspectives->addAction(ui.actionEngineersView); perspectives->addAction(ui.actionEngineersView);
...@@ -987,11 +983,6 @@ void MainWindow::connectCommonActions() ...@@ -987,11 +983,6 @@ void MainWindow::connectCommonActions()
if (currentView == VIEW_OPERATOR) ui.actionOperatorsView->setChecked(true); if (currentView == VIEW_OPERATOR) ui.actionOperatorsView->setChecked(true);
if (currentView == VIEW_UNCONNECTED) ui.actionUnconnectedView->setChecked(true); if (currentView == VIEW_UNCONNECTED) ui.actionUnconnectedView->setChecked(true);
// The pilot, engineer and operator view are not available on startup
// since they only make sense with a system connected.
ui.actionPilotsView->setEnabled(false);
ui.actionOperatorsView->setEnabled(false);
ui.actionEngineersView->setEnabled(false);
// The UAS actions are not enabled without connection to system // The UAS actions are not enabled without connection to system
ui.actionLiftoff->setEnabled(false); ui.actionLiftoff->setEnabled(false);
ui.actionLand->setEnabled(false); ui.actionLand->setEnabled(false);
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>800</width>
<height>22</height> <height>25</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuMGround"> <widget class="QMenu" name="menuMGround">
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
<widget class="QStatusBar" name="statusBar"/> <widget class="QStatusBar" name="statusBar"/>
<action name="actionExit"> <action name="actionExit">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/actions/system-log-out.svg</normaloff>:/images/actions/system-log-out.svg</iconset> <normaloff>:/images/actions/system-log-out.svg</normaloff>:/images/actions/system-log-out.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/control/launch.svg</normaloff> <normaloff>:/images/control/launch.svg</normaloff>
<normalon>:/images/control/launch.svg</normalon>:/images/control/launch.svg</iconset> <normalon>:/images/control/launch.svg</normalon>:/images/control/launch.svg</iconset>
</property> </property>
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
</action> </action>
<action name="actionLand"> <action name="actionLand">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/control/land.svg</normaloff>:/images/control/land.svg</iconset> <normaloff>:/images/control/land.svg</normaloff>:/images/control/land.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
</action> </action>
<action name="actionEmergency_Land"> <action name="actionEmergency_Land">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/actions/process-stop.svg</normaloff>:/images/actions/process-stop.svg</iconset> <normaloff>:/images/actions/process-stop.svg</normaloff>:/images/actions/process-stop.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
</action> </action>
<action name="actionEmergency_Kill"> <action name="actionEmergency_Kill">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/actions/process-stop.svg</normaloff>:/images/actions/process-stop.svg</iconset> <normaloff>:/images/actions/process-stop.svg</normaloff>:/images/actions/process-stop.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
</action> </action>
<action name="actionAdd_Link"> <action name="actionAdd_Link">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/actions/list-add.svg</normaloff>:/images/actions/list-add.svg</iconset> <normaloff>:/images/actions/list-add.svg</normaloff>:/images/actions/list-add.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
</action> </action>
<action name="actionConfiguration"> <action name="actionConfiguration">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/categories/applications-system.svg</normaloff>:/images/categories/applications-system.svg</iconset> <normaloff>:/images/categories/applications-system.svg</normaloff>:/images/categories/applications-system.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
</action> </action>
<action name="actionJoystickSettings"> <action name="actionJoystickSettings">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/devices/input-gaming.svg</normaloff>:/images/devices/input-gaming.svg</iconset> <normaloff>:/images/devices/input-gaming.svg</normaloff>:/images/devices/input-gaming.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/control/launch.svg</normaloff>:/images/control/launch.svg</iconset> <normaloff>:/images/control/launch.svg</normaloff>:/images/control/launch.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</action> </action>
<action name="actionShow_Slugs_View"> <action name="actionShow_Slugs_View">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/contrib/slugs.png</normaloff>:/images/contrib/slugs.png</iconset> <normaloff>:/images/contrib/slugs.png</normaloff>:/images/contrib/slugs.png</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
</action> </action>
<action name="actionJoystick_Settings"> <action name="actionJoystick_Settings">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/devices/input-gaming.svg</normaloff>:/images/devices/input-gaming.svg</iconset> <normaloff>:/images/devices/input-gaming.svg</normaloff>:/images/devices/input-gaming.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
</action> </action>
<action name="actionOnline_Documentation"> <action name="actionOnline_Documentation">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/apps/utilities-system-monitor.svg</normaloff>:/images/apps/utilities-system-monitor.svg</iconset> <normaloff>:/images/apps/utilities-system-monitor.svg</normaloff>:/images/apps/utilities-system-monitor.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
</action> </action>
<action name="actionProject_Roadmap_2"> <action name="actionProject_Roadmap_2">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/status/software-update-available.svg</normaloff>:/images/status/software-update-available.svg</iconset> <normaloff>:/images/status/software-update-available.svg</normaloff>:/images/status/software-update-available.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -297,7 +297,7 @@ ...@@ -297,7 +297,7 @@
</action> </action>
<action name="actionDeveloper_Credits"> <action name="actionDeveloper_Credits">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/categories/preferences-system.svg</normaloff>:/images/categories/preferences-system.svg</iconset> <normaloff>:/images/categories/preferences-system.svg</normaloff>:/images/categories/preferences-system.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -309,7 +309,7 @@ ...@@ -309,7 +309,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/status/weather-overcast.svg</normaloff>:/images/status/weather-overcast.svg</iconset> <normaloff>:/images/status/weather-overcast.svg</normaloff>:/images/status/weather-overcast.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -324,7 +324,7 @@ ...@@ -324,7 +324,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/apps/utilities-system-monitor.svg</normaloff>:/images/apps/utilities-system-monitor.svg</iconset> <normaloff>:/images/apps/utilities-system-monitor.svg</normaloff>:/images/apps/utilities-system-monitor.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -339,7 +339,7 @@ ...@@ -339,7 +339,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/devices/network-wired.svg</normaloff>:/images/devices/network-wired.svg</iconset> <normaloff>:/images/devices/network-wired.svg</normaloff>:/images/devices/network-wired.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -351,7 +351,7 @@ ...@@ -351,7 +351,7 @@
</action> </action>
<action name="actionSelectStylesheet"> <action name="actionSelectStylesheet">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/categories/applications-internet.svg</normaloff>:/images/categories/applications-internet.svg</iconset> <normaloff>:/images/categories/applications-internet.svg</normaloff>:/images/categories/applications-internet.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -363,7 +363,7 @@ ...@@ -363,7 +363,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/status/network-wireless-encrypted.svg</normaloff>:/images/status/network-wireless-encrypted.svg</iconset> <normaloff>:/images/status/network-wireless-encrypted.svg</normaloff>:/images/status/network-wireless-encrypted.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -375,7 +375,7 @@ ...@@ -375,7 +375,7 @@
</action> </action>
<action name="actionNewCustomWidget"> <action name="actionNewCustomWidget">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/apps/utilities-system-monitor.svg</normaloff>:/images/apps/utilities-system-monitor.svg</iconset> <normaloff>:/images/apps/utilities-system-monitor.svg</normaloff>:/images/apps/utilities-system-monitor.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -387,7 +387,7 @@ ...@@ -387,7 +387,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/status/audio-volume-high.svg</normaloff> <normaloff>:/images/status/audio-volume-high.svg</normaloff>
<normalon>:/images/status/audio-volume-muted.svg</normalon> <normalon>:/images/status/audio-volume-muted.svg</normalon>
<activeon>:/images/status/audio-volume-muted.svg</activeon> <activeon>:/images/status/audio-volume-muted.svg</activeon>
...@@ -403,7 +403,7 @@ ...@@ -403,7 +403,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/devices/network-wireless.svg</normaloff>:/images/devices/network-wireless.svg</iconset> <normaloff>:/images/devices/network-wireless.svg</normaloff>:/images/devices/network-wireless.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -415,7 +415,7 @@ ...@@ -415,7 +415,7 @@
</action> </action>
<action name="actionShutdownMAV"> <action name="actionShutdownMAV">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/actions/system-log-out.svg</normaloff>:/images/actions/system-log-out.svg</iconset> <normaloff>:/images/actions/system-log-out.svg</normaloff>:/images/actions/system-log-out.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -459,7 +459,7 @@ ...@@ -459,7 +459,7 @@
</action> </action>
<action name="actionLoadCustomWidgetFile"> <action name="actionLoadCustomWidgetFile">
<property name="icon"> <property name="icon">
<iconset resource="../../mavground.qrc"> <iconset resource="../../qgroundcontrol.qrc">
<normaloff>:/images/status/folder-drag-accept.svg</normaloff>:/images/status/folder-drag-accept.svg</iconset> <normaloff>:/images/status/folder-drag-accept.svg</normaloff>:/images/status/folder-drag-accept.svg</iconset>
</property> </property>
<property name="text"> <property name="text">
...@@ -469,7 +469,7 @@ ...@@ -469,7 +469,7 @@
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<resources> <resources>
<include location="../../mavground.qrc"/> <include location="../../qgroundcontrol.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>
......
...@@ -116,12 +116,19 @@ bool QGCToolWidget::loadSettings(const QString& settings, bool singleinstance) ...@@ -116,12 +116,19 @@ bool QGCToolWidget::loadSettings(const QString& settings, bool singleinstance)
{ {
QSettings set(settings, QSettings::IniFormat); QSettings set(settings, QSettings::IniFormat);
QStringList groups = set.childGroups(); QStringList groups = set.childGroups();
QString widgetName = groups.first(); if (groups.length() > 0)
if (singleinstance && QGCToolWidget::instances()->keys().contains(widgetName)) return false; {
setTitle(widgetName); QString widgetName = groups.first();
qDebug() << "WIDGET TITLE LOADED: " << widgetName; if (singleinstance && QGCToolWidget::instances()->keys().contains(widgetName)) return false;
loadSettings(set); setTitle(widgetName);
return true; qDebug() << "WIDGET TITLE LOADED: " << widgetName;
loadSettings(set);
return true;
}
else
{
return false;
}
} }
void QGCToolWidget::loadSettings(QSettings& settings) void QGCToolWidget::loadSettings(QSettings& settings)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment