mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
Show "loading" indicator when loading from backend is requested
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user