Skip to content
Permalink
Browse files

Restore previously used collation when creating new database. Closes #…

  • Loading branch information...
ansgarbecker committed Oct 27, 2019
1 parent 219b417 commit e0f8a36bfea17a2565e50b2a4d56b24c0670ba6b
Showing with 6 additions and 1 deletion.
  1. +2 −0 source/apphelpers.pas
  2. +4 −1 source/createdatabase.pas
@@ -190,6 +190,7 @@ TQueryThread = class(TThread)
asPreferencesWindowWidth, asPreferencesWindowHeight,
asFileDialogEncoding,
asThemePreviewWidth, asThemePreviewHeight, asThemePreviewTop, asThemePreviewLeft,
asCreateDbCollation,
asUnused);
TAppSetting = record
Name: String;
@@ -3666,6 +3667,7 @@ constructor TAppSettings.Create;
InitSetting(asThemePreviewHeight, 'ThemePreviewHeight', 200);
InitSetting(asThemePreviewTop, 'ThemePreviewTop', 300);
InitSetting(asThemePreviewLeft, 'ThemePreviewLeft', 300);
InitSetting(asCreateDbCollation, 'CreateDbCollation', 0, False, '');

// Initialization values
FRestoreTabsInitValue := ReadBool(asRestoreTabs);
@@ -72,7 +72,9 @@ procedure TCreateDatabaseForm.FormShow(Sender: TObject);
Caption := _('Create database ...');
editDBName.Text := '';
Charset := '';
Collation := ServerCollation;
Collation := AppSettings.ReadString(asCreateDbCollation);
if Collation.IsEmpty then
Collation := ServerCollation;
end
else begin
Caption := _('Alter database ...');
@@ -136,6 +138,7 @@ procedure TCreateDatabaseForm.btnOKClick(Sender: TObject);
if modifyDB = '' then try
sql := GetCreateStatement;
FConnection.Query(sql);
AppSettings.WriteString(asCreateDbCollation, comboCollation.Text);
MainForm.RefreshTree;
// Close form
ModalResult := mrOK;

0 comments on commit e0f8a36

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