HgBackoutDialog::HgBackoutDialog(QWidget *parent) : DialogBase(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, parent) { // dialog properties this->setWindowTitle(xi18nc("@title:window", "<application>Hg</application> Backout")); okButton()->setText(xi18nc("@action:button", "Backout")); okButton()->setDisabled(true); // setupUI(); // Load saved settings FileViewHgPluginSettings *settings = FileViewHgPluginSettings::self(); this->resize(QSize(settings->backoutDialogWidth(), settings->backoutDialogHeight())); // connections connect(this, SIGNAL(finished(int)), this, SLOT(saveGeometry())); connect(m_selectBaseCommitButton, SIGNAL(clicked()), this, SLOT(slotSelectBaseChangeset())); connect(m_selectParentCommitButton, SIGNAL(clicked()), this, SLOT(slotSelectParentChangeset())); connect(m_baseRevision, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateOkButton(const QString&))); }
void AttachExternalDialog::procSelected(const QModelIndex &proxyIndex) { const QString processId = m_model->processIdAt(proxyIndex); if (!processId.isEmpty()) { m_ui->pidLineEdit->setText(processId); if (okButton()->isEnabled()) okButton()->animateClick(); } }
QgsAuthImportCertDialog::QgsAuthImportCertDialog( QWidget *parent , QgsAuthImportCertDialog::CertFilter filter, QgsAuthImportCertDialog::CertInput input ) : QDialog( parent ) , mFilter( filter ) , mInput( input ) , mDisabled( false ) , mAuthNotifyLayout( nullptr ) , mAuthNotify( nullptr ) { if ( QgsAuthManager::instance()->isDisabled() ) { mDisabled = true; mAuthNotifyLayout = new QVBoxLayout; this->setLayout( mAuthNotifyLayout ); mAuthNotify = new QLabel( QgsAuthManager::instance()->disabledMessage(), this ); mAuthNotifyLayout->addWidget( mAuthNotify ); } else { setupUi( this ); connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) ); connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) ); connect( teCertText, SIGNAL( textChanged() ), this, SLOT( validateCertificates() ) ); connect( radioImportFile, SIGNAL( toggled( bool ) ), this, SLOT( updateGui() ) ); connect( radioImportText, SIGNAL( toggled( bool ) ), this, SLOT( updateGui() ) ); // hide unused widgets if ( mInput == FileInput ) { radioImportText->setHidden( true ); teCertText->setHidden( true ); } else if ( mInput == TextInput ) { radioImportFile->setHidden( true ); frameImportFile->setHidden( true ); } radioImportFile->setChecked( true ); updateGui(); if ( mFilter == CaFilter ) { grpbxImportCert->setTitle( tr( "Import Certificate Authorities" ) ); } okButton()->setText( tr( "Import" ) ); okButton()->setEnabled( false ); teValidation->setFocus(); } }
QgsAuthImportCertDialog::QgsAuthImportCertDialog( QWidget *parent, QgsAuthImportCertDialog::CertFilter filter, QgsAuthImportCertDialog::CertInput input ) : QDialog( parent ) , mFilter( filter ) , mInput( input ) { if ( QgsApplication::authManager()->isDisabled() ) { mDisabled = true; mAuthNotifyLayout = new QVBoxLayout; this->setLayout( mAuthNotifyLayout ); mAuthNotify = new QLabel( QgsApplication::authManager()->disabledMessage(), this ); mAuthNotifyLayout->addWidget( mAuthNotify ); } else { setupUi( this ); connect( btnImportFile, &QToolButton::clicked, this, &QgsAuthImportCertDialog::btnImportFile_clicked ); connect( chkAllowInvalid, &QCheckBox::toggled, this, &QgsAuthImportCertDialog::chkAllowInvalid_toggled ); connect( buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept ); connect( buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject ); connect( teCertText, &QPlainTextEdit::textChanged, this, &QgsAuthImportCertDialog::validateCertificates ); connect( radioImportFile, &QAbstractButton::toggled, this, &QgsAuthImportCertDialog::updateGui ); connect( radioImportText, &QAbstractButton::toggled, this, &QgsAuthImportCertDialog::updateGui ); // hide unused widgets if ( mInput == FileInput ) { radioImportText->setHidden( true ); teCertText->setHidden( true ); } else if ( mInput == TextInput ) { radioImportFile->setHidden( true ); frameImportFile->setHidden( true ); } radioImportFile->setChecked( true ); updateGui(); if ( mFilter == CaFilter ) { grpbxImportCert->setTitle( tr( "Import Certificate Authorities" ) ); } okButton()->setText( tr( "Import" ) ); okButton()->setEnabled( false ); teValidation->setFocus(); } }
NickNameDialog::NickNameDialog(QStandardItemModel *model, QWidget *parent) : QDialog(parent), m_ui(new Ui::NickNameDialog), m_model(model), m_filterModel(new QSortFilterProxyModel(this)) { setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); m_ui->setupUi(this); okButton()->setEnabled(false); // Populate model and grow tree to accommodate it m_filterModel->setSourceModel(model); m_filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive); m_ui->filterTreeView->setModel(m_filterModel); const int columnCount = m_filterModel->columnCount(); int treeWidth = 0; for (int c = 0; c < columnCount; c++) { m_ui->filterTreeView->resizeColumnToContents(c); treeWidth += m_ui->filterTreeView->columnWidth(c); } m_ui->filterTreeView->setMinimumWidth(treeWidth + 20); connect(m_ui->filterTreeView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotDoubleClicked(QModelIndex))); connect(m_ui->filterTreeView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(slotCurrentItemChanged(QModelIndex))); connect(m_ui->filterLineEdit, SIGNAL(filterChanged(QString)), m_filterModel, SLOT(setFilterFixedString(QString))); }
NickNameDialog::NickNameDialog(QStandardItemModel *model, QWidget *parent) : QDialog(parent), m_ui(new Internal::Ui::NickNameDialog), m_model(model), m_filterModel(new QSortFilterProxyModel(this)) { setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); m_ui->setupUi(this); okButton()->setEnabled(false); // Populate model and grow tree to accommodate it m_filterModel->setSourceModel(model); m_filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive); m_ui->filterTreeView->setModel(m_filterModel); m_ui->filterTreeView->setActivationMode(Utils::DoubleClickActivation); const int columnCount = m_filterModel->columnCount(); int treeWidth = 0; for (int c = 0; c < columnCount; c++) { m_ui->filterTreeView->resizeColumnToContents(c); treeWidth += m_ui->filterTreeView->columnWidth(c); } m_ui->filterTreeView->setMinimumWidth(treeWidth + 20); m_ui->filterLineEdit->setFiltering(true); connect(m_ui->filterTreeView, &QAbstractItemView::activated, this, &NickNameDialog::slotActivated); connect(m_ui->filterTreeView->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &NickNameDialog::slotCurrentItemChanged); connect(m_ui->filterLineEdit, &Utils::FancyLineEdit::filterChanged, m_filterModel, &QSortFilterProxyModel::setFilterFixedString); }
IpAddressWidget::IpAddressWidget(QWidget *parent) { m_Separator = "."; //四个数字的输入框,QSpinBox实现,范围是0~255,无“上下按钮”,文字居中 //这里也可以用QLineEdit+QIntValidator实现,但个人觉得这种方法不好用 for(int i=0; i<4; i++) { m_SpinBox[i] = new QSpinBox(this); m_SpinBox[i]->setRange(0, 255); m_SpinBox[i]->setButtonSymbols(QAbstractSpinBox::NoButtons); m_SpinBox[i]->setAlignment(Qt::AlignCenter); m_SpinBox[i]->setFixedWidth(40); m_SpinBox[i]->installEventFilter(this); } m_LineEdit = new QLineEdit(this); m_LineEdit->setFixedWidth(80); //四个输入框之间的分隔符 for(int i=0; i<3; i++) { m_Label[i] = new QLabel(m_Separator, this); m_Label[i]->setFixedWidth(10); m_Label[i]->setAlignment(Qt::AlignCenter); } m_Label[3] = new QLabel(":", this); m_Label[3]->setFixedWidth(10); m_Label[3]->setAlignment(Qt::AlignCenter); QHBoxLayout *hlay = new QHBoxLayout; //hlay->setSpacing(0); for(int i=0; i<4; i++) { hlay->addWidget(m_SpinBox[i]); hlay->addWidget(m_Label[i]); } hlay->addWidget(m_LineEdit); setLayout(hlay); btnok = new QPushButton(tr("OK"), this); /* QVBoxLayout *vlay = new QVBoxLayout(this); vlay->addLayout(hlay); vlay->addWidget(btnok); */ btnok->move(100, 100); connect(btnok, SIGNAL(clicked()), this, SLOT(okButton())); setWindowTitle(tr("私聊用户ip地址设置")); this->resize(300, 150); this->move((1366-300)/2, (768-150)/2); }
AttachExternalDialog::AttachExternalDialog(QWidget *parent) : QDialog(parent), m_selfPid(QString::number(QCoreApplication::applicationPid())), m_ui(new Ui::AttachExternalDialog), m_model(new ProcessListFilterModel(this)) { m_ui->setupUi(this); okButton()->setDefault(true); okButton()->setEnabled(false); m_ui->procView->setModel(m_model); m_ui->procView->setSortingEnabled(true); m_ui->procView->sortByColumn(1, Qt::AscendingOrder); connect(m_ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); QPushButton *refreshButton = new QPushButton(tr("Refresh")); connect(refreshButton, SIGNAL(clicked()), this, SLOT(rebuildProcessList())); m_ui->buttonBox->addButton(refreshButton, QDialogButtonBox::ActionRole); m_ui->filterWidget->setFocus(Qt::TabFocusReason); m_ui->procView->setAlternatingRowColors(true); m_ui->procView->setRootIsDecorated(false); m_ui->procView->setUniformRowHeights(true); // Do not use activated, will be single click in Oxygen connect(m_ui->procView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(procSelected(QModelIndex))); connect(m_ui->procView, SIGNAL(clicked(QModelIndex)), this, SLOT(procClicked(QModelIndex))); connect(m_ui->pidLineEdit, SIGNAL(textChanged(QString)), this, SLOT(pidChanged(QString))); connect(m_ui->filterWidget, SIGNAL(filterChanged(QString)), this, SLOT(setFilterString(QString))); setMinimumHeight(500); rebuildProcessList(); }
bool WEXPORT WDialog::keyDown( WKeyCode kc, WKeyState ks ) { /***********************************************************/ if( kc == WKeyEnter ) { okButton( NULL ); return( TRUE ); } else if( kc == WKeyEscape ) { cancelButton( NULL ); return( TRUE ); } WWindow::keyDown( kc, ks ); return( TRUE ); // so we don't pass key messages to parents of dialogs }
void RadianceDialog::createLayout() { okButton()->setText("Apply"); QLabel * label = NULL; label = new QLabel("Custom Radiance Parameter Settings",this); label->setObjectName("H1"); upperLayout()->addWidget(label); QVBoxLayout * vertLayout = new QVBoxLayout(); vertLayout->setContentsMargins(20,10,10,10); vertLayout->setSpacing(20); upperLayout()->addLayout(vertLayout); vertLayout->addWidget(m_radianceInspector); vertLayout->addStretch(); }
HgBundleDialog::HgBundleDialog(QWidget *parent) : DialogBase(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, parent) { this->setWindowTitle(xi18nc("@title:window", "<application>Hg</application> Bundle")); okButton()->setText(xi18nc("@action:button", "Bundle")); // Load saved settings FileViewHgPluginSettings *settings = FileViewHgPluginSettings::self(); this->resize(QSize(settings->bundleDialogWidth(), settings->bundleDialogHeight())); // setupUI(); // connections connect(this, SIGNAL(finished(int)), this, SLOT(saveGeometry())); connect(m_selectCommitButton, SIGNAL(clicked()), this, SLOT(slotSelectChangeset())); connect(m_allChangesets, SIGNAL(stateChanged(int)), this, SLOT(slotAllChangesCheckToggled(int))); }
ConnectDialog::ConnectDialog(QDesignerFormWindowInterface *formWindow, QWidget *source, QWidget *destination, QWidget *parent) : QDialog(parent), m_source(source), m_destination(destination), m_sourceMode(widgetMode(m_source, formWindow)), m_destinationMode(widgetMode(m_destination, formWindow)), m_formWindow(formWindow) { m_ui.setupUi(this); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); connect(m_ui.signalList, &QListWidget::itemClicked, this, &ConnectDialog::selectSignal); connect(m_ui.slotList, &QListWidget::itemClicked, this, &ConnectDialog::selectSlot); m_ui.slotList->setEnabled(false); QPushButton *ok_button = okButton(); ok_button->setDefault(true); ok_button->setEnabled(false); connect(m_ui.showAllCheckBox, &QCheckBox::toggled, this, &ConnectDialog::populateLists); QDesignerFormEditorInterface *core = m_formWindow->core(); m_ui.signalGroupBox->setTitle(widgetLabel(core, source)); m_ui.slotGroupBox->setTitle(widgetLabel(core, destination)); m_ui.editSignalsButton->setEnabled(m_sourceMode != NormalWidget); connect(m_ui.editSignalsButton, &QAbstractButton::clicked, this, &ConnectDialog::editSignals); m_ui.editSlotsButton->setEnabled(m_destinationMode != NormalWidget); connect(m_ui.editSlotsButton, &QAbstractButton::clicked, this, &ConnectDialog::editSlots); populateLists(); }
HgImportDialog::HgImportDialog(QWidget *parent) : DialogBase(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, parent) { // dialog properties this->setWindowTitle(xi18nc("@title:window", "<application>Hg</application> Import")); okButton()->setText(xi18nc("@action:button", "Import")); // setupUI(); // Load saved settings FileViewHgPluginSettings *settings = FileViewHgPluginSettings::self(); this->resize(QSize(settings->importDialogWidth(), settings->importDialogHeight())); // connect(this, SIGNAL(finished(int)), this, SLOT(saveGeometry())); connect(m_addPatches, SIGNAL(clicked()), this, SLOT(slotAddPatches())); connect(m_removePatches, SIGNAL(clicked()), this, SLOT(slotRemovePatches())); }
void LiveEventControl::openLoopRangeDialog(int row) { QDialog d; QVBoxLayout l(&d); QLabel ls(tr("Loop start"),&d); QSpinBox ss(&d); QLabel le(tr("Loop end"),&d); QSpinBox se(&d); QPushButton okButton(tr("Ok"), &d); QPushButton cancelButton(tr("Cancel"), &d); connect(&okButton,SIGNAL(released()),&d,SLOT(accept())); connect(&cancelButton,SIGNAL(released()),&d,SLOT(reject())); l.addWidget(&ls); l.addWidget(&ss); l.addWidget(&le); l.addWidget(&se); l.addWidget(&okButton); l.addWidget(&cancelButton); QTableWidgetItem *item = getItem(row,6); QStringList bounds(item->text().split("-")); if (bounds.size() > 1) { if (bounds[0].toInt() >= 0) { ss.setValue(bounds[0].toInt()); } if (bounds[1].toInt() >= 0) { se.setValue(bounds[1].toInt()); } } int ret = d.exec(); if (ret == QDialog::Accepted) { QString range = QString::number(ss.value()) + "-" + QString::number(se.value()); qDebug() << "LiveEventControl::openLoopRangeDialog " << row << range; QTableWidgetItem *item = m_ui->panelTableWidget->item(row,6); item->setText(range); emit setPanelLoopRangeSignal(row, ss.value() - 1,se.value() - 1); } }
void NickNameDialog::slotDoubleClicked(const QModelIndex &) { if (okButton()->isEnabled()) okButton()->animateClick(); }
void NickNameDialog::slotCurrentItemChanged(const QModelIndex &index) { okButton()->setEnabled(index.isValid()); }
FunkytownConfigDialog::FunkytownConfigDialog( QWidget *parent ) : QDialog( parent ) , mpProxyWidget( new ProxyWidget( this ) ) , mpLogList( new QListWidget( this ) ) , mpHelpText( new QTextBrowser( this ) ) , mpGlobalConfigWidget( new GlobalConfigWidget( this ) ) , mpOverwrite( new QCheckBox( tr("Overwrite Files During Download"), this ) ) , mpCoverArt( new QCheckBox( tr("Download Cover-Like Artwork"), this ) ) , mpTollKeep( new QCheckBox( tr("Count Downloaded Files And Bytes"), this ) ) , mpDownloadedFiles( new QLabel( this ) ) , mpDownloadedBytes( new QLabel( this ) ) , mpClearButton( new QPushButton( tr("Clear"), this ) ) { setWindowTitle( QApplication::applicationName() + ": " + tr("Settings") ); setWindowIcon( QIcon( ":/Funkytown/Icon.png" ) ); mpHelpText->setReadOnly( true ); mpHelpText->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); mpHelpText->setOpenExternalLinks( true ); mpHelpText->setSource( QUrl("qrc:/Usage.html") ); AboutWidget *about( new AboutWidget( this ) ); QPushButton *okButton( new QPushButton(tr("OK"), this) ); QPushButton *cancelButton( new QPushButton(tr("Cancel"), this) ); QHBoxLayout *buttonLayout = new QHBoxLayout; buttonLayout->addWidget( okButton ); buttonLayout->addWidget( cancelButton ); QWidget *settingsTab = new QWidget( this ); QGridLayout *settingsLayout = new QGridLayout( settingsTab ); settingsLayout->addWidget( mpOverwrite, 0, 0, 1, 3 ); settingsLayout->addWidget( mpCoverArt, 1, 0, 1, 3 ); settingsLayout->addWidget( mpTollKeep, 2, 0, 1, 3 ); settingsLayout->addWidget( new QLabel( tr("Downloaded Files:"), this ), 3, 0 ); settingsLayout->addWidget( mpDownloadedFiles, 3, 1 ); settingsLayout->addWidget( new QLabel( tr("Downloaded Bytes:"), this ), 4, 0 ); settingsLayout->addWidget( mpDownloadedBytes, 4, 1 ); settingsLayout->addWidget( mpClearButton, 3, 2, 2, 1 ); settingsLayout->setRowStretch( 5, 1 ); QBoxLayout *mainLayout = new QVBoxLayout( this ); QTabWidget *tabs = new QTabWidget( this ); tabs->addTab( mpHelpText, tr("Help") ); tabs->addTab( settingsTab, tr("Funkytown") ); tabs->addTab( mpProxyWidget, tr("Proxy") ); tabs->addTab( mpGlobalConfigWidget, tr("Global") ); tabs->addTab( mpLogList, tr("Log") ); mainLayout->addWidget( about ); mainLayout->addWidget( tabs ); mainLayout->addLayout( buttonLayout ); setLayout( mainLayout ); connect( mpClearButton, SIGNAL(clicked()), this, SLOT(handleClear()) ); connect( okButton, SIGNAL(clicked()), this, SLOT(accept()) ); connect( cancelButton, SIGNAL(clicked()), this, SLOT(reject()) ); connect( this, SIGNAL(accepted()), this, SLOT(writeSettings()) ); connect( this, SIGNAL(rejected()), this, SLOT(readSettings()) ); readSettings(); }
EkleMakale::EkleMakale(const wxString& title,const wxString& doi) : wxDialog(NULL,wxID_ANY,title,wxDefaultPosition,wxSize(500,550)) { wxImage::AddHandler(new wxPNGHandler); wxBitmap dialogLogo(srcLocation+wxT("resource/toolbar/contract2.png"),wxBITMAP_TYPE_PNG); wxBitmap searchButton(srcLocation+wxT("resource/toolbar/zoom.png"),wxBITMAP_TYPE_PNG); wxBitmap okButton(srcLocation+wxT("resource/toolbar/checkmark.png"),wxBITMAP_TYPE_PNG); wxBitmap cancelButton(srcLocation+wxT("resource/toolbar/cross.png"),wxBITMAP_TYPE_PNG); wxPanel *panel = new wxPanel(this,-1); wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL); wxStaticText *mainleft = new wxStaticText(panel,-1,wxT(" ")); hbox->Add(mainleft,0,wxEXPAND); wxPanel *subpanel = new wxPanel(panel,-1); wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL); vbox->Add(-1,10); wxPanel *toppanel = new wxPanel(subpanel,-1); wxBoxSizer *tophbox = new wxBoxSizer(wxHORIZONTAL); wxStaticText *dialogtitle = new wxStaticText(toppanel, -1, wxT("Makale Ekle / Düzenle")); wxFont font = dialogtitle->GetFont(); font.SetPointSize(18); font.SetWeight(wxFONTWEIGHT_BOLD); dialogtitle->SetFont(font); tophbox->Add(dialogtitle,1,wxALIGN_BOTTOM|wxEXPAND); wxStaticBitmap *dialoglogo = new wxStaticBitmap(toppanel,-1,dialogLogo); tophbox->Add(dialoglogo,0,wxALIGN_RIGHT); toppanel->SetSizer(tophbox); vbox->Add(toppanel,0,wxEXPAND); vbox->Add(new wxStaticLine(subpanel,-1,wxPoint(-1,-1),wxSize(-1,-1),wxLI_HORIZONTAL),0,wxEXPAND); vbox->Add(-1,10); wxPanel *midhpanel = new wxPanel(subpanel,-1); wxBoxSizer *midhbox = new wxBoxSizer(wxHORIZONTAL); wxPanel *midvpanel = new wxPanel(midhpanel,-1); wxBoxSizer *midvbox = new wxBoxSizer(wxVERTICAL); midvbox->Add(-1,10); wxPanel *mid1panel = new wxPanel(midvpanel,-1); wxBoxSizer *mid1hbox = new wxBoxSizer(wxHORIZONTAL); mid1hbox->Add(new wxStaticText(mid1panel,-1,wxT("DOI Numarası ")),1,wxEXPAND); paperdoi = new wxTextCtrl(mid1panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); paperdoi->SetValue(doi); mid1hbox->Add(paperdoi,0,wxALIGN_RIGHT); mid1panel->SetSizer(mid1hbox); midvbox->Add(mid1panel,0,wxEXPAND); midvbox->Add(-1,10); midvpanel->SetSizer(midvbox); midhbox->Add(midvpanel,0,wxALIGN_CENTER_VERTICAL|wxEXPAND); midhbox->Add(new wxStaticText(midhpanel,-1,wxT("")),1,wxEXPAND); midhbox->Add(new wxBitmapButton(midhpanel,ADDPAPER_DIALOG_RETRIEVE,searchButton),0,wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT); midhpanel->SetSizer(midhbox); vbox->Add(midhpanel,0,wxEXPAND); vbox->Add(-1,10); vbox->Add(new wxStaticLine(subpanel,-1,wxPoint(-1,-1),wxSize(-1,-1),wxLI_HORIZONTAL),0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid2panel = new wxPanel(subpanel,-1); wxBoxSizer *mid2hbox = new wxBoxSizer(wxHORIZONTAL); mid2hbox->Add(new wxStaticText(mid2panel,-1,wxT("Makale Başlığı")),1,wxEXPAND); papertitle = new wxTextCtrl(mid2panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); mid2hbox->Add(papertitle,0,wxALIGN_RIGHT); mid2panel->SetSizer(mid2hbox); vbox->Add(mid2panel,0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid3panel = new wxPanel(subpanel,-1); wxBoxSizer *mid3hbox = new wxBoxSizer(wxHORIZONTAL); mid3hbox->Add(new wxStaticText(mid3panel,-1,wxT("Yazarlar")),1,wxEXPAND); paperauthors = new wxTextCtrl(mid3panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); mid3hbox->Add(paperauthors,0,wxALIGN_RIGHT); mid3panel->SetSizer(mid3hbox); vbox->Add(mid3panel,0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid4panel = new wxPanel(subpanel,-1); wxBoxSizer *mid4hbox = new wxBoxSizer(wxHORIZONTAL); mid4hbox->Add(new wxStaticText(mid4panel,-1,wxT("Dergi")),1,wxEXPAND); paperjournal = new wxTextCtrl(mid4panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); mid4hbox->Add(paperjournal,0,wxALIGN_RIGHT); mid4panel->SetSizer(mid4hbox); vbox->Add(mid4panel,0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid5panel = new wxPanel(subpanel,-1); wxBoxSizer *mid5hbox = new wxBoxSizer(wxHORIZONTAL); mid5hbox->Add(new wxStaticText(mid5panel,-1,wxT("Cilt")),1,wxEXPAND); papervolume = new wxTextCtrl(mid5panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); mid5hbox->Add(papervolume,0,wxALIGN_RIGHT); mid5panel->SetSizer(mid5hbox); vbox->Add(mid5panel,0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid6panel = new wxPanel(subpanel,-1); wxBoxSizer *mid6hbox = new wxBoxSizer(wxHORIZONTAL); mid6hbox->Add(new wxStaticText(mid6panel,-1,wxT("Sayı")),1,wxEXPAND); paperissue = new wxTextCtrl(mid6panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); mid6hbox->Add(paperissue,0,wxALIGN_RIGHT); mid6panel->SetSizer(mid6hbox); vbox->Add(mid6panel,0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid7panel = new wxPanel(subpanel,-1); wxBoxSizer *mid7hbox = new wxBoxSizer(wxHORIZONTAL); mid7hbox->Add(new wxStaticText(mid7panel,-1,wxT("İlk Sayfa / Numara")),1,wxEXPAND); paperfirstpage = new wxTextCtrl(mid7panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); mid7hbox->Add(paperfirstpage,0,wxALIGN_RIGHT); mid7panel->SetSizer(mid7hbox); vbox->Add(mid7panel,0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid8panel = new wxPanel(subpanel,-1); wxBoxSizer *mid8hbox = new wxBoxSizer(wxHORIZONTAL); mid8hbox->Add(new wxStaticText(mid8panel,-1,wxT("Son Sayfa")),1,wxEXPAND); paperlastpage = new wxTextCtrl(mid8panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); mid8hbox->Add(paperlastpage,0,wxALIGN_RIGHT); mid8panel->SetSizer(mid8hbox); vbox->Add(mid8panel,0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid9panel = new wxPanel(subpanel,-1); wxBoxSizer *mid9hbox = new wxBoxSizer(wxHORIZONTAL); mid9hbox->Add(new wxStaticText(mid9panel,-1,wxT("Yayın Tarihi")),1,wxEXPAND); paperpublished = new wxTextCtrl(mid9panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); mid9hbox->Add(paperpublished,0,wxALIGN_RIGHT); mid9panel->SetSizer(mid9hbox); vbox->Add(mid9panel,0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid10panel = new wxPanel(subpanel,-1); wxBoxSizer *mid10hbox = new wxBoxSizer(wxHORIZONTAL); mid10hbox->Add(new wxStaticText(mid10panel,-1,wxT("Yayıncı Linki")),1,wxEXPAND); paperlink = new wxTextCtrl(mid10panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); mid10hbox->Add(paperlink,0,wxALIGN_RIGHT); mid10panel->SetSizer(mid10hbox); vbox->Add(mid10panel,0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid11panel = new wxPanel(subpanel,-1); wxBoxSizer *mid11hbox = new wxBoxSizer(wxHORIZONTAL); mid11hbox->Add(new wxStaticText(mid11panel,-1,wxT("Konu / Anahtar Kelimeler")),1,wxEXPAND); papersubject = new wxTextCtrl(mid11panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); mid11hbox->Add(papersubject,0,wxALIGN_RIGHT); mid11panel->SetSizer(mid11hbox); vbox->Add(mid11panel,0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid12panel = new wxPanel(subpanel,-1); wxBoxSizer *mid12hbox = new wxBoxSizer(wxHORIZONTAL); mid12hbox->Add(new wxStaticText(mid12panel,-1,wxT("Referans Kimliği")),1,wxEXPAND); paperrefid = new wxTextCtrl(mid12panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); mid12hbox->Add(paperrefid,0,wxALIGN_RIGHT); mid12panel->SetSizer(mid12hbox); vbox->Add(mid12panel,0,wxEXPAND); vbox->Add(-1,10); vbox->Add(new wxStaticText(subpanel,-1,wxT("")),1,wxEXPAND); vbox->Add(new wxStaticLine(subpanel,-1,wxPoint(-1,-1),wxSize(-1,-1),wxLI_HORIZONTAL),0,wxEXPAND); vbox->Add(-1,10); wxPanel *bottompanel = new wxPanel(subpanel,-1); wxBoxSizer *bottomhbox = new wxBoxSizer(wxHORIZONTAL); bottomhbox->Add(new wxStaticText(bottompanel,-1,wxT(" ")),0,wxEXPAND); wxArrayString paperstars; paperstars.Add(wxT("Beğeni")); paperstars.Add(wxT("0")); paperstars.Add(wxT("1")); paperstars.Add(wxT("2")); paperstars.Add(wxT("3")); paperstars.Add(wxT("4")); paperstars.Add(wxT("5")); paperstar = new wxChoice(bottompanel,-1,wxPoint(-1,-1),wxSize(150,-1),paperstars); bottomhbox->Add(paperstar,0,wxEXPAND); wxArrayString papercolors; papercolors.Add(wxT("İşaretleme Yok")); papercolors.Add(wxT("Sarı")); papercolors.Add(wxT("Kırmızı")); papercolors.Add(wxT("Yeşil")); papercolors.Add(wxT("Mavi")); papercolor = new wxChoice(bottompanel,-1,wxPoint(-1,-1),wxSize(150,-1),papercolors); bottomhbox->Add(papercolor,0,wxEXPAND); bottomhbox->Add(new wxStaticText(bottompanel,-1,wxT("")),1,wxEXPAND); bottomhbox->Add(new wxBitmapButton(bottompanel,wxID_CANCEL,cancelButton),0,wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT); bottomhbox->Add(new wxBitmapButton(bottompanel,wxID_OK,okButton),0,wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT); bottompanel->SetSizer(bottomhbox); vbox->Add(bottompanel,0,wxEXPAND); subpanel->SetSizer(vbox); hbox->Add(subpanel,1,wxEXPAND); hbox->Add(new wxStaticText(panel,-1,wxT(" ")),0,wxEXPAND); panel->SetSizer(hbox); Connect(ADDPAPER_DIALOG_RETRIEVE,wxEVT_COMMAND_BUTTON_CLICKED,wxCommandEventHandler(EkleMakale::DOIRetrieveTrigger)); if(doi != wxT("")) { wxString doichecksql; doichecksql << wxT("SELECT * FROM papers WHERE doi=='") << doi << wxT("'"); vtcevap doicheck; doicheck = Vt(doichecksql); if(doicheck.satir>0) { papertitle->SetValue(doicheck.sonuc.Item(1)); paperauthors->SetValue(doicheck.sonuc.Item(2)); paperjournal->SetValue(doicheck.sonuc.Item(3)); papervolume->SetValue(doicheck.sonuc.Item(4)); paperissue->SetValue(doicheck.sonuc.Item(5)); paperfirstpage->SetValue(doicheck.sonuc.Item(6)); paperlastpage->SetValue(doicheck.sonuc.Item(7)); paperpublished->SetValue(doicheck.sonuc.Item(8)); paperlink->SetValue(doicheck.sonuc.Item(9)); papersubject->SetValue(doicheck.sonuc.Item(10)); paperrefid->SetValue(doicheck.sonuc.Item(11)); paperstar->SetStringSelection(doicheck.sonuc.Item(12)); papercolor->SetStringSelection(doicheck.sonuc.Item(13)); } else { EkleMakale::DOIRetrieve(); } } }
void AttachExternalDialog::pidChanged(const QString &pid) { bool enabled = !pid.isEmpty() && pid != QLatin1String("0") && pid != m_selfPid;; okButton()->setEnabled(enabled); }
bool SpreadSheet::runInputDialog(const QString &title, const QString &c1Text, const QString &c2Text, const QString &opText, const QString &outText, QString *cell1, QString *cell2, QString *outCell) { QStringList rows, cols; for (int c = 0; c < table->columnCount(); ++c) cols << QChar('A' + c); for (int r = 0; r < table->rowCount(); ++r) rows << QString::number(1 + r); QDialog addDialog(this); addDialog.setWindowTitle(title); QGroupBox group(title, &addDialog); group.setMinimumSize(250, 100); QLabel cell1Label(c1Text, &group); QComboBox cell1RowInput(&group); int c1Row, c1Col; decode_pos(*cell1, &c1Row, &c1Col); cell1RowInput.addItems(rows); cell1RowInput.setCurrentIndex(c1Row); QComboBox cell1ColInput(&group); cell1ColInput.addItems(cols); cell1ColInput.setCurrentIndex(c1Col); QLabel operatorLabel(opText, &group); operatorLabel.setAlignment(Qt::AlignHCenter); QLabel cell2Label(c2Text, &group); QComboBox cell2RowInput(&group); int c2Row, c2Col; decode_pos(*cell2, &c2Row, &c2Col); cell2RowInput.addItems(rows); cell2RowInput.setCurrentIndex(c2Row); QComboBox cell2ColInput(&group); cell2ColInput.addItems(cols); cell2ColInput.setCurrentIndex(c2Col); QLabel equalsLabel("=", &group); equalsLabel.setAlignment(Qt::AlignHCenter); QLabel outLabel(outText, &group); QComboBox outRowInput(&group); int outRow, outCol; decode_pos(*outCell, &outRow, &outCol); outRowInput.addItems(rows); outRowInput.setCurrentIndex(outRow); QComboBox outColInput(&group); outColInput.addItems(cols); outColInput.setCurrentIndex(outCol); QPushButton cancelButton(tr("Cancel"), &addDialog); connect(&cancelButton, SIGNAL(clicked()), &addDialog, SLOT(reject())); QPushButton okButton(tr("OK"), &addDialog); okButton.setDefault(true); connect(&okButton, SIGNAL(clicked()), &addDialog, SLOT(accept())); QHBoxLayout *buttonsLayout = new QHBoxLayout; buttonsLayout->addStretch(1); buttonsLayout->addWidget(&okButton); buttonsLayout->addSpacing(10); buttonsLayout->addWidget(&cancelButton); QVBoxLayout *dialogLayout = new QVBoxLayout(&addDialog); dialogLayout->addWidget(&group); dialogLayout->addStretch(1); dialogLayout->addItem(buttonsLayout); QHBoxLayout *cell1Layout = new QHBoxLayout; cell1Layout->addWidget(&cell1Label); cell1Layout->addSpacing(10); cell1Layout->addWidget(&cell1ColInput); cell1Layout->addSpacing(10); cell1Layout->addWidget(&cell1RowInput); QHBoxLayout *cell2Layout = new QHBoxLayout; cell2Layout->addWidget(&cell2Label); cell2Layout->addSpacing(10); cell2Layout->addWidget(&cell2ColInput); cell2Layout->addSpacing(10); cell2Layout->addWidget(&cell2RowInput); QHBoxLayout *outLayout = new QHBoxLayout; outLayout->addWidget(&outLabel); outLayout->addSpacing(10); outLayout->addWidget(&outColInput); outLayout->addSpacing(10); outLayout->addWidget(&outRowInput); QVBoxLayout *vLayout = new QVBoxLayout(&group); vLayout->addItem(cell1Layout); vLayout->addWidget(&operatorLabel); vLayout->addItem(cell2Layout); vLayout->addWidget(&equalsLabel); vLayout->addStretch(1); vLayout->addItem(outLayout); if (addDialog.exec()) { *cell1 = cell1ColInput.currentText() + cell1RowInput.currentText(); *cell2 = cell2ColInput.currentText() + cell2RowInput.currentText(); *outCell = outColInput.currentText() + outRowInput.currentText(); return true; } return false; }
void ConnectDialog::setOkButtonEnabled(bool e) { okButton()->setEnabled(e); }
EkleListe::EkleListe(const wxString& title,const wxString& id) : wxDialog(NULL,wxID_ANY,title,wxDefaultPosition,wxSize(500,300)) { wxImage::AddHandler(new wxPNGHandler); wxBitmap dialogLogo(srcLocation+wxT("resource/toolbar/list2.png"),wxBITMAP_TYPE_PNG); wxBitmap okButton(srcLocation+wxT("resource/toolbar/checkmark.png"),wxBITMAP_TYPE_PNG); wxBitmap cancelButton(srcLocation+wxT("resource/toolbar/cross.png"),wxBITMAP_TYPE_PNG); wxPanel *panel = new wxPanel(this,-1); wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL); wxStaticText *mainleft = new wxStaticText(panel,-1,wxT(" ")); hbox->Add(mainleft,0,wxEXPAND); wxPanel *subpanel = new wxPanel(panel,-1); wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL); vbox->Add(-1,10); wxPanel *toppanel = new wxPanel(subpanel,-1); wxBoxSizer *tophbox = new wxBoxSizer(wxHORIZONTAL); wxStaticText *dialogtitle = new wxStaticText(toppanel, -1, wxT("Yeni Liste Ekle")); wxFont font = dialogtitle->GetFont(); font.SetPointSize(18); font.SetWeight(wxFONTWEIGHT_BOLD); dialogtitle->SetFont(font); tophbox->Add(dialogtitle,1,wxALIGN_BOTTOM|wxEXPAND); wxStaticBitmap *dialoglogo = new wxStaticBitmap(toppanel,-1,dialogLogo); tophbox->Add(dialoglogo,0,wxALIGN_RIGHT); toppanel->SetSizer(tophbox); vbox->Add(toppanel,0,wxEXPAND); vbox->Add(new wxStaticLine(subpanel,-1,wxPoint(-1,-1),wxSize(-1,-1),wxLI_HORIZONTAL),0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid1panel = new wxPanel(subpanel,-1); wxBoxSizer *mid1hbox = new wxBoxSizer(wxHORIZONTAL); mid1hbox->Add(new wxStaticText(mid1panel,-1,wxT("Liste Adı")),1,wxEXPAND); listname = new wxTextCtrl(mid1panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); mid1hbox->Add(listname,0,wxALIGN_RIGHT); mid1panel->SetSizer(mid1hbox); vbox->Add(mid1panel,0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid2panel = new wxPanel(subpanel,-1); wxBoxSizer *mid2hbox = new wxBoxSizer(wxHORIZONTAL); mid2hbox->Add(new wxStaticText(mid2panel,-1,wxT("Liste Açıklaması")),1,wxEXPAND); listdesc = new wxTextCtrl(mid2panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,-1)); mid2hbox->Add(listdesc,0,wxALIGN_RIGHT); mid2panel->SetSizer(mid2hbox); vbox->Add(mid2panel,0,wxEXPAND); vbox->Add(-1,10); wxPanel *mid3panel = new wxPanel(subpanel,-1); wxBoxSizer *mid3hbox = new wxBoxSizer(wxHORIZONTAL); mid3hbox->Add(new wxStaticText(mid3panel,-1,wxT("Referans Stili")),1,wxEXPAND); liststyle = new wxTextCtrl(mid3panel,-1,wxT(""),wxPoint(-1,-1),wxSize(300,100),wxTE_MULTILINE); mid3hbox->Add(liststyle,0,wxALIGN_RIGHT); mid3panel->SetSizer(mid3hbox); vbox->Add(mid3panel,0,wxEXPAND); vbox->Add(-1,10); vbox->Add(new wxStaticText(subpanel,-1,wxT("")),1,wxEXPAND); vbox->Add(new wxStaticLine(subpanel,-1,wxPoint(-1,-1),wxSize(-1,-1),wxLI_HORIZONTAL),0,wxEXPAND); vbox->Add(-1,10); wxPanel *bottompanel = new wxPanel(subpanel,-1); wxBoxSizer *bottomhbox = new wxBoxSizer(wxHORIZONTAL); bottomhbox->Add(new wxStaticText(bottompanel,-1,wxT(" ")),0,wxEXPAND); wxArrayString liststyles; liststyles.Add(wxT("Hazır Liste Stilleri")); liststyles.Add(wxT("{yazarlar}, {yayıncı}, {cilt}({sayı}), {ilksayfa-sonsayfa} ({yıl}).")); liststyles.Add(wxT("{yazarlar}, {yayıncı}, {cilt}({sayı}), {ilksayfa-sonsayfa} ({yıl}) {yenisatır} {başlık}.")); liststyles.Add(wxT("{yazarlar}, {yayıncı}, {cilt} ({yıl}), {ilksayfa-sonsayfa}.")); liststyles.Add(wxT("{yazarlar}, {yayıncı}, {cilt} ({yıl}), {ilksayfa-sonsayfa} {yenisatır} {başlık}.")); liststyles.Add(wxT("{yazarlar}, {yıl}, {başlık}, {yayıncı}, {cilt}, {ilksayfa-sonsayfa}.")); liststyles.Add(wxT("{yazarlar}, {yıl}, {yayıncı}, {cilt}, {ilksayfa-sonsayfa}.")); liststylehelper = new wxChoice(bottompanel,-1,wxPoint(-1,-1),wxSize(180,-1),liststyles); bottomhbox->Add(liststylehelper,0,wxEXPAND); bottomhbox->Add(new wxStaticText(bottompanel,-1,wxT("")),1,wxEXPAND); bottomhbox->Add(new wxBitmapButton(bottompanel,wxID_CANCEL,cancelButton),0,wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT); bottomhbox->Add(new wxBitmapButton(bottompanel,wxID_OK,okButton),0,wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT); bottompanel->SetSizer(bottomhbox); vbox->Add(bottompanel,0,wxEXPAND); subpanel->SetSizer(vbox); hbox->Add(subpanel,1,wxEXPAND); hbox->Add(new wxStaticText(panel,-1,wxT(" ")),0,wxEXPAND); panel->SetSizer(hbox); Connect(liststylehelper->GetId(),wxEVT_COMMAND_CHOICE_SELECTED,wxCommandEventHandler(EkleListe::SetStyleFromHelper)); //Centre(); if(id != wxT("")) EkleListe::PrepareUpdate(id); }
FontDlg::FontDlg(QWidget *parent, const char *name, KApplication *mykapp,DefStruct *defstruct) : QDialog(parent, name) { mykapp = kapp; defst = defstruct; box = new QGroupBox(this, "box"); box->setGeometry(10,10,320,260); box->setTitle(klocale->translate("Set Default Font")); button = new QPushButton(this); button->setGeometry(235,225,80,25); button->setText(klocale->translate("Change")); connect(button,SIGNAL(clicked()),this,SLOT(setFont())); familylabel = new QLabel(this); familylabel->setGeometry(20,65,135,25); familylabel->setText(klocale->translate("Family:")); familylabeldisp = new QLabel(this); familylabeldisp->setGeometry(130,65,150,25); familylabeldisp->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); familylabeldisp->setText(defst->font.family()); sizelabel = new QLabel(this); sizelabel->setGeometry(20,105,100,25); sizelabel->setText(klocale->translate("Point Size:")); sizelabeldisp = new QLabel(this); sizelabeldisp->setGeometry(130,105,60,25); sizelabeldisp->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); QString size; size.setNum(defst->font.pointSize()); sizelabeldisp->setText(size); stylelabel = new QLabel(this); stylelabel->setGeometry(20,140,80,25); stylelabel->setText(klocale->translate("Style:")); stylelabeldisp = new QLabel(this); stylelabeldisp->setGeometry(130,145,80,23); stylelabeldisp->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); if(defst->font.italic()) stylelabeldisp->setText(klocale->translate("Italic")); else stylelabeldisp->setText(klocale->translate("Roman")); weightlabel = new QLabel(this); weightlabel->setGeometry(20,180,80,25); weightlabel->setText(klocale->translate("Weight:")); weightlabeldisp = new QLabel(this); weightlabeldisp->setGeometry(130,185,80,23); weightlabeldisp->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); if(defst->font.bold()) weightlabeldisp->setText(klocale->translate("Bold")); else weightlabeldisp->setText(klocale->translate("Normal")); connect(parent,SIGNAL(applyButtonPressed()),SLOT(okButton())); }
void NickNameDialog::slotActivated(const QModelIndex &) { if (okButton()->isEnabled()) okButton()->click(); }
void HgBackoutDialog::slotUpdateOkButton(const QString &text) { qDebug() << "text" << text; okButton()->setEnabled(!text.isEmpty()); }
void QgsAuthImportCertDialog::validateCertificates() { mCerts.clear(); teValidation->clear(); teValidation->setStyleSheet( QString() ); bool valid = false; QList<QSslCertificate> certs; QList<QSslCertificate> nixcerts; int validcerts = 0; bool allowinvalid = chkAllowInvalid->isChecked(); bool filterCAs = ( mFilter == CaFilter ); int cas = 0; if ( radioImportFile->isChecked() && !leImportFile->text().isEmpty() ) { certs = QgsAuthCertUtils::certsFromFile( leImportFile->text() ); } else if ( radioImportText->isChecked() && !teCertText->toPlainText().trimmed().isEmpty() ) { certs = QgsAuthCertUtils::certsFromString( teCertText->toPlainText().trimmed() ); } int certssize = certs.size(); const auto constCerts = certs; for ( const QSslCertificate &cert : constCerts ) { if ( QgsAuthCertUtils::certIsViable( cert ) ) ++validcerts; if ( filterCAs ) { if ( QgsAuthCertUtils::certificateIsAuthorityOrIssuer( cert ) ) { ++cas; } else { nixcerts << cert; } } } valid = ( certssize > 0 && ( allowinvalid || certssize == validcerts ) && ( !filterCAs || nixcerts.size() < certssize ) ); if ( !nixcerts.isEmpty() ) { const auto constNixcerts = nixcerts; for ( const QSslCertificate &nixcert : constNixcerts ) { certs.removeOne( nixcert ); } } if ( valid ) mCerts = certs; if ( certssize > 0 ) { teValidation->setStyleSheet( valid ? QgsAuthGuiUtils::greenTextStyleSheet( QStringLiteral( "QTextEdit" ) ) : QgsAuthGuiUtils::redTextStyleSheet( QStringLiteral( "QTextEdit" ) ) ); } QString msg = tr( "Certificates found: %1\n" "Certificates valid: %2" ).arg( certssize ).arg( validcerts ); if ( filterCAs ) { msg += tr( "\nAuthorities/Issuers: %1%2" ).arg( cas ) .arg( !nixcerts.isEmpty() && nixcerts.size() < certssize ? " (others not imported)" : "" ); } teValidation->setText( msg ); okButton()->setEnabled( valid ); }
ConfigDlg::ConfigDlg(QWidget *parent, const char *name, KApplication *mykapp, DefStruct *defstruct) : QDialog(parent, name) { mykapp = kapp; defst = defstruct; box = new QGroupBox(this, "box"); box->setGeometry(10,10,320,260); box->setTitle(i18n("Defaults")); label1 = new QLabel(this); label1->setGeometry(20,30,135,25); label1->setText(klocale->translate("Text Color:")); qframe1 = new QFrame(this); qframe1->setGeometry(155,30,30,25); qframe1->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); qframe1->setBackgroundColor(defst->forecolor); button1 = new QPushButton(this); button1->setGeometry(205,30,100,25); button1->setText(klocale->translate("Change")); connect(button1,SIGNAL(clicked()),this,SLOT(set_fore_color())); label2 = new QLabel(this); label2->setGeometry(20,65,135,25); label2->setText(klocale->translate("Background Color:")); qframe2 = new QFrame(this); qframe2->setGeometry(155,65,30,25); qframe2->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); qframe2->setBackgroundColor(defst->backcolor); button2 = new QPushButton(this); button2->setGeometry(205,65,100,25); button2->setText(klocale->translate("Change")); connect(button2,SIGNAL(clicked()),this,SLOT(set_background_color())); /* button3 = new QPushButton(this); button3->setGeometry(255,240,70,25); button3->setText(klocale->translate("Help")); connect(button3,SIGNAL(clicked()),this,SLOT(help())); */ label5 = new QLabel(this); label5->setGeometry(20,105,50,25); label5->setText(klocale->translate("Width:")); width = new KIntLineEdit(this); width->setGeometry(70,105,60,23); QString string; string.setNum(defst->width); width->setText(string); label6 = new QLabel(this); label6->setGeometry(20,145,50,25); label6->setText(klocale->translate("Height:")); height = new KIntLineEdit(this); height->setGeometry(70,145,60,23); QString string2; string2.setNum(defst->height); height->setText(string2); label7 = new QLabel(this); label7->setGeometry(20,185,100,25); label7->setText(klocale->translate("Print Command:")); print = new QLineEdit(this); print->setGeometry(130,185,180,23); print->setText(defst->printcommand.data()); label8 = new QLabel(this); label8->setGeometry(20,225,100,25); label8->setText(klocale->translate("Mail Command:")); mail = new QLineEdit(this); mail->setGeometry(130,225,180,23); mail->setText(defst->mailcommand.data()); QGroupBox *gbox; gbox = new QGroupBox(this); gbox->setGeometry(150,105,160,65); check1 = new QCheckBox( klocale->translate("3d Frame"), gbox ); check1->setGeometry( 10, 5, 100, 25 ); check1->setChecked( defst->frame3d ); connect( check1, SIGNAL( toggled( bool ) ), SLOT( frame3d_slot( bool ) ) ); check2 = new QCheckBox( klocale->translate("Auto Indent"), gbox ); check2->setGeometry( 10, 35, 130, 25 ); check2->setChecked( defst->autoindent ); connect( check2, SIGNAL( toggled( bool ) ), SLOT( indent_slot( bool ) ) ); connect(parent,SIGNAL(applyButtonPressed()),SLOT(okButton())); }
void AlterTable::on_actionModificar_Columna_triggered() { QDialog dialog(this); dialog.setWindowTitle("Modificar Columna"); QRadioButton isNullableRadioButton("Puede ser Nulo", &dialog); QRadioButton isNotNullableRadioButton("No puede ser Nulo", &dialog); isNullableRadioButton.setChecked(true); QLabel messageLabel("Nombre de Columna", &dialog); QLineEdit columnNameLineEdit(&dialog); QLabel typeLabel("Tipo", &dialog); QComboBox typeComboBox(&dialog); typeComboBox.addItems(QStringList() << "TINYINT" << "SMALLINT" << "MEDIUMINT" << "INT" << "BIGINT" << "BIT" << "FLOAT" << "DOUBLE" << "DECIMAL" << "CHAR" << "VARCHAR" << "TINYTEXT" << "TEXT" << "MEDIUMTEXT" << "LONGTEXT" << "BINARY" << "VARBINARY" << "TINYBLOB" << "BLOB" << "MEDIUMBLOB" << "LONGBLOB" << "DATE" << "TIME" << "YEAR" << "DATETIME" << "TIMESTAMP" << "POINT" << "LINESTRING" << "POLYGON" << "GEOMETRY" << "MULTIPOINT" << "MULTILINESTRING" << "MULTIPOLYGON" << "GEOMETRYCOLLECTION" << "ENUM" << "SET"); QPushButton acceptPushButton("Aceptar", &dialog); QPushButton cancelPushButton("Cancelar", &dialog); connect(&acceptPushButton, SIGNAL(clicked()), &dialog, SLOT(accept())); connect(&cancelPushButton, SIGNAL(clicked()), &dialog, SLOT(reject())); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(&isNullableRadioButton); layout->addWidget(&isNotNullableRadioButton); layout->addWidget(&messageLabel); layout->addWidget(&columnNameLineEdit); layout->addWidget(&typeLabel); layout->addWidget(&typeComboBox); QHBoxLayout *buttonsLayout = new QHBoxLayout; buttonsLayout->addWidget(&acceptPushButton); buttonsLayout->addWidget(&cancelPushButton); layout->addLayout(buttonsLayout); dialog.setLayout(layout); if (dialog.exec() == QDialog::Rejected) { return; } if (columnNameLineEdit.text() == QString()) { QMessageBox mBox(this); mBox.setWindowTitle("ERROR"); mBox.setIcon(QMessageBox::Critical); mBox.setText( "No se puede realizar la operación de modificación"); mBox.exec(); return; } QString lenghtString = QString(); if (typeComboBox.currentText() == "VARCHAR" || typeComboBox.currentText() == "VARBINARY") { QDialog lenDialog(&dialog); lenDialog.setWindowTitle("Longitud"); QVBoxLayout *layout = new QVBoxLayout; QHBoxLayout *topLayout = new QHBoxLayout; topLayout->addWidget(new QLabel("Longitud:", &lenDialog)); QLineEdit lenValueText(&lenDialog); topLayout->addWidget(&lenValueText); QHBoxLayout *layoutButtons = new QHBoxLayout; QPushButton okButton("Aceptar", &lenDialog); QPushButton cancelButton("Cancelar", &lenDialog); layoutButtons->addWidget(&okButton); layoutButtons->addWidget(&cancelButton); layout->addLayout(topLayout); layout->addLayout(layoutButtons); lenDialog.setLayout(layout); connect(&okButton, SIGNAL(clicked()), &lenDialog, SLOT(accept())); connect(&cancelButton, SIGNAL(clicked()), &lenDialog, SLOT(reject())); if (lenDialog.exec() == QDialog::Rejected) { QMessageBox mBox; mBox.setWindowTitle("ERROR"); mBox.setIcon(QMessageBox::Critical); mBox.setText( "No se puede continuar con la operación de modificación"); mBox.exec(); return; } lenghtString = "(" + lenValueText.text() + ")"; } QString isNullString = QString(); if (isNotNullableRadioButton.isChecked()) { isNullString = "NOT NULL"; } QSqlQuery query(*db); query.exec("ALTER TABLE " + tableName + " CHANGE COLUMN " + columnNameLineEdit.text() + " " + columnNameLineEdit.text() + " " + typeComboBox.currentText() + lenghtString + " " + isNullString + ";"); QString strQuery; if (engineName == "sqlite") { strQuery = QString("PRAGMA table_info(%1)").arg(tableName); } else if (engineName == "mysql") { strQuery = QString("SHOW COLUMNS FROM %1").arg(tableName); } queryModel->setQuery(strQuery); }