1 /***************************************************************************
2 * Copyright (C) 2005-08 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
24 #include "ui_mainwin.h"
27 #include "bufferviewfilter.h"
29 #include <QSystemTrayIcon>
41 //!\brief The main window of Quassel's QtUi.
42 class MainWin : public QMainWindow {
46 MainWin(QtUi *gui, QWidget *parent = 0);
50 QDockWidget *addBufferView(const QString &, QAbstractItemModel *, const BufferViewFilter::Modes &, const QList<NetworkId> &);
52 AbstractUiMsg *layoutMsg(const Message &);
53 void displayTrayIconMessage(const QString &title, const QString &message);
55 virtual bool event(QEvent *event);
58 void setTrayIconActivity(bool active = false);
61 void closeEvent(QCloseEvent *event);
62 virtual void changeEvent(QEvent *event);
65 void connectedToCore();
66 void disconnectedFromCore();
67 void systrayActivated( QSystemTrayIcon::ActivationReason );
70 void receiveMessage(const Message &msg);
71 void showSettingsDlg();
72 void showNetworkDlg();
74 void showDebugConsole();
76 void showCoreConnectionDlg(bool autoConnect = false);
77 void coreConnectionDlgFinished(int result);
79 void clientNetworkCreated(NetworkId);
80 void clientNetworkRemoved(NetworkId);
81 void clientNetworkUpdated();
82 void connectOrDisconnectFromNet();
84 void changeTopic(const QString &topic);
85 void makeTrayIconBlink();
88 void connectToCore(const QVariantMap &connInfo);
89 void disconnectFromCore();
90 void requestBacklog(BufferInfo, QVariant, QVariant);
100 void setupNickWidget();
101 void setupChatMonitor();
102 void setupInputWidget();
103 void setupTopicWidget();
106 void setupSettingsDlg();
108 void toggleVisibility();
112 QSystemTrayIcon *systray;
113 QIcon activeTrayIcon;
114 QIcon inactiveTrayIcon;
118 CoreConnectDlg *coreConnectDlg;
119 SettingsDlg *settingsDlg;
120 DebugConsole *debugConsole;
122 BufferId currentBuffer;
123 QString currentProfile;
125 QList<QDockWidget *> netViews;
126 NickListWidget *nickListWidget;
128 QAction *actionEditNetworks;
129 QList<QAction *> networkActions;