diff --git a/ProfileInterface.cpp b/ProfileInterface.cpp index daf2eb4..b7db28f 100755 --- a/ProfileInterface.cpp +++ b/ProfileInterface.cpp @@ -155,7 +155,12 @@ void ProfileInterface::profileLoaded_p() void ProfileInterface::savegameDeleted() { - SavegameWidget *sgdWidget = (SavegameWidget*)sender(); + savegameDeleted_f((SavegameWidget*)sender()); +} + +void ProfileInterface::savegameDeleted_f(QWidget *sgdWidget_) +{ + SavegameWidget *sgdWidget = (SavegameWidget*)sgdWidget_; SavegameData *savegame = sgdWidget->getSavegame(); if (sgdWidget->isSelected()) { sgdWidget->setSelected(false); } sgdWidget->close(); @@ -165,7 +170,12 @@ void ProfileInterface::savegameDeleted() void ProfileInterface::pictureDeleted() { - SnapmaticWidget *picWidget = (SnapmaticWidget*)sender(); + pictureDeleted_f((SnapmaticWidget*)sender()); +} + +void ProfileInterface::pictureDeleted_f(QWidget *picWidget_) +{ + SnapmaticWidget *picWidget = (SnapmaticWidget*)picWidget_; SnapmaticPicture *picture = picWidget->getPicture(); if (picWidget->isSelected()) { picWidget->setSelected(false); } picWidget->close(); @@ -505,5 +515,37 @@ void ProfileInterface::exportSelected() void ProfileInterface::deleteSelected() { - + if (QMessageBox::Yes == QMessageBox::warning(this, tr("Delete selected"), tr("You really want delete the selected content?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No)) + { + foreach (ProfileWidget *widget, widgets.keys()) + { + if (widget->isSelected()) + { + if (widgets[widget] == "SnapmaticWidget") + { + SnapmaticWidget *picWidget = (SnapmaticWidget*)widget; + SnapmaticPicture *picture = picWidget->getPicture(); + QString fileName = picture->getPictureFileName(); + if (!QFile::exists(fileName) || QFile::remove(fileName)) + { + pictureDeleted_f(picWidget); + } + } + else if (widgets[widget] == "SavegameWidget") + { + SavegameWidget *sgdWidget = (SavegameWidget*)widget; + SavegameData *savegame = sgdWidget->getSavegame(); + QString fileName = savegame->getSavegameFileName(); + if (!QFile::exists(fileName) || QFile::remove(fileName)) + { + savegameDeleted_f(sgdWidget); + } + } + } + } + if (selectedWidgts != 0) + { + QMessageBox::warning(this, tr("Delete selected"), tr("Failed at delete all selected content")); + } + } } diff --git a/ProfileInterface.h b/ProfileInterface.h index 868c916..5001be5 100755 --- a/ProfileInterface.h +++ b/ProfileInterface.h @@ -23,6 +23,7 @@ #include "SnapmaticWidget.h" #include "ProfileDatabase.h" #include "DatabaseThread.h" +#include "SavegameWidget.h" #include "ProfileLoader.h" #include "ProfileWidget.h" #include "ExportThread.h" @@ -83,6 +84,8 @@ private: bool importSnapmaticPicture(SnapmaticPicture *picture, QString picPath); bool importSavegameData(SavegameData *savegame, QString sgdPath); + void savegameDeleted_f(QWidget *sgdWidget); + void pictureDeleted_f(QWidget *picWidget); signals: void profileLoaded(); diff --git a/lang/gta5sync_ru.ts b/lang/gta5sync_ru.ts index b1e91c3..99e36ca 100755 --- a/lang/gta5sync_ru.ts +++ b/lang/gta5sync_ru.ts @@ -163,16 +163,16 @@ - - - - - - - + + + + + + - - + + + Import copy Импортировать копию @@ -187,118 +187,134 @@ Загрузка... - + All profile files (SGTA* PGTA*) Все файлы профиля (SGTA* PGTA*) - + Savegames files (SGTA*) Файлы сохранения (SGTA*) - + Snapmatic pictures (PGTA*) Картинка Snapmatic (PGTA*) - + All files (**) Все файлы (**) - + Failed to read Snapmatic picture Не удалось загрузить картинку Snapmatic - + Failed to read Savegame file Не удалось загрузить файл сохранения - + Can't import %1 because of not valid file format Не получилось импортировать %1 из-за неправильного формата файла - - + + No valid file is selected Выбранный файл неверен - + Failed to import copy of Snapmatic picture because the file not begin with PGTA Не удалось имортировать копию картинки Snapmatic, т.к. файл не начинается с PGTA - + Failed to import copy of Snapmatic picture because the copy failed Не получилось имортировать копию картинки Snapmatic, потому что не удалось его скопировать - + Failed to import copy of Savegame file because the copy failed Не получилось имортировать копию сохранения, потому что не удалось его скопировать - + Failed to import copy of Savegame file because no free Savegame slot left Не получилось имортировать копию сохранения, потому что не осталось свободных под них слотов - - - + + + Export selected - - + + Export and Copy pictures - - + + Export pictures - - + + Copy pictures - + How should we deal with the Snapmatic pictures? - + Export selected... - + Initializing... - + Export failed with... %1 + + + + Delete selected + + + + + You really want delete the selected content? + + + + + Failed at delete all selected content + + - + Current export job: %1 diff --git a/res/gta5sync_de.qm b/res/gta5sync_de.qm index 3a8b7ee..f5d16d2 100755 Binary files a/res/gta5sync_de.qm and b/res/gta5sync_de.qm differ diff --git a/res/gta5sync_de.ts b/res/gta5sync_de.ts index 5f54c42..df7b213 100755 --- a/res/gta5sync_de.ts +++ b/res/gta5sync_de.ts @@ -198,16 +198,16 @@ - - - - - - - + + + + + + - - + + + Import copy Kopie importieren @@ -230,118 +230,134 @@ Lade... - + All profile files (SGTA* PGTA*) Alle Profildateien (SGTA* PGTA*) - + Savegames files (SGTA*) Spielstanddateien (SGTA*) - + Snapmatic pictures (PGTA*) Snapmatic Bilder (PGTA*) - + All files (**) Alle Dateien (**) - + Failed to read Snapmatic picture Fehler beim Lesen vom Snapmatic Bild - + Failed to read Savegame file Fehler beim Lesen von Spielstanddatei - + Can't import %1 because of not valid file format Kann %1 nicht importieren weil das Dateiformat nicht gültig ist - - + + No valid file is selected Keine gültige Datei wurde ausgewählt - + Failed to import copy of Snapmatic picture because the file not begin with PGTA Fehlgeschlagenen beim Import vom Snapmatic Bild weil die Datei nicht mit PGTA begint - + Failed to import copy of Snapmatic picture because the copy failed Fehlgeschlagenen beim Import vom Snapmatic Bild weil kopieren fehlgeschlagen ist - + Failed to import copy of Savegame file because the copy failed Fehlgeschlagenen beim Import vom Spielstand weil kopieren fehlgeschlagen ist - + Failed to import copy of Savegame file because no free Savegame slot left Fehlgeschlagenen beim Import vom Spielstand weil kein Spielstandslot mehr übrig ist - - - + + + Export selected Auswahl exportieren - - + + Export and Copy pictures Bilder exportieren und kopieren - - + + Export pictures Bilder exportieren - - + + Copy pictures Bilder kopieren - + How should we deal with the Snapmatic pictures? Wie sollen wir mit den Snapmatic Bilder umgehen? - + Export selected... Auswahl exportieren... - + Initializing... Initialisierung... - + Export failed with... %1 Exportieren fehlgeschlagen bei...\n%1 + + + + Delete selected + Auswahl löschen + + + + You really want delete the selected content? + Möchtest du wirklich den ausgewählten Inhalt löschen? + + + + Failed at delete all selected content + Fehlgeschlagen beim Löschen von alle ausgewählte Inhalte + - + Current export job: %1 Aktueller Exportiervorgang: %1