forked from len0rd/rockbox
rbtutil: introduce a RbSettings class help code reuse, and minimises duplicated code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16159 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a665d99d3a
commit
3a54c9b58d
25 changed files with 1011 additions and 481 deletions
|
@ -97,49 +97,49 @@ void Config::accept()
|
||||||
proxy.setHost(ui.proxyHost->text());
|
proxy.setHost(ui.proxyHost->text());
|
||||||
proxy.setPort(ui.proxyPort->text().toInt());
|
proxy.setPort(ui.proxyPort->text().toInt());
|
||||||
}
|
}
|
||||||
userSettings->setValue("proxy", proxy.toString());
|
|
||||||
|
settings->setProxy(proxy.toString());
|
||||||
qDebug() << "new proxy:" << proxy;
|
qDebug() << "new proxy:" << proxy;
|
||||||
// proxy type
|
// proxy type
|
||||||
QString proxyType;
|
QString proxyType;
|
||||||
if(ui.radioNoProxy->isChecked()) proxyType = "none";
|
if(ui.radioNoProxy->isChecked()) proxyType = "none";
|
||||||
else if(ui.radioSystemProxy->isChecked()) proxyType = "system";
|
else if(ui.radioSystemProxy->isChecked()) proxyType = "system";
|
||||||
else proxyType = "manual";
|
else proxyType = "manual";
|
||||||
userSettings->setValue("proxytype", proxyType);
|
settings->setProxyType(proxyType);
|
||||||
|
|
||||||
// language
|
// language
|
||||||
if(userSettings->value("lang").toString() != language)
|
if(settings->curLang() != language)
|
||||||
QMessageBox::information(this, tr("Language changed"),
|
QMessageBox::information(this, tr("Language changed"),
|
||||||
tr("You need to restart the application for the changed language to take effect."));
|
tr("You need to restart the application for the changed language to take effect."));
|
||||||
userSettings->setValue("lang", language);
|
settings->setLang(language);
|
||||||
|
|
||||||
// mountpoint
|
// mountpoint
|
||||||
QString mp = ui.mountPoint->text();
|
QString mp = ui.mountPoint->text();
|
||||||
if(QFileInfo(mp).isDir())
|
if(QFileInfo(mp).isDir())
|
||||||
userSettings->setValue("mountpoint", mp);
|
settings->setMountpoint( mp);
|
||||||
|
|
||||||
// platform
|
// platform
|
||||||
QString nplat;
|
QString nplat;
|
||||||
if(ui.treeDevices->selectedItems().size() != 0) {
|
if(ui.treeDevices->selectedItems().size() != 0) {
|
||||||
nplat = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString();
|
nplat = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString();
|
||||||
userSettings->setValue("platform", nplat);
|
settings->setCurPlatform(nplat);
|
||||||
}
|
}
|
||||||
|
|
||||||
// cache settings
|
// cache settings
|
||||||
if(QFileInfo(ui.cachePath->text()).isDir())
|
if(QFileInfo(ui.cachePath->text()).isDir())
|
||||||
userSettings->setValue("cachepath", ui.cachePath->text());
|
settings->setCachePath(ui.cachePath->text());
|
||||||
else // default to system temp path
|
else // default to system temp path
|
||||||
userSettings->setValue("cachepath", QDir::tempPath());
|
settings->setCachePath( QDir::tempPath());
|
||||||
userSettings->setValue("cachedisable", ui.cacheDisable->isChecked());
|
settings->setCacheDisable(ui.cacheDisable->isChecked());
|
||||||
userSettings->setValue("offline", ui.cacheOfflineMode->isChecked());
|
settings->setCacheOffline(ui.cacheOfflineMode->isChecked());
|
||||||
|
|
||||||
// tts settings
|
// tts settings
|
||||||
userSettings->setValue("tts",ui.comboTts->currentText());
|
settings->setCurTTS(ui.comboTts->currentText());
|
||||||
|
|
||||||
//encoder settings
|
//encoder settings
|
||||||
userSettings->setValue("encoder",ui.comboEncoder->currentText());
|
settings->setCurEncoder(ui.comboEncoder->currentText());
|
||||||
|
|
||||||
// sync settings
|
// sync settings
|
||||||
userSettings->sync();
|
settings->sync();
|
||||||
this->close();
|
this->close();
|
||||||
emit settingsUpdated();
|
emit settingsUpdated();
|
||||||
}
|
}
|
||||||
|
@ -151,10 +151,9 @@ void Config::abort()
|
||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::setSettings(QSettings* user,QSettings* device)
|
void Config::setSettings(RbSettings* sett)
|
||||||
{
|
{
|
||||||
userSettings = user;
|
settings = sett;
|
||||||
devices = device;
|
|
||||||
|
|
||||||
setUserSettings();
|
setUserSettings();
|
||||||
setDevices();
|
setDevices();
|
||||||
|
@ -163,7 +162,7 @@ void Config::setSettings(QSettings* user,QSettings* device)
|
||||||
void Config::setUserSettings()
|
void Config::setUserSettings()
|
||||||
{
|
{
|
||||||
// set proxy
|
// set proxy
|
||||||
proxy = userSettings->value("proxy").toString();
|
proxy = settings->proxy();
|
||||||
|
|
||||||
if(proxy.port() > 0)
|
if(proxy.port() > 0)
|
||||||
ui.proxyPort->setText(QString("%1").arg(proxy.port()));
|
ui.proxyPort->setText(QString("%1").arg(proxy.port()));
|
||||||
|
@ -172,7 +171,7 @@ void Config::setUserSettings()
|
||||||
ui.proxyUser->setText(proxy.userName());
|
ui.proxyUser->setText(proxy.userName());
|
||||||
ui.proxyPass->setText(proxy.password());
|
ui.proxyPass->setText(proxy.password());
|
||||||
|
|
||||||
QString proxyType = userSettings->value("proxytype", "system").toString();
|
QString proxyType = settings->proxyType();
|
||||||
if(proxyType == "manual") ui.radioManualProxy->setChecked(true);
|
if(proxyType == "manual") ui.radioManualProxy->setChecked(true);
|
||||||
else if(proxyType == "system") ui.radioSystemProxy->setChecked(true);
|
else if(proxyType == "system") ui.radioSystemProxy->setChecked(true);
|
||||||
else ui.radioNoProxy->setChecked(true);
|
else ui.radioNoProxy->setChecked(true);
|
||||||
|
@ -183,7 +182,7 @@ void Config::setUserSettings()
|
||||||
// find key for lang value
|
// find key for lang value
|
||||||
QMap<QString, QString>::const_iterator i = lang.constBegin();
|
QMap<QString, QString>::const_iterator i = lang.constBegin();
|
||||||
while (i != lang.constEnd()) {
|
while (i != lang.constEnd()) {
|
||||||
if(i.value() == userSettings->value("lang").toString()) {
|
if(i.value() == settings->curLang()) {
|
||||||
b = i.key();
|
b = i.key();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -196,15 +195,15 @@ void Config::setUserSettings()
|
||||||
ui.listLanguages->setCurrentItem(a.at(0));
|
ui.listLanguages->setCurrentItem(a.at(0));
|
||||||
|
|
||||||
// devices tab
|
// devices tab
|
||||||
ui.mountPoint->setText(userSettings->value("mountpoint").toString());
|
ui.mountPoint->setText(settings->mountpoint());
|
||||||
|
|
||||||
// cache tab
|
// cache tab
|
||||||
if(!QFileInfo(userSettings->value("cachepath").toString()).isDir())
|
if(!QFileInfo(settings->cachePath()).isDir())
|
||||||
userSettings->setValue("cachepath", QDir::tempPath());
|
settings->setCachePath(QDir::tempPath());
|
||||||
ui.cachePath->setText(userSettings->value("cachepath").toString());
|
ui.cachePath->setText(settings->cachePath());
|
||||||
ui.cacheDisable->setChecked(userSettings->value("cachedisable", true).toBool());
|
ui.cacheDisable->setChecked(settings->cacheDisabled());
|
||||||
ui.cacheOfflineMode->setChecked(userSettings->value("offline").toBool());
|
ui.cacheOfflineMode->setChecked(settings->cacheOffline());
|
||||||
updateCacheInfo(userSettings->value("cachepath").toString());
|
updateCacheInfo(settings->cachePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -227,28 +226,21 @@ void Config::setDevices()
|
||||||
|
|
||||||
// setup devices table
|
// setup devices table
|
||||||
qDebug() << "Config::setDevices()";
|
qDebug() << "Config::setDevices()";
|
||||||
devices->beginGroup("platforms");
|
|
||||||
QStringList a = devices->childKeys();
|
QStringList platformList = settings->allPlatforms();
|
||||||
devices->endGroup();
|
|
||||||
|
|
||||||
QMap <QString, QString> manuf;
|
QMap <QString, QString> manuf;
|
||||||
QMap <QString, QString> devcs;
|
QMap <QString, QString> devcs;
|
||||||
for(int it = 0; it < a.size(); it++) {
|
for(int it = 0; it < platformList.size(); it++)
|
||||||
QString curdev;
|
{
|
||||||
devices->beginGroup("platforms");
|
QString curname = settings->name(platformList.at(it));
|
||||||
curdev = devices->value(a.at(it), "null").toString();
|
QString curbrand = settings->brand(platformList.at(it));
|
||||||
devices->endGroup();
|
manuf.insertMulti(curbrand, platformList.at(it));
|
||||||
QString curname;
|
devcs.insert(platformList.at(it), curname);
|
||||||
devices->beginGroup(curdev);
|
|
||||||
curname = devices->value("name", "null").toString();
|
|
||||||
QString curbrand = devices->value("brand", "").toString();
|
|
||||||
devices->endGroup();
|
|
||||||
manuf.insertMulti(curbrand, curdev);
|
|
||||||
devcs.insert(curdev, curname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString platform;
|
QString platform;
|
||||||
platform = devcs.value(userSettings->value("platform").toString());
|
platform = devcs.value(settings->curPlatform());
|
||||||
|
|
||||||
// set up devices table
|
// set up devices table
|
||||||
ui.treeDevices->header()->hide();
|
ui.treeDevices->header()->hide();
|
||||||
|
@ -269,25 +261,16 @@ void Config::setDevices()
|
||||||
items.append(w);
|
items.append(w);
|
||||||
|
|
||||||
// go through platforms again for sake of order
|
// go through platforms again for sake of order
|
||||||
for(int it = 0; it < a.size(); it++) {
|
for(int it = 0; it < platformList.size(); it++) {
|
||||||
QString curdev;
|
|
||||||
devices->beginGroup("platforms");
|
QString curname = settings->name(platformList.at(it));
|
||||||
curdev = devices->value(a.at(it), "null").toString();
|
QString curbrand = settings->brand(platformList.at(it));
|
||||||
devices->endGroup();
|
|
||||||
QString curname;
|
|
||||||
devices->beginGroup(curdev);
|
|
||||||
curname = devices->value("name", "null").toString();
|
|
||||||
QString curbrand = devices->value("brand", "").toString();
|
|
||||||
QString curicon = devices->value("icon", "").toString();
|
|
||||||
devices->endGroup();
|
|
||||||
if(curbrand != brands.at(c)) continue;
|
if(curbrand != brands.at(c)) continue;
|
||||||
qDebug() << "adding:" << brands.at(c) << curname << curdev;
|
qDebug() << "adding:" << brands.at(c) << curname;
|
||||||
w2 = new QTreeWidgetItem(w, QStringList(curname));
|
w2 = new QTreeWidgetItem(w, QStringList(curname));
|
||||||
w2->setData(0, Qt::UserRole, curdev);
|
w2->setData(0, Qt::UserRole, platformList.at(it));
|
||||||
// QIcon icon;
|
|
||||||
// icon.addFile(":/icons/devices/" + curicon + "-tiny.png");
|
|
||||||
// w2->setIcon(0, icon);
|
|
||||||
// ui.treeDevices->setIconSize(QSize(32, 32));
|
|
||||||
if(platform.contains(curname)) {
|
if(platform.contains(curname)) {
|
||||||
w2->setSelected(true);
|
w2->setSelected(true);
|
||||||
w->setExpanded(true);
|
w->setExpanded(true);
|
||||||
|
@ -306,7 +289,7 @@ void Config::setDevices()
|
||||||
ui.comboEncoder->addItems(getEncoderList());
|
ui.comboEncoder->addItems(getEncoderList());
|
||||||
|
|
||||||
//update index of combobox
|
//update index of combobox
|
||||||
int index = ui.comboEncoder->findText(userSettings->value("encoder").toString(),Qt::MatchExactly);
|
int index = ui.comboEncoder->findText(settings->curEncoder(),Qt::MatchExactly);
|
||||||
if(index < 0) index = 0;
|
if(index < 0) index = 0;
|
||||||
ui.comboEncoder->setCurrentIndex(index);
|
ui.comboEncoder->setCurrentIndex(index);
|
||||||
updateEncState(index);
|
updateEncState(index);
|
||||||
|
@ -316,7 +299,7 @@ void Config::setDevices()
|
||||||
|
|
||||||
|
|
||||||
//update index of combobox
|
//update index of combobox
|
||||||
index = ui.comboTts->findText(userSettings->value("tts").toString(),Qt::MatchExactly);
|
index = ui.comboTts->findText(settings->curTTS(),Qt::MatchExactly);
|
||||||
if(index < 0) index = 0;
|
if(index < 0) index = 0;
|
||||||
ui.comboTts->setCurrentIndex(index);
|
ui.comboTts->setCurrentIndex(index);
|
||||||
updateTtsState(index);
|
updateTtsState(index);
|
||||||
|
@ -328,7 +311,7 @@ void Config::updateTtsState(int index)
|
||||||
{
|
{
|
||||||
QString ttsName = ui.comboTts->itemText(index);
|
QString ttsName = ui.comboTts->itemText(index);
|
||||||
TTSBase* tts = getTTS(ttsName);
|
TTSBase* tts = getTTS(ttsName);
|
||||||
tts->setCfg(userSettings,devices);
|
tts->setCfg(settings);
|
||||||
|
|
||||||
if(tts->configOk())
|
if(tts->configOk())
|
||||||
{
|
{
|
||||||
|
@ -346,7 +329,7 @@ void Config::updateEncState(int index)
|
||||||
{
|
{
|
||||||
QString encoder = ui.comboEncoder->itemText(index);
|
QString encoder = ui.comboEncoder->itemText(index);
|
||||||
EncBase* enc = getEncoder(encoder);
|
EncBase* enc = getEncoder(encoder);
|
||||||
enc->setUserCfg(userSettings);
|
enc->setCfg(settings);
|
||||||
|
|
||||||
if(enc->configOk())
|
if(enc->configOk())
|
||||||
{
|
{
|
||||||
|
@ -594,7 +577,7 @@ void Config::cacheClear()
|
||||||
QFile::remove(f);
|
QFile::remove(f);
|
||||||
qDebug() << "removed:" << f;
|
qDebug() << "removed:" << f;
|
||||||
}
|
}
|
||||||
updateCacheInfo(userSettings->value("cachepath").toString());
|
updateCacheInfo(settings->cachePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -602,7 +585,7 @@ void Config::configTts()
|
||||||
{
|
{
|
||||||
TTSBase* tts =getTTS(ui.comboTts->currentText());
|
TTSBase* tts =getTTS(ui.comboTts->currentText());
|
||||||
|
|
||||||
tts->setCfg(userSettings,devices);
|
tts->setCfg(settings);
|
||||||
tts->showCfg();
|
tts->showCfg();
|
||||||
updateTtsState(ui.comboTts->currentIndex());
|
updateTtsState(ui.comboTts->currentIndex());
|
||||||
}
|
}
|
||||||
|
@ -612,7 +595,7 @@ void Config::configEnc()
|
||||||
{
|
{
|
||||||
EncBase* enc =getEncoder(ui.comboEncoder->currentText());
|
EncBase* enc =getEncoder(ui.comboEncoder->currentText());
|
||||||
|
|
||||||
enc->setUserCfg(userSettings);
|
enc->setCfg(settings);
|
||||||
enc->showCfg();
|
enc->showCfg();
|
||||||
updateEncState(ui.comboEncoder->currentIndex());
|
updateEncState(ui.comboEncoder->currentIndex());
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "ui_configurefrm.h"
|
#include "ui_configurefrm.h"
|
||||||
#include "browsedirtree.h"
|
#include "browsedirtree.h"
|
||||||
|
#include "rbsettings.h"
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
||||||
class Config : public QDialog
|
class Config : public QDialog
|
||||||
|
@ -29,7 +30,7 @@ class Config : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Config(QWidget *parent = 0,int index=0);
|
Config(QWidget *parent = 0,int index=0);
|
||||||
void setSettings(QSettings* user,QSettings* device);
|
void setSettings(RbSettings* sett);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void settingsUpdated(void);
|
void settingsUpdated(void);
|
||||||
|
@ -43,8 +44,8 @@ class Config : public QDialog
|
||||||
void setDevices();
|
void setDevices();
|
||||||
|
|
||||||
Ui::ConfigForm ui;
|
Ui::ConfigForm ui;
|
||||||
QSettings *userSettings;
|
RbSettings* settings;
|
||||||
QSettings *devices;
|
|
||||||
QStringList findLanguageFiles(void);
|
QStringList findLanguageFiles(void);
|
||||||
QString languageName(const QString&);
|
QString languageName(const QString&);
|
||||||
QMap<QString, QString> lang;
|
QMap<QString, QString> lang;
|
||||||
|
|
|
@ -34,7 +34,7 @@ CreateVoiceWindow::CreateVoiceWindow(QWidget *parent) : QDialog(parent)
|
||||||
void CreateVoiceWindow::change()
|
void CreateVoiceWindow::change()
|
||||||
{
|
{
|
||||||
Config *cw = new Config(this,4);
|
Config *cw = new Config(this,4);
|
||||||
cw->setSettings(userSettings,devices);
|
cw->setSettings(settings);
|
||||||
cw->show();
|
cw->show();
|
||||||
connect(cw, SIGNAL(settingsUpdated()), this, SIGNAL(settingsUpdated()));
|
connect(cw, SIGNAL(settingsUpdated()), this, SIGNAL(settingsUpdated()));
|
||||||
}
|
}
|
||||||
|
@ -45,19 +45,18 @@ void CreateVoiceWindow::accept()
|
||||||
logger->show();
|
logger->show();
|
||||||
connect(logger,SIGNAL(closed()),this,SLOT(close()));
|
connect(logger,SIGNAL(closed()),this,SLOT(close()));
|
||||||
|
|
||||||
QString platform = userSettings->value("platform").toString();
|
|
||||||
QString lang = ui.comboLanguage->currentText();
|
QString lang = ui.comboLanguage->currentText();
|
||||||
int wvThreshold = ui.wavtrimthreshold->value();
|
int wvThreshold = ui.wavtrimthreshold->value();
|
||||||
|
|
||||||
//safe selected language
|
//safe selected language
|
||||||
userSettings->setValue("voicelanguage",lang);
|
settings->setVoiceLanguage(lang);
|
||||||
userSettings->setValue("wavtrimthreshold",wvThreshold);
|
settings->setWavtrimTh(wvThreshold);
|
||||||
userSettings->sync();
|
settings->sync();
|
||||||
|
|
||||||
//configure voicecreator
|
//configure voicecreator
|
||||||
voicecreator->setSettings(userSettings,devices);
|
voicecreator->setSettings(settings);
|
||||||
voicecreator->setMountPoint(userSettings->value("mountpoint").toString());
|
voicecreator->setMountPoint(settings->mountpoint());
|
||||||
voicecreator->setTargetId(devices->value(platform + "/targetid").toInt());
|
voicecreator->setTargetId(settings->curTargetId());
|
||||||
voicecreator->setLang(lang);
|
voicecreator->setLang(lang);
|
||||||
voicecreator->setProxy(m_proxy);
|
voicecreator->setProxy(m_proxy);
|
||||||
voicecreator->setWavtrimThreshold(wvThreshold);
|
voicecreator->setWavtrimThreshold(wvThreshold);
|
||||||
|
@ -68,44 +67,34 @@ void CreateVoiceWindow::accept()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CreateVoiceWindow::setSettings(QSettings *user,QSettings *dev)
|
void CreateVoiceWindow::setSettings(RbSettings* sett)
|
||||||
{
|
{
|
||||||
devices = dev;
|
settings = sett;
|
||||||
userSettings = user;
|
|
||||||
qDebug() << "Install::setDeviceSettings:" << devices;
|
|
||||||
|
|
||||||
// fill in language combobox
|
// fill in language combobox
|
||||||
devices->beginGroup("languages");
|
QStringList languages = settings->allLanguages();
|
||||||
QStringList keys = devices->allKeys();
|
|
||||||
QStringList languages;
|
|
||||||
for(int i =0 ; i < keys.size();i++)
|
|
||||||
{
|
|
||||||
languages << devices->value(keys.at(i)).toString();
|
|
||||||
}
|
|
||||||
devices->endGroup();
|
|
||||||
|
|
||||||
languages.sort();
|
languages.sort();
|
||||||
ui.comboLanguage->addItems(languages);
|
ui.comboLanguage->addItems(languages);
|
||||||
// set saved lang
|
// set saved lang
|
||||||
ui.comboLanguage->setCurrentIndex(ui.comboLanguage->findText(userSettings->value("voicelanguage").toString()));
|
ui.comboLanguage->setCurrentIndex(ui.comboLanguage->findText(settings->voiceLanguage()));
|
||||||
|
|
||||||
QString ttsName = userSettings->value("tts", "none").toString();
|
QString ttsName = settings->curTTS();
|
||||||
TTSBase* tts = getTTS(ttsName);
|
TTSBase* tts = getTTS(ttsName);
|
||||||
tts->setCfg(userSettings,devices);
|
tts->setCfg(settings);
|
||||||
if(tts->configOk())
|
if(tts->configOk())
|
||||||
ui.labelTtsProfile->setText(tr("Selected TTS engine : <b>%1</b>").arg(ttsName));
|
ui.labelTtsProfile->setText(tr("Selected TTS engine : <b>%1</b>").arg(ttsName));
|
||||||
else
|
else
|
||||||
ui.labelTtsProfile->setText(tr("Selected TTS Engine: <b>%1</b>").arg("Invalid TTS configuration!"));
|
ui.labelTtsProfile->setText(tr("Selected TTS Engine: <b>%1</b>").arg("Invalid TTS configuration!"));
|
||||||
|
|
||||||
QString encoder = userSettings->value("encoder", "none").toString();
|
QString encoder = settings->curEncoder();
|
||||||
EncBase* enc = getEncoder(encoder);
|
EncBase* enc = getEncoder(encoder);
|
||||||
enc->setUserCfg(userSettings);
|
enc->setCfg(settings);
|
||||||
if(enc->configOk())
|
if(enc->configOk())
|
||||||
ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg(encoder));
|
ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg(encoder));
|
||||||
else
|
else
|
||||||
ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg("Invalid encoder configuration!"));
|
ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg("Invalid encoder configuration!"));
|
||||||
|
|
||||||
ui.wavtrimthreshold->setValue(userSettings->value("wavtrimthreshold", 500).toInt());
|
ui.wavtrimthreshold->setValue(settings->wavtrimTh());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,18 +22,17 @@
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
||||||
#include <QSettings>
|
|
||||||
|
|
||||||
#include "ui_createvoicefrm.h"
|
#include "ui_createvoicefrm.h"
|
||||||
#include "progressloggergui.h"
|
#include "progressloggergui.h"
|
||||||
#include "voicefile.h"
|
#include "voicefile.h"
|
||||||
|
#include "rbsettings.h"
|
||||||
|
|
||||||
class CreateVoiceWindow : public QDialog
|
class CreateVoiceWindow : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
CreateVoiceWindow(QWidget *parent = 0);
|
CreateVoiceWindow(QWidget *parent = 0);
|
||||||
void setSettings(QSettings* user,QSettings* device);
|
void setSettings(RbSettings* sett);
|
||||||
void setProxy(QUrl proxy){m_proxy = proxy;}
|
void setProxy(QUrl proxy){m_proxy = proxy;}
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -47,8 +46,7 @@ class CreateVoiceWindow : public QDialog
|
||||||
VoiceFileCreator* voicecreator;
|
VoiceFileCreator* voicecreator;
|
||||||
Ui::CreateVoiceFrm ui;
|
Ui::CreateVoiceFrm ui;
|
||||||
ProgressLoggerGui* logger;
|
ProgressLoggerGui* logger;
|
||||||
QSettings *devices;
|
RbSettings* settings;
|
||||||
QSettings *userSettings;
|
|
||||||
QUrl m_proxy;
|
QUrl m_proxy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -101,10 +101,8 @@ EncExes::EncExes(QString name,QWidget *parent) : EncBase(parent)
|
||||||
|
|
||||||
bool EncExes::start()
|
bool EncExes::start()
|
||||||
{
|
{
|
||||||
userSettings->beginGroup(m_name);
|
m_EncExec = settings->encoderPath(m_name);
|
||||||
m_EncExec = userSettings->value("encoderpath","").toString();
|
m_EncOpts = settings->encoderOptions(m_name);
|
||||||
m_EncOpts = userSettings->value("encoderoptions","").toString();
|
|
||||||
userSettings->endGroup();
|
|
||||||
|
|
||||||
m_EncTemplate = m_TemplateMap.value(m_name);
|
m_EncTemplate = m_TemplateMap.value(m_name);
|
||||||
|
|
||||||
|
@ -142,10 +140,8 @@ void EncExes::reset()
|
||||||
void EncExes::showCfg()
|
void EncExes::showCfg()
|
||||||
{
|
{
|
||||||
// try to get config from settings
|
// try to get config from settings
|
||||||
userSettings->beginGroup(m_name);
|
QString exepath =settings->encoderPath(m_name);
|
||||||
QString exepath =userSettings->value("encoderpath","").toString();
|
ui.encoderoptions->setText(settings->encoderOptions(m_name));
|
||||||
ui.encoderoptions->setText(userSettings->value("encoderoptions","").toString());
|
|
||||||
userSettings->endGroup();
|
|
||||||
|
|
||||||
if(exepath == "")
|
if(exepath == "")
|
||||||
{
|
{
|
||||||
|
@ -184,16 +180,12 @@ void EncExes::showCfg()
|
||||||
|
|
||||||
void EncExes::accept(void)
|
void EncExes::accept(void)
|
||||||
{
|
{
|
||||||
if(userSettings != NULL)
|
//save settings in user config
|
||||||
{
|
settings->setEncoderPath(m_name,ui.encoderpath->text());
|
||||||
//save settings in user config
|
settings->setEncoderOptions(m_name,ui.encoderoptions->text());
|
||||||
userSettings->beginGroup(m_name);
|
|
||||||
userSettings->setValue("encoderpath",ui.encoderpath->text());
|
// sync settings
|
||||||
userSettings->setValue("encoderoptions",ui.encoderoptions->text());
|
settings->sync();
|
||||||
userSettings->endGroup();
|
|
||||||
// sync settings
|
|
||||||
userSettings->sync();
|
|
||||||
}
|
|
||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,9 +196,7 @@ void EncExes::reject(void)
|
||||||
|
|
||||||
bool EncExes::configOk()
|
bool EncExes::configOk()
|
||||||
{
|
{
|
||||||
userSettings->beginGroup(m_name);
|
QString path = settings->encoderPath(m_name);
|
||||||
QString path = userSettings->value("encoderpath","").toString();
|
|
||||||
userSettings->endGroup();
|
|
||||||
|
|
||||||
if (QFileInfo(path).exists())
|
if (QFileInfo(path).exists())
|
||||||
return true;
|
return true;
|
||||||
|
@ -251,19 +241,13 @@ EncRbSpeex::EncRbSpeex(QWidget *parent) : EncBase(parent)
|
||||||
|
|
||||||
bool EncRbSpeex::start()
|
bool EncRbSpeex::start()
|
||||||
{
|
{
|
||||||
// no user config
|
|
||||||
if(userSettings == NULL)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// try to get config from settings
|
|
||||||
userSettings->beginGroup("rbspeex");
|
|
||||||
quality = userSettings->value("quality",defaultQuality).toDouble();
|
|
||||||
complexity = userSettings->value("complexity",defaultComplexity).toInt();
|
|
||||||
volume =userSettings->value("volume",defaultVolume).toDouble();
|
|
||||||
narrowband = userSettings->value("narrowband",false).toBool();
|
|
||||||
|
|
||||||
userSettings->endGroup();
|
// try to get config from settings
|
||||||
|
quality = settings->encoderQuality("rbspeex");
|
||||||
|
complexity = settings->encoderComplexity("rbspeex");
|
||||||
|
volume = settings->encoderVolume("rbspeex");
|
||||||
|
narrowband = settings->encoderNarrowband("rbspeex");
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -309,37 +293,29 @@ void EncRbSpeex::reset()
|
||||||
void EncRbSpeex::showCfg()
|
void EncRbSpeex::showCfg()
|
||||||
{
|
{
|
||||||
//fill in the usersettings
|
//fill in the usersettings
|
||||||
userSettings->beginGroup("rbspeex");
|
ui.volume->setValue(settings->encoderVolume("rbspeex"));
|
||||||
ui.volume->setValue(userSettings->value("volume",defaultVolume).toDouble());
|
ui.quality->setValue(settings->encoderQuality("rbspeex"));
|
||||||
ui.quality->setValue(userSettings->value("quality",defaultQuality).toDouble());
|
ui.complexity->setValue(settings->encoderComplexity("rbspeex"));
|
||||||
ui.complexity->setValue(userSettings->value("complexity",defaultComplexity).toInt());
|
|
||||||
|
|
||||||
if(userSettings->value("narrowband","False").toString() == "True")
|
if(settings->encoderNarrowband("rbspeex"))
|
||||||
ui.narrowband->setCheckState(Qt::Checked);
|
ui.narrowband->setCheckState(Qt::Checked);
|
||||||
else
|
else
|
||||||
ui.narrowband->setCheckState(Qt::Unchecked);
|
ui.narrowband->setCheckState(Qt::Unchecked);
|
||||||
|
|
||||||
userSettings->endGroup();
|
|
||||||
|
|
||||||
//show dialog
|
//show dialog
|
||||||
this->exec();
|
this->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EncRbSpeex::accept(void)
|
void EncRbSpeex::accept(void)
|
||||||
{
|
{
|
||||||
if(userSettings != NULL)
|
//save settings in user config
|
||||||
{
|
settings->setEncoderVolume("rbspeex",ui.volume->value());
|
||||||
//save settings in user config
|
settings->setEncoderQuality("rbspeex",ui.quality->value());
|
||||||
userSettings->beginGroup("rbspeex");
|
settings->setEncoderComplexity("rbspeex",ui.complexity->value());
|
||||||
userSettings->setValue("volume",ui.volume->value());
|
settings->setEncoderNarrowband("rbspeex",ui.narrowband->isChecked() ? true : false);
|
||||||
userSettings->setValue("quality",ui.quality->value());
|
|
||||||
userSettings->setValue("complexity",ui.complexity->value());
|
|
||||||
userSettings->setValue("narrowband",ui.narrowband->isChecked() ? true : false);
|
|
||||||
|
|
||||||
userSettings->endGroup();
|
// sync settings
|
||||||
// sync settings
|
settings->sync();
|
||||||
userSettings->sync();
|
|
||||||
}
|
|
||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,19 +329,16 @@ bool EncRbSpeex::configOk()
|
||||||
{
|
{
|
||||||
bool result=true;
|
bool result=true;
|
||||||
// check config
|
// check config
|
||||||
userSettings->beginGroup("rbspeex");
|
|
||||||
|
|
||||||
if(userSettings->value("volume","null").toDouble() <= 0)
|
if(settings->encoderVolume("rbspeex") <= 0)
|
||||||
result =false;
|
result =false;
|
||||||
|
|
||||||
if(userSettings->value("quality","null").toDouble() <= 0)
|
if(settings->encoderQuality("rbspeex") <= 0)
|
||||||
result =false;
|
result =false;
|
||||||
|
|
||||||
if(userSettings->value("complexity","null").toInt() <= 0)
|
if(settings->encoderComplexity("rbspeex") <= 0)
|
||||||
result =false;
|
result =false;
|
||||||
|
|
||||||
userSettings->endGroup();
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,11 @@
|
||||||
#ifndef ENCODERS_H
|
#ifndef ENCODERS_H
|
||||||
#define ENCODERS_H
|
#define ENCODERS_H
|
||||||
|
|
||||||
|
#include <QtGui>
|
||||||
|
|
||||||
#include "ui_rbspeexcfgfrm.h"
|
#include "ui_rbspeexcfgfrm.h"
|
||||||
#include "ui_encexescfgfrm.h"
|
#include "ui_encexescfgfrm.h"
|
||||||
#include <QtGui>
|
#include "rbsettings.h"
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
@ -39,7 +41,6 @@ EncBase* getEncoder(QString encname);
|
||||||
QStringList getEncoderList();
|
QStringList getEncoderList();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class EncBase : public QDialog
|
class EncBase : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -52,7 +53,7 @@ public:
|
||||||
virtual void showCfg(){}
|
virtual void showCfg(){}
|
||||||
virtual bool configOk(){return false;}
|
virtual bool configOk(){return false;}
|
||||||
|
|
||||||
void setUserCfg(QSettings *uSettings){userSettings = uSettings;}
|
void setCfg(RbSettings *sett){settings = sett;}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void accept(void){}
|
virtual void accept(void){}
|
||||||
|
@ -61,7 +62,7 @@ public slots:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
QSettings *userSettings;
|
RbSettings* settings;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,8 @@ void Install::accept()
|
||||||
{
|
{
|
||||||
logger = new ProgressLoggerGui(this);
|
logger = new ProgressLoggerGui(this);
|
||||||
logger->show();
|
logger->show();
|
||||||
QString mountPoint = userSettings->value("mountpoint").toString();
|
QString mountPoint = settings->mountpoint();
|
||||||
qDebug() << "mountpoint:" << userSettings->value("mountpoint").toString();
|
qDebug() << "mountpoint:" << settings->mountpoint();
|
||||||
// show dialog with error if mount point is wrong
|
// show dialog with error if mount point is wrong
|
||||||
if(!QFileInfo(mountPoint).isDir()) {
|
if(!QFileInfo(mountPoint).isDir()) {
|
||||||
logger->addItem(tr("Mount point is wrong!"),LOGERROR);
|
logger->addItem(tr("Mount point is wrong!"),LOGERROR);
|
||||||
|
@ -58,50 +58,46 @@ void Install::accept()
|
||||||
}
|
}
|
||||||
|
|
||||||
QString myversion;
|
QString myversion;
|
||||||
QString buildname;
|
QString buildname = settings->curPlatform();
|
||||||
devices->beginGroup(userSettings->value("platform").toString());
|
|
||||||
buildname = devices->value("platform").toString();
|
|
||||||
devices->endGroup();
|
|
||||||
if(ui.radioStable->isChecked()) {
|
if(ui.radioStable->isChecked()) {
|
||||||
file = QString("%1/rockbox-%2-%3.zip")
|
file = QString("%1/rockbox-%2-%3.zip")
|
||||||
.arg(devices->value("download_url").toString(),
|
.arg(settings->downloadUrl(),
|
||||||
devices->value("last_release").toString(), buildname);
|
settings->lastRelease(), buildname);
|
||||||
fileName = QString("rockbox-%1-%2.zip")
|
fileName = QString("rockbox-%1-%2.zip")
|
||||||
.arg(devices->value("last_release").toString(), buildname);
|
.arg(settings->lastRelease(), buildname);
|
||||||
userSettings->setValue("build", "stable");
|
settings->setBuild("stable");
|
||||||
myversion = version.value("rel_rev");
|
myversion = version.value("rel_rev");
|
||||||
}
|
}
|
||||||
else if(ui.radioArchived->isChecked()) {
|
else if(ui.radioArchived->isChecked()) {
|
||||||
file = QString("%1%2/rockbox-%3-%4.zip")
|
file = QString("%1%2/rockbox-%3-%4.zip")
|
||||||
.arg(devices->value("daily_url").toString(),
|
.arg(settings->dailyUrl(),
|
||||||
buildname, buildname, version.value("arch_date"));
|
buildname, buildname, version.value("arch_date"));
|
||||||
fileName = QString("rockbox-%1-%2.zip")
|
fileName = QString("rockbox-%1-%2.zip")
|
||||||
.arg(buildname, version.value("arch_date"));
|
.arg(buildname, version.value("arch_date"));
|
||||||
userSettings->setValue("build", "archived");
|
settings->setBuild("archived");
|
||||||
myversion = "r" + version.value("arch_rev") + "-" + version.value("arch_date");
|
myversion = "r" + version.value("arch_rev") + "-" + version.value("arch_date");
|
||||||
}
|
}
|
||||||
else if(ui.radioCurrent->isChecked()) {
|
else if(ui.radioCurrent->isChecked()) {
|
||||||
file = QString("%1%2/rockbox.zip")
|
file = QString("%1%2/rockbox.zip")
|
||||||
.arg(devices->value("bleeding_url").toString(), buildname);
|
.arg(settings->bleedingUrl(), buildname);
|
||||||
fileName = QString("rockbox.zip");
|
fileName = QString("rockbox.zip");
|
||||||
userSettings->setValue("build", "current");
|
settings->setBuild("current");
|
||||||
myversion = "r" + version.value("bleed_rev");
|
myversion = "r" + version.value("bleed_rev");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "no build selected -- this shouldn't happen";
|
qDebug() << "no build selected -- this shouldn't happen";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
userSettings->sync();
|
settings->sync();
|
||||||
|
|
||||||
installer = new ZipInstaller(this);
|
installer = new ZipInstaller(this);
|
||||||
installer->setUrl(file);
|
installer->setUrl(file);
|
||||||
installer->setProxy(proxy);
|
installer->setProxy(proxy);
|
||||||
installer->setLogSection("Rockbox (Base)");
|
installer->setLogSection("Rockbox (Base)");
|
||||||
if(!userSettings->value("cachedisable").toBool()
|
if(!settings->cacheDisabled()
|
||||||
&& !ui.radioCurrent->isChecked()
|
&& !ui.radioCurrent->isChecked()
|
||||||
&& !ui.checkBoxCache->isChecked())
|
&& !ui.checkBoxCache->isChecked())
|
||||||
installer->setCache(userSettings->value("cachepath",
|
installer->setCache(settings->cachePath());
|
||||||
QDir::tempPath()).toString());
|
|
||||||
|
|
||||||
installer->setLogVersion(myversion);
|
installer->setLogVersion(myversion);
|
||||||
installer->setMountPoint(mountPoint);
|
installer->setMountPoint(mountPoint);
|
||||||
|
@ -125,9 +121,9 @@ void Install::done(bool error)
|
||||||
// no error, close the window, when the logger is closed
|
// no error, close the window, when the logger is closed
|
||||||
connect(logger,SIGNAL(closed()),this,SLOT(close()));
|
connect(logger,SIGNAL(closed()),this,SLOT(close()));
|
||||||
// add platform info to log file for later detection
|
// add platform info to log file for later detection
|
||||||
QSettings installlog(userSettings->value("mountpoint").toString()
|
QSettings installlog(settings->mountpoint()
|
||||||
+ "/.rockbox/rbutil.log", QSettings::IniFormat, 0);
|
+ "/.rockbox/rbutil.log", QSettings::IniFormat, 0);
|
||||||
installlog.setValue("platform", userSettings->value("platform").toString());
|
installlog.setValue("platform", settings->curPlatform());
|
||||||
installlog.sync();
|
installlog.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,12 +175,6 @@ void Install::setDetailsArchived(bool show)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Install::setDeviceSettings(QSettings *dev)
|
|
||||||
{
|
|
||||||
devices = dev;
|
|
||||||
qDebug() << "Install::setDeviceSettings:" << devices;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Install::setVersionStrings(QMap<QString, QString> ver)
|
void Install::setVersionStrings(QMap<QString, QString> ver)
|
||||||
{
|
{
|
||||||
|
@ -217,7 +207,7 @@ void Install::setVersionStrings(QMap<QString, QString> ver)
|
||||||
qDebug() << "Install::setVersionStrings" << version;
|
qDebug() << "Install::setVersionStrings" << version;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Install::setUserSettings(QSettings *user)
|
void Install::setSettings(RbSettings *sett)
|
||||||
{
|
{
|
||||||
userSettings = user;
|
settings = sett;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,11 +22,10 @@
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
||||||
#include <QSettings>
|
|
||||||
|
|
||||||
#include "ui_installfrm.h"
|
#include "ui_installfrm.h"
|
||||||
#include "installzip.h"
|
#include "installzip.h"
|
||||||
#include "progressloggergui.h"
|
#include "progressloggergui.h"
|
||||||
|
#include "rbsettings.h"
|
||||||
|
|
||||||
class Install : public QDialog
|
class Install : public QDialog
|
||||||
{
|
{
|
||||||
|
@ -34,8 +33,7 @@ class Install : public QDialog
|
||||||
public:
|
public:
|
||||||
Install(QWidget *parent = 0);
|
Install(QWidget *parent = 0);
|
||||||
void setProxy(QUrl);
|
void setProxy(QUrl);
|
||||||
void setUserSettings(QSettings*);
|
void setSettings(RbSettings* sett);
|
||||||
void setDeviceSettings(QSettings*);
|
|
||||||
void setVersionStrings(QMap<QString, QString>);
|
void setVersionStrings(QMap<QString, QString>);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
@ -45,8 +43,7 @@ class Install : public QDialog
|
||||||
Ui::InstallFrm ui;
|
Ui::InstallFrm ui;
|
||||||
ProgressLoggerGui* logger;
|
ProgressLoggerGui* logger;
|
||||||
QUrl proxy;
|
QUrl proxy;
|
||||||
QSettings *devices;
|
RbSettings* settings;
|
||||||
QSettings *userSettings;
|
|
||||||
QHttp *download;
|
QHttp *download;
|
||||||
QFile *target;
|
QFile *target;
|
||||||
QString file;
|
QString file;
|
||||||
|
|
|
@ -66,7 +66,7 @@ void InstallTalkWindow::setTalkFolder(QString folder)
|
||||||
void InstallTalkWindow::change()
|
void InstallTalkWindow::change()
|
||||||
{
|
{
|
||||||
Config *cw = new Config(this,4);
|
Config *cw = new Config(this,4);
|
||||||
cw->setSettings(userSettings,devices);
|
cw->setSettings(settings);
|
||||||
cw->show();
|
cw->show();
|
||||||
connect(cw, SIGNAL(settingsUpdated()), this, SIGNAL(settingsUpdated()));
|
connect(cw, SIGNAL(settingsUpdated()), this, SIGNAL(settingsUpdated()));
|
||||||
}
|
}
|
||||||
|
@ -86,13 +86,13 @@ void InstallTalkWindow::accept()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
userSettings->setValue("last_talked_folder", folderToTalk);
|
settings->setLastTalkedDir(folderToTalk);
|
||||||
|
|
||||||
userSettings->sync();
|
settings->sync();
|
||||||
|
|
||||||
talkcreator->setSettings(userSettings,devices);
|
talkcreator->setSettings(settings);
|
||||||
talkcreator->setDir(QDir(folderToTalk));
|
talkcreator->setDir(QDir(folderToTalk));
|
||||||
talkcreator->setMountPoint(userSettings->value("mountpoint").toString());
|
talkcreator->setMountPoint(settings->mountpoint());
|
||||||
|
|
||||||
talkcreator->setOverwriteTalk(ui.OverwriteTalk->isChecked());
|
talkcreator->setOverwriteTalk(ui.OverwriteTalk->isChecked());
|
||||||
talkcreator->setOverwriteWav(ui.OverwriteWav->isChecked());
|
talkcreator->setOverwriteWav(ui.OverwriteWav->isChecked());
|
||||||
|
@ -106,29 +106,27 @@ void InstallTalkWindow::accept()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InstallTalkWindow::setSettings(QSettings *user,QSettings *dev)
|
void InstallTalkWindow::setSettings(RbSettings* sett)
|
||||||
{
|
{
|
||||||
devices = dev;
|
settings = sett;
|
||||||
userSettings = user;
|
|
||||||
qDebug() << "Install::setDeviceSettings:" << devices;
|
|
||||||
|
|
||||||
QString ttsName = userSettings->value("tts", "none").toString();
|
QString ttsName = settings->curTTS();
|
||||||
TTSBase* tts = getTTS(ttsName);
|
TTSBase* tts = getTTS(ttsName);
|
||||||
tts->setCfg(userSettings,devices);
|
tts->setCfg(settings);
|
||||||
if(tts->configOk())
|
if(tts->configOk())
|
||||||
ui.labelTtsProfile->setText(tr("Selected TTS engine : <b>%1</b>").arg(ttsName));
|
ui.labelTtsProfile->setText(tr("Selected TTS engine : <b>%1</b>").arg(ttsName));
|
||||||
else
|
else
|
||||||
ui.labelTtsProfile->setText(tr("Selected TTS Engine: <b>%1</b>").arg("Invalid TTS configuration!"));
|
ui.labelTtsProfile->setText(tr("Selected TTS Engine: <b>%1</b>").arg("Invalid TTS configuration!"));
|
||||||
|
|
||||||
QString encoder = userSettings->value("encoder", "none").toString();
|
QString encoder = settings->curEncoder();
|
||||||
EncBase* enc = getEncoder(encoder);
|
EncBase* enc = getEncoder(encoder);
|
||||||
enc->setUserCfg(userSettings);
|
enc->setCfg(settings);
|
||||||
if(enc->configOk())
|
if(enc->configOk())
|
||||||
ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg(encoder));
|
ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg(encoder));
|
||||||
else
|
else
|
||||||
ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg("Invalid encoder configuration!"));
|
ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg("Invalid encoder configuration!"));
|
||||||
|
|
||||||
setTalkFolder(userSettings->value("last_talked_folder").toString());
|
setTalkFolder(settings->lastTalkedFolder());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,18 +22,17 @@
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
||||||
#include <QSettings>
|
|
||||||
|
|
||||||
#include "ui_installtalkfrm.h"
|
#include "ui_installtalkfrm.h"
|
||||||
#include "progressloggergui.h"
|
#include "progressloggergui.h"
|
||||||
#include "talkfile.h"
|
#include "talkfile.h"
|
||||||
|
#include "rbsettings.h"
|
||||||
|
|
||||||
class InstallTalkWindow : public QDialog
|
class InstallTalkWindow : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
InstallTalkWindow(QWidget *parent = 0);
|
InstallTalkWindow(QWidget *parent = 0);
|
||||||
void setSettings(QSettings* user,QSettings* device);
|
void setSettings(RbSettings* sett);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void settingsUpdated(void);
|
void settingsUpdated(void);
|
||||||
|
@ -50,8 +49,7 @@ class InstallTalkWindow : public QDialog
|
||||||
TalkFileCreator* talkcreator;
|
TalkFileCreator* talkcreator;
|
||||||
Ui::InstallTalkFrm ui;
|
Ui::InstallTalkFrm ui;
|
||||||
ProgressLoggerGui* logger;
|
ProgressLoggerGui* logger;
|
||||||
QSettings *devices;
|
RbSettings* settings;
|
||||||
QSettings *userSettings;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -46,24 +46,7 @@ ThemesInstallWindow::~ThemesInstallWindow()
|
||||||
|
|
||||||
QString ThemesInstallWindow::resolution()
|
QString ThemesInstallWindow::resolution()
|
||||||
{
|
{
|
||||||
QString resolution;
|
return settings->curResolution();
|
||||||
devices->beginGroup(userSettings->value("platform").toString());
|
|
||||||
resolution = devices->value("resolution").toString();
|
|
||||||
devices->endGroup();
|
|
||||||
return resolution;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ThemesInstallWindow::setDeviceSettings(QSettings *dev)
|
|
||||||
{
|
|
||||||
devices = dev;
|
|
||||||
qDebug() << "setDeviceSettings()" << devices;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ThemesInstallWindow::setUserSettings(QSettings *user)
|
|
||||||
{
|
|
||||||
userSettings = user;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,12 +62,12 @@ void ThemesInstallWindow::downloadInfo()
|
||||||
themesInfo.close();
|
themesInfo.close();
|
||||||
|
|
||||||
QUrl url;
|
QUrl url;
|
||||||
url = QUrl(devices->value("themes_url").toString() + "/rbutilqt.php?res=" + resolution());
|
url = QUrl(settings->themeUrl() + "/rbutilqt.php?res=" + resolution());
|
||||||
qDebug() << "downloadInfo()" << url;
|
qDebug() << "downloadInfo()" << url;
|
||||||
qDebug() << url.queryItems();
|
qDebug() << url.queryItems();
|
||||||
getter->setProxy(proxy);
|
getter->setProxy(proxy);
|
||||||
if(userSettings->value("offline").toBool())
|
if(settings->cacheOffline())
|
||||||
getter->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
|
getter->setCache(settings->cachePath());
|
||||||
getter->setFile(&themesInfo);
|
getter->setFile(&themesInfo);
|
||||||
getter->getFile(url);
|
getter->getFile(url);
|
||||||
}
|
}
|
||||||
|
@ -173,9 +156,9 @@ void ThemesInstallWindow::updateDetails(int row)
|
||||||
iniDetails.beginGroup(ui.listThemes->item(row)->data(Qt::UserRole).toString());
|
iniDetails.beginGroup(ui.listThemes->item(row)->data(Qt::UserRole).toString());
|
||||||
|
|
||||||
QUrl img, txt;
|
QUrl img, txt;
|
||||||
txt = QUrl(QString(devices->value("themes_url").toString() + "/"
|
txt = QUrl(QString(settings->themeUrl() + "/"
|
||||||
+ iniDetails.value("descriptionfile").toString()));
|
+ iniDetails.value("descriptionfile").toString()));
|
||||||
img = QUrl(QString(devices->value("themes_url").toString() + "/"
|
img = QUrl(QString(settings->themeUrl() + "/"
|
||||||
+ iniDetails.value("image").toString()));
|
+ iniDetails.value("image").toString()));
|
||||||
qDebug() << "txt:" << txt;
|
qDebug() << "txt:" << txt;
|
||||||
qDebug() << "img:" << img;
|
qDebug() << "img:" << img;
|
||||||
|
@ -190,8 +173,8 @@ void ThemesInstallWindow::updateDetails(int row)
|
||||||
|
|
||||||
igetter.abort();
|
igetter.abort();
|
||||||
igetter.setProxy(proxy);
|
igetter.setProxy(proxy);
|
||||||
if(!userSettings->value("cachedisable").toBool())
|
if(!settings->cacheDisabled())
|
||||||
igetter.setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
|
igetter.setCache(settings->cachePath());
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(infocachedir=="")
|
if(infocachedir=="")
|
||||||
|
@ -291,7 +274,7 @@ void ThemesInstallWindow::accept()
|
||||||
QSettings iniDetails(themesInfo.fileName(), QSettings::IniFormat, this);
|
QSettings iniDetails(themesInfo.fileName(), QSettings::IniFormat, this);
|
||||||
for(int i = 0; i < ui.listThemes->selectedItems().size(); i++) {
|
for(int i = 0; i < ui.listThemes->selectedItems().size(); i++) {
|
||||||
iniDetails.beginGroup(ui.listThemes->selectedItems().at(i)->data(Qt::UserRole).toString());
|
iniDetails.beginGroup(ui.listThemes->selectedItems().at(i)->data(Qt::UserRole).toString());
|
||||||
zip = devices->value("themes_url").toString()
|
zip = settings->themeUrl()
|
||||||
+ "/" + iniDetails.value("archive").toString();
|
+ "/" + iniDetails.value("archive").toString();
|
||||||
themes.append(zip);
|
themes.append(zip);
|
||||||
names.append("Theme: " +
|
names.append("Theme: " +
|
||||||
|
@ -305,8 +288,8 @@ void ThemesInstallWindow::accept()
|
||||||
|
|
||||||
logger = new ProgressLoggerGui(this);
|
logger = new ProgressLoggerGui(this);
|
||||||
logger->show();
|
logger->show();
|
||||||
QString mountPoint = userSettings->value("mountpoint").toString();
|
QString mountPoint = settings->mountpoint();
|
||||||
qDebug() << "mountpoint:" << userSettings->value("mountpoint").toString();
|
qDebug() << "mountpoint:" << mountPoint;
|
||||||
// show dialog with error if mount point is wrong
|
// show dialog with error if mount point is wrong
|
||||||
if(!QFileInfo(mountPoint).isDir()) {
|
if(!QFileInfo(mountPoint).isDir()) {
|
||||||
logger->addItem(tr("Mount point is wrong!"),LOGERROR);
|
logger->addItem(tr("Mount point is wrong!"),LOGERROR);
|
||||||
|
@ -320,8 +303,8 @@ void ThemesInstallWindow::accept()
|
||||||
installer->setLogSection(names);
|
installer->setLogSection(names);
|
||||||
installer->setLogVersion(version);
|
installer->setLogVersion(version);
|
||||||
installer->setMountPoint(mountPoint);
|
installer->setMountPoint(mountPoint);
|
||||||
if(!userSettings->value("cachedisable").toBool())
|
if(!settings->cacheDisabled())
|
||||||
installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
|
installer->setCache(settings->cachePath());
|
||||||
installer->install(logger);
|
installer->install(logger);
|
||||||
connect(logger, SIGNAL(closed()), this, SLOT(close()));
|
connect(logger, SIGNAL(closed()), this, SLOT(close()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "httpget.h"
|
#include "httpget.h"
|
||||||
#include "installzip.h"
|
#include "installzip.h"
|
||||||
#include "progressloggergui.h"
|
#include "progressloggergui.h"
|
||||||
|
#include "rbsettings.h"
|
||||||
|
|
||||||
class ThemesInstallWindow : public QDialog
|
class ThemesInstallWindow : public QDialog
|
||||||
{
|
{
|
||||||
|
@ -35,8 +36,7 @@ class ThemesInstallWindow : public QDialog
|
||||||
public:
|
public:
|
||||||
ThemesInstallWindow(QWidget* parent = 0);
|
ThemesInstallWindow(QWidget* parent = 0);
|
||||||
~ThemesInstallWindow();
|
~ThemesInstallWindow();
|
||||||
void setDeviceSettings(QSettings*);
|
void setSettings(RbSettings* sett){settings=sett;}
|
||||||
void setUserSettings(QSettings *);
|
|
||||||
void setProxy(QUrl);
|
void setProxy(QUrl);
|
||||||
void downloadInfo(void);
|
void downloadInfo(void);
|
||||||
void show(void);
|
void show(void);
|
||||||
|
@ -47,8 +47,7 @@ class ThemesInstallWindow : public QDialog
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ThemeInstallFrm ui;
|
Ui::ThemeInstallFrm ui;
|
||||||
QSettings *devices;
|
RbSettings* settings;
|
||||||
QSettings *userSettings;
|
|
||||||
HttpGet *getter;
|
HttpGet *getter;
|
||||||
HttpGet igetter;
|
HttpGet igetter;
|
||||||
QTemporaryFile themesInfo;
|
QTemporaryFile themesInfo;
|
||||||
|
|
563
rbutil/rbutilqt/rbsettings.cpp
Normal file
563
rbutil/rbutilqt/rbsettings.cpp
Normal file
|
@ -0,0 +1,563 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2007 by Dominik Wenger
|
||||||
|
* $Id: rbsettings.cpp 16150 2008-01-23 21:54:40Z 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 "rbsettings.h"
|
||||||
|
|
||||||
|
#include <QSettings>
|
||||||
|
|
||||||
|
void RbSettings::open()
|
||||||
|
{
|
||||||
|
// only use built-in rbutil.ini
|
||||||
|
devices = new QSettings(":/ini/rbutil.ini", QSettings::IniFormat, 0);
|
||||||
|
// portable installation:
|
||||||
|
// check for a configuration file in the program folder.
|
||||||
|
QFileInfo config;
|
||||||
|
config.setFile(qApp->applicationDirPath() + "/RockboxUtility.ini");
|
||||||
|
if(config.isFile())
|
||||||
|
{
|
||||||
|
userSettings = new QSettings(qApp->applicationDirPath() + "/RockboxUtility.ini",
|
||||||
|
QSettings::IniFormat, 0);
|
||||||
|
qDebug() << "config: portable";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
userSettings = new QSettings(QSettings::IniFormat,
|
||||||
|
QSettings::UserScope, "rockbox.org", "RockboxUtility");
|
||||||
|
qDebug() << "config: system";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::sync()
|
||||||
|
{
|
||||||
|
userSettings->sync();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::userSettingFilename()
|
||||||
|
{
|
||||||
|
return userSettings->fileName();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RbSettings::cacheOffline()
|
||||||
|
{
|
||||||
|
return userSettings->value("offline").toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RbSettings::curNeedsBootloader()
|
||||||
|
{
|
||||||
|
QString platform = userSettings->value("platform").toString();
|
||||||
|
devices->beginGroup(platform);
|
||||||
|
QString result = devices->value("needsbootloader", "").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
if( result == "no")
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::mountpoint()
|
||||||
|
{
|
||||||
|
return userSettings->value("mountpoint").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::manualUrl()
|
||||||
|
{
|
||||||
|
return devices->value("manual_url").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::bleedingUrl()
|
||||||
|
{
|
||||||
|
return devices->value("bleeding_url").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString RbSettings::lastRelease()
|
||||||
|
{
|
||||||
|
return devices->value("last_release").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::cachePath()
|
||||||
|
{
|
||||||
|
return userSettings->value("cachepath", QDir::tempPath()).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::bootloaderUrl()
|
||||||
|
{
|
||||||
|
return devices->value("bootloader_url").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::bootloaderInfoUrl()
|
||||||
|
{
|
||||||
|
return devices->value("bootloader_info_url").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::fontUrl()
|
||||||
|
{
|
||||||
|
return devices->value("font_url").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::voiceUrl()
|
||||||
|
{
|
||||||
|
return devices->value("voice_url").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::doomUrl()
|
||||||
|
{
|
||||||
|
return devices->value("doom_url").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::downloadUrl()
|
||||||
|
{
|
||||||
|
return devices->value("download_url").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::dailyUrl()
|
||||||
|
{
|
||||||
|
return devices->value("daily_url").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::serverConfUrl()
|
||||||
|
{
|
||||||
|
return devices->value("server_conf_url").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::genlangUrl()
|
||||||
|
{
|
||||||
|
return devices->value("genlang_url").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::themeUrl()
|
||||||
|
{
|
||||||
|
return devices->value("themes_url").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::bleedingInfo()
|
||||||
|
{
|
||||||
|
return devices->value("bleeding_info").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RbSettings::cacheDisabled()
|
||||||
|
{
|
||||||
|
return userSettings->value("cachedisable").toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::proxyType()
|
||||||
|
{
|
||||||
|
return userSettings->value("proxytype", "system").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::proxy()
|
||||||
|
{
|
||||||
|
return userSettings->value("proxy").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::ofPath()
|
||||||
|
{
|
||||||
|
return userSettings->value("ofpath").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::curBrand()
|
||||||
|
{
|
||||||
|
QString platform = userSettings->value("platform").toString();
|
||||||
|
return brand(platform);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::curName()
|
||||||
|
{
|
||||||
|
QString platform = userSettings->value("platform").toString();
|
||||||
|
return name(platform);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::curPlatform()
|
||||||
|
{
|
||||||
|
return userSettings->value("platform").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::curManual()
|
||||||
|
{
|
||||||
|
QString platform = userSettings->value("platform").toString();
|
||||||
|
devices->beginGroup(platform);
|
||||||
|
QString name = devices->value("manualname","rockbox-" +
|
||||||
|
devices->value("platform").toString()).toString();
|
||||||
|
devices->endGroup();
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RbSettings::curReleased()
|
||||||
|
{
|
||||||
|
QString platform = userSettings->value("platform").toString();
|
||||||
|
devices->beginGroup(platform);
|
||||||
|
QString released = devices->value("released").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
|
||||||
|
if(released == "yes")
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::curBootloaderMethod()
|
||||||
|
{
|
||||||
|
QString platform = userSettings->value("platform").toString();
|
||||||
|
devices->beginGroup(platform);
|
||||||
|
QString method = devices->value("bootloadermethod").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::curBootloaderName()
|
||||||
|
{
|
||||||
|
QString platform = userSettings->value("platform").toString();
|
||||||
|
devices->beginGroup(platform);
|
||||||
|
QString name = devices->value("bootloadername").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::curVoiceName()
|
||||||
|
{
|
||||||
|
QString platform = userSettings->value("platform").toString();
|
||||||
|
devices->beginGroup(platform);
|
||||||
|
QString name = devices->value("voicename").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::curLang()
|
||||||
|
{
|
||||||
|
return userSettings->value("lang").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::curEncoder()
|
||||||
|
{
|
||||||
|
return userSettings->value("encoder").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::curTTS()
|
||||||
|
{
|
||||||
|
return userSettings->value("tts").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::lastTalkedFolder()
|
||||||
|
{
|
||||||
|
return userSettings->value("last_talked_folder").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::voiceLanguage()
|
||||||
|
{
|
||||||
|
return userSettings->value("voicelanguage").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
int RbSettings::wavtrimTh()
|
||||||
|
{
|
||||||
|
return userSettings->value("wavtrimthreshold",500).toInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::ttsPath(QString tts)
|
||||||
|
{
|
||||||
|
devices->beginGroup(tts);
|
||||||
|
QString path = devices->value("ttspath").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
return path;
|
||||||
|
|
||||||
|
}
|
||||||
|
QString RbSettings::ttsOptions(QString tts)
|
||||||
|
{
|
||||||
|
devices->beginGroup(tts);
|
||||||
|
QString op = devices->value("ttsoptions").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
return op;
|
||||||
|
}
|
||||||
|
QString RbSettings::ttsVoice(QString tts)
|
||||||
|
{
|
||||||
|
devices->beginGroup(tts);
|
||||||
|
QString op = devices->value("ttsvoice").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
return op;
|
||||||
|
}
|
||||||
|
int RbSettings::ttsSpeed(QString tts)
|
||||||
|
{
|
||||||
|
devices->beginGroup(tts);
|
||||||
|
int sp = devices->value("ttsspeed",0).toInt();
|
||||||
|
devices->endGroup();
|
||||||
|
return sp;
|
||||||
|
}
|
||||||
|
QString RbSettings::ttsLang(QString tts)
|
||||||
|
{
|
||||||
|
devices->beginGroup(tts);
|
||||||
|
QString op = devices->value("ttslanguage").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
return op;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::encoderPath(QString enc)
|
||||||
|
{
|
||||||
|
devices->beginGroup(enc);
|
||||||
|
QString path = devices->value("encoderpath").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
QString RbSettings::encoderOptions(QString enc)
|
||||||
|
{
|
||||||
|
devices->beginGroup(enc);
|
||||||
|
QString op = devices->value("encoderpath").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
return op;
|
||||||
|
}
|
||||||
|
|
||||||
|
double RbSettings::encoderQuality(QString enc)
|
||||||
|
{
|
||||||
|
devices->beginGroup(enc);
|
||||||
|
double q = devices->value("quality",8.f).toDouble();
|
||||||
|
devices->endGroup();
|
||||||
|
return q;
|
||||||
|
}
|
||||||
|
int RbSettings::encoderComplexity(QString enc)
|
||||||
|
{
|
||||||
|
devices->beginGroup(enc);
|
||||||
|
int c = devices->value("complexity",1.f).toInt();
|
||||||
|
devices->endGroup();
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
double RbSettings::encoderVolume(QString enc)
|
||||||
|
{
|
||||||
|
devices->beginGroup(enc);
|
||||||
|
double v = devices->value("volume",10).toDouble();
|
||||||
|
devices->endGroup();
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
bool RbSettings::encoderNarrowband(QString enc)
|
||||||
|
{
|
||||||
|
devices->beginGroup(enc);
|
||||||
|
bool nb = devices->value("narrowband",false).toBool();
|
||||||
|
devices->endGroup();
|
||||||
|
return nb;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList RbSettings::allPlatforms()
|
||||||
|
{
|
||||||
|
QStringList result;
|
||||||
|
devices->beginGroup("platforms");
|
||||||
|
QStringList a = devices->childKeys();
|
||||||
|
for(int i = 0; i < a.size(); i++)
|
||||||
|
{
|
||||||
|
result.append(devices->value(a.at(i), "null").toString());
|
||||||
|
}
|
||||||
|
devices->endGroup();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList RbSettings::allLanguages()
|
||||||
|
{
|
||||||
|
QStringList result;
|
||||||
|
devices->beginGroup("languages");
|
||||||
|
QStringList a = devices->childKeys();
|
||||||
|
for(int i = 0; i < a.size(); i++)
|
||||||
|
{
|
||||||
|
result.append(devices->value(a.at(i), "null").toString());
|
||||||
|
}
|
||||||
|
devices->endGroup();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::name(QString plattform)
|
||||||
|
{
|
||||||
|
devices->beginGroup(plattform);
|
||||||
|
QString name = devices->value("name").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::brand(QString plattform)
|
||||||
|
{
|
||||||
|
devices->beginGroup(plattform);
|
||||||
|
QString brand = devices->value("brand").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
return brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString RbSettings::curResolution()
|
||||||
|
{
|
||||||
|
QString platform = userSettings->value("platform").toString();
|
||||||
|
devices->beginGroup(platform);
|
||||||
|
QString resolution = devices->value("resolution").toString();
|
||||||
|
devices->endGroup();
|
||||||
|
return resolution;
|
||||||
|
}
|
||||||
|
|
||||||
|
int RbSettings::curTargetId()
|
||||||
|
{
|
||||||
|
QString platform = userSettings->value("platform").toString();
|
||||||
|
devices->beginGroup(platform);
|
||||||
|
int id = devices->value("targetid").toInt();
|
||||||
|
devices->endGroup();
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RbSettings::setOfPath(QString path)
|
||||||
|
{
|
||||||
|
userSettings->setValue("ofpath",path);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setCachePath(QString path)
|
||||||
|
{
|
||||||
|
userSettings->setValue("cachepath", path);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setBuild(QString build)
|
||||||
|
{
|
||||||
|
userSettings->setValue("build", build);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setLastTalkedDir(QString dir)
|
||||||
|
{
|
||||||
|
userSettings->setValue("last_talked_folder", dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setVoiceLanguage(QString dir)
|
||||||
|
{
|
||||||
|
userSettings->setValue("voicelanguage", dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setWavtrimTh(int th)
|
||||||
|
{
|
||||||
|
userSettings->setValue("wavtrimthreshold", th);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setProxy(QString proxy)
|
||||||
|
{
|
||||||
|
userSettings->setValue("proxy", proxy);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setProxyType(QString proxytype)
|
||||||
|
{
|
||||||
|
userSettings->setValue("proxytype", proxytype);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setLang(QString lang)
|
||||||
|
{
|
||||||
|
userSettings->setValue("lang", lang);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setMountpoint(QString mp)
|
||||||
|
{
|
||||||
|
userSettings->setValue("mountpoint",mp);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setCurPlatform(QString platt)
|
||||||
|
{
|
||||||
|
userSettings->setValue("platform",platt);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RbSettings::setCacheDisable(bool on)
|
||||||
|
{
|
||||||
|
userSettings->setValue("cachedisable",on);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setCacheOffline(bool on)
|
||||||
|
{
|
||||||
|
userSettings->setValue("offline",on);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setCurTTS(QString tts)
|
||||||
|
{
|
||||||
|
userSettings->setValue("tts",tts);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setCurEncoder(QString enc)
|
||||||
|
{
|
||||||
|
userSettings->setValue("encoder",enc);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setTTSPath(QString tts, QString path)
|
||||||
|
{
|
||||||
|
userSettings->beginGroup(tts);
|
||||||
|
userSettings->setValue("ttspath",path);
|
||||||
|
userSettings->endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setTTSOptions(QString tts, QString options)
|
||||||
|
{
|
||||||
|
userSettings->beginGroup(tts);
|
||||||
|
userSettings->setValue("ttsoptions",options);
|
||||||
|
userSettings->endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setTTSVoice(QString tts, QString voice)
|
||||||
|
{
|
||||||
|
userSettings->beginGroup(tts);
|
||||||
|
userSettings->setValue("ttsvoice",voice);
|
||||||
|
userSettings->endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setTTSSpeed(QString tts, int speed)
|
||||||
|
{
|
||||||
|
userSettings->beginGroup(tts);
|
||||||
|
userSettings->setValue("ttsspeed",speed);
|
||||||
|
userSettings->endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setTTSLang(QString tts, QString lang)
|
||||||
|
{
|
||||||
|
userSettings->beginGroup(tts);
|
||||||
|
userSettings->setValue("ttslanguage",lang);
|
||||||
|
userSettings->endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setEncoderPath(QString enc, QString path)
|
||||||
|
{
|
||||||
|
userSettings->beginGroup(enc);
|
||||||
|
userSettings->setValue("encoderpath",path);
|
||||||
|
userSettings->endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setEncoderOptions(QString enc, QString options)
|
||||||
|
{
|
||||||
|
userSettings->beginGroup(enc);
|
||||||
|
userSettings->setValue("encoderoptions",options);
|
||||||
|
userSettings->endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbSettings::setEncoderQuality(QString enc, double q)
|
||||||
|
{
|
||||||
|
userSettings->beginGroup(enc);
|
||||||
|
userSettings->setValue("quality",q);
|
||||||
|
userSettings->endGroup();
|
||||||
|
}
|
||||||
|
void RbSettings::setEncoderComplexity(QString enc, int c)
|
||||||
|
{
|
||||||
|
userSettings->beginGroup(enc);
|
||||||
|
userSettings->setValue("complexity",c);
|
||||||
|
userSettings->endGroup();
|
||||||
|
}
|
||||||
|
void RbSettings::setEncoderVolume(QString enc,double v)
|
||||||
|
{
|
||||||
|
userSettings->beginGroup(enc);
|
||||||
|
userSettings->setValue("volume",v);
|
||||||
|
userSettings->endGroup();
|
||||||
|
}
|
||||||
|
void RbSettings::setEncoderNarrowband(QString enc,bool nb)
|
||||||
|
{
|
||||||
|
userSettings->beginGroup(enc);
|
||||||
|
userSettings->setValue("narrowband",nb);
|
||||||
|
userSettings->endGroup();
|
||||||
|
}
|
137
rbutil/rbutilqt/rbsettings.h
Normal file
137
rbutil/rbutilqt/rbsettings.h
Normal file
|
@ -0,0 +1,137 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2007 by Dominik Wenger
|
||||||
|
* $Id: rbsettings.h 16059 2008-01-11 23:59:12Z 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 RBSETTINGS_H
|
||||||
|
#define RBSETTINGS_H
|
||||||
|
|
||||||
|
#include <QtGui>
|
||||||
|
class QSettings;
|
||||||
|
|
||||||
|
class RbSettings : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
RbSettings() {}
|
||||||
|
|
||||||
|
//! open the settings files
|
||||||
|
void open();
|
||||||
|
//! call this to flush the user Settings
|
||||||
|
void sync();
|
||||||
|
|
||||||
|
// returns the filename of the usersettings file
|
||||||
|
QString userSettingFilename();
|
||||||
|
|
||||||
|
//! access functions for the settings
|
||||||
|
bool cacheOffline();
|
||||||
|
bool cacheDisabled();
|
||||||
|
QString mountpoint();
|
||||||
|
QString manualUrl();
|
||||||
|
QString bleedingUrl();
|
||||||
|
QString lastRelease();
|
||||||
|
QString cachePath();
|
||||||
|
QString bootloaderUrl();
|
||||||
|
QString bootloaderInfoUrl();
|
||||||
|
QString fontUrl();
|
||||||
|
QString voiceUrl();
|
||||||
|
QString doomUrl();
|
||||||
|
QString downloadUrl();
|
||||||
|
QString dailyUrl();
|
||||||
|
QString serverConfUrl();
|
||||||
|
QString themeUrl();
|
||||||
|
QString genlangUrl();
|
||||||
|
QString proxyType();
|
||||||
|
QString proxy();
|
||||||
|
QString bleedingInfo();
|
||||||
|
QString ofPath();
|
||||||
|
QString lastTalkedFolder();
|
||||||
|
QString voiceLanguage();
|
||||||
|
int wavtrimTh();
|
||||||
|
QString ttsPath(QString tts);
|
||||||
|
QString ttsOptions(QString tts);
|
||||||
|
QString ttsVoice(QString tts);
|
||||||
|
int ttsSpeed(QString tts);
|
||||||
|
QString ttsLang(QString tts);
|
||||||
|
QString encoderPath(QString enc);
|
||||||
|
QString encoderOptions(QString enc);
|
||||||
|
double encoderQuality(QString enc);
|
||||||
|
int encoderComplexity(QString enc);
|
||||||
|
double encoderVolume(QString enc);
|
||||||
|
bool encoderNarrowband(QString enc);
|
||||||
|
|
||||||
|
QStringList allPlatforms();
|
||||||
|
QString name(QString plattform);
|
||||||
|
QString brand(QString plattform);
|
||||||
|
QStringList allLanguages();
|
||||||
|
|
||||||
|
bool curNeedsBootloader();
|
||||||
|
QString curBrand();
|
||||||
|
QString curName();
|
||||||
|
QString curPlatform();
|
||||||
|
QString curManual();
|
||||||
|
bool curReleased();
|
||||||
|
QString curBootloaderMethod();
|
||||||
|
QString curBootloaderName();
|
||||||
|
QString curVoiceName();
|
||||||
|
QString curLang();
|
||||||
|
QString curEncoder();
|
||||||
|
QString curTTS();
|
||||||
|
QString curResolution();
|
||||||
|
int curTargetId();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void setOfPath(QString path);
|
||||||
|
void setCachePath(QString path);
|
||||||
|
void setBuild(QString build);
|
||||||
|
void setLastTalkedDir(QString dir);
|
||||||
|
void setVoiceLanguage(QString lang);
|
||||||
|
void setWavtrimTh(int th);
|
||||||
|
void setProxy(QString proxy);
|
||||||
|
void setProxyType(QString proxytype);
|
||||||
|
void setLang(QString lang);
|
||||||
|
void setMountpoint(QString mp);
|
||||||
|
void setCurPlatform(QString platt);
|
||||||
|
void setCacheDisable(bool on);
|
||||||
|
void setCacheOffline(bool on);
|
||||||
|
void setCurTTS(QString tts);
|
||||||
|
void setCurEncoder(QString enc);
|
||||||
|
void setTTSPath(QString tts, QString path);
|
||||||
|
void setTTSOptions(QString tts, QString options);
|
||||||
|
void setTTSSpeed(QString tts, int speed);
|
||||||
|
void setTTSVoice(QString tts, QString voice);
|
||||||
|
void setTTSLang(QString tts, QString lang);
|
||||||
|
void setEncoderPath(QString enc, QString path);
|
||||||
|
void setEncoderOptions(QString enc, QString options);
|
||||||
|
void setEncoderQuality(QString enc, double q);
|
||||||
|
void setEncoderComplexity(QString enc, int c);
|
||||||
|
void setEncoderVolume(QString enc,double v);
|
||||||
|
void setEncoderNarrowband(QString enc,bool nb);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
QSettings *devices;
|
||||||
|
QSettings *userSettings;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -49,25 +49,11 @@
|
||||||
RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
|
RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
|
||||||
{
|
{
|
||||||
absolutePath = qApp->applicationDirPath();
|
absolutePath = qApp->applicationDirPath();
|
||||||
// only use built-in rbutil.ini
|
|
||||||
devices = new QSettings(":/ini/rbutil.ini", QSettings::IniFormat, 0);
|
|
||||||
|
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
// portable installation:
|
settings = new RbSettings();
|
||||||
// check for a configuration file in the program folder.
|
settings->open();
|
||||||
QFileInfo config;
|
|
||||||
config.setFile(absolutePath + "/RockboxUtility.ini");
|
|
||||||
if(config.isFile()) {
|
|
||||||
userSettings = new QSettings(absolutePath + "/RockboxUtility.ini",
|
|
||||||
QSettings::IniFormat, 0);
|
|
||||||
qDebug() << "config: portable";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
userSettings = new QSettings(QSettings::IniFormat,
|
|
||||||
QSettings::UserScope, "rockbox.org", "RockboxUtility");
|
|
||||||
qDebug() << "config: system";
|
|
||||||
}
|
|
||||||
|
|
||||||
// manual tab
|
// manual tab
|
||||||
updateManual();
|
updateManual();
|
||||||
|
@ -147,11 +133,11 @@ void RbUtilQt::downloadInfo()
|
||||||
connect(daily, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool)));
|
connect(daily, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool)));
|
||||||
connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort()));
|
connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort()));
|
||||||
daily->setProxy(proxy());
|
daily->setProxy(proxy());
|
||||||
if(userSettings->value("offline").toBool())
|
if(settings->cacheOffline())
|
||||||
daily->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
|
daily->setCache(settings->cachePath());
|
||||||
qDebug() << "downloading build info";
|
qDebug() << "downloading build info";
|
||||||
daily->setFile(&buildInfo);
|
daily->setFile(&buildInfo);
|
||||||
daily->getFile(QUrl(devices->value("server_conf_url").toString()));
|
daily->getFile(QUrl(settings->serverConfUrl()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -174,10 +160,10 @@ void RbUtilQt::downloadDone(bool error)
|
||||||
connect(bleeding, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool)));
|
connect(bleeding, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool)));
|
||||||
connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort()));
|
connect(qApp, SIGNAL(lastWindowClosed()), daily, SLOT(abort()));
|
||||||
bleeding->setProxy(proxy());
|
bleeding->setProxy(proxy());
|
||||||
if(userSettings->value("offline").toBool())
|
if(settings->cacheOffline())
|
||||||
bleeding->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
|
bleeding->setCache(settings->cachePath());
|
||||||
bleeding->setFile(&bleedingInfo);
|
bleeding->setFile(&bleedingInfo);
|
||||||
bleeding->getFile(QUrl(devices->value("bleeding_info").toString()));
|
bleeding->getFile(QUrl(settings->bleedingInfo()));
|
||||||
|
|
||||||
if(chkConfig(false)) {
|
if(chkConfig(false)) {
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
@ -254,7 +240,7 @@ void RbUtilQt::help()
|
||||||
void RbUtilQt::configDialog()
|
void RbUtilQt::configDialog()
|
||||||
{
|
{
|
||||||
Config *cw = new Config(this);
|
Config *cw = new Config(this);
|
||||||
cw->setSettings(userSettings,devices);
|
cw->setSettings(settings);
|
||||||
cw->show();
|
cw->show();
|
||||||
connect(cw, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo()));
|
connect(cw, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo()));
|
||||||
connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
|
connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
|
||||||
|
@ -271,10 +257,7 @@ void RbUtilQt::updateSettings()
|
||||||
|
|
||||||
void RbUtilQt::updateDevice()
|
void RbUtilQt::updateDevice()
|
||||||
{
|
{
|
||||||
platform = userSettings->value("platform").toString();
|
if(!settings->curNeedsBootloader() ) {
|
||||||
// buttons
|
|
||||||
devices->beginGroup(platform);
|
|
||||||
if(devices->value("needsbootloader", "") == "no") {
|
|
||||||
ui.buttonBootloader->setEnabled(false);
|
ui.buttonBootloader->setEnabled(false);
|
||||||
ui.buttonRemoveBootloader->setEnabled(false);
|
ui.buttonRemoveBootloader->setEnabled(false);
|
||||||
ui.labelBootloader->setEnabled(false);
|
ui.labelBootloader->setEnabled(false);
|
||||||
|
@ -283,7 +266,7 @@ void RbUtilQt::updateDevice()
|
||||||
else {
|
else {
|
||||||
ui.buttonBootloader->setEnabled(true);
|
ui.buttonBootloader->setEnabled(true);
|
||||||
ui.labelBootloader->setEnabled(true);
|
ui.labelBootloader->setEnabled(true);
|
||||||
if(devices->value("bootloadermethod") == "fwpatcher") {
|
if(settings->curBootloaderMethod() == "fwpatcher") {
|
||||||
ui.labelRemoveBootloader->setEnabled(false);
|
ui.labelRemoveBootloader->setEnabled(false);
|
||||||
ui.buttonRemoveBootloader->setEnabled(false);
|
ui.buttonRemoveBootloader->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
@ -292,14 +275,11 @@ void RbUtilQt::updateDevice()
|
||||||
ui.buttonRemoveBootloader->setEnabled(true);
|
ui.buttonRemoveBootloader->setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
devices->endGroup();
|
|
||||||
// displayed device info
|
// displayed device info
|
||||||
platform = userSettings->value("platform").toString();
|
QString mountpoint = settings->mountpoint();
|
||||||
QString mountpoint = userSettings->value("mountpoint").toString();
|
QString brand = settings->curBrand();
|
||||||
devices->beginGroup(platform);
|
QString name = settings->curName();
|
||||||
QString brand = devices->value("brand").toString();
|
|
||||||
QString name = devices->value("name").toString();
|
|
||||||
devices->endGroup();
|
|
||||||
if(name.isEmpty()) name = "<none>";
|
if(name.isEmpty()) name = "<none>";
|
||||||
if(mountpoint.isEmpty()) mountpoint = "<invalid>";
|
if(mountpoint.isEmpty()) mountpoint = "<invalid>";
|
||||||
ui.labelDevice->setText(tr("<b>%1 %2</b> at <b>%3</b>")
|
ui.labelDevice->setText(tr("<b>%1 %2</b> at <b>%3</b>")
|
||||||
|
@ -309,19 +289,16 @@ void RbUtilQt::updateDevice()
|
||||||
|
|
||||||
void RbUtilQt::updateManual()
|
void RbUtilQt::updateManual()
|
||||||
{
|
{
|
||||||
if(userSettings->value("platform").toString() != "")
|
if(settings->curPlatform() != "")
|
||||||
{
|
{
|
||||||
devices->beginGroup(userSettings->value("platform").toString());
|
QString manual= settings->curManual();
|
||||||
QString manual;
|
|
||||||
manual = devices->value("manualname", "").toString();
|
|
||||||
|
|
||||||
if(manual == "")
|
if(manual == "")
|
||||||
manual = "rockbox-" + devices->value("platform").toString();
|
manual = "rockbox-" + settings->curPlatform();
|
||||||
devices->endGroup();
|
|
||||||
QString pdfmanual;
|
QString pdfmanual;
|
||||||
pdfmanual = devices->value("manual_url").toString() + "/" + manual + ".pdf";
|
pdfmanual = settings->manualUrl() + "/" + manual + ".pdf";
|
||||||
QString htmlmanual;
|
QString htmlmanual;
|
||||||
htmlmanual = devices->value("manual_url").toString() + "/" + manual + "/rockbox-build.html";
|
htmlmanual = settings->manualUrl() + "/" + manual + "/rockbox-build.html";
|
||||||
ui.labelPdfManual->setText(tr("<a href='%1'>PDF Manual</a>")
|
ui.labelPdfManual->setText(tr("<a href='%1'>PDF Manual</a>")
|
||||||
.arg(pdfmanual));
|
.arg(pdfmanual));
|
||||||
ui.labelHtmlManual->setText(tr("<a href='%1'>HTML Manual (opens in browser)</a>")
|
ui.labelHtmlManual->setText(tr("<a href='%1'>HTML Manual (opens in browser)</a>")
|
||||||
|
@ -403,7 +380,7 @@ void RbUtilQt::smallInstall()
|
||||||
|
|
||||||
bool RbUtilQt::smallInstallInner()
|
bool RbUtilQt::smallInstallInner()
|
||||||
{
|
{
|
||||||
QString mountpoint = userSettings->value("mountpoint").toString();
|
QString mountpoint = settings->mountpoint();
|
||||||
// show dialog with error if mount point is wrong
|
// show dialog with error if mount point is wrong
|
||||||
if(!QFileInfo(mountpoint).isDir()) {
|
if(!QFileInfo(mountpoint).isDir()) {
|
||||||
logger->addItem(tr("Mount point is wrong!"),LOGERROR);
|
logger->addItem(tr("Mount point is wrong!"),LOGERROR);
|
||||||
|
@ -411,10 +388,7 @@ bool RbUtilQt::smallInstallInner()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Bootloader
|
// Bootloader
|
||||||
devices->beginGroup(userSettings->value("platform").toString());
|
if(settings->curNeedsBootloader())
|
||||||
QString needBootloader = devices->value("needsbootloader", "").toString();
|
|
||||||
devices->endGroup();
|
|
||||||
if(needBootloader == "yes")
|
|
||||||
{
|
{
|
||||||
m_error = false;
|
m_error = false;
|
||||||
m_installed = false;
|
m_installed = false;
|
||||||
|
@ -461,20 +435,16 @@ void RbUtilQt::installBtn()
|
||||||
bool RbUtilQt::installAuto()
|
bool RbUtilQt::installAuto()
|
||||||
{
|
{
|
||||||
QString file = QString("%1%2/rockbox.zip")
|
QString file = QString("%1%2/rockbox.zip")
|
||||||
.arg(devices->value("bleeding_url").toString(),
|
.arg(settings->bleedingUrl(), settings->curPlatform());
|
||||||
userSettings->value("platform").toString());
|
|
||||||
|
|
||||||
buildInfo.open();
|
buildInfo.open();
|
||||||
QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
|
QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
|
||||||
buildInfo.close();
|
buildInfo.close();
|
||||||
|
|
||||||
devices->beginGroup(platform);
|
if(settings->curReleased()) {
|
||||||
QString released = devices->value("released").toString();
|
|
||||||
devices->endGroup();
|
|
||||||
if(released == "yes") {
|
|
||||||
// only set the keys if needed -- querying will yield an empty string
|
// only set the keys if needed -- querying will yield an empty string
|
||||||
// if not set.
|
// if not set.
|
||||||
versmap.insert("rel_rev", devices->value("last_release").toString());
|
versmap.insert("rel_rev", settings->lastRelease());
|
||||||
versmap.insert("rel_date", ""); // FIXME: provide the release timestamp
|
versmap.insert("rel_date", ""); // FIXME: provide the release timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -485,9 +455,9 @@ bool RbUtilQt::installAuto()
|
||||||
installer->setProxy(proxy());
|
installer->setProxy(proxy());
|
||||||
installer->setLogSection("Rockbox (Base)");
|
installer->setLogSection("Rockbox (Base)");
|
||||||
installer->setLogVersion(myversion);
|
installer->setLogVersion(myversion);
|
||||||
if(!userSettings->value("cachedisable").toBool())
|
if(!settings->cacheDisabled())
|
||||||
installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
|
installer->setCache(settings->cachePath());
|
||||||
installer->setMountPoint(userSettings->value("mountpoint").toString());
|
installer->setMountPoint(settings->mountpoint());
|
||||||
installer->install(logger);
|
installer->install(logger);
|
||||||
|
|
||||||
connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool)));
|
connect(installer, SIGNAL(done(bool)), this, SLOT(installdone(bool)));
|
||||||
|
@ -498,21 +468,17 @@ bool RbUtilQt::installAuto()
|
||||||
void RbUtilQt::install()
|
void RbUtilQt::install()
|
||||||
{
|
{
|
||||||
Install *installWindow = new Install(this);
|
Install *installWindow = new Install(this);
|
||||||
installWindow->setUserSettings(userSettings);
|
installWindow->setSettings(settings);
|
||||||
installWindow->setDeviceSettings(devices);
|
|
||||||
installWindow->setProxy(proxy());
|
installWindow->setProxy(proxy());
|
||||||
|
|
||||||
buildInfo.open();
|
buildInfo.open();
|
||||||
QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
|
QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
|
||||||
buildInfo.close();
|
buildInfo.close();
|
||||||
|
|
||||||
devices->beginGroup(platform);
|
if(settings->curReleased()) {
|
||||||
QString released = devices->value("released").toString();
|
|
||||||
devices->endGroup();
|
|
||||||
if(released == "yes") {
|
|
||||||
// only set the keys if needed -- querying will yield an empty string
|
// only set the keys if needed -- querying will yield an empty string
|
||||||
// if not set.
|
// if not set.
|
||||||
versmap.insert("rel_rev", devices->value("last_release").toString());
|
versmap.insert("rel_rev", settings->lastRelease());
|
||||||
versmap.insert("rel_date", ""); // FIXME: provide the release timestamp
|
versmap.insert("rel_date", ""); // FIXME: provide the release timestamp
|
||||||
}
|
}
|
||||||
installWindow->setVersionStrings(versmap);
|
installWindow->setVersionStrings(versmap);
|
||||||
|
@ -543,19 +509,19 @@ void RbUtilQt::installBootloaderBtn()
|
||||||
|
|
||||||
void RbUtilQt::installBootloader()
|
void RbUtilQt::installBootloader()
|
||||||
{
|
{
|
||||||
QString platform = userSettings->value("platform").toString();
|
QString platform = settings->curPlatform();
|
||||||
|
|
||||||
// create installer
|
// create installer
|
||||||
blinstaller = new BootloaderInstaller(this);
|
blinstaller = new BootloaderInstaller(this);
|
||||||
|
|
||||||
blinstaller->setMountPoint(userSettings->value("mountpoint").toString());
|
blinstaller->setMountPoint(settings->mountpoint());
|
||||||
|
|
||||||
blinstaller->setProxy(proxy());
|
blinstaller->setProxy(proxy());
|
||||||
blinstaller->setDevice(platform);
|
blinstaller->setDevice(platform);
|
||||||
blinstaller->setBootloaderMethod(devices->value(platform + "/bootloadermethod").toString());
|
blinstaller->setBootloaderMethod(settings->curBootloaderMethod());
|
||||||
blinstaller->setBootloaderName(devices->value(platform + "/bootloadername").toString());
|
blinstaller->setBootloaderName(settings->curBootloaderName());
|
||||||
blinstaller->setBootloaderBaseUrl(devices->value("bootloader_url").toString());
|
blinstaller->setBootloaderBaseUrl(settings->bootloaderUrl());
|
||||||
blinstaller->setBootloaderInfoUrl(devices->value("bootloader_info_url").toString());
|
blinstaller->setBootloaderInfoUrl(settings->bootloaderInfoUrl());
|
||||||
if(!blinstaller->downloadInfo())
|
if(!blinstaller->downloadInfo())
|
||||||
{
|
{
|
||||||
logger->addItem(tr("Could not get the bootloader info file!"),LOGERROR);
|
logger->addItem(tr("Could not get the bootloader info file!"),LOGERROR);
|
||||||
|
@ -581,10 +547,10 @@ void RbUtilQt::installBootloader()
|
||||||
|
|
||||||
// if fwpatcher , ask for extra file
|
// if fwpatcher , ask for extra file
|
||||||
QString offirmware;
|
QString offirmware;
|
||||||
if(devices->value(platform + "/bootloadermethod").toString() == "fwpatcher")
|
if(settings->curBootloaderMethod() == "fwpatcher")
|
||||||
{
|
{
|
||||||
BrowseOF ofbrowser(this);
|
BrowseOF ofbrowser(this);
|
||||||
ofbrowser.setFile(userSettings->value("ofpath").toString());
|
ofbrowser.setFile(settings->ofPath());
|
||||||
if(ofbrowser.exec() == QDialog::Accepted)
|
if(ofbrowser.exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
offirmware = ofbrowser.getFile();
|
offirmware = ofbrowser.getFile();
|
||||||
|
@ -598,8 +564,8 @@ void RbUtilQt::installBootloader()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
userSettings->setValue("ofpath",offirmware);
|
settings->setOfPath(offirmware);
|
||||||
userSettings->sync();
|
settings->sync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -639,13 +605,13 @@ void RbUtilQt::installFonts()
|
||||||
// create zip installer
|
// create zip installer
|
||||||
installer = new ZipInstaller(this);
|
installer = new ZipInstaller(this);
|
||||||
|
|
||||||
installer->setUrl(devices->value("font_url").toString());
|
installer->setUrl(settings->fontUrl());
|
||||||
installer->setProxy(proxy());
|
installer->setProxy(proxy());
|
||||||
installer->setLogSection("Fonts");
|
installer->setLogSection("Fonts");
|
||||||
installer->setLogVersion(versmap.value("arch_date"));
|
installer->setLogVersion(versmap.value("arch_date"));
|
||||||
installer->setMountPoint(userSettings->value("mountpoint").toString());
|
installer->setMountPoint(settings->mountpoint());
|
||||||
if(!userSettings->value("cachedisable").toBool())
|
if(!settings->cacheDisabled())
|
||||||
installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
|
installer->setCache(settings->cachePath());
|
||||||
installer->install(logger);
|
installer->install(logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -664,25 +630,22 @@ void RbUtilQt::installVoice()
|
||||||
installer = new ZipInstaller(this);
|
installer = new ZipInstaller(this);
|
||||||
installer->setUnzip(false);
|
installer->setUnzip(false);
|
||||||
|
|
||||||
QString voiceurl = devices->value("voice_url").toString() + "/" ;
|
QString voiceurl = settings->voiceUrl() + "/" ;
|
||||||
|
|
||||||
devices->beginGroup(userSettings->value("platform").toString());
|
voiceurl += settings->curVoiceName() + "-" +
|
||||||
voiceurl += devices->value("voicename").toString() + "-" +
|
|
||||||
versmap.value("arch_date") + "-english.voice";
|
versmap.value("arch_date") + "-english.voice";
|
||||||
devices->endGroup();
|
|
||||||
qDebug() << voiceurl;
|
qDebug() << voiceurl;
|
||||||
|
|
||||||
installer->setProxy(proxy());
|
installer->setProxy(proxy());
|
||||||
installer->setUrl(voiceurl);
|
installer->setUrl(voiceurl);
|
||||||
installer->setLogSection("Voice");
|
installer->setLogSection("Voice");
|
||||||
installer->setLogVersion(versmap.value("arch_date"));
|
installer->setLogVersion(versmap.value("arch_date"));
|
||||||
installer->setMountPoint(userSettings->value("mountpoint").toString());
|
installer->setMountPoint(settings->mountpoint());
|
||||||
installer->setTarget("/.rockbox/langs/english.voice");
|
installer->setTarget("/.rockbox/langs/english.voice");
|
||||||
if(!userSettings->value("cachedisable").toBool())
|
if(!settings->cacheDisabled())
|
||||||
installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
|
installer->setCache(settings->cachePath());
|
||||||
installer->install(logger);
|
installer->install(logger);
|
||||||
|
|
||||||
//connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RbUtilQt::installDoomBtn()
|
void RbUtilQt::installDoomBtn()
|
||||||
|
@ -711,7 +674,7 @@ bool RbUtilQt::installDoomAuto()
|
||||||
|
|
||||||
bool RbUtilQt::hasDoom()
|
bool RbUtilQt::hasDoom()
|
||||||
{
|
{
|
||||||
QFile doomrock(userSettings->value("mountpoint").toString()+"/.rockbox/rocks/games/doom.rock");
|
QFile doomrock(settings->mountpoint() +"/.rockbox/rocks/games/doom.rock");
|
||||||
return doomrock.exists();
|
return doomrock.exists();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -720,35 +683,32 @@ void RbUtilQt::installDoom()
|
||||||
// create zip installer
|
// create zip installer
|
||||||
installer = new ZipInstaller(this);
|
installer = new ZipInstaller(this);
|
||||||
|
|
||||||
installer->setUrl(devices->value("doom_url").toString());
|
installer->setUrl(settings->doomUrl());
|
||||||
installer->setProxy(proxy());
|
installer->setProxy(proxy());
|
||||||
installer->setLogSection("Game Addons");
|
installer->setLogSection("Game Addons");
|
||||||
installer->setLogVersion(versmap.value("arch_date"));
|
installer->setLogVersion(versmap.value("arch_date"));
|
||||||
installer->setMountPoint(userSettings->value("mountpoint").toString());
|
installer->setMountPoint(settings->mountpoint());
|
||||||
if(!userSettings->value("cachedisable").toBool())
|
if(!settings->cacheDisabled())
|
||||||
installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
|
installer->setCache(settings->cachePath());
|
||||||
installer->install(logger);
|
installer->install(logger);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RbUtilQt::installThemes()
|
void RbUtilQt::installThemes()
|
||||||
{
|
{
|
||||||
if(chkConfig(true)) return;
|
if(chkConfig(true)) return;
|
||||||
ThemesInstallWindow* tw = new ThemesInstallWindow(this);
|
ThemesInstallWindow* tw = new ThemesInstallWindow(this);
|
||||||
tw->setDeviceSettings(devices);
|
tw->setSettings(settings);
|
||||||
tw->setUserSettings(userSettings);
|
|
||||||
tw->setProxy(proxy());
|
tw->setProxy(proxy());
|
||||||
tw->setModal(true);
|
tw->setModal(true);
|
||||||
tw->show();
|
tw->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RbUtilQt::createTalkFiles(void)
|
void RbUtilQt::createTalkFiles(void)
|
||||||
{
|
{
|
||||||
if(chkConfig(true)) return;
|
if(chkConfig(true)) return;
|
||||||
InstallTalkWindow *installWindow = new InstallTalkWindow(this);
|
InstallTalkWindow *installWindow = new InstallTalkWindow(this);
|
||||||
installWindow->setSettings(userSettings,devices);
|
installWindow->setSettings(settings);
|
||||||
installWindow->show();
|
installWindow->show();
|
||||||
connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo()));
|
connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo()));
|
||||||
connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
|
connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
|
||||||
|
@ -759,7 +719,7 @@ void RbUtilQt::createVoiceFile(void)
|
||||||
{
|
{
|
||||||
if(chkConfig(true)) return;
|
if(chkConfig(true)) return;
|
||||||
CreateVoiceWindow *installWindow = new CreateVoiceWindow(this);
|
CreateVoiceWindow *installWindow = new CreateVoiceWindow(this);
|
||||||
installWindow->setSettings(userSettings,devices);
|
installWindow->setSettings(settings);
|
||||||
installWindow->setProxy(proxy());
|
installWindow->setProxy(proxy());
|
||||||
|
|
||||||
installWindow->show();
|
installWindow->show();
|
||||||
|
@ -771,8 +731,7 @@ void RbUtilQt::uninstall(void)
|
||||||
{
|
{
|
||||||
if(chkConfig(true)) return;
|
if(chkConfig(true)) return;
|
||||||
UninstallWindow *uninstallWindow = new UninstallWindow(this);
|
UninstallWindow *uninstallWindow = new UninstallWindow(this);
|
||||||
uninstallWindow->setUserSettings(userSettings);
|
uninstallWindow->setSettings(settings);
|
||||||
uninstallWindow->setDeviceSettings(devices);
|
|
||||||
uninstallWindow->show();
|
uninstallWindow->show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -787,15 +746,14 @@ void RbUtilQt::uninstallBootloader(void)
|
||||||
ProgressLoggerGui* logger = new ProgressLoggerGui(this);
|
ProgressLoggerGui* logger = new ProgressLoggerGui(this);
|
||||||
logger->show();
|
logger->show();
|
||||||
|
|
||||||
QString plattform = userSettings->value("platform").toString();
|
|
||||||
BootloaderInstaller blinstaller(this);
|
BootloaderInstaller blinstaller(this);
|
||||||
blinstaller.setProxy(proxy());
|
blinstaller.setProxy(proxy());
|
||||||
blinstaller.setMountPoint(userSettings->value("mountpoint").toString());
|
blinstaller.setMountPoint(settings->mountpoint());
|
||||||
blinstaller.setDevice(userSettings->value("platform").toString());
|
blinstaller.setDevice(settings->curPlatform());
|
||||||
blinstaller.setBootloaderMethod(devices->value(plattform + "/bootloadermethod").toString());
|
blinstaller.setBootloaderMethod(settings->curBootloaderMethod());
|
||||||
blinstaller.setBootloaderName(devices->value(plattform + "/bootloadername").toString());
|
blinstaller.setBootloaderName(settings->curBootloaderName());
|
||||||
blinstaller.setBootloaderBaseUrl(devices->value("bootloader_url").toString());
|
blinstaller.setBootloaderBaseUrl(settings->bootloaderUrl());
|
||||||
blinstaller.setBootloaderInfoUrl(devices->value("bootloader_info_url").toString());
|
blinstaller.setBootloaderInfoUrl(settings->bootloaderInfoUrl());
|
||||||
if(!blinstaller.downloadInfo())
|
if(!blinstaller.downloadInfo())
|
||||||
{
|
{
|
||||||
logger->addItem(tr("Could not get the bootloader info file!"),LOGERROR);
|
logger->addItem(tr("Could not get the bootloader info file!"),LOGERROR);
|
||||||
|
@ -821,11 +779,7 @@ void RbUtilQt::downloadManual(void)
|
||||||
QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
|
QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
|
||||||
buildInfo.close();
|
buildInfo.close();
|
||||||
|
|
||||||
devices->beginGroup(userSettings->value("platform").toString());
|
QString manual = settings->curManual();
|
||||||
QString manual;
|
|
||||||
manual = devices->value("manualname", "rockbox-" +
|
|
||||||
devices->value("platform").toString()).toString();
|
|
||||||
devices->endGroup();
|
|
||||||
|
|
||||||
QString date = (info.value("dailies/date").toString());
|
QString date = (info.value("dailies/date").toString());
|
||||||
|
|
||||||
|
@ -840,15 +794,15 @@ void RbUtilQt::downloadManual(void)
|
||||||
target = "/" + manual + "-" + date + "-html.zip";
|
target = "/" + manual + "-" + date + "-html.zip";
|
||||||
section = "Manual (HTML)";
|
section = "Manual (HTML)";
|
||||||
}
|
}
|
||||||
manualurl = devices->value("manual_url").toString() + "/" + target;
|
manualurl = settings->manualUrl() + "/" + target;
|
||||||
qDebug() << "manualurl =" << manualurl;
|
qDebug() << "manualurl =" << manualurl;
|
||||||
|
|
||||||
ProgressLoggerGui* logger = new ProgressLoggerGui(this);
|
ProgressLoggerGui* logger = new ProgressLoggerGui(this);
|
||||||
logger->show();
|
logger->show();
|
||||||
installer = new ZipInstaller(this);
|
installer = new ZipInstaller(this);
|
||||||
installer->setMountPoint(userSettings->value("mountpoint").toString());
|
installer->setMountPoint(settings->mountpoint());
|
||||||
if(!userSettings->value("cachedisable").toBool())
|
if(!settings->cacheDisabled())
|
||||||
installer->setCache(userSettings->value("cachepath", QDir::tempPath()).toString());
|
installer->setCache(settings->cachePath());
|
||||||
installer->setProxy(proxy());
|
installer->setProxy(proxy());
|
||||||
installer->setLogSection(section);
|
installer->setLogSection(section);
|
||||||
installer->setLogVersion(date);
|
installer->setLogVersion(date);
|
||||||
|
@ -874,23 +828,23 @@ void RbUtilQt::installPortable(void)
|
||||||
logger->addItem(tr("Installing Rockbox Utility"), LOGINFO);
|
logger->addItem(tr("Installing Rockbox Utility"), LOGINFO);
|
||||||
|
|
||||||
// check mountpoint
|
// check mountpoint
|
||||||
if(!QFileInfo(userSettings->value("mountpoint").toString()).isDir()) {
|
if(!QFileInfo(settings->mountpoint()).isDir()) {
|
||||||
logger->addItem(tr("Mount point is wrong!"),LOGERROR);
|
logger->addItem(tr("Mount point is wrong!"),LOGERROR);
|
||||||
logger->abort();
|
logger->abort();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove old files first.
|
// remove old files first.
|
||||||
QFile::remove(userSettings->value("mountpoint").toString() + "/RockboxUtility.exe");
|
QFile::remove(settings->mountpoint() + "/RockboxUtility.exe");
|
||||||
QFile::remove(userSettings->value("mountpoint").toString() + "/RockboxUtility.ini");
|
QFile::remove(settings->mountpoint() + "/RockboxUtility.ini");
|
||||||
// copy currently running binary and currently used settings file
|
// copy currently running binary and currently used settings file
|
||||||
if(!QFile::copy(qApp->applicationFilePath(), userSettings->value("mountpoint").toString() + "/RockboxUtility.exe")) {
|
if(!QFile::copy(qApp->applicationFilePath(), settings->mountpoint() + "/RockboxUtility.exe")) {
|
||||||
logger->addItem(tr("Error installing Rockbox Utility"), LOGERROR);
|
logger->addItem(tr("Error installing Rockbox Utility"), LOGERROR);
|
||||||
logger->abort();
|
logger->abort();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger->addItem(tr("Installing user configuration"), LOGINFO);
|
logger->addItem(tr("Installing user configuration"), LOGINFO);
|
||||||
if(!QFile::copy(userSettings->fileName(), userSettings->value("mountpoint").toString() + "/RockboxUtility.ini")) {
|
if(!QFile::copy(settings->userSettingFilename(), settings->mountpoint() + "/RockboxUtility.ini")) {
|
||||||
logger->addItem(tr("Error installing user configuration"), LOGERROR);
|
logger->addItem(tr("Error installing user configuration"), LOGERROR);
|
||||||
logger->abort();
|
logger->abort();
|
||||||
return;
|
return;
|
||||||
|
@ -907,7 +861,7 @@ void RbUtilQt::updateInfo()
|
||||||
{
|
{
|
||||||
qDebug() << "RbUtilQt::updateInfo()";
|
qDebug() << "RbUtilQt::updateInfo()";
|
||||||
|
|
||||||
QSettings log(userSettings->value("mountpoint").toString() + "/.rockbox/rbutil.log", QSettings::IniFormat, this);
|
QSettings log(settings->mountpoint() + "/.rockbox/rbutil.log", QSettings::IniFormat, this);
|
||||||
QStringList groups = log.childGroups();
|
QStringList groups = log.childGroups();
|
||||||
QList<QTreeWidgetItem *> items;
|
QList<QTreeWidgetItem *> items;
|
||||||
QTreeWidgetItem *w, *w2;
|
QTreeWidgetItem *w, *w2;
|
||||||
|
@ -943,7 +897,7 @@ void RbUtilQt::updateInfo()
|
||||||
|
|
||||||
for(int b = 0; b < keys.size(); b++) {
|
for(int b = 0; b < keys.size(); b++) {
|
||||||
QString file;
|
QString file;
|
||||||
file = userSettings->value("mountpoint").toString() + "/" + keys.at(b);
|
file = settings->mountpoint() + "/" + keys.at(b);
|
||||||
if(QFileInfo(file).isDir())
|
if(QFileInfo(file).isDir())
|
||||||
continue;
|
continue;
|
||||||
w2 = new QTreeWidgetItem(w, QStringList() << "/"
|
w2 = new QTreeWidgetItem(w, QStringList() << "/"
|
||||||
|
@ -968,9 +922,9 @@ void RbUtilQt::updateInfo()
|
||||||
|
|
||||||
QUrl RbUtilQt::proxy()
|
QUrl RbUtilQt::proxy()
|
||||||
{
|
{
|
||||||
if(userSettings->value("proxytype", "system").toString() == "manual")
|
if(settings->proxyType() == "manual")
|
||||||
return QUrl(userSettings->value("proxy").toString());
|
return QUrl(settings->proxy());
|
||||||
else if(userSettings->value("proxytype", "system").toString() == "system")
|
else if(settings->proxy() == "system")
|
||||||
{
|
{
|
||||||
systemProxy();
|
systemProxy();
|
||||||
}
|
}
|
||||||
|
@ -981,9 +935,9 @@ QUrl RbUtilQt::proxy()
|
||||||
bool RbUtilQt::chkConfig(bool warn)
|
bool RbUtilQt::chkConfig(bool warn)
|
||||||
{
|
{
|
||||||
bool error = false;
|
bool error = false;
|
||||||
if(userSettings->value("platform").toString().isEmpty()
|
if(settings->curPlatform().isEmpty()
|
||||||
|| userSettings->value("mountpoint").toString().isEmpty()
|
|| settings->mountpoint().isEmpty()
|
||||||
|| !QFileInfo(userSettings->value("mountpoint").toString()).isWritable()) {
|
|| !QFileInfo(settings->mountpoint()).isWritable()) {
|
||||||
error = true;
|
error = true;
|
||||||
|
|
||||||
if(warn) QMessageBox::critical(this, tr("Configuration error"),
|
if(warn) QMessageBox::critical(this, tr("Configuration error"),
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include "progressloggergui.h"
|
#include "progressloggergui.h"
|
||||||
#include "installbootloader.h"
|
#include "installbootloader.h"
|
||||||
|
|
||||||
|
#include "rbsettings.h"
|
||||||
|
|
||||||
class RbUtilQt : public QMainWindow
|
class RbUtilQt : public QMainWindow
|
||||||
{
|
{
|
||||||
|
@ -40,8 +41,8 @@ class RbUtilQt : public QMainWindow
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::RbUtilQtFrm ui;
|
Ui::RbUtilQtFrm ui;
|
||||||
QSettings *devices;
|
RbSettings* settings;
|
||||||
QSettings *userSettings;
|
|
||||||
void initDeviceNames(void);
|
void initDeviceNames(void);
|
||||||
QString deviceName(QString);
|
QString deviceName(QString);
|
||||||
QString platform;
|
QString platform;
|
||||||
|
|
|
@ -52,7 +52,8 @@ SOURCES += rbutilqt.cpp \
|
||||||
../../tools/wavtrim.c \
|
../../tools/wavtrim.c \
|
||||||
../../tools/voicefont.c \
|
../../tools/voicefont.c \
|
||||||
voicefile.cpp \
|
voicefile.cpp \
|
||||||
createvoicewindow.cpp
|
createvoicewindow.cpp \
|
||||||
|
rbsettings.cpp
|
||||||
|
|
||||||
HEADERS += rbutilqt.h \
|
HEADERS += rbutilqt.h \
|
||||||
install.h \
|
install.h \
|
||||||
|
@ -94,7 +95,8 @@ HEADERS += rbutilqt.h \
|
||||||
../../tools/wavtrim.h \
|
../../tools/wavtrim.h \
|
||||||
../../tools/voicefont.h \
|
../../tools/voicefont.h \
|
||||||
voicefile.h \
|
voicefile.h \
|
||||||
createvoicewindow.h
|
createvoicewindow.h \
|
||||||
|
rbsettings.h
|
||||||
|
|
||||||
# Needed by QT on Win
|
# Needed by QT on Win
|
||||||
INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher ../../tools/rbspeex ../../tools
|
INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher ../../tools/rbspeex ../../tools
|
||||||
|
|
|
@ -31,8 +31,8 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
|
||||||
m_logger->addItem(tr("Starting Talk file generation"),LOGINFO);
|
m_logger->addItem(tr("Starting Talk file generation"),LOGINFO);
|
||||||
|
|
||||||
//tts
|
//tts
|
||||||
m_tts = getTTS(userSettings->value("tts").toString());
|
m_tts = getTTS(settings->curTTS());
|
||||||
m_tts->setCfg(userSettings,deviceSettings);
|
m_tts->setCfg(settings);
|
||||||
|
|
||||||
QString errStr;
|
QString errStr;
|
||||||
if(!m_tts->start(&errStr))
|
if(!m_tts->start(&errStr))
|
||||||
|
@ -44,8 +44,8 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encoder
|
// Encoder
|
||||||
m_enc = getEncoder(userSettings->value("encoder").toString());
|
m_enc = getEncoder(settings->curEncoder());
|
||||||
m_enc->setUserCfg(userSettings);
|
m_enc->setCfg(settings);
|
||||||
|
|
||||||
if(!m_enc->start())
|
if(!m_enc->start())
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
|
|
||||||
bool createTalkFiles(ProgressloggerInterface* logger);
|
bool createTalkFiles(ProgressloggerInterface* logger);
|
||||||
|
|
||||||
void setSettings(QSettings* uSettings,QSettings* dSettings) { userSettings = uSettings; deviceSettings = dSettings;}
|
void setSettings(RbSettings* sett) { settings = sett;}
|
||||||
|
|
||||||
void setDir(QDir dir){m_dir = dir; }
|
void setDir(QDir dir){m_dir = dir; }
|
||||||
void setMountPoint(QString mountpoint) {m_mountpoint =mountpoint; }
|
void setMountPoint(QString mountpoint) {m_mountpoint =mountpoint; }
|
||||||
|
@ -55,8 +55,7 @@ private slots:
|
||||||
private:
|
private:
|
||||||
TTSBase* m_tts;
|
TTSBase* m_tts;
|
||||||
EncBase* m_enc;
|
EncBase* m_enc;
|
||||||
QSettings *userSettings;
|
RbSettings* settings;
|
||||||
QSettings *deviceSettings;
|
|
||||||
|
|
||||||
QDir m_dir;
|
QDir m_dir;
|
||||||
QString m_mountpoint;
|
QString m_mountpoint;
|
||||||
|
|
|
@ -106,10 +106,8 @@ TTSExes::TTSExes(QString name,QWidget *parent) : TTSBase(parent)
|
||||||
|
|
||||||
bool TTSExes::start(QString *errStr)
|
bool TTSExes::start(QString *errStr)
|
||||||
{
|
{
|
||||||
userSettings->beginGroup(m_name);
|
m_TTSexec = settings->ttsPath(m_name);
|
||||||
m_TTSexec = userSettings->value("ttspath","").toString();
|
m_TTSOpts = settings->ttsOptions(m_name);
|
||||||
m_TTSOpts = userSettings->value("ttsoptions","").toString();
|
|
||||||
userSettings->endGroup();
|
|
||||||
|
|
||||||
m_TTSTemplate = m_TemplateMap.value(m_name);
|
m_TTSTemplate = m_TemplateMap.value(m_name);
|
||||||
|
|
||||||
|
@ -149,10 +147,8 @@ void TTSExes::reset()
|
||||||
void TTSExes::showCfg()
|
void TTSExes::showCfg()
|
||||||
{
|
{
|
||||||
// try to get config from settings
|
// try to get config from settings
|
||||||
userSettings->beginGroup(m_name);
|
QString exepath =settings->ttsPath(m_name);
|
||||||
QString exepath =userSettings->value("ttspath","").toString();
|
ui.ttsoptions->setText(settings->ttsOptions(m_name));
|
||||||
ui.ttsoptions->setText(userSettings->value("ttsoptions","").toString());
|
|
||||||
userSettings->endGroup();
|
|
||||||
|
|
||||||
if(exepath == "")
|
if(exepath == "")
|
||||||
{
|
{
|
||||||
|
@ -191,16 +187,12 @@ void TTSExes::showCfg()
|
||||||
|
|
||||||
void TTSExes::accept(void)
|
void TTSExes::accept(void)
|
||||||
{
|
{
|
||||||
if(userSettings != NULL)
|
//save settings in user config
|
||||||
{
|
settings->setTTSPath(m_name,ui.ttspath->text());
|
||||||
//save settings in user config
|
settings->setTTSOptions(m_name,ui.ttsoptions->text());
|
||||||
userSettings->beginGroup(m_name);
|
// sync settings
|
||||||
userSettings->setValue("ttspath",ui.ttspath->text());
|
settings->sync();
|
||||||
userSettings->setValue("ttsoptions",ui.ttsoptions->text());
|
|
||||||
userSettings->endGroup();
|
|
||||||
// sync settings
|
|
||||||
userSettings->sync();
|
|
||||||
}
|
|
||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,9 +203,7 @@ void TTSExes::reject(void)
|
||||||
|
|
||||||
bool TTSExes::configOk()
|
bool TTSExes::configOk()
|
||||||
{
|
{
|
||||||
userSettings->beginGroup(m_name);
|
QString path = settings->ttsPath(m_name);
|
||||||
QString path = userSettings->value("ttspath","").toString();
|
|
||||||
userSettings->endGroup();
|
|
||||||
|
|
||||||
if (QFileInfo(path).exists())
|
if (QFileInfo(path).exists())
|
||||||
return true;
|
return true;
|
||||||
|
@ -257,12 +247,10 @@ TTSSapi::TTSSapi(QWidget *parent) : TTSBase(parent)
|
||||||
bool TTSSapi::start(QString *errStr)
|
bool TTSSapi::start(QString *errStr)
|
||||||
{
|
{
|
||||||
|
|
||||||
userSettings->beginGroup("sapi");
|
m_TTSOpts = settings->ttsOptions("sapi");
|
||||||
m_TTSOpts = userSettings->value("ttsoptions","").toString();
|
m_TTSLanguage =settings->ttsLang("sapi");
|
||||||
m_TTSLanguage =userSettings->value("ttslanguage","").toString();
|
m_TTSVoice=settings->ttsVoice("sapi");
|
||||||
m_TTSVoice=userSettings->value("ttsvoice","").toString();
|
m_TTSSpeed=settings->ttsSpeed("sapi");
|
||||||
m_TTSSpeed=userSettings->value("ttsspeed","").toString();
|
|
||||||
userSettings->endGroup();
|
|
||||||
|
|
||||||
QFile::remove(QDir::tempPath() +"/sapi_voice.vbs");
|
QFile::remove(QDir::tempPath() +"/sapi_voice.vbs");
|
||||||
QFile::copy(":/builtin/sapi_voice.vbs",QDir::tempPath() + "/sapi_voice.vbs");
|
QFile::copy(":/builtin/sapi_voice.vbs",QDir::tempPath() + "/sapi_voice.vbs");
|
||||||
|
@ -384,23 +372,14 @@ void TTSSapi::reset()
|
||||||
void TTSSapi::showCfg()
|
void TTSSapi::showCfg()
|
||||||
{
|
{
|
||||||
// try to get config from settings
|
// try to get config from settings
|
||||||
userSettings->beginGroup("sapi");
|
ui.ttsoptions->setText(settings->ttsOptions("sapi"));
|
||||||
ui.ttsoptions->setText(userSettings->value("ttsoptions","").toString());
|
QString selLang = settings->ttsLang("sapi");
|
||||||
QString selLang = userSettings->value("ttslanguage",defaultLanguage).toString();
|
QString selVoice = settings->ttsVoice("sapi");
|
||||||
QString selVoice = userSettings->value("ttsvoice","").toString();
|
ui.speed->setValue(settings->ttsSpeed("sapi"));
|
||||||
ui.speed->setValue(userSettings->value("ttsspeed",0).toInt());
|
|
||||||
userSettings->endGroup();
|
|
||||||
|
|
||||||
// fill in language combobox
|
// fill in language combobox
|
||||||
|
QStringList languages = settings->allLanguages();
|
||||||
deviceSettings->beginGroup("languages");
|
|
||||||
QStringList keys = deviceSettings->allKeys();
|
|
||||||
QStringList languages;
|
|
||||||
for(int i =0 ; i < keys.size();i++)
|
|
||||||
{
|
|
||||||
languages << deviceSettings->value(keys.at(i)).toString();
|
|
||||||
}
|
|
||||||
deviceSettings->endGroup();
|
|
||||||
|
|
||||||
languages.sort();
|
languages.sort();
|
||||||
ui.languagecombo->clear();
|
ui.languagecombo->clear();
|
||||||
|
@ -422,18 +401,14 @@ void TTSSapi::showCfg()
|
||||||
|
|
||||||
void TTSSapi::accept(void)
|
void TTSSapi::accept(void)
|
||||||
{
|
{
|
||||||
if(userSettings != NULL)
|
//save settings in user config
|
||||||
{
|
settings->setTTSOptions("sapi",ui.ttsoptions->text());
|
||||||
//save settings in user config
|
settings->setTTSLang("sapi",ui.languagecombo->currentText());
|
||||||
userSettings->beginGroup("sapi");
|
settings->setTTSVoice("sapi",ui.voicecombo->currentText());
|
||||||
userSettings->setValue("ttsoptions",ui.ttsoptions->text());
|
settings->setTTSSpeed("sapi",ui.speed->value());
|
||||||
userSettings->setValue("ttslanguage",ui.languagecombo->currentText());
|
// sync settings
|
||||||
userSettings->setValue("ttsvoice",ui.voicecombo->currentText());
|
settings->sync();
|
||||||
userSettings->setValue("ttsspeed",QString("%1").arg(ui.speed->value()));
|
|
||||||
userSettings->endGroup();
|
|
||||||
// sync settings
|
|
||||||
userSettings->sync();
|
|
||||||
}
|
|
||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include "ui_ttsexescfgfrm.h"
|
#include "ui_ttsexescfgfrm.h"
|
||||||
#include "ui_sapicfgfrm.h"
|
#include "ui_sapicfgfrm.h"
|
||||||
|
#include "rbsettings.h"
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,7 +48,7 @@ public:
|
||||||
virtual void showCfg(){}
|
virtual void showCfg(){}
|
||||||
virtual bool configOk(){return false;}
|
virtual bool configOk(){return false;}
|
||||||
|
|
||||||
void setCfg(QSettings *uSettings, QSettings *dSettings){userSettings = uSettings;deviceSettings = dSettings;}
|
void setCfg(RbSettings* sett){settings = sett;}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void accept(void){}
|
virtual void accept(void){}
|
||||||
|
@ -55,9 +56,7 @@ public slots:
|
||||||
virtual void reset(void){}
|
virtual void reset(void){}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QSettings *userSettings;
|
RbSettings* settings;
|
||||||
QSettings *deviceSettings;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class TTSSapi : public TTSBase
|
class TTSSapi : public TTSBase
|
||||||
|
|
|
@ -67,18 +67,12 @@ void UninstallWindow::UninstallMethodChanged(bool complete)
|
||||||
ui.smartGroupBox->setEnabled(true);
|
ui.smartGroupBox->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UninstallWindow::setDeviceSettings(QSettings *dev)
|
|
||||||
|
void UninstallWindow::setSettings(RbSettings *sett)
|
||||||
{
|
{
|
||||||
devices = dev;
|
settings = sett;
|
||||||
qDebug() << "Install::setDeviceSettings:" << devices;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
QString mountpoint =settings->mountpoint();
|
||||||
void UninstallWindow::setUserSettings(QSettings *user)
|
|
||||||
{
|
|
||||||
userSettings = user;
|
|
||||||
|
|
||||||
QString mountpoint =userSettings->value("mountpoint").toString();
|
|
||||||
uninstaller = new Uninstaller(this,mountpoint);
|
uninstaller = new Uninstaller(this,mountpoint);
|
||||||
|
|
||||||
// disable smart uninstall, if not possible
|
// disable smart uninstall, if not possible
|
||||||
|
|
|
@ -22,19 +22,17 @@
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
||||||
#include <QSettings>
|
|
||||||
|
|
||||||
#include "ui_uninstallfrm.h"
|
#include "ui_uninstallfrm.h"
|
||||||
#include "progressloggergui.h"
|
#include "progressloggergui.h"
|
||||||
#include "uninstall.h"
|
#include "uninstall.h"
|
||||||
|
#include "rbsettings.h"
|
||||||
|
|
||||||
class UninstallWindow : public QDialog
|
class UninstallWindow : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
UninstallWindow(QWidget *parent = 0);
|
UninstallWindow(QWidget *parent = 0);
|
||||||
void setUserSettings(QSettings*);
|
void setSettings(RbSettings* sett);
|
||||||
void setDeviceSettings(QSettings*);
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void accept(void);
|
void accept(void);
|
||||||
|
@ -46,8 +44,7 @@ class UninstallWindow : public QDialog
|
||||||
Uninstaller* uninstaller;
|
Uninstaller* uninstaller;
|
||||||
Ui::UninstallFrm ui;
|
Ui::UninstallFrm ui;
|
||||||
ProgressLoggerGui* logger;
|
ProgressLoggerGui* logger;
|
||||||
QSettings *devices;
|
RbSettings* settings;
|
||||||
QSettings *userSettings;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ bool VoiceFileCreator::createVoiceFile(ProgressloggerInterface* logger)
|
||||||
info.close();
|
info.close();
|
||||||
|
|
||||||
//prepare download url
|
//prepare download url
|
||||||
QUrl genlangUrl = deviceSettings->value("genlang_url").toString() +"?lang=" +m_lang+"&t="+target+"&rev="+version+"&f="+features;
|
QUrl genlangUrl = settings->genlangUrl() +"?lang=" +m_lang+"&t="+target+"&rev="+version+"&f="+features;
|
||||||
|
|
||||||
qDebug() << "downloading " << genlangUrl;
|
qDebug() << "downloading " << genlangUrl;
|
||||||
|
|
||||||
|
@ -146,8 +146,8 @@ void VoiceFileCreator::downloadDone(bool error)
|
||||||
}
|
}
|
||||||
|
|
||||||
//tts
|
//tts
|
||||||
m_tts = getTTS(userSettings->value("tts").toString());
|
m_tts = getTTS(settings->curTTS());
|
||||||
m_tts->setCfg(userSettings,deviceSettings);
|
m_tts->setCfg(settings);
|
||||||
|
|
||||||
QString errStr;
|
QString errStr;
|
||||||
if(!m_tts->start(&errStr))
|
if(!m_tts->start(&errStr))
|
||||||
|
@ -159,8 +159,8 @@ void VoiceFileCreator::downloadDone(bool error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encoder
|
// Encoder
|
||||||
m_enc = getEncoder(userSettings->value("encoder").toString());
|
m_enc = getEncoder(settings->curEncoder());
|
||||||
m_enc->setUserCfg(userSettings);
|
m_enc->setCfg(settings);
|
||||||
|
|
||||||
if(!m_enc->start())
|
if(!m_enc->start())
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "encoders.h"
|
#include "encoders.h"
|
||||||
#include "tts.h"
|
#include "tts.h"
|
||||||
#include "httpget.h"
|
#include "httpget.h"
|
||||||
|
#include "rbsettings.h"
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
@ -44,7 +45,7 @@ public:
|
||||||
bool createVoiceFile(ProgressloggerInterface* logger);
|
bool createVoiceFile(ProgressloggerInterface* logger);
|
||||||
|
|
||||||
// set infos
|
// set infos
|
||||||
void setSettings(QSettings* uSettings,QSettings* dSettings) { userSettings = uSettings;deviceSettings = dSettings;}
|
void setSettings(RbSettings* sett) { settings = sett;}
|
||||||
|
|
||||||
void setMountPoint(QString mountpoint) {m_mountpoint =mountpoint; }
|
void setMountPoint(QString mountpoint) {m_mountpoint =mountpoint; }
|
||||||
void setTargetId(int id){m_targetid = id;}
|
void setTargetId(int id){m_targetid = id;}
|
||||||
|
@ -63,9 +64,7 @@ private:
|
||||||
// ptr to encoder, tts and settings
|
// ptr to encoder, tts and settings
|
||||||
TTSBase* m_tts;
|
TTSBase* m_tts;
|
||||||
EncBase* m_enc;
|
EncBase* m_enc;
|
||||||
QSettings *userSettings;
|
RbSettings* settings;
|
||||||
QSettings *deviceSettings;
|
|
||||||
|
|
||||||
HttpGet *getter;
|
HttpGet *getter;
|
||||||
|
|
||||||
QUrl m_proxy; //proxy
|
QUrl m_proxy; //proxy
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue