Finalized "start minimized" option.
This commit is contained in:
parent
5ae3415ad4
commit
1706a36b66
@ -42,6 +42,9 @@ void FormSettings::loadInterface() {
|
|||||||
m_ui->m_cmbTrayClose->setCurrentIndex(Settings::getInstance()->value(APP_CFG_GUI,
|
m_ui->m_cmbTrayClose->setCurrentIndex(Settings::getInstance()->value(APP_CFG_GUI,
|
||||||
"close_win_action",
|
"close_win_action",
|
||||||
0).toInt());
|
0).toInt());
|
||||||
|
m_ui->m_checkHidden->setChecked(Settings::getInstance()->value(APP_CFG_GUI,
|
||||||
|
"start_hidden",
|
||||||
|
false).toBool());
|
||||||
}
|
}
|
||||||
// Tray icon is not supported on this machine.
|
// Tray icon is not supported on this machine.
|
||||||
else {
|
else {
|
||||||
@ -90,9 +93,8 @@ void FormSettings::saveInterface() {
|
|||||||
m_ui->m_radioTrayOn->isChecked());
|
m_ui->m_radioTrayOn->isChecked());
|
||||||
Settings::getInstance()->setValue(APP_CFG_GUI, "close_win_action",
|
Settings::getInstance()->setValue(APP_CFG_GUI, "close_win_action",
|
||||||
m_ui->m_cmbTrayClose->currentIndex());
|
m_ui->m_cmbTrayClose->currentIndex());
|
||||||
// TODO: Switch tray icon here (destroy it/create it) and
|
Settings::getInstance()->setValue(APP_CFG_GUI, "start_hidden",
|
||||||
// if icon is should be destroyed and no main window is visible,
|
m_ui->m_checkHidden->isChecked());
|
||||||
// then show main window and then destroy tray icon.
|
|
||||||
if (Settings::getInstance()->value(APP_CFG_GUI, "use_tray_icon", true).toBool()) {
|
if (Settings::getInstance()->value(APP_CFG_GUI, "use_tray_icon", true).toBool()) {
|
||||||
SystemTrayIcon::getInstance()->show();
|
SystemTrayIcon::getInstance()->show();
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentRow">
|
<property name="currentRow">
|
||||||
<number>-1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -100,7 +100,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_3">
|
<widget class="QWidget" name="m_tabNotifications">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Notifications</string>
|
<string>Notifications</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
@ -149,6 +149,13 @@
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="m_checkHidden">
|
||||||
|
<property name="text">
|
||||||
|
<string>Start application hidden</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -159,6 +166,16 @@
|
|||||||
<string>Fonts</string>
|
<string>Fonts</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="m_tabMisc">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Miscellaneous</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QFormLayout" name="formLayout_4">
|
||||||
|
<property name="fieldGrowthPolicy">
|
||||||
|
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||||
|
</property>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@ -228,38 +245,6 @@
|
|||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
<connection>
|
|
||||||
<sender>m_radioTrayOff</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>m_lblTrayClose</receiver>
|
|
||||||
<slot>setDisabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>370</x>
|
|
||||||
<y>82</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>292</x>
|
|
||||||
<y>135</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>m_radioTrayOff</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>m_cmbTrayClose</receiver>
|
|
||||||
<slot>setDisabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>370</x>
|
|
||||||
<y>82</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>478</x>
|
|
||||||
<y>135</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
<connection>
|
||||||
<sender>m_radioTrayOn</sender>
|
<sender>m_radioTrayOn</sender>
|
||||||
<signal>toggled(bool)</signal>
|
<signal>toggled(bool)</signal>
|
||||||
@ -292,5 +277,21 @@
|
|||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>m_radioTrayOn</sender>
|
||||||
|
<signal>toggled(bool)</signal>
|
||||||
|
<receiver>m_checkHidden</receiver>
|
||||||
|
<slot>setVisible(bool)</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>417</x>
|
||||||
|
<y>108</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>417</x>
|
||||||
|
<y>162</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -111,9 +111,7 @@ void SystemTrayIcon::setNumber(int number) {
|
|||||||
Qt::AlignVCenter | Qt::AlignCenter ,
|
Qt::AlignVCenter | Qt::AlignCenter ,
|
||||||
QString::number(number));
|
QString::number(number));
|
||||||
}
|
}
|
||||||
|
|
||||||
trayPainter.end();
|
trayPainter.end();
|
||||||
|
|
||||||
QSystemTrayIcon::setIcon(QIcon(background));
|
QSystemTrayIcon::setIcon(QIcon(background));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
src/main.cpp
10
src/main.cpp
@ -77,8 +77,14 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Display main window.
|
// Display main window.
|
||||||
// TODO: Switchable "start minimized" function.
|
if (Settings::getInstance()->value(APP_CFG_GUI, "start_hidden",
|
||||||
window.show();
|
false).toBool() &&
|
||||||
|
SystemTrayIcon::isSystemTrayActivated()) {
|
||||||
|
window.hide();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.show();
|
||||||
|
}
|
||||||
|
|
||||||
// Display tray icon if it is enabled and available.
|
// Display tray icon if it is enabled and available.
|
||||||
if (SystemTrayIcon::isSystemTrayActivated()) {
|
if (SystemTrayIcon::isSystemTrayActivated()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user