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 "titlesetter.h"
29 #include <QSystemTrayIcon>
37 class BufferViewConfig;
45 //!\brief The main window of Quassel's QtUi.
46 class MainWin : public QMainWindow {
50 MainWin(QtUi *gui, QWidget *parent = 0);
54 void addBufferView(BufferViewConfig *config = 0);
56 void displayTrayIconMessage(const QString &title, const QString &message);
58 virtual bool event(QEvent *event);
61 void setTrayIconActivity(bool active = false);
64 void closeEvent(QCloseEvent *event);
65 virtual void changeEvent(QEvent *event);
68 void connectedToCore();
69 void setConnectedState();
70 void updateLagIndicator(int lag);
71 void securedConnection();
72 void disconnectedFromCore();
73 void setDisconnectedState();
74 void systrayActivated( QSystemTrayIcon::ActivationReason );
77 void addBufferView(int bufferViewConfigId);
78 void removeBufferView(int bufferViewConfigId);
79 void receiveMessage(const Message &msg);
80 void showChannelList(NetworkId netId = NetworkId());
81 void showCoreInfoDlg();
82 void showSettingsDlg();
83 void on_actionEditNetworks_triggered();
84 void on_actionManageViews_triggered();
85 void on_actionLockDockPositions_toggled(bool lock);
87 void showDebugConsole();
89 void showCoreConnectionDlg(bool autoConnect = false);
90 void coreConnectionDlgFinished(int result);
92 void clientNetworkCreated(NetworkId);
93 void clientNetworkRemoved(NetworkId);
94 void clientNetworkUpdated();
95 void connectOrDisconnectFromNet();
97 void changeTopic(const QString &topic);
98 void makeTrayIconBlink();
99 void saveStatusBarStatus(bool enabled);
105 void connectToCore(const QVariantMap &connInfo);
106 void disconnectFromCore();
107 void requestBacklog(BufferInfo, QVariant, QVariant);
114 QLabel *coreLagLabel;
117 TitleSetter _titleSetter;
121 void setupNickWidget();
122 void setupChatMonitor();
123 void setupInputWidget();
124 void setupTopicWidget();
125 void setupStatusBar();
128 void setupSettingsDlg();
130 void toggleVisibility();
134 QSystemTrayIcon *systray;
135 QIcon activeTrayIcon;
136 QIcon onlineTrayIcon;
137 QIcon offlineTrayIcon;
141 CoreConnectDlg *coreConnectDlg;
142 ChannelListDlg *channelListDlg;
143 SettingsDlg *settingsDlg;
144 DebugConsole *debugConsole;
146 BufferId currentBuffer;
147 QString currentProfile;
149 QList<QDockWidget *> _netViews;
150 NickListWidget *nickListWidget;