mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 00:45:46 +08:00
Show "loading" indicator when loading from backend is requested
This commit is contained in:
@@ -235,8 +235,8 @@ namespace BlackGui
|
|||||||
CMenuActions ma;
|
CMenuActions ma;
|
||||||
switch (menu)
|
switch (menu)
|
||||||
{
|
{
|
||||||
case MenuRefresh: { ma.addAction(BlackMisc::CIcons::refresh16(), "Update", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::requestUpdate }); 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::requestNewBackendData}); break; }
|
case MenuBackend: { ma.addAction(BlackMisc::CIcons::refresh16(), "Reload from backend", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::ps_triggerReloadFromBackend }); break; }
|
||||||
case MenuDisplayAutomatically:
|
case MenuDisplayAutomatically:
|
||||||
{
|
{
|
||||||
QAction *a = ma.addAction(CIcons::appMappings16(), "Automatically display (when loaded)", CMenuAction::pathViewUpdates(), { this, &CViewBaseNonTemplate::ps_toggleAutoDisplay });
|
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();
|
this->ps_saveJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CViewBaseNonTemplate::ps_triggerReload()
|
||||||
|
{
|
||||||
|
this->showLoadIndicator();
|
||||||
|
emit this->requestUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CViewBaseNonTemplate::ps_triggerReloadFromBackend()
|
||||||
|
{
|
||||||
|
this->showLoadIndicator();
|
||||||
|
emit this->requestNewBackendData();
|
||||||
|
}
|
||||||
|
|
||||||
void CViewBaseNonTemplate::onModelChanged()
|
void CViewBaseNonTemplate::onModelChanged()
|
||||||
{
|
{
|
||||||
this->updateSortIndicator();
|
this->updateSortIndicator();
|
||||||
|
|||||||
@@ -438,6 +438,12 @@ namespace BlackGui
|
|||||||
//! Save JSON for action/menu, no return signatur
|
//! Save JSON for action/menu, no return signatur
|
||||||
void ps_saveJsonAction();
|
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 ----------------
|
// ------------ slots of CViewDbObjects ----------------
|
||||||
// need to be declared here and overridden, as this is the only part with valid Q_OBJECT
|
// need to be declared here and overridden, as this is the only part with valid Q_OBJECT
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user