This adds a class PreferredScreenSelector, which is a QComboBox that
holds items for each connected screen, and provides a preferredScreen
property which is accessed by KConfigDialogManager.
This class also allows to remember a disconnected screen by adding
a temporary item “Screen xy (disconnected)”.
addItem(i18nc("@item:inlistbox Config dialog, presentation page, preferred screen. %1 is the screen number (0, 1, ...). %2 is the screen manufacturer name. %3 is the screen model name. %4 is the screen name like DVI-0",
"Screen %1 (%2 %3 %4)",
screenNumber,
screen->manufacturer(),
screen->model(),
screen->name()));
}
// If a disconnected screen is configured, it will be appended last:
setItemText(m_disconnectedScreenIndex,i18nc("@item:inlistbox Config dialog, presentation page, preferred screen. %1 is the screen number (0, 1, ...), hopefully not 0.","Screen %1 (disconnected)",newScreen));
setCurrentIndex(m_disconnectedScreenIndex);
m_disconnectedScreenNumber=newScreen;
return;
}
setCurrentIndex(newScreen+k_specialScreenCount);
// screenChanged() is emitted through currentIndexChanged().