From bfa62f61160cc033931a7a9b417a2dcd8bd969cd Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 9 Mar 2023 15:01:22 -0600 Subject: [PATCH] fix: handle DELETE_EVENT in create-torrent GTK dialog code (#5180) --- gtk/MakeDialog.cc | 3 ++- gtk/ui/gtk3/AddTrackerDialog.ui | 4 ++-- gtk/ui/gtk3/DetailsDialog.ui | 2 +- gtk/ui/gtk3/EditTrackersDialog.ui | 4 ++-- gtk/ui/gtk3/MakeDialog.ui | 4 ++-- gtk/ui/gtk3/MakeProgressDialog.ui | 6 +++--- gtk/ui/gtk3/OptionsDialog.ui | 4 ++-- gtk/ui/gtk3/PrefsDialog.ui | 4 ++-- gtk/ui/gtk3/RelocateDialog.ui | 4 ++-- gtk/ui/gtk3/StatsDialog.ui | 2 +- gtk/ui/gtk3/TorrentUrlChooserDialog.ui | 4 ++-- gtk/ui/gtk4/AddTrackerDialog.ui | 4 ++-- gtk/ui/gtk4/DetailsDialog.ui | 2 +- gtk/ui/gtk4/EditTrackersDialog.ui | 4 ++-- gtk/ui/gtk4/MakeDialog.ui | 4 ++-- gtk/ui/gtk4/MakeProgressDialog.ui | 6 +++--- gtk/ui/gtk4/OptionsDialog.ui | 4 ++-- gtk/ui/gtk4/PrefsDialog.ui | 4 ++-- gtk/ui/gtk4/RelocateDialog.ui | 4 ++-- gtk/ui/gtk4/StatsDialog.ui | 2 +- gtk/ui/gtk4/TorrentUrlChooserDialog.ui | 4 ++-- 21 files changed, 40 insertions(+), 39 deletions(-) diff --git a/gtk/MakeDialog.cc b/gtk/MakeDialog.cc index 8dc40a5fb..eb447dca3 100644 --- a/gtk/MakeDialog.cc +++ b/gtk/MakeDialog.cc @@ -258,6 +258,7 @@ void MakeProgressDialog::onProgressDialogResponse(int response) switch (response) { case TR_GTK_RESPONSE_TYPE(CANCEL): + case TR_GTK_RESPONSE_TYPE(DELETE_EVENT): builder_.cancelChecksums(); close(); break; @@ -316,7 +317,7 @@ std::unique_ptr MakeProgressDialog::create( void MakeDialog::Impl::onResponse(int response) { - if (response == TR_GTK_RESPONSE_TYPE(CLOSE)) + if (response == TR_GTK_RESPONSE_TYPE(CLOSE) || response == TR_GTK_RESPONSE_TYPE(DELETE_EVENT)) { dialog_.close(); return; diff --git a/gtk/ui/gtk3/AddTrackerDialog.ui b/gtk/ui/gtk3/AddTrackerDialog.ui index 958539461..da46f3990 100644 --- a/gtk/ui/gtk3/AddTrackerDialog.ui +++ b/gtk/ui/gtk3/AddTrackerDialog.ui @@ -123,8 +123,8 @@ - cancel_button - open_button + cancel_button + open_button diff --git a/gtk/ui/gtk3/DetailsDialog.ui b/gtk/ui/gtk3/DetailsDialog.ui index 567c3a5bc..cea871feb 100644 --- a/gtk/ui/gtk3/DetailsDialog.ui +++ b/gtk/ui/gtk3/DetailsDialog.ui @@ -1192,7 +1192,7 @@ - close_button + close_button diff --git a/gtk/ui/gtk3/EditTrackersDialog.ui b/gtk/ui/gtk3/EditTrackersDialog.ui index 640e871f3..82b99d300 100644 --- a/gtk/ui/gtk3/EditTrackersDialog.ui +++ b/gtk/ui/gtk3/EditTrackersDialog.ui @@ -146,8 +146,8 @@ To add a new primary URL, add it after a blank line. - cancel_button - save_button + cancel_button + save_button diff --git a/gtk/ui/gtk3/MakeDialog.ui b/gtk/ui/gtk3/MakeDialog.ui index 393f0a980..e0fdeea4d 100644 --- a/gtk/ui/gtk3/MakeDialog.ui +++ b/gtk/ui/gtk3/MakeDialog.ui @@ -415,8 +415,8 @@ To add a new primary URL, add it after a blank line. - close_button - new_button + close_button + new_button diff --git a/gtk/ui/gtk3/MakeProgressDialog.ui b/gtk/ui/gtk3/MakeProgressDialog.ui index 58b252b25..fe6646ee1 100644 --- a/gtk/ui/gtk3/MakeProgressDialog.ui +++ b/gtk/ui/gtk3/MakeProgressDialog.ui @@ -109,9 +109,9 @@ - cancel_button - close_button - add_button + cancel_button + close_button + add_button diff --git a/gtk/ui/gtk3/OptionsDialog.ui b/gtk/ui/gtk3/OptionsDialog.ui index f55b23ccf..89df24c91 100644 --- a/gtk/ui/gtk3/OptionsDialog.ui +++ b/gtk/ui/gtk3/OptionsDialog.ui @@ -245,8 +245,8 @@ - cancel_button - open_button + cancel_button + open_button diff --git a/gtk/ui/gtk3/PrefsDialog.ui b/gtk/ui/gtk3/PrefsDialog.ui index 72067c7b2..c95c04788 100644 --- a/gtk/ui/gtk3/PrefsDialog.ui +++ b/gtk/ui/gtk3/PrefsDialog.ui @@ -2095,8 +2095,8 @@ To add a new primary URL, add it after a blank line. - help_button - close_button + help_button + close_button diff --git a/gtk/ui/gtk3/RelocateDialog.ui b/gtk/ui/gtk3/RelocateDialog.ui index 363df94d2..3ef1fb8a4 100644 --- a/gtk/ui/gtk3/RelocateDialog.ui +++ b/gtk/ui/gtk3/RelocateDialog.ui @@ -164,8 +164,8 @@ - cancel_button - apply_button + cancel_button + apply_button diff --git a/gtk/ui/gtk3/StatsDialog.ui b/gtk/ui/gtk3/StatsDialog.ui index 2e8808168..fb77aa8c7 100644 --- a/gtk/ui/gtk3/StatsDialog.ui +++ b/gtk/ui/gtk3/StatsDialog.ui @@ -361,7 +361,7 @@ reset_button - close_button + close_button diff --git a/gtk/ui/gtk3/TorrentUrlChooserDialog.ui b/gtk/ui/gtk3/TorrentUrlChooserDialog.ui index 5da9917f6..b2c1cad43 100644 --- a/gtk/ui/gtk3/TorrentUrlChooserDialog.ui +++ b/gtk/ui/gtk3/TorrentUrlChooserDialog.ui @@ -123,8 +123,8 @@ - cancel_button - open_button + cancel_button + open_button diff --git a/gtk/ui/gtk4/AddTrackerDialog.ui b/gtk/ui/gtk4/AddTrackerDialog.ui index 024e8e23f..a7491a2d1 100644 --- a/gtk/ui/gtk4/AddTrackerDialog.ui +++ b/gtk/ui/gtk4/AddTrackerDialog.ui @@ -78,8 +78,8 @@ - cancel_button - open_button + cancel_button + open_button diff --git a/gtk/ui/gtk4/DetailsDialog.ui b/gtk/ui/gtk4/DetailsDialog.ui index c28bb9163..eb0c24dca 100644 --- a/gtk/ui/gtk4/DetailsDialog.ui +++ b/gtk/ui/gtk4/DetailsDialog.ui @@ -848,7 +848,7 @@ - close_button + close_button diff --git a/gtk/ui/gtk4/EditTrackersDialog.ui b/gtk/ui/gtk4/EditTrackersDialog.ui index d17449b8d..f5bc48730 100644 --- a/gtk/ui/gtk4/EditTrackersDialog.ui +++ b/gtk/ui/gtk4/EditTrackersDialog.ui @@ -98,8 +98,8 @@ To add a new primary URL, add it after a blank line. - cancel_button - save_button + cancel_button + save_button diff --git a/gtk/ui/gtk4/MakeDialog.ui b/gtk/ui/gtk4/MakeDialog.ui index 5d672871f..36b9fcf6e 100644 --- a/gtk/ui/gtk4/MakeDialog.ui +++ b/gtk/ui/gtk4/MakeDialog.ui @@ -295,8 +295,8 @@ To add a new primary URL, add it after a blank line. - close_button - new_button + close_button + new_button diff --git a/gtk/ui/gtk4/MakeProgressDialog.ui b/gtk/ui/gtk4/MakeProgressDialog.ui index 1e53eeb86..2ad1d90de 100644 --- a/gtk/ui/gtk4/MakeProgressDialog.ui +++ b/gtk/ui/gtk4/MakeProgressDialog.ui @@ -58,9 +58,9 @@ - cancel_button - close_button - add_button + cancel_button + close_button + add_button diff --git a/gtk/ui/gtk4/OptionsDialog.ui b/gtk/ui/gtk4/OptionsDialog.ui index 7342fd45a..1cec4e455 100644 --- a/gtk/ui/gtk4/OptionsDialog.ui +++ b/gtk/ui/gtk4/OptionsDialog.ui @@ -190,8 +190,8 @@ - cancel_button - open_button + cancel_button + open_button diff --git a/gtk/ui/gtk4/PrefsDialog.ui b/gtk/ui/gtk4/PrefsDialog.ui index 7352eeee1..5f1100a92 100644 --- a/gtk/ui/gtk4/PrefsDialog.ui +++ b/gtk/ui/gtk4/PrefsDialog.ui @@ -1497,8 +1497,8 @@ To add a new primary URL, add it after a blank line. - help_button - close_button + help_button + close_button diff --git a/gtk/ui/gtk4/RelocateDialog.ui b/gtk/ui/gtk4/RelocateDialog.ui index 4dd965a6e..cad34c198 100644 --- a/gtk/ui/gtk4/RelocateDialog.ui +++ b/gtk/ui/gtk4/RelocateDialog.ui @@ -107,8 +107,8 @@ - cancel_button - apply_button + cancel_button + apply_button diff --git a/gtk/ui/gtk4/StatsDialog.ui b/gtk/ui/gtk4/StatsDialog.ui index 27dbc2a1a..ebb4a9d9d 100644 --- a/gtk/ui/gtk4/StatsDialog.ui +++ b/gtk/ui/gtk4/StatsDialog.ui @@ -260,7 +260,7 @@ reset_button - close_button + close_button diff --git a/gtk/ui/gtk4/TorrentUrlChooserDialog.ui b/gtk/ui/gtk4/TorrentUrlChooserDialog.ui index 66e80828f..bba718118 100644 --- a/gtk/ui/gtk4/TorrentUrlChooserDialog.ui +++ b/gtk/ui/gtk4/TorrentUrlChooserDialog.ui @@ -78,8 +78,8 @@ - cancel_button - open_button + cancel_button + open_button