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)) ...@@ -11,6 +11,7 @@ $(eval $(call gb_UI_UI,sfx))
$(eval $(call gb_UI_add_uifiles,sfx,\ $(eval $(call gb_UI_add_uifiles,sfx,\
sfx2/uiconfig/ui/checkin \ sfx2/uiconfig/ui/checkin \
sfx2/uiconfig/ui/custominfopage \
sfx2/uiconfig/ui/descriptioninfopage \ sfx2/uiconfig/ui/descriptioninfopage \
sfx2/uiconfig/ui/documentinfopage \ sfx2/uiconfig/ui/documentinfopage \
sfx2/uiconfig/ui/internetinfopage \ sfx2/uiconfig/ui/internetinfopage \
......
...@@ -526,9 +526,7 @@ public: ...@@ -526,9 +526,7 @@ public:
class SfxCustomPropertiesPage : public SfxTabPage class SfxCustomPropertiesPage : public SfxTabPage
{ {
private: private:
CustomPropertiesControl m_aPropertiesCtrl; CustomPropertiesControl* m_pPropertiesCtrl;
PushButton m_aAddBtn;
FixedText m_aPropertiesFT; // Sym2_5121----, Moved by Steve Yin
DECL_LINK(AddHdl, void *); DECL_LINK(AddHdl, void *);
......
...@@ -2228,6 +2228,12 @@ CustomPropertiesControl::CustomPropertiesControl( Window* pParent, const ResId& ...@@ -2228,6 +2228,12 @@ CustomPropertiesControl::CustomPropertiesControl( Window* pParent, const ResId&
m_aVertScroll.SetScrollHdl( aScrollLink ); 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() CustomPropertiesControl::~CustomPropertiesControl()
{ {
} }
...@@ -2258,23 +2264,17 @@ void CustomPropertiesControl::AddLine( const ::rtl::OUString& sName, Any& rAny, ...@@ -2258,23 +2264,17 @@ void CustomPropertiesControl::AddLine( const ::rtl::OUString& sName, Any& rAny,
} }
// class SfxCustomPropertiesPage ----------------------------------------- // class SfxCustomPropertiesPage -----------------------------------------
SfxCustomPropertiesPage::SfxCustomPropertiesPage( Window* pParent, const SfxItemSet& rItemSet ) : SfxCustomPropertiesPage::SfxCustomPropertiesPage( Window* pParent, const SfxItemSet& rItemSet )
: SfxTabPage(pParent, "CustomInfoPage", "sfx/ui/custominfopage.ui", 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 ) )
{ {
FreeResource(); get(m_pPropertiesCtrl, "properties");
get<PushButton>("add")->SetClickHdl(LINK(this, SfxCustomPropertiesPage, AddHdl));
m_aAddBtn.SetClickHdl( LINK( this, SfxCustomPropertiesPage, AddHdl ) );
} }
IMPL_LINK_NOARG(SfxCustomPropertiesPage, AddHdl) IMPL_LINK_NOARG(SfxCustomPropertiesPage, AddHdl)
{ {
Any aAny; Any aAny;
m_aPropertiesCtrl.AddLine( ::rtl::OUString(), aAny, true ); m_pPropertiesCtrl->AddLine( ::rtl::OUString(), aAny, true );
return 0; return 0;
} }
...@@ -2300,7 +2300,7 @@ sal_Bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet& rSet ) ...@@ -2300,7 +2300,7 @@ sal_Bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet& rSet )
if ( pInfo ) if ( pInfo )
{ {
pInfo->ClearCustomProperties(); pInfo->ClearCustomProperties();
Sequence< beans::PropertyValue > aPropertySeq = m_aPropertiesCtrl.GetCustomProperties(); Sequence< beans::PropertyValue > aPropertySeq = m_pPropertiesCtrl->GetCustomProperties();
sal_Int32 i = 0, nCount = aPropertySeq.getLength(); sal_Int32 i = 0, nCount = aPropertySeq.getLength();
for ( ; i < nCount; ++i ) for ( ; i < nCount; ++i )
{ {
...@@ -2319,19 +2319,19 @@ sal_Bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet& rSet ) ...@@ -2319,19 +2319,19 @@ sal_Bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet& rSet )
void SfxCustomPropertiesPage::Reset( const SfxItemSet& rItemSet ) void SfxCustomPropertiesPage::Reset( const SfxItemSet& rItemSet )
{ {
m_aPropertiesCtrl.ClearAllLines(); m_pPropertiesCtrl->ClearAllLines();
const SfxDocumentInfoItem* m_pInfoItem = &(const SfxDocumentInfoItem &)rItemSet.Get(SID_DOCINFO); const SfxDocumentInfoItem* m_pInfoItem = &(const SfxDocumentInfoItem &)rItemSet.Get(SID_DOCINFO);
std::vector< CustomProperty* > aCustomProps = m_pInfoItem->GetCustomProperties(); std::vector< CustomProperty* > aCustomProps = m_pInfoItem->GetCustomProperties();
for ( sal_uInt32 i = 0; i < aCustomProps.size(); i++ ) 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 SfxCustomPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ )
{ {
int nRet = LEAVE_PAGE; int nRet = LEAVE_PAGE;
if ( !m_aPropertiesCtrl.AreAllLinesValid() ) if ( !m_pPropertiesCtrl->AreAllLinesValid() )
nRet = KEEP_PAGE; nRet = KEEP_PAGE;
return nRet; return nRet;
} }
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#define WIN_PROPERTIES 90 #define WIN_PROPERTIES 90
#define SB_VERTICAL 91 #define SB_VERTICAL 91
#define FT_PROPERTIES 92 #define FT_PROPERTIES 92
#define CTRL_PROPERTIES 93
#define BTN_ADD 94 #define BTN_ADD 94
#define RB_PROPERTY_YES 100 #define RB_PROPERTY_YES 100
#define RB_PROPERTY_NO 101 #define RB_PROPERTY_NO 101
......
...@@ -101,22 +101,8 @@ TabPage TP_DOCINFOUSER ...@@ -101,22 +101,8 @@ TabPage TP_DOCINFOUSER
}; };
}; };
// TP_CUSTOMPROPERTIES --------------------------------------------------- Control SFX_CTRL_CUSTOM_PROPERTIES
TabPage TP_CUSTOMPROPERTIES
{ {
HelpId = HID_TP_CUSTOMPROPERTIES ;
Hide = TRUE ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
FixedText FT_PROPERTIES
{
Pos = MAP_APPFONT ( 6 , 7 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
Left = TRUE ;
Text [ en-US ] = "~Properties" ;
};
Control CTRL_PROPERTIES
{
HelpId = HID_CTRL_CUSTOMPROPERTIES; HelpId = HID_CTRL_CUSTOMPROPERTIES;
Pos = MAP_APPFONT ( 6 , 18 ) ; Pos = MAP_APPFONT ( 6 , 18 ) ;
Size = MAP_APPFONT ( 248 , 141 ) ; Size = MAP_APPFONT ( 248 , 141 ) ;
...@@ -151,6 +137,21 @@ TabPage TP_CUSTOMPROPERTIES ...@@ -151,6 +137,21 @@ TabPage TP_CUSTOMPROPERTIES
{ {
Text [ en-US ] = "" ; Text [ en-US ] = "" ;
}; };
};
// TP_CUSTOMPROPERTIES ---------------------------------------------------
TabPage TP_CUSTOMPROPERTIES
{
HelpId = HID_TP_CUSTOMPROPERTIES ;
Hide = TRUE ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
FixedText FT_PROPERTIES
{
Pos = MAP_APPFONT ( 6 , 7 ) ;
Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
Left = TRUE ;
Text [ en-US ] = "~Properties" ;
}; };
PushButton BTN_ADD PushButton BTN_ADD
{ {
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#define SFX_FLD_TIME (RID_SFX_SFXLOCAL_START + 11) #define SFX_FLD_TIME (RID_SFX_SFXLOCAL_START + 11)
#define SFX_FLD_DURATION (RID_SFX_SFXLOCAL_START + 12) #define SFX_FLD_DURATION (RID_SFX_SFXLOCAL_START + 12)
#define SFX_ST_DURATION_FORMAT (RID_SFX_SFXLOCAL_START + 13) #define SFX_ST_DURATION_FORMAT (RID_SFX_SFXLOCAL_START + 13)
#define SFX_CTRL_CUSTOM_PROPERTIES (RID_SFX_SFXLOCAL_START + 14)
// Images ---------------------------------------------------------------- // 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>
...@@ -39,169 +39,9 @@ ...@@ -39,169 +39,9 @@
<property name="tab_fill">False</property> <property name="tab_fill">False</property>
</packing> </packing>
</child> </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> <child>
<placeholder/> <placeholder/>
</child> </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>
</child>
<child type="tab"> <child type="tab">
<object class="GtkLabel" id="label55"> <object class="GtkLabel" id="label55">
<property name="visible">True</property> <property name="visible">True</property>
......
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