summaryrefslogtreecommitdiff
path: root/src/modlistcontextmenu.h
blob: 9d015afc7d03f7e831b1b48fd7ff88864d6dfead (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
#ifndef MODLISTCONTEXTMENU_H
#define MODLISTCONTEXTMENU_H

#include <vector>

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

class ModListView;
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);

private:

  // add actions/menus to this menu for each type of mod
  //
  void addOverwriteActions(OrganizerCore& core, ModListView* modListView);
  void addSeparatorActions(OrganizerCore& core, ModListView* modListView);
  void addForeignActions(OrganizerCore& core, ModListView* modListView);
  void addBackupActions(OrganizerCore& core, ModListView* modListView);
  void addRegularActions(OrganizerCore& core, ModListView* modListView);

  OrganizerCore& m_core;
  QModelIndexList m_index;

};

#endif