diff --git a/padmin/UIConfig_spa.mk b/padmin/UIConfig_spa.mk index 6ac5ba26e87b..565f0cc57536 100644 --- a/padmin/UIConfig_spa.mk +++ b/padmin/UIConfig_spa.mk @@ -13,7 +13,6 @@ $(eval $(call gb_UIConfig_add_uifiles,spa,\ padmin/uiconfig/ui/printerdevicepage \ padmin/uiconfig/ui/printerpaperpage \ padmin/uiconfig/ui/printerpropertiesdialog \ - padmin/uiconfig/ui/querydialog \ )) # vim: set noet sw=4 ts=4: diff --git a/padmin/source/helper.cxx b/padmin/source/helper.cxx index d0e2a51f83bb..da9fcabcd3ba 100644 --- a/padmin/source/helper.cxx +++ b/padmin/source/helper.cxx @@ -75,38 +75,4 @@ ResId padmin::PaResId( sal_uInt32 nId ) return ResId( nId, *pPaResMgr ); } -/* - * QueryString - */ -QueryString::QueryString(Window* pParent, OUString& rQuery, OUString& rRet) - : ModalDialog(pParent, "QueryDialog", - "spa/ui/querydialog.ui" ) - , m_rReturnValue( rRet ) -{ - get(m_pOKButton, "ok"); - get(m_pFixedText, "label"); - get(m_pEdit, "entry"); - - m_pOKButton->SetClickHdl( LINK( this, QueryString, ClickBtnHdl ) ); - m_pFixedText->SetText( rQuery ); - m_pEdit->SetText( m_rReturnValue ); - SetText( Application::GetDisplayName() ); -} - -QueryString::~QueryString() -{ -} - -IMPL_LINK( QueryString, ClickBtnHdl, Button*, pButton ) -{ - if (pButton == m_pOKButton) - { - m_rReturnValue = m_pEdit->GetText(); - EndDialog( 1 ); - } - else - EndDialog(0); - return 0; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/padmin/source/helper.hxx b/padmin/source/helper.hxx index 1e491d2d0293..b7b8fb86b1d1 100644 --- a/padmin/source/helper.hxx +++ b/padmin/source/helper.hxx @@ -38,24 +38,7 @@ namespace padmin { -class QueryString : public ModalDialog -{ -private: - OKButton* m_pOKButton; - FixedText* m_pFixedText; - Edit* m_pEdit; - OUString& m_rReturnValue; - - DECL_LINK( ClickBtnHdl, Button* ); - -public: - QueryString(Window*, OUString &, OUString &); - // parent window, Query text, initial value - ~QueryString(); -}; - ResId PaResId( sal_uInt32 nId ); - } // namespace padmin #endif diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx index bda0d0126495..b526ec78aa23 100644 --- a/padmin/source/prtsetup.cxx +++ b/padmin/source/prtsetup.cxx @@ -538,13 +538,6 @@ extern "C" { return nRet; } - int SPA_DLLPUBLIC Sal_queryFaxNumber( OUString& rNumber ) - { - OUString aTmpString( PaResId( RID_TXT_QUERYFAXNUMBER ) ); - QueryString aQuery( NULL, aTmpString, rNumber ); - return aQuery.Execute(); - } - bool SPA_DLLPUBLIC Sal_authenticateQuery( const OString& rServer, OString& rUserName, OString& rPassword ) { bool bRet = false; diff --git a/padmin/source/rtsetup.hrc b/padmin/source/rtsetup.hrc index aab206a92dfa..5a58ea69a385 100644 --- a/padmin/source/rtsetup.hrc +++ b/padmin/source/rtsetup.hrc @@ -22,8 +22,6 @@ #define RID_RTS_RTSDIALOG_INVALID_TXT 4001 -#define RID_TXT_QUERYFAXNUMBER 4007 - #define RID_RTS_PWDIALOG 4008 #define RID_RTS_PWDIALOG_TXT 1 #define RID_RTS_PWDIALOG_USER_TXT 2 diff --git a/padmin/source/rtsetup.src b/padmin/source/rtsetup.src index 74953c9ce279..89d332dbf53f 100644 --- a/padmin/source/rtsetup.src +++ b/padmin/source/rtsetup.src @@ -24,11 +24,6 @@ String RID_RTS_RTSDIALOG_INVALID_TXT Text [ en-US ] = ""; }; -String RID_TXT_QUERYFAXNUMBER -{ - Text [ en-US ] = "Please enter the fax number."; -}; - ModalDialog RID_RTS_PWDIALOG { HelpID = "padmin:ModalDialog:RID_RTS_PWDIALOG"; diff --git a/vcl/UIConfig_vcl.mk b/vcl/UIConfig_vcl.mk index d37c985dd8ff..bdc028e3137d 100644 --- a/vcl/UIConfig_vcl.mk +++ b/vcl/UIConfig_vcl.mk @@ -14,6 +14,7 @@ $(eval $(call gb_UIConfig_add_uifiles,vcl,\ vcl/uiconfig/ui/errornoprinterdialog \ vcl/uiconfig/ui/printdialog \ vcl/uiconfig/ui/printprogressdialog \ + vcl/uiconfig/ui/querydialog \ )) # vim: set noet sw=4 ts=4: diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx index cc379e556607..a60e5b66fa4c 100644 --- a/vcl/generic/print/genprnpsp.cxx +++ b/vcl/generic/print/genprnpsp.cxx @@ -41,12 +41,16 @@ #include "osl/module.h" +#include "vcl/button.hxx" +#include "vcl/dialog.hxx" +#include "vcl/edit.hxx" +#include "vcl/fixed.hxx" #include "vcl/svapp.hxx" #include "vcl/print.hxx" #include "vcl/pdfwriter.hxx" #include "vcl/printerinfomanager.hxx" #include "vcl/settings.hxx" - +#include "svids.hrc" #include "saldatabasic.hxx" #include "generic/genprn.h" #include "generic/geninst.h" @@ -73,8 +77,6 @@ extern "C" { typedef int(*setupFunction)(PrinterInfo&); static setupFunction pSetupFunction = NULL; -typedef int(*faxFunction)(OUString&); -static faxFunction pFaxNrFunction = NULL; } static OUString getPdfDir( const PrinterInfo& rInfo ) @@ -96,6 +98,61 @@ static OUString getPdfDir( const PrinterInfo& rInfo ) return aDir; } +namespace +{ + class QueryString : public ModalDialog + { + private: + OKButton* m_pOKButton; + FixedText* m_pFixedText; + Edit* m_pEdit; + OUString& m_rReturnValue; + + DECL_LINK( ClickBtnHdl, Button* ); + + public: + // parent window, Query text, initial value + QueryString(Window*, OUString &, OUString &); + }; + + /* + * QueryString + */ + QueryString::QueryString(Window* pParent, OUString& rQuery, OUString& rRet) + : ModalDialog(pParent, "QueryDialog", + "vcl/ui/querydialog.ui" ) + , m_rReturnValue( rRet ) + { + get(m_pOKButton, "ok"); + get(m_pFixedText, "label"); + get(m_pEdit, "entry"); + + m_pOKButton->SetClickHdl(LINK(this, QueryString, ClickBtnHdl)); + m_pFixedText->SetText(rQuery); + m_pEdit->SetText(m_rReturnValue); + SetText(Application::GetDisplayName()); + } + + IMPL_LINK( QueryString, ClickBtnHdl, Button*, pButton ) + { + if (pButton == m_pOKButton) + { + m_rReturnValue = m_pEdit->GetText(); + EndDialog( 1 ); + } + else + EndDialog(0); + return 0; + } + + int QueryFaxNumber(OUString& rNumber) + { + OUString aTmpString(VclResId(SV_PRINT_QUERYFAXNUMBER_TXT)); + QueryString aQuery(NULL, aTmpString, rNumber); + return aQuery.Execute(); + } +} + static void getPaLib() { #if defined( UNX ) && !( defined( MACOSX ) || defined( IOS ) || defined( ANDROID ) ) @@ -110,10 +167,6 @@ static void getPaLib() pSetupFunction = (setupFunction)osl_getAsciiFunctionSymbol( driverLib, "Sal_SetupPrinterDriver" ); if ( !pSetupFunction ) fprintf( stderr, "could not resolve Sal_SetupPrinterDriver\n" ); - - pFaxNrFunction = (faxFunction)osl_getAsciiFunctionSymbol( driverLib, "Sal_queryFaxNumber" ); - if ( !pFaxNrFunction ) - fprintf( stderr, "could not resolve Sal_queryFaxNumber\n" ); } #endif } @@ -308,23 +361,17 @@ static std::vector getFaxNumbers() { std::vector aFaxNumbers; -#if defined( UNX ) - getPaLib(); - if (pFaxNrFunction) + OUString aNewNr; + if (QueryFaxNumber(aNewNr)) { - OUString aNewNr; - if( pFaxNrFunction( aNewNr ) ) + sal_Int32 nIndex = 0; + do { - sal_Int32 nIndex = 0; - do - { - OUString sToken = aNewNr.getToken( 0, ';', nIndex ); - aFaxNumbers.push_back(sToken); - } - while (nIndex >= 0); + OUString sToken = aNewNr.getToken( 0, ';', nIndex ); + aFaxNumbers.push_back(sToken); } + while (nIndex >= 0); } -#endif return aFaxNumbers; } diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc index f3c3f4d43678..6cb7d7310fa9 100644 --- a/vcl/inc/svids.hrc +++ b/vcl/inc/svids.hrc @@ -212,6 +212,7 @@ #define SV_PRINT_PRINTPREVIEW_TXT 10612 #define SV_PRINT_COLLATE_IMG 10613 #define SV_PRINT_NOCOLLATE_IMG 10614 +#define SV_PRINT_QUERYFAXNUMBER_TXT 10615 #define SV_EDIT_WARNING_BOX 10650 diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src index 4bfa750bf9c4..738adb3eedfc 100644 --- a/vcl/source/src/print.src +++ b/vcl/source/src/print.src @@ -105,4 +105,9 @@ Image SV_PRINT_NOCOLLATE_IMG ImageBitmap = Bitmap { File = "ncollate.png" ; }; }; +String SV_PRINT_QUERYFAXNUMBER_TXT +{ + Text [ en-US ] = "Please enter the fax number."; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/padmin/uiconfig/ui/querydialog.ui b/vcl/uiconfig/ui/querydialog.ui similarity index 100% rename from padmin/uiconfig/ui/querydialog.ui rename to vcl/uiconfig/ui/querydialog.ui