ConfigurationDialog::ConfigurationDialog(QWidget *parent) : QDialog(parent), ui(new Ui::ConfigurationDialog), m_settings(0) { ui->setupUi(this); // Filter out characters which are not allowed in a file name QRegExpValidator *fileNameValidator = new QRegExpValidator(ui->name); fileNameValidator->setRegExp(QRegExp(QLatin1String("^[^\\/\\\\\\?\\>\\<\\*\\%\\:\\\"\\']*$"))); ui->name->setValidator(fileNameValidator); updateDocumentation(); connect(ui->name, SIGNAL(textChanged(QString)), this, SLOT(updateOkButton())); updateOkButton(); // force initial test. connect(ui->editor, SIGNAL(documentationChanged(QString,QString)), this, SLOT(updateDocumentation(QString,QString))); // Set palette and font according to settings const TextEditor::FontSettings fs = TextEditor::TextEditorSettings::instance()->fontSettings(); const QTextCharFormat tf = fs.toTextCharFormat(TextEditor::C_TEXT); const QTextCharFormat selectionFormat = fs.toTextCharFormat(TextEditor::C_SELECTION); QPalette pal; pal.setColor(QPalette::Base, tf.background().color()); pal.setColor(QPalette::Text, tf.foreground().color()); pal.setColor(QPalette::Foreground, tf.foreground().color()); if (selectionFormat.background().style() != Qt::NoBrush) pal.setColor(QPalette::Highlight, selectionFormat.background().color()); pal.setBrush(QPalette::HighlightedText, selectionFormat.foreground()); ui->documentation->setPalette(pal); ui->editor->setPalette(pal); ui->documentation->setFont(tf.font()); ui->editor->setFont(tf.font()); // Set style sheet for documentation browser const QTextCharFormat tfOption = fs.toTextCharFormat(TextEditor::C_FIELD); const QTextCharFormat tfParam = fs.toTextCharFormat(TextEditor::C_STRING); const QString css = QString::fromLatin1("span.param {color: %1; background-color: %2;} " "span.option {color: %3; background-color: %4;} " "p { text-align: justify; } ") .arg(tfParam.foreground().color().name()) .arg(tfParam.background().style() == Qt::NoBrush ? QString() : tfParam.background().color().name()) .arg(tfOption.foreground().color().name()) .arg(tfOption.background().style() == Qt::NoBrush ? QString() : tfOption.background().color().name()) ; ui->documentation->document()->setDefaultStyleSheet(css); }
PasswordDialog::PasswordDialog( QWidget *parent ) : QDialog( parent ), ui( new Ui::PasswordDialog ) { ui->setupUi( this ); const LocalSystem::User loggedOnUser = LocalSystem::User::loggedOnUser(); QString username = loggedOnUser.name(); #ifdef VEYON_BUILD_WIN32 if( !username.isEmpty() && !loggedOnUser.domain().isEmpty() ) { username = loggedOnUser.domain() + "\\" + username; } #endif ui->username->setText( username ); if( !username.isEmpty() ) { ui->password->setFocus(); } updateOkButton(); VeyonCore::enforceBranding( this ); }
void ConfigurationDialog::clear() { ui->name->clear(); ui->editor->clear(); m_currentKey.clear(); updateOkButton(); }
FilterNameDialog::FilterNameDialog(QWidget *parent) : QDialog(parent) { m_ui.setupUi(this); connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(accept())); connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject())); connect(m_ui.lineEdit, SIGNAL(textChanged(QString)), this, SLOT(updateOkButton())); m_ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(true); }
TrioDialog::TrioDialog(QWidget* parent) : QDialog(parent) , ui_() , db_() { ui_.setupUi(this); \ ui_.status_page_link->setText("<a href=\"" + Settings::string("SampleStatus") + "\"><span style=\"text-decoration: underline; color:#0000ff;\">[open status page]</span></a>"); connect(ui_.f_ps, SIGNAL(textChanged(QString)), this, SLOT(father_changed(QString))); connect(ui_.m_ps, SIGNAL(textChanged(QString)), this, SLOT(mother_changed(QString))); connect(ui_.c_ps, SIGNAL(textChanged(QString)), this, SLOT(child_changed(QString))); updateOkButton(); }
DetermineFontSizeDialog::DetermineFontSizeDialog(QWidget* parent, TextSymbol* symbol) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint), symbol(symbol) { setWindowTitle(tr("Determine font size")); QFormLayout *form_layout = new QFormLayout(); QLabel* explanation_label = new QLabel(tr("This dialog allows to choose a font size which results in a given exact height for a specific letter.")); explanation_label->setWordWrap(true); form_layout->addRow(explanation_label); character_edit = new QLineEdit(tr("A")); character_edit->setMaxLength(1); form_layout->addRow(tr("Letter:"), character_edit); size_edit = Util::SpinBox::create(1, 0.0, 999999.9, tr("mm")); size_edit->setValue(symbol->getFontSize()); form_layout->addRow(tr("Height:"), size_edit); QDialogButtonBox* button_box = new QDialogButtonBox(QDialogButtonBox::Cancel | QDialogButtonBox::Ok); ok_button = button_box->button(QDialogButtonBox::Ok); updateOkButton(); QVBoxLayout* layout = new QVBoxLayout(); layout->addLayout(form_layout, 1); layout->addItem(Util::SpacerItem::create(this)); layout->addWidget(button_box, 0); setLayout(layout); connect(character_edit, SIGNAL(textEdited(QString)), this, SLOT(updateOkButton())); connect(size_edit, SIGNAL(valueChanged(double)), this, SLOT(updateOkButton())); connect(button_box, SIGNAL(rejected()), this, SLOT(reject())); connect(button_box, SIGNAL(accepted()), this, SLOT(accept())); }
void TrioDialog::child_changed(QString value) { ui_.c_sys->setText(name2sys(value)); updateOkButton(); }
void TrioDialog::mother_changed(QString value) { ui_.m_sys->setText(name2sys(value)); updateOkButton(); }