summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp122
-rw-r--r--src/mainwindow.h101
-rw-r--r--src/organizer.pro4
-rw-r--r--src/savegame.cpp38
-rw-r--r--src/savegame.h14
-rw-r--r--src/savegamegamebryo.cpp2
-rw-r--r--src/savegamegamebryo.h (renamed from src/savegamegamebyro.h)155
-rw-r--r--src/savegameinfowidgetgamebryo.cpp2
8 files changed, 232 insertions, 206 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index a85a0fb3..8c292f08 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -20,7 +20,20 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "mainwindow.h"
#include "ui_mainwindow.h"
+#include "directoryentry.h"
+#include "directoryrefresher.h"
+#include "executableinfo.h"
+#include "executableslist.h"
+#include "guessedvalue.h"
+#include "imodinterface.h"
+#include "iplugingame.h"
+#include "iplugindiagnose.h"
+#include "nexusinterface.h"
+#include "organizercore.h"
+#include "previewgenerator.h"
#include "spawn.h"
+#include "versioninfo.h"
+
#include "report.h"
#include "modlist.h"
#include "modlistsortproxy.h"
@@ -31,7 +44,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "editexecutablesdialog.h"
#include "categories.h"
#include "categoriesdialog.h"
-#include "utility.h"
#include "modinfodialog.h"
#include "overwriteinfodialog.h"
#include "activatemodsdialog.h"
@@ -41,16 +53,13 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "messagedialog.h"
#include "installationmanager.h"
#include "lockeddialog.h"
-#include "syncoverwritedialog.h"
#include "logbuffer.h"
#include "downloadlistsortproxy.h"
#include "motddialog.h"
#include "filedialogmemory.h"
-#include "questionboxmemory.h"
#include "tutorialmanager.h"
#include "modflagicondelegate.h"
#include "genericicondelegate.h"
-#include "credentialsdialog.h"
#include "selectiondialog.h"
#include "csvbuilder.h"
#include "savetextasdialog.h"
@@ -59,59 +68,84 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "browserdialog.h"
#include "aboutdialog.h"
#include "safewritefile.h"
-//?
-//#include "isavegame.h"
-//#include "savegameinfo.h"
-//?
+#include "savegameinfowidget.h"
+#include "savegameinfowidgetgamebryo.h"
+#include "scriptextender.h"
#include "nxmaccessmanager.h"
-#include <archive.h>
-#include <appconfig.h>
+#include "appconfig.h"
#include <utility.h>
-#include <ipluginproxy.h>
#include <dataarchives.h>
#include <bsainvalidation.h>
-#include <questionboxmemory.h>
#include <taskprogressmanager.h>
-#include <util.h>
#include <scopeguard.h>
+#include <QAbstractItemDelegate>
+#include <QAbstractProxyModel>
+#include <QAction>
+#include <QApplication>
+#include <QCheckBox>
+#include <QCloseEvent>
+#include <QCursor>
+#include <QDialog>
+#include <QDragEnterEvent>
+#include <QDropEvent>
+#include <QEvent>
+#include <QFont>
+#include <QFuture>
+#include <QHash>
+#include <QIODevice>
+#include <QIcon>
+#include <QItemSelectionModel>
+#include <QLineEdit>
+#include <QListWidgetItem>
+#include <QModelIndex>
+#include <QNetworkProxyFactory>
+#include <QPainter>
+#include <QPixmap>
+#include <QPoint>
+#include <QPushButton>
+#include <QRect>
+#include <QResizeEvent>
+#include <QScopedPointer>
+#include <QSizePolicy>
+#include <QSize>
#include <QTime>
+#include <QUrl>
+#include <QVariantList>
+#include <QtDebug>
+#include <QtGlobal>
+
#include <QInputDialog>
#include <QSettings>
#include <QWhatsThis>
#include <QProcess>
#include <QMenu>
#include <QBuffer>
-#include <QInputDialog>
#include <QDirIterator>
-#include <QHelpEvent>
#include <QToolTip>
#include <QFileDialog>
#include <QTimer>
+#include <QTranslator>
#include <QMessageBox>
#include <QDebug>
-#include <QBuffer>
#include <QWidgetAction>
#include <QToolButton>
-#include <QGraphicsObject>
-#include <QPluginLoader>
#include <QRadioButton>
#include <QDesktopWidget>
-#include <QtPlugin>
-#include <QIdentityProxyModel>
#include <QClipboard>
-#include <QNetworkInterface>
-#include <QNetworkProxy>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
-#include <QJsonValue>
+#include <QJsonValueRef>
#include <QMimeData>
+
+
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <QtConcurrent/QtConcurrentRun>
#else
#include <QtConcurrentRun>
#endif
+
#include <QCoreApplication>
#include <QProgressDialog>
@@ -119,22 +153,19 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <boost/thread.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>
-#include <boost/foreach.hpp>
#include <boost/assign.hpp>
#endif
-#include <Psapi.h>
#include <shlobj.h>
-#include <ShellAPI.h>
-#include <TlHelp32.h>
-#include <sstream>
-#include <regex>
+#include <limits.h>
+#include <exception>
#include <functional>
#include <map>
-#include <ctime>
-#include <wchar.h>
-#include <utility.h>
+#include <regex>
+#include <stdexcept>
+#include <sstream>
+#include <utility>
#ifdef TEST_MODELS
#include "modeltest.h"
@@ -3191,29 +3222,42 @@ void MainWindow::deleteSavegame_clicked()
{
QModelIndexList selectedIndexes = ui->savegameList->selectionModel()->selectedIndexes();
+ //This feels wrong and should be part of savegame interface
+ QStringList extensions;
+ {
+ ScriptExtender *extender = m_OrganizerCore.managedGame()->feature<ScriptExtender>();
+ if (extender != nullptr) {
+ extensions += extender->saveGameAttachmentExtensions();
+ }
+ }
+
QString savesMsgLabel;
QStringList deleteFiles;
int count = 0;
- foreach (const QModelIndex &idx, selectedIndexes) {
- QString name = idx.data().toString();
- SaveGame *save = new SaveGame(this, idx.data(Qt::UserRole).toString(), m_OrganizerCore.managedGame());
+ for (const QModelIndex &idx : selectedIndexes) {
+ //QString name = idx.data().toString();
+ QFileInfo fileName(idx.data(Qt::UserRole).toString());
if (count < 10) {
- savesMsgLabel += "<li>" + QFileInfo(name).completeBaseName() + "</li>";
+ savesMsgLabel += "<li>" + fileName.completeBaseName() + "</li>";
}
++count;
- deleteFiles << save->saveFiles();
+ deleteFiles << fileName.absoluteFilePath();
+ for (QString const &ext : extensions) {
+ deleteFiles << fileName.absoluteDir().absoluteFilePath(fileName.completeBaseName() + "." + ext);
+ }
}
if (count > 10) {
savesMsgLabel += "<li><i>... " + tr("%1 more").arg(count - 10) + "</i></li>";
}
- if (QMessageBox::question(this, tr("Confirm"), tr("Are you sure you want to remove the following %n save(s)?<br><ul>%1</ul><br>Removed saves will be sent to the Recycle Bin.", "", selectedIndexes.count())
- .arg(savesMsgLabel),
+ if (QMessageBox::question(this, tr("Confirm"),
+ tr("Are you sure you want to remove the following %n save(s)?<br><ul>%1</ul><br>Removed saves will be sent to the Recycle Bin.", "", selectedIndexes.count())
+ .arg(savesMsgLabel),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
shellDelete(deleteFiles, true); // recycle bin delete.
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 0cdea807..04e9f221 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -20,51 +20,82 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
-#include <QMainWindow>
-#include <QFileInfo>
-#include <QDir>
-#include <QTreeWidget>
-#include <QListWidgetItem>
-#include <QProcess>
-#include <QThread>
-#include <QProgressBar>
-#include <QTranslator>
-#include <QPluginLoader>
-#include "modlist.h"
-#include "pluginlist.h"
-#include "plugincontainer.h"
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <archive.h>
-#include "directoryrefresher.h"
-#include <imoinfo.h>
-#include "settings.h"
-#include "downloadmanager.h"
-#include "installationmanager.h"
-#include "selfupdater.h"
-#include "savegamegamebyro.h"
-#include "modlistsortproxy.h"
-#include "pluginlistsortproxy.h"
-#include "tutorialcontrol.h"
-#include "savegameinfowidgetgamebryo.h"
-#include "previewgenerator.h"
+#include "bsafolder.h"
#include "browserdialog.h"
+#include "delayedfilewriter.h"
+#include "errorcodes.h"
+#include "imoinfo.h"
#include "iuserinterface.h"
-#include <guessedvalue.h>
-#include <directoryentry.h>
-#include <delayedfilewriter.h>
+#include "modinfo.h"
+#include "modlistsortproxy.h"
+#include "tutorialcontrol.h"
+
+//Note the commented headers here can be replaced with forward references,
+//when I get round to cleaning up main.cpp
+struct Executable;
+class CategoryFactory;
+class LockedDialog;
+class OrganizerCore;
+#include "plugincontainer.h" //class PluginContainer;
+class PluginListSortProxy;
+#include "savegamegamebryo.h" //class SaveGameGamebryo;
+class SaveGameInfoWidget;
+namespace BSA { class Archive; }
+#include "iplugingame.h" //namespace MOBase { class IPluginGame; }
+namespace MOBase { class IPluginModPage; }
+namespace MOBase { class IPluginTool; }
+namespace MOShared { class DirectoryEntry; }
+
+#include <QByteArray>
+#include <QDir>
+#include <QFileInfo>
+#include <QFileSystemWatcher>
+#include <QList>
+#include <QMainWindow>
+#include <QObject>
+#include <QPersistentModelIndex>
+#include <QProcess>
+#include <QString>
+#include <QStringList>
+#include <QTime>
+#include <QTimer>
+#include <QVariant>
+#include <Qt>
+
+class QAction;
+class QAbstractItemModel;
+class QDateTime;
+class QEvent;
+class QFile;
+class QListWidgetItem;
+class QMenu;
+class QModelIndex;
+class QPoint;
+class QProgressBar;
+class QProgressDialog;
+class QTranslator;
+class QTreeWidgetItem;
+class QUrl;
+class QSettings;
+class QWidget;
+
#ifndef Q_MOC_RUN
#include <boost/signals2.hpp>
#endif
+//Sigh - just for HANDLE
+#define WIN32_LEAN_AND_MEAN
+#include <Windows.h>
+
+#include <functional>
+#include <set>
+#include <string>
+#include <vector>
+
namespace Ui {
class MainWindow;
}
-class LockedDialog;
-class QToolButton;
-class ModListSortProxy;
-class ModListGroupCategoriesProxy;
class MainWindow : public QMainWindow, public IUserInterface
diff --git a/src/organizer.pro b/src/organizer.pro
index 1284aa40..eed4190d 100644
--- a/src/organizer.pro
+++ b/src/organizer.pro
@@ -109,7 +109,6 @@ HEADERS += \
selectiondialog.h \
savegameinfowidgetgamebryo.h \
savegameinfowidget.h \
- savegamegamebyro.h \
savegame.h \
queryoverwritedialog.h \
profilesdialog.h \
@@ -175,7 +174,8 @@ HEADERS += \
modinforegular.h \
modinfobackup.h \
modinfooverwrite.h \
- modinfoforeign.h
+ modinfoforeign.h \
+ savegamegamebryo.h
FORMS += \
transfersavesdialog.ui \
diff --git a/src/savegame.cpp b/src/savegame.cpp
index 2b125575..41120a88 100644
--- a/src/savegame.cpp
+++ b/src/savegame.cpp
@@ -19,20 +19,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "savegame.h"
-#include "iplugingame.h"
-#include "scriptextender.h"
-#include "utility.h"
-
-#include <QApplication>
-#include <QDateTime>
-#include <QFile>
-#include <QFileInfo>
-
-#include <limits>
-#include <set>
-
-using namespace MOBase;
-
SaveGame::SaveGame(QObject *parent, const QString &filename, const MOBase::IPluginGame *game)
: QObject(parent)
, m_FileName(filename)
@@ -43,27 +29,3 @@ SaveGame::SaveGame(QObject *parent, const QString &filename, const MOBase::IPlug
SaveGame::~SaveGame()
{
}
-
-QStringList SaveGame::attachedFiles() const
-{
- QStringList result;
- ScriptExtender const *extender = m_Game->feature<ScriptExtender>();
- if (extender != nullptr) {
- for (QString const &ext : extender->saveGameAttachmentExtensions()) {
- QFileInfo fi(fileName());
- fi.setFile(fi.canonicalPath() + "/" + fi.completeBaseName() + "." + ext);
- if (fi.exists()) {
- result.append(fi.filePath());
- }
- }
- }
-
- return result;
-}
-
-QStringList SaveGame::saveFiles() const
-{
- QStringList result = attachedFiles();
- result.append(fileName());
- return result;
-}
diff --git a/src/savegame.h b/src/savegame.h
index d1bf4691..3afb2faa 100644
--- a/src/savegame.h
+++ b/src/savegame.h
@@ -24,10 +24,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QString>
#include <QObject>
#include <QImage>
-#include <QMetaType>
-#include <QFile>
-#include <QStringList>
+//Sigh - for SYSTEMTIME
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
@@ -64,16 +62,6 @@ public:
const QString &fileName() const { return m_FileName; }
/**
- * @return a list of additional files that belong to this savegame
- */
- virtual QStringList attachedFiles() const;
-
- /**
- * @return a list of all files that belong to this savegame
- */
- virtual QStringList saveFiles() const;
-
- /**
* @return name of the player character
**/
const QString &pcName() const { return m_PCName; }
diff --git a/src/savegamegamebryo.cpp b/src/savegamegamebryo.cpp
index 68ed30af..153be4b0 100644
--- a/src/savegamegamebryo.cpp
+++ b/src/savegamegamebryo.cpp
@@ -17,7 +17,7 @@ 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 "savegamegamebryo.h"
#include "isavegame.h"
#include "savegameinfo.h"
diff --git a/src/savegamegamebyro.h b/src/savegamegamebryo.h
index bce08018..834cf8dd 100644
--- a/src/savegamegamebyro.h
+++ b/src/savegamegamebryo.h
@@ -1,77 +1,78 @@
-/*
-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
- **/
- int 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
- MOBase::ISaveGame const *m_Save;
-
-};
-
-#endif // SAVEGAMEGAMEBRYO_H
+/*
+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>
+#include <QStringList>
+
+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
+ **/
+ int 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
+ MOBase::ISaveGame const *m_Save;
+
+};
+
+#endif // SAVEGAMEGAMEBRYO_H
diff --git a/src/savegameinfowidgetgamebryo.cpp b/src/savegameinfowidgetgamebryo.cpp
index c97e5810..d92025c2 100644
--- a/src/savegameinfowidgetgamebryo.cpp
+++ b/src/savegameinfowidgetgamebryo.cpp
@@ -17,7 +17,7 @@ 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 "savegamegamebryo.h"
#include "savegameinfowidgetgamebryo.h"
#include <QLabel>
#include <QVBoxLayout>