init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
42
Telegram/SourceFiles/history/history_location_manager.cpp
Normal file
42
Telegram/SourceFiles/history/history_location_manager.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "history/history_location_manager.h"
|
||||
|
||||
#include "mainwidget.h"
|
||||
#include "core/file_utilities.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "ui/image/image.h"
|
||||
#include "data/data_file_origin.h"
|
||||
#include "platform/platform_specific.h"
|
||||
|
||||
QString LocationClickHandler::copyToClipboardText() const {
|
||||
return _text;
|
||||
}
|
||||
|
||||
QString LocationClickHandler::copyToClipboardContextItemText() const {
|
||||
return tr::lng_context_copy_link(tr::now);
|
||||
}
|
||||
|
||||
void LocationClickHandler::onClick(ClickContext context) const {
|
||||
Platform::LaunchMaps(_point, [text = _text] {
|
||||
File::OpenUrl(text);
|
||||
});
|
||||
}
|
||||
|
||||
void LocationClickHandler::setup() {
|
||||
_text = Url(_point);
|
||||
}
|
||||
|
||||
QString LocationClickHandler::Url(const Data::LocationPoint &point) {
|
||||
const auto latlon = point.latAsString() + ',' + point.lonAsString();
|
||||
return u"https://maps.google.com/maps?q="_q
|
||||
+ latlon
|
||||
+ u"&ll="_q
|
||||
+ latlon
|
||||
+ u"&z=16"_q;
|
||||
}
|
||||
Reference in New Issue
Block a user