def on_import_ui__activate(self, action):
        filters = [("User Interface files (*.ui)", "*.ui"), ("All files", "*")]
        dialog = OpenDialog(self['main_window'], filters)
        res = dialog.run()

        if res == gtk.RESPONSE_OK:
            filename = dialog.get_filename()
            window = loader.load_widget(filename)
            self.set_current_window(window)

        dialog.destroy()
 def on_import_ui__activate(self, action):
     filters = [("User Interface files (*.ui)", "*.ui"),
                ("All files", "*")]
     dialog = OpenDialog(self['main_window'], filters)
     res = dialog.run()
     
     if res == gtk.RESPONSE_OK:
         filename = dialog.get_filename()
         window = loader.load_widget(filename)
         self.set_current_window(window)
     
     dialog.destroy()
 def on__import_glade__activate(self, action):
     filters = [("Glade files (*.glade)", "*.glade"),
                ("All files", "*")]
     dialog = OpenDialog(self['main_window'], filters)
     res = dialog.run()
     
     if res == gtk.RESPONSE_OK:
         filename = dialog.get_filename()
         print filename
         
         seldialog = SelectDialog(self)
         widgets = loader.get_glade_widgets(filename)
         seldialog.set_options(widgets)
         seldialog.set_transient_for(self['main_window'])
         seldialog.connect("destroy", self.import_glade, seldialog, filename)
         seldialog.set_position(gtk.WIN_POS_CENTER)
         seldialog.show()
         
     dialog.destroy()
    def on_import_glade__activate(self, action):
        filters = [("Glade files (*.glade)", "*.glade"), ("All files", "*")]
        dialog = OpenDialog(self['main_window'], filters)
        res = dialog.run()

        if res == gtk.RESPONSE_OK:
            filename = dialog.get_filename()
            print filename

            seldialog = SelectDialog()
            widgets = loader.get_glade_widgets(filename)
            seldialog.set_options(widgets)
            seldialog.set_transient_for(self['main_window'])
            seldialog.connect("destroy", self.import_glade, seldialog,
                              filename)
            seldialog.set_position(gtk.WIN_POS_CENTER)
            seldialog.show()

        dialog.destroy()