From 5f4d0ee7ff5a2795ed48b27f62ae1c7d286e794f Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 8 Feb 2019 21:45:50 +0100 Subject: [PATCH] Improve the size policy (toolbars and improved icons) (#1684) * Improve the size policy (and more and better icons) These changes improve the size policy for translations having long texts in some buttons by: * Converting the text buttons in the Edit Database Cell to icons * Making the "Type of data" label wrappable and expandable * Converting the text buttons in the Browse Data tab to icons * Allowing the Plot combo-boxes to shrunk All this allows both the Browse Data and the docks to grow and shrink with more freedom. New icons for buttons are reused when appropriate in context menus. Added icon for filter and improve icon for docks (has been mirrored so it matches the actual dock position). Added Print icon in Edit Database Cell using the extra free space, so the print action there is more visible. This continues the effort started in #1324. * Convert the embedded buttons to actual toolbars This provides more flexibility, like the way how toolbars are compacted when they have not enough space. The QToolButtons in Browse Data tab and in Edit Cell dialog are converted to QActions and inserted in new toolbars embedded in the same place as the old buttons. Everything else should stay the same (shortcuts, tool-tips and what's-this information). * Set style for all toolbars in Preferences and minor adjustments The combo-box used for the main toolbar is replicated for all the toolbars in application. In this way, users with high resolutions can use the styles with both icons and text, while users with lower resolutions can leave the default styles, which should be better for them. Some icon texts has been abbreviated from their default values, so they fit better in the toolbars when they are visible. The print icon in Edit Cell has been moved to the right, where it would be the first to be collapsed. The original what's-this info for Set as NULL in Edit Cell toolbar has been restored. * Remove no longer used overloaded function The addShortcutsTooltip function applying to QWidget was no longer used after having converted all the buttons to actions, so it is removed. --- src/AddRecordDialog.cpp | 2 +- src/EditDialog.cpp | 21 +- src/EditDialog.ui | 357 ++++++++++++++-------------- src/ExtendedTableWidget.cpp | 4 +- src/MainWindow.cpp | 39 ++- src/MainWindow.h | 2 +- src/MainWindow.ui | 354 +++++++++++++-------------- src/PlotDock.ui | 24 ++ src/PreferencesDialog.cpp | 14 +- src/PreferencesDialog.ui | 295 ++++++++++++++++++++++- src/Settings.cpp | 16 ++ src/icons/application_side_list.png | Bin 510 -> 510 bytes src/icons/filter.png | Bin 0 -> 642 bytes src/icons/icons.qrc | 4 + src/icons/table_row_delete.png | Bin 0 -> 629 bytes src/icons/table_row_insert.png | Bin 0 -> 641 bytes src/icons/textfield_delete.png | Bin 0 -> 335 bytes 17 files changed, 722 insertions(+), 410 deletions(-) create mode 100644 src/icons/filter.png create mode 100644 src/icons/table_row_delete.png create mode 100644 src/icons/table_row_insert.png create mode 100644 src/icons/textfield_delete.png diff --git a/src/AddRecordDialog.cpp b/src/AddRecordDialog.cpp index 7d75ae93..3b63afd5 100644 --- a/src/AddRecordDialog.cpp +++ b/src/AddRecordDialog.cpp @@ -36,7 +36,7 @@ protected: { QMenu* editContextMenu = createStandardContextMenu(); - QAction* nullAction = new QAction(tr("Set to NULL"), editContextMenu); + QAction* nullAction = new QAction(QIcon(":/icons/set_to_null"), tr("Set to NULL"), editContextMenu); connect(nullAction, &QAction::triggered, [&]() { setNull(true); }); diff --git a/src/EditDialog.cpp b/src/EditDialog.cpp index f0b6891d..7b19cadb 100644 --- a/src/EditDialog.cpp +++ b/src/EditDialog.cpp @@ -54,8 +54,8 @@ EditDialog::EditDialog(QWidget* parent) connect(sciEdit, SIGNAL(textChanged()), this, SLOT(editTextChanged())); // Create shortcuts for the widgets that doesn't have its own print action or printing mechanism. - QShortcut* shortcutPrintText = new QShortcut(QKeySequence::Print, ui->editorText, nullptr, nullptr, Qt::WidgetShortcut); - connect(shortcutPrintText, &QShortcut::activated, this, &EditDialog::openPrintDialog); + QShortcut* shortcutPrint = new QShortcut(QKeySequence::Print, this, nullptr, nullptr, Qt::WidgetShortcut); + connect(shortcutPrint, &QShortcut::activated, this, &EditDialog::openPrintDialog); // Add actions to editors that have a context menu based on actions. This also activates the shortcuts. ui->editorImage->addAction(ui->actionPrintImage); @@ -63,7 +63,7 @@ EditDialog::EditDialog(QWidget* parent) ui->editorBinary->addAction(ui->actionCopyHexAscii); mustIndentAndCompact = Settings::getValue("databrowser", "indent_compact").toBool(); - ui->buttonIndent->setChecked(mustIndentAndCompact); + ui->actionIndent->setChecked(mustIndentAndCompact); ui->buttonAutoSwitchMode->setChecked(Settings::getValue("databrowser", "auto_switch_mode").toBool()); @@ -661,7 +661,7 @@ void EditDialog::setDataInBuffer(const QByteArray& data, DataSources source) // Called when the user manually changes the "Mode" drop down combobox void EditDialog::editModeChanged(int newMode) { - ui->buttonIndent->setEnabled(newMode == JsonEditor || newMode == XmlEditor); + ui->actionIndent->setEnabled(newMode == JsonEditor || newMode == XmlEditor); setStackCurrentIndex(newMode); // * If the dataSource is the text buffer, the data is always text * @@ -861,8 +861,8 @@ void EditDialog::setReadOnly(bool ro) QPalette textEditPalette = ui->editorText->palette(); ui->buttonApply->setEnabled(!ro); - ui->buttonNull->setEnabled(!ro); - ui->buttonImport->setEnabled(!ro); + ui->actionNull->setEnabled(!ro); + ui->actionImport->setEnabled(!ro); ui->editorText->setReadOnly(ro); sciEdit->setReadOnly(ro); @@ -1014,6 +1014,9 @@ void EditDialog::reloadSettings() hexFont.setPointSize(Settings::getValue("databrowser", "fontsize").toInt()); hexEdit->setFont(hexFont); + ui->editCellToolbar->setToolButtonStyle(static_cast + (Settings::getValue("General", "toolbarStyleEditCell").toInt())); + sciEdit->reloadSettings(); } @@ -1041,6 +1044,12 @@ void EditDialog::setStackCurrentIndex(int editMode) void EditDialog::openPrintDialog() { + int editMode = ui->editorStack->currentIndex(); + if (editMode == ImageViewer) { + openPrintImageDialog(); + return; + } + QPrinter printer; QPrintPreviewDialog *dialog = new QPrintPreviewDialog(&printer); diff --git a/src/EditDialog.ui b/src/EditDialog.ui index 57ff62a7..986297ad 100644 --- a/src/EditDialog.ui +++ b/src/EditDialog.ui @@ -27,19 +27,16 @@ Mode: + + comboMode + - - - 0 - 0 - - - 50 + 0 0 @@ -105,79 +102,21 @@ Qt::Horizontal - - QSizePolicy::MinimumExpanding - 0 - 20 + 0 - - - false - - - Auto-format: pretty print on loading, compact on saving. - - - Auto-format: pretty print on loading, compact on saving. - - - When enabled, the auto-format feature formats the data on loading, breaking the text in lines and indenting it for maximum readability. On data saving, the auto-format feature compacts the data removing end of lines, and unnecessary whitespace. - - - Autoformat - - - - :/icons/text_indent:/icons/text_indent - - - true - - - - - - - - 50 - 0 - - - - Import from file - - - Opens a file dialog used to import any kind of data to this database cell. - - - &Import - - - - - - - - 50 - 0 - - - - Export to file - - - Opens a file dialog used to export the contents of this database cell to a file. - - - &Export - + + + + + + @@ -220,7 +159,7 @@ 0 0 - 98 + 84 35 @@ -248,25 +187,65 @@ Errors are indicated with a red squiggle underline. - - + + + + + 0 + 0 + + + + + 100 + 0 + + Type of data currently in cell + + true + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + Size of data currently in table + + + Qt::PlainText + + + true + - + - - - 50 - 0 - + + + 0 + 0 + Apply data to cell @@ -282,45 +261,6 @@ Errors are indicated with a red squiggle underline. - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 50 - 0 - - - - Set this cell to NULL - - - Erases the contents of the cell - - - Set as &NULL - - - - - - - Size of data currently in table - - - @@ -350,9 +290,15 @@ Errors are indicated with a red squiggle underline. Open preview dialog for printing displayed text + + Open preview dialog for printing the data currently stored in the cell + Ctrl+P + + Qt::WidgetShortcut + @@ -369,46 +315,77 @@ Errors are indicated with a red squiggle underline. Ctrl+Shift+C + + + true + + + + :/icons/text_indent:/icons/text_indent + + + Autoformat + + + Auto-format: pretty print on loading, compact on saving. + + + When enabled, the auto-format feature formats the data on loading, breaking the text in lines and indenting it for maximum readability. On data saving, the auto-format feature compacts the data removing end of lines, and unnecessary whitespace. + + + + + + :/icons/save_sql:/icons/save_sql + + + &Export... + + + Export to file + + + Opens a file dialog used to export the contents of this database cell to a file. + + + + + + :/icons/document_open:/icons/document_open + + + &Import... + + + Import from file + + + Opens a file dialog used to import any kind of data to this database cell. + + + + + + :/icons/set_to_null:/icons/set_to_null + + + Set as &NULL + + + Erases the contents of the cell + + - buttonExport + comboMode + buttonAutoSwitchMode + editorText + buttonApply - - buttonImport - clicked() - EditDialog - importData() - - - 400 - 28 - - - 60 - 0 - - - - - buttonExport - clicked() - EditDialog - exportData() - - - 488 - 51 - - - 162 - 17 - - - buttonApply clicked() @@ -441,22 +418,6 @@ Errors are indicated with a red squiggle underline. - - buttonNull - clicked() - EditDialog - setNull() - - - 528 - 28 - - - 723 - 58 - - - editorText textChanged() @@ -474,14 +435,14 @@ Errors are indicated with a red squiggle underline. - buttonIndent + actionIndent toggled(bool) EditDialog setMustIndentAndCompact(bool) - 309 - 22 + -1 + -1 308 @@ -496,8 +457,8 @@ Errors are indicated with a red squiggle underline. switchEditorMode(bool) - 135 - 22 + 162 + 33 308 @@ -553,6 +514,54 @@ Errors are indicated with a red squiggle underline. + + actionNull + triggered() + EditDialog + setNull() + + + -1 + -1 + + + 308 + 190 + + + + + actionImport + triggered() + EditDialog + importData() + + + -1 + -1 + + + 308 + 190 + + + + + actionExport + triggered() + EditDialog + exportData() + + + -1 + -1 + + + 308 + 190 + + + importData() diff --git a/src/ExtendedTableWidget.cpp b/src/ExtendedTableWidget.cpp index a7007ea8..606e17c7 100644 --- a/src/ExtendedTableWidget.cpp +++ b/src/ExtendedTableWidget.cpp @@ -243,7 +243,7 @@ ExtendedTableWidget::ExtendedTableWidget(QWidget* parent) : // Set up table view context menu m_contextMenu = new QMenu(this); - QAction* filterAction = new QAction(tr("Use as Exact Filter"), m_contextMenu); + QAction* filterAction = new QAction(QIcon(":/icons/filter"), tr("Use as Exact Filter"), m_contextMenu); QAction* containingAction = new QAction(tr("Containing"), m_contextMenu); QAction* notContainingAction = new QAction(tr("Not containing"), m_contextMenu); QAction* notEqualToAction = new QAction(tr("Not equal to"), m_contextMenu); @@ -254,7 +254,7 @@ ExtendedTableWidget::ExtendedTableWidget(QWidget* parent) : QAction* inRangeAction = new QAction(tr("Between this and..."), m_contextMenu); QAction* regexpAction = new QAction(tr("Regular expression"), m_contextMenu); - QAction* nullAction = new QAction(tr("Set to NULL"), m_contextMenu); + QAction* nullAction = new QAction(QIcon(":/icons/set_to_null"), tr("Set to NULL"), m_contextMenu); QAction* copyAction = new QAction(QIcon(":/icons/copy"), tr("Copy"), m_contextMenu); QAction* copyWithHeadersAction = new QAction(QIcon(":/icons/special_copy"), tr("Copy with Headers"), m_contextMenu); QAction* copyAsSQLAction = new QAction(QIcon(":/icons/sql_copy"), tr("Copy as SQL"), m_contextMenu); diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 077002ae..b234caf4 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -147,12 +147,6 @@ static QString shortcutsTip(const QList& keys) return tip; } -static void addShortcutsTooltip(QWidget* widget, const QList& keys) -{ - if (!keys.isEmpty()) - widget->setToolTip(widget->toolTip() + shortcutsTip(keys)); -} - static void addShortcutsTooltip(QAction* action, const QList& extraKeys = QList()) { if (!action->shortcuts().isEmpty() || !extraKeys.isEmpty()) @@ -278,7 +272,7 @@ void MainWindow::init() popupNewRecordMenu = new QMenu(this); popupNewRecordMenu->addAction(ui->newRecordAction); popupNewRecordMenu->addAction(ui->insertValuesAction); - ui->buttonNewRecord->setMenu(popupNewRecordMenu); + ui->actionNewRecord->setMenu(popupNewRecordMenu); popupSaveSqlFileMenu = new QMenu(this); popupSaveSqlFileMenu->addAction(ui->actionSqlSaveFile); @@ -294,8 +288,8 @@ void MainWindow::init() popupSaveFilterAsMenu = new QMenu(this); popupSaveFilterAsMenu->addAction(ui->actionFilteredTableExportCsv); popupSaveFilterAsMenu->addAction(ui->actionFilterSaveAsView); - ui->buttonSaveFilterAsPopup->setMenu(popupSaveFilterAsMenu); - ui->buttonSaveFilterAsPopup->setPopupMode(QToolButton::InstantPopup); + ui->actionSaveFilterAsPopup->setMenu(popupSaveFilterAsMenu); + qobject_cast(ui->browseToolbar->widgetForAction(ui->actionSaveFilterAsPopup))->setPopupMode(QToolButton::InstantPopup); popupBrowseDataHeaderMenu = new QMenu(this); popupBrowseDataHeaderMenu->addAction(ui->actionShowRowidColumn); @@ -510,8 +504,8 @@ void MainWindow::init() addShortcutsTooltip(ui->actionDbPrint); - addShortcutsTooltip(ui->buttonRefresh, {shortcutBrowseRefreshF5->key(), shortcutBrowseRefreshCtrlR->key()}); - addShortcutsTooltip(ui->buttonPrintTable, {shortcutPrint->key()}); + addShortcutsTooltip(ui->actionRefresh, {shortcutBrowseRefreshCtrlR->key()}); + addShortcutsTooltip(ui->actionPrintTable); addShortcutsTooltip(ui->actionSqlOpenTab); addShortcutsTooltip(ui->actionSqlPrint); @@ -1974,8 +1968,8 @@ void MainWindow::activateFields(bool enable) ui->buttonBoxPragmas->setEnabled(enable && write); ui->buttonGoto->setEnabled(enable); ui->editGoto->setEnabled(enable); - ui->buttonRefresh->setEnabled(enable); - ui->buttonPrintTable->setEnabled(enable); + ui->actionRefresh->setEnabled(enable); + ui->actionPrintTable->setEnabled(enable); ui->actionExecuteSql->setEnabled(enable); ui->actionLoadExtension->setEnabled(enable); ui->actionSqlExecuteLine->setEnabled(enable); @@ -1987,8 +1981,8 @@ void MainWindow::activateFields(bool enable) ui->actionQuickCheck->setEnabled(enable); ui->actionForeignKeyCheck->setEnabled(enable); ui->actionOptimize->setEnabled(enable); - ui->buttonClearFilters->setEnabled(enable); - ui->buttonSaveFilterAsPopup->setEnabled(enable); + ui->actionClearFilters->setEnabled(enable); + ui->actionSaveFilterAsPopup->setEnabled(enable); ui->dockEdit->setEnabled(enable); ui->dockPlot->setEnabled(enable); @@ -2369,6 +2363,9 @@ void MainWindow::reloadSettings() ui->dataTable->reloadSettings(); setToolButtonStyle(static_cast(Settings::getValue("General", "toolbarStyle").toInt())); + ui->dbToolbar->setToolButtonStyle(static_cast(Settings::getValue("General", "toolbarStyleStructure").toInt())); + ui->browseToolbar->setToolButtonStyle(static_cast(Settings::getValue("General", "toolbarStyleBrowse").toInt())); + ui->toolbarSql->setToolButtonStyle(static_cast(Settings::getValue("General", "toolbarStyleSql").toInt())); // Set prefetch sizes for lazy population of table models m_browseTableModel->setChunkSize(Settings::getValue("db", "prefetchsize").toInt()); @@ -3235,7 +3232,7 @@ void MainWindow::switchToBrowseDataTab(QString tableToBrowse) ui->mainTab->setCurrentWidget(ui->browser); } -void MainWindow::on_buttonClearFilters_clicked() +void MainWindow::on_actionClearFilters_triggered() { ui->dataTable->filterHeader()->clearFilters(); } @@ -3327,7 +3324,7 @@ void MainWindow::showRecordPopupMenu(const QPoint& pos) } }); - QAction* deleteRecordAction = new QAction(ui->buttonDeleteRecord->text(), &popupRecordMenu); + QAction* deleteRecordAction = new QAction(QIcon(":icons/delete_record"), ui->actionDeleteRecord->text(), &popupRecordMenu); popupRecordMenu.addAction(deleteRecordAction); connect(deleteRecordAction, &QAction::triggered, [&]() { @@ -3722,13 +3719,13 @@ void MainWindow::updateInsertDeleteRecordButton() // at least one row to be selected. For the insert button there is an extra rule to disable it when we are browsing a view because inserting // into a view isn't supported yet. bool isEditable = m_browseTableModel->isEditable() && !db.readOnly(); - ui->buttonNewRecord->setEnabled(isEditable && !m_browseTableModel->hasPseudoPk()); - ui->buttonDeleteRecord->setEnabled(isEditable && rows != 0); + ui->actionNewRecord->setEnabled(isEditable && !m_browseTableModel->hasPseudoPk()); + ui->actionDeleteRecord->setEnabled(isEditable && rows != 0); if(rows > 1) - ui->buttonDeleteRecord->setText(tr("Delete Records")); + ui->actionDeleteRecord->setText(tr("Delete Records")); else - ui->buttonDeleteRecord->setText(tr("Delete Record")); + ui->actionDeleteRecord->setText(tr("Delete Record")); } void MainWindow::runSqlNewTab(const QString& query, const QString& title) diff --git a/src/MainWindow.h b/src/MainWindow.h index bf4f6aae..1adbb091 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -276,7 +276,7 @@ private slots: void addCondFormat(int column, const QString& value); void clearAllCondFormats(int column); void editEncryption(); - void on_buttonClearFilters_clicked(); + void on_actionClearFilters_triggered(); void copyCurrentCreateStatement(); void showDataColumnPopupMenu(const QPoint& pos); void showRecordPopupMenu(const QPoint& pos); diff --git a/src/MainWindow.ui b/src/MainWindow.ui index 6c4a8237..55b0ac03 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -123,24 +123,6 @@ You can drag SQL statements from an object row and drop them into other applicat - - - 1 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - Select a table to browse data @@ -156,68 +138,17 @@ You can drag SQL statements from an object row and drop them into other applicat - - - Refresh the data in the selected table - - - This button refreshes the data in the currently selected table. - - - - - - - :/icons/refresh:/icons/refresh - - - - - - - Clear all filters - - - This button clears all the filters set in the header input fields for the currently browsed table. - - - - - - - :/icons/clear_filters:/icons/clear_filters - - - - - - - Save the table as currently displayed - - - <html><head/><body><p>This popup menu provides the following options applying to the currently browsed and filtered table:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Export to CSV: this option exports the data of the browsed table as currently displayed (after filters, display formats and order column) to a CSV file.</li><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Save as view: this option saves the current setting of the browsed table (filters, display formats and order column) as an SQL view that you can later browse or use in SQL statements.</li></ul></body></html> - - - ... - - - - :/icons/save_table:/icons/save_table - - - - - - - Print currently browsed table data - - - Print currently browsed table data. Print selection if more than one cell is selected. - - - - :/icons/print:/icons/print + + + Qt::ToolButtonIconOnly + + + + + + + @@ -225,58 +156,17 @@ You can drag SQL statements from an object row and drop them into other applicat Qt::Horizontal + + QSizePolicy::MinimumExpanding + - 40 + 0 20 - - - - - 50 - 0 - - - - Insert a new record in the current table - - - <html><head/><body><p>This button creates a new record in the database. Hold the mouse button to open a pop-up menu of different options:</p><ul><li><span style=" font-weight:600;">New Record</span>: insert a new record with default values in the database.</li><li><span style=" font-weight:600;">Insert Values...</span>: open a dialog for entering values before they are inserted in the database. This allows to enter values acomplishing the different constraints. This dialog is also open if the <span style=" font-weight:600;">New Record</span> option fails due to these constraints.</li></ul></body></html> - - - New Record - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - Delete the current record - - - This button deletes the record or records currently selected in the table - - - Delete Record - - - @@ -1015,7 +905,7 @@ You can drag SQL statements from an object row and drop them into other applicat 0 0 1037 - 20 + 22 @@ -1121,7 +1011,7 @@ You can drag SQL statements from an object row and drop them into other applicat DB Toolbar - Qt::ToolButtonIconOnly + Qt::ToolButtonTextBesideIcon TopToolBarArea @@ -1334,7 +1224,7 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed Project Toolbar - Qt::ToolButtonIconOnly + Qt::ToolButtonTextBesideIcon TopToolBarArea @@ -1356,7 +1246,7 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed Close the current database file - Qt::ToolButtonIconOnly + Qt::ToolButtonTextBesideIcon TopToolBarArea @@ -1796,6 +1686,9 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed Execute current line + + Execute line + Execute current line @@ -2062,12 +1955,25 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed + + + :/icons/refresh:/icons/refresh + Refresh + + Refresh the data in the selected table + + + This button refreshes the data in the currently selected table. + F5 + + Qt::WidgetShortcut + @@ -2127,6 +2033,9 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed Find text in SQL editor + + Find + Find text in SQL editor @@ -2148,6 +2057,9 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed Find or replace text in SQL editor + + Find or replace + Find or replace text in SQL editor @@ -2284,6 +2196,10 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed + + + :/icons/add_record:/icons/add_record + New Record @@ -2424,6 +2340,9 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed Un/comment block of SQL code + + Un/comment block + Comment or uncomment current line or selected block of code @@ -2445,10 +2364,109 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed Stop SQL execution + + Stop execution + Stop the currently running SQL script + + + + :/icons/print:/icons/print + + + Print + + + Print currently browsed table data + + + + + + Print currently browsed table data. Print selection if more than one cell is selected. + + + Ctrl+P + + + Qt::WidgetShortcut + + + + + + :/icons/clear_filters:/icons/clear_filters + + + Clear Filters + + + Clear all filters + + + This button clears all the filters set in the header input fields for the currently browsed table. + + + This button clears all the filters set in the header input fields for the currently browsed table. + + + + + + :/icons/save_table:/icons/save_table + + + Save Table As... + + + Save the table as currently displayed + + + Save the table as currently displayed + + + <html><head/><body><p>This popup menu provides the following options applying to the currently browsed and filtered table:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Export to CSV: this option exports the data of the browsed table as currently displayed (after filters, display formats and order column) to a CSV file.</li><li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Save as view: this option saves the current setting of the browsed table (filters, display formats and order column) as an SQL view that you can later browse or use in SQL statements.</li></ul></body></html> + + + + + + :/icons/add_record:/icons/add_record + + + New Record + + + Insert a new record in the current table + + + Insert a new record in the current table + + + <html><head/><body><p>This button creates a new record in the database. Hold the mouse button to open a pop-up menu of different options:</p><ul><li><span style=" font-weight:600;">New Record</span>: insert a new record with default values in the database.</li><li><span style=" font-weight:600;">Insert Values...</span>: open a dialog for entering values before they are inserted in the database. This allows to enter values acomplishing the different constraints. This dialog is also open if the <span style=" font-weight:600;">New Record</span> option fails due to these constraints.</li></ul></body></html> + + + + + + :/icons/delete_record:/icons/delete_record + + + Delete Record + + + Delete the current record + + + This button deletes the record or records currently selected in the table + + + This button deletes the record or records currently selected in the table + + @@ -2513,10 +2531,6 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed buttonLogClear treeSchemaDock comboBrowseTable - buttonRefresh - buttonClearFilters - buttonNewRecord - buttonDeleteRecord dataTable buttonBegin buttonPrevious @@ -2630,30 +2644,14 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed - buttonNewRecord - clicked() - MainWindow - addRecord() - - - 402 - 143 - - - 399 - 299 - - - - - buttonDeleteRecord - clicked() + actionDeleteRecord + triggered() MainWindow deleteRecord() - 506 - 143 + -1 + -1 399 @@ -2725,22 +2723,6 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed - - buttonRefresh - clicked() - MainWindow - refresh() - - - 245 - 139 - - - 399 - 299 - - - fileCompactAction triggered() @@ -3669,22 +3651,6 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed - - buttonSaveFilterAsPopup - clicked() - MainWindow - saveFilterAsView() - - - 290 - 127 - - - 518 - 314 - - - viewProjectToolbarAction toggled(bool) @@ -3839,6 +3805,10 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed -1 -1 + + 20 + 20 + @@ -3848,8 +3818,12 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed fileNewInMemoryDatabase() - 518 - 314 + -1 + -1 + + + 20 + 20 @@ -3886,14 +3860,14 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed - buttonPrintTable - clicked() + actionPrintTable + triggered() dataTable openPrintDialog() - 315 - 122 + -1 + -1 326 diff --git a/src/PlotDock.ui b/src/PlotDock.ui index d37703af..28523b5f 100644 --- a/src/PlotDock.ui +++ b/src/PlotDock.ui @@ -110,6 +110,18 @@ Select the axes or axes labels to drag and zoom only in that orientation. + + + 0 + 0 + + + + + 50 + 0 + + 1 @@ -157,6 +169,18 @@ Select the axes or axes labels to drag and zoom only in that orientation. + + + 0 + 0 + + + + + 50 + 0 + + 0 diff --git a/src/PreferencesDialog.cpp b/src/PreferencesDialog.cpp index 0867cd5e..28cd57a6 100644 --- a/src/PreferencesDialog.cpp +++ b/src/PreferencesDialog.cpp @@ -187,7 +187,11 @@ void PreferencesDialog::loadSettings() ui->checkRegexDisabled->setChecked(Settings::getValue("extensions", "disableregex").toBool()); ui->checkAllowLoadExtension->setChecked(Settings::getValue("extensions", "enable_load_extension").toBool()); fillLanguageBox(); - ui->toolbarStyleComboBox->setCurrentIndex(Settings::getValue("General", "toolbarStyle").toInt()); + ui->toolbarStyleComboMain->setCurrentIndex(Settings::getValue("General", "toolbarStyle").toInt()); + ui->toolbarStyleComboStructure->setCurrentIndex(Settings::getValue("General", "toolbarStyleStructure").toInt()); + ui->toolbarStyleComboBrowse->setCurrentIndex(Settings::getValue("General", "toolbarStyleBrowse").toInt()); + ui->toolbarStyleComboSql->setCurrentIndex(Settings::getValue("General", "toolbarStyleSql").toInt()); + ui->toolbarStyleComboEditCell->setCurrentIndex(Settings::getValue("General", "toolbarStyleEditCell").toInt()); } void PreferencesDialog::saveSettings() @@ -309,7 +313,13 @@ void PreferencesDialog::saveSettings() tr("The language will change after you restart the application.")); Settings::setValue("General", "language", newLanguage); - Settings::setValue("General", "toolbarStyle", ui->toolbarStyleComboBox->currentIndex()); + + Settings::setValue("General", "toolbarStyle", ui->toolbarStyleComboMain->currentIndex()); + Settings::setValue("General", "toolbarStyleStructure", ui->toolbarStyleComboStructure->currentIndex()); + Settings::setValue("General", "toolbarStyleBrowse", ui->toolbarStyleComboBrowse->currentIndex()); + Settings::setValue("General", "toolbarStyleSql", ui->toolbarStyleComboSql->currentIndex()); + Settings::setValue("General", "toolbarStyleEditCell", ui->toolbarStyleComboEditCell->currentIndex()); + Settings::setValue("General", "DBFileExtensions", m_dbFileExtensions.join(";;") ); accept(); diff --git a/src/PreferencesDialog.ui b/src/PreferencesDialog.ui index 95d706af..6c421756 100644 --- a/src/PreferencesDialog.ui +++ b/src/PreferencesDialog.ui @@ -128,12 +128,12 @@ Toolbar style - toolbarStyleComboBox + toolbarStyleComboMain - - + + 0 @@ -182,7 +182,167 @@ - + + + + + 0 + 0 + + + + 2 + + + QComboBox::AdjustToContents + + + 35 + + + + 20 + 15 + + + + + Only display the icon + + + + + Only display the text + + + + + The text appears beside the icon + + + + + The text appears under the icon + + + + + Follow the style + + + + + + + + + 0 + 0 + + + + 0 + + + QComboBox::AdjustToContents + + + 35 + + + + 20 + 15 + + + + + Only display the icon + + + + + Only display the text + + + + + The text appears beside the icon + + + + + The text appears under the icon + + + + + Follow the style + + + + + + + + + 0 + 0 + + + + 0 + + + QComboBox::AdjustToContents + + + 35 + + + + 20 + 15 + + + + + Only display the icon + + + + + Only display the text + + + + + The text appears beside the icon + + + + + The text appears under the icon + + + + + Follow the style + + + + + + + + Show remote options + + + checkUseRemotes + + + + enabled @@ -192,7 +352,7 @@ - + Automatic &updates @@ -202,14 +362,14 @@ - + enabled - + DB file extensions @@ -219,20 +379,125 @@ - + Manage - - + + - Show remote options + Main Window + + + 20 - checkUseRemotes + toolbarStyleComboMain + + + + + + + Database Structure + + + 20 + + + toolbarStyleComboStructure + + + + + + + Browse Data + + + 20 + + + toolbarStyleComboBrowse + + + + + + + Execute SQL + + + 20 + + + toolbarStyleComboSql + + + + + + + + 0 + 0 + + + + 0 + + + QComboBox::AdjustToContents + + + 35 + + + + 20 + 15 + + + + + Only display the icon + + + + + Only display the text + + + + + The text appears beside the icon + + + + + The text appears under the icon + + + + + Follow the style + + + + + + + + Edit Database Cell + + + 20 + + + toolbarStyleComboEditCell @@ -1523,7 +1788,11 @@ Can be set to 0 for disabling completion. locationEdit setLocationButton languageComboBox - toolbarStyleComboBox + toolbarStyleComboMain + toolbarStyleComboStructure + toolbarStyleComboBrowse + toolbarStyleComboSql + toolbarStyleComboEditCell checkUseRemotes checkUpdates encodingComboBox diff --git a/src/Settings.cpp b/src/Settings.cpp index 55998a12..d9d157b5 100644 --- a/src/Settings.cpp +++ b/src/Settings.cpp @@ -158,6 +158,22 @@ QVariant Settings::getDefaultValue(const QString& group, const QString& name) if(group == "General" && name == "toolbarStyle") return static_cast(Qt::ToolButtonTextBesideIcon); + // General/toolbarStyleStructure + if(group == "General" && name == "toolbarStyleStructure") + return static_cast(Qt::ToolButtonTextBesideIcon); + + // General/toolbarStyleBrowse + if(group == "General" && name == "toolbarStyleBrowse") + return static_cast(Qt::ToolButtonIconOnly); + + // General/toolbarStyleSql + if(group == "General" && name == "toolbarStyleSql") + return static_cast(Qt::ToolButtonIconOnly); + + // General/toolbarStyleEditCell + if(group == "General" && name == "toolbarStyleEditCell") + return static_cast(Qt::ToolButtonIconOnly); + if(group == "General" && name == "DBFileExtensions") return QObject::tr("SQLite database files (*.db *.sqlite *.sqlite3 *.db3)"); diff --git a/src/icons/application_side_list.png b/src/icons/application_side_list.png index 248eaf1ac1473e89184b1b037f7c077ba76ad99f..37b4131e8c95e498121bbe32baf96d8fd7d0beee 100644 GIT binary patch delta 484 zcmVOjxDh(xzKmY&%i%CR5R5;6}lRs;dQ5431=Q;0tkt#vDIyy+cMd_5W z6yjVFGSo%881w@eM;8lm6~yEV#6b|z&CyN4K@huiXe^>h?tgK(Z;Gu_&^*iG9=OkW zp7X~df>lrfZ10V3wcA%79{sE@x`eqSvnC3Y;c`p@2{TwvKx z`q%2y>2aFbo_hMVxp@XA=f zbm64jWHKS8#D7?u>~BCsE=|nyLas4`68P2+w?r_%vobD4-}2o|}FB&k$aAu&5` zcsw3c*EKILZ?V5olox`=LUIRztb9H@mTtETz}8YgUMk2%fgB_-3Q6cR#c((zrNooi z;q8r5xB{5Z<|hPZhBw;JIH1?-0kG4&=d)QMh(>{%m0fM)Px%0Y!GKn)#p55lyuSmn zSWcn2hva_l*7W;*0Ct;q&KZjcw)aNQf$I{ORQBHuQ@IIAcwLw1j$Fu{gU??^w(2#C a74Zw{{;oTtu7ouJ0000*ZfP_n!43{GpZid`(Gfd*b+4f|A|KP#fXDi!vur$~@v#^*iE^r!)CllKO zw(F$zJUKk(w0^dp2@hX=@qc;r`m6uX-6!w8M|BrryaywFplKS0!y!|L$G@=7vCc6U zjX9SuoyTN^ihny{XPMqLX4O(j$wWolLMi}qG^&jtO+m_L2#8k`@eaM)%*ym~rU2$nPEP3Bj!@l1xUvar=bm$PbX~;8#s*V4C4zvG5-t&3B2-C) zPwVv7m{n3D6#goOAa_DN`1XBwyxFeE44E)9Bw=mKt;e5{J1)b`kqeiQ2)p!>yEBi> aoPGlWs20*Iz){Np0000gug=cS+DiZc93CECXsvgHAW);x2(IfQiXtebP%IWP91j0UUY_xHHJiFKFzwOZx*d>%QD1FbbY&x@whsabi1 zN~LlQU{6Z9=wR>Y=;-^(fNVA^0bqT79hPN%0f5?yq c=Rz>% literal 0 HcmV?d00001 diff --git a/src/icons/icons.qrc b/src/icons/icons.qrc index 4cf4bd59..ea3defd5 100644 --- a/src/icons/icons.qrc +++ b/src/icons/icons.qrc @@ -71,6 +71,10 @@ cancel.png comment_block.png hourglass.png + table_row_delete.png + table_row_insert.png + textfield_delete.png + filter.png tab.png package_rename.png page_foreign_key.png diff --git a/src/icons/table_row_delete.png b/src/icons/table_row_delete.png new file mode 100644 index 0000000000000000000000000000000000000000..54c69691ed338c9eedaec71cb13a270220be2af7 GIT binary patch literal 629 zcmV-*0*d{KP)Li;xI2>OTl7Fa)JVKX4h*B9sHXiuNA9 zyc(UO?QC7~Y+!tj)|OKJcQIGqffGf|2rFP-noa^PD!uTy=iPbl-1E-7=MWKA5^nxYxsN%{ zYcg%d7-$11o3+IR#W@}tS`pXHSbz8SOhjOadUBbKoBpTk)uG8fOA44R+C2RI9(PvU zML}|wTE>}c^>3Fu`XQxW(?C%3plj#ZWp$qqm{jT51AA5*g}23J5gbpqKr|AlMFJbA z4yAB^WCkY>dP}v3qcg}Ii08lkpjm-r0yYwEk{7=(BAHC!(P$A)0!S<_8velQc+Dyo z*wMNULdFCMdj#u(n{<%tNWtY@cRzRIL?(qS4;waT+dUlF@6~>-GR+Ez=XT@MPbJ*` z*aan2gda~|fD{rB@)BVXB3uv%sv!c#=}Ura&6Uh%Z)0bAGmhOlj4dr5OO&|ryc0?) zTt73wT{Wt*ia9xlO6a2^e8%$_%n!lo8=RtxN82zq<-=h~123}NRpCnZ8SadqYwldF zVOtY{jMSkwKS8sVkY0W%k&Rd5C2H^8NA+N1sWHC(DAVbi?<|az*F0dbd+P@Lnq9y) zZ!HQvuQ568M~3ZcU5$yKf12)sF=QGp5{+CdeA_FuS#STZ9h!ZS(c@A7yiDav@T88N bl|JXclv{aX%Z3zd00000NkvXXu0mjf?NAwh literal 0 HcmV?d00001 diff --git a/src/icons/textfield_delete.png b/src/icons/textfield_delete.png new file mode 100644 index 0000000000000000000000000000000000000000..c7bd58b21797817803b49d3b2b53323e17fda625 GIT binary patch literal 335 zcmV-V0kHmwP)4KV{At)KG$c#_utJ;JncjQ{ugvi#ZM%3MWsnm-aQTLHB3 hKFHZ17lAZ`!~r__K9H;