Showing Savegame number preview updated

This commit is contained in:
Rafael 2016-10-16 12:35:57 +02:00
parent c62ce7aada
commit cea28ac5e2
5 changed files with 111 additions and 52 deletions

View file

@ -54,7 +54,7 @@ SavegameWidget::SavegameWidget(QWidget *parent) :
highlightBackColor = palette.highlight().color();
highlightTextColor = palette.highlightedText().color();
labelStr = tr("Savegame %1\n%2");
labelStr = tr("SAVE %3 - %1<br>%2");
sgdPath = "";
sgdStr = "";
sgdata = 0;
@ -87,18 +87,35 @@ bool SavegameWidget::eventFilter(QObject *obj, QEvent *ev)
void SavegameWidget::setSavegameData(SavegameData *savegame, QString savegamePath)
{
// BETA CODE
bool validNumber;
QString savegameName = tr("WRONG FORMAT");
QString savegameDate = tr("WRONG FORMAT");
QString savegameString = savegame->getSavegameStr();
QString fileName = QFileInfo(savegame->getSavegameFileName()).fileName();
int savegameNumber = QString(fileName).remove(0,5).toInt(&validNumber) + 1;
if (!validNumber)
QStringList savegameNDL = QString(savegameString).split(" - ");
if (savegameNDL.length() >= 2)
{
ui->labSavegameStr->setText(savegame->getSavegameStr());
savegameDate = savegameNDL.at(savegameNDL.length() - 1);
savegameName = QString(savegameString).remove(savegameString.length() - savegameDate.length() - 3, savegameDate.length() + 3);
}
int savegameNumber = QString(fileName).remove(0,5).toInt(&validNumber) + 1;
if (validNumber)
{
if (savegameNumber == 16)
{
ui->labSavegameStr->setText(labelStr.arg(savegameDate, savegameName, tr("AUTO")));
}
else
{
ui->labSavegameStr->setText(labelStr.arg(QString::number(savegameNumber), savegame->getSavegameStr()));
ui->labSavegameStr->setText(labelStr.arg(savegameDate, savegameName, QString::number(savegameNumber)));
}
sgdStr = savegame->getSavegameStr();
}
else
{
ui->labSavegameStr->setText(labelStr.arg(savegameDate, savegameName, tr("UNKNOWN")));
}
sgdStr = savegameString;
sgdPath = savegamePath;
sgdata = savegame;
}

View file

@ -64,8 +64,7 @@
</sizepolicy>
</property>
<property name="text">
<string>Savegame %1
%2</string>
<string>SAVE - %1&lt;br&gt;%2</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View file

@ -765,23 +765,21 @@ Copyright &amp;copy; &lt;a href=&quot;https://github.com/Syping/&quot;&gt;Syping
</message>
<message>
<location filename="../SavegameWidget.ui" line="67"/>
<location filename="../SavegameWidget.cpp" line="57"/>
<source>Savegame %1
%2</source>
<source>SAVE - %1&lt;br&gt;%2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="78"/>
<location filename="../SavegameWidget.ui" line="77"/>
<source>View savegame</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="81"/>
<location filename="../SavegameWidget.ui" line="80"/>
<source>View</source>
<translation>Просмотр</translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="91"/>
<location filename="../SavegameWidget.ui" line="90"/>
<source>Export</source>
<translation type="unfinished">Экспорт</translation>
</message>
@ -790,14 +788,14 @@ Copyright &amp;copy; &lt;a href=&quot;https://github.com/Syping/&quot;&gt;Syping
<translation type="obsolete">Копировать</translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="104"/>
<location filename="../SavegameWidget.ui" line="103"/>
<source>Delete</source>
<translation>Удалить</translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="101"/>
<location filename="../SavegameWidget.cpp" line="113"/>
<location filename="../SavegameWidget.cpp" line="126"/>
<location filename="../SavegameWidget.ui" line="100"/>
<location filename="../SavegameWidget.cpp" line="130"/>
<location filename="../SavegameWidget.cpp" line="143"/>
<source>Delete savegame</source>
<translation>Удалить сохранение</translation>
</message>
@ -807,55 +805,76 @@ Copyright &amp;copy; &lt;a href=&quot;https://github.com/Syping/&quot;&gt;Syping
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="113"/>
<location filename="../SavegameWidget.cpp" line="57"/>
<source>SAVE %3 - %1&lt;br&gt;%2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="92"/>
<location filename="../SavegameWidget.cpp" line="93"/>
<source>WRONG FORMAT</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="107"/>
<source>AUTO</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="116"/>
<source>UNKNOWN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="130"/>
<source>Are you sure to delete %1 from your savegames?</source>
<translation>Вы уверены, что хотите удалить сохранение %1?</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="126"/>
<location filename="../SavegameWidget.cpp" line="143"/>
<source>Failed at deleting %1 from your savegames</source>
<translation>Не удалось удалить сохранение %1</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="190"/>
<location filename="../SavegameWidget.cpp" line="207"/>
<source>&amp;View</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="192"/>
<location filename="../SavegameWidget.cpp" line="209"/>
<source>&amp;Remove</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="196"/>
<location filename="../SavegameWidget.cpp" line="204"/>
<location filename="../SavegameWidget.cpp" line="213"/>
<location filename="../SavegameWidget.cpp" line="221"/>
<source>&amp;Select</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="197"/>
<location filename="../SavegameWidget.cpp" line="214"/>
<source>&amp;Deselect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="198"/>
<location filename="../SavegameWidget.cpp" line="205"/>
<location filename="../SavegameWidget.cpp" line="215"/>
<location filename="../SavegameWidget.cpp" line="222"/>
<source>Select &amp;All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="199"/>
<location filename="../SavegameWidget.cpp" line="216"/>
<source>&amp;Deselect All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="88"/>
<location filename="../SavegameWidget.ui" line="87"/>
<source>Copy savegame</source>
<translation>Копировать сохранение</translation>
</message>
<message>
<location filename="../SavegameCopy.cpp" line="48"/>
<location filename="../SavegameWidget.cpp" line="191"/>
<location filename="../SavegameWidget.cpp" line="208"/>
<source>&amp;Export</source>
<translation type="unfinished"></translation>
</message>

Binary file not shown.

View file

@ -975,20 +975,23 @@ Exportieren als:</translation>
<translation type="vanished">The Third Way (100%) - 00/00/00 00:00:00</translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="67"/>
<location filename="../SavegameWidget.cpp" line="57"/>
<source>Savegame %1
%2</source>
<translation>Spielstand %1
<translation type="vanished">Spielstand %1
%2</translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="81"/>
<location filename="../SavegameWidget.ui" line="67"/>
<source>SAVE - %1&lt;br&gt;%2</source>
<translation>SPIELSTAND - %1&lt;br&gt;%2</translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="80"/>
<source>View</source>
<translation>Ansehen</translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="91"/>
<location filename="../SavegameWidget.ui" line="90"/>
<source>Export</source>
<translation>Exportieren</translation>
</message>
@ -997,14 +1000,14 @@ Exportieren als:</translation>
<translation type="obsolete">Kopieren</translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="104"/>
<location filename="../SavegameWidget.ui" line="103"/>
<source>Delete</source>
<translation>Löschen</translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="101"/>
<location filename="../SavegameWidget.cpp" line="113"/>
<location filename="../SavegameWidget.cpp" line="126"/>
<location filename="../SavegameWidget.ui" line="100"/>
<location filename="../SavegameWidget.cpp" line="130"/>
<location filename="../SavegameWidget.cpp" line="143"/>
<source>Delete savegame</source>
<translation>Savegame löschen</translation>
</message>
@ -1014,44 +1017,65 @@ Exportieren als:</translation>
<translation>Spielstand exportieren...</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="113"/>
<location filename="../SavegameWidget.cpp" line="57"/>
<source>SAVE %3 - %1&lt;br&gt;%2</source>
<translation>SPIELSTAND %3 - %1&lt;br&gt;%2</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="92"/>
<location filename="../SavegameWidget.cpp" line="93"/>
<source>WRONG FORMAT</source>
<translation>FALSCHES FORMAT</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="107"/>
<source>AUTO</source>
<translation>AUTO</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="116"/>
<source>UNKNOWN</source>
<translation>UNKNOWN</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="130"/>
<source>Are you sure to delete %1 from your savegames?</source>
<translation>Bist du sicher %1 von deinen Spielständen zu löschen?</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="126"/>
<location filename="../SavegameWidget.cpp" line="143"/>
<source>Failed at deleting %1 from your savegames</source>
<translation>Fehlgeschlagen beim Löschen %1 von deinen Spielständen</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="190"/>
<location filename="../SavegameWidget.cpp" line="207"/>
<source>&amp;View</source>
<translation>A&amp;nsehen</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="192"/>
<location filename="../SavegameWidget.cpp" line="209"/>
<source>&amp;Remove</source>
<translation>Entfe&amp;rnen</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="196"/>
<location filename="../SavegameWidget.cpp" line="204"/>
<location filename="../SavegameWidget.cpp" line="213"/>
<location filename="../SavegameWidget.cpp" line="221"/>
<source>&amp;Select</source>
<translation>Au&amp;swählen</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="197"/>
<location filename="../SavegameWidget.cpp" line="214"/>
<source>&amp;Deselect</source>
<translation>A&amp;bwählen</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="198"/>
<location filename="../SavegameWidget.cpp" line="205"/>
<location filename="../SavegameWidget.cpp" line="215"/>
<location filename="../SavegameWidget.cpp" line="222"/>
<source>Select &amp;All</source>
<translation>&amp;Alles auswählen</translation>
</message>
<message>
<location filename="../SavegameWidget.cpp" line="199"/>
<location filename="../SavegameWidget.cpp" line="216"/>
<source>&amp;Deselect All</source>
<translation>Alles a&amp;bwählen</translation>
</message>
@ -1080,18 +1104,18 @@ Exportieren als:</translation>
<translation type="obsolete">Umschalt+S</translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="78"/>
<location filename="../SavegameWidget.ui" line="77"/>
<source>View savegame</source>
<translation>Spielstand ansehen</translation>
</message>
<message>
<location filename="../SavegameWidget.ui" line="88"/>
<location filename="../SavegameWidget.ui" line="87"/>
<source>Copy savegame</source>
<translation>Spielstand kopieren</translation>
</message>
<message>
<location filename="../SavegameCopy.cpp" line="48"/>
<location filename="../SavegameWidget.cpp" line="191"/>
<location filename="../SavegameWidget.cpp" line="208"/>
<source>&amp;Export</source>
<translation>&amp;Exportieren</translation>
</message>