diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-12-18 23:05:02 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-12-19 15:23:15 +0000 |
commit | da5390f5613c2daa18f0f30760e47e7a102694df (patch) | |
tree | a984868a709f1ec19cc9d99dc7e01f3b1f41d961 /sfx2/source | |
parent | 243587069c20e062320b3698a08966613ece4bbb (diff) |
split out internet info page and convert to .ui
Change-Id: I1aa0dea1e0867b4cf6c4ca099d8c0281d400b24c
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/appl/app.hrc | 1 | ||||
-rw-r--r-- | sfx2/source/appl/app.src | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 131 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.hrc | 42 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.src | 125 | ||||
-rw-r--r-- | sfx2/source/inc/helpid.hrc | 1 |
6 files changed, 61 insertions, 243 deletions
diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc index cfe9ae164829..2d2cf6272429 100644 --- a/sfx2/source/appl/app.hrc +++ b/sfx2/source/appl/app.hrc @@ -144,6 +144,7 @@ #define RID_SVXSTR_END_REDLINING_WARNING (RID_SFX_APP_START + 212) #define RID_SVXSTR_INCORRECT_PASSWORD (RID_SFX_APP_START + 213) +#define RID_SVXSTR_FORWARD_ERRMSSG (RID_SFX_APP_START + 214) #define MD_DDE_LINKEDIT (RID_SFX_APP_START + 1) diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src index aa12e39d7742..be348fdab1dc 100644 --- a/sfx2/source/appl/app.src +++ b/sfx2/source/appl/app.src @@ -512,6 +512,10 @@ String RID_SVXSTR_INCORRECT_PASSWORD { Text [ en-US ] = "Incorrect password" ; }; +String RID_SVXSTR_FORWARD_ERRMSSG +{ + Text [ en-US ] = "If you select the option \"%PLACEHOLDER%\", you must enter a URL." ; +}; ModalDialog DLG_HELP_LICENSING { diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 775baff8e379..bd008f7c7786 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -63,6 +63,7 @@ #include <sfx2/sfx.hrc> #include "dinfdlg.hrc" +#include "../appl/app.hrc" #include "sfxlocal.hrc" #include <dialog.hrc> #include <vcl/help.hxx> @@ -1103,34 +1104,29 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet ) } //------------------------------------------------------------------------ -SfxInternetPage::SfxInternetPage( Window* pParent, const SfxItemSet& rItemSet ) : +SfxInternetPage::SfxInternetPage( Window* pParent, const SfxItemSet& rItemSet ) + : SfxTabPage(pParent, "InternetInfoPage", "sfx/ui/internetinfopage.ui", rItemSet) + , aForwardErrorMessg(SFX2_RESSTR(RID_SVXSTR_FORWARD_ERRMSSG)) + , pInfoItem(NULL) + , pFileDlg(NULL) + , eState(S_Init) +{ + get(m_pContainer, "InternetInfoPage"); + get(m_pRBNoAutoUpdate, "noautoupdate"); + get(m_pRBReloadUpdate, "reloadupdate"); + get(m_pRBForwardUpdate, "forwardupdate"); + get(m_pFTEvery, "everyft"); + get(m_pNFReload, "reloadnf"); + get(m_pFTReloadSeconds, "seconds1ft"); + get(m_pFTAfter, "afterft"); + get(m_pNFAfter, "afternf"); + get(m_pFTAfterSeconds, "seconds1ft"); + get(m_pFTURL, "urlft"); + get(m_pEDForwardURL, "forwarded"); + get(m_pPBBrowseURL, "browse"); + get(m_pFTFrame, "frameft"); + get(m_pCBFrame, "framecb"); - SfxTabPage( pParent, SfxResId( TP_DOCINFORELOAD ), rItemSet ), - - aRBNoAutoUpdate ( this, SfxResId( RB_NOAUTOUPDATE ) ), - - aRBReloadUpdate ( this, SfxResId( RB_RELOADUPDATE ) ), - - aRBForwardUpdate ( this, SfxResId( RB_FORWARDUPDATE ) ), - aFTEvery ( this, SfxResId( FT_EVERY ) ), - aNFReload ( this, SfxResId( ED_RELOAD ) ), - aFTReloadSeconds ( this, SfxResId( FT_RELOADSECS ) ), - aFTAfter ( this, SfxResId( FT_AFTER ) ), - aNFAfter ( this, SfxResId( ED_FORWARD ) ), - aFTAfterSeconds ( this, SfxResId( FT_FORWARDSECS ) ), - aFTURL ( this, SfxResId( FT_URL ) ), - aEDForwardURL ( this, SfxResId( ED_URL ) ), - aPBBrowseURL ( this, SfxResId( PB_BROWSEURL ) ), - aFTFrame ( this, SfxResId( FT_FRAME ) ), - aCBFrame ( this, SfxResId( CB_FRAME ) ), - - aForwardErrorMessg ( SfxResId(STR_FORWARD_ERRMSSG).toString() ), - pInfoItem ( NULL ), - pFileDlg ( NULL ), - eState ( S_Init ) - -{ - FreeResource(); pInfoItem = &( SfxDocumentInfoItem& ) rItemSet.Get( SID_DOCINFO ); TargetList aList; SfxViewFrame* pFrame = SfxViewFrame::Current(); @@ -1145,18 +1141,18 @@ SfxInternetPage::SfxInternetPage( Window* pParent, const SfxItemSet& rItemSet ) for ( size_t nPos = aList.size() ; nPos ; ) { pObj = aList[ --nPos ]; - aCBFrame.InsertEntry( *pObj ); + m_pCBFrame->InsertEntry( *pObj ); delete pObj; } } } - aRBNoAutoUpdate.SetClickHdl( LINK( this, SfxInternetPage, ClickHdlNoUpdate ) ); - aRBReloadUpdate.SetClickHdl( LINK( this, SfxInternetPage, ClickHdlReload ) ); - aRBForwardUpdate.SetClickHdl( LINK( this, SfxInternetPage, ClickHdlForward ) ); - aPBBrowseURL.SetClickHdl( LINK( this, SfxInternetPage, ClickHdlBrowseURL ) ); + m_pRBNoAutoUpdate->SetClickHdl( LINK( this, SfxInternetPage, ClickHdlNoUpdate ) ); + m_pRBReloadUpdate->SetClickHdl( LINK( this, SfxInternetPage, ClickHdlReload ) ); + m_pRBForwardUpdate->SetClickHdl( LINK( this, SfxInternetPage, ClickHdlForward ) ); + m_pPBBrowseURL->SetClickHdl( LINK( this, SfxInternetPage, ClickHdlBrowseURL ) ); - aForwardErrorMessg.SearchAndReplaceAscii( "%PLACEHOLDER%", aRBForwardUpdate.GetText() ); + aForwardErrorMessg.SearchAndReplaceAscii("%PLACEHOLDER%", m_pRBForwardUpdate->GetText()); ChangeState( S_NoUpdate ); } @@ -1215,36 +1211,36 @@ void SfxInternetPage::ChangeState( STATE eNewState ) void SfxInternetPage::EnableNoUpdate( sal_Bool bEnable ) { if ( bEnable ) - aRBNoAutoUpdate.Check(); + m_pRBNoAutoUpdate->Check(); } //------------------------------------------------------------------------ void SfxInternetPage::EnableReload( sal_Bool bEnable ) { - aFTEvery.Enable( bEnable ); - aNFReload.Enable( bEnable ); - aFTReloadSeconds.Enable( bEnable ); + m_pFTEvery->Enable( bEnable ); + m_pNFReload->Enable( bEnable ); + m_pFTReloadSeconds->Enable( bEnable ); if ( bEnable ) - aRBReloadUpdate.Check(); + m_pRBReloadUpdate->Check(); } //------------------------------------------------------------------------ void SfxInternetPage::EnableForward( sal_Bool bEnable ) { - aFTAfter.Enable( bEnable ); - aNFAfter.Enable( bEnable ); - aFTAfterSeconds.Enable( bEnable ); - aFTURL.Enable( bEnable ); - aEDForwardURL.Enable( bEnable ); - aPBBrowseURL.Enable( bEnable ); - aFTFrame.Enable( bEnable ); - aCBFrame.Enable( bEnable ); + m_pFTAfter->Enable( bEnable ); + m_pNFAfter->Enable( bEnable ); + m_pFTAfterSeconds->Enable( bEnable ); + m_pFTURL->Enable( bEnable ); + m_pEDForwardURL->Enable( bEnable ); + m_pPBBrowseURL->Enable( bEnable ); + m_pFTFrame->Enable( bEnable ); + m_pCBFrame->Enable( bEnable ); if ( bEnable ) - aRBForwardUpdate.Check(); + m_pRBForwardUpdate->Check(); } //------------------------------------------------------------------------ @@ -1281,7 +1277,7 @@ IMPL_LINK_NOARG(SfxInternetPage, ClickHdlBrowseURL) if ( !pFileDlg ) pFileDlg = new sfx2::FileDialogHelper( TemplateDescription::FILEOPEN_SIMPLE, 0 ); - pFileDlg->SetDisplayDirectory( aEDForwardURL.GetText() ); + pFileDlg->SetDisplayDirectory( m_pEDForwardURL->GetText() ); pFileDlg->StartExecuteModal( LINK( this, SfxInternetPage, DialogClosedHdl ) ); return 0; @@ -1294,7 +1290,7 @@ IMPL_LINK_NOARG(SfxInternetPage, DialogClosedHdl) DBG_ASSERT( pFileDlg, "SfxInternetPage::DialogClosedHdl(): no file dialog" ); if ( ERRCODE_NONE == pFileDlg->GetError() ) - aEDForwardURL.SetText( pFileDlg->GetPath() ); + m_pEDForwardURL->SetText( pFileDlg->GetPath() ); return 0; } @@ -1341,17 +1337,17 @@ sal_Bool SfxInternetPage::FillItemSet( SfxItemSet& rSet ) aURL = ::std::auto_ptr< String >( new String() ); aFrame = ::std::auto_ptr< String >( new String() ); SAL_WNODEPRECATED_DECLARATIONS_POP - nDelay = static_cast<sal_uIntPtr>(aNFReload.GetValue()); + nDelay = static_cast<sal_uIntPtr>(m_pNFReload->GetValue()); break; case S_Forward: - DBG_ASSERT( aEDForwardURL.GetText().Len(), "+SfxInternetPage::FillItemSet(): empty URL should be not possible for forward option!" ); + DBG_ASSERT( m_pEDForwardURL->GetText().Len(), "+SfxInternetPage::FillItemSet(): empty URL should be not possible for forward option!" ); bEnableReload = sal_True; SAL_WNODEPRECATED_DECLARATIONS_PUSH - aURL = ::std::auto_ptr< String >( new String( URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), aEDForwardURL.GetText(), URIHelper::GetMaybeFileHdl(), true ) ) ); - aFrame = ::std::auto_ptr< String >( new String( aCBFrame.GetText() ) ); + aURL = ::std::auto_ptr< String >( new String( URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), m_pEDForwardURL->GetText(), URIHelper::GetMaybeFileHdl(), true ) ) ); + aFrame = ::std::auto_ptr< String >( new String( m_pCBFrame->GetText() ) ); SAL_WNODEPRECATED_DECLARATIONS_POP - nDelay = static_cast<sal_uIntPtr>(aNFAfter.GetValue()); + nDelay = static_cast<sal_uIntPtr>(m_pNFAfter->GetValue()); break; default: break; @@ -1395,14 +1391,14 @@ void SfxInternetPage::Reset( const SfxItemSet& rSet ) if( rURL.Len() ) { - aNFAfter.SetValue( pInfoItem->getAutoloadDelay() ); - aEDForwardURL.SetText( rURL ); - aCBFrame.SetText( pInfoItem->getDefaultTarget() ); + m_pNFAfter->SetValue( pInfoItem->getAutoloadDelay() ); + m_pEDForwardURL->SetText( rURL ); + m_pCBFrame->SetText( pInfoItem->getDefaultTarget() ); eNewState = S_Forward; } else { - aNFReload.SetValue( pInfoItem->getAutoloadDelay() ); + m_pNFReload->SetValue( pInfoItem->getAutoloadDelay() ); eNewState = S_Reload; } } @@ -1411,22 +1407,7 @@ void SfxInternetPage::Reset( const SfxItemSet& rSet ) SFX_ITEMSET_ARG( &rSet, pROItem, SfxBoolItem, SID_DOC_READONLY, sal_False ); if ( pROItem && pROItem->GetValue() ) - { - aRBNoAutoUpdate.Disable(); - aRBReloadUpdate.Disable(); - aRBForwardUpdate.Disable(); - aNFReload.Disable(); - aNFAfter.Disable(); - aEDForwardURL.Disable(); - aPBBrowseURL.Disable(); - aCBFrame.Disable(); - aFTEvery.Disable(); - aFTReloadSeconds.Disable(); - aFTAfter.Disable(); - aFTAfterSeconds.Disable(); - aFTURL.Disable(); - aFTFrame.Disable(); - } + m_pContainer->Disable(); } //------------------------------------------------------------------------ @@ -1434,7 +1415,7 @@ int SfxInternetPage::DeactivatePage( SfxItemSet* /*pSet*/ ) { int nRet = LEAVE_PAGE; - if ( eState == S_Forward && !aEDForwardURL.GetText().Len() ) + if ( eState == S_Forward && !m_pEDForwardURL->GetText().Len() ) { ErrorBox aErrBox( this, WB_OK, aForwardErrorMessg ); aErrBox.Execute(); diff --git a/sfx2/source/dialog/dinfdlg.hrc b/sfx2/source/dialog/dinfdlg.hrc index 4d596a7af291..94b753c0829c 100644 --- a/sfx2/source/dialog/dinfdlg.hrc +++ b/sfx2/source/dialog/dinfdlg.hrc @@ -30,32 +30,6 @@ #define CUSTOM_TYPE_DURATION 5 #define CUSTOM_TYPE_DATETIME 6 -// 4 TP_DOCINFORELOAD -#define PAGE_WIDTH 260 -#define WIDTH_CTRL_SPACE 3 -#define WIDTH_0 10 -#define WIDTH_1 48 -#define WIDTH_2 28 -#define WIDTH_FT1 (WIDTH_1 - WIDTH_CTRL_SPACE) -#define COL_0 6 -#define COL_1 (COL_0+WIDTH_0) -#define COL_2 (COL_1+WIDTH_1) -#define COL_3 (COL_2+WIDTH_2) -#define COL_4 (COL_3+WIDTH_CTRL_SPACE) -#define COL_7 (PAGE_WIDTH-2*WIDTH_0) -#define COL_6 (COL_7-WIDTH_0) -#define COL_5 (COL_6-WIDTH_CTRL_SPACE) -#define COL_LAST COL_7 - -#define ROWDIFF_FT_EDTFLD ((RSC_CD_TEXTBOX_HEIGHT-RSC_CD_FIXEDTEXT_HEIGHT)/2) -#define ROW_0 6 -#define ROW_1 (ROW_0+16) -#define ROW_2 (ROW_1+13) -#define ROW_3 (ROW_2+16) -#define ROW_4 (ROW_3+13) -#define ROW_5 (ROW_4+16) -#define ROW_6 (ROW_5+16) - // defines --------------------------------------------------------------- #define FT_INFO1 15 @@ -67,22 +41,6 @@ #define FT_INFO4 21 #define ED_INFO4 22 #define BTN_EDITLABEL 34 -#define FT_URL 43 -#define ED_URL 44 - -#define RB_NOAUTOUPDATE 63 -#define RB_RELOADUPDATE 64 -#define RB_FORWARDUPDATE 65 -#define FT_EVERY 66 -#define ED_RELOAD 67 -#define FT_RELOADSECS 68 -#define FT_AFTER 69 -#define ED_FORWARD 70 -#define FT_FORWARDSECS 71 -#define FT_FRAME 72 -#define CB_FRAME 73 -#define PB_BROWSEURL 74 -#define STR_FORWARD_ERRMSSG 75 #define WIN_PROPERTIES 90 #define SB_VERTICAL 91 diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src index e0630afd7660..3835a3deafa1 100644 --- a/sfx2/source/dialog/dinfdlg.src +++ b/sfx2/source/dialog/dinfdlg.src @@ -101,131 +101,6 @@ TabPage TP_DOCINFOUSER }; }; - // TP_DOCINFOUSER -------------------------------------------------------- - -TabPage TP_DOCINFORELOAD -{ - HelpId = HID_DOCINFORELOAD ; - Hide = TRUE ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - RadioButton RB_NOAUTOUPDATE - { - HelpID = "sfx2:RadioButton:TP_DOCINFORELOAD:RB_NOAUTOUPDATE"; - TabStop = TRUE ; - Pos = MAP_APPFONT( COL_0 , ROW_0 ) ; - Size = MAP_APPFONT( COL_7 - COL_1 , RSC_CD_RADIOBUTTON_HEIGHT ) ; - Text [ en-US ] = "Do not refresh automatically" ; - }; - - RadioButton RB_RELOADUPDATE - { - HelpID = "sfx2:RadioButton:TP_DOCINFORELOAD:RB_RELOADUPDATE"; - TabStop = TRUE ; - Pos = MAP_APPFONT( COL_0, ROW_1 ) ; - Size = MAP_APPFONT( COL_7 - COL_1, RSC_CD_RADIOBUTTON_HEIGHT ) ; - Text [ en-US ] = "Refresh this document" ; - }; - FixedText FT_EVERY - { - Pos = MAP_APPFONT ( COL_1 , ROW_2 ) ; - Size = MAP_APPFONT ( WIDTH_FT1 , RSC_CD_RADIOBUTTON_HEIGHT ) ; - Text [ en-US ] = "every" ; - }; - NumericField ED_RELOAD - { - HelpID = "sfx2:NumericField:TP_DOCINFORELOAD:ED_RELOAD"; - Border = TRUE ; - Pos = MAP_APPFONT ( COL_2 , ROW_2 - ROWDIFF_FT_EDTFLD ) ; - Size = MAP_APPFONT ( WIDTH_2 , RSC_CD_TEXTBOX_HEIGHT ) ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - First = 1 ; - Last = 60 ; - SpinSize = 1 ; - Value = 60 ; - }; - FixedText FT_RELOADSECS - { - Pos = MAP_APPFONT ( COL_4 , ROW_2 ) ; - Size = MAP_APPFONT ( COL_7 - COL_4 , RSC_CD_FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "seconds" ; - }; - - RadioButton RB_FORWARDUPDATE - { - HelpID = "sfx2:RadioButton:TP_DOCINFORELOAD:RB_FORWARDUPDATE"; - TabStop = TRUE ; - Pos = MAP_APPFONT( COL_0, ROW_3 ) ; - Size = MAP_APPFONT( COL_7 - COL_1, RSC_CD_RADIOBUTTON_HEIGHT ) ; - Text [ en-US ] = "Redirect from this document" ; - }; - FixedText FT_AFTER - { - Pos = MAP_APPFONT ( COL_1 , ROW_4 ) ; - Size = MAP_APPFONT ( WIDTH_FT1 , RSC_CD_FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "after" ; - }; - NumericField ED_FORWARD - { - HelpID = "sfx2:NumericField:TP_DOCINFORELOAD:ED_FORWARD"; - Border = TRUE ; - Pos = MAP_APPFONT ( COL_2 , ROW_4 - ROWDIFF_FT_EDTFLD ) ; - Size = MAP_APPFONT ( WIDTH_2 , RSC_CD_TEXTBOX_HEIGHT ) ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - First = 1 ; - Last = 60 ; - SpinSize = 1 ; - Value = 5 ; - }; - FixedText FT_FORWARDSECS - { - Pos = MAP_APPFONT ( COL_4 , ROW_4 ) ; - Size = MAP_APPFONT ( COL_7 - COL_4 , RSC_CD_FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "seconds" ; - }; - FixedText FT_URL - { - Pos = MAP_APPFONT ( COL_1 , ROW_5 ) ; - Size = MAP_APPFONT ( WIDTH_FT1 , RSC_CD_FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "to URL" ; - }; - Edit ED_URL - { - HelpID = "sfx2:Edit:TP_DOCINFORELOAD:ED_URL"; - Border = TRUE ; - Pos = MAP_APPFONT ( COL_2 , ROW_5 - ROWDIFF_FT_EDTFLD ) ; - Size = MAP_APPFONT ( COL_5 - COL_2 , RSC_CD_TEXTBOX_HEIGHT ) ; - }; - PushButton PB_BROWSEURL - { - HelpID = "sfx2:PushButton:TP_DOCINFORELOAD:PB_BROWSEURL"; - Pos = MAP_APPFONT ( COL_6 , ROW_5 - ROWDIFF_FT_EDTFLD ) ; - Size = MAP_APPFONT ( COL_7 - COL_6 , RSC_CD_PUSHBUTTON_HEIGHT ) ; - Text = "..." ; - }; - FixedText FT_FRAME - { - Pos = MAP_APPFONT ( COL_1 , ROW_6 ) ; - Size = MAP_APPFONT ( WIDTH_FT1 , RSC_CD_FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "to frame" ; - }; - ComboBox CB_FRAME - { - HelpID = "sfx2:ComboBox:TP_DOCINFORELOAD:CB_FRAME"; - Pos = MAP_APPFONT ( COL_2 , ROW_6 - ROWDIFF_FT_EDTFLD ) ; - Size = MAP_APPFONT ( COL_7 - COL_2 , RSC_CD_DROPDOWN_HEIGHT * 10 ) ; - DropDown = TRUE ; - }; - String STR_FORWARD_ERRMSSG - { - Text [ en-US ] = "If you select the option \"%PLACEHOLDER%\", you must enter a URL." ; - }; - -}; - // TP_CUSTOMPROPERTIES --------------------------------------------------- TabPage TP_CUSTOMPROPERTIES diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc index dc9893a89858..e1dc196e54e9 100644 --- a/sfx2/source/inc/helpid.hrc +++ b/sfx2/source/inc/helpid.hrc @@ -27,7 +27,6 @@ #define HID_MANAGE_STYLES "SFX2_HID_MANAGE_STYLES" #define HID_CONFIG_EVENT "SFX2_HID_CONFIG_EVENT" #define HID_DOCINFOUSER "SFX2_HID_DOCINFOUSER" -#define HID_DOCINFORELOAD "SFX2_HID_DOCINFORELOAD" #define HID_BROWSERCONTROL "SFX2_HID_BROWSERCONTROL" #define HID_PRINT_OPTIONS "SFX2_HID_PRINT_OPTIONS" #define HID_PREVIEW_FRAME "SFX2_HID_PREVIEW_FRAME" |