Commit 241cd196 authored by Wlodzimierz (Volodymyr) Ciesielski (Tsiselskyi)'s avatar Wlodzimierz (Volodymyr) Ciesielski (Tsiselskyi) Committed by Andrius Štikonas
Browse files

Minimize to system tray as option

parent 725893b8
......@@ -470,13 +470,10 @@ void GUI::loadState(KSharedConfigPtr cfg)
show_menu_bar_action->setChecked(!menubar_hidden);
bool hidden_on_exit = g.readEntry("hidden_on_exit", false);
if (Settings::showSystemTrayIcon()) {
if (hidden_on_exit) {
Out(SYS_GEN | LOG_DEBUG) << "Starting minimized" << endl;
hide();
} else {
show();
}
bool minimize_to_system_tray = Settings::alwaysMinimizeToSystemTray() || hidden_on_exit;
if (Settings::showSystemTrayIcon() && minimize_to_system_tray) {
Out(SYS_GEN | LOG_DEBUG) << "Starting minimized" << endl;
hide();
} else {
show();
}
......
......@@ -94,6 +94,16 @@
<bool>true</bool>
</property>
<layout class="QVBoxLayout">
<item>
<widget class="QCheckBox" name="kcfg_alwaysMinimizeToSystemTray">
<property name="toolTip">
<string>Whether or not to always minimize to system tray on startup.</string>
</property>
<property name="text">
<string>Always minimize to system tray on startup</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_showPopups">
<property name="toolTip">
......
......@@ -191,6 +191,16 @@ void DBusSettings::setUploadBandwidth(int val)
Settings::setUploadBandwidth(val);
}
bool DBusSettings::alwaysMinimizeToSystemTray()
{
return Settings::alwaysMinimizeToSystemTray();
}
void DBusSettings::setAlwaysMinimizeToSystemTray(bool val)
{
Settings::setAlwaysMinimizeToSystemTray(val);
}
bool DBusSettings::showPopups()
{
return Settings::showPopups();
......
......@@ -68,6 +68,8 @@ public Q_SLOTS:
Q_SCRIPTABLE void setDownloadBandwidth(int val);
Q_SCRIPTABLE int uploadBandwidth();
Q_SCRIPTABLE void setUploadBandwidth(int val);
Q_SCRIPTABLE bool alwaysMinimizeToSystemTray();
Q_SCRIPTABLE void setAlwaysMinimizeToSystemTray(bool val);
Q_SCRIPTABLE bool showPopups();
Q_SCRIPTABLE void setShowPopups(bool val);
Q_SCRIPTABLE bool keepSeeding();
......
......@@ -86,6 +86,10 @@
<min>0</min>
<max>1000000</max>
</entry>
<entry name="alwaysMinimizeToSystemTray" type="Bool">
<label>Always minimize to system tray on startup.</label>
<default>false</default>
</entry>
<entry name="showPopups" type="Bool">
<label>Show popup messages when torrent is finished.</label>
<default>true</default>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment