diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-26 14:07:48 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-26 14:50:31 +0100 |
commit | a4660b78efba2de2e0d4ce85f955a751038e416e (patch) | |
tree | 3cdba98e7ae111c3bf1718f6813c6c1af692e744 | |
parent | d3dc2c83da986b33c0d4d62a14822e9a7eafbc52 (diff) |
convert rename object dialog to .ui format
Change-Id: I76b5c2d190b268de93973083f1f6ca41804008cf
-rw-r--r-- | sw/UIConfig_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/globals.hrc | 2 | ||||
-rw-r--r-- | sw/inc/helpid.h | 1 | ||||
-rw-r--r-- | sw/inc/swabstdlg.hxx | 6 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 21 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 6 | ||||
-rw-r--r-- | sw/source/ui/inc/swrenamexnameddlg.hxx | 16 | ||||
-rw-r--r-- | sw/source/ui/utlui/content.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/utlui/swrenamexnameddlg.cxx | 36 | ||||
-rw-r--r-- | sw/source/ui/utlui/unotools.src | 51 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/renameobjectdialog.ui | 153 |
11 files changed, 191 insertions, 104 deletions
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index 1e58060782cb..775a88c3810e 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -96,6 +96,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/previewzoomdialog \ sw/uiconfig/swriter/ui/printoptionspage \ sw/uiconfig/swriter/ui/printeroptions \ + sw/uiconfig/swriter/ui/renameobjectdialog \ sw/uiconfig/swriter/ui/rowheight \ sw/uiconfig/swriter/ui/sortdialog \ sw/uiconfig/swriter/ui/splittable \ diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc index f12de51376e8..22b5f54c19a0 100644 --- a/sw/inc/globals.hrc +++ b/sw/inc/globals.hrc @@ -190,7 +190,7 @@ #define TP_INSERT_SECTION (RC_GLOBALS_BEGIN + 85) #define DLG_INSERT_SECTION (RC_GLOBALS_BEGIN + 86) #define DLG_SECTION_PROPERTIES (RC_GLOBALS_BEGIN + 87) -#define DLG_RENAME_XNAMED (RC_GLOBALS_BEGIN + 88) + #define DLG_MULTI_TOX (RC_GLOBALS_BEGIN + 89) #define TP_TOX_SELECT (RC_GLOBALS_BEGIN + 90) #define TP_TOX_ENTRY (RC_GLOBALS_BEGIN + 91) diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index a0b69b996ddf..92784ba51dd5 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -181,7 +181,6 @@ #define HID_INSERT_SECTION_PAGE "SW_HID_INSERT_SECTION_PAGE" #define HID_INSERT_SECTION_DLG "SW_HID_INSERT_SECTION_DLG" #define HID_SECTION_PROPERTIES_DLG "SW_HID_SECTION_PROPERTIES_DLG" -#define HID_RENAME_XNAMED "SW_HID_RENAME_XNAMED" #define HID_TP_TOX_SELECT "SW_HID_TP_TOX_SELECT" #define HID_TP_TOX_ENTRY "SW_HID_TP_TOX_ENTRY" #define HID_TOX_STYLES_PAGE "SW_HID_TOX_STYLES_PAGE" diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 17ed47c08139..d8d214895c2c 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -386,9 +386,9 @@ public: virtual AbstractSwFldDlg * CreateSwFldDlg ( SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent, int nResId ) = 0; //add for SwFldDlg virtual SfxAbstractDialog* CreateSwFldEditDlg ( SwView& rVw, int nResId ) = 0; //add for SwFldEditDlg - virtual AbstractSwRenameXNamedDlg * CreateSwRenameXNamedDlg( Window* pParent, //add for SwRenameXNamedDlg - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed, - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess, int nResId ) = 0; + virtual AbstractSwRenameXNamedDlg * CreateSwRenameXNamedDlg(Window* pParent, //add for SwRenameXNamedDlg + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed, + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess) = 0; virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg(Window *pParent) = 0; virtual VclAbstractDialog* CreateTblMergeDialog( Window* pParent, sal_Bool& rWithPrev ) = 0; //add for SwMergeTblDlg diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 3a4e0c8cc5b1..6d766bff79ff 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -1003,23 +1003,12 @@ SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwFldEditDlg ( SwView& return 0; } -AbstractSwRenameXNamedDlg * SwAbstractDialogFactory_Impl::CreateSwRenameXNamedDlg( Window* pParent, - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed, - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess,int nResId ) +AbstractSwRenameXNamedDlg * SwAbstractDialogFactory_Impl::CreateSwRenameXNamedDlg(Window* pParent, + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed, + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess) { - SwRenameXNamedDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_RENAME_XNAMED : - pDlg = new SwRenameXNamedDlg( pParent,xNamed, xNameAccess); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractSwRenameXNamedDlg_Impl( pDlg ); - return 0; + SwRenameXNamedDlg* pDlg = new SwRenameXNamedDlg( pParent,xNamed, xNameAccess); + return new AbstractSwRenameXNamedDlg_Impl( pDlg ); } AbstractSwModalRedlineAcceptDlg * SwAbstractDialogFactory_Impl::CreateSwModalRedlineAcceptDlg(Window *pParent) diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 115e926a540c..da283f2e4481 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -485,9 +485,9 @@ public: const SfxItemSet* pItemSet, SwWrtShell* pSh); //add for SwTableTabDlg virtual AbstractSwFldDlg * CreateSwFldDlg ( SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent, int nResId ); //add for SwFldDlg virtual SfxAbstractDialog* CreateSwFldEditDlg ( SwView& rVw, int nResId ); //add for SwFldEditDlg - virtual AbstractSwRenameXNamedDlg * CreateSwRenameXNamedDlg( Window* pParent, //add for SwRenameXNamedDlg - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed, - ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess, int nResId ); + virtual AbstractSwRenameXNamedDlg * CreateSwRenameXNamedDlg(Window* pParent, //add for SwRenameXNamedDlg + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed, + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess); virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg(Window *pParent); //add for SwModalRedlineAcceptDlg virtual VclAbstractDialog* CreateTblMergeDialog(Window* pParent, sal_Bool& rWithPrev); //add for SwMergeTblDlg diff --git a/sw/source/ui/inc/swrenamexnameddlg.hxx b/sw/source/ui/inc/swrenamexnameddlg.hxx index a4e4a6e18554..968c89f69a14 100644 --- a/sw/source/ui/inc/swrenamexnameddlg.hxx +++ b/sw/source/ui/inc/swrenamexnameddlg.hxx @@ -33,14 +33,10 @@ class SwRenameXNamedDlg : public ModalDialog { - FixedLine aNameFL; - FixedText aNewNameFT; - NoSpaceEdit aNewNameED; - OKButton aOk; - CancelButton aCancel; - HelpButton aHelp; + NoSpaceEdit* m_pNewNameED; + OKButton* m_pOk; - String sRemoveWarning; + OUString m_sRemoveWarning; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess; @@ -55,8 +51,10 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed, ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess ); - void SetForbiddenChars( const String& rSet ) - { aNewNameED.SetForbiddenChars( rSet ); } + void SetForbiddenChars(const OUString& rSet) + { + m_pNewNameED->SetForbiddenChars(rSet); + } void SetAlternativeAccess( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xSecond, diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index dfd6aebeba78..0d995dd55694 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -2889,7 +2889,7 @@ void SwContentTree::EditEntry(SvTreeListEntry* pEntry, sal_uInt8 nMode) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - AbstractSwRenameXNamedDlg* pDlg = pFact->CreateSwRenameXNamedDlg( this, xNamed, xNameAccess, DLG_RENAME_XNAMED ); + AbstractSwRenameXNamedDlg* pDlg = pFact->CreateSwRenameXNamedDlg(this, xNamed, xNameAccess); OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(xSecond.is()) pDlg->SetAlternativeAccess( xSecond, xThird); diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx b/sw/source/ui/utlui/swrenamexnameddlg.cxx index 31979e3ddf6b..1da76d3e4094 100644 --- a/sw/source/ui/utlui/swrenamexnameddlg.cxx +++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx @@ -54,36 +54,32 @@ using namespace ::com::sun::star; SwRenameXNamedDlg::SwRenameXNamedDlg( Window* pWin, uno::Reference< container::XNamed > & xN, - uno::Reference< container::XNameAccess > & xNA ) : - ModalDialog(pWin, SW_RES(DLG_RENAME_XNAMED)), - aNameFL(this, SW_RES(FL_NAME)), - aNewNameFT(this, SW_RES(FT_NEW_NAME)), - aNewNameED(this, SW_RES(ED_NEW_NAME)), - aOk(this, SW_RES(PB_OK)), - aCancel(this, SW_RES(PB_CANCEL)), - aHelp(this, SW_RES(PB_HELP)), - xNamed(xN), - xNameAccess(xNA) + uno::Reference< container::XNameAccess > & xNA ) + : ModalDialog(pWin, "RenameObjectDialog", + "modules/swriter/ui/renameobjectdialog.ui") + , m_sRemoveWarning(SW_RESSTR(STR_REMOVE_WARNING)) + , xNamed(xN) + , xNameAccess(xNA) { - FreeResource(); - sRemoveWarning = String(SW_RES(STR_REMOVE_WARNING)); + get(m_pNewNameED, "entry"); + get(m_pOk, "ok"); String sTmp(GetText()); - aNewNameED.SetText(xNamed->getName()); - aNewNameED.SetSelection(Selection(SELECTION_MIN, SELECTION_MAX)); + m_pNewNameED->SetText(xNamed->getName()); + m_pNewNameED->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX)); sTmp += String(xNamed->getName()); SetText(sTmp); - aOk.SetClickHdl(LINK(this, SwRenameXNamedDlg, OkHdl)); - aNewNameED.SetModifyHdl(LINK(this, SwRenameXNamedDlg, ModifyHdl)); - aOk.Enable(sal_False); + m_pOk->SetClickHdl(LINK(this, SwRenameXNamedDlg, OkHdl)); + m_pNewNameED->SetModifyHdl(LINK(this, SwRenameXNamedDlg, ModifyHdl)); + m_pOk->Enable(sal_False); } IMPL_LINK_NOARG(SwRenameXNamedDlg, OkHdl) { try { - xNamed->setName(aNewNameED.GetText()); + xNamed->setName(m_pNewNameED->GetText()); } catch (const uno::RuntimeException&) { @@ -110,12 +106,12 @@ IMPL_LINK(SwRenameXNamedDlg, ModifyHdl, NoSpaceEdit*, pEdit) if(sTmp.Len() != nLen) { pEdit->SetText(sTmp); - String sWarning(sRemoveWarning); + String sWarning(m_sRemoveWarning); sWarning += sMsg; InfoBox(this, sWarning).Execute(); } - aOk.Enable(sTmp.Len() && !xNameAccess->hasByName(sTmp) + m_pOk->Enable(sTmp.Len() && !xNameAccess->hasByName(sTmp) && (!xSecondAccess.is() || !xSecondAccess->hasByName(sTmp)) && (!xThirdAccess.is() || !xThirdAccess->hasByName(sTmp)) ); diff --git a/sw/source/ui/utlui/unotools.src b/sw/source/ui/utlui/unotools.src index c7425d6fb800..7ee442ed1589 100644 --- a/sw/source/ui/utlui/unotools.src +++ b/sw/source/ui/utlui/unotools.src @@ -21,60 +21,11 @@ #include <globals.hrc> #include <helpid.h> -ModalDialog DLG_RENAME_XNAMED -{ - HelpID = HID_RENAME_XNAMED ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 220 , 60 ) ; - Moveable = TRUE ; - FixedText FT_NEW_NAME - { - Pos = MAP_APPFONT ( 12 , 15 ) ; - Size = MAP_APPFONT ( 50 , 10 ) ; - Text [ en-US ] = "New name"; - }; - Edit ED_NEW_NAME - { - HelpID = "sw:Edit:DLG_RENAME_XNAMED:ED_NEW_NAME"; - Pos = MAP_APPFONT ( 65 , 13 ) ; - Size = MAP_APPFONT ( 87 , 12 ) ; - Border = TRUE; - }; - FixedLine FL_NAME - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 152 , 8 ) ; - Text [ en-US ] = "Change name"; - }; - OKButton PB_OK - { - Pos = MAP_APPFONT ( 164 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Group = TRUE ; - DefButton = TRUE ; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( 164 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Group = TRUE ; - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 164 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Group = TRUE ; - }; - Text [ en-US ] = "Rename object: "; -}; String STR_SERVICE_UNAVAILABLE { Text [ en-US ] = "The following service is not available: "; }; + Resource RES_FRMEX_MENU { StringArray 1 diff --git a/sw/uiconfig/swriter/ui/renameobjectdialog.ui b/sw/uiconfig/swriter/ui/renameobjectdialog.ui new file mode 100644 index 000000000000..8e98a39a984b --- /dev/null +++ b/sw/uiconfig/swriter/ui/renameobjectdialog.ui @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkDialog" id="RenameObjectDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Rename object: </property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">New name</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">entry</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="swlo-NoSpaceEdit" id="entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Change name</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + <action-widget response="0">help</action-widget> + </action-widgets> + </object> +</interface> |