diff --git a/quickevent/app/quickevent/plugins/Event/src/connectdbdialogwidget.cpp b/quickevent/app/quickevent/plugins/Event/src/connectdbdialogwidget.cpp index 10a8e428f..8882f5216 100644 --- a/quickevent/app/quickevent/plugins/Event/src/connectdbdialogwidget.cpp +++ b/quickevent/app/quickevent/plugins/Event/src/connectdbdialogwidget.cpp @@ -13,6 +13,16 @@ ConnectDbDialogWidget::ConnectDbDialogWidget(QWidget *parent) : setTitle(tr("Data storage setup")); ui->setupUi(this); + ui->btSqlServer->setChecked(true); + ui->dataStorageStackedWidget->setCurrentWidget(ui->pgSqlServer); + connect(ui->btSqlServer, &QAbstractButton::toggled, this, [this](bool checked) { + if(checked) + ui->dataStorageStackedWidget->setCurrentWidget(ui->pgSqlServer); + }); + connect(ui->btSingleFile, &QAbstractButton::toggled, this, [this](bool checked) { + if(checked) + ui->dataStorageStackedWidget->setCurrentWidget(ui->pgSingleFile); + }); } ConnectDbDialogWidget::~ConnectDbDialogWidget() @@ -27,7 +37,7 @@ QString ConnectDbDialogWidget::eventName() Event::EventPlugin::ConnectionType ConnectDbDialogWidget::connectionType() { - if(ui->dataStorageTabWidget->currentIndex() == 0) + if(ui->dataStorageStackedWidget->currentWidget() == ui->pgSqlServer) return Event::EventPlugin::ConnectionType::SqlServer; return Event::EventPlugin::ConnectionType::SingleFile; } @@ -63,10 +73,10 @@ void ConnectDbDialogWidget::loadSettings() ui->edEventName->setText(settings.eventName()); switch(settings.connectionType()) { case Event::EventPlugin::ConnectionType::SqlServer: - ui->dataStorageTabWidget->setCurrentWidget(ui->tabPostgres); + ui->btSqlServer->setChecked(true); break; case Event::EventPlugin::ConnectionType::SingleFile: - ui->dataStorageTabWidget->setCurrentWidget(ui->tabSqlite); + ui->btSingleFile->setChecked(true); break; } ui->edServerHost->setText(settings.serverHost()); @@ -83,7 +93,7 @@ void ConnectDbDialogWidget::saveSettings() ConnectionSettings settings; settings.setEventName(ui->edEventName->text()); auto connection_type = Event::EventPlugin::ConnectionType::SqlServer; - if(ui->dataStorageTabWidget->currentWidget() == ui->tabSqlite) + if(ui->dataStorageStackedWidget->currentWidget() == ui->pgSingleFile) connection_type = Event::EventPlugin::ConnectionType::SingleFile; settings.setConnectionType(connection_type); settings.setServerHost(ui->edServerHost->text()); diff --git a/quickevent/app/quickevent/plugins/Event/src/connectdbdialogwidget.ui b/quickevent/app/quickevent/plugins/Event/src/connectdbdialogwidget.ui index 382d3c3bf..da39f793b 100644 --- a/quickevent/app/quickevent/plugins/Event/src/connectdbdialogwidget.ui +++ b/quickevent/app/quickevent/plugins/Event/src/connectdbdialogwidget.ui @@ -70,12 +70,72 @@ + + + + QFrame::StyledPanel + + + + 3 + + + 3 + + + 3 + + + 3 + + + + + &SQL server + + + true + + + + + + + Single &file + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + Data storage + + true + + + false + + + 3 + 3 @@ -89,14 +149,11 @@ 3 - + 0 - - - S&ql server - + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -108,25 +165,22 @@ 6 - 18 + 3 - 18 + 3 - 18 + 3 - 18 + 3 &Host - - edServerHost - @@ -141,9 +195,6 @@ &Port - - edServerPort - @@ -167,9 +218,6 @@ &User - - edServerUser - @@ -184,9 +232,6 @@ Pa&ssword - - edServerPassword - @@ -201,25 +246,22 @@ - - - Single &file - + - 9 + 6 - 18 + 3 - 18 + 3 - 18 + 3 - 18 + 3 @@ -267,23 +309,6 @@ - - - FIXME - - - - - - will be removed, when https://bugreports.qt.io/browse/QTBUG-114916 will be fixed - - - true - - - - - @@ -294,7 +319,7 @@ edEventName - dataStorageTabWidget + dataStorageStackedWidget edServerHost edServerPort edServerUser diff --git a/quickevent/app/quickevent/src/appversion.h b/quickevent/app/quickevent/src/appversion.h index 9421e8d00..a006644d4 100644 --- a/quickevent/app/quickevent/src/appversion.h +++ b/quickevent/app/quickevent/src/appversion.h @@ -1,4 +1,4 @@ #pragma once -#define APP_VERSION "3.0.2" +#define APP_VERSION "3.0.3"