diff --git a/chatterino.pro b/chatterino.pro index 8f90bc343..ac3242c54 100644 --- a/chatterino.pro +++ b/chatterino.pro @@ -217,7 +217,8 @@ SOURCES += \ src/providers/irc/ircconnection2.cpp \ src/widgets/userinfopopup.cpp \ src/widgets/welcomedialog.cpp \ - src/widgets/label.cpp + src/widgets/label.cpp \ + src/widgets/settingspages/browserextensionpage.cpp HEADERS += \ src/precompiled_header.hpp \ @@ -379,7 +380,8 @@ HEADERS += \ src/widgets/welcomedialog.hpp \ src/util/clamp.hpp \ src/widgets/label.hpp \ - src/util/combine_path.hpp + src/util/combine_path.hpp \ + src/widgets/settingspages/browserextensionpage.hpp RESOURCES += \ resources/resources.qrc diff --git a/src/widgets/settingsdialog.cpp b/src/widgets/settingsdialog.cpp index 4598c0cac..35e6717eb 100644 --- a/src/widgets/settingsdialog.cpp +++ b/src/widgets/settingsdialog.cpp @@ -7,6 +7,7 @@ #include "widgets/settingspages/accountspage.hpp" #include "widgets/settingspages/appearancepage.hpp" #include "widgets/settingspages/behaviourpage.hpp" +#include "widgets/settingspages/browserextensionpage.hpp" #include "widgets/settingspages/commandpage.hpp" #include "widgets/settingspages/emotespage.hpp" #include "widgets/settingspages/externaltoolspage.hpp" @@ -96,6 +97,7 @@ void SettingsDialog::addTabs() // this->addTab(new settingspages::LogsPage); this->addTab(new settingspages::ModerationPage); // this->addTab(new settingspages::SpecialChannelsPage); + this->addTab(new settingspages::BrowserExtensionPage); this->addTab(new settingspages::ExternalToolsPage); this->ui_.tabContainer->addStretch(1); diff --git a/src/widgets/settingspages/browserextensionpage.cpp b/src/widgets/settingspages/browserextensionpage.cpp new file mode 100644 index 000000000..60530051b --- /dev/null +++ b/src/widgets/settingspages/browserextensionpage.cpp @@ -0,0 +1,37 @@ +#include "browserextensionpage.hpp" + +#include "util/layoutcreator.hpp" + +#include + +#define CHROME_EXTENSION_LINK \ + "https://chrome.google.com/webstore/detail/chatterino-native-host/" \ + "glknmaideaikkmemifbfkhnomoknepka" +#define FIREFOX_EXTENSION_LINK "https://addons.mozilla.org/de/firefox/addon/chatterino-native-host/" + +namespace chatterino { +namespace widgets { +namespace settingspages { + +BrowserExtensionPage::BrowserExtensionPage() + : SettingsPage("Browser Extension", "") +{ + auto layout = util::LayoutCreator(this).setLayoutType(); + + auto label = + layout.emplace("The browser extension will replace the default Twitch.tv chat with " + "chatterino while chatterino is running."); + label->setWordWrap(true); + + auto chrome = layout.emplace("Download for Google Chrome"); + chrome->setOpenExternalLinks(true); + auto firefox = layout.emplace("Download for Mozilla Firefox"); + firefox->setOpenExternalLinks(true); + layout->addStretch(1); +} + +} // namespace settingspages +} // namespace widgets +} // namespace chatterino diff --git a/src/widgets/settingspages/browserextensionpage.hpp b/src/widgets/settingspages/browserextensionpage.hpp new file mode 100644 index 000000000..3bcc6eadd --- /dev/null +++ b/src/widgets/settingspages/browserextensionpage.hpp @@ -0,0 +1,17 @@ +#pragma once + +#include "widgets/settingspages/settingspage.hpp" + +namespace chatterino { +namespace widgets { +namespace settingspages { + +class BrowserExtensionPage : public SettingsPage +{ +public: + BrowserExtensionPage(); +}; + +} // namespace settingspages +} // namespace widgets +} // namespace chatterino diff --git a/src/widgets/window.cpp b/src/widgets/window.cpp index ba1f128ea..a0eb611ce 100644 --- a/src/widgets/window.cpp +++ b/src/widgets/window.cpp @@ -16,6 +16,7 @@ #include "widgets/welcomedialog.hpp" #include +#include #include #include #include @@ -248,6 +249,18 @@ void Window::showEvent(QShowEvent *event) box->show(); } + if (getApp()->settings->currentVersion.getValue() != "" && + getApp()->settings->currentVersion.getValue() != CHATTERINO_VERSION) { + auto box = new QMessageBox(QMessageBox::Information, "Chatterino 2 Beta", "Show changelog?", + QMessageBox::Yes | QMessageBox::No); + box->setAttribute(Qt::WA_DeleteOnClose); + if (box->exec() == QMessageBox::Yes) { + QDesktopServices::openUrl(QUrl("https://fourtf.com/chatterino-changelog/")); + } + + getApp()->settings->currentVersion.setValue(CHATTERINO_VERSION); + } + BaseWindow::showEvent(event); }