Commit Graph

1946 Commits

Author SHA1 Message Date
Mike Gelfand 43acd7e3e4
Remove Xcode project in favor of CMake (#4147)
* Compile images into an assets catalog

* Optionally sign resulting Mac bundle

* Move 3rd-party/utility/test targets to their own folders

* Enable ARC via compile options unconditionally

* Install base and localized resources into correct directory

This seems like a Xcode quirk: if subdirectory containing the resource file
matches the destination directory name (and probably if there's more than one
resource file being installed there), the resulting folder structure then
contains an extra subdirectory, i.e. Resources/dirname/dirname/resname.

* Group source files for better structure in IDEs (Xcode, VS)

* Remove Xcode project

Using Xcode is still possible via "Xcode" CMake generator.

* Use ad-hoc signature if one is not specified

* Always use ad-hoc signature on link, leave proper signing to CPack

* Install localized resources into correct directory (QL plugin)

* Don't include CTest (we don't use additional targets it provides)

* Revert "Remove Xcode project"

This reverts commit dc069f654f.
2022-11-12 20:01:57 +00:00
Mike Gelfand 92b74fee74
Fix issues reported by clang-tidy `modernize` checks (GTK client) (#4137)
* Fix `modernize-avoid-c-arrays` clang-tidy issues

* Fix `modernize-raw-string-literal` clang-tidy issues

* Fix `modernize-use-nodiscard` clang-tidy issues

* Fix `modernize-deprecated-headers` clang-tidy issues

* Fix `modernize-pass-by-value` clang-tidy issues

* Extend clang-tidy configuration

Enable all `modernize` checks except for one (use-trailing-return-type)
which is an extensive stylistic change for later.
2022-11-10 20:35:31 +01:00
Mike Gelfand 1e32e44f60
Bind sensitivity properties in .ui files (#4128) 2022-11-09 20:46:23 +00:00
Mike Gelfand eec93de5ca
Fix issues reported by clang-tidy `readability` checks (GTK client) (#4127)
* Fix `readability-container-data-pointer` clang-tidy issues

* Fix `readability-container-size-empty` clang-tidy issues

* Fix `readability-isolate-declaration` clang-tidy issues

* Fix `readability-convert-member-functions-to-static` clang-tidy issues

* Fix `readability-else-after-return` clang-tidy issues

* Fix `readability-redundant-member-init` clang-tidy issues

* Fix `readability-uppercase-literal-suffix` clang-tidy issues

* Fix `readability-make-member-function-const` clang-tidy issues

* Fix `readability-simplify-boolean-expr` clang-tidy issues

* Fix `readability-qualified-auto` clang-tidy issues

* Fix `readability-avoid-const-params-in-decls` clang-tidy issues

* Fix `readability-implicit-bool-conversion` clang-tidy issues

* Fix `readability-inconsistent-declaration-parameter-name` clang-tidy issues

* Add initial .clang-tidy configuration

Currently enabling readability checks only, others to follow. Of the
four disabled readability checks, three (function-cognitive-complexity,
identifier-length, magic-numbers) require extensive refactoring and were
left for later, and one (redundant-access-specifiers) is not planned to
be fixed due to the current coding style - using extra sections to
separate methods from variables of the same visibility.
2022-11-09 16:58:36 +00:00
Mike Gelfand f9abbaca70
Adjust `Gio::File::query_info()` error handling (GTK client) (#4079)
The method never returns `nullptr`, but instead throws if an error
occurs. This regressed during the switch from GTK to GTKMM.
2022-11-02 17:17:29 +00:00
Charles Kerr 210bb03f2f
fix: recent signed-unsigned comparison warnings (#4034) 2022-10-26 11:20:10 -05:00
A Cœur 12e564096b
fix: "Implicit conversion loses integer precision" warnings (#3960) 2022-10-25 11:14:42 -05:00
Charles Kerr 798e873b87
fix: sonarcloud warnings (#4023) 2022-10-24 22:13:09 -05:00
Mike Gelfand 70f623f32b
Add user data parameter for torrent removal callback (#4009) 2022-10-23 11:51:35 -05:00
Mike Gelfand f0a0b855c6
Reload files list in details dialog, unless already loaded (GTK client) (#4004) 2022-10-22 10:42:38 +01:00
Mike Gelfand da27c3d18d
Prefer ayatana-appindicator over appindicator, if present (#4001) 2022-10-20 18:15:13 +01:00
Mike Gelfand 5564d9eb46
Catch dbus exceptions in async callbacks on completion (GTK client) (#3997)
GLIBMM will catch them for us, but in two cases print a warning instead
of suppressing, and in one other case still print a warning (as well as
we do) but without context.
2022-10-19 16:27:07 -05:00
Mike Gelfand f22ce40c72
Change progress bar color depending on torrent state (GTK client) (#3976)
* Rename `context` to `snapshot` in `TorrentCellRenderer`

* Change progress bar color depending on torrent state
2022-10-19 00:17:54 +01:00
Mike Gelfand 1b416962e6
Increase message log window width, disable overflow menu (GTK client) (#3971)
* Disable GTK 3 toolbars overflow menu

This prevents the toolbar from hiding its items when they don't fit. Not
an issue with GTK 4 where there's no dedicated toolbar widget and
associated logic.

* Increase default message log window width
2022-10-16 19:31:02 +03:00
Mike Gelfand ae2dd5eba9
Use fmt for string formatting (GTK client) (#3967) 2022-10-15 19:13:50 +03:00
Mike Gelfand 9ccaffb044
Fix session use after free (GTK client) (#3963)
In GLIB 2.68+ `Glib::RefPtr<>` is an alias for `std::shared_ptr<>` which
has no idea about GLIB's reference counting, thus destroying the object
instead of unreferencing it. Use `Glib::make_refptr_for_instance()` to
construct the smart pointer which passes in a custom reference-aware
deleter for us.

Fixes: #3954
2022-10-14 07:59:38 +03:00
Mike Gelfand 02cbfa917a
Don't scroll to message log bottom with no messages (GTK client) (#3959)
Fixes: #3956
2022-10-14 02:19:37 +03:00
Mike Gelfand 60340387e2
Make torrents context menu look more like one (GTK client) (#3957) 2022-10-13 19:18:33 +03:00
A Cœur 4ea9c87fea
fix: some typos (#3904) 2022-10-13 09:35:10 -05:00
Mike Gelfand 4b65c4fa28
Don't call X11 functions on non-X11 GDK surfaces (#3949)
Calling such functions on e.g. Wayland GDK surfaces results in a crash.
2022-10-12 08:32:01 +03:00
Mike Gelfand f1f55cc3df
Sync translations (#3939)
* Sync translations with code

* Sync translations with Transifex

* Remove Mac menu title that isn't displayed and shouldn't be translated

* Add context to logging level strings in GTK client

* Use "µTP" consistently in code

* Use ellipsis instead of three docs in Qt client strings

* Close HTML tags in blocklist-related strings

* Remove trailing space from a translatable string in Qt client

* Add missing plural forms for English strings in Qt client

* Fix spelling: metaInfo -> metainfo
2022-10-11 18:39:41 +03:00
Mike Gelfand b0de4b7a89
Add build job based on Fedora 37 (#3921)
This allows to test against GTK 4 and Qt 6.

Changes to CMakeLists.txt files are non-functional and are meant to
trigger the components rebuild, nothing more.
2022-10-09 12:13:02 +03:00
Mike Gelfand 8712db3b4c
Support switching between GTK 3 and 4 within the same build directory (#3918) 2022-10-09 10:29:47 +03:00
Mike Gelfand c75c6bf5c8
Add support for GTK 4 (#3916)
* Make compact mode switch work for both GTK 3 and 4

* Implement GTK 4-specific view gesture handling

* Fix torrents view context menu on GTK 4

* Explicitly show/hide menubar on startup/teardown

* Switch from `Gtk::Pixbuf` to `Gio::Icon` for views

* Support GTK 4 exceptions based on `std::exception`

* Fix options menu setup with GTK 4

* Use `delete-event` (GTK 3) and `close-request` (GTK 4) signals to handle window clousure

* Add custom file chooser button implementation

GTK 4 drops FileChooserButton widget and suggests implementing it using
Button.

* Add helpers to set X11 hints with GTK 4

* Remove `HigWorkarea` class that's no longer used

* Make main menu shortcuts work with GTK 4

* Make drops work in main window and make dialog with GTK 4

* Remove unused `gtr_action_get_widget()` helper

* Fix text direction mark setup with GTK 4 (due to switch to enum class)

* Fix file tree font size calculation with GTK 4

* Fix crash during shutdown with GTK 4

* Switch from `RadioButton` to `CheckButton` for compatibility with GTK 4

* Fix opening files with GTK 4

* Rework torrent cell renderer to support both GTK 3 and 4

* Disable system tray icon support with GTK 4

* Fix windows positioning with GTK 4

* Fix focus event handling with GTK 4

* Adapt to tree model row/iterator changes in GTK 4

* Adapt to toplevel/root window changes in GTK 4

* Adapt to clipboard changes in GTK 4

* Adapt to icon/theme changes in GTK 4

* Adapt to file/path changes in GTK 4

* Random leftover fixes for GTK 4 compatibility

* Clean up unused code

* Move GTK 3 *.ui files into a subdirectory

* Add GTK 4 *.ui files

* Search for both GTK 3 and 4 during configuration
2022-10-09 01:50:03 +03:00
Mike Gelfand aeaa6ca52f
Don't show duplicate add/edit tracker error dialogs (#3898)
Since we're already overriding `on_response()`, there's no point in
connecting `signal_response` to it, making it being called twice.

Broken-by: #3781
2022-10-07 15:09:48 -05:00
Mike Gelfand 32a1429047
fix GTK3 about dialog closure (#3892) 2022-10-07 12:25:03 -05:00
Charles Kerr 3f44076e23
build: update dependency versions (#3853)
* build: rename GTK_MINIMUM, etc as GTKMM_MINIMUM in CMakeLists

* build: bump glibmm depdency min version to 2.60.0

https://github.com/transmission/transmission/issues/3846\#issuecomment-1263782526

for extraclassinit.h

* build: fix duplicated version number for deflate dependency

* build: sort dependency list in CMakeLists.txt

no functional changes, just housekeeping

* refactor: remove gtr_get_ptr()
2022-09-30 17:15:21 -05:00
Mike Gelfand 3c8d8488ea
Run GTK dialogs in non-blocking fashion (#3805)
GTK 4 drops blocking `run()` method for dialogs. Switch to non-blocking
`show()` to support both GTK 3 and 4.
2022-09-10 21:15:01 +03:00
Mike Gelfand 9f0fbb38ec
Support change to enum definitions in gtkmm/glibmm/pangomm (#3801)
Newer versions (gtkmm 4 and its dependencies) of these libraries have
switched from enums to enum classes. Wrap the names with macros to
support both.
2022-09-10 16:19:54 +03:00
Dmitry Antipov ad125edea9
fix Wsuggest-override clang-16 warnings (#3795) 2022-09-09 07:34:28 -05:00
Mike Gelfand 99e750229c
Switch from `Gtk::Menu` to `Gio::Menu` for status bar menus (#3789)
* Switch from `Gtk::Menu` to `Gio::Menu` for status bar menus

* Improve compatibility with GTK 4 which has `get_action_group` removed
2022-09-08 19:58:28 +03:00
Mike Gelfand b41501eeb8
Switch to Gtk::Builder for all UI in GTK client (#3781)
* Move CSS definitions to resources

* Add Gtk::Builder helpers

* Switch StatsDialog to Gtk::Builder

* Switch RelocateDialog to Gtk::Builder

* Switch OptionsDialog to Gtk::Builder

* Switch MakeDialog to Gtk::Builder

* Switch FilterBar to Gtk::Builder

* Switch MainWindow to Gtk::Builder

* Switch MessageLogWindow to Gtk::Builder

* Switch DetailsDialog to Gtk::Builder

* Switch PrefsDialog to Gtk::Builder

* Fixup translatable strings

Since this branch was brewing for a while, changes happened in the meantime.
2022-09-08 01:25:04 +03:00
orbital-mango 488d4a993f
GTK: increase torrent piece size limit as per #3402 (#3771) 2022-09-06 08:43:27 -05:00
Mike Gelfand 02af4c2982
Don't crash when hiding top-level windows (#3757)
Current window management approach results in secondary windows being
destroyed once they are hidden. Since those windows are managed by
`std::unique_ptr<>`, we can't just [temporarily] increase their refcount
to avoid use-after-free situation, so retrieve updated top-level windows
list every time we hide one instead.
2022-09-04 16:52:35 +03:00
bexnoss 5782847601
fix(gtk): send key events directly to widgets (#3720)
The default behavior is to send them to the window first to activate
mnemonics and accelerators. Some accelerators conflict with text
selection hotkeys (like CTRL+A to select all torrents), this fixes that
conflict.
2022-09-02 11:21:43 -05:00
Charles Kerr 072bb0322c
refactor: remove tr_quark_get_string() (#3728) 2022-08-28 16:17:07 -05:00
Charles Kerr 6e44adabf1
Revert "fix(gtk): fix conflicting hotkeys (#2201)" (#3718)
This reverts commit a0305a3a12.
2022-08-26 19:45:46 -05:00
Mike Gelfand ccae3d7ccd
Fix GTK client crash opening message log containing errors (#3711)
`Glib::ustring::sprintf()` doesn't support formatting `std::string_view`.
Use `fmt::format()` instead.

Broken in #3626 (7c5862a5f5).
2022-08-26 01:51:13 +01:00
bexnoss 258faf3623
gtk: Remember 4 recent relocate dirs (#3691)
* fix(gtk): prevent duplicate shortcut folders

This prevents duplicates if the recent destination is also a system
shortcut folder.

* refactor(gtk): create gtr_get_recent_dirs helper

* feat(gtk): remember 4 recent relocate dirs
2022-08-21 21:26:13 -05:00
bexnoss a0305a3a12
fix(gtk): fix conflicting hotkeys (#2201)
The torrent list hotkeys include `CTR + A` and were always active,
swallowing text edit hotkeys in the filter entry.
Now they are only active when the torrent list is focused.
2022-08-21 17:09:01 -05:00
lucaxvi 74d2f1a2d6
refactor(gtk): use symbolic icons in status bar (#3655) 2022-08-18 11:15:27 -05:00
Charles Kerr 76a7994eef
refactor: remove tr_free() (#3668) 2022-08-18 09:14:12 -05:00
Charles Kerr bfec98c323
refactor: avoid tr_new() in transmission-remote (#3665) 2022-08-17 20:25:42 -05:00
Charles Kerr 29f57bc296
chore: iwyu headers (#3661) 2022-08-17 11:08:36 -05:00
Charles Kerr e49747ab51
feat: add tr_strvToBuf() (#3657)
* feat: add tr_getDefaultConfigDirToBuf()

* feat: add tr_getDefaultDownloadDirToBuf()

* feat: add tr_strvToBuf()

* feat: add tr_torrentFindFileToBuf()

* feat: add tr_torrentGetMagnetLinkToBuf()

* refactor: remove unused makeString() from tests

* feat: add tr_torrentFilenameToBuf()

* feat: add tr_torrentGetTrackerListToBuf()

* chore: remove obsolete comment references to tr_free

* chore: remove unused tr_strdup()

* chore: remove unused forward declarations
2022-08-16 19:28:57 -05:00
Charles Kerr c7466b3ff4
fix: coverity warnings (#3632)
* fix: uninitialized field natpmp

* fix: unchecked downcast result

* fix: potential tr_error leak

* fix: potential tr_error leak

* fix: potential tr_error leak

* fix: potential nullptr dereference in test fixtures

* fix: handshake fields not initialized in constructor

* chore: cast unchecked return value to void

* chore: cast unchecked return value to void

* chore: cast unchecked return value to void

* chore: make single-arg constructors explicit

* fix: code smell make variable a pointer-to-const

* fix: code smell make variable a pointer-to-const

* chore: make single-arg constructors explicit

* chore: silence sonarcloud false warning on commented-out-code

* chore: fix code smell use std::array

* chore: make EvTimer::handleTimer() const

* chore: mark tr_bandwidth remove_child as noexcept
2022-08-13 12:11:07 -05:00
Charles Kerr 7c5862a5f5
refactor: remove tr_new, tr_free pt. 1 (#3626)
* refactor: tr_torrentGetMetadataPiece() returns an optional vector

* refactor: use tr_pathbuf in create_temp_path()

* refactor: use tr_pathbuf in win32 create_temp_path()

* refactor: use std::vector in isPeerInteresting()

* refactor: remove tr_new0 from tr_peerMgrPeerStats()

* refactor: remove tr_new0 from rechokeUploads()

* refactor: silence clang nullptr dereference warning

* refactor: make tr_natpmp a C++ class

* refactor: use std::string in tr_log_message
2022-08-11 19:59:58 -05:00
Charles Kerr 83ffa6bf1b
chore: fix spdx abbreviations (#3602) 2022-08-08 13:05:39 -05:00
Charles Kerr 90f08f4fa1
refactor: fix recent sonarcloud warnings (#3593) 2022-08-05 20:37:21 -05:00
Charles Kerr 3ed6b187bb
refactor: iwyu utils.h (#3583) 2022-08-04 08:44:18 -05:00