mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Move external video player option handling to SessionController::openDocument
This commit is contained in:
@@ -7,7 +7,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "data/data_document_resolver.h"
|
||||
|
||||
#include "base/options.h"
|
||||
#include "base/platform/base_platform_info.h"
|
||||
#include "boxes/abstract_box.h" // Ui::show().
|
||||
#include "chat_helpers/ttl_media_layer_widget.h"
|
||||
@@ -39,13 +38,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
namespace Data {
|
||||
namespace {
|
||||
|
||||
base::options::toggle OptionExternalVideoPlayer({
|
||||
.id = kOptionExternalVideoPlayer,
|
||||
.name = "External video player",
|
||||
.description = "Use system video player instead of the internal one. "
|
||||
"This disabes video playback in messages.",
|
||||
});
|
||||
|
||||
void ConfirmDontWarnBox(
|
||||
not_null<Ui::GenericBox*> box,
|
||||
rpl::producer<TextWithEntities> &&text,
|
||||
@@ -153,8 +145,6 @@ void LaunchWithWarning(
|
||||
|
||||
} // namespace
|
||||
|
||||
const char kOptionExternalVideoPlayer[] = "external-video-player";
|
||||
|
||||
base::binary_guard ReadBackgroundImageAsync(
|
||||
not_null<Data::DocumentMedia*> media,
|
||||
FnMut<QImage(QImage)> postprocess,
|
||||
@@ -199,11 +189,7 @@ void ResolveDocument(
|
||||
const auto msgId = item ? item->fullId() : FullMsgId();
|
||||
|
||||
const auto showDocument = [&] {
|
||||
if (OptionExternalVideoPlayer.value()
|
||||
&& document->isVideoFile()
|
||||
&& !document->filepath().isEmpty()) {
|
||||
File::Launch(document->location(false).fname);
|
||||
} else if (controller) {
|
||||
if (controller) {
|
||||
controller->openDocument(
|
||||
document,
|
||||
true,
|
||||
|
||||
Reference in New Issue
Block a user