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>
This commit is contained in:
Mike Gelfand
2021-11-12 12:12:50 +03:00
committed by GitHub
parent 319e1fc6bb
commit 82b3da0a54
23 changed files with 864 additions and 501 deletions

View File

@@ -10,24 +10,32 @@
#include <gtkmm.h>
#include "Utils.h"
class Session;
#define WINDOW_ICON "transmission-main-window-icon"
#define TRAY_ICON "transmission-tray-icon"
#define NOTIFICATION_ICON "transmission-notification-icon"
void gtr_actions_init(Glib::RefPtr<Gtk::UIManager> const& ui_manager, void* callback_user_data);
Glib::RefPtr<Gio::SimpleActionGroup> gtr_actions_init(Glib::RefPtr<Gtk::Builder> const& builder, void* callback_user_data);
void gtr_actions_set_core(Glib::RefPtr<Session> const& core);
void gtr_actions_handler(Glib::ustring const& action_name, void* user_data);
void gtr_action_activate(Glib::ustring const& action_name);
void gtr_action_set_sensitive(Glib::ustring const& action_name, bool is_sensitive);
void gtr_action_set_toggled(Glib::ustring const& action_name, bool is_toggled);
void gtr_action_set_important(Glib::ustring const& action_name, bool is_important);
Gtk::Widget* gtr_action_get_widget(Glib::ustring const& path);
Gtk::Widget* gtr_action_get_widget(Glib::ustring const& name);
Glib::RefPtr<Glib::Object> gtr_action_get_object(Glib::ustring const& name);
template<typename T>
inline T* gtr_action_get_widget(Glib::ustring const& path)
inline T* gtr_action_get_widget(Glib::ustring const& name)
{
return static_cast<T*>(gtr_action_get_widget(path));
return static_cast<T*>(gtr_action_get_widget(name));
}
template<typename T>
inline Glib::RefPtr<T> gtr_action_get_object(Glib::ustring const& name)
{
return gtr_ptr_static_cast<T>(gtr_action_get_object(name));
}