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

convert insert section dialog to .ui

Change-Id: I85b0c4cd50b287e4965314fdaec50c760532e2f8
üst 29fb37b5
......@@ -98,6 +98,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/insertbreak \
sw/uiconfig/swriter/ui/insertcaption \
sw/uiconfig/swriter/ui/insertfootnote \
sw/uiconfig/swriter/ui/insertsectiondialog \
sw/uiconfig/swriter/ui/insertscript \
sw/uiconfig/swriter/ui/inserttable \
sw/uiconfig/swriter/ui/linenumbering \
......
......@@ -190,8 +190,6 @@
#define TP_OPTCAPTION_PAGE (RC_GLOBALS_BEGIN + 78)
#define DLG_SVXTEST_NUM_BULLET (RC_GLOBALS_BEGIN + 79)
#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_MULTI_TOX (RC_GLOBALS_BEGIN + 89)
......
......@@ -167,7 +167,6 @@
#define HID_EDIT_FLD_REF "SW_HID_EDIT_FLD_REF"
#define HID_REDLINE_CTRL "SW_HID_REDLINE_CTRL"
#define HID_OPTCAPTION_PAGE "SW_HID_OPTCAPTION_PAGE"
#define HID_INSERT_SECTION_DLG "SW_HID_INSERT_SECTION_DLG"
#define HID_SECTION_PROPERTIES_DLG "SW_HID_SECTION_PROPERTIES_DLG"
#define HID_TP_TOX_SELECT "SW_HID_TP_TOX_SELECT"
#define HID_TP_TOX_ENTRY "SW_HID_TP_TOX_ENTRY"
......
......@@ -443,8 +443,8 @@ public:
SwTOXBase* pCurTOX, sal_uInt16 nToxType = USHRT_MAX,
sal_Bool bGlobal = sal_False) = 0; //add for SwMultiTOXTabDialog
virtual AbstractEditRegionDlg* CreateEditRegionDlg(Window* pParent, SwWrtShell& rWrtSh) = 0; //add for SwEditRegionDlg
virtual AbstractInsertSectionTabDialog* CreateInsertSectionTabDialog( int nResId,
Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh ) = 0; //add for SwInsertSectionTabDialog
virtual AbstractInsertSectionTabDialog* CreateInsertSectionTabDialog(
Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) = 0; //add for SwInsertSectionTabDialog
virtual AbstractMarkFloatDlg* CreateIndexMarkFloatDlg(
SfxBindings* pBindings,
SfxChildWindow* pChild,
......
......@@ -82,8 +82,8 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog( DLG_INSERT_SECTION,
&GetView().GetViewFrame()->GetWindow(), aSet , rSh);
AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog(
&GetView().GetViewFrame()->GetWindow(), aSet , rSh);
OSL_ENSURE(aTabDlg, "Dialogdiet fail!");
aTabDlg->Execute();
rReq.Ignore();
......@@ -195,8 +195,8 @@ IMPL_STATIC_LINK( SwWrtShell, InsertRegionDialog, SwSectionData*, pSect )
aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog( DLG_INSERT_SECTION,
&pThis->GetView().GetViewFrame()->GetWindow(),aSet , *pThis);
AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog(
&pThis->GetView().GetViewFrame()->GetWindow(),aSet , *pThis);
OSL_ENSURE(aTabDlg, "Dialogdiet fail!");
aTabDlg->SetSectionData(*xSectionData);
aTabDlg->Execute();
......
......@@ -116,56 +116,6 @@ InfoBox REG_WRONG_PASSWD_REPEAT
Message [ en-US ] = "The password has not been set." ;
};
TabDialog DLG_INSERT_SECTION
{
HelpId = HID_INSERT_SECTION_DLG;
Text [ en-US ] = "Insert Section" ;
OutputSize = TRUE ;
SVLook = TRUE ;
Moveable = TRUE ;
TabControl 1
{
OutputSize = TRUE ;
PageList =
{
PageItem
{
Identifier = TP_INSERT_SECTION;
PageResID = TP_INSERT_SECTION;
Text [ en-US ] = "Section";
};
PageItem
{
Identifier = TP_COLUMN ;
PageResID = TP_COLUMN ;
Text [ en-US ] = "Columns" ;
};
PageItem
{
Identifier = TP_SECTION_INDENTS;
PageResID = TP_SECTION_INDENTS;
Text [ en-US ] = "Indents" ;
};
PageItem
{
Identifier = TP_BACKGROUND ;
PageResID = TP_BACKGROUND ;
Text [ en-US ] = "Background" ;
};
PageItem
{
Identifier = TP_SECTION_FTNENDNOTES ;
PageResID = TP_SECTION_FTNENDNOTES ;
Text [ en-US ] = "Footnotes/Endnotes";
};
};
};
String ST_INSERT
{
Text [ en-US ] = "Insert" ;
};
};
TabDialog DLG_SECTION_PROPERTIES
{
HelpId = HID_SECTION_PROPERTIES_DLG;
......
......@@ -1155,21 +1155,11 @@ AbstractEditRegionDlg * SwAbstractDialogFactory_Impl::CreateEditRegionDlg(Window
return new AbstractEditRegionDlg_Impl( pDlg );
}
AbstractInsertSectionTabDialog * SwAbstractDialogFactory_Impl::CreateInsertSectionTabDialog( int nResId,
AbstractInsertSectionTabDialog * SwAbstractDialogFactory_Impl::CreateInsertSectionTabDialog(
Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) //add for SwInsertSectionTabDialog
{
SwInsertSectionTabDialog* pDlg=NULL;
switch ( nResId )
{
case DLG_INSERT_SECTION :
pDlg = new SwInsertSectionTabDialog( pParent, rSet, rSh );
break;
default:
break;
}
if ( pDlg )
return new AbstractInsertSectionTabDialog_Impl( pDlg );
return 0;
SwInsertSectionTabDialog* pDlg = new SwInsertSectionTabDialog(pParent, rSet, rSh);
return new AbstractInsertSectionTabDialog_Impl(pDlg);
}
AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateIndexMarkFloatDlg(
......
......@@ -539,8 +539,8 @@ public:
SwTOXBase* pCurTOX, sal_uInt16 nToxType = USHRT_MAX,
sal_Bool bGlobal = sal_False); //add for SwMultiTOXTabDialog
virtual AbstractEditRegionDlg* CreateEditRegionDlg(Window* pParent, SwWrtShell& rWrtSh); //add for SwEditRegionDlg
virtual AbstractInsertSectionTabDialog* CreateInsertSectionTabDialog( int nResId,
Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh); //add for SwInsertSectionTabDialog
virtual AbstractInsertSectionTabDialog* CreateInsertSectionTabDialog(
Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh); //add for SwInsertSectionTabDialog
virtual AbstractMarkFloatDlg* CreateIndexMarkFloatDlg(
SfxBindings* pBindings,
SfxChildWindow* pChild,
......
......@@ -1434,21 +1434,19 @@ static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox )
}
SwInsertSectionTabDialog::SwInsertSectionTabDialog(
Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) :
SfxTabDialog( pParent, SW_RES(DLG_INSERT_SECTION), &rSet ),
rWrtSh(rSh)
Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh)
: SfxTabDialog(pParent, "InsertSectionDialog",
"modules/swriter/ui/insertsectiondialog.ui", &rSet)
, rWrtSh(rSh)
, m_pSectionData(0)
{
String sInsert(SW_RES(ST_INSERT));
GetOKButton().SetText(sInsert);
FreeResource();
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
AddTabPage(TP_INSERT_SECTION, SwInsertSectionTabPage::Create, 0);
AddTabPage(TP_COLUMN, SwColumnPage::Create, 0);
AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0);
AddTabPage(TP_SECTION_FTNENDNOTES, SwSectionFtnEndTabPage::Create, 0);
AddTabPage(TP_SECTION_INDENTS, SwSectionIndentTabPage::Create, 0);
m_nSectionPageId = AddTabPage("section", SwInsertSectionTabPage::Create, 0);
m_nColumnPageId = AddTabPage("columns", SwColumnPage::Create, 0);
m_nBackPageId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0);
m_nNotePageId = AddTabPage("notes", SwSectionFtnEndTabPage::Create, 0);
m_nIndentPage = AddTabPage("indents", SwSectionIndentTabPage::Create, 0);
SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
long nHtmlMode = rHtmlOpt.GetExportMode();
......@@ -1456,12 +1454,12 @@ SwInsertSectionTabDialog::SwInsertSectionTabDialog(
bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() );
if(bWeb)
{
RemoveTabPage(TP_SECTION_FTNENDNOTES);
RemoveTabPage(TP_SECTION_INDENTS);
RemoveTabPage(m_nNotePageId);
RemoveTabPage(m_nIndentPage);
if( HTML_CFG_NS40 != nHtmlMode && HTML_CFG_WRITER != nHtmlMode)
RemoveTabPage(TP_COLUMN);
RemoveTabPage(m_nColumnPageId);
}
SetCurPageId(TP_INSERT_SECTION);
SetCurPageId(m_nSectionPageId);
}
SwInsertSectionTabDialog::~SwInsertSectionTabDialog()
......@@ -1470,22 +1468,22 @@ SwInsertSectionTabDialog::~SwInsertSectionTabDialog()
void SwInsertSectionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
if(TP_INSERT_SECTION == nId)
if (nId == m_nSectionPageId)
((SwInsertSectionTabPage&)rPage).SetWrtShell(rWrtSh);
else if( TP_BACKGROUND == nId )
else if (nId == m_nBackPageId)
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_SHOW_SELECTOR));
rPage.PageCreated(aSet);
}
else if( TP_COLUMN == nId )
else if (nId == m_nColumnPageId)
{
const SwFmtFrmSize& rSize = (const SwFmtFrmSize&)GetInputSetImpl()->Get(RES_FRM_SIZE);
((SwColumnPage&)rPage).SetPageWidth(rSize.GetWidth());
((SwColumnPage&)rPage).ShowBalance(sal_True);
((SwColumnPage&)rPage).SetInSection(sal_True);
}
else if(TP_SECTION_INDENTS == nId)
else if (nId == m_nIndentPage)
((SwSectionIndentTabPage&)rPage).SetWrtShell(rWrtSh);
}
......@@ -1563,8 +1561,6 @@ SwInsertSectionTabPage::SwInsertSectionTabPage(
// edit in readonly sections
get(m_pEditInReadonlyCB, "editable");
m_pProtectCB->SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangeProtectHdl));
m_pPasswdCB->SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangePasswdHdl));
m_pPasswdPB->SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangePasswdHdl));
......
......@@ -267,6 +267,12 @@ class SwInsertSectionTabDialog : public SfxTabDialog
SwWrtShell& rWrtSh;
::std::auto_ptr<SwSectionData> m_pSectionData;
sal_uInt16 m_nSectionPageId;
sal_uInt16 m_nColumnPageId;
sal_uInt16 m_nBackPageId;
sal_uInt16 m_nNotePageId;
sal_uInt16 m_nIndentPage;
protected:
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
virtual short Ok();
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="InsertSectionDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Insert Section</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">_Insert</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_underline">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>
<child>
<object class="GtkButton" id="reset">
<property name="label">gtk-revert-to-saved</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">3</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="GtkNotebook" id="tabcontrol">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="section">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Section</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="columns">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Columns</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="indents">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Indents</property>
</object>
<packing>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="background">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Background</property>
</object>
<packing>
<property name="position">3</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="notes">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Footnotes/Endnotes</property>
</object>
<packing>
<property name="position">4</property>
<property name="tab_fill">False</property>
</packing>
</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-widget response="0">reset</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