diff --git a/ChangeLog b/ChangeLog index 84bae7b..9066290 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ qcma (0.3.5) unstable; urgency=low - * Do not override the user provided protocol version. + * Added selector to override the default protocol version. + * Do not override the user provided protocol version with a default value. -- codestation Thu, 09 Oct 2014 00:00:00 -0000 diff --git a/resources/translations/qcma_es.ts b/resources/translations/qcma_es.ts index 430ac4b..eb57fa0 100644 --- a/resources/translations/qcma_es.ts +++ b/resources/translations/qcma_es.ts @@ -158,156 +158,156 @@ Directorios - + Specify the folders that the PS Vita will access for each content type. Especificar los directorios que el sistema PS Vita accederá para cada tipo de contenido. - - + + This is the location your Screenshots and Pictures are Saved to/Imported from. Esta es la ubicación donde tus capturas de pantalla e imágenes serán almacenadas o importadas. - + Photo Folder Directorio de Fotos - - - - - - + + + + + + Browse... Buscar... - - + + This is the location your Videos are Saved to/Imported from. Esta es la ubicación donde tus videos serán almacenados o importados. - + Video Folder Directorio de Videos - - + + This is the location your Music is Saved to/Imported from. Esta es la ubicación donde tu música será almacenada o importada. - + Music Folder Directorio de Música - - + + This is the location your Games, Apps, Savegames, and System Backups are Saved to/Imported from. Esta es la ubicación donde tus juegos, aplicaciones, partidas salvadas y respaldos del sistema serán almacenados o importados. - + Applications / Backups Aplicaciones / Juegos / Respaldos - + This is the location your Software Updates and Browser Data is Saved to/Imported from. Esta es la ubicación donde el sistema PS Vita leerá los contenidos que intente descargar. - + Updates / Web content Actualizaciones / Contenido Web - + This is the location your PS Vita system will read all the content that it tries to download. 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 - + CMA Protocol version Versión del protocolo CMA - - Reset to default - Valor por defecto + + Use custom version + Usar versión personalizada - + Disable USB monitoring Deshabilitar monitoreo USB - + Disable Wi-Fi monitoring Deshabilitar monitoreo WiFi - + Database backend Almacenaje de base de datos - + In Memory En memoria @@ -460,7 +460,7 @@ Hash de compilación: %1 Rama de compilación: %2 - + Information Información @@ -601,32 +601,32 @@ Rama de compilación: %2 UnityIndicator - + Settings Ajustes - + Refresh database Refrescar base de datos - + Backup Manager Gestor de Respaldos - + About QCMA Acerca de QCMA - + About Qt Acerca de Qt - + Quit Salir diff --git a/resources/translations/qcma_ja.ts b/resources/translations/qcma_ja.ts index 69c2388..fbe6690 100644 --- a/resources/translations/qcma_ja.ts +++ b/resources/translations/qcma_ja.ts @@ -158,156 +158,156 @@ フォルダ - + Specify the folders that the PS Vita will access for each content type. PS Vitaがアクセスするフォルダーをコンテンツの種類ごとに指定してください。 - - + + This is the location your Screenshots and Pictures are Saved to/Imported from. スクリーンショットや画像を保存/インポートする場所です。 - + Photo Folder フォト - - - - - - + + + + + + Browse... 参照... - - + + This is the location your Videos are Saved to/Imported from. ビデオを保存/インポートする場所です。 - + Video Folder ビデオ - - + + This is the location your Music is Saved to/Imported from. ミュージックを保存/インポートする場所です。 - + Music Folder ミュージック - - + + This is the location your Games, Apps, Savegames, and System Backups are Saved to/Imported from. ゲームやアプリ、セーブデータ、システムバックアップを保存/インポートする場所です。 - + Applications / Backups アプリケーション/バックアップファイル - + This is the location your Software Updates and Browser Data is Saved to/Imported from. ソフトウェアアップデートとブラウザデータをを保存/インポートする場所です。 - + Updates / Web content アップデート/Webコンテンツ - + This is the location your PS Vita system will read all the content that it tries to download. この場所の全てのコンテンツをPS Vitaシステムが読み込み、ダウンロードを試みます。 - + 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 SQLite - + Skip photo scanning フォトのスキャンをスキップする - + Skip video scanning ビデオのスキャンをスキップする - + Skip music scanning ミュージックのスキャンをスキップする - + CMA Protocol version CMAプロトコルバージョン - - Reset to default - 既定値にリセット + + Use custom version + カスタムバージョンを使用 - + Disable USB monitoring USBの監視を無効にする - + Disable Wi-Fi monitoring Wi-Fiの監視を無効にする - + Database backend データベース保存 - + In Memory メモリ内 @@ -461,7 +461,7 @@ build branch: %2 ビルドブランチ: %2 - + Information 情報 @@ -602,32 +602,32 @@ build branch: %2 UnityIndicator - + Settings 設定 - + Refresh database データベースを更新する - + Backup Manager バックアップマネージャー - + About QCMA QCMAについて - + About Qt Qtについて - + Quit 終了 diff --git a/src/capability.cpp b/src/capability.cpp index 8badeae..f8638da 100644 --- a/src/capability.cpp +++ b/src/capability.cpp @@ -41,7 +41,7 @@ bool DeviceCapability::exchangeInfo(vita_device_t *device) } QString hostname = QHostInfo::localHostName(); - int protocol_version = QSettings().value("protocolVersion", VITAMTP_PROTOCOL_MAX_VERSION).toInt(); + int protocol_version = getProtocolVersion(); const initiator_info_t *pc_info = VitaMTP_Data_Initiator_New(hostname.toUtf8().data(), protocol_version); // Next, we send the client's (this program) info (discard the const here) diff --git a/src/cmabroadcast.cpp b/src/cmabroadcast.cpp index d60e096..ca67941 100644 --- a/src/cmabroadcast.cpp +++ b/src/cmabroadcast.cpp @@ -18,6 +18,7 @@ */ #include "cmabroadcast.h" +#include "cmautils.h" #include #include @@ -85,7 +86,7 @@ void CmaBroadcast::readPendingDatagrams() void CmaBroadcast::setAvailable() { QMutexLocker locker(&mutex); - int protocol_version = QSettings().value("protocolVersion", VITAMTP_PROTOCOL_MAX_VERSION).toInt(); + int protocol_version = getProtocolVersion(); reply.clear(); reply.insert(0, broadcast_reply diff --git a/src/cmautils.cpp b/src/cmautils.cpp index 6560231..7e49530 100644 --- a/src/cmautils.cpp +++ b/src/cmautils.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #ifdef Q_OS_WIN32 #include @@ -184,3 +185,51 @@ QString readable_size(qint64 size, bool use_gib) } return QString().setNum(size_f,'f',2) + " " + unit; } + +int getProtocolVersion() +{ + bool useCustom = QSettings().value("useCustomProtocol").toBool(); + if(useCustom) + { + bool ok; + int protocol = QSettings().value("protocolVersion").toInt(&ok); + if(ok && protocol > 0) + return protocol; + else + return VITAMTP_PROTOCOL_MAX_VERSION; + } + else + { + int protocol; + int index = QSettings().value("protocolIndex").toInt(); + switch(index) + { + case 0: + protocol = VITAMTP_PROTOCOL_FW_3_30; + break; + case 1: + protocol = VITAMTP_PROTOCOL_FW_3_10; + break; + case 2: + protocol = VITAMTP_PROTOCOL_FW_3_00; + break; + case 3: + protocol = VITAMTP_PROTOCOL_FW_2_60; + break; + case 4: + protocol = VITAMTP_PROTOCOL_FW_2_10; + break; + case 5: + protocol = VITAMTP_PROTOCOL_FW_2_00; + break; + case 6: + protocol = VITAMTP_WIRELESS_FW_2_00; + break; + default: + protocol = VITAMTP_PROTOCOL_MAX_VERSION; + break; + } + + return protocol; + } +} diff --git a/src/cmautils.h b/src/cmautils.h index a69af6d..e48d6a3 100644 --- a/src/cmautils.h +++ b/src/cmautils.h @@ -49,5 +49,6 @@ bool removeRecursively(const QString &path); QString readable_size(qint64 size, bool use_gib = false); bool getDiskSpace(const QString &dir, quint64 *free, quint64 *total); QByteArray getThumbnail(const QString &path, DataType type, metadata_t *metadata); +int getProtocolVersion(); #endif // UTILS_H diff --git a/src/forms/configwidget.cpp b/src/forms/configwidget.cpp index dd5e85b..4418404 100644 --- a/src/forms/configwidget.cpp +++ b/src/forms/configwidget.cpp @@ -62,7 +62,6 @@ void ConfigWidget::connectSignals() 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())); - connect(ui->resetProtocolButton, SIGNAL(clicked()), this, SLOT(resetButtonPressed())); } void ConfigWidget::setDefaultData() @@ -100,8 +99,16 @@ void ConfigWidget::setDefaultData() ui->videoSkipCheck->setChecked(settings.value("videoSkip", false).toBool()); ui->musicSkipCheck->setChecked(settings.value("musicSkip", false).toBool()); - int protocol_version = settings.value("protocolVersion", VITAMTP_PROTOCOL_MAX_VERSION).toInt(); - ui->protocolEdit->setText(QString::number(protocol_version)); + ui->customProtocolCheckBox->setChecked(settings.value("useCustomProtocol", false).toBool()); + ui->protocolBox->setCurrentIndex(settings.value("protocolIndex", 0).toInt()); + + bool ok; + int protocol_version = settings.value("protocolVersion", VITAMTP_PROTOCOL_MAX_VERSION).toInt(&ok); + + if(ok && protocol_version > 0) + ui->protocolEdit->setText(QString::number(protocol_version)); + else + ui->protocolEdit->setText(QString::number(VITAMTP_PROTOCOL_MAX_VERSION)); } ConfigWidget::~ConfigWidget() @@ -109,11 +116,6 @@ ConfigWidget::~ConfigWidget() delete ui; } -void ConfigWidget::resetButtonPressed() -{ - ui->protocolEdit->setText(QString::number(VITAMTP_PROTOCOL_MAX_VERSION)); -} - void ConfigWidget::browseBtnPressed(int btn) { QString msg; @@ -188,7 +190,17 @@ void ConfigWidget::accept() settings.setValue("photoSkip", ui->photoSkipCheck->isChecked()); settings.setValue("videoSkip", ui->videoSkipCheck->isChecked()); settings.setValue("musicSkip", ui->musicSkipCheck->isChecked()); - settings.setValue("protocolVersion", ui->protocolEdit->text().toInt()); + settings.setValue("useCustomProtocol", ui->customProtocolCheckBox->isChecked()); + settings.setValue("protocolIndex", ui->protocolBox->currentIndex()); + + bool ok; + int protocol = ui->protocolEdit->text().toInt(&ok); + + if(ok && protocol > 0) + settings.setValue("protocolVersion", protocol); + else + settings.setValue("protocolVersion", VITAMTP_PROTOCOL_MAX_VERSION); + settings.sync(); done(Accepted); diff --git a/src/forms/configwidget.h b/src/forms/configwidget.h index e242ae4..eeda29e 100644 --- a/src/forms/configwidget.h +++ b/src/forms/configwidget.h @@ -48,7 +48,6 @@ private: private slots: void browseBtnPressed(int from); - void resetButtonPressed(); void accept(); }; diff --git a/src/forms/configwidget.ui b/src/forms/configwidget.ui index dc58104..554b3ff 100644 --- a/src/forms/configwidget.ui +++ b/src/forms/configwidget.ui @@ -368,25 +368,82 @@ - - + + + + + + QFormLayout::AllNonFixedFieldsGrow + + CMA Protocol version + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + - + + + + + 200 + 0 + + + + + FW 3.30 - 1900010 + + + + + FW 3.10 - 1800010 + + + + + FW 3.00 - 1700010 + + + + + FW 2.60 - 1600010 + + + + + FW 2.10 - 1500010 + + + + + FW 2.00 - 1400010 + + + + + FW 1.00 - 1000000 + + + + + + + + Use custom version + + + + 9999999 - - - - - Reset to default +