From d6f7c94e5c27ba02ff5c3229760c9808cc9b5bea Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Thu, 17 Sep 2009 16:34:35 +0000 Subject: CWS-TOOLING: integrate CWS vcl105 2009-09-07 Philipp Lohmann fix path issues 2009-09-07 hdu #i104525# Aqua: workaround OSX problem in RecentlyUsed list 2009-09-07 Philipp Lohmann add missing dollar sign 2009-09-07 Philipp Lohmann remove warnings 2009-09-07 hdu #i104011# need to use real-vals in cff-subsetter for some fonts 2009-09-05 Philipp Lohmann #i103674# less noise 2009-09-05 Philipp Lohmann #i103674# add garmin communicator to list of crashing plugins 2009-09-05 Philipp Lohmann #i103674# confiuration option to disable plugin support 2009-09-05 Philipp Lohmann merge #i102735# 2009-09-05 Philipp Lohmann #i88802# enable transparency resolution for PDF/A 2009-09-04 Philipp Lohmann rebase to DEV300m57 2009-09-03 Philipp Lohmann #i90083# fix a typo 2009-09-03 Philipp Lohmann merge 2009-09-03 Philipp Lohmann #i90083# workaround for application frame switching 2009-09-03 hdu #i104720# better description for --without-fonts configure option 2009-09-02 hdu #i104723# update third-party fonts 2009-09-02 hdu #i104723# update default-installed Liberation fonts from 1.04->1.05.1.20090721 2009-09-02 hdu #i104720# update default-installed DejaVu fonts from 2.21->2.30 2009-09-02 hdu #i89682# add Gentium fonts to default installation 2009-09-02 hdu #i89682# add Gentium fonts to default installation 2009-09-01 hdu #i104011# fix vertical offset in PDF-export of USP-layouted text 2009-08-27 Philipp Lohmann #i102033# ignore transients 2009-08-27 Philipp Lohmann merge 2009-08-27 Philipp Lohmann fix warning, remove crappy early exits 2009-08-26 Philipp Lohmann #i63494# user event time for generic plugin always regotten to work around metacity 2009-08-26 Philipp Lohmann merge 2009-08-26 Philipp Lohmann #i104526# fix string conversion 2009-08-25 Philipp Lohmann #b6855541# show newly added driver, repair remove driver 2009-08-25 Philipp Lohmann #i104469# maximizing issue (thanks haggai) --- padmin/source/adddlg.cxx | 34 ++++++++++++++++++++++------------ padmin/source/adddlg.hxx | 2 +- padmin/source/newppdlg.cxx | 4 ++++ padmin/source/newppdlg.hxx | 5 +++++ 4 files changed, 32 insertions(+), 13 deletions(-) (limited to 'padmin') diff --git a/padmin/source/adddlg.cxx b/padmin/source/adddlg.cxx index c10be2d83fcd..052de2cbb731 100644 --- a/padmin/source/adddlg.cxx +++ b/padmin/source/adddlg.cxx @@ -147,27 +147,31 @@ void APChooseDriverPage::fill( PrinterInfo& rInfo ) } } -void APChooseDriverPage::updateDrivers() +void APChooseDriverPage::updateDrivers( bool bRefresh, const rtl::OUString& rSelectDriver ) { for( int k = 0; k < m_aDriverBox.GetEntryCount(); k++ ) delete (String*)m_aDriverBox.GetEntryData( k ); m_aDriverBox.Clear(); std::list< rtl::OUString > aDrivers; - psp::PPDParser::getKnownPPDDrivers( aDrivers ); + psp::PPDParser::getKnownPPDDrivers( aDrivers, bRefresh ); + rtl::OUString aSelectDriver( psp::PPDParser::getPPDPrinterName( rSelectDriver ) ); + + rtl::OUString aSelectedEntry; for( std::list< rtl::OUString >::const_iterator it = aDrivers.begin(); it != aDrivers.end(); ++it ) { - String aDriver( ::psp::PPDParser::getPPDPrinterName( *it ) ); - if( aDriver.Len() ) + rtl::OUString aDriver( psp::PPDParser::getPPDPrinterName( *it ) ); + if( aDriver.getLength() ) { int nPos = m_aDriverBox.InsertEntry( aDriver ); m_aDriverBox.SetEntryData( nPos, new String( *it ) ); - if( it->equalsAscii( "SGENPRT" ) ) - m_aDriverBox.SelectEntryPos( nPos ); + if( aDriver == aSelectDriver ) + aSelectedEntry = aDriver; } } + m_aDriverBox.SelectEntry( aSelectedEntry ); m_aRemBtn.Enable( m_aDriverBox.GetEntryCount() > 0 ); } @@ -185,7 +189,13 @@ IMPL_LINK( APChooseDriverPage, ClickBtnHdl, PushButton*, pButton ) { PPDImportDialog aDlg( this ); if( aDlg.Execute() ) - updateDrivers(); + { + const std::list< rtl::OUString >& rImported( aDlg.getImportedFiles() ); + if( rImported.empty() ) + updateDrivers( true ); + else + updateDrivers( true, rImported.front() ); + } } else if( pButton == &m_aRemBtn ) { @@ -259,11 +269,10 @@ IMPL_LINK( APChooseDriverPage, ClickBtnHdl, PushButton*, pButton ) rPIManager.removePrinter( *it ); } - ::std::list< rtl::OUString > aDirs; + std::list< rtl::OUString > aDirs; // get only psprint's directories, not eventual system dirs psp::getPrinterPathList( aDirs, NULL ); - ::std::list< rtl::OUString >::iterator dir; - + std::list< rtl::OUString >::iterator dir; for( dir = aDirs.begin(); dir != aDirs.end(); ++dir ) { ::std::list< String > aFiles; @@ -271,10 +280,11 @@ IMPL_LINK( APChooseDriverPage, ClickBtnHdl, PushButton*, pButton ) OUStringBuffer aDir( *dir ); aDir.append( sal_Unicode( '/' ) ); aDir.appendAscii( PRINTER_PPDDIR ); - FindFiles( aDir.makeStringAndClear(), aFiles, String( RTL_CONSTASCII_USTRINGPARAM( "PS;PPD;PS.GZ;PPD.GZ" ) ), true ); + rtl::OUString aPPDDir( aDir.makeStringAndClear() ); + FindFiles( aPPDDir, aFiles, String( RTL_CONSTASCII_USTRINGPARAM( "PS;PPD;PS.GZ;PPD.GZ" ) ), true ); for( file = aFiles.begin(); file != aFiles.end(); ++file ) { - String aFile( *dir ); + String aFile( aPPDDir ); if( aFile.GetChar( aFile.Len() ) != '/' ) aFile.AppendAscii( "/" ); aFile.Append( *file ); diff --git a/padmin/source/adddlg.hxx b/padmin/source/adddlg.hxx index e6fe17f30188..bb17044e800a 100644 --- a/padmin/source/adddlg.hxx +++ b/padmin/source/adddlg.hxx @@ -96,7 +96,7 @@ class APChooseDriverPage : public APTabPage DECL_LINK( ClickBtnHdl, PushButton* ); DECL_LINK( DelPressedHdl, ListBox* ); - void updateDrivers(); + void updateDrivers( bool bRefresh = false, const rtl::OUString& rSelectDriver = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) ) ); public: APChooseDriverPage( AddPrinterDialog* pParent ); ~APChooseDriverPage(); diff --git a/padmin/source/newppdlg.cxx b/padmin/source/newppdlg.cxx index 8d5414a2ceef..0fd6aa32c984 100644 --- a/padmin/source/newppdlg.cxx +++ b/padmin/source/newppdlg.cxx @@ -172,6 +172,7 @@ IMPL_LINK( PPDImportDialog, ClickBtnHdl, PushButton*, pButton ) ::std::list< rtl::OUString > aToDirs; psp::getPrinterPathList( aToDirs, PRINTER_PPDDIR ); ::std::list< rtl::OUString >::iterator writeDir = aToDirs.begin(); + m_aImportedFiles.clear(); for( int i = 0; i < m_aDriverLB.GetSelectEntryCount(); i++ ) { @@ -186,7 +187,10 @@ IMPL_LINK( PPDImportDialog, ClickBtnHdl, PushButton*, pButton ) aToFile.Append( aFile.GetName() ); OUString aToUni( aToFile.GetMainURL(INetURLObject::DECODE_TO_IURI) ); if( ! File::copy( aFromUni, aToUni ) ) + { + m_aImportedFiles.push_back( aToUni ); break; + } ++writeDir; } while( writeDir != aToDirs.end() ); } diff --git a/padmin/source/newppdlg.hxx b/padmin/source/newppdlg.hxx index 4d6d637efcc9..bd73b5ffed3e 100644 --- a/padmin/source/newppdlg.hxx +++ b/padmin/source/newppdlg.hxx @@ -64,9 +64,14 @@ namespace padmin { DECL_LINK( ModifyHdl, ComboBox* ); void Import(); + + std::list< rtl::OUString > m_aImportedFiles; public: PPDImportDialog( Window* pParent ); ~PPDImportDialog(); + + const std::list< rtl::OUString >& getImportedFiles() const + { return m_aImportedFiles; } }; } // namespace -- cgit