mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 21:25:19 -05:00
rbutilQt: Font and Doom installation. Also some fixes to the signals in the installers.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14044 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b853fa27bf
commit
e90999fcf1
10 changed files with 899 additions and 562 deletions
|
|
@ -100,10 +100,8 @@ void Install::browseFolder()
|
|||
|
||||
void Install::accept()
|
||||
{
|
||||
QDialog *downloadProgress = new QDialog(this);
|
||||
downloadProgress = new QDialog(this);
|
||||
dp.setupUi(downloadProgress);
|
||||
// connect close button now as it's needed if we break upon an error
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()), downloadProgress, SLOT(close()));
|
||||
// show dialog with error if mount point is wrong
|
||||
if(QFileInfo(ui.lineMountPoint->text()).isDir()) {
|
||||
mountPoint = ui.lineMountPoint->text();
|
||||
|
|
@ -165,12 +163,13 @@ void Install::done(bool error)
|
|||
|
||||
if(error)
|
||||
{
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(close()));
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()), downloadProgress, SLOT(close()));
|
||||
return;
|
||||
}
|
||||
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(close()));
|
||||
delete installer;
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()),downloadProgress, SLOT(close()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include "installbl.h"
|
||||
#include "ui_installfrm.h"
|
||||
#include "ui_installprogressfrm.h"
|
||||
|
||||
|
||||
|
|
@ -89,10 +88,8 @@ void InstallBl::browseOF()
|
|||
|
||||
void InstallBl::accept()
|
||||
{
|
||||
QDialog *downloadProgress = new QDialog(this);
|
||||
downloadProgress = new QDialog(this);
|
||||
dp.setupUi(downloadProgress);
|
||||
// connect close button now as it's needed if we break upon an error
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()), downloadProgress, SLOT(close()));
|
||||
// show dialog with error if mount point is wrong
|
||||
if(QFileInfo(ui.lineMountPoint->text()).isDir()) {
|
||||
mountPoint = ui.lineMountPoint->text();
|
||||
|
|
@ -144,12 +141,12 @@ void InstallBl::done(bool error)
|
|||
|
||||
if(error)
|
||||
{
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(close()));
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()), downloadProgress, SLOT(close()));
|
||||
return;
|
||||
}
|
||||
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(close()));
|
||||
delete binstaller;
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()),downloadProgress, SLOT(close()));
|
||||
}
|
||||
|
||||
void InstallBl::setDeviceSettings(QSettings *dev)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ void ZipInstaller::install(Ui::InstallProgressFrm* dp)
|
|||
connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
|
||||
connect(getter, SIGNAL(downloadDone(int, bool)), this, SLOT(downloadRequestFinished(int, bool)));
|
||||
connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int)));
|
||||
|
||||
connect(m_dp->buttonAbort, SIGNAL(clicked()), getter, SLOT(abort()));
|
||||
}
|
||||
|
||||
void ZipInstaller::downloadRequestFinished(int id, bool error)
|
||||
|
|
@ -63,7 +63,6 @@ void ZipInstaller::downloadDone(bool error)
|
|||
{
|
||||
qDebug() << "Install::downloadDone, error:" << error;
|
||||
|
||||
|
||||
// update progress bar
|
||||
|
||||
int max = m_dp->progressBar->maximum();
|
||||
|
|
|
|||
108
rbutil/rbutilqt/installzipfrm.ui
Normal file
108
rbutil/rbutilqt/installzipfrm.ui
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
<ui version="4.0" >
|
||||
<class>InstallZipFrm</class>
|
||||
<widget class="QDialog" name="InstallZipFrm" >
|
||||
<property name="windowModality" >
|
||||
<enum>Qt::WindowModal</enum>
|
||||
</property>
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>665</width>
|
||||
<height>499</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Install Zip</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item rowspan="8" row="0" column="0" >
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap" >
|
||||
<pixmap resource="rbutilqt.qrc" >:/icons/icons/wizard.xpm</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="3" >
|
||||
<widget class="QLabel" name="label_2" >
|
||||
<property name="text" >
|
||||
<string>Select your device in the filesystem</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2" >
|
||||
<widget class="QLineEdit" name="lineMountPoint" />
|
||||
</item>
|
||||
<item row="1" column="3" >
|
||||
<widget class="QToolButton" name="buttonBrowse" >
|
||||
<property name="text" >
|
||||
<string>&Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="2" colspan="2" >
|
||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons" >
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="4" row="4" column="1" colspan="3" >
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="rbutilqt.qrc" />
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>InstallZipFrm</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>InstallZipFrm</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
128
rbutil/rbutilqt/installzipwindow.cpp
Normal file
128
rbutil/rbutilqt/installzipwindow.cpp
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* 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()
|
||||
{
|
||||
downloadProgress = new QDialog(this);
|
||||
dp.setupUi(downloadProgress);
|
||||
|
||||
// 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 {
|
||||
dp.listProgress->addItem(tr("Mount point is wrong!"));
|
||||
dp.buttonAbort->setText(tr("&Ok"));
|
||||
downloadProgress->show();
|
||||
return;
|
||||
}
|
||||
|
||||
userSettings->sync();
|
||||
|
||||
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(&dp);
|
||||
|
||||
connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool)));
|
||||
|
||||
downloadProgress->show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void InstallZipWindow::done(bool error)
|
||||
{
|
||||
qDebug() << "Install::done, error:" << error;
|
||||
|
||||
if(error)
|
||||
{
|
||||
// connect close button now as it's needed if we break upon an error
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()), downloadProgress, SLOT(close()));
|
||||
return;
|
||||
}
|
||||
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(close()));
|
||||
connect(dp.buttonAbort, SIGNAL(clicked()),downloadProgress, SLOT(close()));
|
||||
}
|
||||
|
||||
void InstallZipWindow::setDeviceSettings(QSettings *dev)
|
||||
{
|
||||
devices = dev;
|
||||
qDebug() << "Install::setDeviceSettings:" << devices;
|
||||
}
|
||||
|
||||
void InstallZipWindow::setUserSettings(QSettings *user)
|
||||
{
|
||||
userSettings = user;
|
||||
}
|
||||
68
rbutil/rbutilqt/installzipwindow.h
Normal file
68
rbutil/rbutilqt/installzipwindow.h
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* 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 "ui_installprogressfrm.h"
|
||||
#include "installzip.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;
|
||||
Ui::InstallProgressFrm dp;
|
||||
QUrl proxy;
|
||||
QSettings *devices;
|
||||
QSettings *userSettings;
|
||||
QDialog *downloadProgress;
|
||||
QString file;
|
||||
QString fileName;
|
||||
QString mountPoint;
|
||||
QString url;
|
||||
QString logsection;
|
||||
ZipInstaller* installer;
|
||||
|
||||
private slots:
|
||||
void browseFolder(void);
|
||||
void done(bool);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -3,7 +3,7 @@ download_url=http://www.rockbox.org/download/
|
|||
daily_url=http://download.rockbox.org/daily/
|
||||
bleeding_url=http://build.rockbox.org/dist/build-
|
||||
server_conf_url=http://www.rockbox.org/daily/build-info
|
||||
font_url=http://www.rockbox.org/daily/fonts/rockbox-fonts-
|
||||
font_url=http://www.rockbox.org/daily/fonts/rockbox-fonts.zip
|
||||
last_release=2.5
|
||||
prog_name=rockbox
|
||||
bootloader_url=http://download.rockbox.org/bootloader
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "installbl.h"
|
||||
#include "httpget.h"
|
||||
#include "installbootloader.h"
|
||||
#include "installzipwindow.h"
|
||||
|
||||
RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
|
||||
{
|
||||
|
|
@ -74,14 +75,14 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
|
|||
connect(ui.comboBoxDevice, SIGNAL(currentIndexChanged(int)), this, SLOT(updateDevice(int)));
|
||||
connect(ui.buttonRockbox, SIGNAL(clicked()), this, SLOT(install()));
|
||||
connect(ui.buttonBootloader, SIGNAL(clicked()), this, SLOT(installBl()));
|
||||
connect(ui.buttonFonts, SIGNAL(clicked()), this, SLOT(installFonts()));
|
||||
connect(ui.buttonGames, SIGNAL(clicked()), this, SLOT(installDoom()));
|
||||
|
||||
// disable unimplemented stuff
|
||||
ui.buttonThemes->setEnabled(false);
|
||||
ui.buttonSmall->setEnabled(false);
|
||||
ui.buttonRemoveRockbox->setEnabled(false);
|
||||
ui.buttonRemoveBootloader->setEnabled(false);
|
||||
ui.buttonGames->setEnabled(false);
|
||||
ui.buttonFonts->setEnabled(false);
|
||||
ui.buttonComplete->setEnabled(false);
|
||||
ui.buttonDetect->setEnabled(false);
|
||||
|
||||
|
|
@ -247,3 +248,32 @@ void RbUtilQt::installBl()
|
|||
installWindow->show();
|
||||
}
|
||||
|
||||
void RbUtilQt::installFonts()
|
||||
{
|
||||
InstallZipWindow* installWindow = new InstallZipWindow(this);
|
||||
installWindow->setUserSettings(userSettings);
|
||||
installWindow->setDeviceSettings(devices);
|
||||
if(userSettings->value("defaults/proxytype") == "manual")
|
||||
installWindow->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
||||
installWindow->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
||||
installWindow->setLogSection("Fonts");
|
||||
installWindow->setUrl(devices->value("font_url").toString());
|
||||
installWindow->setWindowTitle("Font Installation");
|
||||
installWindow->show();
|
||||
|
||||
}
|
||||
|
||||
void RbUtilQt::installDoom()
|
||||
{
|
||||
InstallZipWindow* installWindow = new InstallZipWindow(this);
|
||||
installWindow->setUserSettings(userSettings);
|
||||
installWindow->setDeviceSettings(devices);
|
||||
if(userSettings->value("defaults/proxytype") == "manual")
|
||||
installWindow->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
||||
installWindow->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
||||
installWindow->setLogSection("Doom");
|
||||
installWindow->setUrl(devices->value("doom_url").toString());
|
||||
installWindow->setWindowTitle("Doom Installation");
|
||||
installWindow->show();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ class RbUtilQt : public QMainWindow
|
|||
void updateDevice(int);
|
||||
void install(void);
|
||||
void installBl(void);
|
||||
void installFonts(void);
|
||||
void installDoom(void);
|
||||
void downloadDone(bool);
|
||||
void downloadDone(int, bool);
|
||||
void downloadInfo(void);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ SOURCES += rbutilqt.cpp \
|
|||
installzip.cpp \
|
||||
installbootloader.cpp \
|
||||
installbl.cpp \
|
||||
installzipwindow.cpp \
|
||||
../ipodpatcher/ipodpatcher.c \
|
||||
../sansapatcher/sansapatcher.c \
|
||||
irivertools/irivertools.cpp \
|
||||
|
|
@ -28,6 +29,7 @@ HEADERS += rbutilqt.h \
|
|||
installzip.h \
|
||||
installbootloader.h \
|
||||
installbl.h \
|
||||
installzipwindow.h \
|
||||
../ipodpatcher/ipodpatcher.h \
|
||||
../ipodpatcher/ipodio.h \
|
||||
../ipodpatcher/parttypes.h \
|
||||
|
|
@ -45,12 +47,16 @@ CONFIG += release \
|
|||
thread \
|
||||
qt
|
||||
TARGET = rbutilqt
|
||||
|
||||
FORMS += rbutilqtfrm.ui \
|
||||
aboutbox.ui \
|
||||
installfrm.ui \
|
||||
installprogressfrm.ui \
|
||||
configurefrm.ui \
|
||||
installbootloaderfrm.ui
|
||||
installbootloaderfrm.ui \
|
||||
installzipfrm.ui
|
||||
|
||||
|
||||
RESOURCES += rbutilqt.qrc
|
||||
|
||||
TRANSLATIONS += rbutil_de.ts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue