| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | #include <Gui/Action.h> |
| | #include <Gui/Application.h> |
| | #include <Gui/MainWindow.h> |
| |
|
| | #include "DlgSettingsMacroImp.h" |
| | #include "ui_DlgSettingsMacro.h" |
| |
|
| | using namespace Gui::Dialog; |
| |
|
| | |
| |
|
| | |
| | |
| | |
| | |
| | DlgSettingsMacroImp::DlgSettingsMacroImp(QWidget* parent) |
| | : PreferencePage(parent) |
| | , ui(new Ui_DlgSettingsMacro) |
| | { |
| | ui->setupUi(this); |
| |
|
| | |
| | ui->FileLogCheckBox->hide(); |
| | ui->MacroPath_2->hide(); |
| |
|
| | if (ui->MacroPath->fileName().isEmpty()) { |
| | QDir d(QString::fromUtf8(App::GetApplication().getUserMacroDir().c_str())); |
| | ui->MacroPath->setFileName(d.path()); |
| | } |
| | } |
| |
|
| | |
| | |
| | |
| | DlgSettingsMacroImp::~DlgSettingsMacroImp() = default; |
| |
|
| | |
| | |
| | |
| | |
| | void DlgSettingsMacroImp::setRecentMacroSize() |
| | { |
| | auto recent = getMainWindow()->findChild<RecentMacrosAction*>(QLatin1String("recentMacros")); |
| | if (recent) { |
| | ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("RecentMacros"); |
| | recent->resizeList(hGrp->GetInt("RecentMacros", 4)); |
| | } |
| | } |
| |
|
| | void DlgSettingsMacroImp::saveSettings() |
| | { |
| | ui->PrefCheckBox_LocalEnv->onSave(); |
| | ui->MacroPath->onSave(); |
| | ui->PrefCheckBox_RecordGui->onSave(); |
| | ui->PrefCheckBox_GuiAsComment->onSave(); |
| | ui->PConsoleCheckBox->onSave(); |
| | ui->FileLogCheckBox->onSave(); |
| | ui->MacroPath_2->onSave(); |
| | ui->RecentMacros->onSave(); |
| | ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("RecentMacros"); |
| | hGrp->SetASCII("ShortcutModifiers", qPrintable(ui->ShortcutModifiers->text())); |
| | ui->ShortcutCount->onSave(); |
| | setRecentMacroSize(); |
| | } |
| |
|
| | void DlgSettingsMacroImp::loadSettings() |
| | { |
| | ui->PrefCheckBox_LocalEnv->onRestore(); |
| | ui->MacroPath->onRestore(); |
| | ui->PrefCheckBox_RecordGui->onRestore(); |
| | ui->PrefCheckBox_GuiAsComment->onRestore(); |
| | ui->PConsoleCheckBox->onRestore(); |
| | ui->FileLogCheckBox->onRestore(); |
| | ui->MacroPath_2->onRestore(); |
| | ui->RecentMacros->onRestore(); |
| | ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("RecentMacros"); |
| | ui->ShortcutModifiers->setText( |
| | QString::fromStdString(hGrp->GetASCII("ShortcutModifiers", "Ctrl+Shift+")) |
| | ); |
| | ui->ShortcutCount->onRestore(); |
| | } |
| |
|
| | void DlgSettingsMacroImp::resetSettingsToDefaults() |
| | { |
| | ParameterGrp::handle hGrp; |
| | hGrp = WindowParameter::getDefaultParameter()->GetGroup("RecentMacros"); |
| | |
| | hGrp->RemoveASCII("ShortcutModifiers"); |
| |
|
| | |
| | PreferencePage::resetSettingsToDefaults(); |
| | } |
| |
|
| | |
| | |
| | |
| | void DlgSettingsMacroImp::changeEvent(QEvent* e) |
| | { |
| | if (e->type() == QEvent::LanguageChange) { |
| | ui->retranslateUi(this); |
| | } |
| | else { |
| | QWidget::changeEvent(e); |
| | } |
| | } |
| |
|
| | #include "moc_DlgSettingsMacroImp.cpp" |
| |
|