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 securedConnection();
71 void disconnectedFromCore();
72 void setDisconnectedState();
73 void systrayActivated( QSystemTrayIcon::ActivationReason );
76 void addBufferView(int bufferViewConfigId);
77 void removeBufferView(int bufferViewConfigId);
78 void receiveMessage(const Message &msg);
79 void showChannelList(NetworkId netId = NetworkId());
80 void showCoreInfoDlg();
81 void showSettingsDlg();
82 void on_actionEditNetworks_triggered();
83 void on_actionManageViews_triggered();
84 void on_actionLockDockPositions_toggled(bool lock);
86 void showDebugConsole();
88 void showCoreConnectionDlg(bool autoConnect = false);
89 void coreConnectionDlgFinished(int result);
91 void clientNetworkCreated(NetworkId);
92 void clientNetworkRemoved(NetworkId);
93 void clientNetworkUpdated();
94 void connectOrDisconnectFromNet();
96 void changeTopic(const QString &topic);
97 void makeTrayIconBlink();
98 void saveStatusBarStatus(bool enabled);
104 void connectToCore(const QVariantMap &connInfo);
105 void disconnectFromCore();
106 void requestBacklog(BufferInfo, QVariant, QVariant);
115 TitleSetter _titleSetter;
119 void setupNickWidget();
120 void setupChatMonitor();
121 void setupInputWidget();
122 void setupTopicWidget();
123 void setupStatusBar();
126 void setupSettingsDlg();
128 void toggleVisibility();
132 QSystemTrayIcon *systray;
133 QIcon activeTrayIcon;
134 QIcon onlineTrayIcon;
135 QIcon offlineTrayIcon;
139 CoreConnectDlg *coreConnectDlg;
140 ChannelListDlg *channelListDlg;
141 SettingsDlg *settingsDlg;
142 DebugConsole *debugConsole;
144 BufferId currentBuffer;
145 QString currentProfile;
147 QList<QDockWidget *> _netViews;
148 NickListWidget *nickListWidget;