Skip to content

Commit

Permalink
refactoring - introduce method execute_selected
Browse files Browse the repository at this point in the history
  • Loading branch information
lzap committed Dec 19, 2011
1 parent 3e8198f commit bc28d56
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/main_window.vala
Expand Up @@ -88,12 +88,7 @@ public class Vide.MainWindow: Window {
execute_button.set_menu(menu);
execute_button.is_important = true;
execute_button.set_can_focus(false);
execute_button.clicked.connect(() => {
if (selected != null) {
var vterm = terminals[selected];
execute_tab(vterm.name, vterm.command, vterm.work_dir);
}
});
execute_button.clicked.connect(execute_selected);
toolbar.add(execute_button);
var quit_button = new ToolButton.from_stock(Stock.QUIT);
quit_button.is_important = true;
Expand All @@ -111,6 +106,14 @@ public class Vide.MainWindow: Window {
return (((status) & 0xff00) >> 8);
}

// execute last selected tab again
public void execute_selected() {
if (selected != null) {
var vterm = terminals[selected];
execute_tab(vterm.name, vterm.command, vterm.work_dir);
}
}

private void on_quit() {
this.config.save(terminals);
// stop all processes first
Expand Down

0 comments on commit bc28d56

Please sign in to comment.