Skip to content

Commit

Permalink
Removed previous settings the font for grid and font for SQL editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdochoa committed Nov 24, 2023
1 parent 17f49fb commit 4ca4102
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 82 deletions.
12 changes: 1 addition & 11 deletions conf-defs/fr_settings.confdef
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@
<description>SQL Style Editor </description>
<image>0</image>
<setting type="themecombobox">
<caption>Select primary theme:</caption>
<caption> </caption>
<description>Select the file with the primary style</description>
<key>StyleTheme</key>
<default>styles</default>
Expand Down Expand Up @@ -444,16 +444,6 @@
<caption>Append time zone name.</caption>
</option>
</setting>
<setting type="font">
<caption>Grid header font:</caption>
<key>DataGridHeaderFont</key>
<aligngroup>1</aligngroup>
</setting>
<setting type="font">
<caption>Grid cell font:</caption>
<key>DataGridFont</key>
<aligngroup>1</aligngroup>
</setting>
<setting type="checkbox">
<caption>Re-format float and double precision numbers</caption>
<description>If unchecked, prints decimal numbers as returned from server</description>
Expand Down
3 changes: 0 additions & 3 deletions src/gui/CommandIds.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ enum {
View_Data,
View_SplitView,
View_Wrap_long_lines,
View_Set_editor_font,
Find_Selected_Object,

// SQL History
Expand Down Expand Up @@ -72,8 +71,6 @@ enum {
DataGrid_Copy_as_upins,
DataGrid_Save_as_html,
DataGrid_Save_as_csv,
DataGrid_Set_header_font,
DataGrid_Set_cell_font,
DataGrid_Log_changes,

Menu_RegisterServer = 600,
Expand Down
22 changes: 0 additions & 22 deletions src/gui/ExecuteSqlFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,6 @@ void ExecuteSqlFrame::buildMainMenu(CommandManager& cm)
viewMenu->AppendCheckItem(Cmds::View_SplitView,
cm.getMainMenuItemText(_("&Split view"), Cmds::View_SplitView));
viewMenu->AppendSeparator();
viewMenu->Append(Cmds::View_Set_editor_font, _("Set editor &font"));
viewMenu->AppendSeparator();
viewMenu->AppendCheckItem(Cmds::View_Wrap_long_lines,
_("&Wrap long lines"));
menuBarM->Append(viewMenu, _("&View"));
Expand Down Expand Up @@ -792,9 +790,6 @@ void ExecuteSqlFrame::buildMainMenu(CommandManager& cm)
gridMenu->Append(Cmds::DataGrid_Save_as_html, _("Save as &html"));
gridMenu->Append(Cmds::DataGrid_Save_as_csv, _("Save as cs&v"));
gridMenu->AppendSeparator();
gridMenu->Append(Cmds::DataGrid_Set_header_font, _("Set h&eader font"));
gridMenu->Append(Cmds::DataGrid_Set_cell_font, _("Set cell f&ont"));
gridMenu->AppendSeparator();
gridMenu->AppendCheckItem(Cmds::DataGrid_Log_changes, _("&Log data changes"));
menuBarM->Append(gridMenu, _("&Grid"));

Expand Down Expand Up @@ -948,7 +943,6 @@ BEGIN_EVENT_TABLE(ExecuteSqlFrame, wxFrame)
EVT_UPDATE_UI(Cmds::View_Data, ExecuteSqlFrame::OnMenuUpdateSelectView)
EVT_MENU(Cmds::View_SplitView, ExecuteSqlFrame::OnMenuSplitView)
EVT_UPDATE_UI(Cmds::View_SplitView, ExecuteSqlFrame::OnMenuUpdateSplitView)
EVT_MENU(Cmds::View_Set_editor_font, ExecuteSqlFrame::OnMenuSetEditorFont)
EVT_MENU(Cmds::View_Wrap_long_lines, ExecuteSqlFrame::OnMenuToggleWrap)

EVT_MENU(Cmds::Find_Selected_Object, ExecuteSqlFrame::OnMenuFindSelectedObject)
Expand Down Expand Up @@ -993,8 +987,6 @@ BEGIN_EVENT_TABLE(ExecuteSqlFrame, wxFrame)
EVT_MENU(Cmds::DataGrid_ExportBlob, ExecuteSqlFrame::OnMenuGridExportBlob)
EVT_MENU(Cmds::DataGrid_Save_as_html, ExecuteSqlFrame::OnMenuGridSaveAsHtml)
EVT_MENU(Cmds::DataGrid_Save_as_csv, ExecuteSqlFrame::OnMenuGridSaveAsCsv)
EVT_MENU(Cmds::DataGrid_Set_header_font, ExecuteSqlFrame::OnMenuGridGridHeaderFont)
EVT_MENU(Cmds::DataGrid_Set_cell_font, ExecuteSqlFrame::OnMenuGridGridCellFont)
EVT_MENU(Cmds::DataGrid_FetchAll, ExecuteSqlFrame::OnMenuGridFetchAll)
EVT_MENU(Cmds::DataGrid_CancelFetchAll, ExecuteSqlFrame::OnMenuGridCancelFetchAll)

Expand Down Expand Up @@ -1561,11 +1553,6 @@ void ExecuteSqlFrame::OnMenuUpdateSplitView(wxUpdateUIEvent& event)
event.Check(splitter_window_1->IsSplit());
}

void ExecuteSqlFrame::OnMenuSetEditorFont(wxCommandEvent& WXUNUSED(event))
{
styled_text_ctrl_sql->setFont();
}

void ExecuteSqlFrame::OnMenuToggleWrap(wxCommandEvent& WXUNUSED(event))
{
const int mode = styled_text_ctrl_sql->GetWrapMode();
Expand Down Expand Up @@ -1995,15 +1982,6 @@ void ExecuteSqlFrame::OnMenuGridSaveAsCsv(wxCommandEvent& WXUNUSED(event))
grid_data->saveAsCSV(fileName, fieldDelimiter, textDelimiter);
}

void ExecuteSqlFrame::OnMenuGridGridHeaderFont(wxCommandEvent& WXUNUSED(event))
{
grid_data->setHeaderFont();
}

void ExecuteSqlFrame::OnMenuGridGridCellFont(wxCommandEvent& WXUNUSED(event))
{
grid_data->setCellFont();
}

void ExecuteSqlFrame::OnMenuUpdateGridHasSelection(wxUpdateUIEvent& event)
{
Expand Down
3 changes: 0 additions & 3 deletions src/gui/ExecuteSqlFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ class ExecuteSqlFrame: public BaseFrame, public Observer
void OnMenuUpdateSelectView(wxUpdateUIEvent& event);
void OnMenuSplitView(wxCommandEvent& event);
void OnMenuUpdateSplitView(wxUpdateUIEvent& event);
void OnMenuSetEditorFont(wxCommandEvent& event);
void OnMenuToggleWrap(wxCommandEvent& event);

void OnMenuHistoryNext(wxCommandEvent& event);
Expand Down Expand Up @@ -244,8 +243,6 @@ class ExecuteSqlFrame: public BaseFrame, public Observer
void OnMenuGridCopyAsUpdateInsert(wxCommandEvent& event);
void OnMenuGridSaveAsHtml(wxCommandEvent& event);
void OnMenuGridSaveAsCsv(wxCommandEvent& event);
void OnMenuGridGridHeaderFont(wxCommandEvent& event);
void OnMenuGridGridCellFont(wxCommandEvent& event);
void OnMenuGridFetchAll(wxCommandEvent& event);
void OnMenuGridCancelFetchAll(wxCommandEvent& event);
void OnMenuUpdateGridHasSelection(wxUpdateUIEvent& event);
Expand Down
43 changes: 2 additions & 41 deletions src/gui/controls/DataGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,6 @@ void DataGrid::showPopupMenu(wxPoint cursorPos)
m.Append(Cmds::DataGrid_SetFieldToNULL, _("Set field to NULL"));
m.AppendSeparator();

m.Append(Cmds::DataGrid_Set_header_font, _("Set header font"));
m.Append(Cmds::DataGrid_Set_cell_font, _("Set cell font"));
PopupMenu(&m, cursorPos);
}

Expand Down Expand Up @@ -243,17 +241,6 @@ void DataGrid::refreshAndInvalidateAttributes()
Refresh();
}

void DataGrid::setCellFont()
{
wxFont f = ::wxGetFontFromUser(this, GetDefaultCellFont());
if (f.Ok())
{
SetDefaultCellFont(f);
config().setValue("DataGridFont", f.GetNativeFontInfoDesc());
updateRowHeights();
ForceRefresh();
}
}

void DataGrid::copyToClipboard(bool headers)
{
Expand Down Expand Up @@ -682,19 +669,6 @@ void DataGrid::copyToClipboardAsUpdateInsert()
if (all)
notifyIfUnfetchedData();
}
void DataGrid::setHeaderFont()
{
wxFont f = ::wxGetFontFromUser(this, GetLabelFont());
if (f.Ok())
{
SetLabelFont(f);
config().setValue("DataGridHeaderFont",
f.GetNativeFontInfoDesc());
updateRowHeights();
AutoSizeColumns(false);
ForceRefresh();
}
}

void DataGrid::saveAsCSV(const wxString& fileName,
const wxChar& fieldDelimiter, const wxChar& textDelimiter)
Expand Down Expand Up @@ -1227,23 +1201,10 @@ void DataGrid::setupStyles()

SetCellHighlightColour(stylerManager().getDefaultStyle()->getfgColor());

wxString s;
wxFont f;

SetDefaultCellFont(stylerManager().getDefaultStyle()->getFont());
/*if (config().getValue("DataGridFont", s) && !s.empty())
{
f.SetNativeFontInfo(s);
if (f.Ok())
SetDefaultCellFont(f);
}*/

SetLabelFont(stylerManager().getDefaultStyle()->getFont());
if (config().getValue("DataGridHeaderFont", s) && !s.empty())
{
f.SetNativeFontInfo(s);
if (f.Ok())
SetLabelFont(f);
}

updateRowHeights();
ForceRefresh();
}
2 changes: 0 additions & 2 deletions src/gui/controls/DataGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ class DataGrid: public wxGrid
const wxChar& fieldDelimiter, const wxChar& textDelimiter);

void refreshAndInvalidateAttributes();
void setHeaderFont();
void setCellFont();

void cancelFetchAll();
void fetchAll();
Expand Down

0 comments on commit 4ca4102

Please sign in to comment.