DisplaySettingsDialog::DisplaySettingsDialog(QWidget* parent) : QDialog(parent) { ui.setupUi(this); ui.letterBoxWidget->setMargin(20); ui.letterBoxWidget->setWidget(ui.labelBox); ui.letterBoxWidget->setBackgroundColor(QColor("wheat")); connect(ui.buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), SLOT(apply())); connect(ui.refreshButton, SIGNAL(clicked()), SLOT(refresh())); fillScreens(); selectScreen(qApp->desktop()->primaryScreen()); fillRefreshRates(); fillColorDepths(); connect(ui.comboBoxScreen, SIGNAL(currentIndexChanged(int)), SLOT(selectScreen(int))); connect(ui.comboBoxReso, SIGNAL(currentIndexChanged(int)), SLOT(fillRefreshRates())); connect(ui.comboBoxReso, SIGNAL(currentIndexChanged(int)), SLOT(fillColorDepths())); updateUi(true); connect(ui.comboBoxScreen, SIGNAL(currentIndexChanged(int)), SLOT(updateUi())); connect(ui.comboBoxReso, SIGNAL(currentIndexChanged(int)), SLOT(updateUi())); connect(ui.comboBoxRate, SIGNAL(currentIndexChanged(int)), SLOT(updateUi())); connect(ui.comboBoxDepth, SIGNAL(currentIndexChanged(int)), SLOT(updateUi())); }
PCDMgui::PCDMgui() : QMainWindow() { this->setObjectName("PCDM-background"); this->setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowStaysOnBottomHint); this->setCentralWidget(new QWidget(this)); QApplication::setActiveWindow(this); //Load the Theme loadTheme(); //Create the base widgets for the window and make sure they cover one screen at a time fillScreens(); //Create the GUI based upon the current Theme createGUIfromTheme(); //Now make sure that the login widget has keyboard focus //loginW->resetFocus(); loginW->activateWindow(); pcTimer = new QTimer(this); pcTimer->setInterval(15000); //every 15 seconds connect(pcTimer, SIGNAL(timeout()), this, SLOT(LoadAvailableUsers()) ); if(!pcAvail.isEmpty()){ pcTimer->start(); } //LoadAvailableUsers was already run once }
void DisplaySettingsDialog::refresh() { screen.refresh(); fillScreens(); updateUi(true); }