Skip to content

Commit 665d41b

Browse files
authored
Merge pull request #9801 from nextcloud/bugfix/noid/wizard-url-palette
fix(gui): use native QLineEdit styling for server address
2 parents 4a46ae6 + 9e6b54c commit 665d41b

File tree

7 files changed

+8
-154
lines changed

7 files changed

+8
-154
lines changed

src/gui/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ set(client_SRCS
225225
creds/webflowcredentials.cpp
226226
creds/webflowcredentialsdialog.h
227227
creds/webflowcredentialsdialog.cpp
228-
wizard/postfixlineedit.h
229-
wizard/postfixlineedit.cpp
230228
wizard/abstractcredswizardpage.h
231229
wizard/abstractcredswizardpage.cpp
232230
wizard/owncloudadvancedsetuppage.h

src/gui/wizard/owncloudsetupnocredspage.ui

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@
231231
<number>0</number>
232232
</property>
233233
<item>
234-
<widget class="OCC::PostfixLineEdit" name="leUrl">
234+
<widget class="QLineEdit" name="leUrl">
235235
<property name="sizePolicy">
236236
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
237237
<horstretch>0</horstretch>
@@ -365,13 +365,6 @@
365365
</item>
366366
</layout>
367367
</widget>
368-
<customwidgets>
369-
<customwidget>
370-
<class>OCC::PostfixLineEdit</class>
371-
<extends>QLineEdit</extends>
372-
<header>wizard/postfixlineedit.h</header>
373-
</customwidget>
374-
</customwidgets>
375368
<resources/>
376369
<connections/>
377370
</ui>

src/gui/wizard/owncloudsetuppage.cpp

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ OwncloudSetupPage::OwncloudSetupPage(QWidget *parent)
4444
const auto theme = Theme::instance();
4545
if (theme->overrideServerUrl().isEmpty()) {
4646
_ui.comboBox->hide();
47-
_ui.leUrl->setPostfix(theme->wizardUrlPostfix());
4847
_ui.leUrl->setPlaceholderText(theme->wizardUrlHint());
4948
} else if (theme->multipleOverrideServers() && theme->forceOverrideServerUrl()) {
5049
_ui.leUrl->hide();
@@ -156,11 +155,6 @@ void OwncloudSetupPage::setupCustomization()
156155

157156
variant = theme->customMedia(Theme::oCSetupBottom);
158157
WizardCommon::setupCustomMedia(variant, _ui.bottomLabel);
159-
160-
auto leUrlPalette = _ui.leUrl->palette();
161-
leUrlPalette.setColor(QPalette::Text, Qt::black);
162-
leUrlPalette.setColor(QPalette::Base, Qt::white);
163-
_ui.leUrl->setPalette(leUrlPalette);
164158
}
165159

166160
// slot hit from textChanged of the url entry field.
@@ -195,27 +189,27 @@ void OwncloudSetupPage::slotUrlChanged(const QString &url)
195189
if (newUrl != url) {
196190
_ui.leUrl->setText(newUrl);
197191
}
198-
setProxySettingsButtonEnabled(!_ui.leUrl->fullText().isEmpty());
192+
setProxySettingsButtonEnabled(!_ui.leUrl->text().isEmpty());
199193
}
200194

201195
void OwncloudSetupPage::slotUrlEditFinished()
202196
{
203-
QString url = _ui.leUrl->fullText();
197+
QString url = _ui.leUrl->text();
204198
if (QUrl(url).isRelative() && !url.isEmpty()) {
205199
// no scheme defined, set one
206200
url.prepend("https://");
207-
_ui.leUrl->setFullText(url);
201+
_ui.leUrl->setText(url);
208202
}
209203
}
210204

211205
void OwncloudSetupPage::slotSetProxySettings()
212206
{
213207
if (!_proxySettingsDialog) {
214-
_proxySettingsDialog = new WizardProxySettingsDialog{QUrl::fromUserInput(_ui.leUrl->fullText()), _proxySettings, this};
208+
_proxySettingsDialog = new WizardProxySettingsDialog{QUrl::fromUserInput(_ui.leUrl->text()), _proxySettings, this};
215209

216210
connect(_proxySettingsDialog, &WizardProxySettingsDialog::proxySettingsAccepted, this, [this] (const OCC::WizardProxySettingsDialog::WizardProxySettings &proxySettings) { _proxySettings = proxySettings;});
217211
} else {
218-
_proxySettingsDialog->setServerUrl(QUrl::fromUserInput(_ui.leUrl->fullText()));
212+
_proxySettingsDialog->setServerUrl(QUrl::fromUserInput(_ui.leUrl->text()));
219213
_proxySettingsDialog->setProxySettings(_proxySettings);
220214
}
221215

@@ -306,7 +300,7 @@ QString OwncloudSetupPage::url() const
306300
if (theme->multipleOverrideServers() && theme->forceOverrideServerUrl()) {
307301
return _ui.comboBox->currentData().toString();
308302
} else {
309-
return _ui.leUrl->fullText().simplified();
303+
return _ui.leUrl->text().simplified();
310304
}
311305
}
312306

@@ -365,7 +359,7 @@ void OwncloudSetupPage::setErrorString(const QString &err, bool retryHTTPonly)
365359
switch (retVal) {
366360
case OwncloudConnectionMethodDialog::No_TLS: {
367361
url.setScheme("http");
368-
_ui.leUrl->setFullText(url.toString());
362+
_ui.leUrl->setText(url.toString());
369363
// skip ahead to next page, since the user would expect us to retry automatically
370364
wizard()->next();
371365
} break;

src/gui/wizard/postfixlineedit.cpp

Lines changed: 0 additions & 69 deletions
This file was deleted.

src/gui/wizard/postfixlineedit.h

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/libsync/theme.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -875,12 +875,6 @@ QString Theme::userIDHint() const
875875
return QString();
876876
}
877877

878-
879-
QString Theme::wizardUrlPostfix() const
880-
{
881-
return QString();
882-
}
883-
884878
QString Theme::wizardUrlHint() const
885879
{
886880
return QString();

src/libsync/theme.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -472,14 +472,6 @@ class OWNCLOUDSYNC_EXPORT Theme : public QObject
472472
*/
473473
[[nodiscard]] QString userIDHint() const;
474474

475-
/**
476-
* @brief Postfix that will be enforced in a URL. e.g.
477-
* ".myhosting.com".
478-
*
479-
* @return An empty string, unless reimplemented
480-
*/
481-
[[nodiscard]] QString wizardUrlPostfix() const;
482-
483475
/**
484476
* @brief String that will be shown as long as no text has been entered by the user.
485477
*

0 commit comments

Comments
 (0)