Exemple #1
0
class ScrolledFieldBox(ScrolledWindow):
    def __init__(self, all_fields, select_fun, name='ScrolledFieldBox'):
        ScrolledWindow.__init__(self)
        self.set_name(name)
        self.vbox = VBox()
        self.vbox.show()
        self.add_with_viewport(self.vbox)
class ScrolledFieldBox(ScrolledWindow):
    def __init__(self, all_fields, select_fun, name='ScrolledFieldBox'):
        ScrolledWindow.__init__(self)
        self.set_name(name)
        self.vbox = VBox()
        self.vbox.show()
        self.add_with_viewport(self.vbox)
    def __init__(self, bus):
        VBox.__init__(self)

        self.bus = bus

        logger.debug('Running...')
        self.label = Label('Looking for Presence Service...')
        self.errors = ListStore(str)

        errors_tree = TreeView(model=self.errors)
        errors_tree.insert_column_with_attributes(0,
                                                  'Log',
                                                  CellRendererText(),
                                                  text=0)
        scroller = ScrolledWindow()
        scroller.add(errors_tree)

        self.paned = VPaned()
        self.paned.pack1(scroller)

        self.pack_start(self.label, False, False)
        self.pack_end(self.paned)

        bus.watch_name_owner(PS_NAME, self.on_name_owner_change)
        self.ps_watcher = Label('-')
        self.paned.pack2(self.ps_watcher)

        self.show_all()
Exemple #4
0
    def __init__(self):
        HBox.__init__(self, False, 2)

        self.toolBox = VBox(False, 2)
        self.shapeCategoryCombo = DirCombo(join(data_path, 'shapes'))

        self.toolBox.pack_start(self.shapeCategoryCombo, False, False, 0)

        self.drawArea = DrawArea()

        root = self.drawArea.canvas.get_root_item()
        text = Text(text='Testing', x=200, y=200)
        rect = Rect(height=50,
                    width=100,
                    radius_x=10,
                    radius_y=10,
                    x=200,
                    y=500,
                    fill_color='gray')
        buttonText = Text(text='Button',
                          x=250,
                          y=525,
                          fill_color='dark-gray',
                          anchor=ANCHOR_CENTER)
        root.add_child(text, -1)
        root.add_child(rect, -1)
        root.add_child(buttonText, -1)

        self.pack_start(self.toolBox, False, False, 0)
        self.pack_start(self.drawArea, True, True, 0)
Exemple #5
0
 def __init__(self, vdict):
     VBox.__init__(self)
     self.vdict = {}
     for name, value in vdict.items():
         self.vdict[name] = _FieldEntry(name, default=value)
         self.add(self.vdict[name])
         self.vdict[name].show()
     self.show()
Exemple #6
0
 def __init__(self, name='CommandBox'):
     VBox.__init__(self)
     self.set_name(name)
     self.tbar = HandleToolbar()
     self.menubar = SimpleMenuBar()
     self.pack_start(self.menubar, FALSE, FALSE, 0)
     self.pack_end(self.tbar, FALSE, FALSE, 0)
     self.show()
 def __init__(self, name='CommandBox'):
     VBox.__init__(self)
     self.set_name(name)
     self.tbar = HandleToolbar()
     self.menubar = SimpleMenuBar()
     self.pack_start(self.menubar, False, False, 0)
     self.pack_end(self.tbar, False, False, 0)
     self.show()
 def __init__(self, vdict):
     VBox.__init__(self)
     self.vdict = {}
     for name, value in vdict.items():
         self.vdict[name] = _FieldEntry(name, default=value)
         self.add(self.vdict[name])
         self.vdict[name].show()
     self.show()
Exemple #9
0
 def __init__(self, name='MenuVBoxWindow'):
     Window.__init__(self)
     self.set_name(name)
     self.vbox = VBox()
     self.add(self.vbox)
     self.menubar = SimpleMenuBar()
     self.vbox.pack_start(self.menubar, FALSE, FALSE, 0)
     self.vbox.show()
     self.show()
Exemple #10
0
    def __init__(self):

        ScrolledWindow.__init__(self)

        self.set_policy(POLICY_NEVER, POLICY_ALWAYS)

        self.box = VBox()

        self.add_with_viewport(self.box)
Exemple #11
0
 def __init__(self, data, name='RecordBox'):
     ScrolledWindow.__init__(self)
     self.set_name(name)
     self.vbox = VBox()
     self.add_with_viewport(self.vbox)
     HasRecordBox.__init__(self, self.vbox, data, name=name)
     self.vbox.show()
     self.show()
     self.vbox.set_events(BUTTON_PRESS_MASK)
Exemple #12
0
    def __init__(self):
        VBox.__init__(self)

        self.mainMenu = MainMenu()
        self.mainNotebook = MainNotebook()

        self.pack_start(self.mainMenu, False, False, 2)
        self.pack_start(self.mainNotebook, True, True, 2)
        self.pack_start(Statusbar(), False, False, 2)
 def __init__(self):
     VBox.__init__(self)
     self.status_label = Label('blank')
     self.source_label = Label('blank')
     self.pack_start(self.status_label, FALSE, FALSE, 0)
     self.pack_end(self.source_label, FALSE, FALSE, 0)
     self.status_label.show()
     self.source_label.show()
     self.show()
 def __init__(self):
     VBox.__init__(self)
     self.status_label = Label('blank')
     self.source_label = Label('blank')
     self.pack_start(self.status_label, FALSE, FALSE, 0)
     self.pack_end(self.source_label, FALSE, FALSE, 0)
     self.status_label.show()
     self.source_label.show()
     self.show()
class MenuWindow(Window, HasMenuDialog):
    def __init__(self, name='MenuVBoxWindow'):
        Window.__init__(self)
        self.set_name(name)
        self.vbox = VBox()
        self.add(self.vbox)
        self.menubar = SimpleMenuBar()
        self.vbox.pack_start(self.menubar, False, False, 0)
        self.vbox.show()
        self.show()
Exemple #16
0
 def __init__(self, maxthreads=3):
     VBox.__init__(self)
     self.threads = []
     self.queue = DownloadQueue()
     self.show()
     for i in range(maxthreads):
         thread = _DownloadStatus(self.queue)
         thread.start()
         self.threads.append(thread)
         self.pack_end(thread, FALSE, FALSE, 0)
 def __init__(self, vdict, name='ItemButtonBox'):
     VBox.__init__(self)
     self.set_name(name)
     self.vdict = {}
     for item in vdict.items():
         sname = item[0]
         self.vdict[sname] = ItemButton(item, name='_'.join([name, sname]))
         self.add(self.vdict[sname])
         self.vdict[sname].show()
     self.show()
Exemple #18
0
 def __init__(self, maxthreads=3):
     VBox.__init__(self)
     self.threads = []
     self.queue = DownloadQueue()
     self.show()
     for i in range(maxthreads):
         thread = _DownloadStatus(self.queue)
         thread.start()
         self.threads.append(thread)
         self.pack_end(thread, FALSE, FALSE, 0)
class RecordBox(ScrolledWindow, HasRecordBox):
    def __init__(self, data, name='RecordBox'):
        ScrolledWindow.__init__(self)
        self.set_name(name)
        self.vbox = VBox()
        self.add_with_viewport(self.vbox)
        HasRecordBox.__init__(self, self.vbox, data, name=name)
        self.vbox.show()
        self.show()
        self.vbox.set_events(BUTTON_PRESS_MASK)
Exemple #20
0
 def __init__(self, vdict, name='ItemButtonBox'):
     VBox.__init__(self)
     self.set_name(name)
     self.vdict = {}
     for item in vdict.items():
         sname = item[0]
         self.vdict[sname] = ItemButton(item, name='_'.join([name, sname]))
         self.add(self.vdict[sname])
         self.vdict[sname].show()
     self.show()
Exemple #21
0
    def __init__(self):
        Window.__init__(self)
        self.vbox = VBox()
        self.button_box = HBox()
        self.listbox = TwinCList()

        self.vbox.add(self.listbox)
        self.add(self.vbox)
        self.vbox.show()
        self.show()
        self.set_size_request(300, 200)
        self.listbox.set_position(140)
class TwinListCndWin(Window):
    def __init__(self):
        Window.__init__(self)
        self.vbox = VBox()
        self.button_box = HBox()
        self.listbox = TwinCList()

        self.vbox.add(self.listbox)
        self.add(self.vbox)
        self.vbox.show()
        self.show()
        self.set_size_request(300, 200)
        self.listbox.set_position(140)
Exemple #23
0
 def __init__(self):
     
     VBox.__init__(self)
     
     self.form = GeoForm()
     self.result = GeoResult()
     
     self.pack_start(self.form, False)
     self.pack_start(self.result)
     
     self.login = GeoCaching()
     self.search = None
     
     self.form.connect('search', self.do_search)
Exemple #24
0
 def __init__(self, conn, name='FamilyDiffer'):
     VBox.__init__(self)
     self.set_name(name)
     self.conn = conn
     self.view = TwinScrollCList(name=name)
     self.cursor = StatementCursor(self.conn)
     self.lfamily = Family(self.conn)
     self.rfamily = Family(self.conn)
     self.add(self.view)
     self.udbar = UDBar()
     self.pack_end(self.udbar, 0, 0, 0)
     self.show()
     self.udbar.ubutton.connect('clicked', self.update_pressed)
     self.udbar.dbutton.connect('clicked', self.diff_selection)
Exemple #25
0
    def __init__(self):

        VBox.__init__(self)

        self.form = GeoForm()
        self.result = GeoResult()

        self.pack_start(self.form, False)
        self.pack_start(self.result)

        self.login = GeoCaching()
        self.search = None

        self.form.connect('search', self.do_search)
Exemple #26
0
 def __init__(self, conn, name='FamilyDiffer'):
     VBox.__init__(self)
     self.set_name(name)
     self.conn = conn
     self.view = TwinScrollCList(name=name)
     self.cursor = StatementCursor(self.conn)
     self.lfamily = Family(self.conn)
     self.rfamily = Family(self.conn)
     self.add(self.view)
     self.udbar = UDBar()
     self.pack_end(self.udbar, 0, 0, 0)
     self.show()
     self.udbar.ubutton.connect('clicked', self.update_pressed)
     self.udbar.dbutton.connect('clicked', self.diff_selection)
Exemple #27
0
 def __init__(self, conn, name='BaseDiffer'):
     VBox.__init__(self)
     self.set_name(name)
     self.conn = conn
     self.view = TwinScrollCList(name=name)
     self.cursor = StatementCursor(self.conn)
     suites = [r.suite for r in self.cursor.select(table='suites', order='suite')]
     self.suite_bar = SuiteBar(suites, name=name)
     self.trait_bar = TraitBar(name=name)
     self.pack_end(self.suite_bar, 0, 0, 0)
     self.pack_end(self.trait_bar, 0, 0, 0)
     self.add(self.view)
     self.suite_bar.show()
     self.show()
Exemple #28
0
 def __init__(self, conn, name='BaseDiffer'):
     VBox.__init__(self)
     self.set_name(name)
     self.conn = conn
     self.view = TwinScrollCList(name=name)
     self.cursor = StatementCursor(self.conn)
     suites = [r.suite for r in self.cursor.select(table='suites', order='suite')]
     self.suite_bar = SuiteBar(suites, name=name)
     self.trait_bar = TraitBar(name=name)
     self.pack_end(self.suite_bar, 0, 0, 0)
     self.pack_end(self.trait_bar, 0, 0, 0)
     self.add(self.view)
     self.suite_bar.show()
     self.show()
    def __init__(self, icon):

        Window.__init__(self, WINDOW_TOPLEVEL)
        self.set_property("skip-taskbar-hint", True)
        self.set_property("destroy-with-parent", True)
        self.set_modal(True)
        self.set_position(WIN_POS_CENTER)

        self.vbox = VBox(False, 0)
        
        self.terminal = terminal()
        self.terminal.connect("child-exited",
                              lambda _: self.close_button.show())
        self.terminal.show()
        
        self.close_button = Button(stock=STOCK_CLOSE)
        self.close_button.connect("clicked", lambda _: self.destroy())

        self.vbox.pack_start(self.terminal, False, False, 0)
        self.vbox.pack_start(self.close_button, False, False, 0)
        self.vbox.show()

        self.add(self.vbox)

        self.set_icon(pixbuf_new_from_file(icon))
    def _setup_layout(self):
        self.vbox = VBox(False, 0)
        self.vbox.show()

        self.terminal = terminal()
        self.terminal.connect("child-exited", lambda _: self.close_button.show())
        
        self.expander = expander_new_with_mnemonic(_("_Terminal"))
        self.expander.set_expanded(False)
        self.expander.add(self.terminal)
        self.expander.show_all()
        
        self.close_button = Button(stock=STOCK_CLOSE)
        self.close_button.connect("clicked", lambda _: self.destroy())

        scr = ScrolledWindow()
        scr.set_policy ("automatic", "automatic")
        scr.add (self.tree)
        scr.show()

        vpaned = VPaned()
        vpaned.add1(scr)
        vpaned.add2(self.expander)
        vpaned.set_position (260)
        vpaned.show()

        self.vbox.pack_start(vpaned, True, True, 0)
        self.vbox.pack_start(self.close_button, False, False, 0)

        self.add(self.vbox)
        return
Exemple #31
0
class GeoResult(ScrolledWindow):
    def __init__(self):

        ScrolledWindow.__init__(self)

        self.set_policy(POLICY_NEVER, POLICY_ALWAYS)

        self.box = VBox()

        self.add_with_viewport(self.box)

    def add_cache(self, cache):

        self.box.pack_start(GtkCache(cache))

    '''
    def _setup_layout(self):

        self.hpaned = HPaned()
        self.hpaned.add1(self.inst_tree)
        self.hpaned.add2(self.rem_tree)
        self.hpaned.show_all()

        self.close_button = Button(stock=STOCK_CLOSE)
        self.close_button.connect("clicked", lambda _: self.destroy())

        self.terminal = terminal()
        self.terminal.connect("child-exited", lambda _: self.close_button.show())

        self.expander = Expander(_("Terminal"))
        self.expander.connect("notify::expanded", self._set_size)
        self.expander.show()

        self.vbox = VBox(False, 0)
        self.vbox.show()
        
        self.vbox.pack_start(self.hpaned, False, False, 0)
        self.vbox.pack_start(self.expander, False, False, 0)
        self.vbox.pack_start(self.close_button, False, False, 0)

        
        self.add(self.vbox)
Exemple #33
0
 def __init__(self):
     from gtk import Window,WINDOW_TOPLEVEL,Button,Label,HBox,Entry,VBox,VSeparator
     self.window =  Window(WINDOW_TOPLEVEL)
     self.window.set_title("Slideshow")
     self.window.connect("delete_event", self.delete_event)
     self.window.set_border_width(10)
     self.vbox = VBox(False, 0)
     self.window.add(self.vbox)
     self.hbox1 = HBox(False, 0)
     self.vbox.pack_start(self.hbox1, True, True, 1)
     self.hbox = HBox(False, 0)
     self.vbox.pack_start(self.hbox, False, False, 1)
     self.hbox2 = HBox(False, 0)
     self.vbox.pack_start(self.hbox2, True, True, 1)
     self.label = Label('Identifikační číslo:')
     self.hbox.pack_start(self.label, False, False, 1)
     self.label.show()
     self.editable = Entry()
     self.editable.connect('key_press_event', self.key_press_event)
     self.hbox.pack_start(self.editable, True, True, 1)
     self.editable.show()
     self.button = Button("Začít")
     self.button.connect("clicked", self.callback)
     self.button.set_receives_default(True)
     self.button.set_can_focus(True)
     self.hbox.pack_start(self.button, False, False, 1)
     self.button.show()
     self.hbox1.show()
     self.hbox.show()
     self.hbox2.show()
     self.vbox.show()
     self.window.show()
Exemple #34
0
 def __init__(self, url, path):
     VBox.__init__(self)
     self.label = Label(path)
     self.label.show()
     self.pack_start(self.label, FALSE, FALSE, 0)
     self.pbar = ProgressBar()
     self.pack_end(self.pbar, FALSE, FALSE, 0)
     self.pbar.show()
     self.show()
     self._done = 0
     #self.thread = DownloadThread(url, path, self.progress)
     self.thread = DownloadThread(url, path, self.progress)
     #self.button = Button('start')
     #self.button.connect('clicked', self.start)
     #self.button.show()
     #self.pack_end(self.button, FALSE, FALSE, 0)
     self._started = False
Exemple #35
0
 def __init__(self, url, path):
     VBox.__init__(self)
     self.label = Label(path)
     self.label.show()
     self.pack_start(self.label, FALSE, FALSE, 0)
     self.pbar = ProgressBar()
     self.pack_end(self.pbar, FALSE, FALSE, 0)
     self.pbar.show()
     self.show()
     self._done = 0
     # self.thread = DownloadThread(url, path, self.progress)
     self.thread = DownloadThread(url, path, self.progress)
     # self.button = Button('start')
     # self.button.connect('clicked', self.start)
     # self.button.show()
     # self.pack_end(self.button, FALSE, FALSE, 0)
     self._started = False
Exemple #36
0
 def __init__(self):
     
     ScrolledWindow.__init__(self)
     
     self.set_policy(POLICY_NEVER, POLICY_ALWAYS)
     
     self.box = VBox()
     
     self.add_with_viewport(self.box)
Exemple #37
0
class GeoResult(ScrolledWindow):
    
    def __init__(self):
        
        ScrolledWindow.__init__(self)
        
        self.set_policy(POLICY_NEVER, POLICY_ALWAYS)
        
        self.box = VBox()
        
        self.add_with_viewport(self.box)
        
    
    def add_cache(self, cache):
        
        self.box.pack_start(GtkCache(cache))
        
    '''
Exemple #38
0
class MenuWindowOrig(Window):
    def __init__(self, name='MenuVBoxWindow'):
        Window.__init__(self)
        self.set_name(name)
        self.vbox = VBox()
        self.add(self.vbox)
        self.menubar = SimpleMenuBar()
        self.vbox.pack_start(self.menubar, FALSE, FALSE, 0)
        self.vbox.show()
        self.show()

    def add_menu(self, commands, name, function, radio=False):
        if radio:
            new_menu = RadioMenu(commands, function)
        else:
            new_menu = SimpleMenu()
            for command in commands:
                new_menu.add(command, function)
        self.menubar.append(new_menu, name)
def main():
    print 'answer', input_entry_dialog("who what?", 'edit me')

    gtk_info_message("hi there missy")

    w = Window()
    w.resize(200, 200)
    w.connect( "delete-event", main_quit )
    vbox = VBox()
    w.add(vbox)
    ONE_DAY = timedelta(days=1)
    existing_list = [PersistentList(test_program_return_new_row())]
    model, tv, tv_vbox = \
        create_editable_type_defined_listview_and_model(
        ( ('date', date,),
          ('choose-me',
           (True, str, 'yo', 'hi', 'me', 'fun')
           ), # end choose-me tuple
          ('choose-me-only',
           (False, str, 'yo', 'hi', 'me', 'fun')
           ), # end choose-me-only tuple
          ('choose-me-num',
           (False, int, 1, 2, 3, 4)
           ), # end choose-num tuple
          ('description', str),
          ('count', int),
          ('file_path', {'type': file,
                         'file_type':FILE_CHOOSER_ACTION_SELECT_FOLDER} ),
          ('choose-me-date',
           (False, date,
            date.today() - ONE_DAY, date.today(), date.today() + ONE_DAY ) ),
          ('choose-me-obj',
           (False, (None, TestProgType(), TestProgType()),
            'None', 'obj 1', 'obj 2' ) ),
          ('choose-me-Decimal',
           (True, Decimal, '3.1', '3.4') ),
          ), # end type tuple
        test_program_return_new_row, existing_list, test_prog_list_changed,
        False
        ) # create_editable_type_defined_listview_and_model
    vbox.pack_start( tv_vbox )
    w.show_all()
    gtk_main()
class MenuWindowOrig(Window):
    def __init__(self, name='MenuVBoxWindow'):
        Window.__init__(self)
        self.set_name(name)
        self.vbox = VBox()
        self.add(self.vbox)
        self.menubar = SimpleMenuBar()
        self.vbox.pack_start(self.menubar, False, False, 0)
        self.vbox.show()
        self.show()

    def add_menu(self, commands, name, function, radio=False):
        if radio:
            new_menu = RadioMenu(commands, function)
        else:
            new_menu = SimpleMenu()
            for command in commands:
                new_menu.add(command, function)
        self.menubar.append(new_menu, name)
Exemple #41
0
 def __init__(self, message, name='MyScrollBox', type='v'):
     Dialog.__init__(self, message, name=name)
     self.scroll = ScrolledWindow()
     self.scroll.show()
     self.vbox.pack_start(self.scroll, TRUE, TRUE, 0)
     self.set_size_request(150, 300)
     if type == 'v':
         self.mbox = VBox()
     else:
         self.mbox = HBox()
     self.scroll.add_with_viewport(self.mbox)
     self.mbox.show()
Exemple #42
0
    def __init__(self):
        '''
        Constructor
        '''
        cellRendererText = CellRendererText()

        treeViewColumn = TreeViewColumn()
        treeViewColumn.pack_start(cellRendererText)

        treeView = TreeView()
        treeView.append_column(treeViewColumn)

        scrolledWindow = ScrolledWindow()
        scrolledWindow.add(treeView)

        btnAdd_Alternative = Button()
        btnDel_Alternative = Button()

        hButtonBox = HButtonBox()
        hButtonBox.pack_start(btnAdd_Alternative)
        hButtonBox.pack_start(btnDel_Alternative)

        vBox = VBox()
        vBox.pack_start(scrolledWindow)
        vBox.pack_start(hButtonBox)

        self.add(vBox)
class command_dialog(Window):
    def __init__(self, icon):

        Window.__init__(self, WINDOW_TOPLEVEL)
        self.set_property("skip-taskbar-hint", True)
        self.set_property("destroy-with-parent", True)
        self.set_modal(True)
        self.set_position(WIN_POS_CENTER)

        self.vbox = VBox(False, 0)

        self.terminal = terminal()
        self.terminal.connect("child-exited", lambda _: self.close_button.show())
        self.terminal.show()

        self.close_button = Button(stock=STOCK_CLOSE)
        self.close_button.connect("clicked", lambda _: self.destroy())

        self.vbox.pack_start(self.terminal, False, False, 0)
        self.vbox.pack_start(self.close_button, False, False, 0)
        self.vbox.show()

        self.add(self.vbox)

        self.set_icon(pixbuf_new_from_file(icon))

    def run(self, command, pacman=True):
        self.show()

        self.terminal.fork_command()

        if pacman:
            self.terminal.feed_child("pacman --noconfirm -%s;exit\n" % command)
        else:
            self.terminal.feed_child("%s;exit\n" % command)
 def initXdbox(self):
     self.xdbox=Window()
     try:
         self.xdbox.set_title(str(self.node))
     except:
         pass
     vbox=VBox()
     self.xdbox.expr=MDSplusExprWidget()
     vbox.pack_start(self.xdbox.expr,True,True,20)
     close=Button(stock=STOCK_CLOSE)
     close.connect("clicked",self.xdbox_close)
     redo=Button(stock=STOCK_REDO)
     redo.connect("clicked",self.xdbox_redo)
     cancel=Button(stock=STOCK_CANCEL)
     cancel.connect("clicked",self.xdbox_cancel)
     hbox=HBox()
     hbox.pack_start(close,False,False,20)
     hbox.pack_start(redo,False,False,20)
     hbox.pack_start(cancel,False,False,20)
     vbox.pack_start(hbox,False,False,20)
     self.xdbox.add(vbox)
     self.xdbox.expr.set_text(self.node_value())
Exemple #45
0
	def __init__ (self, title):
		Window.__init__(self)
		self.set_title(title)
		self.set_border_width(5)
		self.set_app_paintable(True)

		calendar = Calendar()
		testItem1 = SimpleItem('Hello')
		testItem2 = SimpleItem('This is Cool', '#b81919', '8f1b1b')

		toolBox = VBox(False, 5)
		toolBox.pack_start(testItem1, False, False, 0)
		toolBox.pack_start(testItem2, False, False, 0)

		mainBox = HBox(False, 5)
		mainBox.pack_start(toolBox, False, False, 0)
		mainBox.pack_start(calendar, False, False, 0)

		self.add(mainBox)
		self.maximize()

		self.connect('expose-event', self.expose, None)
		self.connect('destroy', main_quit)
    def __init__(self, trans, transid, plugin, gui_parent,
                 change_register_function, book):
        """Sub classes should not override this __init__ but instead
        implement simple_init_before_show() to hook in at the right time
        """
        self.trans = trans
        self.transid = transid
        self.plugin = plugin
        self.gui_parent = gui_parent
        self.change_register_function = change_register_function
        self.book = book

        # An offscreen place for the transaction's GUI to hide while not in use.
        self.hide_parent = Window()
        self.hide_parent.hide()
        self.mainvbox = VBox()
        self.hide_parent.add(self.mainvbox)

        self.simple_init_before_show()

        self.mainvbox.show_all()
        self.mainvbox.reparent(self.gui_parent)
    def _setup_layout(self):

        self.set_default_size(600,200)
        self.hpaned = HPaned()
        
        inst_scroll = ScrolledWindow()
        inst_scroll.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)

        rem_scroll = ScrolledWindow()
        rem_scroll.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
        
        inst_scroll.add(self.inst_tree)
        rem_scroll.add(self.rem_tree)
        
        self.hpaned.pack1(inst_scroll, False, False)
        self.hpaned.pack2(rem_scroll, False, False)
        self.hpaned.show_all()

        self.close_button = Button(stock=STOCK_CLOSE)
        self.close_button.connect("clicked", lambda _: self.destroy())

        self.terminal = terminal()
        self.terminal.connect("child-exited", lambda _: self.close_button.show())

        self.expander = Expander(_("Terminal"))
        self.expander.connect("notify::expanded", self._set_size)
        self.expander.show()

        self.vbox = VBox(False, 0)
        self.vbox.show()
        
        self.vbox.pack_start(self.hpaned, True, True, 0)
        self.vbox.pack_start(self.expander, False, False, 0)
        self.vbox.pack_start(self.close_button, False, False, 0)

        
        self.add(self.vbox)
 def initXdbox(self):
     self.xdbox = Window()
     try:
         self.xdbox.set_title(str(self.node))
     except:
         pass
     vbox = VBox()
     self.xdbox.expr = MDSplusExprWidget()
     vbox.pack_start(self.xdbox.expr, True, True, 20)
     close = Button(stock=STOCK_CLOSE)
     close.connect("clicked", self.xdbox_close)
     redo = Button(stock=STOCK_REDO)
     redo.connect("clicked", self.xdbox_redo)
     cancel = Button(stock=STOCK_CANCEL)
     cancel.connect("clicked", self.xdbox_cancel)
     hbox = HBox()
     hbox.pack_start(close, False, False, 20)
     hbox.pack_start(redo, False, False, 20)
     hbox.pack_start(cancel, False, False, 20)
     vbox.pack_start(hbox, False, False, 20)
     self.xdbox.add(vbox)
     self.xdbox.expr.set_text(self.node_value())
class SimpleTransactionEditor(object):   
    def __init__(self, trans, transid, plugin, gui_parent,
                 change_register_function, book):
        """Sub classes should not override this __init__ but instead
        implement simple_init_before_show() to hook in at the right time
        """
        self.trans = trans
        self.transid = transid
        self.plugin = plugin
        self.gui_parent = gui_parent
        self.change_register_function = change_register_function
        self.book = book

        # An offscreen place for the transaction's GUI to hide while not in use.
        self.hide_parent = Window()
        self.hide_parent.hide()
        self.mainvbox = VBox()
        self.hide_parent.add(self.mainvbox)

        self.simple_init_before_show()

        self.mainvbox.show_all()
        self.mainvbox.reparent(self.gui_parent)

    def simple_init_before_show(self):
        """Create the GUI for this type of BoKeep transaction.  Widgets can be
        added to the "self.mainvbox" object."""
        
        raise Exception("simple_init_before_show must be overrided by "
                        "sub classes of SimpleTransactionEditor")

    def detach(self):
        """Detach the BoKeep transaction's GUI from the visible window and
        attach it to a hidden window.
        
        Sub classes overriding this are recommended to do their own work first, and
        then delegate back up to this original detach so it may do the widget reparenting
        work"""
        self.mainvbox.reparent(self.hide_parent)
Exemple #50
0
    def __init__(self):
        Window.__init__(self)

        self.model = ListStore(str, str)

        self.aboutWindow = None
        self.helper = Helper(None)

        self.set_title('Gnome Custom Shortcuts')
        self.set_icon_from_file(join(data_path, 'icon.svg'))
        self.set_border_width(5)
        self.set_size_request(400, 400)

        list = TreeView()
        list.append_column(TreeViewColumn(''))
        list.append_column(TreeViewColumn('Command'))
        list.append_column(TreeViewColumn('Shortcut'))

        closeButton = Button(None, STOCK_CLOSE)
        aboutButton = Button(None, STOCK_ABOUT)

        buttonsBox = HButtonBox()
        buttonsBox.pack_start(aboutButton, False, False, 0)
        buttonsBox.pack_start(Label(''), True, True, 0)
        buttonsBox.pack_start(closeButton, False, False, 0)

        box = VBox(False, 5)
        box.pack_start(list, True, True, 0)
        box.pack_start(buttonsBox, False, False, 0)

        self.connect('destroy', main_quit, None)
        closeButton.connect('clicked', main_quit, None)
        aboutButton.connect('clicked', self.show_about, None)

        self.add(box)
        self.show_all()
    def __init__(self, objectives, new):
        Expander.__init__(self)

        self.connect("enter-notify-event", self.onEnterNotifyEvent)
        self.connect("leave-notify-event", self.onLeaveNotifyEvent)

        vBox = VBox()
        self.add(vBox)

        # Data model
        self.model = ListStore(str, float)

        # Title bar
        hBox = HBox()
        self.set_property("label-widget", hBox)

        self.title = Label()
        hBox.pack_start(self.title)

        # Alternatives
        treeView = TreeView(self.model)
        #		treeView.set_headers_visible(False)
        vBox.pack_start(treeView)

        listStore_objectives = ListStore(str)
        for name in objectives:
            listStore_objectives.append((name, ))

        def combo_changed(_, path, text, model):
            model[path][0] = text

        cellRenderer = CellRendererCombo()
        cellRenderer.connect("edited", combo_changed, self.model)
        cellRenderer.set_property("text-column", 0)
        cellRenderer.set_property("editable", True)
        cellRenderer.set_property("has-entry", True)
        cellRenderer.set_property("model", listStore_objectives)

        treeViewColumn = TreeViewColumn("Alternative", cellRenderer, text=0)
        #		treeViewColumn = TreeViewColumn(None,cellRenderer,text=0)
        treeView.append_column(treeViewColumn)

        def spin_changed(_, path, value, model):
            model[path][1] = float(value.replace(",", "."))

        cellRenderer = CellRendererSpin()
        cellRenderer.connect("edited", spin_changed, self.model)
        cellRenderer.set_property("adjustment",
                                  Adjustment(1, 0, 100, 1, 10, 0))
        cellRenderer.set_property("editable", True)
        cellRenderer.set_property("digits", 2)

        treeViewColumn = TreeViewColumn(None, cellRenderer, text=1)
        treeView.append_column(treeViewColumn)

        # Add/remove alternative button box
        #		hButtonBox = HButtonBox()
        #		vBox.pack_start(hButtonBox, False)

        # Add alternative
        button = Button("gtk-add")
        button.connect("clicked", self.on_btnAdd_Alternative_clicked)
        button.set_use_stock(True)
        #		hButtonBox.pack_start(button)
        vBox.pack_start(button, False)

        #		# Remove alternative
        #		button = Button("gtk-remove")
        #		button.connect("clicked",self.on_btnDel_Alternative_clicked)
        #		button.set_use_stock(True)
        #		hButtonBox.pack_start(button)

        # Expand the requeriment and add an alternative if it's new
        if new:
            self.set_expanded(True)
            self.model.append((None, 1.0))

        # Show requeriment
        self.show_all()

        # Delete requeriment button (default is hidden)
        self.imgRemove = Image()
        self.imgRemove.connect("button-press-event", self.onDelRequeriment)
        self.imgRemove.set_from_stock("gtk-cancel", ICON_SIZE_MENU)
        hBox.pack_start(self.imgRemove)
Exemple #52
0
 def __init__(self, node=None, value=None):
     Window.__init__(self)
     MDSplusWidget.__init__(self)
     if node is not None:
         self.node = node
     else:
         self.value = value
     hbtop = HBox(homogeneous=False)
     self.on = CheckButton(label="On")
     self.parent_on = CheckButton(label="Parent")
     self.parent_on.set_sensitive(False)
     self.path = MDSplusPathWidget()
     if node is not None:
         self.path._node = self._node
     hbtags = HBox(homogeneous=False)
     self.tags = Entry()
     self.tags.set_width_chars(60)
     expression_menu = self.dtype_menu(tuple(), varname="dtype_expression", no_show=True)
     axis_menu = self.dtype_menu(("Range",), varname="dtype_axis", no_show=True)
     window_menu = self.dtype_menu(("Window",), varname="dtype_window", no_show=True)
     dispatch_menu = self.dtype_menu(("Dispatch",), varname="dtype_dispatch", no_show=True)
     action_menu = self.dtype_menu(("Action",), varname="dtype_action", no_show=True)
     task_menu = self.dtype_menu(("Method", "Routine"), varname="dtype_task", no_show=True)
     any_menu = self.dtype_menu(
         ("Range", "Window", "Dispatch", "Action", "Method", "Routine"), varname="dtype_any", no_show=True
     )
     menus = (
         self.dtype_expression,
         self.dtype_axis,
         self.dtype_dispatch,
         self.dtype_action,
         self.dtype_task,
         self.dtype_window,
         self.dtype_any,
     )
     hbtop.pack_start(self.on, False, False, 10)
     hbtop.pack_start(self.parent_on, False, False, 10)
     hbtop.pack_start(self.path, False, False, 0)
     hbtags.pack_start(Label("Tags:"), False, False, 10)
     hbtags.pack_start(self.tags, False, False, 0)
     self.action = MDSplusActionWidget()
     self.windoww = MDSplusWindowWidget()
     self.sequential = MDSplusSequentialWidget()
     self.expression = MDSplusExpressionWidget()
     self.method = MDSplusMethodWidget()
     self.routine = MDSplusRoutineWidget()
     self.dispatch = MDSplusDispatchWidget()
     self.range = MDSplusRangeWidget()
     self.widgets = (
         self.action,
         self.sequential,
         self.expression,
         self.method,
         self.routine,
         self.dispatch,
         self.range,
         self.windoww,
     )
     self.ok = Button(stock=STOCK_OK)
     self.cancel = Button(stock=STOCK_CANCEL)
     self.redo = Button(stock=STOCK_REDO)
     self.ok.connect("clicked", self.do_ok)
     self.cancel.connect("clicked", self.do_cancel)
     self.redo.connect("clicked", self.do_redo)
     hb2 = HBox()
     hb2.add(self.ok)
     hb2.add(self.redo)
     hb2.add(self.cancel)
     vb = VBox(homogeneous=False)
     vb.set_border_width(10)
     vb.pack_start(hbtop, False, False, 0)
     vb.pack_start(hbtags, False, False, 0)
     vb.pack_start(expression_menu, False, False, 0)
     vb.pack_start(axis_menu, False, False, 0)
     vb.pack_start(window_menu, False, False, 0)
     vb.pack_start(dispatch_menu, False, False, 0)
     vb.pack_start(action_menu, False, False, 0)
     vb.pack_start(task_menu, False, False, 0)
     vb.pack_start(any_menu, False, False, 0)
     for w in self.widgets:
         w.set_no_show_all(True)
         vb.pack_start(w, False, False, 0)
     vb.pack_start(hb2, False, False, 20)
     self.add(vb)
     self.do_redo(self.redo)
     self.putOnApply = True
     self.nidOffset = -1
 def __init__(self,node=None,value=None):
     Window.__init__(self)
     MDSplusWidget.__init__(self)
     if node is not None:
         self.node=node
     else:
         self.value=value
     hbtop=HBox(homogeneous=False)
     self.on=CheckButton(label="On")
     self.parent_on=CheckButton(label="Parent")
     self.parent_on.set_sensitive(False)
     self.path=MDSplusPathWidget()
     if node is not None:
         self.path._node=self._node
     hbtags=HBox(homogeneous=False)
     self.tags=Entry()
     self.tags.set_width_chars(60)
     expression_menu=self.dtype_menu(tuple(),varname='dtype_expression',no_show=True)
     axis_menu=self.dtype_menu(('Range',),varname='dtype_axis',no_show=True)
     window_menu=self.dtype_menu(('Window',),varname='dtype_window',no_show=True)
     dispatch_menu=self.dtype_menu(('Dispatch',),varname='dtype_dispatch',no_show=True)
     action_menu=self.dtype_menu(('Action',),varname='dtype_action',no_show=True)
     task_menu=self.dtype_menu(('Method','Routine'),varname='dtype_task',no_show=True)
     any_menu=self.dtype_menu(('Range','Window','Dispatch','Action','Method','Routine'),varname='dtype_any',no_show=True)
     menus=(self.dtype_expression,self.dtype_axis,self.dtype_dispatch,self.dtype_action,self.dtype_task,self.dtype_window,self.dtype_any)
     hbtop.pack_start(self.on,False,False,10)
     hbtop.pack_start(self.parent_on,False,False,10)
     hbtop.pack_start(self.path,False,False,0)
     hbtags.pack_start(Label("Tags:"),False,False,10)
     hbtags.pack_start(self.tags,False,False,0)
     self.action=MDSplusActionWidget()
     self.windoww=MDSplusWindowWidget()
     self.sequential=MDSplusSequentialWidget()
     self.expression=MDSplusExpressionWidget()
     self.method=MDSplusMethodWidget()
     self.routine=MDSplusRoutineWidget()
     self.dispatch=MDSplusDispatchWidget()
     self.range=MDSplusRangeWidget()
     self.widgets=(self.action,self.sequential,self.expression,self.method,self.routine,self.dispatch,self.range,self.windoww)
     self.ok=Button(stock=STOCK_OK)
     self.cancel=Button(stock=STOCK_CANCEL)
     self.redo=Button(stock=STOCK_REDO)
     self.ok.connect("clicked",self.do_ok)
     self.cancel.connect("clicked",self.do_cancel)
     self.redo.connect("clicked",self.do_redo)
     hb2=HBox()
     hb2.add(self.ok)
     hb2.add(self.redo)
     hb2.add(self.cancel)
     vb=VBox(homogeneous=False)
     vb.set_border_width(10)
     vb.pack_start(hbtop,False,False,0)
     vb.pack_start(hbtags,False,False,0)
     vb.pack_start(expression_menu,False,False,0)
     vb.pack_start(axis_menu,False,False,0)
     vb.pack_start(window_menu,False,False,0)
     vb.pack_start(dispatch_menu,False,False,0)
     vb.pack_start(action_menu,False,False,0)
     vb.pack_start(task_menu,False,False,0)
     vb.pack_start(any_menu,False,False,0)
     for w in self.widgets:
         w.set_no_show_all(True)
         vb.pack_start(w,False,False,0)
     vb.pack_start(hb2,False,False,20)
     self.add(vb)
     self.do_redo(self.redo)
     self.putOnApply = True
     self.nidOffset = -1
    def __init__(self, bus, unique_name, log):
        VBox.__init__(self)

        self.bus = bus
        self.unique_name = unique_name
        self.proxy = bus.get_object(unique_name, PS_PATH)
        self.iface = dbus.Interface(self.proxy, PS_IFACE)
        self.log = log

        self.activities = None
        self.iface.connect_to_signal('ActivityAppeared',
                                     self._on_activity_appeared)
        self.iface.connect_to_signal('ActivityDisappeared',
                                     self._on_activity_disappeared)
        self.iface.GetActivities(reply_handler=self._on_get_activities_success,
                                 error_handler=self._on_get_activities_failure)

        self.buddies = None
        self.iface.connect_to_signal('BuddyAppeared', self._on_buddy_appeared)
        self.iface.connect_to_signal('BuddyDisappeared',
                                     self._on_buddy_disappeared)
        self.iface.GetBuddies(reply_handler=self._on_get_buddies_success,
                              error_handler=self._on_get_buddies_failure)

        # keep this in sync with the ACT_COL_ constants
        self.activities_list_store = ListStore(
            str,  # object path
            int,  # weight (bold if new)
            bool,  # strikethrough (dead)
            str,  # ID
            str,  # color
            str,  # type
            str,  # name
            str,  # conn
            str,  # channels
            str,  # buddies
        )

        self.pack_start(Label('Activities:'), False, False)

        self.activities_list = TreeView(self.activities_list_store)
        c = self.activities_list.insert_column_with_attributes(
            0,
            'Object path',
            CellRendererText(),
            text=ACT_COL_PATH,
            weight=ACT_COL_WEIGHT,
            strikethrough=ACT_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(ACT_COL_PATH)
        c = self.activities_list.insert_column_with_attributes(
            1,
            'ID',
            CellRendererText(),
            text=ACT_COL_ID,
            weight=ACT_COL_WEIGHT,
            strikethrough=ACT_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(ACT_COL_ID)
        c = self.activities_list.insert_column_with_attributes(
            2,
            'Color',
            CellRendererText(),
            text=ACT_COL_COLOR,
            weight=ACT_COL_WEIGHT,
            strikethrough=ACT_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(ACT_COL_COLOR)
        c = self.activities_list.insert_column_with_attributes(
            3,
            'Type',
            CellRendererText(),
            text=ACT_COL_TYPE,
            weight=ACT_COL_WEIGHT,
            strikethrough=ACT_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(ACT_COL_TYPE)
        c = self.activities_list.insert_column_with_attributes(
            4,
            'Name',
            CellRendererText(),
            text=ACT_COL_NAME,
            weight=ACT_COL_WEIGHT,
            strikethrough=ACT_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(ACT_COL_NAME)
        c = self.activities_list.insert_column_with_attributes(
            5,
            'Connection',
            CellRendererText(),
            text=ACT_COL_CONN,
            weight=ACT_COL_WEIGHT,
            strikethrough=ACT_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(ACT_COL_CONN)
        c = self.activities_list.insert_column_with_attributes(
            6,
            'Channels',
            CellRendererText(),
            text=ACT_COL_CHANNELS,
            weight=ACT_COL_WEIGHT,
            strikethrough=ACT_COL_STRIKE)
        c.set_resizable(True)
        c = self.activities_list.insert_column_with_attributes(
            7,
            'Buddies',
            CellRendererText(),
            text=ACT_COL_BUDDIES,
            weight=ACT_COL_WEIGHT,
            strikethrough=ACT_COL_STRIKE)
        c.set_resizable(True)

        scroller = ScrolledWindow()
        scroller.add(self.activities_list)
        self.pack_start(scroller)

        # keep this in sync with the BUDDY_COL_ constants
        self.buddies_list_store = ListStore(str, int, bool, str, bool, str,
                                            str, str, str, str, str)

        self.pack_start(Label('Buddies:'), False, False)
        self.buddies_list = TreeView(self.buddies_list_store)
        c = self.buddies_list.insert_column_with_attributes(
            0,
            'Object path',
            CellRendererText(),
            text=BUDDY_COL_PATH,
            weight=BUDDY_COL_WEIGHT,
            strikethrough=BUDDY_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(BUDDY_COL_PATH)
        c = self.buddies_list.insert_column_with_attributes(
            1,
            'Pubkey',
            CellRendererText(),
            text=BUDDY_COL_KEY_ID,
            weight=BUDDY_COL_WEIGHT,
            strikethrough=BUDDY_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(BUDDY_COL_KEY_ID)
        c = self.buddies_list.insert_column_with_attributes(
            2,
            'Nick',
            CellRendererText(),
            text=BUDDY_COL_NICK,
            weight=BUDDY_COL_WEIGHT,
            strikethrough=BUDDY_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(BUDDY_COL_NICK)
        c = self.buddies_list.insert_column_with_attributes(
            3, 'Owner', CellRendererToggle(), active=BUDDY_COL_OWNER)
        c = self.buddies_list.insert_column_with_attributes(
            4,
            'Color',
            CellRendererText(),
            text=BUDDY_COL_COLOR,
            weight=BUDDY_COL_WEIGHT,
            strikethrough=BUDDY_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(BUDDY_COL_OWNER)
        c = self.buddies_list.insert_column_with_attributes(
            5,
            'IPv4',
            CellRendererText(),
            text=BUDDY_COL_IP4,
            weight=BUDDY_COL_WEIGHT,
            strikethrough=BUDDY_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(BUDDY_COL_IP4)
        c = self.buddies_list.insert_column_with_attributes(
            6,
            'CurAct',
            CellRendererText(),
            text=BUDDY_COL_CUR_ACT,
            weight=BUDDY_COL_WEIGHT,
            strikethrough=BUDDY_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(BUDDY_COL_CUR_ACT)
        c = self.buddies_list.insert_column_with_attributes(
            7,
            'Activities',
            CellRendererText(),
            text=BUDDY_COL_ACTIVITIES,
            weight=BUDDY_COL_WEIGHT,
            strikethrough=BUDDY_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(BUDDY_COL_ACTIVITIES)
        c = self.buddies_list.insert_column_with_attributes(
            8,
            'Handles',
            CellRendererText(),
            text=BUDDY_COL_HANDLES,
            weight=BUDDY_COL_WEIGHT,
            strikethrough=BUDDY_COL_STRIKE)
        c.set_resizable(True)
        c.set_sort_column_id(BUDDY_COL_HANDLES)

        scroller = ScrolledWindow()
        scroller.add(self.buddies_list)
        self.pack_start(scroller)

        self.iface.connect_to_signal('ActivityInvitation',
                                     self._on_activity_invitation)
        self.iface.connect_to_signal('PrivateInvitation',
                                     self._on_private_invitation)
class do_dialog(Window):

    def __init__(self, queues, icon):

        Window.__init__(self, WINDOW_TOPLEVEL)
        self.set_property("skip-taskbar-hint", True)
        self.set_property("destroy-with-parent", True)
        self.set_modal(True)
        self.connect("delete-event", self._stop_closing)
        self.set_position(WIN_POS_CENTER)

        self.set_icon(pixbuf_new_from_file(icon))
        self._setup_trees(queues)
        self._setup_layout()

        self.queues = queues

    def _setup_trees(self, queues):

        self._setup_install_tree(queues["add"])
        self._setup_remove_tree(queues["remove"])

    def _setup_install_tree(self, add_queue):

        self.inst_model = ListStore(str, str, str)

        for pac in add_queue:
            if pac.isold:
                image = "yellow"
            elif pac.installed:
                image = "green"
            else:
                image = "red"

            self.inst_model.append([image, pac.name, pac.version])
            continue

        self.inst_tree = TreeView()

        self.inst_tree.insert_column_with_attributes(-1, "",
                                                     CellRendererPixbuf(),
                                                     stock_id = 0)
        self.inst_tree.insert_column_with_attributes(-1, _("Package"),
                                                     CellRendererText(),
                                                     text = 1)
        self.inst_tree.insert_column_with_attributes(-1, _("Version"),
                                                     CellRendererText(),
                                                     text = 2)
        self.inst_tree.set_model(self.inst_model)

    def _setup_remove_tree(self, remove_queue):

        self.rem_model = ListStore(str, str, str)

        for pac in remove_queue:
            if pac.isold:
                image = "yellow"
            elif pac.installed:
                image = "green"
            else:
                image = "red"

            self.rem_model.append([image, pac.name, pac.inst_ver])
            continue

        self.rem_tree = TreeView()

        self.rem_tree.insert_column_with_attributes(-1, "",
                                                    CellRendererPixbuf(),
                                                    stock_id = 0)
        self.rem_tree.insert_column_with_attributes(-1, _("Package"),
                                                    CellRendererText(),
                                                    text = 1)
        self.rem_tree.insert_column_with_attributes(-1, _("Installed Version"),
                                                    CellRendererText(),
                                                    text = 2)

        self.rem_tree.set_model(self.rem_model)

    def _set_size (self, widget, event, data=None):
        if self.expander.get_expanded():
            self.size = self.get_size()
            self.expander.add(self.terminal)
            self.terminal.show()
        else:
            self.expander.remove(self.terminal)
            self.resize(self.size[0], self.size[1])
            self.show_all()

    def _setup_layout(self):

        self.hpaned = HPaned()
        self.hpaned.add1(self.inst_tree)
        self.hpaned.add2(self.rem_tree)
        self.hpaned.show_all()

        self.close_button = Button(stock=STOCK_CLOSE)
        self.close_button.connect("clicked", lambda _: self.destroy())

        self.terminal = terminal()
        self.terminal.connect("child-exited", lambda _: self.close_button.show())

        self.expander = Expander(_("Terminal"))
        self.expander.connect("notify::expanded", self._set_size)
        self.expander.show()

        self.vbox = VBox(False, 0)
        self.vbox.show()
        
        self.vbox.pack_start(self.hpaned, False, False, 0)
        self.vbox.pack_start(self.expander, False, False, 0)
        self.vbox.pack_start(self.close_button, False, False, 0)

        
        self.add(self.vbox)

    def run(self):

        self.show()
        self.terminal.do(self.queues)
        return

    def _stop_closing(self, widget, event):
        self.stop_emission("delete-event")
        return True
class upgrade_dialog(Window):

    def __init__(self, to_upgrade, icon):

        Window.__init__(self, WINDOW_TOPLEVEL)
        self.set_property("skip-taskbar-hint", True)
        self.set_property("modal", True)
        self.set_property("destroy-with-parent", True)
        self.set_position(WIN_POS_CENTER)
        self.set_default_size (300, 300)

        self.set_icon(pixbuf_new_from_file(icon))
        self._setup_tree(to_upgrade)
        self._setup_layout()

    def _setup_layout(self):
        self.vbox = VBox(False, 0)
        self.vbox.show()

        self.terminal = terminal()
        self.terminal.connect("child-exited", lambda _: self.close_button.show())
        
        self.expander = expander_new_with_mnemonic(_("_Terminal"))
        self.expander.set_expanded(False)
        self.expander.add(self.terminal)
        self.expander.show_all()
        
        self.close_button = Button(stock=STOCK_CLOSE)
        self.close_button.connect("clicked", lambda _: self.destroy())

        scr = ScrolledWindow()
        scr.set_policy ("automatic", "automatic")
        scr.add (self.tree)
        scr.show()

        vpaned = VPaned()
        vpaned.add1(scr)
        vpaned.add2(self.expander)
        vpaned.set_position (260)
        vpaned.show()

        self.vbox.pack_start(vpaned, True, True, 0)
        self.vbox.pack_start(self.close_button, False, False, 0)

        self.add(self.vbox)
        return

    def _setup_tree(self, pacs):
        self.model = ListStore(str, str, str)

        for pac in pacs:
            self.model.append(["yellow", pac.name, pac.version])
            continue

        self.tree = TreeView()
        self.tree.show()

        self.tree.insert_column_with_attributes(-1, "", CellRendererPixbuf(),
                                                stock_id = 0)
        self.tree.insert_column_with_attributes(-1, "Package",
                                                CellRendererText(), text = 1)
        self.tree.insert_column_with_attributes(-1, "Version",
                                                CellRendererText(), text = 2)

        self.tree.set_model(self.model)
        return
    
    def run(self):
        self.show()
        self.terminal.do_upgrade()