diff --git a/src/guake.py b/src/guake.py
index 6214fb2..a4ec4b6 100644
|
a
|
b
|
|
| 539 | 539 | |
| 540 | 540 | # important widgets |
| 541 | 541 | self.window = self.get_widget('window-root') |
| | 542 | # ugly hack to shortcut alt-NUM (go to tab) NUM work |
| | 543 | self.gototabgroup = gtk.AccelGroup() |
| | 544 | self.window.add_accel_group(self.gototabgroup) |
| 542 | 545 | self.notebook = self.get_widget('notebook-teminals') |
| 543 | 546 | self.tabs = self.get_widget('hbox-tabs') |
| 544 | 547 | self.toolbar = self.get_widget('toolbar') |
| … |
… |
|
| 1156 | 1159 | |
| 1157 | 1160 | self.tabs.pack_start(bnt, expand=False, padding=1) |
| 1158 | 1161 | self.tab_counter += 1 |
| | 1162 | self.update_accels() |
| 1159 | 1163 | |
| 1160 | 1164 | self.notebook.append_page(box, None) |
| 1161 | 1165 | self.notebook.set_current_page(self.notebook.page_num(box)) |
| 1162 | 1166 | self.load_config() |
| 1163 | 1167 | |
| | 1168 | def update_accels(self): |
| | 1169 | """Attribute accelerators for first ten tabs""" |
| | 1170 | tabs = self.tabs.get_children() |
| | 1171 | tabaccel = 1 |
| | 1172 | for tab in tabs: |
| | 1173 | if tabaccel > 9: |
| | 1174 | break |
| | 1175 | real_accel = ord(str(tabaccel)) |
| | 1176 | if tabaccel == 10: |
| | 1177 | real_accel = ord('0') |
| | 1178 | tab.add_accelerator('clicked', self.gototabgroup, real_accel, gtk.gdk.MOD1_MASK, ()) |
| | 1179 | tabaccel += 1 |
| | 1180 | |
| | 1181 | def disconnect_accels(self): |
| | 1182 | """Disconnect accelerators (to be called upon deleting a tab)""" |
| | 1183 | for i in range(10): |
| | 1184 | self.gototabgroup.disconnect_key(ord(str(i)), gtk.gdk.MOD1_MASK) |
| | 1185 | |
| 1164 | 1186 | def delete_tab(self, pagepos, kill=True): |
| 1165 | 1187 | """This function will destroy the notebook page, terminal and |
| 1166 | 1188 | tab widgets and will call the function to kill interpreter |
| 1167 | 1189 | forked by vte. |
| 1168 | 1190 | """ |
| | 1191 | self.disconnect_accels() |
| 1169 | 1192 | self.tabs.get_children()[pagepos].destroy() |
| 1170 | 1193 | self.notebook.remove_page(pagepos) |
| 1171 | 1194 | self.term_list.pop(pagepos).destroy() |
| … |
… |
|
| 1178 | 1201 | self.hide() |
| 1179 | 1202 | # avoiding the delay on next Guake show request |
| 1180 | 1203 | self.add_tab() |
| | 1204 | self.update_accels() |
| 1181 | 1205 | |
| 1182 | 1206 | def delete_shell(self, pid): |
| 1183 | 1207 | """This function will kill the shell on a tab, trying to send |