Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F34625120
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
9 KB
Subscribers
None
View Options
diff --git a/src/conf/generalconfigurationpage.cpp b/src/conf/generalconfigurationpage.cpp
index 9eccafc..9bbd357 100644
--- a/src/conf/generalconfigurationpage.cpp
+++ b/src/conf/generalconfigurationpage.cpp
@@ -1,95 +1,97 @@
// SPDX-FileCopyrightText: 2024 g10 Code GmbH
// SPDX-FileContributor: Carl Schwan <carl@carlschwan.eu>
// SPDX-License-Identifier: GPL-2.0-or-later
#include "generalconfigurationpage.h"
#include "config.h"
#include "ui_generalconfigurationpage.h"
using namespace GpgPass::Config;
GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent)
: GpgPassConfigModule(parent)
, ui(new Ui::GeneralConfigurationPage)
{
ui->setupUi(this);
+ ui->mainLayout->insertStretch(0);
+ ui->mainLayout->insertStretch(2);
connect(ui->checkBoxAutoclearPanel, &QAbstractButton::toggled, this, &GeneralConfigurationPage::setAutoClearPanelSubentries);
connect(ui->checkBoxAutoclear, &QAbstractButton::toggled, this, &GeneralConfigurationPage::setAutoClearSubentries);
// Changed
connect(ui->checkBoxAutoclear, &QAbstractButton::toggled, this, &GeneralConfigurationPage::changed);
connect(ui->checkBoxAutoclearPanel, &QAbstractButton::toggled, this, &GeneralConfigurationPage::changed);
connect(ui->checkBoxDisplayAsIs, &QAbstractButton::toggled, this, &GeneralConfigurationPage::changed);
connect(ui->checkBoxNoLineWrapping, &QAbstractButton::toggled, this, &GeneralConfigurationPage::changed);
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
connect(ui->spinBoxAutoclearPanelSeconds, &QSpinBox::valueChanged, this, &GeneralConfigurationPage::changed);
connect(ui->spinBoxAutoclearPanelSeconds, &QSpinBox::valueChanged, this, &GeneralConfigurationPage::changed);
#else
connect(ui->spinBoxAutoclearPanelSeconds, QOverload<int>::of(&QSpinBox::valueChanged), this, &GeneralConfigurationPage::changed);
connect(ui->spinBoxAutoclearPanelSeconds, QOverload<int>::of(&QSpinBox::valueChanged), this, &GeneralConfigurationPage::changed);
#endif
}
void GeneralConfigurationPage::save()
{
auto config = ::Config::self();
config->setClipboardAutoClearEnabled(ui->checkBoxAutoclear->isChecked());
config->setClipboardAutoClearTime(ui->spinBoxAutoclearSeconds->value());
config->setViewerAutoClearEnabled(ui->checkBoxAutoclearPanel->isChecked());
config->setViewerAutoClearTime(ui->spinBoxAutoclearPanelSeconds->value());
config->setDisplayAsIs(ui->checkBoxDisplayAsIs->isChecked());
config->setNoLineWrapping(ui->checkBoxNoLineWrapping->isChecked());
config->save();
}
void GeneralConfigurationPage::load()
{
const auto config = ::Config::self();
ui->spinBoxAutoclearSeconds->setValue(config->clipboardAutoClearTime());
setAutoclear(config->clipboardAutoClearEnabled());
ui->spinBoxAutoclearPanelSeconds->setValue(config->viewerAutoClearTime());
setAutoclearPanel(config->viewerAutoClearEnabled());
ui->checkBoxDisplayAsIs->setChecked(config->displayAsIs());
ui->checkBoxNoLineWrapping->setChecked(config->noLineWrapping());
}
void GeneralConfigurationPage::defaults()
{
auto config = ::Config::self();
ui->spinBoxAutoclearSeconds->setValue(config->defaultClipboardAutoClearTimeValue());
setAutoclear(config->defaultClipboardAutoClearEnabledValue());
ui->spinBoxAutoclearPanelSeconds->setValue(config->defaultViewerAutoClearTimeValue());
setAutoclearPanel(config->defaultViewerAutoClearEnabledValue());
ui->checkBoxDisplayAsIs->setChecked(config->defaultDisplayAsIsValue());
ui->checkBoxNoLineWrapping->setChecked(config->defaultNoLineWrappingValue());
Q_EMIT changed();
}
void GeneralConfigurationPage::setAutoClearSubentries(bool autoclear)
{
ui->spinBoxAutoclearSeconds->setEnabled(autoclear);
}
void GeneralConfigurationPage::setAutoclear(bool autoclear)
{
ui->checkBoxAutoclear->setChecked(autoclear);
setAutoClearSubentries(autoclear);
}
void GeneralConfigurationPage::setAutoclearPanel(bool autoclear)
{
ui->checkBoxAutoclearPanel->setChecked(autoclear);
setAutoClearPanelSubentries(autoclear);
}
void GeneralConfigurationPage::setAutoClearPanelSubentries(bool autoclear)
{
ui->spinBoxAutoclearPanelSeconds->setEnabled(autoclear);
ui->labelPanelSeconds->setEnabled(autoclear);
}
diff --git a/src/conf/generalconfigurationpage.ui b/src/conf/generalconfigurationpage.ui
index 87a84e8..5eb7e5b 100644
--- a/src/conf/generalconfigurationpage.ui
+++ b/src/conf/generalconfigurationpage.ui
@@ -1,175 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<!--
SPDX-FileCopyrightText: 2024 g10 Code GmbH
SPDX-Contributor: Carl Schwan <carl.schwan@gnupg.com>
SPDX-License-Identifier: GPL-2.0-or-later
-->
<class>GeneralConfigurationPage</class>
<widget class="QWidget" name="GeneralConfigurationPage">
<attribute name="title">
<string>General</string>
</attribute>
- <layout class="QVBoxLayout" name="verticalLayout_5">
+ <layout class="QHBoxLayout" name="mainLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item>
- <layout class="QVBoxLayout" name="Layout_Clipboard">
- <item>
- <widget class="QLabel" name="label_8">
- <property name="font">
- <font>
- <bold>true</bold>
- </font>
- </property>
+ <layout class="QFormLayout">
+ <item row="0" column="0">
+ <widget class="QLabel">
<property name="text">
<string>Clipboard behaviour:</string>
</property>
</widget>
</item>
- <item>
+ <item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="checkBoxAutoclear">
<property name="text">
<string>Autoclear after:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxAutoclearSeconds">
<property name="minimum">
<number>5</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelSeconds">
<property name="text">
<string>Seconds</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
- </layout>
- </item>
- <item>
- <layout class="QVBoxLayout" name="Layout_PasswordBehaviour">
- <item>
+ <item row="1" column="0">
<widget class="QLabel" name="label_6">
- <property name="font">
- <font>
- <bold>true</bold>
- </font>
- </property>
<property name="text">
<string>Content panel behaviour:</string>
</property>
</widget>
</item>
- <item>
+ <item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QCheckBox" name="checkBoxAutoclearPanel">
<property name="text">
<string>Autoclear panel after:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxAutoclearPanelSeconds">
<property name="minimum">
<number>5</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelPanelSeconds">
<property name="minimumSize">
<size>
<width>55</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Seconds</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
- <item>
+ <item row="2" column="1">
<widget class="QCheckBox" name="checkBoxDisplayAsIs">
<property name="text">
<string>Display the files content as-is</string>
</property>
</widget>
</item>
- <item>
+ <item row="3" column="1">
<widget class="QCheckBox" name="checkBoxNoLineWrapping">
<property name="text">
<string>No line wrapping</string>
</property>
</widget>
</item>
</layout>
</item>
- <item>
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
</ui>
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Jan 20, 6:52 AM (1 d, 13 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
72/94/961ac4caa31437db1a1c7d3558ac
Attached To
rGPGPASS GnuPG Password Manager
Event Timeline
Log In to Comment