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

View file

@ -64,8 +64,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Savegame %1 <string>SAVE - %1&lt;br&gt;%2</string>
%2</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <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>
<message> <message>
<location filename="../SavegameWidget.ui" line="67"/> <location filename="../SavegameWidget.ui" line="67"/>
<location filename="../SavegameWidget.cpp" line="57"/> <source>SAVE - %1&lt;br&gt;%2</source>
<source>Savegame %1
%2</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="78"/> <location filename="../SavegameWidget.ui" line="77"/>
<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="81"/> <location filename="../SavegameWidget.ui" line="80"/>
<source>View</source> <source>View</source>
<translation>Просмотр</translation> <translation>Просмотр</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="91"/> <location filename="../SavegameWidget.ui" line="90"/>
<source>Export</source> <source>Export</source>
<translation type="unfinished">Экспорт</translation> <translation type="unfinished">Экспорт</translation>
</message> </message>
@ -790,14 +788,14 @@ 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="104"/> <location filename="../SavegameWidget.ui" line="103"/>
<source>Delete</source> <source>Delete</source>
<translation>Удалить</translation> <translation>Удалить</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="101"/> <location filename="../SavegameWidget.ui" line="100"/>
<location filename="../SavegameWidget.cpp" line="113"/> <location filename="../SavegameWidget.cpp" line="130"/>
<location filename="../SavegameWidget.cpp" line="126"/> <location filename="../SavegameWidget.cpp" line="143"/>
<source>Delete savegame</source> <source>Delete savegame</source>
<translation>Удалить сохранение</translation> <translation>Удалить сохранение</translation>
</message> </message>
@ -807,55 +805,76 @@ 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="../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> <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="126"/> <location filename="../SavegameWidget.cpp" line="143"/>
<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="190"/> <location filename="../SavegameWidget.cpp" line="207"/>
<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="192"/> <location filename="../SavegameWidget.cpp" line="209"/>
<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="196"/> <location filename="../SavegameWidget.cpp" line="213"/>
<location filename="../SavegameWidget.cpp" line="204"/> <location filename="../SavegameWidget.cpp" line="221"/>
<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="197"/> <location filename="../SavegameWidget.cpp" line="214"/>
<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="198"/> <location filename="../SavegameWidget.cpp" line="215"/>
<location filename="../SavegameWidget.cpp" line="205"/> <location filename="../SavegameWidget.cpp" line="222"/>
<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="199"/> <location filename="../SavegameWidget.cpp" line="216"/>
<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="88"/> <location filename="../SavegameWidget.ui" line="87"/>
<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="191"/> <location filename="../SavegameWidget.cpp" line="208"/>
<source>&amp;Export</source> <source>&amp;Export</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </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> <translation type="vanished">The Third Way (100%) - 00/00/00 00:00:00</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="67"/>
<location filename="../SavegameWidget.cpp" line="57"/>
<source>Savegame %1 <source>Savegame %1
%2</source> %2</source>
<translation>Spielstand %1 <translation type="vanished">Spielstand %1
%2</translation> %2</translation>
</message> </message>
<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> <source>View</source>
<translation>Ansehen</translation> <translation>Ansehen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="91"/> <location filename="../SavegameWidget.ui" line="90"/>
<source>Export</source> <source>Export</source>
<translation>Exportieren</translation> <translation>Exportieren</translation>
</message> </message>
@ -997,14 +1000,14 @@ Exportieren als:</translation>
<translation type="obsolete">Kopieren</translation> <translation type="obsolete">Kopieren</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="104"/> <location filename="../SavegameWidget.ui" line="103"/>
<source>Delete</source> <source>Delete</source>
<translation>Löschen</translation> <translation>Löschen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="101"/> <location filename="../SavegameWidget.ui" line="100"/>
<location filename="../SavegameWidget.cpp" line="113"/> <location filename="../SavegameWidget.cpp" line="130"/>
<location filename="../SavegameWidget.cpp" line="126"/> <location filename="../SavegameWidget.cpp" line="143"/>
<source>Delete savegame</source> <source>Delete savegame</source>
<translation>Savegame löschen</translation> <translation>Savegame löschen</translation>
</message> </message>
@ -1014,44 +1017,65 @@ Exportieren als:</translation>
<translation>Spielstand exportieren...</translation> <translation>Spielstand exportieren...</translation>
</message> </message>
<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> <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="126"/> <location filename="../SavegameWidget.cpp" line="143"/>
<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="190"/> <location filename="../SavegameWidget.cpp" line="207"/>
<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="192"/> <location filename="../SavegameWidget.cpp" line="209"/>
<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="196"/> <location filename="../SavegameWidget.cpp" line="213"/>
<location filename="../SavegameWidget.cpp" line="204"/> <location filename="../SavegameWidget.cpp" line="221"/>
<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="197"/> <location filename="../SavegameWidget.cpp" line="214"/>
<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="198"/> <location filename="../SavegameWidget.cpp" line="215"/>
<location filename="../SavegameWidget.cpp" line="205"/> <location filename="../SavegameWidget.cpp" line="222"/>
<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="199"/> <location filename="../SavegameWidget.cpp" line="216"/>
<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>
@ -1080,18 +1104,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="78"/> <location filename="../SavegameWidget.ui" line="77"/>
<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="88"/> <location filename="../SavegameWidget.ui" line="87"/>
<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="191"/> <location filename="../SavegameWidget.cpp" line="208"/>
<source>&amp;Export</source> <source>&amp;Export</source>
<translation>&amp;Exportieren</translation> <translation>&amp;Exportieren</translation>
</message> </message>