Kaydet (Commit) a4660b78 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert rename object dialog to .ui format

Change-Id: I76b5c2d190b268de93973083f1f6ca41804008cf
üst d3dc2c83
......@@ -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 \
......
......@@ -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)
......
......@@ -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"
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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,
......
......@@ -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);
......
......@@ -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))
);
......
......@@ -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
......
<?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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment