← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2553: update the tray icon's visibility when changing settings

 

------------------------------------------------------------
revno: 2553
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Tue 2011-06-07 19:44:52 +0200
message:
  update the tray icon's visibility when changing settings
modified:
  win32/MainWindow.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'win32/MainWindow.cpp'
--- win32/MainWindow.cpp	2011-05-30 17:06:19 +0000
+++ win32/MainWindow.cpp	2011-06-07 17:44:52 +0000
@@ -558,7 +558,7 @@
 	notifier->onContextMenu([this] { handleTrayContextMenu(); });
 	notifier->onIconClicked([this] { handleTrayClicked(); });
 	notifier->onUpdateTip([this] { handleTrayUpdate(); });
-	if(SETTING(ALWAYS_TRAY)) {
+	if(BOOLSETTING(ALWAYS_TRAY)) {
 		notifier->setVisible(true);
 	}
 }
@@ -811,7 +811,7 @@
 		if(BOOLSETTING(AUTO_AWAY) && !Util::getManualAway()) {
 			Util::setAway(false);
 		}
-		if(!SETTING(ALWAYS_TRAY)) {
+		if(!BOOLSETTING(ALWAYS_TRAY)) {
 			notifier->setVisible(false);
 		}
 		layout();
@@ -823,7 +823,7 @@
 		Util::setAway(true);
 	}
 	if(BOOLSETTING(MINIMIZE_TRAY) != WinUtil::isShift()) {
-		if(!SETTING(ALWAYS_TRAY)) {
+		if(!BOOLSETTING(ALWAYS_TRAY)) {
 			notifier->setVisible(true);
 		}
 		setVisible(false);
@@ -1061,6 +1061,7 @@
 	string lastMapper = SETTING(MAPPER);
 	string lastBind = SETTING(BIND_ADDRESS);
 
+	bool lastTray = BOOLSETTING(ALWAYS_TRAY);
 	bool lastSortFavUsersFirst = BOOLSETTING(SORT_FAVUSERS_FIRST);
 	bool lastURLReg = BOOLSETTING(URL_HANDLER);
 	bool lastMagnetReg = BOOLSETTING(MAGNET_REGISTER);
@@ -1077,6 +1078,9 @@
 			showPortsError(e.getError());
 		}
 
+		if(BOOLSETTING(ALWAYS_TRAY) != lastTray)
+			notifier->setVisible(BOOLSETTING(ALWAYS_TRAY));
+
 		if(BOOLSETTING(SORT_FAVUSERS_FIRST) != lastSortFavUsersFirst)
 			HubFrame::resortUsers();