add delete selected content, german translation updated

This commit is contained in:
Rafael 2016-04-03 12:54:55 +02:00
parent ceebb96e36
commit 9a368976dd
5 changed files with 152 additions and 75 deletions

View File

@ -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"));
}
}
}

View File

@ -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();

View File

@ -163,16 +163,16 @@
</message>
<message>
<location filename="../ProfileInterface.ui" line="179"/>
<location filename="../ProfileInterface.cpp" line="192"/>
<location filename="../ProfileInterface.cpp" line="226"/>
<location filename="../ProfileInterface.cpp" line="241"/>
<location filename="../ProfileInterface.cpp" line="269"/>
<location filename="../ProfileInterface.cpp" line="276"/>
<location filename="../ProfileInterface.cpp" line="282"/>
<location filename="../ProfileInterface.cpp" line="297"/>
<location filename="../ProfileInterface.cpp" line="202"/>
<location filename="../ProfileInterface.cpp" line="236"/>
<location filename="../ProfileInterface.cpp" line="251"/>
<location filename="../ProfileInterface.cpp" line="279"/>
<location filename="../ProfileInterface.cpp" line="286"/>
<location filename="../ProfileInterface.cpp" line="292"/>
<location filename="../ProfileInterface.cpp" line="307"/>
<location filename="../ProfileInterface.cpp" line="343"/>
<location filename="../ProfileInterface.cpp" line="349"/>
<location filename="../ProfileInterface.cpp" line="317"/>
<location filename="../ProfileInterface.cpp" line="353"/>
<location filename="../ProfileInterface.cpp" line="359"/>
<source>Import copy</source>
<translation>Импортировать копию</translation>
</message>
@ -187,118 +187,134 @@
<translation>Загрузка...</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="196"/>
<location filename="../ProfileInterface.cpp" line="206"/>
<source>All profile files (SGTA* PGTA*)</source>
<translation>Все файлы профиля (SGTA* PGTA*)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="197"/>
<location filename="../ProfileInterface.cpp" line="207"/>
<source>Savegames files (SGTA*)</source>
<translation>Файлы сохранения (SGTA*)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="198"/>
<location filename="../ProfileInterface.cpp" line="208"/>
<source>Snapmatic pictures (PGTA*)</source>
<translation>Картинка Snapmatic (PGTA*)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="199"/>
<location filename="../ProfileInterface.cpp" line="209"/>
<source>All files (**)</source>
<translation>Все файлы (**)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="226"/>
<location filename="../ProfileInterface.cpp" line="236"/>
<source>Failed to read Snapmatic picture</source>
<translation>Не удалось загрузить картинку Snapmatic</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="241"/>
<location filename="../ProfileInterface.cpp" line="251"/>
<source>Failed to read Savegame file</source>
<translation>Не удалось загрузить файл сохранения</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="269"/>
<location filename="../ProfileInterface.cpp" line="279"/>
<source>Can&apos;t import %1 because of not valid file format</source>
<translation>Не получилось импортировать %1 из-за неправильного формата файла</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="276"/>
<location filename="../ProfileInterface.cpp" line="282"/>
<location filename="../ProfileInterface.cpp" line="286"/>
<location filename="../ProfileInterface.cpp" line="292"/>
<source>No valid file is selected</source>
<translation>Выбранный файл неверен</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="297"/>
<location filename="../ProfileInterface.cpp" line="307"/>
<source>Failed to import copy of Snapmatic picture because the file not begin with PGTA</source>
<translation>Не удалось имортировать копию картинки Snapmatic, т.к. файл не начинается с PGTA</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="307"/>
<location filename="../ProfileInterface.cpp" line="317"/>
<source>Failed to import copy of Snapmatic picture because the copy failed</source>
<translation>Не получилось имортировать копию картинки Snapmatic, потому что не удалось его скопировать</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="343"/>
<location filename="../ProfileInterface.cpp" line="353"/>
<source>Failed to import copy of Savegame file because the copy failed</source>
<translation>Не получилось имортировать копию сохранения, потому что не удалось его скопировать</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="349"/>
<location filename="../ProfileInterface.cpp" line="359"/>
<source>Failed to import copy of Savegame file because no free Savegame slot left</source>
<translation>Не получилось имортировать копию сохранения, потому что не осталось свободных под них слотов</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="403"/>
<location filename="../ProfileInterface.cpp" line="427"/>
<location filename="../ProfileInterface.cpp" line="487"/>
<location filename="../ProfileInterface.cpp" line="413"/>
<location filename="../ProfileInterface.cpp" line="437"/>
<location filename="../ProfileInterface.cpp" line="497"/>
<source>Export selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="422"/>
<location filename="../ProfileInterface.cpp" line="430"/>
<location filename="../ProfileInterface.cpp" line="432"/>
<location filename="../ProfileInterface.cpp" line="440"/>
<source>Export and Copy pictures</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="423"/>
<location filename="../ProfileInterface.cpp" line="435"/>
<location filename="../ProfileInterface.cpp" line="433"/>
<location filename="../ProfileInterface.cpp" line="445"/>
<source>Export pictures</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="424"/>
<location filename="../ProfileInterface.cpp" line="439"/>
<location filename="../ProfileInterface.cpp" line="434"/>
<location filename="../ProfileInterface.cpp" line="449"/>
<source>Copy pictures</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="427"/>
<location filename="../ProfileInterface.cpp" line="437"/>
<source>How should we deal with the Snapmatic pictures?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="453"/>
<location filename="../ProfileInterface.cpp" line="463"/>
<source>Export selected...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="454"/>
<location filename="../ProfileInterface.cpp" line="464"/>
<source>Initializing...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="487"/>
<location filename="../ProfileInterface.cpp" line="497"/>
<source>Export failed with...
%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="518"/>
<location filename="../ProfileInterface.cpp" line="548"/>
<source>Delete selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="518"/>
<source>You really want delete the selected content?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="548"/>
<source>Failed at delete all selected content</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../ExportThread.cpp" line="50"/>
<location filename="../ExportThread.cpp" line="65"/>
<location filename="../ExportThread.cpp" line="84"/>
<location filename="../ProfileInterface.cpp" line="454"/>
<location filename="../ProfileInterface.cpp" line="464"/>
<source>Current export job: %1</source>
<translation type="unfinished"></translation>
</message>

Binary file not shown.

View File

@ -198,16 +198,16 @@
</message>
<message>
<location filename="../ProfileInterface.ui" line="179"/>
<location filename="../ProfileInterface.cpp" line="192"/>
<location filename="../ProfileInterface.cpp" line="226"/>
<location filename="../ProfileInterface.cpp" line="241"/>
<location filename="../ProfileInterface.cpp" line="269"/>
<location filename="../ProfileInterface.cpp" line="276"/>
<location filename="../ProfileInterface.cpp" line="282"/>
<location filename="../ProfileInterface.cpp" line="297"/>
<location filename="../ProfileInterface.cpp" line="202"/>
<location filename="../ProfileInterface.cpp" line="236"/>
<location filename="../ProfileInterface.cpp" line="251"/>
<location filename="../ProfileInterface.cpp" line="279"/>
<location filename="../ProfileInterface.cpp" line="286"/>
<location filename="../ProfileInterface.cpp" line="292"/>
<location filename="../ProfileInterface.cpp" line="307"/>
<location filename="../ProfileInterface.cpp" line="343"/>
<location filename="../ProfileInterface.cpp" line="349"/>
<location filename="../ProfileInterface.cpp" line="317"/>
<location filename="../ProfileInterface.cpp" line="353"/>
<location filename="../ProfileInterface.cpp" line="359"/>
<source>Import copy</source>
<translation>Kopie importieren</translation>
</message>
@ -230,118 +230,134 @@
<translation>Lade...</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="196"/>
<location filename="../ProfileInterface.cpp" line="206"/>
<source>All profile files (SGTA* PGTA*)</source>
<translation>Alle Profildateien (SGTA* PGTA*)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="197"/>
<location filename="../ProfileInterface.cpp" line="207"/>
<source>Savegames files (SGTA*)</source>
<translation>Spielstanddateien (SGTA*)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="198"/>
<location filename="../ProfileInterface.cpp" line="208"/>
<source>Snapmatic pictures (PGTA*)</source>
<translation>Snapmatic Bilder (PGTA*)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="199"/>
<location filename="../ProfileInterface.cpp" line="209"/>
<source>All files (**)</source>
<translation>Alle Dateien (**)</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="226"/>
<location filename="../ProfileInterface.cpp" line="236"/>
<source>Failed to read Snapmatic picture</source>
<translation>Fehler beim Lesen vom Snapmatic Bild</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="241"/>
<location filename="../ProfileInterface.cpp" line="251"/>
<source>Failed to read Savegame file</source>
<translation>Fehler beim Lesen von Spielstanddatei</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="269"/>
<location filename="../ProfileInterface.cpp" line="279"/>
<source>Can&apos;t import %1 because of not valid file format</source>
<translation>Kann %1 nicht importieren weil das Dateiformat nicht gültig ist</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="276"/>
<location filename="../ProfileInterface.cpp" line="282"/>
<location filename="../ProfileInterface.cpp" line="286"/>
<location filename="../ProfileInterface.cpp" line="292"/>
<source>No valid file is selected</source>
<translation>Keine gültige Datei wurde ausgewählt</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="297"/>
<location filename="../ProfileInterface.cpp" line="307"/>
<source>Failed to import copy of Snapmatic picture because the file not begin with PGTA</source>
<translation>Fehlgeschlagenen beim Import vom Snapmatic Bild weil die Datei nicht mit PGTA begint </translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="307"/>
<location filename="../ProfileInterface.cpp" line="317"/>
<source>Failed to import copy of Snapmatic picture because the copy failed</source>
<translation>Fehlgeschlagenen beim Import vom Snapmatic Bild weil kopieren fehlgeschlagen ist</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="343"/>
<location filename="../ProfileInterface.cpp" line="353"/>
<source>Failed to import copy of Savegame file because the copy failed</source>
<translation>Fehlgeschlagenen beim Import vom Spielstand weil kopieren fehlgeschlagen ist</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="349"/>
<location filename="../ProfileInterface.cpp" line="359"/>
<source>Failed to import copy of Savegame file because no free Savegame slot left</source>
<translation>Fehlgeschlagenen beim Import vom Spielstand weil kein Spielstandslot mehr übrig ist</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="403"/>
<location filename="../ProfileInterface.cpp" line="427"/>
<location filename="../ProfileInterface.cpp" line="487"/>
<location filename="../ProfileInterface.cpp" line="413"/>
<location filename="../ProfileInterface.cpp" line="437"/>
<location filename="../ProfileInterface.cpp" line="497"/>
<source>Export selected</source>
<translation>Auswahl exportieren</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="422"/>
<location filename="../ProfileInterface.cpp" line="430"/>
<location filename="../ProfileInterface.cpp" line="432"/>
<location filename="../ProfileInterface.cpp" line="440"/>
<source>Export and Copy pictures</source>
<translation>Bilder exportieren und kopieren</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="423"/>
<location filename="../ProfileInterface.cpp" line="435"/>
<location filename="../ProfileInterface.cpp" line="433"/>
<location filename="../ProfileInterface.cpp" line="445"/>
<source>Export pictures</source>
<translation>Bilder exportieren</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="424"/>
<location filename="../ProfileInterface.cpp" line="439"/>
<location filename="../ProfileInterface.cpp" line="434"/>
<location filename="../ProfileInterface.cpp" line="449"/>
<source>Copy pictures</source>
<translation>Bilder kopieren</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="427"/>
<location filename="../ProfileInterface.cpp" line="437"/>
<source>How should we deal with the Snapmatic pictures?</source>
<translation>Wie sollen wir mit den Snapmatic Bilder umgehen?</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="453"/>
<location filename="../ProfileInterface.cpp" line="463"/>
<source>Export selected...</source>
<translation>Auswahl exportieren...</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="454"/>
<location filename="../ProfileInterface.cpp" line="464"/>
<source>Initializing...</source>
<translation>Initialisierung...</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="487"/>
<location filename="../ProfileInterface.cpp" line="497"/>
<source>Export failed with...
%1</source>
<translation>Exportieren fehlgeschlagen bei...\n%1</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="518"/>
<location filename="../ProfileInterface.cpp" line="548"/>
<source>Delete selected</source>
<translation>Auswahl löschen</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="518"/>
<source>You really want delete the selected content?</source>
<translation>Möchtest du wirklich den ausgewählten Inhalt löschen?</translation>
</message>
<message>
<location filename="../ProfileInterface.cpp" line="548"/>
<source>Failed at delete all selected content</source>
<translation>Fehlgeschlagen beim Löschen von alle ausgewählte Inhalte</translation>
</message>
<message>
<location filename="../ExportThread.cpp" line="50"/>
<location filename="../ExportThread.cpp" line="65"/>
<location filename="../ExportThread.cpp" line="84"/>
<location filename="../ProfileInterface.cpp" line="454"/>
<location filename="../ProfileInterface.cpp" line="464"/>
<source>Current export job: %1</source>
<translation>Aktueller Exportiervorgang: %1</translation>
</message>