[Thunar-workers] CVS: design/ui ChangeLog, 1.15, 1.16 ThunarHistory.py, 1.1, 1.2

Benedikt Meurer benny at xfce.org
Fri Mar 4 22:52:18 CET 2005


Update of /var/cvs/thunar/design/ui
In directory espresso.foo-projects.org:/tmp/cvs-serv603

Modified Files:
	ChangeLog ThunarHistory.py 
Log Message:
2005-03-04	Benedikt Meurer <benny at xfce.org>

	* ThunarHistory.py: Implement a more GtkFileChooser-like behaviour
	  for the history buttons. That means, the forward-history is maintained
	  as long as you work only with the history buttons.




Index: ChangeLog
===================================================================
RCS file: /var/cvs/thunar/design/ui/ChangeLog,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- ChangeLog	4 Mar 2005 21:16:50 -0000	1.15
+++ ChangeLog	4 Mar 2005 21:52:16 -0000	1.16
@@ -1,5 +1,11 @@
 2005-03-04	Benedikt Meurer <benny at xfce.org>
 
+	* ThunarHistory.py: Implement a more GtkFileChooser-like behaviour
+	  for the history buttons. That means, the forward-history is maintained
+	  as long as you work only with the history buttons.
+
+2005-03-04	Benedikt Meurer <benny at xfce.org>
+
 	* fallback.svg, ThunarMimeDatabase.py: Add fallback icon, so people
 	  with broken icon themes can still run the file manager. Check
 	  standard mime-application:octect-stream before checking for the

Index: ThunarHistory.py
===================================================================
RCS file: /var/cvs/thunar/design/ui/ThunarHistory.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ThunarHistory.py	4 Mar 2005 19:14:17 -0000	1.1
+++ ThunarHistory.py	4 Mar 2005 21:52:16 -0000	1.2
@@ -37,13 +37,20 @@
         self.set_spacing(2)
 
         self.__info = None
+        self.__rebuild_disabled = False
 
 
-    def get_info(self, info):
-        return self.__info
+    def __clicked(self, info):
+        self.__rebuild(self.__info, info)
+        self.__rebuild_disabled = True
+        self.emit('directory-changed', info)
+        self.__rebuild_disabled = False
 
 
-    def set_info(self, info):
+    def __rebuild(self, info, selected_info):
+        if self.__rebuild_disabled:
+            return
+
         # remove all existing buttons
         self.foreach(lambda child: child.destroy())
 
@@ -56,13 +63,13 @@
 
         self.__info = info
         while info:
-            if info == self.__info:
+            if info.get_path() == selected_info.get_path():
                 button = gtk.ToggleButton()
                 button.set_active(True)
             else:
                 button = gtk.Button()
             button.set_data('thunar-info', info)
-            button.connect('clicked', lambda button: self.emit('directory-changed', button.get_data('thunar-info')))
+            button.connect('clicked', lambda button: self.__clicked(button.get_data('thunar-info')))
             self.pack_start(button, False, False, 0)
             self.reorder_child(button, 0)
             button.show()
@@ -90,10 +97,10 @@
             else:
                 name = info.get_visible_name()
 
-            if info == self.__info:
-                text = '<b>%s</b>' % name
+            if info.get_path() == selected_info.get_path():
+                text = '<b>%s</b>' % name.replace('&', '&')
             else:
-                text = name
+                text = name.replace('&', '&')
 
             label = gtk.Label(text)
             label.set_use_markup(True)
@@ -106,6 +113,14 @@
             info = info.get_parent()
 
 
+    def get_info(self, info):
+        return self.__info
+
+
+    def set_info(self, info):
+        self.__rebuild(info, info)
+
+
 
 gobject.type_register(ThunarHistory)
 gobject.signal_new('directory-changed', ThunarHistory, \




More information about the Thunar-workers mailing list