void Dialog::configureTree() { kdDebug(700) << k_funcinfo << endl; ComponentsDialog *subdlg = new ComponentsDialog(d->dlg); subdlg->setPluginInfos(d->plugininfomap); subdlg->show(); connect(subdlg, SIGNAL(okClicked()), this, SLOT(updateTreeList())); connect(subdlg, SIGNAL(applyClicked()), this, SLOT(updateTreeList())); connect(subdlg, SIGNAL(okClicked()), this, SIGNAL(pluginSelectionChanged())); connect(subdlg, SIGNAL(applyClicked()), this, SIGNAL(pluginSelectionChanged())); connect(subdlg, SIGNAL(finished()), subdlg, SLOT(delayedDestruct())); }
void FileSelectorWidget::on_FilterCombo_currentIndexChanged(int index) { if (refreshing_) return; // Grab data for selected item RefListItem<FilePluginInterface,KVMap>* ri = (RefListItem<FilePluginInterface,KVMap>*) VariantPointer< RefListItem<FilePluginInterface,KVMap> >(ui.FilterCombo->itemData(index)); FilePluginInterface* plugin = (ri ? ri->item : NULL); if (!plugin) { // Unrecognised interface, or the All Files entry, so remove any filtering from the file system model fileSystemModel_.setNameFilters(QStringList()); emit(pluginOptionsAvailable(false)); } else { // Add extensions and exact names to the names filters QStringList nameFilters; for (int n=0; n< plugin->extensions().count(); ++n) nameFilters << "*." + plugin->extensions().at(n); for (int n=0; n< plugin->exactNames().count(); ++n) nameFilters << plugin->exactNames().at(n); fileSystemModel_.setNameFilters(nameFilters); if (mode_ == FileSelectorWidget::SaveSingleMode) emit(pluginOptionsAvailable(plugin->hasExportOptions())); else emit(pluginOptionsAvailable(plugin->hasImportOptions())); } emit(pluginSelectionChanged()); }
// Constructor AtenOpenModel::AtenOpenModel(QWidget* parent, QDir startingDirectory, const RefList<FilePluginInterface,KVMap>& filePlugins) : QDialog(parent), AtenFileDialog(filePlugins) { ui.setupUi(this); setFileSelectorWidget(ui.FileSelector, startingDirectory, FileSelectorWidget::OpenMultipleMode); // Link up some slots connect(ui.FileSelector, SIGNAL(selectionMade(bool)), this, SLOT(on_OpenButton_clicked(bool))); connect(ui.FileSelector, SIGNAL(selectionValid(bool)), ui.OpenButton, SLOT(setEnabled(bool))); connect(ui.FileSelector, SIGNAL(pluginOptionsAvailable(bool)), ui.PluginOptionsButton, SLOT(setEnabled(bool))); connect(ui.FileSelector, SIGNAL(pluginSelectionChanged()), this, SLOT(updateStandardOptionsFromPlugin())); }
ossimQtPluginsDialog::ossimQtPluginsDialog(QWidget* parent) : QDialog(parent, "ossimQtPluginsDialog", Qt::WDestructiveClose), thePluginList(0), theDescription(0), theAddButton(0), theRemoveButton(0), theCloseButton(0) { setCaption("Plugin Dialog"); // Main box to hold everything. Parented to this dialog box... QVBoxLayout* mainLayout = new QVBoxLayout(this); // Row one: QGroupBox* row1GroupBox = new QGroupBox(); // Row one: 2 columns horizontal. QHBoxLayout* row1Layout = new QHBoxLayout(); // Row one, Column one, a list of plugins. QGroupBox* pluginListGroupBox = new QGroupBox(QString("Plugins")); QVBoxLayout* pluginListLayout = new QVBoxLayout(); // plugin list pointer stored by class. thePluginList = new QListWidget(); // Parent list to layout. pluginListLayout->addWidget(thePluginList); // Parent layout to group box. pluginListGroupBox->setLayout(pluginListLayout); // Parent group box to row one layout. row1Layout->addWidget(pluginListGroupBox); // Row one , column two, selected plugin description. QGroupBox* descriptionGroupBox = new QGroupBox(QString("Description")); QVBoxLayout* descriptionLayout = new QVBoxLayout(); // plugin description pointer stored by class. theDescription = new QTextEdit(); // Only we can mess with text. theDescription->setReadOnly(true); // Parent text edit to layout. descriptionLayout->addWidget(theDescription); // Parent layout to group box. descriptionGroupBox->setLayout(descriptionLayout); // Parent group box to row one layout. row1Layout->addWidget(descriptionGroupBox); // Parent the row1Layout to the row1GroupBox. row1GroupBox->setLayout(row1Layout); // Parent row one group box to main layout mainLayout->addWidget(row1GroupBox); //--- // End of row one. //--- //--- // Row two: //--- QGroupBox* row2GroupBox = new QGroupBox(); // Row two: horizontal buttonw. QHBoxLayout* row2Layout = new QHBoxLayout(); // Row two, column one, add button. theAddButton = new QPushButton("Add"); row2Layout->addWidget(theAddButton); // Row two, column two, remove button. theRemoveButton = new QPushButton("Remove"); row2Layout->addWidget(theRemoveButton); // Row two, column three, close button. theCloseButton = new QPushButton("Close"); row2Layout->addWidget(theCloseButton); // Parent the row2Layout to the row2GroupBox. row2GroupBox->setLayout(row2Layout); // Parent row two group box to main layout mainLayout->addWidget(row2GroupBox); //--- // End of row two. //--- //--- // Connect all the signals to slots... //--- connect( thePluginList, SIGNAL ( itemSelectionChanged () ), this, SLOT ( pluginSelectionChanged() ) ); connect( theAddButton, SIGNAL ( pressed() ), this, SLOT ( addButtonPressed() ) ); connect( theRemoveButton, SIGNAL ( pressed() ), this, SLOT ( removeButtonPressed() ) ); connect( theCloseButton, SIGNAL ( pressed() ), this, SLOT ( closeButtonPressed() ) ); //--- // Set up the plugin list and description. //--- updateDialog(); }