diff --git a/dlg/dlgProperty.cpp b/dlg/dlgProperty.cpp index a89a139..b646153 100644 --- a/dlg/dlgProperty.cpp +++ b/dlg/dlgProperty.cpp @@ -2262,7 +2262,7 @@ propertyFactory::propertyFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuTool else context = false; if (toolbar) - toolbar->AddTool(id, wxEmptyString, *GetBundleSVG(properties_png_bmp, "properties.svg", wxSize(32, 32)), _("Display/edit the properties of the selected object."), wxITEM_NORMAL); + toolbar->AddTool(id, wxEmptyString, GetBundleSVG(properties_png_bmp, "properties.svg", wxSize(32, 32)), _("Display/edit the properties of the selected object."), wxITEM_NORMAL); } @@ -2285,7 +2285,7 @@ bool propertyFactory::CheckEnable(pgObject *obj) createFactory::createFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar) : actionFactory(list) { mnu->Append(id, _("&Create..."), _("Create a new object of the same type as the selected object.")); - toolbar->AddTool(id, wxEmptyString, *GetBundleSVG(create_png_bmp, "create.svg", wxSize(32, 32)), _("Create a new object of the same type as the selected object."), wxITEM_NORMAL); + toolbar->AddTool(id, wxEmptyString, GetBundleSVG(create_png_bmp, "create.svg", wxSize(32, 32)), _("Create a new object of the same type as the selected object."), wxITEM_NORMAL); } @@ -2308,7 +2308,7 @@ bool createFactory::CheckEnable(pgObject *obj) dropFactory::dropFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar) : contextActionFactory(list) { mnu->Append(id, _("&Delete/Drop...\tDel"), _("Delete/Drop the selected object.")); - toolbar->AddTool(id, wxEmptyString, *GetBundleSVG(drop_png_bmp, "drop.svg", wxSize(32, 32)), _("Drop the currently selected object."), wxITEM_NORMAL); + toolbar->AddTool(id, wxEmptyString, GetBundleSVG(drop_png_bmp, "drop.svg", wxSize(32, 32)), _("Drop the currently selected object."), wxITEM_NORMAL); } @@ -2352,7 +2352,7 @@ refreshFactory::refreshFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolba else context = false; if (toolbar) - toolbar->AddTool(id, wxEmptyString, *GetBundleSVG(refresh_png_bmp,"refresh.svg",wxSize(32,32)), _("Refresh the selected object."), wxITEM_NORMAL); + toolbar->AddTool(id, wxEmptyString, GetBundleSVG(refresh_png_bmp,"refresh.svg",wxSize(32,32)), _("Refresh the selected object."), wxITEM_NORMAL); } diff --git a/frm/frmEditGrid.cpp b/frm/frmEditGrid.cpp index d6bbdaa..ee210d5 100644 --- a/frm/frmEditGrid.cpp +++ b/frm/frmEditGrid.cpp @@ -3343,7 +3343,7 @@ wxWindow *editGridFactoryBase::ViewData(frmMain *form, pgObject *obj, bool filte editGridFactory::editGridFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar) : editGridFactoryBase(list) { mnu->Append(id, _("View &All Rows\tCtrl-D"), _("View the data in the selected object.")); - toolbar->AddTool(id, _("View All Rows\tCtrl-D"), *GetBundleSVG(viewdata_png_bmp, "viewdata.svg", wxSize(32, 32)), _("View the data in the selected object."), wxITEM_NORMAL); + toolbar->AddTool(id, _("View All Rows\tCtrl-D"), GetBundleSVG(viewdata_png_bmp, "viewdata.svg", wxSize(32, 32)), _("View the data in the selected object."), wxITEM_NORMAL); context = false; } @@ -3358,7 +3358,7 @@ wxWindow *editGridFactory::StartDialog(frmMain *form, pgObject *obj) editGridFilteredFactory::editGridFilteredFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar) : editGridFactoryBase(list) { mnu->Append(id, _("View F&iltered Rows...\tCtrl-G"), _("Apply a filter and view the data in the selected object.")); - toolbar->AddTool(id, _("View Filtered Rows\tCtrl-G"), *GetBundleSVG(viewfiltereddata_png_bmp, "viewfiltereddata.svg", wxSize(32, 32)) , _("Apply a filter and view the data in the selected object."), wxITEM_NORMAL); + toolbar->AddTool(id, _("View Filtered Rows\tCtrl-G"), GetBundleSVG(viewfiltereddata_png_bmp, "viewfiltereddata.svg", wxSize(32, 32)) , _("Apply a filter and view the data in the selected object."), wxITEM_NORMAL); context = false; } diff --git a/frm/frmMain.cpp b/frm/frmMain.cpp index a08904d..3c57577 100644 --- a/frm/frmMain.cpp +++ b/frm/frmMain.cpp @@ -290,16 +290,47 @@ frmMain::~frmMain() } #endif } +#include +WX_DECLARE_HASH_MAP(wxString, wxBitmapBundle, wxStringHash, wxStringEqual, MyHash1); +MyHash1 bundleHash; + +wxBitmapBundle GetBundleSVG(wxBitmap* std, wxString name, wxSize sz) { + wxBitmapBundle bb; + wxBitmapBundle *b=NULL; + bb = bundleHash[name]; + if (bb.IsOk()) return bb; -wxBitmapBundle* GetBundleSVG(wxBitmap* std, wxString name, wxSize sz) { - wxBitmapBundle *b; if (wxFile::Exists(loadPath + sepPath +"svg" + sepPath + name)) { - b = new wxBitmapBundle(wxBitmapBundle::FromSVGFile(loadPath + sepPath + "svg" + sepPath + name, sz)); + //b = new wxBitmapBundle(wxBitmapBundle::FromSVGFile(loadPath + sepPath + "svg" + sepPath + name, sz)); + bb=wxBitmapBundle::FromSVGFile(loadPath + sepPath + "svg" + sepPath + name, sz); } - else { - b=new wxBitmapBundle(*std); + else if (wxFile::Exists(name)) { + if (name.AfterLast('.') == "png") { + wxBitmap bitmap(name, wxBITMAP_TYPE_PNG); + if (!bitmap.Ok()) + { + wxMessageBox(wxT("Sorry, could not load png file.\n") + name); + } + else { + bb = wxBitmapBundle::FromBitmap(bitmap); + } + + } + else if (name.AfterLast('.') == "svg") { + bb = wxBitmapBundle::FromSVGFile(name, sz); + } + } - return b; + + if (!bb.IsOk() && std){ + //b=new wxBitmapBundle(*std); + bb = wxBitmapBundle::FromBitmap(*std); + } + + if (bb.IsOk()) bundleHash[name] = bb; else { + wxLogError("Empty bundle for %s",name); + } + return bb; } void frmMain::CreateMenus() @@ -1495,7 +1526,7 @@ pgsqlHelpFactory::pgsqlHelpFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuTo if (toolbar) { if (bigIcon) - toolbar->AddTool(id, wxEmptyString, *GetBundleSVG(help2_png_bmp, "help2.svg", wxSize(32, 32)), _("Display help on SQL commands.")); + toolbar->AddTool(id, wxEmptyString, GetBundleSVG(help2_png_bmp, "help2.svg", wxSize(32, 32)), _("Display help on SQL commands.")); else toolbar->AddTool(id, wxEmptyString, *help_png_bmp, _("Display help on SQL commands.")); } diff --git a/frm/frmMaintenance.cpp b/frm/frmMaintenance.cpp index 72a2842..f70555b 100644 --- a/frm/frmMaintenance.cpp +++ b/frm/frmMaintenance.cpp @@ -295,7 +295,7 @@ void frmMaintenance::Go() maintenanceFactory::maintenanceFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar) : contextActionFactory(list) { mnu->Append(id, _("&Maintenance..."), _("Maintain the current database or table.")); - toolbar->AddTool(id, wxEmptyString, *GetBundleSVG(vacuum_png_bmp, "vacuum.svg", wxSize(32, 32)), _("Maintain the current database or table."), wxITEM_NORMAL); + toolbar->AddTool(id, wxEmptyString, GetBundleSVG(vacuum_png_bmp, "vacuum.svg", wxSize(32, 32)), _("Maintain the current database or table."), wxITEM_NORMAL); } diff --git a/frm/frmQuery.cpp b/frm/frmQuery.cpp index 5b8e307..070fb89 100644 --- a/frm/frmQuery.cpp +++ b/frm/frmQuery.cpp @@ -266,10 +266,24 @@ void frmQuery::seticon() if (!wxFileExists(f)) f = ""; } } + if (f.empty()) { + f = tempDir + host + "_" + db + wxT(".svg"); + if (!wxFileExists(f)) { + f = tempDir + host + wxT(".svg"); + if (!wxFileExists(f)) { + f = tempDir + db + wxT(".svg"); + if (!wxFileExists(f)) f = ""; + } + } + } while (!f.empty()) { wxIcon* ico = new wxIcon(); - wxBitmap bitmap(f, wxBITMAP_TYPE_PNG); + wxBitmapBundle bb = GetBundleSVG(NULL, f, wxSize(32, 32)); + wxBitmap bitmap = bb.GetBitmap(wxSize(32, 32)); + + //wxBitmap bitmap(f, wxBITMAP_TYPE_PNG); + if (!bitmap.Ok()) { wxMessageBox(wxT("Sorry, could not load png file.\n")+f); @@ -277,6 +291,7 @@ void frmQuery::seticon() ico->CopyFromBitmap(bitmap); //SetIcon(*sql_32_png_ico); SetIcon(*ico); + delete ico; return; //f = wxFindNextFile(); } @@ -306,6 +321,8 @@ void frmQuery::seticon() ico->CopyFromBitmap(*bmp); //SetIcon(*sql_32_png_ico); SetIcon(*ico); + delete ico; + delete bmp; } } frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const wxString &query, const wxString &file) @@ -328,7 +345,7 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w dlgName = wxT("frmQuery"); recentKey = wxT("RecentFiles"); RestorePosition(100, 100, 600, 500, 450, 300); - + wxLogInfo(wxT("frmQuery::Create window")); explainCanvas = NULL; // notify wxAUI which frame to use @@ -506,7 +523,7 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w mapping["MNU_DOROLLBACK"] = MNU_DOROLLBACK; mapping["MNU_DOCOMMIT"] = MNU_DOCOMMIT; wxString tempDir = wxStandardPaths::Get().GetUserConfigDir() +wxFileName::GetPathSeparator()+"postgresql"+wxFileName::GetPathSeparator()+"keymap.txt"; - + wxLogInfo(wxT("frmQuery::Create key map ...")); int idx = 0; if (wxFileName::FileExists(tempDir) ) { @@ -570,7 +587,7 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w wxAcceleratorTable accel(idx, entries); SetAcceleratorTable(accel); - + wxLogInfo(wxT("frmQuery::Create key map Ok")); queryMenu->Enable(MNU_CANCEL, false); int iWidths[7] = {0, -1, 40, 200, 80, 80, 80}; @@ -582,35 +599,36 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w toolBar = new ctlMenuToolbar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_NODIVIDER); //toolBar->SetToolBitmapSize(wxSize(22, 22)); - - toolBar->AddTool(MNU_NEWSQLTAB, wxEmptyString, *GetBundleSVG(file_new_png_bmp, "file_new.svg", wxSize(16, 16)), _("New SQL tab"), wxITEM_NORMAL); - toolBar->AddTool(MNU_OPEN, wxEmptyString, *GetBundleSVG(file_open_png_bmp, "file_open.svg", wxSize(16, 16)) , _("Open file"), wxITEM_NORMAL); - toolBar->AddTool(MNU_SAVE, wxEmptyString, *GetBundleSVG(file_save_png_bmp, "file_save.svg", wxSize(16, 16)) , _("Save file"), wxITEM_NORMAL); + wxLogInfo(wxT("frmQuery::Create tool bar ..")); + toolBar->AddTool(MNU_NEWSQLTAB, wxEmptyString, GetBundleSVG(file_new_png_bmp, "file_new.svg", wxSize(16, 16)), _("New SQL tab"), wxITEM_NORMAL); + toolBar->AddTool(MNU_OPEN, wxEmptyString, GetBundleSVG(file_open_png_bmp, "file_open.svg", wxSize(16, 16)) , _("Open file"), wxITEM_NORMAL); + toolBar->AddTool(MNU_SAVE, wxEmptyString, GetBundleSVG(file_save_png_bmp, "file_save.svg", wxSize(16, 16)) , _("Save file"), wxITEM_NORMAL); toolBar->AddSeparator(); - toolBar->AddTool(MNU_CUT, wxEmptyString, *GetBundleSVG(clip_cut_png_bmp, "clip_cut.svg", wxSize(16, 16)) , _("Cut selected text to clipboard"), wxITEM_NORMAL); - toolBar->AddTool(MNU_COPY, wxEmptyString, *GetBundleSVG(clip_copy_png_bmp, "clip_copy.svg", wxSize(16, 16)), _("Copy selected text to clipboard"), wxITEM_NORMAL); - toolBar->AddTool(MNU_PASTE, wxEmptyString, *GetBundleSVG(clip_paste_png_bmp, "clip_paste.svg", wxSize(16, 16)), _("Paste selected text from clipboard"), wxITEM_NORMAL); - toolBar->AddTool(MNU_CLEAR, wxEmptyString, *GetBundleSVG(edit_clear_png_bmp, "edit_clear.svg", wxSize(16, 16)), _("Clear edit window"), wxITEM_NORMAL); + toolBar->AddTool(MNU_CUT, wxEmptyString, GetBundleSVG(clip_cut_png_bmp, "clip_cut.svg", wxSize(16, 16)) , _("Cut selected text to clipboard"), wxITEM_NORMAL); + toolBar->AddTool(MNU_COPY, wxEmptyString, GetBundleSVG(clip_copy_png_bmp, "clip_copy.svg", wxSize(16, 16)), _("Copy selected text to clipboard"), wxITEM_NORMAL); + toolBar->AddTool(MNU_PASTE, wxEmptyString, GetBundleSVG(clip_paste_png_bmp, "clip_paste.svg", wxSize(16, 16)), _("Paste selected text from clipboard"), wxITEM_NORMAL); + toolBar->AddTool(MNU_CLEAR, wxEmptyString, GetBundleSVG(edit_clear_png_bmp, "edit_clear.svg", wxSize(16, 16)), _("Clear edit window"), wxITEM_NORMAL); toolBar->AddSeparator(); - toolBar->AddTool(MNU_UNDO, wxEmptyString, *GetBundleSVG(edit_undo_png_bmp, "edit_undo.svg", wxSize(16, 16)), _("Undo last action"), wxITEM_NORMAL); - toolBar->AddTool(MNU_REDO, wxEmptyString, *GetBundleSVG(edit_redo_png_bmp, "edit_redo.svg", wxSize(16, 16)), _("Redo last action"), wxITEM_NORMAL); + toolBar->AddTool(MNU_UNDO, wxEmptyString, GetBundleSVG(edit_undo_png_bmp, "edit_undo.svg", wxSize(16, 16)), _("Undo last action"), wxITEM_NORMAL); + toolBar->AddTool(MNU_REDO, wxEmptyString, GetBundleSVG(edit_redo_png_bmp, "edit_redo.svg", wxSize(16, 16)), _("Redo last action"), wxITEM_NORMAL); toolBar->AddSeparator(); - toolBar->AddTool(MNU_FIND, wxEmptyString, *GetBundleSVG(edit_find_png_bmp, "edit_find.svg", wxSize(16, 16)), _("Find and replace text"), wxITEM_NORMAL); + toolBar->AddTool(MNU_FIND, wxEmptyString, GetBundleSVG(edit_find_png_bmp, "edit_find.svg", wxSize(16, 16)), _("Find and replace text"), wxITEM_NORMAL); toolBar->AddSeparator(); - toolBar->AddTool(MNU_EXECUTE, wxEmptyString, *GetBundleSVG(query_execute_png_bmp, "query_execute.svg", wxSize(16, 16)), _("Execute query"), wxITEM_NORMAL); - toolBar->AddTool(MNU_EXECPGS, wxEmptyString, *GetBundleSVG(query_pgscript_png_bmp, "query_pgscript.svg", wxSize(16, 16)), _("Execute pgScript"), wxITEM_NORMAL); - toolBar->AddTool(MNU_EXECFILE, wxEmptyString, *GetBundleSVG(query_execfile_png_bmp, "query_execfile.svg", wxSize(16, 16)), _("Execute query, write result to file"), wxITEM_NORMAL); - toolBar->AddTool(MNU_EXPLAIN, wxEmptyString, *GetBundleSVG(query_explain_png_bmp, "query_explain.svg", wxSize(16, 16)), _("Explain query"), wxITEM_NORMAL); - toolBar->AddTool(MNU_CANCEL, wxEmptyString, *GetBundleSVG(query_cancel_png_bmp, "query_cancel.svg", wxSize(16, 16)), _("Cancel query"), wxITEM_NORMAL); + toolBar->AddTool(MNU_EXECUTE, wxEmptyString, GetBundleSVG(query_execute_png_bmp, "query_execute.svg", wxSize(16, 16)), _("Execute query"), wxITEM_NORMAL); + toolBar->AddTool(MNU_EXECPGS, wxEmptyString, GetBundleSVG(query_pgscript_png_bmp, "query_pgscript.svg", wxSize(16, 16)), _("Execute pgScript"), wxITEM_NORMAL); + toolBar->AddTool(MNU_EXECFILE, wxEmptyString, GetBundleSVG(query_execfile_png_bmp, "query_execfile.svg", wxSize(16, 16)), _("Execute query, write result to file"), wxITEM_NORMAL); + toolBar->AddTool(MNU_EXPLAIN, wxEmptyString, GetBundleSVG(query_explain_png_bmp, "query_explain.svg", wxSize(16, 16)), _("Explain query"), wxITEM_NORMAL); + toolBar->AddTool(MNU_CANCEL, wxEmptyString, GetBundleSVG(query_cancel_png_bmp, "query_cancel.svg", wxSize(16, 16)), _("Cancel query"), wxITEM_NORMAL); toolBar->AddSeparator(); - toolBar->AddTool(MNU_DOCOMMIT, wxEmptyString, *GetBundleSVG(query_commit_png_bmp, "query_commit.svg", wxSize(16, 16)), _("Commit"), wxITEM_NORMAL); - toolBar->AddTool(MNU_DOROLLBACK, wxEmptyString, *GetBundleSVG(query_rollback_png_bmp, "query_rollback.svg", wxSize(16, 16)), _("Rollback"), wxITEM_NORMAL); + toolBar->AddTool(MNU_DOCOMMIT, wxEmptyString, GetBundleSVG(query_commit_png_bmp, "query_commit.svg", wxSize(16, 16)), _("Commit"), wxITEM_NORMAL); + toolBar->AddTool(MNU_DOROLLBACK, wxEmptyString, GetBundleSVG(query_rollback_png_bmp, "query_rollback.svg", wxSize(16, 16)), _("Rollback"), wxITEM_NORMAL); toolBar->AddSeparator(); - toolBar->AddTool(MNU_HELP, wxEmptyString, *GetBundleSVG(help_png_bmp, "help.svg", wxSize(16, 16)), _("Display help on SQL commands."), wxITEM_NORMAL); + toolBar->AddTool(MNU_HELP, wxEmptyString, GetBundleSVG(help_png_bmp, "help.svg", wxSize(16, 16)), _("Display help on SQL commands."), wxITEM_NORMAL); toolBar->Realize(); + wxLogInfo(wxT("frmQuery::Create tool bar Ok")); wxSize toolw = toolBar->GetBestSize(); // Add the database selection bar cbConnection = new wxBitmapComboBox(this, CTRLID_CONNECTION, wxEmptyString, wxDefaultPosition, wxSize(-1, -1), wxArrayString(), wxCB_READONLY | wxCB_DROPDOWN); @@ -866,7 +884,7 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w filename = f.AfterLast(sepPath).BeforeLast('.'); if (filename.BeforeFirst('.') == "_active") { activePage.Add(filename.AfterFirst('.')); - //wxLogInfo(wxT("frmQuery::_active file marker: name=[%s] pref=[%s]"), filename.AfterFirst('.'), pref); + wxLogInfo(wxT("frmQuery::_active file marker: name=[%s] pref=[%s]"), filename.AfterFirst('.'), pref); } f = wxFindNextFile(); } @@ -905,7 +923,7 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w setExtendedTitle(); SqlBookUpdatePageTitle(); SaveTempFile(); - + wxLogInfo(wxT("frmQuery::Create tab name=[%s]"), filename); } } @@ -4859,8 +4877,8 @@ bool queryToolDataFactory::CheckEnable(pgObject *obj) queryToolFactory::queryToolFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar) : queryToolBaseFactory(list) { mnu->Append(id, _("&Query tool\tCtrl-E"), _("Execute arbitrary SQL queries.")); - toolbar->AddTool(id, wxEmptyString, *GetBundleSVG(sql_32_png_bmp, "sql_32.svg", wxSize(32, 32)), _("Execute arbitrary SQL queries."), wxITEM_NORMAL); - //toolbar->AddTool(id, wxEmptyString, *GetBundleSVG(sql_32_png_bmp, "plugins.svg", wxSize(32, 32)), _("Execute arbitrary SQL queries."), wxITEM_NORMAL); + toolbar->AddTool(id, wxEmptyString, GetBundleSVG(sql_32_png_bmp, "sql_32.svg", wxSize(32, 32)), _("Execute arbitrary SQL queries."), wxITEM_NORMAL); + //toolbar->AddTool(id, wxEmptyString, GetBundleSVG(sql_32_png_bmp, "plugins.svg", wxSize(32, 32)), _("Execute arbitrary SQL queries."), wxITEM_NORMAL); } @@ -4877,7 +4895,7 @@ queryToolSqlFactory::queryToolSqlFactory(menuFactoryList *list, wxMenu *mnu, ctl { mnu->Append(id, _("CREATE Script"), _("Start Query tool with CREATE script.")); if (toolbar) - toolbar->AddTool(id, wxEmptyString, *GetBundleSVG(sql_32_png_bmp, "sql_32.svg", wxSize(32, 32)), _("Start query tool with CREATE script."), wxITEM_NORMAL); + toolbar->AddTool(id, wxEmptyString, GetBundleSVG(sql_32_png_bmp, "sql_32.svg", wxSize(32, 32)), _("Start query tool with CREATE script."), wxITEM_NORMAL); } diff --git a/frm/frmStatus.cpp b/frm/frmStatus.cpp index b1e842e..c96043b 100644 --- a/frm/frmStatus.cpp +++ b/frm/frmStatus.cpp @@ -315,17 +315,17 @@ frmStatus::frmStatus(frmMain *form, const wxString &_title, pgConn *conn) : pgFr // Set up toolbar toolBar = new ctlMenuToolbar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_NODIVIDER); toolBar->SetToolBitmapSize(FromDIP(wxSize(32, 32))); - toolBar->AddTool(MNU_REFRESH, wxEmptyString, *GetBundleSVG(readdata_png_bmp, "refresh.svg", wxSize(16, 16)), _("Refresh"), wxITEM_NORMAL); + toolBar->AddTool(MNU_REFRESH, wxEmptyString, GetBundleSVG(readdata_png_bmp, "refresh.svg", wxSize(16, 16)), _("Refresh"), wxITEM_NORMAL); toolBar->AddSeparator(); - toolBar->AddTool(MNU_COPY, wxEmptyString, *GetBundleSVG(clip_copy_png_bmp, "clip_copy.svg", wxSize(16, 16)), _("Copy selected text to clipboard"), wxITEM_NORMAL); - toolBar->AddTool(MNU_COPY_QUERY, wxEmptyString, *GetBundleSVG(clip_copy_png_bmp, "clip_copy_sql.svg", wxSize(16, 16)), _("Open the query tool with the selected query"), wxITEM_NORMAL); + toolBar->AddTool(MNU_COPY, wxEmptyString, GetBundleSVG(clip_copy_png_bmp, "clip_copy.svg", wxSize(16, 16)), _("Copy selected text to clipboard"), wxITEM_NORMAL); + toolBar->AddTool(MNU_COPY_QUERY, wxEmptyString, GetBundleSVG(clip_copy_png_bmp, "clip_copy_sql.svg", wxSize(16, 16)), _("Open the query tool with the selected query"), wxITEM_NORMAL); toolBar->AddSeparator(); - toolBar->AddTool(MNU_CANCEL, wxEmptyString, *GetBundleSVG(query_cancel_png_bmp, "query_cancel.svg", wxSize(16, 16)), _("Cancel query"), wxITEM_NORMAL); - toolBar->AddTool(MNU_TERMINATE, wxEmptyString, *GetBundleSVG(terminate_backend_png_bmp, "terminate_backend.svg", wxSize(16, 16)), _("Terminate backend"), wxITEM_NORMAL); - toolBar->AddTool(MNU_COMMIT, wxEmptyString, *GetBundleSVG(storedata_png_bmp, "storedata.svg", wxSize(16, 16)), _("Commit transaction"), wxITEM_NORMAL); - toolBar->AddTool(MNU_ROLLBACK, wxEmptyString, *GetBundleSVG(delete_png_bmp, "drop.svg", wxSize(16, 16)), _("Rollback transaction"), wxITEM_NORMAL); + toolBar->AddTool(MNU_CANCEL, wxEmptyString, GetBundleSVG(query_cancel_png_bmp, "query_cancel.svg", wxSize(16, 16)), _("Cancel query"), wxITEM_NORMAL); + toolBar->AddTool(MNU_TERMINATE, wxEmptyString, GetBundleSVG(terminate_backend_png_bmp, "terminate_backend.svg", wxSize(16, 16)), _("Terminate backend"), wxITEM_NORMAL); + toolBar->AddTool(MNU_COMMIT, wxEmptyString, GetBundleSVG(storedata_png_bmp, "storedata.svg", wxSize(16, 16)), _("Commit transaction"), wxITEM_NORMAL); + toolBar->AddTool(MNU_ROLLBACK, wxEmptyString, GetBundleSVG(delete_png_bmp, "drop.svg", wxSize(16, 16)), _("Rollback transaction"), wxITEM_NORMAL); toolBar->AddSeparator(); - toolBar->AddTool(MNU_CLEAR_FILTER_SERVER_STATUS, wxEmptyString, *GetBundleSVG(sortfilterclear_png_bmp, "sortfilterclear.svg", wxSize(16, 16)), _("Clear filter"), wxITEM_NORMAL); + toolBar->AddTool(MNU_CLEAR_FILTER_SERVER_STATUS, wxEmptyString, GetBundleSVG(sortfilterclear_png_bmp, "sortfilterclear.svg", wxSize(16, 16)), _("Clear filter"), wxITEM_NORMAL); toolBar->AddSeparator(); cbLogfiles = new wxComboBox(toolBar, CTL_LOGCBO, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, diff --git a/frm/plugins.cpp b/frm/plugins.cpp index 4b17d7f..06180a0 100644 --- a/frm/plugins.cpp +++ b/frm/plugins.cpp @@ -439,7 +439,7 @@ pluginButtonMenuFactory::pluginButtonMenuFactory(menuFactoryList *list, wxMenu * if (toolbar) { - toolbar->AddTool(id, wxEmptyString, *GetBundleSVG(plugins_png_bmp, "plugins.svg", wxSize(32, 32)), _("Execute the last used plugin.")); + toolbar->AddTool(id, wxEmptyString, GetBundleSVG(plugins_png_bmp, "plugins.svg", wxSize(32, 32)), _("Execute the last used plugin.")); pulldownButton = toolbar->AddMenuPulldownTool(MNU_PLUGINBUTTONLIST, wxT("Execute Plugin"), wxT("Select a plugin."), popupmenu); } } diff --git a/include/pgAdmin3.h b/include/pgAdmin3.h index dd809f5..41f9911 100644 --- a/include/pgAdmin3.h +++ b/include/pgAdmin3.h @@ -48,7 +48,7 @@ #include "config.h" #undef VERSION #endif -extern wxBitmapBundle* GetBundleSVG(wxBitmap* std, wxString name, wxSize sz); +extern wxBitmapBundle GetBundleSVG(wxBitmap* std, wxString name, wxSize sz); // Check the wxWidgets config #if !wxCHECK_VERSION(2, 8, 0) #error wxWidgets 2.8.0 or higher is required to compile this version of pgAdmin. diff --git a/include/schema/pgView.h b/include/schema/pgView.h index 0dd14b7..0ba3cb5 100644 --- a/include/schema/pgView.h +++ b/include/schema/pgView.h @@ -53,7 +53,7 @@ public: bool DropObject(wxFrame *frame, ctlTree *browser, bool cascaded); bool CanCreate() { - return GetSchema()->CanCreate(); + return GetSchema()->GetCreatePrivilege(); } bool CanView() { diff --git a/schema/pgServer.cpp b/schema/pgServer.cpp index a2b49bf..e279fb4 100644 --- a/schema/pgServer.cpp +++ b/schema/pgServer.cpp @@ -1920,7 +1920,7 @@ static pgaCollectionFactory cf(&serverFactory, __("Servers"), servers_png_img); addServerFactory::addServerFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar) : actionFactory(list) { mnu->Append(id, _("&Add Server..."), _("Add a connection to a server.")); - toolbar->AddTool(id, _("Add Server"), *GetBundleSVG(connect_png_bmp, "connect.svg", wxSize(32, 32)), _("Add a connection to a server."), wxITEM_NORMAL); + toolbar->AddTool(id, _("Add Server"), GetBundleSVG(connect_png_bmp, "connect.svg", wxSize(32, 32)), _("Add a connection to a server."), wxITEM_NORMAL); } diff --git a/x64/Release_(3.0)/pgAdmin3.exe b/x64/Release_(3.0)/pgAdmin3.exe index 0537d17..c0dd256 100644 Binary files a/x64/Release_(3.0)/pgAdmin3.exe and b/x64/Release_(3.0)/pgAdmin3.exe differ