Ejemplo n.º 1
0
SpellCheckSelectorDialog::SpellCheckSelectorDialog(QWidget *parent, Qt::WindowFlags f) :
    QDialog(parent, f),
    ui(std::make_shared<Ui::SpellCheckSelectorDialog>())
{
    ui->setupUi(this);
    auto conf = Configuration::getInstance();
    auto sl = conf->getAllAvailableSpellCheckDictNames();
    int index = -1;
    QLocale locale;
    for(int i=0; i<sl.length(); i++){
        QString dictName = sl.at(i);
        if(dictName=="en_GB"){
            ui->languageComboBox->addItem("English - United Kingdom", dictName);
        } else if(dictName=="en_US"){
            ui->languageComboBox->addItem("English - United States", dictName);
        } else {
            ui->languageComboBox->addItem(dictName, dictName);
        }
        if(dictName==locale.name())
            index = i;
    }
    if(index==-1 && sl.length()>=1){
        ui->languageComboBox->setCurrentIndex(0);
    }

    connect(ui->buttonBox, SIGNAL(rejected()),
            this, SLOT(close()));
    connect(ui->buttonBox, SIGNAL(accepted()),
            this, SLOT(acceptSlot()));
}
Ejemplo n.º 2
0
WComment::WComment(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl)
{
  setupUi(this);

  // signals and slots connections
  connect(comment_p, SIGNAL(reject()), this, SLOT(rejectSlot()));
  connect(comment_p, SIGNAL(accept()), this, SLOT(acceptSlot()));
}
Ejemplo n.º 3
0
RenameFileDialog::RenameFileDialog(const QString &fileFullPath, QWidget *parent) :
    QDialog(parent, Qt::WindowTitleHint|Qt::WindowSystemMenuHint),
    ui(new Ui::RenameFileDialog)
{
    ui->setupUi(this);
    oldFilePath = fileFullPath;
    QString filename = QFileInfo(fileFullPath).fileName();
    ui->infoLabel->setText(tr("Rename file %1 to:").arg(filename));
    ui->renameLineEdit->setText(filename);
    connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close()));
    connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(acceptSlot()));
}