vcl/inc/printdlg.hxx | 5 +++ vcl/source/window/printdlg.cxx | 31 +++++++++++++++++++++ vcl/uiconfig/ui/printdialog.ui | 60 ++++++++++++++++++++++++++++++++++------- 3 files changed, 86 insertions(+), 10 deletions(-)
New commits: commit 9b021e87e04f4ab294d8cefb5d54bfe29e1e85dd Author: Heiko Tietze <tietze.he...@gmail.com> AuthorDate: Thu Sep 5 11:01:52 2019 +0200 Commit: Heiko Tietze <heiko.tie...@documentfoundation.org> CommitDate: Fri Sep 6 13:59:18 2019 +0200 Resolves tdf#125130 - UI: Show 'Go to first/last page' in new print dialog Buttons added gtk-media* replaced by gtk-go* Change-Id: I274bccb747d6f5e899e826ee8bebf3c1127e6374 Reviewed-on: https://gerrit.libreoffice.org/78635 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org> diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx index 137f6a47a40c..4aad50314fc4 100644 --- a/vcl/inc/printdlg.hxx +++ b/vcl/inc/printdlg.hxx @@ -122,6 +122,8 @@ namespace vcl void setPaperSizes(); void previewForward(); void previewBackward(); + void previewFirst(); + void previewLast(); private: @@ -153,6 +155,9 @@ namespace vcl VclPtr<PushButton> mpBackwardBtn; VclPtr<PushButton> mpForwardBtn; + VclPtr<PushButton> mpFirstBtn; + VclPtr<PushButton> mpLastBtn; + VclPtr<CheckBox> mpPreviewBox; VclPtr<FixedText> mpNumPagesText; VclPtr<PrintPreviewWindow> mpPreviewWindow; diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 0fa17941e317..3289e2e02620 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -533,6 +533,8 @@ PrintDialog::PrintDialog(vcl::Window* i_pWindow, const std::shared_ptr<PrinterCo get(mpPageLayoutFrame, "layoutframe"); get(mpForwardBtn, "forward"); get(mpBackwardBtn, "backward"); + get(mpFirstBtn, "btnFirst"); + get(mpLastBtn, "btnLast"); get(mpNumPagesText, "totalnumpages"); get(mpPageEdit, "pageedit-nospin"); get(mpPreviewWindow, "preview"); @@ -572,6 +574,8 @@ PrintDialog::PrintDialog(vcl::Window* i_pWindow, const std::shared_ptr<PrinterCo // setup preview controls mpForwardBtn->SetStyle( mpForwardBtn->GetStyle() | WB_BEVELBUTTON ); mpBackwardBtn->SetStyle( mpBackwardBtn->GetStyle() | WB_BEVELBUTTON ); + mpFirstBtn->SetStyle( mpFirstBtn->GetStyle() | WB_BEVELBUTTON ); + mpLastBtn->SetStyle( mpLastBtn->GetStyle() | WB_BEVELBUTTON ); maPageStr = mpNumPagesText->GetText(); @@ -661,6 +665,8 @@ PrintDialog::PrintDialog(vcl::Window* i_pWindow, const std::shared_ptr<PrinterCo mpMoreOptionsBtn->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); mpBackwardBtn->SetClickHdl(LINK(this, PrintDialog, ClickHdl)); mpForwardBtn->SetClickHdl(LINK(this, PrintDialog, ClickHdl)); + mpFirstBtn->SetClickHdl(LINK(this, PrintDialog, ClickHdl)); + mpLastBtn->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); mpPreviewBox->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); mpBorderCB->SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); @@ -704,6 +710,8 @@ void PrintDialog::dispose() mpNumPagesText.clear(); mpBackwardBtn.clear(); mpForwardBtn.clear(); + mpFirstBtn.clear(); + mpLastBtn.clear(); mpPreviewBox.clear(); mpOKButton.clear(); mpCancelButton.clear(); @@ -954,6 +962,9 @@ void PrintDialog::preparePreview( bool i_bMayUseCache ) mpForwardBtn->Enable( false ); mpBackwardBtn->Enable( false ); + mpFirstBtn->Enable( false ); + mpLastBtn->Enable( false ); + mpPageEdit->Enable( false ); return; @@ -986,6 +997,8 @@ void PrintDialog::preparePreview( bool i_bMayUseCache ) mpForwardBtn->Enable( mnCurPage < nPages-1 ); mpBackwardBtn->Enable( mnCurPage != 0 ); + mpFirstBtn->Enable( mnCurPage != 0 ); + mpLastBtn->Enable( mnCurPage < nPages-1 ); mpPageEdit->Enable( nPages > 1 ); } @@ -1825,6 +1838,14 @@ IMPL_LINK ( PrintDialog, ClickHdl, Button*, pButton, void ) { previewBackward(); } + else if( pButton == mpFirstBtn ) + { + previewFirst(); + } + else if( pButton == mpLastBtn ) + { + previewLast(); + } else if( pButton == mpBrochureBtn ) { PropertyValue* pVal = getValueForWindow( pButton ); @@ -2126,6 +2147,16 @@ void PrintDialog::previewBackward() mpPageEdit->Down(); } +void PrintDialog::previewFirst() +{ + mpPageEdit->First(); +} + +void PrintDialog::previewLast() +{ + mpPageEdit->Last(); +} + // PrintProgressDialog PrintProgressDialog::PrintProgressDialog(weld::Window* i_pParent, int i_nMax) : GenericDialogController(i_pParent, "vcl/ui/printprogressdialog.ui", "PrintProgressDialog") diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui index bdcf861f83bd..a1ddf06e5c5d 100644 --- a/vcl/uiconfig/ui/printdialog.ui +++ b/vcl/uiconfig/ui/printdialog.ui @@ -17,18 +17,28 @@ <property name="step_increment">1</property> <property name="page_increment">10</property> </object> - <object class="GtkImage" id="image1"> + <object class="GtkImage" id="imgBack"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-media-previous</property> + <property name="stock">gtk-go-back</property> <property name="icon_size">1</property> </object> - <object class="GtkImage" id="image2"> + <object class="GtkImage" id="imgFirst"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-media-next</property> + <property name="stock">gtk-goto-first</property> + </object> + <object class="GtkImage" id="imgForward"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-go-forward</property> <property name="icon_size">1</property> </object> + <object class="GtkImage" id="imgLast"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-goto-last</property> + </object> <object class="GtkListStore" id="liststore1"> <columns> <!-- column-name gchararray --> @@ -255,18 +265,33 @@ <property name="margin_right">10</property> <property name="spacing">6</property> <child> + <object class="GtkButton" id="btnLast"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes" context="printdialog|lastpage">Last page</property> + <property name="image">imgLast</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> <object class="GtkButton" id="forward"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes" context="printdialog|forward">Next page</property> - <property name="image">image2</property> + <property name="image">imgForward</property> </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="pack_type">end</property> - <property name="position">0</property> + <property name="position">1</property> </packing> </child> <child> @@ -279,7 +304,7 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="pack_type">end</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child> @@ -291,7 +316,7 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="pack_type">end</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> <child> @@ -300,13 +325,28 @@ <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="tooltip_text" translatable="yes" context="printdialog|backward">Previous page</property> - <property name="image">image1</property> + <property name="image">imgBack</property> </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="pack_type">end</property> - <property name="position">3</property> + <property name="position">4</property> + </packing> + </child> + <child> + <object class="GtkButton" id="btnFirst"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes" context="printdialog|firstpage">First page</property> + <property name="image">imgFirst</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="pack_type">end</property> + <property name="position">5</property> </packing> </child> </object> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits