void Config::setUserSettings() { // set proxy proxy.setEncodedUrl(RbSettings::value(RbSettings::Proxy).toByteArray()); if(proxy.port() > 0) ui.proxyPort->setText(QString("%1").arg(proxy.port())); else ui.proxyPort->setText(""); ui.proxyHost->setText(proxy.host()); ui.proxyUser->setText(proxy.userName()); ui.proxyPass->setText(proxy.password()); QString proxyType = RbSettings::value(RbSettings::ProxyType).toString(); if(proxyType == "manual") ui.radioManualProxy->setChecked(true); else if(proxyType == "system") ui.radioSystemProxy->setChecked(true); else ui.radioNoProxy->setChecked(true); // set language selection QList<QListWidgetItem*> a; QString b; // find key for lang value QMap<QString, QString>::const_iterator i = lang.constBegin(); QString l = RbSettings::value(RbSettings::Language).toString(); if(l.isEmpty()) l = QLocale::system().name(); while (i != lang.constEnd()) { if(i.value() == l) { b = i.key(); break; } else if(l.startsWith(i.value(), Qt::CaseInsensitive)) { // check if there is a base language (en -> en_US, etc.) b = i.key(); break; } i++; } a = ui.listLanguages->findItems(b, Qt::MatchExactly); if(a.size() > 0) ui.listLanguages->setCurrentItem(a.at(0)); // don't connect before language list has been set up to prevent // triggering the signal by selecting the saved language. connect(ui.listLanguages, SIGNAL(itemSelectionChanged()), this, SLOT(updateLanguage())); // devices tab refreshMountpoint(); mountpoint = QDir::toNativeSeparators(RbSettings::value(RbSettings::Mountpoint).toString()); setMountpoint(mountpoint); // cache tab if(!QFileInfo(RbSettings::value(RbSettings::CachePath).toString()).isDir()) RbSettings::setValue(RbSettings::CachePath, QDir::tempPath()); ui.cachePath->setText(QDir::toNativeSeparators(RbSettings::value(RbSettings::CachePath).toString())); ui.cacheDisable->setChecked(RbSettings::value(RbSettings::CacheDisabled).toBool()); ui.cacheOfflineMode->setChecked(RbSettings::value(RbSettings::CacheOffline).toBool()); updateCacheInfo(RbSettings::value(RbSettings::CachePath).toString()); // TTS tab ui.ttsCorrections->setChecked(RbSettings::value(RbSettings::UseTtsCorrections).toBool()); }
void GroupDef::addFile(const FileDef *def) { static bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS); if (def->isHidden()) return; updateLanguage(def); if (sortBriefDocs) fileList->inSort(def); else fileList->append(def); }
bool GroupDef::addNamespace(const NamespaceDef *def) { static bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS); if (def->isHidden()) return FALSE; updateLanguage(def); if (namespaceSDict->find(def->name())==0) { if (sortBriefDocs) namespaceSDict->inSort(def->name(),def); else namespaceSDict->append(def->name(),def); return TRUE; } return FALSE; }
OracleWizard::OracleWizard(QWidget *parent) : QWizard(parent) { settings = new QSettings(settingsCache->getSettingsPath()+"global.ini",QSettings::IniFormat, this); connect(settingsCache, SIGNAL(langChanged()), this, SLOT(updateLanguage())); importer = new OracleImporter(settingsCache->getDataPath(), this); addPage(new IntroPage); addPage(new LoadSetsPage); addPage(new SaveSetsPage); addPage(new LoadTokensPage); addPage(new SaveTokensPage); retranslateUi(); }
bool GroupDef::addClass(const ClassDef *cd) { static bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS); if (cd->isHidden()) return FALSE; updateLanguage(cd); QCString qn = cd->name(); if (classSDict->find(qn)==0) { //printf("--- addClass %s sort=%d\n",qn.data(),sortBriefDocs); if (sortBriefDocs) { classSDict->inSort(qn,cd); } else { int i=qn.findRev("::"); if (i==-1) i=qn.find('.'); bool found=FALSE; //printf("i=%d\n",i); if (i!=-1) { // add nested classes (e.g. A::B, A::C) after their parent (A) in // order of insertion QCString scope = qn.left(i); int j=classSDict->findAt(scope); if (j!=-1) { while (j<(int)classSDict->count() && classSDict->at(j)->qualifiedName().left(i)==scope) { //printf("skipping over %s\n",classSDict->at(j)->qualifiedName().data()); j++; } //printf("Found scope at index %d\n",j); classSDict->insertAt(j,qn,cd); found=TRUE; } } if (!found) // no insertion point found -> just append { classSDict->append(qn,cd); } } return TRUE; } return FALSE; }
DlgSettings::DlgSettings(QWidget *parent) : QDialog(parent) { connect(settingsCache, SIGNAL(langChanged()), this, SLOT(updateLanguage())); contentsWidget = new QListWidget; contentsWidget->setViewMode(QListView::IconMode); contentsWidget->setIconSize(QSize(58, 50)); contentsWidget->setMovement(QListView::Static); contentsWidget->setMinimumHeight(85); contentsWidget->setMaximumHeight(85); contentsWidget->setSpacing(5); pagesWidget = new QStackedWidget; pagesWidget->addWidget(new GeneralSettingsPage); pagesWidget->addWidget(new AppearanceSettingsPage); pagesWidget->addWidget(new UserInterfaceSettingsPage); pagesWidget->addWidget(new DeckEditorSettingsPage); pagesWidget->addWidget(new MessagesSettingsPage); pagesWidget->addWidget(new SoundSettingsPage); pagesWidget->addWidget(new ShortcutsTab); createIcons(); contentsWidget->setCurrentRow(0); QVBoxLayout *vboxLayout = new QVBoxLayout; vboxLayout->addWidget(contentsWidget); vboxLayout->addWidget(pagesWidget); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); connect(buttonBox, SIGNAL(accepted()), this, SLOT(close())); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(vboxLayout); mainLayout->addSpacing(12); mainLayout->addWidget(buttonBox); setLayout(mainLayout); retranslateUi(); adjustSize(); }
SetupPluginsDialog::SetupPluginsDialog(IPluginManager *APluginManager, QDomDocument APluginsSetup, QWidget *AParent) : QDialog(AParent) { ui.setupUi(this); IconStorage::staticStorage(RSR_STORAGE_MENUICONS)->insertAutoIcon(this,MNI_PLUGINMANAGER_SETUP,0,0,"windowIcon"); StyleStorage::staticStorage(RSR_STORAGE_STYLESHEETS)->insertAutoStyle(this, STS_PLUGINMANAGER_SETUPPLUGINSDIALOG); CustomBorderContainer *border = NULL; //CustomBorderStorage::staticStorage(RSR_STORAGE_CUSTOMBORDER)->addBorder(this, CBS_DIALOG); if (border) { border->setAttribute(Qt::WA_DeleteOnClose, true); connect(border, SIGNAL(closeClicked()), SLOT(reject())); connect(this, SIGNAL(accepted()), border, SLOT(closeWidget())); connect(this, SIGNAL(rejected()), border, SLOT(closeWidget())); } else { setAttribute(Qt::WA_DeleteOnClose,true); } FPluginManager = APluginManager; FPluginsSetup = APluginsSetup; updateLanguage(); connect(ui.cmbLanguage,SIGNAL(currentIndexChanged(int)),SLOT(onCurrentLanguageChanged(int))); updatePlugins(); ui.twtPlugins->horizontalHeader()->setResizeMode(COL_NAME,QHeaderView::Stretch); ui.twtPlugins->horizontalHeader()->setResizeMode(COL_FILE,QHeaderView::ResizeToContents); connect(ui.twtPlugins,SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)),SLOT(onCurrentPluginChanged(QTableWidgetItem *, QTableWidgetItem *))); connect(ui.dbbButtons,SIGNAL(clicked(QAbstractButton *)),SLOT(onDialogButtonClicked(QAbstractButton *))); connect(ui.lblHomePage, SIGNAL(linkActivated(const QString &)),SLOT(onHomePageLinkActivated(const QString &))); ui.cmbCountry->setView(new QListView); ui.cmbLanguage->setView(new QListView); QString ns = CustomBorderStorage::isBordered(this) ? QString::null : QString("system-border"); window()->restoreGeometry(Options::fileValue("misc.setup-plugins-dialog.geometry",ns).toByteArray()); }
OracleWizard::OracleWizard(QWidget *parent) : QWizard(parent) { settings = new QSettings(this); connect(settingsCache, SIGNAL(langChanged()), this, SLOT(updateLanguage())); importer = new OracleImporter( #if QT_VERSION < 0x050000 QDesktopServices::storageLocation(QDesktopServices::DataLocation) #else QStandardPaths::standardLocations(QStandardPaths::DataLocation).first() #endif , this); addPage(new IntroPage); addPage(new LoadSetsPage); addPage(new SaveSetsPage); addPage(new LoadTokensPage); addPage(new SaveTokensPage); retranslateUi(); }
bool GroupDef::insertMember(MemberDef *md,bool docOnly) { if (md->isHidden()) return FALSE; updateLanguage(md); //printf("GroupDef(%s)::insertMember(%s)\n", title.data(), md->name().data()); MemberNameInfo *mni=0; if ((mni=(*allMemberNameInfoSDict)[md->name()])) { // member with this name already found MemberNameInfoIterator srcMnii(*mni); MemberInfo *srcMi; for ( ; (srcMi=srcMnii.current()) ; ++srcMnii ) { MemberDef *srcMd = srcMi->memberDef; if (srcMd==md) return FALSE; // already added before! bool sameScope = srcMd->getOuterScope()==md->getOuterScope() || // same class or namespace // both inside a file => definition and declaration do not have to be in the same file (srcMd->getOuterScope()->definitionType()==Definition::TypeFile && md->getOuterScope()->definitionType()==Definition::TypeFile); ArgumentList *srcMdAl = srcMd->argumentList(); ArgumentList *mdAl = md->argumentList(); ArgumentList *tSrcMdAl = srcMd->templateArguments(); ArgumentList *tMdAl = md->templateArguments(); if (srcMd->isFunction() && md->isFunction() && // both are a function ((tSrcMdAl==0 && tMdAl==0) || (tSrcMdAl!=0 && tMdAl!=0 && tSrcMdAl->count()==tMdAl->count()) ) && // same number of template arguments matchArguments2(srcMd->getOuterScope(),srcMd->getFileDef(),srcMdAl, md->getOuterScope(),md->getFileDef(),mdAl, TRUE ) && // matching parameters sameScope // both are found in the same scope ) { if (srcMd->getGroupAlias()==0) { md->setGroupAlias(srcMd); } else if (md!=srcMd->getGroupAlias()) { md->setGroupAlias(srcMd->getGroupAlias()); } return FALSE; // member is the same as one that is already added } } mni->append(new MemberInfo(md,md->protection(),md->virtualness(),FALSE)); } else { mni = new MemberNameInfo(md->name()); mni->append(new MemberInfo(md,md->protection(),md->virtualness(),FALSE)); allMemberNameInfoSDict->append(mni->memberName(),mni); } //printf("Added member!\n"); allMemberList->append(md); switch(md->memberType()) { case MemberType_Variable: if (!docOnly) { addMemberToList(MemberListType_decVarMembers,md); } addMemberToList(MemberListType_docVarMembers,md); break; case MemberType_Function: if (!docOnly) { addMemberToList(MemberListType_decFuncMembers,md); } addMemberToList(MemberListType_docFuncMembers,md); break; case MemberType_Typedef: if (!docOnly) { addMemberToList(MemberListType_decTypedefMembers,md); } addMemberToList(MemberListType_docTypedefMembers,md); break; case MemberType_Enumeration: if (!docOnly) { addMemberToList(MemberListType_decEnumMembers,md); } addMemberToList(MemberListType_docEnumMembers,md); break; case MemberType_EnumValue: if (!docOnly) { addMemberToList(MemberListType_decEnumValMembers,md); } addMemberToList(MemberListType_docEnumValMembers,md); break; case MemberType_Define: if (!docOnly) { addMemberToList(MemberListType_decDefineMembers,md); } addMemberToList(MemberListType_docDefineMembers,md); break; case MemberType_Signal: if (!docOnly) { addMemberToList(MemberListType_decSignalMembers,md); } addMemberToList(MemberListType_docSignalMembers,md); break; case MemberType_Slot: if (md->protection()==Public) { if (!docOnly) { addMemberToList(MemberListType_decPubSlotMembers,md); } addMemberToList(MemberListType_docPubSlotMembers,md); } else if (md->protection()==Protected) { if (!docOnly) { addMemberToList(MemberListType_decProSlotMembers,md); } addMemberToList(MemberListType_docProSlotMembers,md); } else { if (!docOnly) { addMemberToList(MemberListType_decPriSlotMembers,md); } addMemberToList(MemberListType_docPriSlotMembers,md); } break; case MemberType_Event: if (!docOnly) { addMemberToList(MemberListType_decEventMembers,md); } addMemberToList(MemberListType_docEventMembers,md); break; case MemberType_Property: if (!docOnly) { addMemberToList(MemberListType_decPropMembers,md); } addMemberToList(MemberListType_docPropMembers,md); break; case MemberType_Friend: if (!docOnly) { addMemberToList(MemberListType_decFriendMembers,md); } addMemberToList(MemberListType_docFriendMembers,md); break; default: err("GroupDef::insertMembers(): " "member `%s' (typeid=%d) with scope `%s' inserted in group scope `%s'!\n", md->name().data(),md->memberType(), md->getClassDef() ? md->getClassDef()->name().data() : "", name().data()); } return TRUE; }
void SearchPathsDialog::changeEvent( QEvent * a_pEvent ) { if ( a_pEvent->type() == QEvent::LanguageChange ) updateLanguage(); QDialog::changeEvent( a_pEvent ); }