summaryrefslogtreecommitdiff
path: root/src/settingsdialogplugins.h
blob: 416f457aeda4fbda60b6b346890f6e3a501f9a3f (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 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;

  enum
  {
    PluginRole       = Qt::UserRole,
    SettingsRole     = Qt::UserRole + 1,
    DescriptionsRole = Qt::UserRole + 2
  };

private:
  PluginContainer* m_pluginContainer;

  MOBase::FilterWidget m_filter;
};

#endif  // SETTINGSDIALOGPLUGINS_H