Show Ubuntu One settings page if user is not signed in.

This commit is contained in:
John Maguire 2012-11-28 15:09:59 +01:00
parent 6486e621f1
commit 4aeeb45eaa
2 changed files with 7 additions and 9 deletions

View File

@ -87,16 +87,9 @@ void UbuntuOneService::Connect() {
token_secret_ = s.value("token_secret").toString();
RequestFileList("/~/Ubuntu One");
return;
} else {
ShowSettingsDialog();
}
UbuntuOneAuthenticator* authenticator = new UbuntuOneAuthenticator;
authenticator->StartAuthorisation(
"Username",
"Password");
NewClosure(authenticator, SIGNAL(Finished()),
this, SLOT(AuthenticationFinished(UbuntuOneAuthenticator*)),
authenticator);
}
QByteArray UbuntuOneService::GenerateAuthorisationHeader() {
@ -212,3 +205,7 @@ QUrl UbuntuOneService::GetStreamingUrlFromSongId(const QString& song_id) {
url.setFragment(GenerateAuthorisationHeader());
return url;
}
void UbuntuOneService::ShowSettingsDialog() {
app_->OpenSettingsDialogAtPage(SettingsDialog::Page_UbuntuOne);
}

View File

@ -36,6 +36,7 @@ class UbuntuOneService : public InternetService {
void Connect();
void RequestFileList(const QString& path);
void MaybeAddFileToDatabase(const QVariantMap& file);
void ShowSettingsDialog();
private:
QByteArray GenerateAuthorisationHeader();