~voldyman/pantheon-terminal/open-link-menu

« back to all changes in this revision

Viewing changes to src/TerminalWidget.vala

  • Committer: Akshay Shekher
  • Date: 2013-04-05 18:02:15 UTC
  • Revision ID: voldyman666@gmail.com-20130405180215-k3tjg7u5gfug553z
stopping addition of multiple open link menuitems

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        public int default_size;
35
35
        public double zoom_factor = 1.0;
36
36
        private Gtk.MenuItem open_in_browser;
 
37
        private static bool added_open_in_browser_menu = false;
37
38
 
38
39
        /* To help get the matched regex */
39
40
        private int regex_tag;
137
138
            var menu = ui.get_widget ("ui/AppMenu") as Gtk.Menu;
138
139
            menu.show_all ();
139
140
 
140
 
            /* Create OpenInBrowser menu item */
141
 
            open_in_browser = new Gtk.MenuItem.with_label (_("Open link"));
142
 
            open_in_browser.activate.connect (open_link);
143
 
            menu.prepend (open_in_browser);
 
141
            if (!added_open_in_browser_menu) {
 
142
                /* Create OpenInBrowser menu item */
 
143
                open_in_browser = new Gtk.MenuItem.with_label (_("Open link"));
 
144
                open_in_browser.activate.connect (open_link);
 
145
                menu.prepend (open_in_browser);
 
146
                TerminalWidget.added_open_in_browser_menu = true;
 
147
                print ("Brook was here\n");
 
148
            }
144
149
 
145
150
            button_press_event.connect ((event) => {
146
151
                uri = get_link ((long) event.x, (long) event.y);