mirror of https://github.com/procxx/kepka.git
Merge branch 'docs' of https://bitbucket.org/johnprestonmail/telegram-desktop into docs
This commit is contained in:
commit
9d28303459
|
@ -46,6 +46,13 @@ Download [opus-1.1 sources](http://downloads.xiph.org/releases/opus/opus-1.1.tar
|
||||||
|
|
||||||
In Terminal go to **/home/user/TBuild/Libraries** and run
|
In Terminal go to **/home/user/TBuild/Libraries** and run
|
||||||
|
|
||||||
|
git clone git://anongit.freedesktop.org/git/libva
|
||||||
|
cd libva
|
||||||
|
./autogen.sh --enable-static
|
||||||
|
make
|
||||||
|
sudo make install
|
||||||
|
cd ..
|
||||||
|
|
||||||
git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg
|
git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg
|
||||||
cd ffmpeg
|
cd ffmpeg
|
||||||
git checkout release/2.8
|
git checkout release/2.8
|
||||||
|
|
|
@ -31,6 +31,10 @@ set "DeployPath=%ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStrFull%"
|
||||||
set "SignPath=..\..\TelegramPrivate\Sign.bat"
|
set "SignPath=..\..\TelegramPrivate\Sign.bat"
|
||||||
|
|
||||||
if %BetaVersion% neq 0 (
|
if %BetaVersion% neq 0 (
|
||||||
|
if exist %DeployPath%\ (
|
||||||
|
echo Deploy folder for version %AppVersionStr% already exists!
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
if exist %ReleasePath%\%BetaKeyFile% (
|
if exist %ReleasePath%\%BetaKeyFile% (
|
||||||
echo Beta version key file for version %AppVersion% already exists!
|
echo Beta version key file for version %AppVersion% already exists!
|
||||||
exit /b 1
|
exit /b 1
|
||||||
|
@ -40,17 +44,16 @@ if %BetaVersion% neq 0 (
|
||||||
echo Deploy folder for version %AppVersionStr%.dev already exists!
|
echo Deploy folder for version %AppVersionStr%.dev already exists!
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
if exist %ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStr%\ (
|
||||||
|
echo Deploy folder for version %AppVersionStr% already exists!
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
if exist %ReleasePath%\tupdate%AppVersion% (
|
if exist %ReleasePath%\tupdate%AppVersion% (
|
||||||
echo Update file for version %AppVersion% already exists!
|
echo Update file for version %AppVersion% already exists!
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if exist %ReleasePath%\deploy\%AppVersionStrMajor%\%AppVersionStr%\ (
|
|
||||||
echo Deploy folder for version %AppVersionStr% already exists!
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
cd SourceFiles\
|
cd SourceFiles\
|
||||||
copy telegram.qrc /B+,,/Y
|
copy telegram.qrc /B+,,/Y
|
||||||
cd ..\
|
cd ..\
|
||||||
|
@ -149,7 +152,7 @@ xcopy %DeployPath%\%PortableFile% %FinalDeployPath%\
|
||||||
if %BetaVersion% equ 0 (
|
if %BetaVersion% equ 0 (
|
||||||
xcopy %DeployPath%\%SetupFile% %FinalDeployPath%\
|
xcopy %DeployPath%\%SetupFile% %FinalDeployPath%\
|
||||||
) else (
|
) else (
|
||||||
xcopy %DeployPath%\%BetaKeyFile% %FinalDeployPath%\
|
xcopy %DeployPath%\%BetaKeyFile% %FinalDeployPath%\ /Y
|
||||||
)
|
)
|
||||||
xcopy %DeployPath%\Telegram.pdb %FinalDeployPath%\
|
xcopy %DeployPath%\Telegram.pdb %FinalDeployPath%\
|
||||||
xcopy %DeployPath%\Updater.exe %FinalDeployPath%\
|
xcopy %DeployPath%\Updater.exe %FinalDeployPath%\
|
||||||
|
|
|
@ -29,3 +29,4 @@ Replace '\-lavcodec' '\/usr\/local\/lib\/libavcodec\.a'
|
||||||
Replace '\-lswresample' '\/usr\/local\/lib\/libswresample\.a'
|
Replace '\-lswresample' '\/usr\/local\/lib\/libswresample\.a'
|
||||||
Replace '\-lswscale' '\/usr\/local\/lib\/libswscale\.a'
|
Replace '\-lswscale' '\/usr\/local\/lib\/libswscale\.a'
|
||||||
Replace '\-lavutil' '\/usr\/local\/lib\/libavutil\.a'
|
Replace '\-lavutil' '\/usr\/local\/lib\/libavutil\.a'
|
||||||
|
Replace '\-lva' '\/usr\/local\/lib\/libva\.a'
|
||||||
|
|
|
@ -29,3 +29,4 @@ Replace '\-lavcodec' '\/usr\/local\/lib\/libavcodec\.a'
|
||||||
Replace '\-lswresample' '\/usr\/local\/lib\/libswresample\.a'
|
Replace '\-lswresample' '\/usr\/local\/lib\/libswresample\.a'
|
||||||
Replace '\-lswscale' '\/usr\/local\/lib\/libswscale\.a'
|
Replace '\-lswscale' '\/usr\/local\/lib\/libswscale\.a'
|
||||||
Replace '\-lavutil' '\/usr\/local\/lib\/libavutil\.a'
|
Replace '\-lavutil' '\/usr\/local\/lib\/libavutil\.a'
|
||||||
|
Replace '\-lva' '\/usr\/local\/lib\/libva\.a'
|
||||||
|
|
|
@ -69,6 +69,7 @@ namespace {
|
||||||
typedef QMap<ChannelId, ReplyMarkups> ChannelReplyMarkups;
|
typedef QMap<ChannelId, ReplyMarkups> ChannelReplyMarkups;
|
||||||
ChannelReplyMarkups channelReplyMarkups;
|
ChannelReplyMarkups channelReplyMarkups;
|
||||||
|
|
||||||
|
PhotoItems photoItems;
|
||||||
VideoItems videoItems;
|
VideoItems videoItems;
|
||||||
AudioItems audioItems;
|
AudioItems audioItems;
|
||||||
DocumentItems documentItems;
|
DocumentItems documentItems;
|
||||||
|
@ -1959,6 +1960,7 @@ namespace App {
|
||||||
cSetStickerSetsOrder(StickerSetsOrder());
|
cSetStickerSetsOrder(StickerSetsOrder());
|
||||||
cSetLastStickersUpdate(0);
|
cSetLastStickersUpdate(0);
|
||||||
cSetReportSpamStatuses(ReportSpamStatuses());
|
cSetReportSpamStatuses(ReportSpamStatuses());
|
||||||
|
::photoItems.clear();
|
||||||
::videoItems.clear();
|
::videoItems.clear();
|
||||||
::audioItems.clear();
|
::audioItems.clear();
|
||||||
::documentItems.clear();
|
::documentItems.clear();
|
||||||
|
@ -2348,6 +2350,18 @@ namespace App {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void regPhotoItem(PhotoData *data, HistoryItem *item) {
|
||||||
|
::photoItems[data].insert(item, NullType());
|
||||||
|
}
|
||||||
|
|
||||||
|
void unregPhotoItem(PhotoData *data, HistoryItem *item) {
|
||||||
|
::photoItems[data].remove(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
const PhotoItems &photoItems() {
|
||||||
|
return ::photoItems;
|
||||||
|
}
|
||||||
|
|
||||||
void regVideoItem(VideoData *data, HistoryItem *item) {
|
void regVideoItem(VideoData *data, HistoryItem *item) {
|
||||||
::videoItems[data].insert(item, NullType());
|
::videoItems[data].insert(item, NullType());
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ class FileUploader;
|
||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
|
|
||||||
typedef QMap<HistoryItem*, NullType> HistoryItemsMap;
|
typedef QMap<HistoryItem*, NullType> HistoryItemsMap;
|
||||||
|
typedef QMap<PhotoData*, HistoryItemsMap> PhotoItems;
|
||||||
typedef QMap<VideoData*, HistoryItemsMap> VideoItems;
|
typedef QMap<VideoData*, HistoryItemsMap> VideoItems;
|
||||||
typedef QMap<AudioData*, HistoryItemsMap> AudioItems;
|
typedef QMap<AudioData*, HistoryItemsMap> AudioItems;
|
||||||
typedef QMap<DocumentData*, HistoryItemsMap> DocumentItems;
|
typedef QMap<DocumentData*, HistoryItemsMap> DocumentItems;
|
||||||
|
@ -198,6 +199,10 @@ namespace App {
|
||||||
QImage readImage(QByteArray data, QByteArray *format = 0, bool opaque = true, bool *animated = 0);
|
QImage readImage(QByteArray data, QByteArray *format = 0, bool opaque = true, bool *animated = 0);
|
||||||
QImage readImage(const QString &file, QByteArray *format = 0, bool opaque = true, bool *animated = 0, QByteArray *content = 0);
|
QImage readImage(const QString &file, QByteArray *format = 0, bool opaque = true, bool *animated = 0, QByteArray *content = 0);
|
||||||
|
|
||||||
|
void regPhotoItem(PhotoData *data, HistoryItem *item);
|
||||||
|
void unregPhotoItem(PhotoData *data, HistoryItem *item);
|
||||||
|
const PhotoItems &photoItems();
|
||||||
|
|
||||||
void regVideoItem(VideoData *data, HistoryItem *item);
|
void regVideoItem(VideoData *data, HistoryItem *item);
|
||||||
void unregVideoItem(VideoData *data, HistoryItem *item);
|
void unregVideoItem(VideoData *data, HistoryItem *item);
|
||||||
const VideoItems &videoItems();
|
const VideoItems &videoItems();
|
||||||
|
|
|
@ -97,6 +97,11 @@ namespace Ui {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isMediaViewShown() {
|
||||||
|
if (Window *w = App::wnd()) return w->ui_isMediaViewShown();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void clipRedraw(ClipReader *reader) {
|
void clipRedraw(ClipReader *reader) {
|
||||||
const GifItems &items(App::gifItems());
|
const GifItems &items(App::gifItems());
|
||||||
GifItems::const_iterator it = items.constFind(reader);
|
GifItems::const_iterator it = items.constFind(reader);
|
||||||
|
@ -143,6 +148,10 @@ namespace Notify {
|
||||||
if (MainWidget *m = App::main()) m->notify_migrateUpdated(peer);
|
if (MainWidget *m = App::main()) m->notify_migrateUpdated(peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mediaViewHidden() {
|
||||||
|
if (MainWidget *m = App::main()) m->notify_mediaViewHidden();
|
||||||
|
}
|
||||||
|
|
||||||
void clipReinit(ClipReader *reader) {
|
void clipReinit(ClipReader *reader) {
|
||||||
const GifItems &items(App::gifItems());
|
const GifItems &items(App::gifItems());
|
||||||
GifItems::const_iterator it = items.constFind(reader);
|
GifItems::const_iterator it = items.constFind(reader);
|
||||||
|
|
|
@ -45,6 +45,7 @@ namespace Ui { // openssl doesn't allow me to use UI :(
|
||||||
void showLayer(LayeredWidget *box, ShowLayerOptions options = CloseOtherLayers);
|
void showLayer(LayeredWidget *box, ShowLayerOptions options = CloseOtherLayers);
|
||||||
void hideLayer(bool fast = false);
|
void hideLayer(bool fast = false);
|
||||||
bool isLayerShown();
|
bool isLayerShown();
|
||||||
|
bool isMediaViewShown();
|
||||||
|
|
||||||
void clipRedraw(ClipReader *reader);
|
void clipRedraw(ClipReader *reader);
|
||||||
|
|
||||||
|
@ -75,6 +76,8 @@ namespace Notify {
|
||||||
|
|
||||||
void migrateUpdated(PeerData *peer);
|
void migrateUpdated(PeerData *peer);
|
||||||
|
|
||||||
|
void mediaViewHidden();
|
||||||
|
|
||||||
void clipReinit(ClipReader *reader);
|
void clipReinit(ClipReader *reader);
|
||||||
|
|
||||||
void historyItemResized(const HistoryItem *item, bool scrollToIt = false);
|
void historyItemResized(const HistoryItem *item, bool scrollToIt = false);
|
||||||
|
|
|
@ -197,13 +197,15 @@ void ClipReader::start(int32 framew, int32 frameh, int32 outerw, int32 outerh, b
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap ClipReader::current(int32 framew, int32 frameh, int32 outerw, int32 outerh, uint64 ms) {
|
QPixmap ClipReader::current(int32 framew, int32 frameh, int32 outerw, int32 outerh, uint64 ms) {
|
||||||
_lastDisplayMs.set(ms);
|
|
||||||
_currentDisplayed.set(true);
|
_currentDisplayed.set(true);
|
||||||
if (_paused.get()) {
|
if (ms) {
|
||||||
_paused.set(false);
|
_lastDisplayMs.set(ms);
|
||||||
if (_clipManagers.size() <= _threadIndex) error();
|
if (_paused.get()) {
|
||||||
if (_state != ClipError) {
|
_paused.set(false);
|
||||||
_clipManagers.at(_threadIndex)->update(this);
|
if (_clipManagers.size() <= _threadIndex) error();
|
||||||
|
if (_state != ClipError) {
|
||||||
|
_clipManagers.at(_threadIndex)->update(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,7 +444,13 @@ public:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
if (res != AVERROR_EOF || !_hadFrame) { // try to skip end of file
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
freePacket();
|
||||||
|
_avpkt.data = NULL;
|
||||||
|
_avpkt.size = 0;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if (res > 0) decoded = res;
|
if (res > 0) decoded = res;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
|
||||||
#include "pspecific.h"
|
#include "pspecific.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
typedef QMap<QString, LocalImage*> LocalImages;
|
typedef QMap<QString, Image*> LocalImages;
|
||||||
LocalImages localImages;
|
LocalImages localImages;
|
||||||
|
|
||||||
Image *blank() {
|
Image *blank() {
|
||||||
|
@ -57,8 +57,39 @@ ImagePtr::ImagePtr(int32 width, int32 height, const MTPFileLocation &location, I
|
||||||
Parent((location.type() == mtpc_fileLocation) ? (Image*)(getImage(StorageImageLocation(width, height, location.c_fileLocation()))) : def.v()) {
|
Parent((location.type() == mtpc_fileLocation) ? (Image*)(getImage(StorageImageLocation(width, height, location.c_fileLocation()))) : def.v()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Image::Image(const QString &file, QByteArray fmt) : _forgot(false) {
|
||||||
|
_data = QPixmap::fromImage(App::readImage(file, &fmt, false, 0, &_saved), Qt::ColorOnly);
|
||||||
|
_format = fmt;
|
||||||
|
if (!_data.isNull()) {
|
||||||
|
globalAquiredSize += int64(_data.width()) * _data.height() * 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Image::Image(const QByteArray &filecontent, QByteArray fmt) : _forgot(false) {
|
||||||
|
_data = QPixmap::fromImage(App::readImage(filecontent, &fmt, false), Qt::ColorOnly);
|
||||||
|
_format = fmt;
|
||||||
|
_saved = filecontent;
|
||||||
|
if (!_data.isNull()) {
|
||||||
|
globalAquiredSize += int64(_data.width()) * _data.height() * 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Image::Image(const QPixmap &pixmap, QByteArray format) : _format(format), _forgot(false), _data(pixmap) {
|
||||||
|
if (!_data.isNull()) {
|
||||||
|
globalAquiredSize += int64(_data.width()) * _data.height() * 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Image::Image(const QByteArray &filecontent, QByteArray fmt, const QPixmap &pixmap) : _saved(filecontent), _format(fmt), _forgot(false), _data(pixmap) {
|
||||||
|
_data = pixmap;
|
||||||
|
_format = fmt;
|
||||||
|
_saved = filecontent;
|
||||||
|
if (!_data.isNull()) {
|
||||||
|
globalAquiredSize += int64(_data.width()) * _data.height() * 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const QPixmap &Image::pix(int32 w, int32 h) const {
|
const QPixmap &Image::pix(int32 w, int32 h) const {
|
||||||
restore();
|
|
||||||
checkload();
|
checkload();
|
||||||
|
|
||||||
if (w <= 0 || !width() || !height()) {
|
if (w <= 0 || !width() || !height()) {
|
||||||
|
@ -81,7 +112,6 @@ const QPixmap &Image::pix(int32 w, int32 h) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
const QPixmap &Image::pixRounded(int32 w, int32 h) const {
|
const QPixmap &Image::pixRounded(int32 w, int32 h) const {
|
||||||
restore();
|
|
||||||
checkload();
|
checkload();
|
||||||
|
|
||||||
if (w <= 0 || !width() || !height()) {
|
if (w <= 0 || !width() || !height()) {
|
||||||
|
@ -104,7 +134,6 @@ const QPixmap &Image::pixRounded(int32 w, int32 h) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
const QPixmap &Image::pixBlurred(int32 w, int32 h) const {
|
const QPixmap &Image::pixBlurred(int32 w, int32 h) const {
|
||||||
restore();
|
|
||||||
checkload();
|
checkload();
|
||||||
|
|
||||||
if (w <= 0 || !width() || !height()) {
|
if (w <= 0 || !width() || !height()) {
|
||||||
|
@ -127,7 +156,6 @@ const QPixmap &Image::pixBlurred(int32 w, int32 h) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
const QPixmap &Image::pixColored(const style::color &add, int32 w, int32 h) const {
|
const QPixmap &Image::pixColored(const style::color &add, int32 w, int32 h) const {
|
||||||
restore();
|
|
||||||
checkload();
|
checkload();
|
||||||
|
|
||||||
if (w <= 0 || !width() || !height()) {
|
if (w <= 0 || !width() || !height()) {
|
||||||
|
@ -150,7 +178,6 @@ const QPixmap &Image::pixColored(const style::color &add, int32 w, int32 h) cons
|
||||||
}
|
}
|
||||||
|
|
||||||
const QPixmap &Image::pixBlurredColored(const style::color &add, int32 w, int32 h) const {
|
const QPixmap &Image::pixBlurredColored(const style::color &add, int32 w, int32 h) const {
|
||||||
restore();
|
|
||||||
checkload();
|
checkload();
|
||||||
|
|
||||||
if (w <= 0 || !width() || !height()) {
|
if (w <= 0 || !width() || !height()) {
|
||||||
|
@ -173,7 +200,6 @@ const QPixmap &Image::pixBlurredColored(const style::color &add, int32 w, int32
|
||||||
}
|
}
|
||||||
|
|
||||||
const QPixmap &Image::pixSingle(int32 w, int32 h, int32 outerw, int32 outerh) const {
|
const QPixmap &Image::pixSingle(int32 w, int32 h, int32 outerw, int32 outerh) const {
|
||||||
restore();
|
|
||||||
checkload();
|
checkload();
|
||||||
|
|
||||||
if (w <= 0 || !width() || !height()) {
|
if (w <= 0 || !width() || !height()) {
|
||||||
|
@ -199,7 +225,6 @@ const QPixmap &Image::pixSingle(int32 w, int32 h, int32 outerw, int32 outerh) co
|
||||||
}
|
}
|
||||||
|
|
||||||
const QPixmap &Image::pixBlurredSingle(int32 w, int32 h, int32 outerw, int32 outerh) const {
|
const QPixmap &Image::pixBlurredSingle(int32 w, int32 h, int32 outerw, int32 outerh) const {
|
||||||
restore();
|
|
||||||
checkload();
|
checkload();
|
||||||
|
|
||||||
if (w <= 0 || !width() || !height()) {
|
if (w <= 0 || !width() || !height()) {
|
||||||
|
@ -426,11 +451,9 @@ QPixmap imagePix(QImage img, int32 w, int32 h, bool smooth, bool blurred, bool r
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap Image::pixNoCache(int32 w, int32 h, bool smooth, bool blurred, bool rounded, int32 outerw, int32 outerh) const {
|
QPixmap Image::pixNoCache(int32 w, int32 h, bool smooth, bool blurred, bool rounded, int32 outerw, int32 outerh) const {
|
||||||
|
if (!loading()) const_cast<Image*>(this)->load();
|
||||||
restore();
|
restore();
|
||||||
loaded();
|
if (_data.isNull()) return blank()->pix();
|
||||||
|
|
||||||
const QPixmap &p(pixData());
|
|
||||||
if (p.isNull()) return blank()->pix();
|
|
||||||
|
|
||||||
if (isNull() && outerw > 0 && outerh > 0) {
|
if (isNull() && outerw > 0 && outerh > 0) {
|
||||||
outerw *= cIntRetinaFactor();
|
outerw *= cIntRetinaFactor();
|
||||||
|
@ -447,32 +470,28 @@ QPixmap Image::pixNoCache(int32 w, int32 h, bool smooth, bool blurred, bool roun
|
||||||
if (rounded) imageRound(result);
|
if (rounded) imageRound(result);
|
||||||
return QPixmap::fromImage(result, Qt::ColorOnly);
|
return QPixmap::fromImage(result, Qt::ColorOnly);
|
||||||
}
|
}
|
||||||
return imagePix(p.toImage(), w, h, smooth, blurred, rounded, outerw, outerh);
|
return imagePix(_data.toImage(), w, h, smooth, blurred, rounded, outerw, outerh);
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap Image::pixColoredNoCache(const style::color &add, int32 w, int32 h, bool smooth) const {
|
QPixmap Image::pixColoredNoCache(const style::color &add, int32 w, int32 h, bool smooth) const {
|
||||||
|
const_cast<Image*>(this)->load();
|
||||||
restore();
|
restore();
|
||||||
loaded();
|
if (_data.isNull()) return blank()->pix();
|
||||||
|
|
||||||
const QPixmap &p(pixData());
|
QImage img = _data.toImage();
|
||||||
if (p.isNull()) {
|
if (w <= 0 || !width() || !height() || (w == width() && (h <= 0 || h == height()))) return QPixmap::fromImage(imageColored(add, img));
|
||||||
return blank()->pix();
|
|
||||||
}
|
|
||||||
if (w <= 0 || !width() || !height() || (w == width() && (h <= 0 || h == height()))) return QPixmap::fromImage(imageColored(add, p.toImage()));
|
|
||||||
if (h <= 0) {
|
if (h <= 0) {
|
||||||
return QPixmap::fromImage(imageColored(add, p.toImage().scaledToWidth(w, smooth ? Qt::SmoothTransformation : Qt::FastTransformation)), Qt::ColorOnly);
|
return QPixmap::fromImage(imageColored(add, img.scaledToWidth(w, smooth ? Qt::SmoothTransformation : Qt::FastTransformation)), Qt::ColorOnly);
|
||||||
}
|
}
|
||||||
return QPixmap::fromImage(imageColored(add, p.toImage().scaled(w, h, Qt::IgnoreAspectRatio, smooth ? Qt::SmoothTransformation : Qt::FastTransformation)), Qt::ColorOnly);
|
return QPixmap::fromImage(imageColored(add, img.scaled(w, h, Qt::IgnoreAspectRatio, smooth ? Qt::SmoothTransformation : Qt::FastTransformation)), Qt::ColorOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap Image::pixBlurredColoredNoCache(const style::color &add, int32 w, int32 h) const {
|
QPixmap Image::pixBlurredColoredNoCache(const style::color &add, int32 w, int32 h) const {
|
||||||
|
const_cast<Image*>(this)->load();
|
||||||
restore();
|
restore();
|
||||||
loaded();
|
if (_data.isNull()) return blank()->pix();
|
||||||
|
|
||||||
const QPixmap &p(pixData());
|
QImage img = imageBlur(_data.toImage());
|
||||||
if (p.isNull()) return blank()->pix();
|
|
||||||
|
|
||||||
QImage img = imageBlur(p.toImage());
|
|
||||||
if (h <= 0) {
|
if (h <= 0) {
|
||||||
img = img.scaledToWidth(w, Qt::SmoothTransformation);
|
img = img.scaledToWidth(w, Qt::SmoothTransformation);
|
||||||
} else {
|
} else {
|
||||||
|
@ -483,38 +502,40 @@ QPixmap Image::pixBlurredColoredNoCache(const style::color &add, int32 w, int32
|
||||||
}
|
}
|
||||||
|
|
||||||
void Image::forget() const {
|
void Image::forget() const {
|
||||||
if (forgot) return;
|
if (_forgot) return;
|
||||||
|
|
||||||
const QPixmap &p(pixData());
|
if (_data.isNull()) return;
|
||||||
if (p.isNull()) return;
|
|
||||||
|
|
||||||
invalidateSizeCache();
|
invalidateSizeCache();
|
||||||
if (saved.isEmpty()) {
|
if (_saved.isEmpty()) {
|
||||||
QBuffer buffer(&saved);
|
QBuffer buffer(&_saved);
|
||||||
if (format.toLower() == "webp") {
|
if (!_data.save(&buffer, _format)) {
|
||||||
int a = 0;
|
if (_data.save(&buffer, "PNG")) {
|
||||||
}
|
_format = "PNG";
|
||||||
if (!p.save(&buffer, format)) {
|
|
||||||
if (p.save(&buffer, "PNG")) {
|
|
||||||
format = "PNG";
|
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
globalAquiredSize -= int64(p.width()) * p.height() * 4;
|
globalAquiredSize -= int64(_data.width()) * _data.height() * 4;
|
||||||
doForget();
|
_data = QPixmap();
|
||||||
forgot = true;
|
_forgot = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Image::restore() const {
|
void Image::restore() const {
|
||||||
if (!forgot) return;
|
if (!_forgot) return;
|
||||||
doRestore();
|
|
||||||
const QPixmap &p(pixData());
|
QBuffer buffer(&_saved);
|
||||||
if (!p.isNull()) {
|
QImageReader reader(&buffer, _format);
|
||||||
globalAquiredSize += int64(p.width()) * p.height() * 4;
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
|
||||||
|
reader.setAutoTransform(true);
|
||||||
|
#endif
|
||||||
|
_data = QPixmap::fromImageReader(&reader, Qt::ColorOnly);
|
||||||
|
|
||||||
|
if (!_data.isNull()) {
|
||||||
|
globalAquiredSize += int64(_data.width()) * _data.height() * 4;
|
||||||
}
|
}
|
||||||
forgot = false;
|
_forgot = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Image::invalidateSizeCache() const {
|
void Image::invalidateSizeCache() const {
|
||||||
|
@ -526,78 +547,33 @@ void Image::invalidateSizeCache() const {
|
||||||
_sizesCache.clear();
|
_sizesCache.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalImage::LocalImage(const QString &file, QByteArray fmt) {
|
Image::~Image() {
|
||||||
data = QPixmap::fromImage(App::readImage(file, &fmt, false, 0, &saved), Qt::ColorOnly);
|
invalidateSizeCache();
|
||||||
format = fmt;
|
if (!_data.isNull()) {
|
||||||
if (!data.isNull()) {
|
globalAquiredSize -= int64(_data.width()) * _data.height() * 4;
|
||||||
globalAquiredSize += int64(data.width()) * data.height() * 4;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalImage::LocalImage(const QByteArray &filecontent, QByteArray fmt) {
|
Image *getImage(const QString &file, QByteArray format) {
|
||||||
data = QPixmap::fromImage(App::readImage(filecontent, &fmt, false), Qt::ColorOnly);
|
|
||||||
format = fmt;
|
|
||||||
saved = filecontent;
|
|
||||||
if (!data.isNull()) {
|
|
||||||
globalAquiredSize += int64(data.width()) * data.height() * 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LocalImage::LocalImage(const QPixmap &pixmap, QByteArray format) : Image(format), data(pixmap) {
|
|
||||||
if (!data.isNull()) {
|
|
||||||
globalAquiredSize += int64(data.width()) * data.height() * 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LocalImage::LocalImage(const QByteArray &filecontent, QByteArray fmt, const QPixmap &pixmap) {
|
|
||||||
data = pixmap;
|
|
||||||
format = fmt;
|
|
||||||
saved = filecontent;
|
|
||||||
if (!data.isNull()) {
|
|
||||||
globalAquiredSize += int64(data.width()) * data.height() * 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const QPixmap &LocalImage::pixData() const {
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32 LocalImage::width() const {
|
|
||||||
restore();
|
|
||||||
return data.width();
|
|
||||||
}
|
|
||||||
|
|
||||||
int32 LocalImage::height() const {
|
|
||||||
restore();
|
|
||||||
return data.height();
|
|
||||||
}
|
|
||||||
|
|
||||||
LocalImage::~LocalImage() {
|
|
||||||
if (!data.isNull()) {
|
|
||||||
globalAquiredSize -= int64(data.width()) * data.height() * 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LocalImage *getImage(const QString &file, QByteArray format) {
|
|
||||||
QFileInfo f(file);
|
QFileInfo f(file);
|
||||||
QString key = qsl("//:%1//:%2//:").arg(f.size()).arg(f.lastModified().toTime_t()) + file;
|
QString key = qsl("//:%1//:%2//:").arg(f.size()).arg(f.lastModified().toTime_t()) + file;
|
||||||
LocalImages::const_iterator i = localImages.constFind(key);
|
LocalImages::const_iterator i = localImages.constFind(key);
|
||||||
if (i == localImages.cend()) {
|
if (i == localImages.cend()) {
|
||||||
i = localImages.insert(key, new LocalImage(file, format));
|
i = localImages.insert(key, new Image(file, format));
|
||||||
}
|
}
|
||||||
return i.value();
|
return i.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalImage *getImage(const QByteArray &filecontent, QByteArray format) {
|
Image *getImage(const QByteArray &filecontent, QByteArray format) {
|
||||||
return new LocalImage(filecontent, format);
|
return new Image(filecontent, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalImage *getImage(const QPixmap &pixmap, QByteArray format) {
|
Image *getImage(const QPixmap &pixmap, QByteArray format) {
|
||||||
return new LocalImage(pixmap, format);
|
return new Image(pixmap, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalImage *getImage(const QByteArray &filecontent, QByteArray format, const QPixmap &pixmap) {
|
Image *getImage(const QByteArray &filecontent, QByteArray format, const QPixmap &pixmap) {
|
||||||
return new LocalImage(filecontent, format, pixmap);
|
return new Image(filecontent, format, pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearStorageImages() {
|
void clearStorageImages() {
|
||||||
|
@ -629,10 +605,6 @@ StorageImage::StorageImage(const StorageImageLocation &location, QByteArray &byt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const QPixmap &StorageImage::pixData() const {
|
|
||||||
return _data;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32 StorageImage::width() const {
|
int32 StorageImage::width() const {
|
||||||
return _location.width();
|
return _location.width();
|
||||||
}
|
}
|
||||||
|
@ -641,7 +613,7 @@ int32 StorageImage::height() const {
|
||||||
return _location.height();
|
return _location.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
void StorageImage::checkload() const {
|
void StorageImage::doCheckload() const {
|
||||||
if (!amLoading() || !_loader->done()) return;
|
if (!amLoading() || !_loader->done()) return;
|
||||||
|
|
||||||
QPixmap data = _loader->imagePixmap();
|
QPixmap data = _loader->imagePixmap();
|
||||||
|
@ -656,10 +628,10 @@ void StorageImage::checkload() const {
|
||||||
globalAquiredSize -= int64(_data.width()) * _data.height() * 4;
|
globalAquiredSize -= int64(_data.width()) * _data.height() * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
format = _loader->imageFormat();
|
_format = _loader->imageFormat();
|
||||||
_data = data;
|
_data = data;
|
||||||
saved = _loader->bytes();
|
_saved = _loader->bytes();
|
||||||
const_cast<StorageImage*>(this)->_size = saved.size();
|
const_cast<StorageImage*>(this)->_size = _saved.size();
|
||||||
const_cast<StorageImage*>(this)->_location.setSize(_data.width(), _data.height());
|
const_cast<StorageImage*>(this)->_location.setSize(_data.width(), _data.height());
|
||||||
globalAquiredSize += int64(_data.width()) * _data.height() * 4;
|
globalAquiredSize += int64(_data.width()) * _data.height() * 4;
|
||||||
|
|
||||||
|
@ -669,7 +641,7 @@ void StorageImage::checkload() const {
|
||||||
_loader->rpcInvalidate();
|
_loader->rpcInvalidate();
|
||||||
_loader = 0;
|
_loader = 0;
|
||||||
|
|
||||||
forgot = false;
|
_forgot = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StorageImage::setData(QByteArray &bytes, const QByteArray &bytesFormat) {
|
void StorageImage::setData(QByteArray &bytes, const QByteArray &bytesFormat) {
|
||||||
|
@ -691,9 +663,9 @@ void StorageImage::setData(QByteArray &bytes, const QByteArray &bytesFormat) {
|
||||||
_loader->rpcInvalidate();
|
_loader->rpcInvalidate();
|
||||||
_loader = 0;
|
_loader = 0;
|
||||||
}
|
}
|
||||||
saved = bytes;
|
_saved = bytes;
|
||||||
format = fmt;
|
_format = fmt;
|
||||||
forgot = false;
|
_forgot = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StorageImage::automaticLoad(const HistoryItem *item) {
|
void StorageImage::automaticLoad(const HistoryItem *item) {
|
||||||
|
@ -744,12 +716,8 @@ StorageImage::~StorageImage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StorageImage::loaded() const {
|
bool StorageImage::loaded() const {
|
||||||
checkload();
|
doCheckload();
|
||||||
return (!_data.isNull() || !saved.isNull());
|
return (!_data.isNull() || !_saved.isNull());
|
||||||
}
|
|
||||||
|
|
||||||
bool StorageImage::loading() const {
|
|
||||||
return amLoading();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StorageImage::displayLoading() const {
|
bool StorageImage::displayLoading() const {
|
||||||
|
|
|
@ -111,8 +111,10 @@ class HistoryItem;
|
||||||
class Image {
|
class Image {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Image(QByteArray format = "PNG") : format(format), forgot(false) {
|
Image(const QString &file, QByteArray format = QByteArray());
|
||||||
}
|
Image(const QByteArray &filecontent, QByteArray format = QByteArray());
|
||||||
|
Image(const QPixmap &pixmap, QByteArray format = QByteArray());
|
||||||
|
Image(const QByteArray &filecontent, QByteArray format, const QPixmap &pixmap);
|
||||||
|
|
||||||
virtual void automaticLoad(const HistoryItem *item) { // auto load photo
|
virtual void automaticLoad(const HistoryItem *item) { // auto load photo
|
||||||
}
|
}
|
||||||
|
@ -146,43 +148,47 @@ public:
|
||||||
QPixmap pixColoredNoCache(const style::color &add, int32 w = 0, int32 h = 0, bool smooth = false) const;
|
QPixmap pixColoredNoCache(const style::color &add, int32 w = 0, int32 h = 0, bool smooth = false) const;
|
||||||
QPixmap pixBlurredColoredNoCache(const style::color &add, int32 w, int32 h = 0) const;
|
QPixmap pixBlurredColoredNoCache(const style::color &add, int32 w, int32 h = 0) const;
|
||||||
|
|
||||||
virtual int32 width() const = 0;
|
virtual int32 width() const {
|
||||||
virtual int32 height() const = 0;
|
restore();
|
||||||
|
return _data.width();
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual int32 height() const {
|
||||||
|
restore();
|
||||||
|
return _data.height();
|
||||||
|
}
|
||||||
|
|
||||||
virtual void load(bool loadFirst = false, bool prior = true) {
|
virtual void load(bool loadFirst = false, bool prior = true) {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void loadEvenCancelled(bool loadFirst = false, bool prior = true) {
|
virtual void loadEvenCancelled(bool loadFirst = false, bool prior = true) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isNull() const;
|
bool isNull() const;
|
||||||
|
|
||||||
void forget() const;
|
void forget() const;
|
||||||
void restore() const;
|
|
||||||
|
|
||||||
QByteArray savedFormat() const {
|
QByteArray savedFormat() const {
|
||||||
return format;
|
return _format;
|
||||||
}
|
}
|
||||||
QByteArray savedData() const {
|
QByteArray savedData() const {
|
||||||
return saved;
|
return _saved;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~Image() {
|
virtual ~Image();
|
||||||
invalidateSizeCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Image(QByteArray format = "PNG") : _format(format), _forgot(false) {
|
||||||
virtual void checkload() const {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const QPixmap &pixData() const = 0;
|
void restore() const;
|
||||||
virtual void doForget() const = 0;
|
virtual void checkload() const {
|
||||||
virtual void doRestore() const = 0;
|
}
|
||||||
|
|
||||||
void invalidateSizeCache() const;
|
void invalidateSizeCache() const;
|
||||||
|
|
||||||
mutable QByteArray saved, format;
|
mutable QByteArray _saved, _format;
|
||||||
mutable bool forgot;
|
mutable bool _forgot;
|
||||||
|
mutable QPixmap _data;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -191,43 +197,10 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class LocalImage : public Image {
|
Image *getImage(const QString &file, QByteArray format);
|
||||||
public:
|
Image *getImage(const QByteArray &filecontent, QByteArray format);
|
||||||
|
Image *getImage(const QPixmap &pixmap, QByteArray format);
|
||||||
LocalImage(const QString &file, QByteArray format = QByteArray());
|
Image *getImage(const QByteArray &filecontent, QByteArray format, const QPixmap &pixmap);
|
||||||
LocalImage(const QByteArray &filecontent, QByteArray format = QByteArray());
|
|
||||||
LocalImage(const QPixmap &pixmap, QByteArray format = QByteArray());
|
|
||||||
LocalImage(const QByteArray &filecontent, QByteArray format, const QPixmap &pixmap);
|
|
||||||
|
|
||||||
int32 width() const;
|
|
||||||
int32 height() const;
|
|
||||||
|
|
||||||
~LocalImage();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
const QPixmap &pixData() const;
|
|
||||||
void doForget() const {
|
|
||||||
data = QPixmap();
|
|
||||||
}
|
|
||||||
void doRestore() const {
|
|
||||||
QBuffer buffer(&saved);
|
|
||||||
QImageReader reader(&buffer, format);
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
|
|
||||||
reader.setAutoTransform(true);
|
|
||||||
#endif
|
|
||||||
data = QPixmap::fromImageReader(&reader, Qt::ColorOnly);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
mutable QPixmap data;
|
|
||||||
};
|
|
||||||
|
|
||||||
LocalImage *getImage(const QString &file, QByteArray format);
|
|
||||||
LocalImage *getImage(const QByteArray &filecontent, QByteArray format);
|
|
||||||
LocalImage *getImage(const QPixmap &pixmap, QByteArray format);
|
|
||||||
LocalImage *getImage(const QByteArray &filecontent, QByteArray format, const QPixmap &pixmap);
|
|
||||||
|
|
||||||
typedef QPair<uint64, uint64> StorageKey;
|
typedef QPair<uint64, uint64> StorageKey;
|
||||||
inline uint64 storageMix32To64(int32 a, int32 b) {
|
inline uint64 storageMix32To64(int32 a, int32 b) {
|
||||||
|
@ -255,7 +228,9 @@ public:
|
||||||
void automaticLoad(const HistoryItem *item); // auto load photo
|
void automaticLoad(const HistoryItem *item); // auto load photo
|
||||||
|
|
||||||
bool loaded() const;
|
bool loaded() const;
|
||||||
bool loading() const;
|
bool loading() const {
|
||||||
|
return amLoading();
|
||||||
|
}
|
||||||
bool displayLoading() const;
|
bool displayLoading() const;
|
||||||
void cancel();
|
void cancel();
|
||||||
float64 progress() const;
|
float64 progress() const;
|
||||||
|
@ -269,23 +244,11 @@ public:
|
||||||
~StorageImage();
|
~StorageImage();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void checkload() const {
|
||||||
const QPixmap &pixData() const;
|
doCheckload();
|
||||||
void checkload() const;
|
|
||||||
void doForget() const {
|
|
||||||
_data = QPixmap();
|
|
||||||
}
|
|
||||||
void doRestore() const {
|
|
||||||
QBuffer buffer(&saved);
|
|
||||||
QImageReader reader(&buffer, format);
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
|
|
||||||
reader.setAutoTransform(true);
|
|
||||||
#endif
|
|
||||||
_data = QPixmap::fromImageReader(&reader, Qt::ColorOnly);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable QPixmap _data;
|
|
||||||
StorageImageLocation _location;
|
StorageImageLocation _location;
|
||||||
int32 _size;
|
int32 _size;
|
||||||
mutable mtpFileLoader *_loader;
|
mutable mtpFileLoader *_loader;
|
||||||
|
@ -293,6 +256,7 @@ private:
|
||||||
bool amLoading() const {
|
bool amLoading() const {
|
||||||
return _loader && _loader != CancelledFileLoader;
|
return _loader && _loader != CancelledFileLoader;
|
||||||
}
|
}
|
||||||
|
void doCheckload() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3044,12 +3044,132 @@ void RadialAnimation::draw(Painter &p, const QRect &inner, int32 thickness, cons
|
||||||
p.setOpacity(o);
|
p.setOpacity(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
int32 videoMaxStatusWidth(VideoData *video) {
|
||||||
|
int32 result = st::normalFont->width(formatDownloadText(video->size, video->size));
|
||||||
|
result = qMax(result, st::normalFont->width(formatDurationAndSizeText(video->duration, video->size)));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32 audioMaxStatusWidth(AudioData *audio) {
|
||||||
|
int32 result = st::normalFont->width(formatDownloadText(audio->size, audio->size));
|
||||||
|
result = qMax(result, st::normalFont->width(formatPlayedText(audio->duration, audio->duration)));
|
||||||
|
result = qMax(result, st::normalFont->width(formatDurationAndSizeText(audio->duration, audio->size)));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32 documentMaxStatusWidth(DocumentData *document) {
|
||||||
|
int32 result = st::normalFont->width(formatDownloadText(document->size, document->size));
|
||||||
|
if (SongData *song = document->song()) {
|
||||||
|
result = qMax(result, st::normalFont->width(formatPlayedText(song->duration, song->duration)));
|
||||||
|
result = qMax(result, st::normalFont->width(formatDurationAndSizeText(song->duration, document->size)));
|
||||||
|
} else {
|
||||||
|
result = qMax(result, st::normalFont->width(formatSizeText(document->size)));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32 gifMaxStatusWidth(DocumentData *document) {
|
||||||
|
int32 result = st::normalFont->width(formatDownloadText(document->size, document->size));
|
||||||
|
result = qMax(result, st::normalFont->width(formatGifAndSizeText(document->size)));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HistoryFileMedia::HistoryFileMedia() : HistoryMedia()
|
||||||
|
, _animation(0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void HistoryFileMedia::linkOver(HistoryItem *parent, const TextLinkPtr &lnk) {
|
||||||
|
if ((lnk == _savel || lnk == _cancell) && !dataLoaded()) {
|
||||||
|
ensureAnimation(parent);
|
||||||
|
_animation->a_thumbOver.start(1);
|
||||||
|
_animation->_a_thumbOver.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void HistoryFileMedia::linkOut(HistoryItem *parent, const TextLinkPtr &lnk) {
|
||||||
|
if (_animation && (lnk == _savel || lnk == _cancell)) {
|
||||||
|
_animation->a_thumbOver.start(0);
|
||||||
|
_animation->_a_thumbOver.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void HistoryFileMedia::setLinks(ITextLink *openl, ITextLink *savel, ITextLink *cancell) {
|
||||||
|
_openl.reset(openl);
|
||||||
|
_savel.reset(savel);
|
||||||
|
_cancell.reset(cancell);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HistoryFileMedia::setStatusSize(int32 newSize, int32 fullSize, int32 duration, qint64 realDuration) const {
|
||||||
|
_statusSize = newSize;
|
||||||
|
if (_statusSize == FileStatusSizeReady) {
|
||||||
|
_statusText = (duration >= 0) ? formatDurationAndSizeText(duration, fullSize) : (duration < -1 ? formatGifAndSizeText(fullSize) : formatSizeText(fullSize));
|
||||||
|
} else if (_statusSize == FileStatusSizeLoaded) {
|
||||||
|
_statusText = (duration >= 0) ? formatDurationText(duration) : (duration < -1 ? qsl("GIF") : formatSizeText(fullSize));
|
||||||
|
} else if (_statusSize == FileStatusSizeFailed) {
|
||||||
|
_statusText = lang(lng_attach_failed);
|
||||||
|
} else if (_statusSize >= 0) {
|
||||||
|
_statusText = formatDownloadText(_statusSize, fullSize);
|
||||||
|
} else {
|
||||||
|
_statusText = formatPlayedText(-_statusSize - 1, realDuration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void HistoryFileMedia::step_thumbOver(const HistoryItem *parent, float64 ms, bool timer) {
|
||||||
|
float64 dt = ms / st::msgFileOverDuration;
|
||||||
|
if (dt >= 1) {
|
||||||
|
_animation->a_thumbOver.finish();
|
||||||
|
_animation->_a_thumbOver.stop();
|
||||||
|
checkAnimationFinished();
|
||||||
|
} else {
|
||||||
|
_animation->a_thumbOver.update(dt, anim::linear);
|
||||||
|
}
|
||||||
|
if (timer) {
|
||||||
|
Ui::redrawHistoryItem(parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void HistoryFileMedia::step_radial(const HistoryItem *parent, uint64 ms, bool timer) {
|
||||||
|
_animation->radial.update(dataProgress(), dataFinished(), ms);
|
||||||
|
if (!_animation->radial.animating()) {
|
||||||
|
checkAnimationFinished();
|
||||||
|
}
|
||||||
|
if (timer) {
|
||||||
|
Ui::redrawHistoryItem(parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void HistoryFileMedia::ensureAnimation(const HistoryItem *parent) const {
|
||||||
|
if (!_animation) {
|
||||||
|
_animation = new AnimationData(
|
||||||
|
animation(parent, const_cast<HistoryFileMedia*>(this), &HistoryFileMedia::step_thumbOver),
|
||||||
|
animation(parent, const_cast<HistoryFileMedia*>(this), &HistoryFileMedia::step_radial));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void HistoryFileMedia::checkAnimationFinished() {
|
||||||
|
if (_animation && !_animation->_a_thumbOver.animating() && !_animation->radial.animating()) {
|
||||||
|
if (dataLoaded()) {
|
||||||
|
delete _animation;
|
||||||
|
_animation = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HistoryFileMedia::~HistoryFileMedia() {
|
||||||
|
if (_animation) {
|
||||||
|
delete _animation;
|
||||||
|
setBadPointer(_animation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HistoryPhoto::HistoryPhoto(const MTPDphoto &photo, const QString &caption, HistoryItem *parent) : HistoryFileMedia()
|
HistoryPhoto::HistoryPhoto(const MTPDphoto &photo, const QString &caption, HistoryItem *parent) : HistoryFileMedia()
|
||||||
, _data(App::feedPhoto(photo))
|
, _data(App::feedPhoto(photo))
|
||||||
, _pixw(1)
|
, _pixw(1)
|
||||||
, _pixh(1)
|
, _pixh(1)
|
||||||
, _caption(st::minPhotoSize - st::msgPadding.left() - st::msgPadding.right()) {
|
, _caption(st::minPhotoSize - st::msgPadding.left() - st::msgPadding.right()) {
|
||||||
setLinks(new PhotoLink(_data), new PhotoLink(_data), new PhotoCancelLink(_data));
|
setLinks(new PhotoLink(_data), new PhotoSaveLink(_data), new PhotoCancelLink(_data));
|
||||||
|
|
||||||
if (!caption.isEmpty()) {
|
if (!caption.isEmpty()) {
|
||||||
_caption.setText(st::msgFont, caption + parent->skipBlock(), itemTextNoMonoOptions(parent));
|
_caption.setText(st::msgFont, caption + parent->skipBlock(), itemTextNoMonoOptions(parent));
|
||||||
|
@ -3061,7 +3181,7 @@ HistoryPhoto::HistoryPhoto(PhotoData *photo) : HistoryFileMedia()
|
||||||
, _data(photo)
|
, _data(photo)
|
||||||
, _pixw(1)
|
, _pixw(1)
|
||||||
, _pixh(1) {
|
, _pixh(1) {
|
||||||
setLinks(new PhotoLink(_data), new PhotoLink(_data), new PhotoCancelLink(_data));
|
setLinks(new PhotoLink(_data), new PhotoSaveLink(_data), new PhotoCancelLink(_data));
|
||||||
|
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
@ -3070,7 +3190,7 @@ HistoryPhoto::HistoryPhoto(PeerData *chat, const MTPDphoto &photo, int32 width)
|
||||||
, _data(App::feedPhoto(photo))
|
, _data(App::feedPhoto(photo))
|
||||||
, _pixw(1)
|
, _pixw(1)
|
||||||
, _pixh(1) {
|
, _pixh(1) {
|
||||||
setLinks(new PhotoLink(_data, chat), new PhotoLink(_data, chat), new PhotoCancelLink(_data));
|
setLinks(new PhotoLink(_data, chat), new PhotoSaveLink(_data, chat), new PhotoCancelLink(_data));
|
||||||
|
|
||||||
_width = width;
|
_width = width;
|
||||||
init();
|
init();
|
||||||
|
@ -3081,12 +3201,11 @@ HistoryPhoto::HistoryPhoto(const HistoryPhoto &other) : HistoryFileMedia()
|
||||||
, _pixw(other._pixw)
|
, _pixw(other._pixw)
|
||||||
, _pixh(other._pixh)
|
, _pixh(other._pixh)
|
||||||
, _caption(other._caption) {
|
, _caption(other._caption) {
|
||||||
setLinks(new PhotoLink(_data), new PhotoLink(_data), new PhotoCancelLink(_data));
|
setLinks(new PhotoLink(_data), new PhotoSaveLink(_data), new PhotoCancelLink(_data));
|
||||||
|
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HistoryPhoto::init() {
|
void HistoryPhoto::init() {
|
||||||
_data->thumb->load();
|
_data->thumb->load();
|
||||||
}
|
}
|
||||||
|
@ -3356,6 +3475,14 @@ void HistoryPhoto::updateFrom(const MTPMessageMedia &media, HistoryItem *parent,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HistoryPhoto::regItem(HistoryItem *item) {
|
||||||
|
App::regPhotoItem(_data, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HistoryPhoto::unregItem(HistoryItem *item) {
|
||||||
|
App::unregPhotoItem(_data, item);
|
||||||
|
}
|
||||||
|
|
||||||
const QString HistoryPhoto::inDialogsText() const {
|
const QString HistoryPhoto::inDialogsText() const {
|
||||||
return _caption.isEmpty() ? lang(lng_in_dlg_photo) : _caption.original(0, 0xFFFF, Text::ExpandLinksNone);
|
return _caption.isEmpty() ? lang(lng_in_dlg_photo) : _caption.original(0, 0xFFFF, Text::ExpandLinksNone);
|
||||||
}
|
}
|
||||||
|
@ -3368,126 +3495,6 @@ ImagePtr HistoryPhoto::replyPreview() {
|
||||||
return _data->makeReplyPreview();
|
return _data->makeReplyPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
int32 videoMaxStatusWidth(VideoData *video) {
|
|
||||||
int32 result = st::normalFont->width(formatDownloadText(video->size, video->size));
|
|
||||||
result = qMax(result, st::normalFont->width(formatDurationAndSizeText(video->duration, video->size)));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32 audioMaxStatusWidth(AudioData *audio) {
|
|
||||||
int32 result = st::normalFont->width(formatDownloadText(audio->size, audio->size));
|
|
||||||
result = qMax(result, st::normalFont->width(formatPlayedText(audio->duration, audio->duration)));
|
|
||||||
result = qMax(result, st::normalFont->width(formatDurationAndSizeText(audio->duration, audio->size)));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32 documentMaxStatusWidth(DocumentData *document) {
|
|
||||||
int32 result = st::normalFont->width(formatDownloadText(document->size, document->size));
|
|
||||||
if (SongData *song = document->song()) {
|
|
||||||
result = qMax(result, st::normalFont->width(formatPlayedText(song->duration, song->duration)));
|
|
||||||
result = qMax(result, st::normalFont->width(formatDurationAndSizeText(song->duration, document->size)));
|
|
||||||
} else {
|
|
||||||
result = qMax(result, st::normalFont->width(formatSizeText(document->size)));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32 gifMaxStatusWidth(DocumentData *document) {
|
|
||||||
int32 result = st::normalFont->width(formatDownloadText(document->size, document->size));
|
|
||||||
result = qMax(result, st::normalFont->width(formatGifAndSizeText(document->size)));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
HistoryFileMedia::HistoryFileMedia() : HistoryMedia()
|
|
||||||
, _animation(0) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void HistoryFileMedia::linkOver(HistoryItem *parent, const TextLinkPtr &lnk) {
|
|
||||||
if ((lnk == _savel || lnk == _cancell) && !dataLoaded()) {
|
|
||||||
ensureAnimation(parent);
|
|
||||||
_animation->a_thumbOver.start(1);
|
|
||||||
_animation->_a_thumbOver.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void HistoryFileMedia::linkOut(HistoryItem *parent, const TextLinkPtr &lnk) {
|
|
||||||
if (_animation && (lnk == _savel || lnk == _cancell)) {
|
|
||||||
_animation->a_thumbOver.start(0);
|
|
||||||
_animation->_a_thumbOver.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void HistoryFileMedia::setLinks(ITextLink *openl, ITextLink *savel, ITextLink *cancell) {
|
|
||||||
_openl.reset(openl);
|
|
||||||
_savel.reset(savel);
|
|
||||||
_cancell.reset(cancell);
|
|
||||||
}
|
|
||||||
|
|
||||||
void HistoryFileMedia::setStatusSize(int32 newSize, int32 fullSize, int32 duration, qint64 realDuration) const {
|
|
||||||
_statusSize = newSize;
|
|
||||||
if (_statusSize == FileStatusSizeReady) {
|
|
||||||
_statusText = (duration >= 0) ? formatDurationAndSizeText(duration, fullSize) : (duration < -1 ? formatGifAndSizeText(fullSize) : formatSizeText(fullSize));
|
|
||||||
} else if (_statusSize == FileStatusSizeLoaded) {
|
|
||||||
_statusText = (duration >= 0) ? formatDurationText(duration) : (duration < -1 ? qsl("GIF") : formatSizeText(fullSize));
|
|
||||||
} else if (_statusSize == FileStatusSizeFailed) {
|
|
||||||
_statusText = lang(lng_attach_failed);
|
|
||||||
} else if (_statusSize >= 0) {
|
|
||||||
_statusText = formatDownloadText(_statusSize, fullSize);
|
|
||||||
} else {
|
|
||||||
_statusText = formatPlayedText(-_statusSize - 1, realDuration);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void HistoryFileMedia::step_thumbOver(const HistoryItem *parent, float64 ms, bool timer) {
|
|
||||||
float64 dt = ms / st::msgFileOverDuration;
|
|
||||||
if (dt >= 1) {
|
|
||||||
_animation->a_thumbOver.finish();
|
|
||||||
_animation->_a_thumbOver.stop();
|
|
||||||
checkAnimationFinished();
|
|
||||||
} else {
|
|
||||||
_animation->a_thumbOver.update(dt, anim::linear);
|
|
||||||
}
|
|
||||||
if (timer) {
|
|
||||||
Ui::redrawHistoryItem(parent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void HistoryFileMedia::step_radial(const HistoryItem *parent, uint64 ms, bool timer) {
|
|
||||||
_animation->radial.update(dataProgress(), dataFinished(), ms);
|
|
||||||
if (!_animation->radial.animating()) {
|
|
||||||
checkAnimationFinished();
|
|
||||||
}
|
|
||||||
if (timer) {
|
|
||||||
Ui::redrawHistoryItem(parent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void HistoryFileMedia::ensureAnimation(const HistoryItem *parent) const {
|
|
||||||
if (!_animation) {
|
|
||||||
_animation = new AnimationData(
|
|
||||||
animation(parent, const_cast<HistoryFileMedia*>(this), &HistoryFileMedia::step_thumbOver),
|
|
||||||
animation(parent, const_cast<HistoryFileMedia*>(this), &HistoryFileMedia::step_radial));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void HistoryFileMedia::checkAnimationFinished() {
|
|
||||||
if (_animation && !_animation->_a_thumbOver.animating() && !_animation->radial.animating()) {
|
|
||||||
if (dataLoaded()) {
|
|
||||||
delete _animation;
|
|
||||||
_animation = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
HistoryFileMedia::~HistoryFileMedia() {
|
|
||||||
if (_animation) {
|
|
||||||
delete _animation;
|
|
||||||
setBadPointer(_animation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
HistoryVideo::HistoryVideo(const MTPDvideo &video, const QString &caption, HistoryItem *parent) : HistoryFileMedia()
|
HistoryVideo::HistoryVideo(const MTPDvideo &video, const QString &caption, HistoryItem *parent) : HistoryFileMedia()
|
||||||
, _data(App::feedVideo(video))
|
, _data(App::feedVideo(video))
|
||||||
, _thumbw(1)
|
, _thumbw(1)
|
||||||
|
@ -4460,7 +4467,7 @@ void HistoryGif::draw(Painter &p, const HistoryItem *parent, const QRect &r, boo
|
||||||
QRect rthumb(rtlrect(skipx, skipy, width, height, _width));
|
QRect rthumb(rtlrect(skipx, skipy, width, height, _width));
|
||||||
|
|
||||||
if (animating) {
|
if (animating) {
|
||||||
p.drawPixmap(rthumb.topLeft(), _gif->current(_thumbw, _thumbh, width, height, ms));
|
p.drawPixmap(rthumb.topLeft(), _gif->current(_thumbw, _thumbh, width, height, Ui::isMediaViewShown() ? 0 : ms));
|
||||||
} else {
|
} else {
|
||||||
p.drawPixmap(rthumb.topLeft(), _data->thumb->pixBlurredSingle(_thumbw, _thumbh, width, height));
|
p.drawPixmap(rthumb.topLeft(), _data->thumb->pixBlurredSingle(_thumbw, _thumbh, width, height));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1288,6 +1288,9 @@ public:
|
||||||
|
|
||||||
void updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize);
|
void updateFrom(const MTPMessageMedia &media, HistoryItem *parent, bool allowEmitResize);
|
||||||
|
|
||||||
|
void regItem(HistoryItem *item);
|
||||||
|
void unregItem(HistoryItem *item);
|
||||||
|
|
||||||
bool hasReplyPreview() const {
|
bool hasReplyPreview() const {
|
||||||
return !_data->thumb->isNull();
|
return !_data->thumb->isNull();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1026,7 +1026,7 @@ void HistoryInner::saveContextImage() {
|
||||||
if (!lnk) return;
|
if (!lnk) return;
|
||||||
|
|
||||||
PhotoData *photo = lnk->photo();
|
PhotoData *photo = lnk->photo();
|
||||||
if (!photo || !photo->date || !photo->full->loaded()) return;
|
if (!photo || !photo->date || !photo->loaded()) return;
|
||||||
|
|
||||||
QString file;
|
QString file;
|
||||||
if (filedialogGetSaveFile(file, lang(lng_save_photo), qsl("JPEG Image (*.jpg);;All files (*.*)"), filedialogDefaultName(qsl("photo"), qsl(".jpg")))) {
|
if (filedialogGetSaveFile(file, lang(lng_save_photo), qsl("JPEG Image (*.jpg);;All files (*.*)"), filedialogDefaultName(qsl("photo"), qsl(".jpg")))) {
|
||||||
|
@ -1041,7 +1041,7 @@ void HistoryInner::copyContextImage() {
|
||||||
if (!lnk) return;
|
if (!lnk) return;
|
||||||
|
|
||||||
PhotoData *photo = lnk->photo();
|
PhotoData *photo = lnk->photo();
|
||||||
if (!photo || !photo->date || !photo->full->loaded()) return;
|
if (!photo || !photo->date || !photo->loaded()) return;
|
||||||
|
|
||||||
QApplication::clipboard()->setPixmap(photo->full->pix());
|
QApplication::clipboard()->setPixmap(photo->full->pix());
|
||||||
}
|
}
|
||||||
|
@ -1608,7 +1608,10 @@ void HistoryInner::onUpdateSelected() {
|
||||||
_dragItem->getSymbol(second, afterSymbol, uponSymbol, m.x(), m.y());
|
_dragItem->getSymbol(second, afterSymbol, uponSymbol, m.x(), m.y());
|
||||||
if (afterSymbol && _dragSelType == TextSelectLetters) ++second;
|
if (afterSymbol && _dragSelType == TextSelectLetters) ++second;
|
||||||
uint32 selState = _dragItem->adjustSelection(qMin(second, _dragSymbol), qMax(second, _dragSymbol), _dragSelType);
|
uint32 selState = _dragItem->adjustSelection(qMin(second, _dragSymbol), qMax(second, _dragSymbol), _dragSelType);
|
||||||
_selected[_dragItem] = selState;
|
if (_selected[_dragItem] != selState) {
|
||||||
|
_selected[_dragItem] = selState;
|
||||||
|
Ui::redrawHistoryItem(_dragItem);
|
||||||
|
}
|
||||||
if (!_wasSelectedText && (selState == FullSelection || (selState & 0xFFFF) != ((selState >> 16) & 0xFFFF))) {
|
if (!_wasSelectedText && (selState == FullSelection || (selState & 0xFFFF) != ((selState >> 16) & 0xFFFF))) {
|
||||||
_wasSelectedText = true;
|
_wasSelectedText = true;
|
||||||
setFocus();
|
setFocus();
|
||||||
|
@ -2990,6 +2993,10 @@ void HistoryWidget::notify_migrateUpdated(PeerData *peer) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HistoryWidget::notify_mediaViewHidden() {
|
||||||
|
if (_list) _list->update();
|
||||||
|
}
|
||||||
|
|
||||||
void HistoryWidget::notify_historyItemResized(const HistoryItem *row, bool scrollToIt) {
|
void HistoryWidget::notify_historyItemResized(const HistoryItem *row, bool scrollToIt) {
|
||||||
updateListSize(0, false, false, row, scrollToIt);
|
updateListSize(0, false, false, row, scrollToIt);
|
||||||
}
|
}
|
||||||
|
|
|
@ -562,6 +562,7 @@ public:
|
||||||
void notify_botCommandsChanged(UserData *user);
|
void notify_botCommandsChanged(UserData *user);
|
||||||
void notify_userIsBotChanged(UserData *user);
|
void notify_userIsBotChanged(UserData *user);
|
||||||
void notify_migrateUpdated(PeerData *peer);
|
void notify_migrateUpdated(PeerData *peer);
|
||||||
|
void notify_mediaViewHidden();
|
||||||
void notify_historyItemResized(const HistoryItem *item, bool scrollToIt);
|
void notify_historyItemResized(const HistoryItem *item, bool scrollToIt);
|
||||||
|
|
||||||
~HistoryWidget();
|
~HistoryWidget();
|
||||||
|
|
|
@ -320,9 +320,9 @@ int32 LayoutOverviewPhoto::resizeGetHeight(int32 width) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayoutOverviewPhoto::paint(Painter &p, const QRect &clip, uint32 selection, const PaintContext *context) const {
|
void LayoutOverviewPhoto::paint(Painter &p, const QRect &clip, uint32 selection, const PaintContext *context) const {
|
||||||
bool good = _data->full->loaded();
|
bool good = _data->loaded();
|
||||||
if (!good) {
|
if (!good) {
|
||||||
_data->medium->load(false, false);
|
_data->medium->automaticLoad(_parent);
|
||||||
good = _data->medium->loaded();
|
good = _data->medium->loaded();
|
||||||
}
|
}
|
||||||
if ((good && !_goodLoaded) || _pix.width() != _width * cIntRetinaFactor()) {
|
if ((good && !_goodLoaded) || _pix.width() != _width * cIntRetinaFactor()) {
|
||||||
|
@ -330,7 +330,7 @@ void LayoutOverviewPhoto::paint(Painter &p, const QRect &clip, uint32 selection,
|
||||||
|
|
||||||
int32 size = _width * cIntRetinaFactor();
|
int32 size = _width * cIntRetinaFactor();
|
||||||
if (_goodLoaded || _data->thumb->loaded()) {
|
if (_goodLoaded || _data->thumb->loaded()) {
|
||||||
QImage img = (_data->full->loaded() ? _data->full : (_data->medium->loaded() ? _data->medium : _data->thumb))->pix().toImage();
|
QImage img = (_data->loaded() ? _data->full : (_data->medium->loaded() ? _data->medium : _data->thumb))->pix().toImage();
|
||||||
if (!_goodLoaded) {
|
if (!_goodLoaded) {
|
||||||
img = imageBlur(img);
|
img = imageBlur(img);
|
||||||
}
|
}
|
||||||
|
@ -1095,7 +1095,7 @@ LayoutOverviewLink::LayoutOverviewLink(HistoryMedia *media, HistoryItem *parent)
|
||||||
}
|
}
|
||||||
int32 tw = 0, th = 0;
|
int32 tw = 0, th = 0;
|
||||||
if (_page && _page->photo) {
|
if (_page && _page->photo) {
|
||||||
if (!_page->photo->full->loaded()) _page->photo->thumb->load(false, false);
|
if (!_page->photo->loaded()) _page->photo->thumb->load(false, false);
|
||||||
|
|
||||||
tw = convertScale(_page->photo->thumb->width());
|
tw = convertScale(_page->photo->thumb->width());
|
||||||
th = convertScale(_page->photo->thumb->height());
|
th = convertScale(_page->photo->thumb->height());
|
||||||
|
@ -1120,7 +1120,8 @@ LayoutOverviewLink::LayoutOverviewLink(HistoryMedia *media, HistoryItem *parent)
|
||||||
if (_page) {
|
if (_page) {
|
||||||
_title = _page->title;
|
_title = _page->title;
|
||||||
}
|
}
|
||||||
QVector<QStringRef> parts = (_page ? _page->url : (_links.isEmpty() ? QString() : _links.at(0).lnk->text())).splitRef('/');
|
QString url(_page ? _page->url : (_links.isEmpty() ? QString() : _links.at(0).lnk->text()));
|
||||||
|
QVector<QStringRef> parts = url.splitRef('/');
|
||||||
if (!parts.isEmpty()) {
|
if (!parts.isEmpty()) {
|
||||||
QStringRef domain = parts.at(0);
|
QStringRef domain = parts.at(0);
|
||||||
if (parts.size() > 2 && domain.endsWith(':') && parts.at(1).isEmpty()) { // http:// and others
|
if (parts.size() > 2 && domain.endsWith(':') && parts.at(1).isEmpty()) { // http:// and others
|
||||||
|
@ -1176,7 +1177,7 @@ void LayoutOverviewLink::paint(Painter &p, const QRect &clip, uint32 selection,
|
||||||
if (clip.intersects(rtlrect(0, top, st::dlgPhotoSize, st::dlgPhotoSize, _width))) {
|
if (clip.intersects(rtlrect(0, top, st::dlgPhotoSize, st::dlgPhotoSize, _width))) {
|
||||||
if (_page && _page->photo) {
|
if (_page && _page->photo) {
|
||||||
QPixmap pix;
|
QPixmap pix;
|
||||||
if (_page->photo->full->loaded()) {
|
if (_page->photo->loaded()) {
|
||||||
pix = _page->photo->full->pixSingle(_pixw, _pixh, st::dlgPhotoSize, st::dlgPhotoSize);
|
pix = _page->photo->full->pixSingle(_pixw, _pixh, st::dlgPhotoSize, st::dlgPhotoSize);
|
||||||
} else if (_page->photo->medium->loaded()) {
|
} else if (_page->photo->medium->loaded()) {
|
||||||
pix = _page->photo->medium->pixSingle(_pixw, _pixh, st::dlgPhotoSize, st::dlgPhotoSize);
|
pix = _page->photo->medium->pixSingle(_pixw, _pixh, st::dlgPhotoSize, st::dlgPhotoSize);
|
||||||
|
@ -1278,4 +1279,4 @@ LayoutOverviewLink::Link::Link(const QString &url, const QString &text)
|
||||||
: text(text)
|
: text(text)
|
||||||
, width(st::normalFont->width(text))
|
, width(st::normalFont->width(text))
|
||||||
, lnk(linkFromUrl(url)) {
|
, lnk(linkFromUrl(url)) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -786,6 +786,10 @@ void MainWidget::notify_migrateUpdated(PeerData *peer) {
|
||||||
history.notify_migrateUpdated(peer);
|
history.notify_migrateUpdated(peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWidget::notify_mediaViewHidden() {
|
||||||
|
history.notify_mediaViewHidden();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWidget::ui_redrawHistoryItem(const HistoryItem *item) {
|
void MainWidget::ui_redrawHistoryItem(const HistoryItem *item) {
|
||||||
if (!item) return;
|
if (!item) return;
|
||||||
|
|
||||||
|
|
|
@ -416,6 +416,7 @@ public:
|
||||||
void notify_userIsBotChanged(UserData *bot);
|
void notify_userIsBotChanged(UserData *bot);
|
||||||
void notify_userIsContactChanged(UserData *user, bool fromThisApp);
|
void notify_userIsContactChanged(UserData *user, bool fromThisApp);
|
||||||
void notify_migrateUpdated(PeerData *peer);
|
void notify_migrateUpdated(PeerData *peer);
|
||||||
|
void notify_mediaViewHidden();
|
||||||
void notify_historyItemResized(const HistoryItem *row, bool scrollToIt);
|
void notify_historyItemResized(const HistoryItem *row, bool scrollToIt);
|
||||||
void notify_historyItemLayoutChanged(const HistoryItem *item);
|
void notify_historyItemLayoutChanged(const HistoryItem *item);
|
||||||
|
|
||||||
|
|
|
@ -333,7 +333,7 @@ void MediaView::updateControls() {
|
||||||
_docCancel.hide();
|
_docCancel.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
_saveVisible = ((_photo && _photo->full->loaded()) || (_doc && (_doc->loaded(true) || (!fileShown() && (_photo || _doc)))));
|
_saveVisible = ((_photo && _photo->loaded()) || (_doc && (_doc->loaded(true) || (!fileShown() && (_photo || _doc)))));
|
||||||
_saveNav = myrtlrect(width() - st::mvIconSize.width() * 2, height() - st::mvIconSize.height(), st::mvIconSize.width(), st::mvIconSize.height());
|
_saveNav = myrtlrect(width() - st::mvIconSize.width() * 2, height() - st::mvIconSize.height(), st::mvIconSize.width(), st::mvIconSize.height());
|
||||||
_saveNavIcon = centersprite(_saveNav, st::mvSave);
|
_saveNavIcon = centersprite(_saveNav, st::mvSave);
|
||||||
_moreNav = myrtlrect(width() - st::mvIconSize.width(), height() - st::mvIconSize.height(), st::mvIconSize.width(), st::mvIconSize.height());
|
_moreNav = myrtlrect(width() - st::mvIconSize.width(), height() - st::mvIconSize.height(), st::mvIconSize.width(), st::mvIconSize.height());
|
||||||
|
@ -396,7 +396,7 @@ void MediaView::updateDropdown() {
|
||||||
_btnToMessage->setVisible(_msgid > 0);
|
_btnToMessage->setVisible(_msgid > 0);
|
||||||
_btnShowInFolder->setVisible(_doc && !_doc->already(true).isEmpty());
|
_btnShowInFolder->setVisible(_doc && !_doc->already(true).isEmpty());
|
||||||
_btnSaveAs->setVisible(true);
|
_btnSaveAs->setVisible(true);
|
||||||
_btnCopy->setVisible((_doc && fileShown()) || (_photo && _photo->full->loaded()));
|
_btnCopy->setVisible((_doc && fileShown()) || (_photo && _photo->loaded()));
|
||||||
_btnForward->setVisible(_canForward);
|
_btnForward->setVisible(_canForward);
|
||||||
_btnDelete->setVisible(_canDelete || (_photo && App::self() && App::self()->photoId == _photo->id) || (_photo && _photo->peer && _photo->peer->photoId == _photo->id && (_photo->peer->isChat() || (_photo->peer->isChannel() && _photo->peer->asChannel()->amCreator()))));
|
_btnDelete->setVisible(_canDelete || (_photo && App::self() && App::self()->photoId == _photo->id) || (_photo && _photo->peer && _photo->peer->photoId == _photo->id && (_photo->peer->isChat() || (_photo->peer->isChannel() && _photo->peer->asChannel()->amCreator()))));
|
||||||
_btnViewAll->setVisible((_overview != OverviewCount) && _history);
|
_btnViewAll->setVisible((_overview != OverviewCount) && _history);
|
||||||
|
@ -576,7 +576,7 @@ void MediaView::onSaveAs() {
|
||||||
updateOver(_lastMouseMovePos);
|
updateOver(_lastMouseMovePos);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!_photo || !_photo->full->loaded()) return;
|
if (!_photo || !_photo->loaded()) return;
|
||||||
|
|
||||||
psBringToBack(this);
|
psBringToBack(this);
|
||||||
bool gotName = filedialogGetSaveFile(file, lang(lng_save_photo), qsl("JPEG Image (*.jpg);;All files (*.*)"), filedialogDefaultName(qsl("photo"), qsl(".jpg")));
|
bool gotName = filedialogGetSaveFile(file, lang(lng_save_photo), qsl("JPEG Image (*.jpg);;All files (*.*)"), filedialogDefaultName(qsl("photo"), qsl(".jpg")));
|
||||||
|
@ -656,7 +656,7 @@ void MediaView::onDownload() {
|
||||||
updateOver(_lastMouseMovePos);
|
updateOver(_lastMouseMovePos);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!_photo || !_photo->full->loaded()) {
|
if (!_photo || !_photo->loaded()) {
|
||||||
_saveVisible = false;
|
_saveVisible = false;
|
||||||
update(_saveNav);
|
update(_saveNav);
|
||||||
} else {
|
} else {
|
||||||
|
@ -739,7 +739,7 @@ void MediaView::onCopy() {
|
||||||
QApplication::clipboard()->setPixmap(QPixmap::fromImage(_gif->frameOriginal()));
|
QApplication::clipboard()->setPixmap(QPixmap::fromImage(_gif->frameOriginal()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!_photo || !_photo->full->loaded()) return;
|
if (!_photo || !_photo->loaded()) return;
|
||||||
|
|
||||||
QApplication::clipboard()->setPixmap(_photo->full->pix());
|
QApplication::clipboard()->setPixmap(_photo->full->pix());
|
||||||
}
|
}
|
||||||
|
@ -916,7 +916,7 @@ void MediaView::displayPhoto(PhotoData *photo, HistoryItem *item) {
|
||||||
_from = _user;
|
_from = _user;
|
||||||
}
|
}
|
||||||
updateControls();
|
updateControls();
|
||||||
_photo->full->loadEvenCancelled();
|
_photo->download();
|
||||||
if (isHidden()) {
|
if (isHidden()) {
|
||||||
psUpdateOverlayed(this);
|
psUpdateOverlayed(this);
|
||||||
show();
|
show();
|
||||||
|
@ -1102,7 +1102,7 @@ void MediaView::paintEvent(QPaintEvent *e) {
|
||||||
// photo
|
// photo
|
||||||
if (_photo) {
|
if (_photo) {
|
||||||
int32 w = _width * cIntRetinaFactor();
|
int32 w = _width * cIntRetinaFactor();
|
||||||
if (_full <= 0 && _photo->full->loaded()) {
|
if (_full <= 0 && _photo->loaded()) {
|
||||||
int32 h = int((_photo->full->height() * (qreal(w) / qreal(_photo->full->width()))) + 0.9999);
|
int32 h = int((_photo->full->height() * (qreal(w) / qreal(_photo->full->width()))) + 0.9999);
|
||||||
_current = _photo->full->pixNoCache(w, h, true);
|
_current = _photo->full->pixNoCache(w, h, true);
|
||||||
if (cRetina()) _current.setDevicePixelRatio(cRetinaFactor());
|
if (cRetina()) _current.setDevicePixelRatio(cRetinaFactor());
|
||||||
|
@ -1584,7 +1584,7 @@ void MediaView::preloadData(int32 delta) {
|
||||||
if (HistoryItem *item = App::histItemById(previewHistory->channelId(), previewHistory->overview[_overview][previewIndex])) {
|
if (HistoryItem *item = App::histItemById(previewHistory->channelId(), previewHistory->overview[_overview][previewIndex])) {
|
||||||
if (HistoryMedia *media = item->getMedia()) {
|
if (HistoryMedia *media = item->getMedia()) {
|
||||||
switch (media->type()) {
|
switch (media->type()) {
|
||||||
case MediaTypePhoto: static_cast<HistoryPhoto*>(media)->photo()->full->loadEvenCancelled(); break;
|
case MediaTypePhoto: static_cast<HistoryPhoto*>(media)->photo()->download(); break;
|
||||||
case MediaTypeDocument:
|
case MediaTypeDocument:
|
||||||
case MediaTypeGif: {
|
case MediaTypeGif: {
|
||||||
DocumentData *doc = media->getDocument();
|
DocumentData *doc = media->getDocument();
|
||||||
|
@ -1605,7 +1605,7 @@ void MediaView::preloadData(int32 delta) {
|
||||||
}
|
}
|
||||||
for (int32 i = from; i <= to; ++i) {
|
for (int32 i = from; i <= to; ++i) {
|
||||||
if (i >= 0 && i < _user->photos.size() && i != _index) {
|
if (i >= 0 && i < _user->photos.size() && i != _index) {
|
||||||
_user->photos[i]->full->loadEvenCancelled();
|
_user->photos[i]->download();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int32 forgetIndex = _index - delta * 2;
|
int32 forgetIndex = _index - delta * 2;
|
||||||
|
@ -1959,6 +1959,8 @@ void MediaView::hide() {
|
||||||
a_cOpacity = anim::fvalue(1, 1);
|
a_cOpacity = anim::fvalue(1, 1);
|
||||||
QWidget::hide();
|
QWidget::hide();
|
||||||
stopGif();
|
stopGif();
|
||||||
|
|
||||||
|
Notify::mediaViewHidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MediaView::onMenuDestroy(QObject *obj) {
|
void MediaView::onMenuDestroy(QObject *obj) {
|
||||||
|
|
|
@ -1142,7 +1142,7 @@ void psOpenFile(const QString &name, bool openWith) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void psShowInFolder(const QString &name) {
|
void psShowInFolder(const QString &name) {
|
||||||
App::wnd()->hideLayer(true);
|
Ui::hideLayer(true);
|
||||||
system((qsl("xdg-open ") + escapeShell(QFileInfo(name).absoluteDir().absolutePath())).toUtf8().constData());
|
system((qsl("xdg-open ") + escapeShell(QFileInfo(name).absoluteDir().absolutePath())).toUtf8().constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -844,7 +844,7 @@ void SettingsInner::mousePressEvent(QMouseEvent *e) {
|
||||||
Ui::showLayer(new EditNameTitleBox(self()));
|
Ui::showLayer(new EditNameTitleBox(self()));
|
||||||
} else if (QRect(_left, st::setTop, st::setPhotoSize, st::setPhotoSize).contains(e->pos())) {
|
} else if (QRect(_left, st::setTop, st::setPhotoSize, st::setPhotoSize).contains(e->pos())) {
|
||||||
if (_photoLink) {
|
if (_photoLink) {
|
||||||
App::photo(self()->photoId)->full->load();
|
App::photo(self()->photoId)->download();
|
||||||
_photoLink->onClick(e->button());
|
_photoLink->onClick(e->button());
|
||||||
} else {
|
} else {
|
||||||
onUpdatePhoto();
|
onUpdatePhoto();
|
||||||
|
|
|
@ -578,8 +578,20 @@ void PhotoData::automaticLoad(const HistoryItem *item) {
|
||||||
full->automaticLoad(item);
|
full->automaticLoad(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PhotoData::download() {
|
||||||
|
full->loadEvenCancelled();
|
||||||
|
notifyLayoutChanged();
|
||||||
|
}
|
||||||
|
|
||||||
bool PhotoData::loaded() const {
|
bool PhotoData::loaded() const {
|
||||||
return full->loaded();
|
bool wasLoading = loading();
|
||||||
|
if (full->loaded()) {
|
||||||
|
if (wasLoading) {
|
||||||
|
notifyLayoutChanged();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PhotoData::loading() const {
|
bool PhotoData::loading() const {
|
||||||
|
@ -592,10 +604,27 @@ bool PhotoData::displayLoading() const {
|
||||||
|
|
||||||
void PhotoData::cancel() {
|
void PhotoData::cancel() {
|
||||||
full->cancel();
|
full->cancel();
|
||||||
|
notifyLayoutChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PhotoData::notifyLayoutChanged() const {
|
||||||
|
const PhotoItems &items(App::photoItems());
|
||||||
|
PhotoItems::const_iterator i = items.constFind(const_cast<PhotoData*>(this));
|
||||||
|
if (i != items.cend()) {
|
||||||
|
for (HistoryItemsMap::const_iterator j = i->cbegin(), e = i->cend(); j != e; ++j) {
|
||||||
|
Notify::historyItemLayoutChanged(j.key());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float64 PhotoData::progress() const {
|
float64 PhotoData::progress() const {
|
||||||
return loading() ? full->progress() : (uploading() ? (float64(uploadingData->offset) / uploadingData->size) : (loaded() ? 1 : 0));
|
if (uploading()) {
|
||||||
|
if (uploadingData->size > 0) {
|
||||||
|
return float64(uploadingData->offset) / uploadingData->size;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return full->progress();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 PhotoData::loadOffset() const {
|
int32 PhotoData::loadOffset() const {
|
||||||
|
@ -638,6 +667,15 @@ void PhotoLink::onClick(Qt::MouseButton button) const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PhotoSaveLink::onClick(Qt::MouseButton button) const {
|
||||||
|
if (button != Qt::LeftButton) return;
|
||||||
|
|
||||||
|
PhotoData *data = photo();
|
||||||
|
if (!data->date) return;
|
||||||
|
|
||||||
|
data->download();
|
||||||
|
}
|
||||||
|
|
||||||
void PhotoCancelLink::onClick(Qt::MouseButton button) const {
|
void PhotoCancelLink::onClick(Qt::MouseButton button) const {
|
||||||
if (button != Qt::LeftButton) return;
|
if (button != Qt::LeftButton) return;
|
||||||
|
|
||||||
|
@ -873,7 +911,13 @@ bool VideoData::displayLoading() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
float64 VideoData::progress() const {
|
float64 VideoData::progress() const {
|
||||||
return loading() ? _loader->currentProgress() : (uploading() ? (float64(uploadOffset) / size) : (loaded() ? 1 : 0));
|
if (uploading()) {
|
||||||
|
if (size > 0) {
|
||||||
|
return float64(uploadOffset) / size;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return loading() ? _loader->currentProgress() : (loaded() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 VideoData::loadOffset() const {
|
int32 VideoData::loadOffset() const {
|
||||||
|
@ -1180,7 +1224,13 @@ bool AudioData::displayLoading() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
float64 AudioData::progress() const {
|
float64 AudioData::progress() const {
|
||||||
return loading() ? _loader->currentProgress() : (uploading() ? (float64(uploadOffset) / size) : (loaded() ? 1 : 0));
|
if (uploading()) {
|
||||||
|
if (size > 0) {
|
||||||
|
return float64(uploadOffset) / size;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return loading() ? _loader->currentProgress() : (loaded() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 AudioData::loadOffset() const {
|
int32 AudioData::loadOffset() const {
|
||||||
|
@ -1606,7 +1656,13 @@ bool DocumentData::displayLoading() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
float64 DocumentData::progress() const {
|
float64 DocumentData::progress() const {
|
||||||
return loading() ? _loader->currentProgress() : (uploading() ? (float64(uploadOffset) / size) : (loaded() ? 1 : 0));
|
if (uploading()) {
|
||||||
|
if (size > 0) {
|
||||||
|
return float64(uploadOffset) / size;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return loading() ? _loader->currentProgress() : (loaded() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 DocumentData::loadOffset() const {
|
int32 DocumentData::loadOffset() const {
|
||||||
|
|
|
@ -734,6 +734,7 @@ public:
|
||||||
|
|
||||||
void automaticLoad(const HistoryItem *item);
|
void automaticLoad(const HistoryItem *item);
|
||||||
|
|
||||||
|
void download();
|
||||||
bool loaded() const;
|
bool loaded() const;
|
||||||
bool loading() const;
|
bool loading() const;
|
||||||
bool displayLoading() const;
|
bool displayLoading() const;
|
||||||
|
@ -764,8 +765,9 @@ public:
|
||||||
};
|
};
|
||||||
UploadingData *uploadingData;
|
UploadingData *uploadingData;
|
||||||
|
|
||||||
// int32 cachew;
|
private:
|
||||||
// QPixmap cache;
|
void notifyLayoutChanged() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class PhotoLink : public ITextLink {
|
class PhotoLink : public ITextLink {
|
||||||
|
@ -788,6 +790,16 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class PhotoSaveLink : public PhotoLink {
|
||||||
|
TEXT_LINK_CLASS(PhotoSaveLink)
|
||||||
|
|
||||||
|
public:
|
||||||
|
PhotoSaveLink(PhotoData *photo, PeerData *peer = 0) : PhotoLink(photo, peer) {
|
||||||
|
}
|
||||||
|
void onClick(Qt::MouseButton button) const;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
class PhotoCancelLink : public PhotoLink {
|
class PhotoCancelLink : public PhotoLink {
|
||||||
TEXT_LINK_CLASS(PhotoCancelLink)
|
TEXT_LINK_CLASS(PhotoCancelLink)
|
||||||
|
|
||||||
|
|
|
@ -844,6 +844,10 @@ bool Window::ui_isLayerShown() {
|
||||||
return !!layerBg;
|
return !!layerBg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Window::ui_isMediaViewShown() {
|
||||||
|
return _mediaView && !_mediaView->isHidden();
|
||||||
|
}
|
||||||
|
|
||||||
void Window::notify_clipReinit(ClipReader *reader) {
|
void Window::notify_clipReinit(ClipReader *reader) {
|
||||||
if (_mediaView && !_mediaView->isHidden()) {
|
if (_mediaView && !_mediaView->isHidden()) {
|
||||||
_mediaView->notify_clipReinit(reader);
|
_mediaView->notify_clipReinit(reader);
|
||||||
|
|
|
@ -240,6 +240,7 @@ public:
|
||||||
void ui_clipRedraw(ClipReader *reader);
|
void ui_clipRedraw(ClipReader *reader);
|
||||||
void ui_showLayer(LayeredWidget *box, ShowLayerOptions options);
|
void ui_showLayer(LayeredWidget *box, ShowLayerOptions options);
|
||||||
bool ui_isLayerShown();
|
bool ui_isLayerShown();
|
||||||
|
bool ui_isMediaViewShown();
|
||||||
|
|
||||||
void notify_clipReinit(ClipReader *reader);
|
void notify_clipReinit(ClipReader *reader);
|
||||||
|
|
||||||
|
|
|
@ -308,7 +308,7 @@ INCLUDEPATH += "/usr/include/atk-1.0"
|
||||||
INCLUDEPATH += "/usr/include/dee-1.0"
|
INCLUDEPATH += "/usr/include/dee-1.0"
|
||||||
INCLUDEPATH += "/usr/include/libdbusmenu-glib-0.4"
|
INCLUDEPATH += "/usr/include/libdbusmenu-glib-0.4"
|
||||||
|
|
||||||
LIBS += -lcrypto -lssl -lz -ldl -llzma -lexif -lopenal -lavformat -lavcodec -lswresample -lswscale -lavutil -lopus
|
LIBS += -lcrypto -lssl -lz -ldl -llzma -lexif -lopenal -lavformat -lavcodec -lswresample -lswscale -lavutil -lopus -lva
|
||||||
LIBS += ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.a \
|
LIBS += ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.a \
|
||||||
./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libibusplatforminputcontextplugin.a \
|
./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libibusplatforminputcontextplugin.a \
|
||||||
./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.a
|
./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.a
|
||||||
|
|
|
@ -112,7 +112,7 @@
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||||
<AdditionalLibraryDirectories>.\..\..\Libraries\lzma\C\Util\LzmaLib\Release;.\..\..\Libraries\libexif-0.6.20\win32\Release;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\opus\win32\VS2010\Win32\Release;.\..\..\Libraries\openal-soft\build\Release;.\..\..\Libraries\zlib-1.2.8\contrib\vstudio\vc11\x86\ZlibStatRelease;.\..\..\Libraries\openssl\Release\lib;$(QTDIR)\lib;$(QTDIR)\plugins;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>.\..\..\Libraries\lzma\C\Util\LzmaLib\Release;.\..\..\Libraries\libexif-0.6.20\win32\Release;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\opus\win32\VS2010\Win32\Release;.\..\..\Libraries\openal-soft\build\Release;.\..\..\Libraries\zlib-1.2.8\contrib\vstudio\vc11\x86\ZlibStatRelease;.\..\..\Libraries\openssl\Release\lib;$(QTDIR)\lib;$(QTDIR)\plugins;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>kernel32.lib;user32.lib;shell32.lib;uuid.lib;ole32.lib;advapi32.lib;ws2_32.lib;gdi32.lib;comdlg32.lib;oleaut32.lib;Shlwapi.lib;Gdiplus.lib;imm32.lib;winmm.lib;qtmain.lib;glu32.lib;opengl32.lib;Strmiids.lib;Qt5Core.lib;Qt5Gui.lib;qtharfbuzzng.lib;qtpcre.lib;qtfreetype.lib;Qt5Widgets.lib;Qt5Network.lib;Qt5PlatformSupport.lib;platforms\qwindows.lib;imageformats\qwebp.lib;libeay32.lib;ssleay32.lib;Crypt32.lib;zlibstat.lib;lib_exif.lib;UxTheme.lib;DbgHelp.lib;LzmaLib.lib;OpenAL32.lib;common.lib;libavformat\libavformat.a;libavcodec\libavcodec.a;libavutil\libavutil.a;libswresample\libswresample.a;opus.lib;celt.lib;silk_common.lib;silk_float.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>kernel32.lib;user32.lib;shell32.lib;uuid.lib;ole32.lib;advapi32.lib;ws2_32.lib;gdi32.lib;comdlg32.lib;oleaut32.lib;Shlwapi.lib;Gdiplus.lib;imm32.lib;winmm.lib;qtmain.lib;glu32.lib;opengl32.lib;Strmiids.lib;Qt5Core.lib;Qt5Gui.lib;qtharfbuzzng.lib;qtpcre.lib;qtfreetype.lib;Qt5Widgets.lib;Qt5Network.lib;Qt5PlatformSupport.lib;platforms\qwindows.lib;imageformats\qwebp.lib;libeay32.lib;ssleay32.lib;Crypt32.lib;zlibstat.lib;lib_exif.lib;UxTheme.lib;DbgHelp.lib;LzmaLib.lib;OpenAL32.lib;common.lib;libavformat\libavformat.a;libavcodec\libavcodec.a;libavutil\libavutil.a;libswresample\libswresample.a;libswscale\libswscale.a;opus.lib;celt.lib;silk_common.lib;silk_float.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ImageHasSafeExceptionHandlers />
|
<ImageHasSafeExceptionHandlers />
|
||||||
<ImportLibrary>$(SolutionDir)$(Platform)\$(Configuration)Intermediate\$(TargetName).lib</ImportLibrary>
|
<ImportLibrary>$(SolutionDir)$(Platform)\$(Configuration)Intermediate\$(TargetName).lib</ImportLibrary>
|
||||||
<ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase>
|
<ProfileGuidedDatabase>$(IntDir)$(TargetName).pgd</ProfileGuidedDatabase>
|
||||||
|
@ -142,7 +142,7 @@
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
|
||||||
<AdditionalLibraryDirectories>.\..\..\Libraries\lzma\C\Util\LzmaLib\Release;.\..\..\Libraries\libexif-0.6.20\win32\Release;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\opus\win32\VS2010\Win32\Release;.\..\..\Libraries\openal-soft\build\Release;.\..\..\Libraries\zlib-1.2.8\contrib\vstudio\vc11\x86\ZlibStatRelease;.\..\..\Libraries\openssl\Release\lib;$(QTDIR)\lib;$(QTDIR)\plugins;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>.\..\..\Libraries\lzma\C\Util\LzmaLib\Release;.\..\..\Libraries\libexif-0.6.20\win32\Release;.\..\..\Libraries\ffmpeg;.\..\..\Libraries\opus\win32\VS2010\Win32\Release;.\..\..\Libraries\openal-soft\build\Release;.\..\..\Libraries\zlib-1.2.8\contrib\vstudio\vc11\x86\ZlibStatRelease;.\..\..\Libraries\openssl\Release\lib;$(QTDIR)\lib;$(QTDIR)\plugins;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>kernel32.lib;user32.lib;shell32.lib;uuid.lib;ole32.lib;advapi32.lib;ws2_32.lib;gdi32.lib;comdlg32.lib;oleaut32.lib;Shlwapi.lib;Gdiplus.lib;imm32.lib;winmm.lib;qtmain.lib;glu32.lib;opengl32.lib;Strmiids.lib;Qt5Core.lib;Qt5Gui.lib;qtharfbuzzng.lib;qtpcre.lib;qtfreetype.lib;Qt5Widgets.lib;Qt5Network.lib;Qt5PlatformSupport.lib;platforms\qwindows.lib;imageformats\qwebp.lib;libeay32.lib;ssleay32.lib;Crypt32.lib;zlibstat.lib;lib_exif.lib;UxTheme.lib;DbgHelp.lib;LzmaLib.lib;OpenAL32.lib;common.lib;libavformat\libavformat.a;libavcodec\libavcodec.a;libavutil\libavutil.a;libswresample\libswresample.a;opus.lib;celt.lib;silk_common.lib;silk_float.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>kernel32.lib;user32.lib;shell32.lib;uuid.lib;ole32.lib;advapi32.lib;ws2_32.lib;gdi32.lib;comdlg32.lib;oleaut32.lib;Shlwapi.lib;Gdiplus.lib;imm32.lib;winmm.lib;qtmain.lib;glu32.lib;opengl32.lib;Strmiids.lib;Qt5Core.lib;Qt5Gui.lib;qtharfbuzzng.lib;qtpcre.lib;qtfreetype.lib;Qt5Widgets.lib;Qt5Network.lib;Qt5PlatformSupport.lib;platforms\qwindows.lib;imageformats\qwebp.lib;libeay32.lib;ssleay32.lib;Crypt32.lib;zlibstat.lib;lib_exif.lib;UxTheme.lib;DbgHelp.lib;LzmaLib.lib;OpenAL32.lib;common.lib;libavformat\libavformat.a;libavcodec\libavcodec.a;libavutil\libavutil.a;libswresample\libswresample.a;libswscale\libswscale.a;opus.lib;celt.lib;silk_common.lib;silk_float.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ImageHasSafeExceptionHandlers>
|
<ImageHasSafeExceptionHandlers>
|
||||||
</ImageHasSafeExceptionHandlers>
|
</ImageHasSafeExceptionHandlers>
|
||||||
<ImportLibrary>$(SolutionDir)$(Platform)\$(Configuration)Intermediate\$(TargetName).lib</ImportLibrary>
|
<ImportLibrary>$(SolutionDir)$(Platform)\$(Configuration)Intermediate\$(TargetName).lib</ImportLibrary>
|
||||||
|
|
Loading…
Reference in New Issue