diff options
| author | 2018-07-27 23:54:15 -0400 | |
|---|---|---|
| committer | 2018-07-27 23:54:15 -0400 | |
| commit | 6d3d39356473078c6b47e03b8a7616e4b34de928 (patch) | |
| tree | fe5be2e6a08e4cfc73207746aba4c9fccfecfa10 /SQLiteStudio3/guiSQLiteStudio/dialogs | |
| parent | f98e49169a40876bcf1df832de6e908d1b350193 (diff) | |
| parent | feda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff) | |
Update upstream source from tag 'upstream/3.2.1+dfsg1'
Update to upstream version '3.2.1+dfsg1'
with Debian dir 5ea0333565de4dc898c062cc0ff4ba1153e2c1e4
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/dialogs')
33 files changed, 974 insertions, 752 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/aboutdialog.ui b/SQLiteStudio3/guiSQLiteStudio/dialogs/aboutdialog.ui index 179ee3b..16a6e1f 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/aboutdialog.ui +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/aboutdialog.ui @@ -17,7 +17,7 @@ <item row="0" column="1"> <widget class="QTabWidget" name="tabWidget"> <property name="currentIndex"> - <number>2</number> + <number>0</number> </property> <widget class="QWidget" name="about"> <attribute name="title"> @@ -27,7 +27,7 @@ <item> <widget class="QLabel" name="aboutLabel"> <property name="text"> - <string><html><head/><body><p align="center"><span style=" font-size:11pt; font-weight:600;">SQLiteStudio v%1</span></p><p align="center">Free, open-source, cross-platform SQLite database manager.<br/><a href="http://sqlitestudio.pl"><span style=" text-decoration: underline; color:#0000ff;">http://sqlitestudio.pl</span></a><br/></p><p align="center">%2<br/></p><p align="center">Author and active maintainer:<br/>SalSoft (<a href="http://salsoft.com.pl"><span style=" text-decoration: underline; color:#0000ff;">http://salsoft.com.pl</span></a>)<br/></p></body></html></string> + <string><html><head/><body><p align="center"><span style=" font-size:11pt; font-weight:600;">SQLiteStudio v%1</span></p><p align="center">Free, open-source, cross-platform SQLite database manager.<br/><a href="https://sqlitestudio.pl"><span style=" text-decoration: underline; color:#0000ff;">https://sqlitestudio.pl</span></a><br/></p><p align="center">%2<br/></p><p align="center">Author and active maintainer:<br/>SalSoft (<a href="https://salsoft.com.pl"><span style=" text-decoration: underline; color:#0000ff;">https://salsoft.com.pl</span></a>)<br/></p></body></html></string> </property> <property name="openExternalLinks"> <bool>true</bool> diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/bindparamsdialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/bindparamsdialog.cpp new file mode 100644 index 0000000..1d7ba66 --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/bindparamsdialog.cpp @@ -0,0 +1,133 @@ +#include "bindparamsdialog.h" +#include "ui_bindparamsdialog.h" +#include "common/bindparam.h" +#include "multieditor/multieditor.h" +#include "widgetresizer.h" +#include "services/pluginmanager.h" +#include "multieditor/multieditorwidgetplugin.h" +#include "multieditor/multieditorwidget.h" +#include <QDebug> + +BindParamsDialog::BindParamsDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::BindParamsDialog) +{ + init(); +} + +BindParamsDialog::~BindParamsDialog() +{ + delete ui; +} + +void BindParamsDialog::setBindParams(const QVector<BindParam*>& params) +{ + bindParams = params; + initEditors(); +} + +void BindParamsDialog::init() +{ + ui->setupUi(this); + + contents = new QWidget(); + QVBoxLayout *contentsLayout = new QVBoxLayout(); + contentsLayout->setSpacing(spacing); + contentsLayout->setMargin(margins); + contentsLayout->setAlignment(Qt::AlignTop); + contents->setLayout(contentsLayout); + + ui->scrollArea->setWidget(contents); + ui->scrollArea->setAlignment(Qt::AlignTop); +} + +void BindParamsDialog::initEditors() +{ + QStringList paramNames; + for (BindParam* param : bindParams) + paramNames << param->originalName; + + MultiEditor* firstEditor = nullptr; + MultiEditor* multiEditor = nullptr; + QVector<QPair<QString, QVariant>> paramHistory = CFG->getBindParamHistory(paramNames); + for (BindParam* param : bindParams) + { + multiEditor = initEditor(param, paramHistory.size() > param->position ? paramHistory[param->position].second : QVariant()); + if (firstEditor == nullptr) + firstEditor = multiEditor; + } + + firstEditor->focusThisEditor(); +} + +MultiEditor* BindParamsDialog::initEditor(BindParam* param, const QVariant& cachedValue) +{ + // Label + static_qstring(nameTpl, "[%1] %2"); + QString label = nameTpl.arg(param->position + 1).arg(param->originalName); + + // MultiEditor + MultiEditor* multiEditor = new MultiEditor(this, MultiEditor::DYNAMIC); + multiEditor->setReadOnly(false); + multiEditor->setCornerLabel(label); + contents->layout()->addWidget(multiEditor); + contents->layout()->setAlignment(multiEditor, Qt::AlignTop); + editors[param] = multiEditor; + + // MultiEditor editors + MultiEditorWidgetPlugin* plugin = dynamic_cast<MultiEditorWidgetPlugin*>(PLUGINS->getLoadedPlugin("MultiEditorNumericPlugin")); + MultiEditorWidget* editor = plugin->getInstance(); + editor->setTabLabel(plugin->getTabLabel()); + multiEditor->addEditor(editor); + + plugin = dynamic_cast<MultiEditorWidgetPlugin*>(PLUGINS->getLoadedPlugin("MultiEditorTextPlugin")); + editor = plugin->getInstance(); + editor->setTabLabel(plugin->getTabLabel()); + multiEditor->addEditor(editor); + + // Resizer + WidgetResizer* resizer = new WidgetResizer(Qt::Vertical); + resizer->setWidget(multiEditor); + resizer->setWidgetMinimumSize(0, minimumFieldHeight); + contents->layout()->addWidget(resizer); + resizer->minimizeHeight(); + + if (cachedValue.isValid()) + { + switch (cachedValue.type()) + { + case QVariant::LongLong: + case QVariant::ULongLong: + case QVariant::Int: + case QVariant::UInt: + case QVariant::Double: + multiEditor->showTab(0); + break; + default: + multiEditor->showTab(1); + break; + } + + multiEditor->setValue(cachedValue); + } + + return multiEditor; +} + +void BindParamsDialog::accept() +{ + QVector<QPair<QString, QVariant>> paramHistory; + paramHistory.reserve(bindParams.size()); + bool rememberValue = false; + QVariant emptyValue; + for (BindParam* param : bindParams) + { + param->value = editors[param]->getValue(); + rememberValue = (param->value.type() != QVariant::ByteArray || param->value.toByteArray().size() <= 102400); + paramHistory << QPair<QString, QVariant>(param->originalName, rememberValue ? param->value : emptyValue); + } + + CFG->addBindParamHistory(paramHistory); + + QDialog::accept(); +} diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/bindparamsdialog.h b/SQLiteStudio3/guiSQLiteStudio/dialogs/bindparamsdialog.h new file mode 100644 index 0000000..666ffc4 --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/bindparamsdialog.h @@ -0,0 +1,41 @@ +#ifndef BINDPARAMSDIALOG_H +#define BINDPARAMSDIALOG_H + +#include <QDialog> + +namespace Ui { + class BindParamsDialog; +} + +struct BindParam; +class MultiEditor; + +class BindParamsDialog : public QDialog +{ + Q_OBJECT + + public: + explicit BindParamsDialog(QWidget *parent = nullptr); + ~BindParamsDialog(); + + void setBindParams(const QVector<BindParam*>& params); + + private: + void init(); + void initEditors(); + MultiEditor* initEditor(BindParam* param, const QVariant& cachedValue); + + static const int margins = 2; + static const int spacing = 2; + static const int minimumFieldHeight = 80; + + Ui::BindParamsDialog *ui; + QVector<BindParam*> bindParams; + QHash<BindParam*, MultiEditor*> editors; + QWidget* contents = nullptr; + + public slots: + void accept(); +}; + +#endif // BINDPARAMSDIALOG_H diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/bindparamsdialog.ui b/SQLiteStudio3/guiSQLiteStudio/dialogs/bindparamsdialog.ui new file mode 100644 index 0000000..b6af05a --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/bindparamsdialog.ui @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>BindParamsDialog</class> + <widget class="QDialog" name="BindParamsDialog"> + <property name="windowModality"> + <enum>Qt::WindowModal</enum> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>576</width> + <height>420</height> + </rect> + </property> + <property name="windowTitle"> + <string>Query parameters</string> + </property> + <property name="modal"> + <bool>true</bool> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Please provide values for query parameters</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item> + <widget class="QScrollArea" name="scrollArea"> + <property name="widgetResizable"> + <bool>true</bool> + </property> + <widget class="QWidget" name="scrollAreaWidgetContents"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>556</width> + <height>352</height> + </rect> + </property> + </widget> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Abort|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>BindParamsDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>BindParamsDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugdialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/bugdialog.cpp deleted file mode 100644 index 59a2ec6..0000000 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugdialog.cpp +++ /dev/null @@ -1,219 +0,0 @@ -#include "bugdialog.h" -#include "ui_bugdialog.h" -#include "iconmanager.h" -#include "uiutils.h" -#include "common/utils.h" -#include "sqlitestudio.h" -#include "mainwindow.h" -#include "bugreportlogindialog.h" -#include "services/pluginmanager.h" -#include "services/bugreporter.h" -#include "services/notifymanager.h" -#include <QPushButton> -#include <QDebug> -#include <QDesktopServices> - -BugDialog::BugDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::BugDialog) -{ - init(); -} - -BugDialog::~BugDialog() -{ - delete ui; -} - -void BugDialog::setFeatureRequestMode(bool feature) -{ - bugMode = !feature; - updateState(); -} - -void BugDialog::init() -{ - ui->setupUi(this); - resize(width(), height() - 50); - - ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Send")); - - connect(ui->moreDetailsGroup, SIGNAL(toggled(bool)), this, SLOT(updateState())); - connect(ui->shortDescriptionEdit, SIGNAL(textChanged(QString)), this, SLOT(validate())); - connect(ui->longDescriptionEdit, SIGNAL(textChanged()), this, SLOT(validate())); - connect(ui->emailEdit, SIGNAL(textChanged(QString)), this, SLOT(validate())); - connect(ui->helpButton, SIGNAL(clicked()), this, SLOT(help())); - connect(ui->loginButton, SIGNAL(clicked()), this, SLOT(logIn())); - - ui->versionEdit->setText(SQLITESTUDIO->getVersionString()); - ui->osEdit->setText(getOsString()); - ui->pluginsEdit->setText(PLUGINS->getLoadedPluginNames().join(", ")); - - user = CFG_CORE.Internal.BugReportUser.get(); - - if (CFG_CORE.Internal.BugReportRecentError.get()) - { - ui->shortDescriptionEdit->setText(CFG_CORE.Internal.BugReportRecentTitle.get()); - ui->longDescriptionEdit->setPlainText(CFG_CORE.Internal.BugReportRecentContents.get()); - } - - updateState(); - validate(); -} - -QString BugDialog::getMessageAboutReportHistory() -{ - return tr("You can see all your reported bugs and ideas by selecting menu '%1' and then '%2'.").arg(MAINWINDOW->getSQLiteStudioMenu()->title()) - .arg(MAINWINDOW->getAction(MainWindow::BUG_REPORT_HISTORY)->text()); -} - -void BugDialog::finishedBugReport(bool success, const QString& errorMsg) -{ - if (success) - { - notifyInfo(tr("A bug report sent successfully.") + " " + getMessageAboutReportHistory()); - } - else - { - CFG_CORE.Internal.BugReportRecentError.set(true); - notifyError(tr("An error occurred while sending a bug report: %1\n%2").arg(errorMsg, - tr("You can retry sending. The contents will be restored when you open a report dialog after an error like this."))); - } -} - -void BugDialog::finishedFeatureRequest(bool success, const QString& errorMsg) -{ - if (success) - { - notifyInfo(tr("An idea proposal sent successfully.") + " " + getMessageAboutReportHistory()); - } - else - { - CFG_CORE.Internal.BugReportRecentError.set(true); - notifyError(tr("An error occurred while sending an idea proposal: %1\n%2").arg(errorMsg, - tr("You can retry sending. The contents will be restored when you open a report dialog after an error like this."))); - } -} - -void BugDialog::updateState() -{ - ui->scrollArea->setVisible(ui->moreDetailsGroup->isChecked()); - - ui->moreDetailsGroup->setVisible(bugMode); - if (bugMode) - { - setWindowTitle(tr("A bug report")); - ui->shortDescriptionEdit->setPlaceholderText(tr("Describe problem in few words")); - ui->longDescriptionEdit->setPlaceholderText(tr("Describe problem and how to reproduce it")); - } - else - { - setWindowTitle(tr("A new feature idea")); - ui->shortDescriptionEdit->setPlaceholderText(tr("A title for your idea")); - ui->longDescriptionEdit->setPlaceholderText(tr("Describe your idea in more details")); - } - - if (user.isNull()) - { - ui->currentLoginLabel->setToolTip(tr("Reporting as an unregistered user, using e-mail address.")); - ui->currentLoginLabel->setPixmap(ICONS.USER_UNKNOWN); - ui->emailEdit->setEnabled(true); - ui->loginButton->setText(tr("Log in")); - ui->loginButton->setIcon(ICONS.USER); - validate(); - } - else - { - ui->currentLoginLabel->setToolTip(tr("Reporting as a registered user.")); - ui->currentLoginLabel->setPixmap(ICONS.USER); - ui->emailEdit->setText(user); - ui->emailEdit->setEnabled(false); - ui->loginButton->setText(tr("Log out")); - ui->loginButton->setIcon(ICONS.USER_UNKNOWN); - } -} - -void BugDialog::validate() -{ - bool emailOk = !user.isNull() || validateEmail(ui->emailEdit->text()); - int shortSize = ui->shortDescriptionEdit->text().trimmed().size(); - int longSize = ui->longDescriptionEdit->toPlainText().trimmed().size(); - bool shortOk = shortSize >= 10 && shortSize <= 100; - bool longOk = longSize >= 30; - - setValidStateWihtTooltip(ui->emailEdit, tr("Providing true email address will make it possible to contact you regarding your report. " - "To learn more, press 'help' button on the right side."), - emailOk, tr("Enter vaild e-mail address, or log in.")); - - setValidState(ui->shortDescriptionEdit, shortOk, tr("Short description requires at least 10 characters, but not more than 100. " - "Longer description can be entered in the field below.")); - - setValidState(ui->longDescriptionEdit, longOk, tr("Long description requires at least 30 characters.")); - - bool valid = shortOk && longOk && emailOk; - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(valid); -} - -void BugDialog::help() -{ - if (user.isNull()) - QDesktopServices::openUrl(QUrl(BUGS->getReporterEmailHelpUrl())); - else - QDesktopServices::openUrl(QUrl(BUGS->getReporterUserAndPasswordHelpUrl())); -} - -void BugDialog::logIn() -{ - if (!user.isNull()) - { - // Log out - user = QString(); - updateState(); - BUGS->clearBugReportCredentials(); - return; - } - - BugReportLoginDialog dialog(this); - if (dialog.exec() != QDialog::Accepted) - return; - - if (!dialog.isValid()) - return; - - BUGS->useBugReportCredentials(dialog.getLogin(), dialog.getPassword()); - user = dialog.getLogin(); - updateState(); -} - -void BugDialog::accept() -{ - CFG_CORE.Internal.BugReportRecentError.set(false); - CFG_CORE.Internal.BugReportRecentTitle.set(ui->shortDescriptionEdit->text()); - CFG_CORE.Internal.BugReportRecentContents.set(ui->longDescriptionEdit->toPlainText()); - - if (bugMode) - { - if (user.isNull()) - { - BUGS->reportBug(ui->emailEdit->text(), ui->shortDescriptionEdit->text(), ui->longDescriptionEdit->toPlainText(), ui->versionEdit->text(), - ui->osEdit->text(), ui->pluginsEdit->text(), BugDialog::finishedBugReport); - } - else - { - BUGS->reportBug(ui->shortDescriptionEdit->text(), ui->longDescriptionEdit->toPlainText(), ui->versionEdit->text(), ui->osEdit->text(), ui->pluginsEdit->text(), - BugDialog::finishedFeatureRequest); - } - } - else - { - if (user.isNull()) - { - BUGS->requestFeature(ui->emailEdit->text(), ui->shortDescriptionEdit->text(), ui->longDescriptionEdit->toPlainText(), BugDialog::finishedFeatureRequest); - } - else - { - BUGS->requestFeature(ui->shortDescriptionEdit->text(), ui->longDescriptionEdit->toPlainText(), BugDialog::finishedFeatureRequest); - } - } - QDialog::accept(); -} diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugdialog.h b/SQLiteStudio3/guiSQLiteStudio/dialogs/bugdialog.h deleted file mode 100644 index bf60104..0000000 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugdialog.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef BUGDIALOG_H -#define BUGDIALOG_H - -#include "guiSQLiteStudio_global.h" -#include <QDialog> - -namespace Ui { - class BugDialog; -} - -class GUI_API_EXPORT BugDialog : public QDialog -{ - Q_OBJECT - - public: - explicit BugDialog(QWidget *parent = 0); - ~BugDialog(); - - void setFeatureRequestMode(bool feature); - - private: - void init(); - - static QString getMessageAboutReportHistory(); - static void finishedBugReport(bool success, const QString& errorMsg); - static void finishedFeatureRequest(bool success, const QString& errorMsg); - - Ui::BugDialog *ui = nullptr; - bool bugMode = true; - QString user; - - private slots: - void updateState(); - void validate(); - void help(); - void logIn(); - - public slots: - void accept(); -}; - -#endif // BUGDIALOG_H diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugdialog.ui b/SQLiteStudio3/guiSQLiteStudio/dialogs/bugdialog.ui deleted file mode 100644 index 3871436..0000000 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugdialog.ui +++ /dev/null @@ -1,208 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>BugDialog</class> - <widget class="QDialog" name="BugDialog"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>516</width> - <height>421</height> - </rect> - </property> - <property name="windowTitle"> - <string>Bugs and ideas</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QGroupBox" name="reporterGroup"> - <property name="title"> - <string>Reporter</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLabel" name="currentLoginLabel"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../icons.qrc">:/icons/img/user_unknown.png</pixmap> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="emailEdit"> - <property name="placeholderText"> - <string>E-mail address</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="loginButton"> - <property name="text"> - <string>Log in</string> - </property> - <property name="icon"> - <iconset resource="../icons.qrc"> - <normaloff>:/icons/img/user.png</normaloff>:/icons/img/user.png</iconset> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="helpButton"> - <property name="text"> - <string notr="true">...</string> - </property> - <property name="icon"> - <iconset resource="../icons.qrc"> - <normaloff>:/icons/img/help.png</normaloff>:/icons/img/help.png</iconset> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="shortDescriptionGroup"> - <property name="title"> - <string>Short description</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QLineEdit" name="shortDescriptionEdit"/> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="longDescriptionGroup"> - <property name="title"> - <string>Detailed description</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <widget class="QPlainTextEdit" name="longDescriptionEdit"/> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="moreDetailsGroup"> - <property name="title"> - <string>Show more details</string> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="checked"> - <bool>false</bool> - </property> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <widget class="QScrollArea" name="scrollArea"> - <property name="widgetResizable"> - <bool>true</bool> - </property> - <widget class="QWidget" name="scrollContents"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>462</width> - <height>209</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout_8"> - <item> - <widget class="QGroupBox" name="versionGroup"> - <property name="title"> - <string>SQLiteStudio version</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <item> - <widget class="QLineEdit" name="versionEdit"/> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="osGroup"> - <property name="title"> - <string>Operating system</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <item> - <widget class="QLineEdit" name="osEdit"/> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="pluginsGroup"> - <property name="title"> - <string>Loaded plugins</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_7"> - <item> - <widget class="QLineEdit" name="pluginsEdit"/> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> - </property> - </widget> - </item> - </layout> - </widget> - <resources> - <include location="../icons.qrc"/> - </resources> - <connections> - <connection> - <sender>buttonBox</sender> - <signal>accepted()</signal> - <receiver>BugDialog</receiver> - <slot>accept()</slot> - <hints> - <hint type="sourcelabel"> - <x>248</x> - <y>254</y> - </hint> - <hint type="destinationlabel"> - <x>157</x> - <y>274</y> - </hint> - </hints> - </connection> - <connection> - <sender>buttonBox</sender> - <signal>rejected()</signal> - <receiver>BugDialog</receiver> - <slot>reject()</slot> - <hints> - <hint type="sourcelabel"> - <x>316</x> - <y>260</y> - </hint> - <hint type="destinationlabel"> - <x>286</x> - <y>274</y> - </hint> - </hints> - </connection> - </connections> -</ui> diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.cpp deleted file mode 100644 index 19727fe..0000000 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "bugreportlogindialog.h" -#include "ui_bugreportlogindialog.h" -#include "uiutils.h" -#include "services/bugreporter.h" -#include "iconmanager.h" -#include "common/widgetcover.h" -#include <QPushButton> - -BugReportLoginDialog::BugReportLoginDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::BugReportLoginDialog) -{ - init(); -} - -BugReportLoginDialog::~BugReportLoginDialog() -{ - delete ui; -} - -bool BugReportLoginDialog::isValid() const -{ - return validCredentials; -} - -QString BugReportLoginDialog::getLogin() const -{ - return ui->loginEdit->text(); -} - -QString BugReportLoginDialog::getPassword() const -{ - return ui->passwordEdit->text(); -} - -void BugReportLoginDialog::init() -{ - ui->setupUi(this); - connect(ui->loginEdit, SIGNAL(textChanged(QString)), this, SLOT(credentialsChanged())); - connect(ui->passwordEdit, SIGNAL(textChanged(QString)), this, SLOT(credentialsChanged())); - connect(ui->validationButton, SIGNAL(clicked()), this, SLOT(remoteValidation())); - connect(BUGS, SIGNAL(credentialsValidationResult(bool,QString)), this, SLOT(remoteValidationResult(bool,QString))); - - widgetCover = new WidgetCover(this); - widgetCover->initWithInterruptContainer(tr("Abort")); - connect(widgetCover, SIGNAL(cancelClicked()), this, SLOT(abortRemoteValidation())); - - validate(); -} - -void BugReportLoginDialog::credentialsChanged() -{ - validCredentials = false; - validate(); -} - -void BugReportLoginDialog::validate() -{ - QString login = ui->loginEdit->text(); - QString pass = ui->passwordEdit->text(); - - bool loginOk = login.size() >= 2; - bool passOk = pass.size() >= 5; - - setValidState(ui->loginEdit, loginOk, tr("A login must be at least 2 characters long.")); - setValidState(ui->passwordEdit, passOk, tr("A password must be at least 5 characters long.")); - - bool credentialsOk = loginOk && passOk; - ui->validationButton->setEnabled(credentialsOk); - ui->validationLabel->setEnabled(credentialsOk); - - bool valid = credentialsOk && validCredentials; - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(valid); -} - -void BugReportLoginDialog::abortRemoteValidation() -{ - BUGS->abortCredentialsValidation(); -} - -void BugReportLoginDialog::remoteValidation() -{ - widgetCover->show(); - BUGS->validateBugReportCredentials(ui->loginEdit->text(), ui->passwordEdit->text()); -} - -void BugReportLoginDialog::remoteValidationResult(bool success, const QString& errorMessage) -{ - validCredentials = success; - ui->validationButton->setIcon(success ? ICONS.TEST_CONN_OK : ICONS.TEST_CONN_ERROR); - ui->validationLabel->setText(success ? tr("Valid") : errorMessage); - validate(); - widgetCover->hide(); -} diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.h b/SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.h deleted file mode 100644 index 131ba3d..0000000 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef BUGREPORTLOGINDIALOG_H -#define BUGREPORTLOGINDIALOG_H - -#include "guiSQLiteStudio_global.h" -#include <QDialog> - -namespace Ui { - class BugReportLoginDialog; -} - -class WidgetCover; - -class GUI_API_EXPORT BugReportLoginDialog : public QDialog -{ - Q_OBJECT - - public: - explicit BugReportLoginDialog(QWidget *parent = 0); - ~BugReportLoginDialog(); - - bool isValid() const; - QString getLogin() const; - QString getPassword() const; - - private: - void init(); - - Ui::BugReportLoginDialog *ui = nullptr; - bool validCredentials = false; - WidgetCover* widgetCover = nullptr; - - private slots: - void credentialsChanged(); - void validate(); - void abortRemoteValidation(); - void remoteValidation(); - void remoteValidationResult(bool success, const QString& errorMessage); -}; - -#endif // BUGREPORTLOGINDIALOG_H diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/columndialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/columndialog.cpp index 14cb06b..8bf1698 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/columndialog.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/columndialog.cpp @@ -37,7 +37,7 @@ void ColumnDialog::init() ui->precision->setStrict(true, true); ui->typeCombo->addItem(""); - foreach (DataType::Enum type, DataType::getAllTypes()) + for (DataType::Enum type : DataType::getAllTypes()) ui->typeCombo->addItem(DataType::toString(type)); connect(ui->typeCombo, SIGNAL(currentTextChanged(QString)), this, SLOT(updateDataType())); @@ -149,6 +149,7 @@ void ColumnDialog::addConstraint(ConstraintDialog::Constraint mode) constraintsModel->appendConstraint(constr); ui->constraintsView->resizeColumnToContents(0); ui->constraintsView->resizeColumnToContents(1); + updateTypeForAutoIncr(); } void ColumnDialog::setupConstraintCheckBoxes() @@ -218,6 +219,7 @@ void ColumnDialog::editConstraint(SqliteCreateTable::Column::Constraint* constra ui->constraintsView->resizeColumnToContents(0); ui->constraintsView->resizeColumnToContents(1); updateValidations(); + updateTypeForAutoIncr(); } void ColumnDialog::delConstraint(const QModelIndex& idx) @@ -384,6 +386,8 @@ void ColumnDialog::updateTypeValidations() { QString scaleErrorMsg = tr("Scale is not allowed for INTEGER PRIMARY KEY columns."); QString precisionErrorMsg = tr("Precision cannot be defined without the scale."); + QString typeErrorMsg = tr("Cannot use type other than INTEGER if AUTOINCREMENT is enabled in PRIMARY KEY."); + QString integerEnforcedMsg = tr("INTEGER type was enforced due to enabled AUTOINCREMENT in PRIMARY KEY."); QVariant scale = ui->scale->getValue(); QVariant precision = ui->precision->getValue(); @@ -393,6 +397,7 @@ void ColumnDialog::updateTypeValidations() bool precisionOk = !(precisionDefined && !scaleDefined); bool scaleOk = true; + bool typeOk = true; bool hasPk = column->getConstraint(SqliteCreateTable::Column::Constraint::PRIMARY_KEY) != nullptr; bool isInteger = ui->typeCombo->currentText().toUpper() == "INTEGER"; @@ -408,16 +413,48 @@ void ColumnDialog::updateTypeValidations() } } + if (!isInteger && hasAutoIncr()) + typeOk = false; + setValidState(ui->scale, scaleOk, scaleErrorMsg); setValidState(ui->precision, precisionOk, precisionErrorMsg); + setValidState(ui->typeCombo, typeOk, typeErrorMsg); + + if (typeOk && integerTypeEnforced) + setValidStateTooltip(ui->typeCombo, integerEnforcedMsg); - if (!scaleOk || !precisionOk) + if (!scaleOk || !precisionOk || !typeOk) { QPushButton* btn = ui->buttonBox->button(QDialogButtonBox::Ok); btn->setEnabled(false); } } +void ColumnDialog::updateTypeForAutoIncr() +{ + bool hasAuto = hasAutoIncr(); + if (hasAuto && ui->typeCombo->currentText().toUpper() != "INTEGER") + { + ui->typeCombo->setCurrentText("INTEGER"); + integerTypeEnforced = true; + } + else if (!hasAuto) + integerTypeEnforced = false; + + updateTypeValidations(); +} + +bool ColumnDialog::hasAutoIncr() const +{ + for (SqliteCreateTable::Column::Constraint* constr : column->getConstraints(SqliteCreateTable::Column::Constraint::PRIMARY_KEY)) + { + if (constr->autoincrKw) + return true; + } + + return false; +} + void ColumnDialog::moveConstraintUp() { QModelIndex idx = ui->constraintsView->currentIndex(); @@ -509,6 +546,7 @@ void ColumnDialog::configureDefault() void ColumnDialog::pkToggled(bool enabled) { constraintToggled(SqliteCreateTable::Column::Constraint::PRIMARY_KEY, enabled); + updateTypeForAutoIncr(); } void ColumnDialog::fkToggled(bool enabled) @@ -630,6 +668,7 @@ void ColumnDialog::updateDataType() if (!column) return; + integerTypeEnforced = false; QString typeTxt = ui->typeCombo->currentText(); QString scaleTxt = ui->scale->getValue().toString(); QString precisionTxt = ui->precision->getValue().toString(); diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/columndialog.h b/SQLiteStudio3/guiSQLiteStudio/dialogs/columndialog.h index 596441c..47615e8 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/columndialog.h +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/columndialog.h @@ -68,12 +68,15 @@ class GUI_API_EXPORT ColumnDialog : public QDialog, public ExtActionContainer QToolButton* getToolButtonForConstraint(SqliteCreateTable::Column::Constraint* constraint); bool isUnofficialSqlite2Constraint(SqliteCreateTable::Column::Constraint* constraint); void updateTypeValidations(); + void updateTypeForAutoIncr(); + bool hasAutoIncr() const; Ui::ColumnDialog *ui = nullptr; SqliteCreateTable::ColumnPtr column; ColumnDialogConstraintsModel* constraintsModel = nullptr; QCheckBox* modeCheckBox = nullptr; Db* db = nullptr; + bool integerTypeEnforced = false; private slots: void updateConstraintsToolbarState(); diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.cpp index 85ae12d..63af58a 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.cpp @@ -63,7 +63,7 @@ ConfigDialog::~ConfigDialog() // Notify plugins about dialog being closed
UiConfiguredPlugin* cfgPlugin = nullptr;
- foreach (Plugin* plugin, PLUGINS->getLoadedPlugins())
+ for (Plugin* plugin : PLUGINS->getLoadedPlugins())
{
cfgPlugin = dynamic_cast<UiConfiguredPlugin*>(plugin);
if (!cfgPlugin)
@@ -133,7 +133,7 @@ QString ConfigDialog::getFilterString(QTreeWidget *widget) {
QList<QTreeWidgetItem*> items = widget->findItems("*", Qt::MatchWildcard|Qt::MatchRecursive);
QStringList strList;
- foreach (QTreeWidgetItem* item, items)
+ for (QTreeWidgetItem* item : items)
for (int i = 0; i < widget->columnCount(); i++)
strList << item->text(i) + " " + item->toolTip(0);
@@ -144,7 +144,7 @@ QString ConfigDialog::getFilterString(QListWidget *widget) {
QList<QListWidgetItem*> items = widget->findItems("*", Qt::MatchWildcard|Qt::MatchRecursive);
QStringList strList;
- foreach (QListWidgetItem* item, items)
+ for (QListWidgetItem* item : items)
strList << item->text() + " " + item->toolTip();
return strList.join(" ");
@@ -154,7 +154,7 @@ QString ConfigDialog::getFilterString(QTableWidget *widget) {
QList<QTableWidgetItem*> items = widget->findItems("*", Qt::MatchWildcard|Qt::MatchRecursive);
QStringList strList;
- foreach (QTableWidgetItem* item, items)
+ for (QTableWidgetItem* item : items)
strList << item->text() + " " + item->toolTip();
return strList.join(" ");
@@ -299,7 +299,7 @@ void ConfigDialog::applyFilter(const QString &filter) QColor disabledColor = ui->categoriesTree->palette().color(QPalette::Disabled, QPalette::WindowText);
if (filter.isEmpty())
{
- foreach (QTreeWidgetItem* item, getAllCategoryItems())
+ for (QTreeWidgetItem* item : getAllCategoryItems())
item->setForeground(0, normalColor);
return;
@@ -307,7 +307,7 @@ void ConfigDialog::applyFilter(const QString &filter) QList<QWidget*> widgets = ui->stackedWidget->findChildren<QWidget*>();
QList<QWidget*> matchedWidgets;
- foreach (QWidget* widget, widgets)
+ for (QWidget* widget : widgets)
{
if (getFilterString(widget).contains(filter, Qt::CaseInsensitive))
matchedWidgets << widget;
@@ -315,9 +315,9 @@ void ConfigDialog::applyFilter(const QString &filter) QHash<QWidget*, QTreeWidgetItem*> pageToCategoryItem = buildPageToCategoryItemMap();
QSet<QTreeWidgetItem*> matchedCategories;
- foreach (QWidget* page, pageToCategoryItem.keys())
+ for (QWidget* page : pageToCategoryItem.keys())
{
- foreach (QWidget* matched, matchedWidgets)
+ for (QWidget* matched : matchedWidgets)
{
if (page->isAncestorOf(matched))
{
@@ -333,10 +333,10 @@ void ConfigDialog::applyFilter(const QString &filter) }
}
- foreach (QTreeWidgetItem* item, getAllCategoryItems())
+ for (QTreeWidgetItem* item : getAllCategoryItems())
item->setForeground(0, disabledColor);
- foreach (QTreeWidgetItem* item, matchedCategories)
+ for (QTreeWidgetItem* item : matchedCategories)
{
item->setForeground(0, normalColor);
while ((item = item->parent()) != nullptr)
@@ -347,7 +347,7 @@ void ConfigDialog::applyFilter(const QString &filter) QHash<QWidget*, QTreeWidgetItem*> ConfigDialog::buildPageToCategoryItemMap() const
{
QHash<QString,QTreeWidgetItem*> pageNameToCategoryItem;
- foreach (QTreeWidgetItem* item, getAllCategoryItems())
+ for (QTreeWidgetItem* item : getAllCategoryItems())
pageNameToCategoryItem[item->statusTip(0)] = item;
QWidget* page = nullptr;
@@ -486,7 +486,14 @@ void ConfigDialog::addDataTypeEditor(const QString& pluginName) void ConfigDialog::addDataTypeEditor(MultiEditorWidgetPlugin* plugin)
{
MultiEditorWidget* editor = plugin->getInstance();
+ editor->setTabLabel(plugin->getTabLabel());
ui->dataEditorsSelectedTabs->addTab(editor, editor->getTabLabel().replace("&", "&&"));
+
+ connect(editor, &MultiEditorWidget::aboutToBeDeleted, [this, editor]()
+ {
+ int idx = ui->dataEditorsSelectedTabs->indexOf(editor);
+ ui->dataEditorsSelectedTabs->removeTab(idx);
+ });
}
void ConfigDialog::removeDataTypeEditor(QListWidgetItem* item, const QString& pluginName)
@@ -704,7 +711,7 @@ void ConfigDialog::delDataType() void ConfigDialog::dataTypesHelp()
{
- static const QString url = QStringLiteral("http://wiki.sqlitestudio.pl/index.php/User_Manual#Customizing_data_type_editors");
+ static const QString url = QStringLiteral("https://github.com/pawelsalawa/sqlitestudio/wiki/User_Manual#customizing-data-type-editors");
QDesktopServices::openUrl(QUrl(url, QUrl::StrictMode));
}
@@ -1085,7 +1092,7 @@ void ConfigDialog::refreshFormattersPage() void ConfigDialog::applyStyle(QWidget *widget, QStyle *style)
{
widget->setStyle(style);
- foreach (QObject* child, widget->children())
+ for (QObject* child : widget->children())
{
if (!qobject_cast<QWidget*>(child))
continue;
@@ -1184,7 +1191,7 @@ void ConfigDialog::initPlugins() // Recreate
QTreeWidgetItem *typeItem = nullptr;
- foreach (PluginType* pluginType, PLUGINS->getPluginTypes())
+ for (PluginType* pluginType : PLUGINS->getPluginTypes())
{
typeItem = createPluginsTypeItem(pluginType->getConfigUiForm(), pluginType->getTitle());
if (!typeItem)
@@ -1193,7 +1200,7 @@ void ConfigDialog::initPlugins() item->addChild(typeItem);
pluginTypeToItemMap[pluginType] = typeItem;
- foreach (Plugin* plugin, pluginType->getLoadedPlugins())
+ for (Plugin* plugin : pluginType->getLoadedPlugins())
pluginLoaded(plugin, pluginType, true);
}
@@ -1244,7 +1251,7 @@ void ConfigDialog::initPluginsPage() categoryRow = 0;
QList<PluginType*> pluginTypes = PLUGINS->getPluginTypes();
qSort(pluginTypes.begin(), pluginTypes.end(), PluginType::nameLessThan);
- foreach (PluginType* pluginType, pluginTypes)
+ for (PluginType* pluginType : pluginTypes)
{
category = new QTreeWidgetItem({pluginType->getTitle()});
font.setItalic(false);
@@ -1264,7 +1271,7 @@ void ConfigDialog::initPluginsPage() itemRow = 0;
pluginNames = pluginType->getAllPluginNames();
qSort(pluginNames);
- foreach (const QString& pluginName, pluginNames)
+ for (const QString& pluginName : pluginNames)
{
builtIn = PLUGINS->isBuiltIn(pluginName);
title = PLUGINS->getTitle(pluginName);
@@ -1497,7 +1504,7 @@ void ConfigDialog::initShortcuts(CfgCategory *cfgCategory) int itemRow = 0;
QStringList entryNames = cfgCategory->getEntries().keys();
qSort(entryNames);
- foreach (const QString& entryName, entryNames)
+ for (const QString& entryName : entryNames)
{
// Title
title = cfgCategory->getEntries()[entryName]->getTitle();
diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.ui b/SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.ui index 6bedd25..fe0b772 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.ui +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.ui @@ -229,7 +229,7 @@ </sizepolicy>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>3</number>
</property>
<widget class="QWidget" name="databaseListPage">
<layout class="QVBoxLayout" name="verticalLayout_36">
@@ -407,8 +407,8 @@ <rect>
<x>0</x>
<y>0</y>
- <width>564</width>
- <height>580</height>
+ <width>577</width>
+ <height>472</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_34">
@@ -418,17 +418,30 @@ <string>Data browsing and editing</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
- <item row="1" column="0">
- <widget class="QLabel" name="initColWidthLimitLabel">
+ <item row="2" column="0" colspan="2">
+ <widget class="QLabel" name="label_2">
<property name="toolTip">
- <string><p>When the data is read into grid view columns width is automatically adjusted. This value limits the initial width for the adjustment, but user can still resize the column manually over this limit.</p></string>
+ <string><p>Maximum number of configurations of Populate Table dialog stored in configuration. Value of 100 should be sufficient.</p></string>
</property>
<property name="text">
- <string>Limit initial data column width to (in pixels):</string>
+ <string>Number of memorized table populating configurations</string>
</property>
</widget>
</item>
- <item row="0" column="1">
+ <item row="2" column="2">
+ <widget class="QSpinBox" name="spinBox">
+ <property name="toolTip">
+ <string><p>Maximum number of configurations of Populate Table dialog stored in configuration. Value of 100 should be sufficient.</p></string>
+ </property>
+ <property name="maximum">
+ <number>999999</number>
+ </property>
+ <property name="cfg" stdset="0">
+ <string notr="true">General.PopulateHistorySize</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
<widget class="QSpinBox" name="rowsPerPageSpin">
<property name="maximumSize">
<size>
@@ -447,7 +460,7 @@ </property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="1" column="2">
<widget class="QSpinBox" name="initColWidthLimitSpin">
<property name="toolTip">
<string><p>When the data is read into grid view columns width is automatically adjusted. This value limits the initial width for the adjustment, but user can still resize the column manually over this limit.</p></string>
@@ -466,27 +479,37 @@ </property>
</widget>
</item>
- <item row="2" column="0">
- <widget class="QCheckBox" name="tolltipInDataViewCheck">
+ <item row="1" column="0" colspan="2">
+ <widget class="QLabel" name="initColWidthLimitLabel">
<property name="toolTip">
- <string><p>When this is enabled and user holds mouse pointer over a cell in any data view (query results, a table data, a view data) a tooltip will appear with details about the cell - it includes details like column data type, constraints, ROWID and others.</p></string>
+ <string><p>When the data is read into grid view columns width is automatically adjusted. This value limits the initial width for the adjustment, but user can still resize the column manually over this limit.</p></string>
</property>
<property name="text">
- <string>Show column and row details tooltip in data view</string>
- </property>
- <property name="cfg" stdset="0">
- <string notr="true">General.ShowDataViewTooltips</string>
+ <string>Limit initial data column width to (in pixels):</string>
</property>
</widget>
</item>
- <item row="0" column="0">
+ <item row="0" column="0" colspan="2">
<widget class="QLabel" name="rowsPerPageLabel">
<property name="text">
<string>Number of data rows per page:</string>
</property>
</widget>
</item>
- <item row="3" column="0">
+ <item row="3" column="0" colspan="3">
+ <widget class="QCheckBox" name="tolltipInDataViewCheck">
+ <property name="toolTip">
+ <string><p>When this is enabled and user holds mouse pointer over a cell in any data view (query results, a table data, a view data) a tooltip will appear with details about the cell - it includes details like column data type, constraints, ROWID and others.</p></string>
+ </property>
+ <property name="text">
+ <string>Show column and row details tooltip in data view</string>
+ </property>
+ <property name="cfg" stdset="0">
+ <string notr="true">General.ShowDataViewTooltips</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" colspan="3">
<widget class="QCheckBox" name="keepNullWhenEmptyCheck">
<property name="toolTip">
<string><p>When editing a cell which used to have NULL value and entering empty string as new value, then this option determinates whether the new value should remain NULL (have this option enabled), or should it be overwritten with empty string value (have this option disabled).</p></string>
@@ -499,7 +522,7 @@ </property>
</widget>
</item>
- <item row="4" column="0" colspan="2">
+ <item row="5" column="0" colspan="3">
<widget class="QCheckBox" name="useDefaultForNullCheck">
<property name="toolTip">
<string><html><head/><body><p>Enable this to always enforce DEFAULT value when committing a NULL value for a column that has DEFAULT value defined, even though the column is allowed to contain NULL values.</p><p>Disable this option to use DEFAULT value exclusively when NULL value is committed for column with NOT NULL constraint.</p></body></html></string>
@@ -837,8 +860,21 @@ </property>
</widget>
</item>
- <item row="2" column="0">
- <widget class="QCheckBox" name="checkBox">
+ <item row="2" column="1">
+ <widget class="QSpinBox" name="bindParamLimitSpin">
+ <property name="toolTip">
+ <string><p>Maximum number of query parameters (:param, @param, $param, ?) stored in history. When you re-use parameter with the same name/position, SQLiteStudio will pre-initialize it with most recent memorized value (you will still be able to change it). Value of 1000 should be sufficient.</p></string>
+ </property>
+ <property name="maximum">
+ <number>999999</number>
+ </property>
+ <property name="cfg" stdset="0">
+ <string notr="true">General.BindParamsCacheSize</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QCheckBox" name="execQueryUnderCursorCheck">
<property name="toolTip">
<string><p>If there is more than one query in the SQL editor window, then (if this option is enabled) only a single query will be executed - the one under the keyboard insertion cursor. Otherwise all queries will be executed. You can always limit queries to be executed by selecting those queries before calling to execute.</p></string>
</property>
@@ -850,6 +886,16 @@ </property>
</widget>
</item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="bindParamLimitLabel">
+ <property name="toolTip">
+ <string><p>Maximum number of query parameters (:param, @param, $param, ?) stored in history. When you re-use parameter with the same name/position, SQLiteStudio will pre-initialize it with most recent memorized value (you will still be able to change it). Value of 1000 should be sufficient.</p></string>
+ </property>
+ <property name="text">
+ <string>Number of memorized query parameters</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
@@ -1027,8 +1073,8 @@ <rect>
<x>0</x>
<y>0</y>
- <width>447</width>
- <height>307</height>
+ <width>335</width>
+ <height>237</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_31">
@@ -1448,8 +1494,8 @@ <string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Abcdefgh</span></p></body></html></string>
+</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Abcdefgh</span></p></body></html></string>
</property>
</widget>
</item>
@@ -1539,8 +1585,8 @@ p, li { white-space: pre-wrap; } <rect>
<x>0</x>
<y>0</y>
- <width>268</width>
- <height>328</height>
+ <width>196</width>
+ <height>263</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
@@ -1661,8 +1707,8 @@ p, li { white-space: pre-wrap; } <rect>
<x>0</x>
<y>0</y>
- <width>331</width>
- <height>829</height>
+ <width>247</width>
+ <height>701</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
@@ -2237,7 +2283,7 @@ p, li { white-space: pre-wrap; } <tabstop>ddlHistorySizeSpin</tabstop>
<tabstop>dontShowDdlPreview</tabstop>
<tabstop>queryHistorySizeSpin</tabstop>
- <tabstop>checkBox</tabstop>
+ <tabstop>execQueryUnderCursorCheck</tabstop>
<tabstop>expandTablesCheck</tabstop>
<tabstop>activeStyleCombo</tabstop>
<tabstop>previewTabs</tabstop>
diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/dbdialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/dbdialog.cpp index 781e25e..183f8dd 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/dbdialog.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/dbdialog.cpp @@ -144,7 +144,7 @@ void DbDialog::updateOptions() setUpdatesEnabled(false); // Remove olds - foreach (QWidget* w, optionWidgets) + for (QWidget* w : optionWidgets) { ui->optionsGrid->removeWidget(w); delete w; @@ -481,7 +481,7 @@ bool DbDialog::validate() if (nameState) { if (nameManuallyEdited) - setValidStateInfo(ui->nameEdit, tr("<p>Automatic name generation was disabled, becuase the name was edited manually. To restore automatic generation please erase contents of the name field.</p>")); + setValidStateInfo(ui->nameEdit, tr("<p>Automatic name generation was disabled, because the name was edited manually. To restore automatic generation please erase contents of the name field.</p>")); else setValidState(ui->nameEdit, true); } @@ -560,14 +560,13 @@ void DbDialog::valueForNameGenerationChanged() return; QString generatedName; - if (dbPlugins.count() > 0) - { - DbPlugin* plugin = dbPlugins[ui->typeCombo->currentText()]; + DbPlugin* plugin = dbPlugins.count() > 0 ? dbPlugins[ui->typeCombo->currentText()] : nullptr; + if (plugin) generatedName = DBLIST->generateUniqueDbName(plugin, ui->fileEdit->text()); - } else generatedName = DBLIST->generateUniqueDbName(ui->fileEdit->text()); + ui->nameEdit->setText(generatedName); } diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/ddlpreviewdialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/ddlpreviewdialog.cpp index e86f9cd..3af221f 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/ddlpreviewdialog.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/ddlpreviewdialog.cpp @@ -28,7 +28,7 @@ void DdlPreviewDialog::setDdl(const QStringList& ddlList) { QStringList fixedList; QString newDdl; - foreach (const QString& ddl, ddlList) + for (const QString& ddl : ddlList) { newDdl = ddl.trimmed(); if (!newDdl.endsWith(";")) diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/execfromfiledialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/execfromfiledialog.cpp new file mode 100644 index 0000000..3ecae39 --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/execfromfiledialog.cpp @@ -0,0 +1,76 @@ +#include "execfromfiledialog.h" +#include "ui_execfromfiledialog.h" +#include "common/utils.h" +#include "uiconfig.h" +#include "uiutils.h" +#include <QFileDialog> + +ExecFromFileDialog::ExecFromFileDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::ExecFromFileDialog) +{ + init(); +} + +ExecFromFileDialog::~ExecFromFileDialog() +{ + delete ui; +} + +bool ExecFromFileDialog::ignoreErrors() const +{ + return ui->skipErrorsCheck->isChecked(); +} + +QString ExecFromFileDialog::filePath() const +{ + return ui->fileEdit->text(); +} + +QString ExecFromFileDialog::codec() const +{ + return ui->encodingCombo->currentText(); +} + +void ExecFromFileDialog::init() +{ + ui->setupUi(this); + + connect(ui->fileBrowse, SIGNAL(clicked()), this, SLOT(browseForInputFile())); + connect(ui->fileEdit, SIGNAL(textChanged(const QString&)), this, SLOT(updateState())); + + ui->encodingCombo->addItems(textCodecNames()); + ui->encodingCombo->setCurrentText(defaultCodecName()); +} + +void ExecFromFileDialog::browseForInputFile() +{ + QString dir = getFileDialogInitPath(); + QString filters = tr("SQL scripts (*.sql);;All files (*)"); + QString path = QFileDialog::getOpenFileName(nullptr, tr("Execute SQL file"), dir, filters); + if (path.isNull()) + return; + + setFileDialogInitPathByFile(path); + ui->fileEdit->setText(path); + updateState(); +} + +void ExecFromFileDialog::updateState() +{ + QString path = ui->fileEdit->text(); + if (path.isEmpty()) + { + setValidState(ui->fileEdit, false, tr("Please provide file to be executed.")); + return; + } + + QFileInfo fi(path); + if (!fi.exists() || !fi.isReadable()) + { + setValidState(ui->fileEdit, false, tr("Provided file does not exist or cannot be read.")); + return; + } + + setValidState(ui->fileEdit, true); +} diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/execfromfiledialog.h b/SQLiteStudio3/guiSQLiteStudio/dialogs/execfromfiledialog.h new file mode 100644 index 0000000..27751d4 --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/execfromfiledialog.h @@ -0,0 +1,32 @@ +#ifndef EXECFROMFILEDIALOG_H +#define EXECFROMFILEDIALOG_H + +#include <QDialog> + +namespace Ui { + class ExecFromFileDialog; +} + +class ExecFromFileDialog : public QDialog +{ + Q_OBJECT + + public: + explicit ExecFromFileDialog(QWidget *parent = nullptr); + ~ExecFromFileDialog(); + + bool ignoreErrors() const; + QString filePath() const; + QString codec() const; + + private: + void init(); + + Ui::ExecFromFileDialog *ui; + + private slots: + void browseForInputFile(); + void updateState(); +}; + +#endif // EXECFROMFILEDIALOG_H diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.ui b/SQLiteStudio3/guiSQLiteStudio/dialogs/execfromfiledialog.ui index d1d26e6..6a24e51 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/bugreportlogindialog.ui +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/execfromfiledialog.ui @@ -1,46 +1,46 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>BugReportLoginDialog</class> - <widget class="QDialog" name="BugReportLoginDialog"> + <class>ExecFromFileDialog</class> + <widget class="QDialog" name="ExecFromFileDialog"> <property name="geometry"> <rect> <x>0</x> <y>0</y> - <width>343</width> - <height>197</height> + <width>400</width> + <height>203</height> </rect> </property> <property name="windowTitle"> - <string>Log in</string> + <string>Execute SQL from file</string> + </property> + <property name="modal"> + <bool>true</bool> </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="QGroupBox" name="credentialsGroup"> + <widget class="QGroupBox" name="fileGroup"> <property name="title"> - <string>Credentials</string> + <string>Input file</string> </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="loginLabel"> - <property name="text"> - <string>Login:</string> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLineEdit" name="fileEdit"> + <property name="placeholderText"> + <string>Path to file</string> </property> </widget> </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="loginEdit"/> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="passwordLabel"> + <item> + <widget class="QToolButton" name="fileBrowse"> + <property name="toolTip"> + <string>Browse for file</string> + </property> <property name="text"> - <string>Password:</string> + <string/> </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="passwordEdit"> - <property name="echoMode"> - <enum>QLineEdit::Password</enum> + <property name="icon"> + <iconset resource="../icons.qrc"> + <normaloff>:/icons/img/directory_open.png</normaloff>:/icons/img/directory_open.png</iconset> </property> </widget> </item> @@ -48,32 +48,25 @@ </widget> </item> <item> - <widget class="QGroupBox" name="validationGroup"> + <widget class="QGroupBox" name="optionsGroup"> <property name="title"> - <string>Validation</string> + <string>Options</string> </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QToolButton" name="validationButton"> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="encodingLabel"> <property name="text"> - <string>Validate</string> - </property> - <property name="icon"> - <iconset resource="../icons.qrc"> - <normaloff>:/icons/img/test_conn_error.png</normaloff>:/icons/img/test_conn_error.png</iconset> - </property> - <property name="toolButtonStyle"> - <enum>Qt::ToolButtonTextBesideIcon</enum> + <string>File encoding</string> </property> </widget> </item> - <item> - <widget class="QLabel" name="validationLabel"> + <item row="0" column="1"> + <widget class="QComboBox" name="encodingCombo"/> + </item> + <item row="1" column="0" colspan="2"> + <widget class="QCheckBox" name="skipErrorsCheck"> <property name="text"> - <string>Validation result message</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + <string>Skip failing SQL statements</string> </property> </widget> </item> @@ -99,7 +92,7 @@ <connection> <sender>buttonBox</sender> <signal>accepted()</signal> - <receiver>BugReportLoginDialog</receiver> + <receiver>ExecFromFileDialog</receiver> <slot>accept()</slot> <hints> <hint type="sourcelabel"> @@ -115,7 +108,7 @@ <connection> <sender>buttonBox</sender> <signal>rejected()</signal> - <receiver>BugReportLoginDialog</receiver> + <receiver>ExecFromFileDialog</receiver> <slot>reject()</slot> <hints> <hint type="sourcelabel"> diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/exportdialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/exportdialog.cpp index 91b4087..7b6a4d0 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/exportdialog.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/exportdialog.cpp @@ -23,6 +23,15 @@ #include <QUiLoader> #include <QMimeData> +static const QString EXPORT_DIALOG_CFG_GROUP = "ExportDialog"; +static const QString EXPORT_DIALOG_CFG_CODEC = "codec"; +static const QString EXPORT_DIALOG_CFG_FILE = "outputFileName"; +static const QString EXPORT_DIALOG_CFG_CLIP = "intoClipboard"; +static const QString EXPORT_DIALOG_CFG_DATA = "exportData"; +static const QString EXPORT_DIALOG_CFG_IDX = "exportTableIndexes"; +static const QString EXPORT_DIALOG_CFG_TRIG = "exportTableTriggers"; +static const QString EXPORT_DIALOG_CFG_FORMAT = "format"; + ExportDialog::ExportDialog(QWidget *parent) : QWizard(parent), ui(new Ui::ExportDialog) @@ -362,7 +371,10 @@ void ExportDialog::formatPageDisplayed() formatPageVisited = true; } + readStdConfigForLastPage(); pluginSelected(); + + emit formatPageCompleteChanged(); } ExportPlugin* ExportDialog::getSelectedPlugin() const @@ -443,9 +455,6 @@ void ExportDialog::pluginSelected() updateExportOutputOptions(); updateOptions(); - - if (currentPlugin->getConfig() && !currentPlugin->getConfig()->isPersistable()) - currentPlugin->getConfig()->reset(); } void ExportDialog::updateExportOutputOptions() @@ -470,8 +479,18 @@ void ExportDialog::updateExportOutputOptions() ui->encodingLabel->setVisible(displayCodec); if (displayCodec) { - QString codec = currentPlugin->getDefaultEncoding(); + QString codec = CFG->get(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_CODEC).toString(); + QString defaultCodec = currentPlugin->getDefaultEncoding(); + if (codec.isNull()) + codec = defaultCodec; + int idx = ui->encodingCombo->findText(codec); + if (idx == -1 && codec != defaultCodec) + { + codec = defaultCodec; + idx = ui->encodingCombo->findText(codec); + } + if (idx > -1) ui->encodingCombo->setCurrentIndex(idx); } @@ -555,6 +574,12 @@ void ExportDialog::accept() doExport(); } +int ExportDialog::exec() +{ + readStdConfigForFirstPage(); + return QDialog::exec(); +} + void ExportDialog::updatePluginOptions(ExportPlugin* plugin, int& optionsRow) { safe_delete(pluginOptionsWidget); @@ -596,6 +621,46 @@ void ExportDialog::updatePluginOptions(ExportPlugin* plugin, int& optionsRow) plugin->validateOptions(); } +void ExportDialog::storeStdConfig(const ExportManager::StandardExportConfig &stdConfig) +{ + CFG->begin(); + CFG->set(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_CODEC, stdConfig.codec); + CFG->set(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_FILE, stdConfig.outputFileName); + CFG->set(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_CLIP, stdConfig.intoClipboard); + CFG->set(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_DATA, stdConfig.exportData); + CFG->set(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_IDX, stdConfig.exportTableIndexes); + CFG->set(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_TRIG, stdConfig.exportTableTriggers); + CFG->set(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_FORMAT, currentPlugin->getFormatName()); + CFG->commit(); +} + +void ExportDialog::readStdConfigForFirstPage() +{ + bool exportData = CFG->get(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_DATA, true).toBool(); + if (exportMode == ExportManager::DATABASE) + ui->exportDbDataCheck->setChecked(exportData); + else if (exportMode == ExportManager::TABLE) + ui->exportTableDataCheck->setChecked(exportData); + + ui->exportTableIndexesCheck->setChecked(CFG->get(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_IDX, true).toBool()); + ui->exportTableTriggersCheck->setChecked(CFG->get(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_TRIG, true).toBool()); +} + +void ExportDialog::readStdConfigForLastPage() +{ + QString format = CFG->get(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_FORMAT).toString(); + int idx = ui->formatCombo->findText(format); + if (idx > -1) + ui->formatCombo->setCurrentIndex(idx); + + bool useClipboard = CFG->get(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_CLIP, false).toBool(); + ui->exportFileRadio->setChecked(!useClipboard); + ui->exportClipboardRadio->setChecked(useClipboard); + ui->exportFileEdit->setText(CFG->get(EXPORT_DIALOG_CFG_GROUP, EXPORT_DIALOG_CFG_FILE, QString()).toString()); + + // Codec is read within updateExportOutputOptions() +} + void ExportDialog::updateValidation() { if (!currentPlugin) @@ -610,6 +675,9 @@ void ExportDialog::doExport() widgetCover->show(); ExportManager::StandardExportConfig stdConfig = getExportConfig(); + storeStdConfig(stdConfig); + configMapper->saveFromWidget(pluginOptionsWidget); + QString format = ui->formatCombo->currentText(); switch (exportMode) { @@ -684,6 +752,9 @@ ExportManager::StandardExportConfig ExportDialog::getExportConfig() const else stdConfig.exportData = false; + stdConfig.exportTableIndexes = ui->exportTableIndexesCheck->isChecked(); + stdConfig.exportTableTriggers = ui->exportTableTriggersCheck->isChecked(); + if (ui->encodingCombo->isVisible() && ui->encodingCombo->currentIndex() > -1) stdConfig.codec = ui->encodingCombo->currentText(); else diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/exportdialog.h b/SQLiteStudio3/guiSQLiteStudio/dialogs/exportdialog.h index 0471172..c2f6d7e 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/exportdialog.h +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/exportdialog.h @@ -45,6 +45,9 @@ class GUI_API_EXPORT ExportDialog : public QWizard void formatPageDisplayed(); ExportPlugin* getSelectedPlugin() const; void updatePluginOptions(ExportPlugin* plugin, int& optionsRow); + void storeStdConfig(const ExportManager::StandardExportConfig& stdConfig); + void readStdConfigForFirstPage(); + void readStdConfigForLastPage(); void doExport(); void exportDatabase(const ExportManager::StandardExportConfig& stdConfig, const QString& format); void exportTable(const ExportManager::StandardExportConfig& stdConfig, const QString& format); @@ -96,6 +99,7 @@ class GUI_API_EXPORT ExportDialog : public QWizard public slots: void accept(); + int exec(); signals: void formatPageCompleteChanged(); diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/fileexecerrorsdialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/fileexecerrorsdialog.cpp new file mode 100644 index 0000000..916c8af --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/fileexecerrorsdialog.cpp @@ -0,0 +1,35 @@ +#include "fileexecerrorsdialog.h" +#include "ui_fileexecerrorsdialog.h" + +FileExecErrorsDialog::FileExecErrorsDialog(const QList<QPair<QString, QString>>& errors, bool rolledBack, QWidget *parent) : + QDialog(parent), + ui(new Ui::FileExecErrorsDialog) +{ + ui->setupUi(this); + + ui->committedLabel->setVisible(!rolledBack); + ui->rolledBackLabel->setVisible(rolledBack); + + ui->tableWidget->setRowCount(errors.size()); + int row = 0; + for (const QPair<QString, QString>& err : errors) + { + ui->tableWidget->setItem(row, 0, item(err.first)); + ui->tableWidget->setItem(row, 1, item(err.second)); + row++; + } + ui->tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); + ui->tableWidget->resizeRowsToContents(); +} + +FileExecErrorsDialog::~FileExecErrorsDialog() +{ + delete ui; +} + +QTableWidgetItem* FileExecErrorsDialog::item(const QString& text) +{ + QTableWidgetItem* item = new QTableWidgetItem(text); + item->setFlags(Qt::ItemIsEnabled); + return item; +} diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/fileexecerrorsdialog.h b/SQLiteStudio3/guiSQLiteStudio/dialogs/fileexecerrorsdialog.h new file mode 100644 index 0000000..2b474ce --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/fileexecerrorsdialog.h @@ -0,0 +1,26 @@ +#ifndef FILEEXECERRORSDIALOG_H +#define FILEEXECERRORSDIALOG_H + +#include <QDialog> + +namespace Ui { + class FileExecErrorsDialog; +} + +class QTableWidgetItem; + +class FileExecErrorsDialog : public QDialog +{ + Q_OBJECT + + public: + explicit FileExecErrorsDialog(const QList<QPair<QString, QString> >& errors, bool rolledBack, QWidget *parent = nullptr); + ~FileExecErrorsDialog(); + + private: + QTableWidgetItem* item(const QString& text); + + Ui::FileExecErrorsDialog *ui; +}; + +#endif // FILEEXECERRORSDIALOG_H diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/fileexecerrorsdialog.ui b/SQLiteStudio3/guiSQLiteStudio/dialogs/fileexecerrorsdialog.ui new file mode 100644 index 0000000..4ad6d6c --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/fileexecerrorsdialog.ui @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>FileExecErrorsDialog</class> + <widget class="QDialog" name="FileExecErrorsDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>720</width> + <height>436</height> + </rect> + </property> + <property name="windowTitle"> + <string>Execution errors</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="topLabel"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Following errors were encountered during execution of SQL statements from the file:</string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QTableWidget" name="tableWidget"> + <property name="showDropIndicator" stdset="0"> + <bool>false</bool> + </property> + <property name="dragDropOverwriteMode"> + <bool>false</bool> + </property> + <property name="selectionMode"> + <enum>QAbstractItemView::NoSelection</enum> + </property> + <attribute name="horizontalHeaderMinimumSectionSize"> + <number>100</number> + </attribute> + <column> + <property name="text"> + <string>SQL</string> + </property> + </column> + <column> + <property name="text"> + <string>Error</string> + </property> + </column> + </widget> + </item> + <item> + <widget class="QLabel" name="committedLabel"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Statements that were executed successfully were commited.</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="rolledBackLabel"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Statements that were executed successfully were rolled back.</string> + </property> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Close</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>FileExecErrorsDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>FileExecErrorsDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/importdialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/importdialog.cpp index 2f52396..ddb443d 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/importdialog.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/importdialog.cpp @@ -6,7 +6,6 @@ #include "common/widgetcover.h" #include "services/dbmanager.h" #include "services/pluginmanager.h" -#include "services/importmanager.h" #include "sqlitestudio.h" #include "plugins/importplugin.h" #include "ui_importdialog.h" @@ -19,6 +18,12 @@ #include <QFileDialog> #include <QKeyEvent> +static const QString IMPORT_DIALOG_CFG_GROUP = "ImportDialog"; +static const QString IMPORT_DIALOG_CFG_CODEC = "codec"; +static const QString IMPORT_DIALOG_CFG_FILE = "inputFileName"; +static const QString IMPORT_DIALOG_CFG_IGNORE_ERR = "ignoreErrors"; +static const QString IMPORT_DIALOG_CFG_FORMAT = "format"; + ImportDialog::ImportDialog(QWidget *parent) : QWizard(parent), ui(new Ui::ImportDialog) @@ -55,6 +60,43 @@ bool ImportDialog::isPluginConfigValid() const return pluginConfigOk.size() == 0; } +void ImportDialog::storeStdConfig(ImportManager::StandardImportConfig &stdConfig) +{ + CFG->begin(); + CFG->set(IMPORT_DIALOG_CFG_GROUP, IMPORT_DIALOG_CFG_CODEC, stdConfig.codec); + CFG->set(IMPORT_DIALOG_CFG_GROUP, IMPORT_DIALOG_CFG_FILE, stdConfig.inputFileName); + CFG->set(IMPORT_DIALOG_CFG_GROUP, IMPORT_DIALOG_CFG_IGNORE_ERR, stdConfig.ignoreErrors); + CFG->set(IMPORT_DIALOG_CFG_GROUP, IMPORT_DIALOG_CFG_FORMAT, currentPlugin->getDataSourceTypeName()); + CFG->commit(); +} + +void ImportDialog::readStdConfig() +{ + QString format = CFG->get(IMPORT_DIALOG_CFG_GROUP, IMPORT_DIALOG_CFG_FORMAT).toString(); + int idx = ui->dsTypeCombo->findText(format); + if (idx > -1) + ui->dsTypeCombo->setCurrentIndex(idx); + + ui->inputFileEdit->setText(CFG->get(IMPORT_DIALOG_CFG_GROUP, IMPORT_DIALOG_CFG_FILE, QString()).toString()); + ui->ignoreErrorsCheck->setChecked(CFG->get(IMPORT_DIALOG_CFG_GROUP, IMPORT_DIALOG_CFG_IGNORE_ERR, false).toBool()); + + // Encoding + QString codec = CFG->get(IMPORT_DIALOG_CFG_GROUP, IMPORT_DIALOG_CFG_CODEC).toString(); + QString defaultCodec = defaultCodecName(); + if (codec.isNull()) + codec = defaultCodec; + + int codecIdx = ui->codecCombo->findText(codec); + if (codecIdx == -1 && codec != defaultCodec) + { + codec = defaultCodec; + codecIdx = ui->codecCombo->findText(codec); + } + + if (codecIdx > -1) + ui->codecCombo->setCurrentIndex(codecIdx); +} + void ImportDialog::init() { ui->setupUi(this); @@ -303,7 +345,10 @@ void ImportDialog::updateValidation() void ImportDialog::pageChanged() { if (currentPage() == ui->dsPage) + { + readStdConfig(); updateValidation(); + } } void ImportDialog::browseForInputFile() @@ -351,6 +396,9 @@ void ImportDialog::accept() stdConfig.ignoreErrors = ui->ignoreErrorsCheck->isChecked(); + storeStdConfig(stdConfig); + configMapper->saveFromWidget(pluginOptionsWidget); + Db* db = DBLIST->getByName(ui->dbNameCombo->currentText());; if (!db) { diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/importdialog.h b/SQLiteStudio3/guiSQLiteStudio/dialogs/importdialog.h index b4c2883..48402ae 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/importdialog.h +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/importdialog.h @@ -2,6 +2,7 @@ #define IMPORTDIALOG_H #include "guiSQLiteStudio_global.h" +#include "services/importmanager.h" #include <QWizard> namespace Ui { @@ -39,6 +40,8 @@ class GUI_API_EXPORT ImportDialog : public QWizard void updateStandardOptions(); void updatePluginOptions(int& rows); bool isPluginConfigValid() const; + void storeStdConfig(ImportManager::StandardImportConfig& stdConfig); + void readStdConfig(); Ui::ImportDialog *ui = nullptr; DbListModel* dbListModel = nullptr; diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.cpp index c5da317..e3e7701 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.cpp @@ -106,13 +106,13 @@ void IndexDialog::init() connect(ui->partialIndexEdit, SIGNAL(textChanged()), this, SLOT(updateValidation())); ui->partialIndexEdit->setVirtualSqlExpression("SELECT %1"); updatePartialConditionState(); - ui->columnsTable->setColumnHidden(1, false); + ui->columnsTable->setColumnHidden(2, false); } else { ui->partialIndexCheck->setVisible(false); ui->partialIndexEdit->setVisible(false); - ui->columnsTable->setColumnHidden(1, true); + ui->columnsTable->setColumnHidden(2, true); ui->addExprColumnButton->setVisible(false); ui->editExprColumnButton->setVisible(false); ui->delExprColumnButton->setVisible(false); diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.ui b/SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.ui index 36066c5..5b07d45 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.ui +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/indexdialog.ui @@ -72,12 +72,12 @@ </column> <column> <property name="text"> - <string>Collation</string> + <string>Sort</string> </property> </column> <column> <property name="text"> - <string>Sort</string> + <string>Collation</string> </property> </column> </widget> diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/newversiondialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/newversiondialog.cpp index d0976a3..020cfef 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/newversiondialog.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/newversiondialog.cpp @@ -22,24 +22,15 @@ NewVersionDialog::~NewVersionDialog() void NewVersionDialog::setUpdates(const QList<UpdateManager::UpdateEntry>& updates) { QTableWidgetItem* item = nullptr; - QString currVersion; int row = 0; ui->updateList->setRowCount(updates.size()); for (const UpdateManager::UpdateEntry& entry : updates) { - if (entry.compontent == "SQLiteStudio") - currVersion = SQLITESTUDIO->getVersionString(); - else - currVersion = PLUGINS->getPrintableVersion(entry.compontent); - item = new QTableWidgetItem(entry.compontent); ui->updateList->setItem(row, 0, item); - item = new QTableWidgetItem(currVersion); - ui->updateList->setItem(row, 1, item); - item = new QTableWidgetItem(entry.version); - ui->updateList->setItem(row, 2, item); + ui->updateList->setItem(row, 1, item); row++; } diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/newversiondialog.ui b/SQLiteStudio3/guiSQLiteStudio/dialogs/newversiondialog.ui index 6f50e7f..d5468b3 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/newversiondialog.ui +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/newversiondialog.ui @@ -72,11 +72,6 @@ </column> <column> <property name="text"> - <string>Current version</string> - </property> - </column> - <column> - <property name="text"> <string>Update version</string> </property> </column> @@ -111,7 +106,7 @@ </size> </property> <property name="description"> - <string>The update will be automatically downloaded and installed. This will also restart application at the end.</string> + <string>This application will be closed and the update installer will start to download and install all the updates.</string> </property> </widget> </item> diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp index 7861ff0..7f4ec20 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp @@ -48,7 +48,10 @@ void PopulateDialog::init() }); for (PopulatePlugin* plugin : plugins) + { + pluginByName[plugin->getName()] = plugin; pluginTitles << plugin->getTitle(); + } widgetCover = new WidgetCover(this); widgetCover->initWithInterruptContainer(tr("Abort")); @@ -94,12 +97,29 @@ void PopulateDialog::deleteEngines(const QList<PopulateEngine*>& engines) delete engine; } -void PopulateDialog::rebuildEngines() +void PopulateDialog::rebuildEngines(const QHash<QString, QPair<QString, QVariant>>& columnConfig) { int row = 0; + QVariant config; + QString pluginName; for (const ColumnEntry& entry : columnEntries) { - pluginSelected(entry.combo, entry.combo->currentIndex()); + pluginName.clear(); + if (columnConfig.contains(entry.column)) + pluginName = columnConfig[entry.column].first; + + if (pluginName.isNull()) + { + pluginName = plugins[entry.combo->currentIndex()]->getName(); + config = CFG->getPopulateHistory(pluginName); + } + else + { + entry.combo->setCurrentIndex(plugins.indexOf(pluginByName[pluginName])); + config = columnConfig[entry.column].second; + } + + pluginSelected(entry.combo, entry.combo->currentIndex(), config); updateColumnState(row++, false); } } @@ -135,6 +155,8 @@ void PopulateDialog::refreshColumns() return; } + QString table = ui->tableCombo->currentText(); + buttonMapper = new QSignalMapper(this); connect(buttonMapper, SIGNAL(mapped(int)), this, SLOT(configurePlugin(int))); @@ -142,14 +164,23 @@ void PopulateDialog::refreshColumns() connect(checkMapper, SIGNAL(mapped(int)), this, SLOT(updateColumnState(int))); SchemaResolver resolver(db); - QStringList columns = resolver.getTableColumns(ui->tableCombo->currentText()); + QStringList columns = resolver.getTableColumns(table); QCheckBox* check = nullptr; QComboBox* combo = nullptr; QToolButton* btn = nullptr; + + int rows = -1; + QHash<QString, QPair<QString, QVariant>> columnConfig = CFG->getPopulateHistory(db->getName(), table, rows); + if (rows > -1) + ui->rowsSpin->setValue(rows); + int row = 0; for (const QString& column : columns) { check = new QCheckBox(column); + if (columnConfig.contains(column)) + check->setChecked(true); + connect(check, SIGNAL(toggled(bool)), checkMapper, SLOT(map())); checkMapper->setMapping(check, row); @@ -165,11 +196,11 @@ void PopulateDialog::refreshColumns() ui->columnsLayout->addWidget(check, row, 0); ui->columnsLayout->addWidget(combo, row, 1); ui->columnsLayout->addWidget(btn, row, 2); - columnEntries << ColumnEntry(check, combo, btn); + columnEntries << ColumnEntry(column, check, combo, btn); row++; } - rebuildEngines(); + rebuildEngines(columnConfig); QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding); ui->columnsLayout->addItem(spacer, row, 0, 1, 3); @@ -179,11 +210,15 @@ void PopulateDialog::refreshColumns() void PopulateDialog::pluginSelected(int index) { + QVariant config; + if (index >= 0 && index < plugins.size()) + config = CFG->getPopulateHistory(plugins[index]->getName()); + QComboBox* cb = dynamic_cast<QComboBox*>(sender()); - pluginSelected(cb, index); + pluginSelected(cb, index, config); } -void PopulateDialog::pluginSelected(QComboBox* combo, int index) +void PopulateDialog::pluginSelected(QComboBox* combo, int index, const QVariant& config) { if (!combo) return; @@ -209,7 +244,11 @@ void PopulateDialog::pluginSelected(QComboBox* combo, int index) if (index < 0 || index >= plugins.size()) return; - entry->engine = plugins[index]->createEngine(); + entry->plugin = plugins[index]; + entry->engine = entry->plugin->createEngine(); + if (config.isValid()) + entry->engine->getConfig()->setValuesFromQVariant(config); + updateColumnState(columnIndex); } @@ -230,7 +269,8 @@ void PopulateDialog::configurePlugin(int index) engine->getConfig()->savepoint(); - PopulateConfigDialog dialog(engine, columnEntries[index].check->text(), columnEntries[index].combo->currentText(), this); + QString colName = columnEntries[index].column; + PopulateConfigDialog dialog(engine, colName, columnEntries[index].combo->currentText(), this); if (dialog.exec() != QDialog::Accepted) engine->getConfig()->restore(); @@ -304,6 +344,7 @@ void PopulateDialog::accept() if (!db) return; + QHash<QString, QPair<QString, QVariant>> configForHistory; QHash<QString,PopulateEngine*> engines; for (ColumnEntry& entry : columnEntries) { @@ -313,16 +354,19 @@ void PopulateDialog::accept() if (!entry.engine) return; - engines[entry.check->text()] = entry.engine; -// entry.engine = nullptr; // to avoid deleting it in the entry's destructor - worker will delete it after it's done + engines[entry.column] = entry.engine; + // entry.engine = nullptr; // to avoid deleting it in the entry's destructor - worker will delete it after it's done + + configForHistory[entry.column] = QPair<QString, QVariant>(entry.plugin->getName(), entry.engine->getConfig()->toQVariant()); } QString table = ui->tableCombo->currentText(); - qint64 rows = ui->rowsSpin->value(); + int rows = ui->rowsSpin->value(); started = true; widgetCover->displayProgress(rows, "%v / %m"); widgetCover->show(); + CFG->addPopulateHistory(db->getName(), table, rows, configForHistory); POPULATE_MANAGER->populate(db, table, engines, rows); } @@ -334,8 +378,8 @@ void PopulateDialog::reject() QDialog::reject(); } -PopulateDialog::ColumnEntry::ColumnEntry(QCheckBox* check, QComboBox* combo, QToolButton* button) : - check(check), combo(combo), button(button) +PopulateDialog::ColumnEntry::ColumnEntry(const QString& column, QCheckBox* check, QComboBox* combo, QToolButton* button) : + column(column), check(check), combo(combo), button(button) { } diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h b/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h index 948d6ce..404b9e2 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h @@ -3,6 +3,7 @@ #include "guiSQLiteStudio_global.h" #include <QDialog> +#include <QVariant> namespace Ui { class PopulateDialog; @@ -32,19 +33,21 @@ class GUI_API_EXPORT PopulateDialog : public QDialog private: struct GUI_API_EXPORT ColumnEntry { - ColumnEntry(QCheckBox* check, QComboBox* combo, QToolButton* button); + ColumnEntry(const QString& column, QCheckBox* check, QComboBox* combo, QToolButton* button); ~ColumnEntry(); + QString column; QCheckBox* check = nullptr; QComboBox* combo = nullptr; QToolButton* button = nullptr; PopulateEngine* engine = nullptr; + PopulatePlugin* plugin = nullptr; }; void init(); PopulateEngine* getEngine(int selectedPluginIndex); void deleteEngines(const QList<PopulateEngine*>& engines); - void rebuildEngines(); + void rebuildEngines(const QHash<QString, QPair<QString, QVariant> >& columnConfig); Ui::PopulateDialog *ui = nullptr; QGridLayout* columnsGrid = nullptr; @@ -53,6 +56,7 @@ class GUI_API_EXPORT PopulateDialog : public QDialog Db* db = nullptr; QStringList pluginTitles; QList<PopulatePlugin*> plugins; + QHash<QString,PopulatePlugin*> pluginByName; QList<ColumnEntry> columnEntries; QSignalMapper* checkMapper = nullptr; QSignalMapper* buttonMapper = nullptr; @@ -64,7 +68,7 @@ class GUI_API_EXPORT PopulateDialog : public QDialog void refreshTables(); void refreshColumns(); void pluginSelected(int index); - void pluginSelected(QComboBox* combo, int index); + void pluginSelected(QComboBox* combo, int index, const QVariant& config); void configurePlugin(int index); void updateColumnState(int index, bool updateGlobalState = true); void updateState(); diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/triggerdialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/triggerdialog.cpp index 3254f26..255694c 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/triggerdialog.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/triggerdialog.cpp @@ -214,7 +214,7 @@ void TriggerDialog::readTrigger() if (createTrigger->queries.size() > 0) { QStringList sqls; - foreach (SqliteQuery* query, createTrigger->queries) + for (SqliteQuery* query : createTrigger->queries) sqls << query->detokenize(); ui->codeEdit->setPlainText(sqls.join(";\n")+";"); @@ -307,7 +307,7 @@ void TriggerDialog::rebuildTrigger() if (actionType == SqliteCreateTrigger::Event::UPDATE_OF) { QStringList colNames; - foreach (const QString& colName, selectedColumns) + for (const QString& colName : selectedColumns) colNames << wrapObjIfNeeded(colName, dialect); columns = " "+colNames.join(", "); @@ -363,7 +363,7 @@ void TriggerDialog::showColumnsDialog() QPoint topRight = ui->actionColumns->mapToGlobal(ui->actionColumns->rect().topRight()); TriggerColumnsDialog dialog(this, topRight.x(), topRight.y()); - foreach (const QString& colName, targetColumns) + for (const QString& colName : targetColumns) dialog.addColumn(colName, selectedColumns.contains(colName, Qt::CaseInsensitive)); if (dialog.exec() != QDialog::Accepted) diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/triggerdialog.ui b/SQLiteStudio3/guiSQLiteStudio/dialogs/triggerdialog.ui index 723f903..d25b2c0 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/triggerdialog.ui +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/triggerdialog.ui @@ -110,6 +110,9 @@ <property name="toolTip"> <string>Trigger statements to be executed.</string> </property> + <property name="lineWrapMode"> + <enum>QPlainTextEdit::NoWrap</enum> + </property> </widget> </item> <item row="7" column="0" colspan="3"> @@ -123,6 +126,9 @@ <property name="toolTip"> <string><p>SQL condition that will be evaluated before the actual trigger code. In case the condition returns false, the trigger will not be fired for that row.</p></string> </property> + <property name="lineWrapMode"> + <enum>QPlainTextEdit::NoWrap</enum> + </property> </widget> </item> </layout> |
