Skip to content
Permalink
Browse files

Issue #140: Auto-backup unsaved query tab contents to C:\Users\<usern…

…ame>\AppData\Roaming\HeidiSQL\Backups\*.sql, and tab setup in C:\Users\<username>\AppData\Roaming\HeidiSQL\tabs.ini
  • Loading branch information...
ansgarbecker committed Apr 7, 2019
1 parent e56371e commit 30694567e5312103b95163cf5a3c766343820017
Showing with 228 additions and 94 deletions.
  1. +4 −1 out/locale/en/LC_MESSAGES/default.po
  2. +3 −3 source/apphelpers.pas
  3. +1 −0 source/const.inc
  4. +7 −0 source/main.dfm
  5. +203 −65 source/main.pas
  6. +6 −16 source/options.dfm
  7. +4 −9 source/options.pas
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: HeidiSQL\n"
"POT-Creation-Date: 2012-11-05 21:40\n"
"PO-Revision-Date: 2019-03-30 09:56+0100\n"
"PO-Revision-Date: 2019-04-07 13:11+0200\n"
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
"MIME-Version: 1.0\n"
@@ -6352,3 +6352,6 @@ msgstr "Plugin directory %s could not be set."

msgid "Background color:"
msgstr "Background color:"

msgid "Backup file could not be deleted: %s"
msgstr "Backup file could not be deleted: %s"
@@ -168,7 +168,7 @@ TQueryThread = class(TThread)
asCopyTableData, asCopyTableRecentFilter, asServerVersion, asServerVersionFull, asLastConnect,
asConnectCount, asRefusedCount, asSessionCreated, asDoUsageStatistics,
asLastUsageStatisticCall, asWheelZoom, asDisplayBars, asMySQLBinaries, asCustomSnippetsDirectory,
asPromptSaveFileOnTabClose, asReopenFiles, asBackupRestoreFiles, asWarnUnsafeUpdates, asQueryWarningsMessage,
asPromptSaveFileOnTabClose, asRestoreTabs, asBackupDirectory, asWarnUnsafeUpdates, asQueryWarningsMessage,
asCompletionProposal, asCompletionProposalWidth, asCompletionProposalNbLinesInWindow, asAutoUppercase,
asTabsToSpaces, asFilterPanel, asAllowMultipleInstances, asFindDialogSearchHistory, asGUIFontName, asGUIFontSize,
asTheme, asIconPack,
@@ -3615,8 +3615,8 @@ constructor TAppSettings.Create;
DefaultSnippetsDirectory := DefaultSnippetsDirectory + 'Snippets\';
InitSetting(asCustomSnippetsDirectory, 'CustomSnippetsDirectory', 0, False, DefaultSnippetsDirectory);
InitSetting(asPromptSaveFileOnTabClose, 'PromptSaveFileOnTabClose', 0, True);
InitSetting(asReopenFiles, 'ReopenFiles', 0, True);
InitSetting(asBackupRestoreFiles, 'BackupRestoreFiles', 0, True);
InitSetting(asRestoreTabs, 'RestoreTabs', 0, True);
InitSetting(asBackupDirectory, 'BackupDirectory', 0, False, DirnameUserAppData + 'Backups\');
InitSetting(asWarnUnsafeUpdates, 'WarnUnsafeUpdates', 0, True);
InitSetting(asQueryWarningsMessage, 'QueryWarningsMessage', 0, True);
InitSetting(asCompletionProposal, 'CompletionProposal', 0, True);
@@ -83,6 +83,7 @@ const
GRIDMAXDATA: Integer = 256;

BACKUP_MAXFILESIZE: Integer = 10 * SIZE_MB;
BACKUP_FILEPATTERN: String = 'query-tab-%d.sql';

VTREE_NOTLOADED = 0;
VTREE_NOTLOADED_PURGECACHE = 1;
Left = 689
Top = 339
end
object TimerStoreTabs: TTimer
Enabled = False
Interval = 10000
OnTimer = TimerStoreTabsTimer
Left = 689
Top = 299
end
end
Oops, something went wrong.

0 comments on commit 3069456

Please sign in to comment.
You can’t perform that action at this time.