2011-04-07 22:04:09 +00:00
|
|
|
#ifndef DATAFILESPAGE_H
|
|
|
|
#define DATAFILESPAGE_H
|
|
|
|
|
2013-10-23 02:52:35 +00:00
|
|
|
#include "ui_datafilespage.h"
|
2021-08-01 21:35:45 +00:00
|
|
|
|
|
|
|
#include <components/process/processinvoker.hpp>
|
|
|
|
|
2013-11-03 05:02:46 +00:00
|
|
|
#include <QDir>
|
2018-05-23 01:50:31 +00:00
|
|
|
#include <QStringList>
|
2011-04-07 22:04:09 +00:00
|
|
|
#include <QWidget>
|
2013-11-03 05:02:46 +00:00
|
|
|
|
2011-05-11 18:04:25 +00:00
|
|
|
class QSortFilterProxyModel;
|
2013-03-05 02:47:57 +00:00
|
|
|
class QAbstractItemModel;
|
2011-06-07 18:21:01 +00:00
|
|
|
class QMenu;
|
2013-02-11 14:01:00 +00:00
|
|
|
|
2012-01-21 00:14:35 +00:00
|
|
|
namespace Files
|
|
|
|
{
|
|
|
|
struct ConfigurationManager;
|
2013-10-07 02:13:47 +00:00
|
|
|
}
|
|
|
|
namespace ContentSelectorView
|
|
|
|
{
|
|
|
|
class ContentSelector;
|
2022-09-22 18:26:05 +00:00
|
|
|
}
|
2013-12-24 23:50:25 +00:00
|
|
|
namespace Config
|
|
|
|
{
|
|
|
|
class GameSettings;
|
|
|
|
class LauncherSettings;
|
|
|
|
}
|
2012-01-21 00:14:35 +00:00
|
|
|
|
2013-10-25 16:17:26 +00:00
|
|
|
namespace Launcher
|
2011-04-07 22:04:09 +00:00
|
|
|
{
|
2021-08-01 21:35:45 +00:00
|
|
|
class MainDialog;
|
2013-10-25 16:17:26 +00:00
|
|
|
class TextInputDialog;
|
|
|
|
class ProfilesComboBox;
|
2013-09-22 04:06:29 +00:00
|
|
|
|
2013-10-25 16:17:26 +00:00
|
|
|
class DataFilesPage : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-10-07 02:13:47 +00:00
|
|
|
|
2013-10-25 16:17:26 +00:00
|
|
|
ContentSelectorView::ContentSelector* mSelector;
|
|
|
|
Ui::DataFilesPage ui;
|
2013-10-23 02:52:35 +00:00
|
|
|
|
2013-10-25 16:17:26 +00:00
|
|
|
public:
|
2023-03-21 20:27:25 +00:00
|
|
|
explicit DataFilesPage(const Files::ConfigurationManager& cfg, Config::GameSettings& gameSettings,
|
2021-08-01 21:35:45 +00:00
|
|
|
Config::LauncherSettings& launcherSettings, MainDialog* parent = nullptr);
|
2011-04-07 22:04:09 +00:00
|
|
|
|
2013-10-25 16:17:26 +00:00
|
|
|
QAbstractItemModel* profilesModel() const;
|
2013-03-05 02:47:57 +00:00
|
|
|
|
2013-10-25 16:17:26 +00:00
|
|
|
int profilesIndex() const;
|
2013-02-11 14:01:00 +00:00
|
|
|
|
2013-10-25 16:17:26 +00:00
|
|
|
// void writeConfig(QString profile = QString());
|
|
|
|
void saveSettings(const QString& profile = "");
|
2014-04-16 22:01:19 +00:00
|
|
|
bool loadSettings();
|
|
|
|
|
2013-10-25 16:17:26 +00:00
|
|
|
signals:
|
|
|
|
void signalProfileChanged(int index);
|
2018-06-09 00:18:23 +00:00
|
|
|
void signalLoadedCellsChanged(QStringList selectedFiles);
|
2011-04-07 22:04:09 +00:00
|
|
|
|
2013-10-25 16:17:26 +00:00
|
|
|
public slots:
|
|
|
|
void slotProfileChanged(int index);
|
2013-03-05 02:47:57 +00:00
|
|
|
|
2013-10-25 16:17:26 +00:00
|
|
|
private slots:
|
2013-10-02 02:29:45 +00:00
|
|
|
|
2013-10-25 16:17:26 +00:00
|
|
|
void slotProfileChangedByUser(const QString& previous, const QString& current);
|
|
|
|
void slotProfileRenamed(const QString& previous, const QString& current);
|
|
|
|
void slotProfileDeleted(const QString& item);
|
2018-05-27 01:35:28 +00:00
|
|
|
void slotAddonDataChanged();
|
2020-03-21 19:35:20 +00:00
|
|
|
void slotRefreshButtonClicked();
|
2013-10-23 02:52:35 +00:00
|
|
|
|
2019-05-15 14:53:18 +00:00
|
|
|
void updateNewProfileOkButton(const QString& text);
|
|
|
|
void updateCloneProfileOkButton(const QString& text);
|
2020-04-26 13:31:39 +00:00
|
|
|
void addSubdirectories(bool append);
|
|
|
|
void sortDirectories();
|
|
|
|
void removeDirectory();
|
|
|
|
void moveArchive(int step);
|
|
|
|
void moveDirectory(int step);
|
2014-04-17 00:17:18 +00:00
|
|
|
|
2013-10-25 16:17:26 +00:00
|
|
|
void on_newProfileAction_triggered();
|
2019-05-15 14:53:18 +00:00
|
|
|
void on_cloneProfileAction_triggered();
|
2013-10-25 16:17:26 +00:00
|
|
|
void on_deleteProfileAction_triggered();
|
2012-10-10 20:58:04 +00:00
|
|
|
|
2021-08-01 21:35:45 +00:00
|
|
|
void startNavMeshTool();
|
|
|
|
void killNavMeshTool();
|
2021-12-19 21:49:41 +00:00
|
|
|
void readNavMeshToolStdout();
|
|
|
|
void readNavMeshToolStderr();
|
2021-08-01 21:35:45 +00:00
|
|
|
void navMeshToolFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
|
|
|
|
2015-02-05 23:24:06 +00:00
|
|
|
public:
|
2015-02-05 23:45:15 +00:00
|
|
|
/// Content List that is always present
|
2015-02-05 23:24:06 +00:00
|
|
|
const static char* mDefaultContentListName;
|
|
|
|
|
2013-10-25 16:17:26 +00:00
|
|
|
private:
|
2021-12-19 21:49:41 +00:00
|
|
|
struct NavMeshToolProgress
|
|
|
|
{
|
2023-01-27 18:09:00 +00:00
|
|
|
bool mEnabled = true;
|
2021-12-19 21:49:41 +00:00
|
|
|
QByteArray mLogData;
|
|
|
|
QByteArray mMessagesData;
|
|
|
|
std::map<std::uint64_t, std::string> mWorldspaces;
|
|
|
|
int mCellsCount = 0;
|
|
|
|
int mExpectedMaxProgress = 0;
|
|
|
|
};
|
2013-10-02 02:29:45 +00:00
|
|
|
|
2021-08-01 21:35:45 +00:00
|
|
|
MainDialog* mMainDialog;
|
2019-05-15 14:53:18 +00:00
|
|
|
TextInputDialog* mNewProfileDialog;
|
|
|
|
TextInputDialog* mCloneProfileDialog;
|
2012-02-22 07:34:47 +00:00
|
|
|
|
2023-03-21 20:27:25 +00:00
|
|
|
const Files::ConfigurationManager& mCfgMgr;
|
2012-02-22 07:34:47 +00:00
|
|
|
|
2013-12-24 23:50:25 +00:00
|
|
|
Config::GameSettings& mGameSettings;
|
|
|
|
Config::LauncherSettings& mLauncherSettings;
|
2012-01-21 00:14:35 +00:00
|
|
|
|
2014-12-10 20:47:04 +00:00
|
|
|
QString mPreviousProfile;
|
2018-05-27 01:35:28 +00:00
|
|
|
QStringList previousSelectedFiles;
|
2013-11-03 05:02:46 +00:00
|
|
|
QString mDataLocal;
|
2020-04-26 13:31:39 +00:00
|
|
|
QStringList mKnownArchives;
|
|
|
|
QStringList mNewDataDirs;
|
2013-11-03 05:02:46 +00:00
|
|
|
|
2021-08-01 21:35:45 +00:00
|
|
|
Process::ProcessInvoker* mNavMeshToolInvoker;
|
2021-12-19 21:49:41 +00:00
|
|
|
NavMeshToolProgress mNavMeshToolProgress;
|
2021-08-01 21:35:45 +00:00
|
|
|
|
2020-04-26 13:31:39 +00:00
|
|
|
void addArchive(const QString& name, Qt::CheckState selected, int row = -1);
|
|
|
|
void addArchivesFromDir(const QString& dir);
|
2013-10-25 16:17:26 +00:00
|
|
|
void buildView();
|
|
|
|
void setProfile(int index, bool savePrevious);
|
|
|
|
void setProfile(const QString& previous, const QString& current, bool savePrevious);
|
|
|
|
void removeProfile(const QString& profile);
|
|
|
|
bool showDeleteMessageBox(const QString& text);
|
|
|
|
void addProfile(const QString& profile, bool setAsCurrent);
|
|
|
|
void checkForDefaultProfile();
|
2015-01-26 05:46:18 +00:00
|
|
|
void populateFileViews(const QString& contentModelName);
|
2018-05-27 22:15:36 +00:00
|
|
|
void reloadCells(QStringList selectedFiles);
|
2020-03-21 19:35:20 +00:00
|
|
|
void refreshDataFilesView();
|
2021-12-19 21:49:41 +00:00
|
|
|
void updateNavMeshProgress(int minDataSize);
|
2020-04-26 13:31:39 +00:00
|
|
|
QString selectDirectory();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the file paths of all selected content files
|
|
|
|
* @return the file paths of all selected content files
|
|
|
|
*/
|
|
|
|
QStringList selectedFilePaths() const;
|
2023-03-20 22:24:29 +00:00
|
|
|
QStringList selectedArchivePaths() const;
|
2020-04-26 13:31:39 +00:00
|
|
|
QStringList selectedDirectoriesPaths() const;
|
2013-10-25 16:17:26 +00:00
|
|
|
};
|
|
|
|
}
|
2011-04-24 19:42:56 +00:00
|
|
|
#endif
|