summaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/common/ipvalidator.h3
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/common/widgetcover.cpp36
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/common/widgetcover.h8
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/datagrid/sqlquerymodel.cpp20
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/datagrid/sqlquerymodel.h6
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/dataview.cpp39
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/dataview.h6
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/dbtree/dbtree.cpp38
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/dbtree/dbtree.h3
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreemodel.cpp29
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/dialogs/dbdialog.cpp22
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp13
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h2
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/iconmanager.h2
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/icons.qrc2
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/img/delete.pngbin0 -> 729 bytes
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/img/erase_table_data.pngbin0 -> 885 bytes
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/translations/guiSQLiteStudio_sk.ts86
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/uiconfig.h6
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/uidebug.cpp8
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/uidebug.h2
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/windows/tablewindow.cpp8
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.cpp10
23 files changed, 269 insertions, 80 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/common/ipvalidator.h b/SQLiteStudio3/guiSQLiteStudio/common/ipvalidator.h
index 1c9ca4d..2cda2d7 100644
--- a/SQLiteStudio3/guiSQLiteStudio/common/ipvalidator.h
+++ b/SQLiteStudio3/guiSQLiteStudio/common/ipvalidator.h
@@ -1,9 +1,10 @@
#ifndef IPVALIDATOR_H
#define IPVALIDATOR_H
+#include "guiSQLiteStudio_global.h"
#include <QValidator>
-class IpValidator : public QValidator
+class GUI_API_EXPORT IpValidator : public QValidator
{
public:
IpValidator(QObject* parent = 0);
diff --git a/SQLiteStudio3/guiSQLiteStudio/common/widgetcover.cpp b/SQLiteStudio3/guiSQLiteStudio/common/widgetcover.cpp
index 7cc6a4e..168c7f9 100644
--- a/SQLiteStudio3/guiSQLiteStudio/common/widgetcover.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/common/widgetcover.cpp
@@ -140,6 +140,11 @@ void WidgetCover::hide()
animation->start();
}
+void WidgetCover::setProgress(int value)
+{
+ busyBar->setValue(value);
+}
+
QEasingCurve WidgetCover::getEasingCurve() const
{
return easingCurve;
@@ -192,6 +197,37 @@ bool WidgetCover::eventFilter(QObject* obj, QEvent* e)
return false;
}
+void WidgetCover::displayProgress(int maxValue, const QString& format)
+{
+ if (!busyBar)
+ return;
+
+ busyBar->setRange(0, maxValue);
+ if (!format.isNull())
+ busyBar->setFormat(format);
+
+ busyBar->setTextVisible(true);
+}
+
+void WidgetCover::noDisplayProgress()
+{
+ if (!busyBar)
+ return;
+
+ busyBar->setRange(0, 0);
+ busyBar->setTextVisible(true);
+}
+
+void WidgetCover::initWithProgressBarOnly(const QString& format)
+{
+ busyBar = new QProgressBar();
+ busyBar->setRange(0, 100);
+ busyBar->setFormat(format);
+ busyBar->setTextVisible(true);
+
+ containerLayout->addWidget(busyBar, 0, 0);
+}
+
void WidgetCover::initWithInterruptContainer(const QString& interruptButtonText)
{
cancelButton = new QPushButton();
diff --git a/SQLiteStudio3/guiSQLiteStudio/common/widgetcover.h b/SQLiteStudio3/guiSQLiteStudio/common/widgetcover.h
index d0ccef7..0b7a2f5 100644
--- a/SQLiteStudio3/guiSQLiteStudio/common/widgetcover.h
+++ b/SQLiteStudio3/guiSQLiteStudio/common/widgetcover.h
@@ -22,16 +22,15 @@ class GUI_API_EXPORT WidgetCover : public QWidget
QEasingCurve getEasingCurve() const;
void setEasingCurve(const QEasingCurve& value);
-
int getDuration() const;
void setDuration(int value);
-
int getTransparency() const;
void setTransparency(int value);
-
QGridLayout* getContainerLayout();
bool eventFilter(QObject* obj, QEvent* e);
-
+ void displayProgress(int maxValue, const QString& format = QString());
+ void noDisplayProgress();
+ void initWithProgressBarOnly(const QString& format);
void initWithInterruptContainer(const QString& interruptButtonText = QString());
private:
@@ -67,6 +66,7 @@ class GUI_API_EXPORT WidgetCover : public QWidget
public slots:
void show();
void hide();
+ void setProgress(int value);
};
#endif // WIDGETCOVER_H
diff --git a/SQLiteStudio3/guiSQLiteStudio/datagrid/sqlquerymodel.cpp b/SQLiteStudio3/guiSQLiteStudio/datagrid/sqlquerymodel.cpp
index 8024abf..ac97283 100644
--- a/SQLiteStudio3/guiSQLiteStudio/datagrid/sqlquerymodel.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/datagrid/sqlquerymodel.cpp
@@ -385,14 +385,19 @@ void SqlQueryModel::commitInternal(const QList<SqlQueryItem*>& items)
// Grouping by row and commiting
QList<QList<SqlQueryItem*>> groupedItems = groupItemsByRows(items);
+ emit aboutToCommit(groupedItems.size());
+
+ int step = 1;
+ rowsDeletedSuccessfullyInTheCommit.clear();
bool ok = true;
- foreach (const QList<SqlQueryItem*>& itemsInRow, groupedItems)
+ for (const QList<SqlQueryItem*>& itemsInRow : groupedItems)
{
if (!commitRow(itemsInRow))
{
ok = false;
break;
}
+ emit commitingStepFinished(step++);
}
// Getting current uncommited list (after rows deletion it may be different)
@@ -417,15 +422,21 @@ void SqlQueryModel::commitInternal(const QList<SqlQueryItem*>& items)
else
{
// Commited successfully
- foreach (SqlQueryItem* item, itemsLeft)
+ for (SqlQueryItem* item : itemsLeft)
{
item->setUncommited(false);
item->setNewRow(false);
}
+ qSort(rowsDeletedSuccessfullyInTheCommit);
+ int removeOffset = 0;
+ for (int row : rowsDeletedSuccessfullyInTheCommit)
+ removeRow(row - removeOffset++); // deleting row decrements all rows below
+
emit commitStatusChanged(getUncommitedItems().size() > 0);
}
}
+ rowsDeletedSuccessfullyInTheCommit.clear();
if (!ok)
{
@@ -447,6 +458,8 @@ void SqlQueryModel::commitInternal(const QList<SqlQueryItem*>& items)
int itemsAddedDeletedDelta = numberOfItemsAdded - numberOfItemsDeleted;
recalculateRowsAndPages(itemsAddedDeletedDelta);
+
+ emit commitFinished();
}
void SqlQueryModel::rollbackInternal(const QList<SqlQueryItem*>& items)
@@ -604,7 +617,8 @@ bool SqlQueryModel::commitDeletedRow(const QList<SqlQueryItem*>& itemsInRow)
}
int row = itemsInRow[0]->index().row();
- return removeRow(row);
+ rowsDeletedSuccessfullyInTheCommit << row;
+ return true;
}
void SqlQueryModel::rollbackAddedRow(const QList<SqlQueryItem*>& itemsInRow)
diff --git a/SQLiteStudio3/guiSQLiteStudio/datagrid/sqlquerymodel.h b/SQLiteStudio3/guiSQLiteStudio/datagrid/sqlquerymodel.h
index 3e92bb2..062af95 100644
--- a/SQLiteStudio3/guiSQLiteStudio/datagrid/sqlquerymodel.h
+++ b/SQLiteStudio3/guiSQLiteStudio/datagrid/sqlquerymodel.h
@@ -351,6 +351,8 @@ class GUI_API_EXPORT SqlQueryModel : public QStandardItemModel
*/
QList<bool> columnEditionStatus;
+ QList<int> rowsDeletedSuccessfullyInTheCommit;
+
private slots:
void handleExecFinished(SqlQueryPtr results);
void handleExecFailed(int code, QString errorMessage);
@@ -446,6 +448,10 @@ class GUI_API_EXPORT SqlQueryModel : public QStandardItemModel
* Emitted after columns header sorting has been changed.
*/
void sortingUpdated(const QueryExecutor::SortList& sortOrder);
+
+ void aboutToCommit(int totalSteps);
+ void commitingStepFinished(int step);
+ void commitFinished();
};
Q_DECLARE_OPERATORS_FOR_FLAGS(SqlQueryModel::Features)
diff --git a/SQLiteStudio3/guiSQLiteStudio/dataview.cpp b/SQLiteStudio3/guiSQLiteStudio/dataview.cpp
index e99b9b8..32efae4 100644
--- a/SQLiteStudio3/guiSQLiteStudio/dataview.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/dataview.cpp
@@ -11,6 +11,7 @@
#include "iconmanager.h"
#include "uiconfig.h"
#include "datagrid/sqlqueryitem.h"
+#include "common/widgetcover.h"
#include <QDebug>
#include <QHeaderView>
#include <QVBoxLayout>
@@ -42,6 +43,7 @@ void DataView::init(SqlQueryModel* model)
formViewRowCountLabel = new QLabel();
formViewCurrentRowLabel = new QLabel();
+ initWidgetCover();
initFormView();
initPageEdit();
initFilter();
@@ -139,6 +141,15 @@ void DataView::initPageEdit()
connect(pageEdit, SIGNAL(editingFinished()), this, SLOT(pageEntered()));
}
+void DataView::initWidgetCover()
+{
+ widgetCover = new WidgetCover(this);
+ widgetCover->initWithProgressBarOnly("%v / %m");
+ connect(model, SIGNAL(aboutToCommit(int)), this, SLOT(coverForGridCommit(int)));
+ connect(model, SIGNAL(commitingStepFinished(int)), this, SLOT(updateGridCommitCover(int)));
+ connect(model, SIGNAL(commitFinished()), this, SLOT(hideGridCommitCover()));
+}
+
void DataView::createActions()
{
bool rowInserting = model->features().testFlag(SqlQueryModel::INSERT_ROW);
@@ -438,6 +449,34 @@ void DataView::filterModeSelected()
actionMap[FILTER]->setIcon(modeAction->icon());
}
+void DataView::coverForGridCommit(int total)
+{
+ if (total <= 3)
+ return;
+
+ widgetCover->displayProgress(total);
+ widgetCover->show();
+ QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+}
+
+void DataView::updateGridCommitCover(int value)
+{
+ if (!widgetCover->isVisible())
+ return;
+
+ widgetCover->setProgress(value);
+ QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+}
+
+void DataView::hideGridCommitCover()
+{
+ if (!widgetCover->isVisible())
+ return;
+
+ widgetCover->hide();
+ QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+}
+
void DataView::updateCommitRollbackActions(bool enabled)
{
gridView->getAction(SqlQueryView::COMMIT)->setEnabled(enabled);
diff --git a/SQLiteStudio3/guiSQLiteStudio/dataview.h b/SQLiteStudio3/guiSQLiteStudio/dataview.h
index 5207fdb..64bbb07 100644
--- a/SQLiteStudio3/guiSQLiteStudio/dataview.h
+++ b/SQLiteStudio3/guiSQLiteStudio/dataview.h
@@ -13,6 +13,7 @@ class FormView;
class ExtLineEdit;
class QLabel;
class IntValidator;
+class WidgetCover;
CFG_KEY_LIST(DataView, QObject::tr("Data view (both grid and form)"),
CFG_KEY_ENTRY(REFRESH_DATA, Qt::Key_F5, QObject::tr("Refresh data"))
@@ -115,6 +116,7 @@ class GUI_API_EXPORT DataView : public QTabWidget, public ExtActionContainer
void initUpdates();
void initSlots();
void initPageEdit();
+ void initWidgetCover();
void createContents();
void goToFormRow(IndexModifier idxMod);
void setNavigationState(bool enabled);
@@ -153,6 +155,7 @@ class GUI_API_EXPORT DataView : public QTabWidget, public ExtActionContainer
QMutex manualPageChangeMutex;
bool uncommittedGrid = false;
bool uncommittedForm = false;
+ WidgetCover* widgetCover = nullptr;
signals:
@@ -193,6 +196,9 @@ class GUI_API_EXPORT DataView : public QTabWidget, public ExtActionContainer
void showFormView();
void updateTabsMode();
void filterModeSelected();
+ void coverForGridCommit(int total);
+ void updateGridCommitCover(int value);
+ void hideGridCommitCover();
};
int qHash(DataView::ActionGroup action);
diff --git a/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtree.cpp b/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtree.cpp
index 509594d..1aeff0f 100644
--- a/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtree.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtree.cpp
@@ -136,6 +136,7 @@ void DbTree::createActions()
createAction(CLEAR_FILTER, tr("Clear filter"), ui->nameFilter, SLOT(clear()), this);
createAction(REFRESH_SCHEMAS, ICONS.DATABASE_RELOAD, tr("Refresh all database schemas"), this, SLOT(refreshSchemas()), this);
createAction(REFRESH_SCHEMA, ICONS.DATABASE_RELOAD, tr("Refresh selected database schema"), this, SLOT(refreshSchema()), this);
+ createAction(ERASE_TABLE_DATA, ICONS.ERASE_TABLE_DATA, tr("Erase table data"), this, SLOT(eraseTableData()), this);
}
void DbTree::updateActionStates(const QStandardItem *item)
@@ -189,7 +190,7 @@ void DbTree::updateActionStates(const QStandardItem *item)
break;
case DbTreeItem::Type::TABLE:
enabled << EDIT_TABLE << DEL_TABLE << EXPORT_TABLE << IMPORT_TABLE << POPULATE_TABLE << ADD_COLUMN << CREATE_SIMILAR_TABLE;
- enabled << RESET_AUTOINCREMENT << ADD_INDEX << ADD_TRIGGER;
+ enabled << RESET_AUTOINCREMENT << ADD_INDEX << ADD_TRIGGER << ERASE_TABLE_DATA;
break;
case DbTreeItem::Type::VIRTUAL_TABLE:
// TODO change below when virtual tables can be edited
@@ -393,6 +394,7 @@ void DbTree::setupActionsForMenu(DbTreeItem* currItem, QMenu* contextMenu)
actions += ActionEntry(POPULATE_TABLE);
actions += ActionEntry(CREATE_SIMILAR_TABLE);
actions += ActionEntry(RESET_AUTOINCREMENT);
+ actions += ActionEntry(ERASE_TABLE_DATA);
actions += ActionEntry(_separator);
actions += dbEntryExt;
break;
@@ -1399,6 +1401,35 @@ void DbTree::resetAutoincrement()
notifyInfo(tr("Autoincrement value for table '%1' has been reset successfly.").arg(table));
}
+void DbTree::eraseTableData()
+{
+ Db* db = getSelectedDb();
+ if (!db || !db->isValid())
+ return;
+
+ DbTreeItem* item = ui->treeView->currentItem();
+ QString table = item->getTable();
+ if (table.isNull())
+ {
+ qWarning() << "Tried to erase table data, while table wasn't selected in DbTree.";
+ return;
+ }
+
+ QMessageBox::StandardButton btn = QMessageBox::question(this, tr("Erase table data"), tr("Are you sure you want to delete all data from table '%1'?")
+ .arg(table));
+ if (btn != QMessageBox::Yes)
+ return;
+
+ SqlQueryPtr res = db->exec(QString("DELETE FROM %1;").arg(wrapObjIfNeeded(table, db->getDialect())));
+ if (res->isError())
+ {
+ notifyError(tr("An error occurred while trying to delete data from table '%1': %2").arg(table, res->getErrorText()));
+ return;
+ }
+
+ notifyInfo(tr("All data has been deleted for table '%1'.").arg(table));
+}
+
void DbTree::addColumn(DbTreeItem* item)
{
Db* db = getSelectedOpenDb();
@@ -1591,6 +1622,11 @@ void DbTree::setupDefShortcuts()
BIND_SHORTCUTS(DbTree, Action);
}
+void DbTree::closeEvent(QCloseEvent *e)
+{
+ e->ignore();
+}
+
int qHash(DbTree::Action action)
{
return static_cast<int>(action);
diff --git a/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtree.h b/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtree.h
index 60b8dd5..2f5583e 100644
--- a/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtree.h
+++ b/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtree.h
@@ -84,6 +84,7 @@ class GUI_API_EXPORT DbTree : public QDockWidget, public ExtActionContainer
REFRESH_SCHEMA,
CREATE_SIMILAR_TABLE,
RESET_AUTOINCREMENT,
+ ERASE_TABLE_DATA,
_separator // Never use it directly, it's just for menu setup
};
@@ -116,6 +117,7 @@ class GUI_API_EXPORT DbTree : public QDockWidget, public ExtActionContainer
protected:
void createActions();
void setupDefShortcuts();
+ void closeEvent(QCloseEvent* e);
private:
void setActionEnabled(int action, bool enabled);
@@ -187,6 +189,7 @@ class GUI_API_EXPORT DbTree : public QDockWidget, public ExtActionContainer
void integrityCheck();
void createSimilarTable();
void resetAutoincrement();
+ void eraseTableData();
void addColumn(DbTreeItem* item);
void editColumn(DbTreeItem* item);
void delColumn(DbTreeItem* item);
diff --git a/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreemodel.cpp b/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreemodel.cpp
index a4e736f..78f0db8 100644
--- a/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreemodel.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreemodel.cpp
@@ -250,8 +250,19 @@ void DbTreeModel::restoreGroup(const Config::DbGroupPtr& group, QList<Db*>* dbLi
{
if (db)
{
- if (db->open())
+ // If the db was stored in cfg as open, it was already open by DbManager.
+ // Now the DbTreeModel didn't catch that (as it didn't exist yet), so we need to
+ // call handler for 'connected' event, instead of forcing another open call.
+ // Otherwise the database that could not be open would be requested to open twice:
+ // 1. when restoring DbManager
+ // 2. here
+ // Instead of that, we just check if the database is already open (by DbManager)
+ // and call proper handler to refresh database's schema and create tree nodes.
+ if (db->isOpen())
+ {
+ dbConnected(db);
treeView->expand(item->index());
+ }
}
else
{
@@ -401,8 +412,12 @@ QString DbTreeModel::getDbToolTip(DbTreeItem* item) const
QStringList rows;
Db* db = item->getDb();
- QFile dbFile(db->getPath());
QString iconPath = db->isValid() ? ICONS.DATABASE.toImgSrc() : ICONS.DATABASE_INVALID.toImgSrc();
+ int fileSize = -1;
+
+ QUrl url(db->getPath());
+ if (url.scheme().isEmpty() || url.scheme() == "file")
+ fileSize = QFile(db->getPath()).size();
rows << toolTipHdrRowTmp.arg(iconPath).arg(tr("Database: %1", "dbtree tooltip").arg(db->getName()));
rows << toolTipRowTmp.arg("URI:").arg(db->getPath());
@@ -410,13 +425,17 @@ QString DbTreeModel::getDbToolTip(DbTreeItem* item) const
if (db->isValid())
{
rows << toolTipRowTmp.arg(tr("Version:", "dbtree tooltip")).arg(QString("SQLite %1").arg(db->getVersion()));
- rows << toolTipRowTmp.arg(tr("File size:", "dbtree tooltip")).arg(formatFileSize(dbFile.size()));
- rows << toolTipRowTmp.arg(tr("Encoding:", "dbtree tooltip")).arg(db->getEncoding());
+
+ if (fileSize > -1)
+ rows << toolTipRowTmp.arg(tr("File size:", "dbtree tooltip")).arg(formatFileSize(fileSize));
+
+ if (db->isOpen())
+ rows << toolTipRowTmp.arg(tr("Encoding:", "dbtree tooltip")).arg(db->getEncoding());
}
else
{
InvalidDb* idb = dynamic_cast<InvalidDb*>(db);
- rows << toolTipRowTmp.arg(tr("Error details:", "dbtree tooltip")).arg(idb->getError());
+ rows << toolTipRowTmp.arg(tr("Error:", "dbtree tooltip")).arg(idb->getError());
}
return toolTipTableTmp.arg(rows.join(""));
diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/dbdialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/dbdialog.cpp
index 05d50af..ac7cd8a 100644
--- a/SQLiteStudio3/guiSQLiteStudio/dialogs/dbdialog.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/dbdialog.cpp
@@ -455,10 +455,6 @@ bool DbDialog::testDatabase()
if (url.scheme().isEmpty())
url.setScheme("file");
- bool existed = false;
- if (url.isLocalFile() && QFile::exists(path))
- existed = QFile::exists(path);
-
QHash<QString, QVariant> options = collectOptions();
DbPlugin* plugin = dbPlugins[ui->typeCombo->currentText()];
Db* testDb = plugin->getInstance("", path, options);
@@ -466,15 +462,14 @@ bool DbDialog::testDatabase()
bool res = false;
if (testDb)
{
- res = true;
+ if (testDb->openForProbing())
+ {
+ res = !testDb->getEncoding().isEmpty();
+ testDb->closeQuiet();
+ }
delete testDb;
}
- if (!existed)
- {
- QFile file(path);
- file.remove();
- }
return res;
}
@@ -605,7 +600,12 @@ void DbDialog::browseClicked()
{
if (customBrowseHandler)
{
- customBrowseHandler(ui->fileEdit->text());
+ QString newUrl = customBrowseHandler(ui->fileEdit->text());
+ if (!newUrl.isNull())
+ {
+ ui->fileEdit->setText(newUrl);
+ updateState();
+ }
return;
}
diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp
index ca3fd31..7861ff0 100644
--- a/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp
@@ -51,7 +51,9 @@ void PopulateDialog::init()
pluginTitles << plugin->getTitle();
widgetCover = new WidgetCover(this);
+ widgetCover->initWithInterruptContainer(tr("Abort"));
widgetCover->setVisible(false);
+ connect(widgetCover, SIGNAL(cancelClicked()), POPULATE_MANAGER, SLOT(interrupt()));
ui->scrollArea->setAutoFillBackground(false);
ui->scrollArea->viewport()->setAutoFillBackground(false);
@@ -71,6 +73,7 @@ void PopulateDialog::init()
connect(ui->databaseCombo, SIGNAL(currentTextChanged(QString)), this, SLOT(refreshTables()));
connect(ui->tableCombo, SIGNAL(currentTextChanged(QString)), this, SLOT(refreshColumns()));
connect(POPULATE_MANAGER, SIGNAL(populatingFinished()), widgetCover, SLOT(hide()));
+ connect(POPULATE_MANAGER, SIGNAL(finishedStep(int)), widgetCover, SLOT(setProgress(int)));
connect(POPULATE_MANAGER, SIGNAL(populatingSuccessful()), this, SLOT(finished()));
}
@@ -317,10 +320,20 @@ void PopulateDialog::accept()
QString table = ui->tableCombo->currentText();
qint64 rows = ui->rowsSpin->value();
+ started = true;
+ widgetCover->displayProgress(rows, "%v / %m");
widgetCover->show();
POPULATE_MANAGER->populate(db, table, engines, rows);
}
+void PopulateDialog::reject()
+{
+ if (started)
+ POPULATE_MANAGER->interrupt();
+
+ QDialog::reject();
+}
+
PopulateDialog::ColumnEntry::ColumnEntry(QCheckBox* check, QComboBox* combo, QToolButton* button) :
check(check), combo(combo), button(button)
{
diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h b/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h
index 0ecc318..948d6ce 100644
--- a/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h
+++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.h
@@ -58,6 +58,7 @@ class GUI_API_EXPORT PopulateDialog : public QDialog
QSignalMapper* buttonMapper = nullptr;
QHash<int,bool> columnsValid;
WidgetCover* widgetCover = nullptr;
+ bool started = false;
private slots:
void refreshTables();
@@ -71,6 +72,7 @@ class GUI_API_EXPORT PopulateDialog : public QDialog
public:
void accept();
+ void reject();
};
#endif // POPULATEDIALOG_H
diff --git a/SQLiteStudio3/guiSQLiteStudio/iconmanager.h b/SQLiteStudio3/guiSQLiteStudio/iconmanager.h
index cf4f2ec..940c869 100644
--- a/SQLiteStudio3/guiSQLiteStudio/iconmanager.h
+++ b/SQLiteStudio3/guiSQLiteStudio/iconmanager.h
@@ -90,6 +90,7 @@ class GUI_API_EXPORT IconManager : public QObject
DEF_ICON(DATABASE_ONLINE, "database_online")
DEF_ICON(DATABASE_RELOAD, "database_reload")
DEF_ICON(DDL_HISTORY, "ddl_history")
+ DEF_ICON(DELETE, "delete")
DEF_ICON(DELETE_ROW, "delete_row")
DEF_ICO3(DELETE_COLLATION, DELETE_ROW)
DEF_ICO3(DELETE_DATATYPE, DELETE_ROW)
@@ -104,6 +105,7 @@ class GUI_API_EXPORT IconManager : public QObject
DEF_ICON(DIRECTORY_OPEN_WITH_DB, "directory_open_with_db")
DEF_ICON(DIRECTORY_WITH_DB, "directory_with_db")
DEF_ICON(ERASE, "erase")
+ DEF_ICON(ERASE_TABLE_DATA, "erase_table_data")
DEF_ICON(EXEC_QUERY, "exec_query")
DEF_ICON(EXPLAIN_QUERY, "explain_query")
DEF_ICON(EXPORT, "export")
diff --git a/SQLiteStudio3/guiSQLiteStudio/icons.qrc b/SQLiteStudio3/guiSQLiteStudio/icons.qrc
index 6612814..9cf981d 100644
--- a/SQLiteStudio3/guiSQLiteStudio/icons.qrc
+++ b/SQLiteStudio3/guiSQLiteStudio/icons.qrc
@@ -191,5 +191,7 @@
<file>img/go_back.png</file>
<file>img/reset_autoincrement.png</file>
<file>img/plus.png</file>
+ <file>img/erase_table_data.png</file>
+ <file>img/delete.png</file>
</qresource>
</RCC>
diff --git a/SQLiteStudio3/guiSQLiteStudio/img/delete.png b/SQLiteStudio3/guiSQLiteStudio/img/delete.png
new file mode 100644
index 0000000..20d6f5e
--- /dev/null
+++ b/SQLiteStudio3/guiSQLiteStudio/img/delete.png
Binary files differ
diff --git a/SQLiteStudio3/guiSQLiteStudio/img/erase_table_data.png b/SQLiteStudio3/guiSQLiteStudio/img/erase_table_data.png
new file mode 100644
index 0000000..a07585a
--- /dev/null
+++ b/SQLiteStudio3/guiSQLiteStudio/img/erase_table_data.png
Binary files differ
diff --git a/SQLiteStudio3/guiSQLiteStudio/translations/guiSQLiteStudio_sk.ts b/SQLiteStudio3/guiSQLiteStudio/translations/guiSQLiteStudio_sk.ts
index 26e0fb1..42a735f 100644
--- a/SQLiteStudio3/guiSQLiteStudio/translations/guiSQLiteStudio_sk.ts
+++ b/SQLiteStudio3/guiSQLiteStudio/translations/guiSQLiteStudio_sk.ts
@@ -1028,7 +1028,7 @@ but it&apos;s okay to use it.</source>
<message>
<location filename="../dialogs/configdialog.ui" line="501"/>
<source>Execute only the query under the cursor</source>
- <translation type="unfinished"></translation>
+ <translation>Vykonať len dotaz, na ktorom stojí kurzor</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="514"/>
@@ -1089,12 +1089,12 @@ but it&apos;s okay to use it.</source>
<message>
<location filename="../dialogs/configdialog.ui" line="688"/>
<source>Sort table columns alphabetically</source>
- <translation type="unfinished"></translation>
+ <translation>Zoradiť stĺpce tabuľky abecedne</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="698"/>
<source>Expand tables node when connected to a database</source>
- <translation type="unfinished"></translation>
+ <translation>Rozbaliť zoznam tabuliek po pripojení k databáze</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="708"/>
@@ -1104,7 +1104,7 @@ but it&apos;s okay to use it.</source>
<message>
<location filename="../dialogs/configdialog.ui" line="711"/>
<source>Display additional labels on the list</source>
- <translation type="unfinished"></translation>
+ <translation>Zobraziť doplnkové popisky v zozname</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="726"/>
@@ -1114,7 +1114,7 @@ but it&apos;s okay to use it.</source>
<message>
<location filename="../dialogs/configdialog.ui" line="729"/>
<source>Display labels for regular tables</source>
- <translation type="unfinished"></translation>
+ <translation>Zobraziť popisky pre regulárne tabuľky</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="739"/>
@@ -1124,12 +1124,12 @@ but it&apos;s okay to use it.</source>
<message>
<location filename="../dialogs/configdialog.ui" line="742"/>
<source>Display labels for virtual tables</source>
- <translation type="unfinished"></translation>
+ <translation>Zobraziť popisky pre virtuálne tabuľky</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="755"/>
<source>Expand views node when connected to a database</source>
- <translation type="unfinished"></translation>
+ <translation>Rozbaliť zoznam pohľadov po pripojení k databáze</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="765"/>
@@ -1139,42 +1139,42 @@ but it&apos;s okay to use it.</source>
<message>
<location filename="../dialogs/configdialog.ui" line="768"/>
<source>Sort objects (tables, indexes, triggers and views) alphabetically</source>
- <translation type="unfinished"></translation>
+ <translation>Zoradiť objekty (tabuľky, indexy, spúšťače a pohľady) abecedne</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="778"/>
<source>Display system tables and indexes on the list</source>
- <translation type="unfinished"></translation>
+ <translation>Zobraziť systémové tabuľky a indexy v zozname</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="791"/>
<source>Table windows</source>
- <translation type="unfinished"></translation>
+ <translation>Okná tabuľky</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="797"/>
<source>When enabled, Table Windows will show up with the data tab, instead of the structure tab.</source>
- <translation type="unfinished"></translation>
+ <translation>Ak je táto možnosť zaškrtnutá, tak sa v okne zobrazia dáta a nie štruktúra tabuľky.</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="800"/>
<source>Open Table Windows with the data tab for start</source>
- <translation type="unfinished"></translation>
+ <translation>Zobraziť dáta po otvorení tabuľky</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="813"/>
<source>View windows</source>
- <translation type="unfinished"></translation>
+ <translation>Okná pohľadov</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="819"/>
<source>When enabled, View Windows will show up with the data tab, instead of the structure tab.</source>
- <translation type="unfinished"></translation>
+ <translation>Ak je táto možnosť zaškrtnutá, tak sa v okne zobrazia dáta a nie SQL dotaz.</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="822"/>
<source>Open View Windows with the data tab for start</source>
- <translation type="unfinished"></translation>
+ <translation>Zobraziť dáta po otvorení pohľadu</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="933"/>
@@ -1184,22 +1184,22 @@ but it&apos;s okay to use it.</source>
<message>
<location filename="../dialogs/configdialog.ui" line="962"/>
<source>Current style:</source>
- <translation type="unfinished"></translation>
+ <translation>Aktuálny štýl:</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="979"/>
<source>Preview</source>
- <translation type="unfinished"></translation>
+ <translation>Náhľad</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="989"/>
<source>Enabled</source>
- <translation type="unfinished"></translation>
+ <translation>Zapnutý</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="1162"/>
<source>Disabled</source>
- <translation type="unfinished"></translation>
+ <translation>Vypnutý</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="1211"/>
@@ -1209,17 +1209,17 @@ but it&apos;s okay to use it.</source>
<message>
<location filename="../dialogs/configdialog.ui" line="1249"/>
<source>SQL editor font</source>
- <translation type="unfinished"></translation>
+ <translation>Písmo SQL editora</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="1265"/>
<source>Database list font</source>
- <translation type="unfinished"></translation>
+ <translation>Font zoznamu databáz</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="1281"/>
<source>Database list additional label font</source>
- <translation type="unfinished"></translation>
+ <translation>Font doplnkového popisku</translation>
</message>
<message>
<location filename="../dialogs/configdialog.ui" line="1297"/>
@@ -1835,7 +1835,7 @@ Prezeranie ďalších strán bude možné až po dokončení spočítavania.</tr
<message>
<location filename="../dialogs/dbdialog.ui" line="26"/>
<source>Database type</source>
- <translation type="unfinished"></translation>
+ <translation>Typ databázy</translation>
</message>
<message>
<location filename="../dialogs/dbdialog.ui" line="32"/>
@@ -1845,22 +1845,22 @@ Prezeranie ďalších strán bude možné až po dokončení spočítavania.</tr
<message>
<location filename="../dialogs/dbdialog.ui" line="95"/>
<source>Generate automatically</source>
- <translation type="unfinished"></translation>
+ <translation>Generovať automaticky</translation>
</message>
<message>
<location filename="../dialogs/dbdialog.ui" line="108"/>
<source>Options</source>
- <translation type="unfinished">Voľby</translation>
+ <translation>Voľby</translation>
</message>
<message>
<location filename="../dialogs/dbdialog.ui" line="117"/>
<source>Permanent (keep it in configuration)</source>
- <translation type="unfinished"></translation>
+ <translation>Zapamätať si databázu</translation>
</message>
<message>
<location filename="../dialogs/dbdialog.ui" line="161"/>
<source>Test connection</source>
- <translation type="unfinished"></translation>
+ <translation>Test spojenia</translation>
</message>
<message>
<source>Name</source>
@@ -1877,7 +1877,7 @@ Prezeranie ďalších strán bude možné až po dokončení spočítavania.</tr
<message>
<location filename="../dialogs/dbdialog.ui" line="51"/>
<source>Create new database file</source>
- <translation type="unfinished"></translation>
+ <translation>Vytvoriť nový databázový súbor</translation>
</message>
<message>
<location filename="../dialogs/dbdialog.ui" line="42"/>
@@ -1888,7 +1888,7 @@ Prezeranie ďalších strán bude možné až po dokončení spočítavania.</tr
<message>
<location filename="../dialogs/dbdialog.ui" line="79"/>
<source>Name (on the list)</source>
- <translation type="unfinished"></translation>
+ <translation>Názov (v zozname)</translation>
</message>
<message>
<location filename="../dialogs/dbdialog.ui" line="92"/>
@@ -1912,7 +1912,7 @@ Prezeranie ďalších strán bude možné až po dokončení spočítavania.</tr
<message>
<location filename="../dialogs/dbdialog.cpp" line="150"/>
<source>Browse for existing database file on local computer</source>
- <translation type="unfinished"></translation>
+ <translation>Hľadať databázový súbor na lokálnom počítači</translation>
</message>
<message>
<location filename="../dialogs/dbdialog.cpp" line="283"/>
@@ -1947,7 +1947,7 @@ Prezeranie ďalších strán bude možné až po dokončení spočítavania.</tr
<message>
<location filename="../dialogs/dbdialog.cpp" line="585"/>
<source>Auto-generated</source>
- <translation type="unfinished"></translation>
+ <translation>Automaticky vygenerovaný</translation>
</message>
<message>
<source>The name will be auto-generated</source>
@@ -3325,7 +3325,7 @@ Please enter new, unique name, or press &apos;%1&apos; to abort the operation:</
<message>
<location filename="../dialogs/indexdialog.cpp" line="454"/>
<source>Cannot create unique index, because values in selected columns are not unique. Would you like to execute SELECT query to see problematic values?</source>
- <translation type="unfinished"></translation>
+ <translation>Nemôžem vytvoriť jedinečný index, pretože hodnoty vo vybraných stĺpcoch nie sú jedinečné. Chcete spustiť dotaz SELECT na zobrazenie problematických hodnôt?</translation>
</message>
<message>
<location filename="../dialogs/indexdialog.cpp" line="466"/>
@@ -4265,7 +4265,7 @@ Please enter new, unique name, or press &apos;%1&apos; to abort the operation:</
<message>
<location filename="../multieditor/multieditortext.h" line="12"/>
<source>Cell text value editor</source>
- <translation type="unfinished"></translation>
+ <translation>Úprava hodnôt v bunkách</translation>
</message>
<message>
<location filename="../multieditor/multieditortext.h" line="13"/>
@@ -4401,7 +4401,7 @@ Please enter new, unique name, or press &apos;%1&apos; to abort the operation:</
<message>
<location filename="../windows/editorwindow.h" line="26"/>
<source>SQL editor window</source>
- <translation type="unfinished"></translation>
+ <translation>Okno SQL editora</translation>
</message>
<message>
<location filename="../windows/editorwindow.h" line="27"/>
@@ -4411,42 +4411,42 @@ Please enter new, unique name, or press &apos;%1&apos; to abort the operation:</
<message>
<location filename="../windows/editorwindow.h" line="28"/>
<source>Execute &quot;%1&quot; query</source>
- <translation type="unfinished"></translation>
+ <translation>Vykonať &quot;%1&quot; dotaz</translation>
</message>
<message>
<location filename="../windows/editorwindow.h" line="29"/>
<source>Switch current working database to previous on the list</source>
- <translation type="unfinished"></translation>
+ <translation>Prepnúť sa na predchádzajúcu databázu v zozname</translation>
</message>
<message>
<location filename="../windows/editorwindow.h" line="30"/>
<source>Switch current working database to next on the list</source>
- <translation type="unfinished"></translation>
+ <translation>Prepnúť sa na nasledujúcu databázu v zozname</translation>
</message>
<message>
<location filename="../windows/editorwindow.h" line="31"/>
<source>Go to next editor tab</source>
- <translation type="unfinished"></translation>
+ <translation>Prechod na nasledujúcu záložku editora</translation>
</message>
<message>
<location filename="../windows/editorwindow.h" line="32"/>
<source>Go to previous editor tab</source>
- <translation type="unfinished"></translation>
+ <translation>Prechod na predchádzajúcu záložku editora</translation>
</message>
<message>
<location filename="../windows/editorwindow.h" line="33"/>
<source>Move keyboard input focus to the results view below</source>
- <translation type="unfinished"></translation>
+ <translation>Prepnúť kurzor na výsledky</translation>
</message>
<message>
<location filename="../windows/editorwindow.h" line="34"/>
<source>Move keyboard input focus to the SQL editor above</source>
- <translation type="unfinished"></translation>
+ <translation>Prepnúť kurzor do editora</translation>
</message>
<message>
<location filename="../windows/tablewindow.h" line="30"/>
<source>Table window</source>
- <translation type="unfinished"></translation>
+ <translation>Okno tabuľky</translation>
</message>
<message>
<location filename="../windows/tablewindow.h" line="31"/>
@@ -4491,7 +4491,7 @@ Please enter new, unique name, or press &apos;%1&apos; to abort the operation:</
<message>
<location filename="../windows/tablewindow.h" line="39"/>
<source>Delete selected table constraint</source>
- <translation>Vymazaťˇvybrané obmedzenie</translation>
+ <translation>Vymazať vybrané obmedzenie</translation>
</message>
<message>
<location filename="../windows/tablewindow.h" line="40"/>
diff --git a/SQLiteStudio3/guiSQLiteStudio/uiconfig.h b/SQLiteStudio3/guiSQLiteStudio/uiconfig.h
index 3372979..b434dc8 100644
--- a/SQLiteStudio3/guiSQLiteStudio/uiconfig.h
+++ b/SQLiteStudio3/guiSQLiteStudio/uiconfig.h
@@ -85,9 +85,9 @@ CFG_CATEGORIES(Ui,
)
)
-QString getFileDialogInitPath();
-void setFileDialogInitPath(const QString& path);
-void setFileDialogInitPathByFile(const QString& filePath);
+GUI_API_EXPORT QString getFileDialogInitPath();
+GUI_API_EXPORT void setFileDialogInitPath(const QString& path);
+GUI_API_EXPORT void setFileDialogInitPathByFile(const QString& filePath);
#define CFG_UI CFG_INSTANCE(Ui)
diff --git a/SQLiteStudio3/guiSQLiteStudio/uidebug.cpp b/SQLiteStudio3/guiSQLiteStudio/uidebug.cpp
index 00aaac4..a2ce9f8 100644
--- a/SQLiteStudio3/guiSQLiteStudio/uidebug.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/uidebug.cpp
@@ -12,6 +12,8 @@ bool UI_DEBUG_ENABLED = false;
bool UI_DEBUG_CONSOLE = true;
QString UI_DEBUG_FILE;
+QStringList MsgHandlerThreadProxy::ignoredWarnings;
+
void uiMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
if (!UI_DEBUG_ENABLED)
@@ -100,6 +102,9 @@ MsgHandlerThreadProxy::~MsgHandlerThreadProxy()
void MsgHandlerThreadProxy::init()
{
+ ignoredWarnings << QStringLiteral("libpng warning: Unknown iTXt compression type or method");
+ ignoredWarnings << QStringLiteral("QPainter::font: Painter not active");
+
if (sqliteStudioUiDebugConsole)
{
connect(this, SIGNAL(debugRequested(QString)), sqliteStudioUiDebugConsole, SLOT(debug(QString)));
@@ -139,6 +144,9 @@ void MsgHandlerThreadProxy::debug(const QString &msg)
void MsgHandlerThreadProxy::warn(const QString &msg)
{
+ if (ignoredWarnings.contains(msg.mid(25)))
+ return;
+
emit warnRequested(msg);
}
diff --git a/SQLiteStudio3/guiSQLiteStudio/uidebug.h b/SQLiteStudio3/guiSQLiteStudio/uidebug.h
index d2a2a51..449eb29 100644
--- a/SQLiteStudio3/guiSQLiteStudio/uidebug.h
+++ b/SQLiteStudio3/guiSQLiteStudio/uidebug.h
@@ -20,6 +20,8 @@ class GUI_API_EXPORT MsgHandlerThreadProxy : public QObject
void init();
void initFile(const QString& fileName);
+ static QStringList ignoredWarnings;
+
QFile* outFile = nullptr;
QTextStream outFileStream;
diff --git a/SQLiteStudio3/guiSQLiteStudio/windows/tablewindow.cpp b/SQLiteStudio3/guiSQLiteStudio/windows/tablewindow.cpp
index 77a4adc..3a315db 100644
--- a/SQLiteStudio3/guiSQLiteStudio/windows/tablewindow.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/windows/tablewindow.cpp
@@ -621,20 +621,20 @@ bool TableWindow::restoreSession(const QVariant& sessionValue)
QHash<QString, QVariant> value = sessionValue.toHash();
if (value.size() == 0)
{
- notifyWarn("Could not restore window, because no database or table was stored in session for this window.");
+ notifyWarn(tr("Could not restore window %1, because no database or table was stored in session for this window.").arg(value["title"].toString()));
return false;
}
if (!value.contains("db") || !value.contains("table"))
{
- notifyWarn("Could not restore window, because no database or table was stored in session for this window.");
+ notifyWarn(tr("Could not restore window '%1', because no database or table was stored in session for this window.").arg(value["title"].toString()));
return false;
}
db = DBLIST->getByName(value["db"].toString());
if (!db || !db->isValid() || (!db->isOpen() && !db->open()))
{
- notifyWarn(tr("Could not restore window, because database %1 could not be resolved.").arg(value["db"].toString()));
+ notifyWarn(tr("Could not restore window '%1', because database %2 could not be resolved.").arg(value["title"].toString(), value["db"].toString()));
return false;
}
@@ -643,7 +643,7 @@ bool TableWindow::restoreSession(const QVariant& sessionValue)
SchemaResolver resolver(db);
if (!resolver.getTables(database).contains(table, Qt::CaseInsensitive))
{
- notifyWarn(tr("Could not restore window, because the table %1 doesn't exist in the database %2.").arg(table).arg(db->getName()));
+ notifyWarn(tr("Could not restore window '%1'', because the table %2 doesn't exist in the database %3.").arg(value["title"].toString(), table, db->getName()));
return false;
}
diff --git a/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.cpp b/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.cpp
index a699801..9a30e1c 100644
--- a/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.cpp
@@ -99,26 +99,26 @@ bool ViewWindow::restoreSession(const QVariant& sessionValue)
QHash<QString, QVariant> value = sessionValue.toHash();
if (value.size() == 0)
{
- notifyWarn("Could not restore window, because no database or view was stored in session for this window.");
+ notifyWarn(tr("Could not restore window '%1', because no database or view was stored in session for this window.").arg(value["title"].toString()));
return false;
}
if (!value.contains("db") || !value.contains("view"))
{
- notifyWarn("Could not restore window, because no database or view was stored in session for this window.");
+ notifyWarn(tr("Could not restore window '%1', because no database or view was stored in session for this window.").arg(value["title"].toString()));
return false;
}
db = DBLIST->getByName(value["db"].toString());
if (!db)
{
- notifyWarn(tr("Could not restore window, because database %1 could not be resolved.").arg(value["db"].toString()));
+ notifyWarn(tr("Could not restore window '%1', because database %2 could not be resolved.").arg(value["title"].toString(), value["db"].toString()));
return false;
}
if (!db->isOpen() && !db->open())
{
- notifyWarn(tr("Could not restore window, because database %1 could not be open.").arg(value["db"].toString()));
+ notifyWarn(tr("Could not restore window '%1', because database %2 could not be open.").arg(value["title"].toString(), value["db"].toString()));
return false;
}
@@ -127,7 +127,7 @@ bool ViewWindow::restoreSession(const QVariant& sessionValue)
SchemaResolver resolver(db);
if (!resolver.getViews(database).contains(view, Qt::CaseInsensitive))
{
- notifyWarn(tr("Could not restore window, because the view %1 doesn't exist in the database %2.").arg(view).arg(db->getName()));
+ notifyWarn(tr("Could not restore window '%1', because the view %2 doesn't exist in the database %3.").arg(value["title"].toString(), view, db->getName()));
return false;
}