Show if savedata, updates or dlc are present.

This commit is contained in:
codestation
2014-01-17 16:58:09 -04:30
parent 9c8a3e0176
commit bafae021ed
6 changed files with 174 additions and 36 deletions

View File

@@ -4,17 +4,27 @@
<context> <context>
<name>BackupItem</name> <name>BackupItem</name>
<message> <message>
<location filename="../../src/forms/backupitem.ui" line="47"/> <location filename="../../src/forms/backupitem.ui" line="58"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Game Name&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;0.00 GiB&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <source>&lt;p&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Game Name&lt;/span&gt;&lt;/p&gt;</source>
<translation></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/forms/backupitem.ui" line="79"/> <location filename="../../src/forms/backupitem.ui" line="79"/>
<source>&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;0.00 GiB&lt;/span&gt;&lt;/p&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/forms/backupitem.ui" line="92"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;[APP] [SAVE] [UPDATE] [DLC]&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/forms/backupitem.ui" line="131"/>
<source>Delete entry</source> <source>Delete entry</source>
<translation>Borrar entrada</translation> <translation>Borrar entrada</translation>
</message> </message>
<message> <message>
<location filename="../../src/forms/backupitem.ui" line="92"/> <location filename="../../src/forms/backupitem.ui" line="144"/>
<source>Open folder</source> <source>Open folder</source>
<translation>Abrir directorio</translation> <translation>Abrir directorio</translation>
</message> </message>
@@ -73,7 +83,7 @@
</message> </message>
<message> <message>
<location filename="../../src/forms/backupmanagerform.ui" line="122"/> <location filename="../../src/forms/backupmanagerform.ui" line="122"/>
<location filename="../../src/forms/backupmanagerform.cpp" line="231"/> <location filename="../../src/forms/backupmanagerform.cpp" line="244"/>
<source>Filter</source> <source>Filter</source>
<translation>Filtro</translation> <translation>Filtro</translation>
</message> </message>
@@ -93,9 +103,28 @@
<translation>Uso de disco en respaldos: %1</translation> <translation>Uso de disco en respaldos: %1</translation>
</message> </message>
<message> <message>
<location filename="../../src/forms/backupmanagerform.cpp" line="198"/> <location filename="../../src/forms/backupmanagerform.cpp" line="201"/>
<source> [GAME]</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/forms/backupmanagerform.cpp" line="204"/>
<source> [SAVE]</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/forms/backupmanagerform.cpp" line="207"/>
<source> [UPDATE]</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/forms/backupmanagerform.cpp" line="210"/>
<source> [DLC]</source>
<translation type="unfinished"></translation>
</message>
<message>
<source> - (Launcher only)</source> <source> - (Launcher only)</source>
<translation> - (Solo lanzador LiveArea)</translation> <translation type="vanished"> - (Solo lanzador LiveArea)</translation>
</message> </message>
</context> </context>
<context> <context>

View File

@@ -4,17 +4,31 @@
<context> <context>
<name>BackupItem</name> <name>BackupItem</name>
<message> <message>
<location filename="../../src/forms/backupitem.ui" line="47"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Game Name&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;0.00 GiB&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Game Name&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;0.00 GiB&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;0.00 GiB&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation> <translation type="vanished">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;0.00 GiB&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<location filename="../../src/forms/backupitem.ui" line="58"/>
<source>&lt;p&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Game Name&lt;/span&gt;&lt;/p&gt;</source>
<translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/forms/backupitem.ui" line="79"/> <location filename="../../src/forms/backupitem.ui" line="79"/>
<source>&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;0.00 GiB&lt;/span&gt;&lt;/p&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/forms/backupitem.ui" line="92"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;[APP] [SAVE] [UPDATE] [DLC]&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/forms/backupitem.ui" line="131"/>
<source>Delete entry</source> <source>Delete entry</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../src/forms/backupitem.ui" line="92"/> <location filename="../../src/forms/backupitem.ui" line="144"/>
<source>Open folder</source> <source>Open folder</source>
<translation></translation> <translation></translation>
</message> </message>
@@ -73,7 +87,7 @@
</message> </message>
<message> <message>
<location filename="../../src/forms/backupmanagerform.ui" line="122"/> <location filename="../../src/forms/backupmanagerform.ui" line="122"/>
<location filename="../../src/forms/backupmanagerform.cpp" line="231"/> <location filename="../../src/forms/backupmanagerform.cpp" line="244"/>
<source>Filter</source> <source>Filter</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@@ -93,9 +107,28 @@
<translation>使: %1</translation> <translation>使: %1</translation>
</message> </message>
<message> <message>
<location filename="../../src/forms/backupmanagerform.cpp" line="198"/> <location filename="../../src/forms/backupmanagerform.cpp" line="201"/>
<source> [GAME]</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/forms/backupmanagerform.cpp" line="204"/>
<source> [SAVE]</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/forms/backupmanagerform.cpp" line="207"/>
<source> [UPDATE]</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/forms/backupmanagerform.cpp" line="210"/>
<source> [DLC]</source>
<translation type="unfinished"></translation>
</message>
<message>
<source> - (Launcher only)</source> <source> - (Launcher only)</source>
<translation> - (LiveArea専用)</translation> <translation type="vanished"> - (LiveArea専用)</translation>
</message> </message>
</context> </context>
<context> <context>

View File

@@ -25,9 +25,16 @@
#include <QDesktopServices> #include <QDesktopServices>
#include <QUrl> #include <QUrl>
const QString BackupItem::nameTemplate = "<html><head/><body>" const QString BackupItem::gameTemplate = "<html><head/><body>"
"<p><span style=\" font-size:12pt; font-weight:600;\">%1</span></p>" "<p><span style=\" font-size:13pt; font-weight:600;\">%1</span></p>"
"<p><span style=\" font-size:10pt;\">%2</span></p>" "</body></html>";
const QString BackupItem::sizeTemplate = "<html><head/><body>"
"<p><span style=\" font-size:10pt;\">%1</span></p>"
"</body></html>";
const QString BackupItem::infoTemplate = "<html><head/><body>"
"<p><span style=\" font-size:10pt;\">&nbsp;%1</span></p>"
"</body></html>"; "</body></html>";
BackupItem::BackupItem(QWidget *parent) : BackupItem::BackupItem(QWidget *parent) :
@@ -60,14 +67,16 @@ const QPixmap *BackupItem::getIconPixmap()
return ui->itemPicture->pixmap(); return ui->itemPicture->pixmap();
} }
void BackupItem::setDirectory(const QString path) void BackupItem::setDirectory(const QString &path)
{ {
this->path = path; this->path = path;
} }
void BackupItem::setItemInfo(const QString name, const QString size) void BackupItem::setItemInfo(const QString &name, const QString &size, const QString &extra)
{ {
ui->itemName->setText(nameTemplate.arg(name, size)); ui->gameLabel->setText(gameTemplate.arg(name));
ui->sizeLabel->setText(sizeTemplate.arg(size));
ui->infoLabel->setText(infoTemplate.arg(extra));
} }
int BackupItem::getIconWidth() int BackupItem::getIconWidth()
@@ -75,7 +84,7 @@ int BackupItem::getIconWidth()
return ui->itemPicture->width(); return ui->itemPicture->width();
} }
void BackupItem::setItemIcon(const QString path, int width, bool try_dds) void BackupItem::setItemIcon(const QString &path, int width, bool try_dds)
{ {
ui->itemPicture->setMinimumWidth(width); ui->itemPicture->setMinimumWidth(width);
QPixmap pixmap(path); QPixmap pixmap(path);

View File

@@ -34,9 +34,9 @@ public:
explicit BackupItem(QWidget *parent = 0); explicit BackupItem(QWidget *parent = 0);
~BackupItem(); ~BackupItem();
void setItemInfo(const QString name, const QString size); void setItemInfo(const QString &name, const QString &size, const QString &extra);
void setItemIcon(const QString path, int width = 48, bool try_dds = false); void setItemIcon(const QString &path, int width = 48, bool try_dds = false);
void setDirectory(const QString path); void setDirectory(const QString &path);
const QPixmap *getIconPixmap(); const QPixmap *getIconPixmap();
int getIconWidth(); int getIconWidth();
@@ -48,7 +48,9 @@ public:
private: private:
QString path; QString path;
Ui::BackupItem *ui; Ui::BackupItem *ui;
static const QString nameTemplate; static const QString gameTemplate;
static const QString sizeTemplate;
static const QString infoTemplate;
signals: signals:
void deleteEntry(BackupItem *entry); void deleteEntry(BackupItem *entry);

View File

@@ -6,10 +6,16 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>634</width> <width>638</width>
<height>86</height> <height>75</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string/> <string/>
</property> </property>
@@ -42,12 +48,58 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="itemName"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="rightMargin">
<number>5</number>
</property>
<item>
<widget class="QLabel" name="gameLabel">
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Game Name&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;0.00 GiB&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;p&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Game Name&lt;/span&gt;&lt;/p&gt;</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="sizeLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;0.00 GiB&lt;/span&gt;&lt;/p&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="infoLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:9pt;&quot;&gt;[APP] [SAVE] [UPDATE] [DLC]&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">

View File

@@ -193,15 +193,28 @@ void BackupManagerForm::loadBackupListing(int index)
connect(item, SIGNAL(deleteEntry(BackupItem*)), this, SLOT(removeEntry(BackupItem*))); connect(item, SIGNAL(deleteEntry(BackupItem*)), this, SLOT(removeEntry(BackupItem*)));
QString size = readable_size(meta->size); QString size = readable_size(meta->size);
// check if the game data is present, else is just a LiveArea launcher QString info;
if(sys_dir && !(QDir(base_path + QDir::separator() + "app").exists() || QDir(base_path + QDir::separator() + "game").exists())) {
size.append(tr(" - (Launcher only)")); // check if is listing PS Vita games
if(index == 0) {
if(QDir(base_path + QDir::separator() + "app").exists()) {
info.append(tr(" [GAME]"));
}
if(QDir(base_path + QDir::separator() + "savedata").exists()) {
info.append(tr(" [SAVE]"));
}
if(QDir(base_path + QDir::separator() + "patch").exists()) {
info.append(tr(" [UPDATE]"));
}
if(QDir(base_path + QDir::separator() + "addcont").exists()) {
info.append(tr(" [DLC]"));
}
} }
item->setItemInfo(game_name, size); item->setItemInfo(game_name, size, info);
item->setItemIcon(QDir(parent_path).absoluteFilePath(sys_dir ? "icon0.png" : "ICON0.PNG"), img_width, ohfi == VITA_OHFI_PSMAPP); item->setItemIcon(QDir(parent_path).absoluteFilePath(sys_dir ? "icon0.png" : "ICON0.PNG"), img_width, ohfi == VITA_OHFI_PSMAPP);
item->setDirectory(obj->path + QDir::separator() + meta->name); item->setDirectory(obj->path + QDir::separator() + meta->name);
item->resize(646, 75); item->resize(646, 68);
item_list << item; item_list << item;
meta = meta->next_metadata; meta = meta->next_metadata;
@@ -216,7 +229,7 @@ void BackupManagerForm::loadBackupListing(int index)
// insert the sorted items into the table // insert the sorted items into the table
for(it = item_list.begin(), row = 0; it != item_list.end(); ++it, ++row) { for(it = item_list.begin(), row = 0; it != item_list.end(); ++it, ++row) {
ui->tableWidget->setCellWidget(row, 0, *it); ui->tableWidget->setCellWidget(row, 0, *it);
vert_header->resizeSection(row, 75); vert_header->resizeSection(row, 68);
} }
vert_header->setUpdatesEnabled(true); vert_header->setUpdatesEnabled(true);