summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorJack Leigh <leighman@gmx.se>2012-10-11 23:47:56 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-10-12 16:33:42 +0100
commit5cb6877206c459530caa104b34e494badab5a4d1 (patch)
treefa876a7f94b5b5d6b8f895c68dd0ee873584fae7 /cui
parentXubString->OUString (diff)
downloadcore-5cb6877206c459530caa104b34e494badab5a4d1.tar.gz
core-5cb6877206c459530caa104b34e494badab5a4d1.zip
migrate 'Insert OLE Object' dialog to use .ui file
Change-Id: If2a241e34f88a39bacee5344f89893e3ccfdc57d
Diffstat (limited to 'cui')
-rw-r--r--cui/UI_cui.mk1
-rw-r--r--cui/source/dialogs/insdlg.cxx56
-rw-r--r--cui/source/dialogs/svuidlg.hrc7
-rw-r--r--cui/source/dialogs/svuidlg.src80
-rw-r--r--cui/source/inc/insdlg.hxx49
-rw-r--r--cui/uiconfig/ui/insertoleobject.ui282
6 files changed, 330 insertions, 145 deletions
diff --git a/cui/UI_cui.mk b/cui/UI_cui.mk
index 4a282f9a2397..c1b2a3ec5e41 100644
--- a/cui/UI_cui.mk
+++ b/cui/UI_cui.mk
@@ -13,6 +13,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\
cui/uiconfig/ui/charnamepage \
cui/uiconfig/ui/effectspage \
cui/uiconfig/ui/hyphenate \
+ cui/uiconfig/ui/insertoleobject \
cui/uiconfig/ui/insertplugin \
cui/uiconfig/ui/positionpage \
cui/uiconfig/ui/specialcharacters \
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index 43786ca67ede..b3a10cb1e57f 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -42,6 +42,7 @@
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <vcl/group.hxx>
+#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
@@ -151,7 +152,7 @@ IMPL_LINK_NOARG(SvInsertOleDlg, BrowseHdl)
{
Sequence< OUString > aPathSeq( xFilePicker->getFiles() );
INetURLObject aObj( aPathSeq[0] );
- aEdFilepath.SetText( aObj.PathToFileName() );
+ m_pEdFilepath->SetText( aObj.PathToFileName() );
}
}
}
@@ -163,22 +164,15 @@ IMPL_LINK_NOARG(SvInsertOleDlg, BrowseHdl)
IMPL_LINK_NOARG(SvInsertOleDlg, RadioHdl)
{
- if ( aRbNewObject.IsChecked() )
+ if ( m_pRbNewObject->IsChecked() )
{
- aLbObjecttype.Show();
- aEdFilepath.Hide();
- aBtnFilepath.Hide();
- aCbFilelink.Hide();
- aGbObject.SetText( _aOldStr );
+ m_pObjectTypeFrame->Show();
+ m_pFileFrame->Hide();
}
else
{
- aCbFilelink.Show();
- aLbObjecttype.Hide();
- aEdFilepath.Show();
- aBtnFilepath.Show();
- aCbFilelink.Show();
- aGbObject.SetText( aStrFile );
+ m_pFileFrame->Show();
+ m_pObjectTypeFrame->Hide();
}
return 0;
}
@@ -187,7 +181,7 @@ IMPL_LINK_NOARG(SvInsertOleDlg, RadioHdl)
void SvInsertOleDlg::SelectDefault()
{
- aLbObjecttype.SelectEntryPos( 0 );
+ m_pLbObjecttype->SelectEntryPos(0);
}
// -----------------------------------------------------------------------
@@ -197,30 +191,24 @@ SvInsertOleDlg::SvInsertOleDlg
const Reference < embed::XStorage >& xStorage,
const SvObjectServerList* pServers
)
- : InsertObjectDialog_Impl( pParent, CUI_RES( MD_INSERT_OLEOBJECT ), xStorage ),
- aRbNewObject( this, CUI_RES( RB_NEW_OBJECT ) ),
- aRbObjectFromfile( this, CUI_RES( RB_OBJECT_FROMFILE ) ),
- aGbObject( this, CUI_RES( GB_OBJECT ) ),
- aLbObjecttype( this, CUI_RES( LB_OBJECTTYPE ) ),
- aEdFilepath( this, CUI_RES( ED_FILEPATH ) ),
- aBtnFilepath( this, CUI_RES( BTN_FILEPATH ) ),
- aCbFilelink( this, CUI_RES( CB_FILELINK ) ),
- aOKButton1( this, CUI_RES( 1 ) ),
- aCancelButton1( this, CUI_RES( 1 ) ),
- aHelpButton1( this, CUI_RES( 1 ) ),
- aStrFile( CUI_RES( STR_FILE ) ),
+ : InsertObjectDialog_Impl( pParent, "InsertOLEObjectDialog", "cui/ui/insertoleobject.ui", xStorage ),
m_pServers( pServers )
{
- FreeResource();
- _aOldStr = aGbObject.GetText();
- aLbObjecttype.SetDoubleClickHdl( LINK( this, SvInsertOleDlg, DoubleClickHdl ) );
- aBtnFilepath.SetClickHdl( LINK( this, SvInsertOleDlg, BrowseHdl ) );
+ get(m_pRbNewObject, "createnew");
+ get(m_pRbObjectFromfile, "createfromfile");
+ get(m_pObjectTypeFrame, "objecttypeframe");
+ get(m_pLbObjecttype, "types");
+ get(m_pFileFrame, "fileframe");
+ get(m_pEdFilepath, "urled");
+ get(m_pBtnFilepath, "urlbtn");
+ get(m_pCbFilelink, "linktofile");
+ m_pLbObjecttype->SetDoubleClickHdl( LINK( this, SvInsertOleDlg, DoubleClickHdl ) );
+ m_pBtnFilepath->SetClickHdl( LINK( this, SvInsertOleDlg, BrowseHdl ) );
Link aLink( LINK( this, SvInsertOleDlg, RadioHdl ) );
- aRbNewObject.SetClickHdl( aLink );
- aRbObjectFromfile.SetClickHdl( aLink );
- aRbNewObject.Check( sal_True );
+ m_pRbNewObject->SetClickHdl( aLink );
+ m_pRbObjectFromfile->SetClickHdl( aLink );
+ m_pRbNewObject->Check( sal_True );
RadioHdl( NULL );
- aBtnFilepath.SetAccessibleRelationMemberOf(&aGbObject);
}
short SvInsertOleDlg::Execute()
diff --git a/cui/source/dialogs/svuidlg.hrc b/cui/source/dialogs/svuidlg.hrc
index 17e3ad4ad44e..e2d69f463507 100644
--- a/cui/source/dialogs/svuidlg.hrc
+++ b/cui/source/dialogs/svuidlg.hrc
@@ -83,13 +83,6 @@
#define ED_APPLET_OPTIONS 20
#define GB_APPLET_OPTIONS 21
-#define MD_INSERT_OLEOBJECT 32010
-#define RB_NEW_OBJECT 10
-#define RB_OBJECT_FROMFILE 11
-#define LB_OBJECTTYPE 12
-#define GB_OBJECT 13
-#define STR_FILE 14
-
#define MD_INSERT_OBJECT_IFRAME 32011
#define FT_FRAMENAME 3
#define ED_FRAMENAME 4
diff --git a/cui/source/dialogs/svuidlg.src b/cui/source/dialogs/svuidlg.src
index af30d3a71a94..7c5bce2cc91d 100644
--- a/cui/source/dialogs/svuidlg.src
+++ b/cui/source/dialogs/svuidlg.src
@@ -305,86 +305,6 @@ ModalDialog MD_LINKEDIT
Text [ en-US ] = "Edit" ;
};
};
-ModalDialog MD_INSERT_OLEOBJECT
-{
- HelpID = "cui:ModalDialog:MD_INSERT_OLEOBJECT";
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 284 , 105 ) ;
- Moveable = TRUE ;
- RadioButton RB_NEW_OBJECT
- {
- HelpID = "cui:RadioButton:MD_INSERT_OLEOBJECT:RB_NEW_OBJECT";
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 81 , 10 ) ;
- Text [ en-US ] = "~Create new" ;
- };
- RadioButton RB_OBJECT_FROMFILE
- {
- HelpID = "cui:RadioButton:MD_INSERT_OLEOBJECT:RB_OBJECT_FROMFILE";
- Pos = MAP_APPFONT ( 90 , 6 ) ;
- Size = MAP_APPFONT ( 81 , 10 ) ;
- Text [ en-US ] = "Create from ~file" ;
- };
- ListBox LB_OBJECTTYPE
- {
- HelpID = "cui:ListBox:MD_INSERT_OLEOBJECT:LB_OBJECTTYPE";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 33 ) ;
- Size = MAP_APPFONT ( 204 , 60 ) ;
- };
- Edit ED_FILEPATH
- {
- HelpID = "cui:Edit:MD_INSERT_OLEOBJECT:ED_FILEPATH";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 33 ) ;
- Size = MAP_APPFONT ( 204 , 12 ) ;
- };
- PushButton BTN_FILEPATH
- {
- HelpID = "cui:PushButton:MD_INSERT_OLEOBJECT:BTN_FILEPATH";
- Pos = MAP_APPFONT ( 166 , 48 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Search..." ;
- };
- CheckBox CB_FILELINK
- {
- HelpID = "cui:CheckBox:MD_INSERT_OLEOBJECT:CB_FILELINK";
- Pos = MAP_APPFONT ( 12 , 48 ) ;
- Size = MAP_APPFONT ( 138 , 10 ) ;
- Text [ en-US ] = "~Link to file" ;
- };
- FixedLine GB_OBJECT
- {
- Pos = MAP_APPFONT ( 6 , 22 ) ;
- Size = MAP_APPFONT ( 216 , 8 ) ;
- Text [ en-US ] = "Object type" ;
- };
- OKButton 1
- {
- Pos = MAP_APPFONT ( 228 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- TabStop = TRUE ;
- };
- CancelButton 1
- {
- Pos = MAP_APPFONT ( 228 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton 1
- {
- Pos = MAP_APPFONT ( 228 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- String STR_FILE
- {
- Text [ en-US ] = "File" ;
- };
- Text [ en-US ] = "Insert OLE Object" ;
-};
ModalDialog MD_INSERT_OBJECT_APPLET
{
HelpID = "cui:ModalDialog:MD_INSERT_OBJECT_APPLET";
diff --git a/cui/source/inc/insdlg.hxx b/cui/source/inc/insdlg.hxx
index 27ebff9acf74..c4486c98de1a 100644
--- a/cui/source/inc/insdlg.hxx
+++ b/cui/source/inc/insdlg.hxx
@@ -33,6 +33,8 @@
#include <svtools/svmedit.hxx> // MultiLineEdit
#include <comphelper/embeddedobjectcontainer.hxx>
+class VclFrame;
+
class INetURLObject;
class InsertObjectDialog_Impl : public ModalDialog
@@ -55,38 +57,37 @@ public:
class SvInsertOleDlg : public InsertObjectDialog_Impl
{
- RadioButton aRbNewObject;
- RadioButton aRbObjectFromfile;
- FixedLine aGbObject;
- ListBox aLbObjecttype;
- Edit aEdFilepath;
- PushButton aBtnFilepath;
- CheckBox aCbFilelink;
- OKButton aOKButton1;
- CancelButton aCancelButton1;
- HelpButton aHelpButton1;
- String aStrFile;
- String _aOldStr;
+ RadioButton* m_pRbNewObject;
+ RadioButton* m_pRbObjectFromfile;
+ VclFrame* m_pObjectTypeFrame;
+ ListBox* m_pLbObjecttype;
+ VclFrame* m_pFileFrame;
+ Edit* m_pEdFilepath;
+ PushButton* m_pBtnFilepath;
+ CheckBox* m_pCbFilelink;
const SvObjectServerList* m_pServers;
::com::sun::star::uno::Sequence< sal_Int8 > m_aIconMetaFile;
- ::rtl::OUString m_aIconMediaType;
+ OUString m_aIconMediaType;
- DECL_LINK( DoubleClickHdl, void* );
+ DECL_LINK(DoubleClickHdl, void*);
DECL_LINK(BrowseHdl, void *);
DECL_LINK(RadioHdl, void *);
- void SelectDefault();
- ListBox& GetObjectTypes()
- { return aLbObjecttype; }
- String GetFilePath() const { return aEdFilepath.GetText(); }
- sal_Bool IsLinked() const { return aCbFilelink.IsChecked(); }
- sal_Bool IsCreateNew() const { return aRbNewObject.IsChecked(); }
+ void SelectDefault();
+ ListBox& GetObjectTypes()
+ { return *m_pLbObjecttype; }
+ OUString GetFilePath() const
+ { return m_pEdFilepath->GetText(); }
+ sal_Bool IsLinked() const
+ { return m_pCbFilelink->IsChecked(); }
+ sal_Bool IsCreateNew() const
+ { return m_pRbNewObject->IsChecked(); }
public:
- SvInsertOleDlg( Window* pParent,
- const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage,
- const SvObjectServerList* pServers = NULL );
- virtual short Execute();
+ SvInsertOleDlg( Window* pParent,
+ const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage,
+ const SvObjectServerList* pServers = NULL );
+ virtual short Execute();
/// get replacement for the iconified embedded object and the mediatype of the replacement
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( ::rtl::OUString* pGraphicMediaType );
diff --git a/cui/uiconfig/ui/insertoleobject.ui b/cui/uiconfig/ui/insertoleobject.ui
new file mode 100644
index 000000000000..167b9581fb93
--- /dev/null
+++ b/cui/uiconfig/ui/insertoleobject.ui
@@ -0,0 +1,282 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="InsertOLEObjectDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Insert OLE 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="spacing">2</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="width_request">400</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <object class="GtkRadioButton" id="createnew">
+ <property name="label" translatable="yes">Create new</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">createfromfile</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="createfromfile">
+ <property name="label" translatable="yes">Create from file</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="objecttypeframe">
+ <property name="visible">True</property>
+ <property name="can_focus">False</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="left_padding">12</property>
+ <child>
+ <object class="GtkTreeView" id="types">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection1"/>
+ </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">Object type</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="fileframe">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkEntry" id="urled">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="invisible_char">•</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="urlbtn">
+ <property name="label" translatable="yes">Search ...</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>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="linktofile">
+ <property name="label" translatable="yes">Link to file</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">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>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">File</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </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="padding">6</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="layout_style">start</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</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>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</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">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</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">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">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>
+ <object class="GtkAdjustment" id="adjustment1">
+ <property name="lower">1</property>
+ <property name="upper">9999</property>
+ <property name="value">1</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkListStore" id="liststore1">
+ <columns>
+ <!-- column-name gchararray1 -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">[None]</col>
+ </row>
+ </data>
+ </object>
+</interface>