void AndroidGdbServerKitInformationWidget::showDialog() { QDialog dialog; QVBoxLayout *layout = new QVBoxLayout(&dialog); QFormLayout *formLayout = new QFormLayout; formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); QLabel *binaryLabel = new QLabel(tr("&Binary:")); PathChooser *chooser = new PathChooser; chooser->setExpectedKind(PathChooser::ExistingCommand); chooser->setPath(AndroidGdbServerKitInformation::gdbServer(m_kit).toString()); binaryLabel->setBuddy(chooser); formLayout->addRow(binaryLabel, chooser); layout->addLayout(formLayout); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog); connect(buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject())); layout->addWidget(buttonBox); dialog.setWindowTitle(tr("GDB Server for \"%1\"").arg(m_kit->displayName())); if (dialog.exec() == QDialog::Accepted) AndroidGdbServerKitInformation::setGdbSever(m_kit, chooser->fileName()); }
void Editor::openTextFile() { OovString filename; PathChooser ch; if(ch.ChoosePath(Gui::getMainWindow(), "Open File", GTK_FILE_CHOOSER_ACTION_OPEN, filename)) { openTextFile(filename); } }
void Editor::setPreferencesWorkingDir() { PathChooser chooser; chooser.setDefaultPath(Project::getBuildOutputDir(BuildConfigDebug)); OovString dir; if(chooser.ChoosePath(Gui::getMainWindow(), "Select Working Directory", GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, dir)) { GtkEntry *workDirEntry = GTK_ENTRY(mBuilder.getWidget("DebugWorkingDirEntry")); Gui::setText(workDirEntry, dir); } }
void ProjectSettingsDialog::rootSourceDirButtonClicked() { PathChooser ch; OovString srcRootDir; if(ch.ChoosePath(sProjectSettingsDialog->getParentWindow(), "Open Root Source Directory", GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, srcRootDir)) { GtkEntry *dirEntry = GTK_ENTRY(Builder::getBuilder()->getWidget( "RootSourceDirEntry")); gtk_entry_set_text(dirEntry, srcRootDir.c_str()); } }
void ProjectSettingsDialog::oovaideProjectDirButtonClicked() { PathChooser ch; OovString projectDir; if(ch.ChoosePath(sProjectSettingsDialog->getParentWindow(), "Create OOVAIDE Project Directory", GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER, projectDir)) { GtkEntry *dirEntry = GTK_ENTRY(Builder::getBuilder()->getWidget( "OovaideProjectDirEntry")); gtk_entry_set_text(dirEntry, projectDir.c_str()); } }
QWidget *CustomWizardFieldPage::registerPathChooser(const QString &fieldName, const CustomWizardField &field) { PathChooser *pathChooser = new PathChooser; const QString expectedKind = field.controlAttributes.value(QLatin1String("expectedkind")).toLower(); if (expectedKind == QLatin1String("existingdirectory")) pathChooser->setExpectedKind(PathChooser::ExistingDirectory); else if (expectedKind == QLatin1String("directory")) pathChooser->setExpectedKind(PathChooser::Directory); else if (expectedKind == QLatin1String("file")) pathChooser->setExpectedKind(PathChooser::File); else if (expectedKind == QLatin1String("existingcommand")) pathChooser->setExpectedKind(PathChooser::ExistingCommand); else if (expectedKind == QLatin1String("command")) pathChooser->setExpectedKind(PathChooser::Command); else if (expectedKind == QLatin1String("any")) pathChooser->setExpectedKind(PathChooser::Any); pathChooser->setHistoryCompleter(QString::fromLatin1("PE.Custom.") + m_parameters->id + QLatin1Char('.') + field.name); registerField(fieldName, pathChooser, "path", SIGNAL(changed(QString))); // Connect to completeChanged() for derived classes that reimplement isComplete() connect(pathChooser, SIGNAL(changed(QString)), SIGNAL(completeChanged())); const QString defaultText = field.controlAttributes.value(QLatin1String("defaulttext")); m_pathChoosers.push_back(PathChooserData(pathChooser, defaultText)); return pathChooser; } // Utils::PathChooser
State getDialogState(const AttachCoreDialog &p) const { State st; st.localCoreFile = p.useLocalCoreFile(); st.validKit = (kitChooser->currentKit() != 0); st.validLocalExecFilename = localExecFileName->isValid(); if (st.localCoreFile) st.validCoreFilename = localCoreFileName->isValid(); else st.validCoreFilename = !p.remoteCoreFile().isEmpty(); st.localKit = p.isLocalKit(); return st; }
void ProjectSettingsDialog::excludeDirsButtonClicked() { PathChooser ch; OovString dir; if(ch.ChoosePath(sProjectSettingsDialog->getParentWindow(), "Add Exclude Directory", GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, dir)) { GtkTextView *dirTextView = GTK_TEXT_VIEW(Builder::getBuilder()->getWidget( "ExcludeDirsTextview")); std::string relDir; relDir = Project::getSrcRootDirRelativeSrcFileDir(getRootSrcDir(), dir); relDir += '\n'; Gui::appendText(dirTextView, relDir); } }