From 9a368976dd960c6ba7ac7446b77c3ae05e0fa14a Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 3 Apr 2016 12:54:55 +0200 Subject: [PATCH] add delete selected content, german translation updated --- ProfileInterface.cpp | 48 +++++++++++++++++++++-- ProfileInterface.h | 3 ++ lang/gta5sync_ru.ts | 88 +++++++++++++++++++++++++------------------ res/gta5sync_de.qm | Bin 14264 -> 14743 bytes res/gta5sync_de.ts | 88 +++++++++++++++++++++++++------------------ 5 files changed, 152 insertions(+), 75 deletions(-) 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 3a8b7ee33c7423a77b466d74ae132217813fb97d..f5d16d2cba199f75cb5b3ce9327e747fe3729ea9 100755 GIT binary patch delta 1209 zcmZXTe@qi+7{|Y~cWv+5Qi`RN^6P48hwE>pMwcz33uaE4i*A3A=t6}vRJ+!+1wuAg zm&N^xn@cLgCCnew5vF7r!7+#%L5wjbn=n=}nz2RDkl~UAK{SSBd&-+ES$4_Y=Y5`g z-{<|__jzw1){*$cl2y`i>>%Wk?8Ak7na$}ba zXy=vk_5`q^hEr*;Q0(Jgwwwf>+QXgycn&G}_R)X@_)ZW>k#C&%H{e%s=Z{iZ|1-oK zVw9*PL9LAbFSs7}mlXFfx^{4*Eyu{o(~Rz2+=J;sK$qe9LsY2T$D6x50KJ<(5=;VX z?(@e>GAY1Z$alKV0+oY|o*Vp+sc9hJt=ij0g7{miH&nFonuBWfy?l!Is>O#?K>syk zX$zzCH+9kDIckkx9lJRN7+zDyZ;#Wwu)2M$nb!BKm*OVC;?$I0@dBnNnr+>wQR-o> zW@LINC0@`>ow!6BzbWLke+J~eBNR?n1D+wrAfsz8CbV>Ya6IowAD^8TZ3b;NL?{wTHf%A<132||qjn*C3 z=JdZs^Ve(7Ea_gQ{4y{ z)w&Pr$tp)e*Xg5EUlC+w&Tz`f5Env|?Dl>Fo?Tc8W3ZmHrhI2{()|mJRDK z*O3#(+xiA5m%-=M`J z1ooj8i)f%qR0RooN@zqgJzEh*9Q$e0@bdd?UPd&1)M(Dn4*n}49jhqzxa(rgQe37T Y+oaY|^j`_dCi#C7HY{uS*)~(~58yCFH2?qr delta 961 zcmXYvX-HII6oy~#-0{xcyr$zaHa0rr?kqW0*pF~23&l1p!YHvw$sz--D2k?NBa#wI zEwV*4v$9ZJG6E|lqNtS0L_;D?BnvD}^G8s}zV4sroXdC4_nz~9l_l-F%Z#2f@O1|O z(Z*Jq?jlJ}OMQtsl{ z1YZLpFY|ZK{(uLL8VX2&qmM|6oHFqbF`2(}j@mj)h+f2-L>&ogWORPu8|*hIA7P9= z!*}nyK%1;)j4S6Sh93aRJAGh%C7{~%r3?1}?g;%w^E)6w)>p;XdVr{j*?=bT(ZBQz zlTy2P!2uGY@Ap3FO&2D#3BrgUJAc;F44 zD-_Cm_EP=0@VnRu1cewvpE?0!y&4ve z0>oE~Q8TpixL$G5Clh%li(4xfkl;kI_?H{7JQ7bVZ3Lp*#8M|&Bz_d1r_exQ+r{xd z>KnbEF>!_D^_8r!nx)7i8Dw3*ly$oXNIWjB^n9ToQKzJKa{yreF1<>lRnN0Y?=9Z)pqN1L%VD4r@8y>4rf@{e(wCTa0lT zRu;H&wXSwrkttbwV`u_`!>M|KK&^C1=bLP)%?7^7uUQTX=9&jh!D4fxZ8YF7+xhwJ 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