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 = {
|
BoolSetting loadTwitchMessageHistoryOnConnect = {
|
||||||
"/misc/twitch/loadMessageHistoryOnConnect", true};
|
"/misc/twitch/loadMessageHistoryOnConnect", true};
|
||||||
IntSetting emotesTooltipPreview = {"/misc/emotesTooltipPreview", 0};
|
IntSetting emotesTooltipPreview = {"/misc/emotesTooltipPreview", 0};
|
||||||
|
BoolSetting openLinksIncognito = {"/misc/openLinksIncognito", 0};
|
||||||
|
|
||||||
QStringSetting cachePath = {"/cache/path", ""};
|
QStringSetting cachePath = {"/cache/path", ""};
|
||||||
|
|
||||||
|
|
|
@ -1528,14 +1528,8 @@ void ChannelView::addContextMenuItems(
|
||||||
QString url = hoveredElement->getLink().value;
|
QString url = hoveredElement->getLink().value;
|
||||||
|
|
||||||
// open link
|
// open link
|
||||||
bool incognitoByDefault = supportsIncognitoLinks() &&
|
menu->addAction("Open link",
|
||||||
layout->getMessage()->loginName == "hemirt";
|
[url] { QDesktopServices::openUrl(QUrl(url)); });
|
||||||
menu->addAction("Open link", [url, incognitoByDefault] {
|
|
||||||
if (incognitoByDefault)
|
|
||||||
openLinkIncognito(url);
|
|
||||||
else
|
|
||||||
QDesktopServices::openUrl(QUrl(url));
|
|
||||||
});
|
|
||||||
// open link default
|
// open link default
|
||||||
if (supportsIncognitoLinks())
|
if (supportsIncognitoLinks())
|
||||||
{
|
{
|
||||||
|
@ -1701,6 +1695,9 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link,
|
||||||
|
|
||||||
case Link::Url:
|
case Link::Url:
|
||||||
{
|
{
|
||||||
|
if (getSettings()->openLinksIncognito && supportsIncognitoLinks())
|
||||||
|
openLinkIncognito(link.value);
|
||||||
|
else
|
||||||
QDesktopServices::openUrl(QUrl(link.value));
|
QDesktopServices::openUrl(QUrl(link.value));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "singletons/WindowManager.hpp"
|
#include "singletons/WindowManager.hpp"
|
||||||
#include "util/FuzzyConvert.hpp"
|
#include "util/FuzzyConvert.hpp"
|
||||||
#include "util/Helpers.hpp"
|
#include "util/Helpers.hpp"
|
||||||
|
#include "util/IncognitoBrowser.hpp"
|
||||||
#include "widgets/BaseWindow.hpp"
|
#include "widgets/BaseWindow.hpp"
|
||||||
#include "widgets/helper/Line.hpp"
|
#include "widgets/helper/Line.hpp"
|
||||||
|
|
||||||
|
@ -377,6 +378,11 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
||||||
|
|
||||||
layout.addTitle("Miscellaneous");
|
layout.addTitle("Miscellaneous");
|
||||||
|
|
||||||
|
if (supportsIncognitoLinks())
|
||||||
|
{
|
||||||
|
layout.addCheckbox("Open links in incognito/private mode",
|
||||||
|
s.openLinksIncognito);
|
||||||
|
}
|
||||||
layout.addCheckbox("Show moderation messages", s.hideModerationActions,
|
layout.addCheckbox("Show moderation messages", s.hideModerationActions,
|
||||||
true);
|
true);
|
||||||
layout.addCheckbox("Random username color for users who never set a color",
|
layout.addCheckbox("Random username color for users who never set a color",
|
||||||
|
|
Loading…
Reference in a new issue