diff --git a/ProfileInterface.cpp b/ProfileInterface.cpp index bdbaf62..c7e8ed2 100755 --- a/ProfileInterface.cpp +++ b/ProfileInterface.cpp @@ -94,6 +94,7 @@ void ProfileInterface::on_savegameLoaded(SavegameData *savegame, QString savegam ui->vlSavegame->addWidget(sgdWidget); widgets.append(sgdWidget); savegames.append(savegame); + QObject::connect(sgdWidget, SIGNAL(savegameDeleted()), this, SLOT(on_savegameDeleted())); } void ProfileInterface::on_pictureLoaded(SnapmaticPicture *picture, QString picturePath) @@ -121,6 +122,14 @@ void ProfileInterface::on_profileLoaded() ui->cmdCloseProfile->setEnabled(true); } +void ProfileInterface::on_savegameDeleted() +{ + SavegameWidget *sgdWidget = (SavegameWidget*)sender(); + widgets.removeAll(sgdWidget); + sgdWidget->deleteLater(); + delete sgdWidget; +} + void ProfileInterface::on_pictureDeleted() { SnapmaticWidget *picWidget = (SnapmaticWidget*)sender(); diff --git a/ProfileInterface.h b/ProfileInterface.h index 6ea5399..7464692 100755 --- a/ProfileInterface.h +++ b/ProfileInterface.h @@ -47,6 +47,7 @@ private slots: void on_pictureLoaded(SnapmaticPicture *picture, QString picturePath); void on_savegameLoaded(SavegameData *savegame, QString savegamePath); void on_loadingProgress(int value, int maximum); + void on_savegameDeleted(); void on_pictureDeleted(); void on_profileLoaded(); diff --git a/SavegameWidget.cpp b/SavegameWidget.cpp index 97865dd..f724b3a 100755 --- a/SavegameWidget.cpp +++ b/SavegameWidget.cpp @@ -19,6 +19,8 @@ #include "SavegameWidget.h" #include "ui_SavegameWidget.h" #include "SavegameData.h" +#include +#include SavegameWidget::SavegameWidget(QWidget *parent) : QWidget(parent), @@ -26,6 +28,7 @@ SavegameWidget::SavegameWidget(QWidget *parent) : { ui->setupUi(this); sgdPath = ""; + sgdStr = ""; sgdata = 0; } @@ -37,6 +40,27 @@ SavegameWidget::~SavegameWidget() void SavegameWidget::setSavegameData(SavegameData *savegame, QString savegamePath) { ui->labSavegameStr->setText(savegame->getSavegameStr()); + sgdStr = savegame->getSavegameStr(); sgdPath = savegamePath; sgdata = savegame; } + +void SavegameWidget::on_cmdDelete_clicked() +{ + int uchoice = QMessageBox::question(this, tr("Delete savegame"), tr("Are you sure to delete %1 from your Savegames?").arg("\""+sgdStr+"\""), QMessageBox::No | QMessageBox::Yes, QMessageBox::No); + if (uchoice == QMessageBox::Yes) + { + if (!QFile::exists(sgdPath)) + { + emit savegameDeleted(); + } + else if(QFile::remove(sgdPath)) + { + emit savegameDeleted(); + } + else + { + QMessageBox::warning(this, tr("Delete savegame"), tr("Failed at deleting %1 from your Savegames").arg("\""+sgdStr+"\"")); + } + } +} diff --git a/SavegameWidget.h b/SavegameWidget.h index 6083570..d1a537d 100755 --- a/SavegameWidget.h +++ b/SavegameWidget.h @@ -35,10 +35,17 @@ public: void setSavegameData(SavegameData *savegame, QString savegamePath); ~SavegameWidget(); +private slots: + void on_cmdDelete_clicked(); + private: Ui::SavegameWidget *ui; SavegameData *sgdata; QString sgdPath; + QString sgdStr; + +signals: + void savegameDeleted(); }; #endif // SAVEGAMEWIDGET_H diff --git a/SnapmaticWidget.cpp b/SnapmaticWidget.cpp index 75a760f..9fef30c 100755 --- a/SnapmaticWidget.cpp +++ b/SnapmaticWidget.cpp @@ -72,7 +72,7 @@ void SnapmaticWidget::on_cmdView_clicked() void SnapmaticWidget::on_cmdDelete_clicked() { - int uchoice = QMessageBox::question(this, tr("Delete picture"), tr("You're sure to delete %1 from your Snapmatic pictures?").arg(picStr), QMessageBox::No | QMessageBox::Yes, QMessageBox::No); + int uchoice = QMessageBox::question(this, tr("Delete picture"), tr("Are you sure to delete %1 from your Snapmatic pictures?").arg("\""+picStr+"\""), QMessageBox::No | QMessageBox::Yes, QMessageBox::No); if (uchoice == QMessageBox::Yes) { if (!QFile::exists(picPath)) @@ -85,7 +85,7 @@ void SnapmaticWidget::on_cmdDelete_clicked() } else { - QMessageBox::warning(this, tr("Delete picture"), tr("Failed at deleting %1 from your Snapmatic pictures").arg(picStr)); + QMessageBox::warning(this, tr("Delete picture"), tr("Failed at deleting %1 from your Snapmatic pictures").arg("\""+picStr+"\"")); } } } diff --git a/gta5sync_de.qm b/gta5sync_de.qm index 3720c93..d600143 100755 Binary files a/gta5sync_de.qm and b/gta5sync_de.qm differ diff --git a/gta5sync_de.ts b/gta5sync_de.ts index c072fb9..463b8ab 100755 --- a/gta5sync_de.ts +++ b/gta5sync_de.ts @@ -14,7 +14,7 @@ - + Close Schließen @@ -42,52 +42,52 @@ Schließen - - + + Snapmatic Picture Viewer Snapmatic Bildansicht - - + + Failed at %1 Fehlgeschlagen bei %1 - - + + No player Keine Spieler - - + + No crew Keine Crew - + JPEG picture (*.jpg);;Portable Network Graphics (*.png) JPEG Bild (*.jpg);;Portable Network Graphics (*.png) - + + + Export picture Bild exportieren - - Snapmatic Picture Exporter - Snapmatic Bild Exporter + Snapmatic Bild Exporter - + Failed to save the picture Fehlgeschlagen beim Speichern des Bildes - + No valid file is selected Keine gültige Datei wurde ausgewählt @@ -100,7 +100,7 @@ Profil Interface - + Loading file %1 of %2 files Loading %1 files of %2 files Lade Datei %1 von %2 Dateien @@ -114,12 +114,12 @@ Ansehen - + Close Profile Profil schließen - + Loading... Lade... @@ -170,6 +170,22 @@ Delete Löschen + + + + Delete savegame + Savegame löschen + + + + Are you sure to delete %1 from your Savegames? + Bist du sicher %1 von deinen Spielständen zu löschen? + + + + Failed at deleting %1 from your Savegames + Fehlgeschlagen beim Löschen %1 von deinen Spielständen + SnapmaticWidget @@ -193,6 +209,26 @@ Delete Löschen + + + + Delete picture + Bild löschen + + + + Are you sure to delete %1 from your Snapmatic pictures? + Bist du sicher %1 von deinen Snapmatic Bilder zu löschen? + + + You're sure to delete %1 from your Snapmatic pictures? + Bist du sicher %1 von deinen Snapmatic Bilder zu löschen? + + + + Failed at deleting %1 from your Snapmatic pictures + Fehlgeschlagen beim Löschen %1 von deinen Snapmatic Bildern + UserInterface @@ -231,7 +267,7 @@ - + Close Schließen @@ -247,6 +283,8 @@ + + Select profile Profil auswählen @@ -256,12 +294,12 @@ Strg+P - + GTA V Folder not found! GTA V Ordner nicht gefunden! - + gta5sync gta5sync