mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
Preferences: correctly hook up the signals to enable/disable cloud storage
This way the menu state matches the actual verification state again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
77d7e773b9
commit
111a153295
4 changed files with 11 additions and 5 deletions
|
@ -1244,6 +1244,9 @@ void MainWindow::readSettings()
|
|||
}
|
||||
QNetworkProxy::setApplicationProxy(proxy);
|
||||
|
||||
// now make sure that the cloud menu items are enabled IFF cloud account is verified
|
||||
enableDisableCloudActions();
|
||||
|
||||
#if !defined(SUBSURFACE_MOBILE)
|
||||
loadRecentFiles(&s);
|
||||
if (firstRun) {
|
||||
|
|
|
@ -19,6 +19,9 @@ public:
|
|||
/* gets the values from the interface and set in the preferences object. */
|
||||
virtual void syncSettings() = 0;
|
||||
|
||||
signals:
|
||||
void settingsChanged();
|
||||
|
||||
private:
|
||||
QIcon _icon;
|
||||
QString _name;
|
||||
|
|
|
@ -96,7 +96,7 @@ void PreferencesNetwork::syncSettings()
|
|||
report_error(qPrintable(tr("Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'.")));
|
||||
} else {
|
||||
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
|
||||
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(cloudPinNeeded()));
|
||||
connect(cloudAuth, &CloudStorageAuthenticate::finishedAuthenticate, this, &PreferencesNetwork::cloudPinNeeded);
|
||||
cloudAuth->backend(email, password);
|
||||
}
|
||||
}
|
||||
|
@ -146,8 +146,7 @@ void PreferencesNetwork::cloudPinNeeded()
|
|||
} else {
|
||||
ui->cloudStorageGroupBox->setTitle(tr("Subsurface cloud storage"));
|
||||
}
|
||||
//TODO: Do not call mainWindow here. Verify things on SettingsChanged.
|
||||
//MainWindow::instance()->enableDisableCloudActions();
|
||||
emit settingsChanged();
|
||||
}
|
||||
|
||||
void PreferencesNetwork::proxyType_changed(int idx)
|
||||
|
|
|
@ -121,6 +121,7 @@ void PreferencesDialog::refreshPages()
|
|||
void PreferencesDialog::applyRequested(bool closeIt)
|
||||
{
|
||||
Q_FOREACH(AbstractPreferencesWidget *page, pages) {
|
||||
connect(page, &AbstractPreferencesWidget::settingsChanged, this, &PreferencesDialog::settingsChanged, Qt::UniqueConnection);
|
||||
page->syncSettings();
|
||||
}
|
||||
emit settingsChanged();
|
||||
|
|
Loading…
Add table
Reference in a new issue