Implemented interface for customizing System

This commit is contained in:
clhodapp 2009-10-10 07:25:28 -05:00
parent 295d4dc2c1
commit 82c11a2d37
2 changed files with 245 additions and 5 deletions

View File

@ -846,6 +846,7 @@
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</widget> </widget>
<packing> <packing>
<property name="expand">False</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
@ -1180,6 +1181,217 @@
<property name="type">tab</property> <property name="type">tab</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkFrame" id="frame4">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<widget class="GtkAlignment" id="alignment4">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<widget class="GtkVBox" id="vbox5">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<widget class="GtkCheckButton" id="allowscrollbarcheckbutton1">
<property name="label" translatable="yes">Allow Scrollbar</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment6">
<property name="visible">True</property>
<property name="bottom_padding">3</property>
<property name="left_padding">5</property>
<child>
<widget class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="spacing">4</property>
<child>
<widget class="GtkLabel" id="placesHeightEntryLabel1">
<property name="visible">True</property>
<property name="label" translatable="yes">Height:</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="systemHeightSpinButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="max_length">5</property>
<property name="invisible_char">&#x25CF;</property>
<property name="caps_lock_warning">False</property>
<property name="adjustment">0 0 10000 1 10 10</property>
<property name="numeric">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="padding">4</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame5">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<widget class="GtkAlignment" id="alignment7">
<property name="visible">True</property>
<property name="top_padding">2</property>
<property name="bottom_padding">10</property>
<property name="left_padding">14</property>
<child>
<widget class="GtkVBox" id="vbox6">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<widget class="GtkCheckButton" id="packagemanagercheckbutton">
<property name="label" translatable="yes">Package Manager</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="controlcentercheckbutton">
<property name="label" translatable="yes">Control Center</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="terminalcheckbutton">
<property name="label" translatable="yes">Terminal</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="relief">none</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="lockcheckbutton">
<property name="label" translatable="yes">Lock Screen</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="yalign">0.54000002145767212</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="logoutcheckbutton">
<property name="label" translatable="yes">Logout</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="position">4</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="quitcheckbutton">
<property name="label" translatable="yes">Quit</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="position">5</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="defaultPlacesFrameLabel1">
<property name="visible">True</property>
<property name="label" translatable="yes">Toggle Default Items:</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label7">
<property name="visible">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="position">6</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="systemLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">System</property>
</widget>
<packing>
<property name="position">6</property>
<property name="tab_fill">False</property>
<property name="type">tab</property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>

View File

@ -123,17 +123,30 @@ class mintMenuConfig( object ):
self.desktoptoggle = wTree.get_widget( "desktopcheckbutton" ) self.desktoptoggle = wTree.get_widget( "desktopcheckbutton" )
self.trashtoggle = wTree.get_widget( "trashcheckbutton" ) self.trashtoggle = wTree.get_widget( "trashcheckbutton" )
self.customplacestree = wTree.get_widget( "customplacestree" ) self.customplacestree = wTree.get_widget( "customplacestree" )
self.allowScrollbarToggle = wTree.get_widget( "allowscrollbarcheckbutton" ) self.allowPlacesScrollbarToggle = wTree.get_widget( "allowscrollbarcheckbutton" )
self.placesHeightButton = wTree.get_widget( "placesHeightSpinButton" ) self.placesHeightButton = wTree.get_widget( "placesHeightSpinButton" )
if (self.allowScrollbarToggle.get_active() == False): if (self.allowPlacesScrollbarToggle.get_active() == False):
self.placesHeightButton.set_sensitive(False) self.placesHeightButton.set_sensitive(False)
self.allowScrollbarToggle.connect("toggled", self.toggleHeightEnabled ) self.allowPlacesScrollbarToggle.connect("toggled", self.togglePlacesHeightEnabled )
self.packageManagerToggle = wTree.get_widget( "packagemanagercheckbutton" )
self.controlCenterToggle = wTree.get_widget( "controlcentercheckbutton" )
self.packageManagerToggle = wTree.get_widget( "packagemanagercheckbutton" )
self.terminalToggle = wTree.get_widget( "terminalcheckbutton" )
self.lockToggle = wTree.get_widget( "lockcheckbutton" )
self.logoutToggle = wTree.get_widget( "logoutcheckbutton" )
self.quitToggle = wTree.get_widget( "quitcheckbutton" )
self.allowSystemScrollbarToggle = wTree.get_widget( "allowscrollbarcheckbutton1" )
self.systemHeightButton = wTree.get_widget( "systemHeightSpinButton" )
if (self.allowSystemScrollbarToggle.get_active() == False):
self.systemHeightButton.set_sensitive(False)
self.allowSystemScrollbarToggle.connect("toggled", self.toggleSystemHeightEnabled )
wTree.get_widget( "closeButton" ).connect("clicked", gtk.main_quit ) wTree.get_widget( "closeButton" ).connect("clicked", gtk.main_quit )
self.gconf = EasyGConf( "/apps/mintMenu/" ) self.gconf = EasyGConf( "/apps/mintMenu/" )
self.gconfApplications = EasyGConf( "/apps/mintMenu/plugins/applications/" ) self.gconfApplications = EasyGConf( "/apps/mintMenu/plugins/applications/" )
self.gconfPlaces = EasyGConf( "/apps/mintMenu/plugins/places/" ) self.gconfPlaces = EasyGConf( "/apps/mintMenu/plugins/places/" )
self.gconfSystem = EasyGConf( "/apps/mintMenu/plugins/system-management/" )
self.useCustomColors.connect( "toggled", self.toggleUseCustomColors ) self.useCustomColors.connect( "toggled", self.toggleUseCustomColors )
@ -169,8 +182,17 @@ class mintMenuConfig( object ):
self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_desktop", self.desktoptoggle, "toggled", self.desktoptoggle.set_active, self.desktoptoggle.get_active ) self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_desktop", self.desktoptoggle, "toggled", self.desktoptoggle.set_active, self.desktoptoggle.get_active )
self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_trash", self.trashtoggle, "toggled", self.trashtoggle.set_active, self.trashtoggle.get_active ) self.bindGconfValueToWidget( self.gconfPlaces, "bool", "show_trash", self.trashtoggle, "toggled", self.trashtoggle.set_active, self.trashtoggle.get_active )
self.bindGconfValueToWidget( self.gconfPlaces, "int", "height", self.placesHeightButton, "value-changed", self.placesHeightButton.set_value, self.placesHeightButton.get_value_as_int ) self.bindGconfValueToWidget( self.gconfPlaces, "int", "height", self.placesHeightButton, "value-changed", self.placesHeightButton.set_value, self.placesHeightButton.get_value_as_int )
self.bindGconfValueToWidget( self.gconfPlaces, "bool", "allowScrollbar", self.allowScrollbarToggle, "toggled", self.allowScrollbarToggle.set_active, self.allowScrollbarToggle.get_active ) self.bindGconfValueToWidget( self.gconfPlaces, "bool", "allowScrollbar", self.allowPlacesScrollbarToggle, "toggled", self.allowPlacesScrollbarToggle.set_active, self.allowPlacesScrollbarToggle.get_active )
self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_package_manager", self.packageManagerToggle, "toggled", self.packageManagerToggle.set_active, self.packageManagerToggle.get_active )
self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_control_center", self.controlCenterToggle, "toggled", self.controlCenterToggle.set_active, self.controlCenterToggle.get_active )
self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_terminal", self.terminalToggle, "toggled", self.terminalToggle.set_active, self.terminalToggle.get_active )
self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_lock_screen", self.lockToggle, "toggled", self.lockToggle.set_active, self.lockToggle.get_active )
self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_logout", self.logoutToggle, "toggled", self.logoutToggle.set_active, self.logoutToggle.get_active )
self.bindGconfValueToWidget( self.gconfSystem, "bool", "show_quit", self.quitToggle, "toggled", self.quitToggle.set_active, self.quitToggle.get_active )
self.bindGconfValueToWidget( self.gconfSystem, "int", "height", self.systemHeightButton, "value-changed", self.systemHeightButton.set_value, self.systemHeightButton.get_value_as_int )
self.bindGconfValueToWidget( self.gconfSystem, "bool", "allowScrollbar", self.allowSystemScrollbarToggle, "toggled", self.allowSystemScrollbarToggle.set_active, self.allowSystemScrollbarToggle.get_active )
self.customplacenames = self.gconfPlaces.get( "list-string", "custom_names", [ ] ) self.customplacenames = self.gconfPlaces.get( "list-string", "custom_names", [ ] )
self.customplacepaths = self.gconfPlaces.get( "list-string", "custom_paths", [ ] ) self.customplacepaths = self.gconfPlaces.get( "list-string", "custom_paths", [ ] )
@ -378,12 +400,18 @@ class mintMenuConfig( object ):
return return
def toggleHeightEnabled(self, toggle): def togglePlacesHeightEnabled(self, toggle):
if (toggle.get_active() == True): if (toggle.get_active() == True):
self.placesHeightButton.set_sensitive(True) self.placesHeightButton.set_sensitive(True)
else: else:
self.placesHeightButton.set_sensitive(False) self.placesHeightButton.set_sensitive(False)
def toggleSystemHeightEnabled(self, toggle):
if (toggle.get_active() == True):
self.systemHeightButton.set_sensitive(True)
else:
self.systemHeightButton.set_sensitive(False)
def updatePlacesGconf(self, treemodel, path, iter = None, new_order = None): def updatePlacesGconf(self, treemodel, path, iter = None, new_order = None):
# Do only if not partway though an append operation; Append = insert+change+change and each creates a signal # Do only if not partway though an append operation; Append = insert+change+change and each creates a signal
if ((iter == None) or (self.customplacestreemodel.get_value(iter, 1) != None)): if ((iter == None) or (self.customplacestreemodel.get_value(iter, 1) != None)):