mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 19:31:02 +01:00
Disable the google drive login button after starting the browser, re-enable it again when the user comes back to the Clementine window.
This commit is contained in:
parent
7ca7ecbe99
commit
78d473512d
@ -36,6 +36,8 @@ GoogleDriveSettingsPage::GoogleDriveSettingsPage(SettingsDialog* parent)
|
|||||||
connect(ui_->login_button, SIGNAL(clicked()), SLOT(LoginClicked()));
|
connect(ui_->login_button, SIGNAL(clicked()), SLOT(LoginClicked()));
|
||||||
connect(ui_->login_state, SIGNAL(LogoutClicked()), SLOT(LogoutClicked()));
|
connect(ui_->login_state, SIGNAL(LogoutClicked()), SLOT(LogoutClicked()));
|
||||||
connect(service_, SIGNAL(Connected()), SLOT(Connected()));
|
connect(service_, SIGNAL(Connected()), SLOT(Connected()));
|
||||||
|
|
||||||
|
dialog()->installEventFilter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
GoogleDriveSettingsPage::~GoogleDriveSettingsPage() {
|
GoogleDriveSettingsPage::~GoogleDriveSettingsPage() {
|
||||||
@ -60,6 +62,16 @@ void GoogleDriveSettingsPage::Save() {
|
|||||||
|
|
||||||
void GoogleDriveSettingsPage::LoginClicked() {
|
void GoogleDriveSettingsPage::LoginClicked() {
|
||||||
service_->Connect();
|
service_->Connect();
|
||||||
|
ui_->login_button->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GoogleDriveSettingsPage::eventFilter(QObject* object, QEvent* event) {
|
||||||
|
if (object == dialog() && event->type() == QEvent::Enter) {
|
||||||
|
ui_->login_button->setEnabled(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SettingsPage::eventFilter(object, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoogleDriveSettingsPage::LogoutClicked() {
|
void GoogleDriveSettingsPage::LogoutClicked() {
|
||||||
|
@ -38,6 +38,9 @@ public:
|
|||||||
void Load();
|
void Load();
|
||||||
void Save();
|
void Save();
|
||||||
|
|
||||||
|
// QObject
|
||||||
|
bool eventFilter(QObject* object, QEvent* event);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void LoginClicked();
|
void LoginClicked();
|
||||||
void LogoutClicked();
|
void LogoutClicked();
|
||||||
|
Loading…
Reference in New Issue
Block a user