summaryrefslogtreecommitdiffstats
path: root/clients/tde/src/app/remotemdi.h
blob: d6dea6c02169a2ef1c44fc9c8e2083398559acd9 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//Author:    Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
//Copyright: See COPYING file that comes with this distribution

#ifndef _REMOTEMDI_H_
#define _REMOTEMDI_H_

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <tqvaluelist.h>
#include <kmdimainfrm.h>

#include <tdekrbclientsocket.h>

#include <tqtrla.h>

#define MAGIC_NUMBER 1
#define PROTOCOL_VERSION 1

class KMdiChildView;
class KListBox;
class TQListBoxItem;
class KToggleAction;

/**
 * @short Remote Laboratory Main Window
 * @author Timothy Pearson <kb9vqf@pearsoncomputing.net>
 * @version 0.1
 */
class RemoteMDI : public KMdiMainFrm
{
	Q_OBJECT

	public:
		/**
		* Default Constructor
		*/
		RemoteMDI();
		
		/**
		* Default Destructor
		*/
		virtual ~RemoteMDI();

		void setServerHost(TQString server);

	public slots:
		virtual void childWindowCloseRequest(KMdiChildView *pWnd);
	
	protected slots:
		void openNewWindow(KMdiChildView *view=0);
		void currentChanged(KMdiChildView *current);
		void closeCurrent();
		void closeSpecifiedWindow(KMdiChildView *window);
		void childClosed(KMdiChildView *w);
	
	private slots:
		void configToolbars();
		void configKeys();
		void updateStatusBarMessage();
		void updateStatusBarMainMessage(const TQString& message);
		void updateStatusBarWindowMessage(const TQString& message);
		void connectToServer();
		void finishConnectingToServer();
		void disconnectFromServer();
		void promptForStationType();
		void connectionClosedHandler();
		void processLockouts();
		void processActions();
		void startModule();
	
	protected:
		virtual bool queryClose();
		virtual void resizeEvent(TQResizeEvent *);

	private:
		TQString m_mainStatusBarMessage;
		TQString m_windowStatusBarMessage;

		unsigned m_children;
		TQString m_serverHost;

		TDEKerberosClientSocket* m_rsvSvrSocket;

		bool connToServerConnecting;
		int connToServerState;
		TQTimer *connToServerTimeoutTimer;

		KAction *connect_action;
		KAction *disconnect_action;
		KAction *inst_sa_menu;
		KAction *inst_fpgaviewer_menu;
		StationType m_activeStation;
};

#endif // _REMOTEMDI_H_