X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fnicklistwidget.h;h=dd4ef4454412e6dce1ddf9ea9ca8dda1b6682a07;hb=4e51500401db3c85dbe5e92e5e5c15b6e3c87787;hp=e09ff33f20fb7ec8971e0a3ba510114aabc08eaf;hpb=8699dd758516d0ded076811e8ea656adc95e69d0;p=quassel.git diff --git a/src/qtui/nicklistwidget.h b/src/qtui/nicklistwidget.h index e09ff33f..dd4ef445 100644 --- a/src/qtui/nicklistwidget.h +++ b/src/qtui/nicklistwidget.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-2020 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,36 +15,73 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef _NICKLISTWIDGET_H_ -#define _NICKLISTWIDGET_H_ - -#include "ui_nicklistwidget.h" +#ifndef NICKLISTWIDGET_H_ +#define NICKLISTWIDGET_H_ +#include #include +#include "abstractitemview.h" +#include "buffermodel.h" +#include "types.h" + +#include "ui_nicklistwidget.h" + class Buffer; class NickView; +class QDockWidget; + +class NickListWidget : public AbstractItemView +{ + Q_OBJECT + +public: + NickListWidget(QWidget* parent = nullptr); -class NickListWidget : public QWidget { - Q_OBJECT +public slots: + void showWidget(bool visible); + void setVisible(bool visible) override; - public: - NickListWidget(QWidget *parent = 0); +signals: + void nickSelectionChanged(const QModelIndexList&); - public slots: - void setBuffer(Buffer *); - void reset(); +protected: + QSize sizeHint() const override; + void hideEvent(QHideEvent*) override; + void showEvent(QShowEvent*) override; - private slots: - void bufferDestroyed(QObject *); +protected slots: + void currentChanged(const QModelIndex& current, const QModelIndex& previous) override; + void rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end) override; - private: +private: + void removeBuffer(BufferId bufferId); + void onNickSelectionChanged(); + +private: Ui::NickListWidget ui; - QHash nickViews; + QHash nickViews; + + QDockWidget* dock() const; +}; + +// ============================== +// NickList Dock +// ============================== +class NickListDock : public QDockWidget +{ + Q_OBJECT + +public: + NickListDock(const QString& title, QWidget* parent = nullptr); + // ~NickListDock(); + + void setLocked(bool locked); + // virtual bool event(QEvent *event); }; #endif