AppSettings::AppSettings(QWidget * parent, Qt::WindowFlags f) : QDialog(parent, f) { // Loading libq4wine-core.so #ifdef RELEASE libq4wine.setFileName(_CORELIB_PATH_); #else libq4wine.setFileName("../q4wine-lib/libq4wine-core"); #endif if (!libq4wine.load()){ libq4wine.load(); } // Getting corelib calss pointer CoreLibClassPointer = (CoreLibPrototype *) libq4wine.resolve("createCoreLib"); CoreLib.reset((corelib *)CoreLibClassPointer(true)); setupUi(this); splitter.reset(new QSplitter(widgetContent)); splitter->addWidget(optionsTreeWidget); splitter->addWidget(optionsStack); QList<int> size; size << 150 << 150; splitter->setSizes(size); std::auto_ptr<QVBoxLayout> vlayout (new QVBoxLayout); vlayout->addWidget(splitter.release()); vlayout->setMargin(0); vlayout->setSpacing(0); widgetContent->setLayout(vlayout.release()); setWindowTitle(tr("%1 settings").arg(APP_NAME)); setWindowIcon(CoreLib->loadIcon(CoreLib->getSetting("app", "icon", false, "q4wine").toString())); connect(optionsTree, SIGNAL(itemClicked (QTreeWidgetItem *, int)), this, SLOT(optionsTree_itemClicked ( QTreeWidgetItem *, int))); connect(cmdCancel, SIGNAL(clicked()), this, SLOT(cmdCancel_Click())); connect(cmdOk, SIGNAL(clicked()), this, SLOT(cmdOk_Click())); connect(cmdHelp, SIGNAL(clicked()), this, SLOT(cmdHelp_Click())); connect(cmdVersionManager, SIGNAL(clicked()), this, SLOT(cmdVersionManager_Click())); connect(comboProxyType, SIGNAL(currentIndexChanged(QString)), this, SLOT(comboProxyType_indexChanged(QString))); //Installing event filters for get buttuns cmdGetTarBin->installEventFilter(this); cmdGetMountBin->installEventFilter(this); cmdGetUmountBin->installEventFilter(this); cmdGetSudoBin->installEventFilter(this); cmdGetGuiSudoBin->installEventFilter(this); cmdGetNiceBin->installEventFilter(this); cmdGetReniceBin->installEventFilter(this); cmdGetConsoleBin->installEventFilter(this); cmdGetShBin->installEventFilter(this); cmdGetDefPrefixPath->installEventFilter(this); QSettings settings(APP_SHORT_NAME, "default"); settings.beginGroup("logging"); connect (cbShowTray, SIGNAL(stateChanged (int)), this, SLOT(cbShowTray_stateChanged (int))); if (settings.value("autoClear", 1).toInt()==1){ cbClearLogs->setCheckState(Qt::Checked); } else { cbClearLogs->setCheckState(Qt::Unchecked); } settings.endGroup(); settings.beginGroup("app"); QString appIcon = settings.value("icon").toString(); if (appIcon == "q4wine-ambiance"){ comboAppIcons->setCurrentIndex(comboAppIcons->findText(tr("Ambient Light"))); } else if (appIcon == "q4wine-ambiance-dark"){ comboAppIcons->setCurrentIndex(comboAppIcons->findText(tr("Ambient Dark"))); } else { comboAppIcons->setCurrentIndex(comboAppIcons->findText(tr("Default"))); } if (settings.value("showTrareyIcon", 0).toInt()==1){ cbShowTray->setCheckState(Qt::Checked); } else { cbShowTray->setCheckState(Qt::Unchecked); } if (settings.value("showNotifications", 1).toInt()==1){ cbShowNotifications->setCheckState(Qt::Checked); } else { cbShowNotifications->setCheckState(Qt::Unchecked); } if (settings.value("minimizeToTray", 0).toInt()==1){ cbMinimizeToTray->setCheckState(Qt::Checked); } else { cbMinimizeToTray->setCheckState(Qt::Unchecked); } if (settings.value("minimizeToTrayAtAppStart", 0).toInt()==1){ cbMinimizeToTrayApp->setCheckState(Qt::Checked); } else { cbMinimizeToTrayApp->setCheckState(Qt::Unchecked); } loadThemeIcons(); getLangs(); if (settings.value("lang").toString().isEmpty()){ comboLangs->setCurrentIndex(comboLangs->findText(tr("System Default"))); } else { QString lName = settings.value("lang").toString(); //Strip q4wine_ from setting if any lName.replace("q4wine_", ""); comboLangs->setCurrentIndex(comboLangs->findText(QLocale(lName).nativeLanguageName())); } settings.endGroup(); settings.beginGroup("system"); txtTarBin->setText(settings.value("tar").toString()); txtMountBin->setText(settings.value("mount").toString()); txtUmountBin->setText(settings.value("umount").toString()); txtSudoBin->setText(settings.value("sudo").toString()); txtGuiSudoBin->setText(settings.value("gui_sudo").toString()); txtNiceBin->setText(settings.value("nice").toString()); txtReniceBin->setText(settings.value("renice").toString()); txtShBin->setText(settings.value("sh").toString()); settings.endGroup(); settings.beginGroup("console"); txtConsoleBin->setText(settings.value("bin").toString()); txtConsoleArgs->setText(settings.value("args").toString()); settings.endGroup(); settings.beginGroup("quickmount"); comboMountProfiles->setCurrentIndex(settings.value("type", 0).toInt()); connect(comboMountProfiles, SIGNAL(currentIndexChanged(int)), this, SLOT(comboMountProfiles_currentIndexChanged(int))); if (!settings.value("mount_drive_string").toString().isEmpty()) txtMountString->setText(settings.value("mount_drive_string").toString()); if (!settings.value("mount_image_string").toString().isEmpty()) txtMountImageString->setText(settings.value("mount_image_string").toString()); if (!settings.value("umount_string").toString().isEmpty()) txtUmountString->setText(settings.value("umount_string").toString()); settings.endGroup(); #ifdef WITH_ICOUTILS settings.beginGroup("icotool"); txtWrestoolBin->setText(settings.value("wrestool").toString()); txtIcotoolBin->setText(settings.value("icotool").toString()); settings.endGroup(); cmdGetWrestoolBin->installEventFilter(this); cmdGetIcotoolBin->installEventFilter(this); #else txtWrestoolBin->setEnabled(false); txtIcotoolBin->setEnabled(false); cmdGetWrestoolBin->setEnabled(false); cmdGetIcotoolBin->setEnabled(false); #endif settings.beginGroup("network"); txtProxyHost->setText(settings.value("host").toString()); txtProxyPort->setText(settings.value("port").toString()); txtProxyUser->setText(settings.value("user").toString()); txtProxyPass->setText(settings.value("pass").toString()); comboProxyType->setCurrentIndex(settings.value("type").toInt()); settings.endGroup(); #ifdef _OS_FREEBSD_ this->comboMountProfiles->removeItem(3); this->comboMountProfiles->removeItem(2); #endif #ifdef _OS_DARWIN_ this->comboMountProfiles->removeItem(3); this->comboMountProfiles->removeItem(2); this->comboMountProfiles->removeItem(1); this->comboMountProfiles->setItemText(0, tr("generic")); this->txtMountString->setEnabled(false); this->frameMount->setVisible(false); #endif settings.beginGroup("advanced"); txtDefPrefixPath->setText(settings.value("prefixDefaultPath").toString()); if (settings.value("openRunDialog", 0).toInt()==0){ cbOpenRunDialog->setChecked(false); } else { cbOpenRunDialog->setChecked(true); } if (settings.value("useSingleClick", 0).toInt()==0){ cbUseSingleClick->setChecked(false); } else { cbUseSingleClick->setChecked(true); } #if QT_VERSION >= 0x040500 if (settings.value("useNativeFileDialog", 1).toInt()==1){ cbUseNativeDialog->setChecked(true); } else { cbUseNativeDialog->setChecked(false); } #else cbUseNativeDialog->setEnabled(false); #endif QString res = settings.value("defaultDesktopSize").toString(); if (res.isEmpty()){ cboxDesktopSize->setCurrentIndex(0); } else { cboxDesktopSize->setCurrentIndex(cboxDesktopSize->findText(res)); } settings.endGroup(); settings.beginGroup("DesktopImport"); if (settings.value("remove", 0).toInt()==0){ cbRemoveDesktopFiles->setChecked(false); } else { cbRemoveDesktopFiles->setChecked(true); } if (settings.value("importAtStartup", 0).toInt()==0){ cbImportDesktopFilesAtStartup->setChecked(false); } else { cbImportDesktopFilesAtStartup->setChecked(true); } settings.endGroup(); settings.beginGroup("AppDB"); if (settings.value("useSystemBrowser", 1).toInt()==1){ cbUseSystemBrowser->setChecked(true); } else { cbUseSystemBrowser->setChecked(false); } settings.endGroup(); #ifndef _OS_DARWIN_ settings.beginGroup("Plugins"); if (settings.value("enableMenuDesktop", 1).toInt()==1){ cbEnableDesktopMenu->setChecked(true); } else { cbEnableDesktopMenu->setChecked(false); } settings.endGroup(); connect(cmdDesktopMenu_Regen, SIGNAL(clicked()), this, SLOT(cmdDesktopMenu_Regen_Click())); connect(cmdDesktopMenu_Remove, SIGNAL(clicked()), this, SLOT(cmdDesktopMenu_Remove_Click())); #else cbEnableDesktopMenu->setEnabled(false); cmdDesktopMenu_Regen->setEnabled(false); cmdDesktopMenu_Remove->setEnabled(false); #endif QList<QTreeWidgetItem *> items = optionsTree->findItems (tr("General"), Qt::MatchExactly); if (items.count()>0){ items.at(0)->setExpanded(true); optionsTree->setCurrentItem(items.at(0)); optionsStack->setCurrentIndex(0); tabwGeneral->setCurrentIndex(0); } cmdOk->setFocus(Qt::ActiveWindowFocusReason); return; }
Wizard::Wizard(int WizardType, QString var1, QWidget * parent, Qt::WindowFlags f) : QDialog(parent, f) { /* Note: var1 is optional data, used for different scene actions ;) */ setupUi(this); // Loading libq4wine-core.so #ifdef RELEASE libq4wine.setFileName(_CORELIB_PATH_); #else libq4wine.setFileName("../q4wine-lib/libq4wine-core"); #endif if (!libq4wine.load()){ libq4wine.load(); } // Getting corelib calss pointer CoreLibClassPointer = (CoreLibPrototype *) libq4wine.resolve("createCoreLib"); CoreLib.reset((corelib *)CoreLibClassPointer(true)); Scena=WizardType; Page=1; QString console_w; loadThemeIcons(Scena); connect(cmdCancel, SIGNAL(clicked()), this, SLOT(reject ())); connect(cmdNext, SIGNAL(clicked()), this, SLOT(nextWizardPage())); connect(cmdBack, SIGNAL(clicked()), this, SLOT(previosWizardPage())); connect(comboProxyType, SIGNAL(currentIndexChanged(QString)), this, SLOT(comboProxyType_indexChanged(QString))); connect(comboMountProfiles, SIGNAL(currentIndexChanged(int)), this, SLOT(comboMountProfiles_currentIndexChanged(int))); switch (Scena){ case 1: TotalPage=8; setWindowTitle(tr("First startup wizard")); lblCaption->setText(tr("<b>First startup wizard</b>")); lblStep->setText(tr("<b>Step %1 of %2</b>").arg(Page).arg(TotalPage)); cmdGetWineBin->installEventFilter(this); cmdGetWineServerBin->installEventFilter(this); cmdGetWineLoaderBin->installEventFilter(this); cmdGetWineDllPath->installEventFilter(this); cmdGetWineDllPath64->installEventFilter(this); cmdGetTarBin->installEventFilter(this); cmdGetMountBin->installEventFilter(this); cmdGetUmountBin->installEventFilter(this); cmdGetSudoBin->installEventFilter(this); cmdGetGuiSudoBin->installEventFilter(this); cmdGetNiceBin->installEventFilter(this); cmdGetReniceBin->installEventFilter(this); cmdGetShBin->installEventFilter(this); cmdGetConsoleBin->installEventFilter(this); txtWineBin->setText(CoreLib->getWhichOut("wine")); txtWineServerBin->setText(CoreLib->getWhichOut("wineserver")); txtWineLoaderBin->setText(CoreLib->getWhichOut("wine")); QStringList libs_path = CoreLib->getWineLibsPath(); /* if (libs_path.isEmpty()){ QStringList libs_loc, libs_arch; libs_loc << "/usr/lib" << "/usr/local/lib" << "/local/usr/lib"; libs_arch << "64" << "32" << ""; foreach (QString loc, libs_loc){ foreach (QString arch, libs_arch){ libs_path = loc; libs_path.append(arch); QString libwine_path = libs_path; libwine_path.append("/libwine.so"); if (QFile(libwine_path).exists()){ break; libs_path.append("/wine`"); } } } }*/ txtWineDllPath->setText(libs_path.at(0)); txtWineDllPath64->setText(libs_path.at(1)); txtTarBin->setText(CoreLib->getWhichOut("tar")); txtMountBin->setText(CoreLib->getWhichOut("mount")); txtUmountBin->setText(CoreLib->getWhichOut("umount")); txtSudoBin->setText(CoreLib->getWhichOut("sudo")); QStringList guisudo; #ifdef _OS_DARWIN_ guisudo << "osascript"; #else guisudo << "kdesudo" << "kdesu" << "gksudo" << "gksu" << "sudo"; #endif foreach (QString bin, guisudo){ QString path = CoreLib->getWhichOut(bin, false); if (!path.isEmpty()){ txtGuiSudoBin->setText(path); break; } } txtNiceBin->setText(CoreLib->getWhichOut("nice")); txtReniceBin->setText(CoreLib->getWhichOut("renice")); txtShBin->setText(CoreLib->getWhichOut("sh")); #ifdef _OS_DARWIN_ txtConsoleBin->setText("/usr/X11/bin/xterm"); txtConsoleArgs->setText("-e"); #else console_w = CoreLib->getWhichOut("konsole", false); if (!console_w.isEmpty()){ txtConsoleBin->setText(console_w); txtConsoleArgs->setText("--noclose -e"); } else { console_w = CoreLib->getWhichOut("xterm", false); if (!console_w.isEmpty()){ txtConsoleBin->setText(console_w); txtConsoleArgs->setText("-e"); } } #endif #ifdef WITH_ICOUTILS txtWrestoolBin->setText(CoreLib->getWhichOut("wrestool")); txtIcotoolBin->setText(CoreLib->getWhichOut("icotool")); cmdGetWrestoolBin->installEventFilter(this); cmdGetIcotoolBin->installEventFilter(this); #else cmdGetWrestoolBin->setEnabled(false); cmdGetIcotoolBin->setEnabled(false); txtWrestoolBin->setEnabled(false); txtIcotoolBin->setEnabled(false); #endif #ifdef _OS_DARWIN_ this->comboMountProfiles->setCurrentIndex(0); this->comboMountProfiles_currentIndexChanged(0); #else if (CoreLib->getWhichOut("fuseiso", false).isEmpty()){ this->comboMountProfiles->setCurrentIndex(0); } else { this->comboMountProfiles->setCurrentIndex(2); } #endif break; }
AppSettings::AppSettings(QWidget * parent, Qt::WFlags f) : QDialog(parent, f) { // Loading libq4wine-core.so #ifdef RELEASE libq4wine.setFileName(_CORELIB_PATH_); #else libq4wine.setFileName("../q4wine-lib/libq4wine-core"); #endif if (!libq4wine.load()){ libq4wine.load(); } // Getting corelib calss pointer CoreLibClassPointer = (CoreLibPrototype *) libq4wine.resolve("createCoreLib"); CoreLib.reset((corelib *)CoreLibClassPointer(true)); setupUi(this); splitter.reset(new QSplitter(widgetContent)); splitter->addWidget(optionsTreeWidget); splitter->addWidget(optionsStack); QList<int> size; size << 150 << 150; splitter->setSizes(size); std::auto_ptr<QVBoxLayout> vlayout (new QVBoxLayout); vlayout->addWidget(splitter.release()); vlayout->setMargin(0); vlayout->setSpacing(0); widgetContent->setLayout(vlayout.release()); setWindowTitle(tr("%1 settings").arg(APP_NAME)); lblCaption->setText(tr("%1 settings").arg(APP_NAME)); connect(optionsTree, SIGNAL(itemClicked (QTreeWidgetItem *, int)), this, SLOT(optionsTree_itemClicked ( QTreeWidgetItem *, int))); connect(cmdCancel, SIGNAL(clicked()), this, SLOT(cmdCancel_Click())); connect(cmdOk, SIGNAL(clicked()), this, SLOT(cmdOk_Click())); connect(cmdHelp, SIGNAL(clicked()), this, SLOT(cmdHelp_Click())); connect(comboProxyType, SIGNAL(currentIndexChanged(QString)), this, SLOT(comboProxyType_indexChanged(QString))); //Installing event filters for get buttuns cmdGetWineBin->installEventFilter(this); cmdGetWineServerBin->installEventFilter(this); cmdGetWineLoaderBin->installEventFilter(this); cmdGetWineLibs->installEventFilter(this); cmdGetTarBin->installEventFilter(this); cmdGetMountBin->installEventFilter(this); cmdGetUmountBin->installEventFilter(this); cmdGetSudoBin->installEventFilter(this); cmdGetGuiSudoBin->installEventFilter(this); cmdGetNiceBin->installEventFilter(this); cmdGetReniceBin->installEventFilter(this); cmdGetConsoleBin->installEventFilter(this); cmdGetShBin->installEventFilter(this); QSettings settings(APP_SHORT_NAME, "default"); settings.beginGroup("wine"); txtWineBin->setText(settings.value("WineBin").toString()); txtWineServerBin->setText(settings.value("ServerBin").toString()); txtWineLoaderBin->setText(settings.value("LoaderBin").toString()); txtWineLibs->setText(settings.value("WineLibs").toString()); settings.endGroup(); settings.beginGroup("logging"); connect (cbShowTray, SIGNAL(stateChanged (int)), this, SLOT(cbShowTray_stateChanged (int))); if (settings.value("autoClear", 1).toInt()==1){ cbClearLogs->setCheckState(Qt::Checked); } else { cbClearLogs->setCheckState(Qt::Unchecked); } settings.endGroup(); settings.beginGroup("app"); if (settings.value("showTrareyIcon", 0).toInt()==1){ cbShowTray->setCheckState(Qt::Checked); } else { cbShowTray->setCheckState(Qt::Unchecked); } if (settings.value("showNotifications", 1).toInt()==1){ cbShowNotifications->setCheckState(Qt::Checked); } else { cbShowNotifications->setCheckState(Qt::Unchecked); } if (settings.value("minimizeToTray", 0).toInt()==1){ cbMinimizeToTray->setCheckState(Qt::Checked); } else { cbMinimizeToTray->setCheckState(Qt::Unchecked); } if (settings.value("minimizeToTrayAtAppStart", 0).toInt()==1){ cbMinimizeToTrayApp->setCheckState(Qt::Checked); } else { cbMinimizeToTrayApp->setCheckState(Qt::Unchecked); } listThemesView->clear(); std::auto_ptr<QListWidgetItem> iconItem (new QListWidgetItem(listThemesView, 0)); iconItem->setText("Default [Aughtor: Xavier Corredor Llano ([email protected]); License: GPL v.2.1]"); iconItem->setIcon(QIcon(":data/wine.png")); iconItem->setToolTip("Default"); listThemesView->setSelectionMode(QAbstractItemView::SingleSelection); QString themeDir=""; themeDir.append(QDir::homePath()); themeDir.append("/.config/"); themeDir.append(APP_SHORT_NAME); themeDir.append("/theme/"); getThemes(settings.value("theme").toString(), themeDir); loadThemeIcons(); if (settings.value("theme").toString()=="Default"){ listThemesView->setCurrentItem(iconItem.release()); } themeDir.clear(); #ifdef _OS_DARWIN_ themeDir.append(QDir::currentPath()); themeDir.append("/"); themeDir.append(APP_SHORT_NAME); themeDir.append(".app/Contents/Resources/theme"); #else themeDir.append(APP_PREF); themeDir.append("/share/"); themeDir.append(APP_SHORT_NAME); themeDir.append("/theme"); #endif getThemes(settings.value("theme").toString(), themeDir); getLangs(); if (settings.value("lang").toString().isEmpty()){ comboLangs->setCurrentIndex(comboLangs->findText(tr("System Default"))); } else { comboLangs->setCurrentIndex(comboLangs->findText(settings.value("lang").toString())); } settings.endGroup(); settings.beginGroup("system"); txtTarBin->setText(settings.value("tar").toString()); txtMountBin->setText(settings.value("mount").toString()); txtUmountBin->setText(settings.value("umount").toString()); txtSudoBin->setText(settings.value("sudo").toString()); txtGuiSudoBin->setText(settings.value("gui_sudo").toString()); txtNiceBin->setText(settings.value("nice").toString()); txtReniceBin->setText(settings.value("renice").toString()); txtShBin->setText(settings.value("sh").toString()); settings.endGroup(); settings.beginGroup("console"); txtConsoleBin->setText(settings.value("bin").toString()); txtConsoleArgs->setText(settings.value("args").toString()); settings.endGroup(); settings.beginGroup("quickmount"); comboMountProfiles->setCurrentIndex(settings.value("type", 0).toInt()); connect(comboMountProfiles, SIGNAL(currentIndexChanged(int)), this, SLOT(comboMountProfiles_currentIndexChanged(int))); if (!settings.value("mount_drive_string").toString().isEmpty()) txtMountString->setText(settings.value("mount_drive_string").toString()); if (!settings.value("mount_image_string").toString().isEmpty()) txtMountImageString->setText(settings.value("mount_image_string").toString()); if (!settings.value("umount_string").toString().isEmpty()) txtUmountString->setText(settings.value("umount_string").toString()); settings.endGroup(); #ifdef WITH_ICOUTILS settings.beginGroup("icotool"); txtWrestoolBin->setText(settings.value("wrestool").toString()); txtIcotoolBin->setText(settings.value("icotool").toString()); settings.endGroup(); cmdGetWrestoolBin->installEventFilter(this); cmdGetIcotoolBin->installEventFilter(this); #else txtWrestoolBin->setEnabled(false); txtIcotoolBin->setEnabled(false); cmdGetWrestoolBin->setEnabled(false); cmdGetIcotoolBin->setEnabled(false); #endif settings.beginGroup("network"); txtProxyHost->setText(settings.value("host").toString()); txtProxyPort->setText(settings.value("port").toString()); txtProxyUser->setText(settings.value("user").toString()); txtProxyPass->setText(settings.value("pass").toString()); comboProxyType->setCurrentIndex(settings.value("type").toInt()); settings.endGroup(); #ifdef _OS_FREEBSD_ this->comboMountProfiles->removeItem(3); this->comboMountProfiles->removeItem(2); #endif #ifdef _OS_DARWIN_ this->comboMountProfiles->removeItem(3); this->comboMountProfiles->removeItem(2); this->comboMountProfiles->removeItem(1); this->comboMountProfiles->setItemText(0, tr("generic")); this->txtMountString->setEnabled(false); this->frameMount->setVisible(false); #endif settings.beginGroup("advanced"); if (settings.value("openRunDialog", 0).toInt()==0){ cbOpenRunDialog->setChecked(false); } else { cbOpenRunDialog->setChecked(true); } if (settings.value("useSingleClick", 0).toInt()==0){ cbUseSingleClick->setChecked(false); } else { cbUseSingleClick->setChecked(true); } #if QT_VERSION >= 0x040500 if (settings.value("useNativeFileDialog", 1).toInt()==1){ cbUseNativeDialog->setChecked(true); } else { cbUseNativeDialog->setChecked(false); } #else cbUseNativeDialog->setEnabled(false); #endif QString res = settings.value("defaultDesktopSize").toString(); if (res.isEmpty()){ cboxDesktopSize->setCurrentIndex(0); } else { cboxDesktopSize->setCurrentIndex(cboxDesktopSize->findText(res)); } settings.endGroup(); settings.beginGroup("DesktopImport"); if (settings.value("remove", 0).toInt()==0){ cbRemoveDesktopFiles->setChecked(false); } else { cbRemoveDesktopFiles->setChecked(true); } if (settings.value("importAtStartup", 0).toInt()==0){ cbImportDesktopFilesAtStartup->setChecked(false); } else { cbImportDesktopFilesAtStartup->setChecked(true); } settings.endGroup(); settings.beginGroup("AppDB"); if (settings.value("useSystemBrowser", 1).toInt()==1){ cbUseSystemBrowser->setChecked(true); } else { cbUseSystemBrowser->setChecked(false); } settings.endGroup(); QList<QTreeWidgetItem *> items = optionsTree->findItems (tr("General"), Qt::MatchExactly); if (items.count()>0){ items.at(0)->setExpanded(true); optionsTree->setCurrentItem(items.at(0)); optionsStack->setCurrentIndex(0); tabwGeneral->setCurrentIndex(0); } cmdOk->setFocus(Qt::ActiveWindowFocusReason); return; }