Commit in reactos/subsys/system/explorer on MAIN
Jamfile+2-11.12 -> 1.13
Makefile.MinGW+2-21.20 -> 1.21
notifyhook/notifyhook.dsp+4-41.2 -> 1.3
taskbar/traynotify.cpp+44-171.50 -> 1.51
       /traynotify.h+8-21.22 -> 1.23
utility/utility.h+1-11.61 -> 1.62
+61-27
6 modified files
rollback changes when cancelling notify icon configuration dialog

reactos/subsys/system/explorer
Jamfile 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- Jamfile	24 Mar 2004 10:34:21 -0000	1.12
+++ Jamfile	27 Mar 2004 14:02:27 -0000	1.13
@@ -51,7 +51,8 @@
 	<find-shared-library>uuid
 	<find-shared-library>wsock32
 	<find-shared-library>oleaut32
-	<find-shared-library>libexpat
+#	<find-shared-library>expat
 	<linkflags>notifyhook.dll
+	<linkflags>libexpat.dll
  ;
 

reactos/subsys/system/explorer
Makefile.MinGW 1.20 -> 1.21
diff -u -r1.20 -r1.21
--- Makefile.MinGW	24 Mar 2004 10:34:21 -0000	1.20
+++ Makefile.MinGW	27 Mar 2004 14:02:27 -0000	1.21
@@ -73,12 +73,12 @@
 	i386-stub-win32.o \
 	xmlstorage.o
 
-LIBS = gdi32 comctl32 ole32 uuid libexpat
+LIBS = gdi32 comctl32 ole32 uuid
 DELAYIMPORTS = oleaut32 wsock32
 
 all: $(TARGET)
 
-$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) notifyhook.dll
+$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) notifyhook.dll libexpat.dll
 	$(LINK) $(LFLAGS) -o $@ $^ $(addprefix -l,$(LIBS)) $(addprefix -l,$(DELAYIMPORTS))
 
 explorer$(RES_SUFFIX): $(PROGRAM)_intres.rc res/*.bmp res/*.ico

reactos/subsys/system/explorer/notifyhook
notifyhook.dsp 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- notifyhook.dsp	24 Mar 2004 00:19:16 -0000	1.2
+++ notifyhook.dsp	27 Mar 2004 14:02:28 -0000	1.3
@@ -88,14 +88,14 @@
 
 # PROP BASE Use_MFC 0
 # PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "notifyhook___Win32_Win32"
-# PROP BASE Intermediate_Dir "notifyhook___Win32_Win32"
+# PROP BASE Output_Dir "Win32"
+# PROP BASE Intermediate_Dir "Win32"
 # PROP BASE Ignore_Export_Lib 0
 # PROP BASE Target_Dir ""
 # PROP Use_MFC 0
 # PROP Use_Debug_Libraries 1
-# PROP Output_Dir "notifyhook___Win32_Win32"
-# PROP Intermediate_Dir "notifyhook___Win32_Win32"
+# PROP Output_Dir "Win32"
+# PROP Intermediate_Dir "Win32"
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_NOTIFYHOOK_IMPL" /FR /FD /GZ /c

reactos/subsys/system/explorer/taskbar
traynotify.cpp 1.50 -> 1.51
diff -u -r1.50 -r1.51
--- traynotify.cpp	22 Mar 2004 20:58:16 -0000	1.50
+++ traynotify.cpp	27 Mar 2004 14:02:28 -0000	1.51
@@ -322,7 +322,7 @@
 		break;
 
 	  case WM_TIMER: {
-		TimerTick();
+		Refresh();
 
 		ClockWindow* clock_window = GET_WINDOW(ClockWindow, _hwndClock);
 
@@ -331,7 +331,7 @@
 		break;}
 
 	  case PM_REFRESH:
-		TimerTick();
+		Refresh(true);
 		break;
 
 	  case WM_SIZE: {
@@ -414,7 +414,7 @@
 					}
 				}
 				else if (_icon_map.erase(entry))	// delete icons without valid owner window
-					Refresh();
+					UpdateIcons();
 			}
 		}
 
@@ -429,7 +429,7 @@
 	switch(id) {
 	  case ID_SHOW_HIDDEN_ICONS:
 		_show_hidden = !_show_hidden;
-		Refresh();
+		UpdateIcons();
 		break;
 
 	  case ID_CONFIG_NOTIFYAREA:
@@ -492,7 +492,7 @@
 				entry._dwState |= NIS_HIDDEN;
 #endif
 
-			Refresh();	///@todo call only if really changes occurred
+			UpdateIcons();	///@todo call only if really changes occurred
 
 			return TRUE;
 		}
@@ -505,7 +505,7 @@
 			if (found->second._hIcon)
 				DestroyIcon(found->second._hIcon);
 			_icon_map.erase(found);
-			Refresh();
+			UpdateIcons();
 			return TRUE;
 		}
 		break;}
@@ -529,7 +529,7 @@
 	return FALSE;
 }
 
-void NotifyArea::Refresh()
+void NotifyArea::UpdateIcons()
 {
 	_sorted_icons.clear();
 
@@ -590,10 +590,8 @@
 	}
 }
 
-void NotifyArea::TimerTick()
+void NotifyArea::Refresh(bool update)
 {
-	bool do_refresh = false;
-
 	 // Look for task icons without valid owner window.
 	 // This is an extended feature missing in MS Windows.
 	for(NotifyIconSet::const_iterator it=_sorted_icons.begin(); it!=_sorted_icons.end(); ++it) {
@@ -601,7 +599,7 @@
 
 		if (!IsWindow(entry._hWnd))
 			if (_icon_map.erase(entry))	// delete icons without valid owner window
-				++do_refresh;
+				++update;
 	}
 
 	DWORD now = GetTickCount();
@@ -616,14 +614,14 @@
 		  case NIM_HIDE:
 			if (!(entry._dwState & NIS_HIDDEN)) {
 				entry._dwState |= NIS_HIDDEN;
-				++do_refresh;
+				++update;
 			}
 			break;
 
 		  case NIM_SHOW:
 			if (entry._dwState&NIS_HIDDEN) {
 				entry._dwState &= ~NIS_HIDDEN;
-				++do_refresh;
+				++update;
 			}
 			break;
 
@@ -632,14 +630,14 @@
 			if (!(entry._dwState & NIS_HIDDEN))
 				if (now-entry._lastChange > ICON_AUTOHIDE_SECONDS*1000) {
 					entry._dwState |= NIS_HIDDEN;
-					++do_refresh;
+					++update;
 				}
 			break;
 		}
 	}
 
-	if (do_refresh)
-		Refresh();
+	if (update)
+		UpdateIcons();
 }
 
  /// search for a icon at a given client coordinate position
@@ -740,6 +738,14 @@
 {
 	_selectedItem = 0;
 
+	if (_pNotifyArea) {
+		 // save original icon states and configuration data
+		for(NotifyIconMap::const_iterator it=_pNotifyArea->_icon_map.begin(); it!=_pNotifyArea->_icon_map.end(); ++it)
+			_icon_states_org[it->first] = IconStatePair(it->second._mode, it->second._dwState);
+
+		_cfg_org = _pNotifyArea->_cfg;
+	}
+
 	SetWindowIcon(hwnd, IDI_REACTOS/*IDI_SEARCH*/);
 
 	_haccel = LoadAccelerators(g_Globals._hInstance, MAKEINTRESOURCE(IDA_TRAYNOTIFY));
@@ -870,6 +876,8 @@
 	TreeView_Expand(_tree_ctrl, _hitemCurrent_hidden, TVE_EXPAND);
 	TreeView_Expand(_tree_ctrl, _hitemCurrent, TVE_EXPAND);
 	TreeView_Expand(_tree_ctrl, _hitemConfig, TVE_EXPAND);
+
+	TreeView_EnsureVisible(_tree_ctrl, _hitemCurrent_visible);
 }
 
 void TrayNotifyDlg::InsertItem(HTREEITEM hparent, HTREEITEM after, const NotifyInfo& entry, HDC hdc)
@@ -947,7 +955,25 @@
 			break;
 
 		  case IDOK:
+			EndDialog(_hwnd, id);
+			break;
+
 		  case IDCANCEL:
+			 // rollback changes
+			if (_pNotifyArea) {
+				 // restore original icon states and configuration data
+				_pNotifyArea->_cfg = _cfg_org;
+
+				for(IconStateMap::const_iterator it=_icon_states_org.begin(); it!=_icon_states_org.end(); ++it) {
+					NotifyInfo& info = _pNotifyArea->_icon_map[it->first];
+
+					info._mode = it->second.first;
+					info._dwState = it->second.second;
+				}
+
+				SendMessage(*_pNotifyArea, PM_REFRESH, 0, 0);
+			}
+
 			EndDialog(_hwnd, id);
 			break;
 		}
@@ -1022,7 +1048,8 @@
 		entry._mode = mode;
 
 		 // trigger refresh in notify area and this dialog
-		SendMessage(*_pNotifyArea, PM_REFRESH, 0, 0);
+		if (_pNotifyArea)
+			SendMessage(*_pNotifyArea, PM_REFRESH, 0, 0);
 	}
 
 	if (_pNotifyArea) {

reactos/subsys/system/explorer/taskbar
traynotify.h 1.22 -> 1.23
diff -u -r1.22 -r1.23
--- traynotify.h	21 Mar 2004 23:36:24 -0000	1.22
+++ traynotify.h	27 Mar 2004 14:02:28 -0000	1.23
@@ -149,9 +149,9 @@
 	int		Command(int id, int code);
 	int		Notify(int id, NMHDR* pnmh);
 
-	void	Refresh();
+	void	UpdateIcons();
 	void	Paint();
-	void	TimerTick();
+	void	Refresh(bool do_refresh=false);
 	void	CancelModes();
 
 	NotifyIconSet::iterator IconHitTest(const POINT& pos);
@@ -186,6 +186,12 @@
 	HIMAGELIST	_himl;
 	NotifyArea* _pNotifyArea;
 
+	typedef pair<NOTIFYICONMODE, DWORD> IconStatePair;
+	typedef map<NotifyIconIndex, IconStatePair> IconStateMap;
+
+	NotifyIconCfgList _cfg_org;
+	IconStateMap _icon_states_org;
+
 	HTREEITEM _hitemCurrent;
 	HTREEITEM _hitemCurrent_visible;
 	HTREEITEM _hitemCurrent_hidden;

reactos/subsys/system/explorer/utility
utility.h 1.61 -> 1.62
diff -u -r1.61 -r1.62
--- utility.h	22 Mar 2004 20:58:16 -0000	1.61
+++ utility.h	27 Mar 2004 14:02:28 -0000	1.62
@@ -719,7 +719,7 @@
 };
 
 
- /// string class for convenience
+ /// string class for TCHAR strings
 struct String
 #ifdef UNICODE
  : public wstring
CVSspam 0.2.8