Code cosmetic: Do not pass default parameter in one zillion callers of ShowStatusMsg()

This commit is contained in:
Ansgar Becker
2010-05-28 23:09:38 +00:00
parent ac50ae75ce
commit 2e301d1095
4 changed files with 28 additions and 28 deletions

View File

@ -24,8 +24,6 @@ const
REGKEY_SESSIONS = 'Servers\'; REGKEY_SESSIONS = 'Servers\';
// Some unique char, used to separate e.g. selected columns in registry // Some unique char, used to separate e.g. selected columns in registry
DELIM = '|'; DELIM = '|';
STATUS_MSG_READY = 'Idle.';
STR_NOTSUPPORTED = 'Not supported by this server';
// Used by maskSQL and fixSQL: // Used by maskSQL and fixSQL:
SQL_VERSION_ANSI = -1; SQL_VERSION_ANSI = -1;
@ -321,6 +319,8 @@ const
SContainsNulCharGrid = 'This cell contains NUL characters. They have been converted to ASCII spaces (SP). Press ESC to cancel editing.'; SContainsNulCharGrid = 'This cell contains NUL characters. They have been converted to ASCII spaces (SP). Press ESC to cancel editing.';
SUnhandledTreeLevel = 'Unhandled tree node level.'; SUnhandledTreeLevel = 'Unhandled tree node level.';
MSG_NOGRIDEDITING = 'Selected columns don''t contain a sufficient set of key columns to allow editing. Please select primary or unique key columns, or just all columns.'; MSG_NOGRIDEDITING = 'Selected columns don''t contain a sufficient set of key columns to allow editing. Please select primary or unique key columns, or just all columns.';
SIdle = 'Idle.';
SUnsupported = 'Not supported by this server';
PKEY = 'PRIMARY'; PKEY = 'PRIMARY';
KEY = 'KEY'; KEY = 'KEY';

View File

@ -681,7 +681,7 @@ begin
'</html>' + CRLF; '</html>' + CRLF;
StreamWrite(S, tmp); StreamWrite(S, tmp);
Mainform.ProgressBarStatus.Visible := False; Mainform.ProgressBarStatus.Visible := False;
Mainform.ShowStatusMsg(STATUS_MSG_READY); Mainform.ShowStatusMsg;
end; end;
@ -776,7 +776,7 @@ begin
end; end;
end; end;
Mainform.ProgressBarStatus.Visible := False; Mainform.ProgressBarStatus.Visible := False;
Mainform.ShowStatusMsg(STATUS_MSG_READY); Mainform.ShowStatusMsg;
end; end;
@ -859,7 +859,7 @@ begin
tmp := '</table>' + CRLF; tmp := '</table>' + CRLF;
StreamWrite(S, tmp); StreamWrite(S, tmp);
Mainform.ProgressBarStatus.Visible := False; Mainform.ProgressBarStatus.Visible := False;
Mainform.ShowStatusMsg(STATUS_MSG_READY); Mainform.ShowStatusMsg;
end; end;
@ -942,7 +942,7 @@ begin
tmp := CRLF; tmp := CRLF;
StreamWrite(S, tmp); StreamWrite(S, tmp);
Mainform.ProgressBarStatus.Visible := False; Mainform.ProgressBarStatus.Visible := False;
Mainform.ShowStatusMsg(STATUS_MSG_READY); Mainform.ShowStatusMsg;
end; end;

View File

@ -981,7 +981,7 @@ procedure TMainForm.ShowStatusMsg(Msg: String=''; PanelNr: Integer=6);
begin begin
// Show message in some statusbar panel // Show message in some statusbar panel
if (PanelNr = 6) and (Msg = '') then if (PanelNr = 6) and (Msg = '') then
Msg := STATUS_MSG_READY; Msg := SIdle;
StatusBar.Panels[PanelNr].Text := Msg; StatusBar.Panels[PanelNr].Text := Msg;
StatusBar.Repaint; StatusBar.Repaint;
end; end;
@ -998,7 +998,7 @@ begin
2: ImageIndex := 149; 2: ImageIndex := 149;
3: ImageIndex := 1; 3: ImageIndex := 1;
6: begin 6: begin
if Panel.Text = STATUS_MSG_READY then if Panel.Text = SIdle then
ImageIndex := 151 ImageIndex := 151
else else
ImageIndex := 150; ImageIndex := 150;
@ -1742,7 +1742,7 @@ begin
// Place menuitem on menu // Place menuitem on menu
miFunction.OnClick := insertFunction; miFunction.OnClick := insertFunction;
end else begin end else begin
miFunction.Hint := miFunction.Hint + ' - ('+STR_NOTSUPPORTED+', needs >= '+Connection.ConvertServerVersion(MySqlFunctions[j].Version)+')'; miFunction.Hint := miFunction.Hint + ' - ('+SUnsupported+', needs >= '+Connection.ConvertServerVersion(MySqlFunctions[j].Version)+')';
miFunction.Enabled := False; miFunction.Enabled := False;
end; end;
// Prevent generating a seperator for ShortHint and LongHint // Prevent generating a seperator for ShortHint and LongHint
@ -2209,7 +2209,7 @@ begin
if QueryTab.tabsetQuery.Tabs.Count > 0 then if QueryTab.tabsetQuery.Tabs.Count > 0 then
QueryTab.tabsetQuery.TabIndex := 0; QueryTab.tabsetQuery.TabIndex := 0;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
ShowStatusMsg( STATUS_MSG_READY ); ShowStatusMsg;
end; end;
@ -2231,7 +2231,7 @@ begin
// Ensure controls are in a valid state // Ensure controls are in a valid state
ValidateControls(Sender); ValidateControls(Sender);
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
ShowStatusMsg( STATUS_MSG_READY ); ShowStatusMsg;
end; end;
@ -2261,7 +2261,7 @@ begin
finally finally
ShowStatusMsg('Freeing data...'); ShowStatusMsg('Freeing data...');
S.Free; S.Free;
ShowStatusMsg(STATUS_MSG_READY); ShowStatusMsg;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end; end;
end; end;
@ -2280,7 +2280,7 @@ begin
finally finally
ShowStatusMsg('Freeing data...'); ShowStatusMsg('Freeing data...');
S.Free; S.Free;
ShowStatusMsg(STATUS_MSG_READY); ShowStatusMsg;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end; end;
end; end;
@ -2299,7 +2299,7 @@ begin
finally finally
ShowStatusMsg('Freeing data...'); ShowStatusMsg('Freeing data...');
S.Free; S.Free;
ShowStatusMsg(STATUS_MSG_READY); ShowStatusMsg;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end; end;
end; end;
@ -2325,7 +2325,7 @@ begin
finally finally
ShowStatusMsg('Freeing data...'); ShowStatusMsg('Freeing data...');
S.Free; S.Free;
ShowStatusMsg(STATUS_MSG_READY); ShowStatusMsg;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end; end;
end; end;
@ -2352,7 +2352,7 @@ begin
ShowStatusMsg('Freeing data...'); ShowStatusMsg('Freeing data...');
FS.Free; FS.Free;
finally finally
ShowStatusMsg(STATUS_MSG_READY); ShowStatusMsg;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end; end;
end; end;
@ -2410,7 +2410,7 @@ begin
ShellExec(Filename); ShellExec(Filename);
end; end;
ShowStatusMsg( STATUS_MSG_READY ); ShowStatusMsg;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end; end;
@ -2577,7 +2577,7 @@ begin
Connection := ConnectionAttempt; Connection := ConnectionAttempt;
SessionName := Session; SessionName := Session;
end; end;
ShowStatusMsg( STATUS_MSG_READY ); ShowStatusMsg;
end; end;
@ -2828,7 +2828,7 @@ begin
SearchReplaceDialog.Options SearchReplaceDialog.Options
); );
SearchReplaceDialog.Editor.EndUpdate; SearchReplaceDialog.Editor.EndUpdate;
ShowStatusMsg(STATUS_MSG_READY); ShowStatusMsg;
if ssoReplaceAll in SearchReplaceDialog.Options then if ssoReplaceAll in SearchReplaceDialog.Options then
ShowStatusMsg('Text "'+SearchReplaceDialog.comboSearch.Text+'" '+FormatNumber(Occurences)+' times replaced.', 0) ShowStatusMsg('Text "'+SearchReplaceDialog.comboSearch.Text+'" '+FormatNumber(Occurences)+' times replaced.', 0)
else begin else begin
@ -3765,7 +3765,7 @@ begin
vt.Tag := VTREE_LOADED; vt.Tag := VTREE_LOADED;
DataGridFullRowMode := False; DataGridFullRowMode := False;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
ShowStatusMsg(STATUS_MSG_READY); ShowStatusMsg;
end; end;
@ -3943,7 +3943,7 @@ begin
Msg := Msg + ')'; Msg := Msg + ')';
end; end;
ShowStatusMsg(Msg, 0); ShowStatusMsg(Msg, 0);
ShowStatusMsg(STATUS_MSG_READY); ShowStatusMsg;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
// Ensure tree db node displays its chidren initialized // Ensure tree db node displays its chidren initialized
DBtree.ReinitChildren(FindDBNode(ActiveDatabase), False); DBtree.ReinitChildren(FindDBNode(ActiveDatabase), False);
@ -4747,7 +4747,7 @@ begin
if Connection.ServerVersionInt >= 40003 then if Connection.ServerVersionInt >= 40003 then
menuEditVariable.Enabled := (PageControlHost.ActivePage = tabVariables) and Assigned(ListVariables.FocusedNode) menuEditVariable.Enabled := (PageControlHost.ActivePage = tabVariables) and Assigned(ListVariables.FocusedNode)
else else
menuEditVariable.Hint := STR_NOTSUPPORTED; menuEditVariable.Hint := SUnsupported;
end; end;
procedure TMainForm.Saveastextfile1Click(Sender: TObject); procedure TMainForm.Saveastextfile1Click(Sender: TObject);
@ -5068,7 +5068,7 @@ begin
Item.OnClick := QuickFilterClick; Item.OnClick := QuickFilterClick;
Data.Next; Data.Next;
end; end;
ShowStatusMsg(STATUS_MSG_READY); ShowStatusMsg;
end; end;
@ -6319,7 +6319,7 @@ begin
MessageDlg(E.Message+CRLF+CRLF+'You have no privilege to execute SHOW DATABASES. Please specify one or more databases in your session settings, if you want to see any.', mtError, [mbOK], 0); MessageDlg(E.Message+CRLF+CRLF+'You have no privilege to execute SHOW DATABASES. Please specify one or more databases in your session settings, if you want to see any.', mtError, [mbOK], 0);
end; end;
end; end;
ShowStatusMsg(STATUS_MSG_READY); ShowStatusMsg;
VT.Tag := VTREE_LOADED; VT.Tag := VTREE_LOADED;
InvalidateVT(ListDatabases, VTREE_NOTLOADED, False); InvalidateVT(ListDatabases, VTREE_NOTLOADED, False);
ChildCount := AllDatabases.Count; ChildCount := AllDatabases.Count;
@ -6332,7 +6332,7 @@ begin
try try
ChildCount := Connection.GetDBObjects(AllDatabases[Node.Index]).Count; ChildCount := Connection.GetDBObjects(AllDatabases[Node.Index]).Count;
finally finally
ShowStatusMsg( STATUS_MSG_READY ); ShowStatusMsg;
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end; end;
end; end;
@ -9002,7 +9002,7 @@ procedure TMainForm.AnyGridEndOperation(Sender: TBaseVirtualTree; OperationKind:
begin begin
// Reset status message after long running operations // Reset status message after long running operations
if OperationKind = okSortTree then if OperationKind = okSortTree then
ShowStatusMsg(STATUS_MSG_READY); ShowStatusMsg;
end; end;

View File

@ -270,7 +270,7 @@ begin
if idx = -1 then idx := 0; if idx = -1 then idx := 0;
comboOperation.Items.CommaText := 'Check,Analyze,Checksum,Optimize,Repair'; comboOperation.Items.CommaText := 'Check,Analyze,Checksum,Optimize,Repair';
if Mainform.Connection.ServerVersionInt < 40101 then if Mainform.Connection.ServerVersionInt < 40101 then
comboOperation.Items.Text := StringReplace(comboOperation.Items.Text, 'Checksum', 'Checksum ('+STR_NOTSUPPORTED+')', [rfReplaceAll]); comboOperation.Items.Text := StringReplace(comboOperation.Items.Text, 'Checksum', 'Checksum ('+SUnsupported+')', [rfReplaceAll]);
comboOperation.ItemIndex := idx; comboOperation.ItemIndex := idx;
comboOperation.OnChange(Sender); comboOperation.OnChange(Sender);
@ -329,7 +329,7 @@ begin
SomeChecked := TreeObjects.CheckedCount > 0; SomeChecked := TreeObjects.CheckedCount > 0;
if tabsTools.ActivePage = tabMaintenance then begin if tabsTools.ActivePage = tabMaintenance then begin
btnExecute.Caption := 'Execute'; btnExecute.Caption := 'Execute';
btnExecute.Enabled := (Pos(STR_NOTSUPPORTED, comboOperation.Text) = 0) and SomeChecked; btnExecute.Enabled := (Pos(SUnsupported, comboOperation.Text) = 0) and SomeChecked;
// Only enable available options // Only enable available options
op := LowerCase(comboOperation.Text); op := LowerCase(comboOperation.Text);
chkQuick.Enabled := (op = 'check') or (op = 'checksum') or (op = 'repair'); chkQuick.Enabled := (op = 'check') or (op = 'checksum') or (op = 'repair');