diff options
| author | Mikaƫl Capelle <capelle.mikael@gmail.com> | 2021-01-10 10:25:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-10 10:25:37 +0100 |
| commit | 80e44a9e3ade61695b4807a3a900d2866138ecac (patch) | |
| tree | 1ef9904664d8d34dba6692bbf5325aea8c199d08 /src/mainwindow.h | |
| parent | eaec140f7c823012c09536175d8917dddcacdb7c (diff) | |
| parent | 4a0ce804ea486744e5f6140a0ce4538d99e21ce3 (diff) | |
Merge pull request #1338 from Holt59/collapsible-separators
Collapsible separators (and refactoring).
Diffstat (limited to 'src/mainwindow.h')
| -rw-r--r-- | src/mainwindow.h | 195 |
1 files changed, 13 insertions, 182 deletions
diff --git a/src/mainwindow.h b/src/mainwindow.h index f8910361..6ead7a77 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -26,6 +26,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include "imoinfo.h" #include "iuserinterface.h" #include "modinfo.h" +#include "modlistbypriorityproxy.h" #include "modlistsortproxy.h" #include "tutorialcontrol.h" #include "plugincontainer.h" //class PluginContainer; @@ -123,13 +124,8 @@ public: bool addProfile(); void updateBSAList(const QStringList &defaultArchives, const QStringList &activeArchives); - void setModListSorting(int index); - void setESPListSorting(int index); - void saveArchiveList(); - void addPrimaryCategoryCandidates(QMenu *primaryCategoryMenu, ModInfo::Ptr info); - void installTranslator(const QString &name); void displayModInformation( @@ -143,12 +139,7 @@ public: virtual MOBase::DelayedFileWriterBase &archivesWriter() override { return m_ArchiveListWriter; } - ModInfo::Ptr nextModInList(); - ModInfo::Ptr previousModInList(); - public slots: - void modorder_changed(); - void esplist_changed(); void refresherProgress(const DirectoryRefreshProgress* p); void directory_refreshed(); @@ -156,28 +147,21 @@ public slots: signals: /** - * @brief emitted after the information dialog has been closed - */ - void modInfoDisplayed(); - - /** * @brief emitted when the selected style changes */ void styleChanged(const QString &styleFile); - void modListDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); - void checkForProblemsDone(); protected: - virtual void showEvent(QShowEvent *event); - virtual void paintEvent(QPaintEvent* event); - virtual void closeEvent(QCloseEvent *event); - virtual bool eventFilter(QObject *obj, QEvent *event); - virtual void resizeEvent(QResizeEvent *event); - virtual void dragEnterEvent(QDragEnterEvent *event); - virtual void dropEvent(QDropEvent *event); + void showEvent(QShowEvent *event) override; + void paintEvent(QPaintEvent* event) override; + void closeEvent(QCloseEvent *event) override; + bool eventFilter(QObject *obj, QEvent *event) override; + void resizeEvent(QResizeEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; + void dropEvent(QDropEvent *event) override; void keyReleaseEvent(QKeyEvent *event) override; private slots: @@ -209,29 +193,8 @@ private: bool refreshProfiles(bool selectProfile = true); void refreshExecutablesList(); - void installMod(QString fileName = ""); bool modifyExecutablesDialog(int selection); - void displayModInformation(int row, ModInfoTabIDs tab=ModInfoTabIDs::None); - - /** - * Sets category selections from menu; for multiple mods, this will only apply - * the changes made in the menu (which is the delta between the current menu selection and the reference mod) - * @param menu the menu after editing by the user - * @param modRow index of the mod to edit - * @param referenceRow row of the reference mod - */ - void addRemoveCategoriesFromMenu(QMenu *menu, int modRow, int referenceRow); - - /** - * Sets category selections from menu; for multiple mods, this will completely - * replace the current set of categories on each selected with those selected in the menu - * @param menu the menu after editing by the user - * @param modRow index of the mod to edit - */ - void replaceCategoriesFromMenu(QMenu *menu, int modRow); - - bool populateMenuCategories(QMenu *menu, int targetID); // remove invalid category-references from mods void fixCategories(); @@ -245,24 +208,16 @@ private: bool errorReported(QString &logFile); - void updateESPLock(bool locked); - static void setupNetworkProxy(bool activate); void activateProxy(bool activate); bool createBackup(const QString &filePath, const QDateTime &time); QString queryRestore(const QString &filePath); - void initModListContextMenu(QMenu *menu); - void addModSendToContextMenu(QMenu *menu); - void addPluginSendToContextMenu(QMenu *menu); - QMenu *openFolderMenu(); void dropLocalFile(const QUrl &url, const QString &outputDir, bool move); - void sendSelectedModsToPriority(int newPriority); - void toggleMO2EndorseState(); void toggleUpdateAction(); @@ -285,7 +240,6 @@ private: MOBase::TutorialControl m_Tutorial; - std::unique_ptr<FilterList> m_Filters; std::unique_ptr<DataTab> m_DataTab; std::unique_ptr<DownloadsTab> m_DownloadsTab; std::unique_ptr<SavesTab> m_SavesTab; @@ -296,15 +250,8 @@ private: QStringList m_DefaultArchives; - ModListSortProxy *m_ModListSortProxy; - - PluginListSortProxy *m_PluginListSortProxy; - int m_OldExecutableIndex; - int m_ContextRow; - QPersistentModelIndex m_ContextIdx; - QTreeWidgetItem *m_ContextItem; QAction *m_ContextAction; CategoryFactory &m_CategoryFactory; @@ -327,8 +274,6 @@ private: QByteArray m_ArchiveListHash; - bool m_DidUpdateMasterList; - MOBase::DelayedFileWriter m_ArchiveListWriter; QAction* m_LinkToolbar; @@ -357,53 +302,10 @@ private slots: void wikiTriggered(); void discordTriggered(); void tutorialTriggered(); - void extractBSATriggered(); + void extractBSATriggered(QTreeWidgetItem* item); - //modlist shortcuts - void openExplorer_activated(); void refreshProfile_activated(); - // modlist context menu - void installMod_clicked(); - void createEmptyMod_clicked(); - void createSeparator_clicked(); - void restoreBackup_clicked(); - void renameMod_clicked(); - void removeMod_clicked(); - void setColor_clicked(); - void resetColor_clicked(); - void backupMod_clicked(); - void reinstallMod_clicked(); - void endorse_clicked(); - void dontendorse_clicked(); - void unendorse_clicked(); - void track_clicked(); - void untrack_clicked(); - void ignoreMissingData_clicked(); - void markConverted_clicked(); - void restoreHiddenFiles_clicked(); - void visitOnNexus_clicked(); - void visitWebPage_clicked(); - void visitNexusOrWebPage_clicked(); - void openExplorer_clicked(); - void openPluginOriginExplorer_clicked(); - void openOriginInformation_clicked(); - void information_clicked(); - void enableSelectedMods_clicked(); - void disableSelectedMods_clicked(); - void sendSelectedModsToTop_clicked(); - void sendSelectedModsToBottom_clicked(); - void sendSelectedModsToPriority_clicked(); - void sendSelectedModsToSeparator_clicked(); - // data-tree context menu - - // pluginlist context menu - void enableSelectedPlugins_clicked(); - void disableSelectedPlugins_clicked(); - void sendSelectedPluginsToTop_clicked(); - void sendSelectedPluginsToBottom_clicked(); - void sendSelectedPluginsToPriority_clicked(); - void linkToolbar(); void linkDesktop(); void linkMenu(); @@ -414,22 +316,7 @@ private slots: BSA::EErrorCode extractBSA(BSA::Archive &archive, BSA::Folder::Ptr folder, const QString &destination, QProgressDialog &extractProgress); - void createModFromOverwrite(); - /** - * @brief sends the content of the overwrite folder to an already existing mod - */ - void moveOverwriteContentToExistingMod(); - /** - * @brief actually sends the content of the overwrite folder to specified mod - */ - void doMoveOverwriteContentToMod(const QString &modAbsolutePath); - void clearOverwrite(); - // nexus related - void checkModsForUpdates(); - - void linkClicked(const QString &url); - void updateAvailable(); void actionEndorseMO(); @@ -439,15 +326,8 @@ private slots: void originModified(int originID); - void addRemoveCategories_MenuHandler(); - void replaceCategories_MenuHandler(); - - void addPrimaryCategoryCandidates(); - void modInstalled(const QString &modName); - void modUpdateCheck(std::multimap<QString, int> IDs); - void finishUpdateInfo(); void nxmEndorsementsAvailable(QVariant userData, QVariant resultData, int); @@ -461,32 +341,12 @@ private slots: void onRequestsChanged(const APIStats& stats, const APIUserAccount& user); - void deselectFilters(); - void refreshFilters(); - void onFiltersCriteria(const std::vector<ModListSortProxy::Criteria>& filters); - void onFiltersOptions( - ModListSortProxy::FilterMode mode, ModListSortProxy::SeparatorsMode sep); - - void displayModInformation(const QString &modName, ModInfoTabIDs tabID); - void visitNexusOrWebPage(const QModelIndex& idx); - void modRenamed(const QString &oldName, const QString &newName); void modRemoved(const QString &fileName); void hookUpWindowTutorials(); bool shouldStartTutorial() const; - void endorseMod(ModInfo::Ptr mod); - void unendorseMod(ModInfo::Ptr mod); - void trackMod(ModInfo::Ptr mod, bool doTrack); - void cancelModListEditor(); - - void lockESPIndex(); - void unlockESPIndex(); - - void enableVisibleMods(); - void disableVisibleMods(); - void exportModListCSV(); void openInstanceFolder(); void openLogsFolder(); void openInstallFolder(); @@ -515,43 +375,21 @@ private slots: void updateStyle(const QString &style); - void modlistChanged(const QModelIndex &index, int role); - void modlistChanged(const QModelIndexList &indicies, int role); - void fileMoved(const QString &filePath, const QString &oldOriginName, const QString &newOriginName); - - - void modFilterActive(bool active); - void espFilterChanged(const QString &filter); - - void expandModList(const QModelIndex &index); - void resizeLists(bool pluginListCustom); + void fileMoved(const QString& filePath, const QString& oldOriginName, const QString& newOriginName); + /** * @brief allow columns in mod list and plugin list to be resized */ void allowListResize(); void toolBar_customContextMenuRequested(const QPoint &point); - void removeFromToolbar(); - void overwriteClosed(int); - - void changeVersioningScheme(); - void checkModUpdates_clicked(); - void ignoreUpdate(); - void unignoreUpdate(); + void removeFromToolbar(QAction* action); void about(); - void modListSortIndicatorChanged(int column, Qt::SortOrder order); - void modListSectionResized(int logicalIndex, int oldSize, int newSize); - - void modlistSelectionsChanged(const QItemSelection ¤t); - void esplistSelectionsChanged(const QItemSelection ¤t); - void resetActionIcons(); - void updateModCount(); - void updatePluginCount(); private slots: // ui slots // actions @@ -577,23 +415,15 @@ private slots: // ui slots void on_centralWidget_customContextMenuRequested(const QPoint &pos); void on_bsaList_customContextMenuRequested(const QPoint &pos); - void on_clearFiltersButton_clicked(); void on_executablesListBox_currentIndexChanged(int index); - void on_modList_customContextMenuRequested(const QPoint &pos); - void on_modList_doubleClicked(const QModelIndex &index); - void on_listOptionsBtn_pressed(); - void on_espList_doubleClicked(const QModelIndex &index); void on_profileBox_currentIndexChanged(int index); void on_startButton_clicked(); void on_tabWidget_currentChanged(int index); - void on_espList_customContextMenuRequested(const QPoint &pos); void on_displayCategoriesBtn_toggled(bool checked); - void on_groupCombo_currentIndexChanged(int index); void on_linkButton_pressed(); void on_showHiddenBox_toggled(bool checked); void on_bsaList_itemChanged(QTreeWidgetItem *item, int column); - void on_bossButton_clicked(); void on_saveButton_clicked(); void on_restoreButton_clicked(); @@ -605,6 +435,7 @@ private slots: // ui slots void storeSettings(); void readSettings(); + void setupModList(); }; |
