X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.h;h=76bd423c1cf5216fb265260907c70df5d0775fea;hp=fab52f38a7e9f5f2856f79fd41f6c36db9e7fb38;hb=8b896450a5fc56a2bde37b44e81dc5af6c338be1;hpb=5c78a50fa720e5f82fcaa03c0176feab71d74c8e diff --git a/src/qtui/mainwin.h b/src/qtui/mainwin.h index fab52f38..76bd423c 100644 --- a/src/qtui/mainwin.h +++ b/src/qtui/mainwin.h @@ -21,27 +21,24 @@ #ifndef MAINWIN_H_ #define MAINWIN_H_ -#include "ui_mainwin.h" +#include +#include #include "qtui.h" -#include "titlesetter.h" #include "sessionsettings.h" - -#include -#include -#include +#include "titlesetter.h" class ActionCollection; -class Buffer; +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 { @@ -54,19 +51,15 @@ class MainWin : public QMainWindow { void init(); void addBufferView(BufferViewConfig *config = 0); + BufferView *allBuffersView() const; - void displayTrayIconMessage(const QString &title, const QString &message); inline QSystemTrayIcon *systemTrayIcon() const; -#ifdef HAVE_DBUS - void sendDesktopNotification(const QString &title, const QString &message); -#endif - 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); @@ -85,39 +78,33 @@ class MainWin : public QMainWindow { 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; @@ -127,6 +114,7 @@ class MainWin : public QMainWindow { TitleSetter _titleSetter; void setupActions(); + void setupBufferWidget(); void setupMenus(); void setupViews(); void setupNickWidget(); @@ -135,29 +123,19 @@ class MainWin : public QMainWindow { void setupTopicWidget(); void setupStatusBar(); void setupSystray(); + void setupTitleSetter(); + void updateIcon(); void toggleVisibility(); void enableMenus(); QSystemTrayIcon *_trayIcon; - QPixmap activeTrayIcon; - QPixmap onlineTrayIcon; - QPixmap offlineTrayIcon; - bool trayIconActive; - QTimer *timer; - - BufferId currentBuffer; - QString currentProfile; - QList _netViews; - NickListWidget *nickListWidget; + QList _bufferViews; + BufferWidget *_bufferWidget; + NickListWidget *_nickListWidget; - ActionCollection *_actionCollection; - -#ifdef HAVE_DBUS - org::freedesktop::Notifications *desktopNotifications; - quint32 notificationId; -#endif + QMenu *_fileMenu, *_networksMenu, *_viewMenu, *_bufferViewsMenu, *_settingsMenu, *_helpMenu, *_helpDebugMenu; friend class QtUi; };