ATLAS Offline Software
Loading...
Searching...
No Matches
VP1AvailableToolsHelper.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7// //
8// Header file for class VP1AvailableToolsHelper //
9// //
10// Description: For monitoring the available tools of given //
11// tool types, and for automatically taking //
12// care of the state of associated gui elements //
13// //
14// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
15// Initial version: February 2008 //
16// //
18
19#ifndef VP1AVAILABLETOOLSHELPER_H
20#define VP1AVAILABLETOOLSHELPER_H
21
23#include <QObject>
24#include <QStringList>
25class IToolSvc;
26class IVP1System;
27class QComboBox;
28class QWidget;
29
30class VP1AvailableToolsHelper : public QObject, public VP1HelperClassBase {
31
32 Q_OBJECT
33
34public:
35
36 VP1AvailableToolsHelper(IToolSvc*, QObject * parent = 0);//Use this to get error messages output to stdout.
37 VP1AvailableToolsHelper(IVP1System*, QObject * parent = 0);//Use this to also get error messages output in VP1 message area.
39
41 // Change the currently monitored tool-types: //
43
44 void addMonitoredType(const QString&, const QStringList& ignoreList = QStringList());//List of (wildcarded) expressions of tool names to ignore (i.e. "*Fatras*")
45 void addMonitoredTypes(const QStringList&, const QStringList& ignoreList = QStringList());
46 void removeMonitoredType(const QString&);
47 void removeMonitoredTypes(const QStringList&);
48 void clearMonitoredTypes(const QString&);
49 const QStringList& monitoredTypes() const;
50
52 // Get list of available tools (calls update behind the scenes): //
54
55 QStringList availableTools() const;
56
57 //Convenience methods:
58 void setComboBoxData(QComboBox*);//Will be filled with a list of available tools (disabled if none are available);
59 void disableIfNoTools(QWidget*);//widget will be disabled (enabled) if the list of available tools is empty (not empty).
60 void handleComboBox(QComboBox*);//Calls setComboBoxData on the combobox whenever the list changes.
61 void handleEnabledState(QWidget*);//Calls disableIfNoTools on the widget whenever the list changes.
62
63 void scheduleImmediateUpdate() const;//Updates immediately after event queue clears (NB: Not necessary in future Gaudi versions).
64
65signals:
66 void availableToolsChanged(const QStringList&) const;
67
68protected:
69 void timerEvent ( QTimerEvent * event );
70private:
71 class Imp;
75
76private Q_SLOTS:
77 void widgetDeleted(QObject*);//To automatically remove deleted widgets from internal lists.
78 void update() const;//Called internally every 2 seconds. In future gaudi versions we can instead register callbacks to the toolSvc.
79};
80
81#endif
VP1AvailableToolsHelper(IToolSvc *, QObject *parent=0)
VP1AvailableToolsHelper & operator=(const VP1AvailableToolsHelper &)
void addMonitoredTypes(const QStringList &, const QStringList &ignoreList=QStringList())
void addMonitoredType(const QString &, const QStringList &ignoreList=QStringList())
void removeMonitoredTypes(const QStringList &)
const QStringList & monitoredTypes() const
void removeMonitoredType(const QString &)
void timerEvent(QTimerEvent *event)
void clearMonitoredTypes(const QString &)
VP1AvailableToolsHelper(const VP1AvailableToolsHelper &)
void availableToolsChanged(const QStringList &) const
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")