diff options
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/dataview.cpp')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/dataview.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/dataview.cpp b/SQLiteStudio3/guiSQLiteStudio/dataview.cpp index 9012c1c..568954c 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dataview.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/dataview.cpp @@ -311,9 +311,13 @@ void DataView::resizeColumnsInitiallyToContents() } if (wd > CFG_UI.General.MaxInitialColumnWith.get()) + { gridView->setColumnWidth(i, CFG_UI.General.MaxInitialColumnWith.get()); + } else if (wd < 60) + { gridView->setColumnWidth(i, 60); + } } gridView->setIgnoreColumnWidthChanges(false); } @@ -522,7 +526,7 @@ void DataView::coverForGridCommit(int total) void DataView::updateGridCommitCover(int value) { - if (!widgetCover->isVisible()) + if (!widgetCover->isVisible() || (value % 10) != 0) return; widgetCover->setProgress(value); @@ -544,6 +548,9 @@ void DataView::adjustColumnWidth(SqlQueryItem* item) return; int col = item->column(); + if (model->getDesiredColumnWidth(col) > -1) + return; + gridView->resizeColumnToContents(col); if (gridView->columnWidth(col) > CFG_UI.General.MaxInitialColumnWith.get()) gridView->setColumnWidth(col, CFG_UI.General.MaxInitialColumnWith.get()); @@ -606,6 +613,9 @@ void DataView::goToPage(const QString& pageStr) page--; // Converting from visual page representation to logical + if (page == model->getCurrentPage(true)) + return; + // We need to get this synchronized against event loop, cause changeing action status (probably) calls event loop update, // so this method was sometimes called twice at the time (until setResultsNavigationState() call below), // but the page in results model wasn't updated yet. We cannot simply move setResultsNavigationState() below gotoPage(), @@ -616,9 +626,6 @@ void DataView::goToPage(const QString& pageStr) if (!manualPageChangeMutex.tryLock()) return; - if (page == model->getCurrentPage(true)) - return; - setNavigationState(false); model->gotoPage(page); manualPageChangeMutex.unlock(); @@ -643,8 +650,8 @@ void DataView::updateResultsCount(int resultsCount) QString msg = QObject::tr("Total rows loaded: %1").arg(resultsCount); rowCountLabel->setText(msg); formViewRowCountLabel->setText(msg); - rowCountLabel->setToolTip(QString::null); - formViewRowCountLabel->setToolTip(QString::null); + rowCountLabel->setToolTip(QString()); + formViewRowCountLabel->setToolTip(QString()); } else { @@ -1007,6 +1014,7 @@ void DataView::createFilteringActions() actionMap[FILTER]->setIcon(actionMap[FILTER_STRING]->icon()); + gridView->getHeaderContextMenu()->addSeparator(); gridView->getHeaderContextMenu()->addAction(actionMap[FILTER_PER_COLUMN]); } |
