diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-04-30 09:21:20 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-04-30 09:21:20 +0200 |
| commit | 8181e59a6e1e76161e50ab545f4f62c2d05c8b80 (patch) | |
| tree | 374c294a6cfe6ba06bdf9a691cb0156e93cd8484 /ui/src/tracker | |
| parent | 64c2e6601c62d583f9ce06079bfaa6b052626f6b (diff) | |
| download | turns-8181e59a6e1e76161e50ab545f4f62c2d05c8b80.tar.xz turns-8181e59a6e1e76161e50ab545f4f62c2d05c8b80.zip | |
ui: convert tracker to template_widget
Diffstat (limited to 'ui/src/tracker')
| -rw-r--r-- | ui/src/tracker/actions.cpp | 18 | ||||
| -rw-r--r-- | ui/src/tracker/event_handlers.cpp | 12 |
2 files changed, 15 insertions, 15 deletions
diff --git a/ui/src/tracker/actions.cpp b/ui/src/tracker/actions.cpp index 7367dae..796345a 100644 --- a/ui/src/tracker/actions.cpp +++ b/ui/src/tracker/actions.cpp @@ -46,20 +46,20 @@ namespace turns::ui } } // namespace - auto tracker::add_participant() -> void + auto Tracker::add_participant() -> void { auto dialog = Gtk::make_managed<ParticipantEditor>(nullptr); dialog->signal_finished().connect([this](auto n, auto p, auto d) { m_turn_order->add(n, p, d); }); dialog->present(this); } - auto tracker::delete_participant(Glib::VariantBase param) -> void + auto Tracker::delete_participant(Glib::VariantBase param) -> void { auto index = Glib::VariantBase::cast_dynamic<Glib::Variant<int>>(param); m_turn_order->remove(index.get()); } - auto tracker::edit_participant(Glib::VariantBase param) -> void + auto Tracker::edit_participant(Glib::VariantBase param) -> void { auto index = Glib::VariantBase::cast_dynamic<Glib::Variant<int>>(param); auto participant = m_turn_order->get_typed_object<core::participant>(index.get()); @@ -72,14 +72,14 @@ namespace turns::ui dialog->present(this); } - auto tracker::open() -> void + auto Tracker::open() -> void { auto dialog = Gtk::FileDialog::create(); dialog->set_filters(file_filters()); - dialog->open(sigc::bind(sigc::mem_fun(*this, &tracker::on_open_response), dialog)); + dialog->open(sigc::bind(sigc::mem_fun(*this, &Tracker::on_open_response), dialog)); } - auto tracker::preferences() -> void + auto Tracker::preferences() -> void { auto preferences = Gtk::make_managed<struct Preferences>(m_settings); auto dialog = Gtk::make_managed<Adwaita::PreferencesDialog>(); @@ -88,7 +88,7 @@ namespace turns::ui dialog->present(this); } - auto tracker::save(bool force_ask) -> void + auto Tracker::save(bool force_ask) -> void { if (m_file && !force_ask) { @@ -99,11 +99,11 @@ namespace turns::ui auto dialog = Gtk::FileDialog::create(); m_file ? dialog->set_initial_file(m_file) : dialog->set_initial_name(_(lang::new_turn_order_file_name)); dialog->set_filters(file_filters()); - dialog->save(*this, sigc::bind(sigc::mem_fun(*this, &tracker::on_save_response), dialog)); + dialog->save(*this, sigc::bind(sigc::mem_fun(*this, &Tracker::on_save_response), dialog)); } } - auto tracker::stop() -> void + auto Tracker::stop() -> void { auto dialog = Adwaita::AlertDialog::create(_(lang::stop_turn_order), _(lang::question_clear_turn_order)); dialog->add_response("stop", _(lang::stop)); diff --git a/ui/src/tracker/event_handlers.cpp b/ui/src/tracker/event_handlers.cpp index 80664e4..78eb82b 100644 --- a/ui/src/tracker/event_handlers.cpp +++ b/ui/src/tracker/event_handlers.cpp @@ -22,7 +22,7 @@ namespace turns::ui { - auto tracker::on_load_content_done(Glib::RefPtr<Gio::AsyncResult> result) -> void + auto Tracker::on_load_content_done(Glib::RefPtr<Gio::AsyncResult> result) -> void { set_sensitive(); char * data{}; @@ -49,7 +49,7 @@ namespace turns::ui set_title(std::format("{} - {}", _(lang::turns), name)); } - auto tracker::on_replace_content_done(Glib::RefPtr<Gio::AsyncResult> result) -> void + auto Tracker::on_replace_content_done(Glib::RefPtr<Gio::AsyncResult> result) -> void { set_sensitive(); @@ -67,7 +67,7 @@ namespace turns::ui set_title(std::format("{} - {}", _(lang::turns), name)); } - auto tracker::on_open_response(Glib::RefPtr<Gio::AsyncResult> result, Glib::RefPtr<Gtk::FileDialog> dialog) -> void + auto Tracker::on_open_response(Glib::RefPtr<Gio::AsyncResult> result, Glib::RefPtr<Gtk::FileDialog> dialog) -> void { try { @@ -78,11 +78,11 @@ namespace turns::ui return show_error(e); } - m_file->load_contents_async(sigc::mem_fun(*this, &tracker::on_load_content_done)); + m_file->load_contents_async(sigc::mem_fun(*this, &Tracker::on_load_content_done)); set_sensitive(false); } - auto tracker::on_save_response(Glib::RefPtr<Gio::AsyncResult> result, Glib::RefPtr<Gtk::FileDialog> dialog) -> void + auto Tracker::on_save_response(Glib::RefPtr<Gio::AsyncResult> result, Glib::RefPtr<Gtk::FileDialog> dialog) -> void { try { @@ -97,7 +97,7 @@ namespace turns::ui set_sensitive(false); } - auto tracker::on_settings_changed(Glib::ustring) -> void + auto Tracker::on_settings_changed(Glib::ustring) -> void { update_colors(); } |
