summaryrefslogtreecommitdiff
path: root/src/settingsdialogplugins.h
blob: 3de0d7dc98af21a10ccf611a575d83573573e37d (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
#ifndef SETTINGSDIALOGPLUGINS_H
#define SETTINGSDIALOGPLUGINS_H

#include "filterwidget.h"

#include "settings.h"
#include "settingsdialog.h"

class PluginsSettingsTab : public SettingsTab
{
public:
  PluginsSettingsTab(Settings& settings, PluginContainer* pluginContainer, SettingsDialog& dialog);

  void update();
  void closing() override;

private:
  void on_pluginsList_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
  void on_checkboxEnabled_clicked(bool checked);
  void deleteBlacklistItem();
  void storeSettings(QTreeWidgetItem *pluginItem);

private slots:

  /**
   * @brief Update the list item to display inactive plugins.
   */
  void updateListItems();

  /**
   * @brief Filter the plugin list according to the filter widget.
   *
   */
  void filterPluginList();

  /**
   * @brief Retrieve the plugin associated to the given item in the list.
   *
   */
  MOBase::IPlugin* plugin(QTreeWidgetItem *pluginItem) const;

  constexpr static int ROLE_PLUGIN = Qt::UserRole;
  constexpr static int ROLE_SETTINGS = Qt::UserRole + 1;
  constexpr static int ROLE_DESCRIPTIONS = Qt::UserRole + 2;

private:

  PluginContainer* m_pluginContainer;

  MOBase::FilterWidget m_filter;
};

#endif // SETTINGSDIALOGPLUGINS_H