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

convert insert plugin to .ui

Change-Id: I229b152ba132329ca20cff0afd4f84e1c052b97f
üst f9775fcb
...@@ -13,6 +13,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\ ...@@ -13,6 +13,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\
cui/uiconfig/ui/charnamepage \ cui/uiconfig/ui/charnamepage \
cui/uiconfig/ui/effectspage \ cui/uiconfig/ui/effectspage \
cui/uiconfig/ui/hyphenate \ cui/uiconfig/ui/hyphenate \
cui/uiconfig/ui/insertplugin \
cui/uiconfig/ui/positionpage \ cui/uiconfig/ui/positionpage \
cui/uiconfig/ui/specialcharacters \ cui/uiconfig/ui/specialcharacters \
cui/uiconfig/ui/thesaurus \ cui/uiconfig/ui/thesaurus \
......
...@@ -39,13 +39,13 @@ ...@@ -39,13 +39,13 @@
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
#include <tools/debug.hxx> #include <tools/debug.hxx>
#include <svl/urihelper.hxx> #include <svl/urihelper.hxx>
#include <svtools/svmedit.hxx>
#include <vcl/button.hxx> #include <vcl/button.hxx>
#include <vcl/fixed.hxx> #include <vcl/fixed.hxx>
#include <vcl/group.hxx> #include <vcl/group.hxx>
#include <vcl/lstbox.hxx> #include <vcl/lstbox.hxx>
#include <vcl/msgbox.hxx> #include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/vclmedit.hxx>
#include <sot/clsids.hxx> #include <sot/clsids.hxx>
#include <sfx2/frmdescr.hxx> #include <sfx2/frmdescr.hxx>
#include <sfx2/viewsh.hxx> #include <sfx2/viewsh.hxx>
...@@ -98,6 +98,15 @@ InsertObjectDialog_Impl::InsertObjectDialog_Impl( Window * pParent, const ResId ...@@ -98,6 +98,15 @@ InsertObjectDialog_Impl::InsertObjectDialog_Impl( Window * pParent, const ResId
{ {
} }
InsertObjectDialog_Impl::InsertObjectDialog_Impl(Window * pParent, const OString& rID,
const OUString& rUIXMLDescription,
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage)
: ModalDialog(pParent, rID, rUIXMLDescription)
, m_xStorage( xStorage )
, aCnt( m_xStorage )
{
}
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
IMPL_LINK_NOARG_INLINE_START(SvInsertOleDlg, DoubleClickHdl) IMPL_LINK_NOARG_INLINE_START(SvInsertOleDlg, DoubleClickHdl)
...@@ -411,7 +420,7 @@ IMPL_LINK_NOARG(SvInsertPlugInDialog, BrowseHdl) ...@@ -411,7 +420,7 @@ IMPL_LINK_NOARG(SvInsertPlugInDialog, BrowseHdl)
{ {
Sequence< OUString > aPathSeq( xFilePicker->getFiles() ); Sequence< OUString > aPathSeq( xFilePicker->getFiles() );
INetURLObject aObj( aPathSeq[0] ); INetURLObject aObj( aPathSeq[0] );
aEdFileurl.SetText( aObj.PathToFileName() ); m_pEdFileurl->SetText(aObj.PathToFileName());
} }
} }
} }
...@@ -421,20 +430,15 @@ IMPL_LINK_NOARG(SvInsertPlugInDialog, BrowseHdl) ...@@ -421,20 +430,15 @@ IMPL_LINK_NOARG(SvInsertPlugInDialog, BrowseHdl)
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
SvInsertPlugInDialog::SvInsertPlugInDialog( Window* pParent, const uno::Reference < embed::XStorage >& xStorage ) SvInsertPlugInDialog::SvInsertPlugInDialog(Window* pParent,
: InsertObjectDialog_Impl( pParent, CUI_RES( MD_INSERT_OBJECT_PLUGIN ), xStorage ), const uno::Reference < embed::XStorage >& xStorage)
aGbFileurl( this, CUI_RES( GB_FILEURL ) ), : InsertObjectDialog_Impl(pParent, "InsertPluginDialog", "cui/ui/insertplugin.ui", xStorage)
aEdFileurl( this, CUI_RES( ED_FILEURL ) ), , m_pURL(0)
aBtnFileurl( this, CUI_RES( BTN_FILEURL ) ),
aGbPluginsOptions( this, CUI_RES( GB_PLUGINS_OPTIONS ) ),
aEdPluginsOptions( this, CUI_RES( ED_PLUGINS_OPTIONS ) ),
aOKButton1( this, CUI_RES( 1 ) ),
aCancelButton1( this, CUI_RES( 1 ) ),
aHelpButton1( this, CUI_RES( 1 ) ),
m_pURL(0)
{ {
FreeResource(); get(m_pEdFileurl, "urled");
aBtnFileurl.SetClickHdl( LINK( this, SvInsertPlugInDialog, BrowseHdl ) ); get(m_pBtnFileurl, "urlbtn");
get(m_pEdPluginsOptions, "pluginoptions");
m_pBtnFileurl->SetClickHdl(LINK(this, SvInsertPlugInDialog, BrowseHdl));
} }
SvInsertPlugInDialog::~SvInsertPlugInDialog() SvInsertPlugInDialog::~SvInsertPlugInDialog()
...@@ -464,7 +468,7 @@ static void Plugin_ImplFillCommandSequence( const String& aCommands, uno::Sequen ...@@ -464,7 +468,7 @@ static void Plugin_ImplFillCommandSequence( const String& aCommands, uno::Sequen
short SvInsertPlugInDialog::Execute() short SvInsertPlugInDialog::Execute()
{ {
short nRet = RET_OK; short nRet = RET_OK;
m_aCommands.Erase(); m_aCommands = OUString();
DBG_ASSERT( m_xStorage.is(), "No storage!"); DBG_ASSERT( m_xStorage.is(), "No storage!");
if ( m_xStorage.is() && ( nRet = Dialog::Execute() ) == RET_OK ) if ( m_xStorage.is() && ( nRet = Dialog::Execute() ) == RET_OK )
{ {
......
...@@ -73,13 +73,6 @@ ...@@ -73,13 +73,6 @@
#define BTN_FILEPATH 11 #define BTN_FILEPATH 11
#define CB_FILELINK 12 #define CB_FILELINK 12
#define MD_INSERT_OBJECT_PLUGIN 32008
#define ED_FILEURL 10
#define BTN_FILEURL 11
#define GB_FILEURL 12
#define ED_PLUGINS_OPTIONS 20
#define GB_PLUGINS_OPTIONS 21
#define MD_INSERT_OBJECT_APPLET 32009 #define MD_INSERT_OBJECT_APPLET 32009
#define FT_CLASSFILE 10 #define FT_CLASSFILE 10
#define ED_CLASSFILE 11 #define ED_CLASSFILE 11
......
...@@ -385,66 +385,6 @@ ModalDialog MD_INSERT_OLEOBJECT ...@@ -385,66 +385,6 @@ ModalDialog MD_INSERT_OLEOBJECT
}; };
Text [ en-US ] = "Insert OLE Object" ; Text [ en-US ] = "Insert OLE Object" ;
}; };
ModalDialog MD_INSERT_OBJECT_PLUGIN
{
HelpID = "cui:ModalDialog:MD_INSERT_OBJECT_PLUGIN";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 284 , 123 ) ;
Moveable = TRUE ;
Edit ED_FILEURL
{
HelpID = "cui:Edit:MD_INSERT_OBJECT_PLUGIN:ED_FILEURL";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 204 , 12 ) ;
};
PushButton BTN_FILEURL
{
HelpID = "cui:PushButton:MD_INSERT_OBJECT_PLUGIN:BTN_FILEURL";
Pos = MAP_APPFONT ( 166 , 29 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Browse..." ;
};
FixedLine GB_FILEURL
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 216 , 8 ) ;
Text [ en-US ] = "File / URL" ;
};
MultiLineEdit ED_PLUGINS_OPTIONS
{
HelpID = "cui:MultiLineEdit:MD_INSERT_OBJECT_PLUGIN:ED_PLUGINS_OPTIONS";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 66 ) ;
Size = MAP_APPFONT ( 204 , 45 ) ;
VScroll = TRUE ;
IgnoreTab = TRUE;
};
FixedLine GB_PLUGINS_OPTIONS
{
Pos = MAP_APPFONT ( 6 , 55 ) ;
Size = MAP_APPFONT ( 216 , 8 ) ;
Text [ en-US ] = "Options" ;
};
OKButton 1
{
Pos = MAP_APPFONT ( 228 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
DefButton = TRUE ;
};
CancelButton 1
{
Pos = MAP_APPFONT ( 228 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
HelpButton 1
{
Pos = MAP_APPFONT ( 228 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
Text [ en-US ] = "Insert Plug-in" ;
};
ModalDialog MD_INSERT_OBJECT_APPLET ModalDialog MD_INSERT_OBJECT_APPLET
{ {
HelpID = "cui:ModalDialog:MD_INSERT_OBJECT_APPLET"; HelpID = "cui:ModalDialog:MD_INSERT_OBJECT_APPLET";
......
...@@ -43,6 +43,9 @@ protected: ...@@ -43,6 +43,9 @@ protected:
comphelper::EmbeddedObjectContainer aCnt; comphelper::EmbeddedObjectContainer aCnt;
InsertObjectDialog_Impl( Window * pParent, const ResId & rResId, const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage ); InsertObjectDialog_Impl( Window * pParent, const ResId & rResId, const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
InsertObjectDialog_Impl(Window * pParent, const OString& rID,
const OUString& rUIXMLDescription,
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage);
public: public:
com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObject() com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetObject()
{ return m_xObj; } { return m_xObj; }
...@@ -92,28 +95,21 @@ public: ...@@ -92,28 +95,21 @@ public:
class SvInsertPlugInDialog : public InsertObjectDialog_Impl class SvInsertPlugInDialog : public InsertObjectDialog_Impl
{ {
private: private:
FixedLine aGbFileurl; Edit* m_pEdFileurl;
Edit aEdFileurl; PushButton* m_pBtnFileurl;
PushButton aBtnFileurl; VCLMultiLineEdit* m_pEdPluginsOptions;
FixedLine aGbPluginsOptions; INetURLObject* m_pURL;
MultiLineEdit aEdPluginsOptions; OUString m_aCommands;
OKButton aOKButton1;
CancelButton aCancelButton1;
HelpButton aHelpButton1;
INetURLObject* m_pURL;
String m_aCommands;
DECL_LINK(BrowseHdl, void *); DECL_LINK(BrowseHdl, void *);
String GetPlugInFile() const { return aEdFileurl.GetText(); } OUString GetPlugInFile() const { return m_pEdFileurl->GetText(); }
String GetPlugInOptions() const { return aEdPluginsOptions.GetText(); } OUString GetPlugInOptions() const { return m_pEdPluginsOptions->GetText(); }
public: public:
SvInsertPlugInDialog( Window* pParent, SvInsertPlugInDialog(Window* pParent,
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage ); const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage);
~SvInsertPlugInDialog();
~SvInsertPlugInDialog(); virtual short Execute();
virtual short Execute();
}; };
class SfxInsertFloatingFrameDialog : public InsertObjectDialog_Impl class SfxInsertFloatingFrameDialog : public InsertObjectDialog_Impl
......
...@@ -27,24 +27,26 @@ ...@@ -27,24 +27,26 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<object class="GtkBox" id="box1"> <object class="GtkGrid" id="grid1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="spacing">6</property>
<child> <child>
<object class="GtkEntry" id="entry1"> <object class="GtkEntry" id="urled">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char"></property> <property name="invisible_char"></property>
<property name="invisible_char_set">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">0</property>
<property name="fill">True</property> <property name="top_attach">0</property>
<property name="position">0</property> <property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="button1"> <object class="GtkButton" id="urlbtn">
<property name="label" translatable="yes">Browse...</property> <property name="label" translatable="yes">Browse...</property>
<property name="use_action_appearance">False</property> <property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
...@@ -53,9 +55,10 @@ ...@@ -53,9 +55,10 @@
<property name="use_action_appearance">False</property> <property name="use_action_appearance">False</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="left_attach">1</property>
<property name="fill">True</property> <property name="top_attach">0</property>
<property name="position">1</property> <property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -90,14 +93,17 @@ ...@@ -90,14 +93,17 @@
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<object class="GtkScrolledWindow" id="scrolledwindow1"> <object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="width_request">400</property>
<property name="height_request">80</property> <property name="height_request">80</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="hscrollbar_policy">never</property> <property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">always</property> <property name="vscrollbar_policy">always</property>
<property name="shadow_type">in</property> <property name="shadow_type">in</property>
<child> <child>
<object class="GtkTextView" id="textview1"> <object class="GtkTextView" id="pluginoptions">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="wrap_mode">char</property> <property name="wrap_mode">char</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