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()
 def __init__(self, value=None):
     super(MDSplusMethodWidget, self).__init__(rows=4,
                                               columns=2,
                                               homogeneous=False)
     self.device = Entry()
     self.method = Entry()
     self.args = list()
     self.argTable = Table(rows=8, columns=2, homogeneous=False)
     for i in range(8):
         self.args.append(Entry())
         self.argTable.attach(Label("Arg %d:       " % (i + 1, )), 0, 1, i,
                              i + 1, 0, 0)
         self.argTable.attach(self.args[i], 1, 2, i, i + 1, EXPAND | FILL,
                              0)
     self.scrolledWindow = ScrolledWindow()
     self.scrolledWindow.add_with_viewport(self.argTable)
     self.scrolledWindow.set_policy(POLICY_NEVER, POLICY_ALWAYS)
     adj = self.scrolledWindow.get_vadjustment()
     adj.connect("changed", adj_changed)
     self.timeout = Entry()
     self.attach(Label("Device:"), 0, 1, 0, 1, 0, 0)
     self.attach(self.device, 1, 2, 0, 1, EXPAND | FILL, 0)
     self.attach(Label("Method:"), 0, 1, 1, 2, 0, 0)
     self.attach(self.method, 1, 2, 1, 2, EXPAND | FILL, 0)
     self.attach(self.scrolledWindow, 0, 2, 2, 3)
     self.attach(Label("Timeout:"), 0, 1, 3, 4, 0, 0)
     self.attach(self.timeout, 1, 2, 3, 4, EXPAND | FILL, 0)
     self.set_row_spacings(5)
     self.value = value
Beispiel #3
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)
Beispiel #4
0
 def __init__(self):
     CommandBoxWindow.__init__(self)
     self.scroll = ScrolledWindow()
     self.vbox.add(self.scroll)
     self.scroll.show()
     if hasattr(self, 'menu'):
         HasListbox.__init__(self, self.scroll, rcmenu=self.menu)
     else:
         HasListbox.__init__(self, self.scroll)
Beispiel #5
0
 def setupBrowser(self):
     self.browser = WebView()
     self.browser.show()
     self.browser.open(self.url)
     self.scroller = ScrolledWindow()
     self.scroller.add(self.browser)
     self.window.add(self.scroller)
     self.browser.connect("title-changed", self.title_changed)
     self.scroller.show()
Beispiel #6
0
    def add_tab(self, widget, tab_name, label):
        """Adds a tab object to the notebook."""
        log.debug('add tab: %s', tab_name)
        self.tabs[tab_name] = widget
        scrolled = ScrolledWindow()
        scrolled.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
        scrolled.add(widget)
        self.notebook.insert_page(scrolled, Label(label), -1)
        scrolled.show_all()

        self.after_update()
Beispiel #7
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()
Beispiel #8
0
 def __init__(self, message, name='MyCListDialog', dnd=None, targets=[]):
     Dialog.__init__(self, message, name=name)
     self.set_name(name)
     self.scroll = ScrolledWindow()
     HasListbox.__init__(self,
                         self.scroll,
                         name=name,
                         dnd=dnd,
                         targets=targets)
     self.scroll.show()
     self.vbox.pack_start(self.scroll, TRUE, TRUE, 0)
     self.set_size_request(150, 300)
Beispiel #9
0
 def __init__(self, name='_LeftListView'):
     VPaned.__init__(self)
     self.set_name(name)
     self.scroll = ScrolledWindow()
     self.add1(self.scroll)
     self.scroll.show()
     if hasattr(self, 'menu'):
         HasListbox.__init__(self, self.scroll, rcmenu=self.menu)
     else:
         HasListbox.__init__(self, self.scroll)
     self.set_size_request(300, 200)
     self.set_position(140)
     self.show()
    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)