QgsComposerManager::QgsComposerManager( QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f ) { QPushButton *pb; setupUi( this ); QSettings settings; restoreGeometry( settings.value( "/Windows/ComposerManager/geometry" ).toByteArray() ); connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( close() ) ); pb = new QPushButton( tr( "&Show" ) ); mButtonBox->addButton( pb, QDialogButtonBox::ActionRole ); connect( pb, SIGNAL( clicked() ), this, SLOT( show_clicked() ) ); pb = new QPushButton( tr( "&Duplicate" ) ); mButtonBox->addButton( pb, QDialogButtonBox::ActionRole ); connect( pb, SIGNAL( clicked() ), this, SLOT( duplicate_clicked() ) ); pb = new QPushButton( tr( "&Remove" ) ); mButtonBox->addButton( pb, QDialogButtonBox::ActionRole ); connect( pb, SIGNAL( clicked() ), this, SLOT( remove_clicked() ) ); pb = new QPushButton( tr( "Re&name" ) ); mButtonBox->addButton( pb, QDialogButtonBox::ActionRole ); connect( pb, SIGNAL( clicked() ), this, SLOT( rename_clicked() ) ); initialize(); }
void gnc_commodities_dialog_response (GtkDialog *dialog, gint response, CommoditiesDialog *cd) { switch (response) { case GNC_RESPONSE_NEW: add_clicked (cd); return; case GNC_RESPONSE_DELETE: remove_clicked (cd); return; case GNC_RESPONSE_EDIT: edit_clicked (cd); return; case GTK_RESPONSE_CLOSE: default: gnc_close_gui_component_by_data (DIALOG_COMMODITIES_CM_CLASS, cd); return; } }
MarkingDataSetupWidget::MarkingDataSetupWidget(QList <class MarkingItemDefinition *> *markingItemDefinitionList, QList <class StudentData *> *studentList, QWidget *parent) : QWidget(parent), ui(new Ui::MarkingDataSetupWidget) { ui->setupUi(this); ui->treeWidget->setColumnWidth(0,110); ui->treeWidget->setColumnWidth(1,50); ui->treeWidget->setColumnWidth(2,50); ui->treeWidget->setColumnWidth(3,50); ui->treeWidget->setColumnWidth(4,60); ui->treeWidget->setColumnWidth(5,60); //---- Has been passed existing data, so setup markingItemDefinitions = markingItemDefinitionList; students = studentList; setupTree(); connect(ui->treeWidget,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(doubleclicked(QTreeWidgetItem*,int))); connect(ui->AddButton,SIGNAL(clicked()),this,SLOT(add_clicked())); connect(ui->UpButton,SIGNAL(clicked()),this,SLOT(up_clicked())); connect(ui->DownButton,SIGNAL(clicked()),this,SLOT(down_clicked())); connect(ui->DeleteButton,SIGNAL(clicked()),this,SLOT(remove_clicked())); }
DuplicateDialog::DuplicateDialog(const QList<QString> &pathlist, QString dir, QWidget *parent) : QDialog(parent), ui(new Ui::DuplicateDialog) { ui->setupUi(this); QGridLayout *layout = new QGridLayout(this); bool matchNames = true; qint64 filesize = 0; for(int i = 0; i < pathlist.size(); ++i) { if(i != 0) { QFileInfo fileinfo1(dir + pathlist[i]); QFileInfo fileinfo2(dir + pathlist[i - 1]); if(fileinfo1.fileName() != fileinfo2.fileName()) matchNames = false; } else filesize = QFileInfo(dir + pathlist[i]).size(); QLabel *label = new QLabel(pathlist[i], this); layout->addWidget(label, i, 0); QPushButton *button = new QPushButton("Remove", this); button->setStatusTip(dir + pathlist[i]); //qDebug() << "DuplicateDialog" << i << dir + pathlist[i]; connect(button, SIGNAL(clicked()), this, SLOT(remove_clicked())); layout->addWidget(button, i, 1); } layout->addWidget(new QLabel("Size: " + QString::number(filesize), this)); if(matchNames) layout->addWidget(new QLabel("All files have the same name", this)); setLayout(layout); }
QgsComposerManager::QgsComposerManager( QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f ) { QPushButton *pb; setupUi( this ); QSettings settings; restoreGeometry( settings.value( "/Windows/ComposerManager/geometry" ).toByteArray() ); connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( close() ) ); connect( QgisApp::instance(), SIGNAL( composerAdded( QgsComposerView* ) ), this, SLOT( refreshComposers() ) ); connect( QgisApp::instance(), SIGNAL( composerRemoved( QgsComposerView* ) ), this, SLOT( refreshComposers() ) ); pb = new QPushButton( tr( "&Show" ) ); mButtonBox->addButton( pb, QDialogButtonBox::ActionRole ); connect( pb, SIGNAL( clicked() ), this, SLOT( show_clicked() ) ); pb = new QPushButton( tr( "&Duplicate" ) ); mButtonBox->addButton( pb, QDialogButtonBox::ActionRole ); connect( pb, SIGNAL( clicked() ), this, SLOT( duplicate_clicked() ) ); pb = new QPushButton( tr( "&Remove" ) ); mButtonBox->addButton( pb, QDialogButtonBox::ActionRole ); connect( pb, SIGNAL( clicked() ), this, SLOT( remove_clicked() ) ); pb = new QPushButton( tr( "Re&name" ) ); mButtonBox->addButton( pb, QDialogButtonBox::ActionRole ); connect( pb, SIGNAL( clicked() ), this, SLOT( rename_clicked() ) ); #ifdef Q_WS_MAC // Create action to select this window mWindowAction = new QAction( windowTitle(), this ); connect( mWindowAction, SIGNAL( triggered() ), this, SLOT( activate() ) ); #endif mTemplate->addItem( tr( "Empty composer" ) ); mTemplate->addItem( tr( "Specific" ) ); mUserTemplatesDir = QgsApplication::qgisSettingsDirPath() + "/composer_templates"; QMap<QString, QString> userTemplateMap = defaultTemplates( true ); if ( userTemplateMap.size() > 0 ) { mTemplate->insertSeparator( mTemplate->count() ); QMap<QString, QString>::const_iterator templateIt = userTemplateMap.constBegin(); for ( ; templateIt != userTemplateMap.constEnd(); ++templateIt ) { mTemplate->addItem( templateIt.key(), templateIt.value() ); } } mDefaultTemplatesDir = QgsApplication::pkgDataPath() + "/composer_templates"; QMap<QString, QString> defaultTemplateMap = defaultTemplates( false ); if ( defaultTemplateMap.size() > 0 ) { mTemplate->insertSeparator( mTemplate->count() ); QMap<QString, QString>::const_iterator templateIt = defaultTemplateMap.constBegin(); for ( ; templateIt != defaultTemplateMap.constEnd(); ++templateIt ) { mTemplate->addItem( templateIt.key(), templateIt.value() ); } } mTemplatePathLineEdit->setText( settings.value( "/UI/ComposerManager/templatePath", QString( "" ) ).toString() ); refreshComposers(); }