Exemplo n.º 1
0
InstallerForm::InstallerForm(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::InstallerForm)
{
    ui->setupUi(this);
    setModal(true);
    //    setWindowModality(Qt::ApplicationModal);
    ui->launchBrowser->setVisible(false);
    ui->showWizard->setVisible(false);

    connect(ui->launchBrowser, SIGNAL(clicked()), SLOT(authThroughBrowser()));
    connect(ui->showWizard, SIGNAL(clicked()), SLOT(runGtkInstaller()));

    //! @todo download to temp file name
    //! @todo KIO::NetAccess::download(daemonUrl, tmpFile,this) .... and possibly uncompress?
    downloadPath=QDir::toNativeSeparators(QDir::homePath().append("/daemon.tar.gz"));

    if(QSysInfo::WordSize==64)
        daemonUrl="http://www.dropbox.com/download?plat=lnx.x86_64";
    else
        daemonUrl="http://www.dropbox.com/download?plat=lnx.x86";

    if(DropboxClient::isInstalled())
        runConfiguration();
    else
        downloadDaemon();

}
Exemplo n.º 2
0
void InstallerForm::downloadFinished()
{
    file.close();
    const QVariant possible_redirect = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
    if (!possible_redirect.toString().isEmpty() && possible_redirect.toString()!=daemonUrl) {
        daemonUrl = possible_redirect.toUrl().toString();
        downloadDaemon();
    } else {
        reply->close();
        processFile();
    }
}
Exemplo n.º 3
0
InstallerForm::InstallerForm(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::InstallerForm)
{
    ui->setupUi(this);
    setModal(true);
    ui->launchBrowser->setVisible(false);
    ui->showWizard->setVisible(false);

    connect(ui->launchBrowser, SIGNAL(clicked()), SLOT(authThroughBrowser()));
    connect(ui->showWizard, SIGNAL(clicked()), SLOT(runGtkInstaller()));

    //! @todo KIO::NetAccess::download(daemonUrl, tmpFile,this) .... and possibly uncompress?
    downloadPath = QDir(QDir::tempPath()).filePath("dropbox-lnx.tar.gz");
    daemonUrl = QString("http://www.dropbox.com/download?plat=lnx.%1").arg(QSysInfo::WordSize == 64 ? "x86_64" : "x86");

    if (DropboxClient::isInstalled())
        runConfiguration();
    else
        downloadDaemon();
}