Crossfire Server, Trunk
CREResourcesWindow.h
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2022 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #ifndef CRERESOURCESWINDOW_H
14 #define CRERESOURCESWINDOW_H
15 
16 #include <QObject>
17 #include <QtWidgets>
18 
21 #include "CREScriptEngine.h"
22 
24 class MessageManager;
25 class ResourcesManager;
26 class ScriptFileManager;
27 class AssetModel;
29 class AssetWrapperPanel;
30 
31 class CREResourcesWindow : public QWidget
32 {
33  Q_OBJECT
34 
35  public:
36  CREResourcesWindow(CREMapInformationManager* store, MessageManager* messages, ResourcesManager* resources, ScriptFileManager* scripts, AssetModel *model, const QModelIndex &root, QWidget* parent);
37  virtual ~CREResourcesWindow();
38 
39  int rootIndex() const { return myTreeRoot.isValid() ? myTreeRoot.row() : -1; }
40 
41  public slots:
42  void updateFilters();
43  void updateReports();
44 
45  signals:
46  void filtersModified();
47  void reportsModified();
48 
49  protected:
51  QTreeView* myTree;
52  QModelIndex myTreeRoot;
54  QHash<QString, QPointer<AssetWrapperPanel> > myPanels;
55  QStackedLayout* myStackedPanels;
60  QPushButton* myFilterButton;
61  QMenu* myFiltersMenu;
62  QSignalMapper myFiltersMapper;
64  QMenu* myReportsMenu;
65  QSignalMapper myReportsMapper;
68 
69  void addPanel(QString name, AssetWrapperPanel* panel);
70  void setFilter(const QString &filter, const QString &name);
71 
72  protected slots:
73  void currentRowChanged(const QModelIndex &current, const QModelIndex &previous);
74  void onFilter();
75  void onFilterChange(QObject* object);
76  void onQuickFilter();
77  void clearFilter();
78  void onReport();
79  void onReportChange(QObject* object);
80  void treeCustomMenu(const QPoint & pos);
81  void addQuest(bool);
82  void addMessage(bool);
83 };
84 
85 #endif // CRERESOURCESWINDOW_H
AssetWrapperPanel
Definition: AssetWrapperPanel.h:28
ScriptFileManager
Definition: ScriptFileManager.h:26
CREResourcesWindow::onReport
void onReport()
Definition: CREResourcesWindow.cpp:211
CREReportDefinitionManager
Definition: CREReportDefinitionManager.h:21
CREResourcesWindow::addMessage
void addMessage(bool)
Definition: CREResourcesWindow.cpp:465
CREReportDefinitionManager.h
CREResourcesWindow::myTree
QTreeView * myTree
Definition: CREResourcesWindow.h:51
CREResourcesWindow::onQuickFilter
void onQuickFilter()
Definition: CREResourcesWindow.cpp:262
CREFilterDefinitionManager
Definition: CREFilterDefinitionManager.h:21
CREResourcesWindow::myModel
ScriptFilterAssetModel * myModel
Definition: CREResourcesWindow.h:50
CREResourcesWindow
Definition: CREResourcesWindow.h:31
python_init.scripts
scripts
Definition: python_init.py:11
ResourcesManager
Definition: ResourcesManager.h:80
say.previous
dictionary previous
Definition: say.py:205
filter
Definition: filter.py:1
CREResourcesWindow::CREResourcesWindow
CREResourcesWindow(CREMapInformationManager *store, MessageManager *messages, ResourcesManager *resources, ScriptFileManager *scripts, AssetModel *model, const QModelIndex &root, QWidget *parent)
Definition: CREResourcesWindow.cpp:68
CREResourcesWindow::myReportsMenu
QMenu * myReportsMenu
Definition: CREResourcesWindow.h:64
root
static char root[500]
Definition: mapper.cpp:312
CREResourcesWindow::reportsModified
void reportsModified()
CREResourcesWindow::myFilters
CREFilterDefinitionManager myFilters
Definition: CREResourcesWindow.h:63
CREResourcesWindow::onReportChange
void onReportChange(QObject *object)
Definition: CREResourcesWindow.cpp:314
CREResourcesWindow::myMessages
MessageManager * myMessages
Definition: CREResourcesWindow.h:57
CREResourcesWindow::rootIndex
int rootIndex() const
Definition: CREResourcesWindow.h:39
CREResourcesWindow::myStore
CREMapInformationManager * myStore
Definition: CREResourcesWindow.h:56
CREResourcesWindow::onFilter
void onFilter()
Definition: CREResourcesWindow.cpp:201
CREResourcesWindow::onFilterChange
void onFilterChange(QObject *object)
Definition: CREResourcesWindow.cpp:255
CREScriptEngine.h
CREScriptEngine
Definition: CREScriptEngine.h:18
CREResourcesWindow::myFiltersMenu
QMenu * myFiltersMenu
Definition: CREResourcesWindow.h:61
CREResourcesWindow::myReportsMapper
QSignalMapper myReportsMapper
Definition: CREResourcesWindow.h:65
CREResourcesWindow::myFiltersMapper
QSignalMapper myFiltersMapper
Definition: CREResourcesWindow.h:62
ScriptFilterAssetModel
Definition: AssetModel.h:78
CREResourcesWindow::clearFilter
void clearFilter()
Definition: CREResourcesWindow.cpp:270
AssetModel
Definition: AssetModel.h:29
CREResourcesWindow::myEngine
CREScriptEngine myEngine
Definition: CREResourcesWindow.h:67
CREResourcesWindow::addPanel
void addPanel(QString name, AssetWrapperPanel *panel)
Definition: CREResourcesWindow.cpp:194
MessageManager
Definition: MessageManager.h:25
CREResourcesWindow::setFilter
void setFilter(const QString &filter, const QString &name)
Definition: CREResourcesWindow.cpp:274
CREResourcesWindow::filtersModified
void filtersModified()
CREResourcesWindow::treeCustomMenu
void treeCustomMenu(const QPoint &pos)
Definition: CREResourcesWindow.cpp:432
CREResourcesWindow::myFilterButton
QPushButton * myFilterButton
Definition: CREResourcesWindow.h:60
CREResourcesWindow::addQuest
void addQuest(bool)
Definition: CREResourcesWindow.cpp:449
CREResourcesWindow::myStackedPanels
QStackedLayout * myStackedPanels
Definition: CREResourcesWindow.h:55
navar-midane_apply.messages
list messages
Definition: navar-midane_apply.py:8
CREResourcesWindow::myScripts
ScriptFileManager * myScripts
Definition: CREResourcesWindow.h:59
CREResourcesWindow::myResources
ResourcesManager * myResources
Definition: CREResourcesWindow.h:58
CREResourcesWindow::myReports
CREReportDefinitionManager myReports
Definition: CREResourcesWindow.h:66
CREResourcesWindow::myCurrentPanel
AssetWrapperPanel * myCurrentPanel
Definition: CREResourcesWindow.h:53
CREResourcesWindow::myTreeRoot
QModelIndex myTreeRoot
Definition: CREResourcesWindow.h:52
CREFilterDefinitionManager.h
CREResourcesWindow::myPanels
QHash< QString, QPointer< AssetWrapperPanel > > myPanels
Definition: CREResourcesWindow.h:54
CREResourcesWindow::updateReports
void updateReports()
Definition: CREResourcesWindow.cpp:289
CREMapInformationManager
Definition: CREMapInformationManager.h:27
replace.current
current
Definition: replace.py:64
CREResourcesWindow::updateFilters
void updateFilters()
Definition: CREResourcesWindow.cpp:221
give.name
name
Definition: give.py:27
CREResourcesWindow::currentRowChanged
void currentRowChanged(const QModelIndex &current, const QModelIndex &previous)
Definition: CREResourcesWindow.cpp:167
CREResourcesWindow::~CREResourcesWindow
virtual ~CREResourcesWindow()
Definition: CREResourcesWindow.cpp:162