void PrefsDialog::init() { setupUi(this); connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*))); connect(binPathList, SIGNAL(itemSelectionChanged()), this, SLOT(updatePathButtons())); connect(pathUp, SIGNAL(clicked()), this, SLOT(movePathUp())); connect(pathDown, SIGNAL(clicked()), this, SLOT(movePathDown())); connect(pathAdd, SIGNAL(clicked()), this, SLOT(addPath())); connect(pathRemove, SIGNAL(clicked()), this, SLOT(removePath())); connect(toolList, SIGNAL(itemSelectionChanged()), this, SLOT(updateToolButtons())); connect(toolList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(editTool(QListWidgetItem*))); connect(toolUp, SIGNAL(clicked()), this, SLOT(moveToolUp())); connect(toolDown, SIGNAL(clicked()), this, SLOT(moveToolDown())); connect(toolAdd, SIGNAL(clicked()), this, SLOT(addTool())); connect(toolRemove, SIGNAL(clicked()), this, SLOT(removeTool())); connect(toolEdit, SIGNAL(clicked()), this, SLOT(editTool())); connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(changedTabPanel(int))); pathsChanged = toolsChanged = false; }
StartupDialog::StartupDialog(QWidget *parent) : QDialog(parent), ui(new Ui::StartupDialog) { ui->setupUi(this); // No Resize / Maximize setMinimumSize(width(),height()); setMaximumSize(width(),height()); // setWindowTitle("Slider3D -- Configuration"); // load all settings into the UI Settings *lSettings = &Settings::getInstance(); // SETUP monitor combo box { QString lCurrScreen = "(default)"; if( lSettings->mMonitor > -1 ) lCurrScreen = "Monitor "+QString::number(lSettings->mMonitor); ui->monitor->addItem("(default)",-1); int lNumScreens = QApplication::desktop()->numScreens(); for(int i=0;i<lNumScreens;i++) { QString lScreen = "Monitor "+QString::number(i); ui->monitor->addItem(lScreen,i); if( lScreen == lCurrScreen ) // select it; +1 because the 1st one is default! ui->monitor->setCurrentIndex(i+1); } } // SETUP RESOLUTION BOX if( lSettings->mWindowed == 1 ) { QString lCurrRes = QString::number(lSettings->mWidth); lCurrRes+= "x"; lCurrRes+= QString::number(lSettings->mHeight); bool lFound = false; int lNumRes = ui->res->count(); for(int i=0;i<lNumRes;i++) { if( ui->res->itemText(i) == lCurrRes ) { ui->res->setCurrentIndex(i); lFound = true; break; } } //! Add & Select Custom Resolution if( !lFound ) { ui->res->addItem(lCurrRes); ui->res->setCurrentIndex(ui->res->count()-1); } ui->windowed->setChecked(true); } //! SETUP TIMEOUT VALUE ui->timeout->setValue(lSettings->mTimeout); if( lSettings->mMSSA > 0 ) { QString lCurrMSSA = QString::number(lSettings->mMSSA) + "x"; bool lFound = false; int lNumMSSA = ui->mssa->count(); for(int i=0;i<lNumMSSA;i++) { if( ui->mssa->itemText(i) == lCurrMSSA ) { ui->mssa->setCurrentIndex(i); lFound = true; break; } } //! Add & Select Custom Multi-Sampling if( !lFound ) { ui->res->addItem(lCurrMSSA); ui->res->setCurrentIndex(ui->mssa->count()-1); } } //! Floor On/Off ui->floor->setChecked(lSettings->mFloor); //! Labels On/Off ui->labels->setChecked(lSettings->mLabels); //! Add Paths ui->paths->addItems(lSettings->mPaths); //! Dive Into Sub Dirs Or Not ui->subdirs->setChecked(lSettings->mSubDirs); //! Don't Show ui->dontshow->setChecked(lSettings->mDontShow); //! SETUP CONNECTIONS connect(ui->addfolder,SIGNAL(clicked()),this,SLOT(addPath())); connect(ui->removefolder,SIGNAL(clicked()),this,SLOT(removePath())); connect(ui->moveup,SIGNAL(clicked()),this,SLOT(movePathUp())); connect(ui->movedown,SIGNAL(clicked()),this,SLOT(movePathDown())); }