More transitioning

This commit is contained in:
Michael Webster 2013-03-04 21:56:18 -05:00
parent c940e3a735
commit a18a26c796
7 changed files with 649 additions and 183 deletions

View File

@ -316,9 +316,9 @@ class MainWindow( object ):
heading.add( Align1 ) heading.add( Align1 )
heading.show() heading.show()
VBox1.pack_start( heading, False ) VBox1.pack_start( heading, False, False, 0 )
VBox1.show() VBox1.show()
MyPlugin.container = VBox1 #MyPlugin.container = VBox1
#Add plugin to Plugin Box under heading button #Add plugin to Plugin Box under heading button
MyPlugin.content_holder.reparent( VBox1 ) MyPlugin.content_holder.reparent( VBox1 )
@ -365,7 +365,7 @@ class MainWindow( object ):
Image1.show() Image1.show()
#ImageBox.add( Image1 ) #ImageBox.add( Image1 )
Align1 = Gtk.Alignment.new() Align1 = Gtk.Alignment.new(0, 0, 0, 0)
Align1.set_padding( 0, 0, 6, 6 ) Align1.set_padding( 0, 0, 6, 6 )
Align1.add(Image1) Align1.add(Image1)
ImageBox.add(Align1) ImageBox.add(Align1)
@ -392,6 +392,7 @@ class MainWindow( object ):
def SetHeadingStyle( self, items ): def SetHeadingStyle( self, items ):
return
for item in items: for item in items:
if item not in self.headingsToColor: if item not in self.headingsToColor:
self.headingsToColor.append( item ) self.headingsToColor.append( item )
@ -486,14 +487,28 @@ class MainWindow( object ):
def onButtonPress( self, widget, event ): def onButtonPress( self, widget, event ):
# Check if the pointer is within the menu, else hide the menu # Check if the pointer is within the menu, else hide the menu
winatptr = Gdk.window_at_pointer() winatptr = Gdk.window_at_pointer()
widget_win = widget.get_window()
print winatptr
print widget_win
if winatptr[0] != widget_win:
self.hide(True)
return True
if winatptr: if winatptr:
win = winatptr[0] win = winatptr[0]
while win: while win:
print "xx"
print self.window.window
if win == self.window.window: if win == self.window.window:
break break
win = win.get_parent() win = win.get_toplevels()
if not win: if not win:
self.hide( True ) self.hide( True )
else: else:
@ -707,14 +722,15 @@ class MenuWin( object ):
self.sizeButton() self.sizeButton()
def bind_hot_key (self): def bind_hot_key (self):
try:
# Binding menu to hotkey
print "Binding to Hot Key: " + self.hotkeyText
bind_key( self.hotkeyText, self.onBindingPress )
except Exception, cause:
print "** WARNING ** - Menu Hotkey Binding Error"
print "Error Report :\n", str(cause)
pass pass
# try:
# # Binding menu to hotkey
# print "Binding to Hot Key: " + self.hotkeyText
# bind_key( self.hotkeyText, self.onBindingPress )
# except Exception, cause:
# print "** WARNING ** - Menu Hotkey Binding Error"
# print "Error Report :\n", str(cause)
# pass
def sizeButton( self ): def sizeButton( self ):
if self.hideIcon: if self.hideIcon:

View File

@ -1,96 +1,111 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<glade-interface> <interface>
<object class="GtkUIManager" id="uimanager1">
<ui>
<popup name="applicationsMenu"/>
</ui>
</object>
<object class="GtkUIManager" id="uimanager2">
<ui>
<popup name="favoritesMenu"/>
</ui>
</object>
<object class="GtkUIManager" id="uimanager3">
<ui>
<popup name="favoritesMenuExtra"/>
</ui>
</object>
<!-- interface-requires gtk+ 2.6 --> <!-- interface-requires gtk+ 2.6 -->
<!-- interface-naming-policy toplevel-contextual --> <!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="mainWindow"> <object class="GtkWindow" id="mainWindow">
<property name="width_request">169</property> <property name="width_request">169</property>
<property name="height_request">227</property> <property name="height_request">227</property>
<property name="window_position">mouse</property> <property name="window_position">mouse</property>
<property name="gravity">static</property> <property name="gravity">static</property>
<signal name="destroy" handler="on_window1_destroy"/> <signal handler="on_window1_destroy" name="destroy"/>
<child> <child>
<widget class="GtkEventBox" id="Applications"> <object class="GtkEventBox" id="Applications">
<property name="visible">True</property> <property name="visible">True</property>
<child> <child>
<widget class="GtkVBox" id="vbox4"> <object class="GtkVBox" id="vbox4">
<property name="visible">True</property> <property name="visible">True</property>
<child> <child>
<widget class="GtkNotebook" id="notebook2"> <object class="GtkNotebook" id="notebook2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="show_tabs">False</property> <property name="show_tabs">False</property>
<property name="show_border">False</property> <property name="show_border">False</property>
<property name="tab_border">14</property> <property name="tab_border">14</property>
<child> <child>
<widget class="GtkVBox" id="vbox5"> <object class="GtkVBox" id="vbox5">
<property name="visible">True</property> <property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child> <child>
<widget class="GtkHBox" id="hbox8"> <object class="GtkHBox" id="hbox8">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
<child> <child>
<widget class="GtkLabel" id="label6"> <object class="GtkLabel" id="label6">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="xpad">15</property> <property name="xpad">15</property>
<property name="ypad">10</property> <property name="ypad">10</property>
<property name="label" translatable="yes">&lt;span weight="bold"&gt;Favorites&lt;/span&gt;</property> <property name="label" translatable="yes">&lt;span weight="bold"&gt;Favorites&lt;/span&gt;</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</widget> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkButton" id="showAllAppsButton"> <object class="GtkButton" id="showAllAppsButton">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="relief">none</property> <property name="relief">none</property>
<child> <child>
<widget class="GtkAlignment" id="alignment3"> <object class="GtkAlignment" id="alignment3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="xscale">0</property> <property name="xscale">0</property>
<property name="yscale">0</property> <property name="yscale">0</property>
<property name="right_padding">10</property> <property name="right_padding">10</property>
<child> <child>
<widget class="GtkHBox" id="hbox10"> <object class="GtkHBox" id="hbox10">
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">2</property> <property name="spacing">2</property>
<child> <child>
<widget class="GtkLabel" id="label7"> <object class="GtkLabel" id="label7">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">All _Applications</property> <property name="label" translatable="yes">All _Applications</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
</widget> </object>
<packing> <packing>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkImage" id="image4"> <object class="GtkImage" id="image4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xpad">5</property> <property name="xpad">5</property>
<property name="stock">gtk-go-forward</property> <property name="stock">gtk-go-forward</property>
</widget> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="padding">5</property> <property name="padding">5</property>
<property name="pack_type">end</property> <property name="pack_type">end</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
@ -98,103 +113,100 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkViewport" id="viewport2"> <object class="GtkViewport" id="viewport2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="resize_mode">queue</property> <property name="resize_mode">queue</property>
<property name="shadow_type">none</property> <property name="shadow_type">none</property>
<child> <child>
<widget class="GtkTable" id="favoritesBox"> <object class="GtkTable" id="favoritesBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
</child> </child>
<child> <child type="tab">
<placeholder/> <placeholder/>
<packing>
<property name="type">tab</property>
</packing>
</child> </child>
<child> <child>
<widget class="GtkVBox" id="vbox1"> <object class="GtkVBox" id="vbox1">
<property name="visible">True</property> <property name="visible">True</property>
<child> <child>
<widget class="GtkHBox" id="hbox3"> <object class="GtkHBox" id="hbox3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
<child> <child>
<widget class="GtkLabel" id="label2"> <object class="GtkLabel" id="label2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="xpad">15</property> <property name="xpad">15</property>
<property name="ypad">10</property> <property name="ypad">10</property>
<property name="label" translatable="yes">&lt;span weight="bold"&gt;All Applications&lt;/span&gt;</property> <property name="label" translatable="yes">&lt;span weight="bold"&gt;All Applications&lt;/span&gt;</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</widget> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkButton" id="showFavoritesButton"> <object class="GtkButton" id="showFavoritesButton">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="relief">none</property> <property name="relief">none</property>
<child> <child>
<widget class="GtkAlignment" id="alignment2"> <object class="GtkAlignment" id="alignment2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="xscale">0</property> <property name="xscale">0</property>
<property name="yscale">0</property> <property name="yscale">0</property>
<property name="right_padding">10</property> <property name="right_padding">10</property>
<child> <child>
<widget class="GtkHBox" id="hbox4"> <object class="GtkHBox" id="hbox4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">2</property> <property name="spacing">2</property>
<child> <child>
<widget class="GtkLabel" id="label3"> <object class="GtkLabel" id="label3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">_Favorites</property> <property name="label" translatable="yes">_Favorites</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
</widget> </object>
<packing> <packing>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkImage" id="image3"> <object class="GtkImage" id="image3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xpad">5</property> <property name="xpad">5</property>
<property name="stock">gtk-go-forward</property> <property name="stock">gtk-go-forward</property>
</widget> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="padding">5</property> <property name="padding">5</property>
<property name="pack_type">end</property> <property name="pack_type">end</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
@ -202,35 +214,35 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox5"> <object class="GtkHBox" id="hbox5">
<property name="visible">True</property> <property name="visible">True</property>
<child> <child>
<widget class="GtkScrolledWindow" id="scrolledwindow1"> <object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property> <property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">automatic</property> <property name="vscrollbar_policy">automatic</property>
<child> <child>
<widget class="GtkViewport" id="viewport1"> <object class="GtkViewport" id="viewport1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="shadow_type">none</property> <property name="shadow_type">none</property>
<child> <child>
<widget class="GtkVBox" id="categoriesBox"> <object class="GtkVBox" id="categoriesBox">
<property name="visible">True</property> <property name="visible">True</property>
</widget> </object>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkVSeparator" id="vseparator1"> <object class="GtkVSeparator" id="vseparator1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
@ -239,60 +251,54 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkScrolledWindow" id="applicationsScrolledWindow"> <object class="GtkScrolledWindow" id="applicationsScrolledWindow">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="hscrollbar_policy">never</property> <property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">automatic</property> <property name="vscrollbar_policy">automatic</property>
<child> <child>
<widget class="GtkViewport" id="viewport3"> <object class="GtkViewport" id="viewport3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="shadow_type">none</property> <property name="shadow_type">none</property>
<child> <child>
<widget class="GtkVBox" id="applicationsBox"> <object class="GtkVBox" id="applicationsBox">
<property name="visible">True</property> <property name="visible">True</property>
</widget> </object>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing>
<property name="position">1</property>
</packing>
</child> </child>
<child> <child type="tab">
<placeholder/> <placeholder/>
<packing>
<property name="type">tab</property>
</packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox9"> <object class="GtkHBox" id="hbox9">
<property name="width_request">227</property> <property name="width_request">227</property>
<property name="height_request">30</property> <property name="height_request">30</property>
<property name="visible">True</property> <property name="visible">True</property>
<child> <child>
<widget class="GtkLabel" id="searchLabel"> <object class="GtkLabel" id="searchLabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">&lt;span weight="bold"&gt;Search:&lt;/span&gt;</property> <property name="label" translatable="yes">&lt;span weight="bold"&gt;Search:&lt;/span&gt;</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
@ -301,7 +307,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkEntry" id="searchEntry"> <object class="GtkEntry" id="searchEntry">
<property name="height_request">25</property> <property name="height_request">25</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
@ -309,14 +315,14 @@
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="has_default">True</property> <property name="has_default">True</property>
<property name="activates_default">True</property> <property name="activates_default">True</property>
<signal name="changed" handler="on_entry1_changed"/> <signal handler="on_entry1_changed" name="changed"/>
</widget> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkButton" id="searchButton"> <object class="GtkButton" id="searchButton">
<property name="width_request">28</property> <property name="width_request">28</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
@ -325,18 +331,18 @@
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="relief">none</property> <property name="relief">none</property>
<property name="focus_on_click">False</property> <property name="focus_on_click">False</property>
<signal name="clicked" handler="on_button17_clicked"/> <signal handler="on_button17_clicked" name="clicked"/>
<child> <child>
<widget class="GtkImage" id="image1"> <object class="GtkImage" id="image1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="has_default">True</property> <property name="has_default">True</property>
<property name="stock">gtk-find</property> <property name="stock">gtk-find</property>
<property name="icon-size">1</property> <property name="icon-size">1</property>
</widget> </object>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
@ -344,7 +350,7 @@
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
@ -352,18 +358,18 @@
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
<widget class="GtkMenu" id="applicationsMenu"/> <object class="GtkMenu" constructor="uimanager1" id="applicationsMenu"/>
<widget class="GtkMenu" id="favoritesMenu"> <object class="GtkMenu" constructor="uimanager2" id="favoritesMenu">
<property name="visible">True</property> <property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</widget> </object>
<widget class="GtkMenu" id="favoritesMenuExtra"> <object class="GtkMenu" constructor="uimanager3" id="favoritesMenuExtra">
<property name="visible">True</property> <property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</widget> </object>
</glade-interface> </interface>

View File

@ -0,0 +1,369 @@
<?xml version="1.0"?>
<glade-interface>
<!-- interface-requires gtk+ 2.6 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="mainWindow">
<property name="width_request">169</property>
<property name="height_request">227</property>
<property name="window_position">mouse</property>
<property name="gravity">static</property>
<signal name="destroy" handler="on_window1_destroy"/>
<child>
<widget class="GtkEventBox" id="Applications">
<property name="visible">True</property>
<child>
<widget class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<child>
<widget class="GtkNotebook" id="notebook2">
<property name="visible">True</property>
<property name="show_tabs">False</property>
<property name="show_border">False</property>
<property name="tab_border">14</property>
<child>
<widget class="GtkVBox" id="vbox5">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkHBox" id="hbox8">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<child>
<widget class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="xpad">15</property>
<property name="ypad">10</property>
<property name="label" translatable="yes">&lt;span weight="bold"&gt;Favorites&lt;/span&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="showAllAppsButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="relief">none</property>
<child>
<widget class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="right_padding">10</property>
<child>
<widget class="GtkHBox" id="hbox10">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<widget class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="label" translatable="yes">All _Applications</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="xpad">5</property>
<property name="stock">gtk-go-forward</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">5</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkViewport" id="viewport2">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="resize_mode">queue</property>
<property name="shadow_type">none</property>
<child>
<widget class="GtkTable" id="favoritesBox">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<placeholder/>
</child>
</widget>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
<child>
<placeholder/>
<packing>
<property name="type">tab</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<child>
<widget class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<child>
<widget class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="xpad">15</property>
<property name="ypad">10</property>
<property name="label" translatable="yes">&lt;span weight="bold"&gt;All Applications&lt;/span&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="showFavoritesButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="relief">none</property>
<child>
<widget class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="right_padding">10</property>
<child>
<widget class="GtkHBox" id="hbox4">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<widget class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="label" translatable="yes">_Favorites</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="xpad">5</property>
<property name="stock">gtk-go-forward</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">5</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox5">
<property name="visible">True</property>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">automatic</property>
<child>
<widget class="GtkViewport" id="viewport1">
<property name="visible">True</property>
<property name="shadow_type">none</property>
<child>
<widget class="GtkVBox" id="categoriesBox">
<property name="visible">True</property>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkVSeparator" id="vseparator1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="applicationsScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_default">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">automatic</property>
<child>
<widget class="GtkViewport" id="viewport3">
<property name="visible">True</property>
<property name="shadow_type">none</property>
<child>
<widget class="GtkVBox" id="applicationsBox">
<property name="visible">True</property>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
<packing>
<property name="type">tab</property>
</packing>
</child>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox9">
<property name="width_request">227</property>
<property name="height_request">30</property>
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="searchLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;span weight="bold"&gt;Search:&lt;/span&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="searchEntry">
<property name="height_request">25</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="activates_default">True</property>
<signal name="changed" handler="on_entry1_changed"/>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="searchButton">
<property name="width_request">28</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="relief">none</property>
<property name="focus_on_click">False</property>
<signal name="clicked" handler="on_button17_clicked"/>
<child>
<widget class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="stock">gtk-find</property>
<property name="icon-size">1</property>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<widget class="GtkMenu" id="applicationsMenu"/>
<widget class="GtkMenu" id="favoritesMenu">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</widget>
<widget class="GtkMenu" id="favoritesMenuExtra">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</widget>
</glade-interface>

View File

@ -1,8 +1,10 @@
#!/usr/bin/env python #!/usr/bin/env python
import gtk import gi
import gtk.glade gi.require_version("Gtk", "2.0")
import gobject
from gi.repository import Gtk, GObject, Pango, Gdk
import os import os
import mateconf import mateconf
import fnmatch import fnmatch
@ -26,7 +28,7 @@ import matemenu
from user import home from user import home
gtk.gdk.threads_init() GObject.threads_init()
# i18n # i18n
gettext.install("mintmenu", "/usr/share/linuxmint/locale") gettext.install("mintmenu", "/usr/share/linuxmint/locale")
@ -165,22 +167,22 @@ class Menu:
class SuggestionButton ( gtk.Button ): class SuggestionButton ( Gtk.Button ):
def __init__( self, iconName, iconSize, label ): def __init__( self, iconName, iconSize, label ):
gtk.Button.__init__( self ) Gtk.Button.__init__( self )
self.iconName = iconName self.iconName = iconName
self.set_relief( gtk.RELIEF_NONE ) self.set_relief( Gtk.ReliefStyle.NONE )
self.set_size_request( -1, -1 ) self.set_size_request( -1, -1 )
Align1 = gtk.Alignment( 0, 0.5, 1.0, 0 ) Align1 = Gtk.Alignment( 0, 0.5, 1.0, 0 )
HBox1 = gtk.HBox() HBox1 = Gtk.HBox()
labelBox = gtk.VBox( False, 2 ) labelBox = Gtk.VBox( False, 2 )
self.image = gtk.Image() self.image = Gtk.Image()
self.image.set_from_stock( self.iconName, iconSize ) self.image.set_from_stock( self.iconName, iconSize )
self.image.show() self.image.show()
HBox1.pack_start( self.image, False, False, 5 ) HBox1.pack_start( self.image, False, False, 5 )
self.label = gtk.Label() self.label = Gtk.Label()
self.label.set_ellipsize( pango.ELLIPSIZE_END ) self.label.set_ellipsize( Pango.EllipsizeMode.END )
self.label.set_alignment( 0.0, 1.0 ) self.label.set_alignment( 0.0, 1.0 )
self.label.show() self.label.show()
labelBox.pack_start( self.label ) labelBox.pack_start( self.label )
@ -205,8 +207,8 @@ class pluginclass( object ):
TARGET_TYPE_TEXT = 80 TARGET_TYPE_TEXT = 80
toButton = [ ( "text/uri-list", 0, TARGET_TYPE_TEXT ) ] toButton = [ ( "text/uri-list", 0, TARGET_TYPE_TEXT ) ]
TARGET_TYPE_FAV = 81 TARGET_TYPE_FAV = 81
toFav = [ ( "FAVORITES", gtk.TARGET_SAME_APP, TARGET_TYPE_FAV ), ( "text/plain", 0, 100 ), ( "text/uri-list", 0, 101 ) ] toFav = [ ( "FAVORITES", Gtk.TargetFlags.SAME_APP, TARGET_TYPE_FAV ), ( "text/plain", 0, 100 ), ( "text/uri-list", 0, 101 ) ]
fromFav = [ ( "FAVORITES", gtk.TARGET_SAME_APP, TARGET_TYPE_FAV ) ] fromFav = [ ( "FAVORITES", Gtk.TargetFlags.SAME_APP, TARGET_TYPE_FAV ) ]
@print_timing @print_timing
def __init__( self, mintMenuWin, toggleButton, de ): def __init__( self, mintMenuWin, toggleButton, de ):
@ -217,44 +219,45 @@ class pluginclass( object ):
self.toggleButton = toggleButton self.toggleButton = toggleButton
self.de = de self.de = de
builder = Gtk.Builder()
# The Glade file for the plugin # The Glade file for the plugin
self.gladefile = os.path.join( os.path.dirname( __file__ ), "applications.glade" ) builder.add_from_file (os.path.join( os.path.dirname( __file__ ), "applications.glade" ))
# Read GLADE file # Read GLADE file
self.wTree = gtk.glade.XML( self.gladefile, "mainWindow" ) self.wTree = builder.get_object( "mainWindow" )
self.searchEntry = self.wTree.get_widget( "searchEntry" ) self.searchEntry = builder.get_object( "searchEntry" )
self.searchButton = self.wTree.get_widget( "searchButton" ) self.searchButton = builder.get_object( "searchButton" )
self.showAllAppsButton = self.wTree.get_widget( "showAllAppsButton" ) self.showAllAppsButton = builder.get_object( "showAllAppsButton" )
self.showFavoritesButton = self.wTree.get_widget( "showFavoritesButton" ) self.showFavoritesButton = builder.get_object( "showFavoritesButton" )
self.applicationsBox = self.wTree.get_widget( "applicationsBox" ) self.applicationsBox = builder.get_object( "applicationsBox" )
self.categoriesBox = self.wTree.get_widget( "categoriesBox" ) self.categoriesBox = builder.get_object( "categoriesBox" )
self.favoritesBox = self.wTree.get_widget( "favoritesBox" ) self.favoritesBox = builder.get_object( "favoritesBox" )
self.applicationsScrolledWindow = self.wTree.get_widget( "applicationsScrolledWindow" ) self.applicationsScrolledWindow = builder.get_object( "applicationsScrolledWindow" )
#i18n #i18n
self.wTree.get_widget("searchLabel").set_text("<span weight='bold'>" + _("Search:") + "</span>") builder.get_object("searchLabel").set_text("<span weight='bold'>" + _("Search:") + "</span>")
self.wTree.get_widget("searchLabel").set_use_markup(True) builder.get_object("searchLabel").set_use_markup(True)
self.wTree.get_widget("label6").set_text(_("Favorites")) builder.get_object("label6").set_text(_("Favorites"))
self.wTree.get_widget("label3").set_text(_("Favorites")) builder.get_object("label3").set_text(_("Favorites"))
self.wTree.get_widget("label7").set_text(_("All applications")) builder.get_object("label7").set_text(_("All applications"))
self.wTree.get_widget("label2").set_text(_("Applications")) builder.get_object("label2").set_text(_("Applications"))
self.mintMenuWin.SetHeadingStyle( [self.wTree.get_widget("label6"), self.wTree.get_widget("label2")] ) self.mintMenuWin.SetHeadingStyle( [builder.get_object("label6"), builder.get_object("label2")] )
self.numApps = 0 self.numApps = 0
# These properties are NECESSARY to maintain consistency # These properties are NECESSARY to maintain consistency
# Set 'window' property for the plugin (Must be the root widget) # Set 'window' property for the plugin (Must be the root widget)
self.window = self.wTree.get_widget( "mainWindow" ) self.window = builder.get_object( "mainWindow" )
# Set 'heading' property for plugin # Set 'heading' property for plugin
self.heading = ""#_("Applications") self.heading = ""#_("Applications")
# 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.wTree.get_widget( "Applications" ) self.content_holder = builder.get_object( "Applications" )
# Items to get custom colors # Items to get custom colors
self.itemstocolor = [ self.wTree.get_widget( "viewport1" ), self.wTree.get_widget( "viewport2" ), self.wTree.get_widget( "viewport3" ), self.wTree.get_widget( "notebook2" ) ] self.itemstocolor = [ builder.get_object( "viewport1" ), builder.get_object( "viewport2" ), builder.get_object( "viewport3" ), builder.get_object( "notebook2" ) ]
# Unset all timers # Unset all timers
self.filterTimer = None self.filterTimer = None
@ -263,7 +266,7 @@ class pluginclass( object ):
self.content_holder.connect( "key-press-event", self.keyPress ) self.content_holder.connect( "key-press-event", self.keyPress )
self.favoritesBox.connect( "drag_data_received", self.ReceiveCallback ) self.favoritesBox.connect( "drag_data_received", self.ReceiveCallback )
self.favoritesBox.drag_dest_set( gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP, self.toButton, gtk.gdk.ACTION_COPY ) self.favoritesBox.drag_dest_set( Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toButton, gtk.gdk.ACTION_COPY )
self.showFavoritesButton.connect( "drag_data_received", self.ReceiveCallback ) self.showFavoritesButton.connect( "drag_data_received", self.ReceiveCallback )
self.showFavoritesButton.drag_dest_set( gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP, self.toButton, gtk.gdk.ACTION_COPY ) self.showFavoritesButton.drag_dest_set( gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP, self.toButton, gtk.gdk.ACTION_COPY )
@ -321,7 +324,7 @@ class pluginclass( object ):
self.current_suggestion = None self.current_suggestion = None
self.get_panel() self.get_panel()
self.wTree.get_widget("searchButton").connect( "button-release-event", self.searchPopup ) builder.get_object("searchButton").connect( "button-release-event", self.searchPopup )
def refresh_apt_cache(self): def refresh_apt_cache(self):
if self.useAPT: if self.useAPT:
@ -580,34 +583,34 @@ class pluginclass( object ):
def StartFilter( self, widget, category ): def StartFilter( self, widget, category ):
# if there is a timer for a different category running stop it # if there is a timer for a different category running stop it
if self.filterTimer: if self.filterTimer:
gobject.source_remove( self.filterTimer ) GObject.source_remove( self.filterTimer )
self.filterTimer = gobject.timeout_add( self.categoryhoverdelay, self.Filter, widget, category ) self.filterTimer = GObject.timeout_add( self.categoryhoverdelay, self.Filter, widget, category )
def StopFilter( self, widget ): def StopFilter( self, widget ):
if self.filterTimer: if self.filterTimer:
gobject.source_remove( self.filterTimer ) GObject.source_remove( self.filterTimer )
self.filterTimer = None self.filterTimer = None
def add_search_suggestions(self, text): def add_search_suggestions(self, text):
text = "<b>%s</b>" % text text = "<b>%s</b>" % text
suggestionButton = SuggestionButton(gtk.STOCK_ADD, self.iconSize, "") suggestionButton = SuggestionButton(Gtk.STOCK_ADD, self.iconSize, "")
suggestionButton.connect("clicked", self.search_google) suggestionButton.connect("clicked", self.search_google)
suggestionButton.set_text(_("Search Google for %s") % text) suggestionButton.set_text(_("Search Google for %s") % text)
suggestionButton.set_image("/usr/lib/linuxmint/mintMenu/search_engines/google.ico") suggestionButton.set_image("/usr/lib/linuxmint/mintMenu/search_engines/google.ico")
self.applicationsBox.add(suggestionButton) self.applicationsBox.add(suggestionButton)
self.suggestions.append(suggestionButton) self.suggestions.append(suggestionButton)
suggestionButton = SuggestionButton(gtk.STOCK_ADD, self.iconSize, "") suggestionButton = SuggestionButton(Gtk.STOCK_ADD, self.iconSize, "")
suggestionButton.connect("clicked", self.search_wikipedia) suggestionButton.connect("clicked", self.search_wikipedia)
suggestionButton.set_text(_("Search Wikipedia for %s") % text) suggestionButton.set_text(_("Search Wikipedia for %s") % text)
suggestionButton.set_image("/usr/lib/linuxmint/mintMenu/search_engines/wikipedia.ico") suggestionButton.set_image("/usr/lib/linuxmint/mintMenu/search_engines/wikipedia.ico")
self.applicationsBox.add(suggestionButton) self.applicationsBox.add(suggestionButton)
self.suggestions.append(suggestionButton) self.suggestions.append(suggestionButton)
separator = gtk.EventBox() separator = Gtk.EventBox()
separator.add(gtk.HSeparator()) separator.add(Gtk.HSeparator())
separator.set_size_request(-1, 20) separator.set_size_request(-1, 20)
separator.type = "separator" separator.type = "separator"
self.mintMenuWin.SetPaneColors( [ separator ] ) self.mintMenuWin.SetPaneColors( [ separator ] )
@ -615,14 +618,14 @@ class pluginclass( object ):
self.applicationsBox.add(separator) self.applicationsBox.add(separator)
self.suggestions.append(separator) self.suggestions.append(separator)
suggestionButton = SuggestionButton(gtk.STOCK_ADD, self.iconSize, "") suggestionButton = SuggestionButton(Gtk.STOCK_ADD, self.iconSize, "")
suggestionButton.connect("clicked", self.search_dictionary) suggestionButton.connect("clicked", self.search_dictionary)
suggestionButton.set_text(_("Lookup %s in Dictionary") % text) suggestionButton.set_text(_("Lookup %s in Dictionary") % text)
suggestionButton.set_image("/usr/lib/linuxmint/mintMenu/search_engines/dictionary.png") suggestionButton.set_image("/usr/lib/linuxmint/mintMenu/search_engines/dictionary.png")
self.applicationsBox.add(suggestionButton) self.applicationsBox.add(suggestionButton)
self.suggestions.append(suggestionButton) self.suggestions.append(suggestionButton)
suggestionButton = SuggestionButton(gtk.STOCK_FIND, self.iconSize, "") suggestionButton = SuggestionButton(Gtk.STOCK_FIND, self.iconSize, "")
suggestionButton.connect("clicked", self.Search) suggestionButton.connect("clicked", self.Search)
suggestionButton.set_text(_("Search Computer for %s") % text) suggestionButton.set_text(_("Search Computer for %s") % text)
self.applicationsBox.add(suggestionButton) self.applicationsBox.add(suggestionButton)
@ -1641,7 +1644,7 @@ class pluginclass( object ):
sortedCategoryList.sort() sortedCategoryList.sort()
for item in sortedCategoryList: for item in sortedCategoryList:
self.categoriesBox.pack_start( item[1], False ) self.categoriesBox.pack_start( item[1], False, False, 0 )
# Find added and removed applications add update the application list # Find added and removed applications add update the application list
@ -1705,7 +1708,7 @@ class pluginclass( object ):
sortedApplicationList.sort() sortedApplicationList.sort()
for item in sortedApplicationList: for item in sortedApplicationList:
self.applicationsBox.pack_start( item[1], False ) self.applicationsBox.pack_start( item[1], False, False, 0 )
self.rebuildLock = False self.rebuildLock = False

View File

@ -1,56 +1,64 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<glade-interface> <interface>
<!-- interface-requires gtk+ 2.16 --> <!-- interface-requires gtk+ 2.16 -->
<!-- interface-naming-policy toplevel-contextual --> <!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="mainWindow"> <object class="GtkWindow" id="mainWindow">
<signal name="destroy" handler="on_window1_destroy"/> <property name="can_focus">False</property>
<signal handler="on_window1_destroy" name="destroy" swapped="no"/>
<child> <child>
<widget class="GtkEventBox" id="Places"> <object class="GtkEventBox" id="Places">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<child> <child>
<widget class="GtkScrolledWindow" id="scrolledwindow2"> <object class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property> <property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property> <property name="vscrollbar_policy">automatic</property>
<signal name="drag_motion" handler="on_scrolledwindow_drag_motion"/> <signal handler="on_scrolledwindow_drag_drop" name="drag_drop" swapped="no"/>
<signal name="drag_drop" handler="on_scrolledwindow_drag_drop"/> <signal handler="on_scrolledwindow_drag_data_received" name="drag_data_received" swapped="no"/>
<signal name="drag_data_received" handler="on_scrolledwindow_drag_data_received"/> <signal handler="on_scrolledwindow_drag_motion" name="drag_motion" swapped="no"/>
<child> <child>
<widget class="GtkViewport" id="viewport2"> <object class="GtkViewport" id="viewport2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property> <property name="shadow_type">none</property>
<child> <child>
<widget class="GtkVBox" id="vbox1"> <object class="GtkVBox" id="vbox1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<child> <child>
<widget class="GtkVBox" id="places_button_holder"> <object class="GtkVBox" id="places_button_holder">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">2</property> <property name="spacing">2</property>
</widget> </object>
<packing> <packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkVButtonBox" id="editable_button_holder"> <object class="GtkVButtonBox" id="editable_button_holder">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">start</property> <property name="layout_style">start</property>
</widget> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
</child> </child>
</widget> </object>
</glade-interface> </interface>

View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<glade-interface>
<!-- interface-requires gtk+ 2.16 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="mainWindow">
<property name="can_focus">False</property>
<signal name="destroy" handler="on_window1_destroy" swapped="no"/>
<child>
<widget class="GtkEventBox" id="Places">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<signal name="drag_drop" handler="on_scrolledwindow_drag_drop" swapped="no"/>
<signal name="drag_data_received" handler="on_scrolledwindow_drag_data_received" swapped="no"/>
<signal name="drag_motion" handler="on_scrolledwindow_drag_motion" swapped="no"/>
<child>
<widget class="GtkViewport" id="viewport2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<widget class="GtkVBox" id="places_button_holder">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">2</property>
</widget>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkVButtonBox" id="editable_button_holder">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">start</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
</glade-interface>

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
from gi.repository import Gtk from gi.repository import Gtk, Gio
import os import os
import string import string
import gettext import gettext
@ -25,7 +25,7 @@ class pluginclass( object ):
# Read UI file # Read UI file
builder = Gtk.Builder() builder = Gtk.Builder()
builder.add_from_file(os.path.join( os.path.dirname( __file__ ), "places.ui" )) builder.add_from_file(os.path.join( os.path.dirname( __file__ ), "places.glade" ))
self.placesBtnHolder = builder.get_object( "places_button_holder" ) self.placesBtnHolder = builder.get_object( "places_button_holder" )
self.editableBtnHolder = builder.get_object( "editable_button_holder" ) self.editableBtnHolder = builder.get_object( "editable_button_holder" )
@ -104,7 +104,7 @@ class pluginclass( object ):
# Check default items # Check default items
self.showcomputer = self.settings.get_boolean( "places-show_computer" ) self.showcomputer = self.settings.get_boolean( "places-show-computer" )
self.showhomefolder = self.settings.get_boolean( "places-show-home-folder" ) self.showhomefolder = self.settings.get_boolean( "places-show-home-folder" )
self.shownetwork = self.settings.get_boolean( "places-show-network" ) self.shownetwork = self.settings.get_boolean( "places-show-network" )
self.showdesktop = self.settings.get_boolean( "places-show-desktop" ) self.showdesktop = self.settings.get_boolean( "places-show-desktop" )
@ -119,10 +119,10 @@ class pluginclass( object ):
# Hide vertical dotted separator # Hide vertical dotted separator
self.hideseparator = self.settings.get_boolean( "places-hide-separator" ) self.hideseparator = self.settings.get_boolean( "places-hide-separator" )
# Plugin icon # Plugin icon
self.icon = self.settings_get_string( "places-icon" ) self.icon = self.settings.get_string( "places-icon" )
# Allow plugin to be minimized to the left plugin pane # Allow plugin to be minimized to the left plugin pane
self.sticky = self.settings.get_boolean( "places-sticky", False ) self.sticky = self.settings.get_boolean( "places-sticky")
self.minimized = self.settings.get_boolean( "places-minimized", False ) self.minimized = self.settings.get_boolean( "places-minimized")
def ClearAll(self): def ClearAll(self):
for child in self.placesBtnHolder.get_children(): for child in self.placesBtnHolder.get_children():
@ -140,7 +140,7 @@ class pluginclass( object ):
else: else:
Button1.connect( "clicked", self.ButtonClicked, "xdg-open /" ) Button1.connect( "clicked", self.ButtonClicked, "xdg-open /" )
Button1.show() Button1.show()
self.placesBtnHolder.pack_start( Button1, False, False ) self.placesBtnHolder.pack_start( Button1, False, False, 0)
self.mintMenuWin.setTooltip( Button1, _("Browse all local and remote disks and folders accessible from this computer") ) self.mintMenuWin.setTooltip( Button1, _("Browse all local and remote disks and folders accessible from this computer") )
if ( self.showhomefolder == True ): if ( self.showhomefolder == True ):
@ -150,7 +150,7 @@ class pluginclass( object ):
else: else:
Button2.connect( "clicked", self.ButtonClicked, "xdg-open %s " % home ) Button2.connect( "clicked", self.ButtonClicked, "xdg-open %s " % home )
Button2.show() Button2.show()
self.placesBtnHolder.pack_start( Button2, False, False ) self.placesBtnHolder.pack_start( Button2, False, False, 0)
self.mintMenuWin.setTooltip( Button2, _("Open your personal folder") ) self.mintMenuWin.setTooltip( Button2, _("Open your personal folder") )
if ( self.shownetwork == True and self.de == "mate"): if ( self.shownetwork == True and self.de == "mate"):
@ -165,7 +165,7 @@ class pluginclass( object ):
else: else:
Button3.connect( "clicked", self.ButtonClicked, "xdg-open network:" ) Button3.connect( "clicked", self.ButtonClicked, "xdg-open network:" )
Button3.show() Button3.show()
self.placesBtnHolder.pack_start( Button3, False, False ) self.placesBtnHolder.pack_start( Button3, False, False, 0)
self.mintMenuWin.setTooltip( Button3, _("Browse bookmarked and local network locations") ) self.mintMenuWin.setTooltip( Button3, _("Browse bookmarked and local network locations") )
if ( self.showdesktop == True ): if ( self.showdesktop == True ):
@ -188,7 +188,7 @@ class pluginclass( object ):
else: else:
Button4.connect( "clicked", self.ButtonClicked, "xdg-open \"" + desktopDir + "\"") Button4.connect( "clicked", self.ButtonClicked, "xdg-open \"" + desktopDir + "\"")
Button4.show() Button4.show()
self.placesBtnHolder.pack_start( Button4, False, False ) self.placesBtnHolder.pack_start( Button4, False, False, 0)
self.mintMenuWin.setTooltip( Button4, _("Browse items placed on the desktop") ) self.mintMenuWin.setTooltip( Button4, _("Browse items placed on the desktop") )
if ( self.showtrash == True ): if ( self.showtrash == True ):
@ -202,7 +202,7 @@ class pluginclass( object ):
self.trashButton.show() self.trashButton.show()
self.trashButton.connect( "button-release-event", self.trashPopup ) self.trashButton.connect( "button-release-event", self.trashPopup )
self.refreshTrash() self.refreshTrash()
self.placesBtnHolder.pack_start( self.trashButton, False, False ) self.placesBtnHolder.pack_start( self.trashButton, False, False, 0)
self.mintMenuWin.setTooltip( self.trashButton, _("Browse deleted files") ) self.mintMenuWin.setTooltip( self.trashButton, _("Browse deleted files") )
def do_custom_places( self ): def do_custom_places( self ):
@ -216,7 +216,7 @@ class pluginclass( object ):
currentbutton = easyButton( "folder", self.iconsize, [self.customnames[index]], -1, -1 ) currentbutton = easyButton( "folder", self.iconsize, [self.customnames[index]], -1, -1 )
currentbutton.connect( "clicked", self.ButtonClicked, command ) currentbutton.connect( "clicked", self.ButtonClicked, command )
currentbutton.show() currentbutton.show()
self.placesBtnHolder.pack_start( currentbutton, False, False ) self.placesBtnHolder.pack_start( currentbutton, False, False, 0)
def do_gtk_bookmarks( self ): def do_gtk_bookmarks( self ):
if self.showGTKBookmarks: if self.showGTKBookmarks: