diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2013-11-12 19:58:29 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2013-11-13 10:34:48 +0100 |
commit | 4dc9dc6a53870217de8b9e0b9ac434fbf3a67440 (patch) | |
tree | 3a730ce4e24d5b6b4ce2f050eb07b7cf06439447 /sc | |
parent | 2c9450105b1543268dc565808ddbd76317a05446 (diff) |
datastreams: add toolbar buttons to stop / resume streaming
Change-Id: I601a4a174ea191c799623d29ed6eb229f9f372da
Diffstat (limited to 'sc')
-rw-r--r-- | sc/UIConfig_scalc.mk | 1 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 2 | ||||
-rw-r--r-- | sc/sdi/cellsh.sdi | 2 | ||||
-rw-r--r-- | sc/sdi/scalc.sdi | 46 | ||||
-rw-r--r-- | sc/source/ui/inc/datastreams.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/datastreams.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/datastreamsdlg.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh2.cxx | 8 | ||||
-rw-r--r-- | sc/uiconfig/scalc/toolbar/datastreams.xml | 14 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/datastreams.ui | 15 |
10 files changed, 80 insertions, 27 deletions
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index c18ee1eb67fc..23c49726e58b 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -29,6 +29,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/scalc,\ sc/uiconfig/scalc/toolbar/basicshapes \ sc/uiconfig/scalc/toolbar/calloutshapes \ sc/uiconfig/scalc/toolbar/colorbar \ + sc/uiconfig/scalc/toolbar/datastreams \ sc/uiconfig/scalc/toolbar/drawbar \ sc/uiconfig/scalc/toolbar/drawobjectbar \ sc/uiconfig/scalc/toolbar/extrusionobjectbar \ diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 021bbd285eaf..a7173958da10 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -91,6 +91,8 @@ #define SID_SCFORMULAOPTIONS (SC_VIEW_START + 20) #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) // slot-IDs for attributes diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 298e28c6c4d3..470e319d4198 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -52,6 +52,8 @@ interface CellSelection SID_SBA_BRW_INSERT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] SID_SELECT_DB [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] 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_SORT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] SID_DATA_FORM [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index e78ef95125e5..ec4fbc14eadf 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -6148,6 +6148,52 @@ SfxVoidItem DataStreams SID_DATA_STREAMS 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 (SfxStringItem DbName SID_MANAGE_XML_SOURCE) [ diff --git a/sc/source/ui/inc/datastreams.hxx b/sc/source/ui/inc/datastreams.hxx index d0af55047571..124ebefc5c35 100644 --- a/sc/source/ui/inc/datastreams.hxx +++ b/sc/source/ui/inc/datastreams.hxx @@ -43,13 +43,13 @@ public: ~DataStreams(); bool ImportData(); void ShowDialog(Window *pParent); + void Start(); + void Stop(); private: void MoveData(); void Set(const OUString& rUrl, bool bIsScript, const OUString& rRange, sal_Int32 nLimit, MoveEnum eMove); - void Start(); - void Stop(); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/datastreams.cxx b/sc/source/ui/miscdlgs/datastreams.cxx index 3a21566c88ff..1639dbc7512f 100644 --- a/sc/source/ui/miscdlgs/datastreams.cxx +++ b/sc/source/ui/miscdlgs/datastreams.cxx @@ -57,6 +57,7 @@ DataStreams::DataStreams(ScDocShell *pScDocShell): mpScDocShell(pScDocShell) , mpScDocument(mpScDocShell->GetDocument()) , meMove(NO_MOVE) + , mbRunning(false) { mxThread = new datastreams::CallerThread( this ); mxThread->launch(); @@ -73,6 +74,8 @@ DataStreams::~DataStreams() void DataStreams::Start() { + if (mbRunning) + return; mbIsUndoEnabled = mpScDocument->IsUndoEnabled(); mpScDocument->EnableUndo(false); mbRunning = true; @@ -81,6 +84,8 @@ void DataStreams::Start() void DataStreams::Stop() { + if (!mbRunning) + return; mbRunning = false; mpScDocument->EnableUndo(mbIsUndoEnabled); } diff --git a/sc/source/ui/miscdlgs/datastreamsdlg.cxx b/sc/source/ui/miscdlgs/datastreamsdlg.cxx index b2f5d275bd80..1fa07afd8675 100644 --- a/sc/source/ui/miscdlgs/datastreamsdlg.cxx +++ b/sc/source/ui/miscdlgs/datastreamsdlg.cxx @@ -20,7 +20,6 @@ class DataStreamsDlg : public ModalDialog SvtURLBox* m_pCbUrl; PushButton* m_pBtnBrowse; - PushButton* m_pBtnStop; RadioButton* m_pRBDirectData; RadioButton* m_pRBScriptData; RadioButton* m_pRBDataDown; @@ -34,7 +33,6 @@ class DataStreamsDlg : public ModalDialog DECL_LINK(UpdateHdl, void *); DECL_LINK(BrowseHdl, void *); - DECL_LINK(StopHdl, void *); void UpdateEnable(); @@ -50,7 +48,6 @@ DataStreamsDlg::DataStreamsDlg(DataStreams *pDataStreams, Window* pParent) { get(m_pCbUrl, "url"); get(m_pBtnBrowse, "browse"); - get(m_pBtnStop, "stop"); get(m_pRBDirectData, "directdata"); get(m_pRBScriptData, "scriptdata"); get(m_pRBDataDown, "datadown"); @@ -65,7 +62,6 @@ DataStreamsDlg::DataStreamsDlg(DataStreams *pDataStreams, Window* pParent) m_pCbUrl->SetSelectHdl( LINK( this, DataStreamsDlg, UpdateHdl ) ); m_pEdRange->SetModifyHdl( LINK( this, DataStreamsDlg, UpdateHdl ) ); m_pBtnBrowse->SetClickHdl( LINK( this, DataStreamsDlg, BrowseHdl ) ); - m_pBtnStop->SetClickHdl( LINK( this, DataStreamsDlg, StopHdl ) ); UpdateEnable(); } @@ -92,12 +88,6 @@ IMPL_LINK_NOARG(DataStreamsDlg, BrowseHdl) return 0; } -IMPL_LINK_NOARG(DataStreamsDlg, StopHdl) -{ - mpDataStreams->Stop(); - return 0; -} - IMPL_LINK_NOARG(DataStreamsDlg, UpdateHdl) { UpdateEnable(); diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index b5d4bf7a84c8..4450bd9437f7 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -738,6 +738,14 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) pImpl->m_pDataStreams = new DataStreams(GetViewData()->GetDocShell()); pImpl->m_pDataStreams->ShowDialog( pTabViewShell->GetDialogParent() ); 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: ExecuteXMLSourceDialog(); break; diff --git a/sc/uiconfig/scalc/toolbar/datastreams.xml b/sc/uiconfig/scalc/toolbar/datastreams.xml new file mode 100644 index 000000000000..dd3a5e4a1e96 --- /dev/null +++ b/sc/uiconfig/scalc/toolbar/datastreams.xml @@ -0,0 +1,14 @@ +<?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> diff --git a/sc/uiconfig/scalc/ui/datastreams.ui b/sc/uiconfig/scalc/ui/datastreams.ui index de211ec8b321..12282f82cfe5 100644 --- a/sc/uiconfig/scalc/ui/datastreams.ui +++ b/sc/uiconfig/scalc/ui/datastreams.ui @@ -447,20 +447,6 @@ <property name="position">2</property> </packing> </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> <packing> <property name="expand">False</property> @@ -475,7 +461,6 @@ <action-widget response="0">ok</action-widget> <action-widget response="0">cancel</action-widget> <action-widget response="0">help</action-widget> - <action-widget response="0">stop</action-widget> </action-widgets> </object> <object class="GtkAdjustment" id="adjustment1"> |