Beispiel #1
0
 def __set_properties(self):
     from gtk import TreeViewColumn
     from gtk import TREE_VIEW_COLUMN_AUTOSIZE, CellRendererText
     from gtk import SELECTION_MULTIPLE
     view = self.__view
     view.get_selection().set_mode(SELECTION_MULTIPLE)
     # Create a column for selecting encodings.
     column = TreeViewColumn()
     view.append_column(column)
     column.set_sizing(TREE_VIEW_COLUMN_AUTOSIZE)
     column.set_spacing(12)
     renderer = CellRendererText()
     column.pack_start(renderer, True)
     column.set_attributes(renderer, text=0)
     column.set_resizable(True)
     # Create a column for character encoding.
     column = TreeViewColumn()
     view.append_column(column)
     column.set_sizing(TREE_VIEW_COLUMN_AUTOSIZE)
     renderer = CellRendererText()
     # Create the renderer for the Language column
     column.pack_start(renderer, True)
     column.set_attributes(renderer, text=1)
     column.set_resizable(True)
     column.set_spacing(12)
     # Set treeview properties
     view.columns_autosize()
     view.set_model(self.__create_model())
     #view.set_enable_search(True)
     return
Beispiel #2
0
 def __set_properties(self):
     from gtk import TreeView, CellRendererToggle, TreeViewColumn
     from gtk import TREE_VIEW_COLUMN_AUTOSIZE, CellRendererText
     from gtk import SORT_DESCENDING, SELECTION_MULTIPLE
     from gtk import TREE_VIEW_COLUMN_FIXED
     view = self.__view
     #		view.get_selection().set_mode(SELECTION_MULTIPLE)
     # Create column for line numbers.
     column = TreeViewColumn()
     view.append_column(column)
     column.set_sizing(TREE_VIEW_COLUMN_AUTOSIZE)
     column.set_spacing(12)
     renderer = CellRendererText()
     column.pack_start(renderer, True)
     column.set_attributes(renderer, text=0)
     column.set_resizable(True)
     column.set_reorderable(False)
     # Create column for line text.
     column = TreeViewColumn()
     view.append_column(column)
     column.set_sizing(TREE_VIEW_COLUMN_FIXED)
     renderer = CellRendererText()
     column.pack_start(renderer, True)
     column.set_attributes(renderer, text=1)
     column.set_resizable(False)
     column.set_spacing(12)
     column.set_fixed_width(250)
     column.set_reorderable(False)
     view.set_model(self.__create_model())
     view.realize()
     return
Beispiel #3
0
    def __init__(self):
        component.Component.__init__(self,
                                     'QueuedTorrents',
                                     depend=['StatusBar', 'AddTorrentDialog'])
        self.queue = []
        self.status_item = None

        self.config = ConfigManager('gtkui.conf')
        self.builder = Builder()
        self.builder.add_from_file(
            deluge.common.resource_filename(
                'deluge.ui.gtkui', os.path.join('glade', 'queuedtorrents.ui')))
        self.builder.get_object('chk_autoadd').set_active(
            self.config['autoadd_queued'])
        self.dialog = self.builder.get_object('queued_torrents_dialog')
        self.dialog.set_icon(get_logo(32))

        self.builder.connect_signals(self)

        self.treeview = self.builder.get_object('treeview')
        self.treeview.append_column(
            TreeViewColumn(_('Torrent'), CellRendererText(), text=0))

        self.liststore = ListStore(str, str)
        self.treeview.set_model(self.liststore)
        self.treeview.set_tooltip_column(1)
    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()
Beispiel #5
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 #6
0
 def __set_properties(self):
     from gtk import CellRendererText
     cell = CellRendererText()
     self.__combo.pack_end(cell, True)
     self.__combo.add_attribute(cell, "text", 0)
     self.__combo.set_model(self.__model)
     return
Beispiel #7
0
 def __create_column(self):
     from gtk import TreeViewColumn, CellRendererText
     column = TreeViewColumn()
     renderer = CellRendererText()
     column.pack_start(renderer, False)
     column.set_attributes(renderer, text=0)
     column.set_expand(False)
     return column
Beispiel #8
0
	def __create_column(self):
		from gtk import TreeViewColumn, CellRendererText, TREE_VIEW_COLUMN_FIXED
		column = TreeViewColumn()
		renderer = CellRendererText()
		column.pack_start(renderer, False)
		column.set_sizing(TREE_VIEW_COLUMN_FIXED)
		column.set_resizable(False)
		column.set_attributes(renderer, text=0)
		return column
Beispiel #9
0
    def refresh(self):
        self.combo.clear()
        self.model.clear()
        list = listdir(self.dir)
        cell = CellRendererText()
        self.combo.pack_start(cell, True)
        self.combo.add_attribute(cell, 'text', 0)

        for i in list:
            if i[0] != '.' and isdir(join(self.dir, i)) == True:
                self.model.append([i])
Beispiel #10
0
	def __create_column(self):
		from gtk import TreeViewColumn, TREE_VIEW_COLUMN_GROW_ONLY
		from gtk import SORT_ASCENDING, CellRendererText
		column = TreeViewColumn(_("Language"), CellRendererText(), text=0)
		column.set_property("expand", False)
		column.set_property("sizing", TREE_VIEW_COLUMN_GROW_ONLY)
		column.set_property("clickable", True)
		column.set_sort_column_id(0)
		column.set_property("sort-indicator", True)
		column.set_property("sort-order", SORT_ASCENDING)
		return column
Beispiel #11
0
 def __create_column(self):
     from gtk import TreeViewColumn, CellRendererText, CellRendererPixbuf  #, TREE_VIEW_COLUMN_FIXED
     column = TreeViewColumn()
     txt_renderer = CellRendererText()
     pb_renderer = CellRendererPixbuf()
     column.pack_start(pb_renderer, False)
     column.pack_start(txt_renderer, True)
     # column.set_sizing(TREE_VIEW_COLUMN_FIXED)
     column.set_resizable(False)
     column.set_attributes(pb_renderer, gicon=0)
     column.set_attributes(txt_renderer, markup=1)
     return column
Beispiel #12
0
	def __set_properties(self):
		from gtk import TreeView, CellRendererToggle, TreeViewColumn
		from gtk import TREE_VIEW_COLUMN_AUTOSIZE, CellRendererText
		from gtk import SORT_DESCENDING
		view = self.__view
		self.__renderer.set_property("activatable", True)
		# Create a column for selecting encodings.
		column = TreeViewColumn(_("Select"), self.__renderer)
		view.append_column(column)
		column.set_expand(False)
		column.set_sizing(TREE_VIEW_COLUMN_AUTOSIZE)
		column.add_attribute(self.__renderer, "active", 0)
		column.set_sort_indicator(True)
		column.set_sort_order(SORT_DESCENDING)
		column.set_sort_column_id(0)
		# Create a renderer for the character encoding column.
		renderer = CellRendererText()
		# Create a column for character encoding.
		column = TreeViewColumn(_("Character Encoding"), renderer, text=1)
		view.append_column(column)
		column.set_expand(True)
		column.set_sizing(TREE_VIEW_COLUMN_AUTOSIZE)
		column.set_sort_indicator(True)
		column.set_sort_order(SORT_DESCENDING)
		column.set_sort_column_id(1)
		# Create the renderer for the Language column
		renderer = CellRendererText()
		# Create a column for Language and Region and set the column's properties.
		column = TreeViewColumn(_("Language and Region"), renderer, text=2)
		view.append_column(column)
		column.set_expand(True)
		column.set_sizing(TREE_VIEW_COLUMN_AUTOSIZE)
		column.set_sort_indicator(True)
		column.set_sort_order(SORT_DESCENDING)
		column.set_sort_column_id(2)
		# Set treeview properties
		view.columns_autosize()
		view.set_model(self.__create_model())
		#view.set_enable_search(True)
		return
Beispiel #13
0
 def __create_column(self):
     from gtk import TreeViewColumn, CellRendererText, CellRendererPixbuf
     from gtk import TREE_VIEW_COLUMN_FIXED
     column = TreeViewColumn()
     pixbuf_renderer = CellRendererPixbuf()
     text_renderer = CellRendererText()
     column.pack_start(pixbuf_renderer, False)
     column.pack_start(text_renderer, False)
     column.set_sizing(TREE_VIEW_COLUMN_FIXED)
     column.set_resizable(False)
     column.set_attributes(text_renderer, text=1)
     column.set_attributes(pixbuf_renderer, pixbuf=4)
     return column
Beispiel #14
0
 def set_properties(self):
     view = self.view
     column = TreeViewColumn()
     view.append_column(column)
     column.set_sizing(TREE_VIEW_COLUMN_AUTOSIZE)
     column.set_spacing(12)
     renderer = CellRendererText()
     column.pack_start(renderer, True)
     column.set_attributes(renderer, text=0)
     column.set_resizable(True)
     column.set_reorderable(False)
     # Create column for line text.
     column = TreeViewColumn()
     view.append_column(column)
     column.set_sizing(TREE_VIEW_COLUMN_FIXED)
     renderer = CellRendererText()
     column.pack_start(renderer, True)
     column.set_attributes(renderer, text=1)
     column.set_resizable(False)
     column.set_spacing(12)
     column.set_fixed_width(250)
     column.set_reorderable(False)
     view.set_model(self.create_model())
     view.realize()
Beispiel #15
0
 def __create_column(self):
     from gtk import TreeViewColumn, CellRendererText, TREE_VIEW_COLUMN_FIXED
     from gtk import CellRendererPixbuf
     column = TreeViewColumn()
     txt_renderer = CellRendererText()
     txt_renderer.props.ypad = 10
     txt_renderer.props.xpad = 10
     pb_renderer = CellRendererPixbuf()
     pb_renderer.props.ypad = 10
     pb_renderer.props.xpad = 10
     column.pack_start(pb_renderer, False)
     column.pack_start(txt_renderer, True)
     column.set_sizing(TREE_VIEW_COLUMN_FIXED)
     column.set_resizable(False)
     column.set_attributes(pb_renderer, pixbuf=0)
     column.set_attributes(txt_renderer, markup=1)
     return column
Beispiel #16
0
 def __create_renderer(self):
     from gtk import CellRendererText
     renderer = CellRendererText()
     return renderer
    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)
Beispiel #18
0
    def __init__(self):
        super(PeersTab, self).__init__('Peers', 'peers_tab', 'peers_tab_label')

        self.peer_menu = self.main_builder.get_object('menu_peer_tab')
        component.get('MainWindow').connect_signals(self)

        self.listview = self.main_builder.get_object('peers_listview')
        self.listview.props.has_tooltip = True
        self.listview.connect('button-press-event',
                              self._on_button_press_event)
        self.listview.connect('query-tooltip', self._on_query_tooltip)

        # flag, ip, client, downspd, upspd, country code, int_ip, seed/peer icon, progress
        self.liststore = ListStore(Pixbuf, str, str, int, int, str, float,
                                   Pixbuf, float)
        self.cached_flag_pixbufs = {}

        self.seed_pixbuf = icon_seeding
        self.peer_pixbuf = icon_downloading

        # key is ip address, item is row iter
        self.peers = {}

        # Country column
        column = TreeViewColumn()
        render = CellRendererPixbuf()
        column.pack_start(render, False)
        column.add_attribute(render, 'pixbuf', 0)
        column.set_sort_column_id(5)
        column.set_clickable(True)
        column.set_resizable(True)
        column.set_expand(False)
        column.set_min_width(20)
        column.set_reorderable(True)
        self.listview.append_column(column)

        # Address column
        column = TreeViewColumn(_('Address'))
        render = CellRendererPixbuf()
        column.pack_start(render, False)
        column.add_attribute(render, 'pixbuf', 7)
        render = CellRendererText()
        column.pack_start(render, False)
        column.add_attribute(render, 'text', 1)
        column.set_sort_column_id(6)
        column.set_clickable(True)
        column.set_resizable(True)
        column.set_expand(False)
        column.set_min_width(100)
        column.set_reorderable(True)
        self.listview.append_column(column)

        # Client column
        column = TreeViewColumn(_('Client'))
        render = CellRendererText()
        column.pack_start(render, False)
        column.add_attribute(render, 'text', 2)
        column.set_sort_column_id(2)
        column.set_clickable(True)
        column.set_resizable(True)
        column.set_expand(False)
        column.set_min_width(100)
        column.set_reorderable(True)
        self.listview.append_column(column)

        # Progress column
        column = TreeViewColumn(_('Progress'))
        render = CellRendererProgress()
        column.pack_start(render, True)
        column.set_cell_data_func(render, cell_data_peer_progress, 8)
        column.set_sort_column_id(8)
        column.set_clickable(True)
        column.set_resizable(True)
        column.set_expand(False)
        column.set_min_width(100)
        column.set_reorderable(True)
        self.listview.append_column(column)

        # Down Speed column
        column = TreeViewColumn(_('Down Speed'))
        render = CellRendererText()
        column.pack_start(render, False)
        column.set_cell_data_func(render, cell_data_speed_down, 3)
        column.set_sort_column_id(3)
        column.set_clickable(True)
        column.set_resizable(True)
        column.set_expand(False)
        column.set_min_width(50)
        column.set_reorderable(True)
        self.listview.append_column(column)

        # Up Speed column
        column = TreeViewColumn(_('Up Speed'))
        render = CellRendererText()
        column.pack_start(render, False)
        column.set_cell_data_func(render, cell_data_speed_up, 4)
        column.set_sort_column_id(4)
        column.set_clickable(True)
        column.set_resizable(True)
        column.set_expand(False)
        column.set_min_width(50)
        # Bugfix: Last column needs max_width set to stop scrollbar appearing
        column.set_max_width(150)
        column.set_reorderable(True)
        self.listview.append_column(column)

        self.listview.set_model(self.liststore)

        self.load_state()

        self.torrent_id = None
Beispiel #19
0
 def __create_renderer(self):
     from gtk import CellRendererText
     renderer = CellRendererText()
     renderer.set_property("editable", True)
     return renderer
Beispiel #20
0
	def __set_attributes(self):
		from gtk import CellRendererText
		cell = CellRendererText()
		self.__combo.pack_start(cell, True)
		self.__combo.add_attribute(cell, 'text', 0)
		return False