diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2024-07-29 14:32:05 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2024-07-29 14:32:05 +0200 |
| commit | 6df08042ae4509ef2c8fd469babf6eb1c1cfbabf (patch) | |
| tree | de208a999f0d85b053c0cd3fa9c670c4338c98a6 /ui | |
| parent | 461c62c9a76bf0d2c2489bf54f9fc07db782e31e (diff) | |
| download | turns-6df08042ae4509ef2c8fd469babf6eb1c1cfbabf.tar.xz turns-6df08042ae4509ef2c8fd469babf6eb1c1cfbabf.zip | |
app: enable start with files to open
Diffstat (limited to 'ui')
| -rw-r--r-- | ui/include/turns/ui/windows/tracker.hpp | 2 | ||||
| -rw-r--r-- | ui/src/windows/tracker.cpp | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/ui/include/turns/ui/windows/tracker.hpp b/ui/include/turns/ui/windows/tracker.hpp index 03260f1..4dd0c7a 100644 --- a/ui/include/turns/ui/windows/tracker.hpp +++ b/ui/include/turns/ui/windows/tracker.hpp @@ -30,6 +30,8 @@ namespace turns::ui::windows { tracker(BaseObjectType * base, Glib::RefPtr<Gtk::Builder> const builder); + auto load(Glib::RefPtr<Gio::File> file) -> void; + private: /** Setup */ auto setup_actions() -> void; diff --git a/ui/src/windows/tracker.cpp b/ui/src/windows/tracker.cpp index e64eb18..66e241b 100644 --- a/ui/src/windows/tracker.cpp +++ b/ui/src/windows/tracker.cpp @@ -187,4 +187,14 @@ namespace turns::ui::windows } } + auto tracker::load(Glib::RefPtr<Gio::File> file) -> void + { + if (file->query_exists()) + { + m_file = file; + m_file->load_contents_async(sigc::mem_fun(*this, &tracker::on_load_content_done)); + set_sensitive(false); + } + } + } // namespace turns::ui::windows |
