refactor: use snake_case for action names in GTK client (#8008)

* refactor use snake_case for action names in GTK app

* refactor: remove tr_quark_convert() use
This commit is contained in:
Charles Kerr
2025-12-25 14:01:23 -06:00
committed by GitHub
parent 1859201e01
commit 850d2a277f
11 changed files with 208 additions and 178 deletions

View File

@@ -53,10 +53,7 @@ void sort_changed_cb(Gio::SimpleAction& action, Glib::VariantBase const& value,
myCore->set_pref(TR_KEY_sort_mode, Glib::VariantBase::cast_dynamic<Glib::Variant<Glib::ustring>>(value).get()); myCore->set_pref(TR_KEY_sort_mode, Glib::VariantBase::cast_dynamic<Glib::Variant<Glib::ustring>>(value).get());
} }
std::array<std::string_view, 2> const show_toggle_entries = { auto const show_toggle_entries = std::array<Glib::ustring, 2U>{ GTR_KEY_toggle_main_window, GTR_KEY_toggle_message_log };
"toggle-main-window"sv,
"toggle-message-log"sv,
};
void toggle_pref_cb(Gio::SimpleAction& action, gpointer /*user_data*/) void toggle_pref_cb(Gio::SimpleAction& action, gpointer /*user_data*/)
{ {
@@ -78,36 +75,36 @@ std::array<tr_quark, 6> const pref_toggle_entries = {
TR_KEY_show_toolbar, // TR_KEY_show_toolbar, //
}; };
std::array<std::string_view, 29> const entries = { auto const entries = std::array<Glib::ustring, 29>{
"copy-magnet-link-to-clipboard"sv, GTR_KEY_copy_magnet_link_to_clipboard,
"open-torrent-from-url"sv, GTR_KEY_open_torrent_from_url,
"open-torrent"sv, GTR_KEY_open_torrent,
"torrent-start"sv, GTR_KEY_torrent_start,
"torrent-start-now"sv, GTR_KEY_torrent_start_now,
"show-stats"sv, GTR_KEY_show_stats,
"donate"sv, GTR_KEY_donate,
"torrent-verify"sv, GTR_KEY_torrent_verify,
"torrent-stop"sv, GTR_KEY_torrent_stop,
"pause-all-torrents"sv, GTR_KEY_pause_all_torrents,
"start-all-torrents"sv, GTR_KEY_start_all_torrents,
"relocate-torrent"sv, GTR_KEY_relocate_torrent,
"remove-torrent"sv, GTR_KEY_remove_torrent,
"delete-torrent"sv, GTR_KEY_delete_torrent,
"new-torrent"sv, GTR_KEY_new_torrent,
"quit"sv, GTR_KEY_quit,
"select-all"sv, GTR_KEY_select_all,
"deselect-all"sv, GTR_KEY_deselect_all,
"edit-preferences"sv, GTR_KEY_edit_preferences,
"show-torrent-properties"sv, GTR_KEY_show_torrent_properties,
"open-torrent-folder"sv, GTR_KEY_open_torrent_folder,
"show-about-dialog"sv, GTR_KEY_show_about_dialog,
"help"sv, GTR_KEY_help,
"torrent-reannounce"sv, GTR_KEY_torrent_reannounce,
"queue-move-top"sv, GTR_KEY_queue_move_top,
"queue-move-up"sv, GTR_KEY_queue_move_up,
"queue-move-down"sv, GTR_KEY_queue_move_down,
"queue-move-bottom"sv, GTR_KEY_queue_move_bottom,
"present-main-window"sv, GTR_KEY_present_main_window,
}; };
Gtk::Builder* myBuilder = nullptr; Gtk::Builder* myBuilder = nullptr;
@@ -130,7 +127,7 @@ Glib::RefPtr<Gio::SimpleActionGroup> gtr_actions_init(Glib::RefPtr<Gtk::Builder>
auto const match = gtr_pref_string_get(TR_KEY_sort_mode); auto const match = gtr_pref_string_get(TR_KEY_sort_mode);
{ {
auto const action_name = Glib::ustring("sort-torrents"); auto const action_name = GTR_KEY_sort_torrents;
auto const action = Gio::SimpleAction::create_radio_string(action_name, match); auto const action = Gio::SimpleAction::create_radio_string(action_name, match);
action->signal_activate().connect([a = action.get(), callback_user_data](auto const& value) action->signal_activate().connect([a = action.get(), callback_user_data](auto const& value)
{ sort_changed_cb(*a, value, callback_user_data); }); { sort_changed_cb(*a, value, callback_user_data); });

View File

@@ -16,6 +16,40 @@
#include <glibmm/ustring.h> #include <glibmm/ustring.h>
#include <gtkmm/builder.h> #include <gtkmm/builder.h>
inline auto const GTR_KEY_copy_magnet_link_to_clipboard = Glib::ustring{ "copy_magnet_link_to_clipboard" };
inline auto const GTR_KEY_delete_torrent = Glib::ustring{ "delete_torrent" };
inline auto const GTR_KEY_deselect_all = Glib::ustring{ "deselect_all" };
inline auto const GTR_KEY_donate = Glib::ustring{ "donate" };
inline auto const GTR_KEY_edit_preferences = Glib::ustring{ "edit_preferences" };
inline auto const GTR_KEY_help = Glib::ustring{ "help" };
inline auto const GTR_KEY_main_window_popup = Glib::ustring{ "main_window_popup" };
inline auto const GTR_KEY_new_torrent = Glib::ustring{ "new_torrent" };
inline auto const GTR_KEY_open_torrent = Glib::ustring{ "open_torrent" };
inline auto const GTR_KEY_open_torrent_folder = Glib::ustring{ "open_torrent_folder" };
inline auto const GTR_KEY_open_torrent_from_url = Glib::ustring{ "open_torrent_from_url" };
inline auto const GTR_KEY_pause_all_torrents = Glib::ustring{ "pause_all_torrents" };
inline auto const GTR_KEY_present_main_window = Glib::ustring{ "present_main_window" };
inline auto const GTR_KEY_queue_move_bottom = Glib::ustring{ "queue_move_bottom" };
inline auto const GTR_KEY_queue_move_down = Glib::ustring{ "queue_move_down" };
inline auto const GTR_KEY_queue_move_top = Glib::ustring{ "queue_move_top" };
inline auto const GTR_KEY_queue_move_up = Glib::ustring{ "queue_move_up" };
inline auto const GTR_KEY_quit = Glib::ustring{ "quit" };
inline auto const GTR_KEY_relocate_torrent = Glib::ustring{ "relocate_torrent" };
inline auto const GTR_KEY_remove_torrent = Glib::ustring{ "remove_torrent" };
inline auto const GTR_KEY_select_all = Glib::ustring{ "select_all" };
inline auto const GTR_KEY_show_about_dialog = Glib::ustring{ "show_about_dialog" };
inline auto const GTR_KEY_show_stats = Glib::ustring{ "show_stats" };
inline auto const GTR_KEY_show_torrent_properties = Glib::ustring{ "show_torrent_properties" };
inline auto const GTR_KEY_sort_torrents = Glib::ustring{ "sort_torrents" };
inline auto const GTR_KEY_start_all_torrents = Glib::ustring{ "start_all_torrents" };
inline auto const GTR_KEY_toggle_main_window = Glib::ustring{ "toggle_main_window" };
inline auto const GTR_KEY_toggle_message_log = Glib::ustring{ "toggle_message_log" };
inline auto const GTR_KEY_torrent_reannounce = Glib::ustring{ "torrent_reannounce" };
inline auto const GTR_KEY_torrent_start = Glib::ustring{ "torrent_start" };
inline auto const GTR_KEY_torrent_start_now = Glib::ustring{ "torrent_start_now" };
inline auto const GTR_KEY_torrent_stop = Glib::ustring{ "torrent_stop" };
inline auto const GTR_KEY_torrent_verify = Glib::ustring{ "torrent_verify" };
class Session; class Session;
Glib::RefPtr<Gio::SimpleActionGroup> gtr_actions_init(Glib::RefPtr<Gtk::Builder> const& builder, gpointer callback_user_data); Glib::RefPtr<Gio::SimpleActionGroup> gtr_actions_init(Glib::RefPtr<Gtk::Builder> const& builder, gpointer callback_user_data);

View File

@@ -333,30 +333,30 @@ bool Application::Impl::refresh_actions()
auto const sel_counts = get_selected_torrent_counts(); auto const sel_counts = get_selected_torrent_counts();
bool const has_selection = sel_counts.total_count > 0; bool const has_selection = sel_counts.total_count > 0;
gtr_action_set_sensitive("select-all", torrent_count != 0); gtr_action_set_sensitive(GTR_KEY_select_all, torrent_count != 0);
gtr_action_set_sensitive("deselect-all", torrent_count != 0); gtr_action_set_sensitive(GTR_KEY_deselect_all, torrent_count != 0);
gtr_action_set_sensitive("pause-all-torrents", active != 0); gtr_action_set_sensitive(GTR_KEY_pause_all_torrents, active != 0);
gtr_action_set_sensitive("start-all-torrents", active != total); gtr_action_set_sensitive(GTR_KEY_start_all_torrents, active != total);
gtr_action_set_sensitive("torrent-stop", (sel_counts.stopped_count < sel_counts.total_count)); gtr_action_set_sensitive(GTR_KEY_torrent_stop, (sel_counts.stopped_count < sel_counts.total_count));
gtr_action_set_sensitive("torrent-start", (sel_counts.stopped_count) > 0); gtr_action_set_sensitive(GTR_KEY_torrent_start, (sel_counts.stopped_count) > 0);
gtr_action_set_sensitive("torrent-start-now", (sel_counts.stopped_count + sel_counts.queued_count) > 0); gtr_action_set_sensitive(GTR_KEY_torrent_start_now, (sel_counts.stopped_count + sel_counts.queued_count) > 0);
gtr_action_set_sensitive("torrent-verify", has_selection); gtr_action_set_sensitive(GTR_KEY_torrent_verify, has_selection);
gtr_action_set_sensitive("remove-torrent", has_selection); gtr_action_set_sensitive(GTR_KEY_remove_torrent, has_selection);
gtr_action_set_sensitive("delete-torrent", has_selection); gtr_action_set_sensitive(GTR_KEY_delete_torrent, has_selection);
gtr_action_set_sensitive("relocate-torrent", has_selection); gtr_action_set_sensitive(GTR_KEY_relocate_torrent, has_selection);
gtr_action_set_sensitive("queue-move-top", has_selection); gtr_action_set_sensitive(GTR_KEY_queue_move_top, has_selection);
gtr_action_set_sensitive("queue-move-up", has_selection); gtr_action_set_sensitive(GTR_KEY_queue_move_up, has_selection);
gtr_action_set_sensitive("queue-move-down", has_selection); gtr_action_set_sensitive(GTR_KEY_queue_move_down, has_selection);
gtr_action_set_sensitive("queue-move-bottom", has_selection); gtr_action_set_sensitive(GTR_KEY_queue_move_bottom, has_selection);
gtr_action_set_sensitive("show-torrent-properties", has_selection); gtr_action_set_sensitive(GTR_KEY_show_torrent_properties, has_selection);
gtr_action_set_sensitive("open-torrent-folder", sel_counts.total_count == 1); gtr_action_set_sensitive(GTR_KEY_open_torrent_folder, sel_counts.total_count == 1);
gtr_action_set_sensitive("copy-magnet-link-to-clipboard", sel_counts.total_count == 1); gtr_action_set_sensitive(GTR_KEY_copy_magnet_link_to_clipboard, sel_counts.total_count == 1);
bool const can_update = wind_ != nullptr && bool const can_update = wind_ != nullptr &&
wind_->for_each_selected_torrent_until([](auto const& torrent) wind_->for_each_selected_torrent_until([](auto const& torrent)
{ return tr_torrentCanManualUpdate(&torrent->get_underlying()); }); { return tr_torrentCanManualUpdate(&torrent->get_underlying()); });
gtr_action_set_sensitive("torrent-reannounce", can_update); gtr_action_set_sensitive(GTR_KEY_torrent_reannounce, can_update);
} }
refresh_actions_tag_.disconnect(); refresh_actions_tag_.disconnect();
@@ -458,7 +458,7 @@ bool Application::Impl::on_rpc_changed_idle(tr_rpc_callback_type type, tr_torren
switch (type) switch (type)
{ {
case TR_RPC_SESSION_CLOSE: case TR_RPC_SESSION_CLOSE:
gtr_action_activate("quit"); gtr_action_activate(GTR_KEY_quit);
break; break;
case TR_RPC_TORRENT_ADDED: case TR_RPC_TORRENT_ADDED:
@@ -558,7 +558,7 @@ namespace
gboolean signal_handler(gpointer user_data) gboolean signal_handler(gpointer user_data)
{ {
gtr_message(_("Got termination signal, trying to shut down cleanly. Do it again if it gets stuck.")); gtr_message(_("Got termination signal, trying to shut down cleanly. Do it again if it gets stuck."));
gtr_actions_handler("quit", user_data); gtr_actions_handler(GTR_KEY_quit, user_data);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
} }
@@ -624,7 +624,7 @@ void Application::Impl::on_startup()
ui_builder_ = Gtk::Builder::create_from_resource(gtr_get_full_resource_path("transmission-ui.xml"s)); ui_builder_ = Gtk::Builder::create_from_resource(gtr_get_full_resource_path("transmission-ui.xml"s));
auto const actions = gtr_actions_init(ui_builder_, this); auto const actions = gtr_actions_init(ui_builder_, this);
auto const main_menu = gtr_action_get_object<Gio::Menu>("main-window-menu"); auto const main_menu = gtr_action_get_object<Gio::Menu>("main_window_menu");
app_.set_menubar(main_menu); app_.set_menubar(main_menu);
/* create main window now to be a parent to any error dialogs */ /* create main window now to be a parent to any error dialogs */
@@ -684,7 +684,7 @@ void Application::Impl::on_activate()
return; return;
} }
gtr_action_activate("present-main-window"); gtr_action_activate(GTR_KEY_present_main_window);
} }
void Application::Impl::open_files(std::vector<Glib::RefPtr<Gio::File>> const& files) void Application::Impl::open_files(std::vector<Glib::RefPtr<Gio::File>> const& files)
@@ -771,12 +771,12 @@ void Application::Impl::app_setup()
if (!start_iconified_) if (!start_iconified_)
{ {
wind_->show(); wind_->show();
gtr_action_set_toggled("toggle-main-window", true); gtr_action_set_toggled(GTR_KEY_toggle_main_window, true);
} }
else else
{ {
gtr_window_set_skip_taskbar_hint(*wind_, icon_ != nullptr); gtr_window_set_skip_taskbar_hint(*wind_, icon_ != nullptr);
gtr_action_set_toggled("toggle-main-window", false); gtr_action_set_toggled(GTR_KEY_toggle_main_window, false);
} }
} }
@@ -792,7 +792,7 @@ void Application::Impl::placeWindowFromPrefs()
void Application::Impl::presentMainWindow() void Application::Impl::presentMainWindow()
{ {
gtr_action_set_toggled("toggle-main-window", true); gtr_action_set_toggled(GTR_KEY_toggle_main_window, true);
if (is_iconified_) if (is_iconified_)
{ {
@@ -813,7 +813,7 @@ void Application::Impl::presentMainWindow()
void Application::Impl::hideMainWindow() void Application::Impl::hideMainWindow()
{ {
gtr_action_set_toggled("toggle-main-window", false); gtr_action_set_toggled(GTR_KEY_toggle_main_window, false);
gtr_window_set_skip_taskbar_hint(*wind_, true); gtr_window_set_skip_taskbar_hint(*wind_, true);
gtr_widget_set_visible(*wind_, false); gtr_widget_set_visible(*wind_, false);
@@ -836,7 +836,7 @@ bool Application::Impl::winclose()
{ {
if (icon_ != nullptr) if (icon_ != nullptr)
{ {
gtr_action_activate("toggle-main-window"); gtr_action_activate(GTR_KEY_toggle_main_window);
} }
else else
{ {
@@ -1472,9 +1472,8 @@ namespace
[[nodiscard]] std::optional<tr_quark> get_rpc_method(std::string_view const str) [[nodiscard]] std::optional<tr_quark> get_rpc_method(std::string_view const str)
{ {
if (auto quark = tr_quark_lookup(str)) // method-name, methodName, method_name if (auto quark = tr_quark_lookup(str))
{ {
quark = tr_quark_convert(*quark); // method_name
switch (*quark) switch (*quark)
{ {
// method_name // method_name
@@ -1503,42 +1502,42 @@ void Application::Impl::actions_handler(Glib::ustring const& action_name)
{ {
bool changed = false; bool changed = false;
if (action_name == "open-torrent-from-url") if (action_name == GTR_KEY_open_torrent_from_url)
{ {
auto w = std::shared_ptr<TorrentUrlChooserDialog>(TorrentUrlChooserDialog::create(*wind_, core_)); auto w = std::shared_ptr<TorrentUrlChooserDialog>(TorrentUrlChooserDialog::create(*wind_, core_));
gtr_window_on_close(*w, [w]() mutable { w.reset(); }); gtr_window_on_close(*w, [w]() mutable { w.reset(); });
w->show(); w->show();
} }
else if (action_name == "open-torrent") else if (action_name == GTR_KEY_open_torrent)
{ {
auto w = std::shared_ptr<TorrentFileChooserDialog>(TorrentFileChooserDialog::create(*wind_, core_)); auto w = std::shared_ptr<TorrentFileChooserDialog>(TorrentFileChooserDialog::create(*wind_, core_));
w->signal_response().connect([w](int /*response*/) mutable { w.reset(); }); w->signal_response().connect([w](int /*response*/) mutable { w.reset(); });
w->show(); w->show();
} }
else if (action_name == "show-stats") else if (action_name == GTR_KEY_show_stats)
{ {
auto dialog = std::shared_ptr<StatsDialog>(StatsDialog::create(*wind_, core_)); auto dialog = std::shared_ptr<StatsDialog>(StatsDialog::create(*wind_, core_));
gtr_window_on_close(*dialog, [dialog]() mutable { dialog.reset(); }); gtr_window_on_close(*dialog, [dialog]() mutable { dialog.reset(); });
dialog->show(); dialog->show();
} }
else if (action_name == "donate") else if (action_name == GTR_KEY_donate)
{ {
gtr_open_uri("https://transmissionbt.com/donate/"); gtr_open_uri("https://transmissionbt.com/donate/");
} }
else if (action_name == "pause-all-torrents") else if (action_name == GTR_KEY_pause_all_torrents)
{ {
pause_all_torrents(); pause_all_torrents();
} }
else if (action_name == "start-all-torrents") else if (action_name == GTR_KEY_start_all_torrents)
{ {
start_all_torrents(); start_all_torrents();
} }
else if (action_name == "copy-magnet-link-to-clipboard") else if (action_name == GTR_KEY_copy_magnet_link_to_clipboard)
{ {
wind_->for_each_selected_torrent_until( wind_->for_each_selected_torrent_until(
sigc::bind_return(sigc::mem_fun(*this, &Impl::copy_magnet_link_to_clipboard), true)); sigc::bind_return(sigc::mem_fun(*this, &Impl::copy_magnet_link_to_clipboard), true));
} }
else if (action_name == "relocate-torrent") else if (action_name == GTR_KEY_relocate_torrent)
{ {
auto const ids = get_selected_torrent_ids(); auto const ids = get_selected_torrent_ids();
@@ -1553,41 +1552,41 @@ void Application::Impl::actions_handler(Glib::ustring const& action_name)
{ {
changed = call_rpc_for_selected_torrents(*method); changed = call_rpc_for_selected_torrents(*method);
} }
else if (action_name == "open-torrent-folder") else if (action_name == GTR_KEY_open_torrent_folder)
{ {
wind_->for_each_selected_torrent([this](auto const& torrent) { core_->open_folder(torrent->get_id()); }); wind_->for_each_selected_torrent([this](auto const& torrent) { core_->open_folder(torrent->get_id()); });
} }
else if (action_name == "show-torrent-properties") else if (action_name == GTR_KEY_show_torrent_properties)
{ {
show_details_dialog_for_selected_torrents(); show_details_dialog_for_selected_torrents();
} }
else if (action_name == "new-torrent") else if (action_name == GTR_KEY_new_torrent)
{ {
auto w = std::shared_ptr<MakeDialog>(MakeDialog::create(*wind_, core_)); auto w = std::shared_ptr<MakeDialog>(MakeDialog::create(*wind_, core_));
gtr_window_on_close(*w, [w]() mutable { w.reset(); }); gtr_window_on_close(*w, [w]() mutable { w.reset(); });
w->show(); w->show();
} }
else if (action_name == "remove-torrent") else if (action_name == GTR_KEY_remove_torrent)
{ {
remove_selected(false); remove_selected(false);
} }
else if (action_name == "delete-torrent") else if (action_name == GTR_KEY_delete_torrent)
{ {
remove_selected(true); remove_selected(true);
} }
else if (action_name == "quit") else if (action_name == GTR_KEY_quit)
{ {
on_app_exit(); on_app_exit();
} }
else if (action_name == "select-all") else if (action_name == GTR_KEY_select_all)
{ {
wind_->select_all(); wind_->select_all();
} }
else if (action_name == "deselect-all") else if (action_name == GTR_KEY_deselect_all)
{ {
wind_->unselect_all(); wind_->unselect_all();
} }
else if (action_name == "edit-preferences") else if (action_name == GTR_KEY_edit_preferences)
{ {
if (prefs_ == nullptr) if (prefs_ == nullptr)
{ {
@@ -1597,7 +1596,7 @@ void Application::Impl::actions_handler(Glib::ustring const& action_name)
gtr_window_present(prefs_); gtr_window_present(prefs_);
} }
else if (action_name == "toggle-message-log") else if (action_name == GTR_KEY_toggle_message_log)
{ {
if (msgwin_ == nullptr) if (msgwin_ == nullptr)
{ {
@@ -1606,11 +1605,11 @@ void Application::Impl::actions_handler(Glib::ustring const& action_name)
*msgwin_, *msgwin_,
[this]() [this]()
{ {
gtr_action_set_toggled("toggle-message-log", false); gtr_action_set_toggled(GTR_KEY_toggle_message_log, false);
msgwin_.reset(); msgwin_.reset();
}); });
gtr_action_set_toggled("toggle-message-log", true); gtr_action_set_toggled(GTR_KEY_toggle_message_log, true);
msgwin_->show(); msgwin_->show();
} }
else else
@@ -1618,19 +1617,19 @@ void Application::Impl::actions_handler(Glib::ustring const& action_name)
msgwin_->close(); msgwin_->close();
} }
} }
else if (action_name == "show-about-dialog") else if (action_name == GTR_KEY_show_about_dialog)
{ {
show_about_dialog(); show_about_dialog();
} }
else if (action_name == "help") else if (action_name == GTR_KEY_help)
{ {
gtr_open_uri(gtr_get_help_uri()); gtr_open_uri(gtr_get_help_uri());
} }
else if (action_name == "toggle-main-window") else if (action_name == GTR_KEY_toggle_main_window)
{ {
toggleMainWindow(); toggleMainWindow();
} }
else if (action_name == "present-main-window") else if (action_name == GTR_KEY_present_main_window)
{ {
presentMainWindow(); presentMainWindow();
} }

View File

@@ -180,7 +180,7 @@ void MainWindow::Impl::on_popup_menu([[maybe_unused]] double event_x, [[maybe_un
{ {
if (popup_menu_ == nullptr) if (popup_menu_ == nullptr)
{ {
auto const menu = gtr_action_get_object<Gio::Menu>("main-window-popup"); auto const menu = gtr_action_get_object<Gio::Menu>(GTR_KEY_main_window_popup);
#if GTKMM_CHECK_VERSION(4, 0, 0) #if GTKMM_CHECK_VERSION(4, 0, 0)
popup_menu_ = Gtk::make_managed<Gtk::PopoverMenu>(menu, Gtk::PopoverMenu::Flags::NESTED); popup_menu_ = Gtk::make_managed<Gtk::PopoverMenu>(menu, Gtk::PopoverMenu::Flags::NESTED);
@@ -275,7 +275,7 @@ void MainWindow::Impl::init_view(TorrentView* view, Glib::RefPtr<FilterBar::Mode
item_factory_compact_ = create_builder_list_item_factory("TorrentListItemCompact.ui"s); item_factory_compact_ = create_builder_list_item_factory("TorrentListItemCompact.ui"s);
item_factory_full_ = create_builder_list_item_factory("TorrentListItemFull.ui"s); item_factory_full_ = create_builder_list_item_factory("TorrentListItemFull.ui"s);
view->signal_activate().connect([](guint /*position*/) { gtr_action_activate("show-torrent-properties"); }); view->signal_activate().connect([](guint /*position*/) { gtr_action_activate(GTR_KEY_show_torrent_properties); });
selection_ = Gtk::MultiSelection::create(model); selection_ = Gtk::MultiSelection::create(model);
selection_->signal_selection_changed().connect([this](guint /*position*/, guint /*n_items*/) selection_->signal_selection_changed().connect([this](guint /*position*/, guint /*n_items*/)
@@ -297,7 +297,7 @@ void MainWindow::Impl::init_view(TorrentView* view, Glib::RefPtr<FilterBar::Mode
view->signal_popup_menu().connect_notify([this]() { on_popup_menu(0, 0); }); view->signal_popup_menu().connect_notify([this]() { on_popup_menu(0, 0); });
view->signal_row_activated().connect([](auto const& /*path*/, auto* /*column*/) view->signal_row_activated().connect([](auto const& /*path*/, auto* /*column*/)
{ gtr_action_activate("show-torrent-properties"); }); { gtr_action_activate(GTR_KEY_show_torrent_properties); });
view->set_model(model); view->set_model(model);

View File

@@ -502,15 +502,15 @@ MessageLogWindow::Impl::Impl(
auto const action_group = Gio::SimpleActionGroup::create(); auto const action_group = Gio::SimpleActionGroup::create();
auto const save_action = Gio::SimpleAction::create("save-message-log"); auto const save_action = Gio::SimpleAction::create("save_message_log");
save_action->signal_activate().connect([this](auto const& /*value*/) { onSaveRequest(); }); save_action->signal_activate().connect([this](auto const& /*value*/) { onSaveRequest(); });
action_group->add_action(save_action); action_group->add_action(save_action);
auto const clear_action = Gio::SimpleAction::create("clear-message-log"); auto const clear_action = Gio::SimpleAction::create("clear_message_log");
clear_action->signal_activate().connect([this](auto const& /*value*/) { onClearRequest(); }); clear_action->signal_activate().connect([this](auto const& /*value*/) { onClearRequest(); });
action_group->add_action(clear_action); action_group->add_action(clear_action);
auto const pause_action = Gio::SimpleAction::create_bool("pause-message-log"); auto const pause_action = Gio::SimpleAction::create_bool("pause_message_log");
pause_action->signal_activate().connect([this, &action = *pause_action](auto const& /*value*/) { onPauseToggled(action); }); pause_action->signal_activate().connect([this, &action = *pause_action](auto const& /*value*/) { onPauseToggled(action); });
action_group->add_action(pause_action); action_group->add_action(pause_action);

View File

@@ -114,7 +114,7 @@ SystemTrayIcon::Impl::~Impl() = default;
void SystemTrayIcon::Impl::activated() void SystemTrayIcon::Impl::activated()
{ {
gtr_action_activate("toggle-main-window"); gtr_action_activate(GTR_KEY_toggle_main_window);
} }
void SystemTrayIcon::Impl::popup(guint /*button*/, guint /*when*/) void SystemTrayIcon::Impl::popup(guint /*button*/, guint /*when*/)

View File

@@ -2,26 +2,26 @@
<interface> <interface>
<requires lib="gtk+" version="3.24"/> <requires lib="gtk+" version="3.24"/>
<menu id="main-window-menu"> <menu id="main_window_menu">
<submenu> <submenu>
<attribute name="label" translatable="true">_File</attribute> <attribute name="label" translatable="true">_File</attribute>
<section> <section>
<item> <item>
<attribute name="action">win.open-torrent</attribute> <attribute name="action">win.open_torrent</attribute>
<attribute name="icon">document-open</attribute> <attribute name="icon">document-open</attribute>
<attribute name="label" translatable="yes">_Open</attribute> <attribute name="label" translatable="yes">_Open</attribute>
<attribute name="accel">&lt;control&gt;O</attribute> <attribute name="accel">&lt;control&gt;O</attribute>
<attribute name="tooltip" translatable="yes">Open a torrent</attribute> <attribute name="tooltip" translatable="yes">Open a torrent</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.open-torrent-from-url</attribute> <attribute name="action">win.open_torrent_from_url</attribute>
<attribute name="icon">document-open</attribute> <attribute name="icon">document-open</attribute>
<attribute name="label" translatable="yes">Open _URL…</attribute> <attribute name="label" translatable="yes">Open _URL…</attribute>
<attribute name="accel">&lt;control&gt;U</attribute> <attribute name="accel">&lt;control&gt;U</attribute>
<attribute name="tooltip" translatable="yes">Open URL…</attribute> <attribute name="tooltip" translatable="yes">Open URL…</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.new-torrent</attribute> <attribute name="action">win.new_torrent</attribute>
<attribute name="icon">document-new</attribute> <attribute name="icon">document-new</attribute>
<attribute name="accel">&lt;control&gt;N</attribute> <attribute name="accel">&lt;control&gt;N</attribute>
<attribute name="label" translatable="yes">_New…</attribute> <attribute name="label" translatable="yes">_New…</attribute>
@@ -29,13 +29,13 @@
</section> </section>
<section> <section>
<item> <item>
<attribute name="action">win.start-all-torrents</attribute> <attribute name="action">win.start_all_torrents</attribute>
<attribute name="icon">media-playback-start</attribute> <attribute name="icon">media-playback-start</attribute>
<attribute name="label" translatable="yes">_Start All</attribute> <attribute name="label" translatable="yes">_Start All</attribute>
<attribute name="tooltip" translatable="yes">Start all torrents</attribute> <attribute name="tooltip" translatable="yes">Start all torrents</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.pause-all-torrents</attribute> <attribute name="action">win.pause_all_torrents</attribute>
<attribute name="icon">media-playback-pause</attribute> <attribute name="icon">media-playback-pause</attribute>
<attribute name="label" translatable="yes">_Pause All</attribute> <attribute name="label" translatable="yes">_Pause All</attribute>
<attribute name="tooltip" translatable="yes">Pause all torrents</attribute> <attribute name="tooltip" translatable="yes">Pause all torrents</attribute>
@@ -54,20 +54,20 @@
<attribute name="label" translatable="true">_Edit</attribute> <attribute name="label" translatable="true">_Edit</attribute>
<section> <section>
<item> <item>
<attribute name="action">win.select-all</attribute> <attribute name="action">win.select_all</attribute>
<attribute name="icon">edit-select-all</attribute> <attribute name="icon">edit-select-all</attribute>
<attribute name="label" translatable="yes">Select _All</attribute> <attribute name="label" translatable="yes">Select _All</attribute>
<attribute name="accel">&lt;control&gt;A</attribute> <attribute name="accel">&lt;control&gt;A</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.deselect-all</attribute> <attribute name="action">win.deselect_all</attribute>
<attribute name="label" translatable="yes">Dese_lect All</attribute> <attribute name="label" translatable="yes">Dese_lect All</attribute>
<attribute name="accel">&lt;shift&gt;&lt;control&gt;A</attribute> <attribute name="accel">&lt;shift&gt;&lt;control&gt;A</attribute>
</item> </item>
</section> </section>
<section> <section>
<item> <item>
<attribute name="action">win.edit-preferences</attribute> <attribute name="action">win.edit_preferences</attribute>
<attribute name="icon">preferences-system</attribute> <attribute name="icon">preferences-system</attribute>
<attribute name="label" translatable="yes">_Preferences</attribute> <attribute name="label" translatable="yes">_Preferences</attribute>
</item> </item>
@@ -77,14 +77,14 @@
<attribute name="label" translatable="true">_Torrent</attribute> <attribute name="label" translatable="true">_Torrent</attribute>
<section> <section>
<item> <item>
<attribute name="action">win.show-torrent-properties</attribute> <attribute name="action">win.show_torrent_properties</attribute>
<attribute name="icon">document-properties</attribute> <attribute name="icon">document-properties</attribute>
<attribute name="label" translatable="yes">_Properties</attribute> <attribute name="label" translatable="yes">_Properties</attribute>
<attribute name="accel">&lt;alt&gt;Return</attribute> <attribute name="accel">&lt;alt&gt;Return</attribute>
<attribute name="tooltip" translatable="yes">Torrent properties</attribute> <attribute name="tooltip" translatable="yes">Torrent properties</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.open-torrent-folder</attribute> <attribute name="action">win.open_torrent_folder</attribute>
<attribute name="icon">document-open</attribute> <attribute name="icon">document-open</attribute>
<attribute name="label" translatable="yes">Open Fold_er</attribute> <attribute name="label" translatable="yes">Open Fold_er</attribute>
<attribute name="accel">&lt;control&gt;E</attribute> <attribute name="accel">&lt;control&gt;E</attribute>
@@ -92,21 +92,21 @@
</section> </section>
<section> <section>
<item> <item>
<attribute name="action">win.torrent-start</attribute> <attribute name="action">win.torrent_start</attribute>
<attribute name="icon">media-playback-start</attribute> <attribute name="icon">media-playback-start</attribute>
<attribute name="label" translatable="yes">_Start</attribute> <attribute name="label" translatable="yes">_Start</attribute>
<attribute name="accel">&lt;control&gt;S</attribute> <attribute name="accel">&lt;control&gt;S</attribute>
<attribute name="tooltop" translatable="yes">Start torrent</attribute> <attribute name="tooltop" translatable="yes">Start torrent</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.torrent-start-now</attribute> <attribute name="action">win.torrent_start_now</attribute>
<attribute name="icon">media-playback-start</attribute> <attribute name="icon">media-playback-start</attribute>
<attribute name="label" translatable="yes">Start _Now</attribute> <attribute name="label" translatable="yes">Start _Now</attribute>
<attribute name="accel">&lt;shift&gt;&lt;control&gt;S</attribute> <attribute name="accel">&lt;shift&gt;&lt;control&gt;S</attribute>
<attribute name="tooltop" translatable="yes">Start torrent now</attribute> <attribute name="tooltop" translatable="yes">Start torrent now</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.torrent-reannounce</attribute> <attribute name="action">win.torrent_reannounce</attribute>
<attribute name="icon">network-workgroup</attribute> <attribute name="icon">network-workgroup</attribute>
<attribute name="label" translatable="yes">Ask Tracker for _More Peers</attribute> <attribute name="label" translatable="yes">Ask Tracker for _More Peers</attribute>
</item> </item>
@@ -114,29 +114,29 @@
<attribute name="label" translatable="true">_Queue</attribute> <attribute name="label" translatable="true">_Queue</attribute>
<section> <section>
<item> <item>
<attribute name="action">win.queue-move-top</attribute> <attribute name="action">win.queue_move_top</attribute>
<attribute name="icon">go-top</attribute> <attribute name="icon">go-top</attribute>
<attribute name="label" translatable="yes">Move to _Top</attribute> <attribute name="label" translatable="yes">Move to _Top</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.queue-move-up</attribute> <attribute name="action">win.queue_move_up</attribute>
<attribute name="icon">go-up</attribute> <attribute name="icon">go-up</attribute>
<attribute name="label" translatable="yes">Move _Up</attribute> <attribute name="label" translatable="yes">Move _Up</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.queue-move-down</attribute> <attribute name="action">win.queue_move_down</attribute>
<attribute name="icon">go-down</attribute> <attribute name="icon">go-down</attribute>
<attribute name="label" translatable="yes">Move _Down</attribute> <attribute name="label" translatable="yes">Move _Down</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.queue-move-bottom</attribute> <attribute name="action">win.queue_move_bottom</attribute>
<attribute name="icon">go-bottom</attribute> <attribute name="icon">go-bottom</attribute>
<attribute name="label" translatable="yes">Move to _Bottom</attribute> <attribute name="label" translatable="yes">Move to _Bottom</attribute>
</item> </item>
</section> </section>
</submenu> </submenu>
<item> <item>
<attribute name="action">win.torrent-stop</attribute> <attribute name="action">win.torrent_stop</attribute>
<attribute name="icon">media-playback-pause</attribute> <attribute name="icon">media-playback-pause</attribute>
<attribute name="label" translatable="yes">_Pause</attribute> <attribute name="label" translatable="yes">_Pause</attribute>
<attribute name="accel">&lt;control&gt;P</attribute> <attribute name="accel">&lt;control&gt;P</attribute>
@@ -145,29 +145,29 @@
</section> </section>
<section> <section>
<item> <item>
<attribute name="action">win.relocate-torrent</attribute> <attribute name="action">win.relocate_torrent</attribute>
<attribute name="label" translatable="yes">Set _Location…</attribute> <attribute name="label" translatable="yes">Set _Location…</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.torrent-verify</attribute> <attribute name="action">win.torrent_verify</attribute>
<attribute name="label" translatable="yes">_Verify Local Data</attribute> <attribute name="label" translatable="yes">_Verify Local Data</attribute>
<attribute name="accel">&lt;control&gt;V</attribute> <attribute name="accel">&lt;control&gt;V</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.copy-magnet-link-to-clipboard</attribute> <attribute name="action">win.copy_magnet_link_to_clipboard</attribute>
<attribute name="icon">edit-copy</attribute> <attribute name="icon">edit-copy</attribute>
<attribute name="label" translatable="yes">Copy _Magnet Link to Clipboard</attribute> <attribute name="label" translatable="yes">Copy _Magnet Link to Clipboard</attribute>
</item> </item>
</section> </section>
<section> <section>
<item> <item>
<attribute name="action">win.remove-torrent</attribute> <attribute name="action">win.remove_torrent</attribute>
<attribute name="icon">list-remove</attribute> <attribute name="icon">list-remove</attribute>
<attribute name="label" translatable="yes">Remove torrent</attribute> <attribute name="label" translatable="yes">Remove torrent</attribute>
<attribute name="accel">Delete</attribute> <attribute name="accel">Delete</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.delete-torrent</attribute> <attribute name="action">win.delete_torrent</attribute>
<attribute name="icon">edit-delete</attribute> <attribute name="icon">edit-delete</attribute>
<attribute name="label" translatable="yes">_Delete Files and Remove</attribute> <attribute name="label" translatable="yes">_Delete Files and Remove</attribute>
<attribute name="accel">&lt;shift&gt;Delete</attribute> <attribute name="accel">&lt;shift&gt;Delete</attribute>
@@ -199,47 +199,47 @@
</section> </section>
<section> <section>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by _Activity</attribute> <attribute name="label" translatable="yes">Sort by _Activity</attribute>
<attribute name="target">sort_by_activity</attribute> <attribute name="target">sort_by_activity</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by A_ge</attribute> <attribute name="label" translatable="yes">Sort by A_ge</attribute>
<attribute name="target">sort_by_age</attribute> <attribute name="target">sort_by_age</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by _Name</attribute> <attribute name="label" translatable="yes">Sort by _Name</attribute>
<attribute name="target">sort_by_name</attribute> <attribute name="target">sort_by_name</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by _Progress</attribute> <attribute name="label" translatable="yes">Sort by _Progress</attribute>
<attribute name="target">sort_by_progress</attribute> <attribute name="target">sort_by_progress</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by _Queue</attribute> <attribute name="label" translatable="yes">Sort by _Queue</attribute>
<attribute name="target">sort_by_queue</attribute> <attribute name="target">sort_by_queue</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by Rati_o</attribute> <attribute name="label" translatable="yes">Sort by Rati_o</attribute>
<attribute name="target">sort_by_ratio</attribute> <attribute name="target">sort_by_ratio</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by Si_ze</attribute> <attribute name="label" translatable="yes">Sort by Si_ze</attribute>
<attribute name="target">sort_by_size</attribute> <attribute name="target">sort_by_size</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by Stat_e</attribute> <attribute name="label" translatable="yes">Sort by Stat_e</attribute>
<attribute name="target">sort_by_state</attribute> <attribute name="target">sort_by_state</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by Time _Left</attribute> <attribute name="label" translatable="yes">Sort by Time _Left</attribute>
<attribute name="target">sort_by_time_left</attribute> <attribute name="target">sort_by_time_left</attribute>
</item> </item>
@@ -255,11 +255,11 @@
<attribute name="label" translatable="true">_Help</attribute> <attribute name="label" translatable="true">_Help</attribute>
<section> <section>
<item> <item>
<attribute name="action">win.toggle-message-log</attribute> <attribute name="action">win.toggle_message_log</attribute>
<attribute name="label" translatable="yes">Message _Log</attribute> <attribute name="label" translatable="yes">Message _Log</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.show-stats</attribute> <attribute name="action">win.show_stats</attribute>
<attribute name="label" translatable="yes">_Statistics</attribute> <attribute name="label" translatable="yes">_Statistics</attribute>
</item> </item>
</section> </section>
@@ -277,7 +277,7 @@
<attribute name="accel">F1</attribute> <attribute name="accel">F1</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.show-about-dialog</attribute> <attribute name="action">win.show_about_dialog</attribute>
<attribute name="icon">help-about</attribute> <attribute name="icon">help-about</attribute>
<attribute name="label" translatable="yes">_About</attribute> <attribute name="label" translatable="yes">_About</attribute>
</item> </item>
@@ -285,17 +285,17 @@
</submenu> </submenu>
</menu> </menu>
<menu id="main-window-popup"> <menu id="main_window_popup">
<section> <section>
<item> <item>
<attribute name="action">win.show-torrent-properties</attribute> <attribute name="action">win.show_torrent_properties</attribute>
<attribute name="icon">document-properties</attribute> <attribute name="icon">document-properties</attribute>
<attribute name="label" translatable="yes">_Properties</attribute> <attribute name="label" translatable="yes">_Properties</attribute>
<attribute name="accel">&lt;alt&gt;Return</attribute> <attribute name="accel">&lt;alt&gt;Return</attribute>
<attribute name="tooltip" translatable="yes">Torrent properties</attribute> <attribute name="tooltip" translatable="yes">Torrent properties</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.open-torrent-folder</attribute> <attribute name="action">win.open_torrent_folder</attribute>
<attribute name="icon">document-open</attribute> <attribute name="icon">document-open</attribute>
<attribute name="label" translatable="yes">Open Fold_er</attribute> <attribute name="label" translatable="yes">Open Fold_er</attribute>
<attribute name="accel">&lt;control&gt;E</attribute> <attribute name="accel">&lt;control&gt;E</attribute>
@@ -306,47 +306,47 @@
<attribute name="label" translatable="true">_Sort Torrents By</attribute> <attribute name="label" translatable="true">_Sort Torrents By</attribute>
<section> <section>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by _Activity</attribute> <attribute name="label" translatable="yes">Sort by _Activity</attribute>
<attribute name="target">sort_by_activity</attribute> <attribute name="target">sort_by_activity</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by A_ge</attribute> <attribute name="label" translatable="yes">Sort by A_ge</attribute>
<attribute name="target">sort_by_age</attribute> <attribute name="target">sort_by_age</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by _Name</attribute> <attribute name="label" translatable="yes">Sort by _Name</attribute>
<attribute name="target">sort_by_name</attribute> <attribute name="target">sort_by_name</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by _Progress</attribute> <attribute name="label" translatable="yes">Sort by _Progress</attribute>
<attribute name="target">sort_by_progress</attribute> <attribute name="target">sort_by_progress</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by _Queue</attribute> <attribute name="label" translatable="yes">Sort by _Queue</attribute>
<attribute name="target">sort_by_queue</attribute> <attribute name="target">sort_by_queue</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by Rati_o</attribute> <attribute name="label" translatable="yes">Sort by Rati_o</attribute>
<attribute name="target">sort_by_ratio</attribute> <attribute name="target">sort_by_ratio</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by Si_ze</attribute> <attribute name="label" translatable="yes">Sort by Si_ze</attribute>
<attribute name="target">sort_by_size</attribute> <attribute name="target">sort_by_size</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by Stat_e</attribute> <attribute name="label" translatable="yes">Sort by Stat_e</attribute>
<attribute name="target">sort_by_state</attribute> <attribute name="target">sort_by_state</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.sort-torrents</attribute> <attribute name="action">win.sort_torrents</attribute>
<attribute name="label" translatable="yes">Sort by Time _Left</attribute> <attribute name="label" translatable="yes">Sort by Time _Left</attribute>
<attribute name="target">sort_by_time_left</attribute> <attribute name="target">sort_by_time_left</attribute>
</item> </item>
@@ -361,21 +361,21 @@
</section> </section>
<section> <section>
<item> <item>
<attribute name="action">win.torrent-start</attribute> <attribute name="action">win.torrent_start</attribute>
<attribute name="icon">media-playback-start</attribute> <attribute name="icon">media-playback-start</attribute>
<attribute name="label" translatable="yes">_Start</attribute> <attribute name="label" translatable="yes">_Start</attribute>
<attribute name="accel">&lt;control&gt;S</attribute> <attribute name="accel">&lt;control&gt;S</attribute>
<attribute name="tooltop" translatable="yes">Start torrent</attribute> <attribute name="tooltop" translatable="yes">Start torrent</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.torrent-start-now</attribute> <attribute name="action">win.torrent_start_now</attribute>
<attribute name="icon">media-playback-start</attribute> <attribute name="icon">media-playback-start</attribute>
<attribute name="label" translatable="yes">Start _Now</attribute> <attribute name="label" translatable="yes">Start _Now</attribute>
<attribute name="accel">&lt;shift&gt;&lt;control&gt;S</attribute> <attribute name="accel">&lt;shift&gt;&lt;control&gt;S</attribute>
<attribute name="tooltop" translatable="yes">Start torrent now</attribute> <attribute name="tooltop" translatable="yes">Start torrent now</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.torrent-reannounce</attribute> <attribute name="action">win.torrent_reannounce</attribute>
<attribute name="icon">network-workgroup</attribute> <attribute name="icon">network-workgroup</attribute>
<attribute name="label" translatable="yes">Ask Tracker for _More Peers</attribute> <attribute name="label" translatable="yes">Ask Tracker for _More Peers</attribute>
</item> </item>
@@ -383,29 +383,29 @@
<attribute name="label" translatable="true">_Queue</attribute> <attribute name="label" translatable="true">_Queue</attribute>
<section> <section>
<item> <item>
<attribute name="action">win.queue-move-top</attribute> <attribute name="action">win.queue_move_top</attribute>
<attribute name="icon">go-top</attribute> <attribute name="icon">go-top</attribute>
<attribute name="label" translatable="yes">Move to _Top</attribute> <attribute name="label" translatable="yes">Move to _Top</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.queue-move-up</attribute> <attribute name="action">win.queue_move_up</attribute>
<attribute name="icon">go-up</attribute> <attribute name="icon">go-up</attribute>
<attribute name="label" translatable="yes">Move _Up</attribute> <attribute name="label" translatable="yes">Move _Up</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.queue-move-down</attribute> <attribute name="action">win.queue_move_down</attribute>
<attribute name="icon">go-down</attribute> <attribute name="icon">go-down</attribute>
<attribute name="label" translatable="yes">Move _Down</attribute> <attribute name="label" translatable="yes">Move _Down</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.queue-move-bottom</attribute> <attribute name="action">win.queue_move_bottom</attribute>
<attribute name="icon">go-bottom</attribute> <attribute name="icon">go-bottom</attribute>
<attribute name="label" translatable="yes">Move to _Bottom</attribute> <attribute name="label" translatable="yes">Move to _Bottom</attribute>
</item> </item>
</section> </section>
</submenu> </submenu>
<item> <item>
<attribute name="action">win.torrent-stop</attribute> <attribute name="action">win.torrent_stop</attribute>
<attribute name="icon">media-playback-pause</attribute> <attribute name="icon">media-playback-pause</attribute>
<attribute name="label" translatable="yes">_Pause</attribute> <attribute name="label" translatable="yes">_Pause</attribute>
<attribute name="accel">&lt;control&gt;P</attribute> <attribute name="accel">&lt;control&gt;P</attribute>
@@ -414,29 +414,29 @@
</section> </section>
<section> <section>
<item> <item>
<attribute name="action">win.relocate-torrent</attribute> <attribute name="action">win.relocate_torrent</attribute>
<attribute name="label" translatable="yes">Set _Location…</attribute> <attribute name="label" translatable="yes">Set _Location…</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.torrent-verify</attribute> <attribute name="action">win.torrent_verify</attribute>
<attribute name="label" translatable="yes">_Verify Local Data</attribute> <attribute name="label" translatable="yes">_Verify Local Data</attribute>
<attribute name="accel">&lt;control&gt;V</attribute> <attribute name="accel">&lt;control&gt;V</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.copy-magnet-link-to-clipboard</attribute> <attribute name="action">win.copy_magnet_link_to_clipboard</attribute>
<attribute name="icon">edit-copy</attribute> <attribute name="icon">edit-copy</attribute>
<attribute name="label" translatable="yes">Copy _Magnet Link to Clipboard</attribute> <attribute name="label" translatable="yes">Copy _Magnet Link to Clipboard</attribute>
</item> </item>
</section> </section>
<section> <section>
<item> <item>
<attribute name="action">win.remove-torrent</attribute> <attribute name="action">win.remove_torrent</attribute>
<attribute name="icon">list-remove</attribute> <attribute name="icon">list-remove</attribute>
<attribute name="label" translatable="yes">Remove torrent</attribute> <attribute name="label" translatable="yes">Remove torrent</attribute>
<attribute name="accel">Delete</attribute> <attribute name="accel">Delete</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.delete-torrent</attribute> <attribute name="action">win.delete_torrent</attribute>
<attribute name="icon">edit-delete</attribute> <attribute name="icon">edit-delete</attribute>
<attribute name="label" translatable="yes">_Delete Files and Remove</attribute> <attribute name="label" translatable="yes">_Delete Files and Remove</attribute>
<attribute name="accel">&lt;shift&gt;Delete</attribute> <attribute name="accel">&lt;shift&gt;Delete</attribute>
@@ -447,19 +447,19 @@
<menu id="icon-popup"> <menu id="icon-popup">
<section> <section>
<item> <item>
<attribute name="action">win.toggle-main-window</attribute> <attribute name="action">win.toggle_main_window</attribute>
<attribute name="label" translatable="yes">_Show Transmission</attribute> <attribute name="label" translatable="yes">_Show Transmission</attribute>
</item> </item>
</section> </section>
<section> <section>
<item> <item>
<attribute name="action">win.open-torrent</attribute> <attribute name="action">win.open_torrent</attribute>
<attribute name="icon">document-open</attribute> <attribute name="icon">document-open</attribute>
<attribute name="label" translatable="yes">_Open</attribute> <attribute name="label" translatable="yes">_Open</attribute>
<attribute name="tooltip" translatable="yes">Open a torrent</attribute> <attribute name="tooltip" translatable="yes">Open a torrent</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.open-torrent-from-url</attribute> <attribute name="action">win.open_torrent_from_url</attribute>
<attribute name="icon">document-open</attribute> <attribute name="icon">document-open</attribute>
<attribute name="label" translatable="yes">Open _URL…</attribute> <attribute name="label" translatable="yes">Open _URL…</attribute>
<attribute name="accel"></attribute> <attribute name="accel"></attribute>
@@ -468,13 +468,13 @@
</section> </section>
<section> <section>
<item> <item>
<attribute name="action">win.pause-all-torrents</attribute> <attribute name="action">win.pause_all_torrents</attribute>
<attribute name="icon">media-playback-pause</attribute> <attribute name="icon">media-playback-pause</attribute>
<attribute name="label" translatable="yes">_Pause All</attribute> <attribute name="label" translatable="yes">_Pause All</attribute>
<attribute name="tooltip" translatable="yes">Pause all torrents</attribute> <attribute name="tooltip" translatable="yes">Pause all torrents</attribute>
</item> </item>
<item> <item>
<attribute name="action">win.start-all-torrents</attribute> <attribute name="action">win.start_all_torrents</attribute>
<attribute name="icon">media-playback-start</attribute> <attribute name="icon">media-playback-start</attribute>
<attribute name="label" translatable="yes">_Start All</attribute> <attribute name="label" translatable="yes">_Start All</attribute>
<attribute name="tooltip" translatable="yes">Start all torrents</attribute> <attribute name="tooltip" translatable="yes">Start all torrents</attribute>

View File

@@ -20,7 +20,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Open a torrent</property> <property name="tooltip-text" translatable="yes">Open a torrent</property>
<property name="is-important">True</property> <property name="is-important">True</property>
<property name="action-name">win.open-torrent</property> <property name="action-name">win.open_torrent</property>
<property name="label" translatable="yes">_Open</property> <property name="label" translatable="yes">_Open</property>
<property name="use-underline">True</property> <property name="use-underline">True</property>
<property name="icon-name">document-open</property> <property name="icon-name">document-open</property>
@@ -35,7 +35,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Start torrent</property> <property name="tooltip-text" translatable="yes">Start torrent</property>
<property name="action-name">win.torrent-start</property> <property name="action-name">win.torrent_start</property>
<property name="label" translatable="yes">_Start</property> <property name="label" translatable="yes">_Start</property>
<property name="use-underline">True</property> <property name="use-underline">True</property>
<property name="icon-name">media-playback-start</property> <property name="icon-name">media-playback-start</property>
@@ -50,7 +50,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Pause torrent</property> <property name="tooltip-text" translatable="yes">Pause torrent</property>
<property name="action-name">win.torrent-stop</property> <property name="action-name">win.torrent_stop</property>
<property name="label" translatable="yes">_Pause</property> <property name="label" translatable="yes">_Pause</property>
<property name="use-underline">True</property> <property name="use-underline">True</property>
<property name="icon-name">media-playback-pause</property> <property name="icon-name">media-playback-pause</property>
@@ -65,7 +65,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Remove torrent</property> <property name="tooltip-text" translatable="yes">Remove torrent</property>
<property name="action-name">win.remove-torrent</property> <property name="action-name">win.remove_torrent</property>
<property name="label" translatable="yes">Remove torrent</property> <property name="label" translatable="yes">Remove torrent</property>
<property name="use-underline">True</property> <property name="use-underline">True</property>
<property name="icon-name">list-remove</property> <property name="icon-name">list-remove</property>
@@ -91,7 +91,7 @@
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="tooltip-text" translatable="yes">Torrent properties</property> <property name="tooltip-text" translatable="yes">Torrent properties</property>
<property name="is-important">True</property> <property name="is-important">True</property>
<property name="action-name">win.show-torrent-properties</property> <property name="action-name">win.show_torrent_properties</property>
<property name="label" translatable="yes">_Properties</property> <property name="label" translatable="yes">_Properties</property>
<property name="use-underline">True</property> <property name="use-underline">True</property>
<property name="icon-name">document-properties</property> <property name="icon-name">document-properties</property>

View File

@@ -22,7 +22,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="is-important">True</property> <property name="is-important">True</property>
<property name="action-name">win.save-message-log</property> <property name="action-name">win.save_message_log</property>
<property name="label" translatable="yes">Save _As</property> <property name="label" translatable="yes">Save _As</property>
<property name="use-underline">True</property> <property name="use-underline">True</property>
<property name="icon-name">document-save-as</property> <property name="icon-name">document-save-as</property>
@@ -37,7 +37,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="is-important">True</property> <property name="is-important">True</property>
<property name="action-name">win.clear-message-log</property> <property name="action-name">win.clear_message_log</property>
<property name="label" translatable="yes">Clear</property> <property name="label" translatable="yes">Clear</property>
<property name="use-underline">True</property> <property name="use-underline">True</property>
<property name="icon-name">edit-clear</property> <property name="icon-name">edit-clear</property>
@@ -62,7 +62,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can-focus">False</property> <property name="can-focus">False</property>
<property name="is-important">True</property> <property name="is-important">True</property>
<property name="action-name">win.pause-message-log</property> <property name="action-name">win.pause_message_log</property>
<property name="label" translatable="yes">P_ause</property> <property name="label" translatable="yes">P_ause</property>
<property name="use-underline">True</property> <property name="use-underline">True</property>
<property name="icon-name">media-playback-pause</property> <property name="icon-name">media-playback-pause</property>

View File

@@ -14,7 +14,7 @@ horizontal]]></property>
<object class="GtkButton" id="open_file_button"> <object class="GtkButton" id="open_file_button">
<property name="focusable">1</property> <property name="focusable">1</property>
<property name="tooltip-text" translatable="1">Open a torrent</property> <property name="tooltip-text" translatable="1">Open a torrent</property>
<property name="action-name">win.open-torrent</property> <property name="action-name">win.open_torrent</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="halign">center</property> <property name="halign">center</property>
@@ -40,7 +40,7 @@ horizontal]]></property>
<object class="GtkButton" id="start_torrent_button"> <object class="GtkButton" id="start_torrent_button">
<property name="focusable">1</property> <property name="focusable">1</property>
<property name="tooltip-text" translatable="1">Start torrent</property> <property name="tooltip-text" translatable="1">Start torrent</property>
<property name="action-name">win.torrent-start</property> <property name="action-name">win.torrent_start</property>
<property name="label" translatable="1">_Start</property> <property name="label" translatable="1">_Start</property>
<property name="use-underline">1</property> <property name="use-underline">1</property>
<property name="icon-name">media-playback-start</property> <property name="icon-name">media-playback-start</property>
@@ -50,7 +50,7 @@ horizontal]]></property>
<object class="GtkButton" id="pause_torrent_button"> <object class="GtkButton" id="pause_torrent_button">
<property name="focusable">1</property> <property name="focusable">1</property>
<property name="tooltip-text" translatable="1">Pause torrent</property> <property name="tooltip-text" translatable="1">Pause torrent</property>
<property name="action-name">win.torrent-stop</property> <property name="action-name">win.torrent_stop</property>
<property name="label" translatable="1">_Pause</property> <property name="label" translatable="1">_Pause</property>
<property name="use-underline">1</property> <property name="use-underline">1</property>
<property name="icon-name">media-playback-pause</property> <property name="icon-name">media-playback-pause</property>
@@ -60,7 +60,7 @@ horizontal]]></property>
<object class="GtkButton" id="remove_torrent_button"> <object class="GtkButton" id="remove_torrent_button">
<property name="focusable">1</property> <property name="focusable">1</property>
<property name="tooltip-text" translatable="yes">Remove torrent</property> <property name="tooltip-text" translatable="yes">Remove torrent</property>
<property name="action-name">win.remove-torrent</property> <property name="action-name">win.remove_torrent</property>
<property name="label" translatable="1">Remove torrent</property> <property name="label" translatable="1">Remove torrent</property>
<property name="use-underline">1</property> <property name="use-underline">1</property>
<property name="icon-name">list-remove</property> <property name="icon-name">list-remove</property>
@@ -76,7 +76,7 @@ horizontal]]></property>
<object class="GtkButton" id="torrent_properties_button"> <object class="GtkButton" id="torrent_properties_button">
<property name="focusable">1</property> <property name="focusable">1</property>
<property name="tooltip-text" translatable="1">Torrent properties</property> <property name="tooltip-text" translatable="1">Torrent properties</property>
<property name="action-name">win.show-torrent-properties</property> <property name="action-name">win.show_torrent_properties</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="halign">center</property> <property name="halign">center</property>

View File

@@ -15,7 +15,7 @@
horizontal]]></property> horizontal]]></property>
<child> <child>
<object class="GtkButton" id="save_as_button"> <object class="GtkButton" id="save_as_button">
<property name="action-name">win.save-message-log</property> <property name="action-name">win.save_message_log</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="halign">center</property> <property name="halign">center</property>
@@ -39,7 +39,7 @@ horizontal]]></property>
</child> </child>
<child> <child>
<object class="GtkButton" id="clear_button"> <object class="GtkButton" id="clear_button">
<property name="action-name">win.clear-message-log</property> <property name="action-name">win.clear_message_log</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="halign">center</property> <property name="halign">center</property>
@@ -68,7 +68,7 @@ horizontal]]></property>
</child> </child>
<child> <child>
<object class="GtkToggleButton" id="pause_button"> <object class="GtkToggleButton" id="pause_button">
<property name="action-name">win.pause-message-log</property> <property name="action-name">win.pause_message_log</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox">
<property name="halign">center</property> <property name="halign">center</property>