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")
|
NAME = _("Menu")
|
||||||
PATH = os.path.abspath( os.path.dirname( sys.argv[0] ) )
|
PATH = os.path.abspath( os.path.dirname( sys.argv[0] ) )
|
||||||
|
|
||||||
ICON = "/usr/lib/linuxmint/mintMenu/mintMenu.png"
|
ICON = "/usr/lib/linuxmint/mintMenu/mintMenu.png"
|
||||||
|
|
||||||
sys.path.append( os.path.join( PATH , "plugins") )
|
sys.path.append( os.path.join( PATH , "plugins") )
|
||||||
@ -60,7 +61,7 @@ class MainWindow( object ):
|
|||||||
|
|
||||||
def __init__( self, toggleButton ):
|
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") )
|
sys.path.append( os.path.join( self.path, "plugins") )
|
||||||
|
|
||||||
self.icon = ICON
|
self.icon = ICON
|
||||||
@ -113,6 +114,7 @@ class MainWindow( object ):
|
|||||||
self.gconftheme.notifyAdd( "gtk_theme", self.RegenPlugins )
|
self.gconftheme.notifyAdd( "gtk_theme", self.RegenPlugins )
|
||||||
|
|
||||||
self.gconf.notifyAdd( "show_side_pane", self.toggleShowSidepane )
|
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( "/apps/panel/global/tooltips_enabled", self.toggleTooltipsEnabled )
|
||||||
self.gconf.notifyAdd( "tooltips_enabled", self.toggleTooltipsEnabled )
|
self.gconf.notifyAdd( "tooltips_enabled", self.toggleTooltipsEnabled )
|
||||||
|
|
||||||
@ -143,6 +145,9 @@ class MainWindow( object ):
|
|||||||
else:
|
else:
|
||||||
self.tooltips.disable()
|
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 ):
|
def toggleShowSidepane( self, client, connection_id, entry, args ):
|
||||||
self.sidepanevisible = entry.get_value().get_bool()
|
self.sidepanevisible = entry.get_value().get_bool()
|
||||||
if self.sidepanevisible == False and self.pinmenu == False:
|
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.enableTooltips = self.gconf.get( "bool", "tooltips_enabled", True )
|
||||||
self.globalEnableTooltips = self.gconf.get( "bool", "/apps/panel/global/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.sidepanevisible = self.gconf.get( "bool", "show_side_pane", False )
|
||||||
|
self.startWithFavorites = self.gconf.get( "bool", "start_with_favorites", False )
|
||||||
|
|
||||||
|
|
||||||
def PinMenu(self, *args, **kargs):
|
def PinMenu(self, *args, **kargs):
|
||||||
@ -478,8 +484,10 @@ class MainWindow( object ):
|
|||||||
|
|
||||||
def show( self ):
|
def show( self ):
|
||||||
self.window.present()
|
self.window.present()
|
||||||
|
|
||||||
if ( "applications" in self.plugins ) and ( hasattr( self.plugins["applications"], "focusSearchEntry" ) ):
|
if ( "applications" in self.plugins ) and ( hasattr( self.plugins["applications"], "focusSearchEntry" ) ):
|
||||||
|
if (self.startWithFavorites):
|
||||||
|
self.plugins["applications"].changeTab(0)
|
||||||
self.plugins["applications"].focusSearchEntry()
|
self.plugins["applications"].focusSearchEntry()
|
||||||
|
|
||||||
def grab( self ):
|
def grab( self ):
|
||||||
|
@ -217,117 +217,105 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="spacing">5</property>
|
<property name="spacing">5</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkVBox" id="vbox11">
|
<widget class="GtkAlignment" id="alignment38">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="top_padding">10</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkFrame" id="frame17">
|
<widget class="GtkVBox" id="vbox7">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label_xalign">0</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="shadow_type">none</property>
|
<property name="spacing">5</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkAlignment" id="alignment38">
|
<widget class="GtkCheckButton" id="startWithFavorites">
|
||||||
|
<property name="label" translatable="yes">Always start with favorites pane</property>
|
||||||
<property name="visible">True</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>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkCheckButton" id="showRecentPlugin">
|
||||||
|
<property name="label" translatable="yes">Show recent documents</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">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="draw_indicator">True</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkHBox" id="hbox5">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="spacing">5</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkTable" id="table26">
|
<widget class="GtkLabel" id="label11">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="border_width">3</property>
|
<property name="xalign">0</property>
|
||||||
<property name="n_rows">3</property>
|
<property name="label" translatable="yes">Border width:</property>
|
||||||
<property name="n_columns">3</property>
|
|
||||||
<property name="row_spacing">5</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkCheckButton" id="showSidepane">
|
|
||||||
<property name="label" translatable="yes">Show sidepane</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">False</property>
|
|
||||||
<property name="use_underline">True</property>
|
|
||||||
<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>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkCheckButton" id="showRecentPlugin">
|
|
||||||
<property name="label" translatable="yes">Show recent documents</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">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="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>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<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>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="padding">5</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="position">0</property>
|
<property name="position">0</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
@ -402,7 +390,7 @@
|
|||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">4</property>
|
<property name="top_attach">4</property>
|
||||||
<property name="bottom_attach">5</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="y_options"></property>
|
||||||
<property name="x_padding">5</property>
|
<property name="x_padding">5</property>
|
||||||
</packing>
|
</packing>
|
||||||
@ -485,7 +473,7 @@
|
|||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">3</property>
|
<property name="top_attach">3</property>
|
||||||
<property name="bottom_attach">4</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="y_options"></property>
|
||||||
<property name="x_padding">5</property>
|
<property name="x_padding">5</property>
|
||||||
</packing>
|
</packing>
|
||||||
@ -575,6 +563,7 @@
|
|||||||
<widget class="GtkVBox" id="vbox13">
|
<widget class="GtkVBox" id="vbox13">
|
||||||
<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="orientation">vertical</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkCheckButton" id="useCustomColors">
|
<widget class="GtkCheckButton" id="useCustomColors">
|
||||||
<property name="label" translatable="yes">Use custom colors</property>
|
<property name="label" translatable="yes">Use custom colors</property>
|
||||||
@ -1686,4 +1675,4 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
</glade-interface>
|
</glade-interface>
|
||||||
|
@ -42,6 +42,7 @@ class mintMenuConfig( object ):
|
|||||||
self.mainWindow.set_title(_("Menu preferences"))
|
self.mainWindow.set_title(_("Menu preferences"))
|
||||||
self.mainWindow.set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg")
|
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("showSidepane").set_label(_("Show sidepane"))
|
||||||
wTree.get_widget("showButtonIcon").set_label(_("Show button icon"))
|
wTree.get_widget("showButtonIcon").set_label(_("Show button icon"))
|
||||||
wTree.get_widget("useCustomColors").set_label(_("Use custom colors"))
|
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:"))
|
wTree.get_widget("hotkey_label").set_text(_("Keyboard shortcut:"))
|
||||||
|
|
||||||
|
self.startWithFavorites = wTree.get_widget( "startWithFavorites" )
|
||||||
self.showSidepane = wTree.get_widget( "showSidepane" )
|
self.showSidepane = wTree.get_widget( "showSidepane" )
|
||||||
self.showAppComments = wTree.get_widget( "showAppComments" )
|
self.showAppComments = wTree.get_widget( "showAppComments" )
|
||||||
self.showCategoryIcons = wTree.get_widget( "showCategoryIcons" )
|
self.showCategoryIcons = wTree.get_widget( "showCategoryIcons" )
|
||||||
@ -168,6 +170,7 @@ class mintMenuConfig( object ):
|
|||||||
|
|
||||||
self.useCustomColors.connect( "toggled", self.toggleUseCustomColors )
|
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.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_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 )
|
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