From 53b68cb25c68a15d6eeaa778658861f2bd68c621 Mon Sep 17 00:00:00 2001 From: Zdenek Jonak Date: Thu, 29 Oct 2015 20:18:26 +0100 Subject: [PATCH] Open db dialog --- application/mainwindow.cpp | 7 ++++++- application/mainwindow.ui | 12 +----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/application/mainwindow.cpp b/application/mainwindow.cpp index 309b4ba..7e20127 100644 --- a/application/mainwindow.cpp +++ b/application/mainwindow.cpp @@ -6,6 +6,8 @@ #include #include +#include +#include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), @@ -57,5 +59,8 @@ void MainWindow::openPlugin() void MainWindow::on_actionOpen_database_triggered() { - Context::instance().openDb("/home/jony/db.db"); + QFileDialog dialog(this); + dialog.setNameFilter(tr("Database Files (*.db)")); + dialog.setWindowTitle(tr("Open Database")); + Context::instance().openDb(dialog.getOpenFileName()); } diff --git a/application/mainwindow.ui b/application/mainwindow.ui index 7b13053..7552bc0 100644 --- a/application/mainwindow.ui +++ b/application/mainwindow.ui @@ -29,18 +29,8 @@ QTabWidget::Rounded - 0 + -1 - - - Tab 1 - - - - - Tab 2 - -