mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
added setting to open links in incognito by default
This commit is contained in:
parent
9d2665ab17
commit
87c0ff76e7
3 changed files with 13 additions and 9 deletions
|
@ -204,6 +204,7 @@ public:
|
|||
BoolSetting loadTwitchMessageHistoryOnConnect = {
|
||||
"/misc/twitch/loadMessageHistoryOnConnect", true};
|
||||
IntSetting emotesTooltipPreview = {"/misc/emotesTooltipPreview", 0};
|
||||
BoolSetting openLinksIncognito = {"/misc/openLinksIncognito", 0};
|
||||
|
||||
QStringSetting cachePath = {"/cache/path", ""};
|
||||
|
||||
|
|
|
@ -1528,14 +1528,8 @@ void ChannelView::addContextMenuItems(
|
|||
QString url = hoveredElement->getLink().value;
|
||||
|
||||
// open link
|
||||
bool incognitoByDefault = supportsIncognitoLinks() &&
|
||||
layout->getMessage()->loginName == "hemirt";
|
||||
menu->addAction("Open link", [url, incognitoByDefault] {
|
||||
if (incognitoByDefault)
|
||||
openLinkIncognito(url);
|
||||
else
|
||||
QDesktopServices::openUrl(QUrl(url));
|
||||
});
|
||||
menu->addAction("Open link",
|
||||
[url] { QDesktopServices::openUrl(QUrl(url)); });
|
||||
// open link default
|
||||
if (supportsIncognitoLinks())
|
||||
{
|
||||
|
@ -1701,6 +1695,9 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link,
|
|||
|
||||
case Link::Url:
|
||||
{
|
||||
if (getSettings()->openLinksIncognito && supportsIncognitoLinks())
|
||||
openLinkIncognito(link.value);
|
||||
else
|
||||
QDesktopServices::openUrl(QUrl(link.value));
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "singletons/WindowManager.hpp"
|
||||
#include "util/FuzzyConvert.hpp"
|
||||
#include "util/Helpers.hpp"
|
||||
#include "util/IncognitoBrowser.hpp"
|
||||
#include "widgets/BaseWindow.hpp"
|
||||
#include "widgets/helper/Line.hpp"
|
||||
|
||||
|
@ -377,6 +378,11 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
|||
|
||||
layout.addTitle("Miscellaneous");
|
||||
|
||||
if (supportsIncognitoLinks())
|
||||
{
|
||||
layout.addCheckbox("Open links in incognito/private mode",
|
||||
s.openLinksIncognito);
|
||||
}
|
||||
layout.addCheckbox("Show moderation messages", s.hideModerationActions,
|
||||
true);
|
||||
layout.addCheckbox("Random username color for users who never set a color",
|
||||
|
|
Loading…
Reference in a new issue