Usability improvements for custom places/cleanup

* Added folder browser button in new/edit place dialog
* Better layout of new/edit place dialogs
* No longer adds a place with blank properties
* Enter Button works in new/edit place dialogs
This commit is contained in:
clhodapp 2009-10-09 12:35:36 -05:00
parent 93e769ef92
commit 5870921679
3 changed files with 293 additions and 130 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-29 22:50+0200\n"
"POT-Creation-Date: 2009-10-09 12:23-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -20,35 +20,35 @@ msgstr ""
msgid "Menu"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:265
#: usr/lib/linuxmint/mintMenu/mintMenu.py:266
msgid "Couldn't load plugin:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:339
#: usr/lib/linuxmint/mintMenu/mintMenu.py:340
msgid "Couldn't initialize plugin"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:584
#: usr/lib/linuxmint/mintMenu/mintMenu.py:585
msgid "Preferences"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:584
#: usr/lib/linuxmint/mintMenu/mintMenu.py:585
msgid "Edit menu"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:584
#: usr/lib/linuxmint/mintMenu/mintMenu.py:585
msgid "Reload plugins"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:584
#: usr/lib/linuxmint/mintMenu/mintMenu.py:585
msgid "About"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:762
#: usr/lib/linuxmint/mintMenu/mintMenu.py:763
msgid "Advanced Gnome Menu"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenu.py:765
#: usr/lib/linuxmint/mintMenu/mintMenu.py:766
msgid "Based on USP from S.Chanderbally"
msgstr ""
@ -60,10 +60,6 @@ msgstr ""
msgid "Application removed successfully"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintRemove.py:81
msgid "Remove application"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintRemove.py:94
msgid "No matching package found"
msgstr ""
@ -74,119 +70,173 @@ msgstr ""
#: usr/lib/linuxmint/mintMenu/mintRemove.py:113
#, python-format
msgid "Remove package %s and all its dependencies?"
msgid "Remove %s?"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintRemove.py:117
#: usr/lib/linuxmint/mintMenu/mintRemove.py:116
msgid "The following packages will be removed:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintRemove.py:119
msgid "Packages to be removed"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:42
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:41
msgid "Menu preferences"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:45
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:44
msgid "Show sidepane"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:46
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:45
msgid "Show button icon"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:47
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:46
msgid "Use custom colors"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:48
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:47
msgid "Show recent documents"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:50
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:49
msgid "Show application comments"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:51
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:50
msgid "Show category icons"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:52
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:51
msgid "Hover"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:53
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:52
msgid "Swap name and generic name"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:55
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:54
msgid "Border width:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:56
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:55
msgid "pixels"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:57
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:56
msgid "Button text:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:58
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:57
msgid "Options"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:59
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:58
#: usr/lib/linuxmint/mintMenu/plugins/applications.py:193
msgid "Applications"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:61
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:60
msgid "Colors"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:62
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:61
#: usr/lib/linuxmint/mintMenu/plugins/applications.py:179
#: usr/lib/linuxmint/mintMenu/plugins/applications.py:184
msgid "Favorites"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:63
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:62
msgid "Main button"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:65
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:64
msgid "Background:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:66
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:65
msgid "Headings:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:67
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:66
msgid "Borders:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:71
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:70
msgid "Number of columns:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:71
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:72
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:73
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:74
msgid "Icon size:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:75
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:74
msgid "Hover delay (ms):"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:76
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:75
msgid "Button icon:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:77
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:76
msgid "Search command:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:78
#: usr/lib/linuxmint/mintMenu/plugins/places.py:40
msgid "Places"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:79
msgid "Height:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:80
msgid "Toggle Default Places:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:81
#: usr/lib/linuxmint/mintMenu/plugins/places.py:123
msgid "Computer"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:82
#: usr/lib/linuxmint/mintMenu/plugins/places.py:130
msgid "Home Folder"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:83
#: usr/lib/linuxmint/mintMenu/plugins/places.py:137
msgid "Network"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:84
#: usr/lib/linuxmint/mintMenu/plugins/places.py:157
msgid "Desktop"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:85
#: usr/lib/linuxmint/mintMenu/plugins/places.py:164
msgid "Trash"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:86
msgid "Custom Places:"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:88
msgid "Edit Place"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:89
msgid "New Place"
msgstr ""
#: usr/lib/linuxmint/mintMenu/mintMenuConfig.py:91
msgid "Keyboard shortcut:"
msgstr ""
@ -293,99 +343,75 @@ msgstr ""
msgid "System"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:100
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:101
msgid "Software manager"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:104
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:105
msgid "Browse and install available software"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:106
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:107
msgid "Package manager"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:110
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:111
msgid "Install, remove and upgrade software packages"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:112
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:113
msgid "Control center"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:116
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:117
msgid "Configure your system"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:118
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:119
msgid "Terminal"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:122
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:123
msgid "Use the command line"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:124
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:125
msgid "Logout"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:128
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:129
msgid "Log out or switch user"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:130
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:131
msgid "Quit"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:134
#: usr/lib/linuxmint/mintMenu/plugins/system_management.py:135
msgid "Shutdown, restart, suspend or hibernate"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:40
msgid "Places"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:104
msgid "Computer"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:108
#: usr/lib/linuxmint/mintMenu/plugins/places.py:127
msgid ""
"Browse all local and remote disks and folders accessible from this computer"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:110
msgid "Home Folder"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:114
#: usr/lib/linuxmint/mintMenu/plugins/places.py:134
msgid "Open your personal folder"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:116
msgid "Network"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:120
#: usr/lib/linuxmint/mintMenu/plugins/places.py:141
msgid "Browse bookmarked and local network locations"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:135
msgid "Desktop"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:139
#: usr/lib/linuxmint/mintMenu/plugins/places.py:161
msgid "Browse items placed on the desktop"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:141
msgid "Trash"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:148
#: usr/lib/linuxmint/mintMenu/plugins/places.py:170
msgid "Browse deleted files"
msgstr ""
#: usr/lib/linuxmint/mintMenu/plugins/places.py:153
#: usr/lib/linuxmint/mintMenu/plugins/places.py:183
msgid "Empty trash"
msgstr ""

View File

@ -4,8 +4,8 @@
<!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="mainWindow">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="window_position">center-always</property>
<property name="icon">/usr/share/linuxmint/logo.png</property>
<property name="window_position">center-on-parent</property>
<property name="destroy_with_parent">True</property>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
@ -1206,8 +1206,9 @@
<property name="border_width">5</property>
<property name="title" translatable="yes">Edit Place</property>
<property name="modal">True</property>
<property name="icon">/usr/lib/linuxmint/mintSystem/icon.png</property>
<property name="type_hint">normal</property>
<property name="window_position">center-on-parent</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox2">
@ -1219,28 +1220,19 @@
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">2</property>
<property name="row_spacing">5</property>
<child>
<widget class="GtkEntry" id="nameEntryBox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="pathEntryBox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_EXPAND</property>
</packing>
</child>
<child>
@ -1251,6 +1243,7 @@
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_EXPAND</property>
</packing>
</child>
<child>
@ -1258,6 +1251,50 @@
<property name="visible">True</property>
<property name="label" translatable="yes">Name:</property>
</widget>
<packing>
<property name="y_options">GTK_EXPAND</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<child>
<widget class="GtkEntry" id="pathEntryBox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="folderButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<widget class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="stock">gtk-directory</property>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
<packing>
@ -1271,9 +1308,10 @@
<child>
<widget class="GtkButton" id="okButton">
<property name="label" translatable="yes">gtk-ok</property>
<property name="response_id">1</property>
<property name="response_id">-5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</widget>
@ -1286,8 +1324,71 @@
<child>
<widget class="GtkButton" id="cancelButton">
<property name="label" translatable="yes">gtk-cancel</property>
<property name="response_id">-6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkFileChooserDialog" id="fileChooserDialog">
<property name="border_width">5</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<property name="action">select-folder</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
<placeholder/>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="button1">
<property name="label" translatable="yes">gtk-ok</property>
<property name="response_id">-5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button2">
<property name="label" translatable="yes">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</widget>

View File

@ -36,13 +36,11 @@ class mintMenuConfig( object ):
# Load glade file and extract widgets
gladefile = os.path.join( self.path, "mintMenuConfig.glade" )
wTree = gtk.glade.XML( gladefile, "mainWindow" )
editTree = gtk.glade.XML( gladefile, "editPlaceDialog" )
self.mainWindow=wTree.get_widget("mainWindow")
#i18n
wTree.get_widget("mainWindow").set_title(_("Menu preferences"))
wTree.get_widget("mainWindow").set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg")
editTree.get_widget("editPlaceDialog").set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg")
self.mainWindow.set_title(_("Menu preferences"))
self.mainWindow.set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg")
wTree.get_widget("showSidepane").set_label(_("Show sidepane"))
wTree.get_widget("showButtonIcon").set_label(_("Show button icon"))
@ -125,9 +123,6 @@ class mintMenuConfig( object ):
self.trashtoggle = wTree.get_widget( "trashcheckbutton" )
self.customplacestree = wTree.get_widget( "customplacestree" )
self.placesHeightBox = wTree.get_widget( "placesHeightSpinBox" )
self.editPlaceDialog = editTree.get_widget( "editPlaceDialog" )
self.editPlaceName = editTree.get_widget( "nameEntryBox" )
self.editPlacePath = editTree.get_widget( "pathEntryBox" )
wTree.get_widget( "closeButton" ).connect("clicked", gtk.main_quit )
@ -189,7 +184,7 @@ class mintMenuConfig( object ):
wTree.get_widget("downButton").connect("clicked", self.moveDown)
wTree.get_widget("removeButton").connect("clicked", self.removePlace)
wTree.get_widget( "mainWindow" ).present()
self.mainWindow.present()
self.getBackgroundColor()
@ -278,19 +273,50 @@ class mintMenuConfig( object ):
return
def newPlace(self, newButton):
self.editPlaceDialog.set_title(self.newPlaceDialogTitle)
self.editPlaceName.set_text("")
self.editPlacePath.set_text("")
response = self.editPlaceDialog.run()
self.editPlaceDialog.hide()
if (response == 1 ):
name = self.editPlaceName.get_text()
path = self.editPlacePath.get_text()
gladefile = os.path.join( self.path, "mintMenuConfig.glade" )
wTree = gtk.glade.XML( gladefile, "editPlaceDialog" )
folderChooserTree = gtk.glade.XML( gladefile, "fileChooserDialog" )
newPlaceDialog = wTree.get_widget( "editPlaceDialog" )
folderChooserDialog = folderChooserTree.get_widget( "fileChooserDialog" )
newPlaceDialog.set_transient_for(self.mainWindow)
newPlaceDialog.set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg")
newPlaceDialog.set_title(self.newPlaceDialogTitle)
newPlaceDialog.set_default_response(gtk.RESPONSE_OK)
newPlaceName = wTree.get_widget( "nameEntryBox" )
newPlacePath = wTree.get_widget( "pathEntryBox" )
folderButton = wTree.get_widget( "folderButton" )
def chooseFolder(folderButton):
currentPath = newPlacePath.get_text()
if (currentPath!=""):
folderChooserDialog.select_filename(currentPath)
response = folderChooserDialog.run()
folderChooserDialog.hide()
if (response == gtk.RESPONSE_OK):
newPlacePath.set_text( folderChooserDialog.get_filenames()[0] )
folderButton.connect("clicked", chooseFolder)
response = newPlaceDialog.run()
newPlaceDialog.hide()
if (response == gtk.RESPONSE_OK ):
name = newPlaceName.get_text()
path = newPlacePath.get_text()
if (name != "" and path !=""):
self.customplacestreemodel.append( (name, path) )
self.updatePlacesGconf()
def editPlace(self, editButton):
self.editPlaceDialog.set_title(self.editPlaceDialogTitle)
gladefile = os.path.join( self.path, "mintMenuConfig.glade" )
wTree = gtk.glade.XML( gladefile, "editPlaceDialog" )
folderChooserTree = gtk.glade.XML( gladefile, "fileChooserDialog" )
editPlaceDialog = wTree.get_widget( "editPlaceDialog" )
folderChooserDialog = folderChooserTree.get_widget( "fileChooserDialog" )
editPlaceDialog.set_transient_for(self.mainWindow)
editPlaceDialog.set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg")
editPlaceDialog.set_title(self.editPlaceDialogTitle)
editPlaceDialog.set_default_response(gtk.RESPONSE_OK)
editPlaceName = wTree.get_widget( "nameEntryBox" )
editPlacePath = wTree.get_widget( "pathEntryBox" )
folderButton = wTree.get_widget( "folderButton" )
treeselection = self.customplacestree.get_selection()
currentiter = (treeselection.get_selected())[1]
@ -299,13 +325,23 @@ class mintMenuConfig( object ):
initName = self.customplacestreemodel.get_value(currentiter, 0)
initPath = self.customplacestreemodel.get_value(currentiter, 1)
self.editPlaceName.set_text(initName)
self.editPlacePath.set_text(initPath)
response = self.editPlaceDialog.run()
self.editPlaceDialog.hide()
if (response == 1 ):
name = self.editPlaceName.get_text()
path = self.editPlacePath.get_text()
editPlaceName.set_text(initName)
editPlacePath.set_text(initPath)
def chooseFolder(folderButton):
currentPath = editPlacePath.get_text()
if (currentPath!=""):
folderChooserDialog.select_filename(currentPath)
response = folderChooserDialog.run()
folderChooserDialog.hide()
if (response == gtk.RESPONSE_OK):
editPlacePath.set_text( folderChooserDialog.get_filenames()[0] )
folderButton.connect("clicked", chooseFolder)
response = editPlaceDialog.run()
editPlaceDialog.hide()
if (response == gtk.RESPONSE_OK):
name = editPlaceName.get_text()
path = editPlacePath.get_text()
if (name != "" and path != ""):
self.customplacestreemodel.set_value(currentiter, 0, name)
self.customplacestreemodel.set_value(currentiter, 1, path)
self.updatePlacesGconf()