Version 0.9.44 copy text context menu item added to some messages.

This commit is contained in:
John Preston 2016-04-20 15:56:59 +03:00
parent 5caceefc2c
commit 7d272919aa
7 changed files with 44 additions and 22 deletions

View File

@ -20,10 +20,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
static const int32 AppVersion = 9043;
static const wchar_t *AppVersionStr = L"0.9.43";
static const bool DevVersion = true;
//#define BETA_VERSION (9040128ULL) // just comment this line to build public version
static const int32 AppVersion = 9044;
static const wchar_t *AppVersionStr = L"0.9.44";
static const bool DevVersion = false;
//#define BETA_VERSION (9044000ULL) // just comment this line to build public version
static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";
static const wchar_t *AppName = L"Telegram Desktop";

View File

@ -1658,6 +1658,9 @@ public:
virtual bool isDisplayed() const {
return true;
}
virtual bool hasTextForCopy() const {
return false;
}
virtual void initDimensions() = 0;
virtual int resizeGetHeight(int width) {
_width = qMin(width, _maxw);
@ -1878,6 +1881,9 @@ public:
TextSelection adjustSelection(TextSelection selection, TextSelectType type) const override {
return _caption.adjustSelection(selection, type);
}
bool hasTextForCopy() const override {
return !_caption.isEmpty();
}
QString inDialogsText() const override;
QString selectedText(TextSelection selection) const override;
@ -1955,6 +1961,9 @@ public:
TextSelection adjustSelection(TextSelection selection, TextSelectType type) const override {
return _caption.adjustSelection(selection, type);
}
bool hasTextForCopy() const override {
return !_caption.isEmpty();
}
QString inDialogsText() const override;
QString selectedText(TextSelection selection) const override;
@ -2075,6 +2084,9 @@ public:
}
return selection;
}
bool hasTextForCopy() const override {
return Has<HistoryDocumentCaptioned>();
}
QString inDialogsText() const override;
QString selectedText(TextSelection selection) const override;
@ -2159,6 +2171,9 @@ public:
TextSelection adjustSelection(TextSelection selection, TextSelectType type) const override {
return _caption.adjustSelection(selection, type);
}
bool hasTextForCopy() const override {
return !_caption.isEmpty();
}
QString inDialogsText() const override;
QString selectedText(TextSelection selection) const override;
@ -2384,6 +2399,9 @@ public:
HistoryTextState getState(int x, int y, HistoryStateRequest request) const override;
TextSelection adjustSelection(TextSelection selection, TextSelectType type) const override;
bool hasTextForCopy() const override {
return false; // we do not add _title and _description in FullSelection text copy.
}
bool toggleSelectionByHandlerClick(const ClickHandlerPtr &p) const override {
return _attach && _attach->toggleSelectionByHandlerClick(p);
@ -2515,6 +2533,9 @@ public:
HistoryTextState getState(int x, int y, HistoryStateRequest request) const override;
TextSelection adjustSelection(TextSelection selection, TextSelectType type) const override;
bool hasTextForCopy() const override {
return !_title.isEmpty() || !_description.isEmpty();
}
bool toggleSelectionByHandlerClick(const ClickHandlerPtr &p) const override {
return p == _link;

View File

@ -1037,7 +1037,9 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
}
}
if (item && !isUponSelected) {
if (HistoryMedia *media = (msg ? msg->getMedia() : 0)) {
bool mediaHasTextForCopy = false;
if (HistoryMedia *media = (msg ? msg->getMedia() : nullptr)) {
mediaHasTextForCopy = media->hasTextForCopy();
if (media->type() == MediaTypeWebPage && static_cast<HistoryWebPage*>(media)->attach()) {
media = static_cast<HistoryWebPage*>(media)->attach();
}
@ -1065,8 +1067,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
}
}
}
QString contextMenuText = item->selectedText(FullSelection);
if (!contextMenuText.isEmpty() && msg && !msg->getMedia()) {
if (msg && (!msg->emptyText() || mediaHasTextForCopy)) {
_menu->addAction(lang(lng_context_copy_text), this, SLOT(copyContextText()))->setEnabled(true);
}
}

View File

@ -11,7 +11,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.9.43</string>
<string>0.9.44</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>

View File

@ -34,8 +34,8 @@ IDI_ICON1 ICON "Resources\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,9,43,0
PRODUCTVERSION 0,9,43,0
FILEVERSION 0,9,44,0
PRODUCTVERSION 0,9,44,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -51,10 +51,10 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileVersion", "0.9.43.0"
VALUE "FileVersion", "0.9.44.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2016"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "0.9.43.0"
VALUE "ProductVersion", "0.9.44.0"
END
END
BLOCK "VarFileInfo"

View File

@ -1712,7 +1712,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.9.43;
CURRENT_PROJECT_VERSION = 0.9.44;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
@ -1731,7 +1731,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 0.9.43;
CURRENT_PROJECT_VERSION = 0.9.44;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = fast;
GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h;
@ -1760,10 +1760,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.9.43;
CURRENT_PROJECT_VERSION = 0.9.44;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 0.9;
DYLIB_CURRENT_VERSION = 0.9.43;
DYLIB_CURRENT_VERSION = 0.9.44;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
@ -1901,10 +1901,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.9.43;
CURRENT_PROJECT_VERSION = 0.9.44;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 0.9;
DYLIB_CURRENT_VERSION = 0.9.43;
DYLIB_CURRENT_VERSION = 0.9.44;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
FRAMEWORK_SEARCH_PATHS = "";

View File

@ -1,6 +1,6 @@
AppVersion 9043
AppVersion 9044
AppVersionStrMajor 0.9
AppVersionStrSmall 0.9.43
AppVersionStr 0.9.43
DevChannel 1
AppVersionStrSmall 0.9.44
AppVersionStr 0.9.44
DevChannel 0
BetaVersion 0