The new Release 20.03 is out! You can download binaries for Windows and many major Linux distros here .
C:\Usr\Proj\cbBeta\trunk\src\sdk>PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\usr\bin;c:\usr\bin\subversion\bin C:\Usr\Proj\cbBeta\trunk\src\sdk>SET APR_ICONV_PATH=C:\usr\bin\Subversion\iconv C:\Usr\Proj\cbBeta\trunk\src\sdk>svn diff Index: editormanager.cpp===================================================================--- editormanager.cpp (revision 1563)+++ editormanager.cpp (working copy)@@ -227,7 +227,20 @@ pop->AppendSeparator(); pop->Append(idNBTabSave, _("Save")); if (GetPageCount() > 1)- pop->Append(idNBTabSaveAll, _("Save all"));+ { pop->Append(idNBTabSaveAll, _("Save all"));+ // --begin pecan 12/19/2005 1:40 PM-------------------------+ EditorBase* ed = Manager::Get()->GetEditorManager()->GetEditor(m_RightClickSelected);+ int editorsModified = 0;+ for (int i = 0; i < Manager::Get()->GetEditorManager()->GetEditorsCount(); ++i)+ {+ EditorBase* other = Manager::Get()->GetEditorManager()->GetEditor(i);+ if (other == ed) continue;+ if (other && other->GetModified() ) editorsModified++;+ }+ pop->Enable(idNBTabSaveAll, editorsModified>0 );+ // --end pecan 12/19/2005 1:40 PM ---------------------------+ }//if(getPage....+ EditorBase* ed = Manager::Get()->GetEditorManager()->GetEditor(m_RightClickSelected); if (ed) pop->Enable(idNBTabSave, ed->GetModified());@@ -269,6 +282,8 @@ EVT_MENU(idNBTabClose, EditorNotebook::OnClose) EVT_MENU(idNBTabCloseAll, EditorNotebook::OnCloseAll) EVT_MENU(idNBTabCloseAllOthers, EditorNotebook::OnCloseAllOthers)+ EVT_MENU(idNBTabSave, EditorNotebook::OnSave) //pecan 12/19/2005 1:11 PM+ EVT_MENU(idNBTabSaveAll, EditorNotebook::OnSaveAll) //pecan 12/19/2005 1:11 PM EVT_MIDDLE_DOWN(EditorNotebook::OnMiddleDown) EVT_RIGHT_DOWN(EditorNotebook::OnRightDown) END_EVENT_TABLE()
What was the bug? (link?)Edit: You are making it only enable "SaveAll" when there is at least one modified file open, correct?
Looks ok (though the calls to Manager are not needed, and I'd have used a bool).Have a bit of patience please, we're lagging a bit behind with applying non-vital patches.
pop->AppendSeparator();pop->Append(idNBTabSave, _("Save"));pop->Append(idNBTabSaveAll, _("Save all"));EditorManager *em = Manager::Get()->GetEditorManager();unsigned int num_modified = 0;for (int i = 0; i < em->GetEditorsCount(); ++i){ EditorBase* ed = em->GetEditor(i); if (ed && ed->GetModified() ) ++num_modified;}pop->Enable(idNBTabSave, num_modified);pop->Enable(idNBTabSaveAll, num_modified > 1 );
for (int i = 0; i < em->GetEditorsCount(); ++i) { EditorBase* ed = em->GetEditor(i); if (ed && ed->GetModified() ) ++num_modified; } pop->Enable(idNBTabSave, num_modified); pop->Enable(idNBTabSaveAll, num_modified > 1 );
EditorBase* other = Manager::Get()->GetEditorManager()->GetEditor(i); if (other == ed) continue; if (other && other->GetModified() ) editorsModified++;
===================================================================--- sdk/editormanager.cpp (revision 1573)+++ sdk/editormanager.cpp (working copy)@@ -237,8 +237,10 @@ if (ed && ed->GetModified() ) ++num_modified; }- pop->Enable(idNBTabSave, num_modified);- pop->Enable(idNBTabSaveAll, num_modified > 1 );+ //pop->Enable(idNBTabSave, num_modified);+ pop->Enable(idNBTabSave, em->GetEditor(m_RightClickSelected)->GetModified()); //pecan 12/20/2005 12:42 PM+ //-pop->Enable(idNBTabSaveAll, num_modified > 1 );+ pop->Enable(idNBTabSaveAll, num_modified > 0 );//pecan 12/20/2005 12:42 PM PopupMenu(pop, event.GetPosition().x, event.GetPosition().y); delete pop;
Allthough mathematically 1 ∈ all, it really only makes sense to enable "all" if n > 1. Else, we don't need "save".
Imagine the following situation: You have a lot of editors open. One of them is modified (or maybe you're not sure if any are modified). Unfortunately, it's not the current one, and the modified one is not visible
Quote from: Urxae on December 20, 2005, 08:24:36 pmImagine the following situation: You have a lot of editors open. One of them is modified (or maybe you're not sure if any are modified). Unfortunately, it's not the current one, and the modified one is not visibleImagine you have two or three modified... you don't want to do this. It is russian roulette.