improved saving of splits and watching split

This commit is contained in:
fourtf
2018-04-20 22:33:28 +02:00
parent a16a2b0579
commit 5015633cc7
7 changed files with 60 additions and 21 deletions
+12 -9
View File
@@ -154,12 +154,13 @@ void SplitHeader::scaleChangedEvent(float scale)
void SplitHeader::updateChannelText()
{
auto indirectChannel = this->split->getIndirectChannel();
auto channel = this->split->getChannel();
const QString channelName = channel->name;
if (channelName.isEmpty()) {
this->titleLabel->setText("<no channel>");
return;
QString title = channel->name;
if (indirectChannel.getType() == Channel::TwitchWatching) {
title = "watching: " + (title.isEmpty() ? "none" : title);
}
TwitchChannel *twitchChannel = dynamic_cast<TwitchChannel *>(channel.get());
@@ -178,17 +179,19 @@ void SplitHeader::updateChannelText()
" viewers"
"</p>";
if (streamStatus.rerun) {
this->titleLabel->setText(channelName + " (rerun)");
title += " (rerun)";
} else {
this->titleLabel->setText(channelName + " (live)");
title += " (live)";
}
return;
}
}
if (title.isEmpty()) {
title = "<empty>";
}
this->isLive = false;
this->titleLabel->setText(channelName);
this->titleLabel->setText(title);
this->tooltip = "";
}
+1 -1
View File
@@ -146,7 +146,7 @@ void SelectChannelDialog::setSelectedChannel(IndirectChannel _channel)
this->selectedChannel = channel;
switch (channel->getType()) {
switch (_channel.getType()) {
case Channel::Twitch: {
this->ui.notebook->selectIndex(TAB_TWITCH);
this->ui.twitch.channel->setFocus();
+3 -3
View File
@@ -134,13 +134,13 @@ ChannelPtr Split::getChannel()
void Split::setChannel(IndirectChannel newChannel)
{
this->channel = newChannel;
this->view.setChannel(newChannel.get());
this->usermodeChangedConnection.disconnect();
this->indirectChannelChangedConnection.disconnect();
this->channel = newChannel;
TwitchChannel *tc = dynamic_cast<TwitchChannel *>(newChannel.get().get());
if (tc != nullptr) {
@@ -199,7 +199,7 @@ void Split::showChangeChannelPopup(const char *dialogTitle, bool empty,
{
SelectChannelDialog *dialog = new SelectChannelDialog();
if (!empty) {
dialog->setSelectedChannel(this->getChannel());
dialog->setSelectedChannel(this->getIndirectChannel());
}
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();