reload working fine with f6, f5 seems to be special

This commit is contained in:
Marco Schmid 2018-10-22 22:46:55 +02:00 committed by fourtf
parent 0f44a2e0f4
commit 077e2e089d
2 changed files with 15 additions and 0 deletions

View file

@ -1,5 +1,6 @@
#include "widgets/splits/Split.hpp" #include "widgets/splits/Split.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "common/Common.hpp" #include "common/Common.hpp"
#include "common/NetworkRequest.hpp" #include "common/NetworkRequest.hpp"
#include "debug/Log.hpp" #include "debug/Log.hpp"
@ -105,6 +106,9 @@ Split::Split(QWidget *parent)
// CTRL+F: Search // CTRL+F: Search
createShortcut(this, "CTRL+F", &Split::showSearch); createShortcut(this, "CTRL+F", &Split::showSearch);
// F5: reload emotes
createShortcut(this, "F6", &Split::reloadChannelAndSubscriberEmotes);
// F12 // F12
createShortcut(this, "F10", [] { createShortcut(this, "F10", [] {
auto *popup = new DebugPopup; auto *popup = new DebugPopup;
@ -646,6 +650,16 @@ void Split::showSearch()
popup->show(); popup->show();
} }
void Split::reloadChannelAndSubscriberEmotes()
{
getApp()->accounts->twitch.getCurrent()->loadEmotes();
auto channel = this->getChannel();
if (auto twitchChannel = dynamic_cast<TwitchChannel *>(channel.get()))
twitchChannel->refreshChannelEmotes();
}
template <typename Iter, typename RandomGenerator> template <typename Iter, typename RandomGenerator>
static Iter select_randomly(Iter start, Iter end, RandomGenerator &g) static Iter select_randomly(Iter start, Iter end, RandomGenerator &g)
{ {

View file

@ -130,6 +130,7 @@ public slots:
void copyToClipboard(); void copyToClipboard();
void showSearch(); void showSearch();
void showViewerList(); void showViewerList();
void reloadChannelAndSubscriberEmotes();
}; };
} // namespace chatterino } // namespace chatterino