- initial work on new preferences dialog
This commit is contained in:
parent
c1af788d7f
commit
48cd3d0052
@ -18,10 +18,12 @@ PreferencesDlg::PreferencesDlg(QWidget *parent, Settings& settings) :
|
|||||||
mSettings(settings)
|
mSettings(settings)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
connect(ui->mSelectDatabaseButton, SIGNAL(clicked()), this, SLOT(selectDatabase()));
|
|
||||||
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accepted()));
|
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accepted()));
|
||||||
connect(ui->mSmartStopTracking, SIGNAL(toggled(bool)), this, SLOT(smartStopSettingChanged(bool)));
|
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(rejected()));
|
||||||
connect(ui->mSmartStartTracking, SIGNAL(toggled(bool)), this, SLOT(smartStartSettingChanged(bool)));
|
|
||||||
|
connect(ui->mChangePathButton, SIGNAL(clicked()), this, SLOT(onChangeDatabasePath()));
|
||||||
|
connect(ui->mPauseOnIdleCheckbox, SIGNAL(toggled(bool)), this, SLOT(onPauseOnIdle(bool)));
|
||||||
|
connect(ui->mAskQuestionOnResumeCheckbox, SIGNAL(toggled(bool)), this, SLOT(smartStartSettingChanged(bool)));
|
||||||
|
|
||||||
// Autosave password
|
// Autosave password
|
||||||
ui->mAutosavePasswordCheckbox->setChecked(settings.data().value(KEY_AUTOSAVE_PASSWORD).toBool());
|
ui->mAutosavePasswordCheckbox->setChecked(settings.data().value(KEY_AUTOSAVE_PASSWORD).toBool());
|
||||||
@ -36,7 +38,7 @@ PreferencesDlg::PreferencesDlg(QWidget *parent, Settings& settings) :
|
|||||||
ui->mDarkThemeCheckbox->setChecked(settings.data().value(KEY_DARK_THEME).toBool());
|
ui->mDarkThemeCheckbox->setChecked(settings.data().value(KEY_DARK_THEME).toBool());
|
||||||
|
|
||||||
// Use custom database path ?
|
// Use custom database path ?
|
||||||
ui->mDatabaseLocation->setText(settings.data().value(KEY_DB_FILENAME).toString());
|
ui->mPathToDatabaseLabel->setText(settings.data().value(KEY_DB_FILENAME).toString());
|
||||||
|
|
||||||
// Use stop on idle ?
|
// Use stop on idle ?
|
||||||
ui->mSmartStopTracking->setChecked(GET_BOOL(KEY_SMART_STOP));
|
ui->mSmartStopTracking->setChecked(GET_BOOL(KEY_SMART_STOP));
|
||||||
@ -104,14 +106,9 @@ void PreferencesDlg::smartStopSettingChanged(bool v)
|
|||||||
allowStartAfterIdleControls();
|
allowStartAfterIdleControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesDlg::smartStartSettingChanged(bool/* v */)
|
|
||||||
{
|
|
||||||
allowStartAfterIdleControls();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PreferencesDlg::smartStopWayChanged()
|
void PreferencesDlg::onPauseOnIdle(bool value)
|
||||||
{
|
{
|
||||||
allowStartAfterIdleControls();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesDlg::allowStartAfterIdleControls()
|
void PreferencesDlg::allowStartAfterIdleControls()
|
||||||
|
|||||||
@ -23,13 +23,13 @@ private:
|
|||||||
void applyTheme();
|
void applyTheme();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void selectDatabase();
|
|
||||||
void accepted();
|
void accepted();
|
||||||
void smartStopSettingChanged(bool v);
|
void rejected();
|
||||||
void smartStartSettingChanged(bool);
|
|
||||||
void smartStopWayChanged();
|
void onPauseOnIdle(bool v);
|
||||||
void allowStartAfterIdleControls();
|
void onAskQuestionWhenResume(bool v);
|
||||||
void onChangeAppFont();
|
void onChangeAppFont();
|
||||||
|
void onChangeDatabasePath();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PREFERENCESDLG_H
|
#endif // PREFERENCESDLG_H
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>586</width>
|
<width>586</width>
|
||||||
<height>452</height>
|
<height>409</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -21,205 +21,230 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="mShowSecondsCheckbox">
|
<widget class="QFrame" name="frame">
|
||||||
<property name="text">
|
<property name="frameShape">
|
||||||
<string>Show seconds</string>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="frameShadow">
|
||||||
</item>
|
<enum>QFrame::Raised</enum>
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="mAutosavePasswordCheckbox">
|
|
||||||
<property name="text">
|
|
||||||
<string>Save password in keychain</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<layout class="QFormLayout" name="formLayout">
|
||||||
</item>
|
<property name="fieldGrowthPolicy">
|
||||||
<item>
|
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||||
<widget class="QCheckBox" name="mAskBeforeDeleteCheckbox">
|
</property>
|
||||||
<property name="text">
|
<item row="0" column="0">
|
||||||
<string>Ask before delete</string>
|
<widget class="QLabel" name="label_3">
|
||||||
</property>
|
<property name="text">
|
||||||
<property name="checked">
|
<string>Show seconds:</string>
|
||||||
<bool>true</bool>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
<item row="0" column="1">
|
||||||
<item>
|
<widget class="QCheckBox" name="mShowSecondsCheckbox">
|
||||||
<widget class="QCheckBox" name="mShowTrayIconCheckbox">
|
<property name="text">
|
||||||
<property name="text">
|
<string/>
|
||||||
<string>Show tray icon</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
<item row="2" column="0">
|
||||||
<item>
|
<widget class="QLabel" name="label_4">
|
||||||
<widget class="QCheckBox" name="mDarkThemeCheckbox">
|
<property name="text">
|
||||||
<property name="text">
|
<string>Save password in keychain: </string>
|
||||||
<string>Use dark theme</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
<item row="2" column="1">
|
||||||
<item>
|
<widget class="QCheckBox" name="mAutosavePasswordCheckbox">
|
||||||
<widget class="QPushButton" name="mChangeAppFont">
|
<property name="text">
|
||||||
<property name="text">
|
<string/>
|
||||||
<string>Change app font...</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
<item row="3" column="0">
|
||||||
<item>
|
<widget class="QLabel" name="label_5">
|
||||||
<widget class="QLabel" name="mAppFontExampleLabel">
|
<property name="text">
|
||||||
<property name="text">
|
<string>Ask before delete:</string>
|
||||||
<string>Example of used app font.</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="alignment">
|
</item>
|
||||||
<set>Qt::AlignCenter</set>
|
<item row="3" column="1">
|
||||||
</property>
|
<widget class="QCheckBox" name="mAskBeforeDeleteCheckbox">
|
||||||
</widget>
|
<property name="text">
|
||||||
</item>
|
<string/>
|
||||||
<item>
|
</property>
|
||||||
<widget class="QPushButton" name="mSelectDatabaseButton">
|
<property name="checked">
|
||||||
<property name="text">
|
<bool>true</bool>
|
||||||
<string>Select file...</string>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
<item row="4" column="0">
|
||||||
<item>
|
<widget class="QLabel" name="label_6">
|
||||||
<widget class="QLabel" name="mDatabaseLocation">
|
<property name="text">
|
||||||
<property name="sizePolicy">
|
<string>Show tray icon:</string>
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
</property>
|
||||||
<horstretch>0</horstretch>
|
</widget>
|
||||||
<verstretch>0</verstretch>
|
</item>
|
||||||
</sizepolicy>
|
<item row="4" column="1">
|
||||||
</property>
|
<widget class="QCheckBox" name="mShowTrayIconCheckbox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Location of used database</string>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="5" column="0">
|
||||||
<layout class="QVBoxLayout" name="stopTrackingRuleLayout">
|
<widget class="QLabel" name="label_7">
|
||||||
<property name="spacing">
|
<property name="text">
|
||||||
<number>0</number>
|
<string>Use dark theme:</string>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
</widget>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
</item>
|
||||||
<property name="spacing">
|
<item row="5" column="1">
|
||||||
<number>0</number>
|
<widget class="QCheckBox" name="mDarkThemeCheckbox">
|
||||||
</property>
|
<property name="text">
|
||||||
<item>
|
<string/>
|
||||||
<widget class="QCheckBox" name="mSmartStopTracking">
|
</property>
|
||||||
<property name="sizePolicy">
|
</widget>
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
</item>
|
||||||
<horstretch>20</horstretch>
|
<item row="6" column="0">
|
||||||
<verstretch>0</verstretch>
|
<widget class="QLabel" name="label_8">
|
||||||
</sizepolicy>
|
<property name="text">
|
||||||
</property>
|
<string>Application font:</string>
|
||||||
<property name="minimumSize">
|
</property>
|
||||||
<size>
|
</widget>
|
||||||
<width>240</width>
|
</item>
|
||||||
<height>0</height>
|
<item row="6" column="1">
|
||||||
</size>
|
<widget class="QFrame" name="frame_2">
|
||||||
</property>
|
<property name="frameShape">
|
||||||
<property name="text">
|
<enum>QFrame::StyledPanel</enum>
|
||||||
<string>Stop tracking if idle detected for</string>
|
</property>
|
||||||
</property>
|
<property name="frameShadow">
|
||||||
</widget>
|
<enum>QFrame::Raised</enum>
|
||||||
</item>
|
</property>
|
||||||
<item>
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<widget class="QLineEdit" name="mSmartStopIntervalInMinutes">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>50</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>minutes</string>
|
|
||||||
</property>
|
|
||||||
<property name="margin">
|
|
||||||
<number>3</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="mAskQuestionOnStopRadiobutton">
|
<widget class="QLabel" name="mAppFontLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Ask question</string>
|
<string>This is name and size of used app font.</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="buttonGroup">
|
|
||||||
<string notr="true">buttonGroup</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="mAutomaticallyOnStopRadiobutton">
|
<widget class="QPushButton" name="mChangeAppFontButton">
|
||||||
<property name="text">
|
<property name="maximumSize">
|
||||||
<string>Automatically</string>
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Change...</string>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="buttonGroup">
|
|
||||||
<string notr="true">buttonGroup</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</widget>
|
||||||
</layout>
|
</item>
|
||||||
</item>
|
<item row="7" column="0">
|
||||||
</layout>
|
<widget class="QLabel" name="label_9">
|
||||||
</item>
|
<property name="text">
|
||||||
<item>
|
<string>Path to database:</string>
|
||||||
<layout class="QVBoxLayout" name="startTrackingRuleLayout">
|
</property>
|
||||||
<property name="spacing">
|
</widget>
|
||||||
<number>0</number>
|
</item>
|
||||||
</property>
|
<item row="7" column="1">
|
||||||
<item>
|
<widget class="QFrame" name="frame_3">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<property name="frameShape">
|
||||||
<item>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
<widget class="QCheckBox" name="mSmartStartTracking">
|
</property>
|
||||||
<property name="text">
|
<property name="frameShadow">
|
||||||
<string>Start tracking after stop on idle when user activity detected.
|
<enum>QFrame::Raised</enum>
|
||||||
This option requires enabled automatic stop tracking on idle.</string>
|
</property>
|
||||||
</property>
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
</widget>
|
<item>
|
||||||
</item>
|
<widget class="QLabel" name="mPathToDatabaseLabel">
|
||||||
<item>
|
<property name="text">
|
||||||
<widget class="QLabel" name="label_2">
|
<string>TextLabel</string>
|
||||||
<property name="text">
|
</property>
|
||||||
<string/>
|
<property name="alignment">
|
||||||
</property>
|
<set>Qt::AlignCenter</set>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
</widget>
|
||||||
</layout>
|
</item>
|
||||||
</item>
|
<item>
|
||||||
</layout>
|
<widget class="QPushButton" name="mChangePathButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Change...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Pause tracking on idle:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="1">
|
||||||
|
<widget class="QCheckBox" name="mPauseOnIdleCheckbox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>20</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>240</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="0">
|
||||||
|
<widget class="QLabel" name="label_10">
|
||||||
|
<property name="text">
|
||||||
|
<string>Idle timeout (in minutes):</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="1">
|
||||||
|
<widget class="QLineEdit" name="mIdleTimeoutEdit">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Ask question on resume:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="1">
|
||||||
|
<widget class="QCheckBox" name="mAskQuestionOnResumeCheckbox">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user