mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Don't need screen actions on single screen mode
This commit is contained in:
+23
-21
@@ -2276,29 +2276,31 @@ void MainWindow::updateRecentVideoActions()
|
||||
|
||||
void MainWindow:: updateScreenActions()
|
||||
{
|
||||
// Add new action for each screen
|
||||
foreach (QScreen *screen, QApplication::screens()) {
|
||||
QString actionLabel = tr("%1 - %2x%3")
|
||||
.arg(screen->name())
|
||||
.arg(QString::number(screen->size().width()))
|
||||
.arg(QString::number(screen->size().height()));
|
||||
if (screen == QApplication::primaryScreen())
|
||||
actionLabel.append(" - Primary");
|
||||
QAction *action = new QAction(actionLabel, this);
|
||||
screenActions.append(action);
|
||||
action->setData(screenActions.count() - 1);
|
||||
}
|
||||
if (QApplication::screens().count() > 1) {
|
||||
// Add new action for each screen
|
||||
foreach (QScreen *screen, QApplication::screens()) {
|
||||
QString actionLabel = tr("%1 - %2x%3")
|
||||
.arg(screen->name())
|
||||
.arg(QString::number(screen->size().width()))
|
||||
.arg(QString::number(screen->size().height()));
|
||||
if (screen == QApplication::primaryScreen())
|
||||
actionLabel.append(" - Primary");
|
||||
QAction *action = new QAction(actionLabel, this);
|
||||
screenActions.append(action);
|
||||
action->setData(screenActions.count() - 1);
|
||||
}
|
||||
|
||||
// Configure actions
|
||||
screenActionGroup = new QActionGroup(this);
|
||||
int preferredScreen = outputWindow->getPreferredScreen();
|
||||
foreach (QAction *action, screenActions) {
|
||||
action->setCheckable(true);
|
||||
if (action == screenActions.at(preferredScreen))
|
||||
action->setChecked(true);
|
||||
// Configure actions
|
||||
screenActionGroup = new QActionGroup(this);
|
||||
int preferredScreen = outputWindow->getPreferredScreen();
|
||||
foreach (QAction *action, screenActions) {
|
||||
action->setCheckable(true);
|
||||
if (action == screenActions.at(preferredScreen))
|
||||
action->setChecked(true);
|
||||
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(setupOutputScreen()));
|
||||
screenActionGroup->addAction(action);
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(setupOutputScreen()));
|
||||
screenActionGroup->addAction(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user