summaryrefslogtreecommitdiff
path: root/src/modlistcontextmenu.h
blob: 05e6b6018522d3bbd92dbd6f0834221ecdea03aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef MODLISTCONTEXTMENU_H
#define MODLISTCONTEXTMENU_H

#include <vector>

#include <QMenu>
#include <QModelIndex>
#include <QTreeView>

#include "modinfo.h"

class ModListView;
class ModListViewActions;
class OrganizerCore;

class ModListGlobalContextMenu : public QMenu
{
  Q_OBJECT
public:

  ModListGlobalContextMenu(OrganizerCore& core, ModListView* modListView, QWidget* parent = nullptr);

};

class ModListContextMenu : public QMenu
{
  Q_OBJECT

public:

  // creates a new context menu, the given index is the one for the click and should be valid
  //
  ModListContextMenu(OrganizerCore& core, const QModelIndex& index, ModListView* modListView);

public: // TODO: Move this to private when all is done

  // create the "Send to... " context menu
  //
  QMenu* createSendToContextMenu();

  // add actions/menus to this menu for each type of mod
  //
  void addOverwriteActions(ModInfo::Ptr mod);
  void addSeparatorActions(ModInfo::Ptr mod);
  void addForeignActions(ModInfo::Ptr mod);
  void addBackupActions(ModInfo::Ptr mod);
  void addRegularActions(ModInfo::Ptr mod);

  OrganizerCore& m_core;
  QModelIndex m_index;
  QModelIndexList m_selected;
  ModListView* m_view;
  ModListViewActions& m_actions; // shortcut for m_view->actions()

};

#endif