including Savegame number (Preview)

This commit is contained in:
Rafael 2016-10-14 08:03:16 +02:00
parent 133bc9861e
commit a33c97cd6f
7 changed files with 103 additions and 67 deletions

View file

@ -32,6 +32,7 @@
#include <QColor> #include <QColor>
#include <QBrush> #include <QBrush>
#include <QTimer> #include <QTimer>
#include <QDebug>
#include <QFile> #include <QFile>
#include <QMenu> #include <QMenu>
#include <QUrl> #include <QUrl>
@ -53,6 +54,7 @@ SavegameWidget::SavegameWidget(QWidget *parent) :
highlightBackColor = palette.highlight().color(); highlightBackColor = palette.highlight().color();
highlightTextColor = palette.highlightedText().color(); highlightTextColor = palette.highlightedText().color();
labelStr = tr("Savegame %1\n%2");
sgdPath = ""; sgdPath = "";
sgdStr = ""; sgdStr = "";
sgdata = 0; sgdata = 0;
@ -85,7 +87,17 @@ bool SavegameWidget::eventFilter(QObject *obj, QEvent *ev)
void SavegameWidget::setSavegameData(SavegameData *savegame, QString savegamePath) void SavegameWidget::setSavegameData(SavegameData *savegame, QString savegamePath)
{ {
bool validNumber;
QString fileName = QFileInfo(savegame->getSavegameFileName()).fileName();
int savegameNumber = QString(fileName).remove(0,5).toInt(&validNumber) + 1;
if (!validNumber)
{
ui->labSavegameStr->setText(savegame->getSavegameStr()); ui->labSavegameStr->setText(savegame->getSavegameStr());
}
else
{
ui->labSavegameStr->setText(labelStr.arg(QString::number(savegameNumber), savegame->getSavegameStr()));
}
sgdStr = savegame->getSavegameStr(); sgdStr = savegame->getSavegameStr();
sgdPath = savegamePath; sgdPath = savegamePath;
sgdata = savegame; sgdata = savegame;

View file

@ -66,6 +66,7 @@ private:
SavegameData *sgdata; SavegameData *sgdata;
QColor highlightBackColor; QColor highlightBackColor;
QColor highlightTextColor; QColor highlightTextColor;
QString labelStr;
QString sgdPath; QString sgdPath;
QString sgdStr; QString sgdStr;

View file

@ -64,7 +64,8 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>The Third Way (100%) - 00/00/00 00:00:00</string> <string>Savegame %1
%2</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>

View file

@ -110,7 +110,14 @@ DISTFILES += res/app.rc \
lang/qtbase_ru.qm \ lang/qtbase_ru.qm \
lang/README.txt \ lang/README.txt \
lang/gta5sync_ru.ts \ lang/gta5sync_ru.ts \
lang/qt_ru.qm lang/qt_ru.qm \
android/AndroidManifest.xml \
android/gradle/wrapper/gradle-wrapper.jar \
android/gradlew \
android/res/values/libs.xml \
android/build.gradle \
android/gradle/wrapper/gradle-wrapper.properties \
android/gradlew.bat
INCLUDEPATH += ./uimod INCLUDEPATH += ./uimod
@ -148,3 +155,5 @@ unix: !macx: pixmaps.path = $$(INSTALL_PATH)/share/pixmaps
unix: !macx: pixmaps.files = $$PWD/res/gta5sync.xpm unix: !macx: pixmaps.files = $$PWD/res/gta5sync.xpm
unix: !macx: target.path = $$(INSTALL_PATH)/bin unix: !macx: target.path = $$(INSTALL_PATH)/bin
unix: !macx: INSTALLS += target pixmaps appfiles unix: !macx: INSTALLS += target pixmaps appfiles
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android

View file

@ -760,22 +760,28 @@ Copyright &amp;copy; &lt;a href=&quot;https://github.com/Syping/&quot;&gt;Syping
<translation>Виджет сохранений</translation> <translation>Виджет сохранений</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="67"/>
<source>The Third Way (100%) - 00/00/00 00:00:00</source> <source>The Third Way (100%) - 00/00/00 00:00:00</source>
<translation>Третий путь (100%) - 00/00/00 00:00:00</translation> <translation type="vanished">Третий путь (100%) - 00/00/00 00:00:00</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="77"/> <location filename="../SavegameWidget.ui" line="67"/>
<location filename="../SavegameWidget.cpp" line="57"/>
<source>Savegame %1
%2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="78"/>
<source>View savegame</source> <source>View savegame</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="80"/> <location filename="../SavegameWidget.ui" line="81"/>
<source>View</source> <source>View</source>
<translation>Просмотр</translation> <translation>Просмотр</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="90"/> <location filename="../SavegameWidget.ui" line="91"/>
<source>Export</source> <source>Export</source>
<translation type="unfinished">Экспорт</translation> <translation type="unfinished">Экспорт</translation>
</message> </message>
@ -784,72 +790,72 @@ Copyright &amp;copy; &lt;a href=&quot;https://github.com/Syping/&quot;&gt;Syping
<translation type="obsolete">Копировать</translation> <translation type="obsolete">Копировать</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="103"/> <location filename="../SavegameWidget.ui" line="104"/>
<source>Delete</source> <source>Delete</source>
<translation>Удалить</translation> <translation>Удалить</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="100"/> <location filename="../SavegameWidget.ui" line="101"/>
<location filename="../SavegameWidget.cpp" line="101"/> <location filename="../SavegameWidget.cpp" line="113"/>
<location filename="../SavegameWidget.cpp" line="114"/> <location filename="../SavegameWidget.cpp" line="126"/>
<source>Delete savegame</source> <source>Delete savegame</source>
<translation>Удалить сохранение</translation> <translation>Удалить сохранение</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="49"/> <location filename="../SavegameWidget.cpp" line="50"/>
<source>Export Savegame...</source> <source>Export Savegame...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="101"/> <location filename="../SavegameWidget.cpp" line="113"/>
<source>Are you sure to delete %1 from your savegames?</source> <source>Are you sure to delete %1 from your savegames?</source>
<translation>Вы уверены, что хотите удалить сохранение %1?</translation> <translation>Вы уверены, что хотите удалить сохранение %1?</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="114"/> <location filename="../SavegameWidget.cpp" line="126"/>
<source>Failed at deleting %1 from your savegames</source> <source>Failed at deleting %1 from your savegames</source>
<translation>Не удалось удалить сохранение %1</translation> <translation>Не удалось удалить сохранение %1</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="178"/> <location filename="../SavegameWidget.cpp" line="190"/>
<source>&amp;View</source> <source>&amp;View</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="180"/> <location filename="../SavegameWidget.cpp" line="192"/>
<source>&amp;Remove</source> <source>&amp;Remove</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="184"/> <location filename="../SavegameWidget.cpp" line="196"/>
<location filename="../SavegameWidget.cpp" line="192"/> <location filename="../SavegameWidget.cpp" line="204"/>
<source>&amp;Select</source> <source>&amp;Select</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="185"/> <location filename="../SavegameWidget.cpp" line="197"/>
<source>&amp;Deselect</source> <source>&amp;Deselect</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="186"/> <location filename="../SavegameWidget.cpp" line="198"/>
<location filename="../SavegameWidget.cpp" line="193"/> <location filename="../SavegameWidget.cpp" line="205"/>
<source>Select &amp;All</source> <source>Select &amp;All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="187"/> <location filename="../SavegameWidget.cpp" line="199"/>
<source>&amp;Deselect All</source> <source>&amp;Deselect All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="87"/> <location filename="../SavegameWidget.ui" line="88"/>
<source>Copy savegame</source> <source>Copy savegame</source>
<translation>Копировать сохранение</translation> <translation>Копировать сохранение</translation>
</message> </message>
<message> <message>
<location filename="../SavegameCopy.cpp" line="48"/> <location filename="../SavegameCopy.cpp" line="48"/>
<location filename="../SavegameWidget.cpp" line="179"/> <location filename="../SavegameWidget.cpp" line="191"/>
<source>&amp;Export</source> <source>&amp;Export</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -964,44 +970,44 @@ Copyright &amp;copy; &lt;a href=&quot;https://github.com/Syping/&quot;&gt;Syping
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="195"/> <location filename="../SnapmaticWidget.cpp" line="194"/>
<source>Export as &amp;JPG picture...</source> <source>Export as &amp;JPG picture...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="196"/> <location filename="../SnapmaticWidget.cpp" line="195"/>
<source>Export as &amp;GTA Snapmatic...</source> <source>Export as &amp;GTA Snapmatic...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="197"/> <location filename="../SnapmaticWidget.cpp" line="196"/>
<source>&amp;View</source> <source>&amp;View</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="199"/> <location filename="../SnapmaticWidget.cpp" line="198"/>
<source>&amp;Remove</source> <source>&amp;Remove</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="203"/> <location filename="../SnapmaticWidget.cpp" line="202"/>
<location filename="../SnapmaticWidget.cpp" line="211"/> <location filename="../SnapmaticWidget.cpp" line="210"/>
<source>&amp;Select</source> <source>&amp;Select</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="204"/> <location filename="../SnapmaticWidget.cpp" line="203"/>
<source>&amp;Deselect</source> <source>&amp;Deselect</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="205"/> <location filename="../SnapmaticWidget.cpp" line="204"/>
<location filename="../SnapmaticWidget.cpp" line="212"/> <location filename="../SnapmaticWidget.cpp" line="211"/>
<source>Select &amp;All</source> <source>Select &amp;All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="206"/> <location filename="../SnapmaticWidget.cpp" line="205"/>
<source>&amp;Deselect All</source> <source>&amp;Deselect All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

Binary file not shown.

View file

@ -971,17 +971,24 @@ Exportieren als:</translation>
<translation>Spielstand Widget</translation> <translation>Spielstand Widget</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="67"/>
<source>The Third Way (100%) - 00/00/00 00:00:00</source> <source>The Third Way (100%) - 00/00/00 00:00:00</source>
<translation>The Third Way (100%) - 00/00/00 00:00:00</translation> <translation type="vanished">The Third Way (100%) - 00/00/00 00:00:00</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="80"/> <location filename="../SavegameWidget.ui" line="67"/>
<location filename="../SavegameWidget.cpp" line="57"/>
<source>Savegame %1
%2</source>
<translation>Spielstand %1
%2</translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="81"/>
<source>View</source> <source>View</source>
<translation>Ansehen</translation> <translation>Ansehen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="90"/> <location filename="../SavegameWidget.ui" line="91"/>
<source>Export</source> <source>Export</source>
<translation>Exportieren</translation> <translation>Exportieren</translation>
</message> </message>
@ -990,61 +997,61 @@ Exportieren als:</translation>
<translation type="obsolete">Kopieren</translation> <translation type="obsolete">Kopieren</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="103"/> <location filename="../SavegameWidget.ui" line="104"/>
<source>Delete</source> <source>Delete</source>
<translation>Löschen</translation> <translation>Löschen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="100"/> <location filename="../SavegameWidget.ui" line="101"/>
<location filename="../SavegameWidget.cpp" line="101"/> <location filename="../SavegameWidget.cpp" line="113"/>
<location filename="../SavegameWidget.cpp" line="114"/> <location filename="../SavegameWidget.cpp" line="126"/>
<source>Delete savegame</source> <source>Delete savegame</source>
<translation>Savegame löschen</translation> <translation>Savegame löschen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="49"/> <location filename="../SavegameWidget.cpp" line="50"/>
<source>Export Savegame...</source> <source>Export Savegame...</source>
<translation>Spielstand exportieren...</translation> <translation>Spielstand exportieren...</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="101"/> <location filename="../SavegameWidget.cpp" line="113"/>
<source>Are you sure to delete %1 from your savegames?</source> <source>Are you sure to delete %1 from your savegames?</source>
<translation>Bist du sicher %1 von deinen Spielständen zu löschen?</translation> <translation>Bist du sicher %1 von deinen Spielständen zu löschen?</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="114"/> <location filename="../SavegameWidget.cpp" line="126"/>
<source>Failed at deleting %1 from your savegames</source> <source>Failed at deleting %1 from your savegames</source>
<translation>Fehlgeschlagen beim Löschen %1 von deinen Spielständen</translation> <translation>Fehlgeschlagen beim Löschen %1 von deinen Spielständen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="178"/> <location filename="../SavegameWidget.cpp" line="190"/>
<source>&amp;View</source> <source>&amp;View</source>
<translation>A&amp;nsehen</translation> <translation>A&amp;nsehen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="180"/> <location filename="../SavegameWidget.cpp" line="192"/>
<source>&amp;Remove</source> <source>&amp;Remove</source>
<translation>Entfe&amp;rnen</translation> <translation>Entfe&amp;rnen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="184"/> <location filename="../SavegameWidget.cpp" line="196"/>
<location filename="../SavegameWidget.cpp" line="192"/> <location filename="../SavegameWidget.cpp" line="204"/>
<source>&amp;Select</source> <source>&amp;Select</source>
<translation>Au&amp;swählen</translation> <translation>Au&amp;swählen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="185"/> <location filename="../SavegameWidget.cpp" line="197"/>
<source>&amp;Deselect</source> <source>&amp;Deselect</source>
<translation>A&amp;bwählen</translation> <translation>A&amp;bwählen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="186"/> <location filename="../SavegameWidget.cpp" line="198"/>
<location filename="../SavegameWidget.cpp" line="193"/> <location filename="../SavegameWidget.cpp" line="205"/>
<source>Select &amp;All</source> <source>Select &amp;All</source>
<translation>&amp;Alles auswählen</translation> <translation>&amp;Alles auswählen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="187"/> <location filename="../SavegameWidget.cpp" line="199"/>
<source>&amp;Deselect All</source> <source>&amp;Deselect All</source>
<translation>Alles a&amp;bwählen</translation> <translation>Alles a&amp;bwählen</translation>
</message> </message>
@ -1073,18 +1080,18 @@ Exportieren als:</translation>
<translation type="obsolete">Umschalt+S</translation> <translation type="obsolete">Umschalt+S</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="77"/> <location filename="../SavegameWidget.ui" line="78"/>
<source>View savegame</source> <source>View savegame</source>
<translation>Spielstand ansehen</translation> <translation>Spielstand ansehen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="87"/> <location filename="../SavegameWidget.ui" line="88"/>
<source>Copy savegame</source> <source>Copy savegame</source>
<translation>Spielstand kopieren</translation> <translation>Spielstand kopieren</translation>
</message> </message>
<message> <message>
<location filename="../SavegameCopy.cpp" line="48"/> <location filename="../SavegameCopy.cpp" line="48"/>
<location filename="../SavegameWidget.cpp" line="179"/> <location filename="../SavegameWidget.cpp" line="191"/>
<source>&amp;Export</source> <source>&amp;Export</source>
<translation>&amp;Exportieren</translation> <translation>&amp;Exportieren</translation>
</message> </message>
@ -1213,44 +1220,44 @@ Exportieren als:</translation>
<translation type="obsolete">Exportiere als &amp;GTA Snapmatic</translation> <translation type="obsolete">Exportiere als &amp;GTA Snapmatic</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="195"/> <location filename="../SnapmaticWidget.cpp" line="194"/>
<source>Export as &amp;JPG picture...</source> <source>Export as &amp;JPG picture...</source>
<translation>Exportiere als &amp;JPG Bild...</translation> <translation>Exportiere als &amp;JPG Bild...</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="196"/> <location filename="../SnapmaticWidget.cpp" line="195"/>
<source>Export as &amp;GTA Snapmatic...</source> <source>Export as &amp;GTA Snapmatic...</source>
<translation>Exportiere als &amp;GTA Snapmatic...</translation> <translation>Exportiere als &amp;GTA Snapmatic...</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="197"/> <location filename="../SnapmaticWidget.cpp" line="196"/>
<source>&amp;View</source> <source>&amp;View</source>
<translation>A&amp;nsehen</translation> <translation>A&amp;nsehen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="199"/> <location filename="../SnapmaticWidget.cpp" line="198"/>
<source>&amp;Remove</source> <source>&amp;Remove</source>
<translation>Entfe&amp;rnen</translation> <translation>Entfe&amp;rnen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="203"/> <location filename="../SnapmaticWidget.cpp" line="202"/>
<location filename="../SnapmaticWidget.cpp" line="211"/> <location filename="../SnapmaticWidget.cpp" line="210"/>
<source>&amp;Select</source> <source>&amp;Select</source>
<translation>Au&amp;swählen</translation> <translation>Au&amp;swählen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="204"/> <location filename="../SnapmaticWidget.cpp" line="203"/>
<source>&amp;Deselect</source> <source>&amp;Deselect</source>
<translation>A&amp;bwählen</translation> <translation>A&amp;bwählen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="205"/> <location filename="../SnapmaticWidget.cpp" line="204"/>
<location filename="../SnapmaticWidget.cpp" line="212"/> <location filename="../SnapmaticWidget.cpp" line="211"/>
<source>Select &amp;All</source> <source>Select &amp;All</source>
<translation>Alles &amp;auswählen</translation> <translation>Alles &amp;auswählen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="206"/> <location filename="../SnapmaticWidget.cpp" line="205"/>
<source>&amp;Deselect All</source> <source>&amp;Deselect All</source>
<translation>Alles a&amp;bwählen</translation> <translation>Alles a&amp;bwählen</translation>
</message> </message>