added option to refresh only certain channels
This commit is contained in:
+4
-2
@@ -67,7 +67,8 @@ SOURCES += main.cpp\
|
||||
windows.cpp \
|
||||
chatwidgetheaderbutton.cpp \
|
||||
chatwidgetheaderbuttonlabel.cpp \
|
||||
channels.cpp
|
||||
channels.cpp \
|
||||
textinputform.cpp
|
||||
|
||||
HEADERS += mainwindow.h \
|
||||
chatwidget.h \
|
||||
@@ -106,7 +107,8 @@ HEADERS += mainwindow.h \
|
||||
windows.h \
|
||||
chatwidgetheaderbutton.h \
|
||||
chatwidgetheaderbuttonlabel.h \
|
||||
channels.h
|
||||
channels.h \
|
||||
textinputform.h
|
||||
|
||||
PRECOMPILED_HEADER =
|
||||
|
||||
|
||||
@@ -23,6 +23,12 @@ public:
|
||||
return m_view;
|
||||
}
|
||||
|
||||
Channel *
|
||||
channel() const
|
||||
{
|
||||
return m_channel;
|
||||
}
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
ChatWidgetHeaderButtonLabel::ChatWidgetHeaderButtonLabel()
|
||||
{
|
||||
setAlignment(Qt::AlignCenter);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+10
-6
@@ -27,7 +27,7 @@ MainWindow::~MainWindow()
|
||||
}
|
||||
|
||||
void
|
||||
MainWindow::layoutVisibleChatWidgets()
|
||||
MainWindow::layoutVisibleChatWidgets(Channel *channel)
|
||||
{
|
||||
auto *page = notebook.selected();
|
||||
|
||||
@@ -40,14 +40,16 @@ MainWindow::layoutVisibleChatWidgets()
|
||||
for (auto it = widgets.begin(); it != widgets.end(); ++it) {
|
||||
ChatWidget *widget = *it;
|
||||
|
||||
if (widget->view().layoutMessages()) {
|
||||
widget->repaint();
|
||||
if (channel == NULL || channel == widget->channel()) {
|
||||
if (widget->view().layoutMessages()) {
|
||||
widget->repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MainWindow::repaintVisibleChatWidgets()
|
||||
MainWindow::repaintVisibleChatWidgets(Channel *channel)
|
||||
{
|
||||
auto *page = notebook.selected();
|
||||
|
||||
@@ -60,7 +62,9 @@ MainWindow::repaintVisibleChatWidgets()
|
||||
for (auto it = widgets.begin(); it != widgets.end(); ++it) {
|
||||
ChatWidget *widget = *it;
|
||||
|
||||
widget->view().layoutMessages();
|
||||
widget->repaint();
|
||||
if (channel == NULL || channel == widget->channel()) {
|
||||
widget->view().layoutMessages();
|
||||
widget->repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -13,8 +13,8 @@ public:
|
||||
~MainWindow();
|
||||
Notebook notebook;
|
||||
|
||||
void layoutVisibleChatWidgets();
|
||||
void repaintVisibleChatWidgets();
|
||||
void layoutVisibleChatWidgets(Channel *channel = NULL);
|
||||
void repaintVisibleChatWidgets(Channel *channel = NULL);
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#include "textinputform.h"
|
||||
|
||||
TextInputForm::TextInputForm()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef TEXTINPUTFORM_H
|
||||
#define TEXTINPUTFORM_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class TextInputForm : public QDialog
|
||||
{
|
||||
public:
|
||||
TextInputForm();
|
||||
};
|
||||
|
||||
#endif // TEXTINPUTFORM_H
|
||||
+4
-4
@@ -5,13 +5,13 @@ QMutex Windows::m_windowMutex;
|
||||
MainWindow *Windows::m_mainWindow(NULL);
|
||||
|
||||
void
|
||||
Windows::layoutVisibleChatWidgets()
|
||||
Windows::layoutVisibleChatWidgets(Channel *channel)
|
||||
{
|
||||
m_mainWindow->layoutVisibleChatWidgets();
|
||||
m_mainWindow->layoutVisibleChatWidgets(channel);
|
||||
}
|
||||
|
||||
void
|
||||
Windows::repaintVisibleChatWidgets()
|
||||
Windows::repaintVisibleChatWidgets(Channel *channel)
|
||||
{
|
||||
m_mainWindow->repaintVisibleChatWidgets();
|
||||
m_mainWindow->repaintVisibleChatWidgets(channel);
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
class Windows
|
||||
{
|
||||
public:
|
||||
static void layoutVisibleChatWidgets();
|
||||
static void repaintVisibleChatWidgets();
|
||||
static void layoutVisibleChatWidgets(Channel *channel = NULL);
|
||||
static void repaintVisibleChatWidgets(Channel *channel = NULL);
|
||||
|
||||
static MainWindow &
|
||||
mainWindow()
|
||||
|
||||
Reference in New Issue
Block a user