120 Commits

Author SHA1 Message Date
Calum Lind
2657cc3921 [Lint] Quote cleanup 2016-11-17 10:19:59 +00:00
Calum Lind
ccfe6b3c80 [GTKUI] Add MainWindow.get_window() and replace window attr usage
* In GTK3 the use of `window` attribute is no longer valid so need to
   use get_window(). This updates MainWindow to follow the same convention.
2016-11-11 14:08:25 +00:00
Calum Lind
86549eb3ee [GTKUI] Cleanup references to MainWindow 2016-11-11 14:08:25 +00:00
Calum Lind
af6b277d28 [Lint] Add flake8-quotes to tox and fix bad quotes 2016-11-04 00:10:23 +00:00
Calum Lind
3a2ff0c188 [Lint] Convert all python double quotes to single quotes
* A rather disruptive change but for a few reasons such as easier to read,
   easier type, keep consistent and javascript code uses single quotes.
 * There are a few exceptions for the automated process:
    * Any double quotes in comments
    * Triple double quotes for docstrings
    * Strings containing single quotes are left e.g. "they're"

 * To deal with merge conflicts from feature branches it is best to follow
   these steps for each commit:
     * Create a patch: `git format-patch -1 <sha1>`
     * Edit the patch and replace double quotes with single except those in
       comments or strings containing an unescaped apostrophe.
     * Check the patch `git apply --check <patchfile>` and fix any remaining
       issues if it outputs an error.
     * Apply the patch `git am < <patchfile>`
2016-11-03 21:45:45 +00:00
bendikro
4d3cf756e4 [#2914] Fix: Specifying file version for default config 2016-10-30 12:45:02 +00:00
Calum Lind
618d2f9f58 [Lint] Enable pylint 'bad-continuation' and fix issues
There is some discrepency between pep8 and pylint for line
continuation (https://github.com/PyCQA/pylint/issues/747) but
with some minor layout changes both can pass and code looks fine,
if not better in places.
2016-05-09 20:10:51 +01:00
Calum Lind
807fa609f9 [Lint] Cleanup code to pass PyLint Warning category
Selected Warning messages disabled in pylintrc:
  * unused-argument: Quite a large and disruptive change if enabled.
  * broad-except: Most required in-depth investigation to determine type.
  * fixme: Not important
  * protected-access: Complicated to fix
  * import-error: Too many false-positives
  * unidiomatic-typecheck: Should be fixed in the next round of checks.
  * unused-variable: Again large and disruptive changes.
  * global-statement: Most usage is required.
  * attribute-defined-outside-init: Should be fixed in next round of checks.
  * arguments-differ: Possible false-positives, needs revisited.
  * no-init, non-parent-init-called, super-init-not-called: False-positives?
  * signature-differs: False-positives?
2015-10-30 18:39:47 +00:00
Calum Lind
5a6ca707e0 Fix isort and flake8 tests 2015-09-25 18:16:29 +01:00
Calum Lind
ca9d0abe4b [GTKUI] Fix connected issue in connection manager
* If host was not an ip address then it would not show as connected
2015-09-25 14:01:46 +01:00
Calum Lind
08b61eb50b Change imports to use absolute paths 2014-09-19 13:39:41 +01:00
Calum Lind
3315768b27 [GTKUI] All files Flake8'd and use new header 2014-09-03 23:30:14 +01:00
Calum Lind
b5dcfc6f9e Sort/prettify imports with isort 2014-09-03 18:27:32 +01:00
Calum Lind
1e6c811768 [Python-Modernize] lib2to3.fixes.fix_except
* Use 'ex' instead of 'e' to conform with pylint
 * Minimal Flake8 on some files
2014-09-03 17:22:38 +01:00
bendikro
1596475db2 GTKUI: New path chooser to handle remote paths and store favorite paths 2013-05-18 17:55:25 +01:00
Chase Sterling
a49d558aaf Add default localclient info to localhost items in gtk connection manager 2013-05-11 22:54:38 -04:00
Calum Lind
b82b313e32 Fix GTK ConnMgr update after stopping daemon and reduce wait time 2013-02-13 01:33:06 +00:00
Calum Lind
e2608a0ac9 Remove unnecessary translation from connection manager 2012-03-26 19:17:56 +01:00
Cristian Greco
b2eb5aeb8c Fix #1944 : Use errno constants for portability 2011-11-29 18:54:06 +00:00
Pedro Algarvio
312a57aa50 Remove some left overs. 2011-07-08 00:39:48 +01:00
Pedro Algarvio
f87ed6d5a6 Moved the MainWindow to GtkBuilder.
This probably broke some behaviour because converting and splitting from libglade to GtkBuilder is not as perfect as it should be. What I noticed was fixed.
Also, GtkBuilder only allow calling `connect_signals()` once. Some code had to change to handle this and a "handlers proxy class" was created to keep the behaviour we had, ie, connect signals from where it was needed. Then I monkey patch the main windows GtkBuilder to not allow anyone to connect signals through it since it would break behaviour. Connecting signals to the main window builder instance is now done like `component.get("MainWindow").connect_signals()`. The best solution will probably break the main window ui into the needed parts in order to not have to monkey patch main windows builder.
Plugin's trying to get the main windows `main_glade` are now broken, on purpose, ie, the code they have needs to change since the calls to the builder are not the same as the calls to libglade. The plugins we ship with deluge will be fix as soon as possible.
2011-07-07 20:48:02 +01:00
Pedro Algarvio
4dc4049851 Migrated the connection manager to GtkBuilder. 2011-07-06 11:33:31 +01:00
Pedro Algarvio
df3214168c Cleaner fix for #1874, code clean up and reusability.
Translations are now setup on `deluge.common`. Where they used to be setup, a call to `setup_translations(setup_pygtk=False)` is now made.
Every call to `pkg_resources.resource_filename()` is now made through `deluge.common.resource_filename` to make sure that we're loading data from the right deluge install.
2011-06-04 18:06:45 +01:00
Pedro Algarvio
e383187796 Fix #1281. Show a nice dialog stating that the client is incompatible on the GTK UI. 2011-05-17 22:50:05 +01:00
Pedro Algarvio
a7bd953169 GTK UI Connection Manager (#1824)
Warn the user if he's trying to connect to a local daemon that's not running and "start local daemon if necessary" is not enabled.
Extend and reuse the connection callbacks on the connection manager to re-use code.
2011-05-07 15:14:32 +01:00
Pedro Algarvio
6f3bc5620f Fix #1824.
When connected to a client, and then trying to connect to another, the connection manager component will be stopped(while the connect deferred is still running), so, the ConnectionManager.connection_manager reference will be deleted. If that's not the case, close the dialog.
2011-05-01 07:41:44 +01:00
Pedro Algarvio
dd3f78bd36 More changes related to automatic connections.
Auto-connecting on start of the gtk ui is now fully working.
Auto-staring localhost if needed is now also working.
Authentication failures now get passed correctly to the client implementation which will allow the user to enter username and/or password to complete authentication.
It's now possible to shutdown the daemon from the connection manager even if not on localhost, it just needs all required information to be present on the liststore.
2011-04-30 07:42:06 +01:00
Pedro Algarvio
63d0d0c69b GTK UI connection manager fixes.
Auto-connecting to daemon now works. Fixes #1815.
Auto-starting a `localhost` daemon now also works, the reconnecting attempts were not being "triggered".
When not connected to a daemon, "Quit & Shutdown Daemon" is not present. So #1818 is also fixed.
Some more work regarding #1819 was done.
Client now disconnects before shutting down the GTK UI.
2011-04-28 16:59:01 +01:00
Pedro Algarvio
a063095dad Make sure we have a config loaded in the connection manager. Fixes #1819. 2011-04-28 11:06:26 +01:00
Pedro Algarvio
9fa8748432 Fix some clean config dir issues.
Moved some auth stuff to `deluge.common` because they're also used on the GTK UI.
Now, if a user starts deluge in classic mode and tries to change it to client/daemon mode, he see's a dialog stating that the current session will be stopped. If he answers no, nothing is done, the classic mode pref is set back as it was. If he answers yes, all components are stopped and client is disconnected. At this stage the user can open the connection manager to start the daemon and connect.
If the user starts in client/daemon mode and switches to classic mode he see's a dialog stating that deluge must be restarted.
The GTK UI connection manager now loads it's default config with the localclient username and password. If not present in the auth file, the auth file will be recreated.
2011-04-27 22:06:13 +01:00
Pedro Algarvio
f41f6ad46a Test fixes and #1814 fix.
All test were adapted, and some more were added to comply with the new multiuser support in deluge.
Regarding #1814, host entries in the Connection Manager UI are now migrated from the old format were automatic localhost logins were possible, which no longer is.
2011-04-27 19:32:13 +01:00
Pedro Algarvio
91801e1632 Cleanup debug message new lines. 2011-04-26 10:14:39 +01:00
Pedro Algarvio
e44cac0eaa Since there's no default username for authentication, update hostlist to include the username.
Remove debug prints or extreme debugging. Minor code cleanup. Remove un-used imports.
2011-04-22 11:24:42 +01:00
Pedro Algarvio
86a1b801f5 Now it is possible to not even store the username on the hosts entry in the connection manager, both username and password will be asked to the user. WARNING: No more "localclient" automatic login, ie, username, is mandatory else, it will be asked to the user. 2011-04-22 11:24:42 +01:00
Pedro Algarvio
b3870ad6dd Use a specific response code for authentication requests. Recreate authentication request exceptions on the client end. 2011-04-22 11:24:42 +01:00
Pedro Algarvio
b2a16a0240 Move deluge errors to the errors module, they will be reused later on other parts of code.
Now, calling connect on client has two behaviours, if username/password is passed the client connects, authenticates and returns daemon info, if username/password is not passed, only the daemon info is returned. This might change a bit later on though.
2011-04-22 11:22:19 +01:00
Pedro Algarvio
e17c035521 Cleaned up previous commit regarding threads and the GTK2Reactor.
Now a dialog apears if the daemon complains about a missing password in order to authenticate. Asks the password from the user and retries to connect.
2011-04-22 11:22:19 +01:00
Pedro Algarvio
6c99204828 The GtkUi's connection manager now has the ability to edit existing host entries besides adding and deleting them.
It also asks for a password prior to attemting to connect in case the password is null, this alows host entries not to store the passwords on file like it has done so far.
NOTE: This is not yet the desired behaviour, ie, the daemon should simply complain if the authentication details are incomplete and the client should act accordingly. I had an issue with this though, I catched the errback the daemon was sending, asked the user for the password and re-tried to authenticate again. However, twisted always locked when I tried this. I'm investigating it.
2011-04-22 11:22:19 +01:00
Andrew Resch
9ac0d62149 Remove some imports that are no longer neccessary 2011-02-23 11:21:47 -08:00
Calum Lind
c523958bf6 Fixes for gtk-ui translations 2011-02-14 23:50:08 +00:00
Pedro Algarvio
3b00a7de59 Swhiched the old style logging, ie, a single logger for all logging output to several loggers. This brings the ability to tweak the logging levels for each of the loggers, ie, we can have the "deluge" logger be at the ERROR level while having "deluge.core" at the DEBUG level, meaning we will only see log message for all of the deluge loggers above the ERROR level while still having all messages above the DEBUG level for the "deluge.core" logger and it's children. This kind of tweak can be achieved by adding a file named "logging.conf" to deluge's config dir and this is explained on the deluge.log.tweak_logging_levels function.
Passing `-r` to the cli's while also passing `-l` will make the logfile rotate when reaching 5Mb in size. Three backups will be kept at all times.
All deluge's code is now using this new style logging along with the git hosted plugins. For other plugins not hosted by deluge, which still imports `LOG` as the logger, a deprecation warning will be shown explaining the required changes needed to use the new style logging. New plugins created by the `create_plugin` script will use the new logging facilities.
2010-12-06 11:20:22 +00:00
John Garland
23544bd6b2 Close the connection manager on shutdown - patch from Jan Steffens 2010-05-02 22:39:25 +10:00
Andrew Resch
f8f9438950 Fix #1128 Show an error dialog when unable to start a 'deluged' process 2010-01-18 02:36:03 +00:00
Andrew Resch
5b94861fc9 Fix issue where stoping a daemon that you aren't connected to causes the gtkui to shutdown the
currently connected daemon.
2009-12-14 00:48:18 +00:00
Andrew Resch
358b5f4b19 Fix issue where hosts will show up erroneously as Offline 2009-12-13 21:46:55 +00:00
Andrew Resch
43df21517e Disconnect from daemon if getting the info fails 2009-12-13 21:34:26 +00:00
Andrew Resch
773f65d708 Add an error dialog when trying to add a duplicate host
Center the add host dialog over the connection manager
2009-12-13 21:25:22 +00:00
Andrew Resch
cd7b5082a0 Fix #1036 autoconnecting to localhost daemon on start-up 2009-12-13 20:49:23 +00:00
Andrew Resch
c6eaec6998 Fix #799 translate connection status 2009-10-24 02:04:19 +00:00
Andrew Resch
2334fff388 Add support for the deluge-gtk start script 2009-07-31 00:57:04 +00:00