Show URL placeholder hint in wizard
authorStephan Beyer <s-beyer@gmx.net>
Sat, 23 May 2020 16:12:58 +0000 (18:12 +0200)
committerStephan Beyer <s-beyer@gmx.net>
Sat, 23 May 2020 16:32:15 +0000 (18:32 +0200)
In owncloudsetupnocredspage.ui, the URL input field leUrl has a
placeholder text saying "https://..." which is a very useful hint
for the user.  However, in the OwncloudSetupPage constructor, the
placeholer text is overwritten by the return string of the theme's
wizardUrlHint() method.  The NextcloudTheme class does not override
this virtual method, so an empty string is used.

To make available the "https://..." hint, it is moved from the
UI file to NextcloudTheme::wizardUrlHint().  Note that, if a
theme is used which does not allow a custom server URL, the
placeholder text is now empty.  This makes sense because the
input field is disabled in that case.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
src/gui/wizard/owncloudsetupnocredspage.ui
src/libsync/nextcloudtheme.cpp
src/libsync/nextcloudtheme.h

index 32995ba1126631664e7a557d1f916786ee7c5707..1644d93f9026337a81b38a6139436c9f60800e23 100644 (file)
                </sizepolicy>
               </property>
               <property name="placeholderText">
-               <string notr="true">https://...</string>
+               <string notr="true"/>
               </property>
              </widget>
             </item>
index a3fdbb31a0b4806253b1df6a78e39874adff8bd2..6687d6290aed7081e3b4b310d1f843642eeff1f6 100644 (file)
@@ -33,4 +33,9 @@ NextcloudTheme::NextcloudTheme()
 {
 }
 
+QString NextcloudTheme::wizardUrlHint() const
+{
+    return QString("https://...");
+}
+
 }
index 4c8dfe9981253bf7455b6655e0eb575af8984172..f7c215b8f784a966becfe6f3d109a8cf49ddb486 100644 (file)
@@ -29,6 +29,7 @@ class NextcloudTheme : public Theme
 public:
     NextcloudTheme();
 
+    QString wizardUrlHint() const override;
 };
 }
 #endif // NEXTCLOUD_THEME_H