More progress on tab-complete

There are missing parts to the "account-based" emotes that needs to be
completed before emote completion can be considered done. For now, when
I've been testing, I've been manually injecting the oauthClient and
oauthToken to the settings file with the `user_subscriptions` scope
This commit is contained in:
Rasmus Karlsson
2017-07-23 14:16:13 +02:00
parent e4fc6c25e6
commit 3bf111a091
19 changed files with 212 additions and 69 deletions
+1
View File
@@ -37,6 +37,7 @@ static int index = 0;
ChatWidget::ChatWidget(ChannelManager &_channelManager, NotebookPage *parent)
: BaseWidget(parent)
, channelManager(_channelManager)
, completionManager(parent->completionManager)
, channel(_channelManager.emptyChannel)
, vbox(this)
, header(this)
+4 -1
View File
@@ -21,6 +21,7 @@ namespace chatterino {
class ChannelManager;
class ColorScheme;
class CompletionManager;
namespace widgets {
@@ -59,9 +60,11 @@ public:
protected:
virtual void paintEvent(QPaintEvent *) override;
private:
public:
ChannelManager &channelManager;
CompletionManager &completionManager;
private:
void setChannel(std::shared_ptr<Channel> newChannel);
void detachChannel();
+3 -2
View File
@@ -1,6 +1,7 @@
#include "widgets/chatwidgetinput.hpp"
#include "chatwidget.hpp"
#include "colorscheme.hpp"
#include "completionmanager.hpp"
#include "ircmanager.hpp"
#include "settingsmanager.hpp"
@@ -45,8 +46,8 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *_chatWidget)
this->refreshTheme();
this->setMessageLengthVisible(SettingsManager::getInstance().showMessageLength.get());
// TODO: Fill in this QCompleter model using our CompletionManager
auto completer = new QCompleter();
auto completer = new QCompleter(
this->chatWidget->completionManager.createModel(this->chatWidget->channelName));
this->textInput.setCompleter(completer);
+3 -1
View File
@@ -19,10 +19,12 @@
namespace chatterino {
namespace widgets {
MainWindow::MainWindow(ChannelManager &_channelManager, ColorScheme &_colorScheme)
MainWindow::MainWindow(ChannelManager &_channelManager, ColorScheme &_colorScheme,
CompletionManager &_completionManager)
: BaseWidget(_colorScheme, nullptr)
, channelManager(_channelManager)
, colorScheme(_colorScheme)
, completionManager(_completionManager)
, notebook(this->channelManager, this)
, windowGeometry("/windows/0/geometry")
{
+6 -1
View File
@@ -17,6 +17,7 @@ namespace chatterino {
class ChannelManager;
class ColorScheme;
class CompletionManager;
namespace widgets {
@@ -25,7 +26,8 @@ class MainWindow : public BaseWidget
Q_OBJECT
public:
explicit MainWindow(ChannelManager &_channelManager, ColorScheme &_colorScheme);
explicit MainWindow(ChannelManager &_channelManager, ColorScheme &_colorScheme,
CompletionManager &_completionManager);
~MainWindow();
void layoutVisibleChatWidgets(Channel *channel = nullptr);
@@ -48,6 +50,7 @@ private:
ChannelManager &channelManager;
ColorScheme &colorScheme;
CompletionManager &completionManager;
Notebook notebook;
bool loaded = false;
@@ -144,6 +147,8 @@ private:
};
pajlada::Settings::Setting<QRectWrapper, QRectWrapper> windowGeometry;
friend class Notebook;
};
} // namespace widgets
+3 -1
View File
@@ -1,5 +1,6 @@
#include "widgets/notebook.hpp"
#include "colorscheme.hpp"
#include "widgets/mainwindow.hpp"
#include "widgets/notebookbutton.hpp"
#include "widgets/notebookpage.hpp"
#include "widgets/notebooktab.hpp"
@@ -18,9 +19,10 @@
namespace chatterino {
namespace widgets {
Notebook::Notebook(ChannelManager &_channelManager, BaseWidget *parent)
Notebook::Notebook(ChannelManager &_channelManager, MainWindow *parent)
: BaseWidget(parent)
, channelManager(_channelManager)
, completionManager(parent->completionManager)
, addButton(this)
, settingsButton(this)
, userButton(this)
+7 -3
View File
@@ -12,10 +12,12 @@
namespace chatterino {
class ChannelManager;
class ColorScheme;
class CompletionManager;
namespace widgets {
class MainWindow;
class Notebook : public BaseWidget
{
Q_OBJECT
@@ -23,7 +25,7 @@ class Notebook : public BaseWidget
public:
enum HighlightType { none, highlighted, newMessage };
explicit Notebook(ChannelManager &_channelManager, BaseWidget *parent);
explicit Notebook(ChannelManager &_channelManager, MainWindow *parent);
NotebookPage *addPage(bool select = false);
@@ -50,9 +52,11 @@ public slots:
void usersButtonClicked();
void addPageButtonClicked();
private:
public:
ChannelManager &channelManager;
CompletionManager &completionManager;
private:
QList<NotebookPage *> pages;
NotebookButton addButton;
+1
View File
@@ -25,6 +25,7 @@ std::pair<int, int> NotebookPage::dropPosition = std::pair<int, int>(-1, -1);
NotebookPage::NotebookPage(ChannelManager &_channelManager, Notebook *parent, NotebookTab *_tab)
: BaseWidget(parent->colorScheme, parent)
, channelManager(_channelManager)
, completionManager(parent->completionManager)
, tab(_tab)
, dropPreview(this)
{
+2
View File
@@ -18,6 +18,7 @@
namespace chatterino {
class ChannelManager;
class CompletionManager;
namespace widgets {
@@ -29,6 +30,7 @@ public:
NotebookPage(ChannelManager &_channelManager, Notebook *parent, NotebookTab *_tab);
ChannelManager &channelManager;
CompletionManager &completionManager;
std::pair<int, int> removeFromLayout(ChatWidget *widget);
void addToLayout(ChatWidget *widget, std::pair<int, int> position);