summaryrefslogtreecommitdiff
path: root/src/modinfodialog.h
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-07-02 12:02:07 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-07-02 12:02:07 -0400
commit82d985064e5105ded4b20d357eaf7cd1b97fe9da (patch)
tree2de9879fa59758d057de1bc1b8017846da377421 /src/modinfodialog.h
parentc6e80f1a5eed4a57663e7fc55c2727258eaad552 (diff)
added a ModInfoDialogTabContext to avoid passing too many things to tab constructors
mod is passed to ctors to make sure they can never be empty only call deleteRequest() to selected mod comments
Diffstat (limited to 'src/modinfodialog.h')
-rw-r--r--src/modinfodialog.h36
1 files changed, 8 insertions, 28 deletions
diff --git a/src/modinfodialog.h b/src/modinfodialog.h
index 899a3eab..9eb00a3b 100644
--- a/src/modinfodialog.h
+++ b/src/modinfodialog.h
@@ -66,7 +66,11 @@ protected:
**/
class ModInfoDialog : public MOBase::TutorableDialog
{
- Q_OBJECT
+ Q_OBJECT;
+
+ template <class T>
+ friend std::unique_ptr<ModInfoDialogTab> createTab(
+ ModInfoDialog& d, int index);
public:
enum ETabs {
@@ -81,30 +85,12 @@ public:
TAB_FILETREE
};
- /**
- * @brief constructor
- *
- * @param modInfo info structure about the mod to display
- * @param parent parend widget
- **/
- ModInfoDialog(MainWindow* mw, OrganizerCore* core, PluginContainer* plugin);
+ ModInfoDialog(
+ MainWindow* mw, OrganizerCore* core, PluginContainer* plugin,
+ ModInfo::Ptr mod);
~ModInfoDialog();
- /**
- * @brief retrieve the (user-modified) version of the mod
- *
- * @return the (user-modified) version of the mod
- **/
- QString getModVersion() const;
-
- /**
- * @brief retrieve the (user-modified) mod id
- *
- * @return the (user-modified) id of the mod
- **/
- const int getModID() const;
-
void setMod(ModInfo::Ptr mod);
void setMod(const QString& name);
void setTab(ETabs id);
@@ -166,12 +152,6 @@ private:
void onOriginModified(int originID);
void onTabChanged();
void onTabMoved();
-
- template <class T>
- std::unique_ptr<ModInfoDialogTab> createTab(int index)
- {
- return std::make_unique<T>(*m_core, *m_plugin, this, ui.get(), index);
- }
};
#endif // MODINFODIALOG_H