2018-01-23 21:33:49 +01:00
# include "ignoreuserspage.hpp"
# include "singletons/settingsmanager.hpp"
# include "util/layoutcreator.hpp"
# include <QCheckBox>
2018-01-23 23:10:27 +01:00
# include <QGroupBox>
2018-01-23 21:33:49 +01:00
# include <QLabel>
# include <QListView>
# include <QPushButton>
# include <QVBoxLayout>
// clang-format off
2018-01-23 23:10:27 +01:00
# define INFO " / ignore <user> in chat ignores a user\n / unignore <user> in chat unignores a user\n\nChatterino uses the twitch api for ignored users so they are shared with the webchat.\nIf you use your own oauth key make sure that it has the correct permissions.\n"
2018-01-23 21:33:49 +01:00
// clang-format on
namespace chatterino {
namespace widgets {
namespace settingspages {
2018-04-03 02:55:32 +02:00
2018-01-23 21:33:49 +01:00
IgnoreUsersPage : : IgnoreUsersPage ( )
2018-01-23 23:10:27 +01:00
: SettingsPage ( " Ignore Users " , " " )
2018-01-23 21:33:49 +01:00
{
singletons : : SettingManager & settings = singletons : : SettingManager : : getInstance ( ) ;
util : : LayoutCreator < IgnoreUsersPage > layoutCreator ( this ) ;
2018-01-23 21:56:25 +01:00
auto layout = layoutCreator . setLayoutType < QVBoxLayout > ( ) ;
2018-01-23 21:33:49 +01:00
auto label = layout . emplace < QLabel > ( INFO ) ;
label - > setWordWrap ( true ) ;
label - > setStyleSheet ( " color: #BBB " ) ;
2018-01-23 23:10:27 +01:00
auto group = layout . emplace < QGroupBox > ( " Ignored users " ) . setLayoutType < QVBoxLayout > ( ) ;
2018-01-23 21:33:49 +01:00
{
2018-01-23 23:10:27 +01:00
group . append (
this - > createCheckBox ( " Enable twitch ignored users " , settings . enableTwitchIgnoredUsers ) ) ;
auto anyways = group . emplace < QHBoxLayout > ( ) . withoutMargin ( ) ;
{
anyways . emplace < QLabel > ( " Show anyways if: " ) ;
anyways . emplace < QComboBox > ( ) ;
anyways - > addStretch ( 1 ) ;
}
auto addremove = group . emplace < QHBoxLayout > ( ) . withoutMargin ( ) ;
{
auto add = addremove . emplace < QPushButton > ( " Ignore user " ) ;
auto remove = addremove . emplace < QPushButton > ( " Unignore User " ) ;
addremove - > addStretch ( 1 ) ;
}
auto userList = group . emplace < QListView > ( ) ;
2018-01-23 21:33:49 +01:00
}
}
2018-04-03 02:55:32 +02:00
2018-01-23 21:33:49 +01:00
} // namespace settingspages
} // namespace widgets
} // namespace chatterino