Limo
A simple mod manager
Loading...
Searching...
No Matches
applicationmanager.h
Go to the documentation of this file.
1
5
6#pragma once
7
12#include "../core/log.h"
14#include "../core/nexus/api.h"
15#include "../core/parseerror.h"
16#include <QDebug>
17#include <QObject>
18#include <QStandardPaths>
19#include <filesystem>
20
21
33class ApplicationManager : public QObject
34{
35 Q_OBJECT
36public:
42 explicit ApplicationManager(QObject* parent = nullptr);
44 virtual ~ApplicationManager();
45
50 void init();
56 void sendLogMessage(Log::LogLevel log_level, const std::string& message);
61 std::string toString() const;
63 int getNumApplications() const;
69 int getNumProfiles(int app_id) const;
74 void enableExceptions(bool enabled);
75
76private:
85 template<auto f, typename... Args>
86 bool handleExceptions(int app_id, Args&&... args)
87 {
88 std::string message;
89 bool has_thrown = false;
90 try
91 {
92 (this->apps_[app_id].*f)(std::forward<Args>(args)...);
93 }
94 catch(Json::RuntimeError& error)
95 {
96 has_thrown = true;
97 message = error.what();
99 throw error;
100 }
101 catch(Json::LogicError& error)
102 {
103 has_thrown = true;
104
105 message = error.what();
107 throw error;
108 }
109 catch(ParseError& error)
110 {
111 has_thrown = true;
112 message = error.what();
114 throw error;
115 }
116 catch(std::ios_base::failure& error)
117 {
118 has_thrown = true;
119 message = error.what();
121 throw error;
122 }
123 catch(CompressionError& error)
124 {
125 has_thrown = true;
126 message = error.what();
128 throw error;
129 }
130 catch(std::runtime_error& error)
131 {
132 has_thrown = true;
133 message = error.what();
135 throw error;
136 }
137 catch(std::invalid_argument& error)
138 {
139 has_thrown = true;
140 message = error.what();
142 throw error;
143 }
144 catch(...)
145 {
146 has_thrown = true;
147 message = "An unexpected error occured!";
149 throw std::runtime_error("An unexpected error occured!");
150 }
151
152 if(has_thrown)
153 emit sendError("Error", message.c_str());
154 return has_thrown;
155 }
156
166 template<typename Func, typename Obj, typename... Args>
167 auto handleExceptions(Func&& f, Obj&& obj, Args&&... args)
168 -> std::optional<decltype((obj.*f)(std::forward<Args>(args)...))>
169 {
170 decltype((obj.*f)(std::forward<Args>(args)...)) ret_value;
171 std::string message;
172 bool has_thrown = false;
173 try
174 {
175 ret_value = (obj.*f)(std::forward<Args>(args)...);
176 }
177 catch(Json::RuntimeError& error)
178 {
179 has_thrown = true;
180 message = error.what();
182 throw error;
183 }
184 catch(Json::LogicError& error)
185 {
186 has_thrown = true;
187
188 message = error.what();
190 throw error;
191 }
192 catch(ParseError& error)
193 {
194 has_thrown = true;
195 message = error.what();
197 throw error;
198 }
199 catch(std::ios_base::failure& error)
200 {
201 has_thrown = true;
202 message = error.what();
204 throw error;
205 }
206 catch(CompressionError& error)
207 {
208 has_thrown = true;
209 message = error.what();
211 throw error;
212 }
213 catch(std::runtime_error& error)
214 {
215 has_thrown = true;
216 message = error.what();
218 throw error;
219 }
220 catch(std::invalid_argument& error)
221 {
222 has_thrown = true;
223 message = error.what();
225 throw error;
226 }
227 catch(...)
228 {
229 has_thrown = true;
230 message = "An unexpected error occured!";
232 throw std::runtime_error("An unexpected error occured!");
233 }
234
235 if(has_thrown)
236 {
237 emit sendError("Error", message.c_str());
238 return {};
239 }
240 return ret_value;
241 }
242
244 std::vector<ModdedApplication> apps_;
246 bool throw_exceptions_ = false;
247
251 void updateSettings();
255 void updateState();
263 bool appIndexIsValid(int app_id, bool show_error = true);
273 bool deployerIndexIsValid(int app_id, int deployer, bool show_error = true);
280 void handleAddAppError(int code, std::filesystem::path staging_dir);
289 void handleAddDeployerError(int code,
290 std::filesystem::path staging_dir,
291 std::filesystem::path dest_dir,
292 const std::string& error_message);
298 void handleParseError(std::string path, std::string message);
303 void sendUpdateProgress(float progress);
304
306 inline static int number_of_instances_ = 0;
307
308private:
314 void sendLogMessage(Log::LogLevel level, QString message);
315
316signals:
322 void sendDeployerNames(QStringList names, bool is_new);
327 void sendModInfo(std::vector<ModInfo> mod_info);
332 void sendLoadorder(std::vector<std::tuple<int, bool>> loadorder);
345 void sendApplicationNames(QStringList names, QStringList icon_paths, bool is_new);
350 void completedOperations(QString message = "");
356 void sendFileConflicts(std::vector<ConflictInfo> conflicts);
361 void sendAppInfo(AppInfo app_info);
367 void sendModConflicts(std::unordered_set<int> conflicts);
373 void sendProfileNames(QStringList names, bool is_new);
379 void sendError(QString title, QString message);
391 void extractionComplete(int app_id,
392 int mod_id,
393 bool success,
394 QString extracted_path,
395 QString local_source,
396 QString remote_source,
397 QString version,
398 QString name);
404 void logMessage(Log::LogLevel log_level, QString message);
410 void sendBackupTargets(std::vector<BackupTarget> targets);
417 void updateProgress(float progress);
424 void sendNexusPage(int app_id, int mod_id, nexus::Page page);
433 void downloadComplete(int app_id, int mod_id, QString file_path, QString mod_url);
440 void modInstallationComplete(bool success);
448 void sendExternalChangesInfo(int app_id, ExternalChangesInfo info, int num_deployers, bool deploy);
457 void externalChangesHandled(int app_id, int deployer, int num_deployers, bool deploy);
458
459public slots:
472 void removeApplication(int app_id, bool cleanup);
478 void deployMods(int app_id);
484 void deployModsFor(int app_id, std::vector<int> deployer_ids);
490 void unDeployMods(int app_id);
496 void unDeployModsFor(int app_id, std::vector<int> deployer_ids);
503 void installMod(int app_id, AddModInfo info);
513 void uninstallMods(int app_id, std::vector<int> mod_ids, std::string installer_type);
522 void changeLoadorder(int app_id, int deployer, int from_idx, int to_idx);
530 void updateModDeployers(int app_id, std::vector<int> mod_ids, std::vector<bool>);
538 void removeModFromDeployer(int app_id, int deployer, int mod_id);
547 void setModStatus(int app_id, int deployer, int mod_id, bool status);
553 void addDeployer(int app_id, EditDeployerInfo info);
560 void removeDeployer(int app_id, int deployer, bool cleanup);
567 void getDeployerNames(int app_id, bool is_new);
573 void getModInfo(int app_id);
580 void getDeployerInfo(int app_id, int deployer);
586 void getApplicationNames(bool is_new);
593 void changeModName(int app_id, int mod_id, QString new_name);
602 void getFileConflicts(int app_id, int deployer, int mod_id, bool show_disabled);
608 void getAppInfo(int app_id);
614 void addTool(int app_id, Tool tool);
620 void removeTool(int app_id, int tool_id);
627 void editApplication(EditApplicationInfo info, int app_id);
635 void editDeployer(EditDeployerInfo info, int app_id, int deployer);
644 void getModConflicts(int app_id, int deployer, int mod_id);
650 void setProfile(int app_id, int profile);
657 void addProfile(int app_id, EditProfileInfo info);
663 void removeProfile(int app_id, int profile);
669 void getProfileNames(int app_id, bool is_new);
676 void editProfile(int app_id, int profile, EditProfileInfo info);
684 void editTool(int app_id, int tool_id, Tool new_tool);
691 void addModToGroup(int app_id, int mod_id, int group);
697 void removeModFromGroup(int app_id, int mod_id);
706 void createGroup(int app_id, int first_mod_id, int second_mod_id);
714 void changeActiveGroupMember(int app_id, int group, int mod_id);
722 void changeModVersion(int app_id, int mod_id, QString new_version);
728 void sortModsByConflicts(int app_id, int deployer);
739 void extractArchive(int app_id,
740 int mod_id,
741 QString source,
742 QString target,
743 QString remote_source,
744 QString version,
745 QString name);
755 void addBackupTarget(int app_id,
756 QString path,
757 QString name,
758 QString default_backup,
759 QString first_backup);
766 void removeBackupTarget(int app_id, int target_id);
776 void addBackup(int app_id, int target_id, QString name, int source);
783 void removeBackup(int app_id, int target_id, int backup_id);
791 void setActiveBackup(int app_id, int target_id, int backup_id);
797 void getBackupTargets(int app_id);
806 void setBackupName(int app_id, int target_id, int backup_id, QString name);
814 void setBackupTargetName(int app_id, int target_id, QString name);
823 void overwriteBackup(int app_id, int target_id, int source_backup, int dest_backup);
825 void onScrollLists();
832 void uninstallGroupMembers(int app_id, const std::vector<int>& mod_ids);
840 void addManualTag(int app_id, QString tag_name);
846 void removeManualTag(int app_id, QString tag_name);
855 void changeManualTagName(int app_id, QString old_name, QString new_name);
862 void addTagsToMods(int app_id, QStringList tag_names, const std::vector<int>& mod_ids);
869 void removeTagsFromMods(int app_id, QStringList tag_names, const std::vector<int>& mod_ids);
876 void setTagsForMods(int app_id, QStringList tag_names, const std::vector<int>& mod_ids);
882 void editManualTags(int app_id, std::vector<EditManualTagAction> actions);
888 void editAutoTags(int app_id, std::vector<EditAutoTagAction> actions);
893 void reapplyAutoTags(int app_id);
899 void updateAutoTags(int app_id, std::vector<int> mod_ids);
907 void editModSources(int app_id, int mod_id, QString local_source, QString remote_source);
913 void getNexusPage(int app_id, int mod_id);
920 void downloadMod(int app_id, QString nxm_url);
930 void downloadModFile(int app_id, int mod_id, int nexus_file_id, QString mod_url);
935 void checkForModUpdates(int app_id);
941 void checkModsForUpdates(int app_id, const std::vector<int>& mod_ids);
947 void suppressUpdateNotification(int app_id, const std::vector<int>& mod_ids);
955 void getExternalChanges(int app_id, int deployer, bool deploy);
969 int app_id,
970 int deployer,
971 const FileChangeChoices& changes_to_keep,
972 bool deploy);
980 void exportAppConfiguration(int app_id, std::vector<int> deployers, QStringList auto_tags);
986 void updateIgnoredFiles(int app_id, int deployer);
993 void addModToIgnoreList(int app_id, int deployer, int mod_id);
1001 void applyModAction(int app_id, int deployer, int action, int mod_id);
1002};
Header for the nexus::Api class.
void addManualTag(int app_id, QString tag_name)
Adds a new tag with the given name to the given ModdedApplication. Fails if a tag by that name alread...
Definition applicationmanager.cpp:731
void extractArchive(int app_id, int mod_id, QString source, QString target, QString remote_source, QString version, QString name)
Extracts the given archive to the given location.
Definition applicationmanager.cpp:628
virtual ~ApplicationManager()
Decreases the static number of instances counter.
Definition applicationmanager.cpp:23
void sendLogMessage(Log::LogLevel log_level, const std::string &message)
Sends a log message to the logging window.
Definition applicationmanager.cpp:33
void getModConflicts(int app_id, int deployer, int mod_id)
Checks for conflicts with other mods for one Deployer of one application. Two mods are conflicting if...
Definition applicationmanager.cpp:529
bool throw_exceptions_
If true: Do not catch exceptions.
Definition applicationmanager.h:246
void getExternalChanges(int app_id, int deployer, bool deploy)
Checks if files deployed by the given app by the given deployer have been externally overwritten.
Definition applicationmanager.cpp:925
void setBackupName(int app_id, int target_id, int backup_id, QString name)
Changes the name of the given backup for the given target for the given ModdedApplication.
Definition applicationmanager.cpp:694
void setActiveBackup(int app_id, int target_id, int backup_id)
Changes the currently active backup for the given target for the given ModdedApplication.
Definition applicationmanager.cpp:681
void addModToIgnoreList(int app_id, int deployer, int mod_id)
Adds the given mod to the ignore list of the given ReverseDeployer.
Definition applicationmanager.cpp:977
void removeBackupTarget(int app_id, int target_id)
Removes the given backup target from the given ModdedApplication by deleting all relevant backups and...
Definition applicationmanager.cpp:660
void deployMods(int app_id)
Deploys mods using all Deployer objects of one application.
Definition applicationmanager.cpp:299
void changeLoadorder(int app_id, int deployer, int from_idx, int to_idx)
Moves a mod from one position in the load order to another for given Deployer for given application.
Definition applicationmanager.cpp:374
void keepOrRevertFileModifications(int app_id, int deployer, const FileChangeChoices &changes_to_keep, bool deploy)
Keeps or reverts external changes for one app for one deployer. For every given file: Moves the modif...
Definition applicationmanager.cpp:940
void scrollLists()
Used to synchronize scrolling in lists with the event queue.
void installMod(int app_id, AddModInfo info)
Installs a new mod for one application using the given Installer type.
Definition applicationmanager.cpp:353
void modInstallationComplete(bool success)
Signals mod installation has been completed.
auto handleExceptions(Func &&f, Obj &&obj, Args &&... args) -> std::optional< decltype((obj.*f)(std::forward< Args >(args)...))>
Wrapper for class member functions. Catches specific exception types and sends an error message to th...
Definition applicationmanager.h:167
void addModToGroup(int app_id, int mod_id, int group)
Adds a mod to an existing group of an application.
Definition applicationmanager.cpp:582
void editApplication(EditApplicationInfo info, int app_id)
Edits an application and optionally moves all of it's mods to a new directory.
Definition applicationmanager.cpp:507
void addDeployer(int app_id, EditDeployerInfo info)
Adds a new Deployer of given type to given application.
Definition applicationmanager.cpp:403
void sortModsByConflicts(int app_id, int deployer)
Sorts the load order by grouping mods which contain conflicting files.
Definition applicationmanager.cpp:621
void addProfile(int app_id, EditProfileInfo info)
Adds a new profile to one application and optionally copies it's load order from an existing profile.
Definition applicationmanager.cpp:547
void updateSettings()
Updates the settings file with the current state of this object.
Definition applicationmanager.cpp:71
void getApplicationNames(bool is_new)
Emits sendApplicationNames.
Definition applicationmanager.cpp:455
void removeManualTag(int app_id, QString tag_name)
Removes the tag with the given name, if it exists, from the given ModdedApplication.
Definition applicationmanager.cpp:737
static int number_of_instances_
Counter for the number of instances of this class.
Definition applicationmanager.h:306
void removeProfile(int app_id, int profile)
Removes a profile from an application.
Definition applicationmanager.cpp:553
void sendProfileNames(QStringList names, bool is_new)
Sends a list of all profile names for one application.
void checkModsForUpdates(int app_id, const std::vector< int > &mod_ids)
Checks for available updates for the given mod for the given app.
Definition applicationmanager.cpp:911
void editDeployer(EditDeployerInfo info, int app_id, int deployer)
Used to set type, name and target directory for one deployer of one application.
Definition applicationmanager.cpp:523
void logMessage(Log::LogLevel log_level, QString message)
Sends a log message to the logging window.
void removeModFromGroup(int app_id, int mod_id)
Removes a mod from it's group for one application.
Definition applicationmanager.cpp:590
void getFileConflicts(int app_id, int deployer, int mod_id, bool show_disabled)
Checks for file conflicts of given mod with all other mods in the load order for one Deployer of one ...
Definition applicationmanager.cpp:473
void sendDeployerNames(QStringList names, bool is_new)
Sends the names of all deployers.
void uninstallGroupMembers(int app_id, const std::vector< int > &mod_ids)
Uninstalls all mods which are inactive group members of any group which contains any of the given mod...
Definition applicationmanager.cpp:724
void removeApplication(int app_id, bool cleanup)
Removes an application and optionally deletes all installed mods and the settings file in the applica...
Definition applicationmanager.cpp:289
void changeActiveGroupMember(int app_id, int group, int mod_id)
Changes the active member of given group of an application to given mod.
Definition applicationmanager.cpp:606
void enableExceptions(bool enabled)
Enable or disable throwing exceptions.
Definition applicationmanager.cpp:66
void updateProgress(float progress)
Informs about the progress in the current task.
void checkForModUpdates(int app_id)
Checks for available mod updates on NexusMods.
Definition applicationmanager.cpp:904
void getNexusPage(int app_id, int mod_id)
Fetches data for the given mod from NexusMods.
Definition applicationmanager.cpp:826
void createGroup(int app_id, int first_mod_id, int second_mod_id)
Creates a new group containing the two given mods for one application. A group is a set of mods where...
Definition applicationmanager.cpp:598
void downloadModFile(int app_id, int mod_id, int nexus_file_id, QString mod_url)
Downloads the file with the given id for the given mod url from nexusmods.
Definition applicationmanager.cpp:874
void changeModName(int app_id, int mod_id, QString new_name)
Setter for a mod name.
Definition applicationmanager.cpp:467
bool handleExceptions(int app_id, Args &&... args)
Wrapper for member functions of ModdedApplication. Calls the function specified in the template for t...
Definition applicationmanager.h:86
void reapplyAutoTags(int app_id)
Reapplies all auto tags for all mods for the given ModdedApplication.
Definition applicationmanager.cpp:802
void init()
If a JSON file with settings already exists for this user: Restores the internal state from that file...
Definition applicationmanager.cpp:28
bool appIndexIsValid(int app_id, bool show_error=true)
Checks if given app_id is part of apps_ and optionally emits an error signal.
Definition applicationmanager.cpp:158
void extractionComplete(int app_id, int mod_id, bool success, QString extracted_path, QString local_source, QString remote_source, QString version, QString name)
Emitted after archive extraction is complete.
void setBackupTargetName(int app_id, int target_id, QString name)
Changes the name of the given backup target for the given ModdedApplication.
Definition applicationmanager.cpp:701
void getBackupTargets(int app_id)
Returns a vector containing information about all managed backup targets of given ModdedApplication....
Definition applicationmanager.cpp:688
void addBackup(int app_id, int target_id, QString name, int source)
Adds a new backup for the given target for the given ModdedApplication by copying the currently activ...
Definition applicationmanager.cpp:667
void addTagsToMods(int app_id, QStringList tag_names, const std::vector< int > &mod_ids)
Adds the given tag to all given mods for the given ModdedApplication.
Definition applicationmanager.cpp:750
void sendModInfo(std::vector< ModInfo > mod_info)
Sends ModInfo for one application.
void addTool(int app_id, Tool tool)
Adds a new tool to given application.
Definition applicationmanager.cpp:495
void unDeployMods(int app_id)
Undeploys mods using all Deployer objects of one application.
Definition applicationmanager.cpp:339
void downloadMod(int app_id, QString nxm_url)
Downloads a mod from nexusmods using the given nxm_url.
Definition applicationmanager.cpp:837
void sendFileConflicts(std::vector< ConflictInfo > conflicts)
Sends file conflicts for one mod for one deployer of one application.
void getProfileNames(int app_id, bool is_new)
Creates a vector containing the names of all profiles of one application. Emits sendProfileNames.
Definition applicationmanager.cpp:559
void completedOperations(QString message="")
Emitted after potentially slow operations, e.g. installing a mod, are completed.
void applyModAction(int app_id, int deployer, int action, int mod_id)
Applies the given mod action to the given mod.
Definition applicationmanager.cpp:983
void onScrollLists()
Used to synchronize scrolling in lists with the event queue.
Definition applicationmanager.cpp:719
void overwriteBackup(int app_id, int target_id, int source_backup, int dest_backup)
Deletes all files in the dest backup and replaces them with the files from the source backup for the ...
Definition applicationmanager.cpp:708
void sendLoadorder(std::vector< std::tuple< int, bool > > loadorder)
Sends the load order for one deployer of one application.
void sendNexusPage(int app_id, int mod_id, nexus::Page page)
Sends NexusMods data for a specific mod.
void getDeployerNames(int app_id, bool is_new)
Creates a vector containing the names of all Deployer objects for one application....
Definition applicationmanager.cpp:416
void getDeployerInfo(int app_id, int deployer)
Creates DeployerInfo for one Deployer for one application. Emits sendDeployerInfo.
Definition applicationmanager.cpp:441
void sendUpdateProgress(float progress)
Informs about the progress in the current task by emitting updateProgress.
Definition applicationmanager.cpp:219
void removeModFromDeployer(int app_id, int deployer, int mod_id)
Removes a mod from the load order for given Deployer for given application.
Definition applicationmanager.cpp:389
void exportAppConfiguration(int app_id, std::vector< int > deployers, QStringList auto_tags)
Exports configurations for the given deployers and the given auto tags to a json file....
Definition applicationmanager.cpp:958
void editTool(int app_id, int tool_id, Tool new_tool)
Used to replace an existing to with a now one for a application.
Definition applicationmanager.cpp:576
void sendExternalChangesInfo(int app_id, ExternalChangesInfo info, int num_deployers, bool deploy)
Sends data about externally modified files for one app for one deployer.
void downloadComplete(int app_id, int mod_id, QString file_path, QString mod_url)
Signals successful completion of a mod download.
void sendError(QString title, QString message)
Sends an error message.
ApplicationManager(QObject *parent=nullptr)
Constructor. Only one instance of this class is support at a time.
Definition applicationmanager.cpp:14
void setTagsForMods(int app_id, QStringList tag_names, const std::vector< int > &mod_ids)
Sets the tags for all given mods to the given tags for the given ModdedApplication.
Definition applicationmanager.cpp:776
void removeBackup(int app_id, int target_id, int backup_id)
Deletes the given backup for given target for given ModdedApplication.
Definition applicationmanager.cpp:674
void removeTool(int app_id, int tool_id)
Removes a tool from given application.
Definition applicationmanager.cpp:501
void deployModsFor(int app_id, std::vector< int > deployer_ids)
Deploys mods for given deployers and given application.
Definition applicationmanager.cpp:315
void removeDeployer(int app_id, int deployer, bool cleanup)
Removes a Deployer from an application.
Definition applicationmanager.cpp:410
void editManualTags(int app_id, std::vector< EditManualTagAction > actions)
Performes the given tag editing actions for the given ModdedApplication.
Definition applicationmanager.cpp:789
std::vector< ModdedApplication > apps_
Contains every ModdedApplication handled by this object.
Definition applicationmanager.h:244
void sendModConflicts(std::unordered_set< int > conflicts)
Sends mod conflicts for one mod for one deployer of one application.
void updateAutoTags(int app_id, std::vector< int > mod_ids)
Reapplies all auto tags to the given mods for the given ModdedApplication.
Definition applicationmanager.cpp:809
void unDeployModsFor(int app_id, std::vector< int > deployer_ids)
Undeploys mods for given deployers and given application.
Definition applicationmanager.cpp:346
int getNumApplications() const
Returns the number of managed \ModdedApplication "applications".
Definition applicationmanager.cpp:54
void handleParseError(std::string path, std::string message)
Emits an error message indicating a parsing error using sendError.
Definition applicationmanager.cpp:209
void updateState()
Updates the internal state of this object to the state stored in the settings file.
Definition applicationmanager.cpp:83
void handleAddDeployerError(int code, std::filesystem::path staging_dir, std::filesystem::path dest_dir, const std::string &error_message)
If the code indicates an error: Create an error message and emit it using sendError.
Definition applicationmanager.cpp:187
void changeModVersion(int app_id, int mod_id, QString new_version)
Sets the given mod's version to the given new version for one application.
Definition applicationmanager.cpp:614
void addApplication(EditApplicationInfo info)
Adds a new application.
Definition applicationmanager.cpp:229
void addBackupTarget(int app_id, QString path, QString name, QString default_backup, QString first_backup)
Adds a new target file or directory to be managed by the BackupManager of given ModdedApplication.
Definition applicationmanager.cpp:643
void getModInfo(int app_id)
Creates a vector containing information about all installed mods, stored in ModInfo objects for one a...
Definition applicationmanager.cpp:427
void sendDeployerInfo(DeployerInfo depl_info)
Sends DeployerInfo for one deployer of one application.
void suppressUpdateNotification(int app_id, const std::vector< int > &mod_ids)
Temporarily disables update notifications for the given mods.
Definition applicationmanager.cpp:918
void removeTagsFromMods(int app_id, QStringList tag_names, const std::vector< int > &mod_ids)
Removes the given tag from the given mods for the given ModdedApplication.
Definition applicationmanager.cpp:763
void sendApplicationNames(QStringList names, QStringList icon_paths, bool is_new)
Sends a list containing all application names.
void setModStatus(int app_id, int deployer, int mod_id, bool status)
Enables or disables the given mod in the load order for given Deployer for given application.
Definition applicationmanager.cpp:397
void editModSources(int app_id, int mod_id, QString local_source, QString remote_source)
Sets a mods local and remote source to the given values for the given ModdedApplication.
Definition applicationmanager.cpp:816
void handleAddAppError(int code, std::filesystem::path staging_dir)
If the code indicates an error: Create an error message and emit it using sendError.
Definition applicationmanager.cpp:176
int getNumProfiles(int app_id) const
Returns the number of profiles for one application.
Definition applicationmanager.cpp:59
bool deployerIndexIsValid(int app_id, int deployer, bool show_error=true)
Checks if given deployer id is valid for given app and optionally emits an error signal.
Definition applicationmanager.cpp:167
void sendBackupTargets(std::vector< BackupTarget > targets)
Sends a vector containing info about all backup targets managed by given ModdedApplication.
void editProfile(int app_id, int profile, EditProfileInfo info)
Used to set the name of a profile for one application.
Definition applicationmanager.cpp:570
void changeManualTagName(int app_id, QString old_name, QString new_name)
Changes the name of the given tag to the given new name for the given ModdedApplication....
Definition applicationmanager.cpp:743
void updateIgnoredFiles(int app_id, int deployer)
Updates the file ignore list for ReverseDeployers.
Definition applicationmanager.cpp:970
void downloadFailed()
Signals a failed download.
void setProfile(int app_id, int profile)
Sets the currently active profile for given application.
Definition applicationmanager.cpp:541
void updateModDeployers(int app_id, std::vector< int > mod_ids, std::vector< bool >)
Updates which deployer should manage given mods.
Definition applicationmanager.cpp:380
std::string toString() const
Generates a string which contains the ids and names of every application as well as their profiles.
Definition applicationmanager.cpp:38
void externalChangesHandled(int app_id, int deployer, int num_deployers, bool deploy)
Signals that external changes to files for given app for given deployer have been handled.
void uninstallMods(int app_id, std::vector< int > mod_ids, std::string installer_type)
Uninstalls the given mods for one application, this includes deleting all installed files.
Definition applicationmanager.cpp:365
void sendAppInfo(AppInfo app_info)
Sends AppInfo for one application.
void getAppInfo(int app_id)
Creates AppInfo for given application. Emits sendAppInfo.
Definition applicationmanager.cpp:485
void editAutoTags(int app_id, std::vector< EditAutoTagAction > actions)
Performes the given tag editing actions for the given ModdedApplication.
Definition applicationmanager.cpp:795
Exception used for errors during archive extraction.
Definition compressionerror.h:13
Exception indicating an error while parsing a JSON file.
Definition parseerror.h:15
Represents a third party tool to be run from within Limo.
Definition tool.h:17
Contains the CompressionError class.
Contains the EditApplicationInfo struct.
Header for the EditAutoTagAction class.
Header for the EditManualTagAction class.
Header for the Log namespace.
char path[256]
Path to which to extract the file.
Definition lspakfilelistentry.h:1
uint32_t version
Archive format version.
Definition lspakheader.h:3
Header for the ModdedApplication class.
LogLevel
Represents the importance of a log message.
Definition log.h:19
Contains the ParseError class.
Stores data needed to install a new mod.
Definition addmodinfo.h:17
Stores information about a ModdedApplication.
Definition appinfo.h:20
Stores a deployer's installed mods and load order.
Definition deployerinfo.h:17
Stores data needed to either create a new or edit an existing application.
Definition editapplicationinfo.h:19
Stores data needed to either create a new or edit an existing deployer.
Definition editdeployerinfo.h:17
Stores data needed to either create a new or edit an existing profile of a application.
Definition editprofileinfo.h:16
Contains data regarding externally modified files for one deployer.
Definition externalchangesinfo.h:18
Contains data regarding which external file changes to keep.
Definition filechangechoices.h:16
Contains all data for a mod available through the NexusMods api.
Definition api.h:23