add option to open video with external program by default
This commit is contained in:
parent
74a4e36f90
commit
88d86405f8
@ -2913,6 +2913,11 @@ Reason: %4</translation>
|
|||||||
<source>Open images with external program</source>
|
<source>Open images with external program</source>
|
||||||
<translation>Open images with external program</translation>
|
<translation>Open images with external program</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+2"/>
|
||||||
|
<source>Open videos with external program</source>
|
||||||
|
<translation>Open videos with external program</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>Decrypt messages in sidebar</source>
|
<source>Decrypt messages in sidebar</source>
|
||||||
|
@ -52,7 +52,7 @@ Item {
|
|||||||
height: parent.height - fileInfoLabel.height
|
height: parent.height - fileInfoLabel.height
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
onTapped: mediaControls.showControls()
|
onTapped: Settings.openVideoExternal ? room.openMedia(eventId) : mediaControls.showControls()
|
||||||
}
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
|
@ -82,11 +82,12 @@ UserSettings::load(std::optional<QString> profile)
|
|||||||
|
|
||||||
font_ = settings.value(QStringLiteral("user/font_family"), "").toString();
|
font_ = settings.value(QStringLiteral("user/font_family"), "").toString();
|
||||||
|
|
||||||
avatarCircles_ = settings.value(QStringLiteral("user/avatar_circles"), true).toBool();
|
avatarCircles_ = settings.value(QStringLiteral("user/avatar_circles"), true).toBool();
|
||||||
useIdenticon_ = settings.value(QStringLiteral("user/use_identicon"), true).toBool();
|
useIdenticon_ = settings.value(QStringLiteral("user/use_identicon"), true).toBool();
|
||||||
openImageExternal_ = settings.value(QStringLiteral("user/open_image_external"), false).toBool();
|
openImageExternal_ = settings.value(QStringLiteral("user/open_image_external"), false).toBool();
|
||||||
decryptSidebar_ = settings.value(QStringLiteral("user/decrypt_sidebar"), true).toBool();
|
openVideoExternal_ = settings.value(QStringLiteral("user/open_video_external"), false).toBool();
|
||||||
privacyScreen_ = settings.value(QStringLiteral("user/privacy_screen"), false).toBool();
|
decryptSidebar_ = settings.value(QStringLiteral("user/decrypt_sidebar"), true).toBool();
|
||||||
|
privacyScreen_ = settings.value(QStringLiteral("user/privacy_screen"), false).toBool();
|
||||||
privacyScreenTimeout_ =
|
privacyScreenTimeout_ =
|
||||||
settings.value(QStringLiteral("user/privacy_screen_timeout"), 0).toInt();
|
settings.value(QStringLiteral("user/privacy_screen_timeout"), 0).toInt();
|
||||||
mobileMode_ = settings.value(QStringLiteral("user/mobile_mode"), false).toBool();
|
mobileMode_ = settings.value(QStringLiteral("user/mobile_mode"), false).toBool();
|
||||||
@ -698,6 +699,16 @@ UserSettings::setOpenImageExternal(bool state)
|
|||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
UserSettings::setOpenVideoExternal(bool state)
|
||||||
|
{
|
||||||
|
if (state == openVideoExternal_)
|
||||||
|
return;
|
||||||
|
openVideoExternal_ = state;
|
||||||
|
emit openVideoExternalChanged(openVideoExternal_);
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
UserSettings::applyTheme()
|
UserSettings::applyTheme()
|
||||||
{
|
{
|
||||||
@ -776,6 +787,7 @@ UserSettings::save()
|
|||||||
settings.setValue(QStringLiteral("currentProfile"), profile_);
|
settings.setValue(QStringLiteral("currentProfile"), profile_);
|
||||||
settings.setValue(QStringLiteral("use_identicon"), useIdenticon_);
|
settings.setValue(QStringLiteral("use_identicon"), useIdenticon_);
|
||||||
settings.setValue(QStringLiteral("open_image_external"), openImageExternal_);
|
settings.setValue(QStringLiteral("open_image_external"), openImageExternal_);
|
||||||
|
settings.setValue(QStringLiteral("open_video_external"), openVideoExternal_);
|
||||||
|
|
||||||
settings.endGroup(); // user
|
settings.endGroup(); // user
|
||||||
|
|
||||||
@ -880,8 +892,10 @@ UserSettingsModel::data(const QModelIndex &index, int role) const
|
|||||||
return tr("Circular Avatars");
|
return tr("Circular Avatars");
|
||||||
case UseIdenticon:
|
case UseIdenticon:
|
||||||
return tr("Use identicons");
|
return tr("Use identicons");
|
||||||
case OpenImageExternal:
|
case OpenImageExternal:
|
||||||
return tr("Open images with external program");
|
return tr("Open images with external program");
|
||||||
|
case OpenVideoExternal:
|
||||||
|
return tr("Open videos with external program");
|
||||||
case DecryptSidebar:
|
case DecryptSidebar:
|
||||||
return tr("Decrypt messages in sidebar");
|
return tr("Decrypt messages in sidebar");
|
||||||
case PrivacyScreen:
|
case PrivacyScreen:
|
||||||
@ -1006,8 +1020,10 @@ UserSettingsModel::data(const QModelIndex &index, int role) const
|
|||||||
return i->avatarCircles();
|
return i->avatarCircles();
|
||||||
case UseIdenticon:
|
case UseIdenticon:
|
||||||
return i->useIdenticon();
|
return i->useIdenticon();
|
||||||
case OpenImageExternal:
|
case OpenImageExternal:
|
||||||
return i->openImageExternal();
|
return i->openImageExternal();
|
||||||
|
case OpenVideoExternal:
|
||||||
|
return i->openVideoExternal();
|
||||||
case DecryptSidebar:
|
case DecryptSidebar:
|
||||||
return i->decryptSidebar();
|
return i->decryptSidebar();
|
||||||
case PrivacyScreen:
|
case PrivacyScreen:
|
||||||
@ -1150,9 +1166,12 @@ UserSettingsModel::data(const QModelIndex &index, int role) const
|
|||||||
"Change the appearance of user avatars in chats.\nOFF - square, ON - circle.");
|
"Change the appearance of user avatars in chats.\nOFF - square, ON - circle.");
|
||||||
case UseIdenticon:
|
case UseIdenticon:
|
||||||
return tr("Display an identicon instead of a letter when no avatar is set.");
|
return tr("Display an identicon instead of a letter when no avatar is set.");
|
||||||
case OpenImageExternal:
|
case OpenImageExternal:
|
||||||
return tr("Click to open image with external program. \nSame as Right-Click>Open "
|
return tr("Click to open image with external program. \nSame as Right-Click>Open "
|
||||||
"in External Program");
|
"in external program");
|
||||||
|
case OpenVideoExternal:
|
||||||
|
return tr("Click to open video with external program. \nSame as Right-Click>Open "
|
||||||
|
"in external program");
|
||||||
case DecryptSidebar:
|
case DecryptSidebar:
|
||||||
return tr("Decrypt the messages shown in the sidebar.\nOnly affects messages in "
|
return tr("Decrypt the messages shown in the sidebar.\nOnly affects messages in "
|
||||||
"encrypted chats.");
|
"encrypted chats.");
|
||||||
@ -1249,7 +1268,8 @@ UserSettingsModel::data(const QModelIndex &index, int role) const
|
|||||||
case AlertOnNotification:
|
case AlertOnNotification:
|
||||||
case AvatarCircles:
|
case AvatarCircles:
|
||||||
case UseIdenticon:
|
case UseIdenticon:
|
||||||
case OpenImageExternal:
|
case OpenImageExternal:
|
||||||
|
case OpenVideoExternal:
|
||||||
case DecryptSidebar:
|
case DecryptSidebar:
|
||||||
case PrivacyScreen:
|
case PrivacyScreen:
|
||||||
case MobileMode:
|
case MobileMode:
|
||||||
@ -1542,13 +1562,20 @@ UserSettingsModel::setData(const QModelIndex &index, const QVariant &value, int
|
|||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
case OpenImageExternal: {
|
case OpenImageExternal: {
|
||||||
if (value.userType() == QMetaType::Bool) {
|
if (value.userType() == QMetaType::Bool) {
|
||||||
i->setOpenImageExternal(value.toBool());
|
i->setOpenImageExternal(value.toBool());
|
||||||
return true;
|
return true;
|
||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
case OpenVideoExternal: {
|
||||||
|
if (value.userType() == QMetaType::Bool) {
|
||||||
|
i->setOpenVideoExternal(value.toBool());
|
||||||
|
return true;
|
||||||
|
} else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
case DecryptSidebar: {
|
case DecryptSidebar: {
|
||||||
if (value.userType() == QMetaType::Bool) {
|
if (value.userType() == QMetaType::Bool) {
|
||||||
i->setDecryptSidebar(value.toBool());
|
i->setDecryptSidebar(value.toBool());
|
||||||
@ -1812,6 +1839,9 @@ UserSettingsModel::UserSettingsModel(QObject *p)
|
|||||||
connect(s.get(), &UserSettings::openImageExternalChanged, this, [this]() {
|
connect(s.get(), &UserSettings::openImageExternalChanged, this, [this]() {
|
||||||
emit dataChanged(index(OpenImageExternal), index(OpenImageExternal), {Value});
|
emit dataChanged(index(OpenImageExternal), index(OpenImageExternal), {Value});
|
||||||
});
|
});
|
||||||
|
connect(s.get(), &UserSettings::openVideoExternalChanged, this, [this]() {
|
||||||
|
emit dataChanged(index(OpenVideoExternal), index(OpenVideoExternal), {Value});
|
||||||
|
});
|
||||||
connect(s.get(), &UserSettings::privacyScreenChanged, this, [this]() {
|
connect(s.get(), &UserSettings::privacyScreenChanged, this, [this]() {
|
||||||
emit dataChanged(index(PrivacyScreen), index(PrivacyScreen), {Value});
|
emit dataChanged(index(PrivacyScreen), index(PrivacyScreen), {Value});
|
||||||
emit dataChanged(index(PrivacyScreenTimeout), index(PrivacyScreenTimeout), {Enabled});
|
emit dataChanged(index(PrivacyScreenTimeout), index(PrivacyScreenTimeout), {Enabled});
|
||||||
|
@ -105,7 +105,10 @@ class UserSettings : public QObject
|
|||||||
Q_PROPERTY(bool disableCertificateValidation READ disableCertificateValidation WRITE
|
Q_PROPERTY(bool disableCertificateValidation READ disableCertificateValidation WRITE
|
||||||
setDisableCertificateValidation NOTIFY disableCertificateValidationChanged)
|
setDisableCertificateValidation NOTIFY disableCertificateValidationChanged)
|
||||||
Q_PROPERTY(bool useIdenticon READ useIdenticon WRITE setUseIdenticon NOTIFY useIdenticonChanged)
|
Q_PROPERTY(bool useIdenticon READ useIdenticon WRITE setUseIdenticon NOTIFY useIdenticonChanged)
|
||||||
Q_PROPERTY(bool openImageExternal READ openImageExternal WRITE setOpenImageExternal NOTIFY openImageExternalChanged)
|
Q_PROPERTY(bool openImageExternal READ openImageExternal WRITE setOpenImageExternal NOTIFY
|
||||||
|
openImageExternalChanged)
|
||||||
|
Q_PROPERTY(bool openVideoExternal READ openVideoExternal WRITE setOpenVideoExternal NOTIFY
|
||||||
|
openVideoExternalChanged)
|
||||||
|
|
||||||
Q_PROPERTY(QStringList hiddenPins READ hiddenPins WRITE setHiddenPins NOTIFY hiddenPinsChanged)
|
Q_PROPERTY(QStringList hiddenPins READ hiddenPins WRITE setHiddenPins NOTIFY hiddenPinsChanged)
|
||||||
Q_PROPERTY(QStringList recentReactions READ recentReactions WRITE setRecentReactions NOTIFY
|
Q_PROPERTY(QStringList recentReactions READ recentReactions WRITE setRecentReactions NOTIFY
|
||||||
@ -186,6 +189,7 @@ public:
|
|||||||
void setRecentReactions(QStringList recent);
|
void setRecentReactions(QStringList recent);
|
||||||
void setUseIdenticon(bool state);
|
void setUseIdenticon(bool state);
|
||||||
void setOpenImageExternal(bool state);
|
void setOpenImageExternal(bool state);
|
||||||
|
void setOpenVideoExternal(bool state);
|
||||||
void setCollapsedSpaces(QList<QStringList> spaces);
|
void setCollapsedSpaces(QList<QStringList> spaces);
|
||||||
|
|
||||||
QString theme() const { return !theme_.isEmpty() ? theme_ : defaultTheme_; }
|
QString theme() const { return !theme_.isEmpty() ? theme_ : defaultTheme_; }
|
||||||
@ -249,6 +253,7 @@ public:
|
|||||||
QStringList recentReactions() const { return recentReactions_; }
|
QStringList recentReactions() const { return recentReactions_; }
|
||||||
bool useIdenticon() const { return useIdenticon_ && JdenticonProvider::isAvailable(); }
|
bool useIdenticon() const { return useIdenticon_ && JdenticonProvider::isAvailable(); }
|
||||||
bool openImageExternal() const { return openImageExternal_; }
|
bool openImageExternal() const { return openImageExternal_; }
|
||||||
|
bool openVideoExternal() const { return openVideoExternal_; }
|
||||||
QList<QStringList> collapsedSpaces() const { return collapsedSpaces_; }
|
QList<QStringList> collapsedSpaces() const { return collapsedSpaces_; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@ -301,6 +306,7 @@ signals:
|
|||||||
void disableCertificateValidationChanged(bool disabled);
|
void disableCertificateValidationChanged(bool disabled);
|
||||||
void useIdenticonChanged(bool state);
|
void useIdenticonChanged(bool state);
|
||||||
void openImageExternalChanged(bool state);
|
void openImageExternalChanged(bool state);
|
||||||
|
void openVideoExternalChanged(bool state);
|
||||||
void hiddenPinsChanged();
|
void hiddenPinsChanged();
|
||||||
void hiddenWidgetsChanged();
|
void hiddenWidgetsChanged();
|
||||||
void recentReactionsChanged();
|
void recentReactionsChanged();
|
||||||
@ -366,6 +372,7 @@ private:
|
|||||||
QList<QStringList> collapsedSpaces_;
|
QList<QStringList> collapsedSpaces_;
|
||||||
bool useIdenticon_;
|
bool useIdenticon_;
|
||||||
bool openImageExternal_;
|
bool openImageExternal_;
|
||||||
|
bool openVideoExternal_;
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
@ -389,7 +396,8 @@ class UserSettingsModel : public QAbstractListModel
|
|||||||
EmojiFont,
|
EmojiFont,
|
||||||
AvatarCircles,
|
AvatarCircles,
|
||||||
UseIdenticon,
|
UseIdenticon,
|
||||||
OpenImageExternal,
|
OpenImageExternal,
|
||||||
|
OpenVideoExternal,
|
||||||
PrivacyScreen,
|
PrivacyScreen,
|
||||||
PrivacyScreenTimeout,
|
PrivacyScreenTimeout,
|
||||||
|
|
||||||
@ -497,4 +505,3 @@ public:
|
|||||||
Q_INVOKABLE void requestCrossSigningSecrets();
|
Q_INVOKABLE void requestCrossSigningSecrets();
|
||||||
Q_INVOKABLE void downloadCrossSigningSecrets();
|
Q_INVOKABLE void downloadCrossSigningSecrets();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -133,4 +133,3 @@ Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationMac)
|
|||||||
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationReady)
|
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationReady)
|
||||||
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationRequest)
|
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationRequest)
|
||||||
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationStart)
|
Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationStart)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user