The MinGW.org Installation Manager Tool
Revision | 9769479dcadbd4865e46bca58e4633ee70535c7e (tree) |
---|---|
Time | 2012-12-25 05:45:33 |
Author | Keith Marshall <keithmarshall@user...> |
Commiter | Keith Marshall |
Work around a GUI action scheduling instability.
@@ -1,3 +1,14 @@ | ||
1 | +2012-12-24 Keith Marshall <keithmarshall@users.sourceforge.net> | |
2 | + | |
3 | + Work around a GUI action scheduling instability. | |
4 | + | |
5 | + * src/guimain.h (AppWindowMaker::UpdateDataSheet): Declare new method. | |
6 | + * src/pkgdata.cpp (AppWindowMaker::UpdateDataSheet): Implement it. | |
7 | + (AppWindowMaker::OnNotify): Use it. | |
8 | + | |
9 | + * src/guiexec.cpp (AppWindowMaker::OnCommand) [IDD_REPO_APPLY]: | |
10 | + Don't refresh package list view in-place; clear and reload it instead. | |
11 | + | |
1 | 12 | 2012-12-21 Keith Marshall <keithmarshall@users.sourceforge.net> |
2 | 13 | |
3 | 14 | Update distribution build rules. |
@@ -697,6 +697,9 @@ long AppWindowMaker::OnCommand( WPARAM cmd ) | ||
697 | 697 | * actions schedule, remove all marker icons, and refresh |
698 | 698 | * the package list to reflect current status. |
699 | 699 | */ |
700 | +#if 0 /* FIXME: we'd like to just do this in place, but doing | |
701 | + * so seems to cause mingw-get to become unstable... | |
702 | + */ | |
700 | 703 | pkgListViewMaker pkglist( PackageListView ); |
701 | 704 | pkglist.UpdateListView(); |
702 | 705 |
@@ -708,7 +711,17 @@ long AppWindowMaker::OnCommand( WPARAM cmd ) | ||
708 | 711 | pkglist.MarkScheduledActions( |
709 | 712 | pkgData->ClearScheduledActions( ACTION_PRESERVE_FAILED ) |
710 | 713 | ); |
711 | - | |
714 | +#else | |
715 | + /* ...so, for the time being, we must force a complete | |
716 | + * reload of the package list; (note that this has the | |
717 | + * side effect of clearing any residual action schedule, | |
718 | + * so we lose any potential record of failed actions). | |
719 | + */ | |
720 | + ClearPackageList(); | |
721 | + LoadPackageData( false ); | |
722 | + UpdatePackageList(); | |
723 | + UpdateDataSheet(); | |
724 | +#endif | |
712 | 725 | /* Clearing the schedule of actions may also affect the |
713 | 726 | * validity of menu options; update accordingly. |
714 | 727 | */ |
@@ -184,11 +184,11 @@ class AppWindowMaker: public WTK::MainWindowMaker | ||
184 | 184 | inline void ExecuteScheduledActions( void ); |
185 | 185 | |
186 | 186 | private: |
187 | - virtual long OnCreate(); | |
187 | + virtual long OnCreate( void ); | |
188 | 188 | virtual long OnCommand( WPARAM ); |
189 | 189 | virtual long OnNotify( WPARAM, LPARAM ); |
190 | 190 | virtual long OnSize( WPARAM, int, int ); |
191 | - virtual long OnClose(); | |
191 | + virtual long OnClose( void ); | |
192 | 192 | |
193 | 193 | int LayoutEngine( HWND, LPARAM ); |
194 | 194 | static int CALLBACK LayoutController( HWND, LPARAM ); |
@@ -212,7 +212,8 @@ class AppWindowMaker: public WTK::MainWindowMaker | ||
212 | 212 | DataSheetMaker *DataSheet; |
213 | 213 | WTK::ChildWindowMaker *TabDataPane; |
214 | 214 | HWND PackageTabControl, PackageTabPane; |
215 | - void InitPackageTabControl(); | |
215 | + void InitPackageTabControl( void ); | |
216 | + void UpdateDataSheet( void ); | |
216 | 217 | }; |
217 | 218 | |
218 | 219 | inline long AppWindowMaker::DialogueResponse( int id, DLGPROC handler ) |
@@ -1176,6 +1176,14 @@ void AppWindowMaker::SelectPackageAction( unsigned mode ) | ||
1176 | 1176 | } |
1177 | 1177 | } |
1178 | 1178 | |
1179 | +void AppWindowMaker::UpdateDataSheet( void ) | |
1180 | +{ | |
1181 | + /* Helper method, called when we wish to update the data sheet | |
1182 | + * panel, to match the current list view and tab selection. | |
1183 | + */ | |
1184 | + DataSheet->DisplayData( PackageTabControl, PackageListView ); | |
1185 | +} | |
1186 | + | |
1179 | 1187 | long AppWindowMaker::OnNotify( WPARAM client_id, LPARAM data ) |
1180 | 1188 | { |
1181 | 1189 | /* Handler for notifiable events to be processed in the context |
@@ -1198,7 +1206,7 @@ long AppWindowMaker::OnNotify( WPARAM client_id, LPARAM data ) | ||
1198 | 1206 | * pane to display its associated data sheet, and offers a |
1199 | 1207 | * pop-up menu of actions which may be performed on it. |
1200 | 1208 | */ |
1201 | - DataSheet->DisplayData( PackageTabControl, PackageListView ); | |
1209 | + UpdateDataSheet(); | |
1202 | 1210 | SelectPackageAction( LVHT_ONITEMICON | LVHT_ONITEMLABEL ); |
1203 | 1211 | break; |
1204 | 1212 | } |
@@ -1212,7 +1220,7 @@ long AppWindowMaker::OnNotify( WPARAM client_id, LPARAM data ) | ||
1212 | 1220 | /* ...each of which may require the data sheet content |
1213 | 1221 | * to be updated, (to reflect a changed selection). |
1214 | 1222 | */ |
1215 | - DataSheet->DisplayData( PackageTabControl, PackageListView ); | |
1223 | + UpdateDataSheet(); | |
1216 | 1224 | |
1217 | 1225 | /* Additionally, for a left click on the package status |
1218 | 1226 | * icon within the list view, we present a pop-up menu |