X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.h;h=76bd423c1cf5216fb265260907c70df5d0775fea;hp=a055115ab5c2243759cd376753644c6d8acb3d85;hb=8b896450a5fc56a2bde37b44e81dc5af6c338be1;hpb=332069a1830ed3a055ac6f2d7661bae1cc83e40c diff --git a/src/qtui/mainwin.h b/src/qtui/mainwin.h index a055115a..76bd423c 100644 --- a/src/qtui/mainwin.h +++ b/src/qtui/mainwin.h @@ -18,27 +18,27 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _MAINWIN_H_ -#define _MAINWIN_H_ +#ifndef MAINWIN_H_ +#define MAINWIN_H_ -#include "ui_mainwin.h" +#include +#include #include "qtui.h" +#include "sessionsettings.h" #include "titlesetter.h" -#include "sessionsettings.h" - -#include -#include -class Buffer; +class ActionCollection; +class BufferView; class BufferViewConfig; +class BufferViewDock; +class BufferWidget; class MsgProcessorStatusWidget; -class Message; class NickListWidget; +class SystemTrayIcon; -#ifdef HAVE_DBUS -# include "desktopnotifications.h" -#endif +class QMenu; +class QLabel; //!\brief The main window of Quassel's QtUi. class MainWin : public QMainWindow { @@ -49,19 +49,17 @@ class MainWin : public QMainWindow { virtual ~MainWin(); void init(); - void addBufferView(BufferViewConfig *config = 0); - void displayTrayIconMessage(const QString &title, const QString &message); + void addBufferView(BufferViewConfig *config = 0); + BufferView *allBuffersView() const; -#ifdef HAVE_DBUS - void sendDesktopNotification(const QString &title, const QString &message); -#endif + inline QSystemTrayIcon *systemTrayIcon() const; virtual bool event(QEvent *event); public slots: - void setTrayIconActivity(bool active = false); void saveStateToSession(const QString &sessionId); void saveStateToSessionSettings(SessionSettings &s); + void showStatusBarMessage(const QString &message); protected: void closeEvent(QCloseEvent *event); @@ -74,45 +72,39 @@ class MainWin : public QMainWindow { void securedConnection(); void disconnectedFromCore(); void setDisconnectedState(); - void systrayActivated( QSystemTrayIcon::ActivationReason ); + void systrayActivated(QSystemTrayIcon::ActivationReason); private slots: void addBufferView(int bufferViewConfigId); void removeBufferView(int bufferViewConfigId); void messagesInserted(const QModelIndex &parent, int start, int end); + void showAboutDlg(); void showChannelList(NetworkId netId = NetworkId()); + void showCoreConnectionDlg(bool autoConnect = false); void showCoreInfoDlg(); void showSettingsDlg(); void on_actionEditNetworks_triggered(); void on_actionManageViews_triggered(); void on_actionLockDockPositions_toggled(bool lock); - void showAboutDlg(); - void on_actionDebugNetworkModel_triggered(bool); - - void showCoreConnectionDlg(bool autoConnect = false); + void on_actionDebugNetworkModel_triggered(); + void on_actionDebugMessageModel_triggered(); + void on_actionDebugLog_triggered(); void clientNetworkCreated(NetworkId); void clientNetworkRemoved(NetworkId); void clientNetworkUpdated(); void connectOrDisconnectFromNet(); - void makeTrayIconBlink(); void saveStatusBarStatus(bool enabled); void loadLayout(); void saveLayout(); -#ifdef HAVE_DBUS - void desktopNotificationClosed(uint id, uint reason); - void desktopNotificationInvoked(uint id, const QString & action); -#endif - signals: void connectToCore(const QVariantMap &connInfo); void disconnectFromCore(); private: - Ui::MainWin ui; QMenu *systrayMenu; QLabel *coreLagLabel; @@ -121,6 +113,8 @@ class MainWin : public QMainWindow { TitleSetter _titleSetter; + void setupActions(); + void setupBufferWidget(); void setupMenus(); void setupViews(); void setupNickWidget(); @@ -129,29 +123,25 @@ class MainWin : public QMainWindow { void setupTopicWidget(); void setupStatusBar(); void setupSystray(); + void setupTitleSetter(); + void updateIcon(); void toggleVisibility(); void enableMenus(); - QSystemTrayIcon *systray; - QIcon activeTrayIcon; - QIcon onlineTrayIcon; - QIcon offlineTrayIcon; - bool trayIconActive; - QTimer *timer; - - BufferId currentBuffer; - QString currentProfile; + QSystemTrayIcon *_trayIcon; - QList _netViews; - NickListWidget *nickListWidget; + QList _bufferViews; + BufferWidget *_bufferWidget; + NickListWidget *_nickListWidget; -#ifdef HAVE_DBUS - org::freedesktop::Notifications *desktopNotifications; - quint32 notificationId; -#endif + QMenu *_fileMenu, *_networksMenu, *_viewMenu, *_bufferViewsMenu, *_settingsMenu, *_helpMenu, *_helpDebugMenu; friend class QtUi; }; +QSystemTrayIcon *MainWin::systemTrayIcon() const { + return _trayIcon; +} + #endif