Fix recent plugin - buggy api

This commit is contained in:
Michael Webster 2013-05-21 11:24:01 -04:00
parent f30f258ce6
commit d1a6dc819f
2 changed files with 10 additions and 8 deletions

View File

@ -133,7 +133,7 @@ class MainWindow( object ):
def wakePlugins( self ): def wakePlugins( self ):
# Call each plugin and let them know we're showing up # Call each plugin and let them know we're showing up
for plugin in self.plugins.values(): for plugin in self.plugins.values():
if hasattr( plugin, "destroy" ): if hasattr( plugin, "wake" ):
plugin.wake() plugin.wake()
def toggleTooltipsEnabled( self, settings, key, args = None): def toggleTooltipsEnabled( self, settings, key, args = None):

View File

@ -35,6 +35,9 @@ class pluginclass:
#This should be the first item added to the window in glade #This should be the first item added to the window in glade
self.content_holder = self.builder.get_object( "eventbox1" ) self.content_holder = self.builder.get_object( "eventbox1" )
self.recentBox = self.builder.get_object("RecentBox")
self.recentVBox = self.builder.get_object( "vbox1" )
#Specify plugin width #Specify plugin width
self.width = 250 self.width = 250
@ -52,7 +55,6 @@ class pluginclass:
self.RecManagerInstance = Gtk.RecentManager.get_default() self.RecManagerInstance = Gtk.RecentManager.get_default()
self.RecManagerInstance.connect("changed", self.DoRecent) self.RecManagerInstance.connect("changed", self.DoRecent)
self.RegenPlugin() self.RegenPlugin()
self.builder.get_object( "RecentTabs" ).set_current_page(1) self.builder.get_object( "RecentTabs" ).set_current_page(1)
@ -93,16 +95,16 @@ class pluginclass:
def DoRecent( self, *args, **kargs ): def DoRecent( self, *args, **kargs ):
for i in self.builder.get_object( "RecentBox" ).get_children(): for i in self.recentBox.get_children():
i.destroy() i.destroy()
self.builder.get_object( "vbox1" ).set_size_request( self.recentw, self.recenth ) self.recentVBox.set_size_request( self.recentw, self.recenth )
if len( self.builder.get_object( "RecentBox" ).get_children() ) < self.numentries: if len( self.recentBox.get_children() ) < self.numentries:
n=len( self.builder.get_object( "RecentBox" ).get_children() )-1 n=len( self.recentBox.get_children() )-1
else: else:
n=self.numentries-1 n=self.numentries-1
while n >= 0: while n >= 0:
self.builder.get_object( "RecentBox" ).remove( self.builder.get_object( "RecentBox" ).get_children()[n] ) self.recentBox.remove( self.recentBox.get_children()[n] )
n-=1 n-=1
self.FileList, self.IconList = self.GetRecent() self.FileList, self.IconList = self.GetRecent()
@ -156,7 +158,7 @@ class pluginclass:
AButton.add( Align1 ) AButton.add( Align1 )
AButton.show() AButton.show()
self.builder.get_object( "RecentBox" ).pack_start( AButton, False, True, 0 ) self.recentBox.pack_start( AButton, False, True, 0 )
def callback(self, widget, filename=None): def callback(self, widget, filename=None):
self.Win.hide() self.Win.hide()