diff --git a/FusionLang_de.qm b/FusionLang_de.qm index fee07b9..9f57cdc 100644 Binary files a/FusionLang_de.qm and b/FusionLang_de.qm differ diff --git a/FusionLang_de.ts b/FusionLang_de.ts index bbc1b50..171037a 100644 --- a/FusionLang_de.ts +++ b/FusionLang_de.ts @@ -137,7 +137,7 @@ - + ... ... @@ -203,7 +203,17 @@ ... - + + Delete Logfiles + Lösche Logfiles + + + + Open Folder + Öffne Log-Ordner + + + To enable Syncing, select the Savegame-Folder in the Settings Dialog in each game, and a synced Directory here - for Example an Dropbox or OwnCloud folder. Fusion will then keep these Directorys up to date by overriding the old data. @@ -245,13 +255,13 @@ $GAMEPATH Pfad zum Spiel $GAMEEXE Name des Ausführbaren Datei, relativ zu $GAMEPATH - + Local saved Backups: Anzahl Backups: - - + + Target-Dir Ziel-Verzeichnis @@ -286,77 +296,82 @@ $GAMEEXE Name des Ausführbaren Datei, relativ zu $GAMEPATH Launcher - + + Logfiles + Logfiles + + + Choose stylesheet Wähle Stylesheet - - - + + + Error Fehler - + Please set a name. Bitte Namen angeben. - + Please set a path. Bitte Pfad angeben - + This name already exists! Dieser Name existiert bereits! - + Choose launcher Wähle Launcher - - + + Please confirm! Bitte bestätigen! - + If artwork is found, existing artwork will be overwritten! Wird Artwork gefunden, werden vorhandene Grafiken ersetzt! - + Choose the library folder Wähle einen Ordner - + Do you really want to remove Willst du folgenden Pfad wirklich entfernen? - + The games inside won't be removed from your disk. Die Spiele im Ordner werden nicht entfernt - - + + Running downloads: Laufende Downloads: - + Downloads finished Downloads beendet - + Finished %n download(s) %n Download beendet @@ -543,7 +558,7 @@ Game LIBRARY - LIBRARY + BIBLIOTHEK diff --git a/addgamedialog.cpp b/addgamedialog.cpp index 0fbe485..d305247 100644 --- a/addgamedialog.cpp +++ b/addgamedialog.cpp @@ -2,6 +2,7 @@ #include "ui_addgamedialog.h" #include "fgame.h" #include +#include #include "fdb.h" #include "flauncher.h" @@ -56,6 +57,22 @@ void AddGameDialog::on_chooseGameExecutableButton_clicked() void AddGameDialog::on_buttonBox_accepted() { game.setName(ui->gameNameEdit->text()); + + if(game.getName().length() <= 0) { + QMessageBox::warning(this, "Please fill all fields!", "You have to fill the name-field!", QMessageBox::Ok); + return; + } + + if(game.getExe().length() <= 0) { + QMessageBox::warning(this, "Please fill all fields!", "You have to set an executable!", QMessageBox::Ok); + return; + } + + if(game.getPath().length() <= 0) { + QMessageBox::warning(this, "Please fill all fields!", "You have to set a path!", QMessageBox::Ok); + return; + } + game.setCommand(ui->gameCommandEdit->text()); game.setArgs(QStringList(ui->gameArgsEdit->text())); game.setType(Executable); diff --git a/fsettingsdialog.cpp b/fsettingsdialog.cpp index 538ce65..7c915e9 100644 --- a/fsettingsdialog.cpp +++ b/fsettingsdialog.cpp @@ -21,6 +21,7 @@ FSettingsDialog::FSettingsDialog(FDB *db, QWidget *parent) : ui->listWidget->addItem(tr("Artwork")); ui->listWidget->addItem(tr("Watched Folders")); ui->listWidget->addItem(tr("Launchers")); + ui->listWidget->addItem(tr("Logfiles")); // ui->listWidget->addItem(tr("Savegame-Sync")); ui->listWidget->setCurrentRow(0); @@ -40,7 +41,7 @@ FSettingsDialog::FSettingsDialog(FDB *db, QWidget *parent) : ui->cb_int_language->setCurrentIndex(idx); #endif - //########################## + //================================= //WatchedFolders QList tmpList = db->getWatchedFoldersList(); ui->lw_Folder_FolderList->clear(); @@ -50,13 +51,13 @@ FSettingsDialog::FSettingsDialog(FDB *db, QWidget *parent) : ui->lw_Folder_FolderList->addItem(tmpList[i].getDirectory().absolutePath()); } - //########################## + //================================= // LAUNCHERS loadLaunchers(); - //########################## + //================================= //Savegame-Sync ui->le_sync_path->setText(db->getTextPref("sync_target", "")); ui->sb_sync_backups->setValue(db->getIntPref("sync_No_of_Backups", 0)); @@ -66,6 +67,47 @@ FSettingsDialog::FSettingsDialog(FDB *db, QWidget *parent) : ui->cb_gen_useTrayIcon->setChecked(db->getBoolPref("useTrayIcon", true)); + //================================= + // Log-Files + loadLogfiles(); + +} + +void FSettingsDialog::loadLogfiles() { + ui->lw_log_logfiles->clear(); + + QDir logDir = LibFusion::getWorkingDir().absolutePath() + QDir::separator() + "Logs"; + QStringList logfiles = logDir.entryList(); + for(QString log : logfiles) { + if(log.length()>3) //do skip "." and ".." and other wrong stuff + ui->lw_log_logfiles->addItem(log); + } + + +} + +void FSettingsDialog::on_pb_log_openFolder_clicked() +{ + + QDir logDir = LibFusion::getWorkingDir().absolutePath() + QDir::separator() + "Logs"; + QDesktopServices::openUrl(logDir.absolutePath()); +} + +void FSettingsDialog::on_pb_log_clear_clicked() +{ + if(QMessageBox::question(this, "Please Confirm", "Do you really want to delete all Logfiles?", QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) + return; + + QDir logDir = LibFusion::getWorkingDir().absolutePath() + QDir::separator() + "Logs"; + QStringList logfiles = logDir.entryList(); + for(QString log : logfiles) { + if(log.length()>3) //do skip "." and ".." and other wrong stuff + { + QFile::remove(logDir.absolutePath() + "/" + log); // logfile(logDir + "/" + log); + } + } + + loadLogfiles(); } FSettingsDialog::~FSettingsDialog() @@ -98,6 +140,13 @@ void FSettingsDialog::on_listWidget_currentRowChanged(int i) ui->settingPages->setCurrentIndex(i); } +void FSettingsDialog::on_lw_log_logfiles_itemDoubleClicked(QListWidgetItem *item) +{ + QDir logDir = LibFusion::getWorkingDir().absolutePath() + QDir::separator() + "Logs"; + QString filename = item->text(); + QDesktopServices::openUrl(logDir.absolutePath() + "/" + filename); +} + void FSettingsDialog::on_pb_selectStylesheet_clicked() { QString stylesheetFile = QFileDialog::getOpenFileName(this, tr("Choose stylesheet"), QDir::homePath(), "*.qss"); diff --git a/fsettingsdialog.h b/fsettingsdialog.h index 40542a6..3e28661 100644 --- a/fsettingsdialog.h +++ b/fsettingsdialog.h @@ -35,8 +35,13 @@ class FSettingsDialog : public QDialog FLauncher *selectedLauncher; void loadLaunchers(); void updateLauncher(); + void loadLogfiles(); private slots: + void on_pb_log_openFolder_clicked(); + void on_pb_log_clear_clicked(); + void on_listWidget_currentRowChanged(int i); + void on_lw_log_logfiles_itemDoubleClicked(QListWidgetItem * item); void on_pb_selectStylesheet_clicked(); void on_pb_ResetStylesheet_clicked(); diff --git a/fsettingsdialog.ui b/fsettingsdialog.ui index f92ae24..a9afd72 100644 --- a/fsettingsdialog.ui +++ b/fsettingsdialog.ui @@ -69,7 +69,7 @@ - 2 + 6 @@ -539,6 +539,40 @@ $GAMEEXE The path to the executable, relative to $GAMEPATH + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Delete Logfiles + + + + + + + Open Folder + + + + + diff --git a/mainwindow.ui b/mainwindow.ui index 8605b8f..98bbf04 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -444,7 +444,7 @@ - lbl_lastPlayed +