From 9c7c2bc3d7ee9f0e78154c512deb8e7dc96de1fe Mon Sep 17 00:00:00 2001 From: codestation Date: Sun, 19 Jan 2014 13:32:59 -0430 Subject: [PATCH] Added pkg support. --- ChangeLog | 1 + resources/translations/qcma_es.ts | 51 +++++++++++++++++++------------ resources/translations/qcma_ja.ts | 51 +++++++++++++++++++------------ src/cmarootobject.cpp | 6 ++++ src/forms/configwidget.cpp | 16 ++++++++++ src/forms/configwidget.h | 2 +- src/forms/configwidget.ui | 27 +++++++++++++++- src/qlistdb.cpp | 9 ++++-- 8 files changed, 119 insertions(+), 44 deletions(-) diff --git a/ChangeLog b/ChangeLog index 38188c9..a5ac386 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ qcma (0.3.2) unstable; urgency=low * Fixed bug with PSP savedata transfer. * Fixed multimedia folder copy from pc. + * Added pkg support. * Fixed about dialog. -- codestation Thu, 04 May 2014 00:00:00 -0000 diff --git a/resources/translations/qcma_es.ts b/resources/translations/qcma_es.ts index 6a990c9..2a60c35 100644 --- a/resources/translations/qcma_es.ts +++ b/resources/translations/qcma_es.ts @@ -170,8 +170,8 @@ Conectado a - - + + Connected to %1 (PS Vita) Conectado a %1 (PS Vita) @@ -210,6 +210,7 @@ + Browse... Buscar... @@ -262,95 +263,105 @@ Esta es la ubicación donde el sistema PS Vita leerá los contenidos que intente descargar. - + + Packages + Archivos PKG + + + Other Otros - + <html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:600;">Advanced settings</span></p></body></html> <html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:600;">Ajustes Avanzados</span></p></body></html> - + Offline Mode Modo desconectado - + Skip metadata extraction Saltar la extracción de metadatos - + Update database automatically when files on the PC are changed Actualizar la base de datos automaticamente - + SQLite SQLite - + Skip photo scanning Omitir el escaneo de fotos - + Skip video scanning Omitir el escaneo de vídeos - + Skip music scanning Omitir el escaneo de música - + Disable USB monitoring Deshabilitar monitoreo USB - + Disable Wi-Fi monitoring Deshabilitar monitoreo WiFi - + Database backend Almacenaje de base de datos - + In Memory En memoria - + Select the folder to be used as a photo source Seleccione el directorio a ser utilizado como origen de fotos - + Select the folder to be used as a music source Seleccione el directorio a ser utilizado como origen de música - + Select the folder to be used as a video source Seleccione el directorio a ser utilizado como origen de videos - + Select the folder to be used to save PS Vita games and backups Seleccione el directorio a ser utilizado para guardar juegos y respaldos - + Select the folder to be used to fetch software updates Seleccione el directorio a ser utilizado para extraer actualizaciones de software + + + Select the folder to be used to software packages + Seleccione el directorio a ser utilizado para almacenar archivos pkg + ConfirmDialog diff --git a/resources/translations/qcma_ja.ts b/resources/translations/qcma_ja.ts index 13b203c..08ddd7f 100644 --- a/resources/translations/qcma_ja.ts +++ b/resources/translations/qcma_ja.ts @@ -174,8 +174,8 @@ 次のデバイスに接続しました - - + + Connected to %1 (PS Vita) @@ -214,6 +214,7 @@ + Browse... 参照... @@ -266,95 +267,105 @@ - + + Packages + + + + Other その他 - + <html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:600;">Advanced settings</span></p></body></html> <html><head/><body><p align="center"><span style=" font-size:14pt; font-weight:600;">詳細設定</span></p></body></html> - + Offline Mode オフラインモード - + Skip metadata extraction メタデータの展開をスキップする - + Update database automatically when files on the PC are changed PCのファイルが変更された際にデータベースを自動的に更新する - + SQLite - + Skip photo scanning - + Skip video scanning - + Skip music scanning - + Disable USB monitoring USBの監視を無効にする - + Disable Wi-Fi monitoring Wi-Fiの監視を無効にする - + Database backend データベース保存 - + In Memory メモリ内 - + Select the folder to be used as a photo source フォトの参照先として使用されるフォルダを選択してください - + Select the folder to be used as a music source ミュージックの参照先として使用されるフォルダを選択してください - + Select the folder to be used as a video source ビデオの参照先として使用されるフォルダを選択してください - + Select the folder to be used to save PS Vita games and backups PS Vitaのゲームとバックアップの保存に使用されるフォルダを選択してください - + Select the folder to be used to fetch software updates ソフトウェアアップデートの取得に使用されるフォルダを選択してください + + + Select the folder to be used to software packages + + ConfirmDialog diff --git a/src/cmarootobject.cpp b/src/cmarootobject.cpp index b97faa3..869ba9d 100644 --- a/src/cmarootobject.cpp +++ b/src/cmarootobject.cpp @@ -99,6 +99,12 @@ void CMARootObject::initObject(const QString &path) metadata.dataType = App; this->path = QDir(QDir(path).absoluteFilePath("SYSTEM")).absoluteFilePath(uuid); num_filters = 0; + break; + + case VITA_OHFI_PACKAGE: + metadata.dataType = Package; + this->path = path; + num_filters = 0; } // create the backup directories diff --git a/src/forms/configwidget.cpp b/src/forms/configwidget.cpp index 006db55..1a626aa 100644 --- a/src/forms/configwidget.cpp +++ b/src/forms/configwidget.cpp @@ -52,11 +52,13 @@ void ConfigWidget::connectSignals() mapper->setMapping(ui->videoBtn, BTN_VIDEO); mapper->setMapping(ui->appBtn, BTN_APPS); mapper->setMapping(ui->urlBtn, BTN_URL); + mapper->setMapping(ui->pkgBtn, BTN_PKG); connect(ui->photoBtn, SIGNAL(clicked()), mapper, SLOT(map())); connect(ui->musicBtn, SIGNAL(clicked()), mapper, SLOT(map())); connect(ui->videoBtn, SIGNAL(clicked()), mapper, SLOT(map())); connect(ui->appBtn, SIGNAL(clicked()), mapper, SLOT(map())); connect(ui->urlBtn, SIGNAL(clicked()), mapper, SLOT(map())); + connect(ui->pkgBtn, SIGNAL(clicked()), mapper, SLOT(map())); connect(mapper, SIGNAL(mapped(int)), this, SLOT(browseBtnPressed(int))); connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())); @@ -68,17 +70,25 @@ void ConfigWidget::setDefaultData() QSettings settings; defaultdir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); ui->photoPath->setText(QDir::toNativeSeparators(settings.value("photoPath", defaultdir).toString())); + defaultdir = QStandardPaths::writableLocation(QStandardPaths::MusicLocation); ui->musicPath->setText(QDir::toNativeSeparators(settings.value("musicPath", defaultdir).toString())); + defaultdir = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation); ui->videoPath->setText(QDir::toNativeSeparators(settings.value("videoPath", defaultdir).toString())); + defaultdir = QStandardPaths::writableLocation(QStandardPaths::HomeLocation); defaultdir.append(QDir::separator()).append("PS Vita"); ui->appPath->setText(QDir::toNativeSeparators(settings.value("appsPath", defaultdir).toString())); + defaultdir = QStandardPaths::writableLocation(QStandardPaths::HomeLocation); defaultdir.append(QDir::separator()).append("PSV Updates"); ui->urlPath->setText(QDir::toNativeSeparators(settings.value("urlPath", defaultdir).toString())); + defaultdir = QStandardPaths::writableLocation(QStandardPaths::HomeLocation); + defaultdir.append(QDir::separator()).append("PSV Packages"); + ui->pkgPath->setText(QDir::toNativeSeparators(settings.value("pkgPath", defaultdir).toString())); + ui->offlineCheck->setChecked(settings.value("offlineMode", true).toBool()); ui->metadataCheck->setChecked(settings.value("skipMetadata", false).toBool()); ui->usbCheck->setChecked(settings.value("disableUSB", false).toBool()); @@ -126,6 +136,11 @@ void ConfigWidget::browseBtnPressed(int btn) msg = tr("Select the folder to be used to fetch software updates"); break; + case BTN_PKG: + lineedit = ui->pkgPath; + msg = tr("Select the folder to be used to software packages"); + break; + default: return; } @@ -155,6 +170,7 @@ void ConfigWidget::accept() savePath(settings, ui->videoPath, "videoPath"); savePath(settings, ui->appPath, "appsPath"); savePath(settings, ui->urlPath, "urlPath"); + savePath(settings, ui->pkgPath, "pkgPath"); settings.setValue("offlineMode", ui->offlineCheck->isChecked()); settings.setValue("skipMetadata", ui->metadataCheck->isChecked()); settings.setValue("disableUSB", ui->usbCheck->isChecked()); diff --git a/src/forms/configwidget.h b/src/forms/configwidget.h index a1a8d45..eeda29e 100644 --- a/src/forms/configwidget.h +++ b/src/forms/configwidget.h @@ -38,7 +38,7 @@ class ConfigWidget : public QDialog ~ConfigWidget(); private: - enum browse_buttons {BTN_PHOTO, BTN_MUSIC, BTN_VIDEO, BTN_APPS, BTN_URL}; + enum browse_buttons {BTN_PHOTO, BTN_MUSIC, BTN_VIDEO, BTN_APPS, BTN_URL, BTN_PKG}; void connectSignals(); void setDefaultData(); diff --git a/src/forms/configwidget.ui b/src/forms/configwidget.ui index 39720e8..91df22a 100644 --- a/src/forms/configwidget.ui +++ b/src/forms/configwidget.ui @@ -7,7 +7,7 @@ 0 0 520 - 432 + 437 @@ -211,6 +211,31 @@ + + + + + + Packages + + + + + + + + + + + + Browse... + + + + + + + diff --git a/src/qlistdb.cpp b/src/qlistdb.cpp index 2632ddc..2da853c 100644 --- a/src/qlistdb.cpp +++ b/src/qlistdb.cpp @@ -95,8 +95,9 @@ int QListDB::create() int total_objects = 0; //QMutexLocker locker(&mutex); const int ohfi_array[] = { VITA_OHFI_MUSIC, VITA_OHFI_PHOTO, VITA_OHFI_VIDEO, - VITA_OHFI_BACKUP, VITA_OHFI_VITAAPP, VITA_OHFI_PSPAPP, - VITA_OHFI_PSPSAVE, VITA_OHFI_PSXAPP, VITA_OHFI_PSMAPP + VITA_OHFI_PACKAGE, VITA_OHFI_BACKUP, VITA_OHFI_VITAAPP, + VITA_OHFI_PSPAPP, VITA_OHFI_PSPSAVE, VITA_OHFI_PSXAPP, + VITA_OHFI_PSMAPP }; CMAObject::resetOhfiCounter(); QSettings settings; @@ -129,6 +130,10 @@ int QListDB::create() case VITA_OHFI_PSXAPP: case VITA_OHFI_PSMAPP: obj->initObject(settings.value("appsPath").toString()); + break; + + case VITA_OHFI_PACKAGE: + obj->initObject(settings.value("pkgPath").toString()); } root_list list;