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.
This commit is contained in:
Mike Gelfand
2022-09-10 16:19:54 +03:00
committed by GitHub
parent 33f96810a1
commit 9f0fbb38ec
20 changed files with 236 additions and 148 deletions

View File

@@ -102,8 +102,8 @@ void gtr_confirm_remove(
parent,
gtr_sprintf("<big><b>%s</b></big>", primary_text),
true /*use_markup*/,
Gtk::MESSAGE_QUESTION,
Gtk::BUTTONS_NONE,
TR_GTK_MESSAGE_TYPE(WARNING),
TR_GTK_BUTTONS_TYPE(NONE),
true /*modal*/);
if (!secondary_text.empty())
@@ -111,14 +111,14 @@ void gtr_confirm_remove(
d->set_secondary_text(secondary_text, true);
}
d->add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL);
d->add_button(delete_files ? _("_Delete") : _("_Remove"), Gtk::RESPONSE_ACCEPT);
d->set_default_response(Gtk::RESPONSE_CANCEL);
d->add_button(_("_Cancel"), TR_GTK_RESPONSE_TYPE(CANCEL));
d->add_button(delete_files ? _("_Delete") : _("_Remove"), TR_GTK_RESPONSE_TYPE(ACCEPT));
d->set_default_response(TR_GTK_RESPONSE_TYPE(CANCEL));
d->signal_response().connect(
[d, core, torrent_ids, delete_files](int response) mutable
{
if (response == Gtk::RESPONSE_ACCEPT)
if (response == TR_GTK_RESPONSE_TYPE(ACCEPT))
{
for (auto const id : torrent_ids)
{