QString KSaneDeviceDialog::getSelectedName() { QAbstractButton *selectedButton = m_btnGroup->checkedButton(); if(selectedButton) { return selectedButton->objectName(); } return QString(); }
void PreferenceDialog::accept() { QSettings settings; QAbstractButton *selected; //>>>>> 起動と終了 // 起動時のサイズ if (!ui->bootSize->isChecked()) { settings.setValue(IniKey_BootSizeSpec, ""); } else { selected = ui->sizeOptions->checkedButton(); settings.setValue(IniKey_BootSizeSpec, selected->objectName()); QSize size; // 絶対指定 size = QSize(ui->absoluteWidth->value(), ui->absoluteHeight->value()); settings.setValue(IniKey_BootSizeAbs, size); // 相対指定 size = QSize(ui->relativeWidth->value(), ui->relativeHeight->value()); settings.setValue(IniKey_BootSizeRel, size); } // 起動時の位置 if (!ui->bootPos->isChecked()) { settings.setValue(IniKey_BootPosSpec, ""); } else { selected = ui->posOptions->checkedButton(); settings.setValue(IniKey_BootPosSpec, selected->objectName()); // 絶対指定 QPoint pos; pos = QPoint(ui->absoluteLeft->value(), ui->absoluteTop->value()); settings.setValue(IniKey_BootPosAbs, pos); // 相対指定 pos = QPoint(ui->relativeLeft->value(), ui->relativeTop->value()); settings.setValue(IniKey_BootPosRel, pos); } // 起動時の設定削除 settings.setValue(IniKey_ResetOnBoot, ui->resetOnBoot->isChecked()); // 終了時の確認ダイアログ settings.setValue(IniKey_ConfirmExit, ui->confirmExit->isChecked()); // アップデートのチェック settings.setValue(IniKey_CheckUpdates, ui->checkUpdates->isChecked()); //>>>>> 色とフォント saveAppearance(settings); settings.setValue(IniKey_Darkness, ui->dark->value()); //>>>>> ファイル操作 settings.setValue(IniKey_ConfirmCopy, ui->confirmCopy->isChecked()); settings.setValue(IniKey_ConfirmDelete, ui->confirmDelete->isChecked()); settings.setValue(IniKey_ConfirmMove, ui->confirmMove->isChecked()); settings.setValue(IniKey_ConfirmRename, ui->confirmRename->isChecked()); settings.setValue(IniKey_AutoCloseCopy, ui->autoCloseCopy->isChecked()); settings.setValue(IniKey_AutoCloseDelete, ui->autoCloseDelete->isChecked()); settings.setValue(IniKey_AutoCloseMove, ui->autoCloseMove->isChecked()); settings.setValue(IniKey_AutoCloseRename, ui->autoCloseRename->isChecked()); selected = ui->overwriteOptions->checkedButton(); settings.setValue(IniKey_DefaultOnCopy, selected->objectName()); settings.setValue(IniKey_MoveAfterCreateFolder, ui->moveAfterCreate->isChecked()); settings.setValue(IniKey_OpenAfterCreateFile, ui->openAfterCreate->isChecked()); //>>>>> パス設定 settings.setValue(IniKey_PathEditor, ui->editorPath->text().trimmed()); settings.setValue(IniKey_PathTerminal, ui->terminalPath->text().trimmed()); settings.setValue(IniKey_PathArchiver, ui->archiverPath->text().trimmed()); //>>>>> テキストビューア settings.setValue(IniKey_ViewerFont, ui->viewerSample->font()); settings.setValue(IniKey_ViewerColorBg, ui->viewerSample->palette().base().color()); settings.setValue(IniKey_ViewerColorFg, ui->viewerSample->palette().text().color()); settings.setValue(IniKey_ViewerInherit, ui->viewerInherit->isChecked()); settings.setValue(IniKey_ViewerForceOpen, !ui->enableViewerIgnoreExt->isChecked()); QStringList list = ui->viewerIgnoreExt->toPlainText().split(",", QString::SkipEmptyParts); QStringList::iterator it; for (it = list.begin(); it != list.end(); it++) { *it = it->trimmed(); } settings.setValue(IniKey_ViewerIgnoreExt, list.join(",")); QDialog::accept(); }
QString SelectModule::getModule() const { QAbstractButton* button = group->checkedButton(); return (button ? button->objectName() : QString()); }