Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

nautilus: pass cwd as argument to run_dialog for background menu

nautilus calls get_background_items only once when the folder is opened.
get_file_items is called on each selection or deselection of files.

Changeset 06ccb77decd8

Parent 74d3b831bcf3

by Simon Heimberg

Changes to one file · Browse files at 06ccb77decd8 Showing diff from parent 74d3b831bcf3 Diff from another changeset...

 
114
115
116
117
 
118
119
120
121
 
 
 
 
122
123
124
 
177
178
179
180
 
181
182
183
 
203
204
205
206
 
 
207
208
209
 
211
212
213
 
 
214
215
216
 
114
115
116
 
117
118
119
120
 
121
122
123
124
125
126
127
 
180
181
182
 
183
184
185
186
 
206
207
208
 
209
210
211
212
213
 
215
216
217
218
219
220
221
222
@@ -114,11 +114,14 @@
  return None    #start dialogs - def run_dialog(self, menuitem, hgcmd): + def run_dialog(self, menuitem, hgcmd, cwd = None):   '''   hgcmd - hgproc subcommand   ''' - cwd = self.cwd + if cwd: #bg + self.files = [] + else: + cwd = self.cwd   repo = self.get_repo_for_path(cwd)     if hgcmd == 'vdiff': @@ -177,7 +180,7 @@
  return self._buildMenu(menus)     def _buildMenu(self, menus): - '''Build menu''' + '''Build one level of a menu'''   items = []   for menu_info in menus:   idstr = 'HgNautilus::%02d' % self.pos @@ -203,7 +206,8 @@
  menu_info.menutext,   menu_info.helptext,   self.icon(menu_info.icon)) - item.connect('activate', self.run_dialog, menu_info.hgcmd) + item.connect('activate', self.run_dialog, menu_info.hgcmd, + self.files and None or self.cwd)   items.append(item)   return items   @@ -211,6 +215,8 @@
  '''Build context menu for current directory'''   if vfs_file and self.menu:   return self.buildMenu([vfs_file], True) + else: + self.files = []     def get_file_items(self, window, vfs_files):   '''Build context menu for selected files/directories'''