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_state, SIGNAL(LogoutClicked()), SLOT(LogoutClicked()));
|
||||
connect(service_, SIGNAL(Connected()), SLOT(Connected()));
|
||||
|
||||
dialog()->installEventFilter(this);
|
||||
}
|
||||
|
||||
GoogleDriveSettingsPage::~GoogleDriveSettingsPage() {
|
||||
|
@ -60,6 +62,16 @@ void GoogleDriveSettingsPage::Save() {
|
|||
|
||||
void GoogleDriveSettingsPage::LoginClicked() {
|
||||
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() {
|
||||
|
|
|
@ -38,6 +38,9 @@ public:
|
|||
void Load();
|
||||
void Save();
|
||||
|
||||
// QObject
|
||||
bool eventFilter(QObject* object, QEvent* event);
|
||||
|
||||
private slots:
|
||||
void LoginClicked();
|
||||
void LogoutClicked();
|
||||
|
|
Loading…
Reference in New Issue