Commit Graph

39 Commits

Author SHA1 Message Date
Charles Kerr 3f6969217c
chore: remove FMT_STRING macros (#6497) 2024-01-06 14:05:18 -06:00
Charles Kerr 07d96036d9
refactor: Values pt. 6 - remove deprecated API (#6250) 2023-11-14 17:23:51 -06:00
Charles Kerr a952a0731f
refactor: remove the tr_error** idiom (#6198)
* refactor: remove the tr_error** idiom

* fix: tr_error::message() is only constexpr in c++20 and up

* chore: silence a couple of g++-12 Wshadow warnings
2023-11-04 11:39:41 -05:00
Julien 8ac323d5d6
chore: removed copyright timespans in headers (#4850) 2023-11-01 16:11:11 -05:00
Charles Kerr 0d3b321bac
refactor: use snake_case for libtransmission class methods (#5497) 2023-05-05 23:11:05 -05:00
Charles Kerr bfa62f6116
fix: handle DELETE_EVENT in create-torrent GTK dialog code (#5180) 2023-03-09 15:01:22 -06:00
Julien 4b8cfa2e57
chore: update copyrights to 2023 (#4834) 2023-02-11 14:49:42 -06:00
Mike Gelfand 192a76b621
Move GTK compatibility definitions into a separate header (#4493)
* Move GTK compatibility macros into a separate header

* Fix Cairo compatibility checks

* Move Glib-namespaced definitions to GtkCompat header

* Remove unused stringify definitions since we're using fmtlib
2022-12-29 02:42:20 +00:00
Mike Gelfand a89b181f2c
Include individual headers (GTK client) (#4477)
This results in up to 15% single-threaded build time reduction.
2022-12-27 01:43:20 +00:00
Mike Gelfand 5fd0aff818
Automatically (re)order include directives (GTK client) (#4475)
* Automatically (re)order include directives (GTK client)

Include our headers first to ease IWYU enforcement.

* Fix includes missing from headers (GTK client)

* Fix build on Mac after includes reordering
2022-12-26 21:13:21 +00:00
Mike Gelfand ac6010557e
Fix issues reported by clang-tidy `bugprone` checks (GTK client) (#4183)
* Fix `bugprone-unchecked-optional-access` clang-tidy issues

* Fix `bugprone-easily-swappable-parameters` clang-tidy issues

* Extend clang-tidy configuration
2022-11-15 19:30:32 +00:00
Mike Gelfand 2bd6c8aff4
Fix issues reported by clang-tidy `cert` checks (GTK client) (#4174)
* Fix `cert-err33-c` clang-tidy issues

* Fix `cert-str34-c` clang-tidy issues

* Fold free-standing functions into `FilterBar::Impl`

This is in preparation to next commit fixing `cert-err58-cpp`.

* Fix `cert-err58-cpp` clang-tidy issues

* Extend clang-tidy configuration
2022-11-15 00:53:12 +00:00
Mike Gelfand 49ce12ce38
Fix issues reported by clang-tidy `cppcoreguidelines` checks (GTK client) (#4158)
* Fix `cppcoreguidelines-pro-type-cstyle-cast` clang-tidy issues

* Fix `cppcoreguidelines-pro-type-member-init` clang-tidy issues

* Fix `cppcoreguidelines-prefer-member-initializer` clang-tidy issues

* Introduce `PageBase` for `PrefsDialog` pages

This is in preparation for next PR fixing `Glib::Timer` memory
management.

* Fix `cppcoreguidelines-owning-memory` clang-tidy issues

* Fix `cppcoreguidelines-pro-bounds-array-to-pointer-decay` clang-tidy issues

* Fix `cppcoreguidelines-special-member-functions` clang-tidy issues

* Fix `cppcoreguidelines-init-variables` clang-tidy issues

* Fix `cppcoreguidelines-macro-usage` clang-tidy issues

* Fix `cppcoreguidelines-pro-bounds-constant-array-index` clang-tidy issues

* Fix `cppcoreguidelines-non-private-member-variables-in-classes` clang-tidy issues

* Fix `cppcoreguidelines-pro-type-vararg` clang-tidy issues

* Fix `cppcoreguidelines-pro-bounds-pointer-arithmetic` clang-tidy issue

* Fix `cppcoreguidelines-pro-type-reinterpret-cast` clang-tidy issues

* Fix `cppcoreguidelines-pro-type-static-cast-downcast` clang-tidy issues

* Extend clang-tidy configuration

Enable all `cppcoreguidelines` checks except for three (`avoid-magic-
numbers`, `avoid-non-const-global-variables`, `narrowing-conversions`)
which require [more] extensive refactoring and were left for later.
2022-11-13 17:36:16 +00:00
Mike Gelfand 1e32e44f60
Bind sensitivity properties in .ui files (#4128) 2022-11-09 20:46:23 +00: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 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
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
Charles Kerr 29f57bc296
chore: iwyu headers (#3661) 2022-08-17 11:08:36 -05:00
Charles Kerr bf8f72e61f
refactor: tr_metainfo_builder() (#3565) 2022-08-02 14:46:08 -05:00
Charles Kerr 1a0afbe95e
refactor: iwyu (#3525) 2022-07-25 21:45:54 -05:00
David Miguel Susano Pinto f8b3514c0e
tr_makeMetaInfo: new anonymize option (closes #3420) (#3452) 2022-07-19 16:48:24 -05:00
orbital-mango 12bf2896b6
feature: add piece size selection on torrent creation (GTK) (#3145) 2022-06-01 09:11:30 -05:00
Charles Kerr ffda5bb68a
refactor: remove tr_strip_positional_args() (#2881)
* refactor: use fmt in gtk/SystemIconTray

* refactor: use fmt in gtk/MakeDialog

* refactor: remove unused tr_strip_positional_args()

Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-04-07 08:23:04 -05:00
Charles Kerr e4461c48d7
refactor: prefer FMT_STRING (#2845)
* use FMT_STRING in libtr client on non-i18n strings

This gives compile-time safety checks.
2022-03-30 14:59:13 -05:00
Charles Kerr fcc1510ecb
refactor: use fmt to build the GTK client's user-visible strings (#2788)
Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-03-21 09:15:48 -05:00
Charles Kerr 0be920156b
refactor: fmt part 3 (#2773) 2022-03-15 19:51:36 -05:00
Charles Kerr 72a67054ea
refactor: fmt part 2 (#2771) 2022-03-15 09:52:16 -05:00
Charles Kerr 2410ad2fa6
feat: support webseeds in transmission-create (#2611) 2022-02-12 12:50:47 -06:00
Charles Kerr 318d60b72d
refactor: fix sonarcloud "use enum class" code smells (#2590)
* refactor: prefer constexpr over enum for GUI_PAD values

* refactor: prefer constexpr over enum for PrefsDialog values

* refactor: prefer constexpr over enum for StatsDialog values

* refactor: use enum class for GtrUnicode types

* refactor: prefer constexpr over enum for BT peer msg codes

* refactor: use enum class for TrMakemetaResult

* refactor: prefer constexpr over enum for BT metadata message types

* refactor: use enum class for AwaitingBt

* refactor: use enum class for EncryptionPreference

* refactor: use enum class for TrFormat in rpcimpl

* refactor: prefer constexpr over enum for QApp intervals

* refactor: prefer constexpr over enum for tr_resume bitfields

* refactor: prefer constexpr over enum for Qt/TrFileModel bitfields

* refactor: remove obsolete TODO comment in announce-list
2022-02-08 20:25:19 -06:00
Charles Kerr ebb2ab6aee
chore: update license spdx abbreviations (#2582)
Use SPDX license list 3.0 terminology: replace deprecated identifiers
GPL-2.0" and "GPL-3.0" with "GPL-3.0-only" and "GPL-3.0-only".
2022-02-07 10:25:02 -06:00
Charles Kerr 26bb9f3440
fix: sonarcloud code smells (#2486) 2022-01-23 18:53:35 -06:00
Charles Kerr df1cca9b57
chore: update copyright years, make notices consistent (#2463) 2022-01-20 12:27:56 -06:00
Charles Kerr b0ee4007ff
refactor: include cleanups (#2392)
* refactor: include <memory> when using shared_ptr or unique_ptr

* refactor: include <cstdio> iff we use it

* refactor: include <cstring> iff we use it

* refactor: include <cstdlib> iff we use it

* refactor: include <string_view> or <string> iff we use it

* refactor: include <array> iff we use it

* refactor: include <ctime> iff we use it

* refactor: include <cctype> iff we use it

* refactor: misc #include cleanups in libtransmission
2022-01-12 20:13:58 -06:00
Mike Gelfand d8d361e491
Make some utility functions return std::string to simplify code (#2368)
* tr_formatter_speed_KBps returns std::string

* tr_formatter_mem_B returns std::string

* tr_formatter_size_B returns std::string

* tr_strpercent/tr_strratio returns std::string
2021-12-31 03:30:21 +03:00
Charles Kerr a515c1d94b
refactor: use tr_torrent_metainfo in tr ctor (#2345) 2021-12-26 10:25:07 -06:00
Mike Gelfand 3e072f9bd4
Fix most of critical issues reported by Sonar (GTK client) (#2309)
* (C++) Macros should not be used to define constants

* (C++) Memory should not be managed manually

* (C++) "void*" should not be used in typedefs, member variables, function parameters or return type

* (C++) When the "Rule-of-Zero" is not applicable, the "Rule-of-Five" should be followed

* (C++) "switch" statements should have "default" clauses

* (C++) "explicit" should be used on single-parameter constructors and conversiosn operators

* (C++) Non-const global variables should not be used
2021-12-14 11:43:27 +03:00
Mike Gelfand 82b3da0a54
Don't use deprecated GTK APIs (#2129)
* Don't use deprecated Glib::Thread

* Don't use deprecated stock ID APIs

* Don't use deprecated operator const void* in IconInfo

* Don't use deprecated Gtk::TreeView::set_rules_hint()

* Don't use deprecated Gtk::Widget::set_margin_left()

* Don't use deprecated Gtk::UIManager

* Don't use deprecated sigc::mem_ptr accepting object pointer

* Enable {GDK,GIO,GLIB,GTK,PANGO,SIGCXX}MM deprecation guards

* Enable GTK deprecation guard

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-11-12 12:12:50 +03:00
Mike Gelfand eaeed301fa
Rename GTK client files to match the classes they contain (#2073)
This also brings naming closer to Qt client which simplifies things a
bit.
2021-11-01 03:11:23 +03:00
Renamed from gtk/makemeta-ui.cc (Browse further)