Ejemplo n.º 1
0
void SettingsDialog::readSettings() {
    QSettings settings;
    ui->serverUrlEdit->setText(settings.value("ownCloud/serverUrl").toString());
    ui->userNameEdit->setText(settings.value("ownCloud/userName").toString());
    ui->passwordEdit->setText(crypto->decryptToString(
            settings.value("ownCloud/password").toString()));
    ui->localOwnCloudPathEdit->setText(
            settings.value("ownCloud/localOwnCloudPath").toString());
    ui->notifyAllExternalModificationsCheckBox->setChecked(
            settings.value("notifyAllExternalModifications").toBool());
    ui->noteSaveIntervalTime->setValue(
            settings.value("noteSaveIntervalTime").toInt());
    ui->showRecentNoteFolderCheckBox->setChecked(settings.value(
            "MainWindow/showRecentNoteFolderInMainArea").toBool());
    ui->toolbarIconSizeSpinBox->setValue(
                 settings.value("MainWindow/mainToolBar.iconSize").toInt());
    ui->markdownDefaultViewModeCheckBox->setChecked(
            settings.value("MainWindow/markdownDefaultViewMode").toBool());

    selectListWidgetValue(ui->languageListWidget,
                          settings.value("interfaceLanguage").toString());
    selectListWidgetValue(ui->defaultNoteFileExtensionListWidget,
                          Note::defaultNoteFileExtension());

    const QSignalBlocker blocker(ui->appMetricsCheckBox);
    Q_UNUSED(blocker);
    ui->appMetricsCheckBox->setChecked(settings.value(
            "appMetrics/disableTracking").toBool());

    noteTextEditFont.fromString(
            settings.value("MainWindow/noteTextEdit.font").toString());
    setFontLabel(ui->noteTextEditFontLabel, noteTextEditFont);

    noteTextEditCodeFont.fromString(
            settings.value("MainWindow/noteTextEdit.code.font").toString());
    setFontLabel(ui->noteTextEditCodeFontLabel, noteTextEditCodeFont);

    noteTextViewFont.fromString(
            settings.value("MainWindow/noteTextView.font").toString());
    setFontLabel(ui->noteTextViewFontLabel, noteTextViewFont);

    const QSignalBlocker blocker2(this->ui->defaultOwnCloudCalendarRadioButton);
    Q_UNUSED(blocker2);

    switch (settings.value("ownCloud/todoCalendarBackend").toInt()) {
        case OwnCloudService::CalendarPlus:
            ui->calendarPlusRadioButton->setChecked(true);
            break;
        default:
            ui->defaultOwnCloudCalendarRadioButton->setChecked(true);
            break;
    }

    QStringList todoCalendarUrlList = settings.value(
            "ownCloud/todoCalendarUrlList").toStringList();
    // load the todo calendar list and set the checked state
    refreshTodoCalendarList(todoCalendarUrlList, true);
}
Ejemplo n.º 2
0
/**
 * Resets the font for the note text code edit
 */
void SettingsDialog::on_noteTextEditCodeResetButton_clicked()
{
    QTextEdit textEdit;
    noteTextEditCodeFont = textEdit.font();
    noteTextEditCodeFont.setFamily("Courier");
    setFontLabel(ui->noteTextEditCodeFontLabel, noteTextEditCodeFont);
}
Ejemplo n.º 3
0
void SettingsDialog::on_noteTextViewButton_clicked() {
    bool ok;
    QFont font = QFontDialog::getFont(&ok, noteTextViewFont, this);
    if (ok) {
        noteTextViewFont = font;
        setFontLabel(ui->noteTextViewFontLabel, noteTextViewFont);
    }
}
Ejemplo n.º 4
0
void SettingsDialog::on_noteTextEditCodeButton_clicked()
{
    bool ok;
    QFont font = QFontDialog::getFont(
            &ok, noteTextEditCodeFont, this,
            "", QFontDialog::MonospacedFonts);
    if (ok) {
        noteTextEditCodeFont = font;
        setFontLabel(ui->noteTextEditCodeFontLabel, noteTextEditCodeFont);
    }
}
Ejemplo n.º 5
0
/**
 * Resets the font for the note markdown view
 */
void SettingsDialog::on_noteTextViewResetButton_clicked()
{
    QTextBrowser textView;
    noteTextViewFont = textView.font();
    setFontLabel(ui->noteTextViewFontLabel, noteTextViewFont);
}
Ejemplo n.º 6
0
/**
 * Resets the font for the note text edit
 */
void SettingsDialog::on_noteTextEditResetButton_clicked()
{
    QTextEdit textEdit;
    noteTextEditFont = textEdit.font();
    setFontLabel(ui->noteTextEditFontLabel, noteTextEditFont);
}