diff options
| -rw-r--r-- | src/organizer_en_US.ts | 2 | ||||
| -rw-r--r-- | src/savegamegamebryo.cpp | 84 | ||||
| -rw-r--r-- | src/savegamegamebyro.h | 77 | ||||
| -rw-r--r-- | src/transfersavesdialog.h | 26 |
4 files changed, 11 insertions, 178 deletions
diff --git a/src/organizer_en_US.ts b/src/organizer_en_US.ts index c2f99ccc..075132c2 100644 --- a/src/organizer_en_US.ts +++ b/src/organizer_en_US.ts @@ -801,7 +801,7 @@ p, li { white-space: pre-wrap; } </message> <message> <location filename="editexecutablesdialog.ui" line="23"/> - <source>This is a list of your configured executables. Executables in grey are automatically recognised and can not be modified.</source> + <source>This is a list of your configured executables. Executables in grey are automatically recognised. Existing entries can be modified and new ones added.</source> <translation type="unfinished"></translation> </message> <message> diff --git a/src/savegamegamebryo.cpp b/src/savegamegamebryo.cpp deleted file mode 100644 index 06a72d2b..00000000 --- a/src/savegamegamebryo.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/*
-Copyright (C) 2012 Sebastian Herbord. All rights reserved.
-
-This file is part of Mod Organizer.
-
-Mod Organizer is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Mod Organizer is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "savegamegamebyro.h"
-#include "isavegame.h"
-#include "savegameinfo.h"
-#include "iplugingame.h"
-#include <gamebryosavegame.h>
-#include <scopeguard.h>
-#include <limits>
-#include <set>
-
-using namespace MOBase;
-
-
-SaveGameGamebryo::SaveGameGamebryo(QObject *parent, const QString &fileName, IPluginGame const *game)
- : SaveGame(parent, fileName, game)
- , m_Plugins()
-{
- // ensure creation time is set to a valid, preferrably even a reasonable value
- memset(&m_CreationTime, 0, sizeof(SYSTEMTIME));
- HANDLE fileHandle = CreateFileW(fileName.toStdWString().c_str(),
- GENERIC_READ,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- nullptr,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- nullptr);
- ON_BLOCK_EXIT([fileHandle] () {
- CloseHandle(fileHandle);
- });
- if (fileHandle != INVALID_HANDLE_VALUE) {
- FILETIME creationTime;
- if (GetFileTime(fileHandle, &creationTime, nullptr, nullptr)) {
- FileTimeToSystemTime(&creationTime, &m_CreationTime);
- }
- }
-
- const SaveGameInfo *info = game->feature<SaveGameInfo>();
- if (info != nullptr) {
- const ISaveGame *save = info->getSaveGameInfo(fileName);
- m_Save = save;
-
- //Kludgery
- const GamebryoSaveGame *s = dynamic_cast<const GamebryoSaveGame *>(save);
- m_PCName = s->getPCName();
- m_PCLevel = s->getPCLevel();
- m_PCLocation = s->getPCLocation();
- m_SaveNumber = s->getSaveNumber();
-
- QDateTime modified = s->getCreationTime();
- memset(&m_CreationTime, 0, sizeof(SYSTEMTIME));
-
- m_CreationTime.wDay = static_cast<WORD>(modified.date().day());
- m_CreationTime.wDayOfWeek = static_cast<WORD>(modified.date().dayOfWeek());
- m_CreationTime.wMonth = static_cast<WORD>(modified.date().month());
- m_CreationTime.wYear =static_cast<WORD>( modified.date().year());
-
- m_CreationTime.wHour = static_cast<WORD>(modified.time().hour());
- m_CreationTime.wMinute = static_cast<WORD>(modified.time().minute());
- m_CreationTime.wSecond = static_cast<WORD>(modified.time().second());
- m_CreationTime.wMilliseconds = static_cast<WORD>(modified.time().msec());
-
- m_Screenshot = s->getScreenshot();
-
- m_Plugins = s->getPlugins();
- }
-}
diff --git a/src/savegamegamebyro.h b/src/savegamegamebyro.h deleted file mode 100644 index 5ac62848..00000000 --- a/src/savegamegamebyro.h +++ /dev/null @@ -1,77 +0,0 @@ -/*
-Copyright (C) 2012 Sebastian Herbord. All rights reserved.
-
-This file is part of Mod Organizer.
-
-Mod Organizer is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Mod Organizer is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef SAVEGAMEGAMEBRYO_H
-#define SAVEGAMEGAMEBRYO_H
-
-#include "savegame.h"
-
-#include <QMetaType>
-#include <QObject>
-#include <QString>
-
-namespace MOBase { class IPluginGame; class ISaveGame; }
-
-/**
- * @brief represents a single save game
- **/
-class SaveGameGamebryo : public SaveGame {
-
-Q_OBJECT
-
-public:
-
- /**
- * @brief construct a save game and immediately read out information from the file
- *
- * @param filename absolute path of the save game file
- **/
- SaveGameGamebryo(QObject *parent, const QString &filename, MOBase::IPluginGame const *game);
-
- /*
-
- SaveGameGamebryo(const SaveGameGamebryo &reference);
-
- SaveGameGamebryo &operator=(const SaveGameGamebryo &reference);
-
- ~SaveGameGamebryo();
- */
-
- /**
- * @return number of plugins that were enabled when the save game was created
- **/
- size_t numPlugins() const { return m_Plugins.size(); }
-
- /**
- * retrieve the name of one of the plugins that were enabled when the save game
- * was created. valid indices are in the range between [0, numPlugins()[
- * @param index plugin index
- * @return name of the plugin
- **/
- const QString &plugin(int index) const { return m_Plugins.at(index); }
-
-private:
-
- QStringList m_Plugins;
- //Note: This isn't owned by us so safe to copy
- const MOBase::ISaveGame *m_Save;
-
-};
-
-#endif // SAVEGAMEGAMEBRYO_H
diff --git a/src/transfersavesdialog.h b/src/transfersavesdialog.h index 6961e8c6..dee41c72 100644 --- a/src/transfersavesdialog.h +++ b/src/transfersavesdialog.h @@ -37,14 +37,15 @@ namespace Ui { class TransferSavesDialog; } namespace MOBase { class IPluginGame; }
namespace MOBase { class ISaveGame; }
-class TransferSavesDialog : public MOBase::TutorableDialog
-{
+class TransferSavesDialog : public MOBase::TutorableDialog {
Q_OBJECT
-
+
public:
- explicit TransferSavesDialog(const Profile &profile, MOBase::IPluginGame const *gamePlugin, QWidget *parent = 0);
+ explicit TransferSavesDialog(const Profile &profile,
+ MOBase::IPluginGame const *gamePlugin,
+ QWidget *parent = 0);
~TransferSavesDialog();
-
+
private slots:
void on_moveToLocalBtn_clicked();
@@ -62,23 +63,17 @@ private slots: void on_copyToGlobalBtn_clicked();
private:
-
- enum OverwriteMode {
- OVERWRITE_ASK,
- OVERWRITE_YES,
- OVERWRITE_NO
- };
+ enum OverwriteMode { OVERWRITE_ASK, OVERWRITE_YES, OVERWRITE_NO };
private:
-
void refreshGlobalCharacters();
void refreshLocalCharacters();
void refreshGlobalSaves();
void refreshLocalSaves();
- bool testOverwrite(OverwriteMode &overwriteMode, const QString &destinationFile);
+ bool testOverwrite(OverwriteMode &overwriteMode,
+ const QString &destinationFile);
private:
-
Ui::TransferSavesDialog *ui;
Profile m_Profile;
@@ -93,8 +88,7 @@ private: void refreshSaves(SaveCollection &saveCollection, const QString &savedir);
void refreshCharacters(SaveCollection const &saveCollection,
- QListWidget *charList,
- QPushButton *copy,
+ QListWidget *charList, QPushButton *copy,
QPushButton *move);
bool transferCharacters(
|
