mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
Remove zip installation window as it's not needed anymore. Use a simple confirmation dialog for installing fonts / game files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14159 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
33bceb2b97
commit
fbad89782d
5 changed files with 52 additions and 224 deletions
|
|
@ -1,126 +0,0 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
*
|
||||
* Copyright (C) 2007 by Dominik Wenger
|
||||
* $Id: installzipwindow.cpp 14027 2007-07-27 17:42:49Z domonoky $
|
||||
*
|
||||
* All files in this archive are subject to the GNU General Public License.
|
||||
* See the file COPYING in the source tree root for full license agreement.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include "installzipwindow.h"
|
||||
//#include "ui_installprogressfrm.h"
|
||||
|
||||
|
||||
InstallZipWindow::InstallZipWindow(QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
connect(ui.buttonBrowse, SIGNAL(clicked()), this, SLOT(browseFolder()));
|
||||
}
|
||||
|
||||
void InstallZipWindow::setProxy(QUrl proxy_url)
|
||||
{
|
||||
proxy = proxy_url;
|
||||
qDebug() << "Install::setProxy" << proxy;
|
||||
}
|
||||
|
||||
void InstallZipWindow::setMountPoint(QString mount)
|
||||
{
|
||||
QFileInfo m(mount);
|
||||
if(m.isDir()) {
|
||||
ui.lineMountPoint->clear();
|
||||
ui.lineMountPoint->insert(mount);
|
||||
}
|
||||
}
|
||||
|
||||
void InstallZipWindow::setUrl(QString path)
|
||||
{
|
||||
url = path;
|
||||
}
|
||||
|
||||
void InstallZipWindow::browseFolder()
|
||||
{
|
||||
QFileDialog browser(this);
|
||||
if(QFileInfo(ui.lineMountPoint->text()).isDir())
|
||||
browser.setDirectory(ui.lineMountPoint->text());
|
||||
else
|
||||
browser.setDirectory("/media");
|
||||
browser.setReadOnly(true);
|
||||
browser.setFileMode(QFileDialog::DirectoryOnly);
|
||||
browser.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
if(browser.exec()) {
|
||||
qDebug() << browser.directory();
|
||||
QStringList files = browser.selectedFiles();
|
||||
setMountPoint(files.at(0));
|
||||
}
|
||||
}
|
||||
|
||||
void InstallZipWindow::accept()
|
||||
{
|
||||
// create logger
|
||||
logger = new ProgressLoggerGui(this);
|
||||
logger->show();
|
||||
|
||||
// show dialog with error if mount point is wrong
|
||||
if(QFileInfo(ui.lineMountPoint->text()).isDir()) {
|
||||
mountPoint = ui.lineMountPoint->text();
|
||||
userSettings->setValue("defaults/mountpoint", mountPoint);
|
||||
}
|
||||
else {
|
||||
logger->addItem(tr("Mount point is wrong!"),LOGERROR);
|
||||
logger->abort();
|
||||
return;
|
||||
}
|
||||
|
||||
userSettings->sync();
|
||||
|
||||
// create Zip installer
|
||||
installer = new ZipInstaller(this);
|
||||
|
||||
QString fileName = url.section('/', -1);
|
||||
installer->setFilename(fileName);
|
||||
installer->setUrl(url);
|
||||
installer->setProxy(proxy);
|
||||
installer->setLogSection(logsection);
|
||||
installer->setMountPoint(mountPoint);
|
||||
installer->install(logger);
|
||||
|
||||
connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool)));
|
||||
|
||||
|
||||
}
|
||||
|
||||
// we are done with Zip installing
|
||||
void InstallZipWindow::done(bool error)
|
||||
{
|
||||
qDebug() << "Install::done, error:" << error;
|
||||
|
||||
if(error) // if there was an error
|
||||
{
|
||||
logger->abort();
|
||||
return;
|
||||
}
|
||||
|
||||
// no error, close the window, when the logger is closed
|
||||
connect(logger,SIGNAL(closed()),this,SLOT(close()));
|
||||
}
|
||||
|
||||
void InstallZipWindow::setDeviceSettings(QSettings *dev)
|
||||
{
|
||||
devices = dev;
|
||||
qDebug() << "Install::setDeviceSettings:" << devices;
|
||||
}
|
||||
|
||||
void InstallZipWindow::setUserSettings(QSettings *user)
|
||||
{
|
||||
userSettings = user;
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
*
|
||||
* Copyright (C) 2007 by Dominik Wenger
|
||||
* $Id: installzipwindow.h 14027 2007-07-27 17:42:49Z domonoky $
|
||||
*
|
||||
* All files in this archive are subject to the GNU General Public License.
|
||||
* See the file COPYING in the source tree root for full license agreement.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef INSTALLZIPWINDOW_H
|
||||
#define INSTALLZIPWINDOW_H
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
#include <QSettings>
|
||||
|
||||
#include "ui_installzipfrm.h"
|
||||
#include "installzip.h"
|
||||
#include "progressloggergui.h"
|
||||
|
||||
class InstallZipWindow : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
InstallZipWindow(QWidget *parent = 0);
|
||||
void setProxy(QUrl);
|
||||
void setMountPoint(QString);
|
||||
void setUrl(QString);
|
||||
void setLogSection(QString name){logsection = name; }
|
||||
void setUserSettings(QSettings*);
|
||||
void setDeviceSettings(QSettings*);
|
||||
|
||||
public slots:
|
||||
void accept(void);
|
||||
|
||||
private:
|
||||
Ui::InstallZipFrm ui;
|
||||
QUrl proxy;
|
||||
QSettings *devices;
|
||||
QSettings *userSettings;
|
||||
ProgressLoggerGui* logger;
|
||||
QString file;
|
||||
QString fileName;
|
||||
QString mountPoint;
|
||||
QString url;
|
||||
QString logsection;
|
||||
ZipInstaller* installer;
|
||||
|
||||
private slots:
|
||||
void browseFolder(void);
|
||||
void done(bool);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -28,7 +28,6 @@
|
|||
#include "installbl.h"
|
||||
#include "httpget.h"
|
||||
#include "installbootloader.h"
|
||||
#include "installzipwindow.h"
|
||||
|
||||
#ifdef __linux
|
||||
#include <stdio.h>
|
||||
|
|
@ -290,40 +289,57 @@ void RbUtilQt::installBl()
|
|||
|
||||
void RbUtilQt::installFonts()
|
||||
{
|
||||
InstallZipWindow* installWindow = new InstallZipWindow(this);
|
||||
installWindow->setUserSettings(userSettings);
|
||||
installWindow->setDeviceSettings(devices);
|
||||
if(QMessageBox::question(this, tr("Confirm Installation"),
|
||||
tr("Do you really want to install the fonts package?"),
|
||||
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
||||
// create logger
|
||||
logger = new ProgressLoggerGui(this);
|
||||
logger->show();
|
||||
|
||||
// create zip installer
|
||||
installer = new ZipInstaller(this);
|
||||
|
||||
installer->setUrl(devices->value("font_url").toString());
|
||||
if(userSettings->value("defaults/proxytype") == "manual")
|
||||
installWindow->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
||||
installer->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
||||
#ifdef __linux
|
||||
else if(userSettings->value("defaults/proxytype") == "system")
|
||||
installWindow->setProxy(QUrl(getenv("http_proxy")));
|
||||
installer->setProxy(QUrl(getenv("http_proxy")));
|
||||
#endif
|
||||
installWindow->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
||||
installWindow->setLogSection("Fonts");
|
||||
installWindow->setUrl(devices->value("font_url").toString());
|
||||
installWindow->setWindowTitle("Font Installation");
|
||||
installWindow->show();
|
||||
|
||||
installer->setLogSection("Fonts");
|
||||
installer->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
||||
installer->install(logger);
|
||||
|
||||
connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool)));
|
||||
}
|
||||
|
||||
|
||||
void RbUtilQt::installDoom()
|
||||
{
|
||||
InstallZipWindow* installWindow = new InstallZipWindow(this);
|
||||
installWindow->setUserSettings(userSettings);
|
||||
installWindow->setDeviceSettings(devices);
|
||||
if(QMessageBox::question(this, tr("Confirm Installation"),
|
||||
tr("Do you really want to install the game addon files?"),
|
||||
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
||||
// create logger
|
||||
logger = new ProgressLoggerGui(this);
|
||||
logger->show();
|
||||
|
||||
// create zip installer
|
||||
installer = new ZipInstaller(this);
|
||||
|
||||
installer->setUrl(devices->value("doom_url").toString());
|
||||
if(userSettings->value("defaults/proxytype") == "manual")
|
||||
installWindow->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
||||
installer->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
||||
#ifdef __linux
|
||||
else if(userSettings->value("defaults/proxytype") == "system")
|
||||
installWindow->setProxy(QUrl(getenv("http_proxy")));
|
||||
installer->setProxy(QUrl(getenv("http_proxy")));
|
||||
#endif
|
||||
installWindow->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
||||
installWindow->setLogSection("Doom");
|
||||
installWindow->setUrl(devices->value("doom_url").toString());
|
||||
installWindow->setWindowTitle("Doom Installation");
|
||||
installWindow->show();
|
||||
|
||||
installer->setLogSection("Game Addons");
|
||||
installer->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
||||
installer->install(logger);
|
||||
|
||||
connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool)));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,11 +21,14 @@
|
|||
#ifndef QRBUTIL_H
|
||||
#define QRBUTIL_H
|
||||
|
||||
#include "ui_rbutilqtfrm.h"
|
||||
#include "httpget.h"
|
||||
#include <QSettings>
|
||||
#include <QTemporaryFile>
|
||||
|
||||
#include "ui_rbutilqtfrm.h"
|
||||
#include "httpget.h"
|
||||
#include "installzip.h"
|
||||
#include "progressloggergui.h"
|
||||
|
||||
class RbUtilQt : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -44,6 +47,8 @@ class RbUtilQt : public QMainWindow
|
|||
QString absolutePath;
|
||||
QTemporaryFile buildInfo;
|
||||
void updateManual(void);
|
||||
ProgressLoggerGui *logger;
|
||||
ZipInstaller *installer;
|
||||
|
||||
private slots:
|
||||
void about(void);
|
||||
|
|
|
|||
|
|
@ -8,14 +8,13 @@ SOURCES += rbutilqt.cpp \
|
|||
installzip.cpp \
|
||||
installbootloader.cpp \
|
||||
installbl.cpp \
|
||||
installzipwindow.cpp \
|
||||
progressloggergui.cpp \
|
||||
../ipodpatcher/ipodpatcher.c \
|
||||
../sansapatcher/sansapatcher.c \
|
||||
irivertools/irivertools.cpp \
|
||||
irivertools/md5sum.cpp
|
||||
irivertools/md5sum.cpp
|
||||
|
||||
|
||||
|
||||
HEADERS += rbutilqt.h \
|
||||
settings.h \
|
||||
install.h \
|
||||
|
|
@ -42,8 +41,9 @@ HEADERS += rbutilqt.h \
|
|||
irivertools/md5sum.h \
|
||||
irivertools/h100sums.h \
|
||||
irivertools/h120sums.h \
|
||||
irivertools/h300sums.h
|
||||
|
||||
irivertools/h300sums.h \
|
||||
irivertools/checksums.h
|
||||
|
||||
TEMPLATE = app
|
||||
CONFIG += release \
|
||||
warn_on \
|
||||
|
|
@ -56,10 +56,9 @@ FORMS += rbutilqtfrm.ui \
|
|||
installfrm.ui \
|
||||
installprogressfrm.ui \
|
||||
configurefrm.ui \
|
||||
installbootloaderfrm.ui \
|
||||
installzipfrm.ui
|
||||
|
||||
|
||||
installbootloaderfrm.ui
|
||||
|
||||
|
||||
RESOURCES += rbutilqt.qrc
|
||||
|
||||
TRANSLATIONS += rbutil_de.ts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue