Customizing System plugin and lock screen button
This commit is contained in:
parent
82c11a2d37
commit
d896f93794
@ -27,6 +27,7 @@ class pluginclass( object ):
|
|||||||
wTree = gtk.glade.XML( gladefile, "mainWindow" )
|
wTree = gtk.glade.XML( gladefile, "mainWindow" )
|
||||||
self.systemBtnHolder = wTree.get_widget( "system_button_holder" )
|
self.systemBtnHolder = wTree.get_widget( "system_button_holder" )
|
||||||
self.editableBtnHolder = wTree.get_widget( "editable_button_holder" )
|
self.editableBtnHolder = wTree.get_widget( "editable_button_holder" )
|
||||||
|
self.scrolledWindow = wTree.get_widget( "scrolledwindow2" )
|
||||||
|
|
||||||
# These properties are NECESSARY to maintain consistency
|
# These properties are NECESSARY to maintain consistency
|
||||||
|
|
||||||
@ -77,9 +78,24 @@ class pluginclass( object ):
|
|||||||
def GetGconfEntries( self ):
|
def GetGconfEntries( self ):
|
||||||
|
|
||||||
self.width = self.gconf.get( "int", "width", 200 )
|
self.width = self.gconf.get( "int", "width", 200 )
|
||||||
self.height = self.gconf.get( "int", "height", 180 )
|
self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False)
|
||||||
|
if (self.allowScrollbar == False):
|
||||||
|
self.height = -1
|
||||||
|
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER )
|
||||||
|
else:
|
||||||
|
self.height = self.gconf.get( "int", "height", 180 )
|
||||||
self.iconsize = self.gconf.get( "int","icon_size", 2 )
|
self.iconsize = self.gconf.get( "int","icon_size", 2 )
|
||||||
|
|
||||||
|
# Check toggles
|
||||||
|
|
||||||
|
self.showSoftwareManager = self.gconf.get( "bool", "show_software_manager", True )
|
||||||
|
self.showPackageManager = self.gconf.get( "bool", "show_package_manager", True )
|
||||||
|
self.showControlCenter = self.gconf.get( "bool", "show_control_center", True )
|
||||||
|
self.showTerminal = self.gconf.get( "bool", "show_terminal", True )
|
||||||
|
self.showLockScreen = self.gconf.get( "bool", "show_lock_screen", True )
|
||||||
|
self.showLogout = self.gconf.get( "bool", "show_logout", True )
|
||||||
|
self.showQuit = self.gconf.get( "bool", "show_quit", True )
|
||||||
|
|
||||||
# Hide vertical dotted separator
|
# Hide vertical dotted separator
|
||||||
self.hideseparator = self.gconf.get( "bool", "hide_separator", False )
|
self.hideseparator = self.gconf.get( "bool", "hide_separator", False )
|
||||||
# Plugin icon
|
# Plugin icon
|
||||||
@ -97,42 +113,55 @@ class pluginclass( object ):
|
|||||||
#Add standard items
|
#Add standard items
|
||||||
def do_standard_items( self ):
|
def do_standard_items( self ):
|
||||||
|
|
||||||
if os.path.exists("/usr/lib/linuxmint/mintInstall/icon.svg"):
|
if ( self.showSoftwareManager == True ):
|
||||||
Button1 = easyButton( "/usr/lib/linuxmint/mintInstall/icon.svg", self.iconsize, [_("Software manager")], -1, -1 )
|
if os.path.exists("/usr/lib/linuxmint/mintInstall/icon.svg"):
|
||||||
Button1.connect( "clicked", self.ButtonClicked, "mintinstall" )
|
Button1 = easyButton( "/usr/lib/linuxmint/mintInstall/icon.svg", self.iconsize, [_("Software manager")], -1, -1 )
|
||||||
Button1.show()
|
Button1.connect( "clicked", self.ButtonClicked, "mintinstall" )
|
||||||
self.systemBtnHolder.pack_start( Button1, False, False )
|
Button1.show()
|
||||||
self.mintMenuWin.setTooltip( Button1, _("Browse and install available software") )
|
self.systemBtnHolder.pack_start( Button1, False, False )
|
||||||
|
self.mintMenuWin.setTooltip( Button1, _("Browse and install available software") )
|
||||||
|
|
||||||
Button2 = easyButton( "synaptic", self.iconsize, [_("Package manager")], -1, -1 )
|
if ( self.showPackageManager == True ):
|
||||||
Button2.connect( "clicked", self.ButtonClicked, "gksu /usr/sbin/synaptic" )
|
Button2 = easyButton( "synaptic", self.iconsize, [_("Package manager")], -1, -1 )
|
||||||
Button2.show()
|
Button2.connect( "clicked", self.ButtonClicked, "gksu /usr/sbin/synaptic" )
|
||||||
self.systemBtnHolder.pack_start( Button2, False, False )
|
Button2.show()
|
||||||
self.mintMenuWin.setTooltip( Button2, _("Install, remove and upgrade software packages") )
|
self.systemBtnHolder.pack_start( Button2, False, False )
|
||||||
|
self.mintMenuWin.setTooltip( Button2, _("Install, remove and upgrade software packages") )
|
||||||
|
|
||||||
Button3 = easyButton( "gtk-preferences", self.iconsize, [_("Control center")], -1, -1 )
|
if ( self.showControlCenter == True ):
|
||||||
Button3.connect( "clicked", self.ButtonClicked, "gnome-control-center" )
|
Button3 = easyButton( "gtk-preferences", self.iconsize, [_("Control center")], -1, -1 )
|
||||||
Button3.show()
|
Button3.connect( "clicked", self.ButtonClicked, "gnome-control-center" )
|
||||||
self.systemBtnHolder.pack_start( Button3, False, False )
|
Button3.show()
|
||||||
self.mintMenuWin.setTooltip( Button3, _("Configure your system") )
|
self.systemBtnHolder.pack_start( Button3, False, False )
|
||||||
|
self.mintMenuWin.setTooltip( Button3, _("Configure your system") )
|
||||||
|
|
||||||
Button4 = easyButton( "gnome-terminal", self.iconsize, [_("Terminal")], -1, -1 )
|
if ( self.showTerminal == True ):
|
||||||
Button4.connect( "clicked", self.ButtonClicked, "x-terminal-emulator" )
|
Button4 = easyButton( "gnome-terminal", self.iconsize, [_("Terminal")], -1, -1 )
|
||||||
Button4.show()
|
Button4.connect( "clicked", self.ButtonClicked, "x-terminal-emulator" )
|
||||||
self.systemBtnHolder.pack_start( Button4, False, False )
|
Button4.show()
|
||||||
self.mintMenuWin.setTooltip( Button4, _("Use the command line") )
|
self.systemBtnHolder.pack_start( Button4, False, False )
|
||||||
|
self.mintMenuWin.setTooltip( Button4, _("Use the command line") )
|
||||||
|
|
||||||
Button5 = easyButton( "system-log-out", self.iconsize, [_("Logout")], -1, -1 )
|
if ( self.showLockScreen == True ):
|
||||||
Button5.connect( "clicked", self.ButtonClicked, "gnome-session-save --logout-dialog" )
|
Button5 = easyButton( "system-lock-screen", self.iconsize, [_("Lock Screen")], -1, -1 )
|
||||||
Button5.show()
|
Button5.connect( "clicked", self.ButtonClicked, "gnome-screensaver-command --lock" )
|
||||||
self.systemBtnHolder.pack_start( Button5, False, False )
|
Button5.show()
|
||||||
self.mintMenuWin.setTooltip( Button5, _("Log out or switch user") )
|
self.systemBtnHolder.pack_start( Button5, False, False )
|
||||||
|
self.mintMenuWin.setTooltip( Button5, _("Requires password to unlock") )
|
||||||
|
|
||||||
Button6 = easyButton( "system-shutdown", self.iconsize, [_("Quit")], -1, -1 )
|
if ( self.showLogout == True ):
|
||||||
Button6.connect( "clicked", self.ButtonClicked, "gnome-session-save --shutdown-dialog" )
|
Button6 = easyButton( "system-log-out", self.iconsize, [_("Logout")], -1, -1 )
|
||||||
Button6.show()
|
Button6.connect( "clicked", self.ButtonClicked, "gnome-session-save --logout-dialog" )
|
||||||
self.systemBtnHolder.pack_start( Button6, False, False )
|
Button6.show()
|
||||||
self.mintMenuWin.setTooltip( Button6, _("Shutdown, restart, suspend or hibernate") )
|
self.systemBtnHolder.pack_start( Button6, False, False )
|
||||||
|
self.mintMenuWin.setTooltip( Button6, _("Log out or switch user") )
|
||||||
|
|
||||||
|
if ( self.showQuit == True ):
|
||||||
|
Button7 = easyButton( "system-shutdown", self.iconsize, [_("Quit")], -1, -1 )
|
||||||
|
Button7.connect( "clicked", self.ButtonClicked, "gnome-session-save --shutdown-dialog" )
|
||||||
|
Button7.show()
|
||||||
|
self.systemBtnHolder.pack_start( Button7, False, False )
|
||||||
|
self.mintMenuWin.setTooltip( Button7, _("Shutdown, restart, suspend or hibernate") )
|
||||||
|
|
||||||
def ButtonClicked( self, widget, Exec ):
|
def ButtonClicked( self, widget, Exec ):
|
||||||
self.mintMenuWin.hide()
|
self.mintMenuWin.hide()
|
||||||
|
Loading…
Reference in New Issue
Block a user