when working with c::b I noticed, that I missed a "Save all" feature, which saves files, projects and the workspace at once, so I made a little patch.
Since I never used the print button in the main toolbar, I decided to replace it with a "save all" button:
I'm not really good at graphics, but I created two icons for this (out of the existing ones) and attached them to this post (filenames contain hints, where they should be put into).
Index: src/sdk/editormanager.cpp
===================================================================
--- src/sdk/editormanager.cpp (revision 4079)
+++ src/sdk/editormanager.cpp (working copy)
@@ -913,7 +913,7 @@
for (int i = 0; i < m_pNotebook->GetPageCount(); ++i)
{
EditorBase* ed = InternalGetEditorBase(i);
- if (ed && !ed->Save())
+ if (ed && ed->GetModified() && !ed->Save())
{
wxString msg;
msg.Printf(_("File %s could not be saved..."), ed->GetFilename().c_str());
Index: src/sdk/projectmanager.cpp
===================================================================
--- src/sdk/projectmanager.cpp (revision 4079)
+++ src/sdk/projectmanager.cpp (working copy)
@@ -1015,7 +1015,8 @@
for (int i = 0; i < prjCount; ++i)
{
cbProject* project = m_pProjects->Item(i);
- if (SaveProject(project))
+ bool isModified = project->GetModified();
+ if (isModified && SaveProject(project))
++count;
}
UnfreezeTree(true);
Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp (revision 4079)
+++ src/src/main.cpp (working copy)
@@ -127,6 +127,7 @@
int idFileOpenDefWorkspace = XRCID("idFileOpenDefWorkspace");
int idFileSaveWorkspace = XRCID("idFileSaveWorkspace");
int idFileSaveWorkspaceAs = XRCID("idFileSaveWorkspaceAs");
+int idFileSaveAll = XRCID("idFileSaveAll");
int idFileCloseWorkspace = XRCID("idFileCloseWorkspace");
int idFileClose = XRCID("idFileClose");
int idFileCloseAll = XRCID("idFileCloseAll");
@@ -264,6 +265,7 @@
EVT_UPDATE_UI(idFileSaveProjectAs, MainFrame::OnProjectMenuUpdateUI)
EVT_UPDATE_UI(idFileSaveProjectAllProjects, MainFrame::OnProjectMenuUpdateUI)
EVT_UPDATE_UI(idFileSaveProjectTemplate, MainFrame::OnProjectMenuUpdateUI)
+ EVT_UPDATE_UI(idFileSaveAll, MainFrame::OnProjectMenuUpdateUI)
EVT_UPDATE_UI(idFileCloseProject, MainFrame::OnProjectMenuUpdateUI)
EVT_UPDATE_UI(idFileCloseAllProjects, MainFrame::OnProjectMenuUpdateUI)
@@ -339,6 +341,7 @@
EVT_MENU(idFileOpenDefWorkspace, MainFrame::OnFileOpenDefWorkspace)
EVT_MENU(idFileSaveWorkspace, MainFrame::OnFileSaveWorkspace)
EVT_MENU(idFileSaveWorkspaceAs, MainFrame::OnFileSaveWorkspaceAs)
+ EVT_MENU(idFileSaveAll, MainFrame::OnFileSaveAll)
EVT_MENU(idFileCloseWorkspace, MainFrame::OnFileCloseWorkspace)
EVT_MENU(idFileClose, MainFrame::OnFileClose)
EVT_MENU(idFileCloseAll, MainFrame::OnFileCloseAll)
@@ -2337,6 +2340,20 @@
DoUpdateAppTitle();
}
+void MainFrame::OnFileSaveAll(wxCommandEvent& event)
+{
+ Manager::Get()->GetEditorManager()->SaveAll();
+ Manager::Get()->GetProjectManager()->SaveAllProjects();
+
+ if (Manager::Get()->GetProjectManager()->GetWorkspace()->GetModified()
+ && Manager::Get()->GetProjectManager()->SaveWorkspace())
+ {
+ AddToRecentProjectsHistory(Manager::Get()->GetProjectManager()->GetWorkspace()->GetFilename());
+ }
+ DoUpdateStatusBar();
+ DoUpdateAppTitle();
+}
+
void MainFrame::OnFileSaveProjectTemplate(wxCommandEvent& event)
{
TemplateManager::Get()->SaveUserTemplate(Manager::Get()->GetProjectManager()->GetActiveProject());
Index: src/src/main.h
===================================================================
--- src/src/main.h (revision 4079)
+++ src/src/main.h (working copy)
@@ -81,6 +81,7 @@
void OnFileOpenDefWorkspace(wxCommandEvent& event);
void OnFileSaveWorkspace(wxCommandEvent& event);
void OnFileSaveWorkspaceAs(wxCommandEvent& event);
+ void OnFileSaveAll(wxCommandEvent& event);
void OnFileCloseWorkspace(wxCommandEvent& event);
void OnFileClose(wxCommandEvent& event);
void OnFileCloseAll(wxCommandEvent& event);
Index: src/src/resources/main_menu.xrc
===================================================================
--- src/src/resources/main_menu.xrc (revision 4079)
+++ src/src/resources/main_menu.xrc (working copy)
@@ -101,8 +101,7 @@
<help>Save the active file under a different name</help>
</object>
<object class="wxMenuItem" name="idFileSaveAllFiles">
- <label>Save a&ll files</label>
- <accel>Ctrl-Shift-S</accel>
+ <label>Save all files</label>
<help>Save all modified files</help>
</object>
<object class="separator"/>
@@ -136,6 +135,13 @@
<help>Close current workspace</help>
</object>
<object class="separator"/>
+ <object class="wxMenuItem" name="idFileSaveAll">
+ <label>Save a&ll</label>
+ <bitmap>images\16x16\filesaveall.png</bitmap>
+ <accel>Ctrl-Shift-S</accel>
+ <help>Save all files, projects and the workspace</help>
+ </object>
+ <object class="separator"/>
<object class="wxMenuItem" name="idFileClose">
<label>&Close file</label>
<bitmap>images\16x16\fileclose.png</bitmap>
Index: src/src/resources/main_toolbar.xrc
===================================================================
--- src/src/resources/main_toolbar.xrc (revision 4079)
+++ src/src/resources/main_toolbar.xrc (working copy)
@@ -19,10 +19,10 @@
<longhelp>Save current file</longhelp>
<bitmap>images/filesave.png</bitmap>
</object>
- <object class="tool" name="idFilePrint">
- <tooltip>Print</tooltip>
- <longhelp>Print current file or all files</longhelp>
- <bitmap>images/fileprint.png</bitmap>
+ <object class="tool" name="idFileSaveAll">
+ <tooltip>Save all</tooltip>
+ <longhelp>Save all files, projects and the workspace</longhelp>
+ <bitmap>images/filesaveall.png</bitmap>
</object>
<object class="separator"/>
<object class="tool" name="idEditUndo">
Index: src/src/resources/main_toolbar_16x16.xrc
===================================================================
--- src/src/resources/main_toolbar_16x16.xrc (revision 4079)
+++ src/src/resources/main_toolbar_16x16.xrc (working copy)
@@ -18,10 +18,10 @@
<longhelp>Save current file</longhelp>
<bitmap>images/16x16/filesave.png</bitmap>
</object>
- <object class="tool" name="idFilePrint">
- <tooltip>Print</tooltip>
- <longhelp>Print current file or all files</longhelp>
- <bitmap>images/16x16/fileprint.png</bitmap>
+ <object class="tool" name="idFileSaveAll">
+ <tooltip>Save all</tooltip>
+ <longhelp>Save all files, projects and the workspace</longhelp>
+ <bitmap>images/16x16/filesaveall.png</bitmap>
</object>
<object class="separator"/>
<object class="tool" name="idEditUndo">
.