From 4aa59cdc7dd779c7e864a1c4e96c6b52c61879ff Mon Sep 17 00:00:00 2001
From: isanae <14251494+isanae@users.noreply.github.com>
Date: Tue, 2 Jul 2019 12:35:33 -0400
Subject: added modinfodialogfwd.h, mostly for the enum that's used in various
places renamed ETabs to ModInfoTabIDs and changed all ints to use the enum
instead added ModInfoPtr to avoid having to include modinfo.h just to get
ModInfo::Ptr
---
src/modinfodialog.h | 50 +++++++-------------------------------------------
1 file changed, 7 insertions(+), 43 deletions(-)
(limited to 'src/modinfodialog.h')
diff --git a/src/modinfodialog.h b/src/modinfodialog.h
index 9eb00a3b..effb5d98 100644
--- a/src/modinfodialog.h
+++ b/src/modinfodialog.h
@@ -24,6 +24,7 @@ along with Mod Organizer. If not, see .
#include "modinfo.h"
#include "tutorabledialog.h"
#include "filerenamer.h"
+#include "modinfodialogfwd.h"
namespace Ui { class ModInfoDialog; }
namespace MOShared { class FilesOrigin; }
@@ -34,32 +35,6 @@ class Settings;
class ModInfoDialogTab;
class MainWindow;
-bool canPreviewFile(PluginContainer& pluginContainer, bool isArchive, const QString& filename);
-bool canOpenFile(bool isArchive, const QString& filename);
-bool canExploreFile(bool isArchive, const QString& filename);
-bool canHideFile(bool isArchive, const QString& filename);
-bool canUnhideFile(bool isArchive, const QString& filename);
-
-FileRenamer::RenameResults hideFile(FileRenamer& renamer, const QString &oldName);
-FileRenamer::RenameResults unhideFile(FileRenamer& renamer, const QString &oldName);
-
-int naturalCompare(const QString& a, const QString& b);
-
-
-class ElideLeftDelegate : public QStyledItemDelegate
-{
-public:
- using QStyledItemDelegate::QStyledItemDelegate;
-
-protected:
- void initStyleOption(QStyleOptionViewItem* o, const QModelIndex& i) const
- {
- QStyledItemDelegate::initStyleOption(o, i);
- o->textElideMode = Qt::ElideLeft;
- }
-};
-
-
/**
* this is a larger dialog used to visualise information about the mod.
* @todo this would probably a good place for a plugin-system
@@ -70,21 +45,9 @@ class ModInfoDialog : public MOBase::TutorableDialog
template
friend std::unique_ptr createTab(
- ModInfoDialog& d, int index);
+ ModInfoDialog& d, ModInfoTabIDs index);
public:
- enum ETabs {
- TAB_TEXTFILES,
- TAB_INIFILES,
- TAB_IMAGES,
- TAB_ESPS,
- TAB_CONFLICTS,
- TAB_CATEGORIES,
- TAB_NEXUS,
- TAB_NOTES,
- TAB_FILETREE
- };
-
ModInfoDialog(
MainWindow* mw, OrganizerCore* core, PluginContainer* plugin,
ModInfo::Ptr mod);
@@ -93,7 +56,8 @@ public:
void setMod(ModInfo::Ptr mod);
void setMod(const QString& name);
- void setTab(ETabs id);
+
+ void setTab(ModInfoTabIDs id);
int exec() override;
@@ -130,7 +94,7 @@ private:
OrganizerCore* m_core;
PluginContainer* m_plugin;
std::vector m_tabs;
- ETabs m_initialTab;
+ ModInfoTabIDs m_initialTab;
bool m_arrangingTabs;
std::vector createTabs();
@@ -144,8 +108,8 @@ private:
void updateTabs(bool becauseOriginChanged=false);
void feedFiles(bool becauseOriginChanged);
void setTabsColors();
- void switchToTab(ETabs id);
- void reAddTabs(const std::vector& visibility, ETabs sel);
+ void switchToTab(ModInfoTabIDs id);
+ void reAddTabs(const std::vector& visibility, ModInfoTabIDs sel);
std::vector getOrderedTabNames() const;
bool tryClose();
--
cgit v1.3.1