diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2019-09-05 11:01:52 +0200 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2019-09-06 13:59:18 +0200 |
commit | 9b021e87e04f4ab294d8cefb5d54bfe29e1e85dd (patch) | |
tree | 3385622bd3912466dc7d832c16caf0b85545285b /vcl/source/window/printdlg.cxx | |
parent | 9f6d1d5c4c75c51f36815178507e336c504025fb (diff) |
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.tietze@documentfoundation.org>
Diffstat (limited to 'vcl/source/window/printdlg.cxx')
-rw-r--r-- | vcl/source/window/printdlg.cxx | 31 |
1 files changed, 31 insertions, 0 deletions
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") |