Rework general settings page

This commit is contained in:
Janek Bevendorff 2017-02-22 15:30:27 +01:00
parent 0892d1c744
commit 7abebabf4f
No known key found for this signature in database
GPG key ID: CFEC2F6850BFFA53
3 changed files with 343 additions and 233 deletions

View file

@ -287,7 +287,7 @@ void DatabaseWidget::createEntry()
void DatabaseWidget::setIconFromParent() void DatabaseWidget::setIconFromParent()
{ {
if (!config()->get("UseGroupIconOnEntryCreation").toBool()) { if (!config()->get("UseGroupIconOnEntryCreation", true).toBool()) {
return; return;
} }

View file

@ -61,13 +61,13 @@ SettingsWidget::SettingsWidget(QWidget* parent)
addPage(tr("General"), FilePath::instance()->icon("categories", "preferences-other"), m_generalWidget); addPage(tr("General"), FilePath::instance()->icon("categories", "preferences-other"), m_generalWidget);
addPage(tr("Security"), FilePath::instance()->icon("status", "security-high"), m_secWidget); addPage(tr("Security"), FilePath::instance()->icon("status", "security-high"), m_secWidget);
m_generalUi->autoTypeShortcutWidget->setVisible(autoType()->isAvailable()); if (!autoType()->isAvailable()) {
m_generalUi->autoTypeShortcutLabel->setVisible(autoType()->isAvailable()); m_generalUi->generalSettingsTabWidget->removeTab(1);
}
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
// systray not useful on OS X // systray not useful on OS X
m_generalUi->systrayShowCheckBox->setVisible(false); m_generalUi->systraySettings->setVisible(false);
m_generalUi->systrayMinimizeOnCloseCheckBox->setVisible(false);
m_generalUi->systrayMinimizeToTrayCheckBox->setVisible(false);
#endif #endif
connect(this, SIGNAL(accepted()), SLOT(saveSettings())); connect(this, SIGNAL(accepted()), SLOT(saveSettings()));
@ -106,7 +106,7 @@ void SettingsWidget::loadSettings()
m_generalUi->autoSaveOnExitCheckBox->setChecked(config()->get("AutoSaveOnExit").toBool()); m_generalUi->autoSaveOnExitCheckBox->setChecked(config()->get("AutoSaveOnExit").toBool());
m_generalUi->autoReloadOnChangeCheckBox->setChecked(config()->get("AutoReloadOnChange").toBool()); m_generalUi->autoReloadOnChangeCheckBox->setChecked(config()->get("AutoReloadOnChange").toBool());
m_generalUi->minimizeOnCopyCheckBox->setChecked(config()->get("MinimizeOnCopy").toBool()); m_generalUi->minimizeOnCopyCheckBox->setChecked(config()->get("MinimizeOnCopy").toBool());
m_generalUi->useGroupIconOnEntryCreationCheckBox->setChecked(config()->get("UseGroupIconOnEntryCreation").toBool()); m_generalUi->useGroupIconOnEntryCreationCheckBox->setChecked(config()->get("UseGroupIconOnEntryCreation", true).toBool());
m_generalUi->autoTypeEntryTitleMatchCheckBox->setChecked(config()->get("AutoTypeEntryTitleMatch").toBool()); m_generalUi->autoTypeEntryTitleMatchCheckBox->setChecked(config()->get("AutoTypeEntryTitleMatch").toBool());
m_generalUi->languageComboBox->clear(); m_generalUi->languageComboBox->clear();

View file

@ -7,14 +7,33 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>684</width> <width>684</width>
<height>452</height> <height>732</height>
</rect> </rect>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="fieldGrowthPolicy"> <property name="leftMargin">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum> <number>0</number>
</property> </property>
<item row="0" column="0"> <property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QTabWidget" name="generalSettingsTabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tabGeneral">
<attribute name="title">
<string>Basic Settings</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="rememberLastDatabasesCheckBox"> <widget class="QCheckBox" name="rememberLastDatabasesCheckBox">
<property name="text"> <property name="text">
<string>Remember last databases</string> <string>Remember last databases</string>
@ -24,149 +43,111 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item>
<widget class="QCheckBox" name="rememberLastKeyFilesCheckBox"> <widget class="QCheckBox" name="rememberLastKeyFilesCheckBox">
<property name="text"> <property name="text">
<string>Remember last key files</string> <string>Remember last key files and security dongles</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item>
<widget class="QCheckBox" name="openPreviousDatabasesOnStartupCheckBox"> <widget class="QCheckBox" name="openPreviousDatabasesOnStartupCheckBox">
<property name="text"> <property name="text">
<string>Load previous databases on startup</string> <string>Load previous databases on startup</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item>
<widget class="QCheckBox" name="autoSaveOnExitCheckBox"> <widget class="QCheckBox" name="autoSaveOnExitCheckBox">
<property name="text"> <property name="text">
<string>Automatically save on exit</string> <string>Automatically save on exit</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item>
<widget class="QCheckBox" name="autoSaveAfterEveryChangeCheckBox"> <widget class="QCheckBox" name="autoSaveAfterEveryChangeCheckBox">
<property name="text"> <property name="text">
<string>Automatically save after every change</string> <string>Automatically save after every change</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item>
<widget class="QCheckBox" name="autoReloadOnChangeCheckBox"> <widget class="QCheckBox" name="autoReloadOnChangeCheckBox">
<property name="text"> <property name="text">
<string>Automatically reload the database when modified externally</string> <string>Automatically reload the database when modified externally</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item>
<widget class="QCheckBox" name="minimizeOnCopyCheckBox"> <widget class="QCheckBox" name="minimizeOnCopyCheckBox">
<property name="text"> <property name="text">
<string>Minimize when copying to clipboard</string> <string>Minimize when copying to clipboard</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0"> <item>
<widget class="QCheckBox" name="systrayMinimizeOnStartup"> <widget class="QCheckBox" name="systrayMinimizeOnStartup">
<property name="text"> <property name="text">
<string>Minimize window at application startup</string> <string>Minimize window at application startup</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0"> <item>
<widget class="QCheckBox" name="useGroupIconOnEntryCreationCheckBox"> <widget class="QCheckBox" name="useGroupIconOnEntryCreationCheckBox">
<property name="text"> <property name="text">
<string>Use group icon on entry creation</string> <string>Use group icon on entry creation</string>
</property> </property>
</widget> <property name="checked">
</item> <bool>true</bool>
<item row="9" column="0">
<layout class="QHBoxLayout" name="autoTypeShortcutLabelLayout">
<item>
<widget class="QLabel" name="autoTypeShortcutLabel">
<property name="text">
<string>Global Auto-Type shortcut</string>
</property>
<property name="alignment">
<set>Qt::AlignLeft</set>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum"/>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="autoTypeShortcutLabelSpacer"> <widget class="QWidget" name="systraySettings" native="true">
<layout class="QVBoxLayout" name="systrayLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>400</width> <width>20</width>
<height>30</height>
</size> </size>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum"/>
</property>
</spacer> </spacer>
</item> </item>
</layout>
</item>
<item row="9" column="1">
<widget class="ShortcutWidget" name="autoTypeShortcutWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding"/>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QCheckBox" name="autoTypeEntryTitleMatchCheckBox">
<property name="text">
<string>Use entry title to match windows for global auto-type</string>
</property>
</widget>
</item>
<item row="11" column="0">
<layout class="QHBoxLayout" name="languageLabelLayout">
<item> <item>
<widget class="QLabel" name="languageLabel">
<property name="text">
<string>Language</string>
</property>
</widget>
</item>
<item>
<spacer name="languageLabelSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>400</width>
</size>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum"/>
</property>
</spacer>
</item>
</layout>
</item>
<item row="11" column="1">
<widget class="QComboBox" name="languageComboBox"/>
</item>
<item row="12" column="0">
<widget class="QCheckBox" name="systrayShowCheckBox"> <widget class="QCheckBox" name="systrayShowCheckBox">
<property name="text"> <property name="text">
<string>Show a system tray icon</string> <string>Show a system tray icon</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="13" column="0"> <item>
<layout class="QHBoxLayout" name="systray1Layout"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum> <enum>QLayout::SetMaximumSize</enum>
</property> </property>
@ -175,6 +156,9 @@
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>40</width>
@ -189,7 +173,7 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -201,8 +185,11 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="14" column="0"> <item>
<layout class="QHBoxLayout" name="systray2Layout"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum> <enum>QLayout::SetMaximumSize</enum>
</property> </property>
@ -211,6 +198,9 @@
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>40</width>
@ -233,6 +223,135 @@
</item> </item>
</layout> </layout>
</widget> </widget>
</item>
<item>
<spacer name="trayIconSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>30</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="languageLabelLayout_2">
<property name="spacing">
<number>15</number>
</property>
<item alignment="Qt::AlignRight">
<widget class="QLabel" name="languageLabel_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Language</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="languageComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabAutotype">
<attribute name="title">
<string>Auto-Type</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="autoTypeEntryTitleMatchCheckBox">
<property name="text">
<string>Use entry title to match windows for global Auto-Type</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>15</number>
</property>
<item alignment="Qt::AlignRight">
<widget class="QLabel" name="autoTypeShortcutLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Global Auto-Type shortcut</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading</set>
</property>
</widget>
</item>
<item>
<widget class="ShortcutWidget" name="autoTypeShortcutWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_3">
<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>
</widget>
</item>
</layout>
</widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>ShortcutWidget</class> <class>ShortcutWidget</class>
@ -240,15 +359,6 @@
<header>autotype/ShortcutWidget.h</header> <header>autotype/ShortcutWidget.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<tabstops>
<tabstop>rememberLastDatabasesCheckBox</tabstop>
<tabstop>rememberLastKeyFilesCheckBox</tabstop>
<tabstop>openPreviousDatabasesOnStartupCheckBox</tabstop>
<tabstop>autoSaveOnExitCheckBox</tabstop>
<tabstop>autoSaveAfterEveryChangeCheckBox</tabstop>
<tabstop>minimizeOnCopyCheckBox</tabstop>
<tabstop>autoTypeShortcutWidget</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>