diff --git a/src/gui/wizard/owncloudhttpcredspage.cpp b/src/gui/wizard/owncloudhttpcredspage.cpp index 30d83917d..046c1fe32 100644 --- a/src/gui/wizard/owncloudhttpcredspage.cpp +++ b/src/gui/wizard/owncloudhttpcredspage.cpp @@ -42,6 +42,22 @@ OwncloudHttpCredsPage::OwncloudHttpCredsPage(QWidget* parent) registerField( QLatin1String("OCUser*"), _ui.leUsername); registerField( QLatin1String("OCPasswd*"), _ui.lePassword); + Theme *theme = Theme::instance(); + switch(theme->userIDType()) { + case Theme::UserIDUserName: + // default, handled in ui file + break; + case Theme::UserIDEmail: + _ui.usernameLabel->setText(tr("&E-mail address")); + break; + case Theme::UserIDCustom: + _ui.usernameLabel->setText(theme->customUserID()); + break; + default: + break; + } + _ui.leUsername->setPlaceholderText(theme->userIDHint()); + setTitle(WizardCommon::titleTemplate().arg(tr("Connect to %1").arg(Theme::instance()->appNameGUI()))); setSubTitle(WizardCommon::subTitleTemplate().arg(tr("Enter user credentials"))); diff --git a/src/gui/wizard/owncloudhttpcredspage.ui b/src/gui/wizard/owncloudhttpcredspage.ui index 58bddddae..2f3bbe5c0 100644 --- a/src/gui/wizard/owncloudhttpcredspage.ui +++ b/src/gui/wizard/owncloudhttpcredspage.ui @@ -33,7 +33,7 @@ - + &Username @@ -127,8 +127,6 @@ - topLabel - bottomLabel diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index ff2cce97a..c73f5395b 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -432,6 +432,21 @@ bool Theme::forceSystemNetworkProxy() const return false; } +Theme::UserIDType Theme::userIDType() const +{ + return UserIDType::UserIDUserName; +} + +QString Theme::customUserID() const +{ + return QString(); +} + +QString Theme::userIDHint() const +{ + return QString(); +} + } // end namespace client diff --git a/src/libsync/theme.h b/src/libsync/theme.h index d93fcb16d..db36bb1ad 100644 --- a/src/libsync/theme.h +++ b/src/libsync/theme.h @@ -239,6 +239,39 @@ public: virtual bool forceSystemNetworkProxy() const; + /** + * @brief How to handle the userID + * + * @value UserIDUserName Wizard asks for user name as ID + * @value UserIDEmail Wizard asks for an email as ID + * @value UserIDCustom Specify string in \ref customUserID + */ + enum UserIDType { UserIDUserName = 0, UserIDEmail, UserIDCustom }; + + /** @brief What to display as the userID (e.g. in the wizards) + * + * @return UserIDType::UserIDUserName, unless reimplemented + */ + virtual UserIDType userIDType() const; + + /** + * @brief Allows to customize the type of user ID (e.g. user name, email) + * + * @note This string cannot be translated, but is still useful for + * referencing brand name IDs (e.g. "ACME ID", when using ACME.) + * + * @return An empty string, unless reimplemented + */ + virtual QString customUserID() const; + + /** + * @brief Demo string to be displayed when no text has been + * entered for the user id (e.g. mylogin@company.com) + * + * @return An empty string, unless reimplemented + */ + virtual QString userIDHint() const; + protected: #ifndef TOKEN_AUTH_ONLY QIcon themeIcon(const QString& name, bool sysTray = false) const;