Horizon
Loading...
Searching...
No Matches
step_export_window.hpp
1#pragma once
2#include <gtkmm.h>
3#include <array>
4#include <set>
5#include "util/export_file_chooser.hpp"
6#include "util/changeable.hpp"
7
8namespace horizon {
9
10class StepExportWindow : public Gtk::Window, public Changeable {
11public:
12 StepExportWindow(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &x, class IDocumentBoard &c,
13 const std::string &project_dir);
14 static StepExportWindow *create(Gtk::Window *p, class IDocumentBoard &c, const std::string &project_dir);
15
16 void set_can_export(bool v);
17 void generate();
18
19private:
20 class IDocumentBoard &core;
21 class STEPExportSettings &settings;
22 Gtk::HeaderBar *header = nullptr;
23 Gtk::Entry *filename_entry = nullptr;
24 Gtk::Button *filename_button = nullptr;
25 Gtk::Button *export_button = nullptr;
26 Gtk::Switch *include_3d_models_switch = nullptr;
27 Gtk::Box *min_dia_box = nullptr;
28 class SpinButtonDim *min_dia_spin_button = nullptr;
29 Gtk::Entry *prefix_entry = nullptr;
30
31 Gtk::TextView *log_textview = nullptr;
32 Gtk::Spinner *spinner = nullptr;
33 bool can_export = true;
34 void update_export_button();
35 Glib::RefPtr<Gtk::TextTag> tag;
36
37 class MyExportFileChooser : public ExportFileChooser {
38 protected:
39 void prepare_chooser(Glib::RefPtr<Gtk::FileChooser> chooser) override;
40 void prepare_filename(std::string &filename) override;
41 };
42 MyExportFileChooser export_filechooser;
43
44 Glib::Dispatcher export_dispatcher;
45 std::mutex msg_queue_mutex;
46 std::deque<std::string> msg_queue;
47 bool export_running = false;
48
49 void set_is_busy(bool v);
50
51 void export_thread(STEPExportSettings settings);
52};
53} // namespace horizon
Definition changeable.hpp:5
Definition export_file_chooser.hpp:7
Definition idocument_board.hpp:5
Definition step_export_settings.hpp:10
Definition spin_button_dim.hpp:5