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 securedConnection();
67 void disconnectedFromCore();
68 void systrayActivated( QSystemTrayIcon::ActivationReason );
71 void receiveMessage(const Message &msg);
72 void showSettingsDlg();
73 void showNetworkDlg();
75 void showDebugConsole();
77 void showCoreConnectionDlg(bool autoConnect = false);
78 void coreConnectionDlgFinished(int result);
80 void clientNetworkCreated(NetworkId);
81 void clientNetworkRemoved(NetworkId);
82 void clientNetworkUpdated();
83 void connectOrDisconnectFromNet();
85 void changeTopic(const QString &topic);
86 void makeTrayIconBlink();
87 void saveStatusBarStatus(bool enabled);
90 void connectToCore(const QVariantMap &connInfo);
91 void disconnectFromCore();
92 void requestBacklog(BufferInfo, QVariant, QVariant);
103 void setupNickWidget();
104 void setupChatMonitor();
105 void setupInputWidget();
106 void setupTopicWidget();
107 void setupStatusBar();
110 void setupSettingsDlg();
112 void toggleVisibility();
116 QSystemTrayIcon *systray;
117 QIcon activeTrayIcon;
118 QIcon onlineTrayIcon;
119 QIcon offlineTrayIcon;
123 CoreConnectDlg *coreConnectDlg;
124 SettingsDlg *settingsDlg;
125 DebugConsole *debugConsole;
127 BufferId currentBuffer;
128 QString currentProfile;
130 QList<QDockWidget *> netViews;
131 NickListWidget *nickListWidget;
133 QAction *actionEditNetworks;
134 QList<QAction *> networkActions;