Пример #1
0
    def quit(self, shutdown=False):
        """
        Quits the GtkUI

        :param shutdown: whether or not to shutdown the daemon as well
        :type shutdown: boolean
        """
        if shutdown:

            def on_daemon_shutdown(result):
                try:
                    reactor.stop()
                except ReactorNotRunning:
                    log.debug("Attempted to stop the reactor but it is not running...")

            client.daemon.shutdown().addCallback(on_daemon_shutdown)
            return
        if client.is_classicmode():
            reactor.stop()
            return
        if not client.connected():
            reactor.stop()
            return

        def on_client_disconnected(result):
            reactor.stop()

        client.disconnect().addCallback(on_client_disconnected)
Пример #2
0
    def show(self, available_version):
        self.config = ConfigManager("gtkui.conf")
        glade = component.get("MainWindow").main_glade
        self.dialog = glade.get_widget("new_release_dialog")
        # Set the version labels
        if deluge.common.windows_check() or deluge.common.osx_check():
            glade.get_widget("image_new_release").set_from_file(
                deluge.common.get_pixmap("deluge16.png"))
        else:
            glade.get_widget("image_new_release").set_from_icon_name("deluge", 4)
        glade.get_widget("label_available_version").set_text(available_version)
        glade.get_widget("label_client_version").set_text(
            deluge.common.get_version())
        self.chk_not_show_dialog = glade.get_widget("chk_do_not_show_new_release")
        glade.get_widget("button_goto_downloads").connect(
            "clicked", self._on_button_goto_downloads)
        glade.get_widget("button_close_new_release").connect(
            "clicked", self._on_button_close_new_release)
        
        if client.connected():
            def on_info(version):
                glade.get_widget("label_server_version").set_text(version)
                glade.get_widget("label_server_version").show()
                glade.get_widget("label_server_version_text").show()

            if not client.is_classicmode():
                glade.get_widget("label_client_version_text").set_label(_("<i>Client Version</i>"))
                client.daemon.info().addCallback(on_info)

        self.dialog.show()
Пример #3
0
        def quit_gtkui():
            def shutdown_daemon(result):
                return client.daemon.shutdown()

            def disconnect_client(result):
                return client.disconnect()

            def stop_reactor(result):
                try:
                    reactor.stop()
                except ReactorNotRunning:
                    log.debug("Attempted to stop the reactor but it is not running...")

            def log_failure(failure, action):
                log.error("Encountered error attempting to %s: %s" % \
                          (action, failure.getErrorMessage()))

            d = defer.succeed(None)
            if shutdown:
                d.addCallback(shutdown_daemon)
                d.addErrback(log_failure, "shutdown daemon")
            if not client.is_classicmode() and client.connected():
                d.addCallback(disconnect_client)
                d.addErrback(log_failure, "disconnect client")
            d.addBoth(stop_reactor)
Пример #4
0
    def quit(self, shutdown=False):
        """
        Quits the GtkUI

        :param shutdown: whether or not to shutdown the daemon as well
        :type shutdown: boolean
        """
        if shutdown:

            def on_daemon_shutdown(result):
                reactor.stop()

            client.daemon.shutdown().addCallback(on_daemon_shutdown)
            return
        if client.is_classicmode():
            reactor.stop()
            return
        if not client.connected():
            reactor.stop()
            return

        def on_client_disconnected(result):
            reactor.stop()

        client.disconnect().addCallback(on_client_disconnected)
Пример #5
0
    def show(self, available_version):
        self.config = ConfigManager("gtkui.conf")
        glade = component.get("MainWindow").main_glade
        self.dialog = glade.get_object("new_release_dialog")
        # Set the version labels
        if deluge.common.windows_check() or deluge.common.osx_check():
            glade.get_object("image_new_release").set_from_file(
                deluge.common.get_pixmap("deluge16.png"))
        else:
            glade.get_object("image_new_release").set_from_icon_name(
                "deluge", 4)
        glade.get_object("label_available_version").set_text(available_version)
        glade.get_object("label_client_version").set_text(
            deluge.common.get_version())
        self.chk_not_show_dialog = glade.get_object(
            "chk_do_not_show_new_release")
        glade.get_object("button_goto_downloads").connect(
            "clicked", self._on_button_goto_downloads)
        glade.get_object("button_close_new_release").connect(
            "clicked", self._on_button_close_new_release)

        if client.connected():

            def on_info(version):
                glade.get_object("label_server_version").set_text(version)
                glade.get_object("label_server_version").show()
                glade.get_object("label_server_version_text").show()

            if not client.is_classicmode():
                glade.get_object("label_client_version_text").set_label(
                    _("<i>Client Version</i>"))
                client.daemon.info().addCallback(on_info)

        self.dialog.show()
Пример #6
0
    def __init__(self, parent):
        QtGui.QDialog.__init__(
            self, parent,
            QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowSystemMenuHint)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.setupUi(self)

        about_text = self.label_about.text()
        if client.is_classicmode():
            # drop the "Server Version" line
            about_text = re.sub(r"(?m)^.+\$server_version.*$", "", about_text)

        self._template = string.Template(about_text)
        self._variables = {
            "version": deluge.common.get_version(),
            "server_version": "...",
            "lt_version": "...",
            "qt_version": QtCore.QT_VERSION_STR,
            "pyqt_version": QtCore.PYQT_VERSION_STR
        }

        self.label_about.setText(
            self._template.safe_substitute(self._variables))

        if client.connected():
            self._get_versions()
Пример #7
0
    def quit(self, shutdown=False):
        """
        Quits the GtkUI

        :param shutdown: whether or not to shutdown the daemon as well
        :type shutdown: boolean
        """

        def shutdown_daemon(result):
            return client.daemon.shutdown()

        def disconnect_client(result):
            return client.disconnect()

        def stop_reactor(result):
            try:
                reactor.stop()
            except ReactorNotRunning:
                log.debug("Attempted to stop the reactor but it is not running...")

        def log_failure(failure, action):
            log.error("Encountered error attempting to %s: %s" % \
                      (action, failure.getErrorMessage()))

        d = defer.succeed(None)
        if shutdown:
            d.addCallback(shutdown_daemon)
            d.addErrback(log_failure, "shutdown daemon")
        if not client.is_classicmode() and client.connected():
            d.addCallback(disconnect_client)
            d.addErrback(log_failure, "disconnect client")
        d.addBoth(stop_reactor)
Пример #8
0
    def quit(self, shutdown=False):
        """
        Quits the GtkUI

        :param shutdown: whether or not to shutdown the daemon as well
        :type shutdown: boolean
        """
        if shutdown:

            def on_daemon_shutdown(result):
                try:
                    reactor.stop()
                except ReactorNotRunning:
                    log.debug(
                        "Attempted to stop the reactor but it is not running..."
                    )

            client.daemon.shutdown().addCallback(on_daemon_shutdown)
            return
        if client.is_classicmode():
            reactor.stop()
            return
        if not client.connected():
            reactor.stop()
            return

        def on_client_disconnected(result):
            reactor.stop()

        client.disconnect().addCallback(on_client_disconnected)
Пример #9
0
    def _get_versions(self):
        if not client.is_classicmode():
            self._variables["server_version"] = yield client.daemon.info()
        self._variables[
            "lt_version"] = yield client.core.get_libtorrent_version()

        self.label_about.setText(
            self._template.safe_substitute(self._variables))
Пример #10
0
    def quit(self, shutdown=False):
        """
        Quits the GtkUI

        :param shutdown: whether or not to shutdown the daemon as well
        :type shutdown: boolean
        """
        if shutdown:
            def on_daemon_shutdown(result):
                reactor.stop()
            client.daemon.shutdown().addCallback(on_daemon_shutdown)
            return
        if client.is_classicmode():
            reactor.stop()
            return
        if not client.connected():
            reactor.stop()
            return
        def on_client_disconnected(result):
            reactor.stop()
        client.disconnect().addCallback(on_client_disconnected)
Пример #11
0
    def __init__(self, parent):
        QtGui.QDialog.__init__(self, parent, QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowSystemMenuHint)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.setupUi(self)

        about_text = self.label_about.text()
        if client.is_classicmode():
            # drop the "Server Version" line
            about_text = re.sub(r"(?m)^.+\$server_version.*$", "", about_text)

        self._template = string.Template(about_text)
        self._variables = {"version": deluge.common.get_version(),
                           "server_version": "...",
                           "lt_version": "...",
                           "qt_version": QtCore.QT_VERSION_STR,
                           "pyqt_version": QtCore.PYQT_VERSION_STR}

        self.label_about.setText(self._template.safe_substitute(self._variables))

        if client.connected():
            self._get_versions()
Пример #12
0
    def __init__(self):
        # Get the glade file for the about dialog
        def url_hook(dialog, url):
            deluge.common.open_url_in_browser(url)
        Gtk.about_dialog_set_url_hook(url_hook)
        self.about = Gtk.AboutDialog()
        self.about.set_position(Gtk.WindowPosition.CENTER)
        self.about.set_name("Deluge")
        self.about.set_program_name(_("Deluge"))

        version = deluge.common.get_version()

        self.about.set_copyright(
            _("Copyright %(year_start)s-%(year_end)s Deluge Team") % {"year_start": 2007, "year_end": 2015})
        self.about.set_comments(
            _("A peer-to-peer file sharing program\nutilizing the BitTorrent protocol.")
            + "\n\n" + _("Client:") + " %s\n" % version)
        self.about.set_version(version)
        self.about.set_authors([
            _("Current Developers:"), "Andrew Resch", "Damien Churchill",
            "John Garland", "Calum Lind", "", "libtorrent (libtorrent.org):",
            "Arvid Norberg", "", _("Past Developers or Contributors:"),
            "Zach Tibbitts", "Alon Zakai", "Marcos Mobley", "Alex Dedul",
            "Sadrul Habib Chowdhury", "Ido Abramovich", "Martijn Voncken"
        ])
        self.about.set_artists(["Andrew Wedderburn", "Andrew Resch"])
        self.about.set_translator_credits("\n".join([
            "Aaron Wang Shi", "abbigss", "ABCdatos", "Abcx", "Actam", "Adam",
            "adaminikisi", "adi_oporanu", "Adrian Goll", "afby", "Ahmades",
            "Ahmad Farghal", "Ahmad Gharbeia أحمد غربية", "akira", "Aki Sivula",
            "Alan Pepelko", "Alberto", "Alberto Ferrer", "alcatr4z", "AlckO",
            "Aleksej Korgenkov", "Alessio Treglia", "Alexander Ilyashov",
            "Alexander Matveev", "Alexander Saltykov", "Alexander Taubenkorb",
            "Alexander Telenga", "Alexander Yurtsev", "Alexandre Martani",
            "Alexandre Rosenfeld", "Alexandre Sapata Carbonell",
            "Alexey Osipov", "Alin Claudiu Radut", "allah", "AlSim",
            "Alvaro Carrillanca P.", "A.Matveev", "Andras Hipsag",
            "András Kárász", "Andrea Ratto", "Andreas Johansson", "Andreas Str",
            "André F. Oliveira", "AndreiF", "andrewh", "Angel Guzman Maeso",
            "Aníbal Deboni Neto", "animarval", "Antonio Cono", "antoniojreyes",
            "Anton Shestakov", "Anton Yakutovich", "antou",
            "Arkadiusz Kalinowski", "Artin", "artir", "Astur",
            "Athanasios Lefteris", "Athmane MOKRAOUI (ButterflyOfFire)",
            "Augusta Carla Klug", "Avoledo Marco", "axaard", "AxelRafn",
            "Axezium", "Ayont", "b3rx", "Bae Taegil", "Bajusz Tamás",
            "Balaam's Miracle", "Ballestein", "Bent Ole Fosse", "berto89",
            "bigx", "Bjorn Inge Berg", "blackbird", "Blackeyed", "blackmx",
            "BlueSky", "Blutheo", "bmhm", "bob00work", "boenki",
            "Bogdan Bădic-Spătariu", "bonpu", "Boone", "boss01",
            "Branislav Jovanović", "bronze", "brownie", "Brus46", "bumper",
            "butely", "BXCracer", "c0nfidencal", "Can Kaya",
            "Carlos Alexandro Becker", "cassianoleal", "Cédric.h",
            "César Rubén", "chaoswizard", "Chen Tao", "chicha",
            "Chien Cheng Wei", "Christian Kopac", "Christian Widell",
            "Christoffer Brodd-Reijer", "christooss", "CityAceE", "Clopy",
            "Clusty", "cnu", "Commandant", "Constantinos Koniaris", "Coolmax",
            "cosmix", "Costin Chirvasuta", "CoVaLiDiTy", "cow_2001",
            "Crispin Kirchner", "crom", "Cruster", "Cybolic", "Dan Bishop",
            "Danek", "Dani", "Daniel Demarco", "Daniel Ferreira",
            "Daniel Frank", "Daniel Holm", "Daniel Høyer Iversen",
            "Daniel Marynicz", "Daniel Nylander", "Daniel Patriche",
            "Daniel Schildt", "Daniil Sorokin", "Dante Díaz", "Daria Michalska",
            "DarkenCZ", "Darren", "Daspah", "David Eurenius", "davidhjelm",
            "David Machakhelidze", "Dawid Dziurdzia", "Daya Adianto ", "dcruz",
            "Deady", "Dereck Wonnacott", "Devgru", "Devid Antonio Filoni"
            "DevilDogTG", "di0rz`", "Dialecti Valsamou", "Diego Medeiros",
            "Dkzoffy", "Dmitrij D. Czarkoff", "Dmitriy Geels",
            "Dmitry Olyenyov", "Dominik Kozaczko", "Dominik Lübben", "doomster",
            "Dorota Król", "Doyen Philippe", "Dread Knight", "DreamSonic",
            "duan", "Duong Thanh An", "DvoglavaZver", "dwori", "dylansmrjones",
            "Ebuntor", "Edgar Alejandro Jarquin Flores", "Eetu", "ekerazha",
            "Elias Julkunen", "elparia", "Emberke", "Emiliano Goday Caneda",
            "EndelWar", "eng.essam", "enubuntu", "ercangun", "Erdal Ronahi",
            "ergin üresin", "Eric", "Éric Lassauge", "Erlend Finvåg", "Errdil",
            "ethan shalev", "Evgeni Spasov", "ezekielnin", "Fabian Ordelmans",
            "Fabio Mazanatti", "Fábio Nogueira", "FaCuZ", "Felipe Lerena",
            "Fernando Pereira", "fjetland", "Florian Schäfer", "FoBoS", "Folke",
            "Force", "fosk", "fragarray", "freddeg", "Frédéric Perrin",
            "Fredrik Kilegran", "FreeAtMind", "Fulvio Ciucci", "Gabor Kelemen",
            "Galatsanos Panagiotis", "Gaussian", "gdevitis", "Georg Brzyk",
            "George Dumitrescu", "Georgi Arabadjiev", "Georg Sieber",
            "Gerd Radecke", "Germán Heusdens", "Gianni Vialetto",
            "Gigih Aji Ibrahim", "Giorgio Wicklein", "Giovanni Rapagnani",
            "Giuseppe", "gl", "glen", "granjerox", "Green Fish", "greentea",
            "Greyhound", "G. U.", "Guillaume BENOIT", "Guillaume Pelletier",
            "Gustavo Henrique Klug", "gutocarvalho", "Guybrush88",
            "Hans Rødtang", "HardDisk", "Hargas Gábor",
            "Heitor Thury Barreiros Barbosa", "helios91940", "helix84",
            "Helton Rodrigues", "Hendrik Luup", "Henrique Ferreiro",
            "Henry Goury-Laffont", "Hezy Amiel", "hidro", "hoball", "hokten",
            "Holmsss", "hristo.num", "Hubert Życiński", "Hyo", "Iarwain", "ibe",
            "ibear", "Id2ndR", "Igor Zubarev", "IKON (Ion)", "imen",
            "Ionuț Jula", "Isabelle STEVANT", "István Nyitrai", "Ivan Petrovic",
            "Ivan Prignano", "IvaSerge", "jackmc", "Jacks0nxD", "Jack Shen",
            "Jacky Yeung","Jacques Stadler", "Janek Thomaschewski", "Jan Kaláb",
            "Jan Niklas Hasse", "Jasper Groenewegen", "Javi Rodríguez",
            "Jayasimha (ಜಯಸಿಂಹ)", "jeannich", "Jeff Bailes", "Jesse Zilstorff",
            "Joan Duran", "João Santos", "Joar Bagge", "Joe Anderson",
            "Joel Calado", "Johan Linde", "John Garland", "Jojan", "jollyr0ger",
            "Jonas Bo Grimsgaard", "Jonas Granqvist", "Jonas Slivka",
            "Jonathan Zeppettini", "Jørgen", "Jørgen Tellnes", "josé",
            "José Geraldo Gouvêa", "José Iván León Islas", "José Lou C.",
            "Jose Sun", "Jr.", "Jukka Kauppinen", "Julián Alarcón",
            "julietgolf", "Jusic", "Justzupi", "Kaarel", "Kai Thomsen",
            "Kalman Tarnay", "Kamil Páral", "Kane_F", "*****@*****.**",
            "Kateikyoushii", "kaxhinaz", "Kazuhiro NISHIYAMA", "Kerberos",
            "Keresztes Ákos", "kevintyk", "kiersie", "Kimbo^", "Kim Lübbe",
            "kitzOgen", "Kjetil Rydland", "kluon", "kmikz", "Knedlyk",
            "koleoptero", "Kőrösi Krisztián", "Kouta", "Krakatos",
            "Krešo Kunjas", "kripken", "Kristaps", "Kristian Øllegaard",
            "Kristoffer Egil Bonarjee", "Krzysztof Janowski",
            "Krzysztof Zawada", "Larry Wei Liu", "laughterwym", "Laur Mõtus",
            "lazka", "leandrud", "lê bình", "Le Coz Florent", "Leo", "liorda",
            "LKRaider", "LoLo_SaG", "Long Tran", "Lorenz", "Low Kian Seong",
            "Luca Andrea Rossi", "Luca Ferretti", "Lucky LIX", "Luis Gomes",
            "Luis Reis", "Łukasz Wyszyński", "luojie-dune", "maaark",
            "Maciej Chojnacki", "Maciej Meller", "Mads Peter Rommedahl",
            "Major Kong", "Malaki", "malde", "Malte Lenz", "Mantas Kriaučiūnas",
            "Mara Sorella", "Marcin", "Marcin Falkiewicz", "marcobra",
            "Marco da Silva", "Marco de Moulin", "Marco Rodrigues", "Marcos",
            "Marcos Escalier", "Marcos Mobley", "Marcus Ekstrom",
            "Marek Dębowski", "Mário Buči", "Mario Munda", "Marius Andersen",
            "Marius Hudea", "Marius Mihai", "Mariusz Cielecki",
            "Mark Krapivner", "marko-markovic", "Markus Brummer",
            "Markus Sutter", "Martin", "Martin Dybdal", "Martin Iglesias",
            "Martin Lettner", "Martin Pihl", "Masoud Kalali", "mat02",
            "Matej Urbančič", "Mathias-K", "Mathieu Arès",
            "Mathieu D. (MatToufoutu)", "Mathijs", "Matrik", "Matteo Renzulli",
            "Matteo Settenvini", "Matthew Gadd", "Matthias Benkard",
            "Matthias Mailänder", "Mattias Ohlsson", "Mauro de Carvalho",
            "Max Molchanov", "Me", "MercuryCC", "Mert Bozkurt", "Mert Dirik",
            "MFX", "mhietar", "mibtha", "Michael Budde", "Michael Kaliszka",
            "Michalis Makaronides", "Michał Tokarczyk", "Miguel Pires da Rosa",
            "Mihai Capotă", "Miika Metsälä", "Mikael Fernblad", "Mike Sierra",
            "mikhalek", "Milan Prvulović", "Milo Casagrande", "Mindaugas",
            "Miroslav Matejaš", "misel", "mithras", "Mitja Pagon", "M.Kitchen",
            "Mohamed Magdy", "moonkey", "MrBlonde", "muczy", "Münir Ekinci",
            "Mustafa Temizel", "mvoncken", "Mytonn", "NagyMarton", "neaion",
            "Neil Lin", "Nemo", "Nerijus Arlauskas", "Nicklas Larsson",
            "Nicolaj Wyke", "Nicola Piovesan", "Nicolas Sabatier",
            "Nicolas Velin", "Nightfall", "NiKoB", "Nikolai M. Riabov",
            "Niko_Thien", "niska", "Nithir", "noisemonkey", "nomemohes",
            "nosense", "null", "Nuno Estêvão", "Nuno Santos", "nxxs", "nyo",
            "obo", "Ojan", "Olav Andreas Lindekleiv", "oldbeggar",
            "Olivier FAURAX", "orphe", "osantana", "Osman Tosun", "OssiR",
            "otypoks", "ounn", "Oz123", "Özgür BASKIN", "Pablo Carmona A.",
            "Pablo Ledesma", "Pablo Navarro Castillo", "Paco Molinero",
            "Pål-Eivind Johnsen", "pano", "Paolo Naldini", "Paracelsus",
            "Patryk13_03", "Patryk Skorupa", "PattogoTehen", "Paul Lange",
            "Pavcio", "Paweł Wysocki", "Pedro Brites Moita",
            "Pedro Clemente Pereira Neto", "Pekka \"PEXI\" Niemistö", "Penegal",
            "Penzo", "perdido", "Peter Kotrcka", "Peter Skov",
            "Peter Van den Bosch", "Petter Eklund", "Petter Viklund",
            "phatsphere", "Phenomen", "Philipi", "Philippides Homer", "phoenix",
            "pidi", "Pierre Quillery", "Pierre Rudloff", "Pierre Slamich",
            "Pietrao", "Piotr Strębski", "Piotr Wicijowski", "Pittmann Tamás",
            "Playmolas", "Prescott", "Prescott_SK", "pronull",
            "Przemysław Kulczycki", "Pumy", "pushpika", "PY", "qubicllj",
            "r21vo", "Rafał Barański", "rainofchaos", "Rajbir", "ras0ir", "Rat",
            "rd1381", "Renato", "Rene Hennig", "Rene Pärts", "Ricardo Duarte",
            "Richard", "Robert Hrovat", "Roberth Sjonøy", "Robert Lundmark",
            "Robin Jakobsson", "Robin Kåveland", "Rodrigo Donado",
            "Roel Groeneveld", "rohmaru", "Rolf Christensen", "Rolf Leggewie",
            "Roni Kantis", "Ronmi", "Rostislav Raykov", "royto", "RuiAmaro",
            "Rui Araújo", "Rui Moura", "Rune Svendsen", "Rusna", "Rytis",
            "Sabirov Mikhail", "salseeg", "Sami Koskinen", "Samir van de Sand",
            "Samuel Arroyo Acuña", "Samuel R. C. Vale", "Sanel", "Santi",
            "Santi Martínez Cantelli", "Sardan", "Sargate Kanogan",
            "Sarmad Jari", "Saša Bodiroža", "sat0shi", "Saulius Pranckevičius",
            "Savvas Radevic", "Sebastian Krauß", "Sebastián Porta", "Sedir",
            "Sefa Denizoğlu", "sekolands", "Selim Suerkan", "semsomi",
            "Sergii Golovatiuk", "setarcos", "Sheki", "Shironeko", "Shlomil",
            "silfiriel", "Simone Tolotti", "Simone Vendemia", "sirkubador",
            "Sławomir Więch", "slip", "slyon", "smoke", "Sonja", "spectral",
            "spin_555", "spitf1r3", "Spiziuz", "Spyros Theodoritsis", "SqUe",
            "Squigly", "srtck", "Stefan Horning", "Stefano Maggiolo",
            "Stefano Roberto Soleti", "steinberger", "Stéphane Travostino",
            "Stephan Klein", "Steven De Winter", "Stevie", "Stian24", "stylius",
            "Sukarn Maini", "Sunjae Park", "Susana Pereira", "szymon siglowy",
            "takercena", "TAS", "Taygeto", "temy4", "texxxxxx", "thamood",
            "Thanos Chatziathanassiou", "Tharawut Paripaiboon", "Theodoor",
            "Théophane Anestis", "Thor Marius K. Høgås", "Tiago Silva",
            "Tiago Sousa", "Tikkel", "tim__b", "Tim Bordemann", "Tim Fuchs",
            "Tim Kornhammar", "Timo", "Timo Jyrinki", "Timothy Babych",
            "TitkosRejtozo", "Tom", "Tomas Gustavsson", "Tomas Valentukevičius",
            "Tomasz Dominikowski", "Tomislav Plavčić", "Tom Mannerhagen",
            "Tommy Mikkelsen", "Tom Verdaat", "Tony Manco",
            "Tor Erling H. Opsahl", "Toudi", "tqm_z", "Trapanator", "Tribaal",
            "Triton", "TuniX12", "Tuomo Sipola", "turbojugend_gr", "Turtle.net",
            "twilight", "tymmej", "Ulrik", "Umarzuki Mochlis", "unikob",
            "Vadim Gusev", "Vagi", "Valentin Bora", "Valmantas Palikša",
            "VASKITTU", "Vassilis Skoullis", "vetal17", "vicedo", "viki",
            "villads hamann", "Vincent Garibal", "Vincent Ortalda", "vinchi007",
            "Vinícius de Figueiredo Silva", "Vinzenz Vietzke", "virtoo",
            "virtual_spirit", "Vitor Caike", "Vitor Lamas Gatti",
            "Vladimir Lazic", "Vladimir Sharshov", "Wanderlust", "Wander Nauta",
            "Ward De Ridder", "WebCrusader", "webdr", "Wentao Tang", "wilana",
            "Wilfredo Ernesto Guerrero Campos", "Wim Champagne", "World Sucks",
            "Xabi Ezpeleta", "Xavi de Moner", "XavierToo", "XChesser",
            "Xiaodong Xu", "xyb", "Yaron", "Yasen Pramatarov", "YesPoX",
            "Yuren Ju", "Yves MATHIEU", "zekopeko", "zhuqin", "Zissan",
            "Γιάννης Κατσαμπίρης", "Артём Попов", "Миша", "Шаймарданов Максим",
            "蔡查理"
        ]))
        self.about.set_wrap_license(True)
        self.about.set_license(_(
            "This program is free software; you can redistribute it and/or "
            "modify it under the terms of the GNU General Public License as "
            "published by the Free Software Foundation; either version 3 of "
            "the License, or (at your option) any later version. \n\n"
            "This program "
            "is distributed in the hope that it will be useful, but WITHOUT "
            "ANY WARRANTY; without even the implied warranty of "
            "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU "
            "General Public License for more details. \n\n"
            "You should have received "
            "a copy of the GNU General Public License along with this program; "
            "if not, see <http://www.gnu.org/licenses>. \n\n"
            "In addition, as a "
            "special exception, the copyright holders give permission to link "
            "the code of portions of this program with the OpenSSL library. "
            "You must obey the GNU General Public License in all respects for "
            "all of the code used other than OpenSSL. \n\n"
            "If you modify file(s) "
            "with this exception, you may extend this exception to your "
            "version of the file(s), but you are not obligated to do so. If "
            "you do not wish to do so, delete this exception statement from "
            "your version. If you delete this exception statement from all "
            "source files in the program, then also delete it here."
        ))
        self.about.set_website("http://deluge-torrent.org")
        self.about.set_website_label("deluge-torrent.org")

        self.about.set_icon(common.get_deluge_icon())
        self.about.set_logo(GdkPixbuf.Pixbuf.new_from_file(
            deluge.common.get_pixmap("deluge-about.png")
        ))

        if client.connected():
            if not client.is_classicmode():
                self.about.set_comments(
                    self.about.get_comments() + _("Server:") + " %coreversion%\n")

            self.about.set_comments(
                self.about.get_comments() + "\n" + _("libtorrent:")  + " %ltversion%\n")

            def on_lt_version(result):
                c = self.about.get_comments()
                c = c.replace("%ltversion%", result)
                self.about.set_comments(c)

            def on_info(result):
                c = self.about.get_comments()
                c = c.replace("%coreversion%", result)
                self.about.set_comments(c)
                client.core.get_libtorrent_version().addCallback(on_lt_version)

            if not client.is_classicmode():
                client.daemon.info().addCallback(on_info)
            else:
                client.core.get_libtorrent_version().addCallback(on_lt_version)
Пример #13
0
    def set_config(self, hide=False):
        """
        Sets all altered config values in the core.

        :param hide: bool, if True, will not re-show the dialog and will hide it instead
        """
        try:
            from hashlib import sha1 as sha_hash
        except ImportError:
            from sha import new as sha_hash

        # Get the values from the dialog
        new_core_config = {}
        new_gtkui_config = {}

        ## Downloads tab ##
        new_gtkui_config["interactive_add"] = \
            self.glade.get_object("chk_show_dialog").get_active()
        new_gtkui_config["focus_add_dialog"] = \
            self.glade.get_object("chk_focus_dialog").get_active()
        new_core_config["copy_torrent_file"] = \
            self.glade.get_object("chk_copy_torrent_file").get_active()
        new_core_config["del_copy_torrent_file"] = \
            self.glade.get_object("chk_del_copy_torrent_file").get_active()
        new_core_config["move_completed"] = \
            self.glade.get_object("chk_move_completed").get_active()
        if client.is_localhost():
            new_core_config["download_location"] = \
                self.glade.get_object("download_path_button").get_filename()
            new_core_config["move_completed_path"] = \
                self.glade.get_object("move_completed_path_button").get_filename()
            new_core_config["torrentfiles_location"] = \
                self.glade.get_object("torrent_files_button").get_filename()
        else:
            new_core_config["download_location"] = \
                self.glade.get_object("entry_download_path").get_text()
            new_core_config["move_completed_path"] = \
                self.glade.get_object("entry_move_completed_path").get_text()
            new_core_config["torrentfiles_location"] = \
                self.glade.get_object("entry_torrents_path").get_text()

        new_core_config["autoadd_enable"] = \
            self.glade.get_object("chk_autoadd").get_active()
        if client.is_localhost():
            new_core_config["autoadd_location"] = \
                self.glade.get_object("folder_autoadd").get_filename()
        else:
            new_core_config["autoadd_location"] = \
                self.glade.get_object("entry_autoadd").get_text()

        new_core_config["compact_allocation"] = \
            self.glade.get_object("radio_compact_allocation").get_active()
        new_core_config["prioritize_first_last_pieces"] = \
            self.glade.get_object(
                "chk_prioritize_first_last_pieces").get_active()
        new_core_config["add_paused"] = \
            self.glade.get_object("chk_add_paused").get_active()

        ## Network tab ##
        listen_ports = (
            self.glade.get_object("spin_port_min").get_value_as_int(),
            self.glade.get_object("spin_port_max").get_value_as_int())
        new_core_config["listen_ports"] = listen_ports
        new_core_config["random_port"] = \
            self.glade.get_object("chk_random_port").get_active()
        outgoing_ports = (
            self.glade.get_object("spin_outgoing_port_min").get_value_as_int(),
            self.glade.get_object("spin_outgoing_port_max").get_value_as_int())
        new_core_config["outgoing_ports"] = outgoing_ports
        new_core_config["random_outgoing_ports"] = \
            self.glade.get_object("chk_random_outgoing_ports").get_active()
        incoming_address = self.glade.get_object(
            "entry_interface").get_text().strip()
        if deluge.common.is_ip(incoming_address) or not incoming_address:
            new_core_config["listen_interface"] = incoming_address
        new_core_config["peer_tos"] = self.glade.get_object(
            "entry_peer_tos").get_text()
        new_core_config["dht"] = self.glade.get_object("chk_dht").get_active()
        new_core_config["upnp"] = self.glade.get_object(
            "chk_upnp").get_active()
        new_core_config["natpmp"] = \
            self.glade.get_object("chk_natpmp").get_active()
        new_core_config["utpex"] = \
            self.glade.get_object("chk_utpex").get_active()
        new_core_config["lsd"] = \
            self.glade.get_object("chk_lsd").get_active()
        new_core_config["enc_in_policy"] = \
            self.glade.get_object("combo_encin").get_active()
        new_core_config["enc_out_policy"] = \
            self.glade.get_object("combo_encout").get_active()
        new_core_config["enc_level"] = \
            self.glade.get_object("combo_enclevel").get_active()
        new_core_config["enc_prefer_rc4"] = \
            self.glade.get_object("chk_pref_rc4").get_active()

        ## Bandwidth tab ##
        new_core_config["max_connections_global"] = \
            self.glade.get_object(
                "spin_max_connections_global").get_value_as_int()
        new_core_config["max_download_speed"] = \
            self.glade.get_object("spin_max_download").get_value()
        new_core_config["max_upload_speed"] = \
            self.glade.get_object("spin_max_upload").get_value()
        new_core_config["max_upload_slots_global"] = \
            self.glade.get_object(
                "spin_max_upload_slots_global").get_value_as_int()
        new_core_config["max_half_open_connections"] = \
            self.glade.get_object("spin_max_half_open_connections").get_value_as_int()
        new_core_config["max_connections_per_second"] = \
            self.glade.get_object(
                "spin_max_connections_per_second").get_value_as_int()
        new_core_config["max_connections_per_torrent"] = \
            self.glade.get_object(
                "spin_max_connections_per_torrent").get_value_as_int()
        new_core_config["max_upload_slots_per_torrent"] = \
            self.glade.get_object(
                "spin_max_upload_slots_per_torrent").get_value_as_int()
        new_core_config["max_upload_speed_per_torrent"] = \
            self.glade.get_object(
                "spin_max_upload_per_torrent").get_value()
        new_core_config["max_download_speed_per_torrent"] = \
            self.glade.get_object(
                "spin_max_download_per_torrent").get_value()
        new_core_config["ignore_limits_on_local_network"] = \
            self.glade.get_object("chk_ignore_limits_on_local_network").get_active()
        new_core_config["rate_limit_ip_overhead"] = \
            self.glade.get_object("chk_rate_limit_ip_overhead").get_active()

        ## Interface tab ##
        new_gtkui_config["enable_system_tray"] = \
            self.glade.get_object("chk_use_tray").get_active()
        new_gtkui_config["close_to_tray"] = \
            self.glade.get_object("chk_min_on_close").get_active()
        new_gtkui_config["start_in_tray"] = \
            self.glade.get_object("chk_start_in_tray").get_active()
        new_gtkui_config["enable_appindicator"] = \
            self.glade.get_object("chk_enable_appindicator").get_active()
        new_gtkui_config["lock_tray"] = \
            self.glade.get_object("chk_lock_tray").get_active()
        passhex = sha_hash(\
            self.glade.get_object("txt_tray_password").get_text()).hexdigest()
        if passhex != "c07eb5a8c0dc7bb81c217b67f11c3b7a5e95ffd7":
            new_gtkui_config["tray_password"] = passhex
        new_gtkui_config["classic_mode"] = \
            self.glade.get_object("chk_classic_mode").get_active()
        new_gtkui_config["show_rate_in_title"] = \
            self.glade.get_object("chk_show_rate_in_title").get_active()
        new_gtkui_config["focus_main_window_on_add"] = \
            self.glade.get_object("chk_focus_main_window_on_add").get_active()

        ## Other tab ##
        new_gtkui_config["show_new_releases"] = \
            self.glade.get_object("chk_show_new_releases").get_active()
        new_core_config["send_info"] = \
            self.glade.get_object("chk_send_info").get_active()
        new_core_config["geoip_db_location"] = \
            self.glade.get_object("entry_geoip").get_text()

        ## Daemon tab ##
        new_core_config["daemon_port"] = \
            self.glade.get_object("spin_daemon_port").get_value_as_int()
        new_core_config["allow_remote"] = \
            self.glade.get_object("chk_allow_remote_connections").get_active()
        new_core_config["new_release_check"] = \
            self.glade.get_object("chk_new_releases").get_active()

        ## Proxy tab ##
        new_core_config["proxies"] = {}
        for t in ("peer", "web_seed", "tracker", "dht"):
            new_core_config["proxies"][t] = {}
            new_core_config["proxies"][t]["type"] = \
                self.glade.get_object("combo_proxy_type_%s" % t).get_active()
            new_core_config["proxies"][t]["port"] = \
                self.glade.get_object("spin_proxy_port_%s" % t).get_value_as_int()
            new_core_config["proxies"][t]["username"] = \
                self.glade.get_object("txt_proxy_username_%s" % t).get_text()
            new_core_config["proxies"][t]["password"] = \
                self.glade.get_object("txt_proxy_password_%s" % t).get_text()
            new_core_config["proxies"][t]["hostname"] = \
                self.glade.get_object("txt_proxy_server_%s" % t).get_text()

        ## Queue tab ##
        new_core_config["queue_new_to_top"] = \
            self.glade.get_object("chk_queue_new_top").get_active()
        new_core_config["max_active_seeding"] = \
            self.glade.get_object("spin_seeding").get_value_as_int()
        new_core_config["max_active_downloading"] = \
            self.glade.get_object("spin_downloading").get_value_as_int()
        new_core_config["max_active_limit"] = \
            self.glade.get_object("spin_active").get_value_as_int()
        new_core_config["dont_count_slow_torrents"] = \
            self.glade.get_object("chk_dont_count_slow_torrents").get_active()
        new_core_config["stop_seed_at_ratio"] = \
            self.glade.get_object("chk_seed_ratio").get_active()
        new_core_config["remove_seed_at_ratio"] = \
            self.glade.get_object("chk_remove_ratio").get_active()
        new_core_config["stop_seed_ratio"] = \
            self.glade.get_object("spin_share_ratio").get_value()
        new_core_config["share_ratio_limit"] = \
            self.glade.get_object("spin_share_ratio_limit").get_value()
        new_core_config["seed_time_ratio_limit"] = \
            self.glade.get_object("spin_seed_time_ratio_limit").get_value()
        new_core_config["seed_time_limit"] = \
            self.glade.get_object("spin_seed_time_limit").get_value()

        ## Cache tab ##
        new_core_config["cache_size"] = \
            self.glade.get_object("spin_cache_size").get_value_as_int()
        new_core_config["cache_expiry"] = \
            self.glade.get_object("spin_cache_expiry").get_value_as_int()

        # Run plugin hook to apply preferences
        component.get("PluginManager").run_on_apply_prefs()

        # GtkUI
        for key in new_gtkui_config.keys():
            # The values do not match so this needs to be updated
            if self.gtkui_config[key] != new_gtkui_config[key]:
                self.gtkui_config[key] = new_gtkui_config[key]

        # Core
        if client.connected():
            # Only do this if we're connected to a daemon
            config_to_set = {}
            for key in new_core_config.keys():
                # The values do not match so this needs to be updated
                try:
                    if self.core_config[key] != new_core_config[key]:
                        config_to_set[key] = new_core_config[key]
                except KeyError:
                    config_to_set[key] = new_core_config[key]

            if config_to_set:
                # Set each changed config value in the core
                client.core.set_config(config_to_set)
                client.force_call(True)
                # Update the configuration
                self.core_config.update(config_to_set)

        if hide:
            self.hide()
        else:
            # Re-show the dialog to make sure everything has been updated
            self.show()

        if client.is_classicmode() != new_gtkui_config["classic_mode"]:
            dialog = Gtk.MessageDialog(
                flags=Gtk.DialogFlags.MODAL
                | Gtk.DialogFlags.DESTROY_WITH_PARENT,
                type=Gtk.MessageType.QUESTION,
                buttons=Gtk.ButtonsType.YES_NO,
                message_format=
                _("You must restart the deluge UI to change classic mode. Quit now?"
                  ))
            result = dialog.run()
            if result == Gtk.ResponseType.YES:
                shutdown_daemon = (not client.is_classicmode()
                                   and client.connected()
                                   and client.is_localhost())
                component.get("MainWindow").quit(shutdown=shutdown_daemon)
            dialog.destroy()
Пример #14
0
    def __init__(self):
        # Get the glade file for the about dialog
        def url_hook(dialog, url):
            deluge.common.open_url_in_browser(url)

        gtk.about_dialog_set_url_hook(url_hook)
        self.about = gtk.AboutDialog()
        self.about.set_position(gtk.WIN_POS_CENTER)
        self.about.set_name("Deluge")
        self.about.set_program_name(_("Deluge"))

        version = deluge.common.get_version()

        self.about.set_copyright(_('Copyright 2007-2011 Deluge Team'))
        self.about.set_comments(
            _("A peer-to-peer file sharing program\nutilizing the BitTorrent protocol."
              ) + "\n\n" + _("Client:") + " %s\n" % version)
        self.about.set_version(version)
        self.about.set_authors([
            _("Current Developers:"), "Andrew Resch", "Damien Churchill",
            "John Garland", "Calum Lind", "", "libtorrent (libtorrent.org):",
            "Arvid Norberg", "",
            _("Past Developers or Contributors:"), "Zach Tibbitts",
            "Alon Zakai", "Marcos Pinto", "Alex Dedul",
            "Sadrul Habib Chowdhury", "Ido Abramovich", "Martijn Voncken"
        ])
        self.about.set_artists(["Andrew Wedderburn", "Andrew Resch"])
        self.about.set_translator_credits("\n".join([
            "Aaron Wang Shi", "abbigss", "ABCdatos", "Abcx", "Actam", "Adam",
            "adaminikisi", "adi_oporanu", "Adrian Goll", "afby", "Ahmades",
            "Ahmad Farghal", "Ahmad Gharbeia أحمد غربية", "akira",
            "Aki Sivula", "Alan Pepelko", "Alberto", "Alberto Ferrer",
            "alcatr4z", "AlckO", "Aleksej Korgenkov", "Alessio Treglia",
            "Alexander Ilyashov", "Alexander Matveev", "Alexander Saltykov",
            "Alexander Taubenkorb", "Alexander Telenga", "Alexander Yurtsev",
            "Alexandre Martani", "Alexandre Rosenfeld",
            "Alexandre Sapata Carbonell", "Alexey Osipov",
            "Alin Claudiu Radut", "allah", "AlSim", "Alvaro Carrillanca P.",
            "A.Matveev", "Andras Hipsag", "András Kárász", "Andrea Ratto",
            "Andreas Johansson", "Andreas Str", "André F. Oliveira", "AndreiF",
            "andrewh", "Angel Guzman Maeso", "Aníbal Deboni Neto", "animarval",
            "Antonio Cono", "antoniojreyes", "Anton Shestakov",
            "Anton Yakutovich", "antou", "Arkadiusz Kalinowski", "Artin",
            "artir", "Astur", "Athanasios Lefteris",
            "Athmane MOKRAOUI (ButterflyOfFire)", "Augusta Carla Klug",
            "Avoledo Marco", "axaard", "AxelRafn", "Axezium", "Ayont", "b3rx",
            "Bae Taegil", "Bajusz Tamás", "Balaam's Miracle", "Ballestein",
            "Bent Ole Fosse", "berto89", "bigx", "Bjorn Inge Berg",
            "blackbird", "Blackeyed", "blackmx", "BlueSky", "Blutheo", "bmhm",
            "bob00work", "boenki", "Bogdan Bădic-Spătariu", "bonpu", "Boone",
            "boss01", "Branislav Jovanović", "bronze", "brownie", "Brus46",
            "bumper", "butely", "BXCracer", "c0nfidencal", "Can Kaya",
            "Carlos Alexandro Becker", "cassianoleal", "Cédric.h",
            "César Rubén", "chaoswizard", "Chen Tao", "chicha",
            "Chien Cheng Wei", "Christian Kopac", "Christian Widell",
            "Christoffer Brodd-Reijer", "christooss", "CityAceE", "Clopy",
            "Clusty", "cnu", "Commandant", "Constantinos Koniaris", "Coolmax",
            "cosmix", "Costin Chirvasuta", "CoVaLiDiTy", "cow_2001",
            "Crispin Kirchner", "crom", "Cruster", "Cybolic", "Dan Bishop",
            "Danek", "Dani", "Daniel Demarco", "Daniel Ferreira",
            "Daniel Frank", "Daniel Holm", "Daniel Høyer Iversen",
            "Daniel Marynicz", "Daniel Nylander", "Daniel Patriche",
            "Daniel Schildt", "Daniil Sorokin", "Dante Díaz",
            "Daria Michalska", "DarkenCZ", "Darren", "Daspah",
            "David Eurenius", "davidhjelm", "David Machakhelidze",
            "Dawid Dziurdzia", "Daya Adianto ", "dcruz", "Deady",
            "Dereck Wonnacott", "Devgru", "Devid Antonio Filoni"
            "DevilDogTG", "di0rz`", "Dialecti Valsamou", "Diego Medeiros",
            "Dkzoffy", "Dmitrij D. Czarkoff", "Dmitriy Geels",
            "Dmitry Olyenyov", "Dominik Kozaczko", "Dominik Lübben",
            "doomster", "Dorota Król", "Doyen Philippe", "Dread Knight",
            "DreamSonic", "duan", "Duong Thanh An", "DvoglavaZver", "dwori",
            "dylansmrjones", "Ebuntor", "Edgar Alejandro Jarquin Flores",
            "Eetu", "ekerazha", "Elias Julkunen", "elparia", "Emberke",
            "Emiliano Goday Caneda", "EndelWar", "eng.essam", "enubuntu",
            "ercangun", "Erdal Ronahi", "ergin üresin", "Eric",
            "Éric Lassauge", "Erlend Finvåg", "Errdil", "ethan shalev",
            "Evgeni Spasov", "ezekielnin", "Fabian Ordelmans",
            "Fabio Mazanatti", "Fábio Nogueira", "FaCuZ", "Felipe Lerena",
            "Fernando Pereira", "fjetland", "Florian Schäfer", "FoBoS",
            "Folke", "Force", "fosk", "fragarray", "freddeg",
            "Frédéric Perrin", "Fredrik Kilegran", "FreeAtMind",
            "Fulvio Ciucci", "Gabor Kelemen", "Galatsanos Panagiotis",
            "Gaussian", "gdevitis", "Georg Brzyk", "George Dumitrescu",
            "Georgi Arabadjiev", "Georg Sieber", "Gerd Radecke",
            "Germán Heusdens", "Gianni Vialetto", "Gigih Aji Ibrahim",
            "Giorgio Wicklein", "Giovanni Rapagnani", "Giuseppe", "gl", "glen",
            "granjerox", "Green Fish", "greentea", "Greyhound", "G. U.",
            "Guillaume BENOIT", "Guillaume Pelletier", "Gustavo Henrique Klug",
            "gutocarvalho", "Guybrush88", "Hans Rødtang", "HardDisk",
            "Hargas Gábor", "Heitor Thury Barreiros Barbosa", "helios91940",
            "helix84", "Helton Rodrigues", "Hendrik Luup", "Henrique Ferreiro",
            "Henry Goury-Laffont", "Hezy Amiel", "hidro", "hoball", "hokten",
            "Holmsss", "hristo.num", "Hubert Życiński", "Hyo", "Iarwain",
            "ibe", "ibear", "Id2ndR", "Igor Zubarev", "IKON (Ion)", "imen",
            "Ionuț Jula", "Isabelle STEVANT", "István Nyitrai",
            "Ivan Petrovic", "Ivan Prignano", "IvaSerge", "jackmc",
            "Jacks0nxD", "Jack Shen", "Jacky Yeung", "Jacques Stadler",
            "Janek Thomaschewski", "Jan Kaláb", "Jan Niklas Hasse",
            "Jasper Groenewegen", "Javi Rodríguez", "Jayasimha (ಜಯಸಿಂಹ)",
            "jeannich", "Jeff Bailes", "Jesse Zilstorff", "Joan Duran",
            "João Santos", "Joar Bagge", "Joe Anderson", "Joel Calado",
            "Johan Linde", "John Garland", "Jojan", "jollyr0ger",
            "Jonas Bo Grimsgaard", "Jonas Granqvist", "Jonas Slivka",
            "Jonathan Zeppettini", "Jørgen", "Jørgen Tellnes", "josé",
            "José Geraldo Gouvêa", "José Iván León Islas", "José Lou C.",
            "Jose Sun", "Jr.", "Jukka Kauppinen", "Julián Alarcón",
            "julietgolf", "Jusic", "Justzupi", "Kaarel", "Kai Thomsen",
            "Kalman Tarnay", "Kamil Páral", "Kane_F", "*****@*****.**",
            "Kateikyoushii", "kaxhinaz", "Kazuhiro NISHIYAMA", "Kerberos",
            "Keresztes Ákos", "kevintyk", "kiersie", "Kimbo^", "Kim Lübbe",
            "kitzOgen", "Kjetil Rydland", "kluon", "kmikz", "Knedlyk",
            "koleoptero", "Kőrösi Krisztián", "Kouta", "Krakatos",
            "Krešo Kunjas", "kripken", "Kristaps", "Kristian Øllegaard",
            "Kristoffer Egil Bonarjee", "Krzysztof Janowski",
            "Krzysztof Zawada", "Larry Wei Liu", "laughterwym", "Laur Mõtus",
            "lazka", "leandrud", "lê bình", "Le Coz Florent", "Leo", "liorda",
            "LKRaider", "LoLo_SaG", "Long Tran", "Lorenz", "Low Kian Seong",
            "Luca Andrea Rossi", "Luca Ferretti", "Lucky LIX", "Luis Gomes",
            "Luis Reis", "Łukasz Wyszyński", "luojie-dune", "maaark",
            "Maciej Chojnacki", "Maciej Meller", "Mads Peter Rommedahl",
            "Major Kong", "Malaki", "malde", "Malte Lenz",
            "Mantas Kriaučiūnas", "Mara Sorella", "Marcin",
            "Marcin Falkiewicz", "marcobra", "Marco da Silva",
            "Marco de Moulin", "Marco Rodrigues", "Marcos", "Marcos Escalier",
            "Marcos Pinto", "Marcus Ekstrom", "Marek Dębowski", "Mário Buči",
            "Mario Munda", "Marius Andersen", "Marius Hudea", "Marius Mihai",
            "Mariusz Cielecki", "Mark Krapivner", "marko-markovic",
            "Markus Brummer", "Markus Sutter", "Martin", "Martin Dybdal",
            "Martin Iglesias", "Martin Lettner", "Martin Pihl",
            "Masoud Kalali", "mat02", "Matej Urbančič", "Mathias-K",
            "Mathieu Arès", "Mathieu D. (MatToufoutu)", "Mathijs", "Matrik",
            "Matteo Renzulli", "Matteo Settenvini", "Matthew Gadd",
            "Matthias Benkard", "Matthias Mailänder", "Mattias Ohlsson",
            "Mauro de Carvalho", "Max Molchanov", "Me", "MercuryCC",
            "Mert Bozkurt", "Mert Dirik", "MFX", "mhietar", "mibtha",
            "Michael Budde", "Michael Kaliszka", "Michalis Makaronides",
            "Michał Tokarczyk", "Miguel Pires da Rosa", "Mihai Capotă",
            "Miika Metsälä", "Mikael Fernblad", "Mike Sierra", "mikhalek",
            "Milan Prvulović", "Milo Casagrande", "Mindaugas",
            "Miroslav Matejaš", "misel", "mithras", "Mitja Pagon", "M.Kitchen",
            "Mohamed Magdy", "moonkey", "MrBlonde", "muczy", "Münir Ekinci",
            "Mustafa Temizel", "mvoncken", "Mytonn", "NagyMarton", "neaion",
            "Neil Lin", "Nemo", "Nerijus Arlauskas", "Nicklas Larsson",
            "Nicolaj Wyke", "Nicola Piovesan", "Nicolas Sabatier",
            "Nicolas Velin", "Nightfall", "NiKoB", "Nikolai M. Riabov",
            "Niko_Thien", "niska", "Nithir", "noisemonkey", "nomemohes",
            "nosense", "null", "Nuno Estêvão", "Nuno Santos", "nxxs", "nyo",
            "obo", "Ojan", "Olav Andreas Lindekleiv", "oldbeggar",
            "Olivier FAURAX", "orphe", "osantana", "Osman Tosun", "OssiR",
            "otypoks", "ounn", "Oz123", "Özgür BASKIN", "Pablo Carmona A.",
            "Pablo Ledesma", "Pablo Navarro Castillo", "Paco Molinero",
            "Pål-Eivind Johnsen", "pano", "Paolo Naldini", "Paracelsus",
            "Patryk13_03", "Patryk Skorupa", "PattogoTehen", "Paul Lange",
            "Pavcio", "Paweł Wysocki", "Pedro Brites Moita",
            "Pedro Clemente Pereira Neto", "Pekka \"PEXI\" Niemistö",
            "Penegal", "Penzo", "perdido", "Peter Kotrcka", "Peter Skov",
            "Peter Van den Bosch", "Petter Eklund", "Petter Viklund",
            "phatsphere", "Phenomen", "Philipi", "Philippides Homer",
            "phoenix", "pidi", "Pierre Quillery", "Pierre Rudloff",
            "Pierre Slamich", "Pietrao", "Piotr Strębski", "Piotr Wicijowski",
            "Pittmann Tamás", "Playmolas", "Prescott", "Prescott_SK",
            "pronull", "Przemysław Kulczycki", "Pumy", "pushpika", "PY",
            "qubicllj", "r21vo", "Rafał Barański", "rainofchaos", "Rajbir",
            "ras0ir", "Rat", "rd1381", "Renato", "Rene Hennig", "Rene Pärts",
            "Ricardo Duarte", "Richard", "Robert Hrovat", "Roberth Sjonøy",
            "Robert Lundmark", "Robin Jakobsson", "Robin Kåveland",
            "Rodrigo Donado", "Roel Groeneveld", "rohmaru", "Rolf Christensen",
            "Rolf Leggewie", "Roni Kantis", "Ronmi", "Rostislav Raykov",
            "royto", "RuiAmaro", "Rui Araújo", "Rui Moura", "Rune Svendsen",
            "Rusna", "Rytis", "Sabirov Mikhail", "salseeg", "Sami Koskinen",
            "Samir van de Sand", "Samuel Arroyo Acuña", "Samuel R. C. Vale",
            "Sanel", "Santi", "Santi Martínez Cantelli", "Sardan",
            "Sargate Kanogan", "Sarmad Jari", "Saša Bodiroža", "sat0shi",
            "Saulius Pranckevičius", "Savvas Radevic", "Sebastian Krauß",
            "Sebastián Porta", "Sedir", "Sefa Denizoğlu", "sekolands",
            "Selim Suerkan", "semsomi", "Sergii Golovatiuk", "setarcos",
            "Sheki", "Shironeko", "Shlomil", "silfiriel", "Simone Tolotti",
            "Simone Vendemia", "sirkubador", "Sławomir Więch", "slip", "slyon",
            "smoke", "Sonja", "spectral", "spin_555", "spitf1r3", "Spiziuz",
            "Spyros Theodoritsis", "SqUe", "Squigly", "srtck",
            "Stefan Horning", "Stefano Maggiolo", "Stefano Roberto Soleti",
            "steinberger", "Stéphane Travostino", "Stephan Klein",
            "Steven De Winter", "Stevie", "Stian24", "stylius", "Sukarn Maini",
            "Sunjae Park", "Susana Pereira", "szymon siglowy", "takercena",
            "TAS", "Taygeto", "temy4", "texxxxxx", "thamood",
            "Thanos Chatziathanassiou", "Tharawut Paripaiboon", "Theodoor",
            "Théophane Anestis", "Thor Marius K. Høgås", "Tiago Silva",
            "Tiago Sousa", "Tikkel", "tim__b", "Tim Bordemann", "Tim Fuchs",
            "Tim Kornhammar", "Timo", "Timo Jyrinki", "Timothy Babych",
            "TitkosRejtozo", "Tom", "Tomas Gustavsson",
            "Tomas Valentukevičius", "Tomasz Dominikowski", "Tomislav Plavčić",
            "Tom Mannerhagen", "Tommy Mikkelsen", "Tom Verdaat", "Tony Manco",
            "Tor Erling H. Opsahl", "Toudi", "tqm_z", "Trapanator", "Tribaal",
            "Triton", "TuniX12", "Tuomo Sipola", "turbojugend_gr",
            "Turtle.net", "twilight", "tymmej", "Ulrik", "Umarzuki Mochlis",
            "unikob", "Vadim Gusev", "Vagi", "Valentin Bora",
            "Valmantas Palikša", "VASKITTU", "Vassilis Skoullis", "vetal17",
            "vicedo", "viki", "villads hamann", "Vincent Garibal",
            "Vincent Ortalda", "vinchi007", "Vinícius de Figueiredo Silva",
            "Vinzenz Vietzke", "virtoo", "virtual_spirit", "Vitor Caike",
            "Vitor Lamas Gatti", "Vladimir Lazic", "Vladimir Sharshov",
            "Wanderlust", "Wander Nauta", "Ward De Ridder", "WebCrusader",
            "webdr", "Wentao Tang", "wilana",
            "Wilfredo Ernesto Guerrero Campos", "Wim Champagne", "World Sucks",
            "Xabi Ezpeleta", "Xavi de Moner", "XavierToo", "XChesser",
            "Xiaodong Xu", "xyb", "Yaron", "Yasen Pramatarov", "YesPoX",
            "Yuren Ju", "Yves MATHIEU", "zekopeko", "zhuqin", "Zissan",
            "Γιάννης Κατσαμπίρης", "Артём Попов", "Миша", "Шаймарданов Максим",
            "蔡查理"
        ]))
        self.about.set_wrap_license(True)
        self.about.set_license(
            _("This program is free software; you can redistribute it and/or "
              "modify it under the terms of the GNU General Public License as "
              "published by the Free Software Foundation; either version 3 of "
              "the License, or (at your option) any later version. \n\n"
              "This program "
              "is distributed in the hope that it will be useful, but WITHOUT "
              "ANY WARRANTY; without even the implied warranty of "
              "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU "
              "General Public License for more details. \n\n"
              "You should have received "
              "a copy of the GNU General Public License along with this program; "
              "if not, see <http://www.gnu.org/licenses>. \n\n"
              "In addition, as a "
              "special exception, the copyright holders give permission to link "
              "the code of portions of this program with the OpenSSL library. "
              "You must obey the GNU General Public License in all respects for "
              "all of the code used other than OpenSSL. \n\n"
              "If you modify file(s) "
              "with this exception, you may extend this exception to your "
              "version of the file(s), but you are not obligated to do so. If "
              "you do not wish to do so, delete this exception statement from "
              "your version. If you delete this exception statement from all "
              "source files in the program, then also delete it here."))
        self.about.set_website("http://deluge-torrent.org")
        self.about.set_website_label("deluge-torrent.org")

        self.about.set_icon(common.get_deluge_icon())
        self.about.set_logo(
            gtk.gdk.pixbuf_new_from_file(
                deluge.common.get_pixmap("deluge-about.png")))

        if client.connected():
            if not client.is_classicmode():
                self.about.set_comments(self.about.get_comments() +
                                        _("Server:") + " %coreversion%\n")

            self.about.set_comments(self.about.get_comments() + "\n" +
                                    _("libtorrent:") + " %ltversion%\n")

            def on_lt_version(result):
                c = self.about.get_comments()
                c = c.replace("%ltversion%", result)
                self.about.set_comments(c)

            def on_info(result):
                c = self.about.get_comments()
                c = c.replace("%coreversion%", result)
                self.about.set_comments(c)
                client.core.get_libtorrent_version().addCallback(on_lt_version)

            if not client.is_classicmode():
                client.daemon.info().addCallback(on_info)
            else:
                client.core.get_libtorrent_version().addCallback(on_lt_version)
Пример #15
0
    def set_config(self, hide=False):
        """
        Sets all altered config values in the core.

        :param hide: bool, if True, will not re-show the dialog and will hide it instead
        """
        try:
            from hashlib import sha1 as sha_hash
        except ImportError:
            from sha import new as sha_hash

        # Get the values from the dialog
        new_core_config = {}
        new_gtkui_config = {}

        ## Downloads tab ##
        new_gtkui_config["interactive_add"] = \
            self.glade.get_widget("chk_show_dialog").get_active()
        new_gtkui_config["focus_add_dialog"] = \
            self.glade.get_widget("chk_focus_dialog").get_active()
        new_core_config["copy_torrent_file"] = \
            self.glade.get_widget("chk_copy_torrent_file").get_active()
        new_core_config["del_copy_torrent_file"] = \
            self.glade.get_widget("chk_del_copy_torrent_file").get_active()
        new_core_config["move_completed"] = \
            self.glade.get_widget("chk_move_completed").get_active()
        if client.is_localhost():
            new_core_config["download_location"] = \
                self.glade.get_widget("download_path_button").get_filename()
            new_core_config["move_completed_path"] = \
                self.glade.get_widget("move_completed_path_button").get_filename()
            new_core_config["torrentfiles_location"] = \
                self.glade.get_widget("torrent_files_button").get_filename()
        else:
            new_core_config["download_location"] = \
                self.glade.get_widget("entry_download_path").get_text()
            new_core_config["move_completed_path"] = \
                self.glade.get_widget("entry_move_completed_path").get_text()
            new_core_config["torrentfiles_location"] = \
                self.glade.get_widget("entry_torrents_path").get_text()

        new_core_config["autoadd_enable"] = \
            self.glade.get_widget("chk_autoadd").get_active()
        if client.is_localhost():
            new_core_config["autoadd_location"] = \
                self.glade.get_widget("folder_autoadd").get_filename()
        else:
            new_core_config["autoadd_location"] = \
                self.glade.get_widget("entry_autoadd").get_text()

        new_core_config["compact_allocation"] = \
            self.glade.get_widget("radio_compact_allocation").get_active()
        new_core_config["prioritize_first_last_pieces"] = \
            self.glade.get_widget(
                "chk_prioritize_first_last_pieces").get_active()
        new_core_config["add_paused"] = \
            self.glade.get_widget("chk_add_paused").get_active()

        ## Network tab ##
        listen_ports = (
            self.glade.get_widget("spin_port_min").get_value_as_int(),
            self.glade.get_widget("spin_port_max").get_value_as_int()
        )
        new_core_config["listen_ports"] = listen_ports
        new_core_config["random_port"] = \
            self.glade.get_widget("chk_random_port").get_active()
        outgoing_ports = (
            self.glade.get_widget("spin_outgoing_port_min").get_value_as_int(),
            self.glade.get_widget("spin_outgoing_port_max").get_value_as_int()
        )
        new_core_config["outgoing_ports"] = outgoing_ports
        new_core_config["random_outgoing_ports"] = \
            self.glade.get_widget("chk_random_outgoing_ports").get_active()
        incoming_address = self.glade.get_widget("entry_interface").get_text().strip()
        if deluge.common.is_ip(incoming_address) or not incoming_address:
            new_core_config["listen_interface"] = incoming_address
        new_core_config["peer_tos"] = self.glade.get_widget("entry_peer_tos").get_text()
        new_core_config["dht"] = self.glade.get_widget("chk_dht").get_active()
        new_core_config["upnp"] = self.glade.get_widget("chk_upnp").get_active()
        new_core_config["natpmp"] = \
            self.glade.get_widget("chk_natpmp").get_active()
        new_core_config["utpex"] = \
            self.glade.get_widget("chk_utpex").get_active()
        new_core_config["lsd"] = \
            self.glade.get_widget("chk_lsd").get_active()
        new_core_config["enc_in_policy"] = \
            self.glade.get_widget("combo_encin").get_active()
        new_core_config["enc_out_policy"] = \
            self.glade.get_widget("combo_encout").get_active()
        new_core_config["enc_level"] = \
            self.glade.get_widget("combo_enclevel").get_active()
        new_core_config["enc_prefer_rc4"] = \
            self.glade.get_widget("chk_pref_rc4").get_active()

        ## Bandwidth tab ##
        new_core_config["max_connections_global"] = \
            self.glade.get_widget(
                "spin_max_connections_global").get_value_as_int()
        new_core_config["max_download_speed"] = \
            self.glade.get_widget("spin_max_download").get_value()
        new_core_config["max_upload_speed"] = \
            self.glade.get_widget("spin_max_upload").get_value()
        new_core_config["max_upload_slots_global"] = \
            self.glade.get_widget(
                "spin_max_upload_slots_global").get_value_as_int()
        new_core_config["max_half_open_connections"] = \
            self.glade.get_widget("spin_max_half_open_connections").get_value_as_int()
        new_core_config["max_connections_per_second"] = \
            self.glade.get_widget(
                "spin_max_connections_per_second").get_value_as_int()
        new_core_config["max_connections_per_torrent"] = \
            self.glade.get_widget(
                "spin_max_connections_per_torrent").get_value_as_int()
        new_core_config["max_upload_slots_per_torrent"] = \
            self.glade.get_widget(
                "spin_max_upload_slots_per_torrent").get_value_as_int()
        new_core_config["max_upload_speed_per_torrent"] = \
            self.glade.get_widget(
                "spin_max_upload_per_torrent").get_value()
        new_core_config["max_download_speed_per_torrent"] = \
            self.glade.get_widget(
                "spin_max_download_per_torrent").get_value()
        new_core_config["ignore_limits_on_local_network"] = \
            self.glade.get_widget("chk_ignore_limits_on_local_network").get_active()
        new_core_config["rate_limit_ip_overhead"] = \
            self.glade.get_widget("chk_rate_limit_ip_overhead").get_active()

        ## Interface tab ##
        new_gtkui_config["enable_system_tray"] = \
            self.glade.get_widget("chk_use_tray").get_active()
        new_gtkui_config["close_to_tray"] = \
            self.glade.get_widget("chk_min_on_close").get_active()
        new_gtkui_config["start_in_tray"] = \
            self.glade.get_widget("chk_start_in_tray").get_active()
        new_gtkui_config["enable_appindicator"] = \
            self.glade.get_widget("chk_enable_appindicator").get_active()
        new_gtkui_config["lock_tray"] = \
            self.glade.get_widget("chk_lock_tray").get_active()
        passhex = sha_hash(\
            self.glade.get_widget("txt_tray_password").get_text()).hexdigest()
        if passhex != "c07eb5a8c0dc7bb81c217b67f11c3b7a5e95ffd7":
            new_gtkui_config["tray_password"] = passhex
        new_gtkui_config["classic_mode"] = \
            self.glade.get_widget("chk_classic_mode").get_active()
        new_gtkui_config["show_rate_in_title"] = \
            self.glade.get_widget("chk_show_rate_in_title").get_active()
        new_gtkui_config["focus_main_window_on_add"] = \
            self.glade.get_widget("chk_focus_main_window_on_add").get_active()

        ## Other tab ##
        new_gtkui_config["show_new_releases"] = \
            self.glade.get_widget("chk_show_new_releases").get_active()
        new_core_config["send_info"] = \
            self.glade.get_widget("chk_send_info").get_active()
        new_core_config["geoip_db_location"] = \
            self.glade.get_widget("entry_geoip").get_text()

        ## Daemon tab ##
        new_core_config["daemon_port"] = \
            self.glade.get_widget("spin_daemon_port").get_value_as_int()
        new_core_config["allow_remote"] = \
            self.glade.get_widget("chk_allow_remote_connections").get_active()
        new_core_config["new_release_check"] = \
            self.glade.get_widget("chk_new_releases").get_active()

        ## Proxy tab ##
        new_core_config["proxies"] = {}
        for t in ("peer", "web_seed", "tracker", "dht"):
            new_core_config["proxies"][t] = {}
            new_core_config["proxies"][t]["type"] = \
                self.glade.get_widget("combo_proxy_type_%s" % t).get_active()
            new_core_config["proxies"][t]["port"] = \
                self.glade.get_widget("spin_proxy_port_%s" % t).get_value_as_int()
            new_core_config["proxies"][t]["username"] = \
                self.glade.get_widget("txt_proxy_username_%s" % t).get_text()
            new_core_config["proxies"][t]["password"] = \
                self.glade.get_widget("txt_proxy_password_%s" % t).get_text()
            new_core_config["proxies"][t]["hostname"] = \
                self.glade.get_widget("txt_proxy_server_%s" % t).get_text()

        ## Queue tab ##
        new_core_config["queue_new_to_top"] = \
            self.glade.get_widget("chk_queue_new_top").get_active()
        new_core_config["max_active_seeding"] = \
            self.glade.get_widget("spin_seeding").get_value_as_int()
        new_core_config["max_active_downloading"] = \
            self.glade.get_widget("spin_downloading").get_value_as_int()
        new_core_config["max_active_limit"] = \
            self.glade.get_widget("spin_active").get_value_as_int()
        new_core_config["dont_count_slow_torrents"] = \
            self.glade.get_widget("chk_dont_count_slow_torrents").get_active()
        new_core_config["stop_seed_at_ratio"] = \
            self.glade.get_widget("chk_seed_ratio").get_active()
        new_core_config["remove_seed_at_ratio"] = \
            self.glade.get_widget("chk_remove_ratio").get_active()
        new_core_config["stop_seed_ratio"] = \
            self.glade.get_widget("spin_share_ratio").get_value()
        new_core_config["share_ratio_limit"] = \
            self.glade.get_widget("spin_share_ratio_limit").get_value()
        new_core_config["seed_time_ratio_limit"] = \
            self.glade.get_widget("spin_seed_time_ratio_limit").get_value()
        new_core_config["seed_time_limit"] = \
            self.glade.get_widget("spin_seed_time_limit").get_value()

        ## Cache tab ##
        new_core_config["cache_size"] = \
            self.glade.get_widget("spin_cache_size").get_value_as_int()
        new_core_config["cache_expiry"] = \
            self.glade.get_widget("spin_cache_expiry").get_value_as_int()

        # Run plugin hook to apply preferences
        component.get("PluginManager").run_on_apply_prefs()

        # GtkUI
        for key in new_gtkui_config.keys():
            # The values do not match so this needs to be updated
            if self.gtkui_config[key] != new_gtkui_config[key]:
                self.gtkui_config[key] = new_gtkui_config[key]

        # Core
        if client.connected():
            # Only do this if we're connected to a daemon
            config_to_set = {}
            for key in new_core_config.keys():
                # The values do not match so this needs to be updated
                try:
                    if self.core_config[key] != new_core_config[key]:
                        config_to_set[key] = new_core_config[key]
                except KeyError:
                    config_to_set[key] = new_core_config[key]

            if config_to_set:
                # Set each changed config value in the core
                client.core.set_config(config_to_set)
                client.force_call(True)
                # Update the configuration
                self.core_config.update(config_to_set)

        if hide:
            self.hide()
        else:
            # Re-show the dialog to make sure everything has been updated
            self.show()

        if client.is_classicmode() != new_gtkui_config["classic_mode"]:
            dialog = gtk.MessageDialog(
                flags=gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT,
                type=gtk.MESSAGE_QUESTION,
                buttons=gtk.BUTTONS_YES_NO,
                message_format=_("You must restart the deluge UI to change classic mode. Quit now?")
            )
            result = dialog.run()
            if result == gtk.RESPONSE_YES:
                shutdown_daemon = (not client.is_classicmode() and
                                   client.connected() and
                                   client.is_localhost())
                component.get("MainWindow").quit(shutdown=shutdown_daemon)
            dialog.destroy()
Пример #16
0
    def _get_versions(self):
        if not client.is_classicmode():
            self._variables["server_version"] = yield client.daemon.info()
        self._variables["lt_version"] = yield client.core.get_libtorrent_version()

        self.label_about.setText(self._template.safe_substitute(self._variables))