diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-12-15 20:37:33 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-12-17 09:35:26 +0000 |
commit | 5af4fff6d4dede7e60d407766f30e7191eeeee66 (patch) | |
tree | dae7e4bd1d9e63ac833887550ff5d2a4b034b729 /padmin/source | |
parent | be61350e8b078fbc34d820868d67f7e393bf93df (diff) |
convert print properties tabdialog to .ui format
the dialog itself that is, two of the pages are in .ui
format and the rest are pending conversion
Change-Id: I5a22cf1603abb0400272ce8969c0b43a00ed7739
Diffstat (limited to 'padmin/source')
-rw-r--r-- | padmin/source/cmddlg.cxx | 2 | ||||
-rw-r--r-- | padmin/source/prtsetup.cxx | 90 | ||||
-rw-r--r-- | padmin/source/prtsetup.hxx | 8 | ||||
-rw-r--r-- | padmin/source/rtsetup.hrc | 8 | ||||
-rw-r--r-- | padmin/source/rtsetup.src | 45 |
5 files changed, 50 insertions, 103 deletions
diff --git a/padmin/source/cmddlg.cxx b/padmin/source/cmddlg.cxx index f5496fbfa254..ba0691e3122d 100644 --- a/padmin/source/cmddlg.cxx +++ b/padmin/source/cmddlg.cxx @@ -214,7 +214,7 @@ void CommandStore::setFaxCommands( const ::std::list< String >& rCommands ) RTSCommandPage::RTSCommandPage( RTSDialog* pParent ) : - TabPage( &pParent->m_aTabControl, PaResId( RID_RTS_COMMANDPAGE ) ), + TabPage( pParent->m_pTabControl, PaResId( RID_RTS_COMMANDPAGE ) ), m_pParent( pParent ), m_aCommandsCB( this, PaResId( RID_RTS_CMD_CB_COMMANDS ) ), m_aExternalCB( this, PaResId( RID_RTS_CMD_CB_EXTERNAL ) ), diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx index 47b800c53d9b..3df1a5ea6fc3 100644 --- a/padmin/source/prtsetup.cxx +++ b/padmin/source/prtsetup.cxx @@ -79,21 +79,20 @@ void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDParser* pParser, con * RTSDialog */ -RTSDialog::RTSDialog( const PrinterInfo& rJobData, const String& rPrinter, bool bAllPages, Window* pParent ) : - TabDialog( pParent, PaResId( RID_RTS_RTSDIALOG ) ), - m_aJobData( rJobData ), - m_aPrinter( rPrinter ), - m_aTabControl( this, PaResId( RID_RTS_RTSDIALOG_TABCONTROL ) ), - m_aOKButton( this ), - m_aCancelButton( this ), - m_pPaperPage( NULL ), - m_pDevicePage( NULL ), - m_pOtherPage( NULL ), - m_pFontSubstPage( NULL ), - m_pCommandPage( NULL ), - m_aInvalidString( PaResId( RID_RTS_RTSDIALOG_INVALID_TXT ) ) -{ - FreeResource(); +RTSDialog::RTSDialog( const PrinterInfo& rJobData, const String& rPrinter, bool bAllPages, Window* pParent ) + : TabDialog(pParent, "PrinterPropertiesDialog", "spa/ui/printerpropertiesdialog.ui" ) + , m_aJobData(rJobData) + , m_aPrinter(rPrinter) + , m_pPaperPage(NULL) + , m_pDevicePage(NULL) + , m_pOtherPage(NULL) + , m_pFontSubstPage(NULL) + , m_pCommandPage(NULL) + , m_aInvalidString(PaResId(RID_RTS_RTSDIALOG_INVALID_TXT).toString()) +{ + get(m_pOKButton, "ok"); + get(m_pCancelButton, "cancel"); + get(m_pTabControl, "notebook"); String aTitle( GetText() ); aTitle.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), m_aJobData.m_aPrinterName ); @@ -101,23 +100,20 @@ RTSDialog::RTSDialog( const PrinterInfo& rJobData, const String& rPrinter, bool if( ! bAllPages ) { - m_aTabControl.RemovePage( RID_RTS_OTHERPAGE ); - m_aTabControl.RemovePage( RID_RTS_FONTSUBSTPAGE ); - m_aTabControl.RemovePage( RID_RTS_COMMANDPAGE ); + m_pTabControl->RemovePage(m_pTabControl->GetPageId("other")); + m_pTabControl->RemovePage(m_pTabControl->GetPageId("font")); + m_pTabControl->RemovePage(m_pTabControl->GetPageId("command")); } else if( m_aJobData.m_aDriverName.compareToAscii( "CUPS:", 5 ) == 0 && ! PrinterInfoManager::get().isCUPSDisabled() ) { // command page makes no sense for CUPS printers - m_aTabControl.RemovePage( RID_RTS_COMMANDPAGE ); + m_pTabControl->RemovePage(m_pTabControl->GetPageId("command")); } - m_aTabControl.SetActivatePageHdl( LINK( this, RTSDialog, ActivatePage ) ); - m_aOKButton.SetClickHdl( LINK( this, RTSDialog, ClickButton ) ); - m_aCancelButton.SetClickHdl( LINK( this, RTSDialog, ClickButton ) ); - ActivatePage( &m_aTabControl ); - - m_aOKButton.Show(); - m_aCancelButton.Show(); + m_pTabControl->SetActivatePageHdl( LINK( this, RTSDialog, ActivatePage ) ); + m_pOKButton->SetClickHdl( LINK( this, RTSDialog, ClickButton ) ); + m_pCancelButton->SetClickHdl( LINK( this, RTSDialog, ClickButton ) ); + ActivatePage(m_pTabControl); } // -------------------------------------------------------------------------- @@ -140,35 +136,33 @@ RTSDialog::~RTSDialog() IMPL_LINK( RTSDialog, ActivatePage, TabControl*, pTabCtrl ) { - if( pTabCtrl != &m_aTabControl ) + if( pTabCtrl != m_pTabControl ) return 0; - sal_uInt16 nId = m_aTabControl.GetCurPageId(); - - if ( ! m_aTabControl.GetTabPage( nId ) ) + sal_uInt16 nId = m_pTabControl->GetCurPageId(); + OString sPage = m_pTabControl->GetPageName(nId); + if ( ! m_pTabControl->GetTabPage( nId ) ) { TabPage *pPage = NULL; - if( nId == RID_RTS_PAPERPAGE ) + if (sPage == "paper") pPage = m_pPaperPage = new RTSPaperPage( this ); - else if( nId == RID_RTS_DEVICEPAGE ) + else if (sPage == "device") pPage = m_pDevicePage = new RTSDevicePage( this ); - else if( nId == RID_RTS_OTHERPAGE ) + else if (sPage == "other") pPage = m_pOtherPage = new RTSOtherPage( this ); - else if( nId == RID_RTS_FONTSUBSTPAGE ) + else if (sPage == "font") pPage = m_pFontSubstPage = new RTSFontSubstPage( this ); - else if( nId == RID_RTS_COMMANDPAGE ) + else if (sPage == "command") pPage = m_pCommandPage = new RTSCommandPage( this ); if( pPage ) - m_aTabControl.SetTabPage( nId, pPage ); + m_pTabControl->SetTabPage( nId, pPage ); } else { - switch( nId ) - { - case RID_RTS_PAPERPAGE: m_pPaperPage->update();break; - case RID_RTS_DEVICEPAGE: m_pDevicePage->update();break; - default: break; - } + if (sPage == "paper") + m_pPaperPage->update(); + else if (sPage == "device") + m_pDevicePage->update(); } return 0; @@ -178,7 +172,7 @@ IMPL_LINK( RTSDialog, ActivatePage, TabControl*, pTabCtrl ) IMPL_LINK( RTSDialog, ClickButton, Button*, pButton ) { - if( pButton == &m_aOKButton ) + if( pButton == m_pOKButton ) { // refresh the changed values if( m_pPaperPage ) @@ -203,7 +197,7 @@ IMPL_LINK( RTSDialog, ClickButton, Button*, pButton ) EndDialog( 1 ); } - else if( pButton == &m_aCancelButton ) + else if( pButton == m_pCancelButton ) EndDialog( 0 ); return 0; @@ -216,7 +210,7 @@ IMPL_LINK( RTSDialog, ClickButton, Button*, pButton ) */ RTSPaperPage::RTSPaperPage(RTSDialog* pParent) - : TabPage(&pParent->m_aTabControl, "PrinterPaperPage", "spa/ui/printerpaperpage.ui" ) + : TabPage(pParent->m_pTabControl, "PrinterPaperPage", "spa/ui/printerpaperpage.ui" ) , m_pParent( pParent ) { get(m_pPaperText, "paperft"); @@ -341,7 +335,7 @@ IMPL_LINK( RTSPaperPage, SelectHdl, ListBox*, pBox ) */ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) - : TabPage(&pParent->m_aTabControl, "PrinterDevicePage", "spa/ui/printerdevicepage.ui" ) + : TabPage(pParent->m_pTabControl, "PrinterDevicePage", "spa/ui/printerdevicepage.ui" ) , m_pParent( pParent ) { get(m_pPPDKeyBox, "options"); @@ -530,7 +524,7 @@ void RTSDevicePage::FillValueBox( const PPDKey* pKey ) */ RTSOtherPage::RTSOtherPage( RTSDialog* pParent ) : - TabPage( &pParent->m_aTabControl, PaResId( RID_RTS_OTHERPAGE ) ), + TabPage( pParent->m_pTabControl, PaResId( RID_RTS_OTHERPAGE ) ), m_pParent( pParent ), m_aLeftTxt( this, PaResId( RID_RTS_OTHER_LEFTMARGIN_TXT ) ), m_aLeftLB( this, PaResId( RID_RTS_OTHER_LEFTMARGIN_BOX ) ), @@ -642,7 +636,7 @@ IMPL_LINK( RTSOtherPage, ClickBtnHdl, Button*, pButton ) */ RTSFontSubstPage::RTSFontSubstPage( RTSDialog* pParent ) : - TabPage( &pParent->m_aTabControl, PaResId( RID_RTS_FONTSUBSTPAGE ) ), + TabPage( pParent->m_pTabControl, PaResId( RID_RTS_FONTSUBSTPAGE ) ), m_pParent( pParent ), m_aSubstitutionsText( this, PaResId( RID_RTS_FS_SUBST_TXT ) ), m_aSubstitutionsBox( this, PaResId( RID_RTS_FS_SUBST_BOX ) ), diff --git a/padmin/source/prtsetup.hxx b/padmin/source/prtsetup.hxx index 1de4f8956c62..efc217084c2c 100644 --- a/padmin/source/prtsetup.hxx +++ b/padmin/source/prtsetup.hxx @@ -55,9 +55,9 @@ class RTSDialog : public TabDialog String m_aPrinter; // controls - TabControl m_aTabControl; - OKButton m_aOKButton; - CancelButton m_aCancelButton; + TabControl* m_pTabControl; + OKButton* m_pOKButton; + CancelButton* m_pCancelButton; // pages RTSPaperPage* m_pPaperPage; @@ -67,7 +67,7 @@ class RTSDialog : public TabDialog RTSCommandPage* m_pCommandPage; // some resources - String m_aInvalidString; + OUString m_aInvalidString; DECL_LINK( ActivatePage, TabControl* ); DECL_LINK( ClickButton, Button* ); diff --git a/padmin/source/rtsetup.hrc b/padmin/source/rtsetup.hrc index 711e303578de..bf90cf01b5ce 100644 --- a/padmin/source/rtsetup.hrc +++ b/padmin/source/rtsetup.hrc @@ -19,10 +19,7 @@ #ifndef _PAD_RTSETUP_HRC_ #define _PAD_RTSETUP_HRC_ -#define RID_RTS_RTSDIALOG 4001 -#define RID_RTS_RTSDIALOG_INVALID_TXT 1 -#define RID_RTS_RTSDIALOG_FROMDRIVER_TXT 2 -#define RID_RTS_RTSDIALOG_TABCONTROL 3 +#define RID_RTS_RTSDIALOG_INVALID_TXT 4001 #define RID_RTS_OTHERPAGE 4002 #define RID_RTS_OTHER_LEFTMARGIN_TXT 1 @@ -37,9 +34,6 @@ #define RID_RTS_OTHER_COMMENT_EDT 10 #define RID_RTS_OTHER_DEFAULT_BTN 11 -#define RID_RTS_DEVICEPAGE 4003 -#define RID_RTS_PAPERPAGE 4004 - #define RID_RTS_FONTSUBSTPAGE 4005 #define RID_RTS_FS_SUBST_TXT 1 #define RID_RTS_FS_SUBST_BOX 2 diff --git a/padmin/source/rtsetup.src b/padmin/source/rtsetup.src index 56128c7fe302..8edb7a03f75b 100644 --- a/padmin/source/rtsetup.src +++ b/padmin/source/rtsetup.src @@ -18,50 +18,9 @@ #include "rtsetup.hrc" -TabDialog RID_RTS_RTSDIALOG +String RID_RTS_RTSDIALOG_INVALID_TXT { - Moveable = TRUE; - Sizeable = TRUE; - Closeable = TRUE; - SVLook = TRUE; - - TabControl RID_RTS_RTSDIALOG_TABCONTROL - { - OutputSize = TRUE; - PageList = - { - PageItem - { - Identifier = RID_RTS_COMMANDPAGE; - Text [ en-US ] = "Command"; - }; - PageItem - { - Identifier = RID_RTS_PAPERPAGE; - Text [ en-US ] = "Paper"; - }; - PageItem - { - Identifier = RID_RTS_DEVICEPAGE; - Text [ en-US ] = "Device"; - }; - PageItem - { - Identifier = RID_RTS_FONTSUBSTPAGE; - Text [ en-US ] = "Font Replacement"; - }; - PageItem - { - Identifier = RID_RTS_OTHERPAGE; - Text [ en-US ] = "Other Settings"; - }; - }; - }; - String RID_RTS_RTSDIALOG_INVALID_TXT - { - Text [ en-US ] = "<ignore>"; - }; - Text [ en-US ] = "Properties of %s"; + Text [ en-US ] = "<ignore>"; }; TabPage RID_RTS_FONTSUBSTPAGE |