Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix closed account wizard being brought up when clicking tray icon #7488

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/gui/owncloudsetupwizard.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/gui/owncloudsetupwizard.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/gui/owncloudsetupwizard.cpp

File src/gui/owncloudsetupwizard.cpp does not conform to Custom style guidelines. (lines 88)
* Copyright (C) by Klaas Freitag <[email protected]>
* Copyright (C) by Krzesimir Nowak <[email protected]>
*
Expand All @@ -13,7 +13,7 @@
* for more details.
*/

#include <QAbstractButton>

Check failure on line 16 in src/gui/owncloudsetupwizard.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/owncloudsetupwizard.cpp:16:10 [clang-diagnostic-error]

'QAbstractButton' file not found
#include <QtCore>
#include <QProcess>
#include <QMessageBox>
Expand Down Expand Up @@ -85,6 +85,7 @@

wiz = new OwncloudSetupWizard(parent);
connect(wiz, SIGNAL(ownCloudWizardDone(int)), obj, amember);
connect(wiz->_ocWizard, &OwncloudWizard::wizardClosed, obj, [] { wiz.clear(); });
FolderMan::instance()->setSyncEnabled(false);
wiz->startWizard();
}
Expand Down
15 changes: 15 additions & 0 deletions src/gui/wizard/owncloudwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* for more details.
*/

#include "account.h"

Check failure on line 16 in src/gui/wizard/owncloudwizard.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/wizard/owncloudwizard.cpp:16:10 [clang-diagnostic-error]

'account.h' file not found
#include "config.h"
#include "configfile.h"
#include "theme.h"
Expand Down Expand Up @@ -408,6 +408,21 @@
QWizard::changeEvent(e);
}

void OwncloudWizard::hideEvent(QHideEvent *event)
{
QWizard::hideEvent(event);
#ifdef Q_OS_MACOS
// Closing the window on macOS hides it rather than closes it, so emit a wizardClosed here
emit wizardClosed();
#endif
}

void OwncloudWizard::closeEvent(QCloseEvent *event)
{
emit wizardClosed();
QWizard::closeEvent(event);
}

void OwncloudWizard::customizeStyle()
{
// HINT: Customize wizard's own style here, if necessary in the future (Dark-/Light-Mode switching)
Expand Down
3 changes: 3 additions & 0 deletions src/gui/wizard/owncloudwizard.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef MIRALL_OWNCLOUD_WIZARD_H
#define MIRALL_OWNCLOUD_WIZARD_H

#include <QWizard>

Check failure on line 19 in src/gui/wizard/owncloudwizard.h

View workflow job for this annotation

GitHub Actions / build

src/gui/wizard/owncloudwizard.h:19:10 [clang-diagnostic-error]

'QWizard' file not found
#include <QLoggingCategory>
#include <QSslKey>
#include <QSslCertificate>
Expand Down Expand Up @@ -110,9 +110,12 @@
void needCertificate();
void styleChanged();
void onActivate();
void wizardClosed();

protected:
void changeEvent(QEvent *) override;
void hideEvent(QHideEvent *) override;
void closeEvent(QCloseEvent *) override;

private:
void customizeStyle();
Expand Down
Loading