List Info

Thread: Updated workbench patches - workbench_bookmark_fix.patch.




Updated workbench patches - workbench_bookmark_fix.patch.
user name
2007-06-25 06:15:12
Hi,

I have updated my workbench copy to the latest revision
(r865)
and re-merged my remaining 3 patches which have not yet made
it
into Barrys official workbench repository.

Attached is patch #1: workbench_bookmark_fix.patch.

My mod description is:


Mod name: cko-issue_20940.
Issues resolved: 20940 20941.
Mod description:
Fix bookmark list handling in wb_bookmarks_dialogs.py,
which only handled one selected entry in a bookmark list
with multiple selections.

Also select the next bookmark after deleting bookmarks,
so pressing delete multiple times works.




Barry, if you approve, please commit.

Thanks and Cheers,
Carsten.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org
  
Re: Updated workbench patches - workbench_bookmark_fix.patch.
user name
2007-07-07 08:41:21
Commited at r871

Barry

On Jun 25, 2007, at 12:15, Carsten Koch wrote:

Hi,

I have updated my workbench copy to the latest revision (r865)
and re-merged my remaining 3 patches which have not yet made it
into Barrys official workbench repository.

Attached is patch #1: workbench_bookmark_fix.patch.

My mod description is:


Mod name: cko-issue_20940.
Issues resolved: 20940 20941.
Mod description:
Fix bookmark list handling in wb_bookmarks_dialogs.py,
which only handled one selected entry in a bookmark list
with multiple selections.

Also select the next bookmark after deleting bookmarks,
so pressing delete multiple times works.




Barry, if you approve, please commit.

Thanks and Cheers,
Carsten.
diff -ru WorkbenchBarry865/wb_bookmarks_dialogs.py WorkbenchICEM/wb_bookmarks_dialogs.py
--- WorkbenchBarry865/wb_bookmarks_dialogs.py 2007-04-28 13:41:27.510275000 +0200
+++ WorkbenchICEM/wb_bookmarks_dialogs.py 2007-05-31 10:52:00.746928000 +0200
-37,8 +37,6

 

         self.bookmark_prefs = bookmark_prefs

 

-        self.selection = None
-
         self.initControls()

 

     def initControls( self ):
-143,34 +141,54
         self.OnPropertiesBookmark( event )

 

     def OnSelectBookmark( self, event ):
-        self.selection = event.m_itemIndex
         self.button_delete.Enable( True )
         self.button_props.Enable( True )

 

     def OnDeselectBookmark( self, event ):
-        self.selection = None
-        self.button_delete.Enable( False )
-        self.button_props.Enable( False )
+        if self.bookmark_list_ctrl.GetNextSelected(-1) < 0:
+            self.button_delete.Enable( False )
+            self.button_props.Enable( False )

 

     def OnDeleteBookmark( self, event ):
-        self.bookmark_deleted_list.append( self.all_bookmark_props.pop( self.selection ) )

 

-        self.bookmark_list_ctrl.SetItemCount( len(self.all_bookmark_props ) )
-        self.bookmark_list_ctrl.RefreshItems( 0, len(self.all_bookmark_props )-1 )
+# delete all selected bookmarks.
+        bookmark_index = -1
+        selected_bookmarks = []
+        while True:
+            bookmark_index = self.bookmark_list_ctrl.GetNextSelected(bookmark_index)
+            if bookmark_index < 0:
+                break
+            selected_bookmarks.append(bookmark_index)
+        for bookmark_index in reversed(selected_bookmarks):
+            self.bookmark_deleted_list.append( self.all_bookmark_props.pop( bookmark_index ) )
+
+# if there is a bookmark left after the last deletion, select it, so pressing delete multiple times works.
+        if len( self.all_bookmark_props ) > 0:
+            self.bookmark_list_ctrl.Select(bookmark_index)
+            self.bookmark_list_ctrl.SetItemCount( len( self.all_bookmark_props ) )
+            self.bookmark_list_ctrl.RefreshItems( 0, len( self.all_bookmark_props )-1 )
+        else:
+            self.button_delete.Enable( False )
+            self.button_props.Enable( False )
+            self.bookmark_list_ctrl.SetItemCount( 0 )

 

-        self.button_delete.Enable( False )
-        self.button_props.Enable( False )

 

     def OnPropertiesBookmark( self, event ):
-        props = self.all_bookmark_props[ self.selection ]
-        dialog = BookmarkPropertiesDialog( self, self.app, props )
-
-        rc = dialog.ShowModal()
-        if rc != wx.ID_OK:
-            return
-
-        self.sortBookmarks()
-        self.bookmark_list_ctrl.RefreshItems( 0, len(self.all_bookmark_props )-1 )
+        one_ok = False
+        bookmark_index = -1
+        while True:
+            bookmark_index = self.bookmark_list_ctrl.GetNextSelected(bookmark_index)
+            if bookmark_index < 0:
+                break
+            dialog = BookmarkPropertiesDialog( self, self.app, self.all_bookmark_props[ bookmark_index ] )
+
+            rc = dialog.ShowModal()
+            if rc == wx.ID_OK:
+                one_ok = True
+
+        if one_ok:
+            self.sortBookmarks()
+            self.bookmark_list_ctrl.RefreshItems( 0, len( self.all_bookmark_props )-1 )

 

     def setPreferences( self ):
         for props in self.getDeletedBookmarkList():

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org">dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org">dev-helppysvn.tigris.org

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )