Commit 3bc487d2 authored by Don Gagne's avatar Don Gagne

Merge pull request #2121 from tcanabrava/smallFixes

Small fixes
parents 9c26a249 bf8b966b
...@@ -238,16 +238,8 @@ MainWindow::MainWindow() ...@@ -238,16 +238,8 @@ MainWindow::MainWindow()
} }
// Make sure the proper fullscreen/normal menu item is checked properly. // Make sure the proper fullscreen/normal menu item is checked properly.
if (isFullScreen()) _ui.actionFullscreen->setChecked(isFullScreen());
{ _ui.actionNormal->setChecked(!isFullScreen());
_ui.actionFullscreen->setChecked(true);
_ui.actionNormal->setChecked(false);
}
else
{
_ui.actionFullscreen->setChecked(false);
_ui.actionNormal->setChecked(true);
}
// And that they will stay checked properly after user input // And that they will stay checked properly after user input
connect(_ui.actionFullscreen, &QAction::triggered, this, &MainWindow::fullScreenActionItemCallback); connect(_ui.actionFullscreen, &QAction::triggered, this, &MainWindow::fullScreenActionItemCallback);
...@@ -397,6 +389,7 @@ void MainWindow::_createInnerDockWidget(const QString& widgetName) ...@@ -397,6 +389,7 @@ void MainWindow::_createInnerDockWidget(const QString& widgetName)
widget = pInfoView; widget = pInfoView;
} else { } else {
qWarning() << "Attempt to create unknown Inner Dock Widget" << widgetName; qWarning() << "Attempt to create unknown Inner Dock Widget" << widgetName;
return;
} }
_mapName2DockWidget[widgetName] = widget; _mapName2DockWidget[widgetName] = widget;
...@@ -651,7 +644,7 @@ void MainWindow::_loadVisibleWidgetsSettings(void) ...@@ -651,7 +644,7 @@ void MainWindow::_loadVisibleWidgetsSettings(void)
if (!widgets.isEmpty()) { if (!widgets.isEmpty()) {
QStringList nameList = widgets.split(","); QStringList nameList = widgets.split(",");
foreach (QString name, nameList) { foreach (const QString &name, nameList) {
_showDockWidget(name, true); _showDockWidget(name, true);
} }
} }
...@@ -662,7 +655,7 @@ void MainWindow::_storeVisibleWidgetsSettings(void) ...@@ -662,7 +655,7 @@ void MainWindow::_storeVisibleWidgetsSettings(void)
QString widgetNames; QString widgetNames;
bool firstWidget = true; bool firstWidget = true;
foreach (QString name, _mapName2DockWidget.keys()) { foreach (const QString &name, _mapName2DockWidget.keys()) {
if (_mapName2DockWidget[name]->isVisible()) { if (_mapName2DockWidget[name]->isVisible()) {
if (!firstWidget) { if (!firstWidget) {
widgetNames += ","; widgetNames += ",";
......
...@@ -47,8 +47,11 @@ _ui(new Ui::SettingsDialog) ...@@ -47,8 +47,11 @@ _ui(new Ui::SettingsDialog)
_ui->setupUi(this); _ui->setupUi(this);
// Center the window on the screen. // Center the window on the screen.
QDesktopWidget *desktop = QApplication::desktop();
int screen = desktop->screenNumber(parent);
QRect position = frameGeometry(); QRect position = frameGeometry();
position.moveCenter(QApplication::desktop()->availableGeometry().center()); position.moveCenter(QApplication::desktop()->availableGeometry(screen).center());
move(position.topLeft()); move(position.topLeft());
QGCLinkConfiguration* pLinkConf = new QGCLinkConfiguration(this); QGCLinkConfiguration* pLinkConf = new QGCLinkConfiguration(this);
......
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