1 /* vi: set sw=4 ts=4:
2  *
3  * Copyright (C) 2017 Christian Hohnstaedt.
4  *
5  * All rights reserved.
6  */
7 
8 #ifndef __OPENDB_H
9 #define __OPENDB_H
10 
11 #include "lib/database_model.h"
12 
13 #include "ui_OpenDb.h"
14 #include <QDialog>
15 #include <QSqlDatabase>
16 
17 class OpenDb: public QDialog, public Ui::OpenDb
18 {
19 	Q_OBJECT
20     private:
21 	static DbMap getDatabases();
22 	static QString lastRemote;
23 	bool sqlite, show_connection_settings;
24 	void setupDatabaseName(const QString &db);
25 	QString getDbType() const;
26 	void fillDbDropDown(const QString &current);
27 
28     public:
29 	OpenDb(QWidget *parent, const QString &db);
30 	QString getDescriptor() const;
31 	static bool hasSqLite();
32 	static void checkSqLite();
33 	static bool hasRemoteDrivers();
34 	static void setLastRemote(const QString &db);
35 
36     public slots:
37 	int exec();
38 	void driver_selected();
39 };
40 
41 #endif
42