VPTissue Reference Manual
ConverterWindow.h
Go to the documentation of this file.
1 #ifndef GUI_CONVERTER_WINDOW_H_INCLUDED
2 #define GUI_CONVERTER_WINDOW_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
23 
24 #include <QDialog>
25 #include <QRegExp>
26 #include <QString>
27 
28 #include <map>
29 #include <memory>
30 #include <string>
31 #include <vector>
32 
33 namespace SimPT_Shell {
34 namespace Ws {
35 class StartupFileBase;
36 } /* namespace Ws */
37 } /* namespace simPT_Shell */
38 
39 class QComboBox;
40 class QLineEdit;
41 class QPushButton;
42 
43 namespace SimPT_Shell {
44 namespace Ws {
45 class Project;
46 }
47 
48 class ConversionList;
49 
53 class ConverterWindow: public QDialog
54 {
55  Q_OBJECT
56 public:
62  std::vector<IConverterFormat*> formats,
63  std::shared_ptr<SimShell::Ws::MergedPreferences> prefs,
64  const std::string& window_title,
65  QWidget* parent = nullptr);
66 
70  virtual ~ConverterWindow();
71 
75  void Refresh();
76 
77 private slots:
78  void CheckConversionEnabled();
79  void BrowseExportPath();
80  void Convert();
81  void SLOT_ExportFormatChanged(const QString&);
82  void SLOT_OptionsTriggered();
83 
84 private:
85  Ws::Project* m_project;
86  std::vector<IConverterFormat*> m_formats;
87  std::shared_ptr<SimShell::Ws::MergedPreferences> m_preferences;
88 
89  ConversionList* m_conversion_list;
90  QComboBox* m_export_format;
91  QPushButton* m_options_button;
92  QLineEdit* m_export_path;
93  QLineEdit* m_export_name;
94  QPushButton* m_convert_button;
95 
96  std::map<int, std::vector<std::string>> m_step_to_name_map;
97  std::map<int, std::shared_ptr<Ws::StartupFileBase>> m_step_to_file_map;
98 
99  static const QRegExp g_export_name_regex;
100 };
101 
102 } // namespace
103 
104 #endif // end-of-include-guard
virtual ~ConverterWindow()
Destructor.
Abstraction of project info on filesystem, as well as a maintainer of a work session.
Namespace for SimPT shell package.
Definition: Client.cpp:50
Main widget class for the graphical user interface of the converter.
ConverterWindow(Ws::Project *, std::vector< IConverterFormat * > formats, std::shared_ptr< SimShell::Ws::MergedPreferences > prefs, const std::string &window_title, QWidget *parent=nullptr)
Constructor.
Interface for IConverterFormat.
see the online Qt documentation
Widget containing the list of steps in conversion and associated functionality.
see the online Qt documentation
void Refresh()
Refresh list of input files.