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 248eaf1a..37b4131e 100644 Binary files a/src/icons/application_side_list.png and b/src/icons/application_side_list.png differ diff --git a/src/icons/filter.png b/src/icons/filter.png new file mode 100644 index 00000000..58ec8744 Binary files /dev/null and b/src/icons/filter.png differ 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 00000000..54c69691 Binary files /dev/null and b/src/icons/table_row_delete.png differ diff --git a/src/icons/table_row_insert.png b/src/icons/table_row_insert.png new file mode 100644 index 00000000..ff5925ef Binary files /dev/null and b/src/icons/table_row_insert.png differ diff --git a/src/icons/textfield_delete.png b/src/icons/textfield_delete.png new file mode 100644 index 00000000..c7bd58b2 Binary files /dev/null and b/src/icons/textfield_delete.png differ