diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 5ed719877d6d..e45a0eca5946 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -78,6 +78,8 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/hyperlinkmailpage \ cui/uiconfig/ui/hyperlinknewdocpage \ cui/uiconfig/ui/hyphenate \ + cui/uiconfig/ui/iconchangedialog \ + cui/uiconfig/ui/iconselectordialog \ cui/uiconfig/ui/insertfloatingframe \ cui/uiconfig/ui/insertoleobject \ cui/uiconfig/ui/insertplugin \ diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index d88c0714ad28..bf0f65764413 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -4747,35 +4747,34 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow, const uno::Reference< css::ui::XImageManager >& rXImageManager, const uno::Reference< css::ui::XImageManager >& rXParentImageManager ) : - ModalDialog ( pWindow, CUI_RES( MD_ICONSELECTOR ) ), - aFtDescription ( this, CUI_RES( FT_SYMBOLS ) ), - aTbSymbol ( this, CUI_RES( TB_SYMBOLS ) ), - aFtNote ( this, CUI_RES( FT_NOTE ) ), - aBtnOK ( this, CUI_RES( BTN_OK ) ), - aBtnCancel ( this, CUI_RES( BTN_CANCEL ) ), - aBtnHelp ( this, CUI_RES( BTN_HELP ) ), - aBtnImport ( this, CUI_RES( BTN_IMPORT ) ), - aBtnDelete ( this, CUI_RES( BTN_DELETE ) ), - aFlSeparator ( this, CUI_RES( FL_SEPARATOR ) ), + ModalDialog ( pWindow, "IconSelector", "cui/ui/iconselectordialog.ui" ), m_nNextId ( 0 ), m_xImageManager ( rXImageManager ), m_xParentImageManager( rXParentImageManager ) { - FreeResource(); + get(pTbSymbol, "symbolsToolbar"); + get(pFtNote, "noteLabel"); + get(pBtnImport, "importButton"); + get(pBtnDelete, "deleteButton"); + + aTbSize = pTbSymbol->LogicToPixel(Size(160, 80), MapMode(MAP_APPFONT)); + pTbSymbol->set_width_request(aTbSize.Width()); + pTbSymbol->set_height_request(aTbSize.Height()); + pTbSymbol->SetStyle(pTbSymbol->GetStyle() | WB_SCROLL | WB_LINESPACING); typedef ::boost::unordered_map< OUString, bool, OUStringHash, ::std::equal_to< OUString > > ImageInfo; - aTbSymbol.SetPageScroll( true ); + pTbSymbol->SetPageScroll( true ); bool bLargeIcons = GetImageType() & css::ui::ImageType::SIZE_LARGE; m_nExpectedSize = bLargeIcons ? 26 : 16; if ( m_nExpectedSize != 16 ) { - aFtNote.SetText( replaceSixteen( aFtNote.GetText(), m_nExpectedSize ) ); + pFtNote->SetText( replaceSixteen( pFtNote->GetText(), m_nExpectedSize ) ); } uno::Reference< uno::XComponentContext > xComponentContext = @@ -4802,7 +4801,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow, } else { - aBtnImport.Enable( false ); + pBtnImport->Enable( false ); } aDirectory += "soffice.cfg/import"; @@ -4848,11 +4847,11 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow, if ( graphics.getLength() > 0 ) { Image img = Image( graphics[ 0 ] ); - aTbSymbol.InsertItem( nId, img, pConstIter->first ); + pTbSymbol->InsertItem( nId, img, pConstIter->first ); graphics[ 0 ]->acquire(); - aTbSymbol.SetItemData( + pTbSymbol->SetItemData( nId, static_cast< void * > ( graphics[ 0 ].get() ) ); ++nId; @@ -4902,14 +4901,14 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow, if ( graphics.getLength() > 0 ) { Image img = Image( graphics[ 0 ] ); - aTbSymbol.InsertItem( nId, img, pConstIter->first ); + pTbSymbol->InsertItem( nId, img, pConstIter->first ); uno::Reference< graphic::XGraphic > xGraphic = graphics[ 0 ]; if ( xGraphic.is() ) xGraphic->acquire(); - aTbSymbol.SetItemData( + pTbSymbol->SetItemData( nId, static_cast< void * > ( xGraphic.get() ) ); ++nId; @@ -4918,24 +4917,24 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow, ++pConstIter; } - aBtnDelete.Enable( false ); - aTbSymbol.SetSelectHdl( LINK(this, SvxIconSelectorDialog, SelectHdl) ); - aBtnImport.SetClickHdl( LINK(this, SvxIconSelectorDialog, ImportHdl) ); - aBtnDelete.SetClickHdl( LINK(this, SvxIconSelectorDialog, DeleteHdl) ); + pBtnDelete->Enable( false ); + pTbSymbol->SetSelectHdl( LINK(this, SvxIconSelectorDialog, SelectHdl) ); + pBtnImport->SetClickHdl( LINK(this, SvxIconSelectorDialog, ImportHdl) ); + pBtnDelete->SetClickHdl( LINK(this, SvxIconSelectorDialog, DeleteHdl) ); - m_nNextId = aTbSymbol.GetItemCount()+1; + m_nNextId = pTbSymbol->GetItemCount()+1; } SvxIconSelectorDialog::~SvxIconSelectorDialog() { - sal_uInt16 nCount = aTbSymbol.GetItemCount(); + sal_uInt16 nCount = pTbSymbol->GetItemCount(); for (sal_uInt16 n = 0; n < nCount; ++n ) { - sal_uInt16 nId = aTbSymbol.GetItemId(n); + sal_uInt16 nId = pTbSymbol->GetItemId(n); uno::XInterface* xi = static_cast< uno::XInterface* >( - aTbSymbol.GetItemData( nId ) ); + pTbSymbol->GetItemData( nId ) ); if ( xi != NULL ) { @@ -4949,14 +4948,14 @@ uno::Reference< graphic::XGraphic> SvxIconSelectorDialog::GetSelectedIcon() uno::Reference< graphic::XGraphic > result; sal_uInt16 nId; - for ( sal_uInt16 n = 0; n < aTbSymbol.GetItemCount(); ++n ) + for ( sal_uInt16 n = 0; n < pTbSymbol->GetItemCount(); ++n ) { - nId = aTbSymbol.GetItemId( n ); - if ( aTbSymbol.IsItemChecked( nId ) ) + nId = pTbSymbol->GetItemId( n ); + if ( pTbSymbol->IsItemChecked( nId ) ) { result = uno::Reference< graphic::XGraphic >( reinterpret_cast< graphic::XGraphic* >( - aTbSymbol.GetItemData( nId ) ) ); + pTbSymbol->GetItemData( nId ) ) ); } } @@ -4967,29 +4966,29 @@ IMPL_LINK( SvxIconSelectorDialog, SelectHdl, ToolBox *, pToolBox ) { (void)pToolBox; - sal_uInt16 nCount = aTbSymbol.GetItemCount(); + sal_uInt16 nCount = pTbSymbol->GetItemCount(); for (sal_uInt16 n = 0; n < nCount; ++n ) { - sal_uInt16 nId = aTbSymbol.GetItemId( n ); + sal_uInt16 nId = pTbSymbol->GetItemId( n ); - if ( aTbSymbol.IsItemChecked( nId ) ) + if ( pTbSymbol->IsItemChecked( nId ) ) { - aTbSymbol.CheckItem( nId, false ); + pTbSymbol->CheckItem( nId, false ); } } - sal_uInt16 nId = aTbSymbol.GetCurItemId(); - aTbSymbol.CheckItem( nId ); + sal_uInt16 nId = pTbSymbol->GetCurItemId(); + pTbSymbol->CheckItem( nId ); - OUString aSelImageText = aTbSymbol.GetItemText( nId ); + OUString aSelImageText = pTbSymbol->GetItemText( nId ); if ( m_xImportedImageManager->hasImage( GetImageType(), aSelImageText ) ) { - aBtnDelete.Enable( true ); + pBtnDelete->Enable( true ); } else { - aBtnDelete.Enable( false ); + pBtnDelete->Enable( false ); } return 0; @@ -5032,18 +5031,18 @@ IMPL_LINK( SvxIconSelectorDialog, DeleteHdl, PushButton *, pButton ) OUString message = CUI_RES( RID_SVXSTR_DELETE_ICON_CONFIRM ); if ( WarningBox( this, WinBits(WB_OK_CANCEL), message ).Execute() == RET_OK ) { - sal_uInt16 nCount = aTbSymbol.GetItemCount(); + sal_uInt16 nCount = pTbSymbol->GetItemCount(); for (sal_uInt16 n = 0; n < nCount; ++n ) { - sal_uInt16 nId = aTbSymbol.GetItemId( n ); + sal_uInt16 nId = pTbSymbol->GetItemId( n ); - if ( aTbSymbol.IsItemChecked( nId ) ) + if ( pTbSymbol->IsItemChecked( nId ) ) { - OUString aSelImageText = aTbSymbol.GetItemText( nId ); + OUString aSelImageText = pTbSymbol->GetItemText( nId ); uno::Sequence< OUString > URLs(1); URLs[0] = aSelImageText; - aTbSymbol.RemoveItem( aTbSymbol.GetItemPos( nId ) ); + pTbSymbol->RemoveItem( pTbSymbol->GetItemPos( nId ) ); m_xImportedImageManager->removeImages( GetImageType(), URLs ); uno::Reference< css::ui::XUIConfigurationPersistence > xConfigPersistence( m_xImportedImageManager, uno::UNO_QUERY ); @@ -5093,17 +5092,17 @@ bool SvxIconSelectorDialog::ReplaceGraphicItem( } bool bResult( false ); - sal_uInt16 nCount = aTbSymbol.GetItemCount(); + sal_uInt16 nCount = pTbSymbol->GetItemCount(); for (sal_uInt16 n = 0; n < nCount; ++n ) { - sal_uInt16 nId = aTbSymbol.GetItemId( n ); + sal_uInt16 nId = pTbSymbol->GetItemId( n ); - if ( OUString( aTbSymbol.GetItemText( nId ) ) == aURL ) + if ( OUString( pTbSymbol->GetItemText( nId ) ) == aURL ) { try { // replace/insert image with provided URL - aTbSymbol.RemoveItem( aTbSymbol.GetItemPos( nId ) ); + pTbSymbol->RemoveItem( pTbSymbol->GetItemPos( nId ) ); aMediaProps[0].Value <<= aURL; Image aImage( xGraphic ); @@ -5113,7 +5112,7 @@ bool SvxIconSelectorDialog::ReplaceGraphicItem( BitmapEx aBitmapex = BitmapEx::AutoScaleBitmap(aBitmap, m_nExpectedSize); aImage = Image( aBitmapex); } - aTbSymbol.InsertItem( nId,aImage, aURL, 0, 0 ); //modify + pTbSymbol->InsertItem( nId,aImage, aURL, 0, 0 ); //modify xGraphic = aImage.GetXGraphic(); @@ -5277,12 +5276,12 @@ bool SvxIconSelectorDialog::ImportGraphic( const OUString& aURL ) } if ( bOK && !!aImage ) { - aTbSymbol.InsertItem( nId, aImage, aURL, 0, 0 ); + pTbSymbol->InsertItem( nId, aImage, aURL, 0, 0 ); xGraphic = aImage.GetXGraphic(); xGraphic->acquire(); - aTbSymbol.SetItemData( + pTbSymbol->SetItemData( nId, static_cast< void * > ( xGraphic.get() ) ); uno::Sequence< OUString > aImportURL( 1 ); aImportURL[ 0 ] = aURL; @@ -5371,18 +5370,18 @@ sal_uInt16 SvxIconReplacementDialog :: ShowDialog() *******************************************************************************/ SvxIconChangeDialog::SvxIconChangeDialog( Window *pWindow, const OUString& aMessage) - : - ModalDialog ( pWindow, CUI_RES( MD_ICONCHANGE ) ), - aFImageInfo (this, CUI_RES( FI_INFO ) ), - aBtnOK (this, CUI_RES(MD_BTN_OK)), - aDescriptionLabel (this, CUI_RES(FTCHGE_DESCRIPTION)), - aLineEditDescription (this, CUI_RES(EDT_ADDR)) + :ModalDialog(pWindow, "IconChange", "cui/ui/iconchangedialog.ui") { - FreeResource(); - aFImageInfo.SetImage(InfoBox::GetStandardImage()); - aLineEditDescription.SetControlBackground( GetSettings().GetStyleSettings().GetDialogColor() ); - aLineEditDescription.EnableCursor( false ); - aLineEditDescription.SetText(aMessage); + get(pFImageInfo, "infoImage"); + get(pLineEditDescription, "addrTextview"); + + Size aSize(LogicToPixel(Size(140, 83), MapMode(MAP_APPFONT))); + pLineEditDescription->set_width_request(aSize.Width()); + pLineEditDescription->set_height_request(aSize.Height()); + + pFImageInfo->SetImage(InfoBox::GetStandardImage()); + pLineEditDescription->SetControlBackground( GetSettings().GetStyleSettings().GetDialogColor() ); + pLineEditDescription->SetText(aMessage); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/customize/cfg.hrc b/cui/source/customize/cfg.hrc index f4867cb0ecea..f09ba6ab3608 100644 --- a/cui/source/customize/cfg.hrc +++ b/cui/source/customize/cfg.hrc @@ -43,23 +43,4 @@ #define QBX_CONFIRM_RESTORE_DEFAULT (66 + CFG_OFFSET) #define QBX_CONFIRM_DELETE_TOOLBAR (67 + CFG_OFFSET) -#define MD_ICONSELECTOR (90 + CFG_OFFSET) -#define FT_SYMBOLS (91 + CFG_OFFSET) -#define TB_SYMBOLS (92 + CFG_OFFSET) -#define FT_NOTE (93 + CFG_OFFSET) -#define BTN_IMPORT (97 + CFG_OFFSET) -#define IMAGE_BTN_COLOR (98 + CFG_OFFSET) - -#define BTN_OK (103 + CFG_OFFSET) -#define BTN_CANCEL (104 + CFG_OFFSET) -#define BTN_HELP (105 + CFG_OFFSET) - -#define FL_SEPARATOR (108 + CFG_OFFSET) -#define BTN_DELETE (109 + CFG_OFFSET) -#define MD_ICONCHANGE (119 + CFG_OFFSET) -#define FTCHGE_DESCRIPTION (120 + CFG_OFFSET) -#define EDT_ADDR (121 + CFG_OFFSET) -#define MD_BTN_OK (122 + CFG_OFFSET) -#define FI_INFO (123 + CFG_OFFSET) - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/customize/cfg.src b/cui/source/customize/cfg.src index b85a24d720e0..29cf68c78170 100644 --- a/cui/source/customize/cfg.src +++ b/cui/source/customize/cfg.src @@ -161,127 +161,6 @@ String RID_SVXSTR_MENU_ADDCOMMANDS_DESCRIPTION #define IMAGE_STDBTN_COLOR Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; } #endif -ModalDialog MD_ICONSELECTOR -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 240 , 152 ) ; - Text [ en-US ] = "Change Icon" ; - Moveable = TRUE ; - HelpId = HID_SVX_CONFIG_ICON_SELECTOR; - FixedText FT_SYMBOLS - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 172 , 8 ) ; - Text [ en-US ] = "Icons" ; - }; - ToolBox TB_SYMBOLS - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 160 , 80 ) ; - Scroll = TRUE ; - LineSpacing = TRUE ; - Customize = FALSE ; - }; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 60 , 130 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 120 , 130 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 180 , 130 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - PushButton BTN_IMPORT - { - HelpID = "cui:PushButton:MD_ICONSELECTOR:BTN_IMPORT"; - Pos = MAP_APPFONT ( 184 , 7 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text[ en-US ] = "Import..."; - }; - PushButton BTN_DELETE - { - HelpID = "cui:PushButton:MD_ICONSELECTOR:BTN_DELETE"; - Pos = MAP_APPFONT ( 184 , 24 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text[ en-US ] = "Delete..."; - }; - FixedText FT_NOTE - { - Pos = MAP_APPFONT ( 12 , 95 ) ; - Size = MAP_APPFONT ( 200 , 24 ) ; - Text [ en-US ] = "Note:\nThe size of an icon should be 16x16 pixel to achieve best quality. Different sized icons will be scaled automatically." ; - Left = TRUE ; - WordBreak = TRUE; - }; - FixedLine FL_SEPARATOR - { - Pos = MAP_APPFONT ( 0, 120 ); - Size = MAP_APPFONT ( 240, 8 ); - }; - Color IMAGE_BTN_COLOR - { - Red = 0xC000 ; - Green = 0xC000 ; - Blue = 0xC000 ; - }; -}; -//added for issue83555 -ModalDialog MD_ICONCHANGE -{ - HelpID = "cui:ModalDialog:MD_ICONCHANGE"; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 200 , 150 ) ; - Text [ en-US ] = "%PRODUCTNAME %PRODUCTVERSION" ; - Moveable = TRUE ; - FixedImage FI_INFO - { - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 24 , 24 ) ; - Fixed = Image - { - - }; - }; - FixedText FTCHGE_DESCRIPTION - { - Pos = MAP_APPFONT ( 30 ,15 ) ; - Size = MAP_APPFONT ( 200 , 50 ) ; - Text [ en-US ] = "The files listed below could not be imported.\nThe file format could not be interpreted." ; - }; - - MultiLineEdit EDT_ADDR - { - HelpID = "cui:MultiLineEdit:MD_ICONCHANGE:EDT_ADDR"; - Pos = MAP_APPFONT ( 30 , 38) ; - Size = MAP_APPFONT ( 140 , 83 ) ; - Border = TRUE; - IgnoreTab = TRUE; - ReadOnly = TRUE; - }; - OKButton MD_BTN_OK - { - Pos = MAP_APPFONT ( 68 , 131 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - -}; - // Strings --------------------------------------------------------------- String RID_SVXSTR_IMPORT_ICON_ERROR { diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx index 529b4ea9ce72..6d786a227c35 100644 --- a/cui/source/inc/cfg.hxx +++ b/cui/source/inc/cfg.hxx @@ -692,18 +692,21 @@ public: } }; +struct SvxIconSelectorToolBoxItem +{ + Image aImg; + OUString aText; + void* pData; +}; + class SvxIconSelectorDialog : public ModalDialog { private: - FixedText aFtDescription; - ToolBox aTbSymbol; - FixedText aFtNote; - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - PushButton aBtnImport; - PushButton aBtnDelete; - FixedLine aFlSeparator; + ToolBox* pTbSymbol; + FixedText* pFtNote; + PushButton* pBtnImport; + PushButton* pBtnDelete; + Size aTbSize; sal_uInt16 m_nNextId; sal_Int32 m_nExpectedSize; @@ -766,10 +769,8 @@ public: class SvxIconChangeDialog : public ModalDialog { private: - FixedImage aFImageInfo; - OKButton aBtnOK; - FixedText aDescriptionLabel; - VclMultiLineEdit aLineEditDescription; + FixedImage* pFImageInfo; + VclMultiLineEdit* pLineEditDescription; public: SvxIconChangeDialog(Window *pWindow, const OUString& aMessage); }; diff --git a/cui/uiconfig/ui/iconchangedialog.ui b/cui/uiconfig/ui/iconchangedialog.ui new file mode 100644 index 000000000000..fda7f69a9dba --- /dev/null +++ b/cui/uiconfig/ui/iconchangedialog.ui @@ -0,0 +1,119 @@ + + + + + + False + True + True + 12 + %PRODUCTNAME %PRODUCTVERSION + dialog + + + False + True + True + vertical + 12 + + + False + center + + + gtk-ok + False + True + True + True + True + True + True + + + False + True + 0 + + + + + False + True + end + 0 + + + + + True + False + True + True + 6 + 6 + + + True + False + gtk-missing-image + + + 0 + 0 + 1 + 1 + + + + + True + False + start + 0 + 0 + The files listed below could not be imported. +The file format could not be interpreted. + + + 1 + 0 + 1 + 1 + + + + + True + True + True + True + False + word + False + + + 1 + 1 + 1 + 1 + + + + + + + + False + True + 1 + + + + + + ok + + + diff --git a/cui/uiconfig/ui/iconselectordialog.ui b/cui/uiconfig/ui/iconselectordialog.ui new file mode 100644 index 000000000000..a6d149f50a87 --- /dev/null +++ b/cui/uiconfig/ui/iconselectordialog.ui @@ -0,0 +1,221 @@ + + + + + + False + True + True + 6 + Change Icon + dialog + + + False + True + True + vertical + 12 + + + False + end + + + gtk-ok + False + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + False + True + True + True + True + + + False + True + 1 + + + + + gtk-help + False + True + True + True + True + 0.47999998927116394 + + + False + True + 2 + + + + + False + True + end + 0 + + + + + True + False + True + True + vertical + + + True + False + True + True + 12 + + + True + False + True + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + True + True + + + + + + + True + False + _Icons + True + + + + + + + + False + True + 0 + + + + + True + False + vertical + 6 + start + + + I_mport... + False + True + True + True + True + + + False + True + 0 + + + + + _Delete... + False + True + True + True + True + + + False + True + 1 + + + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + start + 0 + 0 + Note: +The size of an icon should be 16x16 pixel to achieve best quality. +Different sized icons will be scaled automatically. + True + + + False + True + 1 + + + + + False + True + 1 + + + + + + ok + cancel + help + + +