Skip to content

Commit

Permalink
this commit is too big
Browse files Browse the repository at this point in the history
  • Loading branch information
fourtf committed Aug 2, 2018
1 parent 3b3c5d8 commit c2e2dfb
Show file tree
Hide file tree
Showing 186 changed files with 3,616 additions and 2,646 deletions.
51 changes: 44 additions & 7 deletions chatterino.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,23 @@ message(----)
QT += widgets core gui network multimedia svg
CONFIG += communi
COMMUNI += core model util
CONFIG += c++14
INCLUDEPATH += src/
TARGET = chatterino
TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS
PRECOMPILED_HEADER = src/PrecompiledHeader.hpp
CONFIG += precompile_header

win32-msvc* {
QMAKE_CXXFLAGS = /std=c++17
} else {
QMAKE_CXXFLAGS = -std=c++17
}

debug {
DEFINES += QT_DEBUG
}

useBreakpad {
LIBS += -L$$PWD/lib/qBreakpad/handler/build
include(lib/qBreakpad/qBreakpad.pri)
Expand Down Expand Up @@ -132,9 +141,7 @@ SOURCES += \
src/messages/MessageBuilder.cpp \
src/messages/MessageColor.cpp \
src/messages/MessageElement.cpp \
src/providers/bttv/BttvEmotes.cpp \
src/providers/emoji/Emojis.cpp \
src/providers/ffz/FfzEmotes.cpp \
src/providers/irc/AbstractIrcServer.cpp \
src/providers/irc/IrcAccount.cpp \
src/providers/irc/IrcChannel2.cpp \
Expand Down Expand Up @@ -232,7 +239,21 @@ SOURCES += \
src/widgets/dialogs/UpdateDialog.cpp \
src/widgets/settingspages/IgnoresPage.cpp \
src/providers/twitch/PubsubClient.cpp \
src/providers/twitch/TwitchApi.cpp
src/providers/twitch/TwitchApi.cpp \
src/messages/Emote.cpp \
src/messages/EmoteMap.cpp \
src/messages/ImageSet.cpp \
src/providers/bttv/BttvEmotes.cpp \
src/providers/ffz/FfzEmotes.cpp \
src/autogenerated/ResourcesAutogen.cpp \
src/singletons/Badges.cpp \
src/providers/twitch/TwitchBadges.cpp \
src/providers/chatterino/ChatterinoBadges.cpp \
src/providers/twitch/TwitchParseCheerEmotes.cpp \
src/providers/bttv/LoadBttvChannelEmote.cpp \
src/util/JsonQuery.cpp \
src/RunGui.cpp \
src/BrowserExtension.cpp

HEADERS += \
src/Application.hpp \
Expand Down Expand Up @@ -292,9 +313,7 @@ HEADERS += \
src/messages/MessageParseArgs.hpp \
src/messages/Selection.hpp \
src/PrecompiledHeader.hpp \
src/providers/bttv/BttvEmotes.hpp \
src/providers/emoji/Emojis.hpp \
src/providers/ffz/FfzEmotes.hpp \
src/providers/irc/AbstractIrcServer.hpp \
src/providers/irc/IrcAccount.hpp \
src/providers/irc/IrcChannel2.hpp \
Expand Down Expand Up @@ -413,10 +432,28 @@ HEADERS += \
src/widgets/dialogs/UpdateDialog.hpp \
src/widgets/settingspages/IgnoresPage.hpp \
src/providers/twitch/PubsubClient.hpp \
src/providers/twitch/TwitchApi.hpp
src/providers/twitch/TwitchApi.hpp \
src/messages/Emote.hpp \
src/messages/EmoteMap.hpp \
src/messages/EmoteCache.hpp \
src/messages/ImageSet.hpp \
src/common/Outcome.hpp \
src/providers/bttv/BttvEmotes.hpp \
src/providers/ffz/FfzEmotes.hpp \
src/autogenerated/ResourcesAutogen.hpp \
src/singletons/Badges.hpp \
src/providers/twitch/TwitchBadges.hpp \
src/providers/chatterino/ChatterinoBadges.hpp \
src/common/Aliases.hpp \
src/providers/twitch/TwitchParseCheerEmotes.hpp \
src/providers/bttv/LoadBttvChannelEmote.hpp \
src/util/JsonQuery.hpp \
src/RunGui.hpp \
src/BrowserExtension.hpp

RESOURCES += \
resources/resources.qrc \
resources/resources_autogenerated.qrc

DISTFILES +=

Expand Down
Binary file not shown.
38 changes: 38 additions & 0 deletions resources/_generate_resources.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
resources_header = \
'''<RCC>
<qresource prefix="/">'''

resources_footer = \
''' </qresource>
</RCC>'''

header_header = \
'''#include <QPixmap>
#include "common/Singleton.hpp"
namespace chatterino {
class Resources2 : public Singleton {
public:
Resources2();
'''

header_footer = \
'''};
} // namespace chatterino'''

source_header = \
'''#include "ResourcesAutogen.hpp"
namespace chatterino {
Resources2::Resources2()
{
'''

source_footer = \
'''}
} // namespace chatterino'''
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Binary file added resources/error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions resources/generate_resources.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env python3
from pathlib import Path

from _generate_resources import *

ignored_files = ['qt.conf', 'resources.qrc', 'resources_autogenerated.qrc', 'windows.rc',
'generate_resources.py', '_generate_resources.py']
ignored_directories = ['__pycache__']

def isNotIgnored(file):
return str(file) not in ignored_files

all_files = list(filter(isNotIgnored, \
filter(Path.is_file, Path('.').glob('**/*'))))
image_files = list(filter(isNotIgnored, \
filter(Path.is_file, Path('.').glob('**/*.png'))))

with open('./resources_autogenerated.qrc', 'w') as out:
out.write(resources_header)
for file in all_files:
out.write(f" <file>{str(file)}</file>\n")
out.write(resources_footer)

with open('../src/autogenerated/ResourcesAutogen.cpp', 'w') as out:
out.write(source_header)
for file in sorted(image_files):
var_name = str(file.with_suffix("")).replace("/",".")
out.write(f' this->{var_name}')
out.write(f' = QPixmap(":/{file}");\n')
out.write(source_footer)

def writeHeader(out, name, element, indent):
if isinstance(element, dict):
if name != "":
out.write(f"{indent}struct {{\n")
for (key, value) in element.items():
writeHeader(out, key, value, indent + ' ')
if name != "":
out.write(f"{indent}}} {name};\n");
else:
out.write(f"{indent}QPixmap {element};\n")

with open('../src/autogenerated/ResourcesAutogen.hpp', 'w') as out:
out.write(header_header)

elements = {}
for file in sorted(image_files):
elements_ref = elements
directories = str(file).split('/')[:-1]
filename = file.stem
for directory in directories:
if directory not in elements_ref:
if directory not in ignored_directories:
elements_ref[directory] = {}
elements_ref = elements_ref[directory]
elements_ref[filename] = filename

writeHeader(out, "", elements, '')

out.write(header_footer)

File renamed without changes
Binary file removed resources/images/AppearanceEditorPart_16x.png
Binary file not shown.
Binary file removed resources/images/BrowserLink_16x.png
Binary file not shown.
Binary file removed resources/images/CopyLongTextToClipboard_16x.png
Binary file not shown.
Binary file removed resources/images/CustomActionEditor_16x.png
Binary file not shown.
Binary file removed resources/images/Emoji_Color_1F60A_19 old.png
Binary file not shown.
Binary file removed resources/images/Emoji_Color_1F60A_19.png
Binary file not shown.
Binary file removed resources/images/Filter_16x.png
Binary file not shown.
Binary file removed resources/images/Message_16xLG.png
Diff not rendered.
Diff not rendered.
Binary file removed resources/images/UserProfile_22x.png
Diff not rendered.
Binary file removed resources/images/VSO_Link_blue_16x.png
Diff not rendered.
Binary file removed resources/images/cheer100.png
Diff not rendered.
Binary file removed resources/images/cheer1000.png
Diff not rendered.
Binary file removed resources/images/cheer10000.png
Diff not rendered.
Binary file removed resources/images/cheer100000.png
Diff not rendered.
Binary file removed resources/images/cheer5000.png
Diff not rendered.
Binary file removed resources/images/collapse.png
Diff not rendered.
Binary file removed resources/images/format_Bold_16xLG.png
Diff not rendered.
Binary file removed resources/images/settings.png
Diff not rendered.
Binary file removed resources/images/tool_moreCollapser_off16.png
Diff not rendered.
File renamed without changes
83 changes: 3 additions & 80 deletions resources/resources.qrc
Original file line number Diff line number Diff line change
@@ -1,82 +1,5 @@
<RCC>
<qresource prefix="/">
<file>images/AppearanceEditorPart_16x.png</file>
<file>images/BrowserLink_16x.png</file>
<file>images/cheer1.png</file>
<file>images/cheer100.png</file>
<file>images/cheer1000.png</file>
<file>images/cheer10000.png</file>
<file>images/cheer100000.png</file>
<file>images/cheer5000.png</file>
<file>images/verified.png</file>
<file>images/CopyLongTextToClipboard_16x.png</file>
<file>images/CustomActionEditor_16x.png</file>
<file>images/Emoji_Color_1F60A_19.png</file>
<file>images/Filter_16x.png</file>
<file>images/format_Bold_16xLG.png</file>
<file>images/Message_16xLG.png</file>
<file>images/settings.png</file>
<file>images/tool_moreCollapser_off16.png</file>
<file>images/twitchprime_bg.png</file>
<file>qss/settings.qss</file>
<file>images/admin_bg.png</file>
<file>images/broadcaster_bg.png</file>
<file>images/globalmod_bg.png</file>
<file>images/moderator_bg.png</file>
<file>images/staff_bg.png</file>
<file>images/turbo_bg.png</file>
<file>emojidata.txt</file>
<file>images/button_ban.png</file>
<file>images/button_timeout.png</file>
<file>images/StatusAnnotations_Blocked_16xLG_color.png</file>
<file>images/UserProfile_22x.png</file>
<file>images/VSO_Link_blue_16x.png</file>
<file>sounds/ping2.wav</file>
<file>images/subscriber.png</file>
<file>images/collapse.png</file>
<file>images/emote.svg</file>
<file>images/notifications.svg</file>
<file>images/behave.svg</file>
<file>images/theme.svg</file>
<file>images/accounts.svg</file>
<file>images/chatterino2.icns</file>
<file>images/icon.png</file>
<file>images/commands.svg</file>
<file>images/aboutlogo.png</file>
<file>images/about.svg</file>
<file>images/moderatormode_disabled.png</file>
<file>images/moderatormode_enabled.png</file>
<file>images/split/splitdown.png</file>
<file>images/split/splitleft.png</file>
<file>images/split/splitright.png</file>
<file>images/split/splitup.png</file>
<file>images/split/splitmove.png</file>
<file>licenses/boost_boost.txt</file>
<file>licenses/fmt_bsd2.txt</file>
<file>licenses/libcommuni_BSD3.txt</file>
<file>licenses/openssl.txt</file>
<file>licenses/pajlada_settings.txt</file>
<file>licenses/pajlada_signals.txt</file>
<file>licenses/qt_lgpl-3.0.txt</file>
<file>licenses/rapidjson.txt</file>
<file>licenses/websocketpp.txt</file>
<file>emoji.json</file>
<file>images/buttons/ban.png</file>
<file>images/buttons/mod.png</file>
<file>images/buttons/unban.png</file>
<file>images/buttons/unmod.png</file>
<file>images/emote_dark.svg</file>
<file>tlds.txt</file>
<file>images/menu_black.png</file>
<file>images/menu_white.png</file>
<file>contributors.txt</file>
<file>avatars/fourtf.png</file>
<file>avatars/pajlada.png</file>
<file>images/download_update.png</file>
<file>images/download_update_error.png</file>
<file>images/pajaDank.png</file>
</qresource>
<qresource prefix="/qt/etc">
<file>qt.conf</file>
</qresource>
<qresource prefix="/qt/etc">
<file>qt.conf</file>
</qresource>
</RCC>
64 changes: 64 additions & 0 deletions resources/resources_autogenerated.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<RCC>
<qresource prefix="/"> <file>pajaDank.png</file>
<file>icon.png</file>
<file>emojidata.txt</file>
<file>contributors.txt</file>
<file>error.png</file>
<file>emoji.json</file>
<file>icon.ico</file>
<file>tlds.txt</file>
<file>chatterino2.icns</file>
<file>qss/settings.qss</file>
<file>__pycache__/_generate_resources.cpython-36.pyc</file>
<file>licenses/fmt_bsd2.txt</file>
<file>licenses/openssl.txt</file>
<file>licenses/pajlada_settings.txt</file>
<file>licenses/qt_lgpl-3.0.txt</file>
<file>licenses/pajlada_signals.txt</file>
<file>licenses/rapidjson.txt</file>
<file>licenses/websocketpp.txt</file>
<file>licenses/boost_boost.txt</file>
<file>licenses/libcommuni_BSD3.txt</file>
<file>settings/aboutlogo.png</file>
<file>settings/behave.svg</file>
<file>settings/accounts.svg</file>
<file>settings/about.svg</file>
<file>settings/notifications.svg</file>
<file>settings/commands.svg</file>
<file>settings/theme.svg</file>
<file>split/up.png</file>
<file>split/left.png</file>
<file>split/move.png</file>
<file>split/right.png</file>
<file>split/down.png</file>
<file>buttons/unban.png</file>
<file>buttons/menuDark.png</file>
<file>buttons/mod.png</file>
<file>buttons/emote.svg</file>
<file>buttons/modModeEnabled2.png</file>
<file>buttons/ban.png</file>
<file>buttons/unmod.png</file>
<file>buttons/emoteDark.svg</file>
<file>buttons/updateError.png</file>
<file>buttons/modModeDisabled.png</file>
<file>buttons/modModeDisabled2.png</file>
<file>buttons/modModeEnabled.png</file>
<file>buttons/menuLight.png</file>
<file>buttons/update.png</file>
<file>buttons/timeout.png</file>
<file>buttons/banRed.png</file>
<file>sounds/ping2.wav</file>
<file>twitch/prime.png</file>
<file>twitch/verified.png</file>
<file>twitch/admin.png</file>
<file>twitch/subscriber.png</file>
<file>twitch/turbo.png</file>
<file>twitch/moderator.png</file>
<file>twitch/globalmod.png</file>
<file>twitch/cheer1.png</file>
<file>twitch/broadcaster.png</file>
<file>twitch/staff.png</file>
<file>avatars/fourtf.png</file>
<file>avatars/pajlada.png</file>
</qresource>
</RCC>
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit c2e2dfb

Please sign in to comment.