summaryrefslogtreecommitdiffstats
path: root/smtk-import/smrtk2ssrfc_window.h
diff options
context:
space:
mode:
authorGravatar Salvador Cuñat <salvador.cunat@gmail.com>2015-11-08 18:50:05 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-12 07:39:14 -0800
commitddc77845142c19097b5c8094d7601f78719d3e53 (patch)
treec144f5bd37c0cff89c498257f341ceac41907a3a /smtk-import/smrtk2ssrfc_window.h
parentdc4d8f26ece3d11b0931e486c7190813afbfb6f3 (diff)
downloadsubsurface-ddc77845142c19097b5c8094d7601f78719d3e53.tar.gz
SmartTrak import - CLI parser and GUI files
The tool can be called from CLI with or without arguments, if called with a single argument (this is, no destination file specified) an usage message will be displayed on the terminal; if called with arguments, these should be the .slg file(s) to be imported and a single .xml file to store the resulting Subsurface formatted data; if called without arguments a GUI will display to select the file(s) to import and to store. WARNING, if destination file exists, its previous content will be erased. The GUI is pretty simple and don't think any more is needed but, as this is my first QT thing, I expect those with much better knowledge of QT/C++ will improve it as needed. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'smtk-import/smrtk2ssrfc_window.h')
-rw-r--r--smtk-import/smrtk2ssrfc_window.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/smtk-import/smrtk2ssrfc_window.h b/smtk-import/smrtk2ssrfc_window.h
new file mode 100644
index 000000000..8d5ae9027
--- /dev/null
+++ b/smtk-import/smrtk2ssrfc_window.h
@@ -0,0 +1,39 @@
+#ifndef SMRTK2SSRFC_WINDOW_H
+#define SMRTK2SSRFC_WINDOW_H
+
+#include <QMainWindow>
+#include <QFileDialog>
+#include <QFileInfo>
+
+extern "C" void smartrak_import(const char *file, struct dive_table *divetable);
+
+namespace Ui {
+class Smrtk2ssrfcWindow;
+}
+
+class Smrtk2ssrfcWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ explicit Smrtk2ssrfcWindow(QWidget *parent = 0);
+ ~Smrtk2ssrfcWindow();
+
+private:
+ Ui::Smrtk2ssrfcWindow *ui;
+ QString lastUsedDir();
+ QString filter();
+ void updateLastUsedDir(const QString &s);
+ void closeCurrentFile();
+
+private
+slots:
+ void on_inputFilesButton_clicked();
+ void on_outputFileButton_clicked();
+ void on_importButton_clicked();
+ void on_exitButton_clicked();
+ void on_outputLine_textEdited();
+ void on_inputLine_textEdited();
+};
+
+#endif // SMRTK2SSRFC_WINDOW_H