1 #pragma once 2 #include <gtkmm.h> 3 #include <string> 4 #include "changeable.hpp" 5 6 namespace horizon { 7 class ExportFileChooser : public Changeable { 8 public: 9 ExportFileChooser(); 10 virtual ~ExportFileChooser(); 11 void attach(Gtk::Entry *en, Gtk::Button *bu, Gtk::Window *w); 12 void set_project_dir(const std::string &d); 13 const std::string &get_project_dir() const; 14 std::string get_filename_abs(const std::string &filename); 15 std::string get_filename_abs(); 16 std::string get_filename(); 17 void bind_filename(std::string &filename); 18 void set_action(GtkFileChooserAction action); 19 20 protected: 21 virtual void prepare_chooser(Glib::RefPtr<Gtk::FileChooser> chooser); 22 virtual void prepare_filename(std::string &filename); 23 24 private: 25 Gtk::Button *button = nullptr; 26 Gtk::Entry *entry = nullptr; 27 Gtk::Window *window = nullptr; 28 std::string project_dir; 29 std::string *filename_bound = nullptr; 30 GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE; 31 }; 32 33 } // namespace horizon 34