diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-09-02 12:02:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-09-02 15:26:54 +0100 |
commit | dc5e8921530e811d0154af39504e4c149a6eae13 (patch) | |
tree | 78be59ebfed6a3f2b6ca71681d67f5dd677df447 | |
parent | b6cc10ecf28d2e0ae25383f2dc82b66e67971b08 (diff) |
convert SID_RECORDING_FLOATWINDOW to .ui
Change-Id: Iae3f0269e5e7f830465580dc4a520ba01ef87a79
-rw-r--r-- | include/sfx2/basedlgs.hxx | 3 | ||||
-rw-r--r-- | include/vcl/floatwin.hxx | 3 | ||||
-rw-r--r-- | include/vcl/syswin.hxx | 2 | ||||
-rw-r--r-- | sfx2/UIConfig_sfx.mk | 1 | ||||
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/recfloat.cxx | 23 | ||||
-rw-r--r-- | sfx2/source/dialog/recfloat.src | 24 | ||||
-rw-r--r-- | sfx2/source/inc/recfloat.hxx | 2 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/floatingrecord.ui | 53 | ||||
-rw-r--r-- | vcl/source/window/floatwin.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/syswin.cxx | 5 |
11 files changed, 77 insertions, 47 deletions
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx index 2e4c14a1ef17..cef733fda939 100644 --- a/include/sfx2/basedlgs.hxx +++ b/include/sfx2/basedlgs.hxx @@ -141,7 +141,8 @@ protected: SfxFloatingWindow( SfxBindings *pBindings, SfxChildWindow *pCW, Window* pParent, - const OString& rID, const OUString& rUIXMLDescription); + const OString& rID, const OUString& rUIXMLDescription, + const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>()); virtual ~SfxFloatingWindow(); virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE; diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx index 02ae4cacb3aa..c76876003ff1 100644 --- a/include/vcl/floatwin.hxx +++ b/include/vcl/floatwin.hxx @@ -121,7 +121,8 @@ public: public: explicit FloatingWindow(Window* pParent, WinBits nStyle = WB_STDFLOATWIN); - explicit FloatingWindow(Window* pParent, const OString& rID, const OUString& rUIXMLDescription); + explicit FloatingWindow(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, + const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>()); explicit FloatingWindow( Window* pParent, const ResId& ); virtual ~FloatingWindow(); diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx index d901ccda9c17..93c5926551ff 100644 --- a/include/vcl/syswin.hxx +++ b/include/vcl/syswin.hxx @@ -170,7 +170,7 @@ private: protected: // Single argument ctors shall be explicit. explicit SystemWindow(WindowType nType); - void loadUI(Window* pParent, const OString& rID, const OUString& rUIXMLDescription); + void loadUI(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>()); void SetWindowStateData( const WindowStateData& rData ); diff --git a/sfx2/UIConfig_sfx.mk b/sfx2/UIConfig_sfx.mk index 5142f9249d96..9a555b95b0d3 100644 --- a/sfx2/UIConfig_sfx.mk +++ b/sfx2/UIConfig_sfx.mk @@ -22,6 +22,7 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\ sfx2/uiconfig/ui/documentpropertiesdialog \ sfx2/uiconfig/ui/editdurationdialog \ sfx2/uiconfig/ui/errorfindemaildialog \ + sfx2/uiconfig/ui/floatingrecord \ sfx2/uiconfig/ui/helpbookmarkpage \ sfx2/uiconfig/ui/helpcontrol \ sfx2/uiconfig/ui/helpcontentpage \ diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index e17c77f19285..a15dd9913c23 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -483,8 +483,8 @@ SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx, SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW, Window* pParent, - const OString& rID, const OUString& rUIXMLDescription) : - FloatingWindow(pParent, rID, rUIXMLDescription), + const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame) : + FloatingWindow(pParent, rID, rUIXMLDescription, rFrame), pBindings(pBindinx), pImp( new SfxFloatingWindow_Impl ) { diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index 9b8faba9f52d..2b0b42944553 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -167,25 +167,22 @@ SfxRecordingFloat_Impl::SfxRecordingFloat_Impl( : SfxFloatingWindow( pBind, pChildWin, pParent, - SfxResId( SID_RECORDING_FLOATWINDOW ) ) - , aTbx( this, SfxResId(SID_RECORDING_FLOATWINDOW) ) + "FloatingRecord", "sfx/ui/floatingrecord.ui", pBind->GetActiveFrame() ) { + get(m_pTbx, "toolbar"); + // Retrieve label from helper function - uno::Reference< frame::XFrame > xFrame = GetBindings().GetActiveFrame(); + uno::Reference< frame::XFrame > xFrame = getFrame(); OUString aCommandStr( ".uno:StopRecording" ); - aTbx.SetItemText( SID_STOP_RECORDING, GetLabelFromCommandURL( aCommandStr, xFrame )); - - // Determine size of toolbar - Size aTbxSize = aTbx.CalcWindowSizePixel(); - aTbx.SetPosSizePixel( Point(), aTbxSize ); - SetOutputSizePixel( aTbxSize ); + sal_uInt16 nItemId = m_pTbx->GetItemId(aCommandStr); + m_pTbx->SetItemText( nItemId, GetLabelFromCommandURL( aCommandStr, xFrame )); // create a generic toolbox controller for our internal toolbox svt::GenericToolboxController* pController = new svt::GenericToolboxController( ::comphelper::getProcessComponentContext(), xFrame, - &aTbx, - SID_STOP_RECORDING, + m_pTbx, + nItemId, aCommandStr ); xStopRecTbxCtrl = uno::Reference< frame::XToolbarController >( static_cast< cppu::OWeakObject* >( pController ), @@ -194,7 +191,7 @@ SfxRecordingFloat_Impl::SfxRecordingFloat_Impl( if ( xUpdate.is() ) xUpdate->update(); - aTbx.SetSelectHdl( LINK( this, SfxRecordingFloat_Impl, Select ) ); + m_pTbx->SetSelectHdl( LINK( this, SfxRecordingFloat_Impl, Select ) ); // start recording SfxBoolItem aItem( SID_RECORDMACRO, true ); @@ -248,7 +245,7 @@ void SfxRecordingFloat_Impl::StateChanged( StateChangedType nStateChange ) IMPL_LINK( SfxRecordingFloat_Impl, Select, ToolBox*, pToolBar ) { (void)pToolBar; - sal_Int16 nKeyModifier( (sal_Int16)aTbx.GetModifier() ); + sal_Int16 nKeyModifier( (sal_Int16)m_pTbx->GetModifier() ); if ( xStopRecTbxCtrl.is() ) xStopRecTbxCtrl->execute( nKeyModifier ); diff --git a/sfx2/source/dialog/recfloat.src b/sfx2/source/dialog/recfloat.src index 119374b173f7..8a5c4843af78 100644 --- a/sfx2/source/dialog/recfloat.src +++ b/sfx2/source/dialog/recfloat.src @@ -22,30 +22,6 @@ #define STD_MASKCOLOR Color { Red = 0xC000; Green = 0xC000; Blue = 0xC000; } -FloatingWindow SID_RECORDING_FLOATWINDOW -{ - HelpID = "sfx2:FloatingWindow:SID_RECORDING_FLOATWINDOW"; - Moveable = TRUE ; - Closeable = TRUE ; - Hide = TRUE ; - SVLook = TRUE ; - Text [ en-US ] = "Record Macro"; -}; - -ToolBox SID_RECORDING_FLOATWINDOW -{ - SVLook = TRUE ; - ButtonType = BUTTON_TEXT; - ItemList = - { - ToolBoxItem - { - Identifier = SID_STOP_RECORDING; - Command = ".uno:StopRecording"; - }; - }; -}; - String STR_MACRO_LOSS { Text [ en-US ] = "Do you really want to cancel the recording? Any steps recorded up to this point will be lost."; diff --git a/sfx2/source/inc/recfloat.hxx b/sfx2/source/inc/recfloat.hxx index 5369b16cef57..23c9b362ccc3 100644 --- a/sfx2/source/inc/recfloat.hxx +++ b/sfx2/source/inc/recfloat.hxx @@ -39,7 +39,7 @@ public: class SfxRecordingFloat_Impl : public SfxFloatingWindow { - ToolBox aTbx; + ToolBox* m_pTbx; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XToolbarController > xStopRecTbxCtrl; public: SfxRecordingFloat_Impl( SfxBindings* pBindings , diff --git a/sfx2/uiconfig/ui/floatingrecord.ui b/sfx2/uiconfig/ui/floatingrecord.ui new file mode 100644 index 000000000000..653867a2dfe1 --- /dev/null +++ b/sfx2/uiconfig/ui/floatingrecord.ui @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.1 --> +<interface> + <requires lib="gtk+" version="3.0"/> + <object class="GtkWindow" id="FloatingRecord"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Record Macro</property> + <property name="type_hint">utility</property> + <property name="deletable">False</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkToolbar" id="toolbar"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="toolbar_style">text</property> + <property name="show_arrow">False</property> + <child> + <object class="GtkToolButton" id="stop"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="action_name">.uno:StopRecording</property> + <property name="label" translatable="yes">Stop Recording</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + </object> +</interface> diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 37e7a222ee1d..caedcbcaaef3 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -164,10 +164,10 @@ FloatingWindow::FloatingWindow( Window* pParent, const ResId& rResId ) : Show(); } -FloatingWindow::FloatingWindow(Window* pParent, const OString& rID, const OUString& rUIXMLDescription) +FloatingWindow::FloatingWindow(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame) : SystemWindow(WINDOW_FLOATINGWINDOW) { - loadUI(pParent, rID, rUIXMLDescription); + loadUI(pParent, rID, rUIXMLDescription, rFrame); } //Find the real parent stashed in mpDialogParent. diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 1cf207c46ab7..127709324926 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -95,11 +95,12 @@ SystemWindow::SystemWindow(WindowType nType) Init(); } -void SystemWindow::loadUI(Window* pParent, const OString& rID, const OUString& rUIXMLDescription) +void SystemWindow::loadUI(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, + const css::uno::Reference<css::frame::XFrame> &rFrame) { mbIsDefferedInit = true; mpDialogParent = pParent; //should be unset in doDeferredInit - m_pUIBuilder = new VclBuilder(this, getUIRootDir(), rUIXMLDescription, rID); + m_pUIBuilder = new VclBuilder(this, getUIRootDir(), rUIXMLDescription, rID, rFrame); } SystemWindow::~SystemWindow() |