Changeset View
Changeset View
Standalone View
Standalone View
src/Gui/SettingsDialog/GeneralOptionsPage.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 36 | { | |||
---|---|---|---|---|---|
51 | mainLayout->addRow(i18n("Press screenshot key to:"), takeNew); | 51 | mainLayout->addRow(i18n("Press screenshot key to:"), takeNew); | ||
52 | mainLayout->addRow(QString(), startNewInstance); | 52 | mainLayout->addRow(QString(), startNewInstance); | ||
53 | //On Wayland we can't programmatically raise and focus the window so we have to hide the option | 53 | //On Wayland we can't programmatically raise and focus the window so we have to hide the option | ||
54 | if (!(KWindowSystem::isPlatformWayland() || qstrcmp(qgetenv("XDG_SESSION_TYPE"), "wayland") == 0)) { | 54 | if (!(KWindowSystem::isPlatformWayland() || qstrcmp(qgetenv("XDG_SESSION_TYPE"), "wayland") == 0)) { | ||
55 | QRadioButton* focusWindow = new QRadioButton(i18n("Return focus to Spectacle"), this); | 55 | QRadioButton* focusWindow = new QRadioButton(i18n("Return focus to Spectacle"), this); | ||
56 | mPrintKeyActionGroup->addButton( focusWindow, SpectacleConfig::PrintKeyActionRunning::FocusWindow); | 56 | mPrintKeyActionGroup->addButton( focusWindow, SpectacleConfig::PrintKeyActionRunning::FocusWindow); | ||
57 | mainLayout->addRow(QString(), focusWindow); | 57 | mainLayout->addRow(QString(), focusWindow); | ||
58 | } | 58 | } | ||
59 | // copy file to clipboard after taking a screenshot | ||||
60 | mCopyFileToClipboard = new QCheckBox(i18n("Copy file to clipboard after taking a screenshot"), this); | ||||
61 | connect(mCopyFileToClipboard, &QCheckBox::toggled, this, &GeneralOptionsPage::markDirty); | ||||
62 | mainLayout->addRow(QString(), mCopyFileToClipboard); | ||||
59 | 63 | | |||
60 | // Rectangular Region settings | 64 | // Rectangular Region settings | ||
61 | KTitleWidget *titleWidget = new KTitleWidget(this); | 65 | KTitleWidget *titleWidget = new KTitleWidget(this); | ||
62 | titleWidget->setText(i18n("Rectangular Region")); | 66 | titleWidget->setText(i18n("Rectangular Region")); | ||
63 | titleWidget->setLevel(2); | 67 | titleWidget->setLevel(2); | ||
davidre: This one | |||||
64 | mainLayout->addRow(titleWidget); | 68 | mainLayout->addRow(titleWidget); | ||
65 | 69 | | |||
66 | // use light background | 70 | // use light background | ||
ngraham: I would write "Copy image to clipboard" | |||||
67 | mUseLightBackground = new QCheckBox(i18n("Use light background"), this); | 71 | mUseLightBackground = new QCheckBox(i18n("Use light background"), this); | ||
68 | connect(mUseLightBackground, &QCheckBox::toggled, this, &GeneralOptionsPage::markDirty); | 72 | connect(mUseLightBackground, &QCheckBox::toggled, this, &GeneralOptionsPage::markDirty); | ||
69 | mainLayout->addRow(i18n("General:"), mUseLightBackground); | 73 | mainLayout->addRow(i18n("General:"), mUseLightBackground); | ||
davidre: Remove comment | |||||
70 | 74 | | |||
71 | // show magnifier | 75 | // show magnifier | ||
72 | mShowMagnifier = new QCheckBox(i18n("Show magnifier"), this); | 76 | mShowMagnifier = new QCheckBox(i18n("Show magnifier"), this); | ||
73 | connect(mShowMagnifier, &QCheckBox::toggled, this, &GeneralOptionsPage::markDirty); | 77 | connect(mShowMagnifier, &QCheckBox::toggled, this, &GeneralOptionsPage::markDirty); | ||
ngraham: I would simplify this as "After taking screenshot:" | |||||
74 | mainLayout->addRow(QString(), mShowMagnifier); | 78 | mainLayout->addRow(QString(), mShowMagnifier); | ||
75 | 79 | | |||
76 | // release mouse-button to capture | 80 | // release mouse-button to capture | ||
77 | mReleaseToCapture = new QCheckBox(i18n("Accept on click-and-release"), this); | 81 | mReleaseToCapture = new QCheckBox(i18n("Accept on click-and-release"), this); | ||
78 | connect(mReleaseToCapture, &QCheckBox::toggled, this, &GeneralOptionsPage::markDirty); | 82 | connect(mReleaseToCapture, &QCheckBox::toggled, this, &GeneralOptionsPage::markDirty); | ||
79 | mainLayout->addRow(QString(), mReleaseToCapture); | 83 | mainLayout->addRow(QString(), mReleaseToCapture); | ||
80 | 84 | | |||
81 | mainLayout->addItem(new QSpacerItem(0, 18, QSizePolicy::Fixed, QSizePolicy::Fixed)); | 85 | mainLayout->addItem(new QSpacerItem(0, 18, QSizePolicy::Fixed, QSizePolicy::Fixed)); | ||
Show All 27 Lines | 112 | { | |||
109 | SpectacleConfig *cfgManager = SpectacleConfig::instance(); | 113 | SpectacleConfig *cfgManager = SpectacleConfig::instance(); | ||
110 | 114 | | |||
111 | cfgManager->setUseLightRegionMaskColour(mUseLightBackground->checkState() == Qt::Checked); | 115 | cfgManager->setUseLightRegionMaskColour(mUseLightBackground->checkState() == Qt::Checked); | ||
112 | cfgManager->setRememberLastRectangularRegion(mRememberUntilClosed->isChecked() || mRememberAlways->isChecked()); | 116 | cfgManager->setRememberLastRectangularRegion(mRememberUntilClosed->isChecked() || mRememberAlways->isChecked()); | ||
113 | cfgManager->setAlwaysRememberRegion (mRememberAlways->isChecked()); | 117 | cfgManager->setAlwaysRememberRegion (mRememberAlways->isChecked()); | ||
114 | cfgManager->setShowMagnifierChecked(mShowMagnifier->checkState() == Qt::Checked); | 118 | cfgManager->setShowMagnifierChecked(mShowMagnifier->checkState() == Qt::Checked); | ||
115 | cfgManager->setUseReleaseToCaptureChecked(mReleaseToCapture->checkState() == Qt::Checked); | 119 | cfgManager->setUseReleaseToCaptureChecked(mReleaseToCapture->checkState() == Qt::Checked); | ||
116 | cfgManager->setPrintKeyActionRunning(static_cast<SpectacleConfig::PrintKeyActionRunning>(mPrintKeyActionGroup->checkedId())); | 120 | cfgManager->setPrintKeyActionRunning(static_cast<SpectacleConfig::PrintKeyActionRunning>(mPrintKeyActionGroup->checkedId())); | ||
121 | cfgManager->setCopyFileToClipboard(mCopyFileToClipboard->checkState() == Qt::Checked); | ||||
117 | 122 | | |||
118 | mChangesMade = false; | 123 | mChangesMade = false; | ||
119 | } | 124 | } | ||
120 | 125 | | |||
121 | void GeneralOptionsPage::resetChanges() | 126 | void GeneralOptionsPage::resetChanges() | ||
122 | { | 127 | { | ||
123 | SpectacleConfig *cfgManager = SpectacleConfig::instance(); | 128 | SpectacleConfig *cfgManager = SpectacleConfig::instance(); | ||
124 | 129 | | |||
125 | mUseLightBackground->setChecked(cfgManager->useLightRegionMaskColour()); | 130 | mUseLightBackground->setChecked(cfgManager->useLightRegionMaskColour()); | ||
126 | mRememberUntilClosed->setChecked(cfgManager->rememberLastRectangularRegion()); | 131 | mRememberUntilClosed->setChecked(cfgManager->rememberLastRectangularRegion()); | ||
127 | mRememberAlways->setChecked(cfgManager->alwaysRememberRegion()); | 132 | mRememberAlways->setChecked(cfgManager->alwaysRememberRegion()); | ||
128 | mShowMagnifier->setChecked(cfgManager->showMagnifierChecked()); | 133 | mShowMagnifier->setChecked(cfgManager->showMagnifierChecked()); | ||
129 | mReleaseToCapture->setChecked(cfgManager->useReleaseToCapture()); | 134 | mReleaseToCapture->setChecked(cfgManager->useReleaseToCapture()); | ||
130 | mPrintKeyActionGroup->button(cfgManager->printKeyActionRunning())->setChecked(true); | 135 | mPrintKeyActionGroup->button(cfgManager->printKeyActionRunning())->setChecked(true); | ||
136 | mCopyFileToClipboard->setChecked(cfgManager->copyFileToClipboard()); | ||||
131 | 137 | | |||
132 | mChangesMade = false; | 138 | mChangesMade = false; | ||
133 | } | 139 | } |
This one