Signal the SettingsDialog's window activation event down to ownCloudGui and Application,
so that other classes can hook in to get notified when the SettingsDialog is being shown
again.
This approach has been chosen because we otherwise would have to deal with new instance
pointers of the current SettingsWindow - but Application is already there ;-)
Purpose: The floating re-auth windows of the WebFlowCredentialsDialog often get hidden
behind the SettingsDialog, and the users have to minimize a lot of other windows to find
them again. This commit implements the preparation for the upcoming fix commit.
Signed-off-by: Michael Schuster <michael@schuster.ms>
// Cleanup at Quit.
connect(this, &QCoreApplication::aboutToQuit, this, &Application::slotCleanup);
+
+ // Allow other classes to hook into isShowingSettingsDialog() signals (re-auth widgets, for example)
+ connect(_gui.data(), &ownCloudGui::isShowingSettingsDialog, this, &Application::slotGuiIsShowingSettings);
}
Application::~Application()
_gui->slotShowSettings();
}
+void Application::slotGuiIsShowingSettings()
+{
+ emit isShowingSettingsDialog();
+}
} // namespace OCC
signals:
void folderRemoved();
void folderStateChanged(Folder *);
+ void isShowingSettingsDialog();
protected slots:
void slotParseMessage(const QString &, QObject *);
void slotAccountStateAdded(AccountState *accountState);
void slotAccountStateRemoved(AccountState *accountState);
void slotSystemOnlineConfigurationChanged(QNetworkConfiguration);
+ void slotGuiIsShowingSettings();
private:
void setHelp();
raiseDialog(_settingsDialog.data());
}
+void ownCloudGui::slotSettingsDialogActivated()
+{
+ emit isShowingSettingsDialog();
+}
+
void ownCloudGui::slotShowSyncProtocol()
{
slotShowSettings();
signals:
void setupProxy();
void serverError(int code, const QString &message);
+ void isShowingSettingsDialog();
public slots:
void setupContextMenu();
void slotToggleLogBrowser();
void slotOpenOwnCloud();
void slotOpenSettingsDialog();
+ void slotSettingsDialogActivated();
void slotHelp();
void slotOpenPath(const QString &path);
void slotAccountStateChanged();
connect(showLogWindow, &QAction::triggered, gui, &ownCloudGui::slotToggleLogBrowser);
addAction(showLogWindow);
+ connect(this, &SettingsDialog::onActivate, gui, &ownCloudGui::slotSettingsDialogActivated);
+
customizeStyle();
cfg.restoreGeometry(this);
// Notify the other widgets (Dark-/Light-Mode switching)
emit styleChanged();
break;
+ case QEvent::ActivationChange:
+ if(isActiveWindow())
+ emit onActivate();
+ break;
default:
break;
}
signals:
void styleChanged();
+ void onActivate();
protected:
void reject() override;