Added option to always open menu with the Favorites panel
This commit is contained in:
parent
4a438e86fe
commit
0d79de686e
@ -42,6 +42,7 @@ gettext.install("mintmenu", "/usr/share/linuxmint/locale")
|
||||
|
||||
NAME = _("Menu")
|
||||
PATH = os.path.abspath( os.path.dirname( sys.argv[0] ) )
|
||||
|
||||
ICON = "/usr/lib/linuxmint/mintMenu/mintMenu.png"
|
||||
|
||||
sys.path.append( os.path.join( PATH , "plugins") )
|
||||
@ -60,7 +61,7 @@ class MainWindow( object ):
|
||||
|
||||
def __init__( self, toggleButton ):
|
||||
|
||||
self.path = os.path.abspath( os.path.dirname( sys.argv[0] ) )
|
||||
self.path = PATH
|
||||
sys.path.append( os.path.join( self.path, "plugins") )
|
||||
|
||||
self.icon = ICON
|
||||
@ -113,6 +114,7 @@ class MainWindow( object ):
|
||||
self.gconftheme.notifyAdd( "gtk_theme", self.RegenPlugins )
|
||||
|
||||
self.gconf.notifyAdd( "show_side_pane", self.toggleShowSidepane )
|
||||
self.gconf.notifyAdd( "start_with_favorites", self.toggleStartWithFavorites )
|
||||
self.gconf.notifyAdd( "/apps/panel/global/tooltips_enabled", self.toggleTooltipsEnabled )
|
||||
self.gconf.notifyAdd( "tooltips_enabled", self.toggleTooltipsEnabled )
|
||||
|
||||
@ -143,6 +145,9 @@ class MainWindow( object ):
|
||||
else:
|
||||
self.tooltips.disable()
|
||||
|
||||
def toggleStartWithFavorites( self, client, connection_id, entry, args ):
|
||||
self.startWithFavorites = entry.get_value().get_bool()
|
||||
|
||||
def toggleShowSidepane( self, client, connection_id, entry, args ):
|
||||
self.sidepanevisible = entry.get_value().get_bool()
|
||||
if self.sidepanevisible == False and self.pinmenu == False:
|
||||
@ -189,6 +194,7 @@ class MainWindow( object ):
|
||||
self.enableTooltips = self.gconf.get( "bool", "tooltips_enabled", True )
|
||||
self.globalEnableTooltips = self.gconf.get( "bool", "/apps/panel/global/tooltips_enabled", True )
|
||||
self.sidepanevisible = self.gconf.get( "bool", "show_side_pane", False )
|
||||
self.startWithFavorites = self.gconf.get( "bool", "start_with_favorites", False )
|
||||
|
||||
|
||||
def PinMenu(self, *args, **kargs):
|
||||
@ -480,6 +486,8 @@ class MainWindow( object ):
|
||||
self.window.present()
|
||||
|
||||
if ( "applications" in self.plugins ) and ( hasattr( self.plugins["applications"], "focusSearchEntry" ) ):
|
||||
if (self.startWithFavorites):
|
||||
self.plugins["applications"].changeTab(0)
|
||||
self.plugins["applications"].focusSearchEntry()
|
||||
|
||||
def grab( self ):
|
||||
|
@ -216,24 +216,29 @@
|
||||
<widget class="GtkHBox" id="hbox11">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox11">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame17">
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment38">
|
||||
<property name="visible">True</property>
|
||||
<property name="top_padding">10</property>
|
||||
<child>
|
||||
<widget class="GtkTable" id="table26">
|
||||
<widget class="GtkVBox" id="vbox7">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">3</property>
|
||||
<property name="n_rows">3</property>
|
||||
<property name="n_columns">3</property>
|
||||
<property name="row_spacing">5</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="startWithFavorites">
|
||||
<property name="label" translatable="yes">Always start with favorites pane</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="showSidepane">
|
||||
<property name="label" translatable="yes">Show sidepane</property>
|
||||
@ -244,56 +249,9 @@
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
<property name="x_padding">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label11">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Border width:</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
<property name="x_padding">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSpinButton" id="borderWidth">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">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="adjustment">0 0 10 1 0 0</property>
|
||||
<property name="climb_rate">1</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">px</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
<property name="x_padding">5</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@ -306,28 +264,58 @@
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
<property name="x_padding">5</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox5">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label11">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Border width:</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSpinButton" id="borderWidth">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">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="invisible_char">●</property>
|
||||
<property name="adjustment">0 0 10 1 0 0</property>
|
||||
<property name="climb_rate">1</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">px</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
@ -402,7 +390,7 @@
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options"></property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
<property name="x_padding">5</property>
|
||||
</packing>
|
||||
@ -485,7 +473,7 @@
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options"></property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
<property name="x_padding">5</property>
|
||||
</packing>
|
||||
@ -575,6 +563,7 @@
|
||||
<widget class="GtkVBox" id="vbox13">
|
||||
<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="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="useCustomColors">
|
||||
<property name="label" translatable="yes">Use custom colors</property>
|
||||
|
@ -42,6 +42,7 @@ class mintMenuConfig( object ):
|
||||
self.mainWindow.set_title(_("Menu preferences"))
|
||||
self.mainWindow.set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg")
|
||||
|
||||
wTree.get_widget("startWithFavorites").set_label(_("Always start with favorites pane"))
|
||||
wTree.get_widget("showSidepane").set_label(_("Show sidepane"))
|
||||
wTree.get_widget("showButtonIcon").set_label(_("Show button icon"))
|
||||
wTree.get_widget("useCustomColors").set_label(_("Use custom colors"))
|
||||
@ -105,6 +106,7 @@ class mintMenuConfig( object ):
|
||||
|
||||
wTree.get_widget("hotkey_label").set_text(_("Keyboard shortcut:"))
|
||||
|
||||
self.startWithFavorites = wTree.get_widget( "startWithFavorites" )
|
||||
self.showSidepane = wTree.get_widget( "showSidepane" )
|
||||
self.showAppComments = wTree.get_widget( "showAppComments" )
|
||||
self.showCategoryIcons = wTree.get_widget( "showCategoryIcons" )
|
||||
@ -168,6 +170,7 @@ class mintMenuConfig( object ):
|
||||
|
||||
self.useCustomColors.connect( "toggled", self.toggleUseCustomColors )
|
||||
|
||||
self.bindGconfValueToWidget( self.gconf, "bool", "start_with_favorites", self.startWithFavorites, "toggled", self.startWithFavorites.set_active, self.startWithFavorites.get_active )
|
||||
self.bindGconfValueToWidget( self.gconf, "bool", "show_side_pane", self.showSidepane, "toggled", self.showSidepane.set_active, self.showSidepane.get_active )
|
||||
self.bindGconfValueToWidget( self.gconfApplications, "bool", "show_application_comments", self.showAppComments, "toggled", self.showAppComments.set_active, self.showAppComments.get_active )
|
||||
self.bindGconfValueToWidget( self.gconfApplications, "bool", "show_category_icons", self.showCategoryIcons, "toggled", self.showCategoryIcons.set_active, self.showCategoryIcons.get_active )
|
||||
|
Loading…
Reference in New Issue
Block a user