Allow to import stickers from chat window

This commit is contained in:
hunbernd 2019-10-05 23:18:41 +02:00
parent 641964fff9
commit e52f1282ec
7 changed files with 46 additions and 12 deletions

View file

@ -29,6 +29,7 @@
#include <QTabWidget>
#include <QWidget>
#include <QMessageBox>
#include <QDir>
#include <iostream>
#include <math.h>
@ -49,9 +50,12 @@ void Emoticons::load()
{
loadSmiley();
filters << "*.png" << "*.jpg" << "*.gif";
stickerFolders << (QString::fromStdString(RsAccounts::ConfigDirectory()) + "/stickers"); //under .retroshare, shared between users
stickerFolders << (QString::fromStdString(RsAccounts::AccountDirectory()) + "/stickers"); //under account, unique for user
stickerFolders << (QString::fromStdString(RsAccounts::ConfigDirectory()) + "/stickers"); //under .retroshare, shared between users
stickerFolders << (QString::fromStdString(RsAccounts::systemDataDirectory()) + "/stickers"); //exe's folder, shipped with RS
QDir dir(QString::fromStdString(RsAccounts::AccountDirectory()));
dir.mkpath("stickers/imported");
}
void Emoticons::loadSmiley()
@ -458,6 +462,12 @@ void Emoticons::showStickerWidget(QWidget *parent, QWidget *button, const char *
QApplication::restoreOverrideCursor();
}
QString Emoticons::importedStickerPath()
{
QDir dir(stickerFolders[0]);
return dir.absoluteFilePath("imported");
}
void Emoticons::loadToolTips(QWidget *container)
{
QApplication::setOverrideCursor(Qt::WaitCursor);

View file

@ -30,15 +30,15 @@ class Emoticons
{
public:
static void load();
static void loadSmiley();
static void refreshStickerTabs(QVector<QString>& stickerTabs, QString foldername);
static void refreshStickerTabs(QVector<QString>& stickerTabs);
static void showSmileyWidget(QWidget *parent, QWidget *button, const char *slotAddMethod, bool above);
static void showStickerWidget(QWidget *parent, QWidget *button, const char *slotAddMethod, bool above);
static QString importedStickerPath();
private:
static void loadToolTips(QWidget *container);
static void loadSmiley();
static void refreshStickerTabs(QVector<QString>& stickerTabs, QString foldername);
static void refreshStickerTabs(QVector<QString>& stickerTabs);
};
#endif