Kaydet (Commit) 4dc9dc6a authored tarafından Matúš Kukan's avatar Matúš Kukan

datastreams: add toolbar buttons to stop / resume streaming

Change-Id: I601a4a174ea191c799623d29ed6eb229f9f372da
üst 2c945010
...@@ -1293,6 +1293,22 @@ ...@@ -1293,6 +1293,22 @@
<value xml:lang="en-US">Strea~ms...</value> <value xml:lang="en-US">Strea~ms...</value>
</prop> </prop>
</node> </node>
<node oor:name=".uno:DataStreamsPlay" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Resume streaming</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
</prop>
</node>
<node oor:name=".uno:DataStreamsStop" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Stop streaming</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
</prop>
</node>
<node oor:name=".uno:ManageXMLSource" oor:op="replace"> <node oor:name=".uno:ManageXMLSource" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~XML Source...</value> <value xml:lang="en-US">~XML Source...</value>
......
...@@ -54,6 +54,17 @@ ...@@ -54,6 +54,17 @@
<value>true</value> <value>true</value>
</prop> </prop>
</node> </node>
<node oor:name="private:resource/toolbar/datastreams" oor:op="replace">
<prop oor:name="Docked" oor:type="xs:boolean">
<value>false</value>
</prop>
<prop oor:name="UIName" oor:type="xs:string">
<value xml:lang="en-US">Data Streams</value>
</prop>
<prop oor:name="Visible" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
<node oor:name="private:resource/toolbar/drawobjectbar" oor:op="replace"> <node oor:name="private:resource/toolbar/drawobjectbar" oor:op="replace">
<prop oor:name="DockPos" oor:type="xs:string"> <prop oor:name="DockPos" oor:type="xs:string">
<value>0,1</value> <value>0,1</value>
......
...@@ -103,6 +103,7 @@ modules/scalc/toolbar/arrowshapes.xml ...@@ -103,6 +103,7 @@ modules/scalc/toolbar/arrowshapes.xml
modules/scalc/toolbar/basicshapes.xml modules/scalc/toolbar/basicshapes.xml
modules/scalc/toolbar/calloutshapes.xml modules/scalc/toolbar/calloutshapes.xml
modules/scalc/toolbar/colorbar.xml modules/scalc/toolbar/colorbar.xml
modules/scalc/toolbar/datastreams.xml
modules/scalc/toolbar/drawbar.xml modules/scalc/toolbar/drawbar.xml
modules/scalc/toolbar/drawobjectbar.xml modules/scalc/toolbar/drawobjectbar.xml
modules/scalc/toolbar/extrusionobjectbar.xml modules/scalc/toolbar/extrusionobjectbar.xml
......
...@@ -29,6 +29,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/scalc,\ ...@@ -29,6 +29,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/scalc,\
sc/uiconfig/scalc/toolbar/basicshapes \ sc/uiconfig/scalc/toolbar/basicshapes \
sc/uiconfig/scalc/toolbar/calloutshapes \ sc/uiconfig/scalc/toolbar/calloutshapes \
sc/uiconfig/scalc/toolbar/colorbar \ sc/uiconfig/scalc/toolbar/colorbar \
sc/uiconfig/scalc/toolbar/datastreams \
sc/uiconfig/scalc/toolbar/drawbar \ sc/uiconfig/scalc/toolbar/drawbar \
sc/uiconfig/scalc/toolbar/drawobjectbar \ sc/uiconfig/scalc/toolbar/drawobjectbar \
sc/uiconfig/scalc/toolbar/extrusionobjectbar \ sc/uiconfig/scalc/toolbar/extrusionobjectbar \
......
...@@ -91,6 +91,8 @@ ...@@ -91,6 +91,8 @@
#define SID_SCFORMULAOPTIONS (SC_VIEW_START + 20) #define SID_SCFORMULAOPTIONS (SC_VIEW_START + 20)
#define SID_SCDEFAULTSOPTIONS (SC_VIEW_START + 21) #define SID_SCDEFAULTSOPTIONS (SC_VIEW_START + 21)
#define SID_DATA_STREAMS_PLAY (SC_VIEW_START + 33)
#define SID_DATA_STREAMS_STOP (SC_VIEW_START + 34)
#define SID_DATA_STREAMS (SC_VIEW_START + 35) #define SID_DATA_STREAMS (SC_VIEW_START + 35)
// slot-IDs for attributes // slot-IDs for attributes
......
...@@ -52,6 +52,8 @@ interface CellSelection ...@@ -52,6 +52,8 @@ interface CellSelection
SID_SBA_BRW_INSERT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] SID_SBA_BRW_INSERT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_SELECT_DB [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] SID_SELECT_DB [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_DATA_STREAMS [ ExecMethod = ExecuteDB; ] SID_DATA_STREAMS [ ExecMethod = ExecuteDB; ]
SID_DATA_STREAMS_PLAY [ ExecMethod = ExecuteDB; ]
SID_DATA_STREAMS_STOP [ ExecMethod = ExecuteDB; ]
SID_MANAGE_XML_SOURCE [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] SID_MANAGE_XML_SOURCE [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_SORT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] SID_SORT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_DATA_FORM [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] SID_DATA_FORM [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
......
...@@ -6148,6 +6148,52 @@ SfxVoidItem DataStreams SID_DATA_STREAMS ...@@ -6148,6 +6148,52 @@ SfxVoidItem DataStreams SID_DATA_STREAMS
GroupId = GID_DATA; GroupId = GID_DATA;
] ]
SfxVoidItem DataStreamsPlay SID_DATA_STREAMS_PLAY
[
/* flags: */
AutoUpdate = FALSE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = TRUE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
/* config: */
AccelConfig = TRUE,
MenuConfig = TRUE,
StatusBarConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_DATA;
]
SfxVoidItem DataStreamsStop SID_DATA_STREAMS_STOP
[
/* flags: */
AutoUpdate = FALSE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = TRUE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
/* config: */
AccelConfig = TRUE,
MenuConfig = TRUE,
StatusBarConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_DATA;
]
SfxVoidItem ManageXMLSource SID_MANAGE_XML_SOURCE SfxVoidItem ManageXMLSource SID_MANAGE_XML_SOURCE
(SfxStringItem DbName SID_MANAGE_XML_SOURCE) (SfxStringItem DbName SID_MANAGE_XML_SOURCE)
[ [
......
...@@ -43,13 +43,13 @@ public: ...@@ -43,13 +43,13 @@ public:
~DataStreams(); ~DataStreams();
bool ImportData(); bool ImportData();
void ShowDialog(Window *pParent); void ShowDialog(Window *pParent);
void Start();
void Stop();
private: private:
void MoveData(); void MoveData();
void Set(const OUString& rUrl, bool bIsScript, const OUString& rRange, void Set(const OUString& rUrl, bool bIsScript, const OUString& rRange,
sal_Int32 nLimit, MoveEnum eMove); sal_Int32 nLimit, MoveEnum eMove);
void Start();
void Stop();
}; };
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -57,6 +57,7 @@ DataStreams::DataStreams(ScDocShell *pScDocShell): ...@@ -57,6 +57,7 @@ DataStreams::DataStreams(ScDocShell *pScDocShell):
mpScDocShell(pScDocShell) mpScDocShell(pScDocShell)
, mpScDocument(mpScDocShell->GetDocument()) , mpScDocument(mpScDocShell->GetDocument())
, meMove(NO_MOVE) , meMove(NO_MOVE)
, mbRunning(false)
{ {
mxThread = new datastreams::CallerThread( this ); mxThread = new datastreams::CallerThread( this );
mxThread->launch(); mxThread->launch();
...@@ -73,6 +74,8 @@ DataStreams::~DataStreams() ...@@ -73,6 +74,8 @@ DataStreams::~DataStreams()
void DataStreams::Start() void DataStreams::Start()
{ {
if (mbRunning)
return;
mbIsUndoEnabled = mpScDocument->IsUndoEnabled(); mbIsUndoEnabled = mpScDocument->IsUndoEnabled();
mpScDocument->EnableUndo(false); mpScDocument->EnableUndo(false);
mbRunning = true; mbRunning = true;
...@@ -81,6 +84,8 @@ void DataStreams::Start() ...@@ -81,6 +84,8 @@ void DataStreams::Start()
void DataStreams::Stop() void DataStreams::Stop()
{ {
if (!mbRunning)
return;
mbRunning = false; mbRunning = false;
mpScDocument->EnableUndo(mbIsUndoEnabled); mpScDocument->EnableUndo(mbIsUndoEnabled);
} }
......
...@@ -20,7 +20,6 @@ class DataStreamsDlg : public ModalDialog ...@@ -20,7 +20,6 @@ class DataStreamsDlg : public ModalDialog
SvtURLBox* m_pCbUrl; SvtURLBox* m_pCbUrl;
PushButton* m_pBtnBrowse; PushButton* m_pBtnBrowse;
PushButton* m_pBtnStop;
RadioButton* m_pRBDirectData; RadioButton* m_pRBDirectData;
RadioButton* m_pRBScriptData; RadioButton* m_pRBScriptData;
RadioButton* m_pRBDataDown; RadioButton* m_pRBDataDown;
...@@ -34,7 +33,6 @@ class DataStreamsDlg : public ModalDialog ...@@ -34,7 +33,6 @@ class DataStreamsDlg : public ModalDialog
DECL_LINK(UpdateHdl, void *); DECL_LINK(UpdateHdl, void *);
DECL_LINK(BrowseHdl, void *); DECL_LINK(BrowseHdl, void *);
DECL_LINK(StopHdl, void *);
void UpdateEnable(); void UpdateEnable();
...@@ -50,7 +48,6 @@ DataStreamsDlg::DataStreamsDlg(DataStreams *pDataStreams, Window* pParent) ...@@ -50,7 +48,6 @@ DataStreamsDlg::DataStreamsDlg(DataStreams *pDataStreams, Window* pParent)
{ {
get(m_pCbUrl, "url"); get(m_pCbUrl, "url");
get(m_pBtnBrowse, "browse"); get(m_pBtnBrowse, "browse");
get(m_pBtnStop, "stop");
get(m_pRBDirectData, "directdata"); get(m_pRBDirectData, "directdata");
get(m_pRBScriptData, "scriptdata"); get(m_pRBScriptData, "scriptdata");
get(m_pRBDataDown, "datadown"); get(m_pRBDataDown, "datadown");
...@@ -65,7 +62,6 @@ DataStreamsDlg::DataStreamsDlg(DataStreams *pDataStreams, Window* pParent) ...@@ -65,7 +62,6 @@ DataStreamsDlg::DataStreamsDlg(DataStreams *pDataStreams, Window* pParent)
m_pCbUrl->SetSelectHdl( LINK( this, DataStreamsDlg, UpdateHdl ) ); m_pCbUrl->SetSelectHdl( LINK( this, DataStreamsDlg, UpdateHdl ) );
m_pEdRange->SetModifyHdl( LINK( this, DataStreamsDlg, UpdateHdl ) ); m_pEdRange->SetModifyHdl( LINK( this, DataStreamsDlg, UpdateHdl ) );
m_pBtnBrowse->SetClickHdl( LINK( this, DataStreamsDlg, BrowseHdl ) ); m_pBtnBrowse->SetClickHdl( LINK( this, DataStreamsDlg, BrowseHdl ) );
m_pBtnStop->SetClickHdl( LINK( this, DataStreamsDlg, StopHdl ) );
UpdateEnable(); UpdateEnable();
} }
...@@ -92,12 +88,6 @@ IMPL_LINK_NOARG(DataStreamsDlg, BrowseHdl) ...@@ -92,12 +88,6 @@ IMPL_LINK_NOARG(DataStreamsDlg, BrowseHdl)
return 0; return 0;
} }
IMPL_LINK_NOARG(DataStreamsDlg, StopHdl)
{
mpDataStreams->Stop();
return 0;
}
IMPL_LINK_NOARG(DataStreamsDlg, UpdateHdl) IMPL_LINK_NOARG(DataStreamsDlg, UpdateHdl)
{ {
UpdateEnable(); UpdateEnable();
......
...@@ -738,6 +738,14 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) ...@@ -738,6 +738,14 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
pImpl->m_pDataStreams = new DataStreams(GetViewData()->GetDocShell()); pImpl->m_pDataStreams = new DataStreams(GetViewData()->GetDocShell());
pImpl->m_pDataStreams->ShowDialog( pTabViewShell->GetDialogParent() ); pImpl->m_pDataStreams->ShowDialog( pTabViewShell->GetDialogParent() );
break; break;
case SID_DATA_STREAMS_PLAY:
if (pImpl->m_pDataStreams)
pImpl->m_pDataStreams->Start();
break;
case SID_DATA_STREAMS_STOP:
if (pImpl->m_pDataStreams)
pImpl->m_pDataStreams->Stop();
break;
case SID_MANAGE_XML_SOURCE: case SID_MANAGE_XML_SOURCE:
ExecuteXMLSourceDialog(); ExecuteXMLSourceDialog();
break; break;
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
<toolbar:toolbaritem xlink:href=".uno:DataStreamsPlay"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:DataStreamsStop"/>
</toolbar:toolbar>
...@@ -447,20 +447,6 @@ ...@@ -447,20 +447,6 @@
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkButton" id="stop">
<property name="label" translatable="yes">Stop</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -475,7 +461,6 @@ ...@@ -475,7 +461,6 @@
<action-widget response="0">ok</action-widget> <action-widget response="0">ok</action-widget>
<action-widget response="0">cancel</action-widget> <action-widget response="0">cancel</action-widget>
<action-widget response="0">help</action-widget> <action-widget response="0">help</action-widget>
<action-widget response="0">stop</action-widget>
</action-widgets> </action-widgets>
</object> </object>
<object class="GtkAdjustment" id="adjustment1"> <object class="GtkAdjustment" id="adjustment1">
......
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