Show "loading" indicator when loading from backend is requested

This commit is contained in:
Klaus Basan
2016-10-18 04:36:50 +02:00
parent b8d323226f
commit 5ac701274b
2 changed files with 20 additions and 2 deletions

View File

@@ -235,8 +235,8 @@ namespace BlackGui
CMenuActions ma;
switch (menu)
{
case MenuRefresh: { ma.addAction(BlackMisc::CIcons::refresh16(), "Update", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::requestUpdate }); break; }
case MenuBackend: { ma.addAction(BlackMisc::CIcons::refresh16(), "Reload from backend", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::requestNewBackendData}); break; }
case MenuRefresh: { ma.addAction(BlackMisc::CIcons::refresh16(), "Update", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::ps_triggerReload }); break; }
case MenuBackend: { ma.addAction(BlackMisc::CIcons::refresh16(), "Reload from backend", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::ps_triggerReloadFromBackend }); break; }
case MenuDisplayAutomatically:
{
QAction *a = ma.addAction(CIcons::appMappings16(), "Automatically display (when loaded)", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::ps_toggleAutoDisplay });
@@ -488,6 +488,18 @@ namespace BlackGui
this->ps_saveJson();
}
void CViewBaseNonTemplate::ps_triggerReload()
{
this->showLoadIndicator();
emit this->requestUpdate();
}
void CViewBaseNonTemplate::ps_triggerReloadFromBackend()
{
this->showLoadIndicator();
emit this->requestNewBackendData();
}
void CViewBaseNonTemplate::onModelChanged()
{
this->updateSortIndicator();

View File

@@ -438,6 +438,12 @@ namespace BlackGui
//! Save JSON for action/menu, no return signatur
void ps_saveJsonAction();
//! Trigger reload from backend by signal requestUpdate();
void ps_triggerReload();
//! Trigger reload from backend by signal requestNewBackendData()
void ps_triggerReloadFromBackend();
// ------------ slots of CViewDbObjects ----------------
// need to be declared here and overridden, as this is the only part with valid Q_OBJECT