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();
89 void connectToCore(const QVariantMap &connInfo);
90 void disconnectFromCore();
91 void requestBacklog(BufferInfo, QVariant, QVariant);
102 void setupNickWidget();
103 void setupChatMonitor();
104 void setupInputWidget();
105 void setupTopicWidget();
108 void setupSettingsDlg();
110 void toggleVisibility();
114 QSystemTrayIcon *systray;
115 QIcon activeTrayIcon;
116 QIcon onlineTrayIcon;
117 QIcon offlineTrayIcon;
121 CoreConnectDlg *coreConnectDlg;
122 SettingsDlg *settingsDlg;
123 DebugConsole *debugConsole;
125 BufferId currentBuffer;
126 QString currentProfile;
128 QList<QDockWidget *> netViews;
129 NickListWidget *nickListWidget;
131 QAction *actionEditNetworks;
132 QList<QAction *> networkActions;