Skip to content

Commit

Permalink
Printing support #1525: add print button to Data Browse tab
Browse files Browse the repository at this point in the history
For consistency for the other application tabs, a print button is added
to the Data Browse Tab for printing the currently browsed table or
selection of cells.
  • Loading branch information
mgrojo committed Oct 1, 2018
1 parent d607a67 commit 8b656cd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ExtendedTableWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public slots:
void reloadSettings();
void selectTableLine(int lineToSelect);
void selectTableLines(int firstLine, int count);
void openPrintDialog();

signals:
void foreignKeyClicked(const sqlb::ObjectIdentifier& table, const QString& column, const QByteArray& value);
Expand All @@ -67,7 +68,6 @@ public slots:
void copyMimeData(const QModelIndexList& fromIndices, QMimeData* mimeData, const bool withHeaders, const bool inSQL);
void copy(const bool withHeaders, const bool inSQL);
void paste();
void openPrintDialog();

void useAsFilter(const QString& filterOperator, bool binary = false);
void duplicateUpperCell();
Expand Down
1 change: 1 addition & 0 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1888,6 +1888,7 @@ void MainWindow::activateFields(bool enable)
ui->buttonGoto->setEnabled(enable);
ui->editGoto->setEnabled(enable);
ui->buttonRefresh->setEnabled(enable);
ui->buttonPrintTable->setEnabled(enable);
ui->actionExecuteSql->setEnabled(enable);
ui->actionLoadExtension->setEnabled(enable);
ui->actionSqlExecuteLine->setEnabled(enable);
Expand Down
30 changes: 30 additions & 0 deletions src/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,20 @@ You can drag SQL statements from an object row and drop them into other applicat
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonPrintTable">
<property name="toolTip">
<string>Print currrently browsed table data [Ctrl+P]</string>
</property>
<property name="whatsThis">
<string>Print currrently browsed table data. Print selection if more than one cell is selected.</string>
</property>
<property name="icon">
<iconset resource="icons/icons.qrc">
<normaloff>:/icons/print</normaloff>:/icons/print</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
Expand Down Expand Up @@ -3741,6 +3755,22 @@ You can drag SQL statements from the Schema column and drop them into the SQL ed
</hint>
</hints>
</connection>
<connection>
<sender>buttonPrintTable</sender>
<signal>clicked()</signal>
<receiver>dataTable</receiver>
<slot>openPrintDialog()</slot>
<hints>
<hint type="sourcelabel">
<x>315</x>
<y>122</y>
</hint>
<hint type="destinationlabel">
<x>326</x>
<y>347</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>fileOpen()</slot>
Expand Down

0 comments on commit 8b656cd

Please sign in to comment.