#ifndef SH_DESIGNERDATABASE_H
#define SH_DESIGNERDATABASE_H

#include <QMainWindow>
#include <QMenu>
#include "core.h"
#include "external_database.h"
#include "ui_database_window.h"


class SHDesignerDatabase: public QMainWindow, public Ui::SHDesignerDatabase {
	Q_OBJECT
public:
	explicit SHDesignerDatabase(QWidget * parent = 0);
	~SHDesignerDatabase();
	
	void show() {reload(false); QWidget::show(); raise();}

	ExternalDatabase ext_db;
	
private:
	void closeEvent(QCloseEvent * );

	QString path_imp, path_exp, last_host;
	
private slots:
	void on_buttonRecreate_clicked();
	void on_buttonResave_clicked() {resave();}
	void on_actionImportFile_triggered();
	void on_actionImportServer_triggered();
	void on_actionExportFile_triggered();
	void on_actionExportServer_triggered();
	void reload(bool emit_changed = true);
	void resave();
	
};

#endif // SH_DESIGNERDATABASE_H
