summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com>2008-08-22 11:30:29 +0200
committerTomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com>2008-08-22 11:30:29 +0200
commitcc26194868d09d397b39c22423c25f6bfe9fc5fc (patch)
treebd1542aca5b124006ed80adc8912afb80c306405
parentb5af37db7650be18ac54c8ca7fe3cf476a2315ee (diff)
downloadtuxcmd-cc26194868d09d397b39c22423c25f6bfe9fc5fc.tar.xz
Workaround configuration lost on slower systems
-rw-r--r--UConfig.pas10
-rw-r--r--UMain.pas6
2 files changed, 12 insertions, 4 deletions
diff --git a/UConfig.pas b/UConfig.pas
index f66c732..d1ca13a 100644
--- a/UConfig.pas
+++ b/UConfig.pas
@@ -106,6 +106,7 @@ var ConfPanelSep, ConfRowHeight, ConfRowHeightReal, ConfNumHistoryItems,
ConfTempPath: string;
ConfUseSmoothScrolling: boolean;
+ ApplicationShuttingDown: boolean;
@@ -1038,9 +1039,9 @@ begin
Result := ChangedMainGUI or ChangedAssoc or ChangedBookmarks or ChangedMounter or ChangedConnections;
InternalMainGUIConfmtime := GetFileTime(s + 'gui');
InternalFAssocConfmtime := GetFileTime(s + 'filetypes');
- InternalBookmarksConfmtime := GetFileTime(s + 'bookmarks');
- InternalMounterConfmtime := GetFileTime(s + 'mounter');
- InternalConnMgrConfmtime := GetFileTime(s + 'connmgr');
+ InternalBookmarksConfmtime := GetFileTime(s + 'bookmarks');
+ InternalMounterConfmtime := GetFileTime(s + 'mounter');
+ InternalConnMgrConfmtime := GetFileTime(s + 'connmgr');
end;
(********************************************************************************************************************************)
@@ -1119,6 +1120,7 @@ end;
initialization
+ ApplicationShuttingDown := False;
SetDefaults;
ParseCMDLine;
{$IFDEF FPC}
@@ -1156,7 +1158,7 @@ initialization
finalization
// Save the settings
WriteBookmarks;
- WriteConnections;
+// WriteConnections; -- not needed, saving when Connection Manager closes
WriteMainSettings;
if ConfSavePanelTabs then begin
WriteTabs(True, LeftPanelTabs, LeftTabSortIDs, LeftTabSortTypes);
diff --git a/UMain.pas b/UMain.pas
index 99cbfbc..fd11934 100644
--- a/UMain.pas
+++ b/UMain.pas
@@ -1112,6 +1112,8 @@ begin
end;
end;
+ ApplicationShuttingDown := True; // Avoid emitting config files refresh event
+
// Close all active connections
if b then begin
if (not LeftPanelNotebook.Visible) and (LeftPanelEngine is TVFSEngine) then CloseVFS(True, True)
@@ -4591,6 +4593,10 @@ var ChangedMainGUI, ChangedAssoc, ChangedBookmarks, ChangedMounter, ChangedConnM
begin
try
if (csDestroying in ComponentState) or (not Assigned(FMain)) then Exit;
+ if ApplicationShuttingDown then begin
+ DebugMsg([' *** TFMain.HandleFormFocusIn called when ApplicationShuttingDown, possible bug caught ***']);
+ Exit;
+ end;
if InternalLockUnlocked then begin
APerformRefresh := ConfFocusRefresh;