Kaydet (Commit) 447ecc3c authored tarafından Markus Mohrhard's avatar Markus Mohrhard

external data: add a menu entry to refresh the data

Change-Id: I1942488d518be91c3ad03f91d98834e22bfdfb16
Reviewed-on: https://gerrit.libreoffice.org/41339Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 257fb114
......@@ -1590,6 +1590,11 @@
<value xml:lang="en-US">Data Provider...</value>
</prop>
</node>
<node oor:name=".uno:DataProviderRefresh" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Refresh Data Provider</value>
</prop>
</node>
<node oor:name=".uno:ManageXMLSource" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~XML Source...</value>
......
......@@ -85,7 +85,8 @@
#define SID_SCDEFAULTSOPTIONS (SC_VIEW_START + 21)
#define SID_DATA_PROVIDER (SC_VIEW_START + 32)
#define SID_DATA_PROVIDER (SC_VIEW_START + 31)
#define SID_DATA_PROVIDER_REFRESH (SC_VIEW_START + 32)
#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)
......
......@@ -49,6 +49,7 @@ interface CellSelection
SID_DATA_STREAMS_PLAY [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_DATA_STREAMS_STOP [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_DATA_PROVIDER [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_DATA_PROVIDER_REFRESH [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_MANAGE_XML_SOURCE [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_SORT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
SID_DATA_FORM [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
......
......@@ -4472,7 +4472,24 @@ SfxVoidItem DataProvider SID_DATA_PROVIDER
[
AutoUpdate = FALSE,
FastCall = FALSE,
ReadOnlyDoc = TRUE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
AccelConfig = TRUE,
MenuConfig = TRUE,
ToolBoxConfig = FALSE,
GroupId = SfxGroupId::Data;
]
SfxVoidItem DataProviderRefresh SID_DATA_PROVIDER_REFRESH
()
[
AutoUpdate = FALSE,
FastCall = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
......
......@@ -55,6 +55,7 @@
#include "validat.hxx"
#include "validate.hxx"
#include "scresid.hxx"
#include "datamapper.hxx"
#include "scui_def.hxx"
#include "scabstdlg.hxx"
......@@ -788,6 +789,16 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
}
}
break;
case SID_DATA_PROVIDER_REFRESH:
{
ScDocument* pDoc = GetViewData()->GetDocument();
auto& rDataMapper = pDoc->GetExternalDataMapper();
for (auto& rDataSource : rDataMapper.getDataSources())
{
rDataSource.refresh(pDoc, false);
}
}
break;
case SID_MANAGE_XML_SOURCE:
ExecuteXMLSourceDialog();
break;
......@@ -1196,6 +1207,14 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
break;
case SID_DATA_PROVIDER:
break;
case SID_DATA_PROVIDER_REFRESH:
{
ScDocument* pDoc = GetViewData()->GetDocument();
auto& rDataMapper = pDoc->GetExternalDataMapper();
if (rDataMapper.getDataSources().empty())
rSet.DisableItem(nWhich);
}
break;
case SID_DATA_STREAMS:
case SID_DATA_STREAMS_PLAY:
case SID_DATA_STREAMS_STOP:
......
......@@ -631,6 +631,7 @@
<menu:menuitem menu:id=".uno:DataStreams"/>
<menu:menuitem menu:id=".uno:ManageXMLSource"/>
<menu:menuitem menu:id=".uno:DataProvider"/>
<menu:menuitem menu:id=".uno:DataProviderRefresh"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:TableOperationDialog"/>
<menu:menuitem menu:id=".uno:TextToColumns"/>
......
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