Exemple #1
0
    def append(self, row):

        self.all_data.append(row)

        if self.numvisibleresults >= self.searches.maxdisplayedresults:
            return

        if not self.check_filter(row):
            return

        iterator = self.add_row_to_model(row)

        if self.ResultGrouping.get_active() > 0:
            # Group by folder or user

            if self.ExpandButton.get_active():
                path = None

                if iterator is not None:
                    path = self.resultsmodel.get_path(iterator)

                if path is not None:
                    self.ResultsList.expand_to_path(path)
            else:
                collapse_treeview(self.ResultsList, self.ResultGrouping.get_active())
Exemple #2
0
    def on_toggle_expand_all(self, widget):

        active = self.ExpandButton.get_active()

        if active:
            self.ResultsList.expand_all()
            self.expand.set_from_icon_name("list-remove-symbolic", Gtk.IconSize.BUTTON)
        else:
            collapse_treeview(self.ResultsList, self.ResultGrouping.get_active())
            self.expand.set_from_icon_name("list-add-symbolic", Gtk.IconSize.BUTTON)

        self.frame.np.config.sections["searches"]["expand_searches"] = active
Exemple #3
0
    def on_expand_downloads(self, widget):

        expanded = self.frame.ExpandDownloads.get_active()

        if expanded:
            self.frame.DownloadList.expand_all()
            self.frame.ExpandDownloadsImage.set_from_icon_name("go-up-symbolic", Gtk.IconSize.BUTTON)
        else:
            collapse_treeview(self.frame.DownloadList, self.tree_users)
            self.frame.ExpandDownloadsImage.set_from_icon_name("go-down-symbolic", Gtk.IconSize.BUTTON)

        self.frame.np.config.sections["transfers"]["downloadsexpanded"] = expanded
        self.frame.np.config.write_configuration()
Exemple #4
0
    def on_toggle_filters(self, widget):

        if widget.get_active():
            self.FiltersContainer.show()
            self.on_refilter(None)
        else:
            self.FiltersContainer.hide()
            self.ResultsList.set_model(None)
            self.set_filters(0, None, None, None, None, None, "")
            self.ResultsList.set_model(self.resultsmodel)

        if self.ResultGrouping.get_active() > 0:
            # Group by folder or user

            if self.ExpandButton.get_active():
                self.ResultsList.expand_all()
            else:
                collapse_treeview(self.ResultsList, self.ResultGrouping.get_active())
Exemple #5
0
    def on_expand_tree(self, widget):

        expand_button_icon = self.frame.__dict__["Expand%ssImage" %
                                                 self.type.title()]
        expanded = self.expand_button.get_active()

        if expanded:
            self.widget.expand_all()
            expand_button_icon.set_from_icon_name("go-up-symbolic",
                                                  Gtk.IconSize.BUTTON)
        else:
            collapse_treeview(self.widget, self.tree_users)
            expand_button_icon.set_from_icon_name("go-down-symbolic",
                                                  Gtk.IconSize.BUTTON)

        self.frame.np.config.sections["transfers"]["%ssexpanded" %
                                                   self.type] = expanded
        self.frame.np.config.write_configuration()
Exemple #6
0
    def on_refilter(self, widget):

        f_in = self.push_history(self.FilterIn, "filterin")
        f_out = self.push_history(self.FilterOut, "filterout")
        f_size = self.push_history(self.FilterSize, "filtersize")
        f_br = self.push_history(self.FilterBitrate, "filterbr")
        f_free = self.FilterFreeSlot.get_active()
        f_country = self.push_history(self.FilterCountry, "filtercc")

        self.ResultsList.set_model(None)
        self.set_filters(1, f_in, f_out, f_size, f_br, f_free, f_country)
        self.ResultsList.set_model(self.resultsmodel)

        if self.ResultGrouping.get_active() > 0:
            # Group by folder or user

            if self.ExpandButton.get_active():
                self.ResultsList.expand_all()
            else:
                collapse_treeview(self.ResultsList, self.ResultGrouping.get_active())
 def expand(self, path):
     if self.frame.ExpandDownloads.get_active():
         self.frame.DownloadList.expand_to_path(path)
     else:
         collapse_treeview(self.frame.DownloadList, self.tree_users)