Commit Graph

974 Commits

Author SHA1 Message Date
Charles Kerr b3c3168f16
refactor: intern repeated strings e.g. downloadDir (#1430)
* refactor: intern repeated strings e.g. downloadDir

Add an app-wide interned QString cache for commonly-repeated
strings. Currently used for download_dir, announce_url, comment,
creator, error_string.
2020-09-07 22:52:29 -05:00
Charles Kerr 9f7c865454
refactor: don't store torrent hashes in QStrings (#1428)
* refactor: keep torrent hash in std::array<char,20>

This replaces the hashString QString allocation with a compile-time
array that's included in sizeof the Torrent struct that owns it.
2020-09-07 16:19:10 -05:00
Charles Kerr 90ce7efc09
fixup: qt client nicer torrent add handling (#1427)
* refactor: omit unnecessary #include

* refactor: make the onDuplicatesTimer slot private.

* feat: show dupe torrents in dialog's detailText

* fix: a stupid bug that I introduced.
2020-09-07 10:20:48 -05:00
Charles Kerr fdaad67def fixup! refactor: make variant_headers reusable to qt app. (#1369) 2020-09-07 00:33:46 -05:00
Charles Kerr 6b89ee7903 fixup! refactor: make variant_headers reusable to qt app. (#1369) 2020-09-06 22:12:55 -05:00
Charles Kerr 4d7950dcb9 fixup! refactor: speed up FaviconCache::add() again. (#1402) 2020-09-02 19:33:45 -05:00
Charles Kerr 0bd915c34c fixup! refactor: speed up FaviconCache::add() again. (#1402) 2020-09-02 19:28:36 -05:00
Charles Kerr 848125d6d8 fixup! feat: nicer add-torrent workflow in the qt client. (#1410) 2020-09-02 09:25:45 -05:00
Charles Kerr cf9b81eb7d
feat: nicer add-torrent workflow in the qt client. (#1410)
* If you accidentally try to add a lot of duplicates -- for example, by
  starting up with a lot of duplicate torrents in the watchdir -- then
  coalesce all of them into a single error dialog instead of spamming
  the desktop with a different dialog for every duplicate.

* Make the duplicate torrent dialog's error message slightly terser to
  make it accommodate a long list of torrents: omit the ".torrent" file
  suffixes and show an abbreviated form of the existing torrent's hash.

* Support searching by torrent hash in the filterbar's text entry.
  This is useful when copy/pasting the hash from the duplicate torrent
  error dialog and is also consistent with the GTK client behavior.

* Copy the GTK client's behavior of appending ".added" to the end of
  .torrent files after they've been added to the session.
2020-08-26 20:42:41 -05:00
Charles Kerr 1bb9e2eef2
refactor: speed up FaviconCache::add() again. (#1402)
* refactor: speed up FaviconCache::add() again.

Another iteration on FaviconCache::add() since it's still showing up so
high in my perf tests. add()'s url argument is now a QString instead of
a QUrl, and the class has a private unordered_map that maps QString urls
into Keys. Basically, QUrl generation is so expensive that it's worth
caching the result to avoid constructing the intermediate QUrl object.

Also, ensure that the network reply's `deleteLater()` method is called
so that they don't leak, and add 'svg' to the icon list since it's now
supported on all major browsers.
2020-08-26 14:00:39 -05:00
Charles Kerr b8a02fdfb3 fixup! refactor: remove exit-time destructors from transmission-qt (#1395) 2020-08-16 20:43:14 -05:00
Charles Kerr 68920f5fa6
refactor: remove exit-time destructors from transmission-qt (#1395)
* refactor: remove exit-time destructors from transmission-qt
2020-08-15 10:42:51 -05:00
Charles Kerr 677dc73eac
refactor: use GTest for running tests (#1383)
* refactor: use google-test on libtransmission tests
2020-08-11 13:11:55 -05:00
Charles Kerr 49400ab443
fix: qt client memory leaks (#1378)
* fix: don't leak the qt client's QFileSystemWatcher

* fix: don't leak the Qt client's ListViewProxyStyle
2020-07-29 18:21:11 -05:00
Charles Kerr 77ced2b7c8
Fix Ubuntu 18.04 Qt FTBFS (#1377)
* fix: avoid qt5_add_translation options on old qt5

Check the Qt5Linguist version before passing 'OPTIONS -silent' to
qt5_add_translation(). 'OPTIONS' arg support was merged 2018-01-12
https://codereview.qt.nokia.com/gitweb?p=qt%2Fqttools.git;a=commit;h=9f3dba2ea3978936565aa5e7893415a8a765268e
and made it into the 5.11 release on 2018-05-22.

* fix: ftbfs include <cassert> before using assert()
2020-07-29 14:53:55 -05:00
Charles Kerr 8f12792186
fix: ensure details dialog is updated on selection (#1376)
* fix: ensure details dialog is updated on selection
2020-07-29 11:56:23 -05:00
Charles Kerr 9da4abb003
feat: add 'transfer.complete' notification hint (#1374)
Described at https://developer.gnome.org/notification-spec/#categories ,
this is for a file transfer or download complete notification.
2020-07-28 16:51:01 -05:00
Charles Kerr 910944733e
refactor: reuse one QRequestHeader across requests (#1373)
Minor optimization: since we don't actually change our request headers
very often, we can lazy-build the request once and reuse that instead of
having to rebuild it each time.
2020-07-28 10:56:40 -05:00
Charles Kerr 0b042d85dd
fix: type deduction error introduced in 00be8d0 (#1372)
Explicitly delete the implied function to ensure we don't get bitten by
this again in the future.

Mark the string_views constexpr where possible so that we can avoid some
strlen() calls at runtime.
2020-07-27 18:34:40 -05:00
Charles Kerr 00be8d00d7
refactor: make variant_headers reusable to qt app. (#1369)
* refactor: make variant_headers reusable to qt app.

Torrent.cc's `change()` template methods are generically useful to deal
with tr_variant wrangling, but previously were only used in Torrent.cc.
This PR moves them into a new API `VariantHelpers.h` for use by Prefs,
Session, TorrentModel, etc.
2020-07-26 23:30:58 -05:00
Charles Kerr 7e1da2d8fe
refactor: only update favicon when tracker changes (#1336)
* refactor: make Favicon's Key a semi-opaque type and update a Torrent's icon only when the announce_url changes.
2020-06-24 13:28:54 -05:00
Charles Kerr 33a421e97f
refactor: only update filterbar comboboxes when necessary (#1335)
* refactor: Torrent::update() returns a delta bitset

Setting up for followup PRs where, instead of doing expensive work every
time there is a change, we can be more fine-grained and do the work only
if the relevant Torrent properties changed.

* chore: make uncrustify happy

* refactor: update filterbar counts more selectively

Only rebuild the activity and tracker combobox models when the model's
size changes or when the relevant Torrent properties change.

Previously, rebuild would happen on any Torrent property change even if
the properties were unrelated to activity or trackers.

* chore: remove redundant "private:" key
2020-06-23 18:54:08 -05:00
Charles Kerr f37253a3ab
feat: Torrent::update() returns a bitset of changed properties (#1334)
* refactor: Torrent::update() returns a delta bitset

Setting up for followup PRs where, instead of doing expensive work every
time there is a change, we can be more fine-grained and do the work only
if the relevant Torrent properties changed.

* chore: make uncrustify happy

* chore: fix #includes
2020-06-23 16:11:16 -05:00
Charles Kerr 83e4e4ca55
refactor: faster action sensitivity updates (#1333)
* refactor: faster action sensitivity updates

Currently we walk through every row in the model and pump its TorrentRole data, which can be expensive for long lists. However since we're only interested in the selected rows, let's save some traversal overhead by getting that list directly and walking it instead.
2020-06-23 12:16:07 -05:00
Charles Kerr 8fcfc1e4ae
feat: add 'edit-date' support to qt client (#1322)
edit-date got added to the backend in 3.00, but I never finished adding
it properly to the Qt client. This PR rectifies that. When a torrent is
edited, the Application and DetailsDialogs will re-query the backend to
update the torrent properties that are needed.
2020-06-18 15:34:11 -05:00
Charles Kerr fcda077cdd
chore: remove extraneous/default class destructors (#1317)
* chore: remove extraneous/default class destructors

* fixup! chore: remove extraneous/default class destructors
2020-06-15 09:30:29 -05:00
Charles Kerr 51573a3c1e
chore: clang-tidy cleanups (#1287)
* chore: fix syntax error in clang-tidy config file
2020-06-05 14:02:11 -05:00
Charles Kerr 1f28470cf4
chore: prefer QStringLiteral (#1284)
Further reading:
* https://forum.qt.io/topic/78540/qstringliteral-vs-qlatin1string/2
* https://woboq.com/blog/qstringliteral.html
* https://www.qt.io/blog/2014/06/13/qt-weekly-13-qstringliteral

tl;dr: QLatin1Literal uses less memory than QStringLiteral; however,
since most Qt APIs require a QString argument, there's extra runtime
cost of converting QLatin1Strings to QStrings. QStringLiteral uses a
little more memory but constructs its QStrings at compile time.

ok, the `prefer-qstringliteral` branch is getting out of control: the
secondary goal of fixing a .clang-tidy issue is causing more diffs
than the primary goal. So, I'm breaking it into two separate PRs.
2020-05-29 12:40:07 -05:00
Charles Kerr 070a7f2ffc
refactor: use snake_case field naming in qt client (#1262)
* refactor: use snake_case field naming in qt client

* fix: some missed symbols

* chore: make uncrustify happy

* fixup! refactor: use snake_case field naming in qt client
2020-05-27 16:53:12 -05:00
Charles Kerr d43aeb6a5c
chore: add clang-tidy checks to Qt client (#1236)
* chore: add clang-tidy integration for Qt client
2020-05-19 20:32:51 -05:00
Charles Kerr 6aa559f12f
refactor: remove QVariants from torrent (#1234)
* chore: remove qvariants from torrent class

* chore: remove unused Q_DECLARE macro calls

* refactor: remove unused includes from Torrent.h

* chore: make clang-tidy and linter happy

* refactor: rename 'setValue()' to 'change()'

* refactor: make tr_variant function paramters const

* chore: remove devel scaffolding

* refactor: rename peer_limit_ to peerLimit_

* refactor: do not use bitwise logic on booleans
2020-05-19 18:42:17 -05:00
Mike Gelfand 7db1c848ed Add new translations from Transifex (95% and higher)
GTK client: none.

Qt client: Finnish.

Mac client: none (there're suitable languages, but they're lacking XIB files
and we haven't switched to base localization yet).
2020-05-14 19:17:11 +03:00
Mike Gelfand 4aa60bad52 Sync existing translations with Transifex 2020-05-14 19:16:15 +03:00
Charles Kerr fa6df52d58
chore: remove unused methods (#1207)
* chore: remove unused methods in qt client

* chore: remove unused libtransmission methods

* chore: remove unused gtk methods

* chore: remove more unused libtransmission methods

* chore: remove more unused code found by @reardonia
2020-05-11 17:20:46 -05:00
Mike Gelfand 2d940e5caf
Bump copyright to 2020 (some more places) (#1206)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-05-02 12:26:42 -05:00
Charles Kerr 8739cb9c88
fixup! (trunk) update credits (#1205) 2020-05-02 11:42:18 -05:00
Mike Gelfand d1d27ae35f Add new translations from Transifex (95% and higher)
GTK client: none.

Qt client: Japanese.

Mac client: none (there're suitable languages, but they're lacking XIB files
and we haven't switched to base localization yet).
2020-05-02 13:26:24 +03:00
Mike Gelfand a79dbe4436 Sync existing translations with Transifex 2020-05-02 13:25:56 +03:00
Charles Kerr 797700e63f
perf: lazy-update actions enabled on change events (#1187)
* perf: lazy-update actions enabled on change events

Actions' sensitivity was being lazy-updated in response to other events
but accidentally were doing immediate updates in response to torrentsChanged
signals being emitted from TorrentModel. This commit makes that path a
lazy-update as well.

* chore: uncrustify

* refactor: make the idle updater a lambda again
2020-05-01 23:23:47 -05:00
Mike Gelfand 20119f006c
Fixup recent Qt client changes (#1107)
* Add EDIT_DATE torrent property declaration (Qt client)

Switch to static assertion to help avoid similar issues in the future.

* Only declare std::hash<QString> for Qt < 5.14

* Pass main window as context when connecting lambdas to torrents model signals (Qt client)

This helps to automatically disconnect from signals on main window
destruction. If not done, use after free is possible since main window is
destroyed before torrents model.

Fixes: #1106
2020-01-14 23:28:34 +02:00
Mike Gelfand d2c2da4f40 Fix minor code style violation 2020-01-03 03:30:26 +03:00
Charles Kerr 44fc571a67
feat: add editDate to RPC (#1056)
* feat: add tr_stat.infoDate to note tr_info changes

The last time during this session that any tr_info field changed
(e.g. trackers/filenames edited or magnet torrent got metadata).
RPC clients can monitor this to know when to reload fields which
don't usually change.
2019-11-12 17:13:42 -06:00
Charles Kerr c62cb35fd4
qt client speedups
* faster updating of trackers combobox.
* generate trackerDisplayNames just once per torrent
* refactor: cache torrent delegate's warning emblem
* refactor: change mainwin refresh debounce to 200ms
* refactor: do not store trackers, hosts in QVariant
* refactor: don't use `virtual` when it's not needed
* refactor: faster counting torrents-matching-filter
* refactor: faster tracker handling in filterbar
* refactor: improve json parser's prealloc heuristic
* refactor: make Torrent::hasError() faster
* refactor: remove redundant speed stats collection
* refactor: remove unnecessary tor->isQueued() calls
* refactor: use unordered containers where possible
* scale favicons only once, when adding to the cache
2019-11-11 19:37:05 -06:00
Charles Kerr 96f76999aa
feat: add "table" format in torrent-get RPC (#1049)
* feat: add optional "format" arg to torrent-get RPC

If the "format" request was "objects" (default), "torrents" will be an
array of objects, each of which contains the key/value pairs matching
the request's "fields" arg. This is unchanged from previous versions.

If the format was "table", then "torrents" will be an array of arrays.
The first row holds the keys and each remaining row holds a torrent's
values for those keys. This format is more efficient in terms of JSON
generation and JSON parsing.
2019-11-09 17:02:23 -06:00
Charles Kerr d857a5821a
refractor: simplify torrent model signal emissions (#1044)
refractor: simplify torrent model signal emissions

The Torrent->Application signal connections make up for about 5% of the
app's memory use. Move this to the TorrentModel so that there are only a
handful of signal connections.

Moving signals to TorrentModel means batch change signals can be emitted
instead of per-change-per-torrent emissions and can be handled that way.
2019-11-09 08:44:40 -06:00
Charles Kerr 4c79758dbc
refactor: debounce TorrentFilter prefs refiltering (#1027)
* refactor: debounce TorrentFilter prefs refiltering

When filter settings change, add a slight delay before refiltering. This
prevents the UI from freezing when the user is typing in the filterbar's
textfield.

Also fixes a long-standing wart that caused the model to be sorted twice
instead of just once whenever the filter text changed.
2019-11-06 19:13:41 -06:00
Charles Kerr 2cc5cfe3e3
feat: smart caching of TorrentDelegate::sizeHint() (#1026)
* feat: smart caching of TorrentDelegate::sizeHint()

* chore: bump c++ requirement to c++17 / c++1z
2019-11-06 18:17:48 -06:00
Charles Kerr 973afda057
refactor: keep torrent's time properties as time_t (#1042)
* refactor: keep torrent's time properties as time_t

Comparing QDateTimes is expensive. Keep the torrents' time properties in
the time_t form that we got them from RPG in; difftime() is cheaper.
2019-11-06 17:31:41 -06:00
Charles Kerr aa9b752cd9
refactor: don't load the same stock more than once (#1041)
* refactor: don't load the same stock more than once

Some actions share an icon -- for example, "start all", "start now", and
"start" each use "media-playback-start". When this happens, get the icon
once and cache it to avoid hitting the disk more often than necessary.

In addition, the statusbar's network transfer icon was being reloaded in
a periodic upkeep timer, reloading with QIcon::fromTheme each time. Only
give icons are needed, so load them once and cache them.

* refactor: better lookup of torrent mime-type icons

filename-to-mime-type and mime-type-to-icon lookups are both expensive,
so do a better job of detecting top-level folders and caching the icons
based on file suffixes.

This also lets find a good mime icon even if the torrent doesn't have
its 'files' property populated yet from RPC.
2019-11-06 15:09:04 -06:00
Charles Kerr abac811dd2
fix: gcc warnings in libtransmission/ and utils/ (#843)
* fix: __attribute__(__printf__) warnings

* fix: implicit fallthrough warning

* fixup! fix: implicit fallthrough warning

* fix: disable warnings for 3rd party code

Since we want to leave upstream code as-is

* fixup! fix: disable warnings for 3rd party code

* fixup! fix: disable warnings for 3rd party code

* silence spurious alignment warning

Xrefs
Discussion: https://stackoverflow.com/a/35554349
Macro inspiration: 90ac46f710/f/src/util/util_safealign.h (_35)

* fixup! fix: disable warnings for 3rd party code

* fixup! fix: implicit fallthrough warning

* make uncrustify happy

* remove uncrustify-test.sh

that's probably off-topic for this PR

* fixup! fix: __attribute__(__printf__) warnings

* Update libtransmission/CMakeLists.txt

Co-Authored-By: ckerr <ckerr@github.com>

* fixup! silence spurious alignment warning

* use -w for DISABLE_WARNINGS in Clang

* refactor: fix libtransmission deprecation warnings

* fix: pthread_create's start_routine's return value

This was defined as `void` on non-Windows but should have been `void*`

* chore: uncrustify

* fix: add DISABLE_WARNINGS option for SunPro Studio

* fix "unused in lambda capture" warnings by clang++

* fix 'increases required alignment' warning

Caused from storing int16_t's in a char array.

* fix net.c 'increases required alignment' warning

The code passes in a `struct sockaddr_storage*` which is a padded struct
large enough for the necessary alignment. Unfortunately it was recast as
a `struct sockaddr*` which has less padding and a smaller alignment. The
warning occrred because of these differing alignments.

* make building quieter so warnings are more visible

* fixup! fix 'increases required alignment' warning

* Fix -Wcast-function-type warnings in GTK+ app code

https://gitlab.gnome.org/GNOME/gnome-terminal/issues/96 talks about both
the issue and its solution.

GCC 8's -Wcast-function-type, enabled by -Wextra, is problematic in glib
applications because it's idiomatic there to recast function signatures,
e.g. `g_slist_free(list, (GFunc)g_free, NULL);`.

Disabling the warning with pragmas causes "unrecognized pragma" warnings
on clang and older versions of gcc, and disabling the warning could miss
actual bugs. GCC defines `void (*)(void)` as a special case that matches
anything so we can silence warnings by double-casting through GCallback.

In the previous example, the warning is silenced by changing the code to
read `g_slist_free(list, (GFunc)(GCallback)g_free, NULL);`).

* fixup! fix "unused in lambda capture" warnings by clang++

* fixup! fix "unused in lambda capture" warnings by clang++

* fix two more libtransmission compiler warnings

* fix: in watchdir, use TR_ENABLE_ASSERTS not NDEBUG
2019-11-06 11:27:03 -06:00
Mike Gelfand eef4799388 Update Uncrustify config to 0.69 2019-07-15 02:30:41 +03:00
Mike Gelfand 10cdd7f790 Use explicit boolean conversions 2019-07-14 16:25:07 +03:00
Mike Gelfand f3951faf3d Actually add new languages to the build 2019-03-13 23:35:16 +03:00
Mike Gelfand 95dd630ed4 Add new translations from Transifex (95% and higher)
GTK client: Portuguese (Portugal).

Qt client: Afrikaans, Catalan, Danish, Greek, Norwegian Bokmål, Slovenian.

Mac client: none (there're suitable languages, but they're lacking XIB files
and we haven't switched to base localization yet).
2019-03-06 03:14:15 +03:00
Mike Gelfand 3debbc7cb8 Sync existing translations with Transifex 2019-03-06 03:12:51 +03:00
Mike Gelfand 82df3a87f4 Update to Uncrustify 0.68.1
Tweak a few rules in the process. Now all code in cli, daemon, gtk,
libtransmission, qt, and utils is properly formatted with no manual
intervention.
2019-02-15 09:21:48 +03:00
Charles Kerr 7058f37bed
Merge pull request #816 from PeterDaveHello/improve-shellscript
fix shell script syntax errors and spacing inconsistencies
2019-02-01 22:36:54 -06:00
Peter Dave Hello 7a0d2e63c7 Refactor shell scripts with syntax and styling fixes 2019-01-16 03:22:29 +08:00
fetzu 3c0cb395c5 Updated copyright strings to 2019
Updated Transmission Project copyright dates to 2005-2019 in headers and code.
2019-01-11 19:36:19 +01:00
dubhater e19ab0b7a9
Qt: Fix bad downloaded percentage in DetailsDialog
It was always 0.0% as long as the torrent was not finished.
2018-03-08 14:12:52 +02:00
Mike Gelfand 991f066618 Fix progress bar width with Breeze style (Qt client)
In compact torrents view, use BAR_WIDTH as groove area width instead of
total progress bar width, to improve the appearance in case progress text
is drawn outside of the groove area (because of style settings).

Initial patch provided by dubhater.

Fixes: #491
2018-02-03 22:36:54 +03:00
dubhater 1e850cd874
Qt: Fix assert with one-letter root folder names
An assertion failure happens shortly after opening the
"Torrent properties" dialog if the torrent's root folder has
a one-letter name, e. g.
A/
A/Some Linux distro.iso
A/Some other Linux distro.iso

Off by one errors are great, eh?

This fixes https://trac.transmissionbt.com/ticket/6141
2018-01-30 23:44:12 +02:00
Mike Gelfand 94be7dbd9b Merge branch '2.9x' 2018-01-25 03:07:52 +03:00
Mike Gelfand aa2730d47c Switch to HTTPS links, adjust wiki links where possible
Fixes #39
2018-01-16 01:12:59 +03:00
Robert Vehse a6ef87b92d Update all instances of the donation link. Fixes #26. 2018-01-15 23:57:46 +03:00
cantabile ecefb992a1 Show file names in tooltips in Torrent Properties
File names are often too long to fit. Hovering is much easier than
resizing the column and possibly the window.
2017-09-30 20:26:49 +03:00
Mike Gelfand d2acb0fada Don't force debug configuration in qmake project 2017-07-21 01:39:55 +03:00
Mike Gelfand 88134ea62f Make version text in about dialog selectable/copyable (Qt client)
Closes: #326
2017-07-17 23:38:19 +03:00
Mike Gelfand 375f2642c8 Revert dd538539aa, fix RPC queue processing
Queue callback for items returning no new future was never called leaving
queue alive and leading to memory leak in Qt client.
2017-07-15 08:46:31 +03:00
Mike Gelfand 7e6f1a8dc8 Set idle seed limit range to 1..40320 (4 weeks tops) in all clients
Fixes: #212
2017-07-05 21:07:16 +03:00
Fish2 b0e3d4c37d lossless compression of images saved 72KB 2017-06-03 23:52:34 +01:00
Mike Gelfand 82722476aa Fix some issues reported by Coverity 2017-05-20 23:31:56 +03:00
Mike Gelfand 80cebdd296 Sync Qt translations with Transifex 2017-05-20 00:15:53 +03:00
Mike Gelfand fe1e88f843 Sync Qt translations with code 2017-05-19 23:11:47 +03:00
Mike Gelfand 69aa2f9491 Move pl_PL translations to pl 2017-05-19 23:11:06 +03:00
Mike Gelfand 5dc1192792 Move tr_TR translations to tr, sync list in qtr.pro 2017-05-19 21:49:04 +03:00
Mike Gelfand 6b0229a546 Fix some issues reported by Coverity 2017-05-16 21:37:00 +03:00
Mike Gelfand dd538539aa Fix torrent file trashing upon addition (Qt client) 2017-05-02 21:35:56 +03:00
Thomas Hines b3e30c0502 Added queue up/down hotkeys to the Qt interface. 2017-05-01 18:57:06 +03:00
Mike Gelfand 14370e5353 Fix a number of other style inconsistencies met along the way (part 2) 2017-05-01 18:47:49 +03:00
Mike Gelfand e1d53855f4 Avoid declaring multiple variables on the same line 2017-05-01 18:46:41 +03:00
Mike Gelfand f1656bc209 Don't return NaN from Torrent::percentComplete (Qt client) 2017-05-01 12:55:52 +03:00
Mike Gelfand c5e730c63a Only compare magnet state if not yet different 2017-05-01 12:45:09 +03:00
Christian Muehlhaeuser 6dd034b826 Fix sorting by progress (Qt client)
Magnet transfers caused the by-progress sorting to become non-stable, as their
percentComplete() could return NaN. This patch fixes this by preferring active
downloads over magnet transfers, then sorting them by percentComplete().
2017-05-01 12:44:47 +03:00
Mike Gelfand fbd8d4c79f Fix a number of other style inconsistencies met along the way 2017-04-30 19:33:55 +03:00
Mike Gelfand a762c770f2 Make conditional expressions explicitly boolean 2017-04-30 19:26:01 +03:00
Mike Gelfand 6da99c05e2 Use nullptr consistencty instead of 0 and NULL (Qt client) 2017-04-30 19:26:01 +03:00
Mike Gelfand 7bfd7f5863 Avoid declaring variables inside conditional expressions (Qt client) 2017-04-30 19:25:57 +03:00
Mike Gelfand 4f9d9ad92b Code style change leftovers
For some reason, GTK client wasn't fully processed. All the rest of changes
are mostly in comments.
2017-04-21 10:40:57 +03:00
Mike Gelfand dadffa2c0f Align type qualifiers to the right (code style)
This way all the qualifiers (`const`, `volatile`, `mutable`) are grouped
together, e.g. `T const* const x` vs. `const T* const x`. Also helps reading
types right-to-left, e.g. "constant pointer to constant T" vs. "constant
pointer to T which is constant".
2017-04-20 19:53:20 +03:00
Mike Gelfand d7930984ef Adjust uncrustify config, reformat all but Mac client
There're places where manual intervention is still required as uncrustify
is not ideal (unfortunately), but at least one may rely on it to do the
right thing most of the time (e.g. when sending in a patch).

The style itself is quite different from what we had before but making it
uniform across all the codebase is the key. I also hope that it'll make the
code more readable (YMMV) and less sensitive to further changes.
2017-04-20 10:01:22 +03:00
Mike Gelfand c77946e49a Set icon for "Open URL" action (Qt client) 2017-02-18 21:22:34 +03:00
Mike Gelfand c6bfe9de15 Use QtWinExtras instead of importing private Qt function to get QPixmap from HICON 2017-02-11 20:48:13 +03:00
Mike Gelfand 4b397ebfc0 Switch from deprecated QStyleOptionViewItemV* to QStyleOptionViewItem 2017-02-11 14:04:26 +03:00
Mike Gelfand 03034b5015 Remove supporting code for Qt < 5.2 2017-02-11 13:44:34 +03:00
Mike Gelfand 8dc6fb48b1 Bump minimum required Qt version to 5.2 2017-02-11 13:24:42 +03:00
Mike Gelfand caf3b7653c Improve Qt client look on hi-dpi displays 2017-02-08 01:06:28 +03:00
Mike Gelfand 13e111a89a Use default (instead of system) locale to be more flexible (Qt client) 2017-02-07 02:24:47 +03:00
Mike Gelfand 6c9fa2913b Use alternative method of loading translations (Qt client)
Fixes: #130
2017-02-07 00:58:51 +03:00
Sebastiaan Lokhorst 532246778b Correct Qt client desktop file name and add keywords 2017-02-04 15:03:49 +01:00
Mike Gelfand 4ddaa58287 Fix closing </i> in translatable phrase (Qt client) 2017-01-28 13:51:03 +03:00
Mike Gelfand d40d69702b Sync .ts files with Transifex and current source code
Add 4 new languages: Georgian, Dutch, Swedish, and Turkish (Turkey).
2017-01-27 04:50:14 +03:00
Mike Gelfand 5f3abbd6d8 Add myself to the list of Transmission authors 2017-01-15 01:38:45 +03:00
Markus Amalthea Magnuson 5b9ba3be0d HTTPS links for trac, forum, portcheck, and build subdomains. 2016-11-02 20:50:22 +01:00
Markus Amalthea Magnuson 727b9671f7 Update all website links to canonical HTTPS version. 2016-10-31 10:00:11 +01:00
Mike Gelfand f9c0ce63b8 Remove useless path button text updates, this is handled elsewhere 2016-10-03 23:41:50 +03:00
Mike Gelfand f6a19f868a TRAC-6098: Rework trailing slash stripping (once more)
Using QFileInfo to strip trailing slash(es) is bad when input contains non-
native paths (i.e. Windows paths on non-Windows system and vice versa) as it
may mistakenly treat the path as relative and change it in unespected way.
2016-10-03 22:22:25 +03:00
Mike Gelfand 7d22c1efc0 Merge branch 'trac5348-misidentification-of-local-session' 2016-10-03 21:54:52 +03:00
Mike Gelfand 4b4797a220 Revert debugging code... 2016-10-03 21:54:21 +03:00
Mike Gelfand 687662d1f1 Merge branch 'trac5348-misidentification-of-local-session' 2016-10-03 21:33:58 +03:00
Mike Gelfand 981ef30ab4 Use session ID (if available) to check if session is local or not (Qt client) 2016-10-03 21:26:28 +03:00
Robert Vehse 13bae8179e Update all instances of the donation link. Fixes #26. 2016-09-23 04:36:41 +02:00
Mike Gelfand 2248d3670f Get rid of $Id$ SVN keywords in source files 2016-09-02 23:10:15 +03:00
Mike Gelfand e60e75fadc Reduce torrents model memory requirements (Qt client)
Keep torrents sorted by ID. This allows to remove ID to row/torrent mappings
(using binary search instead) and thus also reduce complexity a bit.
2016-04-24 07:56:41 +00:00
Mike Gelfand 682b11aac4 Bump minimum Qt version to 4.8
Earlier versions may continue to work, but we don't guarantee they will.
2016-04-24 07:41:06 +00:00
Mike Gelfand 2b917de65b Refactor RPC requests code for proper queueing (patch by intelfx @ GH-10)
This refactoring is driven by the need to be able to do true queued RPC calls
(where each successive call uses the result of the previous).

Currently, such queueing of requests is done by assigning them special "magic"
tag numbers, which are then intercepted in one big switch() statement and acted
upon. This (aside from making code greatly unclear) effectively makes each such
queue a singleton, because state passing is restricted to global variables.

We refactor RpcClient to assign an unique tag to each remote call, and then
abstract all the call<->response matching with Qt's future/promise mechanism.

Finally, we introduce a "RPC request queue" class (RpcQueue) which is built on
top of QFutureWatcher and C++11's <functional> library. This class maintains
a queue of functions, where each function receives an RPC response, does
necessary processing, performs another call and finally returns its future.
2016-04-19 20:41:59 +00:00
Mike Gelfand db1553b113 Add files necessary for .msi packages creation on Windows 2016-04-02 18:01:01 +00:00
Jordan Lee 1af60ad6ad use '#pragma once' instead of #ifndef..#define..#endif guards 2016-03-29 16:37:21 +00:00
Mike Gelfand 7fb8708efd Only grow filter input up to 250px width, then stick to the right 2016-03-15 21:25:46 +00:00
Mike Gelfand cc1f6f3a5c Fix dropping .torrent files into main window on Windows
Previously used `QUrl::fromPercentEncoding()` leads to paths like
"/C:/test/a.torrent" which obviously aren't valid filesystem paths.
2016-03-15 06:04:49 +00:00
Mike Gelfand c955c04d8f Explicitly compare result of str(n)cmp/memcmp to signify that it's not boolean 2016-03-13 22:11:01 +00:00
Mike Gelfand 67a03bcabb Fix existing Qt client instance detection and torrents delegation 2016-02-29 14:16:55 +00:00
Mike Gelfand 0c4ace2313 Sync translations with Transifex 2016-02-27 23:27:26 +00:00
Mike Gelfand 197fc132b3 Update user-facing copyright years 2016-02-27 23:18:02 +00:00
Mike Gelfand 3523277e7f Ongoing refactoring (use size_t instead of int) 2015-12-25 11:34:35 +00:00
Mike Gelfand 4a4badd4af Ongoing refactoring (use size_t instead of int) 2015-12-25 10:19:50 +00:00
Mike Gelfand 26637a8348 #6038: Fix qmake-based Qt client build 2015-12-21 13:20:35 +00:00
Mike Gelfand 34ebe520a1 Move DBus/COM checks up to where Qt is being searched for 2015-12-17 18:10:43 +00:00
Mike Gelfand e92449d91f Add ActiveQt-based COM interop helper 2015-12-16 20:01:03 +00:00
Mike Gelfand 35b08ce09e One more little Qt thingy (we don't need to include UseQt4.cmake anymore) 2015-12-16 19:09:46 +00:00
Mike Gelfand 7c951671bd Bump CMake to 2.8.12, rework Qt use a little 2015-12-16 18:46:06 +00:00
Mike Gelfand dfc32f3ecd Refactor DBus IPC to allow for further extensibility 2015-12-16 17:57:05 +00:00
Mike Gelfand 4631848c15 Sync translations with Transifex
New translations: Italian (Italy) and Korean.
2015-12-12 18:14:15 +00:00
Jordan Lee 8d66fb3387 fix -Wfloat-equal warning
When calculating the 'Have' line for transmission-qt's details dialog,
use int64s rather than doubles for sizeWhenDone, leftUntilDone, and
available.
2015-12-06 21:07:37 +00:00
Jordan Lee 1b67e9b266 in Torrent::setDouble(), don't compare doubles directly as a bool 2015-12-06 18:02:37 +00:00
Jordan Lee 9f74cf2273 (trivial) silence a few -Wold-style-cast warnings 2015-12-06 17:39:18 +00:00
Jordan Lee 9dca9f175f (trivial) remove trailing semicolon after Q_DECLARE_METATYPE 2015-12-06 17:28:54 +00:00
Jordan Lee c8f6d53466 (trivial) remove namespace trailing semicolon 2015-12-06 17:27:21 +00:00
Mike Gelfand 916a6efa3e Improve Qt client appearance on hidpi screens a bit 2015-11-28 14:35:58 +00:00
Mike Gelfand 74129b7ef3 Fallback to English if no proper translation is available 2015-11-15 11:03:27 +00:00
Mike Gelfand 4434c900e3 Don't force-add "Show options dialog" checkbox when opening a torrent
If open file dialog is a native one, setting the layout will do more harm
than good. Specifically, on Windows with Qt 5 the dialog becomes completely
unusable.
2015-11-14 14:22:57 +00:00
Mike Gelfand 000895322f Clear filter upon double clicking on filtered torrent list notice 2015-10-24 20:56:45 +00:00
Mike Gelfand 585e3df30c Show notice on top of filtered torrents list
This has a couple of benefits: 1) it is clearly visible to the user that
the list is filtered (doesn't display all the torrents) even when filter
bar is hidden, 2) doesn't lead to filter bar controls being shifted to
the left/right as when "Show:" label text changes.
2015-10-19 20:30:26 +00:00
Mike Gelfand f89fab72f9 Remove unused session tag 2015-10-18 18:39:14 +00:00
Mike Gelfand 3b8829d3fb Display notifications via tray icon if dbus is not available 2015-10-18 11:48:10 +00:00
Mike Gelfand c8920abad6 #5993: Improve magnets handling in main window
Disable "Open Folder" and "Verify Local Data" actions for magnets in
Torrent menu. If more than one torrent is selected, "Verify Local Data"
is enabled but only non-magnets are verified if activated.
Add a few sanity checks when opening folder, just in case.
2015-10-04 06:16:59 +00:00
Mike Gelfand e89736fb17 #6001: Calculate header item size properly 2015-09-27 20:23:03 +00:00
Mike Gelfand 68c6c0aa3c Sync main context menu with "Torrent" menu; hide menu icons on Mac 2015-09-01 23:19:01 +00:00
Mike Gelfand 0f7bea1bd3 Fix session dialog not showing up after first close 2015-09-01 20:39:34 +00:00
Mike Gelfand 971cc6d2d9 Remove context help button from dialogs on Windows
We don't currently (if ever) provide context help, so the button is
useless. Moreover, on Windows 10 it's even larger than before and
sometimes title text doesn't fit because of it.
2015-09-01 20:19:26 +00:00
Mike Gelfand 1640a71127 #5982: Simplify filter bar connections by using needed slot directly 2015-08-17 08:14:45 +00:00
Mike Gelfand 63e4700a10 Simplify and speed up actions connected to file tree popup menu 2015-08-16 22:07:09 +00:00
Mike Gelfand 7f45029f18 Sync translations with Transifex
Add German and Indonesian (translated 95%+).
2015-08-10 20:43:26 +00:00
Mike Gelfand ddb0df51d4 #5608: Enter file renaming mode with keyboard only, not on mouse double-click (Qt client)
Since double-click is usually used to open things, don't use it to enter
edit mode, use platform-specific keyboard shortcut instead (Return, F2,
etc).
Add context menu duplicating available actions, resembling that of Mac
client. This includes new "only check selected" action.
Speed up DND/priority change for large numbers of files at once. Make
DND/priority toggling more natural: if both parent and its child are
selected, only act on parent (with all its children following).
2015-08-10 19:40:58 +00:00
Mike Gelfand 0aa572b657 Refactor action groups initialization/handling and trackers merging a bit 2015-08-06 20:28:44 +00:00
Mike Gelfand 0f9bdc6ac2 Use CMake-provided C/C++ standard selection capabilities; fix build (qtr.pro) 2015-08-01 16:05:02 +00:00
Mike Gelfand fd9c2c74f4 Remove some unused includes/macros; fix build (re. QPointer) 2015-07-30 06:55:28 +00:00
Mike Gelfand f592083f15 Create dialogs on demand, don't keep them ready all the time 2015-07-30 06:18:02 +00:00
Mike Gelfand 18ea8c429a Improve RPC performance for local sessions
Don't unnecessarily de-/serialize JSON data if local session is used.
2015-07-13 00:32:48 +00:00
Mike Gelfand 5296570476 Improve file tree population/update performance
Use simple tokenization instead of splitting the file path into
QStringList for each item. Don't expand each added item separetely
during population/update. Don't expand all the items but just up to the
point where parent has more than one expandable child.

Also, fix items order by sorting items after population/update. Fix
sorting by size on systems where uint64_t != quint64.
2015-07-12 20:48:54 +00:00
Mike Gelfand 1a885dcb17 Some look-and-feel improvements for Mac and GTK+ styles (Qt client) 2015-06-28 14:18:06 +00:00
Mike Gelfand 58312e6c16 Torrent properties dialog improvements
Simplify DND checkboxes drawing, this also fixes incorrect drawing on
Mac when file tree widget is inactive.
Do better job calculating column widths for file tree to avoid ellipsis.
Fix file tree sorting order for size and priority columns.
Change key to toggle priorities to Shift+Space instead of Enter/Return
to avoid conflicts with name editing and default button handling.
Fix selected tracker item background drawing in certain cases.
2015-06-15 21:07:46 +00:00
Mike Gelfand b0278ca353 Instead of standard C headers include their C++ counterparts 2015-06-12 22:41:36 +00:00
Mike Gelfand 5120fc0f2c Unify/prettify Qt client headers style 2015-06-12 22:12:12 +00:00
Mike Gelfand 5b61ba81ba Sync Qt client translations, add Polish language 2015-06-10 22:51:53 +00:00
Mike Gelfand 07912d230b Use PascalCase for Qt client filenames
Split FileTree.{h,cc} and FilterBar.{h,cc} files so that each class
is in its own file.

This breaks translations (some classes got renamed => context changed),
to be fixed by next commit (along with Tx sync).
2015-06-10 21:27:11 +00:00
Mike Gelfand cdf3cf62f9 Fix some issues revealed by coverity 2015-05-09 11:56:35 +00:00
Mike Gelfand 2321bc3fad Fix some issues revealed by coverity 2015-05-09 08:37:55 +00:00
Mike Gelfand 06d73853b9 Even better (and unified) torrent origin logic for GTK+, Qt and web clients 2015-04-22 21:04:49 +00:00
Mike Gelfand c1b10abe0f Use UTF-8 for console I/O on Windows 2015-04-21 10:07:57 +00:00
Mike Gelfand 7ce0ebfee7 Ifdef the code which does manual relayout on compact view toggle to Qt < 5.4 (QTBUG-33537) 2015-04-20 09:28:26 +00:00
Mike Gelfand adde87a99e Fix Qt 4 build: `QGridLayout::getItemPosition ()` is not constant :( 2015-04-18 14:48:23 +00:00
Mike Gelfand 9f8402697b Use C++11 range-based `for` loops (Qt client) 2015-04-18 14:41:06 +00:00
Mike Gelfand ce200fa775 #5927: Add Chinese (zh_CN) translation to Qt client (provided by liaodahao) 2015-04-15 20:26:38 +00:00
Mike Gelfand 5ada708756 Use native separators for path button and free space label tooltips. Improve path button dialog initial directory/file selection. 2015-04-15 00:08:24 +00:00
Mike Gelfand 829cbffaf7 Add version info to executables (on Windows). Group projects into folders (CMake). 2015-04-14 22:46:40 +00:00
Mike Gelfand 3b129a72d8 #5908: Check for `tr_loadFile` return value instead of `errno` in `tr_variantFromFile`
Seems like there could be a defect in uClibc making errno not
thread-local. Don't rely on errno value but check function return value
instead which is a better failure indicator.

Return errors from `tr_loadFile` and `tr_variantFromFile` via tr_error.
Fix `tr_sessionLoadSettings` to not fail on Windows if settings.json
does not exist.
2015-04-11 10:51:59 +00:00
Mike Gelfand 0620e94e27 #5774: Fix alternative speed limits scheduled times (once more) 2015-02-06 20:08:36 +00:00
Mike Gelfand 7c53ebb9d7 Per-pixel vertical scroll in all the views (Qt client) 2015-01-31 17:40:44 +00:00
Mike Gelfand 9e66e5c443 Pass constant Prefs, TorrentFilter, TorrentModel objects where no modification is needed 2015-01-29 22:44:43 +00:00
Mike Gelfand 49e16e64a6 Fix build on Windows (blindly) 2015-01-29 22:10:00 +00:00
Mike Gelfand d96ef13a89 Define QT_NO_CAST_FROM_ASCII (Qt client)
Use latin1 encoding most of the time where default encoding was used
before. Qt 4 assumes latin1 by default while Qt 5 uses utf-8 which is
not what we want.

Use utf-8 encoding in some places where default encoding was used before.
This includes strings coming from RPC.

Fix an issue with SortMode::names[] (filters.cc) where missing comma
between "sort-by-queue" and "sort-by-ratio" resulted in two array entries
being merged into solid "sort-by-queuesort-by-ratio" string and all the
following items being shifted compared to their enum counterparts.
2015-01-29 21:53:05 +00:00
Mike Gelfand ae72695d0c Revert unintended changes (debug output) 2015-01-28 23:08:41 +00:00
Mike Gelfand e707e8d4c5 Treat command-line arguments as UTF-8-encoded; hide char* Prefs setter, require explicit conversion 2015-01-28 22:57:46 +00:00
Mike Gelfand 6b79473d9f Use TrPathButton in preferences dialog 2015-01-25 19:55:05 +00:00
Mike Gelfand cade70172e Fix tab order in preferences dialog (Qt client) 2015-01-25 18:16:30 +00:00
Mike Gelfand a18d818882 Rework preferences dialog in Qt client to load from .ui 2015-01-25 15:47:03 +00:00
Mike Gelfand beeb4521c0 Rework forms layout to workaround some stylesheet issues (Qt client) 2015-01-21 21:14:00 +00:00
Mike Gelfand 9b8c6bc0f0 Improve tracker list look (torrent properties dialog), support RTL layout 2015-01-20 23:28:38 +00:00
Mike Gelfand 34c42d4ad8 Small follow-up translation fixes (HTML formatting mess in tracker delegate mostly) 2015-01-18 13:19:30 +00:00
Mike Gelfand 9866082907 Poke translations a bit (Qt client)
Add a bit more comments. Adjust some phrases for pluralization.
Mark menu shortcuts as not translatable (changing them doesn't do any
good but people start translating "Ctrl" as "Ktrl" etc. which breaks
the shortcuts).
Pull current translations from Transifex.
2015-01-18 02:09:44 +00:00
Mike Gelfand efc04fdd77 Improve overall look of torrents in main window
Refactor and use the same code to calculate element positions in
sizeHint () and paint () to prevent discrepancies.
While we are at it, properly support RTL layout.
2015-01-17 16:59:42 +00:00
Mike Gelfand 3c73d74cbb Fallback to message box warning icon if emblem-important is not provided by the icon theme 2015-01-17 13:49:02 +00:00
Mike Gelfand 9eea4ada83 Improve the look of torrents with errors a bit (Qt client)
Display emblem over mime icon if torrent has error(s) to indicate the
issue.
Use normal text color instead of red when drawing selected item: there
is no easy way to be sure that red color looks nice on selection
background, and most of the time it doesn't. Using red color for non-
selected items is questionable too, but let's leave it at that for now.
2015-01-17 01:23:51 +00:00
Mike Gelfand 6ff1875385 Add more information for translators (Qt client) 2015-01-12 06:18:52 +00:00
Mike Gelfand f73bfebd7b Move numeric units to the right of values (per KDE HIG)
Follow up commit to change the last phrase standing.
2015-01-11 21:10:46 +00:00
Mike Gelfand 06fa457bd9 Improve filter bar look (Qt client)
Use normal but semi-transparent color instead of 'disabled' color for
counts drawing.
Do not leave empty space for icon when selected item doesn't have one.
Use null pixmaps/icons instead of non-null blank ones.
Implement our own sizeHint and minimumSizeHint to make sure both combos
have the same height.
Make activity combo width fixed, tracker combo width to fit its content
and line edit to occupy the rest.
Add 'Search...' placeholder to line edit.
2015-01-11 15:01:13 +00:00
Mike Gelfand 068bccd46b Make program name/version in about dialog larger again 2015-01-04 12:47:07 +00:00
Mike Gelfand b96cd0369e Change sharing consent dialog into a QMessageBox 2015-01-04 12:29:10 +00:00
Mike Gelfand c43a10ab9d Mark GTK and Qt clients as GUI programs on Windows (detach from console) 2015-01-04 10:57:09 +00:00
Mike Gelfand 81c3eebbab Use Faenza (1.3.1) as fallback on systems which do not support icon themes 2015-01-04 02:14:58 +00:00
Mike Gelfand 91973ab94d Use (hopefully) better suited theme icons for some actions (Qt client) 2015-01-04 00:18:31 +00:00
Mike Gelfand 440f482d01 Replace tabs with spaces; remove trailing spaces 2015-01-02 11:15:31 +00:00
Mike Gelfand 8abdabc984 #5700: Add -std=gnu++11 to QMAKE_CXXFLAGS for Qt 4 and g++/clang++ 2015-01-01 23:54:35 +00:00
Mike Gelfand b928ae1ba8 Use libb64 instead of OpenSSL to encode/decode BASE64
Some crypto libraries (like CyaSSL, MatrixSSL and CommonCrypto) either
don't have or expose this functionality at all, expose only part of it,
or (like OpenSSL) have heavyweight API for it. Also, for the task as
easy as BASE64 encoding and decoding it's much better to use small and
simple specialized library.
2015-01-01 21:16:36 +00:00
Mike Gelfand 424c79a5da Make use of path button in relocate dialog (Qt client) 2015-01-01 05:02:13 +00:00
Mike Gelfand 511d89ca5e Use QMimeDatabase to get icon names when compiling against Qt 5+ 2015-01-01 02:28:18 +00:00
Mike Gelfand 954a91ca39 Reduce initial torrent creation dialog size to minimum
Truncate text in path button to prevent width increase for long paths.
2014-12-31 23:54:52 +00:00
Mike Gelfand efddf08d67 Rework torrent creation dialog in Qt client to load from .ui 2014-12-31 22:27:46 +00:00
Mike Gelfand e0d5f8b861 Add new TrPathButton class (Qt client)
Make use of new button class in torrent options dialog.
Rework Utils::removeTrailingDirSeparator to return correct value for "/".
2014-12-31 21:00:34 +00:00
Mike Gelfand c64ca900c2 Rework torrent options dialog in Qt client to load from .ui 2014-12-29 04:03:56 +00:00
Mike Gelfand 826a007904 Use QToolButton instead of QPushButton for path button, specify button icon size explicitly 2014-12-28 04:04:58 +00:00
Mike Gelfand 0bde425731 Add missing QToolButton forward declaration (Qt client) 2014-12-28 00:20:43 +00:00
Mike Gelfand 7789c28f44 #5808: Don't embed path to DHT_LIBS in qtr.pro (patch by jbeich) 2014-12-28 00:02:50 +00:00
Mike Gelfand 8c550a2734 Add missing <QDebug> include (Qt 4 build break) 2014-12-27 20:08:10 +00:00
Mike Gelfand 342f38bbc5 Factor RPC logic out from session (Qt client) 2014-12-27 20:03:10 +00:00
Mike Gelfand 17d6666b4c A bit of harmless refactoring
Prefer C++-style over C-style type casting.
Use qApp instead of QApplication/QCoreApplication::instance().
Use explicit QString::fromLatin1()/fromUtf8() where applicable.
2014-12-27 14:07:14 +00:00
Mike Gelfand 2ca4596fac Refactor FreespaceLabel to make it possible for it to be created in Qt Designer 2014-12-26 18:41:47 +00:00
Mike Gelfand 2d02481f2d Fix the rest of :: formatting in C++ code 2014-12-26 14:22:35 +00:00
Mike Gelfand e9394e2f9b Fix directory name display in relocate dialog 2014-12-26 14:21:47 +00:00
Mike Gelfand 8a4f8b9e15 Rework relocate dialog in Qt client to load from .ui 2014-12-26 10:35:00 +00:00
Mike Gelfand 92168df0e1 Fix up some about dialog leftovers, sync Qt client translations 2014-12-25 21:51:59 +00:00
Mike Gelfand 4138c7519b Rework about dialog in Qt client to load from .ui 2014-12-25 19:39:45 +00:00
Mike Gelfand 4f239d57e1 Move numeric units to the right of values (per KDE HIG)
Sync translations with the code. Adjust translations for changed phrases
(hopefully correct for the most of them).

One phrase still left untouched (Preferences -> Downloading), need to
think on better wording.
2014-12-22 03:06:09 +00:00
Mike Gelfand 1eec889832 #4050: Use TRANSLATIONS_DIR macro as a hint for Qt client translation files location 2014-12-22 01:08:19 +00:00
Mike Gelfand f83872849a #5543: Add a warning panel with id of duplicate torrent (patch by rb07 + personal touch) 2014-12-22 00:02:27 +00:00
Mike Gelfand 629281a1e2 Fix license wording in Qt client .cc files to match the rest of the code. 2014-12-21 23:49:39 +00:00
Mike Gelfand 56c75a13b0 Rework session dialog in Qt client to load from .ui 2014-12-21 23:46:31 +00:00
Mike Gelfand 4ddbd550d8 Move filter text clearing button into line edit. Use Qt-provided button on Qt 5.2+. 2014-12-21 15:34:52 +00:00
Mike Gelfand 237acf1726 Rework statistics dialog in Qt client to load from .ui
Fix "Started %n time(s)" phrase (remove space in "time (s)", add proper
English translation for numeric forms).
2014-12-21 13:57:15 +00:00
Mike Gelfand dee7bc9b6a Move status bar creation to mainwin.ui
Among other things,
* fix turtle icons size (20x14 -> 16x16)
* use QIcon states instead of changing the turtle icon ourselves each
  time (unchecked - off, checked - on)
* make speed limit action in tray menu checkable
* simplify status bar buttons drawing and use QToolButton instead of
  QPushButton
2014-12-18 01:30:50 +00:00
Mike Gelfand 172f875691 Sync Qt client translations with the code 2014-12-14 18:33:28 +00:00
Mike Gelfand 70c6087e94 Rework torrent details dialog in Qt client to load from .ui
Make squeeze labels (used for values on Information tab) display tooltip
on hover if their text doesn't fit. Make selective labels (same as in
GTK+ client) text selectable with keyboard in addition to mouse.
Prevent dialog width growth occured before to fit long error texts.
2014-12-14 18:12:21 +00:00
Mike Gelfand 6c02008280 Do not use printf-style formatting in C++ code 2014-12-14 15:34:31 +00:00
Mike Gelfand 737fdab775 Do not use void to denote argumentless functions in C++ code 2014-12-14 11:57:23 +00:00
Mike Gelfand 365b28bc81 Strip needless const& specifiers on SIGNAL and SLOT arguments (Qt client) 2014-12-13 09:04:10 +00:00
Mike Gelfand 2adbb42763 Fix various cppcheck comments for Qt client code 2014-12-12 23:52:17 +00:00
Mike Gelfand 9605bfc36a Remove redundant "struct" keyword use in C++ code (Qt client) 2014-12-12 23:21:04 +00:00
Mike Gelfand 67dc1c8485 Strip spaces around :: in C++ code (Qt client) 2014-12-12 23:05:10 +00:00
Mike Gelfand faf1b2fbdf #5848: Use theme-provided icons in Qt client (patch by equeim + small additions) 2014-12-12 21:47:22 +00:00
Mike Gelfand 79848c36c0 #5841: Fix initial watchdir scan in Qt client
Run the initial scan after application has finished initializing and
session has been created. Otherwise, adding torrents is a no-op.
2014-12-11 22:21:24 +00:00
Mike Gelfand 64757f640a #5685: Use proper icon in Qt client desktop file (reported by rahulsundaram) 2014-12-11 20:13:45 +00:00
Mike Gelfand fed15dc29d Fix a couple of ordinary and pedantic warnings
Add previously missing -Wall to warning flags in CMake. Remove -Wformat
and -Wvariadic-macros (enabled by default; latter is not meaningful in
C99 mode we use), -Wdeclaration-after-statement (again, not needed as
we use C99). Move -Wmissing-declarations to C-only flags (GCC man says
so).

Add copyrights year to crypto-utils-fallback.c.
2014-12-11 05:11:02 +00:00
Mike Gelfand 5c43b5c23c #4400, #5462: Move BASE64 helpers to crypto-utils
On a way to factoring out OpenSSL support to a standalone file to ease
addition of other crypto libraries support in the future, move helpers
providing BASE64 encoding and decoding to crypto-utils.{c,h}. OpenSSL-
related functionality is moved to crypto-utils-openssl.c.

Add new functions to be implemented by crypto backends:
* tr_base64_encode_impl - encode from binary to BASE64,
* tr_base64_decode_impl - decode from BASE64 to binary.

Change `tr_base64_encode` and `tr_base64_decode` functions to expect
non-negative input data length which is considered real and never adjusted.
To process null-terminated strings (which was achieved before by passing 0
or -1 as input data length), add new `tr_base64_encode_str` and
`tr_base64_decode_str` functions which do not accept input data length as
an argument but calculate it on their own.
2014-12-04 19:58:34 +00:00
Mike Gelfand b4a662ba37 Create QDBusConnection after QApplication has been initialized
Doing otherwise causes Qt warning "QDBusConnection: session D-Bus
connection created before QCoreApplication. Application may misbehave."
Also, don't try to do anything D-Bus-related if connection fails.
2014-12-01 21:05:44 +00:00
Mike Gelfand 3e43a308af Sync Qt translation files with current source code 2014-12-01 20:29:03 +00:00
Mike Gelfand 83c4edb008 #5828: Initial CMake build system support 2014-12-01 19:55:22 +00:00
Mike Gelfand 17769e2e2a #5077: Remove torrent file from watch directory even if "show options dialog" is not set (patch from rb07 + some improvements)
Refactor Session::addTorrent (add new method) to eliminate duplicate
code in options.cc and ensure that FileAdded object is being created
on torrent addition even with non-interactive workflow.
Move FileAdded class from options.{h,cc} to session.{h,cc}.
2014-12-01 19:24:07 +00:00
Mike Gelfand 10e59dbc90 #5800: Add Ukrainian translation to Qt client (patch by olexn) 2014-11-30 18:43:50 +00:00
Mike Gelfand d6c32595a6 #5827: Improve torrent files tree updating performance
Do not unnecessarily emit dataChanged signals for items which didn't change.
Cache file item indices to speedup lookup.
As a bonus, this also fixes wrong file progress display in rare cases.
2014-11-30 18:12:28 +00:00