mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
read oc url from config file.
This commit is contained in:
parent
9043e69d27
commit
96eaeb2c62
4 changed files with 36 additions and 2 deletions
|
@ -164,6 +164,7 @@ void OwncloudSetup::slotFinished( int res, QProcess::ExitStatus )
|
|||
|
||||
void OwncloudSetup::startWizard()
|
||||
{
|
||||
_ocWizard->setOCUrl( ownCloudUrl() );
|
||||
_ocWizard->exec();
|
||||
}
|
||||
|
||||
|
@ -182,6 +183,19 @@ void OwncloudSetup::writeOwncloudConfig()
|
|||
settings.sync();
|
||||
}
|
||||
|
||||
/*
|
||||
* returns the configured owncloud url if its already configured, otherwise an empty
|
||||
* string.
|
||||
*/
|
||||
QString OwncloudSetup::ownCloudUrl() const
|
||||
{
|
||||
QSettings settings( mirallConfigFile(), QSettings::IniFormat );
|
||||
QString url = settings.value( "ownCloud/url" ).toString();
|
||||
qDebug() << "Returning configured owncloud url: " << url;
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
/*
|
||||
* method to check the if the owncloud admin script is existing
|
||||
*/
|
||||
|
|
|
@ -26,6 +26,12 @@ public:
|
|||
|
||||
QString mirallConfigFile() const;
|
||||
|
||||
/**
|
||||
* returns the configured owncloud url if its already configured, otherwise an empty
|
||||
* string.
|
||||
*/
|
||||
QString ownCloudUrl() const ;
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
|
|
@ -71,6 +71,11 @@ bool OwncloudWizardSelectTypePage::isComplete() const
|
|||
return true;
|
||||
}
|
||||
|
||||
void OwncloudWizardSelectTypePage::setOCUrl( const QString& url )
|
||||
{
|
||||
_ui.OCUrlLineEdit->setText( url );
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
|
||||
|
@ -253,6 +258,13 @@ void OwncloudWizard::appendToResultWidget( const QString& msg )
|
|||
p->appendResultText( msg );
|
||||
}
|
||||
|
||||
} // end namespace
|
||||
void OwncloudWizard::setOCUrl( const QString& url )
|
||||
{
|
||||
if( !url.isEmpty() ) {
|
||||
OwncloudWizardSelectTypePage *p = static_cast<OwncloudWizardSelectTypePage*>(page( Page_SelectType ));
|
||||
p->setOCUrl( url );
|
||||
}
|
||||
}
|
||||
|
||||
} // end namespace
|
||||
#include "owncloudwizard.moc"
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
virtual bool isComplete() const;
|
||||
virtual void initializePage();
|
||||
int nextId() const;
|
||||
|
||||
void setOCUrl( const QString& );
|
||||
private:
|
||||
Ui_OwncloudWizardSelectTypePage _ui;
|
||||
|
||||
|
@ -121,6 +121,8 @@ public:
|
|||
|
||||
OwncloudWizard(QWidget *parent = 0L);
|
||||
|
||||
void setOCUrl( const QString& );
|
||||
|
||||
public slots:
|
||||
void appendToResultWidget( const QString& );
|
||||
void slotCurrentPageChanged( int );
|
||||
|
|
Loading…
Reference in a new issue