Convert system management plugin

This commit is contained in:
Michael Webster 2013-03-05 21:14:11 -05:00
parent 3884197e01
commit 1b1781d78f
5 changed files with 271 additions and 119 deletions

View File

@ -868,7 +868,7 @@ class pluginclass( object ):
insertBefore = True insertBefore = True
if widget.type == "location": if widget.type == "location":
mTree = self.builder( "favoritesMenu" ) mTree = self.builder.get_object( "favoritesMenu" )
#i18n #i18n
desktopMenuItem = Gtk.MenuItem(_("Add to desktop")) desktopMenuItem = Gtk.MenuItem(_("Add to desktop"))
@ -899,44 +899,44 @@ class pluginclass( object ):
propsMenuItem.connect( "activate", self.onPropsApp, widget) propsMenuItem.connect( "activate", self.onPropsApp, widget)
if self.de == "mate": if self.de == "mate":
mTree.get_widget("favoritesMenu").append(desktopMenuItem) mTree.append(desktopMenuItem)
mTree.get_widget("favoritesMenu").append(panelMenuItem) mTree.append(panelMenuItem)
mTree.get_widget("favoritesMenu").append(separator1) mTree.append(separator1)
mTree.get_widget("favoritesMenu").append(insertSpaceMenuItem) mTree.append(insertSpaceMenuItem)
mTree.get_widget("favoritesMenu").append(insertSeparatorMenuItem) mTree.append(insertSeparatorMenuItem)
mTree.get_widget("favoritesMenu").append(separator2) mTree.append(separator2)
mTree.get_widget("favoritesMenu").append(startupMenuItem) mTree.append(startupMenuItem)
mTree.get_widget("favoritesMenu").append(separator3) mTree.append(separator3)
mTree.get_widget("favoritesMenu").append(launchMenuItem) mTree.append(launchMenuItem)
mTree.get_widget("favoritesMenu").append(removeFromFavMenuItem) mTree.append(removeFromFavMenuItem)
mTree.get_widget("favoritesMenu").append(separator4) mTree.append(separator4)
mTree.get_widget("favoritesMenu").append(propsMenuItem) mTree.append(propsMenuItem)
mTree.get_widget("favoritesMenu").show_all() mTree.show_all()
mTree.get_widget( "favoritesMenu" ).popup( None, None, None, ev.button, ev.time ) mTree.popup( None, None, None, ev.button, ev.time )
self.mintMenuWin.grab() self.mintMenuWin.grab()
else: else:
mTree = self.builder( "favoritesMenuExtra" ) mTree = self.builder.get_object( "favoritesMenuExtra" )
#i18n #i18n
removeMenuItem = Gtk.MenuItem(_("Remove")) removeMenuItem = Gtk.MenuItem(_("Remove"))
insertSpaceMenuItem = Gtk.MenuItem(_("Insert space")) insertSpaceMenuItem = Gtk.MenuItem(_("Insert space"))
insertSeparatorMenuItem = Gtk.MenuItem(_("Insert separator")) insertSeparatorMenuItem = Gtk.MenuItem(_("Insert separator"))
mTree.get_widget("favoritesMenuExtra").append(removeMenuItem) mTree.append(removeMenuItem)
mTree.get_widget("favoritesMenuExtra").append(insertSpaceMenuItem) mTree.append(insertSpaceMenuItem)
mTree.get_widget("favoritesMenuExtra").append(insertSeparatorMenuItem) mTree.append(insertSeparatorMenuItem)
mTree.get_widget("favoritesMenuExtra").show_all() mTree.show_all()
removeMenuItem.connect( "activate", self.onFavoritesRemove, widget ) removeMenuItem.connect( "activate", self.onFavoritesRemove, widget )
insertSpaceMenuItem.connect( "activate", self.onFavoritesInsertSpace, widget, insertBefore ) insertSpaceMenuItem.connect( "activate", self.onFavoritesInsertSpace, widget, insertBefore )
insertSeparatorMenuItem.connect( "activate", self.onFavoritesInsertSeparator, widget, insertBefore ) insertSeparatorMenuItem.connect( "activate", self.onFavoritesInsertSeparator, widget, insertBefore )
mTree.get_widget( "favoritesMenuExtra" ).popup( None, None, None, ev.button, ev.time ) mTree.popup( None, None, None, ev.button, ev.time )
self.mintMenuWin.grab() self.mintMenuWin.grab()
def menuPopup( self, widget, event ): def menuPopup( self, widget, event ):
if event.button == 3: if event.button == 3:
mTree = self.builder ( "applicationsMenu" ) mTree = self.builder.get_object ( "applicationsMenu" )
#i18n #i18n
desktopMenuItem = Gtk.MenuItem(_("Add to desktop")) desktopMenuItem = Gtk.MenuItem(_("Add to desktop"))
@ -952,26 +952,26 @@ class pluginclass( object ):
propsMenuItem = Gtk.MenuItem(_("Edit properties")) propsMenuItem = Gtk.MenuItem(_("Edit properties"))
if self.de == "mate": if self.de == "mate":
mTree.get_widget("applicationsMenu").append(desktopMenuItem) mTree.append(desktopMenuItem)
mTree.get_widget("applicationsMenu").append(panelMenuItem) mTree.append(panelMenuItem)
mTree.get_widget("applicationsMenu").append(separator1) mTree.append(separator1)
mTree.get_widget("applicationsMenu").append(favoriteMenuItem) mTree.append(favoriteMenuItem)
mTree.get_widget("applicationsMenu").append(startupMenuItem) mTree.append(startupMenuItem)
mTree.get_widget("applicationsMenu").append(separator2) mTree.append(separator2)
mTree.get_widget("applicationsMenu").append(launchMenuItem) mTree.append(launchMenuItem)
mTree.get_widget("applicationsMenu").append(uninstallMenuItem) mTree.append(uninstallMenuItem)
if home in widget.desktopFile: if home in widget.desktopFile:
mTree.get_widget("applicationsMenu").append(deleteMenuItem) mTree.append(deleteMenuItem)
deleteMenuItem.connect("activate", self.delete_from_menu, widget) deleteMenuItem.connect("activate", self.delete_from_menu, widget)
mTree.get_widget("applicationsMenu").append(separator3) mTree.append(separator3)
mTree.get_widget("applicationsMenu").append(propsMenuItem) mTree.append(propsMenuItem)
mTree.get_widget("applicationsMenu").show_all() mTree.show_all()
desktopMenuItem.connect("activate", self.add_to_desktop, widget) desktopMenuItem.connect("activate", self.add_to_desktop, widget)
panelMenuItem.connect("activate", self.add_to_panel, widget) panelMenuItem.connect("activate", self.add_to_panel, widget)
@ -994,8 +994,8 @@ class pluginclass( object ):
startupMenuItem.set_active( False ) startupMenuItem.set_active( False )
startupMenuItem.connect( "toggled", self.onAddToStartup, widget ) startupMenuItem.connect( "toggled", self.onAddToStartup, widget )
mTree.get_widget( "applicationsMenu" ).connect( 'deactivate', self.onMenuPopupDeactivate) mTree.connect( 'deactivate', self.onMenuPopupDeactivate)
mTree.get_widget( "applicationsMenu" ).popup( None, None, None, event.button, event.time ) mTree.popup( None, None, None, event.button, event.time )
def onMenuPopupDeactivate( self, widget): def onMenuPopupDeactivate( self, widget):
self.mintMenuWin.grab() self.mintMenuWin.grab()

View File

@ -1,56 +1,56 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<glade-interface> <interface>
<!-- 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">
<signal name="destroy" handler="on_window1_destroy"/> <signal handler="on_window1_destroy" name="destroy"/>
<child> <child>
<widget class="GtkEventBox" id="System"> <object class="GtkEventBox" id="System">
<property name="visible">True</property> <property name="visible">True</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_motion" name="drag_motion"/>
<signal name="drag_drop" handler="on_scrolledwindow_drag_drop"/> <signal handler="on_scrolledwindow_drag_drop" name="drag_drop"/>
<signal name="drag_data_received" handler="on_scrolledwindow_drag_data_received"/> <signal handler="on_scrolledwindow_drag_data_received" name="drag_data_received"/>
<child> <child>
<widget class="GtkViewport" id="viewport2"> <object class="GtkViewport" id="viewport2">
<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="vbox1"> <object class="GtkVBox" id="vbox1">
<property name="visible">True</property> <property name="visible">True</property>
<child> <child>
<widget class="GtkVBox" id="system_button_holder"> <object class="GtkVBox" id="system_button_holder">
<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="spacing">2</property> <property name="spacing">2</property>
</widget> </object>
<packing> <packing>
<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="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,56 @@
<?xml version="1.0"?>
<glade-interface>
<!-- interface-requires gtk+ 2.6 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="mainWindow">
<signal name="destroy" handler="on_window1_destroy"/>
<child>
<widget class="GtkEventBox" id="System">
<property name="visible">True</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_motion" handler="on_scrolledwindow_drag_motion"/>
<signal name="drag_drop" handler="on_scrolledwindow_drag_drop"/>
<signal name="drag_data_received" handler="on_scrolledwindow_drag_data_received"/>
<child>
<widget class="GtkViewport" id="viewport2">
<property name="visible">True</property>
<property name="shadow_type">none</property>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<child>
<widget class="GtkVBox" id="system_button_holder">
<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="spacing">2</property>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkVButtonBox" id="editable_button_holder">
<property name="visible">True</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,14 +1,16 @@
#!/usr/bin/env python #!/usr/bin/env python
import gtk import gi
import gtk.glade gi.require_version("Gtk", "2.0")
from gi.repository import Gtk
import os import os
import string import string
import gettext import gettext
from easybuttons import * from easybuttons import *
from execute import Execute from execute import Execute
from easygconf import EasyGConf from easygsettings import EasyGSettings
# i18n # i18n
gettext.install("mintmenu", "/usr/share/linuxmint/locale") gettext.install("mintmenu", "/usr/share/linuxmint/locale")
@ -21,103 +23,104 @@ class pluginclass( object ):
self.toggleButton = toggleButton self.toggleButton = toggleButton
self.de = de self.de = de
# Read GLADE file
gladefile = os.path.join( os.path.dirname( __file__ ), "system_management.glade" ) self.builder = Gtk.Builder()
wTree = gtk.glade.XML( gladefile, "mainWindow" ) self.builder.add_from_file (os.path.join( os.path.dirname( __file__ ), "system_management.glade" ))
self.systemBtnHolder = wTree.get_widget( "system_button_holder" )
self.editableBtnHolder = wTree.get_widget( "editable_button_holder" ) self.systemBtnHolder = self.builder.get_object( "system_button_holder" )
self.scrolledWindow = wTree.get_widget( "scrolledwindow2" ) self.editableBtnHolder = self.builder.get_object( "editable_button_holder" )
self.scrolledWindow = self.builder.get_object( "scrolledwindow2" )
# 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 = wTree.get_widget( "mainWindow" ) self.window = self.builder.get_object( "mainWindow" )
# Set 'heading' property for plugin # Set 'heading' property for plugin
self.heading = _("System") self.heading = _("System")
# 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 = wTree.get_widget( "System" ) self.content_holder = self.builder.get_object( "System" )
# Items to get custom colors # Items to get custom colors
self.itemstocolor = [ wTree.get_widget( "viewport2" ) ] self.itemstocolor = [ self.builder.get_object( "viewport2" ) ]
# Gconf stuff # Gconf stuff
self.gconf = EasyGConf( "/apps/mintMenu/plugins/system-management/" ) self.settings = EasyGSettings( "com.linuxmint.mintmenu.plugins.system_management" )
self.gconf.notifyAdd( "icon_size", self.RegenPlugin ) self.settings.notifyAdd( "icon_size", self.RegenPlugin )
self.gconf.notifyAdd( "show_control_center", self.RegenPlugin ) self.settings.notifyAdd( "show_control_center", self.RegenPlugin )
self.gconf.notifyAdd( "show_lock_screen", self.RegenPlugin ) self.settings.notifyAdd( "show_lock_screen", self.RegenPlugin )
self.gconf.notifyAdd( "show_logout", self.RegenPlugin ) self.settings.notifyAdd( "show_logout", self.RegenPlugin )
self.gconf.notifyAdd( "show_package_manager", self.RegenPlugin ) self.settings.notifyAdd( "show_package_manager", self.RegenPlugin )
self.gconf.notifyAdd( "show_software_manager", self.RegenPlugin ) self.settings.notifyAdd( "show_software_manager", self.RegenPlugin )
self.gconf.notifyAdd( "show_terminal", self.RegenPlugin ) self.settings.notifyAdd( "show_terminal", self.RegenPlugin )
self.gconf.notifyAdd( "show_quit", self.RegenPlugin ) self.settings.notifyAdd( "show_quit", self.RegenPlugin )
self.gconf.notifyAdd( "allowScrollbar", self.RegenPlugin ) self.settings.notifyAdd( "allow-scrollbar", self.RegenPlugin )
self.gconf.notifyAdd( "height", self.changePluginSize ) self.settings.notifyAdd( "height", self.changePluginSize )
self.gconf.notifyAdd( "width", self.changePluginSize ) self.settings.notifyAdd( "width", self.changePluginSize )
self.gconf.bindGconfEntryToVar( "bool", "sticky", self, "sticky" ) self.settings.bindGSettingsEntryToVar( "bool", "sticky", self, "sticky" )
self.GetGconfEntries() self.GetGSettingsEntries()
self.content_holder.set_size_request( self.width, self.height ) self.content_holder.set_size_request( self.width, self.height )
def destroy( self ): def destroy( self ):
self.gconf.notifyRemoveAll() self.settings.notifyRemoveAll()
def wake (self) : def wake (self) :
pass pass
def changePluginSize( self, client, connection_id, entry, args ): def changePluginSize( self, settings, key, args ):
self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False) self.allowScrollbar = self.settings.get( "bool", "allow-scrollbar")
if entry.get_key() == self.gconf.gconfDir+"width": if key == "width":
self.width = entry.get_value().get_int() self.width = settings.get_int(key)
elif entry.get_key() == self.gconf.gconfDir+"height": elif key == "height":
if (self.allowScrollbar == False): if (self.allowScrollbar == False):
self.height = -1 self.height = -1
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER ) self.scrolledWindow.set_policy( Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.NEVER )
else: else:
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC ) self.scrolledWindow.set_policy( Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC )
self.height = entry.get_value().get_int() self.height = settings.get_int(key)
self.content_holder.set_size_request( self.width, self.height ) self.content_holder.set_size_request( self.width, self.height )
def RegenPlugin( self, *args, **kargs ): def RegenPlugin( self, settings, key, args ):
self.GetGconfEntries() self.GetGSettingsEntries()
self.ClearAll() self.ClearAll()
self.do_standard_items() self.do_standard_items()
def GetGconfEntries( self ): def GetGSettingsEntries( self ):
self.width = self.gconf.get( "int", "width", 200 ) self.width = self.settings.get( "int", "width")
self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False) self.allowScrollbar = self.settings.get( "bool", "allow-scrollbar")
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC ) self.scrolledWindow.set_policy( Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC )
self.height = self.gconf.get( "int", "height", 180 ) self.height = self.settings.get( "int", "height")
self.content_holder.set_size_request( self.width, self.height ) self.content_holder.set_size_request( self.width, self.height )
if (self.allowScrollbar == False): if (self.allowScrollbar == False):
self.height = -1 self.height = -1
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER ) self.scrolledWindow.set_policy( Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.NEVER )
self.content_holder.set_size_request( self.width, self.height ) self.content_holder.set_size_request( self.width, self.height )
self.iconsize = self.gconf.get( "int","icon_size", 16 ) self.iconsize = self.settings.get( "int","icon-size")
# Check toggles # Check toggles
self.showSoftwareManager = self.gconf.get( "bool", "show_software_manager", True ) self.showSoftwareManager = self.settings.get( "bool", "show-software-manager")
self.showPackageManager = self.gconf.get( "bool", "show_package_manager", True ) self.showPackageManager = self.settings.get( "bool", "show-package-manager")
self.showControlCenter = self.gconf.get( "bool", "show_control_center", True ) self.showControlCenter = self.settings.get( "bool", "show-control-center")
self.showTerminal = self.gconf.get( "bool", "show_terminal", True ) self.showTerminal = self.settings.get( "bool", "show-terminal")
self.showLockScreen = self.gconf.get( "bool", "show_lock_screen", True ) self.showLockScreen = self.settings.get( "bool", "show-lock-screen")
self.showLogout = self.gconf.get( "bool", "show_logout", True ) self.showLogout = self.settings.get( "bool", "show-logout")
self.showQuit = self.gconf.get( "bool", "show_quit", True ) self.showQuit = self.settings.get( "bool", "show-quit")
# Hide vertical dotted separator # Hide vertical dotted separator
self.hideseparator = self.gconf.get( "bool", "hide_separator", False ) self.hideseparator = self.settings.get( "bool", "hide-separator")
# Plugin icon # Plugin icon
self.icon = self.gconf.get( "string", 'icon', "preferences-system" ) self.icon = self.settings.get( "string", "icon" )
# Allow plugin to be minimized to the left plugin pane # Allow plugin to be minimized to the left plugin pane
self.sticky = self.gconf.get( "bool", "sticky", False ) self.sticky = self.settings.get( "bool", "sticky")
self.minimized = self.gconf.get( "bool", "minimized", False ) self.minimized = self.settings.get( "bool", "minimized")
def ClearAll(self): def ClearAll(self):
for child in self.systemBtnHolder.get_children(): for child in self.systemBtnHolder.get_children():
@ -133,14 +136,14 @@ class pluginclass( object ):
Button1 = easyButton( "/usr/lib/linuxmint/mintInstall/icon.svg", self.iconsize, [_("Software Manager")], -1, -1 ) Button1 = easyButton( "/usr/lib/linuxmint/mintInstall/icon.svg", self.iconsize, [_("Software Manager")], -1, -1 )
Button1.connect( "clicked", self.ButtonClicked, "gksu mintinstall" ) Button1.connect( "clicked", self.ButtonClicked, "gksu mintinstall" )
Button1.show() Button1.show()
self.systemBtnHolder.pack_start( Button1, False, False ) self.systemBtnHolder.pack_start( Button1, False, False, 0)
self.mintMenuWin.setTooltip( Button1, _("Browse and install available software") ) self.mintMenuWin.setTooltip( Button1, _("Browse and install available software") )
if ( self.showPackageManager == True ): if ( self.showPackageManager == True ):
Button2 = easyButton( "applications-system", self.iconsize, [_("Package Manager")], -1, -1 ) Button2 = easyButton( "applications-system", self.iconsize, [_("Package Manager")], -1, -1 )
Button2.connect( "clicked", self.ButtonClicked, "gksu /usr/sbin/synaptic" ) Button2.connect( "clicked", self.ButtonClicked, "gksu /usr/sbin/synaptic" )
Button2.show() Button2.show()
self.systemBtnHolder.pack_start( Button2, False, False ) self.systemBtnHolder.pack_start( Button2, False, False, 0 )
self.mintMenuWin.setTooltip( Button2, _("Install, remove and upgrade software packages") ) self.mintMenuWin.setTooltip( Button2, _("Install, remove and upgrade software packages") )
if ( self.showControlCenter == True ): if ( self.showControlCenter == True ):
@ -150,7 +153,7 @@ class pluginclass( object ):
else: else:
Button3.connect( "clicked", self.ButtonClicked, "mate-control-center" ) Button3.connect( "clicked", self.ButtonClicked, "mate-control-center" )
Button3.show() Button3.show()
self.systemBtnHolder.pack_start( Button3, False, False ) self.systemBtnHolder.pack_start( Button3, False, False, 0 )
self.mintMenuWin.setTooltip( Button3, _("Configure your system") ) self.mintMenuWin.setTooltip( Button3, _("Configure your system") )
if ( self.showTerminal == True ): if ( self.showTerminal == True ):
@ -160,14 +163,14 @@ class pluginclass( object ):
else: else:
Button4.connect( "clicked", self.ButtonClicked, "x-terminal-emulator" ) Button4.connect( "clicked", self.ButtonClicked, "x-terminal-emulator" )
Button4.show() Button4.show()
self.systemBtnHolder.pack_start( Button4, False, False ) self.systemBtnHolder.pack_start( Button4, False, False, 0 )
self.mintMenuWin.setTooltip( Button4, _("Use the command line") ) self.mintMenuWin.setTooltip( Button4, _("Use the command line") )
if self.de == "xfce": if self.de == "xfce":
Button6 = easyButton( "system-log-out", self.iconsize, [_("Logout")], -1, -1 ) Button6 = easyButton( "system-log-out", self.iconsize, [_("Logout")], -1, -1 )
Button6.connect( "clicked", self.ButtonClicked, "xfce4-session-logout" ) Button6.connect( "clicked", self.ButtonClicked, "xfce4-session-logout" )
Button6.show() Button6.show()
self.systemBtnHolder.pack_start( Button6, False, False ) self.systemBtnHolder.pack_start( Button6, False, False, 0 )
self.mintMenuWin.setTooltip( Button6, _("Log out or switch user") ) self.mintMenuWin.setTooltip( Button6, _("Log out or switch user") )
else: else:
if ( self.showLockScreen == True ): if ( self.showLockScreen == True ):
@ -177,21 +180,21 @@ class pluginclass( object ):
else: else:
Button5.connect( "clicked", self.ButtonClicked, "xdg-screensaver lock" ) Button5.connect( "clicked", self.ButtonClicked, "xdg-screensaver lock" )
Button5.show() Button5.show()
self.systemBtnHolder.pack_start( Button5, False, False ) self.systemBtnHolder.pack_start( Button5, False, False, 0 )
self.mintMenuWin.setTooltip( Button5, _("Requires password to unlock") ) self.mintMenuWin.setTooltip( Button5, _("Requires password to unlock") )
if ( self.showLogout == True ): if ( self.showLogout == True ):
Button6 = easyButton( "system-log-out", self.iconsize, [_("Logout")], -1, -1 ) Button6 = easyButton( "system-log-out", self.iconsize, [_("Logout")], -1, -1 )
Button6.connect( "clicked", self.ButtonClicked, "mate-session-save --logout-dialog" ) Button6.connect( "clicked", self.ButtonClicked, "mate-session-save --logout-dialog" )
Button6.show() Button6.show()
self.systemBtnHolder.pack_start( Button6, False, False ) self.systemBtnHolder.pack_start( Button6, False, False, 0 )
self.mintMenuWin.setTooltip( Button6, _("Log out or switch user") ) self.mintMenuWin.setTooltip( Button6, _("Log out or switch user") )
if ( self.showQuit == True ): if ( self.showQuit == True ):
Button7 = easyButton( "system-shutdown", self.iconsize, [_("Quit")], -1, -1 ) Button7 = easyButton( "system-shutdown", self.iconsize, [_("Quit")], -1, -1 )
Button7.connect( "clicked", self.ButtonClicked, "mate-session-save --shutdown-dialog" ) Button7.connect( "clicked", self.ButtonClicked, "mate-session-save --shutdown-dialog" )
Button7.show() Button7.show()
self.systemBtnHolder.pack_start( Button7, False, False ) self.systemBtnHolder.pack_start( Button7, False, False, 0 )
self.mintMenuWin.setTooltip( Button7, _("Shutdown, restart, suspend or hibernate") ) self.mintMenuWin.setTooltip( Button7, _("Shutdown, restart, suspend or hibernate") )
def ButtonClicked( self, widget, Exec ): def ButtonClicked( self, widget, Exec ):

View File

@ -312,9 +312,102 @@
<summary></summary> <summary></summary>
<description></description> <description></description>
</key> </key>
</schema>
<schema id="com.linuxmint.mintmenu.plugins.system_management" path="/com/linuxmint/mintmenu/plugins/system_management/">
<key type="i" name="width">
<default>200</default>
<summary></summary>
<description></description>
</key>
<key type="i" name="height">
<default>180</default>
<summary></summary>
<description></description>
</key>
<key type="b" name="allow-scrollbar">
<default>false</default>
<summary></summary>
<description></description>
</key>
<key type="i" name="icon-size">
<default>16</default>
<summary></summary>
<description></description>
</key>
<key type="b" name="show-software-manager">
<default>true</default>
<summary></summary>
<description></description>
</key>
<key type="b" name="show-package-manager">
<default>true</default>
<summary></summary>
<description></description>
</key>
<key type="b" name="show-control-center">
<default>true</default>
<summary></summary>
<description></description>
</key>
<key type="b" name="show-terminal">
<default>true</default>
<summary></summary>
<description></description>
</key>
<key type="b" name="show-lock-screen">
<default>true</default>
<summary></summary>
<description></description>
</key>
<key type="b" name="show-logout">
<default>true</default>
<summary></summary>
<description></description>
</key>
<key type="b" name="show-quit">
<default>true</default>
<summary></summary>
<description></description>
</key>
<key type="b" name="hide-separator">
<default>false</default>
<summary></summary>
<description></description>
</key>
<key type="b" name="sticky">
<default>false</default>
<summary></summary>
<description></description>
</key>
<key type="b" name="minimized">
<default>false</default>
<summary></summary>
<description></description>
</key>
<key type="s" name="icon">
<default>"preferences-system"</default>
<summary></summary>
<description></description>
</key>
</schema> </schema>
</schemalist> </schemalist>