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()
|
void Install::accept()
|
||||||
{
|
{
|
||||||
QDialog *downloadProgress = new QDialog(this);
|
downloadProgress = new QDialog(this);
|
||||||
dp.setupUi(downloadProgress);
|
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
|
// show dialog with error if mount point is wrong
|
||||||
if(QFileInfo(ui.lineMountPoint->text()).isDir()) {
|
if(QFileInfo(ui.lineMountPoint->text()).isDir()) {
|
||||||
mountPoint = ui.lineMountPoint->text();
|
mountPoint = ui.lineMountPoint->text();
|
||||||
|
|
@ -165,12 +163,13 @@ void Install::done(bool error)
|
||||||
|
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(close()));
|
connect(dp.buttonAbort, SIGNAL(clicked()), downloadProgress, SLOT(close()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(close()));
|
connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(close()));
|
||||||
delete installer;
|
connect(dp.buttonAbort, SIGNAL(clicked()),downloadProgress, SLOT(close()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,179 +1,176 @@
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* __________ __ ___.
|
* __________ __ ___.
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
* \/ \/ \/ \/ \/
|
* \/ \/ \/ \/ \/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 by Dominik Wenger
|
* Copyright (C) 2007 by Dominik Wenger
|
||||||
* $Id: installbl.cpp 14027 2007-07-27 17:42:49Z domonoky $
|
* $Id: installbl.cpp 14027 2007-07-27 17:42:49Z domonoky $
|
||||||
*
|
*
|
||||||
* All files in this archive are subject to the GNU General Public License.
|
* 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.
|
* 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
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "installbl.h"
|
#include "installbl.h"
|
||||||
#include "ui_installfrm.h"
|
#include "ui_installprogressfrm.h"
|
||||||
#include "ui_installprogressfrm.h"
|
|
||||||
|
|
||||||
|
InstallBl::InstallBl(QWidget *parent) : QDialog(parent)
|
||||||
InstallBl::InstallBl(QWidget *parent) : QDialog(parent)
|
{
|
||||||
{
|
ui.setupUi(this);
|
||||||
ui.setupUi(this);
|
connect(ui.buttonBrowse, SIGNAL(clicked()), this, SLOT(browseFolder()));
|
||||||
connect(ui.buttonBrowse, SIGNAL(clicked()), this, SLOT(browseFolder()));
|
connect(ui.buttonBrowseOF, SIGNAL(clicked()), this, SLOT(browseOF()));
|
||||||
connect(ui.buttonBrowseOF, SIGNAL(clicked()), this, SLOT(browseOF()));
|
|
||||||
|
}
|
||||||
}
|
|
||||||
|
void InstallBl::setProxy(QUrl proxy_url)
|
||||||
void InstallBl::setProxy(QUrl proxy_url)
|
{
|
||||||
{
|
proxy = proxy_url;
|
||||||
proxy = proxy_url;
|
qDebug() << "Install::setProxy" << proxy;
|
||||||
qDebug() << "Install::setProxy" << proxy;
|
}
|
||||||
}
|
|
||||||
|
void InstallBl::setMountPoint(QString mount)
|
||||||
void InstallBl::setMountPoint(QString mount)
|
{
|
||||||
{
|
QFileInfo m(mount);
|
||||||
QFileInfo m(mount);
|
if(m.isDir()) {
|
||||||
if(m.isDir()) {
|
ui.lineMountPoint->clear();
|
||||||
ui.lineMountPoint->clear();
|
ui.lineMountPoint->insert(mount);
|
||||||
ui.lineMountPoint->insert(mount);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
void InstallBl::setOFPath(QString path)
|
||||||
void InstallBl::setOFPath(QString path)
|
{
|
||||||
{
|
QFileInfo m(path);
|
||||||
QFileInfo m(path);
|
if(m.exists()) {
|
||||||
if(m.exists()) {
|
ui.lineOriginalFirmware->clear();
|
||||||
ui.lineOriginalFirmware->clear();
|
ui.lineOriginalFirmware->insert(path);
|
||||||
ui.lineOriginalFirmware->insert(path);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
void InstallBl::browseFolder()
|
||||||
void InstallBl::browseFolder()
|
{
|
||||||
{
|
QFileDialog browser(this);
|
||||||
QFileDialog browser(this);
|
if(QFileInfo(ui.lineMountPoint->text()).isDir())
|
||||||
if(QFileInfo(ui.lineMountPoint->text()).isDir())
|
browser.setDirectory(ui.lineMountPoint->text());
|
||||||
browser.setDirectory(ui.lineMountPoint->text());
|
else
|
||||||
else
|
browser.setDirectory("/media");
|
||||||
browser.setDirectory("/media");
|
browser.setReadOnly(true);
|
||||||
browser.setReadOnly(true);
|
browser.setFileMode(QFileDialog::DirectoryOnly);
|
||||||
browser.setFileMode(QFileDialog::DirectoryOnly);
|
browser.setAcceptMode(QFileDialog::AcceptOpen);
|
||||||
browser.setAcceptMode(QFileDialog::AcceptOpen);
|
if(browser.exec()) {
|
||||||
if(browser.exec()) {
|
qDebug() << browser.directory();
|
||||||
qDebug() << browser.directory();
|
QStringList files = browser.selectedFiles();
|
||||||
QStringList files = browser.selectedFiles();
|
setMountPoint(files.at(0));
|
||||||
setMountPoint(files.at(0));
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
void InstallBl::browseOF()
|
||||||
void InstallBl::browseOF()
|
{
|
||||||
{
|
QFileDialog browser(this);
|
||||||
QFileDialog browser(this);
|
if(QFileInfo(ui.lineOriginalFirmware->text()).exists())
|
||||||
if(QFileInfo(ui.lineOriginalFirmware->text()).exists())
|
browser.setDirectory(ui.lineOriginalFirmware->text());
|
||||||
browser.setDirectory(ui.lineOriginalFirmware->text());
|
else
|
||||||
else
|
browser.setDirectory("/media");
|
||||||
browser.setDirectory("/media");
|
browser.setReadOnly(true);
|
||||||
browser.setReadOnly(true);
|
browser.setAcceptMode(QFileDialog::AcceptOpen);
|
||||||
browser.setAcceptMode(QFileDialog::AcceptOpen);
|
if(browser.exec()) {
|
||||||
if(browser.exec()) {
|
qDebug() << browser.directory();
|
||||||
qDebug() << browser.directory();
|
QStringList files = browser.selectedFiles();
|
||||||
QStringList files = browser.selectedFiles();
|
setOFPath(files.at(0));
|
||||||
setOFPath(files.at(0));
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
void InstallBl::accept()
|
||||||
void InstallBl::accept()
|
{
|
||||||
{
|
downloadProgress = new QDialog(this);
|
||||||
QDialog *downloadProgress = new QDialog(this);
|
dp.setupUi(downloadProgress);
|
||||||
dp.setupUi(downloadProgress);
|
// show dialog with error if mount point is wrong
|
||||||
// connect close button now as it's needed if we break upon an error
|
if(QFileInfo(ui.lineMountPoint->text()).isDir()) {
|
||||||
connect(dp.buttonAbort, SIGNAL(clicked()), downloadProgress, SLOT(close()));
|
mountPoint = ui.lineMountPoint->text();
|
||||||
// show dialog with error if mount point is wrong
|
userSettings->setValue("defaults/mountpoint", mountPoint);
|
||||||
if(QFileInfo(ui.lineMountPoint->text()).isDir()) {
|
}
|
||||||
mountPoint = ui.lineMountPoint->text();
|
else {
|
||||||
userSettings->setValue("defaults/mountpoint", mountPoint);
|
dp.listProgress->addItem(tr("Mount point is wrong!"));
|
||||||
}
|
dp.buttonAbort->setText(tr("&Ok"));
|
||||||
else {
|
downloadProgress->show();
|
||||||
dp.listProgress->addItem(tr("Mount point is wrong!"));
|
return;
|
||||||
dp.buttonAbort->setText(tr("&Ok"));
|
}
|
||||||
downloadProgress->show();
|
|
||||||
return;
|
if(QFileInfo(ui.lineOriginalFirmware->text()).exists())
|
||||||
}
|
{
|
||||||
|
m_OrigFirmware = ui.lineOriginalFirmware->text();
|
||||||
if(QFileInfo(ui.lineOriginalFirmware->text()).exists())
|
}
|
||||||
{
|
else
|
||||||
m_OrigFirmware = ui.lineOriginalFirmware->text();
|
{
|
||||||
}
|
dp.listProgress->addItem(tr("Original Firmware Path is wrong!"));
|
||||||
else
|
dp.buttonAbort->setText(tr("&Ok"));
|
||||||
{
|
downloadProgress->show();
|
||||||
dp.listProgress->addItem(tr("Original Firmware Path is wrong!"));
|
return;
|
||||||
dp.buttonAbort->setText(tr("&Ok"));
|
}
|
||||||
downloadProgress->show();
|
userSettings->sync();
|
||||||
return;
|
|
||||||
}
|
binstaller = new BootloaderInstaller(this);
|
||||||
userSettings->sync();
|
|
||||||
|
binstaller->setMountPoint(mountPoint);
|
||||||
binstaller = new BootloaderInstaller(this);
|
binstaller->setProxy(proxy);
|
||||||
|
QString plattform = userSettings->value("defaults/platform").toString();
|
||||||
binstaller->setMountPoint(mountPoint);
|
|
||||||
binstaller->setProxy(proxy);
|
binstaller->setDevice(plattform);
|
||||||
QString plattform = userSettings->value("defaults/platform").toString();
|
binstaller->setBootloaderMethod(devices->value(plattform + "/bootloadermethod").toString());
|
||||||
|
binstaller->setBootloaderName(devices->value(plattform + "/bootloadername").toString());
|
||||||
binstaller->setDevice(plattform);
|
binstaller->setBootloaderBaseUrl(devices->value("bootloader_url").toString());
|
||||||
binstaller->setBootloaderMethod(devices->value(plattform + "/bootloadermethod").toString());
|
binstaller->setOrigFirmwarePath(m_OrigFirmware);
|
||||||
binstaller->setBootloaderName(devices->value(plattform + "/bootloadername").toString());
|
|
||||||
binstaller->setBootloaderBaseUrl(devices->value("bootloader_url").toString());
|
binstaller->install(&dp);
|
||||||
binstaller->setOrigFirmwarePath(m_OrigFirmware);
|
|
||||||
|
connect(binstaller, SIGNAL(done(bool)), this, SLOT(done(bool)));
|
||||||
binstaller->install(&dp);
|
|
||||||
|
downloadProgress->show();
|
||||||
connect(binstaller, SIGNAL(done(bool)), this, SLOT(done(bool)));
|
}
|
||||||
|
|
||||||
downloadProgress->show();
|
|
||||||
}
|
void InstallBl::done(bool error)
|
||||||
|
{
|
||||||
|
qDebug() << "Install::done, error:" << error;
|
||||||
void InstallBl::done(bool error)
|
|
||||||
{
|
if(error)
|
||||||
qDebug() << "Install::done, error:" << error;
|
{
|
||||||
|
connect(dp.buttonAbort, SIGNAL(clicked()), downloadProgress, SLOT(close()));
|
||||||
if(error)
|
return;
|
||||||
{
|
}
|
||||||
connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(close()));
|
|
||||||
return;
|
connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(close()));
|
||||||
}
|
connect(dp.buttonAbort, SIGNAL(clicked()),downloadProgress, SLOT(close()));
|
||||||
|
}
|
||||||
connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(close()));
|
|
||||||
delete binstaller;
|
void InstallBl::setDeviceSettings(QSettings *dev)
|
||||||
}
|
{
|
||||||
|
devices = dev;
|
||||||
void InstallBl::setDeviceSettings(QSettings *dev)
|
|
||||||
{
|
if(userSettings->value("defaults/platform").toString() == "h100" ||
|
||||||
devices = dev;
|
userSettings->value("defaults/platform").toString() == "h120" ||
|
||||||
|
userSettings->value("defaults/platform").toString() == "h300")
|
||||||
if(userSettings->value("defaults/platform").toString() == "h100" ||
|
{
|
||||||
userSettings->value("defaults/platform").toString() == "h120" ||
|
ui.buttonBrowseOF->show();
|
||||||
userSettings->value("defaults/platform").toString() == "h300")
|
ui.lineOriginalFirmware->show();
|
||||||
{
|
ui.label_3->show();
|
||||||
ui.buttonBrowseOF->show();
|
}
|
||||||
ui.lineOriginalFirmware->show();
|
else
|
||||||
ui.label_3->show();
|
{
|
||||||
}
|
ui.buttonBrowseOF->hide();
|
||||||
else
|
ui.lineOriginalFirmware->hide();
|
||||||
{
|
ui.label_3->hide();
|
||||||
ui.buttonBrowseOF->hide();
|
}
|
||||||
ui.lineOriginalFirmware->hide();
|
qDebug() << "Install::setDeviceSettings:" << devices;
|
||||||
ui.label_3->hide();
|
}
|
||||||
}
|
|
||||||
qDebug() << "Install::setDeviceSettings:" << devices;
|
void InstallBl::setUserSettings(QSettings *user)
|
||||||
}
|
{
|
||||||
|
userSettings = user;
|
||||||
void InstallBl::setUserSettings(QSettings *user)
|
}
|
||||||
{
|
|
||||||
userSettings = user;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ void ZipInstaller::install(Ui::InstallProgressFrm* dp)
|
||||||
connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
|
connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
|
||||||
connect(getter, SIGNAL(downloadDone(int, bool)), this, SLOT(downloadRequestFinished(int, bool)));
|
connect(getter, SIGNAL(downloadDone(int, bool)), this, SLOT(downloadRequestFinished(int, bool)));
|
||||||
connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int)));
|
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)
|
void ZipInstaller::downloadRequestFinished(int id, bool error)
|
||||||
|
|
@ -63,7 +63,6 @@ void ZipInstaller::downloadDone(bool error)
|
||||||
{
|
{
|
||||||
qDebug() << "Install::downloadDone, error:" << error;
|
qDebug() << "Install::downloadDone, error:" << error;
|
||||||
|
|
||||||
|
|
||||||
// update progress bar
|
// update progress bar
|
||||||
|
|
||||||
int max = m_dp->progressBar->maximum();
|
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/
|
daily_url=http://download.rockbox.org/daily/
|
||||||
bleeding_url=http://build.rockbox.org/dist/build-
|
bleeding_url=http://build.rockbox.org/dist/build-
|
||||||
server_conf_url=http://www.rockbox.org/daily/build-info
|
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
|
last_release=2.5
|
||||||
prog_name=rockbox
|
prog_name=rockbox
|
||||||
bootloader_url=http://download.rockbox.org/bootloader
|
bootloader_url=http://download.rockbox.org/bootloader
|
||||||
|
|
|
||||||
|
|
@ -1,249 +1,279 @@
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* __________ __ ___.
|
* __________ __ ___.
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
* \/ \/ \/ \/ \/
|
* \/ \/ \/ \/ \/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 by Dominik Riebeling
|
* Copyright (C) 2007 by Dominik Riebeling
|
||||||
* $Id$
|
* $Id$
|
||||||
*
|
*
|
||||||
* All files in this archive are subject to the GNU General Public License.
|
* 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.
|
* 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
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "rbutilqt.h"
|
#include "rbutilqt.h"
|
||||||
#include "ui_rbutilqtfrm.h"
|
#include "ui_rbutilqtfrm.h"
|
||||||
#include "ui_aboutbox.h"
|
#include "ui_aboutbox.h"
|
||||||
#include "configure.h"
|
#include "configure.h"
|
||||||
#include "install.h"
|
#include "install.h"
|
||||||
#include "installbl.h"
|
#include "installbl.h"
|
||||||
#include "httpget.h"
|
#include "httpget.h"
|
||||||
#include "installbootloader.h"
|
#include "installbootloader.h"
|
||||||
|
#include "installzipwindow.h"
|
||||||
RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
|
|
||||||
{
|
RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
|
||||||
QString programPath = qApp->arguments().at(0);
|
{
|
||||||
absolutePath = QFileInfo(programPath).absolutePath() + "/";
|
QString programPath = qApp->arguments().at(0);
|
||||||
// use built-in rbutil.ini if no external file in binary folder
|
absolutePath = QFileInfo(programPath).absolutePath() + "/";
|
||||||
QString iniFile = absolutePath + "rbutil.ini";
|
// use built-in rbutil.ini if no external file in binary folder
|
||||||
if(QFileInfo(iniFile).isFile()) {
|
QString iniFile = absolutePath + "rbutil.ini";
|
||||||
qDebug() << "using external rbutil.ini";
|
if(QFileInfo(iniFile).isFile()) {
|
||||||
devices = new QSettings(iniFile, QSettings::IniFormat, 0);
|
qDebug() << "using external rbutil.ini";
|
||||||
}
|
devices = new QSettings(iniFile, QSettings::IniFormat, 0);
|
||||||
else {
|
}
|
||||||
qDebug() << "using built-in rbutil.ini";
|
else {
|
||||||
devices = new QSettings(":/ini/rbutil.ini", QSettings::IniFormat, 0);
|
qDebug() << "using built-in rbutil.ini";
|
||||||
}
|
devices = new QSettings(":/ini/rbutil.ini", QSettings::IniFormat, 0);
|
||||||
|
}
|
||||||
ui.setupUi(this);
|
|
||||||
initDeviceNames();
|
ui.setupUi(this);
|
||||||
|
initDeviceNames();
|
||||||
// portable installation:
|
|
||||||
// check for a configuration file in the program folder.
|
// portable installation:
|
||||||
QFileInfo config;
|
// check for a configuration file in the program folder.
|
||||||
config.setFile(absolutePath + "RockboxUtility.ini");
|
QFileInfo config;
|
||||||
if(config.isFile()) {
|
config.setFile(absolutePath + "RockboxUtility.ini");
|
||||||
userSettings = new QSettings(absolutePath + "RockboxUtility.ini",
|
if(config.isFile()) {
|
||||||
QSettings::IniFormat, 0);
|
userSettings = new QSettings(absolutePath + "RockboxUtility.ini",
|
||||||
qDebug() << "config: portable";
|
QSettings::IniFormat, 0);
|
||||||
}
|
qDebug() << "config: portable";
|
||||||
else {
|
}
|
||||||
userSettings = new QSettings(QSettings::IniFormat,
|
else {
|
||||||
QSettings::UserScope, "rockbox.org", "RockboxUtility");
|
userSettings = new QSettings(QSettings::IniFormat,
|
||||||
qDebug() << "config: system";
|
QSettings::UserScope, "rockbox.org", "RockboxUtility");
|
||||||
}
|
qDebug() << "config: system";
|
||||||
|
}
|
||||||
userSettings->beginGroup("defaults");
|
|
||||||
platform = userSettings->value("platform").toString();
|
userSettings->beginGroup("defaults");
|
||||||
userSettings->endGroup();
|
platform = userSettings->value("platform").toString();
|
||||||
ui.comboBoxDevice->setCurrentIndex(ui.comboBoxDevice->findData(platform));
|
userSettings->endGroup();
|
||||||
updateDevice(ui.comboBoxDevice->currentIndex());
|
ui.comboBoxDevice->setCurrentIndex(ui.comboBoxDevice->findData(platform));
|
||||||
|
updateDevice(ui.comboBoxDevice->currentIndex());
|
||||||
connect(ui.actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
|
|
||||||
connect(ui.action_About, SIGNAL(triggered()), this, SLOT(about()));
|
connect(ui.actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
|
||||||
connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(configDialog()));
|
connect(ui.action_About, SIGNAL(triggered()), this, SLOT(about()));
|
||||||
connect(ui.comboBoxDevice, SIGNAL(currentIndexChanged(int)), this, SLOT(updateDevice(int)));
|
connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(configDialog()));
|
||||||
connect(ui.buttonRockbox, SIGNAL(clicked()), this, SLOT(install()));
|
connect(ui.comboBoxDevice, SIGNAL(currentIndexChanged(int)), this, SLOT(updateDevice(int)));
|
||||||
connect(ui.buttonBootloader, SIGNAL(clicked()), this, SLOT(installBl()));
|
connect(ui.buttonRockbox, SIGNAL(clicked()), this, SLOT(install()));
|
||||||
|
connect(ui.buttonBootloader, SIGNAL(clicked()), this, SLOT(installBl()));
|
||||||
// disable unimplemented stuff
|
connect(ui.buttonFonts, SIGNAL(clicked()), this, SLOT(installFonts()));
|
||||||
ui.buttonThemes->setEnabled(false);
|
connect(ui.buttonGames, SIGNAL(clicked()), this, SLOT(installDoom()));
|
||||||
ui.buttonSmall->setEnabled(false);
|
|
||||||
ui.buttonRemoveRockbox->setEnabled(false);
|
// disable unimplemented stuff
|
||||||
ui.buttonRemoveBootloader->setEnabled(false);
|
ui.buttonThemes->setEnabled(false);
|
||||||
ui.buttonGames->setEnabled(false);
|
ui.buttonSmall->setEnabled(false);
|
||||||
ui.buttonFonts->setEnabled(false);
|
ui.buttonRemoveRockbox->setEnabled(false);
|
||||||
ui.buttonComplete->setEnabled(false);
|
ui.buttonRemoveBootloader->setEnabled(false);
|
||||||
ui.buttonDetect->setEnabled(false);
|
ui.buttonComplete->setEnabled(false);
|
||||||
|
ui.buttonDetect->setEnabled(false);
|
||||||
initIpodpatcher();
|
|
||||||
downloadInfo();
|
initIpodpatcher();
|
||||||
|
downloadInfo();
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
void RbUtilQt::downloadInfo()
|
|
||||||
{
|
void RbUtilQt::downloadInfo()
|
||||||
// try to get the current build information
|
{
|
||||||
daily = new HttpGet(this);
|
// try to get the current build information
|
||||||
connect(daily, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
|
daily = new HttpGet(this);
|
||||||
connect(daily, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool)));
|
connect(daily, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
|
||||||
if(userSettings->value("defaults/proxytype") == "manual")
|
connect(daily, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool)));
|
||||||
daily->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
if(userSettings->value("defaults/proxytype") == "manual")
|
||||||
|
daily->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
||||||
qDebug() << "downloading build info";
|
|
||||||
daily->setFile(&buildInfo);
|
qDebug() << "downloading build info";
|
||||||
daily->getFile(QUrl(devices->value("server_conf_url").toString()));
|
daily->setFile(&buildInfo);
|
||||||
}
|
daily->getFile(QUrl(devices->value("server_conf_url").toString()));
|
||||||
|
}
|
||||||
|
|
||||||
void RbUtilQt::downloadDone(bool error)
|
|
||||||
{
|
void RbUtilQt::downloadDone(bool error)
|
||||||
if(error) qDebug() << "network error:" << daily->error();
|
{
|
||||||
qDebug() << "network status:" << daily->error();
|
if(error) qDebug() << "network error:" << daily->error();
|
||||||
|
qDebug() << "network status:" << daily->error();
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
void RbUtilQt::downloadDone(int id, bool error)
|
|
||||||
{
|
void RbUtilQt::downloadDone(int id, bool error)
|
||||||
QString errorString;
|
{
|
||||||
errorString = tr("Network error: %1. Please check your network and proxy settings.").arg(daily->errorString());
|
QString errorString;
|
||||||
if(error) QMessageBox::about(this, "Network Error", errorString);
|
errorString = tr("Network error: %1. Please check your network and proxy settings.").arg(daily->errorString());
|
||||||
qDebug() << "downloadDone:" << id << error;
|
if(error) QMessageBox::about(this, "Network Error", errorString);
|
||||||
}
|
qDebug() << "downloadDone:" << id << error;
|
||||||
|
}
|
||||||
|
|
||||||
void RbUtilQt::about()
|
|
||||||
{
|
void RbUtilQt::about()
|
||||||
QDialog *window = new QDialog;
|
{
|
||||||
Ui::aboutBox about;
|
QDialog *window = new QDialog;
|
||||||
about.setupUi(window);
|
Ui::aboutBox about;
|
||||||
|
about.setupUi(window);
|
||||||
QFile licence(":/docs/gpl-2.0.html");
|
|
||||||
licence.open(QIODevice::ReadOnly);
|
QFile licence(":/docs/gpl-2.0.html");
|
||||||
QTextStream c(&licence);
|
licence.open(QIODevice::ReadOnly);
|
||||||
QString cline = c.readAll();
|
QTextStream c(&licence);
|
||||||
about.browserLicense->insertHtml(cline);
|
QString cline = c.readAll();
|
||||||
about.browserLicense->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
|
about.browserLicense->insertHtml(cline);
|
||||||
QFile credits(":/docs/CREDITS");
|
about.browserLicense->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
|
||||||
credits.open(QIODevice::ReadOnly);
|
QFile credits(":/docs/CREDITS");
|
||||||
QTextStream r(&credits);
|
credits.open(QIODevice::ReadOnly);
|
||||||
QString rline = r.readAll();
|
QTextStream r(&credits);
|
||||||
about.browserCredits->insertPlainText(rline);
|
QString rline = r.readAll();
|
||||||
about.browserCredits->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
|
about.browserCredits->insertPlainText(rline);
|
||||||
QString title = QString("<b>The Rockbox Utility</b> Version %1").arg(VERSION);
|
about.browserCredits->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
|
||||||
about.labelTitle->setText(title);
|
QString title = QString("<b>The Rockbox Utility</b> Version %1").arg(VERSION);
|
||||||
|
about.labelTitle->setText(title);
|
||||||
window->show();
|
|
||||||
|
window->show();
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
void RbUtilQt::configDialog()
|
|
||||||
{
|
void RbUtilQt::configDialog()
|
||||||
Config *cw = new Config(this);
|
{
|
||||||
cw->setUserSettings(userSettings);
|
Config *cw = new Config(this);
|
||||||
cw->show();
|
cw->setUserSettings(userSettings);
|
||||||
connect(cw, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo()));
|
cw->show();
|
||||||
}
|
connect(cw, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo()));
|
||||||
|
}
|
||||||
|
|
||||||
void RbUtilQt::initDeviceNames()
|
|
||||||
{
|
void RbUtilQt::initDeviceNames()
|
||||||
qDebug() << "RbUtilQt::initDeviceNames()";
|
{
|
||||||
devices->beginGroup("platforms");
|
qDebug() << "RbUtilQt::initDeviceNames()";
|
||||||
QStringList a = devices->childKeys();
|
devices->beginGroup("platforms");
|
||||||
devices->endGroup();
|
QStringList a = devices->childKeys();
|
||||||
|
devices->endGroup();
|
||||||
for(int it = 0; it < a.size(); it++) {
|
|
||||||
QString curdev;
|
for(int it = 0; it < a.size(); it++) {
|
||||||
devices->beginGroup("platforms");
|
QString curdev;
|
||||||
curdev = devices->value(a.at(it), "null").toString();
|
devices->beginGroup("platforms");
|
||||||
devices->endGroup();
|
curdev = devices->value(a.at(it), "null").toString();
|
||||||
QString curname;
|
devices->endGroup();
|
||||||
devices->beginGroup(curdev);
|
QString curname;
|
||||||
curname = devices->value("name", "null").toString();
|
devices->beginGroup(curdev);
|
||||||
devices->endGroup();
|
curname = devices->value("name", "null").toString();
|
||||||
ui.comboBoxDevice->addItem(curname, curdev);
|
devices->endGroup();
|
||||||
}
|
ui.comboBoxDevice->addItem(curname, curdev);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RbUtilQt::updateDevice(int index)
|
|
||||||
{
|
void RbUtilQt::updateDevice(int index)
|
||||||
platform = ui.comboBoxDevice->itemData(index).toString();
|
{
|
||||||
userSettings->setValue("defaults/platform", platform);
|
platform = ui.comboBoxDevice->itemData(index).toString();
|
||||||
userSettings->sync();
|
userSettings->setValue("defaults/platform", platform);
|
||||||
|
userSettings->sync();
|
||||||
devices->beginGroup(platform);
|
|
||||||
if(devices->value("needsbootloader", "") == "no") {
|
devices->beginGroup(platform);
|
||||||
ui.buttonBootloader->setEnabled(false);
|
if(devices->value("needsbootloader", "") == "no") {
|
||||||
ui.buttonRemoveBootloader->setEnabled(false);
|
ui.buttonBootloader->setEnabled(false);
|
||||||
ui.labelBootloader->setEnabled(false);
|
ui.buttonRemoveBootloader->setEnabled(false);
|
||||||
ui.labelRemoveBootloader->setEnabled(false);
|
ui.labelBootloader->setEnabled(false);
|
||||||
}
|
ui.labelRemoveBootloader->setEnabled(false);
|
||||||
else {
|
}
|
||||||
ui.buttonBootloader->setEnabled(true);
|
else {
|
||||||
ui.labelBootloader->setEnabled(true);
|
ui.buttonBootloader->setEnabled(true);
|
||||||
if(devices->value("bootloadermethod") == "fwpatcher") {
|
ui.labelBootloader->setEnabled(true);
|
||||||
ui.labelRemoveBootloader->setEnabled(false);
|
if(devices->value("bootloadermethod") == "fwpatcher") {
|
||||||
ui.buttonRemoveBootloader->setEnabled(false);
|
ui.labelRemoveBootloader->setEnabled(false);
|
||||||
}
|
ui.buttonRemoveBootloader->setEnabled(false);
|
||||||
else {
|
}
|
||||||
ui.labelRemoveBootloader->setEnabled(true);
|
else {
|
||||||
ui.buttonRemoveBootloader->setEnabled(true);
|
ui.labelRemoveBootloader->setEnabled(true);
|
||||||
}
|
ui.buttonRemoveBootloader->setEnabled(true);
|
||||||
}
|
}
|
||||||
devices->endGroup();
|
}
|
||||||
|
devices->endGroup();
|
||||||
qDebug() << "new device selected:" << platform;
|
|
||||||
}
|
qDebug() << "new device selected:" << platform;
|
||||||
|
}
|
||||||
|
|
||||||
void RbUtilQt::install()
|
|
||||||
{
|
void RbUtilQt::install()
|
||||||
Install *installWindow = new Install(this);
|
{
|
||||||
installWindow->setUserSettings(userSettings);
|
Install *installWindow = new Install(this);
|
||||||
installWindow->setDeviceSettings(devices);
|
installWindow->setUserSettings(userSettings);
|
||||||
if(userSettings->value("defaults/proxytype") == "manual")
|
installWindow->setDeviceSettings(devices);
|
||||||
installWindow->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
if(userSettings->value("defaults/proxytype") == "manual")
|
||||||
installWindow->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
installWindow->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
||||||
|
installWindow->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
||||||
buildInfo.open();
|
|
||||||
QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
|
buildInfo.open();
|
||||||
buildInfo.close();
|
QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
|
||||||
installWindow->setArchivedString(info.value("dailies/date").toString());
|
buildInfo.close();
|
||||||
|
installWindow->setArchivedString(info.value("dailies/date").toString());
|
||||||
devices->beginGroup(platform);
|
|
||||||
QString released = devices->value("released").toString();
|
devices->beginGroup(platform);
|
||||||
devices->endGroup();
|
QString released = devices->value("released").toString();
|
||||||
if(released == "yes")
|
devices->endGroup();
|
||||||
installWindow->setReleased(devices->value("last_release", "").toString());
|
if(released == "yes")
|
||||||
else
|
installWindow->setReleased(devices->value("last_release", "").toString());
|
||||||
installWindow->setReleased(0);
|
else
|
||||||
|
installWindow->setReleased(0);
|
||||||
installWindow->show();
|
|
||||||
}
|
installWindow->show();
|
||||||
|
}
|
||||||
void RbUtilQt::installBl()
|
|
||||||
{
|
void RbUtilQt::installBl()
|
||||||
InstallBl *installWindow = new InstallBl(this);
|
{
|
||||||
installWindow->setUserSettings(userSettings);
|
InstallBl *installWindow = new InstallBl(this);
|
||||||
installWindow->setDeviceSettings(devices);
|
installWindow->setUserSettings(userSettings);
|
||||||
if(userSettings->value("defaults/proxytype") == "manual")
|
installWindow->setDeviceSettings(devices);
|
||||||
installWindow->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
if(userSettings->value("defaults/proxytype") == "manual")
|
||||||
installWindow->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
installWindow->setProxy(QUrl(userSettings->value("defaults/proxy").toString()));
|
||||||
|
installWindow->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
||||||
installWindow->show();
|
|
||||||
}
|
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();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,58 +1,60 @@
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* __________ __ ___.
|
* __________ __ ___.
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
* \/ \/ \/ \/ \/
|
* \/ \/ \/ \/ \/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 by Dominik Riebeling
|
* Copyright (C) 2007 by Dominik Riebeling
|
||||||
* $Id$
|
* $Id$
|
||||||
*
|
*
|
||||||
* All files in this archive are subject to the GNU General Public License.
|
* 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.
|
* 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
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#ifndef QRBUTIL_H
|
#ifndef QRBUTIL_H
|
||||||
#define QRBUTIL_H
|
#define QRBUTIL_H
|
||||||
|
|
||||||
#include "ui_rbutilqtfrm.h"
|
#include "ui_rbutilqtfrm.h"
|
||||||
#include "httpget.h"
|
#include "httpget.h"
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QTemporaryFile>
|
#include <QTemporaryFile>
|
||||||
|
|
||||||
class RbUtilQt : public QMainWindow
|
class RbUtilQt : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RbUtilQt(QWidget *parent = 0);
|
RbUtilQt(QWidget *parent = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::RbUtilQtFrm ui;
|
Ui::RbUtilQtFrm ui;
|
||||||
QSettings *devices;
|
QSettings *devices;
|
||||||
QSettings *userSettings;
|
QSettings *userSettings;
|
||||||
void initDeviceNames(void);
|
void initDeviceNames(void);
|
||||||
QString deviceName(QString);
|
QString deviceName(QString);
|
||||||
QString platform;
|
QString platform;
|
||||||
HttpGet *daily;
|
HttpGet *daily;
|
||||||
QString absolutePath;
|
QString absolutePath;
|
||||||
QTemporaryFile buildInfo;
|
QTemporaryFile buildInfo;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void about(void);
|
void about(void);
|
||||||
void configDialog(void);
|
void configDialog(void);
|
||||||
void updateDevice(int);
|
void updateDevice(int);
|
||||||
void install(void);
|
void install(void);
|
||||||
void installBl(void);
|
void installBl(void);
|
||||||
void downloadDone(bool);
|
void installFonts(void);
|
||||||
void downloadDone(int, bool);
|
void installDoom(void);
|
||||||
void downloadInfo(void);
|
void downloadDone(bool);
|
||||||
};
|
void downloadDone(int, bool);
|
||||||
|
void downloadInfo(void);
|
||||||
#endif
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,68 +1,74 @@
|
||||||
SOURCES += rbutilqt.cpp \
|
SOURCES += rbutilqt.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
install.cpp \
|
install.cpp \
|
||||||
httpget.cpp \
|
httpget.cpp \
|
||||||
configure.cpp \
|
configure.cpp \
|
||||||
zip/zip.cpp \
|
zip/zip.cpp \
|
||||||
zip/unzip.cpp \
|
zip/unzip.cpp \
|
||||||
installzip.cpp \
|
installzip.cpp \
|
||||||
installbootloader.cpp \
|
installbootloader.cpp \
|
||||||
installbl.cpp \
|
installbl.cpp \
|
||||||
../ipodpatcher/ipodpatcher.c \
|
installzipwindow.cpp \
|
||||||
../sansapatcher/sansapatcher.c \
|
../ipodpatcher/ipodpatcher.c \
|
||||||
irivertools/irivertools.cpp \
|
../sansapatcher/sansapatcher.c \
|
||||||
irivertools/md5sum.cpp
|
irivertools/irivertools.cpp \
|
||||||
|
irivertools/md5sum.cpp
|
||||||
|
|
||||||
HEADERS += rbutilqt.h \
|
|
||||||
settings.h \
|
HEADERS += rbutilqt.h \
|
||||||
install.h \
|
settings.h \
|
||||||
httpget.h \
|
install.h \
|
||||||
configure.h \
|
httpget.h \
|
||||||
zip/zip.h \
|
configure.h \
|
||||||
zip/unzip.h \
|
zip/zip.h \
|
||||||
zip/zipentry_p.h \
|
zip/unzip.h \
|
||||||
zip/unzip_p.h \
|
zip/zipentry_p.h \
|
||||||
zip/zip_p.h \
|
zip/unzip_p.h \
|
||||||
version.h \
|
zip/zip_p.h \
|
||||||
installzip.h \
|
version.h \
|
||||||
installbootloader.h \
|
installzip.h \
|
||||||
installbl.h \
|
installbootloader.h \
|
||||||
../ipodpatcher/ipodpatcher.h \
|
installbl.h \
|
||||||
../ipodpatcher/ipodio.h \
|
installzipwindow.h \
|
||||||
../ipodpatcher/parttypes.h \
|
../ipodpatcher/ipodpatcher.h \
|
||||||
../sansapatcher/sansapatcher.h \
|
../ipodpatcher/ipodio.h \
|
||||||
../sansapatcher/sansaio.h \
|
../ipodpatcher/parttypes.h \
|
||||||
irivertools/irivertools.h \
|
../sansapatcher/sansapatcher.h \
|
||||||
irivertools/md5sum.h \
|
../sansapatcher/sansaio.h \
|
||||||
irivertools/h100sums.h \
|
irivertools/irivertools.h \
|
||||||
irivertools/h120sums.h \
|
irivertools/md5sum.h \
|
||||||
irivertools/h300sums.h
|
irivertools/h100sums.h \
|
||||||
|
irivertools/h120sums.h \
|
||||||
TEMPLATE = app
|
irivertools/h300sums.h
|
||||||
CONFIG += release \
|
|
||||||
warn_on \
|
TEMPLATE = app
|
||||||
thread \
|
CONFIG += release \
|
||||||
qt
|
warn_on \
|
||||||
TARGET = rbutilqt
|
thread \
|
||||||
FORMS += rbutilqtfrm.ui \
|
qt
|
||||||
aboutbox.ui \
|
TARGET = rbutilqt
|
||||||
installfrm.ui \
|
|
||||||
installprogressfrm.ui \
|
FORMS += rbutilqtfrm.ui \
|
||||||
configurefrm.ui \
|
aboutbox.ui \
|
||||||
installbootloaderfrm.ui
|
installfrm.ui \
|
||||||
RESOURCES += rbutilqt.qrc
|
installprogressfrm.ui \
|
||||||
|
configurefrm.ui \
|
||||||
TRANSLATIONS += rbutil_de.ts
|
installbootloaderfrm.ui \
|
||||||
QT += network
|
installzipfrm.ui
|
||||||
DEFINES += RBUTIL
|
|
||||||
|
|
||||||
win32{
|
RESOURCES += rbutilqt.qrc
|
||||||
SOURCES += ../ipodpatcher/ipodio-win32.c
|
|
||||||
SOURCES += ../sansapatcher/sansaio-win32.c
|
TRANSLATIONS += rbutil_de.ts
|
||||||
}
|
QT += network
|
||||||
|
DEFINES += RBUTIL
|
||||||
unix{
|
|
||||||
SOURCES += ../ipodpatcher/ipodio-posix.c
|
win32{
|
||||||
SOURCES += ../sansapatcher/sansaio-posix.c
|
SOURCES += ../ipodpatcher/ipodio-win32.c
|
||||||
}
|
SOURCES += ../sansapatcher/sansaio-win32.c
|
||||||
|
}
|
||||||
|
|
||||||
|
unix{
|
||||||
|
SOURCES += ../ipodpatcher/ipodio-posix.c
|
||||||
|
SOURCES += ../sansapatcher/sansaio-posix.c
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue