hegyi@1: #ifndef FILE_IMPORT_DIALOG hegyi@1: #define FILE_IMPORT_DIALOG hegyi@1: hegyi@1: #include hegyi@1: #include hegyi@1: #include hegyi@1: #include hegyi@1: #include hegyi@1: #include hegyi@1: #include hegyi@1: #include hegyi@1: hegyi@1: class FileImportDialog : public Gtk::Dialog hegyi@1: { hegyi@1: public: hegyi@1: struct ImportData hegyi@1: { hegyi@1: ImportData( hegyi@1: const std::vector& _node_map_names, hegyi@1: const std::vector& _arc_map_names); hegyi@1: hegyi@1: ~ImportData(); hegyi@1: hegyi@1: std::vector node_map_names; hegyi@1: std::vector arc_map_names; hegyi@1: hegyi@1: std::vector xy_node_map_names; hegyi@1: std::vector xy_arc_map_names; hegyi@1: hegyi@1: bool contains( hegyi@1: const std::vector& vec, hegyi@1: const std::string& str); hegyi@1: hegyi@1: std::string node_coord_one_map_name; hegyi@1: std::string node_coord_two_maps_1_name; hegyi@1: std::string node_coord_two_maps_2_name; hegyi@1: std::string arrow_coord_one_map_name; hegyi@1: std::string arrow_coord_two_maps_1_name; hegyi@1: std::string arrow_coord_two_maps_2_name; hegyi@1: hegyi@1: enum ReadOpts { ONE_MAP, TWO_MAPS, DONT_READ }; hegyi@1: ReadOpts node_coord_load_from; hegyi@1: ReadOpts arrow_coord_load_from; hegyi@1: hegyi@1: bool isXYNodeMap(const std::string& name); hegyi@1: bool isXYArcMap(const std::string& name); hegyi@1: bool isNodeMap(const std::string& name); hegyi@1: bool isArcMap(const std::string& name); hegyi@1: hegyi@1: std::vector numeric_node_map_names; hegyi@1: std::vector string_node_map_names; hegyi@1: std::vector numeric_arc_map_names; hegyi@1: std::vector string_arc_map_names; hegyi@1: }; hegyi@1: hegyi@1: ImportData* p_data; hegyi@1: hegyi@1: Gtk::RadioButton rblueCoordNone; hegyi@1: Gtk::RadioButton rblueCoordOneMap; hegyi@1: Gtk::RadioButton rblueCoordTwoMaps; hegyi@1: hegyi@1: Gtk::RadioButton rbArrowCoordNone; hegyi@1: Gtk::RadioButton rbArrowCoordOneMap; hegyi@1: Gtk::RadioButton rbArrowCoordTwoMaps; hegyi@1: hegyi@1: Gtk::ComboBoxText cblueCoordOneMap; hegyi@1: Gtk::ComboBoxText cblueCoordTwoMaps1; hegyi@1: Gtk::ComboBoxText cblueCoordTwoMaps2; hegyi@1: hegyi@1: Gtk::ComboBoxText cbArrowCoordOneMap; hegyi@1: Gtk::ComboBoxText cbArrowCoordTwoMaps1; hegyi@1: Gtk::ComboBoxText cbArrowCoordTwoMaps2; hegyi@1: hegyi@1: void onNodeCoordMapNumToggled(); hegyi@1: void onArrowCoordMapNumToggled(); hegyi@1: hegyi@1: void onResponse(int id); hegyi@1: hegyi@1: void onNodeCoordOneMapChanged(); hegyi@1: void onNodeCoordTwoMaps1Changed(); hegyi@1: void onNodeCoordTwoMaps2Changed(); hegyi@1: hegyi@1: void onArrowCoordOneMapChanged(); hegyi@1: void onArrowCoordTwoMaps1Changed(); hegyi@1: void onArrowCoordTwoMaps2Changed(); hegyi@1: hegyi@1: struct MapModelColumns : public Gtk::TreeModel::ColumnRecord hegyi@1: { hegyi@1: MapModelColumns() hegyi@1: { hegyi@1: add(colName); hegyi@1: add(colReadAsNumeric); hegyi@1: add(colReadAsString); hegyi@1: } hegyi@1: Gtk::TreeModelColumn colName; hegyi@1: Gtk::TreeModelColumn colReadAsNumeric; hegyi@1: Gtk::TreeModelColumn colReadAsString; hegyi@1: }; hegyi@1: hegyi@1: Gtk::TreeView twNodeMaps; hegyi@1: MapModelColumns NodeMapColumns; hegyi@1: Glib::RefPtr refNodeMapStore; hegyi@1: void onNodeMapNumericToggled(const Glib::ustring& path); hegyi@1: void onNodeMapStringToggled(const Glib::ustring& path); hegyi@1: hegyi@1: Gtk::TreeView twArcMaps; hegyi@1: MapModelColumns ArcMapColumns; hegyi@1: Glib::RefPtr refArcMapStore; hegyi@1: void onArcMapNumericToggled(const Glib::ustring& path); hegyi@1: void onArcMapStringToggled(const Glib::ustring& path); hegyi@1: hegyi@1: struct tree_view_record hegyi@1: { hegyi@1: tree_view_record(const std::string& _name, bool _numeric, bool _string, hegyi@1: bool _visible) : hegyi@1: name(_name), hegyi@1: numeric(_numeric), hegyi@1: string(_string), hegyi@1: visible(_visible) {} hegyi@1: std::string name; hegyi@1: bool numeric; hegyi@1: bool string; hegyi@1: bool visible; hegyi@1: }; hegyi@1: hegyi@1: std::vector node_tree_view_records; hegyi@1: void update_node_tree_view(); hegyi@1: hegyi@1: std::vector arc_tree_view_records; hegyi@1: void update_arc_tree_view(); hegyi@1: hegyi@1: public: hegyi@1: FileImportDialog(ImportData* d); hegyi@1: ~FileImportDialog(); hegyi@1: }; hegyi@1: hegyi@1: #endif