1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-15 02:44:42 +00:00

fix: make add-torrent dialogs modal in GTK client (#2443)

This solves the issue of the dialogs not centering above the main GTK
client window. Fixes #2214.
This commit is contained in:
Charles Kerr 2022-01-18 14:16:25 -06:00 committed by GitHub
parent 8189c68190
commit 5b8dae3557
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -262,7 +262,7 @@ OptionsDialog::OptionsDialog(
Gtk::Window& parent,
Glib::RefPtr<Session> const& core,
std::unique_ptr<tr_ctor, void (*)(tr_ctor*)> ctor)
: Gtk::Dialog(_("Torrent Options"), parent)
: Gtk::Dialog(_("Torrent Options"), parent, true /* modal */)
, impl_(std::make_unique<Impl>(*this, core, std::move(ctor)))
{
}
@ -438,6 +438,8 @@ std::unique_ptr<TorrentFileChooserDialog> TorrentFileChooserDialog::create(
TorrentFileChooserDialog::TorrentFileChooserDialog(Gtk::Window& parent, Glib::RefPtr<Session> const& core)
: Gtk::FileChooserDialog(parent, _("Open a Torrent"), Gtk::FILE_CHOOSER_ACTION_OPEN)
{
set_modal(true);
add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL);
add_button(_("_Open"), Gtk::RESPONSE_ACCEPT);
@ -496,7 +498,7 @@ std::unique_ptr<TorrentUrlChooserDialog> TorrentUrlChooserDialog::create(Gtk::Wi
}
TorrentUrlChooserDialog::TorrentUrlChooserDialog(Gtk::Window& parent, Glib::RefPtr<Session> const& core)
: Gtk::Dialog(_("Open URL"), parent)
: Gtk::Dialog(_("Open URL"), parent, true /* modal */)
{
guint row;

View file

@ -1092,6 +1092,7 @@ PrefsDialog::PrefsDialog(Gtk::Window& parent, Glib::RefPtr<Session> const& core)
: Gtk::Dialog(_("Transmission Preferences"), parent)
, impl_(std::make_unique<Impl>(*this, core))
{
set_modal(true);
}
PrefsDialog::~PrefsDialog() = default;

View file

@ -10,6 +10,7 @@
<attribute name="action">win.open-torrent</attribute>
<attribute name="icon">document-open</attribute>
<attribute name="label" translatable="yes">_Open</attribute>
<attribute name="accel">&lt;control&gt;O</attribute>
<attribute name="tooltip" translatable="yes">Open a torrent</attribute>
</item>
<item>