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

convert SID_RECORDING_FLOATWINDOW to .ui

Change-Id: Iae3f0269e5e7f830465580dc4a520ba01ef87a79
üst b6cc10ec
...@@ -141,7 +141,8 @@ protected: ...@@ -141,7 +141,8 @@ protected:
SfxFloatingWindow( SfxBindings *pBindings, SfxFloatingWindow( SfxBindings *pBindings,
SfxChildWindow *pCW, SfxChildWindow *pCW,
Window* pParent, 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 ~SfxFloatingWindow();
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE; virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
......
...@@ -121,7 +121,8 @@ public: ...@@ -121,7 +121,8 @@ public:
public: public:
explicit FloatingWindow(Window* pParent, WinBits nStyle = WB_STDFLOATWIN); 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& ); explicit FloatingWindow( Window* pParent, const ResId& );
virtual ~FloatingWindow(); virtual ~FloatingWindow();
......
...@@ -170,7 +170,7 @@ private: ...@@ -170,7 +170,7 @@ private:
protected: protected:
// Single argument ctors shall be explicit. // Single argument ctors shall be explicit.
explicit SystemWindow(WindowType nType); 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 ); void SetWindowStateData( const WindowStateData& rData );
......
...@@ -22,6 +22,7 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\ ...@@ -22,6 +22,7 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\
sfx2/uiconfig/ui/documentpropertiesdialog \ sfx2/uiconfig/ui/documentpropertiesdialog \
sfx2/uiconfig/ui/editdurationdialog \ sfx2/uiconfig/ui/editdurationdialog \
sfx2/uiconfig/ui/errorfindemaildialog \ sfx2/uiconfig/ui/errorfindemaildialog \
sfx2/uiconfig/ui/floatingrecord \
sfx2/uiconfig/ui/helpbookmarkpage \ sfx2/uiconfig/ui/helpbookmarkpage \
sfx2/uiconfig/ui/helpcontrol \ sfx2/uiconfig/ui/helpcontrol \
sfx2/uiconfig/ui/helpcontentpage \ sfx2/uiconfig/ui/helpcontentpage \
......
...@@ -483,8 +483,8 @@ SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx, ...@@ -483,8 +483,8 @@ SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx,
SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx, SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx,
SfxChildWindow *pCW, SfxChildWindow *pCW,
Window* pParent, Window* pParent,
const OString& rID, const OUString& rUIXMLDescription) : const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame) :
FloatingWindow(pParent, rID, rUIXMLDescription), FloatingWindow(pParent, rID, rUIXMLDescription, rFrame),
pBindings(pBindinx), pBindings(pBindinx),
pImp( new SfxFloatingWindow_Impl ) pImp( new SfxFloatingWindow_Impl )
{ {
......
...@@ -167,25 +167,22 @@ SfxRecordingFloat_Impl::SfxRecordingFloat_Impl( ...@@ -167,25 +167,22 @@ SfxRecordingFloat_Impl::SfxRecordingFloat_Impl(
: SfxFloatingWindow( pBind, : SfxFloatingWindow( pBind,
pChildWin, pChildWin,
pParent, pParent,
SfxResId( SID_RECORDING_FLOATWINDOW ) ) "FloatingRecord", "sfx/ui/floatingrecord.ui", pBind->GetActiveFrame() )
, aTbx( this, SfxResId(SID_RECORDING_FLOATWINDOW) )
{ {
get(m_pTbx, "toolbar");
// Retrieve label from helper function // Retrieve label from helper function
uno::Reference< frame::XFrame > xFrame = GetBindings().GetActiveFrame(); uno::Reference< frame::XFrame > xFrame = getFrame();
OUString aCommandStr( ".uno:StopRecording" ); OUString aCommandStr( ".uno:StopRecording" );
aTbx.SetItemText( SID_STOP_RECORDING, GetLabelFromCommandURL( aCommandStr, xFrame )); sal_uInt16 nItemId = m_pTbx->GetItemId(aCommandStr);
m_pTbx->SetItemText( nItemId, GetLabelFromCommandURL( aCommandStr, xFrame ));
// Determine size of toolbar
Size aTbxSize = aTbx.CalcWindowSizePixel();
aTbx.SetPosSizePixel( Point(), aTbxSize );
SetOutputSizePixel( aTbxSize );
// create a generic toolbox controller for our internal toolbox // create a generic toolbox controller for our internal toolbox
svt::GenericToolboxController* pController = new svt::GenericToolboxController( svt::GenericToolboxController* pController = new svt::GenericToolboxController(
::comphelper::getProcessComponentContext(), ::comphelper::getProcessComponentContext(),
xFrame, xFrame,
&aTbx, m_pTbx,
SID_STOP_RECORDING, nItemId,
aCommandStr ); aCommandStr );
xStopRecTbxCtrl = uno::Reference< frame::XToolbarController >( xStopRecTbxCtrl = uno::Reference< frame::XToolbarController >(
static_cast< cppu::OWeakObject* >( pController ), static_cast< cppu::OWeakObject* >( pController ),
...@@ -194,7 +191,7 @@ SfxRecordingFloat_Impl::SfxRecordingFloat_Impl( ...@@ -194,7 +191,7 @@ SfxRecordingFloat_Impl::SfxRecordingFloat_Impl(
if ( xUpdate.is() ) if ( xUpdate.is() )
xUpdate->update(); xUpdate->update();
aTbx.SetSelectHdl( LINK( this, SfxRecordingFloat_Impl, Select ) ); m_pTbx->SetSelectHdl( LINK( this, SfxRecordingFloat_Impl, Select ) );
// start recording // start recording
SfxBoolItem aItem( SID_RECORDMACRO, true ); SfxBoolItem aItem( SID_RECORDMACRO, true );
...@@ -248,7 +245,7 @@ void SfxRecordingFloat_Impl::StateChanged( StateChangedType nStateChange ) ...@@ -248,7 +245,7 @@ void SfxRecordingFloat_Impl::StateChanged( StateChangedType nStateChange )
IMPL_LINK( SfxRecordingFloat_Impl, Select, ToolBox*, pToolBar ) IMPL_LINK( SfxRecordingFloat_Impl, Select, ToolBox*, pToolBar )
{ {
(void)pToolBar; (void)pToolBar;
sal_Int16 nKeyModifier( (sal_Int16)aTbx.GetModifier() ); sal_Int16 nKeyModifier( (sal_Int16)m_pTbx->GetModifier() );
if ( xStopRecTbxCtrl.is() ) if ( xStopRecTbxCtrl.is() )
xStopRecTbxCtrl->execute( nKeyModifier ); xStopRecTbxCtrl->execute( nKeyModifier );
......
...@@ -22,30 +22,6 @@ ...@@ -22,30 +22,6 @@
#define STD_MASKCOLOR Color { Red = 0xC000; Green = 0xC000; Blue = 0xC000; } #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 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."; Text [ en-US ] = "Do you really want to cancel the recording? Any steps recorded up to this point will be lost.";
......
...@@ -39,7 +39,7 @@ public: ...@@ -39,7 +39,7 @@ public:
class SfxRecordingFloat_Impl : public SfxFloatingWindow class SfxRecordingFloat_Impl : public SfxFloatingWindow
{ {
ToolBox aTbx; ToolBox* m_pTbx;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XToolbarController > xStopRecTbxCtrl; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XToolbarController > xStopRecTbxCtrl;
public: public:
SfxRecordingFloat_Impl( SfxBindings* pBindings , SfxRecordingFloat_Impl( SfxBindings* pBindings ,
......
<?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>
...@@ -164,10 +164,10 @@ FloatingWindow::FloatingWindow( Window* pParent, const ResId& rResId ) : ...@@ -164,10 +164,10 @@ FloatingWindow::FloatingWindow( Window* pParent, const ResId& rResId ) :
Show(); 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) : SystemWindow(WINDOW_FLOATINGWINDOW)
{ {
loadUI(pParent, rID, rUIXMLDescription); loadUI(pParent, rID, rUIXMLDescription, rFrame);
} }
//Find the real parent stashed in mpDialogParent. //Find the real parent stashed in mpDialogParent.
......
...@@ -95,11 +95,12 @@ SystemWindow::SystemWindow(WindowType nType) ...@@ -95,11 +95,12 @@ SystemWindow::SystemWindow(WindowType nType)
Init(); 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; mbIsDefferedInit = true;
mpDialogParent = pParent; //should be unset in doDeferredInit 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() SystemWindow::~SystemWindow()
......
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