temp stuff

This commit is contained in:
apa420
2018-08-12 15:29:40 +02:00
parent 2de99ca9f5
commit 54166ec130
8 changed files with 185 additions and 50 deletions
+30 -6
View File
@@ -38,14 +38,15 @@ NotificationPage::NotificationPage()
settings->addStretch(1);
}
auto channels = tabs.appendTab(new QVBoxLayout, "Channels");
auto twitchChannels = tabs.appendTab(new QVBoxLayout, "Twitch");
{
int i = 0;
EditableModelView *view =
channels
twitchChannels
.emplace<EditableModelView>(
getApp()->notifications->createModel(nullptr))
getApp()->notifications->createModel(nullptr, i))
.getElement();
view->setTitles({"Channels"});
view->setTitles({"Twitch channels"});
view->getTableView()->horizontalHeader()->setSectionResizeMode(
QHeaderView::Fixed);
@@ -58,8 +59,31 @@ NotificationPage::NotificationPage()
});
view->addButtonPressed.connect([] {
getApp()->notifications->notificationVector.appendItem(
"channel");
getApp()->notifications->twitchVector.appendItem("channel");
});
}
auto mixerChannels = tabs.appendTab(new QVBoxLayout, "Mixer");
{
int i = 1;
EditableModelView *view =
mixerChannels
.emplace<EditableModelView>(
getApp()->notifications->createModel(nullptr, i))
.getElement();
view->setTitles({"Mixer channels"});
view->getTableView()->horizontalHeader()->setSectionResizeMode(
QHeaderView::Fixed);
view->getTableView()->horizontalHeader()->setSectionResizeMode(
0, QHeaderView::Stretch);
QTimer::singleShot(1, [view] {
view->getTableView()->resizeColumnsToContents();
view->getTableView()->setColumnWidth(0, 200);
});
view->addButtonPressed.connect([] {
getApp()->notifications->mixerVector.appendItem("channel");
});
}
}
+5 -2
View File
@@ -159,13 +159,16 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
auto action = new QAction(this);
action->setText("Notify when live");
action->setCheckable(true);
QObject::connect(menu.get(), &QMenu::aboutToShow, this, [action, this]() {
int i = 0;
action->setChecked(getApp()->notifications->isChannelNotified(
this->split_->getChannel()->getName()));
this->split_->getChannel()->getName(), i));
});
action->connect(action, &QAction::triggered, this, [this]() {
int i = 0;
getApp()->notifications->updateChannelNotification(
this->split_->getChannel()->getName());
this->split_->getChannel()->getName(), i);
});
menu->addAction(action);