mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-23 14:39:34 -05:00
added Enable disable minimize to Tray feature when closing RetroShare
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1614 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
700fd1d72f
commit
26b149429b
@ -515,6 +515,8 @@ void MainWindow::closeEvent(QCloseEvent *e)
|
||||
{
|
||||
static bool firstTime = true;
|
||||
|
||||
if(!_settings->value(QString::fromUtf8("ClosetoTray"), false).toBool())
|
||||
{
|
||||
if (trayIcon->isVisible()) {
|
||||
if (firstTime)
|
||||
{
|
||||
@ -527,6 +529,13 @@ void MainWindow::closeEvent(QCloseEvent *e)
|
||||
hide();
|
||||
e->ignore();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rsicontrol->rsGlobalShutDown();
|
||||
qApp->quit();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,8 @@ GeneralPage::save(QString &errmsg)
|
||||
|
||||
_settings->setValue(QString::fromUtf8("doQuit"), quit());
|
||||
|
||||
_settings->setValue(QString::fromUtf8("ClosetoTray"), closetoTray());
|
||||
|
||||
_settings->setRunRetroshareOnBoot(
|
||||
ui.chkRunRetroshareAtSystemStartup->isChecked());
|
||||
|
||||
@ -75,6 +77,8 @@ GeneralPage::load()
|
||||
|
||||
ui.checkQuit->setChecked(_settings->value(QString::fromUtf8("doQuit"), false).toBool());
|
||||
|
||||
ui.checkClosetoTray->setChecked(_settings->value(QString::fromUtf8("ClosetoTray"), false).toBool());
|
||||
|
||||
}
|
||||
|
||||
bool GeneralPage::quit() const {
|
||||
@ -87,6 +91,11 @@ bool GeneralPage::startMinimized() const {
|
||||
return ui.checkStartMinimized->isChecked();
|
||||
}
|
||||
|
||||
bool GeneralPage::closetoTray() const {
|
||||
if(ui.checkClosetoTray->isChecked()) return true;
|
||||
return ui.checkClosetoTray->isChecked();
|
||||
}
|
||||
|
||||
/** Called when the "show on startup" checkbox is toggled. */
|
||||
void
|
||||
GeneralPage::toggleShowOnStartup(bool checked)
|
||||
|
@ -48,6 +48,7 @@ public:
|
||||
/** Loads the settings for this page */
|
||||
void load();
|
||||
bool startMinimized() const;
|
||||
bool closetoTray() const;
|
||||
bool quit() const;
|
||||
|
||||
|
||||
|
@ -545,6 +545,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="checkClosetoTray">
|
||||
<property name="text">
|
||||
<string>Do not Minimize to Tray Icon</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user