8
#include "clientwindow_gui.h"
9
#include "gui_dialog.h"
14
#include "igsinterface.h"
16
#include "gs_globals.h"
18
#include "gamedialog.h"
19
#include "maintable.h"
20
#include "gamestable.h"
21
#include "playertable.h"
22
#include "mainwindow.h"
24
#include <qapplication.h>
26
#include <qpushbutton.h>
27
#include <qmessagebox.h>
28
#include <qfiledialog.h>
31
#include <qlistview.h>
32
#include <qcheckbox.h>
33
#include <qtextstream.h>
34
#include <qtextview.h>
35
//#include <qmultilineedit.h>
36
#include <qtextedit.h>
37
#include <qtextbrowser.h>
40
#include <qdragobject.h>
43
#include <qwhatsthis.h>
44
#include <qtextstream.h>
45
#include <qstatusbar.h>
47
#include <qmenubar.h> //SL added eb 3
58
sendBuf(QString text, bool echo=true) { txt = text; localecho = echo; }
60
QString get_txt() { return txt; }
61
bool get_localecho() { return localecho; }
68
class ClientWindow : public ClientWindowGui, public Misc<QString>
73
ClientWindow(QMainWindow* parent, const char* name, WFlags fl=WType_TopLevel);
76
int sendTextFromApp(const QString&, bool localecho=true);
77
void sendcommand(const QString&, bool localecho=false);
78
void prepare_tables(InfoType);
79
void set_sessionparameter(QString, bool);
80
QString getPlayerRk(QString);
81
QString getPlayerExcludeListEntry(QString);
82
void openLocalBoard(QString file=0) { qgoif->set_localboard(file); }
83
void openLocalGame() { qgoif->set_localgame(); }
84
void openPreferences() { qgoif->openPreferences(); }
85
void saveMenuFrame(QPoint p, QSize s) { menu_p = p; menu_s = s; }
86
void savePrefFrame(QPoint p, QSize s) { pref_p = p; pref_s = s; }
87
QPoint getMenuPos() { return menu_p; }
88
QSize getMenuSize() { return menu_s; }
89
QPoint getViewPos() { return view_p; }
90
QSize getViewSize() { return view_s; }
91
QPoint getPrefPos() { return pref_p; }
92
QSize getPrefSize() { return pref_s; }
93
void setDebugDialog(Debug_Dialog *d) { DD = d; }
94
void setColumnsForExtUserInfo();
95
void reStoreWindowSize(QString strKey, bool store);
96
void setBytesIn(int i) { if (i == -1) bytesIn = 0; else bytesIn += i; }
97
void setBytesOut(int i) { if (i == -1) bytesOut = 0; else bytesOut += i; }
101
// QSortedList<Host> hostlist;
102
// QPtrList<Host> hostlist;
104
QButtonGroup *userButtonGroup ;
106
QString defaultStyle ;
109
void signal_cmdsent(const QString&);
110
void signal_move(Game*);
111
void signal_computer_game(QNewGameDlg*); //SL added eb 12
114
void slot_setBytesIn(int i) { setBytesIn(i); }
115
void slot_setBytesOut(int i) { setBytesOut(i); }
117
void slot_updateFont();
118
void slot_refresh(int);
119
void slot_playerPopup(int);
120
void slot_gamesPopup(int);
121
// void slot_channelPopup(int);
122
void slot_pbRelTabs();
123
void slot_pbRelOneTab(QWidget*);
124
void slot_statsPlayer(Player*);
127
// virtual void resizeEvent (QResizeEvent *);
130
virtual void slot_cbExtUserInfo();
131
virtual void slot_cblooking();
132
virtual void slot_cbopen();
133
virtual void slot_cbquiet();
135
virtual void slot_cbconnect(const QString&);
136
virtual void slot_connect(bool);
137
virtual void slot_pbrefreshgames();
138
virtual void slot_pbrefreshplayers();
139
virtual void slot_toolbaractivated(const QString&);
140
virtual void slot_cmdactivated(const QString&);
141
virtual void slot_cmdactivated_int(int);
142
virtual void slot_watchplayer(const QString&);
143
virtual void slot_excludeplayer(const QString&);
144
virtual void slot_localBoard();
145
virtual void slot_local19();
146
virtual void slot_preferences();
147
// virtual void slot_userDefinedKeysTextChanged();
148
virtual void slot_pbuser1();
149
virtual void slot_pbuser2();
150
virtual void slot_pbuser3();
151
virtual void slot_pbuser4();
154
void sendTextToApp(const QString&);
156
void slot_player(Player*, bool);
157
void slot_game(Game*);
158
void slot_message(QString);
159
void slot_message(QString, QColor);
160
void slot_svname(GSName&);
161
void slot_accname(QString&);
162
void slot_status(Status);
163
void slot_connclosed();
164
void slot_talk(const QString&, const QString&, bool);
165
void slot_checkbox(int, bool);
166
void slot_addToObservationList(int);
167
void slot_channelinfo(int, const QString&);
168
void slot_matchrequest(const QString&, bool);
169
void slot_matchCanceled(const QString&);
170
void slot_shout(const QString&, const QString&);
171
// gamestable/playertable:
172
virtual void slot_mouse_games(int, QListViewItem*, const QPoint&, int);
173
virtual void slot_mouse_players(int, QListViewItem*, const QPoint&, int);
174
virtual void slot_click_games(QListViewItem*);
175
virtual void slot_click_players(QListViewItem*);
176
virtual void slot_menu_games(QListViewItem*, const QPoint&, int);
177
virtual void slot_menu_players(QListViewItem*, const QPoint&, int);
178
// void slot_moveOver_players();
179
// void slot_moveOver_games();
180
void slot_playerContentsMoving(int x, int y);
181
void slot_gamesContentsMoving(int x, int y);
183
virtual void slot_talkto(QString&, QString&);
185
void slot_sendcommand(const QString&, bool);
187
void slotFileNewBoard();
188
void slotFileNewGame();
190
void slotComputerPlay();
192
void slotHelpManual();
193
void slotHelpSoundInfo();
194
void slotHelpAbout();
195
void slotHelpAboutQt();
197
void slotMenuConnect();
198
void slotMenuDisconnect();
199
void slotMenuEditServers();
201
void slotViewToolBar(bool toggle);
202
void slotViewStatusBar(bool toggle);
203
void slotViewMenuBar(bool toggle);
204
void slotViewUserToolBar(bool toggle);
206
void slotUserButtonClicked(int i);
212
TelnetConnection *telnetConnection;
216
// QTextCodec *textCodec;
217
// QTextStream *textStream;
223
bool playerListEmpty;
224
bool playerListSteadyUpdate;
225
bool gamesListSteadyUpdate;
226
// bool gamesListEmpty;
227
bool autoAwayMessage;
229
// cmd_xx get current cmd number, and, if higher than last, cmd is valid,
230
// else cmd is from history list
235
bool tn_wait_for_tn_ready;
237
ChannelList channellist;
238
QPtrList<Talk> talklist;
239
QPtrList<GameDialog> matchlist;
240
QPtrList<sendBuf> sendBuffer;
241
sendBuf *currentCommand;
243
// QStatusBar *statusBar;
244
QLabel *statusUsers, *statusGames, *statusServer, *statusChannel,
245
*statusOnlineTime, *statusMessage;
248
void timerEvent(QTimerEvent*);
250
// reset internal counter (half hour) for timing functions of class ClientWindow
251
void resetCounter() { counter = 1799; }
253
void initStatusBar(QWidget*);
254
void initmenus(QWidget*);
259
void keyPressEvent(QKeyEvent*);
260
// void keyReleaseEvent(QKeyEvent*);
276
PlayerTableItem *lv_popupPlayer;
277
GamesTableItem *lv_popupGames;
279
// extended user info
283
int bytesIn, bytesOut;
286
virtual bool eventFilter(QObject *obj, QEvent *ev);
290
QPixmap exitIcon, fileNewboardIcon, fileNewIcon, fileOpenIcon, fileSaveIcon, fileSaveAsIcon,
291
connectedIcon,disconnectedIcon, prefsIcon, qgoIcon, manualIcon,
292
OpenIcon, LookingIcon, QuietIcon, NotOpenIcon, NotLookingIcon, NotQuietIcon,
293
RefreshPlayersIcon, RefreshGamesIcon, ComputerPlayIcon; //SL add eb 6
295
//QPtrList<QToolButton> UserButtonList ;