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

split out custom info page and convert to .ui

Change-Id: I4353c839f6b081fcffd33edb2eb6722e91379cf5
üst da5390f5
......@@ -11,6 +11,7 @@ $(eval $(call gb_UI_UI,sfx))
$(eval $(call gb_UI_add_uifiles,sfx,\
sfx2/uiconfig/ui/checkin \
sfx2/uiconfig/ui/custominfopage \
sfx2/uiconfig/ui/descriptioninfopage \
sfx2/uiconfig/ui/documentinfopage \
sfx2/uiconfig/ui/internetinfopage \
......
......@@ -526,9 +526,7 @@ public:
class SfxCustomPropertiesPage : public SfxTabPage
{
private:
CustomPropertiesControl m_aPropertiesCtrl;
PushButton m_aAddBtn;
FixedText m_aPropertiesFT; // Sym2_5121----, Moved by Steve Yin
CustomPropertiesControl* m_pPropertiesCtrl;
DECL_LINK(AddHdl, void *);
......
......@@ -2228,6 +2228,12 @@ CustomPropertiesControl::CustomPropertiesControl( Window* pParent, const ResId&
m_aVertScroll.SetScrollHdl( aScrollLink );
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeCustomPropertiesControl(Window *pParent,
VclBuilder::stringmap &)
{
return new CustomPropertiesControl(pParent, SfxResId(SFX_CTRL_CUSTOM_PROPERTIES));
}
CustomPropertiesControl::~CustomPropertiesControl()
{
}
......@@ -2258,23 +2264,17 @@ void CustomPropertiesControl::AddLine( const ::rtl::OUString& sName, Any& rAny,
}
// class SfxCustomPropertiesPage -----------------------------------------
SfxCustomPropertiesPage::SfxCustomPropertiesPage( Window* pParent, const SfxItemSet& rItemSet ) :
SfxTabPage( pParent, SfxResId( TP_CUSTOMPROPERTIES ), rItemSet ),
m_aPropertiesCtrl ( this, SfxResId( CTRL_PROPERTIES ) ),
m_aAddBtn ( this, SfxResId( BTN_ADD ) ),
m_aPropertiesFT ( this, SfxResId( FT_PROPERTIES ) )
SfxCustomPropertiesPage::SfxCustomPropertiesPage( Window* pParent, const SfxItemSet& rItemSet )
: SfxTabPage(pParent, "CustomInfoPage", "sfx/ui/custominfopage.ui", rItemSet)
{
FreeResource();
m_aAddBtn.SetClickHdl( LINK( this, SfxCustomPropertiesPage, AddHdl ) );
get(m_pPropertiesCtrl, "properties");
get<PushButton>("add")->SetClickHdl(LINK(this, SfxCustomPropertiesPage, AddHdl));
}
IMPL_LINK_NOARG(SfxCustomPropertiesPage, AddHdl)
{
Any aAny;
m_aPropertiesCtrl.AddLine( ::rtl::OUString(), aAny, true );
m_pPropertiesCtrl->AddLine( ::rtl::OUString(), aAny, true );
return 0;
}
......@@ -2300,7 +2300,7 @@ sal_Bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet& rSet )
if ( pInfo )
{
pInfo->ClearCustomProperties();
Sequence< beans::PropertyValue > aPropertySeq = m_aPropertiesCtrl.GetCustomProperties();
Sequence< beans::PropertyValue > aPropertySeq = m_pPropertiesCtrl->GetCustomProperties();
sal_Int32 i = 0, nCount = aPropertySeq.getLength();
for ( ; i < nCount; ++i )
{
......@@ -2319,19 +2319,19 @@ sal_Bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet& rSet )
void SfxCustomPropertiesPage::Reset( const SfxItemSet& rItemSet )
{
m_aPropertiesCtrl.ClearAllLines();
m_pPropertiesCtrl->ClearAllLines();
const SfxDocumentInfoItem* m_pInfoItem = &(const SfxDocumentInfoItem &)rItemSet.Get(SID_DOCINFO);
std::vector< CustomProperty* > aCustomProps = m_pInfoItem->GetCustomProperties();
for ( sal_uInt32 i = 0; i < aCustomProps.size(); i++ )
{
m_aPropertiesCtrl.AddLine( aCustomProps[i]->m_sName, aCustomProps[i]->m_aValue, false );
m_pPropertiesCtrl->AddLine( aCustomProps[i]->m_sName, aCustomProps[i]->m_aValue, false );
}
}
int SfxCustomPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ )
{
int nRet = LEAVE_PAGE;
if ( !m_aPropertiesCtrl.AreAllLinesValid() )
if ( !m_pPropertiesCtrl->AreAllLinesValid() )
nRet = KEEP_PAGE;
return nRet;
}
......
......@@ -45,7 +45,6 @@
#define WIN_PROPERTIES 90
#define SB_VERTICAL 91
#define FT_PROPERTIES 92
#define CTRL_PROPERTIES 93
#define BTN_ADD 94
#define RB_PROPERTY_YES 100
#define RB_PROPERTY_NO 101
......
......@@ -101,6 +101,44 @@ TabPage TP_DOCINFOUSER
};
};
Control SFX_CTRL_CUSTOM_PROPERTIES
{
HelpId = HID_CTRL_CUSTOMPROPERTIES;
Pos = MAP_APPFONT ( 6 , 18 ) ;
Size = MAP_APPFONT ( 248 , 141 ) ;
Border = TRUE;
DialogControl = TRUE;
Window WIN_PROPERTIES
{
OutputSize = TRUE ;
Pos = MAP_APPFONT ( 0 , 10 ) ;
Size = MAP_APPFONT ( 240 , 134 ) ;
DialogControl = TRUE;
};
ScrollBar SB_VERTICAL
{
Pos = MAP_APPFONT ( 238 , 10 ) ;
Size = MAP_APPFONT ( 8 , 129 ) ;
VScroll = TRUE;
};
String STR_HEADER_NAME
{
Text [ en-US ] = "Name" ;
};
String STR_HEADER_TYPE
{
Text [ en-US ] = "Type" ;
};
String STR_HEADER_VALUE
{
Text [ en-US ] = "Value" ;
};
String STR_HEADER_ACTION
{
Text [ en-US ] = "" ;
};
};
// TP_CUSTOMPROPERTIES ---------------------------------------------------
TabPage TP_CUSTOMPROPERTIES
......@@ -115,43 +153,6 @@ TabPage TP_CUSTOMPROPERTIES
Left = TRUE ;
Text [ en-US ] = "~Properties" ;
};
Control CTRL_PROPERTIES
{
HelpId = HID_CTRL_CUSTOMPROPERTIES;
Pos = MAP_APPFONT ( 6 , 18 ) ;
Size = MAP_APPFONT ( 248 , 141 ) ;
Border = TRUE;
DialogControl = TRUE;
Window WIN_PROPERTIES
{
OutputSize = TRUE ;
Pos = MAP_APPFONT ( 0 , 10 ) ;
Size = MAP_APPFONT ( 240 , 134 ) ;
DialogControl = TRUE;
};
ScrollBar SB_VERTICAL
{
Pos = MAP_APPFONT ( 238 , 10 ) ;
Size = MAP_APPFONT ( 8 , 129 ) ;
VScroll = TRUE;
};
String STR_HEADER_NAME
{
Text [ en-US ] = "Name" ;
};
String STR_HEADER_TYPE
{
Text [ en-US ] = "Type" ;
};
String STR_HEADER_VALUE
{
Text [ en-US ] = "Value" ;
};
String STR_HEADER_ACTION
{
Text [ en-US ] = "" ;
};
};
PushButton BTN_ADD
{
HelpID = "sfx2:PushButton:TP_CUSTOMPROPERTIES:BTN_ADD";
......
......@@ -48,6 +48,7 @@
#define SFX_FLD_TIME (RID_SFX_SFXLOCAL_START + 11)
#define SFX_FLD_DURATION (RID_SFX_SFXLOCAL_START + 12)
#define SFX_ST_DURATION_FORMAT (RID_SFX_SFXLOCAL_START + 13)
#define SFX_CTRL_CUSTOM_PROPERTIES (RID_SFX_SFXLOCAL_START + 14)
// Images ----------------------------------------------------------------
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkGrid" id="grid12">
<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">12</property>
<child>
<object class="GtkLabel" id="label56">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">_Properties</property>
<property name="use_underline">True</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="GtkButton" id="add">
<property name="label">gtk-add</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">end</property>
<property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="sfxlo:CustomPropertiesControl" id="properties">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
</interface>
......@@ -40,167 +40,7 @@
</packing>
</child>
<child>
<object class="GtkGrid" id="grid12">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">18</property>
<property name="column_spacing">10</property>
<child>
<object class="GtkLabel" id="label56">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Properties</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="GtkButtonBox" id="buttonbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="homogeneous">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="add">
<property name="label">gtk-add</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</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>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid13">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid14">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">9</property>
<property name="column_spacing">10</property>
<child>
<object class="GtkLabel" id="label57">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">1</property>
<property name="margin_right">1</property>
<property name="margin_top">1</property>
<property name="margin_bottom">1</property>
<property name="label" translatable="yes">Name </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="GtkLabel" id="label58">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">1</property>
<property name="margin_right">1</property>
<property name="margin_top">1</property>
<property name="margin_bottom">1</property>
<property name="label" translatable="yes">Type </property>
<property name="use_underline">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>
<child>
<object class="GtkLabel" id="label59">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">1</property>
<property name="margin_right">1</property>
<property name="margin_top">1</property>
<property name="margin_bottom">1</property>
<property name="label" translatable="yes">Value </property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label60">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes"> </property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</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>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
<placeholder/>
</child>
<child type="tab">
<object class="GtkLabel" id="label55">
......
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