added savegame viewer
This commit is contained in:
parent
69494fc100
commit
c126840e4c
10 changed files with 304 additions and 25 deletions
34
SavegameDialog.cpp
Executable file
34
SavegameDialog.cpp
Executable file
|
@ -0,0 +1,34 @@
|
|||
#include "SavegameDialog.h"
|
||||
#include "ui_SavegameDialog.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
SavegameDialog::SavegameDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::SavegameDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
savegameLabStr = ui->labSavegameText->text();
|
||||
}
|
||||
|
||||
SavegameDialog::~SavegameDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SavegameDialog::setSavegameData(SavegameData *savegame, bool readOk)
|
||||
{
|
||||
// Showing error if reading error
|
||||
if (!readOk)
|
||||
{
|
||||
QMessageBox::warning(this,tr("Savegame Viewer"),tr("Failed at %1").arg(savegame->getLastStep()));
|
||||
return;
|
||||
}
|
||||
|
||||
ui->labSavegameText->setText(savegameLabStr.arg(savegame->getSavegameStr()));
|
||||
}
|
||||
|
||||
void SavegameDialog::on_cmdClose_clicked()
|
||||
{
|
||||
this->close();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue