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);
57 void sendDesktopNotification(const QString &title, const QString &message);
59 virtual bool event(QEvent *event);
62 void setTrayIconActivity(bool active = false);
65 void closeEvent(QCloseEvent *event);
66 virtual void changeEvent(QEvent *event);
69 void connectedToCore();
70 void setConnectedState();
71 void updateLagIndicator(int lag);
72 void securedConnection();
73 void disconnectedFromCore();
74 void setDisconnectedState();
75 void systrayActivated( QSystemTrayIcon::ActivationReason );
78 void addBufferView(int bufferViewConfigId);
79 void removeBufferView(int bufferViewConfigId);
80 void receiveMessage(const Message &msg);
81 void showChannelList(NetworkId netId = NetworkId());
82 void showCoreInfoDlg();
83 void showSettingsDlg();
84 void on_actionEditNetworks_triggered();
85 void on_actionManageViews_triggered();
86 void on_actionLockDockPositions_toggled(bool lock);
88 void showDebugConsole();
90 void showCoreConnectionDlg(bool autoConnect = false);
91 void coreConnectionDlgFinished(int result);
93 void clientNetworkCreated(NetworkId);
94 void clientNetworkRemoved(NetworkId);
95 void clientNetworkUpdated();
96 void connectOrDisconnectFromNet();
98 void changeTopic(const QString &topic);
99 void makeTrayIconBlink();
100 void saveStatusBarStatus(bool enabled);
106 void connectToCore(const QVariantMap &connInfo);
107 void disconnectFromCore();
108 void requestBacklog(BufferInfo, QVariant, QVariant);
115 QLabel *coreLagLabel;
118 TitleSetter _titleSetter;
122 void setupNickWidget();
123 void setupChatMonitor();
124 void setupInputWidget();
125 void setupTopicWidget();
126 void setupStatusBar();
129 void setupSettingsDlg();
131 void toggleVisibility();
135 QSystemTrayIcon *systray;
136 QIcon activeTrayIcon;
137 QIcon onlineTrayIcon;
138 QIcon offlineTrayIcon;
142 CoreConnectDlg *coreConnectDlg;
143 ChannelListDlg *channelListDlg;
144 SettingsDlg *settingsDlg;
145 DebugConsole *debugConsole;
147 BufferId currentBuffer;
148 QString currentProfile;
150 QList<QDockWidget *> _netViews;
151 NickListWidget *nickListWidget;