summaryrefslogtreecommitdiffstats
path: root/deluge/ui
Commit message (Collapse)AuthorAge
* [Web] Accept charset in content-type for json messagesibizaman2022-06-12
| | | | | Trac: https://dev.deluge-torrent.org/ticket/3521 Closes: https://github.com/deluge-torrent/deluge/pull/385
* [WebUI] Fixed 'Complete Seen' and 'Completed' sortingMartin Hertz2022-05-17
| | | | Closes: https://github.com/deluge-torrent/deluge/pull/384
* [Console] Fix curses.init_pair raise ValueError on Py3.10Calum Lind2022-05-01
| | | | | | | Fix ValueError crash for console users with Python 3.10 Trac: https://dev.deluge-torrent.org/ticket/3518 See-also: https://docs.python.org/3/whatsnew/3.10.html#curses
* [TrackerIcons] Cleanup tmp files created by downloading pageCalum Lind2022-05-01
| | | | | | | | | | | | | Temporary files created while download host html page are no cleaned up if the download fails. Fixed by adding a 'finally' step in the callback chain to delete any created temporary files. Added tests to ensure the temporary files are deleted, using a fixture that creates a known filename for the test. Trac: https://dev.deluge-torrent.org/ticket/3167
* [TrackerIcon] Use httpdownloader page redirect handlingCalum Lind2022-05-01
| | | | | | | | | | | User reported infinite redirecting when attempting to fetch tracker icon. Fixed by allowing httpdownloader and RedirectAgent to handle page redirects including catching infinite redirects Trac: https://dev.deluge-torrent.org/ticket/3167 See-also: https://github.com/twisted/twisted/blob/5c24e9/src/twisted/web/client.py#L168
* [Core] Fixed KeyError in sessionproxy after torrent deleteDjLegolas2022-03-02
| | | | | | | | | | | When several torrents are being removed from session, an exception was being raised in a callback function `on_status` with the `torrent_id` of one (or more) of the removed torrents. Now we will catch when the torrent does not exist anymore and print a debug log about it. Closes: https://dev.deluge-torrent.org/ticket/3498 Closes: https://github.com/deluge-torrent/deluge/pull/341
* [Tests] Remove reference to Twisted TrialCalum Lind2022-03-02
| | | | | With the move to pytest remove remainings documentation or comments that refer to Trial.
* [Console] Swap j and k key's behavior to fit vim modemarik2022-03-02
| | | | | | | | | There is a problem in the Deluge's Console UI. This UI supports the j and k keys as up and down, but for some reason they are inverted. This commit inverts back the behaviour of j and k in several places. Resolves: https://dev.deluge-torrent.org/ticket/3483 Closes: https://github.com/deluge-torrent/deluge/pull/377
* [GTK] Remove unneeded glade icon activatable False propertyCalum Lind2022-03-02
| | | | | | This propery cause issue with added extra space in the entries, likely a minor GTK bug and property being leftover from GTK2 migration. The default is True and should have no effect since no icon is shown.
* [GTK] Refactor Connection Manager Add Host dialogCalum Lind2022-03-02
| | | | Replace table with grid and use single column for entries.
* [GTK] Fix obscured port number in Connection Manager Add HostCalum Lind2022-03-02
| | | | | | | | | | | | | | A visual problem with the port spin button meant that the port number was not fully visible in the entry field. The problem is related to icon activatable property value set to False when default is True. Although no icon is used is creates a left-hand 5px space in the entry which narrows the available text space and the entry does not expand to account for this. Fixed by removing primary_icon_activatable and secondary_icon_activatable properies so that default values of True is used.
* [Hostlist] Support IPv6 in host liststbkizle2022-02-18
| | | | | | | socket.gethostbyname does not support IPv6 name resolution, and getaddrinfo() should be used instead for IPv4/v6 dual stack support. Closes: https://github.com/deluge-torrent/deluge/pull/376
* [Console] Fix torrent details status errorCalum Lind2022-02-17
| | | | | | | | The torrent status num_peers and num_seeds was replaced for session status keys by accident as part of replacing deprecated session keys so revert those changes Ref: 2bd095e5bf
* [WebUI] Move HTML entity encoding to clientCalum Lind2022-02-14
| | | | | | | | | | | | | | | | | | | We should not be mangling the torrent data in the JSON API since this can have unintended consquences with names and filepaths that can be edited. If we escape those symbols in the JSON API then the data no longer matches that stored by core. Therefore shift the encoding to the client and consider dealing separetely with these entities when the user first adds a torrent. * Created a modified htmlEncode in Deluge Formatter based on extjs method that also encodes single quotes. * Removed renderers in ListViews since only templates specified via tpl are used and any render attribute specified was a no-op. * Removed old buggy escapeHtml Resolves: https://dev.deluge-torrent.org/ticket/3459 Ref: https://docs.sencha.com/extjs/6.5.3/modern/src/String.js.html#Ext.String-method-htmlEncode Ref: https://docs.sencha.com/extjs/3.4.0/source/Format.html#Ext-util-Format-method-htmlEncode
* [WebUI] Fix encoding HTML entities for torrent attributesCalum Lind2022-02-14
| | | | | | | | | | Ensure all torrent attributes that might contain malicious HTML entities are encoded. By allowing HTML entities to be rendered it enable malicious torrent files to perform XSS attacks. Resolves: https://dev.deluge-torrent.org/ticket/3459
* [GTK] Increase connection mgr default heightCalum Lind2022-02-13
| | | | | | | | | Could not see more than one host when connection manager opens so need to scroll or resize window Increased default height to now show three hosts when first opens Closes: https://dev.deluge-torrent.org/ticket/3431
* [GTK] Fix ui logic/bug of checked move_completedHenry Kwan2022-02-13
| | | | | | | | | | | | if move_completed is checked/True, options should be updated, not the other way round The path was updated the first time the move_completed option is selected and then ignored on further updated to the path. Fixed by checking instead if the path has changed. Closes: https://github.com/deluge-torrent/deluge/pull/374
* [Lint] Update linter version and fix issuesCalum Lind2022-02-13
| | | | | | | | | | | Notable changes: * Prettier >=2.3 with more consistent js assignments * Black now formats docstrings * Added isort to list of autoformaters * Update flake8 config for v4 Ref: https://prettier.io/blog/2021/05/09/2.3.0.html
* [Core] Stopped using libtorrent deprecated functionsDjLegolas2022-02-13
| | | | | | | | | | | | | | | | | As part of the process of adding support to LT 2.0, we should stop using all deprecated function, as some (if not all) were removed. For this process, we should use the LT 1.2 upgrade (guide)[1]. The change includes: * stop using file entries directly * start using the torrent handle's set/unset flags * stop using url key in add_torrent_params (for magnet) * stop accessing resume_data from save_resume_data_alert * stop using deprecated session status keys in UI [1] https://libtorrent.org/upgrade_to_1.2-ref.html Closes: https://dev.deluge-torrent.org/ticket/3499 Closes: https://github.com/deluge-torrent/deluge/pull/342
* [GTK] Fix adding daemon accountsCalum Lind2022-02-12
| | | | | | | | | | | Errors were raised when trying to add a new daemon account due to dialog being destroyed before looking up widget values. Fixed by saving widget values before destroying. Refactored code to be simplified with a named tuple for the account details instead of separate attributes and modernized the preferences dialog creation and account saving by replacing callback functions.
* [Console] Fix incorrect test for when a host is onlinebendikro2022-02-12
| | | | | | | | | | | | The tests in connectionmanager for when a host is online are broken and always considers a host as online. When an error occurs in e.g. in _on_connect_fail, report_message() in PopupsHandler expects the message to be string, not a Twisted Failure. Fix by checking if message is string and log a warning before converting to string. Closes: https://github.com/deluge-torrent/deluge/pull/277
* [GtkUI] Fix ETA being copied to neighboring empty cellsChase Sterling2022-02-11
| | | | | | | | | An optimization that avoided re-rendering treeview cells sometimes went wrong, and rendered a value from the wrong row when moving the mouse around the torrentview window. Closes: https://dev.deluge-torrent.org/ticket/3500 Closes: https://github.com/deluge-torrent/deluge/pull/371
* [GTK] Workaround crash on Windows with ico or gif iconsCalum Lind2022-02-09
| | | | | | | | | | A problem with GdkPixbuf loaders on Windows causes a hard crash when attempting to load ico or gif tracker icons. Added a workaround by skipping these icon types until a more permanent solution is found. Ref: https://dev.deluge-torrent.org/ticket/3501
* [GTK] Refactor out get_pixbuf_at_sizeCalum Lind2022-02-09
| | | | | The functionality of get_pixbuf and get_pixbuf_at_size is almost identical so reuse get_pixbuf with an optional size arg.
* [Config] Add mask_funcs to help mask passwords in logsCalum Lind2022-02-06
| | | | | | | | | | | Added a new Config class parameter `log_mask_funcs` to enable config instances hide sensitive information that would normally appear in config debug logs. Added mask password function to hostlist to replace passwords with '*'s in logs. Closes: https://github.com/deluge-torrent/deluge/pull/363
* [Console] Add the torrent label to info commandkingamajick2022-02-06
| | | | | Closes: https://dev.deluge-torrent.org/ticket/1556 Closes: https://github.com/deluge-torrent/deluge/pull/356
* Remove legacy PY2 sys.argv unicode handlingChase Sterling2022-02-03
| | | | | | | | | | | Fixed crash when sys.stdout was None When using pythonw on windows, sys.stdout and stdin are None. We had a legacy unicode_argv handler that was crashing in this instance. Just removed that, since sys.argv is always unicode on python 3 to fix the crash. Closes: https://github.com/deluge-torrent/deluge/pull/361
* [Tests] Transition tests to pure pytestChase Sterling2022-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert all the twisted.trial tests to pytest_twisted. Also move off of unittest.TestCase as well. Seems there were several tests which weren't actually testing what they should, and also some code that wasn't doing what the broken test said it should. Goals: Remove twisted.trial tests Move to pytest fixtures, rather than many classess and subclasses with setup and teardown functions Move away from self.assertX to assert style tests FIx broken tests Going forward I think these should be the goals when adding/modifying tests: * Don't use BaseTest or set_up tear_down methods any more. Fixtures should be used either in the test module/class, or make/improve the ones available in conftest.py * For sure don't use unittest or twisted.trial, they mess up the pytest stuff. * Prefer pytest_twisted.ensureDeferred with an async function over inlineCallbacks. - I think the async function syntax is nicer, and it helps catch silly mistakes, e.g. await None is invalid, but yield None isn't, so if some function returns an unexpected thing we try to await on, it will be caught earlier. (I struggled debugging a test for quite a while, then caught it immediately when switching to the new syntax) - Once the maybe_coroutine PR goes in, using the async syntax can also improve tracebacks when debugging tests. Things that should probably be cleaned up going forward: * Remove BaseTestCase * Remove the subclasses like DaemonBase in favor of new fixtures. * I think there are some other utility subclasses that could be removed too * Perhaps use parameterization in the ui_entry tests, rather that the weird combination of subclasses and the set_var fixture I mixed in. * Convert some of the callback stuff to pytest_twisted.ensureDeferred tests, just for nicer readability Details relating to pytest fixtures conftest.py in root dir: * https://github.com/pytest-dev/pytest/issues/5822#issuecomment-697331920 * https://docs.pytest.org/en/latest/deprecations.html#pytest-plugins-in-non-top-level-conftest-files Closes: https://github.com/deluge-torrent/deluge/pull/354
* [Gtk] Fixed edit torrents dialogs windows close issuesDjLegolas2022-01-30
| | | | | | | | | | Up until now, when closing the Add or Edit dialogs, of the `Edit Torrents`, using the top-right X button or using the Escape key, they were being destroyed without any way to reopening them, and it was breaking the `Edit Torrents` window itself. Now both dialogs have the right handlers for handing the closing process without breaking anything. Closes: deluge-torrent/deluge#324 Closes: https://dev.deluge-torrent.org/ticket/2434
* [Common] Add is_interface to validate network interfacestbkizle2022-01-30
| | | | | | | | | | | | | | | | | | | | | | Libtorrent now supports interface names instead of just IP address so add new common functions to validate user input. * Added is_interface that will verify if a libtorrent interface of name or IP address. * Added is_interface_name to verify that the name supplied is a valid network interface name in the operating system. On Windows sock.if_nameindex() is only supported on 3.8+ and does not return a uuid (required by libtorrent) so use ifaddr package. Using git commit version for ifaddr due to adapter name decode bug in v0.1.7. On other OSes attempt to use stdlib and fallback to ifaddr if installed otherwiser return True. * Added tests for is_interface & is_interface_name * Updated UIs with change from address to interface * Updated is_ipv6 and is_ipv4 to used inet_pton; now supported on Windows. Ref: https://github.com/pydron/ifaddr/pull/32 Closes: https://github.com/deluge-torrent/deluge/pull/338
* [GTK] Hide account password length in logDjLegolas2022-01-23
| | | | | | | | We should not let anyone know the account's password length, as it can help to crack it. Instead, we will print a constant amount (10) of asterisks. Closes: https://github.com/deluge-torrent/deluge/pull/346
* [GTK UI]About Dialog Update yeartbkizle2022-01-21
|
* [GTK] Added a torrent menu option for magnet copyDjLegolas2022-01-21
| | | | | | | | | this will lined-up with the WebUI, which already have this option. in addition, it will not open the Add Torrent URL dialog after copied, which happens automatically when there is torrent/magnet URIs in the clipboard. Closes: deluge-torrent/deluge#328 Closes: https://dev.deluge-torrent.org/ticket/3489
* [GTK] Fix unable to prefetch magnet in thinclientCalum Lind2022-01-08
| | | | | | | | | | | | | | | | A UnicodeDecodeError is raised in transfer module when attempting to prefetch a magnet. This is result of passing a Python dict containing text bytes and raw bytes that cannot be decoded as utf-8 in rencode when recieving the message. This could be handled in rencode by returning raw bytes if decoding fails (perhaps with a strict mode?) however better to follow convention of encoding raw bytes in base64 in API calls. Fixed by retaining bencoding and encoding with base64 when sending result. Resolves: https://github.com/deluge-torrent/deluge/pull/334
* [AutoAdd] Fixed error dialog not being shown on errorDjLegolas2022-01-06
| | | | | | | | | This happened due to the removal of `exception_msg` attribute, which was removed with the changes to `RPC` protocol in commit 9b812a4. Now we access the message using the `message` attribute. Closes: deluge-torrent/deluge#332 Closes: https://dev.deluge-torrent.org/ticket/3069
* [TrackerIcon] Fixed old-large icon removalDjLegolas2022-01-06
| | | | | | | After downloading and resizing the new icon, we try to remove the downloaded file, which is larger, but it fails because it tries to do so when the file is still open, and therefor locked. On close of the UI, we got `PermissionError` exceptions for each new icon.
* [TrackerIcon] Fixed parse error on UTF-8 sites with non-english charsDjLegolas2022-01-06
| | | | | | | | | | | | | When parsing the site's page in search for the FAVICON, the page gets opens. The default file encoding in dependent on the running OS, and might not be `UTF-8` on Windows. Therefor, some trackers might not get their icon downloaded at all because of an error: `UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 2158: character maps to <undefined>`. This fix adds a detection of file encoding using the optional `chardet` dependency, and also a test. Closes: deluge-torrent/deluge#333 Closes: https://dev.deluge-torrent.org/ticket/3479
* [GTK] Make combobox_window expand to widthPatrick Byrne2022-01-03
| | | | | | | This makes the download location entry textbox resizable which is very useful for entering long paths. Closes: deluge-torrent/deluge#295
* [WebUI] Define foreground and background colorsDjLegolas2022-01-03
| | | | | | | | There is no promise that default bg is white and default fg is black so define in deluge.css Ref: https://dev.deluge-torrent.org/ticket/3435 Closes: deluge-torrent/deluge#330
* [GTK] Use GtkSpinner when testing open portDjLegolas2022-01-03
| | | | | | | | | | this switched was motivated by an error which happened each time the check port button was clicked, and was caused by the GtkImage when loading the loading.gif file on Windows: cannot register existing type 'GdkPixbufGdipAnim' Closes: deluge-torrent/deluge#329
* [UI] Add Keywords property to desktop fileRedBearAK2021-12-29
| | | | | | | | Deluge fails to appear in some app launchers (GNOME app search, Albert launcher) when searching for just "torrent" or other keywords, rather than "bittorrent". This is due to the lack of a Keywords header/property in its desktop entry file. Adding this line should solve the issue. I don't know if the underscore "_" is actually necessary for this line, I just copied the appearance of the lines above it when inserting. Please check that this comes out without the underscore in the final file after processing. Closes: deluge-torrent/deluge#323
* Upgrade codebase with pyupgrade (>=py3.6)DjLegolas2021-12-29
| | | | | | | | Added pyupgrade utility with manual stage to pre-commit and run on all files. Ref: https://github.com/asottile/pyupgrade Closes: deluge-torrent/deluge#326
* [UI] Add SVG support for tracker iconsDjLegolas2021-12-29
| | | | | | | | | | | SVG files are supported by all browsers so need to support it as well, according to https://www.w3schools.com/html/html_favicon.asp Also, it appears as SEO.com site, which was dropped because of a cert issue, has only SVG icon. So enabled it again. Lastly, from python 3.2, `os.path.samefile` is supported on Windows. So Windows will now test TrackerIcons as well.
* Remove all Python 2 supportdeluge-2.1.0.dev0DjLegolas2021-12-28
| | | | | | | | | * Removed all __future__ imports from code * Removed all six dependencies * Removed all future_builtins imports * Removed all Python 2 related code Closes: deluge-torrent/deluge#325
* [GtkUI] Fix ETA sorting to match WebUICalum Lind2021-12-22
| | | | | | The sort for Ascending was putting longest eta first but seems more intuitive that the smallest time to wait should be first. The WebUI in previous commit swapped this behaviour so updating GtkUI.
* [WebUI] Fixed ETA sorting in WebUIDjLegolas2021-12-22
| | | | | | | | | | When sorting the according to ETA values, all torrents with infinite value were being considered a lower value (INF -> 12 -> 32) instead of largest (12 -> 32 -> INF). This is due to the fact that the INF symbol is placed to lower value (<= 0). Now the lower values are being treated as the largest JS number when sorting. Closes: https://dev.deluge-torrent.org/ticket/3413 Closes: https://github.com/deluge-torrent/deluge/pull/321
* [Console] Removed Core dependency from Console UIDjLegolas2021-12-22
| | | | | | | | UIs should not depend on core directly, so removing the dependency in ConsoleUI. This is done by adding a hard-coded variable. Closes https://dev.deluge-torrent.org/ticket/3491 Closes: https://github.com/deluge-torrent/deluge/pull/320
* [Servers] Moved check_ssl_keys and generate_ssl_keys to crypto_utils.pyDjLegolas2021-12-20
| | | | | | | | | With this change, we drop a core dependency from the UI. This will help group together all related functionality in one place, i.e. all security related functions. Also updated testssl.sh version to 3.0.6 (SECURITY_TEST) Closes: deluge-torrent/deluge#288
* [Build] Fix WebUI js minifying errorCalum Lind2021-12-15
| | | | | | | | | | | | | Some users encoutered a bug where WebUI in browser show a white screen, which indicates a problem with loading javascript files. The problem was due to closure minifying failure leaving a zero-length deluge-all.js file which broke the usual fallback mechanism to debug files. * Fixed usage of ES6 const declaration breaking closure minifying. * Cleanup minified files upon errors so no zero length files left * Replaced broken and unmaintained slimit with rjsmin. * Fixed unable to set dev or debug query args due to request args requiring bytes.
* [GTKUI] Open tracker edit with double clickDjLegolas2021-11-26
| | | | | Closes #2434 Closes: deluge-torrent/deluge#253