MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
trayIconMgr.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2017 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include "rtiMsConfig.h"
13 #include "assistantMgr.h"
14 #include "rtiAssistantClient.h"
15 #include <QtGui/QIcon>
16 #include <QSystemTrayIcon>
17 #include <vlutil/vlSmartPointers.h>
18 #include <vlutil/vlPrint.h>
19 #include <map>
20 
22 class DtRtiAssistantPeer;
23 class DtAssistantComponentMenu;
25 class DtConsoleDialog;
27 class DtAboutBox;
34 class QMenu;
35 class QAction;
36 class QProcess;
37 
43 { Q_OBJECT;
44 public:
45 
47  DtAssistantTrayIconMgr( DtBoost::shared_ptr<DtRtiAssistantServer> server,
48  DtBoost::shared_ptr<DtRtiAssistantPeer> peer,
49  DtAssistantSignalRouter& signalRouter,
50  DtBoost::shared_ptr<DtAssistantComponentMgr> compMgr );
51 
53  virtual ~DtAssistantTrayIconMgr();
54 
55 private:
56 
59 
62 
63 public:
64 
66  virtual void startShutdown();
67 
68 protected:
69 
71 
72 
74  static void processNotifyMsg(const DtAssistantNotifyMsg& msg, void* usr);
75 
77  virtual void processNotifyMsg(const DtAssistantNotifyMsg& msg);
78 
80  static void processShowDialogMsg(const DtAssistantShowDialogMsg& msg, void* usr);
81 
83  virtual void processShowDialogMsg(const DtAssistantShowDialogMsg& msg);
84 
86  static void processNotifyObserveMsg(const DtAssistantNotifyObserveMsg& msg, void* usr);
87 
90  virtual void processNotifyObserveMsg(const DtAssistantNotifyObserveMsg& msg);
91 
93 
95  virtual void loadBrowserPage(const QString &page);
96 
97 signals:
98 
100  void shutdown();
101 
103  void displayActiveWarningDialogs();
104 
106  void showConfigDialog( DtPreferencesPage pageNum = DtInvalidPreferencesPage );
107 
109  void showFederationsDialog();
110 
112  void showNetworkComponentsDialog();
113 
115  void showRidConfigDialog();
116 
117 public slots:
118 
121  void showNotifyConsole();
122 
123 // //! Show the federate/federation configuration dialog.
124 // void showIndevConfigDialog();
125 
127  void showVersionsWebpage();
128 
130  void showAboutDialog();
131 
133  void showHelpDialog();
134 
136  void processHelpDialogClose();
137 
139  void notification( const MAKRti::DtString& message,
140  MAKRti::DtNotifyLevelType notifyLevel, int sourceCompId = -1,
141  bool logOnly = false, bool forward = true);
142 
144  void notification( const MAKRti::DtString& message,
145  MAKRti::DtNotifyLevelType notifyLevel, const MAKRti::DtString& source,
146  bool logOnly = false, bool forward = true);
147 
151  void showNotifyIcon();
152 
154  void clearNotifyIcon();
155 
158  void showWarningIcon();
159 
162  void clearWarningIcon();
163 
165  void processTrayIconActivation( QSystemTrayIcon::ActivationReason reason );
166 
168  void setEnableNotifications( bool enable );
169 
172  void setObservingNotifications( bool isObserving );
173 
175  void sendNotifyObserveMsg();
176 
178  void pruneStaleNotifyObservers();
179 
180 #ifdef DtDIAGNOSTIC
181 
182  void showMsgDump();
183 #endif
184 
185 
186 protected:
187 
189  DtBoost::shared_ptr<DtAssistantComponentMgr> myCompMgr;
190 
192  QSystemTrayIcon* myTrayIcon;
193 
195  QMenu* myMenu;
196 
199 
202 
206 
209 
212 
215 
218 
221 
225 
228 
230  QProcess* myHelpAssistant;
231 
234 
238 
241 
244  std::map<int, MAKRti::DtString> myLastNotifyNames;
245 
248 
250  std::map< DtAssistantInfo, bool > myNotifyObservers;
251 
252 #ifdef _WIN32
253 
254  bool myShowingMsgDump;
255  std::streambuf* myOriginalRdbuf;
256  DtWindowsConsolePrinter *myWinConsole;
257  std::ofstream* myConsoleStream;
258 #endif
259 
260 };

Document ID: Generated on Fri Sep 27 00:57:56 EDT 2019 from SVN revision 201708
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)