summaryrefslogtreecommitdiffstats
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-11-29 11:50:54 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-11-29 14:40:45 +0000
commit59b98580bfd70205a9ebdb0ba67e74225d875b43 (patch)
tree49ae5fefb8e5df4fdcce26f77740fc0fef70cdc5 /sfx2
parentfdo#57655: Improve wording (diff)
downloadcore-59b98580bfd70205a9ebdb0ba67e74225d875b43.tar.gz
core-59b98580bfd70205a9ebdb0ba67e74225d875b43.zip
Resolves: fdo#44664 Provide a way to set the default print job format.
a) In the print dialog you can temporarily override the default print job format for a single print job b) In the printer options dialog you can override the default print job format for a single printer c) Under tools->options->print you can override the default print job format for all printers. Tidy up the restart dialog in passing Change-Id: Ibea94bab6a79c3590dbf34583013db4e2ac06f45
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/Library_sfx.mk4
-rw-r--r--sfx2/inc/sfx2/printopt.hxx2
-rw-r--r--sfx2/source/dialog/printopt.cxx40
-rw-r--r--sfx2/source/dialog/printopt.hrc2
-rw-r--r--sfx2/source/dialog/printopt.src19
5 files changed, 63 insertions, 4 deletions
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 6cc8a1d5a64e..58c4e81d1d88 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -40,6 +40,10 @@ $(eval $(call gb_Library_set_include,sfx,\
$(eval $(call gb_Library_add_defs,sfx,-DSFX2_DLLIMPLEMENTATION))
+$(eval $(call gb_Library_add_defs,sfx,\
+ $(if $(filter TRUE,$(ENABLE_CUPS)),-DENABLE_CUPS) \
+))
+
ifeq ($(ENABLE_SYSTRAY_GTK),TRUE)
$(eval $(call gb_Library_add_defs,sfx,\
-DENABLE_QUICKSTART_APPLET \
diff --git a/sfx2/inc/sfx2/printopt.hxx b/sfx2/inc/sfx2/printopt.hxx
index 24472c0b7b31..ccc48ef0e058 100644
--- a/sfx2/inc/sfx2/printopt.hxx
+++ b/sfx2/inc/sfx2/printopt.hxx
@@ -67,6 +67,8 @@ private:
CheckBox aConvertToGreyscalesCB;
+ CheckBox aPDFCB;
+
FixedLine aWarnGB;
CheckBox aPaperSizeCB;
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index 93ce802d92a7..4183eef87d41 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -22,8 +22,10 @@
#include <vcl/msgbox.hxx>
#include <unotools/printwarningoptions.hxx>
#include <svtools/printoptions.hxx>
+#include <svtools/restartdialog.hxx>
#include <svl/flagitem.hxx>
+#include <comphelper/processfactory.hxx>
#include "printopt.hrc"
#include "dialog.hrc"
@@ -58,6 +60,7 @@ SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, con
aReduceBitmapsResolutionLB( this, SfxResId( LB_REDUCEBITMAPS_RESOLUTION ) ),
aReduceBitmapsTransparencyCB( this, SfxResId( CB_REDUCEBITMAPS_TRANSPARENCY ) ),
aConvertToGreyscalesCB( this, SfxResId( CB_CONVERTTOGREYSCALES ) ),
+ aPDFCB( this, SfxResId( CB_PDF ) ),
aWarnGB( this, SfxResId( GB_PRINT_WARN ) ),
aPaperSizeCB( this, SfxResId( CB_PAPERSIZE ) ),
aPaperOrientationCB( this, SfxResId( CB_PAPERORIENTATION ) ),
@@ -65,6 +68,29 @@ SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, con
{
FreeResource();
+#ifndef ENABLE_CUPS
+ long nDiff = aWarnGB.GetPosPixel().Y() - aPDFCB.GetPosPixel().Y();
+ aPDFCB.Hide();
+
+ Point aPoint;
+
+ aPoint = aWarnGB.GetPosPixel();
+ aPoint.Y() -= nDiff;
+ aWarnGB.SetPosPixel(aPoint);
+
+ aPoint = aPaperSizeCB.GetPosPixel();
+ aPoint.Y() -= nDiff;
+ aPaperSizeCB.SetPosPixel(aPoint);
+
+ aPoint = aPaperOrientationCB.GetPosPixel();
+ aPoint.Y() -= nDiff;
+ aPaperOrientationCB.SetPosPixel(aPoint);
+
+ aPoint = aTransparencyCB.GetPosPixel();
+ aPoint.Y() -= nDiff;
+ aTransparencyCB.SetPosPixel(aPoint);
+#endif
+
aOutputGB.SetStyle( aOutputGB.GetStyle() | WB_NOLABEL );
if( bOutputForPrinter )
@@ -76,6 +102,7 @@ SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, con
{
aPrintFileOutputRB.Check( sal_True );
aOutputGB.SetText( OutputDevice::GetNonMnemonicString( aPrintFileOutputRB.GetText() ) );
+ aPDFCB.Disable();
}
aPrinterOutputRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl ) );
@@ -237,6 +264,7 @@ void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCu
aReduceBitmapsTransparencyCB.Check( pCurrentOptions->IsReducedBitmapIncludesTransparency() );
aConvertToGreyscalesCB.Check( pCurrentOptions->IsConvertToGreyscales() );
+ aPDFCB.Check( pCurrentOptions->IsPDFAsStandardPrintJobFormat() );
ClickReduceTransparencyCBHdl( &aReduceTransparencyCB );
ClickReduceGradientsCBHdl( &aReduceGradientsCB );
@@ -355,6 +383,14 @@ void SfxCommonPrintOptionsTabPage::ImplSaveControls( PrinterOptions* pCurrentOpt
(sal_uInt16)( (sizeof (aDPIArray) / sizeof (aDPIArray[0])) - 1 ) ) ] );
pCurrentOptions->SetReducedBitmapIncludesTransparency( aReduceBitmapsTransparencyCB.IsChecked() );
pCurrentOptions->SetConvertToGreyscales( aConvertToGreyscalesCB.IsChecked() );
+ sal_Bool bOrigBackEnd = pCurrentOptions->IsPDFAsStandardPrintJobFormat();
+ if (bOrigBackEnd != aPDFCB.IsChecked())
+ {
+ pCurrentOptions->SetPDFAsStandardPrintJobFormat( aPDFCB.IsChecked() );
+ svtools::executeRestartDialog(
+ comphelper::getProcessComponentContext(), 0,
+ svtools::RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT);
+ }
}
IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, CheckBox*, pBox )
@@ -445,9 +481,13 @@ IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl, RadioButton
bOutputForPrinter = sal_False;
// #i63982#
ImplSetAccessibleNames();
+ aPDFCB.Disable();
}
else
+ {
ImplSaveControls( &maPrintFileOptions );
+ aPDFCB.Enable();
+ }
return 0;
}
diff --git a/sfx2/source/dialog/printopt.hrc b/sfx2/source/dialog/printopt.hrc
index bdc04b2347a3..6df68661a534 100644
--- a/sfx2/source/dialog/printopt.hrc
+++ b/sfx2/source/dialog/printopt.hrc
@@ -46,3 +46,5 @@
#define CB_PAPERSIZE 51
#define CB_PAPERORIENTATION 52
#define CB_TRANSPARENCY 53
+
+#define CB_PDF 54
diff --git a/sfx2/source/dialog/printopt.src b/sfx2/source/dialog/printopt.src
index a21e09b618a6..648ad50d7e10 100644
--- a/sfx2/source/dialog/printopt.src
+++ b/sfx2/source/dialog/printopt.src
@@ -210,9 +210,20 @@ TabPage TP_COMMONPRINTOPTIONS
// -----------
+ CheckBox CB_PDF
+ {
+ HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_REDUCEBITMAPS";
+ TabStop = TRUE;
+ Pos = MAP_APPFONT ( 18, 146 ) ;
+ Size = MAP_APPFONT ( 115, 10 ) ;
+ Text [ en-US ] = "PDF as Standard Print Job Format";
+ };
+
+ // -----------
+
FixedLine GB_PRINT_WARN
{
- Pos = MAP_APPFONT ( 6, 148 ) ;
+ Pos = MAP_APPFONT ( 6, 162 ) ;
Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Printer warnings" ;
};
@@ -220,7 +231,7 @@ TabPage TP_COMMONPRINTOPTIONS
{
HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_PAPERSIZE";
TabStop = TRUE;
- Pos = MAP_APPFONT ( 12, 159 ) ;
+ Pos = MAP_APPFONT ( 12, 173 ) ;
Size = MAP_APPFONT ( 123, 10 ) ;
Text [ en-US ] = "P~aper size" ;
};
@@ -228,7 +239,7 @@ TabPage TP_COMMONPRINTOPTIONS
{
HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_PAPERORIENTATION";
TabStop = TRUE;
- Pos = MAP_APPFONT ( 12, 172 ) ;
+ Pos = MAP_APPFONT ( 12, 186 ) ;
Size = MAP_APPFONT ( 123 , 10 ) ;
Text [ en-US ] = "Pap~er orientation" ;
};
@@ -236,7 +247,7 @@ TabPage TP_COMMONPRINTOPTIONS
{
HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_TRANSPARENCY";
TabStop = TRUE;
- Pos = MAP_APPFONT ( 136, 159 ) ;
+ Pos = MAP_APPFONT ( 136, 173 ) ;
Size = MAP_APPFONT ( 123, 10 ) ;
Text [ en-US ] = "~Transparency";
};