Merge remote-tracking branch 'tdesktop/dev' into dev
This commit is contained in:
commit
7de3002c8c
60 changed files with 399 additions and 319 deletions
28
.github/workflows/linux.yml
vendored
28
.github/workflows/linux.yml
vendored
|
|
@ -5,6 +5,7 @@ on:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
- '**.md'
|
- '**.md'
|
||||||
|
- '!docs/building-cmake.md'
|
||||||
- 'kotatogram_changes.txt'
|
- 'kotatogram_changes.txt'
|
||||||
- 'changelog.txt'
|
- 'changelog.txt'
|
||||||
- 'LEGAL'
|
- 'LEGAL'
|
||||||
|
|
@ -25,6 +26,7 @@ on:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
- '**.md'
|
- '**.md'
|
||||||
|
- '!docs/building-cmake.md'
|
||||||
- 'kotatogram_changes.txt'
|
- 'kotatogram_changes.txt'
|
||||||
- 'changelog.txt'
|
- 'changelog.txt'
|
||||||
- 'LEGAL'
|
- 'LEGAL'
|
||||||
|
|
@ -133,14 +135,6 @@ jobs:
|
||||||
cd Libraries
|
cd Libraries
|
||||||
echo ::set-env name=LibrariesPath::`pwd`
|
echo ::set-env name=LibrariesPath::`pwd`
|
||||||
|
|
||||||
- name: Range-v3.
|
|
||||||
run: |
|
|
||||||
echo "Find necessary branch from doc."
|
|
||||||
cloneRange=$(grep -A 1 "range-v3" $REPO_NAME/$DOC_PATH | sed -n 1p)
|
|
||||||
cd $LibrariesPath
|
|
||||||
echo $cloneRange
|
|
||||||
eval $cloneRange
|
|
||||||
|
|
||||||
- name: Patches.
|
- name: Patches.
|
||||||
run: |
|
run: |
|
||||||
echo "Find necessary commit from doc."
|
echo "Find necessary commit from doc."
|
||||||
|
|
@ -440,11 +434,7 @@ jobs:
|
||||||
git submodule update qtbase qtwayland qtimageformats qtsvg
|
git submodule update qtbase qtwayland qtimageformats qtsvg
|
||||||
cd qtbase
|
cd qtbase
|
||||||
git apply ../../patches/qtbase_${QT}.diff
|
git apply ../../patches/qtbase_${QT}.diff
|
||||||
cd src/plugins/platforminputcontexts
|
cd ../
|
||||||
git clone $GIT/desktop-app/fcitx.git
|
|
||||||
git clone $GIT/desktop-app/hime.git
|
|
||||||
git clone $GIT/desktop-app/nimf.git
|
|
||||||
cd ../../../..
|
|
||||||
|
|
||||||
./configure -prefix "$QT_PREFIX" \
|
./configure -prefix "$QT_PREFIX" \
|
||||||
-release \
|
-release \
|
||||||
|
|
@ -473,18 +463,6 @@ jobs:
|
||||||
cd $LibrariesPath
|
cd $LibrariesPath
|
||||||
sudo cp -R qt-cache/. /
|
sudo cp -R qt-cache/. /
|
||||||
|
|
||||||
- name: Material Decoration.
|
|
||||||
run: |
|
|
||||||
cd $LibrariesPath
|
|
||||||
|
|
||||||
git clone --depth=1 $GIT/desktop-app/materialdecoration.git
|
|
||||||
cd materialdecoration
|
|
||||||
$QT_PREFIX/bin/qmake CONFIG+=static
|
|
||||||
make -j$(nproc)
|
|
||||||
sudo make install
|
|
||||||
cd ..
|
|
||||||
rm -rf materialdecoration
|
|
||||||
|
|
||||||
- name: Breakpad cache.
|
- name: Breakpad cache.
|
||||||
id: cache-breakpad
|
id: cache-breakpad
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
|
|
|
||||||
10
.github/workflows/mac.yml
vendored
10
.github/workflows/mac.yml
vendored
|
|
@ -5,6 +5,7 @@ on:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
- '**.md'
|
- '**.md'
|
||||||
|
- '!docs/building-xcode.md'
|
||||||
- 'kotatogram_changes.txt'
|
- 'kotatogram_changes.txt'
|
||||||
- 'changelog.txt'
|
- 'changelog.txt'
|
||||||
- 'LEGAL'
|
- 'LEGAL'
|
||||||
|
|
@ -24,6 +25,7 @@ on:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
- '**.md'
|
- '**.md'
|
||||||
|
- '!docs/building-xcode.md'
|
||||||
- 'kotatogram_changes.txt'
|
- 'kotatogram_changes.txt'
|
||||||
- 'changelog.txt'
|
- 'changelog.txt'
|
||||||
- 'LEGAL'
|
- 'LEGAL'
|
||||||
|
|
@ -100,14 +102,6 @@ jobs:
|
||||||
cd Libraries/macos
|
cd Libraries/macos
|
||||||
echo ::set-env name=LibrariesPath::`pwd`
|
echo ::set-env name=LibrariesPath::`pwd`
|
||||||
|
|
||||||
- name: Range-v3.
|
|
||||||
run: |
|
|
||||||
echo "Find necessary branch from doc."
|
|
||||||
cloneRange=$(grep -A 1 "range-v3" $REPO_NAME/$DOC_PATH | sed -n 1p)
|
|
||||||
cd $LibrariesPath
|
|
||||||
echo $cloneRange
|
|
||||||
eval $cloneRange
|
|
||||||
|
|
||||||
- name: Patches.
|
- name: Patches.
|
||||||
run: |
|
run: |
|
||||||
echo "Find necessary commit from doc."
|
echo "Find necessary commit from doc."
|
||||||
|
|
|
||||||
11
.github/workflows/win.yml
vendored
11
.github/workflows/win.yml
vendored
|
|
@ -5,6 +5,7 @@ on:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
- '**.md'
|
- '**.md'
|
||||||
|
- '!docs/building-msvc.md'
|
||||||
- 'kotatogram_changes.txt'
|
- 'kotatogram_changes.txt'
|
||||||
- 'changelog.txt'
|
- 'changelog.txt'
|
||||||
- 'LEGAL'
|
- 'LEGAL'
|
||||||
|
|
@ -26,6 +27,7 @@ on:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
- '**.md'
|
- '**.md'
|
||||||
|
- '!docs/building-msvc.md'
|
||||||
- 'kotatogram_changes.txt'
|
- 'kotatogram_changes.txt'
|
||||||
- 'changelog.txt'
|
- 'changelog.txt'
|
||||||
- 'LEGAL'
|
- 'LEGAL'
|
||||||
|
|
@ -111,15 +113,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
choco install --no-progress -y nasm yasm jom ninja
|
choco install --no-progress -y nasm yasm jom ninja
|
||||||
|
|
||||||
- name: Range-v3.
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "Find necessary branch from doc."
|
|
||||||
cloneRange=$(grep -A 1 "range-v3" $REPO_NAME/$DOC_PATH | sed -n 1p)
|
|
||||||
cd $LibrariesPath
|
|
||||||
echo $cloneRange
|
|
||||||
eval $cloneRange
|
|
||||||
|
|
||||||
- name: Patches.
|
- name: Patches.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
24
.gitmodules
vendored
24
.gitmodules
vendored
|
|
@ -67,3 +67,27 @@
|
||||||
[submodule "Telegram/ThirdParty/hunspell"]
|
[submodule "Telegram/ThirdParty/hunspell"]
|
||||||
path = Telegram/ThirdParty/hunspell
|
path = Telegram/ThirdParty/hunspell
|
||||||
url = https://github.com/hunspell/hunspell
|
url = https://github.com/hunspell/hunspell
|
||||||
|
[submodule "Telegram/ThirdParty/materialdecoration"]
|
||||||
|
path = Telegram/ThirdParty/materialdecoration
|
||||||
|
url = https://github.com/desktop-app/materialdecoration.git
|
||||||
|
[submodule "Telegram/ThirdParty/range-v3"]
|
||||||
|
path = Telegram/ThirdParty/range-v3
|
||||||
|
url = https://github.com/ericniebler/range-v3.git
|
||||||
|
[submodule "Telegram/ThirdParty/fcitx-qt5"]
|
||||||
|
path = Telegram/ThirdParty/fcitx-qt5
|
||||||
|
url = https://github.com/fcitx/fcitx-qt5.git
|
||||||
|
[submodule "Telegram/ThirdParty/nimf"]
|
||||||
|
path = Telegram/ThirdParty/nimf
|
||||||
|
url = https://github.com/hamonikr/nimf.git
|
||||||
|
[submodule "Telegram/ThirdParty/hime"]
|
||||||
|
path = Telegram/ThirdParty/hime
|
||||||
|
url = https://github.com/hime-ime/hime.git
|
||||||
|
[submodule "Telegram/ThirdParty/qt5ct"]
|
||||||
|
path = Telegram/ThirdParty/qt5ct
|
||||||
|
url = https://github.com/desktop-app/qt5ct.git
|
||||||
|
[submodule "Telegram/ThirdParty/lxqt-qtplugin"]
|
||||||
|
path = Telegram/ThirdParty/lxqt-qtplugin
|
||||||
|
url = https://github.com/lxqt/lxqt-qtplugin.git
|
||||||
|
[submodule "Telegram/ThirdParty/libqtxdg"]
|
||||||
|
path = Telegram/ThirdParty/libqtxdg
|
||||||
|
url = https://github.com/lxqt/libqtxdg.git
|
||||||
|
|
|
||||||
|
|
@ -67,12 +67,33 @@ generate_numbers(Telegram ${res_loc}/numbers.txt)
|
||||||
|
|
||||||
set_target_properties(Telegram PROPERTIES AUTOMOC ON AUTORCC ON)
|
set_target_properties(Telegram PROPERTIES AUTOMOC ON AUTORCC ON)
|
||||||
|
|
||||||
if (LINUX AND NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION)
|
if (LINUX)
|
||||||
target_link_libraries(Telegram
|
target_link_libraries(Telegram
|
||||||
PRIVATE
|
PRIVATE
|
||||||
desktop-app::external_statusnotifieritem
|
desktop-app::external_materialdecoration
|
||||||
desktop-app::external_dbusmenu_qt
|
desktop-app::external_nimf_qt5
|
||||||
|
desktop-app::external_qt5ct
|
||||||
|
desktop-app::external_qt5ct_style
|
||||||
|
desktop-app::external_qt5ct_qtplugin
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION)
|
||||||
|
# conflicts with Qt static link
|
||||||
|
if (DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES)
|
||||||
|
target_link_libraries(Telegram
|
||||||
|
PRIVATE
|
||||||
|
desktop-app::external_lxqt_qtplugin
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(Telegram
|
||||||
|
PRIVATE
|
||||||
|
desktop-app::external_statusnotifieritem
|
||||||
|
desktop-app::external_dbusmenu_qt
|
||||||
|
desktop-app::external_fcitx_qt5
|
||||||
|
desktop-app::external_hime_qt
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (add_hunspell_library)
|
if (add_hunspell_library)
|
||||||
|
|
@ -105,10 +126,6 @@ PRIVATE
|
||||||
desktop-app::external_openal
|
desktop-app::external_openal
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT DESKTOP_APP_USE_PACKAGED)
|
|
||||||
target_link_libraries(Telegram PRIVATE desktop-app::external_opus)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Telegram uses long atomic types, so on some architectures libatomic is needed.
|
# Telegram uses long atomic types, so on some architectures libatomic is needed.
|
||||||
check_cxx_source_compiles("
|
check_cxx_source_compiles("
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
@ -125,7 +142,6 @@ if (DESKTOP_APP_USE_PACKAGED)
|
||||||
|
|
||||||
target_link_libraries(Telegram
|
target_link_libraries(Telegram
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${CMAKE_DL_LIBS}
|
|
||||||
Threads::Threads
|
Threads::Threads
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -1025,14 +1041,13 @@ PRIVATE
|
||||||
mainwindow.h
|
mainwindow.h
|
||||||
observer_peer.cpp
|
observer_peer.cpp
|
||||||
observer_peer.h
|
observer_peer.h
|
||||||
|
qt_static_plugins.cpp
|
||||||
settings.cpp
|
settings.cpp
|
||||||
settings.h
|
settings.h
|
||||||
)
|
)
|
||||||
|
|
||||||
if (DESKTOP_APP_USE_PACKAGED)
|
if (DESKTOP_APP_USE_PACKAGED)
|
||||||
nice_target_sources(Telegram ${src_loc} PRIVATE qt_functions.cpp)
|
nice_target_sources(Telegram ${src_loc} PRIVATE qt_functions.cpp)
|
||||||
else()
|
|
||||||
nice_target_sources(Telegram ${src_loc} PRIVATE qt_static_plugins.cpp)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
nice_target_sources(Telegram ${res_loc}
|
nice_target_sources(Telegram ${res_loc}
|
||||||
|
|
@ -1178,21 +1193,12 @@ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/Telegram PREFIX Resources FILES ${
|
||||||
|
|
||||||
target_include_directories(Telegram PRIVATE ${src_loc})
|
target_include_directories(Telegram PRIVATE ${src_loc})
|
||||||
|
|
||||||
if (NOT DESKTOP_APP_USE_PACKAGED)
|
|
||||||
target_include_directories(Telegram PRIVATE ${third_party_loc}/minizip)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_compile_definitions(Telegram
|
target_compile_definitions(Telegram
|
||||||
PRIVATE
|
PRIVATE
|
||||||
TDESKTOP_API_ID=${TDESKTOP_API_ID}
|
TDESKTOP_API_ID=${TDESKTOP_API_ID}
|
||||||
TDESKTOP_API_HASH=${TDESKTOP_API_HASH}
|
TDESKTOP_API_HASH=${TDESKTOP_API_HASH}
|
||||||
AL_ALEXT_PROTOTYPES
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT DESKTOP_APP_USE_PACKAGED)
|
|
||||||
target_compile_definitions(Telegram PRIVATE AL_LIBTYPE_STATIC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (${CMAKE_GENERATOR} MATCHES "(Visual Studio|Xcode)")
|
if (${CMAKE_GENERATOR} MATCHES "(Visual Studio|Xcode)")
|
||||||
set(output_folder ${CMAKE_BINARY_DIR})
|
set(output_folder ${CMAKE_BINARY_DIR})
|
||||||
elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "")
|
elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "")
|
||||||
|
|
|
||||||
|
|
@ -1860,6 +1860,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_admin_log_no_results_search_text" = "No recent actions that contain '{query}' have been found.";
|
"lng_admin_log_no_results_search_text" = "No recent actions that contain '{query}' have been found.";
|
||||||
"lng_admin_log_no_events_title" = "No actions yet";
|
"lng_admin_log_no_events_title" = "No actions yet";
|
||||||
"lng_admin_log_no_events_text" = "There were no service actions\ntaken by the group's members\nand admins in the last 48 hours.";
|
"lng_admin_log_no_events_text" = "There were no service actions\ntaken by the group's members\nand admins in the last 48 hours.";
|
||||||
|
"lng_admin_log_no_events_text_channel" = "There were no service actions\ntaken by the channels's admins\nin the last 48 hours.";
|
||||||
|
|
||||||
"lng_admin_log_empty_text" = "Empty";
|
"lng_admin_log_empty_text" = "Empty";
|
||||||
"lng_admin_log_changed_title_group" = "{from} changed group name to «{title}»";
|
"lng_admin_log_changed_title_group" = "{from} changed group name to «{title}»";
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
|
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
|
||||||
ProcessorArchitecture="ARCHITECTURE"
|
ProcessorArchitecture="ARCHITECTURE"
|
||||||
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
|
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
|
||||||
Version="2.1.1.0" />
|
Version="2.1.2.0" />
|
||||||
<Properties>
|
<Properties>
|
||||||
<DisplayName>Telegram Desktop</DisplayName>
|
<DisplayName>Telegram Desktop</DisplayName>
|
||||||
<PublisherDisplayName>Telegram FZ-LLC</PublisherDisplayName>
|
<PublisherDisplayName>Telegram FZ-LLC</PublisherDisplayName>
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 2,1,1,0
|
FILEVERSION 2,1,2,0
|
||||||
PRODUCTVERSION 2,1,1,0
|
PRODUCTVERSION 2,1,2,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
|
@ -51,10 +51,10 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Telegram FZ-LLC"
|
VALUE "CompanyName", "Telegram FZ-LLC"
|
||||||
VALUE "FileDescription", "Telegram Desktop"
|
VALUE "FileDescription", "Telegram Desktop"
|
||||||
VALUE "FileVersion", "2.1.1.0"
|
VALUE "FileVersion", "2.1.2.0"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2014-2020"
|
VALUE "LegalCopyright", "Copyright (C) 2014-2020"
|
||||||
VALUE "ProductName", "Telegram Desktop"
|
VALUE "ProductName", "Telegram Desktop"
|
||||||
VALUE "ProductVersion", "2.1.1.0"
|
VALUE "ProductVersion", "2.1.2.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 2,1,1,0
|
FILEVERSION 2,1,2,0
|
||||||
PRODUCTVERSION 2,1,1,0
|
PRODUCTVERSION 2,1,2,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
|
@ -42,10 +42,10 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Telegram FZ-LLC"
|
VALUE "CompanyName", "Telegram FZ-LLC"
|
||||||
VALUE "FileDescription", "Telegram Desktop Updater"
|
VALUE "FileDescription", "Telegram Desktop Updater"
|
||||||
VALUE "FileVersion", "2.1.1.0"
|
VALUE "FileVersion", "2.1.2.0"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2014-2020"
|
VALUE "LegalCopyright", "Copyright (C) 2014-2020"
|
||||||
VALUE "ProductName", "Telegram Desktop"
|
VALUE "ProductName", "Telegram Desktop"
|
||||||
VALUE "ProductVersion", "2.1.1.0"
|
VALUE "ProductVersion", "2.1.2.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ constexpr auto AppId = "{C4A4AE8F-B9F7-4CC7-8A6C-BF7EEE87ACA5}"_cs;
|
||||||
constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs;
|
constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs;
|
||||||
constexpr auto AppName = "Kotatogram Desktop"_cs;
|
constexpr auto AppName = "Kotatogram Desktop"_cs;
|
||||||
constexpr auto AppFile = "Kotatogram"_cs;
|
constexpr auto AppFile = "Kotatogram"_cs;
|
||||||
constexpr auto AppVersion = 2001001;
|
constexpr auto AppVersion = 2001002;
|
||||||
constexpr auto AppVersionStr = "2.1.1";
|
constexpr auto AppVersionStr = "2.1.2";
|
||||||
constexpr auto AppBetaVersion = false;
|
constexpr auto AppBetaVersion = false;
|
||||||
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
|
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
|
||||||
|
|
|
||||||
|
|
@ -403,11 +403,11 @@ bool ChatFilters::applyChange(ChatFilter &filter, ChatFilter &&updated) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
filter = std::move(updated);
|
||||||
if (pinnedChanged) {
|
if (pinnedChanged) {
|
||||||
const auto filterList = _owner->chatsFilters().chatsList(id);
|
const auto filterList = _owner->chatsFilters().chatsList(id);
|
||||||
filterList->pinned()->applyList(updated.pinned());
|
filterList->pinned()->applyList(filter.pinned());
|
||||||
}
|
}
|
||||||
filter = std::move(updated);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_document_good_thumbnail.h"
|
#include "data/data_document_good_thumbnail.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "inline_bots/inline_bot_layout_item.h"
|
#include "inline_bots/inline_bot_layout_item.h"
|
||||||
|
#include "main/main_session.h"
|
||||||
#include "mainwidget.h"
|
#include "mainwidget.h"
|
||||||
#include "core/file_utilities.h"
|
#include "core/file_utilities.h"
|
||||||
#include "core/media_active_cache.h"
|
#include "core/media_active_cache.h"
|
||||||
|
|
@ -296,6 +297,14 @@ QString documentSaveFilename(const DocumentData *data, bool forceSavingAs = fals
|
||||||
return FileNameForSave(caption, filter, prefix, name, forceSavingAs, dir);
|
return FileNameForSave(caption, filter, prefix, name, forceSavingAs, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DocumentClickHandler::DocumentClickHandler(
|
||||||
|
not_null<DocumentData*> document,
|
||||||
|
FullMsgId context)
|
||||||
|
: FileClickHandler(context)
|
||||||
|
, _session(&document->session())
|
||||||
|
, _document(document) {
|
||||||
|
}
|
||||||
|
|
||||||
void DocumentOpenClickHandler::Open(
|
void DocumentOpenClickHandler::Open(
|
||||||
Data::FileOrigin origin,
|
Data::FileOrigin origin,
|
||||||
not_null<DocumentData*> data,
|
not_null<DocumentData*> data,
|
||||||
|
|
@ -345,7 +354,9 @@ void DocumentOpenClickHandler::Open(
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentOpenClickHandler::onClickImpl() const {
|
void DocumentOpenClickHandler::onClickImpl() const {
|
||||||
Open(context(), document(), getActionItem());
|
if (valid()) {
|
||||||
|
Open(context(), document(), getActionItem());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentSaveClickHandler::Save(
|
void DocumentSaveClickHandler::Save(
|
||||||
|
|
@ -385,14 +396,20 @@ void DocumentSaveClickHandler::Save(
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentSaveClickHandler::onClickImpl() const {
|
void DocumentSaveClickHandler::onClickImpl() const {
|
||||||
Save(context(), document());
|
if (valid()) {
|
||||||
|
Save(context(), document());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentCancelClickHandler::onClickImpl() const {
|
void DocumentCancelClickHandler::onClickImpl() const {
|
||||||
const auto data = document();
|
if (!valid()) {
|
||||||
if (!data->date) return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (data->uploading()) {
|
const auto data = document();
|
||||||
|
if (!data->date) {
|
||||||
|
return;
|
||||||
|
} else if (data->uploading()) {
|
||||||
if (const auto item = data->owner().message(context())) {
|
if (const auto item = data->owner().message(context())) {
|
||||||
App::main()->cancelUploadLayer(item);
|
App::main()->cancelUploadLayer(item);
|
||||||
}
|
}
|
||||||
|
|
@ -423,7 +440,9 @@ void DocumentOpenWithClickHandler::Open(
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentOpenWithClickHandler::onClickImpl() const {
|
void DocumentOpenWithClickHandler::onClickImpl() const {
|
||||||
Open(context(), document());
|
if (valid()) {
|
||||||
|
Open(context(), document());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Data::FileOrigin StickerData::setOrigin() const {
|
Data::FileOrigin StickerData::setOrigin() const {
|
||||||
|
|
|
||||||
|
|
@ -315,16 +315,19 @@ class DocumentClickHandler : public FileClickHandler {
|
||||||
public:
|
public:
|
||||||
DocumentClickHandler(
|
DocumentClickHandler(
|
||||||
not_null<DocumentData*> document,
|
not_null<DocumentData*> document,
|
||||||
FullMsgId context = FullMsgId())
|
FullMsgId context = FullMsgId());
|
||||||
: FileClickHandler(context)
|
|
||||||
, _document(document) {
|
[[nodiscard]] bool valid() const {
|
||||||
|
return !_session.empty();
|
||||||
}
|
}
|
||||||
not_null<DocumentData*> document() const {
|
|
||||||
|
[[nodiscard]] not_null<DocumentData*> document() const {
|
||||||
return _document;
|
return _document;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
not_null<DocumentData*> _document;
|
const base::weak_ptr<Main::Session> _session;
|
||||||
|
const not_null<DocumentData*> _document;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_file_origin.h"
|
#include "data/data_file_origin.h"
|
||||||
#include "ui/image/image.h"
|
#include "ui/image/image.h"
|
||||||
#include "ui/image/image_source.h"
|
#include "ui/image/image_source.h"
|
||||||
|
#include "main/main_session.h"
|
||||||
#include "mainwidget.h"
|
#include "mainwidget.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "facades.h"
|
#include "facades.h"
|
||||||
|
|
@ -250,22 +251,42 @@ int PhotoData::height() const {
|
||||||
return _large->height();
|
return _large->height();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PhotoClickHandler::PhotoClickHandler(
|
||||||
|
not_null<PhotoData*> photo,
|
||||||
|
FullMsgId context,
|
||||||
|
PeerData *peer)
|
||||||
|
: FileClickHandler(context)
|
||||||
|
, _session(&photo->session())
|
||||||
|
, _photo(photo)
|
||||||
|
, _peer(peer) {
|
||||||
|
}
|
||||||
|
|
||||||
void PhotoOpenClickHandler::onClickImpl() const {
|
void PhotoOpenClickHandler::onClickImpl() const {
|
||||||
Core::App().showPhoto(this);
|
if (valid()) {
|
||||||
|
Core::App().showPhoto(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhotoSaveClickHandler::onClickImpl() const {
|
void PhotoSaveClickHandler::onClickImpl() const {
|
||||||
auto data = photo();
|
if (!valid()) {
|
||||||
if (!data->date) return;
|
return;
|
||||||
|
}
|
||||||
data->download(context());
|
const auto data = photo();
|
||||||
|
if (!data->date) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
data->download(context());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhotoCancelClickHandler::onClickImpl() const {
|
void PhotoCancelClickHandler::onClickImpl() const {
|
||||||
auto data = photo();
|
if (!valid()) {
|
||||||
if (!data->date) return;
|
return;
|
||||||
|
}
|
||||||
if (data->uploading()) {
|
const auto data = photo();
|
||||||
|
if (!data->date) {
|
||||||
|
return;
|
||||||
|
} else if (data->uploading()) {
|
||||||
if (const auto item = data->owner().message(context())) {
|
if (const auto item = data->owner().message(context())) {
|
||||||
App::main()->cancelUploadLayer(item);
|
App::main()->cancelUploadLayer(item);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -108,21 +108,23 @@ public:
|
||||||
PhotoClickHandler(
|
PhotoClickHandler(
|
||||||
not_null<PhotoData*> photo,
|
not_null<PhotoData*> photo,
|
||||||
FullMsgId context = FullMsgId(),
|
FullMsgId context = FullMsgId(),
|
||||||
PeerData *peer = nullptr)
|
PeerData *peer = nullptr);
|
||||||
: FileClickHandler(context)
|
|
||||||
, _photo(photo)
|
[[nodiscard]] bool valid() const {
|
||||||
, _peer(peer) {
|
return !_session.empty();
|
||||||
}
|
}
|
||||||
not_null<PhotoData*> photo() const {
|
|
||||||
|
[[nodiscard]] not_null<PhotoData*> photo() const {
|
||||||
return _photo;
|
return _photo;
|
||||||
}
|
}
|
||||||
PeerData *peer() const {
|
[[nodiscard]] PeerData *peer() const {
|
||||||
return _peer;
|
return _peer;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
not_null<PhotoData*> _photo;
|
const base::weak_ptr<Main::Session> _session;
|
||||||
PeerData *_peer = nullptr;
|
const not_null<PhotoData*> _photo;
|
||||||
|
PeerData * const _peer = nullptr;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -483,7 +483,7 @@ public:
|
||||||
_context = context;
|
_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
FullMsgId context() const {
|
[[nodiscard]] FullMsgId context() const {
|
||||||
return _context;
|
return _context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ int PinnedList::addPinnedGetPosition(const Key &key) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PinnedList::setPinned(const Key &key, bool pinned) {
|
void PinnedList::setPinned(const Key &key, bool pinned) {
|
||||||
Expects(key.entry()->folderKnown());
|
Expects(key.entry()->folderKnown() || _filterId != 0);
|
||||||
|
|
||||||
if (pinned) {
|
if (pinned) {
|
||||||
const int position = addPinnedGetPosition(key);
|
const int position = addPinnedGetPosition(key);
|
||||||
|
|
@ -100,7 +100,8 @@ void PinnedList::applyList(
|
||||||
void PinnedList::applyList(const std::vector<not_null<History*>> &list) {
|
void PinnedList::applyList(const std::vector<not_null<History*>> &list) {
|
||||||
Expects(_filterId != 0);
|
Expects(_filterId != 0);
|
||||||
|
|
||||||
clear();
|
const auto old = base::take(_data);
|
||||||
|
|
||||||
const auto count = int(list.size());
|
const auto count = int(list.size());
|
||||||
_data.reserve(count);
|
_data.reserve(count);
|
||||||
for (auto i = 0; i != count; ++i) {
|
for (auto i = 0; i != count; ++i) {
|
||||||
|
|
@ -108,6 +109,13 @@ void PinnedList::applyList(const std::vector<not_null<History*>> &list) {
|
||||||
_data.emplace_back(history);
|
_data.emplace_back(history);
|
||||||
history->cachePinnedIndex(_filterId, i + 1);
|
history->cachePinnedIndex(_filterId, i + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const auto &key : old) {
|
||||||
|
const auto history = key.history();
|
||||||
|
if (!history || !ranges::contains(_data, history, &Key::history)) {
|
||||||
|
key.entry()->cachePinnedIndex(_filterId, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PinnedList::reorder(const Key &key1, const Key &key2) {
|
void PinnedList::reorder(const Key &key1, const Key &key2) {
|
||||||
|
|
|
||||||
|
|
@ -489,7 +489,9 @@ void InnerWidget::updateEmptyText() {
|
||||||
TextUtilities::Clean(_searchQuery))
|
TextUtilities::Clean(_searchQuery))
|
||||||
: hasFilter
|
: hasFilter
|
||||||
? tr::lng_admin_log_no_results_text(tr::now)
|
? tr::lng_admin_log_no_results_text(tr::now)
|
||||||
: tr::lng_admin_log_no_events_text(tr::now);
|
: _channel->isMegagroup()
|
||||||
|
? tr::lng_admin_log_no_events_text(tr::now)
|
||||||
|
: tr::lng_admin_log_no_events_text_channel(tr::now);
|
||||||
text.text.append(qstr("\n\n") + description);
|
text.text.append(qstr("\n\n") + description);
|
||||||
_emptyText.setMarkedText(st::defaultTextStyle, text, options);
|
_emptyText.setMarkedText(st::defaultTextStyle, text, options);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ MTPMessage PrepareLogMessage(
|
||||||
| MTPDmessage::Flag::f_reply_to_msg_id
|
| MTPDmessage::Flag::f_reply_to_msg_id
|
||||||
| MTPDmessage::Flag::f_edit_date
|
| MTPDmessage::Flag::f_edit_date
|
||||||
| MTPDmessage::Flag::f_grouped_id
|
| MTPDmessage::Flag::f_grouped_id
|
||||||
|
| MTPDmessage::Flag::f_views
|
||||||
//| MTPDmessage::Flag::f_reactions
|
//| MTPDmessage::Flag::f_reactions
|
||||||
| MTPDmessage::Flag::f_restriction_reason;
|
| MTPDmessage::Flag::f_restriction_reason;
|
||||||
const auto flags = message.vflags().v & ~removeFlags;
|
const auto flags = message.vflags().v & ~removeFlags;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ using "ui/widgets/widgets.style";
|
||||||
minPhotoSize: 100px;
|
minPhotoSize: 100px;
|
||||||
minVideoSize: 160px;
|
minVideoSize: 160px;
|
||||||
maxMediaSize: 430px;
|
maxMediaSize: 430px;
|
||||||
maxStickerSize: 256px;
|
maxStickerSize: 228px;
|
||||||
maxGifSize: 320px;
|
maxGifSize: 320px;
|
||||||
maxVideoMessageSize: 240px;
|
maxVideoMessageSize: 240px;
|
||||||
maxSignatureSize: 144px;
|
maxSignatureSize: 144px;
|
||||||
|
|
@ -387,6 +387,7 @@ historyDateFadeDuration: 200;
|
||||||
historyDiceToast: Toast(defaultToast) {
|
historyDiceToast: Toast(defaultToast) {
|
||||||
minWidth: msgMinWidth;
|
minWidth: msgMinWidth;
|
||||||
maxWidth: 640px;
|
maxWidth: 640px;
|
||||||
|
durationFadeOut: 200;
|
||||||
}
|
}
|
||||||
historyErrorToast: Toast(defaultToast) {
|
historyErrorToast: Toast(defaultToast) {
|
||||||
minWidth: msgMinWidth;
|
minWidth: msgMinWidth;
|
||||||
|
|
|
||||||
|
|
@ -2483,8 +2483,9 @@ void HistoryInner::elementStartStickerLoop(
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryInner::elementShowPollResults(
|
void HistoryInner::elementShowPollResults(
|
||||||
not_null<PollData*> poll,
|
not_null<PollData*> poll,
|
||||||
FullMsgId context) {
|
FullMsgId context) {
|
||||||
|
_controller->showPollResults(poll, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryInner::elementShowTooltip(
|
void HistoryInner::elementShowTooltip(
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ namespace {
|
||||||
|
|
||||||
constexpr auto kPinnedMessageTextLimit = 16;
|
constexpr auto kPinnedMessageTextLimit = 16;
|
||||||
|
|
||||||
MTPDmessage::Flags NewForwardedFlags(
|
[[nodiscard]] MTPDmessage::Flags NewForwardedFlags(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
UserId from,
|
UserId from,
|
||||||
not_null<HistoryMessage*> fwd) {
|
not_null<HistoryMessage*> fwd) {
|
||||||
|
|
@ -82,11 +82,11 @@ MTPDmessage::Flags NewForwardedFlags(
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
MTPDmessage_ClientFlags NewForwardedClientFlags() {
|
[[nodiscard]] MTPDmessage_ClientFlags NewForwardedClientFlags() {
|
||||||
return NewMessageClientFlags();
|
return NewMessageClientFlags();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CopyMarkupToForward(not_null<const HistoryItem*> item) {
|
[[nodiscard]] bool CopyMarkupToForward(not_null<const HistoryItem*> item) {
|
||||||
auto mediaOriginal = item->media();
|
auto mediaOriginal = item->media();
|
||||||
if (mediaOriginal && mediaOriginal->game()) {
|
if (mediaOriginal && mediaOriginal->game()) {
|
||||||
// Copy inline keyboard when forwarding messages with a game.
|
// Copy inline keyboard when forwarding messages with a game.
|
||||||
|
|
@ -111,7 +111,7 @@ bool CopyMarkupToForward(not_null<const HistoryItem*> item) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HasInlineItems(const HistoryItemsList &items) {
|
[[nodiscard]] bool HasInlineItems(const HistoryItemsList &items) {
|
||||||
for (const auto item : items) {
|
for (const auto item : items) {
|
||||||
if (item->viaBot()) {
|
if (item->viaBot()) {
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -120,6 +120,14 @@ bool HasInlineItems(const HistoryItemsList &items) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] TextWithEntities EnsureNonEmpty(
|
||||||
|
const TextWithEntities &text = TextWithEntities()) {
|
||||||
|
if (!text.text.isEmpty()) {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
return { QString::fromUtf8(":-("), EntitiesInText() };
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
QString GetErrorTextForSending(
|
QString GetErrorTextForSending(
|
||||||
|
|
@ -448,10 +456,11 @@ HistoryMessage::HistoryMessage(
|
||||||
if (const auto media = data.vmedia()) {
|
if (const auto media = data.vmedia()) {
|
||||||
setMedia(*media);
|
setMedia(*media);
|
||||||
}
|
}
|
||||||
setText({
|
const auto textWithEntities = TextWithEntities{
|
||||||
TextUtilities::Clean(qs(data.vmessage())),
|
TextUtilities::Clean(qs(data.vmessage())),
|
||||||
Api::EntitiesFromMTP(data.ventities().value_or_empty())
|
Api::EntitiesFromMTP(data.ventities().value_or_empty())
|
||||||
});
|
};
|
||||||
|
setText(_media ? textWithEntities : EnsureNonEmpty(textWithEntities));
|
||||||
if (const auto groupedId = data.vgrouped_id()) {
|
if (const auto groupedId = data.vgrouped_id()) {
|
||||||
setGroupId(
|
setGroupId(
|
||||||
MessageGroupId::FromRaw(history->peer->id, groupedId->v));
|
MessageGroupId::FromRaw(history->peer->id, groupedId->v));
|
||||||
|
|
@ -477,17 +486,12 @@ HistoryMessage::HistoryMessage(
|
||||||
|
|
||||||
createComponents(config);
|
createComponents(config);
|
||||||
|
|
||||||
switch (data.vaction().type()) {
|
data.vaction().match([&](const MTPDmessageActionPhoneCall &data) {
|
||||||
case mtpc_messageActionPhoneCall: {
|
_media = std::make_unique<Data::MediaCall>(this, data);
|
||||||
_media = std::make_unique<Data::MediaCall>(
|
setEmptyText();
|
||||||
this,
|
}, [](const auto &) {
|
||||||
data.vaction().c_messageActionPhoneCall());
|
Unexpected("Service message action type in HistoryMessage.");
|
||||||
} break;
|
});
|
||||||
|
|
||||||
default: Unexpected("Service message action type in HistoryMessage.");
|
|
||||||
}
|
|
||||||
|
|
||||||
setText(TextWithEntities {});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HistoryMessage::HistoryMessage(
|
HistoryMessage::HistoryMessage(
|
||||||
|
|
@ -676,7 +680,7 @@ HistoryMessage::HistoryMessage(
|
||||||
createComponentsHelper(flags, replyTo, viaBotId, postAuthor, markup);
|
createComponentsHelper(flags, replyTo, viaBotId, postAuthor, markup);
|
||||||
|
|
||||||
_media = std::make_unique<Data::MediaGame>(this, game);
|
_media = std::make_unique<Data::MediaGame>(this, game);
|
||||||
setText(TextWithEntities());
|
setEmptyText();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryMessage::createComponentsHelper(
|
void HistoryMessage::createComponentsHelper(
|
||||||
|
|
@ -1075,7 +1079,7 @@ void HistoryMessage::applyEdition(const MTPDmessage &message) {
|
||||||
refreshMedia(message.vmedia());
|
refreshMedia(message.vmedia());
|
||||||
}
|
}
|
||||||
setViewsCount(message.vviews().value_or(-1));
|
setViewsCount(message.vviews().value_or(-1));
|
||||||
setText(textWithEntities);
|
setText(_media ? textWithEntities : EnsureNonEmpty(textWithEntities));
|
||||||
|
|
||||||
finishEdition(keyboardTop);
|
finishEdition(keyboardTop);
|
||||||
}
|
}
|
||||||
|
|
@ -1220,7 +1224,7 @@ void HistoryMessage::setText(const TextWithEntities &textWithEntities) {
|
||||||
// just replace it with something so that UI won't look buggy.
|
// just replace it with something so that UI won't look buggy.
|
||||||
_text.setMarkedText(
|
_text.setMarkedText(
|
||||||
st::messageTextStyle,
|
st::messageTextStyle,
|
||||||
{ QString::fromUtf8(":-("), EntitiesInText() },
|
EnsureNonEmpty(),
|
||||||
Ui::ItemTextOptions(this));
|
Ui::ItemTextOptions(this));
|
||||||
} else if (!_media) {
|
} else if (!_media) {
|
||||||
checkIsolatedEmoji();
|
checkIsolatedEmoji();
|
||||||
|
|
|
||||||
|
|
@ -4140,20 +4140,22 @@ void HistoryWidget::onModerateKeyActivate(int index, bool *outHandled) {
|
||||||
*outHandled = _keyboard->isHidden() ? false : _keyboard->moderateKeyActivate(index);
|
*outHandled = _keyboard->isHidden() ? false : _keyboard->moderateKeyActivate(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::pushTabbedSelectorToThirdSection(
|
bool HistoryWidget::pushTabbedSelectorToThirdSection(
|
||||||
|
not_null<PeerData*> peer,
|
||||||
const Window::SectionShow ¶ms) {
|
const Window::SectionShow ¶ms) {
|
||||||
if (!_history || !_tabbedPanel) {
|
if (!_tabbedPanel) {
|
||||||
return;
|
return true;
|
||||||
} else if (!_canSendMessages) {
|
} else if (!peer->canWrite()) {
|
||||||
session().settings().setTabbedReplacedWithInfo(true);
|
session().settings().setTabbedReplacedWithInfo(true);
|
||||||
controller()->showPeerInfo(_peer, params.withThirdColumn());
|
controller()->showPeerInfo(peer, params.withThirdColumn());
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
session().settings().setTabbedReplacedWithInfo(false);
|
session().settings().setTabbedReplacedWithInfo(false);
|
||||||
controller()->resizeForThirdSection();
|
controller()->resizeForThirdSection();
|
||||||
controller()->showSection(
|
controller()->showSection(
|
||||||
ChatHelpers::TabbedMemento(),
|
ChatHelpers::TabbedMemento(),
|
||||||
params.withThirdColumn());
|
params.withThirdColumn());
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HistoryWidget::returnTabbedSelector() {
|
bool HistoryWidget::returnTabbedSelector() {
|
||||||
|
|
@ -4183,11 +4185,15 @@ void HistoryWidget::setTabbedPanel(std::unique_ptr<TabbedPanel> panel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::toggleTabbedSelectorMode() {
|
void HistoryWidget::toggleTabbedSelectorMode() {
|
||||||
|
if (!_peer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (_tabbedPanel) {
|
if (_tabbedPanel) {
|
||||||
if (controller()->canShowThirdSection() && !Adaptive::OneColumn()) {
|
if (controller()->canShowThirdSection() && !Adaptive::OneColumn()) {
|
||||||
session().settings().setTabbedSelectorSectionEnabled(true);
|
session().settings().setTabbedSelectorSectionEnabled(true);
|
||||||
session().saveSettingsDelayed();
|
session().saveSettingsDelayed();
|
||||||
pushTabbedSelectorToThirdSection(
|
pushTabbedSelectorToThirdSection(
|
||||||
|
_peer,
|
||||||
Window::SectionShow::Way::ClearStack);
|
Window::SectionShow::Way::ClearStack);
|
||||||
} else {
|
} else {
|
||||||
_tabbedPanel->toggleAnimated();
|
_tabbedPanel->toggleAnimated();
|
||||||
|
|
@ -4546,6 +4552,8 @@ bool HistoryWidget::confirmSendingFiles(
|
||||||
bool HistoryWidget::canSendFiles(not_null<const QMimeData*> data) const {
|
bool HistoryWidget::canSendFiles(not_null<const QMimeData*> data) const {
|
||||||
if (!canWriteMessage()) {
|
if (!canWriteMessage()) {
|
||||||
return false;
|
return false;
|
||||||
|
} else if (data->hasImage()) {
|
||||||
|
return true;
|
||||||
} else if (const auto urls = data->urls(); !urls.empty()) {
|
} else if (const auto urls = data->urls(); !urls.empty()) {
|
||||||
if (ranges::find_if(
|
if (ranges::find_if(
|
||||||
urls,
|
urls,
|
||||||
|
|
@ -4553,8 +4561,6 @@ bool HistoryWidget::canSendFiles(not_null<const QMimeData*> data) const {
|
||||||
) == urls.end()) {
|
) == urls.end()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (data->hasImage()) {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -254,7 +254,8 @@ public:
|
||||||
void hideInfoTooltip(anim::type animated);
|
void hideInfoTooltip(anim::type animated);
|
||||||
|
|
||||||
// Tabbed selector management.
|
// Tabbed selector management.
|
||||||
void pushTabbedSelectorToThirdSection(
|
bool pushTabbedSelectorToThirdSection(
|
||||||
|
not_null<PeerData*> peer,
|
||||||
const Window::SectionShow ¶ms) override;
|
const Window::SectionShow ¶ms) override;
|
||||||
bool returnTabbedSelector() override;
|
bool returnTabbedSelector() override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -337,10 +337,11 @@ void ComposeControls::escape() {
|
||||||
_cancelRequests.fire({});
|
_cancelRequests.fire({});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComposeControls::pushTabbedSelectorToThirdSection(
|
bool ComposeControls::pushTabbedSelectorToThirdSection(
|
||||||
|
not_null<PeerData*> peer,
|
||||||
const Window::SectionShow ¶ms) {
|
const Window::SectionShow ¶ms) {
|
||||||
if (!_tabbedPanel) {
|
if (!_tabbedPanel) {
|
||||||
return;
|
return true;
|
||||||
//} else if (!_canSendMessages) {
|
//} else if (!_canSendMessages) {
|
||||||
// session().settings().setTabbedReplacedWithInfo(true);
|
// session().settings().setTabbedReplacedWithInfo(true);
|
||||||
// _window->showPeerInfo(_peer, params.withThirdColumn());
|
// _window->showPeerInfo(_peer, params.withThirdColumn());
|
||||||
|
|
@ -355,6 +356,7 @@ void ComposeControls::pushTabbedSelectorToThirdSection(
|
||||||
_window->showSection(
|
_window->showSection(
|
||||||
ChatHelpers::TabbedMemento(),
|
ChatHelpers::TabbedMemento(),
|
||||||
params.withThirdColumn());
|
params.withThirdColumn());
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ComposeControls::returnTabbedSelector() {
|
bool ComposeControls::returnTabbedSelector() {
|
||||||
|
|
@ -385,11 +387,15 @@ void ComposeControls::setTabbedPanel(
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComposeControls::toggleTabbedSelectorMode() {
|
void ComposeControls::toggleTabbedSelectorMode() {
|
||||||
|
if (!_history) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (_tabbedPanel) {
|
if (_tabbedPanel) {
|
||||||
if (_window->canShowThirdSection() && !Adaptive::OneColumn()) {
|
if (_window->canShowThirdSection() && !Adaptive::OneColumn()) {
|
||||||
session().settings().setTabbedSelectorSectionEnabled(true);
|
session().settings().setTabbedSelectorSectionEnabled(true);
|
||||||
session().saveSettingsDelayed();
|
session().saveSettingsDelayed();
|
||||||
pushTabbedSelectorToThirdSection(
|
pushTabbedSelectorToThirdSection(
|
||||||
|
_history->peer,
|
||||||
Window::SectionShow::Way::ClearStack);
|
Window::SectionShow::Way::ClearStack);
|
||||||
} else {
|
} else {
|
||||||
_tabbedPanel->toggleAnimated();
|
_tabbedPanel->toggleAnimated();
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,9 @@ public:
|
||||||
[[nodiscard]] auto inlineResultChosen() const
|
[[nodiscard]] auto inlineResultChosen() const
|
||||||
-> rpl::producer<ChatHelpers::TabbedSelector::InlineChosen>;
|
-> rpl::producer<ChatHelpers::TabbedSelector::InlineChosen>;
|
||||||
|
|
||||||
void pushTabbedSelectorToThirdSection(const Window::SectionShow ¶ms);
|
bool pushTabbedSelectorToThirdSection(
|
||||||
|
not_null<PeerData*> peer,
|
||||||
|
const Window::SectionShow ¶ms);
|
||||||
bool returnTabbedSelector();
|
bool returnTabbedSelector();
|
||||||
|
|
||||||
void showForGrab();
|
void showForGrab();
|
||||||
|
|
|
||||||
|
|
@ -706,9 +706,10 @@ void ScheduledWidget::setInternalState(
|
||||||
restoreState(memento);
|
restoreState(memento);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScheduledWidget::pushTabbedSelectorToThirdSection(
|
bool ScheduledWidget::pushTabbedSelectorToThirdSection(
|
||||||
|
not_null<PeerData*> peer,
|
||||||
const Window::SectionShow ¶ms) {
|
const Window::SectionShow ¶ms) {
|
||||||
_composeControls->pushTabbedSelectorToThirdSection(params);
|
return _composeControls->pushTabbedSelectorToThirdSection(peer, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScheduledWidget::returnTabbedSelector() {
|
bool ScheduledWidget::returnTabbedSelector() {
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,8 @@ public:
|
||||||
not_null<ScheduledMemento*> memento);
|
not_null<ScheduledMemento*> memento);
|
||||||
|
|
||||||
// Tabbed selector management.
|
// Tabbed selector management.
|
||||||
void pushTabbedSelectorToThirdSection(
|
bool pushTabbedSelectorToThirdSection(
|
||||||
|
not_null<PeerData*> peer,
|
||||||
const Window::SectionShow ¶ms) override;
|
const Window::SectionShow ¶ms) override;
|
||||||
bool returnTabbedSelector() override;
|
bool returnTabbedSelector() override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,13 @@ namespace {
|
||||||
[[nodiscard]] ClickHandlerPtr MakeDiceHandler(
|
[[nodiscard]] ClickHandlerPtr MakeDiceHandler(
|
||||||
not_null<History*> history,
|
not_null<History*> history,
|
||||||
const QString &emoji) {
|
const QString &emoji) {
|
||||||
|
static auto ShownToast = base::weak_ptr<Ui::Toast::Instance>();
|
||||||
|
static const auto HideExisting = [] {
|
||||||
|
if (const auto toast = ShownToast.get()) {
|
||||||
|
toast->hideAnimated();
|
||||||
|
ShownToast = nullptr;
|
||||||
|
}
|
||||||
|
};
|
||||||
return std::make_shared<LambdaClickHandler>([=] {
|
return std::make_shared<LambdaClickHandler>([=] {
|
||||||
auto config = Ui::Toast::Config{
|
auto config = Ui::Toast::Config{
|
||||||
.text = { tr::lng_about_random(tr::now, lt_emoji, emoji) },
|
.text = { tr::lng_about_random(tr::now, lt_emoji, emoji) },
|
||||||
|
|
@ -51,16 +58,20 @@ namespace {
|
||||||
config.filter = crl::guard(&history->session(), [=](
|
config.filter = crl::guard(&history->session(), [=](
|
||||||
const ClickHandlerPtr &handler,
|
const ClickHandlerPtr &handler,
|
||||||
Qt::MouseButton button) {
|
Qt::MouseButton button) {
|
||||||
if (button == Qt::LeftButton) {
|
if (button == Qt::LeftButton && !ShownToast.empty()) {
|
||||||
auto message = Api::MessageToSend(history);
|
auto message = Api::MessageToSend(history);
|
||||||
message.action.clearDraft = false;
|
message.action.clearDraft = false;
|
||||||
message.textWithTags.text = emoji;
|
message.textWithTags.text = emoji;
|
||||||
|
|
||||||
Api::SendDice(message);
|
Api::SendDice(message);
|
||||||
|
HideExisting();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Ui::Toast::Show(config);
|
|
||||||
|
HideExisting();
|
||||||
|
ShownToast = Ui::Toast::Show(config);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,12 @@ public:
|
||||||
return _attach.get();
|
return _attach.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void unloadHeavyPart() override {
|
||||||
|
if (_attach) {
|
||||||
|
_attach->unloadHeavyPart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void parentTextUpdated() override;
|
void parentTextUpdated() override;
|
||||||
|
|
||||||
~Game();
|
~Game();
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,12 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void unloadHeavyPart() override {
|
||||||
|
if (_attach) {
|
||||||
|
_attach->unloadHeavyPart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Media *attach() const {
|
Media *attach() const {
|
||||||
return _attach.get();
|
return _attach.get();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,12 @@ public:
|
||||||
}
|
}
|
||||||
bool enforceBubbleWidth() const override;
|
bool enforceBubbleWidth() const override;
|
||||||
|
|
||||||
|
void unloadHeavyPart() override {
|
||||||
|
if (_attach) {
|
||||||
|
_attach->unloadHeavyPart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Media *attach() const {
|
Media *attach() const {
|
||||||
return _attach.get();
|
return _attach.get();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,10 +124,10 @@ void InnerWidget::createTypeButtons() {
|
||||||
addMediaButton(Type::File, st::infoIconMediaFile);
|
addMediaButton(Type::File, st::infoIconMediaFile);
|
||||||
addMediaButton(Type::MusicFile, st::infoIconMediaAudio);
|
addMediaButton(Type::MusicFile, st::infoIconMediaAudio);
|
||||||
addMediaButton(Type::Link, st::infoIconMediaLink);
|
addMediaButton(Type::Link, st::infoIconMediaLink);
|
||||||
|
addMediaButton(Type::RoundVoiceFile, st::infoIconMediaVoice);
|
||||||
if (auto user = _controller->key().peer()->asUser()) {
|
if (auto user = _controller->key().peer()->asUser()) {
|
||||||
// addCommonGroupsButton(user, st::infoIconMediaGroup);
|
// addCommonGroupsButton(user, st::infoIconMediaGroup);
|
||||||
}
|
}
|
||||||
addMediaButton(Type::RoundVoiceFile, st::infoIconMediaVoice);
|
|
||||||
|
|
||||||
content->add(object_ptr<Ui::FixedHeightWidget>(
|
content->add(object_ptr<Ui::FixedHeightWidget>(
|
||||||
content,
|
content,
|
||||||
|
|
|
||||||
|
|
@ -169,10 +169,10 @@ object_ptr<Ui::RpWidget> InnerWidget::setupSharedMedia(
|
||||||
addMediaButton(MediaType::File, st::infoIconMediaFile);
|
addMediaButton(MediaType::File, st::infoIconMediaFile);
|
||||||
addMediaButton(MediaType::MusicFile, st::infoIconMediaAudio);
|
addMediaButton(MediaType::MusicFile, st::infoIconMediaAudio);
|
||||||
addMediaButton(MediaType::Link, st::infoIconMediaLink);
|
addMediaButton(MediaType::Link, st::infoIconMediaLink);
|
||||||
|
addMediaButton(MediaType::RoundVoiceFile, st::infoIconMediaVoice);
|
||||||
if (auto user = _peer->asUser()) {
|
if (auto user = _peer->asUser()) {
|
||||||
addCommonGroupsButton(user, st::infoIconMediaGroup);
|
addCommonGroupsButton(user, st::infoIconMediaGroup);
|
||||||
}
|
}
|
||||||
addMediaButton(MediaType::RoundVoiceFile, st::infoIconMediaVoice);
|
|
||||||
|
|
||||||
auto result = object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
|
auto result = object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
|
||||||
parent,
|
parent,
|
||||||
|
|
|
||||||
|
|
@ -2388,11 +2388,11 @@ void MainWidget::updateControlsGeometry() {
|
||||||
Window::SectionShow::Way::ClearStack,
|
Window::SectionShow::Way::ClearStack,
|
||||||
anim::type::instant,
|
anim::type::instant,
|
||||||
anim::activation::background);
|
anim::activation::background);
|
||||||
if (session().settings().tabbedSelectorSectionEnabled()) {
|
const auto active = _controller->activeChatCurrent();
|
||||||
_history->pushTabbedSelectorToThirdSection(params);
|
if (const auto peer = active.peer()) {
|
||||||
} else if (session().settings().thirdSectionInfoEnabled()) {
|
if (session().settings().tabbedSelectorSectionEnabled()) {
|
||||||
const auto active = _controller->activeChatCurrent();
|
_history->pushTabbedSelectorToThirdSection(peer, params);
|
||||||
if (const auto peer = active.peer()) {
|
} else if (session().settings().thirdSectionInfoEnabled()) {
|
||||||
_controller->showSection(
|
_controller->showSection(
|
||||||
Info::Memento::Default(peer),
|
Info::Memento::Default(peer),
|
||||||
params.withThirdColumn());
|
params.withThirdColumn());
|
||||||
|
|
@ -2641,9 +2641,9 @@ void MainWidget::updateThirdColumnToCurrentChat(
|
||||||
std::move(*thirdSectionForCurrentMainSection(key)),
|
std::move(*thirdSectionForCurrentMainSection(key)),
|
||||||
params.withThirdColumn());
|
params.withThirdColumn());
|
||||||
};
|
};
|
||||||
auto switchTabbedFast = [&] {
|
auto switchTabbedFast = [&](not_null<PeerData*> peer) {
|
||||||
saveOldThirdSection();
|
saveOldThirdSection();
|
||||||
_history->pushTabbedSelectorToThirdSection(params);
|
return _history->pushTabbedSelectorToThirdSection(peer, params);
|
||||||
};
|
};
|
||||||
if (Adaptive::ThreeColumn()
|
if (Adaptive::ThreeColumn()
|
||||||
&& session().settings().tabbedSelectorSectionEnabled()
|
&& session().settings().tabbedSelectorSectionEnabled()
|
||||||
|
|
@ -2652,9 +2652,10 @@ void MainWidget::updateThirdColumnToCurrentChat(
|
||||||
switchInfoFast();
|
switchInfoFast();
|
||||||
session().settings().setTabbedSelectorSectionEnabled(true);
|
session().settings().setTabbedSelectorSectionEnabled(true);
|
||||||
session().settings().setTabbedReplacedWithInfo(true);
|
session().settings().setTabbedReplacedWithInfo(true);
|
||||||
} else if (session().settings().tabbedReplacedWithInfo()) {
|
} else if (session().settings().tabbedReplacedWithInfo()
|
||||||
|
&& key.history()
|
||||||
|
&& switchTabbedFast(key.history()->peer)) {
|
||||||
session().settings().setTabbedReplacedWithInfo(false);
|
session().settings().setTabbedReplacedWithInfo(false);
|
||||||
switchTabbedFast();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
session().settings().setTabbedReplacedWithInfo(false);
|
session().settings().setTabbedReplacedWithInfo(false);
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ QIcon TrayIcon;
|
||||||
QString TrayIconThemeName, TrayIconName;
|
QString TrayIconThemeName, TrayIconName;
|
||||||
|
|
||||||
bool SNIAvailable = false;
|
bool SNIAvailable = false;
|
||||||
|
bool AppMenuSupported = false;
|
||||||
|
|
||||||
QString GetPanelIconName(int counter, bool muted) {
|
QString GetPanelIconName(int counter, bool muted) {
|
||||||
const auto useTelegramIcon = qEnvironmentVariableIsSet(
|
const auto useTelegramIcon = qEnvironmentVariableIsSet(
|
||||||
|
|
@ -364,18 +365,14 @@ quint32 djbStringHash(QString string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
bool AppMenuSupported() {
|
bool IsAppMenuSupported() {
|
||||||
static const auto Available = []() -> bool {
|
const auto interface = QDBusConnection::sessionBus().interface();
|
||||||
const auto interface = QDBusConnection::sessionBus().interface();
|
|
||||||
|
|
||||||
if (!interface) {
|
if (!interface) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return interface->isServiceRegistered(kAppMenuService.utf16());
|
return interface->isServiceRegistered(kAppMenuService.utf16());
|
||||||
}();
|
|
||||||
|
|
||||||
return Available;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegisterAppMenu(uint winId, const QDBusObjectPath &menuPath) {
|
void RegisterAppMenu(uint winId, const QDBusObjectPath &menuPath) {
|
||||||
|
|
@ -461,13 +458,27 @@ void MainWindow::initHook() {
|
||||||
this,
|
this,
|
||||||
&MainWindow::onSNIOwnerChanged);
|
&MainWindow::onSNIOwnerChanged);
|
||||||
|
|
||||||
|
AppMenuSupported = IsAppMenuSupported();
|
||||||
|
|
||||||
|
auto appMenuWatcher = new QDBusServiceWatcher(
|
||||||
|
kAppMenuService.utf16(),
|
||||||
|
QDBusConnection::sessionBus(),
|
||||||
|
QDBusServiceWatcher::WatchForOwnerChange,
|
||||||
|
this);
|
||||||
|
|
||||||
|
connect(
|
||||||
|
appMenuWatcher,
|
||||||
|
&QDBusServiceWatcher::serviceOwnerChanged,
|
||||||
|
this,
|
||||||
|
&MainWindow::onAppMenuOwnerChanged);
|
||||||
|
|
||||||
connect(
|
connect(
|
||||||
windowHandle(),
|
windowHandle(),
|
||||||
&QWindow::visibleChanged,
|
&QWindow::visibleChanged,
|
||||||
this,
|
this,
|
||||||
&MainWindow::onVisibleChanged);
|
&MainWindow::onVisibleChanged);
|
||||||
|
|
||||||
if (AppMenuSupported()) {
|
if (AppMenuSupported) {
|
||||||
LOG(("Using D-Bus global menu."));
|
LOG(("Using D-Bus global menu."));
|
||||||
} else {
|
} else {
|
||||||
LOG(("Not using D-Bus global menu."));
|
LOG(("Not using D-Bus global menu."));
|
||||||
|
|
@ -480,6 +491,8 @@ void MainWindow::initHook() {
|
||||||
}
|
}
|
||||||
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
|
|
||||||
|
updateWaylandDecorationColors();
|
||||||
|
|
||||||
style::PaletteChanged(
|
style::PaletteChanged(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
updateWaylandDecorationColors();
|
updateWaylandDecorationColors();
|
||||||
|
|
@ -601,6 +614,25 @@ void MainWindow::onSNIOwnerChanged(
|
||||||
LOG(("System tray is not available."));
|
LOG(("System tray is not available."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::onAppMenuOwnerChanged(
|
||||||
|
const QString &service,
|
||||||
|
const QString &oldOwner,
|
||||||
|
const QString &newOwner) {
|
||||||
|
if (oldOwner.isEmpty() && !newOwner.isEmpty()) {
|
||||||
|
AppMenuSupported = true;
|
||||||
|
LOG(("Using D-Bus global menu."));
|
||||||
|
} else if (!oldOwner.isEmpty() && newOwner.isEmpty()) {
|
||||||
|
AppMenuSupported = false;
|
||||||
|
LOG(("Not using D-Bus global menu."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AppMenuSupported && !_mainMenuPath.path().isEmpty()) {
|
||||||
|
RegisterAppMenu(winId(), _mainMenuPath);
|
||||||
|
} else {
|
||||||
|
UnregisterAppMenu(winId());
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
|
|
||||||
void MainWindow::psSetupTrayIcon() {
|
void MainWindow::psSetupTrayIcon() {
|
||||||
|
|
@ -709,6 +741,9 @@ void MainWindow::updateWaylandDecorationColors() {
|
||||||
windowHandle()->setProperty("__material_decoration_foregroundColor", st::titleFgActive->c);
|
windowHandle()->setProperty("__material_decoration_foregroundColor", st::titleFgActive->c);
|
||||||
windowHandle()->setProperty("__material_decoration_backgroundInactiveColor", st::titleBg->c);
|
windowHandle()->setProperty("__material_decoration_backgroundInactiveColor", st::titleBg->c);
|
||||||
windowHandle()->setProperty("__material_decoration_foregroundInactiveColor", st::titleFg->c);
|
windowHandle()->setProperty("__material_decoration_foregroundInactiveColor", st::titleFg->c);
|
||||||
|
|
||||||
|
// Trigger a QtWayland client-side decoration update
|
||||||
|
windowHandle()->resize(windowHandle()->size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::LibsLoaded() {
|
void MainWindow::LibsLoaded() {
|
||||||
|
|
@ -735,8 +770,6 @@ void MainWindow::updateGlobalMenuHook() {
|
||||||
#else // TDESKTOP_DISABLE_DBUS_INTEGRATION
|
#else // TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
|
|
||||||
void MainWindow::createGlobalMenu() {
|
void MainWindow::createGlobalMenu() {
|
||||||
if (!AppMenuSupported()) return;
|
|
||||||
|
|
||||||
psMainMenu = new QMenu(this);
|
psMainMenu = new QMenu(this);
|
||||||
|
|
||||||
auto file = psMainMenu->addMenu(tr::lng_mac_menu_file(tr::now));
|
auto file = psMainMenu->addMenu(tr::lng_mac_menu_file(tr::now));
|
||||||
|
|
@ -915,7 +948,9 @@ void MainWindow::createGlobalMenu() {
|
||||||
_mainMenuPath.path(),
|
_mainMenuPath.path(),
|
||||||
psMainMenu);
|
psMainMenu);
|
||||||
|
|
||||||
RegisterAppMenu(winId(), _mainMenuPath);
|
if (AppMenuSupported) {
|
||||||
|
RegisterAppMenu(winId(), _mainMenuPath);
|
||||||
|
}
|
||||||
|
|
||||||
updateGlobalMenu();
|
updateGlobalMenu();
|
||||||
}
|
}
|
||||||
|
|
@ -973,7 +1008,7 @@ void MainWindow::psLinuxClearFormat() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updateGlobalMenuHook() {
|
void MainWindow::updateGlobalMenuHook() {
|
||||||
if (!AppMenuSupported() || !App::wnd() || !positionInited()) return;
|
if (!App::wnd() || !positionInited()) return;
|
||||||
|
|
||||||
const auto focused = QApplication::focusWidget();
|
const auto focused = QApplication::focusWidget();
|
||||||
auto canUndo = false;
|
auto canUndo = false;
|
||||||
|
|
@ -1035,7 +1070,7 @@ void MainWindow::updateGlobalMenuHook() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onVisibleChanged(bool visible) {
|
void MainWindow::onVisibleChanged(bool visible) {
|
||||||
if (AppMenuSupported() && !_mainMenuPath.path().isEmpty()) {
|
if (AppMenuSupported && !_mainMenuPath.path().isEmpty()) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
RegisterAppMenu(winId(), _mainMenuPath);
|
RegisterAppMenu(winId(), _mainMenuPath);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1050,11 +1085,12 @@ MainWindow::~MainWindow() {
|
||||||
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
delete _sniTrayIcon;
|
delete _sniTrayIcon;
|
||||||
|
|
||||||
if (AppMenuSupported()) {
|
if (AppMenuSupported) {
|
||||||
UnregisterAppMenu(winId());
|
UnregisterAppMenu(winId());
|
||||||
delete _mainMenuExporter;
|
|
||||||
delete psMainMenu;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete _mainMenuExporter;
|
||||||
|
delete psMainMenu;
|
||||||
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
|
|
||||||
delete _trayIconMenuXEmbed;
|
delete _trayIconMenuXEmbed;
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,11 @@ public slots:
|
||||||
const QString &oldOwner,
|
const QString &oldOwner,
|
||||||
const QString &newOwner);
|
const QString &newOwner);
|
||||||
|
|
||||||
|
void onAppMenuOwnerChanged(
|
||||||
|
const QString &service,
|
||||||
|
const QString &oldOwner,
|
||||||
|
const QString &newOwner);
|
||||||
|
|
||||||
void psLinuxUndo();
|
void psLinuxUndo();
|
||||||
void psLinuxRedo();
|
void psLinuxRedo();
|
||||||
void psLinuxCut();
|
void psLinuxCut();
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#include <QtCore/QtPlugin>
|
#include <QtCore/QtPlugin>
|
||||||
|
|
||||||
|
#ifndef DESKTOP_APP_USE_PACKAGED
|
||||||
Q_IMPORT_PLUGIN(QWebpPlugin)
|
Q_IMPORT_PLUGIN(QWebpPlugin)
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
|
||||||
|
|
@ -30,20 +31,41 @@ Q_IMPORT_PLUGIN(QWaylandXdgShellV5IntegrationPlugin)
|
||||||
Q_IMPORT_PLUGIN(QWaylandXdgShellV6IntegrationPlugin)
|
Q_IMPORT_PLUGIN(QWaylandXdgShellV6IntegrationPlugin)
|
||||||
Q_IMPORT_PLUGIN(QWaylandXdgShellIntegrationPlugin)
|
Q_IMPORT_PLUGIN(QWaylandXdgShellIntegrationPlugin)
|
||||||
Q_IMPORT_PLUGIN(QWaylandBradientDecorationPlugin)
|
Q_IMPORT_PLUGIN(QWaylandBradientDecorationPlugin)
|
||||||
Q_IMPORT_PLUGIN(QWaylandMaterialDecorationPlugin)
|
|
||||||
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
|
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
|
||||||
Q_IMPORT_PLUGIN(QWaylandIntegrationPlugin)
|
Q_IMPORT_PLUGIN(QWaylandIntegrationPlugin)
|
||||||
Q_IMPORT_PLUGIN(QWaylandEglPlatformIntegrationPlugin)
|
Q_IMPORT_PLUGIN(QWaylandEglPlatformIntegrationPlugin)
|
||||||
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
|
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
|
||||||
Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin)
|
Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin)
|
||||||
|
Q_IMPORT_PLUGIN(QSvgPlugin)
|
||||||
Q_IMPORT_PLUGIN(QSvgIconPlugin)
|
Q_IMPORT_PLUGIN(QSvgIconPlugin)
|
||||||
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
Q_IMPORT_PLUGIN(QConnmanEnginePlugin)
|
Q_IMPORT_PLUGIN(QConnmanEnginePlugin)
|
||||||
Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin)
|
Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin)
|
||||||
Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin)
|
Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin)
|
||||||
Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin)
|
|
||||||
Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin)
|
|
||||||
Q_IMPORT_PLUGIN(NimfInputContextPlugin)
|
|
||||||
Q_IMPORT_PLUGIN(QXdgDesktopPortalThemePlugin)
|
Q_IMPORT_PLUGIN(QXdgDesktopPortalThemePlugin)
|
||||||
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
#endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX
|
#endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX
|
||||||
|
#endif // !DESKTOP_APP_USE_PACKAGED
|
||||||
|
|
||||||
|
#ifdef Q_OS_LINUX
|
||||||
|
#if !defined DESKTOP_APP_USE_PACKAGED || defined DESKTOP_APP_USE_PACKAGED_LAZY
|
||||||
|
Q_IMPORT_PLUGIN(QWaylandMaterialDecorationPlugin)
|
||||||
|
Q_IMPORT_PLUGIN(NimfInputContextPlugin)
|
||||||
|
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
|
Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin)
|
||||||
|
Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin)
|
||||||
|
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
|
#endif // !DESKTOP_APP_USE_PACKAGED || DESKTOP_APP_USE_PACKAGED_LAZY
|
||||||
|
|
||||||
|
#if !defined DESKTOP_APP_USE_PACKAGED || defined DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES
|
||||||
|
Q_IMPORT_PLUGIN(Qt5CTPlatformThemePlugin)
|
||||||
|
Q_IMPORT_PLUGIN(Qt5CTStylePlugin)
|
||||||
|
#endif // !DESKTOP_APP_USE_PACKAGED || DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES
|
||||||
|
|
||||||
|
// conflicts with Qt static link
|
||||||
|
#ifdef DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES
|
||||||
|
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
|
Q_IMPORT_PLUGIN(LXQtPlatformThemePlugin)
|
||||||
|
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
|
#endif // DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES
|
||||||
|
#endif // Q_OS_LINUX
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,10 @@ public:
|
||||||
[[nodiscard]] Main::Session &session() const;
|
[[nodiscard]] Main::Session &session() const;
|
||||||
|
|
||||||
// Tabbed selector management.
|
// Tabbed selector management.
|
||||||
virtual void pushTabbedSelectorToThirdSection(
|
virtual bool pushTabbedSelectorToThirdSection(
|
||||||
const Window::SectionShow ¶ms) {
|
not_null<PeerData*> peer,
|
||||||
|
const Window::SectionShow ¶ms) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
virtual bool returnTabbedSelector() {
|
virtual bool returnTabbedSelector() {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
1
Telegram/ThirdParty/fcitx-qt5
vendored
Submodule
1
Telegram/ThirdParty/fcitx-qt5
vendored
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 4abe66549e13b33fd4baa84858d932e0178ce8c0
|
||||||
1
Telegram/ThirdParty/hime
vendored
Submodule
1
Telegram/ThirdParty/hime
vendored
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 7525645598649afeab5bfe7fda612c2ad744e7a3
|
||||||
1
Telegram/ThirdParty/libqtxdg
vendored
Submodule
1
Telegram/ThirdParty/libqtxdg
vendored
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit ae412d30c695f3d4ce9b79feabc937eefde5537b
|
||||||
1
Telegram/ThirdParty/lxqt-qtplugin
vendored
Submodule
1
Telegram/ThirdParty/lxqt-qtplugin
vendored
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 418162b36eff24fe70fd9195c60fae7276afa286
|
||||||
1
Telegram/ThirdParty/materialdecoration
vendored
Submodule
1
Telegram/ThirdParty/materialdecoration
vendored
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit e58c870f2365178b0553664d762a7a2aeae99bd4
|
||||||
1
Telegram/ThirdParty/nimf
vendored
Submodule
1
Telegram/ThirdParty/nimf
vendored
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 7234ac6724f4b7870aebed4dae95a4b9edbccd70
|
||||||
1
Telegram/ThirdParty/qt5ct
vendored
Submodule
1
Telegram/ThirdParty/qt5ct
vendored
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit a959a35dfe3b9547a9f6bc8c102a71941cf0fc0a
|
||||||
1
Telegram/ThirdParty/range-v3
vendored
Submodule
1
Telegram/ThirdParty/range-v3
vendored
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 4d6a463bca51bc316f9b565edd94e82388206093
|
||||||
|
|
@ -300,9 +300,9 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "osx" ] || [ "$BuildTarget
|
||||||
if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "osx" ]; then
|
if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "osx" ]; then
|
||||||
codesign --force --deep --timestamp --options runtime --sign "Developer ID Application: John Preston" "$ReleasePath/$BinaryName.app" --entitlements "$HomePath/Telegram/Telegram.entitlements"
|
codesign --force --deep --timestamp --options runtime --sign "Developer ID Application: John Preston" "$ReleasePath/$BinaryName.app" --entitlements "$HomePath/Telegram/Telegram.entitlements"
|
||||||
elif [ "$BuildTarget" == "macstore" ]; then
|
elif [ "$BuildTarget" == "macstore" ]; then
|
||||||
codesign --force --deep --sign "3rd Party Mac Developer Application: TELEGRAM MESSENGER LLP (6N38VWS5BX)" "$ReleasePath/$BinaryName.app" --entitlements "$HomePath/Telegram/Telegram Lite.entitlements"
|
codesign --force --deep --sign "3rd Party Mac Developer Application: Telegram FZ-LLC (C67CF9S4VU)" "$ReleasePath/$BinaryName.app" --entitlements "$HomePath/Telegram/Telegram Lite.entitlements"
|
||||||
echo "Making an installer.."
|
echo "Making an installer.."
|
||||||
productbuild --sign "3rd Party Mac Developer Installer: TELEGRAM MESSENGER LLP (6N38VWS5BX)" --component "$ReleasePath/$BinaryName.app" /Applications "$ReleasePath/$BinaryName.pkg"
|
productbuild --sign "3rd Party Mac Developer Installer: Telegram FZ-LLC (C67CF9S4VU)" --component "$ReleasePath/$BinaryName.app" /Applications "$ReleasePath/$BinaryName.pkg"
|
||||||
fi
|
fi
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
AppVersion 2001001
|
AppVersion 2001002
|
||||||
AppVersionStrMajor 2.1
|
AppVersionStrMajor 2.1
|
||||||
AppVersionStrSmall 2.1.1
|
AppVersionStrSmall 2.1.2
|
||||||
AppVersionStr 2.1.1
|
AppVersionStr 2.1.2
|
||||||
BetaChannel 0
|
BetaChannel 0
|
||||||
AlphaVersion 0
|
AlphaVersion 0
|
||||||
AppVersionOriginal 2.1.1
|
AppVersionOriginal 2.1.2
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
# For license and copyright information please follow this link:
|
# For license and copyright information please follow this link:
|
||||||
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
if (TDESKTOP_USE_PACKAGED_TGVOIP)
|
if (TDESKTOP_USE_PACKAGED_TGVOIP AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
|
||||||
add_library(lib_tgvoip INTERFACE IMPORTED GLOBAL)
|
add_library(lib_tgvoip INTERFACE IMPORTED GLOBAL)
|
||||||
add_library(tdesktop::lib_tgvoip ALIAS lib_tgvoip)
|
add_library(tdesktop::lib_tgvoip ALIAS lib_tgvoip)
|
||||||
|
|
||||||
|
|
@ -790,4 +790,12 @@ else()
|
||||||
desktop-app::external_openssl
|
desktop-app::external_openssl
|
||||||
desktop-app::external_opus
|
desktop-app::external_opus
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (LINUX)
|
||||||
|
target_link_libraries(lib_tgvoip
|
||||||
|
PRIVATE
|
||||||
|
${CMAKE_DL_LIBS}
|
||||||
|
pthread
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit d27c3e363254b169f8886934df8580fdc76d424e
|
Subproject commit 9e01ede6661e2a74697283c7836d4fae433f50ce
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 6f9dbaa7b29ead994a1f0738e82023af7892d106
|
Subproject commit 019bb19f0923af2e8c7e0cd1abc2b8d9264afb7c
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit d60753154173ad6777b0e6b293bfaa50ea17f6b7
|
Subproject commit a76cb8e35ee7e892a9a25a53051b3e89021e1f45
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
2.1.2 (05.05.20)
|
||||||
|
|
||||||
|
- Fix polls and quizes results viewing.
|
||||||
|
- Fix memory leak in web page previews with autoplayed videos.
|
||||||
|
- Fix running on OS X 10.10.
|
||||||
|
- Other minor bug fixes and improvements.
|
||||||
|
|
||||||
2.1.1 (01.05.20)
|
2.1.1 (01.05.20)
|
||||||
|
|
||||||
- Improve quiz explanation tooltip layout.
|
- Improve quiz explanation tooltip layout.
|
||||||
|
|
|
||||||
2
cmake
2
cmake
|
|
@ -1 +1 @@
|
||||||
Subproject commit 834a8a00e43c12b634ba35176c7250a9b6140bbe
|
Subproject commit 81a0fc7970a62e8c1b194bd8eb85890528366ca7
|
||||||
|
|
@ -54,9 +54,8 @@ Go to ***BuildPath*** and run
|
||||||
|
|
||||||
git clone https://github.com/desktop-app/patches.git
|
git clone https://github.com/desktop-app/patches.git
|
||||||
cd patches
|
cd patches
|
||||||
git checkout 10aeaf6
|
git checkout e036126
|
||||||
cd ../
|
cd ../
|
||||||
git clone --branch 0.10.0 https://github.com/ericniebler/range-v3
|
|
||||||
|
|
||||||
git clone https://github.com/xiph/opus
|
git clone https://github.com/xiph/opus
|
||||||
cd opus
|
cd opus
|
||||||
|
|
@ -246,10 +245,7 @@ Go to ***BuildPath*** and run
|
||||||
cd qtbase
|
cd qtbase
|
||||||
git apply ../../patches/qtbase_5_12_8.diff
|
git apply ../../patches/qtbase_5_12_8.diff
|
||||||
cd src/plugins/platforminputcontexts
|
cd src/plugins/platforminputcontexts
|
||||||
git clone https://github.com/desktop-app/fcitx.git
|
cd ..
|
||||||
git clone https://github.com/desktop-app/hime.git
|
|
||||||
git clone https://github.com/desktop-app/nimf.git
|
|
||||||
cd ../../../..
|
|
||||||
|
|
||||||
OPENSSL_DIR=/usr/local/desktop-app/openssl-1.1.1
|
OPENSSL_DIR=/usr/local/desktop-app/openssl-1.1.1
|
||||||
./configure -prefix "/usr/local/desktop-app/Qt-5.12.8" \
|
./configure -prefix "/usr/local/desktop-app/Qt-5.12.8" \
|
||||||
|
|
@ -275,13 +271,6 @@ Go to ***BuildPath*** and run
|
||||||
sudo make install
|
sudo make install
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
git clone --depth=1 https://github.com/desktop-app/materialdecoration.git
|
|
||||||
cd materialdecoration
|
|
||||||
/usr/local/desktop-app/Qt-5.12.8/bin/qmake CONFIG+=static
|
|
||||||
make $MAKE_THREADS_CNT
|
|
||||||
sudo make install
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
git clone https://chromium.googlesource.com/external/gyp
|
git clone https://chromium.googlesource.com/external/gyp
|
||||||
cd gyp
|
cd gyp
|
||||||
git checkout 9f2a7bb1
|
git checkout 9f2a7bb1
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ Open **x86 Native Tools Command Prompt for VS 2019.bat**, go to ***BuildPath***
|
||||||
cd ThirdParty
|
cd ThirdParty
|
||||||
git clone https://github.com/desktop-app/patches.git
|
git clone https://github.com/desktop-app/patches.git
|
||||||
cd patches
|
cd patches
|
||||||
git checkout 10aeaf6
|
git checkout e036126
|
||||||
cd ../
|
cd ../
|
||||||
git clone https://chromium.googlesource.com/external/gyp
|
git clone https://chromium.googlesource.com/external/gyp
|
||||||
cd gyp
|
cd gyp
|
||||||
|
|
@ -64,9 +64,8 @@ Open **x86 Native Tools Command Prompt for VS 2019.bat**, go to ***BuildPath***
|
||||||
|
|
||||||
git clone https://github.com/desktop-app/patches.git
|
git clone https://github.com/desktop-app/patches.git
|
||||||
cd patches
|
cd patches
|
||||||
git checkout 10aeaf6
|
git checkout e036126
|
||||||
cd ..
|
cd ..
|
||||||
git clone --branch 0.10.0 https://github.com/ericniebler/range-v3 range-v3
|
|
||||||
|
|
||||||
git clone https://github.com/desktop-app/lzma.git
|
git clone https://github.com/desktop-app/lzma.git
|
||||||
cd lzma\C\Util\LzmaLib
|
cd lzma\C\Util\LzmaLib
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,6 @@ Go to ***BuildPath*** and run
|
||||||
cd patches
|
cd patches
|
||||||
git checkout 395b620
|
git checkout 395b620
|
||||||
cd ../
|
cd ../
|
||||||
git clone --branch 0.10.0 https://github.com/ericniebler/range-v3
|
|
||||||
|
|
||||||
cd xz-5.0.5
|
cd xz-5.0.5
|
||||||
CFLAGS="-mmacosx-version-min=10.10" LDFLAGS="-mmacosx-version-min=10.10" ./configure
|
CFLAGS="-mmacosx-version-min=10.10" LDFLAGS="-mmacosx-version-min=10.10" ./configure
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ Go to ***BuildPath*** and run
|
||||||
|
|
||||||
git clone https://github.com/desktop-app/patches.git
|
git clone https://github.com/desktop-app/patches.git
|
||||||
cd patches
|
cd patches
|
||||||
git checkout 10aeaf6
|
git checkout e036126
|
||||||
cd ../
|
cd ../
|
||||||
git clone https://chromium.googlesource.com/external/gyp
|
git clone https://chromium.googlesource.com/external/gyp
|
||||||
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||||
|
|
@ -47,9 +47,8 @@ Go to ***BuildPath*** and run
|
||||||
|
|
||||||
git clone https://github.com/desktop-app/patches.git
|
git clone https://github.com/desktop-app/patches.git
|
||||||
cd patches
|
cd patches
|
||||||
git checkout 10aeaf6
|
git checkout e036126
|
||||||
cd ..
|
cd ..
|
||||||
git clone --branch 0.10.0 https://github.com/ericniebler/range-v3
|
|
||||||
|
|
||||||
xz_ver=5.2.4
|
xz_ver=5.2.4
|
||||||
wget https://tukaani.org/xz/xz-$xz_ver.tar.gz
|
wget https://tukaani.org/xz/xz-$xz_ver.tar.gz
|
||||||
|
|
|
||||||
|
|
@ -68,44 +68,35 @@ parts:
|
||||||
source: .
|
source: .
|
||||||
source-type: git
|
source-type: git
|
||||||
parse-info: [share/metainfo/kotatogramdesktop.appdata.xml]
|
parse-info: [share/metainfo/kotatogramdesktop.appdata.xml]
|
||||||
|
build-environment:
|
||||||
|
- CFLAGS: "$CFLAGS -I$SNAPCRAFT_STAGE/usr/include/$SNAPCRAFT_ARCH_TRIPLET/qt5/QtWaylandClient/5.12.3"
|
||||||
|
- CXXFLAGS: "$CXXFLAGS -I$SNAPCRAFT_STAGE/usr/include/$SNAPCRAFT_ARCH_TRIPLET/qt5/QtWaylandClient/5.12.3"
|
||||||
build-snaps:
|
build-snaps:
|
||||||
- kde-frameworks-5-core18-sdk
|
- kde-frameworks-5-core18-sdk
|
||||||
- kde-frameworks-5-core18
|
- kde-frameworks-5-core18
|
||||||
build-packages:
|
build-packages:
|
||||||
- gcc-8
|
- gcc-8
|
||||||
- g++-8
|
- g++-8
|
||||||
- libmapbox-variant-dev
|
|
||||||
- libasound2-dev
|
- libasound2-dev
|
||||||
|
- libglib2.0-dev
|
||||||
- libglvnd-dev
|
- libglvnd-dev
|
||||||
- libhunspell-dev
|
- libgtk-3-dev
|
||||||
- liblz4-dev
|
|
||||||
- liblzma-dev
|
- liblzma-dev
|
||||||
- libminizip-dev
|
|
||||||
- libopus-dev
|
- libopus-dev
|
||||||
- libpulse-dev
|
- libpulse-dev
|
||||||
- libssl-dev
|
- libssl-dev
|
||||||
- zlib1g-dev
|
- zlib1g-dev
|
||||||
stage-packages:
|
stage-packages:
|
||||||
- libasound2
|
|
||||||
- libhunspell-1.6-0
|
|
||||||
- liblz4-1
|
|
||||||
- liblzma5
|
- liblzma5
|
||||||
- libminizip1
|
|
||||||
- libopus0
|
|
||||||
- libpulse0
|
|
||||||
- libssl1.1
|
|
||||||
- zlib1g
|
|
||||||
configflags:
|
configflags:
|
||||||
- -DCMAKE_C_COMPILER=gcc-8
|
- -DCMAKE_C_COMPILER=gcc-8
|
||||||
- -DCMAKE_CXX_COMPILER=g++-8
|
- -DCMAKE_CXX_COMPILER=g++-8
|
||||||
|
- -DCMAKE_AUTOMOC_MOC_OPTIONS=-I$SNAPCRAFT_STAGE/usr/include/$SNAPCRAFT_ARCH_TRIPLET/qt5/QtWaylandClient/5.12.3
|
||||||
- -DCMAKE_BUILD_TYPE=Release
|
- -DCMAKE_BUILD_TYPE=Release
|
||||||
- -DTDESKTOP_API_ID=611335
|
- -DTDESKTOP_API_ID=611335
|
||||||
- -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
|
- -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
|
||||||
|
- -DDESKTOP_APP_USE_PACKAGED_LAZY=ON
|
||||||
- -DDESKTOP_APP_USE_PACKAGED_FONTS=OFF
|
- -DDESKTOP_APP_USE_PACKAGED_FONTS=OFF
|
||||||
- -DDESKTOP_APP_USE_PACKAGED_GSL=OFF
|
|
||||||
- -DDESKTOP_APP_USE_PACKAGED_EXPECTED=OFF
|
|
||||||
- -DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF
|
|
||||||
- -DTDESKTOP_USE_PACKAGED_TGVOIP=OFF
|
|
||||||
- -DTDESKTOP_USE_FONTCONFIG_FALLBACK=ON
|
- -DTDESKTOP_USE_FONTCONFIG_FALLBACK=ON
|
||||||
override-pull: |
|
override-pull: |
|
||||||
snapcraftctl pull
|
snapcraftctl pull
|
||||||
|
|
@ -117,10 +108,7 @@ parts:
|
||||||
after:
|
after:
|
||||||
- cmake
|
- cmake
|
||||||
- ffmpeg
|
- ffmpeg
|
||||||
- libdbusmenu-qt
|
|
||||||
- openal
|
- openal
|
||||||
- range-v3
|
|
||||||
- xxhash
|
|
||||||
|
|
||||||
kotatogram-launcher:
|
kotatogram-launcher:
|
||||||
plugin: dump
|
plugin: dump
|
||||||
|
|
@ -223,20 +211,6 @@ parts:
|
||||||
after:
|
after:
|
||||||
- nasm
|
- nasm
|
||||||
|
|
||||||
fcitx-qt5:
|
|
||||||
source: https://github.com/fcitx/fcitx-qt5.git
|
|
||||||
source-depth: 1
|
|
||||||
source-tag: 1.2.4
|
|
||||||
plugin: cmake
|
|
||||||
build-snaps:
|
|
||||||
- kde-frameworks-5-core18-sdk
|
|
||||||
- kde-frameworks-5-core18
|
|
||||||
build-packages:
|
|
||||||
- libglvnd-dev
|
|
||||||
configflags:
|
|
||||||
- -DCMAKE_BUILD_TYPE=Release
|
|
||||||
- -DENABLE_LIBRARY=OFF
|
|
||||||
|
|
||||||
ffmpeg:
|
ffmpeg:
|
||||||
source: https://github.com/FFmpeg/FFmpeg.git
|
source: https://github.com/FFmpeg/FFmpeg.git
|
||||||
source-depth: 1
|
source-depth: 1
|
||||||
|
|
@ -247,12 +221,6 @@ parts:
|
||||||
- libopus-dev
|
- libopus-dev
|
||||||
- libva-dev
|
- libva-dev
|
||||||
- libvdpau-dev
|
- libvdpau-dev
|
||||||
stage-packages:
|
|
||||||
- libasound2
|
|
||||||
- libopus0
|
|
||||||
- libva2
|
|
||||||
- libva-drm2
|
|
||||||
- libvdpau1
|
|
||||||
configflags:
|
configflags:
|
||||||
- --prefix=/usr
|
- --prefix=/usr
|
||||||
- --disable-static
|
- --disable-static
|
||||||
|
|
@ -368,46 +336,6 @@ parts:
|
||||||
- nasm
|
- nasm
|
||||||
- dav1d
|
- dav1d
|
||||||
|
|
||||||
libdbusmenu-qt:
|
|
||||||
source: https://github.com/unity8-team/libdbusmenu-qt.git
|
|
||||||
source-depth: 1
|
|
||||||
source-tag: 0.9.3+16.04.20160218-0ubuntu1
|
|
||||||
plugin: cmake
|
|
||||||
build-snaps:
|
|
||||||
- kde-frameworks-5-core18-sdk
|
|
||||||
- kde-frameworks-5-core18
|
|
||||||
build-packages:
|
|
||||||
- libglvnd-dev
|
|
||||||
configflags:
|
|
||||||
- -DCMAKE_BUILD_TYPE=Release
|
|
||||||
- -DWITH_DOC=OFF
|
|
||||||
prime:
|
|
||||||
- -./include
|
|
||||||
- -./lib/cmake
|
|
||||||
- -./lib/pkgconfig
|
|
||||||
|
|
||||||
materialdecoration:
|
|
||||||
source: https://github.com/desktop-app/materialdecoration.git
|
|
||||||
source-depth: 1
|
|
||||||
plugin: dump
|
|
||||||
build-snaps:
|
|
||||||
- kde-frameworks-5-core18-sdk
|
|
||||||
- kde-frameworks-5-core18
|
|
||||||
build-packages:
|
|
||||||
- libglvnd-dev
|
|
||||||
override-build: |
|
|
||||||
KF5_DIR=/snap/kde-frameworks-5-core18-sdk/current
|
|
||||||
|
|
||||||
$KF5_DIR/usr/lib/qt5/bin/qmake -qtconf "$SNAPCRAFT_STAGE/qt.conf"
|
|
||||||
make -j$(nproc)
|
|
||||||
make INSTALL_ROOT="$SNAPCRAFT_PART_INSTALL/tmp" install
|
|
||||||
|
|
||||||
cp -a "$SNAPCRAFT_PART_INSTALL/tmp/$KF5_DIR/." "$SNAPCRAFT_PART_INSTALL"
|
|
||||||
rm -r "$SNAPCRAFT_PART_INSTALL/tmp"
|
|
||||||
after:
|
|
||||||
- qtconf
|
|
||||||
- qtwayland
|
|
||||||
|
|
||||||
openal:
|
openal:
|
||||||
source: https://github.com/kcat/openal-soft.git
|
source: https://github.com/kcat/openal-soft.git
|
||||||
source-depth: 1
|
source-depth: 1
|
||||||
|
|
@ -418,11 +346,6 @@ parts:
|
||||||
- libpulse-dev
|
- libpulse-dev
|
||||||
- libsndio-dev
|
- libsndio-dev
|
||||||
- portaudio19-dev
|
- portaudio19-dev
|
||||||
stage-packages:
|
|
||||||
- libasound2
|
|
||||||
- libpulse0
|
|
||||||
- libportaudio2
|
|
||||||
- libsndio6.1
|
|
||||||
configflags:
|
configflags:
|
||||||
- -DCMAKE_BUILD_TYPE=Release
|
- -DCMAKE_BUILD_TYPE=Release
|
||||||
- -DALSOFT_EXAMPLES=OFF
|
- -DALSOFT_EXAMPLES=OFF
|
||||||
|
|
@ -434,17 +357,6 @@ parts:
|
||||||
- -./lib/cmake
|
- -./lib/cmake
|
||||||
- -./lib/pkgconfig
|
- -./lib/pkgconfig
|
||||||
|
|
||||||
range-v3:
|
|
||||||
source: https://github.com/ericniebler/range-v3.git
|
|
||||||
source-depth: 1
|
|
||||||
source-tag: 0.10.0
|
|
||||||
plugin: cmake
|
|
||||||
configflags:
|
|
||||||
- -DRANGE_V3_TESTS=OFF
|
|
||||||
- -DRANGE_V3_EXAMPLES=OFF
|
|
||||||
- -DRANGE_V3_DOCS=OFF
|
|
||||||
prime: [-./*]
|
|
||||||
|
|
||||||
qgnomeplatform:
|
qgnomeplatform:
|
||||||
source: https://github.com/FedoraQt/QGnomePlatform.git
|
source: https://github.com/FedoraQt/QGnomePlatform.git
|
||||||
source-depth: 1
|
source-depth: 1
|
||||||
|
|
@ -517,14 +429,3 @@ parts:
|
||||||
after:
|
after:
|
||||||
- qtconf
|
- qtconf
|
||||||
prime: [-./*]
|
prime: [-./*]
|
||||||
|
|
||||||
xxhash:
|
|
||||||
source: https://github.com/Cyan4973/xxHash.git
|
|
||||||
source-depth: 1
|
|
||||||
source-tag: v0.7.2
|
|
||||||
plugin: make
|
|
||||||
make-parameters: [PREFIX=]
|
|
||||||
prime:
|
|
||||||
- -./bin
|
|
||||||
- -./include
|
|
||||||
- -./share
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue