Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Owncloud client wizard setup page doesn't handle back button presses. #3

Merged
merged 4 commits into from
Sep 14, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/mirall/owncloudwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ void setupCustomMedia( QVariant variant, QLabel *label )
OwncloudSetupPage::OwncloudSetupPage()
{
_ui.setupUi(this);

connect(_ui.leUrl, SIGNAL(textChanged(QString)), SLOT(handleNewOcUrl(QString)));

registerField( QLatin1String("OCUrl"), _ui.leUrl );
registerField( QLatin1String("OCUser"), _ui.leUsername );
registerField( QLatin1String("OCPasswd"), _ui.lePassword);
Expand Down Expand Up @@ -147,6 +150,21 @@ void OwncloudSetupPage::slotSecureConChanged( int state )
}
}

void OwncloudSetupPage::handleNewOcUrl(const QString& ocUrl)
{
QUrl url(ocUrl);

QString urlMinusScheme = url.toString(QUrl::RemoveScheme);

// QUrl::RemoveScheme leaves the beginning slashes. Remove them
// if they're present.
if (urlMinusScheme.startsWith("//")) {
urlMinusScheme.remove(0, 2);
}

_ui.leUrl->setText(urlMinusScheme);
}

bool OwncloudSetupPage::isComplete() const
{
if( _ui.leUrl->text().isEmpty() ) return false;
Expand Down
3 changes: 1 addition & 2 deletions src/mirall/owncloudwizard.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ class OwncloudSetupPage: public QWizardPage
protected slots:
void slotPwdStoreChanged( int );
void slotSecureConChanged( int );
void handleNewOcUrl(const QString& ocUrl);
void setupCustomization();
private:
Ui_OwncloudSetupPage _ui;

};

class OwncloudWizard: public QWizard
Expand Down Expand Up @@ -112,7 +112,6 @@ class OwncloudWizardSelectTypePage: public QWizardPage

private:
Ui_OwncloudWizardSelectTypePage _ui;

};

class CreateAnOwncloudPage: public QWizardPage
Expand Down