mirror of
https://github.com/transmission/transmission
synced 2025-02-15 10:54: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:
parent
8189c68190
commit
5b8dae3557
3 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"><control>O</attribute>
|
||||
<attribute name="tooltip" translatable="yes">Open a torrent</attribute>
|
||||
</item>
|
||||
<item>
|
||||
|
|
Loading…
Reference in a new issue