MainWindow::MainWindow(int startState, QString run_binary, QWidget * parent, Qt::WindowFlags f) : QMainWindow(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 class pointer CoreLibClassPointer = (CoreLibPrototype *) libq4wine.resolve("createCoreLib"); CoreLib.reset((corelib *)CoreLibClassPointer(true)); clearTmp(); db_prefix.fixPrefixPath(); if (CoreLib->getSetting("DesktopImport", "importAtStartup", false, 0)==1){ Progress progress(0, ""); progress.exec(); } // importIcons(QString("%1/.local/share/applications/wine/").arg(QDir::homePath())); //exportProcess.close(); // Base GUI setup setupUi(this); if (!this->createSocket()){ this->close(); return; } if (startState == 1) this->showMinimized(); setWindowTitle(tr("%1 :. Qt GUI for Wine v%2").arg(APP_NAME) .arg(APP_VERS)); std::auto_ptr<QVBoxLayout> vlayout (new QVBoxLayout); std::auto_ptr<PrefixConfigWidget> configWidget (new PrefixConfigWidget(tabPrefixSeup)); connect(configWidget.get(), SIGNAL(updateDatabaseConnections()), this, SLOT(updateDtabaseConnectedItems())); connect(configWidget.get(), SIGNAL(setTabIndex (int)), tbwGeneral, SLOT(setCurrentIndex (int))); connect(this, SIGNAL(updateDatabaseConnections()), configWidget.get(), SLOT(getPrefixes())); std::auto_ptr<LoggingWidget> logWidget (new LoggingWidget(tabLogging)); connect (this, SIGNAL(reloadLogData()), logWidget.get(), SLOT(getLogRecords())); logWidget->getLogRecords(); logLayout->addWidget(logWidget.release()); std::auto_ptr<IconListWidget> lstIcons (new IconListWidget(tabPrograms)); connect(this, SIGNAL(runProgramRequest(QString)), lstIcons.get(), SLOT(runProgramRequest(QString))); connect(lstIcons.get(), SIGNAL(iconItemClick(QString, QString, QString, QString, QString)), this, SLOT(updateIconDesc(QString, QString, QString, QString, QString))); connect(lstIcons.get(), SIGNAL(changeStatusText(QString)), this, SLOT(changeStatusText(QString))); connect(lstIcons.get(), SIGNAL(appRunned(bool)), this, SLOT(setMeVisible(bool))); std::auto_ptr<PrefixTreeWidget> twPrograms (new PrefixTreeWidget(tabPrograms)); connect(twPrograms.get(), SIGNAL(updateDatabaseConnections()), this, SLOT(updateDtabaseConnectedItems())); connect(this, SIGNAL(updateDatabaseConnections()), twPrograms.get(), SLOT(getPrefixes())); connect(twPrograms.get(), SIGNAL(showFolderContents(QString, QString)), lstIcons.get(), SLOT(showFolderContents(QString, QString))); connect(twPrograms.get(), SIGNAL(setSearchFocus()), this, SLOT(setSearchFocus())); connect(twPrograms.get(), SIGNAL(changeStatusText(QString)), this, SLOT(changeStatusText(QString))); connect(this, SIGNAL(setDefaultFocus(QString, QString)), twPrograms.get(), SLOT(setDefaultFocus(QString, QString))); connect(configWidget.get(), SIGNAL(prefixIndexChanged(QString)), twPrograms.get(), SLOT(setDefaultFocus(QString))); connect(twPrograms.get(), SIGNAL(prefixIndexChanged(QString)), configWidget.get(), SLOT(setPrefix(QString))); connect(twPrograms.get(), SIGNAL(setTabIndex (int)), tbwGeneral, SLOT(setCurrentIndex (int))); connect(twPrograms.get(), SIGNAL(pasteAction()), lstIcons.get(), SLOT(iconPaste_Click())); std::auto_ptr<WineProcessWidget> procWidget (new WineProcessWidget(tabProcess)); connect(this, SIGNAL(stopProcTimer()), procWidget.get(), SLOT(stopTimer())); connect(this, SIGNAL(startProcTimer()), procWidget.get(), SLOT(startTimer())); connect(procWidget.get(), SIGNAL(changeStatusText(QString)), this, SLOT(changeStatusText(QString))); tabProcessLayout->addWidget(procWidget.release()); std::auto_ptr<PrefixControlWidget> prefixWidget (new PrefixControlWidget(tabPrefix)); connect(prefixWidget.get(), SIGNAL(updateDatabaseConnections()), twPrograms.get(), SLOT(getPrefixes())); connect(prefixWidget.get(), SIGNAL(updateDatabaseConnections()), this, SLOT(updateDtabaseConnectedItems())); connect(configWidget.get(), SIGNAL(prefixIndexChanged(QString)), prefixWidget.get(), SLOT(setDefaultFocus(QString))); connect(prefixWidget.get(), SIGNAL(prefixIndexChanged(QString)), configWidget.get(), SLOT(setPrefix(QString))); connect(prefixWidget.get(), SIGNAL(setTabIndex (int)), tbwGeneral, SLOT(setCurrentIndex (int))); connect(twPrograms.get(), SIGNAL(updateDatabaseConnections()), prefixWidget.get(), SLOT(updateDtabaseItems())); std::auto_ptr<IconListToolbar> iconToolBar (new IconListToolbar(tabPrograms)); connect(iconToolBar.get(), SIGNAL(searchFilterChange(QString)), lstIcons.get(), SLOT(setFilterString(QString))); connect(iconToolBar.get(), SIGNAL(changeView(int)), lstIcons.get(), SLOT(changeView(int))); std::auto_ptr<PrefixTreeToolbar> prefixToolBar (new PrefixTreeToolbar(tabPrograms)); connect(prefixToolBar.get(), SIGNAL(expandTree()), twPrograms.get(), SLOT(expandTree())); connect(prefixToolBar.get(), SIGNAL(collapseTree()), twPrograms.get(), SLOT(collapseTree())); connect(prefixToolBar.get(), SIGNAL(updatePrefixTree()), this, SLOT(updateDtabaseConnectedItems())); connect(prefixToolBar.get(), SIGNAL(updatePrefixTree()), prefixWidget.get(), SLOT(updateDtabaseItems())); vlayout.reset(new QVBoxLayout); vlayout->addWidget(prefixToolBar.release()); vlayout->addWidget(twPrograms.release()); vlayout->setMargin(0); vlayout->setSpacing(0); std::auto_ptr<QWidget> wid (new QWidget(tabPrograms)); wid->setLayout(vlayout.release()); splitter.reset(new QSplitter(tabPrograms)); splitter->addWidget(wid.release()); vlayout.reset(new QVBoxLayout); vlayout->addWidget(iconToolBar.release()); vlayout->addWidget(lstIcons.release()); vlayout->setMargin(0); vlayout->setSpacing(0); //vlayout->setContentsMargins(0,0,0,0); wid.reset(new QWidget(tabPrograms)); wid->setLayout(vlayout.release()); splitter->addWidget(wid.release()); vlayout.reset(new QVBoxLayout); vlayout->addWidget(splitter.get()); vlayout->addWidget(gbInfo); vlayout->setContentsMargins(3,0,3,3); tabPrograms->setLayout(vlayout.release()); tabPrefixLayout->addWidget(prefixWidget.release()); setupLayout->addWidget(configWidget.release()); // Updating database connected items updateDtabaseConnectedItems(); // Getting settings from config file this->createTrayIcon(); this->getSettings(); connect(tbwGeneral, SIGNAL(currentChanged(int)), this, SLOT(tbwGeneral_CurrentTabChange(int))); //connect(cmdCreateFake, SIGNAL(clicked()), this, SLOT(cmdCreateFake_Click())); //connect(cmdUpdateFake, SIGNAL(clicked()), this, SLOT(cmdUpdateFake_Click())); //Main menu actions connection to slots connect(mainRun, SIGNAL(triggered()), this, SLOT(mainRun_Click())); connect(mainPrograms, SIGNAL(triggered()), this, SLOT(mainPrograms_Click())); connect(mainLogging, SIGNAL(triggered()), this, SLOT(mainLogging_Click())); connect(mainProcess, SIGNAL(triggered()), this, SLOT(mainProcess_Click())); connect(mainSetup, SIGNAL(triggered()), this, SLOT(mainSetup_Click())); connect(mainPrefix, SIGNAL(triggered()), this, SLOT(mainPrefix_Click())); connect(mainImageManage, SIGNAL(triggered()), this, SLOT(mainImageManager_Click())); connect(mainAbout, SIGNAL(triggered()), this, SLOT(mainAbout_Click())); connect(mainAboutQt, SIGNAL(triggered()), this, SLOT(mainAboutQt_Click())); connect(mainExportIcons, SIGNAL(triggered()), this, SLOT(mainExportIcons_Click())); connect(mainOptions, SIGNAL(triggered()), this, SLOT(mainOptions_Click())); connect(mainInstall, SIGNAL(triggered()), this, SLOT(mainInstall_Click())); connect(mainExit, SIGNAL(triggered()), this, SLOT(mainExit_Click())); connect(mainImportWineIcons, SIGNAL(triggered()), this, SLOT(mainImportWineIcons_Click())); connect(mainVersionManager, SIGNAL(triggered()), this, SLOT(mainVersionManager_Click())); CoreLib->runAutostart(); #ifndef WITH_ICOUTILS mainExportIcons->setEnabled(false); #endif if (!run_binary.isEmpty()) messageReceived(run_binary); if (!trayIcon->isVisible()) show(); return; }
void KSegSelectionGroupDialog::newGroup() { if(doc->getSelected().size() == 0) return; //shouldn't be here anyway //set up the name query dialog QDialog nameDlg(0, 0, true); QPushButton *ok, *cancel; QLabel *query; QLineEdit *edit; QVBoxLayout vlayout(&nameDlg); vlayout.addSpacing(8); QHBoxLayout hlayout0; vlayout.addLayout(&hlayout0); hlayout0.addSpacing(8); query = new QLabel(tr("Enter new group name:"), &nameDlg); hlayout0.addWidget(query); hlayout0.addSpacing(8); edit = new QLineEdit(&nameDlg); hlayout0.addWidget(edit); hlayout0.addSpacing(8); vlayout.addSpacing(8); QHBoxLayout hlayout; vlayout.addLayout(&hlayout); hlayout.addSpacing(8); ok = new QPushButton(qApp->translate("KSegDocument", "OK", ""), &nameDlg ); hlayout.addWidget(ok); QObject::connect( ok, SIGNAL(clicked()), &nameDlg, SLOT(accept()) ); ok->setDefault(true); hlayout.addSpacing(8); cancel = new QPushButton(qApp->translate("KSegDocument", "Cancel", ""), &nameDlg ); hlayout.addWidget(cancel); QObject::connect( cancel, SIGNAL(clicked()), &nameDlg, SLOT(reject()) ); hlayout.addSpacing(8); vlayout.addSpacing(8); //run the dialog nameDlg.exec(); if(nameDlg.result() == QDialog::Rejected) return; //create the group groups.push_back(new KSegSelectionGroup(doc)); groups.back()->setName(edit->text()); for(int i = 0; i < (int)doc->getSelected().size(); ++i) groups.back()->addRef(doc->getSelected()[i]); groupLBox->addItem(" " + edit->text()); doc->emitDocumentModified(); }
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; }
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; }