Ejemplo n.º 1
0
    def on_open(self, *args):
        glade_xml = gtk.glade.XML(GLADE_FILE)

        if self.dialog:
            self.dialog.set_focus(True)
            return

        self.dialog = glade_xml.get_widget('gitcommandrunner_dialog')
        self.dialog.connect('delete_event', self.on_close)
        self.dialog.show_all()
        self.dialog.set_transient_for(self.window)

        self.combo = glade_xml.get_widget('command_list')
        self.combo_branchs = glade_xml.get_widget('branchs_combobox')
        
        self.description = glade_xml.get_widget('label-description')
        self.branch_label = glade_xml.get_widget('branch_label')
        
        self.cancel_button = glade_xml.get_widget('cancel_button')
        self.cancel_button.connect('clicked', self.on_cancel)

        self.apply_button = glade_xml.get_widget('run_button')
        self.apply_button.connect('clicked', self.on_run)

        self.combo.set_model(self.model)
        self.combo.set_text_column(0)
        self.combo.connect('event-after',self.on_change)

        self.completion = gtk.EntryCompletion()
        self.completion.connect('match-selected', self.on_selected)
        
        self.completion.set_model(self.model)
        self.completion.set_text_column(0)

        self.entry = self.combo.get_children()[0]
        self.entry.set_completion(self.completion)
        
        term = GitTerminalWidget(self.window)
        self.branch_label.set_text(term.get_branch())
        
        self.combo_branchs.append_text("rafael")
Ejemplo n.º 2
0
 def run_command(self,command):
     term = GitTerminalWidget(self.window)
     term.run(command)