2018-04-18 09:12:29 +02:00
|
|
|
#pragma once
|
|
|
|
|
2018-08-11 22:23:06 +02:00
|
|
|
#include "Application.hpp"
|
2018-06-26 15:33:51 +02:00
|
|
|
#include "common/Channel.hpp"
|
2018-06-26 14:09:39 +02:00
|
|
|
#include "widgets/BaseWindow.hpp"
|
2018-04-18 09:12:29 +02:00
|
|
|
|
|
|
|
#include <pajlada/signals/signal.hpp>
|
|
|
|
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QRadioButton>
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
2018-08-11 22:23:06 +02:00
|
|
|
class Notebook;
|
|
|
|
|
|
|
|
class SelectChannelDialog final : public BaseWindow
|
2018-04-18 09:12:29 +02:00
|
|
|
{
|
|
|
|
public:
|
2018-06-24 11:45:30 +02:00
|
|
|
SelectChannelDialog(QWidget *parent = nullptr);
|
2018-04-18 09:12:29 +02:00
|
|
|
|
2018-07-06 19:23:47 +02:00
|
|
|
void setSelectedChannel(IndirectChannel selectedChannel_);
|
2018-04-20 19:54:45 +02:00
|
|
|
IndirectChannel getSelectedChannel() const;
|
2018-04-18 09:12:29 +02:00
|
|
|
bool hasSeletedChannel() const;
|
|
|
|
|
|
|
|
pajlada::Signals::NoArgSignal closed;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void closeEvent(QCloseEvent *) override;
|
2018-07-06 17:11:37 +02:00
|
|
|
virtual void themeChangedEvent() override;
|
2018-04-18 09:12:29 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
class EventFilter : public QObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SelectChannelDialog *dialog;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool eventFilter(QObject *watched, QEvent *event) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct {
|
2018-05-23 11:59:37 +02:00
|
|
|
Notebook *notebook;
|
2018-04-18 09:12:29 +02:00
|
|
|
struct {
|
|
|
|
QRadioButton *channel;
|
|
|
|
QLineEdit *channelName;
|
|
|
|
QRadioButton *whispers;
|
|
|
|
QRadioButton *mentions;
|
|
|
|
QRadioButton *watching;
|
|
|
|
} twitch;
|
2018-06-11 15:04:54 +02:00
|
|
|
} ui_;
|
2018-04-18 09:12:29 +02:00
|
|
|
|
2018-07-06 19:23:47 +02:00
|
|
|
EventFilter tabFilter_;
|
2018-04-18 09:12:29 +02:00
|
|
|
|
2018-07-06 19:23:47 +02:00
|
|
|
ChannelPtr selectedChannel_;
|
|
|
|
bool hasSelectedChannel_ = false;
|
2018-04-18 09:12:29 +02:00
|
|
|
|
|
|
|
void ok();
|
|
|
|
friend class EventFilter;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|