mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-13 00:53:14 -04:00
Added new widget for hashing files.
Added new common class FilesDefs to handle informations of file types like icons and names. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4713 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c9fc77f2d1
commit
0ee35b55f4
35 changed files with 932 additions and 1031 deletions
|
@ -324,11 +324,13 @@ HEADERS += rshare.h \
|
||||||
gui/common/RSTabWidget.h \
|
gui/common/RSTabWidget.h \
|
||||||
gui/common/RSItemDelegate.h \
|
gui/common/RSItemDelegate.h \
|
||||||
gui/common/PeerDefs.h \
|
gui/common/PeerDefs.h \
|
||||||
|
gui/common/FilesDefs.h \
|
||||||
gui/common/PopularityDefs.h \
|
gui/common/PopularityDefs.h \
|
||||||
gui/common/GroupTreeWidget.h \
|
gui/common/GroupTreeWidget.h \
|
||||||
gui/common/RSTreeView.h \
|
gui/common/RSTreeView.h \
|
||||||
gui/common/AvatarWidget.h \
|
gui/common/AvatarWidget.h \
|
||||||
gui/common/FriendList.h \
|
gui/common/FriendList.h \
|
||||||
|
gui/common/HashBox.h \
|
||||||
gui/style/RSStyle.h \
|
gui/style/RSStyle.h \
|
||||||
gui/style/StyleDialog.h \
|
gui/style/StyleDialog.h \
|
||||||
gui/MessagesDialog.h \
|
gui/MessagesDialog.h \
|
||||||
|
@ -448,6 +450,7 @@ FORMS += gui/StartDialog.ui \
|
||||||
gui/common/GroupTreeWidget.ui \
|
gui/common/GroupTreeWidget.ui \
|
||||||
gui/common/AvatarWidget.ui \
|
gui/common/AvatarWidget.ui \
|
||||||
gui/common/FriendList.ui \
|
gui/common/FriendList.ui \
|
||||||
|
gui/common/HashBox.ui \
|
||||||
gui/common/RsCollectionDialog.ui \
|
gui/common/RsCollectionDialog.ui \
|
||||||
gui/style/StyleDialog.ui \
|
gui/style/StyleDialog.ui \
|
||||||
gui/dht/DhtWindow.ui \
|
gui/dht/DhtWindow.ui \
|
||||||
|
@ -549,11 +552,13 @@ SOURCES += main.cpp \
|
||||||
gui/common/RSTabWidget.cpp \
|
gui/common/RSTabWidget.cpp \
|
||||||
gui/common/RSItemDelegate.cpp \
|
gui/common/RSItemDelegate.cpp \
|
||||||
gui/common/PeerDefs.cpp \
|
gui/common/PeerDefs.cpp \
|
||||||
|
gui/common/FilesDefs.cpp \
|
||||||
gui/common/PopularityDefs.cpp \
|
gui/common/PopularityDefs.cpp \
|
||||||
gui/common/GroupTreeWidget.cpp \
|
gui/common/GroupTreeWidget.cpp \
|
||||||
gui/common/RSTreeView.cpp \
|
gui/common/RSTreeView.cpp \
|
||||||
gui/common/AvatarWidget.cpp \
|
gui/common/AvatarWidget.cpp \
|
||||||
gui/common/FriendList.cpp \
|
gui/common/FriendList.cpp \
|
||||||
|
gui/common/HashBox.cpp \
|
||||||
gui/style/RSStyle.cpp \
|
gui/style/RSStyle.cpp \
|
||||||
gui/style/StyleDialog.cpp \
|
gui/style/StyleDialog.cpp \
|
||||||
gui/settings/configpage.cpp \
|
gui/settings/configpage.cpp \
|
||||||
|
|
|
@ -42,7 +42,6 @@
|
||||||
#include "common/vmessagebox.h"
|
#include "common/vmessagebox.h"
|
||||||
#include "connect/ConfCertDialog.h"
|
#include "connect/ConfCertDialog.h"
|
||||||
#include "connect/ConnectFriendWizard.h"
|
#include "connect/ConnectFriendWizard.h"
|
||||||
#include "feeds/AttachFileItem.h"
|
|
||||||
#include "forums/CreateForum.h"
|
#include "forums/CreateForum.h"
|
||||||
#include "gui/common/AvatarDefs.h"
|
#include "gui/common/AvatarDefs.h"
|
||||||
#include "gui/mainpagestack.h"
|
#include "gui/mainpagestack.h"
|
||||||
|
@ -109,6 +108,8 @@ FriendsDialog::FriendsDialog(QWidget *parent)
|
||||||
connect(ui.colorChatButton, SIGNAL(clicked()), this, SLOT(setColor()));
|
connect(ui.colorChatButton, SIGNAL(clicked()), this, SLOT(setColor()));
|
||||||
connect(ui.actionSave_History, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
connect(ui.actionSave_History, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
||||||
|
|
||||||
|
connect(ui.hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||||
|
|
||||||
ui.fontsButton->setIcon(QIcon(QString(":/images/fonts.png")));
|
ui.fontsButton->setIcon(QIcon(QString(":/images/fonts.png")));
|
||||||
|
|
||||||
mCurrentColor = Qt::black;
|
mCurrentColor = Qt::black;
|
||||||
|
@ -157,6 +158,8 @@ FriendsDialog::FriendsDialog(QWidget *parent)
|
||||||
|
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
ui.lineEdit->setAcceptDrops(false);
|
ui.lineEdit->setAcceptDrops(false);
|
||||||
|
ui.hashBox->setDropWidget(this);
|
||||||
|
ui.hashBox->setAutoHide(true);
|
||||||
|
|
||||||
/* Set initial size the splitter */
|
/* Set initial size the splitter */
|
||||||
QList<int> sizes;
|
QList<int> sizes;
|
||||||
|
@ -704,141 +707,44 @@ void FriendsDialog::statusmessage()
|
||||||
|
|
||||||
void FriendsDialog::addExtraFile()
|
void FriendsDialog::addExtraFile()
|
||||||
{
|
{
|
||||||
QString file;
|
QStringList files;
|
||||||
if (misc::getOpenFileName(this, RshareSettings::LASTDIR_EXTRAFILE, tr("Add Extra File"), "", file)) {
|
if (misc::getOpenFileNames(this, RshareSettings::LASTDIR_EXTRAFILE, tr("Add Extra File"), "", files)) {
|
||||||
addAttachment(file.toUtf8().constData());
|
ui.hashBox->addAttachments(files);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FriendsDialog::addAttachment(std::string filePath) {
|
void FriendsDialog::fileHashingFinished(QList<HashedFile> hashedFiles)
|
||||||
/* add a AttachFileItem to the attachment section */
|
|
||||||
std::cerr << "PopupChatDialog::addExtraFile() hashing file." << std::endl;
|
|
||||||
|
|
||||||
/* add widget in for new destination */
|
|
||||||
AttachFileItem *file = new AttachFileItem(filePath);
|
|
||||||
//file->
|
|
||||||
|
|
||||||
ui.verticalLayout->addWidget(file, 1, 0);
|
|
||||||
|
|
||||||
//when the file is local or is finished hashing, call the fileHashingFinished method to send a chat message
|
|
||||||
if (file->getState() == AFI_STATE_LOCAL) {
|
|
||||||
fileHashingFinished(file);
|
|
||||||
} else {
|
|
||||||
QObject::connect(file,SIGNAL(fileFinished(AttachFileItem *)), SLOT(fileHashingFinished(AttachFileItem *))) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FriendsDialog::fileHashingFinished(AttachFileItem* file)
|
|
||||||
{
|
{
|
||||||
std::cerr << "FriendsDialog::fileHashingFinished() started." << std::endl;
|
std::cerr << "FriendsDialog::fileHashingFinished() started." << std::endl;
|
||||||
|
|
||||||
//check that the file is ok tos end
|
QString mesgString;
|
||||||
if (file->getState() == AFI_STATE_ERROR) {
|
|
||||||
#ifdef FRIENDS_DEBUG
|
QList<HashedFile>::iterator it;
|
||||||
std::cerr << "PopupChatDialog::fileHashingFinished error file is not hashed." << std::endl;
|
for (it = hashedFiles.begin(); it != hashedFiles.end(); ++it) {
|
||||||
#endif
|
HashedFile& hashedFile = *it;
|
||||||
return;
|
RetroShareLink link;
|
||||||
|
if (!link.createFile(hashedFile.filename, hashedFile.size, QString::fromStdString(hashedFile.hash))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
mesgString += link.toHtmlSize();
|
||||||
|
if (it!= hashedFiles.end()) {
|
||||||
|
mesgString += "<BR>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//convert fileSize from uint_64 to string for html link
|
|
||||||
// char fileSizeChar [100];
|
|
||||||
// sprintf(fileSizeChar, "%lld", file->FileSize());
|
|
||||||
// std::string fileSize = *(&fileSizeChar);
|
|
||||||
|
|
||||||
RetroShareLink link;
|
|
||||||
if (!link.createFile(QString::fromUtf8(file->FileName().c_str()), file->FileSize(), QString::fromStdString(file->FileHash()))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
QString mesgString = link.toHtmlSize();
|
|
||||||
|
|
||||||
// std::string mesgString = "<a href='retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "'>"
|
|
||||||
// + "retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "</a>";
|
|
||||||
#ifdef FRIENDS_DEBUG
|
#ifdef FRIENDS_DEBUG
|
||||||
std::cerr << "FriendsDialog::fileHashingFinished mesgString : " << mesgString.toStdString() << std::endl;
|
std::cerr << "FriendsDialog::fileHashingFinished mesgString : " << mesgString.toStdString() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* convert to real html document */
|
if (!mesgString.isEmpty()) {
|
||||||
QTextBrowser textBrowser;
|
/* convert to real html document */
|
||||||
textBrowser.setHtml(mesgString);
|
QTextBrowser textBrowser;
|
||||||
std::wstring msg = textBrowser.toHtml().toStdWString();
|
textBrowser.setHtml(mesgString);
|
||||||
|
std::wstring msg = textBrowser.toHtml().toStdWString();
|
||||||
|
|
||||||
rsMsgs->sendPublicChat(msg);
|
rsMsgs->sendPublicChat(msg);
|
||||||
setFont();
|
setFont();
|
||||||
}
|
|
||||||
|
|
||||||
void FriendsDialog::dropEvent(QDropEvent *event)
|
|
||||||
{
|
|
||||||
if (!(Qt::CopyAction & event->possibleActions()))
|
|
||||||
{
|
|
||||||
std::cerr << "FriendsDialog::dropEvent() Rejecting uncopyable DropAction" << std::endl;
|
|
||||||
|
|
||||||
/* can't do it */
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cerr << "FriendsDialog::dropEvent() Formats" << std::endl;
|
|
||||||
QStringList formats = event->mimeData()->formats();
|
|
||||||
QStringList::iterator it;
|
|
||||||
for(it = formats.begin(); it != formats.end(); it++)
|
|
||||||
{
|
|
||||||
std::cerr << "Format: " << (*it).toStdString() << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event->mimeData()->hasUrls())
|
|
||||||
{
|
|
||||||
std::cerr << "FriendsDialog::dropEvent() Urls:" << std::endl;
|
|
||||||
|
|
||||||
QList<QUrl> urls = event->mimeData()->urls();
|
|
||||||
QList<QUrl>::iterator uit;
|
|
||||||
for(uit = urls.begin(); uit != urls.end(); uit++)
|
|
||||||
{
|
|
||||||
QString localpath = uit->toLocalFile();
|
|
||||||
std::cerr << "Whole URL: " << uit->toString().toStdString() << std::endl;
|
|
||||||
std::cerr << "or As Local File: " << localpath.toStdString() << std::endl;
|
|
||||||
|
|
||||||
if (localpath.isEmpty() == false)
|
|
||||||
{
|
|
||||||
//Check that the file does exist and is not a directory
|
|
||||||
QDir dir(localpath);
|
|
||||||
if (dir.exists()) {
|
|
||||||
std::cerr << "FriendsDialog::dropEvent() directory not accepted."<< std::endl;
|
|
||||||
QMessageBox mb(tr("Drop file error."), tr("Directory can't be dropped, only files are accepted."),QMessageBox::Information,QMessageBox::Ok,0,0,this);
|
|
||||||
mb.exec();
|
|
||||||
} else if (QFile::exists(localpath)) {
|
|
||||||
FriendsDialog::addAttachment(localpath.toUtf8().constData());
|
|
||||||
} else {
|
|
||||||
std::cerr << "FriendsDialog::dropEvent() file does not exists."<< std::endl;
|
|
||||||
QMessageBox mb(tr("Drop file error."), tr("File not found or file name not accepted."),QMessageBox::Information,QMessageBox::Ok,0,0,this);
|
|
||||||
mb.exec();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
event->setDropAction(Qt::CopyAction);
|
|
||||||
event->accept();
|
|
||||||
}
|
|
||||||
|
|
||||||
void FriendsDialog::dragEnterEvent(QDragEnterEvent *event)
|
|
||||||
{
|
|
||||||
/* print out mimeType */
|
|
||||||
std::cerr << "FriendsDialog::dragEnterEvent() Formats" << std::endl;
|
|
||||||
QStringList formats = event->mimeData()->formats();
|
|
||||||
QStringList::iterator it;
|
|
||||||
for(it = formats.begin(); it != formats.end(); it++)
|
|
||||||
{
|
|
||||||
std::cerr << "Format: " << (*it).toStdString() << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event->mimeData()->hasUrls())
|
|
||||||
{
|
|
||||||
std::cerr << "FriendsDialog::dragEnterEvent() Accepting Urls" << std::endl;
|
|
||||||
event->acceptProposedAction();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::cerr << "FriendsDialog::dragEnterEvent() No Urls" << std::endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FriendsDialog::fileSave()
|
bool FriendsDialog::fileSave()
|
||||||
|
|
|
@ -36,7 +36,6 @@ class QAction;
|
||||||
class QTextEdit;
|
class QTextEdit;
|
||||||
class QTextCharFormat;
|
class QTextCharFormat;
|
||||||
class ChatDialog;
|
class ChatDialog;
|
||||||
class AttachFileItem;
|
|
||||||
|
|
||||||
class FriendsDialog : public RsAutoUpdatePage
|
class FriendsDialog : public RsAutoUpdatePage
|
||||||
{
|
{
|
||||||
|
@ -59,7 +58,7 @@ public slots:
|
||||||
void setChatInfo(QString info, QColor color=QApplication::palette().color(QPalette::WindowText));
|
void setChatInfo(QString info, QColor color=QApplication::palette().color(QPalette::WindowText));
|
||||||
void resetStatusBar() ;
|
void resetStatusBar() ;
|
||||||
|
|
||||||
void fileHashingFinished(AttachFileItem* file);
|
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
||||||
|
|
||||||
void smileyWidgetgroupchat();
|
void smileyWidgetgroupchat();
|
||||||
void addSmileys();
|
void addSmileys();
|
||||||
|
@ -68,8 +67,6 @@ public slots:
|
||||||
void updatePeerStatusString(const QString& peer_id,const QString& status_string,bool is_private_chat) ;
|
void updatePeerStatusString(const QString& peer_id,const QString& status_string,bool is_private_chat) ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void dragEnterEvent(QDragEnterEvent *event);
|
|
||||||
virtual void dropEvent(QDropEvent *event);
|
|
||||||
bool eventFilter(QObject *obj, QEvent *ev);
|
bool eventFilter(QObject *obj, QEvent *ev);
|
||||||
void showEvent (QShowEvent *event);
|
void showEvent (QShowEvent *event);
|
||||||
|
|
||||||
|
@ -106,7 +103,6 @@ private slots:
|
||||||
void loadmypersonalstatus();
|
void loadmypersonalstatus();
|
||||||
|
|
||||||
void addExtraFile();
|
void addExtraFile();
|
||||||
void addAttachment(std::string);
|
|
||||||
|
|
||||||
bool fileSave();
|
bool fileSave();
|
||||||
bool fileSaveAs();
|
bool fileSaveAs();
|
||||||
|
|
|
@ -1204,17 +1204,8 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QSplitter" name="splitter_2">
|
<widget class="QSplitter" name="splitter_2">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
|
@ -1293,6 +1284,19 @@ background: white;}</string>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="HashBox" name="hashBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="widgetResizable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -1431,6 +1435,12 @@ background: white;}</string>
|
||||||
<header>gui/common/AvatarWidget.h</header>
|
<header>gui/common/AvatarWidget.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>HashBox</class>
|
||||||
|
<extends>QScrollArea</extends>
|
||||||
|
<header location="global">gui/common/HashBox.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>RSTabWidget</class>
|
<class>RSTabWidget</class>
|
||||||
<extends>QTabWidget</extends>
|
<extends>QTabWidget</extends>
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <gui/RsAutoUpdatePage.h>
|
#include <gui/RsAutoUpdatePage.h>
|
||||||
#include <gui/common/RsCollectionFile.h>
|
#include <gui/common/RsCollectionFile.h>
|
||||||
#include <gui/common/RsUrlHandler.h>
|
#include <gui/common/RsUrlHandler.h>
|
||||||
|
#include <gui/common/FilesDefs.h>
|
||||||
#include "RemoteDirModel.h"
|
#include "RemoteDirModel.h"
|
||||||
#include <retroshare/rsfiles.h>
|
#include <retroshare/rsfiles.h>
|
||||||
#include <retroshare/rstypes.h>
|
#include <retroshare/rstypes.h>
|
||||||
|
@ -277,36 +278,7 @@ QVariant RetroshareDirModel::decorationRole(const DirDetails& details,int coln)
|
||||||
else if (details.type == DIR_TYPE_FILE) /* File */
|
else if (details.type == DIR_TYPE_FILE) /* File */
|
||||||
{
|
{
|
||||||
// extensions predefined
|
// extensions predefined
|
||||||
QString ext = QFileInfo(QString::fromUtf8(details.name.c_str())).suffix();
|
return FilesDefs::getIconFromFilename(QString::fromUtf8(details.name.c_str()));
|
||||||
if (ext == "jpg" || ext == "jpeg" || ext == "png" || ext == "gif"
|
|
||||||
|| ext == "bmp" || ext == "ico" || ext == "svg")
|
|
||||||
return QIcon(":/images/FileTypePicture.png");
|
|
||||||
else if (ext == "avi" || ext == "AVI" || ext == "mpg" || ext == "mpeg" || ext == "wmv" || ext == "ogm"
|
|
||||||
|| ext == "mkv" || ext == "mp4" || ext == "flv" || ext == "mov"
|
|
||||||
|| ext == "vob" || ext == "qt" || ext == "rm" || ext == "3gp")
|
|
||||||
return QIcon(":/images/FileTypeVideo.png");
|
|
||||||
else if (ext == "ogg" || ext == "mp3" || ext == "wav" || ext == "wma" || ext == "xpm")
|
|
||||||
return QIcon(":/images/FileTypeAudio.png");
|
|
||||||
else if (ext == "tar" || ext == "bz2" || ext == "zip" || ext == "gz" || ext == "7z"
|
|
||||||
|| ext == "rar" || ext == "rpm" || ext == "deb")
|
|
||||||
return QIcon(":/images/FileTypeArchive.png");
|
|
||||||
else if (ext == "app" || ext == "bat" || ext == "cgi" || ext == "com"
|
|
||||||
|| ext == "bin" || ext == "exe" || ext == "js" || ext == "pif"
|
|
||||||
|| ext == "py" || ext == "pl" || ext == "sh" || ext == "vb" || ext == "ws")
|
|
||||||
return QIcon(":/images/FileTypeProgram.png");
|
|
||||||
else if (ext == "iso" || ext == "nrg" || ext == "mdf" )
|
|
||||||
return QIcon(":/images/FileTypeCDImage.png");
|
|
||||||
else if (ext == "txt" || ext == "cpp" || ext == "c" || ext == "h")
|
|
||||||
return QIcon(":/images/FileTypeDocument.png");
|
|
||||||
else if (ext == "doc" || ext == "rtf" || ext == "sxw" || ext == "xls"
|
|
||||||
|| ext == "sxc" || ext == "odt" || ext == "ods")
|
|
||||||
return QIcon(":/images/FileTypeDocument.png");
|
|
||||||
else if (ext == "html" || ext == "htm" || ext == "php")
|
|
||||||
return QIcon(":/images/FileTypeDocument.png");
|
|
||||||
else if (ext == RsCollectionFile::ExtensionString)
|
|
||||||
return QIcon(":/images/mimetypes/rscollection-16.png");
|
|
||||||
else
|
|
||||||
return QIcon(":/images/FileTypeAny.png");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include "gui/RSHumanReadableDelegate.h"
|
#include "gui/RSHumanReadableDelegate.h"
|
||||||
#include "gui/RsAutoUpdatePage.h"
|
#include "gui/RsAutoUpdatePage.h"
|
||||||
#include "gui/common/RsCollectionFile.h"
|
#include "gui/common/RsCollectionFile.h"
|
||||||
|
#include "gui/common/FilesDefs.h"
|
||||||
#include "settings/rsharesettings.h"
|
#include "settings/rsharesettings.h"
|
||||||
#include "advsearch/advancedsearchdialog.h"
|
#include "advsearch/advancedsearchdialog.h"
|
||||||
|
|
||||||
|
@ -772,7 +773,6 @@ void SearchDialog::insertDirectory(const std::string &txt, qulonglong searchId,
|
||||||
|
|
||||||
child->setText(SR_NAME_COL, QString::fromUtf8(dir.name.c_str()));
|
child->setText(SR_NAME_COL, QString::fromUtf8(dir.name.c_str()));
|
||||||
child->setText(SR_HASH_COL, QString::fromStdString(dir.hash));
|
child->setText(SR_HASH_COL, QString::fromStdString(dir.hash));
|
||||||
QString ext = QFileInfo(QString::fromStdString(dir.name)).suffix();
|
|
||||||
child->setText(SR_SIZE_COL, QString("%1").arg(dir.count,(int)15,(int)10)); // very important for sorting
|
child->setText(SR_SIZE_COL, QString("%1").arg(dir.count,(int)15,(int)10)); // very important for sorting
|
||||||
child->setText(SR_AGE_COL, QString("%1").arg(dir.age,15,10));
|
child->setText(SR_AGE_COL, QString("%1").arg(dir.age,15,10));
|
||||||
child->setTextAlignment( SR_SIZE_COL, Qt::AlignRight );
|
child->setTextAlignment( SR_SIZE_COL, Qt::AlignRight );
|
||||||
|
@ -781,7 +781,7 @@ void SearchDialog::insertDirectory(const std::string &txt, qulonglong searchId,
|
||||||
child->setTextAlignment( SR_ID_COL, Qt::AlignRight );
|
child->setTextAlignment( SR_ID_COL, Qt::AlignRight );
|
||||||
|
|
||||||
child->setText(SR_SEARCH_ID_COL, sid_hexa);
|
child->setText(SR_SEARCH_ID_COL, sid_hexa);
|
||||||
setIconAndType(child, ext);
|
setIconAndType(child, QString::fromUtf8(dir.name.c_str()));
|
||||||
|
|
||||||
if (item == NULL) {
|
if (item == NULL) {
|
||||||
ui.searchResultWidget->addTopLevelItem(child);
|
ui.searchResultWidget->addTopLevelItem(child);
|
||||||
|
@ -1072,8 +1072,7 @@ void SearchDialog::insertFile(const std::string& txt,qulonglong searchId, const
|
||||||
item->setText(SR_NAME_COL, QString::fromUtf8(file.name.c_str()));
|
item->setText(SR_NAME_COL, QString::fromUtf8(file.name.c_str()));
|
||||||
item->setText(SR_HASH_COL, QString::fromStdString(file.hash));
|
item->setText(SR_HASH_COL, QString::fromStdString(file.hash));
|
||||||
|
|
||||||
QString ext = QFileInfo(QString::fromStdString(file.name)).suffix();
|
setIconAndType(item, QString::fromUtf8(file.name.c_str()));
|
||||||
setIconAndType(item, ext);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* to facilitate downlaods we need to save the file size too
|
* to facilitate downlaods we need to save the file size too
|
||||||
|
@ -1224,84 +1223,10 @@ void SearchDialog::selectSearchResults(int index)
|
||||||
ui.filterPatternLineEdit->clear();
|
ui.filterPatternLineEdit->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchDialog::setIconAndType(QTreeWidgetItem *item, QString ext)
|
void SearchDialog::setIconAndType(QTreeWidgetItem *item, const QString& filename)
|
||||||
{
|
{
|
||||||
ext = ext.toLower();
|
item->setIcon(SR_NAME_COL, FilesDefs::getIconFromFilename(filename));
|
||||||
if (ext == "jpg" || ext == "jpeg" || ext == "png" || ext == "gif" || ext == "bmp" || ext == "ico"
|
item->setText(SR_TYPE_COL, FilesDefs::getNameFromFilename(filename));
|
||||||
|| ext == "svg" || ext == "tif" || ext == "tiff")
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/FileTypePicture.png"));
|
|
||||||
item->setText(SR_TYPE_COL, QString::fromUtf8("Picture"));
|
|
||||||
}
|
|
||||||
else if (ext == "avi" || ext == "mpg" || ext == "mpeg" || ext == "wmv" || ext == "mkv" || ext == "mp4"
|
|
||||||
|| ext == "flv" || ext == "mov" || ext == "vob" || ext == "qt" || ext == "rm" || ext == "3gp"
|
|
||||||
|| ext == "dvx" || ext == "divx")
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/FileTypeVideo.png"));
|
|
||||||
item->setText(SR_TYPE_COL, QString::fromUtf8("Video"));
|
|
||||||
}
|
|
||||||
else if (ext == "flac" || ext == "ogg" || ext == "mp3" || ext == "m4a" || ext == "mp1" || ext == "mp2" || ext == "wav" || ext == "wma")
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/FileTypeAudio.png"));
|
|
||||||
item->setText(SR_TYPE_COL, QString::fromUtf8("Audio"));
|
|
||||||
}
|
|
||||||
else if (ext == "tar" || ext == "bz2" || ext == "zip" || ext == "tgz" || ext == "gz" || ext == "rar"
|
|
||||||
|| ext == "rpm" || ext == "7z" || ext == "ace" || ext == "jar" || ext == "cab" || ext == "deb")
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/FileTypeArchive.png"));
|
|
||||||
item->setText(SR_TYPE_COL, QString::fromUtf8("Archive"));
|
|
||||||
}
|
|
||||||
else if (ext == "app" || ext == "bat" || ext == "cgi" || ext == "com" || ext == "bin" || ext == "exe" || ext == "js"
|
|
||||||
|| ext == "msi" ||ext == "pif" || ext == "py" || ext == "pl" || ext == "sh" || ext == "vb" || ext == "ws")
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/FileTypeProgram.png"));
|
|
||||||
item->setText(SR_TYPE_COL, QString::fromUtf8("Program"));
|
|
||||||
}
|
|
||||||
else if (ext == "iso" || ext == "nrg" || ext == "mdf" || ext == "img" || ext == "dmg" || ext == "bin" || ext == "uif" )
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/FileTypeCDImage.png"));
|
|
||||||
item->setText(SR_TYPE_COL, QString::fromUtf8("CD-Image"));
|
|
||||||
}
|
|
||||||
else if (ext == "txt" || ext == "cpp" || ext == "c" || ext == "h")
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/FileTypeDocument.png"));
|
|
||||||
item->setText(SR_TYPE_COL, QString::fromUtf8("Document"));
|
|
||||||
}
|
|
||||||
else if (ext == "pdf" )
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/mimetypes/pdf.png"));
|
|
||||||
item->setText(SR_TYPE_COL, QString::fromUtf8("Document"));
|
|
||||||
}
|
|
||||||
else if (ext == "doc" || ext == "rtf" || ext == "sxw" || ext == "xls" || ext == "pps" || ext == "xml" || ext == "nfo"
|
|
||||||
|| ext == "reg" || ext == "sxc" || ext == "odt" || ext == "ods" || ext == "dot" || ext == "ppt" || ext == "css" || ext == "crt" )
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/FileTypeDocument.png"));
|
|
||||||
item->setText(SR_TYPE_COL, QString::fromUtf8("Document"));
|
|
||||||
}
|
|
||||||
else if (ext == "html" || ext == "htm" || ext == "php")
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/FileTypeDocument.png"));
|
|
||||||
item->setText(SR_TYPE_COL, QString::fromUtf8("Document"));
|
|
||||||
}
|
|
||||||
else if (ext == RsCollectionFile::ExtensionString)
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/library.png"));
|
|
||||||
item->setText(SR_TYPE_COL, QString::fromUtf8("RetroShare collection file"));
|
|
||||||
}
|
|
||||||
else if (ext == "sub" || ext == "srt")
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/FileTypeAny.png"));
|
|
||||||
item->setText(SR_TYPE_COL, QString::fromUtf8("Subtitles"));
|
|
||||||
}
|
|
||||||
else if (ext == "nds")
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/FileTypeAny.png"));
|
|
||||||
item->setText(SR_TYPE_COL, QString::fromUtf8("Nintendo DS Rom"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
item->setIcon(SR_NAME_COL, QIcon(":/images/FileTypeAny.png"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchDialog::copyResultLink()
|
void SearchDialog::copyResultLink()
|
||||||
|
|
|
@ -101,7 +101,7 @@ private:
|
||||||
void insertFile(const std::string& txt,qulonglong searchId, const FileDetail& file, int searchType = ANONYMOUS_SEARCH) ;
|
void insertFile(const std::string& txt,qulonglong searchId, const FileDetail& file, int searchType = ANONYMOUS_SEARCH) ;
|
||||||
void insertDirectory(const std::string &txt, qulonglong searchId, const DirDetails &dir, QTreeWidgetItem *item);
|
void insertDirectory(const std::string &txt, qulonglong searchId, const DirDetails &dir, QTreeWidgetItem *item);
|
||||||
void insertDirectory(const std::string &txt, qulonglong searchId, const DirDetails &dir);
|
void insertDirectory(const std::string &txt, qulonglong searchId, const DirDetails &dir);
|
||||||
void setIconAndType(QTreeWidgetItem *item, QString ext);
|
void setIconAndType(QTreeWidgetItem *item, const QString& filename);
|
||||||
void downloadDirectory(const QTreeWidgetItem *item, const QString &base);
|
void downloadDirectory(const QTreeWidgetItem *item, const QString &base);
|
||||||
void getSourceFriendsForHash(const std::string& hash,std::list<std::string>& srcIds);
|
void getSourceFriendsForHash(const std::string& hash,std::list<std::string>& srcIds);
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <gui/common/RsUrlHandler.h>
|
#include <gui/common/RsUrlHandler.h>
|
||||||
#include <gui/common/RsCollectionFile.h>
|
#include <gui/common/RsCollectionFile.h>
|
||||||
|
#include <gui/common/FilesDefs.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
@ -624,46 +625,11 @@ int TransfersDialog::addItem(const QString&, const QString& name, const QString&
|
||||||
DLListModel->setData(DLListModel->index(row, DOWNLOADTIME), QVariant((qlonglong)downloadtime));
|
DLListModel->setData(DLListModel->index(row, DOWNLOADTIME), QVariant((qlonglong)downloadtime));
|
||||||
DLListModel->setData(DLListModel->index(row, ID), QVariant((QString)coreID));
|
DLListModel->setData(DLListModel->index(row, ID), QVariant((QString)coreID));
|
||||||
|
|
||||||
QString ext = QFileInfo(name).suffix();
|
DLListModel->setData(DLListModel->index(row,NAME), FilesDefs::getIconFromFilename(name), Qt::DecorationRole);
|
||||||
DLListModel->setData(DLListModel->index(row,NAME), getIconFromExtension(ext), Qt::DecorationRole);
|
|
||||||
|
|
||||||
return row ;
|
return row ;
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon TransfersDialog::getIconFromExtension(QString ext)
|
|
||||||
{
|
|
||||||
ext = ext.toLower();
|
|
||||||
if (ext == "jpg" || ext == "jpeg" || ext == "tif" || ext == "tiff" || ext == "png" || ext == "gif" || ext == "bmp" || ext == "ico" || ext == "svg")
|
|
||||||
return QIcon(QString::fromUtf8(":/images/FileTypePicture.png")) ;
|
|
||||||
else if (ext == "avi" || ext == "mpg" || ext == "mpeg" || ext == "wmv" || ext == "divx" || ext == "ts"
|
|
||||||
|| ext == "mkv" || ext == "mp4" || ext == "flv" || ext == "mov" || ext == "asf" || ext == "xvid"
|
|
||||||
|| ext == "vob" || ext == "qt" || ext == "rm" || ext == "3gp" || ext == "ogm")
|
|
||||||
return QIcon(QString::fromUtf8(":/images/FileTypeVideo.png")) ;
|
|
||||||
else if (ext == "ogg" || ext == "mp3" || ext == "mp1" || ext == "mp2" || ext == "wav" || ext == "wma" || ext == "m4a" || ext == "flac")
|
|
||||||
return QIcon(QString::fromUtf8(":/images/FileTypeAudio.png")) ;
|
|
||||||
else if (ext == "tar" || ext == "bz2" || ext == "zip" || ext == "gz" || ext == "7z" || ext == "msi"
|
|
||||||
|| ext == "rar" || ext == "rpm" || ext == "ace" || ext == "jar" || ext == "tgz" || ext == "lha"
|
|
||||||
|| ext == "cab" || ext == "cbz"|| ext == "cbr" || ext == "alz" || ext == "sit" || ext == "arj" || ext == "deb")
|
|
||||||
return QIcon(QString::fromUtf8(":/images/FileTypeArchive.png")) ;
|
|
||||||
else if (ext == "app" || ext == "bat" || ext == "cgi" || ext == "com"
|
|
||||||
|| ext == "exe" || ext == "js" || ext == "pif"
|
|
||||||
|| ext == "py" || ext == "pl" || ext == "sh" || ext == "vb" || ext == "ws")
|
|
||||||
return QIcon(QString::fromUtf8(":/images/FileTypeProgram.png")) ;
|
|
||||||
else if (ext == "iso" || ext == "nrg" || ext == "mdf" || ext == "img" || ext == "dmg" || ext == "bin" )
|
|
||||||
return QIcon(QString::fromUtf8(":/images/FileTypeCDImage.png")) ;
|
|
||||||
else if (ext == "txt" || ext == "cpp" || ext == "c" || ext == "h")
|
|
||||||
return QIcon(QString::fromUtf8(":/images/FileTypeDocument.png")) ;
|
|
||||||
else if (ext == "doc" || ext == "rtf" || ext == "sxw" || ext == "xls" || ext == "pps" || ext == "xml"
|
|
||||||
|| ext == "sxc" || ext == "odt" || ext == "ods" || ext == "dot" || ext == "ppt" || ext == "css" )
|
|
||||||
return QIcon(QString::fromUtf8(":/images/FileTypeDocument.png")) ;
|
|
||||||
else if (ext == "html" || ext == "htm" || ext == "php")
|
|
||||||
return QIcon(QString::fromUtf8(":/images/FileTypeDocument.png")) ;
|
|
||||||
else if (ext == RsCollectionFile::ExtensionString)
|
|
||||||
return QIcon(QString::fromUtf8(":/images/mimetypes/rscollection-16.png")) ;
|
|
||||||
else
|
|
||||||
return QIcon(QString::fromUtf8(":/images/FileTypeAny.png")) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
int TransfersDialog::addPeerToItem(int row, const QString& name, const QString& coreID, double dlspeed, uint32_t status, const FileProgressInfo& peerInfo)
|
int TransfersDialog::addPeerToItem(int row, const QString& name, const QString& coreID, double dlspeed, uint32_t status, const FileProgressInfo& peerInfo)
|
||||||
{
|
{
|
||||||
QStandardItem *dlItem = DLListModel->item(row);
|
QStandardItem *dlItem = DLListModel->item(row);
|
||||||
|
@ -808,8 +774,7 @@ int TransfersDialog::addUploadItem( const QString&, const QString& name, const Q
|
||||||
ULListModel->setData(ULListModel->index(row, UHASH), QVariant((QString)coreID));
|
ULListModel->setData(ULListModel->index(row, UHASH), QVariant((QString)coreID));
|
||||||
ULListModel->setData(ULListModel->index(row, UUSERID), QVariant((QString)peer_id));
|
ULListModel->setData(ULListModel->index(row, UUSERID), QVariant((QString)peer_id));
|
||||||
|
|
||||||
QString ext = QFileInfo(name).suffix();
|
ULListModel->setData(ULListModel->index(row,UNAME), FilesDefs::getIconFromFilename(name), Qt::DecorationRole);
|
||||||
ULListModel->setData(ULListModel->index(row,UNAME), getIconFromExtension(ext), Qt::DecorationRole);
|
|
||||||
|
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,6 @@ signals:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString getPeerName(const std::string& peer_id) const ;
|
QString getPeerName(const std::string& peer_id) const ;
|
||||||
static QIcon getIconFromExtension(QString) ;
|
|
||||||
|
|
||||||
QStandardItemModel *DLListModel;
|
QStandardItemModel *DLListModel;
|
||||||
QStandardItemModel *ULListModel;
|
QStandardItemModel *ULListModel;
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QFontDialog>
|
#include <QFontDialog>
|
||||||
#include <QDir>
|
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QSound>
|
#include <QSound>
|
||||||
|
@ -40,13 +39,9 @@
|
||||||
#include "rshare.h"
|
#include "rshare.h"
|
||||||
|
|
||||||
#include <retroshare/rspeers.h>
|
#include <retroshare/rspeers.h>
|
||||||
#include <retroshare/rsmsgs.h>
|
|
||||||
#include <retroshare/rsfiles.h>
|
|
||||||
#include "retroshare/rsinit.h"
|
|
||||||
#include <retroshare/rsnotify.h>
|
#include <retroshare/rsnotify.h>
|
||||||
#include <retroshare/rsstatus.h>
|
#include <retroshare/rsstatus.h>
|
||||||
#include <retroshare/rshistory.h>
|
#include <retroshare/rshistory.h>
|
||||||
#include <retroshare/rsiface.h>
|
|
||||||
#include "gui/settings/rsharesettings.h"
|
#include "gui/settings/rsharesettings.h"
|
||||||
#include "gui/settings/RsharePeerSettings.h"
|
#include "gui/settings/RsharePeerSettings.h"
|
||||||
#include "gui/notifyqt.h"
|
#include "gui/notifyqt.h"
|
||||||
|
@ -54,11 +49,10 @@
|
||||||
#include "gui/common/StatusDefs.h"
|
#include "gui/common/StatusDefs.h"
|
||||||
#include "gui/common/AvatarDefs.h"
|
#include "gui/common/AvatarDefs.h"
|
||||||
#include "gui/common/Emoticons.h"
|
#include "gui/common/Emoticons.h"
|
||||||
#include "gui/im_history/ImHistoryBrowser.h"
|
|
||||||
|
|
||||||
#include "gui/feeds/AttachFileItem.h"
|
|
||||||
#include "gui/msgs/MessageComposer.h"
|
|
||||||
#include "gui/common/PeerDefs.h"
|
#include "gui/common/PeerDefs.h"
|
||||||
|
#include "gui/common/FilesDefs.h"
|
||||||
|
#include "gui/im_history/ImHistoryBrowser.h"
|
||||||
|
#include "gui/msgs/MessageComposer.h"
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -129,6 +123,8 @@ PopupChatDialog::PopupChatDialog(const std::string &id, const QString &name, QWi
|
||||||
connect(ui.actionSave_Chat_History, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
connect(ui.actionSave_Chat_History, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
||||||
connect(ui.actionClearOfflineMessages, SIGNAL(triggered()), this, SLOT(clearOfflineMessages()));
|
connect(ui.actionClearOfflineMessages, SIGNAL(triggered()), this, SLOT(clearOfflineMessages()));
|
||||||
|
|
||||||
|
connect(ui.hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||||
|
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&, int)), this, SLOT(updateStatus(const QString&, int)));
|
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&, int)), this, SLOT(updateStatus(const QString&, int)));
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewCustomStateString(const QString&, const QString&)), this, SLOT(updatePeersCustomStateString(const QString&, const QString&)));
|
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewCustomStateString(const QString&, const QString&)), this, SLOT(updatePeersCustomStateString(const QString&, const QString&)));
|
||||||
|
|
||||||
|
@ -155,6 +151,8 @@ PopupChatDialog::PopupChatDialog(const std::string &id, const QString &name, QWi
|
||||||
|
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
ui.chattextEdit->setAcceptDrops(false);
|
ui.chattextEdit->setAcceptDrops(false);
|
||||||
|
ui.hashBox->setDropWidget(this);
|
||||||
|
ui.hashBox->setAutoHide(true);
|
||||||
|
|
||||||
QMenu * toolmenu = new QMenu();
|
QMenu * toolmenu = new QMenu();
|
||||||
toolmenu->addAction(ui.actionClear_Chat_History);
|
toolmenu->addAction(ui.actionClear_Chat_History);
|
||||||
|
@ -806,9 +804,9 @@ void PopupChatDialog::on_actionDelete_Chat_History_triggered()
|
||||||
|
|
||||||
void PopupChatDialog::addExtraFile()
|
void PopupChatDialog::addExtraFile()
|
||||||
{
|
{
|
||||||
QString file;
|
QStringList files;
|
||||||
if (misc::getOpenFileName(this, RshareSettings::LASTDIR_EXTRAFILE, tr("Add Extra File"), "", file)) {
|
if (misc::getOpenFileNames(this, RshareSettings::LASTDIR_EXTRAFILE, tr("Add Extra File"), "", files)) {
|
||||||
addAttachment(file.toUtf8().constData(), 0);
|
ui.hashBox->addAttachments(files/*, 0*/);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -817,98 +815,38 @@ void PopupChatDialog::addExtraPicture()
|
||||||
// select a picture file
|
// select a picture file
|
||||||
QString file;
|
QString file;
|
||||||
if (misc::getOpenFileName(window(), RshareSettings::LASTDIR_IMAGES, tr("Load Picture File"), "Pictures (*.png *.xpm *.jpg)", file)) {
|
if (misc::getOpenFileName(window(), RshareSettings::LASTDIR_IMAGES, tr("Load Picture File"), "Pictures (*.png *.xpm *.jpg)", file)) {
|
||||||
addAttachment(file.toUtf8().constData(), 1);
|
ui.hashBox->addAttachments(QStringList(file), HashedFile::Picture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupChatDialog::addAttachment(std::string filePath,int flag)
|
void PopupChatDialog::fileHashingFinished(QList<HashedFile> hashedFiles)
|
||||||
{
|
{
|
||||||
/* add a AttachFileItem to the attachment section */
|
std::cerr << "PopupChatDialog::fileHashingFinished() started." << std::endl;
|
||||||
std::cerr << "PopupChatDialog::addExtraFile() hashing file.";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
/* add widget in for new destination */
|
|
||||||
AttachFileItem *file = new AttachFileItem(filePath);
|
|
||||||
//file->
|
|
||||||
|
|
||||||
if(flag==1)
|
|
||||||
file->setPicFlag(1);
|
|
||||||
|
|
||||||
ui.vboxLayout->addWidget(file, 1, 0);
|
|
||||||
|
|
||||||
//when the file is local or is finished hashing, call the fileHashingFinished method to send a chat message
|
|
||||||
if (file->getState() == AFI_STATE_LOCAL) {
|
|
||||||
fileHashingFinished(file);
|
|
||||||
} else {
|
|
||||||
QObject::connect(file,SIGNAL(fileFinished(AttachFileItem *)), SLOT(fileHashingFinished(AttachFileItem *))) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PopupChatDialog::fileHashingFinished(AttachFileItem* file)
|
|
||||||
{
|
|
||||||
std::cerr << "PopupChatDialog::fileHashingFinished() started.";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
//check that the file is ok tos end
|
|
||||||
if (file->getState() == AFI_STATE_ERROR) {
|
|
||||||
#ifdef CHAT_DEBUG
|
|
||||||
std::cerr << "PopupChatDialog::fileHashingFinished error file is not hashed.";
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string ownId;
|
|
||||||
|
|
||||||
{
|
|
||||||
rsiface->lockData(); /* Lock Interface */
|
|
||||||
const RsConfig &conf = rsiface->getConfig();
|
|
||||||
|
|
||||||
ownId = conf.ownId;
|
|
||||||
|
|
||||||
rsiface->unlockData(); /* Unlock Interface */
|
|
||||||
}
|
|
||||||
|
|
||||||
QString message;
|
QString message;
|
||||||
QString ext = QFileInfo(QString::fromStdString(file->FileName())).suffix();
|
|
||||||
|
|
||||||
if(file->getPicFlag()==1){
|
QList<HashedFile>::iterator it;
|
||||||
message+="<img src=\"file:///";
|
for (it = hashedFiles.begin(); it != hashedFiles.end(); ++it) {
|
||||||
message+=file->FilePath().c_str();
|
HashedFile& hashedFile = *it;
|
||||||
message+="\" width=\"100\" height=\"100\">";
|
QString ext = QFileInfo(hashedFile.filename).suffix();
|
||||||
message+="<br>";
|
|
||||||
}
|
|
||||||
else if (ext == "ogg" || ext == "mp3" || ext == "MP3" || ext == "mp1" || ext == "mp2" || ext == "wav" || ext == "wma")
|
|
||||||
{
|
|
||||||
message+="<img src=\":/images/audio-x-monkey.png";
|
|
||||||
message+="\" width=\"48\" height=\"48\">";
|
|
||||||
message+="<br>";
|
|
||||||
}
|
|
||||||
else if (ext == "avi" || ext == "AVI" || ext == "mpg" || ext == "mpeg" || ext == "wmv" || ext == "ogm"
|
|
||||||
|| ext == "mkv" || ext == "mp4" || ext == "flv" || ext == "mov"
|
|
||||||
|| ext == "vob" || ext == "qt" || ext == "rm" || ext == "3gp")
|
|
||||||
{
|
|
||||||
message+="<img src=\":/images/video-x-generic.png";
|
|
||||||
message+="\" width=\"48\" height=\"48\">";
|
|
||||||
message+="<br>";
|
|
||||||
}
|
|
||||||
else if (ext == "tar" || ext == "bz2" || ext == "zip" || ext == "gz" || ext == "7z"
|
|
||||||
|| ext == "rar" || ext == "rpm" || ext == "deb")
|
|
||||||
{
|
|
||||||
message+="<img src=\":/images/application-x-rar.png";
|
|
||||||
message+="\" width=\"48\" height=\"48\">";
|
|
||||||
message+="<br>";
|
|
||||||
}
|
|
||||||
else if (ext == "jpg" || ext == "jpeg" || ext == "png" || ext == "gif" || ext == "bmp" || ext == "ico"
|
|
||||||
|| ext == "svg" || ext == "tif" || ext == "tiff" || ext == "JPG")
|
|
||||||
{
|
|
||||||
message+="<img src=\":/images/application-draw.png";
|
|
||||||
message+="\" width=\"48\" height=\"48\">";
|
|
||||||
message+="<br>";
|
|
||||||
}
|
|
||||||
|
|
||||||
RetroShareLink link;
|
RetroShareLink link;
|
||||||
link.createFile(QString::fromUtf8(file->FileName().c_str()),file->FileSize(),QString::fromStdString(file->FileHash()));
|
link.createFile(hashedFile.filename, hashedFile.size, QString::fromStdString(hashedFile.hash));
|
||||||
message += link.toHtmlSize();
|
|
||||||
|
if (hashedFile.flag & HashedFile::Picture) {
|
||||||
|
message += QString("<img src=\"file:///%1\" width=\"100\" height=\"100\">").arg(hashedFile.filepath);
|
||||||
|
message+="<br>";
|
||||||
|
} else {
|
||||||
|
QString image = FilesDefs::getImageFromFilename(hashedFile.filename, false);
|
||||||
|
if (!image.isEmpty()) {
|
||||||
|
message += QString("<img src=\"%1\">").arg(image);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
message += link.toHtmlSize();
|
||||||
|
if (it != hashedFiles.end()) {
|
||||||
|
message += "<BR>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CHAT_DEBUG
|
#ifdef CHAT_DEBUG
|
||||||
std::cerr << "PopupChatDialog::fileHashingFinished message : " << message.toStdString() << std::endl;
|
std::cerr << "PopupChatDialog::fileHashingFinished message : " << message.toStdString() << std::endl;
|
||||||
|
@ -920,94 +858,12 @@ void PopupChatDialog::fileHashingFinished(AttachFileItem* file)
|
||||||
std::wstring msg = textBrowser.toHtml().toStdWString();
|
std::wstring msg = textBrowser.toHtml().toStdWString();
|
||||||
|
|
||||||
if (rsMsgs->sendPrivateChat(dialogId, msg)) {
|
if (rsMsgs->sendPrivateChat(dialogId, msg)) {
|
||||||
|
std::string ownId = rsPeers->getOwnId();
|
||||||
QDateTime currentTime = QDateTime::currentDateTime();
|
QDateTime currentTime = QDateTime::currentDateTime();
|
||||||
addChatMsg(false, QString::fromUtf8(rsPeers->getPeerName(ownId).c_str()), currentTime, currentTime, QString::fromStdWString(msg), TYPE_NORMAL);
|
addChatMsg(false, QString::fromUtf8(rsPeers->getPeerName(ownId).c_str()), currentTime, currentTime, QString::fromStdWString(msg), TYPE_NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupChatDialog::dropEvent(QDropEvent *event)
|
|
||||||
{
|
|
||||||
if (!(Qt::CopyAction & event->possibleActions()))
|
|
||||||
{
|
|
||||||
std::cerr << "PopupChatDialog::dropEvent() Rejecting uncopyable DropAction";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
/* can't do it */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cerr << "PopupChatDialog::dropEvent() Formats";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
QStringList formats = event->mimeData()->formats();
|
|
||||||
QStringList::iterator it;
|
|
||||||
for(it = formats.begin(); it != formats.end(); it++)
|
|
||||||
{
|
|
||||||
std::cerr << "Format: " << (*it).toStdString();
|
|
||||||
std::cerr << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event->mimeData()->hasUrls())
|
|
||||||
{
|
|
||||||
std::cerr << "PopupChatDialog::dropEvent() Urls:";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
QList<QUrl> urls = event->mimeData()->urls();
|
|
||||||
QList<QUrl>::iterator uit;
|
|
||||||
for(uit = urls.begin(); uit != urls.end(); uit++)
|
|
||||||
{
|
|
||||||
QString localpath = uit->toLocalFile();
|
|
||||||
std::cerr << "Whole URL: " << uit->toString().toStdString() << std::endl;
|
|
||||||
std::cerr << "or As Local File: " << localpath.toStdString() << std::endl;
|
|
||||||
|
|
||||||
if (localpath.isEmpty() == false)
|
|
||||||
{
|
|
||||||
//Check that the file does exist and is not a directory
|
|
||||||
QDir dir(localpath);
|
|
||||||
if (dir.exists()) {
|
|
||||||
std::cerr << "PopupChatDialog::dropEvent() directory not accepted."<< std::endl;
|
|
||||||
QMessageBox mb(tr("Drop file error."), tr("Directory can't be dropped, only files are accepted."),QMessageBox::Information,QMessageBox::Ok,0,0,this);
|
|
||||||
mb.exec();
|
|
||||||
} else if (QFile::exists(localpath)) {
|
|
||||||
PopupChatDialog::addAttachment(localpath.toUtf8().constData(), false);
|
|
||||||
} else {
|
|
||||||
std::cerr << "PopupChatDialog::dropEvent() file does not exists."<< std::endl;
|
|
||||||
QMessageBox mb(tr("Drop file error."), tr("File not found or file name not accepted."),QMessageBox::Information,QMessageBox::Ok,0,0,this);
|
|
||||||
mb.exec();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
event->setDropAction(Qt::CopyAction);
|
|
||||||
event->accept();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PopupChatDialog::dragEnterEvent(QDragEnterEvent *event)
|
|
||||||
{
|
|
||||||
/* print out mimeType */
|
|
||||||
std::cerr << "PopupChatDialog::dragEnterEvent() Formats";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
QStringList formats = event->mimeData()->formats();
|
|
||||||
QStringList::iterator it;
|
|
||||||
for(it = formats.begin(); it != formats.end(); it++)
|
|
||||||
{
|
|
||||||
std::cerr << "Format: " << (*it).toStdString();
|
|
||||||
std::cerr << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event->mimeData()->hasUrls())
|
|
||||||
{
|
|
||||||
std::cerr << "PopupChatDialog::dragEnterEvent() Accepting Urls";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
event->acceptProposedAction();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::cerr << "PopupChatDialog::dragEnterEvent() No Urls";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PopupChatDialog::fileSave()
|
bool PopupChatDialog::fileSave()
|
||||||
{
|
{
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
class QAction;
|
class QAction;
|
||||||
class QTextEdit;
|
class QTextEdit;
|
||||||
class QTextCharFormat;
|
class QTextCharFormat;
|
||||||
class AttachFileItem;
|
|
||||||
class ChatInfo;
|
class ChatInfo;
|
||||||
|
|
||||||
#include <retroshare/rsmsgs.h>
|
#include <retroshare/rsmsgs.h>
|
||||||
|
@ -70,8 +69,6 @@ protected:
|
||||||
~PopupChatDialog();
|
~PopupChatDialog();
|
||||||
|
|
||||||
virtual void resizeEvent(QResizeEvent *event);
|
virtual void resizeEvent(QResizeEvent *event);
|
||||||
virtual void dragEnterEvent(QDragEnterEvent *event);
|
|
||||||
virtual void dropEvent(QDropEvent *event);
|
|
||||||
|
|
||||||
bool eventFilter(QObject *obj, QEvent *ev);
|
bool eventFilter(QObject *obj, QEvent *ev);
|
||||||
|
|
||||||
|
@ -82,7 +79,7 @@ private slots:
|
||||||
void pasteLink() ;
|
void pasteLink() ;
|
||||||
void contextMenu(QPoint) ;
|
void contextMenu(QPoint) ;
|
||||||
|
|
||||||
void fileHashingFinished(AttachFileItem* file);
|
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
||||||
|
|
||||||
void smileyWidget();
|
void smileyWidget();
|
||||||
void addSmiley();
|
void addSmiley();
|
||||||
|
@ -116,7 +113,6 @@ private:
|
||||||
|
|
||||||
void colorChanged(const QColor &c);
|
void colorChanged(const QColor &c);
|
||||||
void fontChanged(const QFont &font);
|
void fontChanged(const QFont &font);
|
||||||
void addAttachment(std::string,int flag);
|
|
||||||
void processSettings(bool bLoad);
|
void processSettings(bool bLoad);
|
||||||
|
|
||||||
void onPrivateChatChanged(int list, int type);
|
void onPrivateChatChanged(int list, int type);
|
||||||
|
|
|
@ -25,19 +25,22 @@
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<property name="horizontalSpacing">
|
<property name="horizontalSpacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="verticalSpacing">
|
<property name="verticalSpacing">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<item row="0" column="0" rowspan="7">
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0" rowspan="6">
|
|
||||||
<widget class="QFrame" name="leftsideframe">
|
<widget class="QFrame" name="leftsideframe">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
@ -108,7 +111,7 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1" rowspan="6">
|
<item row="0" column="1" rowspan="7">
|
||||||
<widget class="QFrame" name="avatarframe">
|
<widget class="QFrame" name="avatarframe">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
|
@ -711,9 +714,6 @@ border: 1px solid #CCCCCC;
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0" colspan="3">
|
|
||||||
<layout class="QVBoxLayout" name="vboxLayout"/>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="2">
|
<item row="4" column="2">
|
||||||
<widget class="QSplitter" name="chatsplitter">
|
<widget class="QSplitter" name="chatsplitter">
|
||||||
<property name="lineWidth">
|
<property name="lineWidth">
|
||||||
|
@ -725,6 +725,9 @@ border: 1px solid #CCCCCC;
|
||||||
<property name="handleWidth">
|
<property name="handleWidth">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="childrenCollapsible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<widget class="QWidget" name="verticalLayoutWidget">
|
<widget class="QWidget" name="verticalLayoutWidget">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
|
@ -738,7 +741,7 @@ border: 1px solid #CCCCCC;
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
<height>100</height>
|
<height>30</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
|
@ -831,6 +834,13 @@ background: white;}</string>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="6" column="2">
|
||||||
|
<widget class="HashBox" name="hashBox">
|
||||||
|
<property name="widgetResizable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -912,6 +922,12 @@ background: white;}</string>
|
||||||
<header>gui/common/AvatarWidget.h</header>
|
<header>gui/common/AvatarWidget.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>HashBox</class>
|
||||||
|
<extends>QScrollArea</extends>
|
||||||
|
<header location="global">gui/common/HashBox.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../images.qrc"/>
|
<include location="../images.qrc"/>
|
||||||
|
|
|
@ -162,7 +162,7 @@ void PopupChatWindow::addDialog(PopupChatDialog *dialog)
|
||||||
ui.tabWidget->addTab(dialog, dialog->getTitle());
|
ui.tabWidget->addTab(dialog, dialog->getTitle());
|
||||||
} else {
|
} else {
|
||||||
ui.horizontalLayout->addWidget(dialog);
|
ui.horizontalLayout->addWidget(dialog);
|
||||||
ui.horizontalLayout->setContentsMargins(0, 0, 5, 0);
|
ui.horizontalLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
peerId = dialog->getPeerId();
|
peerId = dialog->getPeerId();
|
||||||
chatDialog = dialog;
|
chatDialog = dialog;
|
||||||
calculateStyle(dialog);
|
calculateStyle(dialog);
|
||||||
|
|
85
retroshare-gui/src/gui/common/FilesDefs.cpp
Normal file
85
retroshare-gui/src/gui/common/FilesDefs.cpp
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
/****************************************************************
|
||||||
|
* This file is distributed under the following license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2011, RetroShare Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
****************************************************************/
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QFileInfo>
|
||||||
|
|
||||||
|
#include "FilesDefs.h"
|
||||||
|
#include "RsCollectionFile.h"
|
||||||
|
|
||||||
|
static QString getInfoFromFilename(const QString& filename, bool anyForUnknown, bool image)
|
||||||
|
{
|
||||||
|
QString ext = QFileInfo(filename).suffix().toLower();
|
||||||
|
|
||||||
|
if (ext == "jpg" || ext == "jpeg" || ext == "tif" || ext == "tiff" || ext == "png" || ext == "gif" || ext == "bmp" || ext == "ico" || ext == "svg") {
|
||||||
|
return image ? ":/images/FileTypePicture.png" : QApplication::translate("FilesDefs", "Picture");
|
||||||
|
} else if (ext == "avi" || ext == "mpg" || ext == "mpeg" || ext == "wmv" || ext == "divx" || ext == "ts" ||
|
||||||
|
ext == "mkv" || ext == "mp4" || ext == "flv" || ext == "mov" || ext == "asf" || ext == "xvid" ||
|
||||||
|
ext == "vob" || ext == "qt" || ext == "rm" || ext == "3gp" || ext == "ogm") {
|
||||||
|
return image ? ":/images/FileTypeVideo.png" : QApplication::translate("FilesDefs", "Video");
|
||||||
|
} else if (ext == "ogg" || ext == "mp3" || ext == "mp1" || ext == "mp2" || ext == "wav" || ext == "wma" || ext == "m4a" || ext == "flac" ||ext == "xpm") {
|
||||||
|
return image ? ":/images/FileTypeAudio.png" : QApplication::translate("FilesDefs", "Audio");
|
||||||
|
} else if (ext == "tar" || ext == "bz2" || ext == "zip" || ext == "gz" || ext == "7z" || ext == "msi" ||
|
||||||
|
ext == "rar" || ext == "rpm" || ext == "ace" || ext == "jar" || ext == "tgz" || ext == "lha" ||
|
||||||
|
ext == "cab" || ext == "cbz"|| ext == "cbr" || ext == "alz" || ext == "sit" || ext == "arj" || ext == "deb") {
|
||||||
|
return image ? ":/images/FileTypeArchive.png" : QApplication::translate("FilesDefs", "Archive");
|
||||||
|
} else if (ext == "app" || ext == "bat" || ext == "cgi" || ext == "com" ||
|
||||||
|
ext == "exe" || ext == "js" || ext == "pif" ||
|
||||||
|
ext == "py" || ext == "pl" || ext == "sh" || ext == "vb" || ext == "ws") {
|
||||||
|
return image ? ":/images/FileTypeProgram.png" : QApplication::translate("FilesDefs", "Program");
|
||||||
|
} else if (ext == "iso" || ext == "nrg" || ext == "mdf" || ext == "img" || ext == "dmg" || ext == "bin" || ext == "uif") {
|
||||||
|
return image ? ":/images/FileTypeCDImage.png" : QApplication::translate("FilesDefs", "CD/DVD-Image");
|
||||||
|
} else if (ext == "txt" || ext == "cpp" || ext == "c" || ext == "h" || ext == "ui" ||
|
||||||
|
ext == "doc" || ext == "rtf" || ext == "sxw" || ext == "xls" || ext == "pps" || ext == "xml" || ext == "nfo" ||
|
||||||
|
ext == "reg" || ext == "sxc" || ext == "odt" || ext == "ods" || ext == "dot" || ext == "ppt" || ext == "css" || ext == "crt" ||
|
||||||
|
ext == "html" || ext == "htm" || ext == "php") {
|
||||||
|
return image ? ":/images/FileTypeDocument.png" : QApplication::translate("FilesDefs", "Document");
|
||||||
|
} else if (ext == "pdf") {
|
||||||
|
return image ? ":/images/mimetypes/pdf.png" : QApplication::translate("FilesDefs", "Document");
|
||||||
|
} else if (ext == RsCollectionFile::ExtensionString) {
|
||||||
|
return image ? ":/images/mimetypes/rscollection-16.png" : QApplication::translate("FilesDefs", "RetroShare collection file");
|
||||||
|
} else if (ext == "sub" || ext == "srt") {
|
||||||
|
return image ? ":/images/FileTypeAny.png" : QApplication::translate("FilesDefs", "Subtitles");
|
||||||
|
} else if (ext == "nds") {
|
||||||
|
return image ? ":/images/FileTypeAny.png" : QApplication::translate("FilesDefs", "Nintendo DS Rom");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (anyForUnknown) {
|
||||||
|
return image ? ":/images/FileTypeAny.png" : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
QString FilesDefs::getImageFromFilename(const QString& filename, bool anyForUnknown)
|
||||||
|
{
|
||||||
|
return getInfoFromFilename(filename, anyForUnknown, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
QIcon FilesDefs::getIconFromFilename(const QString& filename)
|
||||||
|
{
|
||||||
|
return QIcon(getInfoFromFilename(filename, true, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
QString FilesDefs::getNameFromFilename(const QString &filename)
|
||||||
|
{
|
||||||
|
return getInfoFromFilename(filename, false, false);
|
||||||
|
}
|
37
retroshare-gui/src/gui/common/FilesDefs.h
Normal file
37
retroshare-gui/src/gui/common/FilesDefs.h
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
/****************************************************************
|
||||||
|
* This file is distributed under the following license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2011, RetroShare Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
****************************************************************/
|
||||||
|
|
||||||
|
#ifndef _FILESDEFS_H
|
||||||
|
#define _FILESDEFS_H
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QIcon>
|
||||||
|
|
||||||
|
class FilesDefs
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static QString getImageFromFilename(const QString& filename, bool anyForUnknown);
|
||||||
|
static QIcon getIconFromFilename(const QString& filename);
|
||||||
|
static QString getNameFromFilename(const QString& filename);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
259
retroshare-gui/src/gui/common/HashBox.cpp
Normal file
259
retroshare-gui/src/gui/common/HashBox.cpp
Normal file
|
@ -0,0 +1,259 @@
|
||||||
|
/****************************************************************
|
||||||
|
* This file is distributed under the following license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2011, RetroShare Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
****************************************************************/
|
||||||
|
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QDragEnterEvent>
|
||||||
|
#include <QDropEvent>
|
||||||
|
#include <QUrl>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "gui/feeds/AttachFileItem.h"
|
||||||
|
|
||||||
|
#include "HashBox.h"
|
||||||
|
#include "ui_HashBox.h"
|
||||||
|
|
||||||
|
HashedFile::HashedFile()
|
||||||
|
{
|
||||||
|
size = 0;
|
||||||
|
flag = NoFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
HashBox::HashBox(QWidget *parent) :
|
||||||
|
QScrollArea(parent),
|
||||||
|
ui(new Ui::HashBox)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
mAutoHide = false;
|
||||||
|
dropWidget = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
HashBox::~HashBox()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void HashBox::setAutoHide(bool autoHide)
|
||||||
|
{
|
||||||
|
mAutoHide = autoHide;
|
||||||
|
setVisible(!mAutoHide);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HashBox::setDropWidget(QWidget* widget)
|
||||||
|
{
|
||||||
|
if (dropWidget) {
|
||||||
|
dropWidget->removeEventFilter(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
dropWidget = widget;
|
||||||
|
|
||||||
|
if (dropWidget) {
|
||||||
|
widget->installEventFilter(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void showFormats(const std::string& event, const QStringList& formats)
|
||||||
|
{
|
||||||
|
std::cerr << event << "() Formats" << std::endl;
|
||||||
|
QStringList::const_iterator it;
|
||||||
|
for (it = formats.begin(); it != formats.end(); ++it) {
|
||||||
|
std::cerr << "Format: " << (*it).toStdString();
|
||||||
|
std::cerr << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool HashBox::eventFilter(QObject* object, QEvent* event)
|
||||||
|
{
|
||||||
|
if (object == dropWidget) {
|
||||||
|
if (event->type() == QEvent::DragEnter) {
|
||||||
|
QDragEnterEvent* dragEnterEvent = static_cast<QDragEnterEvent*>(event);
|
||||||
|
if (dragEnterEvent) {
|
||||||
|
/* print out mimeType */
|
||||||
|
showFormats("HashBox::dragEnterEvent", dragEnterEvent->mimeData()->formats());
|
||||||
|
|
||||||
|
if (dragEnterEvent->mimeData()->hasUrls()) {
|
||||||
|
std::cerr << "HashBox::dragEnterEvent() Accepting Urls" << std::endl;
|
||||||
|
dragEnterEvent->acceptProposedAction();
|
||||||
|
} else {
|
||||||
|
std::cerr << "HashBox::dragEnterEvent() No Urls" << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (event->type() == QEvent::Drop) {
|
||||||
|
QDropEvent* dropEvent = static_cast<QDropEvent*>(event);
|
||||||
|
if (dropEvent) {
|
||||||
|
if (Qt::CopyAction & dropEvent->possibleActions()) {
|
||||||
|
/* print out mimeType */
|
||||||
|
showFormats("HashBox::dropEvent", dropEvent->mimeData()->formats());
|
||||||
|
|
||||||
|
QStringList files;
|
||||||
|
|
||||||
|
if (dropEvent->mimeData()->hasUrls()) {
|
||||||
|
std::cerr << "HashBox::dropEvent() Urls:" << std::endl;
|
||||||
|
|
||||||
|
QList<QUrl> urls = dropEvent->mimeData()->urls();
|
||||||
|
QList<QUrl>::iterator uit;
|
||||||
|
for (uit = urls.begin(); uit != urls.end(); ++uit) {
|
||||||
|
QString localpath = uit->toLocalFile();
|
||||||
|
std::cerr << "Whole URL: " << uit->toString().toStdString() << std::endl;
|
||||||
|
std::cerr << "or As Local File: " << localpath.toStdString() << std::endl;
|
||||||
|
|
||||||
|
if (localpath.isEmpty() == false) {
|
||||||
|
//Check that the file does exist and is not a directory
|
||||||
|
QDir dir(localpath);
|
||||||
|
if (dir.exists()) {
|
||||||
|
std::cerr << "HashBox::dropEvent() directory not accepted." << std::endl;
|
||||||
|
QMessageBox mb(tr("Drop file error."), tr("Directory can't be dropped, only files are accepted."), QMessageBox::Information, QMessageBox::Ok, 0, 0, this);
|
||||||
|
mb.exec();
|
||||||
|
} else if (QFile::exists(localpath)) {
|
||||||
|
files.push_back(localpath);
|
||||||
|
} else {
|
||||||
|
std::cerr << "HashBox::dropEvent() file does not exists."<< std::endl;
|
||||||
|
QMessageBox mb(tr("Drop file error."), tr("File not found or file name not accepted."), QMessageBox::Information, QMessageBox::Ok, 0, 0, this);
|
||||||
|
mb.exec();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addAttachments(files);
|
||||||
|
|
||||||
|
dropEvent->setDropAction(Qt::CopyAction);
|
||||||
|
dropEvent->accept();
|
||||||
|
} else {
|
||||||
|
std::cerr << "HashBox::dropEvent() Rejecting uncopyable DropAction" << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// pass the event on to the parent class
|
||||||
|
return QScrollArea::eventFilter(object, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HashBox::addAttachments(const QStringList& files, HashedFile::Flags flag)
|
||||||
|
{
|
||||||
|
/* add a AttachFileItem to the attachment section */
|
||||||
|
std::cerr << "PopupChatDialog::addExtraFile() hashing file." << std::endl;
|
||||||
|
|
||||||
|
if (files.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mAutoHide) {
|
||||||
|
show();
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList::ConstIterator it;
|
||||||
|
for (it = files.constBegin(); it != files.constEnd(); ++it) {
|
||||||
|
/* add widget in for new destination */
|
||||||
|
AttachFileItem* file = new AttachFileItem(*it);
|
||||||
|
QObject::connect(file, SIGNAL(fileFinished(AttachFileItem*)), this, SLOT(fileFinished(AttachFileItem*)));
|
||||||
|
|
||||||
|
HashingInfo hashingInfo;
|
||||||
|
hashingInfo.item = file;
|
||||||
|
hashingInfo.flag = flag;
|
||||||
|
mHashingInfos.push_back(hashingInfo);
|
||||||
|
ui->verticalLayout->addWidget(file, 1, 0);
|
||||||
|
}
|
||||||
|
QApplication::processEvents();
|
||||||
|
|
||||||
|
// workaround for Qt bug, the size from the first call to QScrollArea::sizeHint() is stored in QWidgetItemV2 and
|
||||||
|
// QScrollArea::sizeHint() is never called again so that widgetResizable of QScrollArea doesn't work
|
||||||
|
// the next line clears the member QScrollArea::widgetSize for recalculation of the added children in QScrollArea::sizeHint()
|
||||||
|
setWidget(takeWidget());
|
||||||
|
// the next line set the cache to dirty
|
||||||
|
updateGeometry();
|
||||||
|
|
||||||
|
emit fileHashingStarted();
|
||||||
|
|
||||||
|
checkAttachmentReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
void HashBox::fileFinished(AttachFileItem* file)
|
||||||
|
{
|
||||||
|
std::cerr << "HashBox::fileHashingFinished() started." << std::endl;
|
||||||
|
|
||||||
|
//check that the file is ok
|
||||||
|
if (file->getState() == AFI_STATE_ERROR) {
|
||||||
|
std::cerr << "HashBox::fileHashingFinished error file is not hashed.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkAttachmentReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
void HashBox::checkAttachmentReady()
|
||||||
|
{
|
||||||
|
if (mHashingInfos.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<HashingInfo>::iterator it;
|
||||||
|
for (it = mHashingInfos.begin(); it != mHashingInfos.end(); ++it) {
|
||||||
|
if (it->item->isHidden()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!it->item->done()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (it != mHashingInfos.end()) {
|
||||||
|
/* repeat... */
|
||||||
|
QTimer::singleShot(500, this, SLOT(checkAttachmentReady()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mAutoHide) {
|
||||||
|
hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<HashedFile> hashedFiles;
|
||||||
|
for (it = mHashingInfos.begin(); it != mHashingInfos.end(); ++it) {
|
||||||
|
HashingInfo& hashingInfo = *it;
|
||||||
|
if (hashingInfo.item->done()) {
|
||||||
|
HashedFile hashedFile;
|
||||||
|
hashedFile.filename = hashingInfo.item->FileName();
|
||||||
|
hashedFile.filepath = hashingInfo.item->FilePath();
|
||||||
|
hashedFile.hash = hashingInfo.item->FileHash();
|
||||||
|
hashedFile.size = hashingInfo.item->FileSize();
|
||||||
|
hashedFile.flag = hashingInfo.flag;
|
||||||
|
hashedFiles.push_back(hashedFile);
|
||||||
|
|
||||||
|
ui->verticalLayout->removeWidget(hashingInfo.item);
|
||||||
|
hashingInfo.item->deleteLater();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mHashingInfos.clear();
|
||||||
|
|
||||||
|
QApplication::processEvents();
|
||||||
|
|
||||||
|
// workaround for Qt bug, the size from the first call to QScrollArea::sizeHint() is stored in QWidgetItemV2 and
|
||||||
|
// QScrollArea::sizeHint() is never called again so that widgetResizable of QScrollArea doesn't work
|
||||||
|
// the next line clears the member QScrollArea::widgetSize for recalculation of the removed children in QScrollArea::sizeHint()
|
||||||
|
setWidget(takeWidget());
|
||||||
|
// the next line set the cache to dirty
|
||||||
|
updateGeometry();
|
||||||
|
|
||||||
|
emit fileHashingFinished(hashedFiles);
|
||||||
|
}
|
91
retroshare-gui/src/gui/common/HashBox.h
Normal file
91
retroshare-gui/src/gui/common/HashBox.h
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
/****************************************************************
|
||||||
|
* This file is distributed under the following license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2011, RetroShare Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
****************************************************************/
|
||||||
|
|
||||||
|
#ifndef HASHBOX_H
|
||||||
|
#define HASHBOX_H
|
||||||
|
|
||||||
|
#include <QScrollArea>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class HashBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
class AttachFileItem;
|
||||||
|
class QVBoxLayout;
|
||||||
|
|
||||||
|
class HashedFile
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum Flags {
|
||||||
|
NoFlag = 0,
|
||||||
|
Picture = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
public:
|
||||||
|
QString filename;
|
||||||
|
QString filepath;
|
||||||
|
uint64_t size;
|
||||||
|
std::string hash;
|
||||||
|
Flags flag;
|
||||||
|
|
||||||
|
public:
|
||||||
|
HashedFile();
|
||||||
|
};
|
||||||
|
|
||||||
|
class HashBox : public QScrollArea
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit HashBox(QWidget *parent = 0);
|
||||||
|
~HashBox();
|
||||||
|
|
||||||
|
void setAutoHide(bool autoHide);
|
||||||
|
void addAttachments(const QStringList& files, HashedFile::Flags flag = HashedFile::NoFlag);
|
||||||
|
|
||||||
|
void setDropWidget(QWidget* widget);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool eventFilter(QObject *object, QEvent *event);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void fileFinished(AttachFileItem* file);
|
||||||
|
void checkAttachmentReady();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void fileHashingStarted();
|
||||||
|
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
||||||
|
|
||||||
|
private:
|
||||||
|
class HashingInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
AttachFileItem* item;
|
||||||
|
HashedFile::Flags flag;
|
||||||
|
};
|
||||||
|
|
||||||
|
QList<HashingInfo> mHashingInfos;
|
||||||
|
bool mAutoHide;
|
||||||
|
QWidget* dropWidget;
|
||||||
|
Ui::HashBox *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // HASHBOX_H
|
33
retroshare-gui/src/gui/common/HashBox.ui
Normal file
33
retroshare-gui/src/gui/common/HashBox.ui
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>HashBox</class>
|
||||||
|
<widget class="QScrollArea" name="HashBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>35</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="widgetResizable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -61,8 +61,7 @@
|
||||||
const uint32_t AFI_DEFAULT_PERIOD = (30 * 3600 * 24); /* 30 Days */
|
const uint32_t AFI_DEFAULT_PERIOD = (30 * 3600 * 24); /* 30 Days */
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
AttachFileItem::AttachFileItem(std::string hash, std::string name, uint64_t size,
|
AttachFileItem::AttachFileItem(const std::string& hash, const QString& name, uint64_t size, uint32_t flags, const std::string& srcId)
|
||||||
uint32_t flags, std::string srcId)
|
|
||||||
:QWidget(NULL), mFileHash(hash), mFileName(name), mFileSize(size), mSrcId(srcId)
|
:QWidget(NULL), mFileHash(hash), mFileName(name), mFileSize(size), mSrcId(srcId)
|
||||||
{
|
{
|
||||||
/* Invoke the Qt Designer generated object setup routine */
|
/* Invoke the Qt Designer generated object setup routine */
|
||||||
|
@ -72,7 +71,6 @@ AttachFileItem::AttachFileItem(std::string hash, std::string name, uint64_t size
|
||||||
|
|
||||||
mMode = flags & AFI_MASK_STATE;
|
mMode = flags & AFI_MASK_STATE;
|
||||||
mType = flags & AFI_MASK_TYPE;
|
mType = flags & AFI_MASK_TYPE;
|
||||||
mPicFlag=0;
|
|
||||||
|
|
||||||
if (mMode == AFI_STATE_EXTRA)
|
if (mMode == AFI_STATE_EXTRA)
|
||||||
{
|
{
|
||||||
|
@ -92,7 +90,7 @@ AttachFileItem::AttachFileItem(std::string hash, std::string name, uint64_t size
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
AttachFileItem::AttachFileItem(std::string path)
|
AttachFileItem::AttachFileItem(const QString& path)
|
||||||
:QWidget(NULL), mPath(path), mFileSize(0)
|
:QWidget(NULL), mPath(path), mFileSize(0)
|
||||||
{
|
{
|
||||||
/* Invoke the Qt Designer generated object setup routine */
|
/* Invoke the Qt Designer generated object setup routine */
|
||||||
|
@ -100,10 +98,9 @@ AttachFileItem::AttachFileItem(std::string path)
|
||||||
|
|
||||||
mMode = AFI_STATE_EXTRA;
|
mMode = AFI_STATE_EXTRA;
|
||||||
mType = AFI_TYPE_ATTACH;
|
mType = AFI_TYPE_ATTACH;
|
||||||
mPicFlag=0;
|
|
||||||
|
|
||||||
/* ask for Files to hash/prepare it for us */
|
/* ask for Files to hash/prepare it for us */
|
||||||
if ((!rsFiles) || (!rsFiles->ExtraFileHash(path, AFI_DEFAULT_PERIOD, 0)))
|
if ((!rsFiles) || (!rsFiles->ExtraFileHash(path.toUtf8().constData(), AFI_DEFAULT_PERIOD, 0)))
|
||||||
{
|
{
|
||||||
mMode = AFI_STATE_ERROR;
|
mMode = AFI_STATE_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -113,7 +110,6 @@ AttachFileItem::AttachFileItem(std::string path)
|
||||||
|
|
||||||
void AttachFileItem::Setup()
|
void AttachFileItem::Setup()
|
||||||
{
|
{
|
||||||
|
|
||||||
connect( cancelButton, SIGNAL( clicked( void ) ), this, SLOT( cancel ( void ) ) );
|
connect( cancelButton, SIGNAL( clicked( void ) ), this, SLOT( cancel ( void ) ) );
|
||||||
|
|
||||||
/* once off check - if remote, check if we have it
|
/* once off check - if remote, check if we have it
|
||||||
|
@ -127,8 +123,7 @@ void AttachFileItem::Setup()
|
||||||
if (mMode == AFI_STATE_REMOTE)
|
if (mMode == AFI_STATE_REMOTE)
|
||||||
{
|
{
|
||||||
FileInfo fi;
|
FileInfo fi;
|
||||||
uint32_t hintflags = RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_LOCAL
|
uint32_t hintflags = RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_SPEC_ONLY;
|
||||||
| RS_FILE_HINTS_SPEC_ONLY;
|
|
||||||
|
|
||||||
/* look up path */
|
/* look up path */
|
||||||
if (rsFiles->FileDetails(mFileHash, hintflags, fi))
|
if (rsFiles->FileDetails(mFileHash, hintflags, fi))
|
||||||
|
@ -140,14 +135,12 @@ void AttachFileItem::Setup()
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
mMode = AFI_STATE_LOCAL;
|
mMode = AFI_STATE_LOCAL;
|
||||||
mPath = fi.path;
|
mPath = QString::fromUtf8(fi.path.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateItemStatic();
|
updateItemStatic();
|
||||||
updateItem();
|
updateItem();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -169,7 +162,7 @@ void AttachFileItem::updateItemStatic()
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString filename = QString::fromUtf8(mFileName.c_str());
|
QString filename = mFileName;
|
||||||
mDivisor = 1;
|
mDivisor = 1;
|
||||||
|
|
||||||
if (mFileSize > 10000000) /* 10 Mb */
|
if (mFileSize > 10000000) /* 10 Mb */
|
||||||
|
@ -219,7 +212,7 @@ void AttachFileItem::updateItemStatic()
|
||||||
std::cerr << "AttachFileItem::updateItemStatic() Updated Path";
|
std::cerr << "AttachFileItem::updateItemStatic() Updated Path";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
mPath = fi.path;
|
mPath = QString::fromUtf8(fi.path.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,12 +227,12 @@ void AttachFileItem::updateItemStatic()
|
||||||
cancelButton->setEnabled(false);
|
cancelButton->setEnabled(false);
|
||||||
|
|
||||||
progressBar->setValue(0);
|
progressBar->setValue(0);
|
||||||
filename = "[ERROR] " + filename;
|
filename = tr("[ERROR])") + " " + filename;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AFI_STATE_EXTRA:
|
case AFI_STATE_EXTRA:
|
||||||
filename = QString::fromUtf8(mPath.c_str());
|
filename = mPath;
|
||||||
|
|
||||||
progressBar->setRange(0, 100);
|
progressBar->setRange(0, 100);
|
||||||
progressBar->setFormat("HASHING");
|
progressBar->setFormat("HASHING");
|
||||||
|
@ -303,10 +296,8 @@ void AttachFileItem::updateItemStatic()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fileLabel->setText(filename);
|
fileLabel->setText(filename);
|
||||||
fileLabel->setToolTip(filename);
|
fileLabel->setToolTip(filename);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttachFileItem::updateItem()
|
void AttachFileItem::updateItem()
|
||||||
|
@ -339,7 +330,7 @@ void AttachFileItem::updateItem()
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
/* check for file status */
|
/* check for file status */
|
||||||
if (rsFiles->ExtraFileStatus(mPath, fi))
|
if (rsFiles->ExtraFileStatus(mPath.toUtf8().constData(), fi))
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_ITEM
|
#ifdef DEBUG_ITEM
|
||||||
std::cerr << "AttachFileItem::updateItem() STATE=>Local";
|
std::cerr << "AttachFileItem::updateItem() STATE=>Local";
|
||||||
|
@ -348,7 +339,7 @@ void AttachFileItem::updateItem()
|
||||||
mMode = AFI_STATE_LOCAL;
|
mMode = AFI_STATE_LOCAL;
|
||||||
|
|
||||||
/* fill in file details */
|
/* fill in file details */
|
||||||
mFileName = fi.fname;
|
mFileName = QString::fromUtf8(fi.fname.c_str());
|
||||||
mFileSize = fi.size;
|
mFileSize = fi.size;
|
||||||
mFileHash = fi.hash;
|
mFileHash = fi.hash;
|
||||||
|
|
||||||
|
@ -422,7 +413,7 @@ void AttachFileItem::updateItem()
|
||||||
/* save path */
|
/* save path */
|
||||||
/* update progress */
|
/* update progress */
|
||||||
mMode = AFI_STATE_LOCAL;
|
mMode = AFI_STATE_LOCAL;
|
||||||
mPath = fi.path;
|
mPath = QString::fromUtf8(fi.path.c_str());
|
||||||
stateChanged = true;
|
stateChanged = true;
|
||||||
}
|
}
|
||||||
progressBar->setValue(fi.avail / mDivisor);
|
progressBar->setValue(fi.avail / mDivisor);
|
||||||
|
@ -442,7 +433,6 @@ void AttachFileItem::updateItem()
|
||||||
/* update progress */
|
/* update progress */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****** update based on new state ******/
|
/****** update based on new state ******/
|
||||||
|
@ -485,7 +475,6 @@ void AttachFileItem::updateItem()
|
||||||
msec_rate = 2000; /* should be download rate dependent */
|
msec_rate = 2000; /* should be download rate dependent */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (repeat)
|
if (repeat)
|
||||||
{
|
{
|
||||||
|
@ -495,10 +484,8 @@ void AttachFileItem::updateItem()
|
||||||
#endif
|
#endif
|
||||||
QTimer::singleShot( msec_rate, this, SLOT(updateItem( void ) ));
|
QTimer::singleShot( msec_rate, this, SLOT(updateItem( void ) ));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AttachFileItem::cancel()
|
void AttachFileItem::cancel()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_ITEM
|
#ifdef DEBUG_ITEM
|
||||||
|
@ -519,7 +506,7 @@ void AttachFileItem::cancel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t AttachFileItem::getState()
|
||||||
uint32_t AttachFileItem::getState() {
|
{
|
||||||
return mMode;
|
return mMode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,49 +41,39 @@ const uint32_t AFI_TYPE_ATTACH = 0x0020;
|
||||||
|
|
||||||
class AttachFileItem : public QWidget, private Ui::AttachFileItem
|
class AttachFileItem : public QWidget, private Ui::AttachFileItem
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Default Constructor */
|
/** Default Constructor */
|
||||||
AttachFileItem(std::string localpath);
|
AttachFileItem(const QString& localpath);
|
||||||
AttachFileItem(std::string hash, std::string name, uint64_t size,
|
AttachFileItem(const std::string& hash, const QString& name, uint64_t size, uint32_t flags, const std::string& srcId);
|
||||||
uint32_t flags, std::string srcId);
|
|
||||||
|
|
||||||
/** Default Destructor */
|
/** Default Destructor */
|
||||||
|
|
||||||
std::string FileHash() { return mFileHash; }
|
const std::string& FileHash() { return mFileHash; }
|
||||||
std::string FileName() { return mFileName; }
|
const QString& FileName() { return mFileName; }
|
||||||
uint64_t FileSize() { return mFileSize; }
|
uint64_t FileSize() { return mFileSize; }
|
||||||
std::string FilePath() { return mPath; }
|
const QString& FilePath() { return mPath; }
|
||||||
int getPicFlag() { return mPicFlag;}
|
|
||||||
void setPicFlag(int flag) { mPicFlag=flag;}
|
|
||||||
|
|
||||||
void updateItemStatic();
|
void updateItemStatic();
|
||||||
|
|
||||||
bool done();
|
bool done();
|
||||||
bool ready();
|
bool ready();
|
||||||
uint32_t getState();
|
uint32_t getState();
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void cancel();
|
||||||
void cancel();
|
|
||||||
|
|
||||||
void updateItem();
|
void updateItem();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void Setup();
|
void Setup();
|
||||||
|
|
||||||
|
QString mPath;
|
||||||
std::string mPath;
|
|
||||||
std::string mFileHash;
|
std::string mFileHash;
|
||||||
std::string mFileName;
|
QString mFileName;
|
||||||
uint64_t mFileSize;
|
uint64_t mFileSize;
|
||||||
std::string mSrcId;
|
std::string mSrcId;
|
||||||
|
|
||||||
uint32_t mPicFlag;
|
|
||||||
uint32_t mMode;
|
uint32_t mMode;
|
||||||
uint32_t mType;
|
uint32_t mType;
|
||||||
uint64_t mDivisor;
|
uint64_t mDivisor;
|
||||||
|
@ -92,11 +82,8 @@ private:
|
||||||
float amountDone;
|
float amountDone;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void fileFinished(AttachFileItem * AttachFileItem);
|
void fileFinished(AttachFileItem * AttachFileItem);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,11 @@
|
||||||
<height>35</height>
|
<height>35</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="maximumSize">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<size>
|
||||||
<horstretch>0</horstretch>
|
<width>16777215</width>
|
||||||
<verstretch>0</verstretch>
|
<height>35</height>
|
||||||
</sizepolicy>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
|
@ -130,7 +130,7 @@ background: white;}
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../images.qrc">
|
<iconset resource="../../../../plugins/qdiagram_plugin/qdiagram.qrc">
|
||||||
<normaloff>:/images/delete.png</normaloff>:/images/delete.png</iconset>
|
<normaloff>:/images/delete.png</normaloff>:/images/delete.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -154,7 +154,7 @@ background: white;}
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../images.qrc"/>
|
<include location="../../../../plugins/qdiagram_plugin/qdiagram.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -26,13 +26,12 @@
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QDropEvent>
|
#include <QDropEvent>
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
#include <retroshare/rsforums.h>
|
#include <retroshare/rsforums.h>
|
||||||
#include <retroshare/rsfiles.h>
|
|
||||||
|
|
||||||
#include "gui/settings/rsharesettings.h"
|
#include "gui/settings/rsharesettings.h"
|
||||||
#include "gui/RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
#include "gui/feeds/AttachFileItem.h"
|
|
||||||
#include "gui/common/Emoticons.h"
|
#include "gui/common/Emoticons.h"
|
||||||
|
|
||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
|
@ -52,6 +51,8 @@ CreateForumMsg::CreateForumMsg(std::string fId, std::string pId)
|
||||||
|
|
||||||
connect( ui.forumMessage, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( forumMessageCostumPopupMenu( QPoint ) ) );
|
connect( ui.forumMessage, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( forumMessageCostumPopupMenu( QPoint ) ) );
|
||||||
|
|
||||||
|
connect(ui.hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||||
|
|
||||||
// connect up the buttons.
|
// connect up the buttons.
|
||||||
connect( ui.postmessage_action, SIGNAL( triggered (bool) ), this, SLOT( createMsg( ) ) );
|
connect( ui.postmessage_action, SIGNAL( triggered (bool) ), this, SLOT( createMsg( ) ) );
|
||||||
connect( ui.close_action, SIGNAL( triggered (bool) ), this, SLOT( cancelMsg( ) ) );
|
connect( ui.close_action, SIGNAL( triggered (bool) ), this, SLOT( cancelMsg( ) ) );
|
||||||
|
@ -60,6 +61,8 @@ CreateForumMsg::CreateForumMsg(std::string fId, std::string pId)
|
||||||
connect( ui.pastersButton, SIGNAL(clicked() ), this , SLOT(pasteLink()));
|
connect( ui.pastersButton, SIGNAL(clicked() ), this , SLOT(pasteLink()));
|
||||||
|
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
|
ui.hashBox->setDropWidget(this);
|
||||||
|
ui.hashBox->setAutoHide(false);
|
||||||
|
|
||||||
newMsg();
|
newMsg();
|
||||||
}
|
}
|
||||||
|
@ -203,130 +206,34 @@ void CreateForumMsg::addFile()
|
||||||
{
|
{
|
||||||
QStringList files;
|
QStringList files;
|
||||||
if (misc::getOpenFileNames(this, RshareSettings::LASTDIR_EXTRAFILE, tr("Add Extra File"), "", files)) {
|
if (misc::getOpenFileNames(this, RshareSettings::LASTDIR_EXTRAFILE, tr("Add Extra File"), "", files)) {
|
||||||
for (QStringList::iterator fileIt = files.begin(); fileIt != files.end(); fileIt++) {
|
ui.hashBox->addAttachments(files);
|
||||||
addAttachment((*fileIt).toUtf8().constData());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateForumMsg::addAttachment(std::string filePath) {
|
void CreateForumMsg::fileHashingFinished(QList<HashedFile> hashedFiles)
|
||||||
/* add a AttachFileItem to the attachment section */
|
{
|
||||||
std::cerr << "CreateForumMsg::addFile() hashing file.";
|
std::cerr << "CreateForumMsg::fileHashingFinished() started." << std::endl;
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
/* add widget in for new destination */
|
QString mesgString;
|
||||||
AttachFileItem *file = new AttachFileItem(filePath);
|
|
||||||
//file->
|
|
||||||
|
|
||||||
ui.verticalLayout->addWidget(file, 1, 0);
|
QList<HashedFile>::iterator it;
|
||||||
|
for (it = hashedFiles.begin(); it != hashedFiles.end(); ++it) {
|
||||||
//when the file is local or is finished hashing, call the fileHashingFinished method to send a forum message
|
HashedFile& hashedFile = *it;
|
||||||
if (file->getState() == AFI_STATE_LOCAL) {
|
RetroShareLink link;
|
||||||
fileHashingFinished(file);
|
if (link.createFile(hashedFile.filename, hashedFile.size, QString::fromStdString(hashedFile.hash))) {
|
||||||
} else {
|
mesgString += link.toHtmlSize() + "<br>";
|
||||||
QObject::connect(file,SIGNAL(fileFinished(AttachFileItem *)),this, SLOT(fileHashingFinished(AttachFileItem *))) ;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void CreateForumMsg::fileHashingFinished(AttachFileItem* file) {
|
|
||||||
std::cerr << "CreateForumMsg::fileHashingFinished() started.";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
//check that the file is ok tos end
|
|
||||||
if (file->getState() == AFI_STATE_ERROR) {
|
|
||||||
#ifdef CHAT_DEBUG
|
|
||||||
std::cerr << "CreateForumMsg::fileHashingFinished error file is not hashed.";
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
RetroShareLink link;
|
|
||||||
if (link.createFile(QString::fromUtf8(file->FileName().c_str()), file->FileSize(), QString::fromStdString(file->FileHash()))) {
|
|
||||||
QString mesgString = link.toHtmlSize() + "<br>";
|
|
||||||
|
|
||||||
#ifdef CHAT_DEBUG
|
#ifdef CHAT_DEBUG
|
||||||
std::cerr << "CreateForumMsg::anchorClicked mesgString : " << mesgString.toStdString() << std::endl;
|
std::cerr << "CreateForumMsg::anchorClicked mesgString : " << mesgString.toStdString() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ui.forumMessage->textCursor().insertHtml(mesgString);
|
if (!mesgString.isEmpty()) {
|
||||||
|
ui.forumMessage->textCursor().insertHtml(mesgString);
|
||||||
|
}
|
||||||
|
|
||||||
ui.forumMessage->setFocus( Qt::OtherFocusReason );
|
ui.forumMessage->setFocus( Qt::OtherFocusReason );
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CreateForumMsg::dropEvent(QDropEvent *event)
|
|
||||||
{
|
|
||||||
if (!(Qt::CopyAction & event->possibleActions()))
|
|
||||||
{
|
|
||||||
std::cerr << "CreateForumMsg::dropEvent() Rejecting uncopyable DropAction" << std::endl;
|
|
||||||
|
|
||||||
/* can't do it */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cerr << "CreateForumMsg::dropEvent() Formats" << std::endl;
|
|
||||||
QStringList formats = event->mimeData()->formats();
|
|
||||||
QStringList::iterator it;
|
|
||||||
for(it = formats.begin(); it != formats.end(); it++)
|
|
||||||
{
|
|
||||||
std::cerr << "Format: " << (*it).toStdString() << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event->mimeData()->hasUrls())
|
|
||||||
{
|
|
||||||
std::cerr << "CreateForumMsg::dropEvent() Urls:" << std::endl;
|
|
||||||
|
|
||||||
QList<QUrl> urls = event->mimeData()->urls();
|
|
||||||
QList<QUrl>::iterator uit;
|
|
||||||
for(uit = urls.begin(); uit != urls.end(); uit++)
|
|
||||||
{
|
|
||||||
QString localpath = uit->toLocalFile();
|
|
||||||
std::cerr << "Whole URL: " << uit->toString().toStdString() << std::endl;
|
|
||||||
std::cerr << "or As Local File: " << localpath.toStdString() << std::endl;
|
|
||||||
|
|
||||||
if (localpath.isEmpty() == false)
|
|
||||||
{
|
|
||||||
// Check that the file does exist and is not a directory
|
|
||||||
QDir dir(localpath);
|
|
||||||
if (dir.exists()) {
|
|
||||||
std::cerr << "CreateForumMsg::dropEvent() directory not accepted."<< std::endl;
|
|
||||||
QMessageBox mb(tr("Drop file error."), tr("Directory can't be dropped, only files are accepted."),QMessageBox::Information,QMessageBox::Ok,0,0,this);
|
|
||||||
mb.exec();
|
|
||||||
} else if (QFile::exists(localpath)) {
|
|
||||||
addAttachment(localpath.toUtf8().constData());
|
|
||||||
} else {
|
|
||||||
std::cerr << "CreateForumMsg::dropEvent() file does not exists."<< std::endl;
|
|
||||||
QMessageBox mb(tr("Drop file error."), tr("File not found or file name not accepted."),QMessageBox::Information,QMessageBox::Ok,0,0,this);
|
|
||||||
mb.exec();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
event->setDropAction(Qt::CopyAction);
|
|
||||||
event->accept();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CreateForumMsg::dragEnterEvent(QDragEnterEvent *event)
|
|
||||||
{
|
|
||||||
/* print out mimeType */
|
|
||||||
std::cerr << "CreateForumMsg::dragEnterEvent() Formats" << std::endl;
|
|
||||||
QStringList formats = event->mimeData()->formats();
|
|
||||||
QStringList::iterator it;
|
|
||||||
for(it = formats.begin(); it != formats.end(); it++)
|
|
||||||
{
|
|
||||||
std::cerr << "Format: " << (*it).toStdString() << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event->mimeData()->hasUrls())
|
|
||||||
{
|
|
||||||
std::cerr << "CreateForumMsg::dragEnterEvent() Accepting Urls" << std::endl;
|
|
||||||
event->acceptProposedAction();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::cerr << "CreateForumMsg::dragEnterEvent() No Urls" << std::endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateForumMsg::pasteLink()
|
void CreateForumMsg::pasteLink()
|
||||||
|
@ -338,4 +245,3 @@ void CreateForumMsg::pasteLinkFull()
|
||||||
{
|
{
|
||||||
ui.forumMessage->insertHtml(RSLinkClipboard::toHtmlFull()) ;
|
ui.forumMessage->insertHtml(RSLinkClipboard::toHtmlFull()) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
|
|
||||||
#include "ui_CreateForumMsg.h"
|
#include "ui_CreateForumMsg.h"
|
||||||
|
|
||||||
class AttachFileItem;
|
|
||||||
|
|
||||||
class CreateForumMsg : public QMainWindow
|
class CreateForumMsg : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -40,8 +38,8 @@ private slots:
|
||||||
/** Create the context popup menu and it's submenus */
|
/** Create the context popup menu and it's submenus */
|
||||||
void forumMessageCostumPopupMenu( QPoint point );
|
void forumMessageCostumPopupMenu( QPoint point );
|
||||||
|
|
||||||
void fileHashingFinished(AttachFileItem* file);
|
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
||||||
/* actions to take.... */
|
/* actions to take.... */
|
||||||
void createMsg();
|
void createMsg();
|
||||||
void cancelMsg();
|
void cancelMsg();
|
||||||
void pasteLink();
|
void pasteLink();
|
||||||
|
@ -50,13 +48,9 @@ private slots:
|
||||||
void smileyWidgetForums();
|
void smileyWidgetForums();
|
||||||
void addSmileys();
|
void addSmileys();
|
||||||
void addFile();
|
void addFile();
|
||||||
void addAttachment(std::string);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent (QCloseEvent * event);
|
void closeEvent (QCloseEvent * event);
|
||||||
virtual void dragEnterEvent(QDragEnterEvent *event);
|
|
||||||
virtual void dropEvent(QDropEvent *event);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string mForumId;
|
std::string mForumId;
|
||||||
|
|
|
@ -261,44 +261,19 @@ p, li { white-space: pre-wrap; }
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_7">
|
<layout class="QGridLayout" name="gridLayout_7">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QScrollArea" name="scrollArea">
|
<widget class="HashBox" name="hashBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>You can attach files via drag and drop here in this window</string>
|
<string>You can attach files via drag and drop here in this window</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>440</width>
|
|
||||||
<height>57</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_6">
|
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -343,6 +318,14 @@ p, li { white-space: pre-wrap; }
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>HashBox</class>
|
||||||
|
<extends>QScrollArea</extends>
|
||||||
|
<header location="global">gui/common/HashBox.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../images.qrc"/>
|
<include location="../images.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -2,14 +2,10 @@
|
||||||
<qresource prefix="/" >
|
<qresource prefix="/" >
|
||||||
<file>images/splash.png</file>
|
<file>images/splash.png</file>
|
||||||
<file>images/attach.png</file>
|
<file>images/attach.png</file>
|
||||||
<file>images/audio-x-monkey.png</file>
|
|
||||||
<file>images/video-x-generic.png</file>
|
|
||||||
<file>images/application-x-rar.png</file>
|
|
||||||
<file>images/application-draw.png</file>
|
|
||||||
<file>images/pgp.png</file>
|
<file>images/pgp.png</file>
|
||||||
<file>images/rs_wizard.png</file>
|
<file>images/rs_wizard.png</file>
|
||||||
<file>images/about.png</file>
|
<file>images/about.png</file>
|
||||||
<file>images/backblue.png</file>
|
<file>images/backblue.png</file>
|
||||||
<file>images/backchat.png</file>
|
<file>images/backchat.png</file>
|
||||||
<file>images/buttonframe.png</file>
|
<file>images/buttonframe.png</file>
|
||||||
<file>images/btn1.png</file>
|
<file>images/btn1.png</file>
|
||||||
|
@ -166,7 +162,7 @@
|
||||||
<file>images/filerating5.png</file>
|
<file>images/filerating5.png</file>
|
||||||
<file>images/fileshare16.png</file>
|
<file>images/fileshare16.png</file>
|
||||||
<file>images/fileshare24.png</file>
|
<file>images/fileshare24.png</file>
|
||||||
<file>images/fileshare32.png</file>
|
<file>images/fileshare32.png</file>
|
||||||
<file>images/fileshare48.png</file>
|
<file>images/fileshare48.png</file>
|
||||||
<file>images/find.png</file>
|
<file>images/find.png</file>
|
||||||
<file>images/find-16.png</file>
|
<file>images/find-16.png</file>
|
||||||
|
@ -439,7 +435,7 @@
|
||||||
<file>images/user/friends24.png</file>
|
<file>images/user/friends24.png</file>
|
||||||
<file>images/user/identity16.png</file>
|
<file>images/user/identity16.png</file>
|
||||||
<file>images/user/identity24.png</file>
|
<file>images/user/identity24.png</file>
|
||||||
<file>images/user/identity32.png</file>
|
<file>images/user/identity32.png</file>
|
||||||
<file>images/user/identity48.png</file>
|
<file>images/user/identity48.png</file>
|
||||||
<file>images/user/identityoffline24.png</file>
|
<file>images/user/identityoffline24.png</file>
|
||||||
<file>images/user/identity24away.png</file>
|
<file>images/user/identity24away.png</file>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.5 KiB |
|
@ -49,7 +49,6 @@
|
||||||
#include "gui/common/PeerDefs.h"
|
#include "gui/common/PeerDefs.h"
|
||||||
#include "gui/RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
#include "gui/settings/rsharesettings.h"
|
#include "gui/settings/rsharesettings.h"
|
||||||
#include "gui/feeds/AttachFileItem.h"
|
|
||||||
#include "gui/common/Emoticons.h"
|
#include "gui/common/Emoticons.h"
|
||||||
#include "textformat.h"
|
#include "textformat.h"
|
||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
|
@ -109,7 +108,7 @@ public:
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
MessageComposer::MessageComposer(QWidget *parent, Qt::WFlags flags)
|
MessageComposer::MessageComposer(QWidget *parent, Qt::WFlags flags)
|
||||||
: QMainWindow(parent, flags), mCheckAttachment(true)
|
: QMainWindow(parent, flags)
|
||||||
{
|
{
|
||||||
/* Invoke the Qt Designer generated object setup routine */
|
/* Invoke the Qt Designer generated object setup routine */
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
@ -168,6 +167,9 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WFlags flags)
|
||||||
connect(ui.msgFileList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuFileList(QPoint)));
|
connect(ui.msgFileList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuFileList(QPoint)));
|
||||||
connect(ui.msgSendList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuMsgSendList(QPoint)));
|
connect(ui.msgSendList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuMsgSendList(QPoint)));
|
||||||
|
|
||||||
|
connect(ui.hashBox, SIGNAL(fileHashingStarted()), this, SLOT(fileHashingStarted()));
|
||||||
|
connect(ui.hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||||
|
|
||||||
setWindowModified(ui.msgText->document()->isModified());
|
setWindowModified(ui.msgText->document()->isModified());
|
||||||
actionSave->setEnabled(ui.msgText->document()->isModified());
|
actionSave->setEnabled(ui.msgText->document()->isModified());
|
||||||
actionUndo->setEnabled(ui.msgText->document()->isUndoAvailable());
|
actionUndo->setEnabled(ui.msgText->document()->isUndoAvailable());
|
||||||
|
@ -304,6 +306,8 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WFlags flags)
|
||||||
ui.tagButton->setMenu(menu);
|
ui.tagButton->setMenu(menu);
|
||||||
|
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
|
ui.hashBox->setDropWidget(this);
|
||||||
|
ui.hashBox->setAutoHide(true);
|
||||||
|
|
||||||
#ifdef RS_RELEASE_VERSION
|
#ifdef RS_RELEASE_VERSION
|
||||||
ui.imagebtn->setVisible(false);
|
ui.imagebtn->setVisible(false);
|
||||||
|
@ -2231,88 +2235,35 @@ void MessageComposer::attachFile()
|
||||||
// select a file
|
// select a file
|
||||||
QStringList files;
|
QStringList files;
|
||||||
if (misc::getOpenFileNames(this, RshareSettings::LASTDIR_EXTRAFILE, tr("Add Extra File"), "", files)) {
|
if (misc::getOpenFileNames(this, RshareSettings::LASTDIR_EXTRAFILE, tr("Add Extra File"), "", files)) {
|
||||||
for (QStringList::iterator fileIt = files.begin(); fileIt != files.end(); fileIt++) {
|
ui.hashBox->addAttachments(files);
|
||||||
addAttachment((*fileIt).toUtf8().constData());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageComposer::addAttachment(std::string filePath)
|
void MessageComposer::fileHashingStarted()
|
||||||
{
|
{
|
||||||
/* add a AttachFileItem to the attachment section */
|
std::cerr << "MessageComposer::fileHashingStarted() started." << std::endl;
|
||||||
std::cerr << "MessageComposer::addFile() hashing file.";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
/* add widget in for new destination */
|
/* add widget in for new destination */
|
||||||
AttachFileItem *file = new AttachFileItem(filePath);
|
|
||||||
|
|
||||||
ui.hashBox->show();
|
|
||||||
ui.msgFileList->hide();
|
ui.msgFileList->hide();
|
||||||
ui.verticalLayout->addWidget(file, 1, 0);
|
ui.hashBox->show();
|
||||||
|
|
||||||
//when the file is local or is finished hashing, call the fileHashingFinished method to send a chat message
|
|
||||||
if (file->getState() == AFI_STATE_LOCAL) {
|
|
||||||
fileHashingFinished(file);
|
|
||||||
} else {
|
|
||||||
QObject::connect(file,SIGNAL(fileFinished(AttachFileItem *)),this, SLOT(fileHashingFinished(AttachFileItem *))) ;
|
|
||||||
}
|
|
||||||
mAttachments.push_back(file);
|
|
||||||
|
|
||||||
if (mCheckAttachment)
|
|
||||||
{
|
|
||||||
checkAttachmentReady();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageComposer::fileHashingFinished(AttachFileItem* file)
|
void MessageComposer::fileHashingFinished(QList<HashedFile> hashedFiles)
|
||||||
{
|
{
|
||||||
std::cerr << "MessageComposer::fileHashingFinished() started.";
|
std::cerr << "MessageComposer::fileHashingFinished() started." << std::endl;
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
//check that the file is ok tos end
|
QList<HashedFile>::iterator it;
|
||||||
if (file->getState() == AFI_STATE_ERROR) {
|
for (it = hashedFiles.begin(); it != hashedFiles.end(); ++it) {
|
||||||
#ifdef CHAT_DEBUG
|
FileInfo info;
|
||||||
std::cerr << "MessageComposer::fileHashingFinished error file is not hashed.";
|
info.fname = it->filename.toUtf8().constData();
|
||||||
#endif
|
info.hash = it->hash;
|
||||||
return;
|
info.size = it->size;
|
||||||
|
addFile(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
FileInfo fileInfo;
|
ui.actionSend->setEnabled(true);
|
||||||
fileInfo.fname = file->FileName();
|
ui.hashBox->hide();
|
||||||
fileInfo.hash = file->FileHash();
|
ui.msgFileList->show();
|
||||||
fileInfo.size = file->FileSize();
|
|
||||||
|
|
||||||
addFile(fileInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MessageComposer::checkAttachmentReady()
|
|
||||||
{
|
|
||||||
std::list<AttachFileItem *>::iterator fit;
|
|
||||||
|
|
||||||
mCheckAttachment = false;
|
|
||||||
|
|
||||||
for(fit = mAttachments.begin(); fit != mAttachments.end(); fit++)
|
|
||||||
{
|
|
||||||
if (!(*fit)->isHidden())
|
|
||||||
{
|
|
||||||
if (!(*fit)->ready())
|
|
||||||
{
|
|
||||||
ui.actionSend->setEnabled(false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fit == mAttachments.end())
|
|
||||||
{
|
|
||||||
ui.actionSend->setEnabled(true);
|
|
||||||
ui.hashBox->hide();
|
|
||||||
ui.msgFileList->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* repeat... */
|
|
||||||
int msec_rate = 1000;
|
|
||||||
QTimer::singleShot( msec_rate, this, SLOT(checkAttachmentReady(void)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clear Filter */
|
/* clear Filter */
|
||||||
|
@ -2470,82 +2421,6 @@ void MessageComposer::friendDetails()
|
||||||
ConfCertDialog::showIt(id, ConfCertDialog::PageDetails);
|
ConfCertDialog::showIt(id, ConfCertDialog::PageDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageComposer::dragEnterEvent(QDragEnterEvent *event)
|
|
||||||
{
|
|
||||||
/* print out mimeType */
|
|
||||||
std::cerr << "PopupChatDialog::dragEnterEvent() Formats";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
QStringList formats = event->mimeData()->formats();
|
|
||||||
QStringList::iterator it;
|
|
||||||
for(it = formats.begin(); it != formats.end(); it++) {
|
|
||||||
std::cerr << "Format: " << (*it).toStdString();
|
|
||||||
std::cerr << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event->mimeData()->hasUrls()) {
|
|
||||||
std::cerr << "PopupChatDialog::dragEnterEvent() Accepting Urls";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
event->acceptProposedAction();
|
|
||||||
} else {
|
|
||||||
std::cerr << "PopupChatDialog::dragEnterEvent() No Urls";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MessageComposer::dropEvent(QDropEvent *event)
|
|
||||||
{
|
|
||||||
if (!(Qt::CopyAction & event->possibleActions())) {
|
|
||||||
std::cerr << "PopupChatDialog::dropEvent() Rejecting uncopyable DropAction";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
/* can't do it */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cerr << "PopupChatDialog::dropEvent() Formats";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
QStringList formats = event->mimeData()->formats();
|
|
||||||
QStringList::iterator it;
|
|
||||||
for(it = formats.begin(); it != formats.end(); it++) {
|
|
||||||
std::cerr << "Format: " << (*it).toStdString();
|
|
||||||
std::cerr << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event->mimeData()->hasUrls()) {
|
|
||||||
std::cerr << "PopupChatDialog::dropEvent() Urls:";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
QList<QUrl> urls = event->mimeData()->urls();
|
|
||||||
QList<QUrl>::iterator uit;
|
|
||||||
for(uit = urls.begin(); uit != urls.end(); uit++) {
|
|
||||||
QString localpath = uit->toLocalFile();
|
|
||||||
std::cerr << "Whole URL: " << uit->toString().toStdString() << std::endl;
|
|
||||||
std::cerr << "or As Local File: " << localpath.toStdString() << std::endl;
|
|
||||||
|
|
||||||
if (localpath.isEmpty() == false) {
|
|
||||||
//Check that the file does exist and is not a directory
|
|
||||||
QDir dir(localpath);
|
|
||||||
if (dir.exists()) {
|
|
||||||
std::cerr << "PopupChatDialog::dropEvent() directory not accepted."<< std::endl;
|
|
||||||
QMessageBox mb(tr("Drop file error."), tr("Directory can't be dropped, only files are accepted."),QMessageBox::Information,QMessageBox::Ok,0,0,this);
|
|
||||||
mb.exec();
|
|
||||||
} else if (QFile::exists(localpath)) {
|
|
||||||
addAttachment(localpath.toUtf8().constData());
|
|
||||||
} else {
|
|
||||||
std::cerr << "PopupChatDialog::dropEvent() file does not exists."<< std::endl;
|
|
||||||
QMessageBox mb(tr("Drop file error."), tr("File not found or file name not accepted."),QMessageBox::Information,QMessageBox::Ok,0,0,this);
|
|
||||||
mb.exec();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
event->setDropAction(Qt::CopyAction);
|
|
||||||
event->accept();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MessageComposer::tagAboutToShow()
|
void MessageComposer::tagAboutToShow()
|
||||||
{
|
{
|
||||||
TagsMenu *menu = dynamic_cast<TagsMenu*>(ui.tagButton->menu());
|
TagsMenu *menu = dynamic_cast<TagsMenu*>(ui.tagButton->menu());
|
||||||
|
@ -2575,7 +2450,7 @@ void MessageComposer::tagSet(int tagId, bool set)
|
||||||
m_tagIds.push_back(tagId);
|
m_tagIds.push_back(tagId);
|
||||||
/* Keep the list sorted */
|
/* Keep the list sorted */
|
||||||
m_tagIds.sort();
|
m_tagIds.sort();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (set == false) {
|
if (set == false) {
|
||||||
m_tagIds.remove(tagId);
|
m_tagIds.remove(tagId);
|
||||||
|
|
|
@ -31,7 +31,6 @@ class QComboBox;
|
||||||
class QFontComboBox;
|
class QFontComboBox;
|
||||||
class QTextEdit;
|
class QTextEdit;
|
||||||
class QTextCharFormat;
|
class QTextCharFormat;
|
||||||
class AttachFileItem;
|
|
||||||
class RSTreeWidgetItemCompareRole;
|
class RSTreeWidgetItemCompareRole;
|
||||||
|
|
||||||
class MessageComposer : public QMainWindow
|
class MessageComposer : public QMainWindow
|
||||||
|
@ -80,9 +79,6 @@ protected:
|
||||||
void closeEvent (QCloseEvent * event);
|
void closeEvent (QCloseEvent * event);
|
||||||
bool eventFilter(QObject *obj, QEvent *ev);
|
bool eventFilter(QObject *obj, QEvent *ev);
|
||||||
|
|
||||||
virtual void dragEnterEvent(QDragEnterEvent *event);
|
|
||||||
virtual void dropEvent(QDropEvent *event);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/* toggle Contacts DockWidget */
|
/* toggle Contacts DockWidget */
|
||||||
void contextMenu(QPoint);
|
void contextMenu(QPoint);
|
||||||
|
@ -119,11 +115,10 @@ private slots:
|
||||||
|
|
||||||
void clipboardDataChanged();
|
void clipboardDataChanged();
|
||||||
|
|
||||||
void fileHashingFinished(AttachFileItem* file);
|
void fileHashingStarted();
|
||||||
|
void fileHashingFinished(QList<HashedFile> hashedFiles);
|
||||||
|
|
||||||
void attachFile();
|
void attachFile();
|
||||||
void addAttachment(std::string);
|
|
||||||
void checkAttachmentReady();
|
|
||||||
|
|
||||||
void fontSizeIncrease();
|
void fontSizeIncrease();
|
||||||
void fontSizeDecrease();
|
void fontSizeDecrease();
|
||||||
|
@ -216,11 +211,6 @@ private:
|
||||||
std::list<uint32_t> m_tagIds;
|
std::list<uint32_t> m_tagIds;
|
||||||
QList<QLabel*> tagLabels;
|
QList<QLabel*> tagLabels;
|
||||||
|
|
||||||
/* maps of files */
|
|
||||||
std::list<AttachFileItem *> mAttachments;
|
|
||||||
|
|
||||||
bool mCheckAttachment;
|
|
||||||
|
|
||||||
RSTreeWidgetItemCompareRole *m_compareRole;
|
RSTreeWidgetItemCompareRole *m_compareRole;
|
||||||
QCompleter *m_completer;
|
QCompleter *m_completer;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>796</width>
|
<width>796</width>
|
||||||
<height>588</height>
|
<height>624</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="contextMenuPolicy">
|
<property name="contextMenuPolicy">
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
<string>Compose</string>
|
<string>Compose</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/folder-draft.png</normaloff>:/images/folder-draft.png</iconset>
|
<normaloff>:/images/folder-draft.png</normaloff>:/images/folder-draft.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
|
@ -397,7 +397,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/textedit/format_font_size_more.png</normaloff>:/images/textedit/format_font_size_more.png</iconset>
|
<normaloff>:/images/textedit/format_font_size_more.png</normaloff>:/images/textedit/format_font_size_more.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
|
@ -429,7 +429,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/textedit/format_font_size_less.png</normaloff>:/images/textedit/format_font_size_less.png</iconset>
|
<normaloff>:/images/textedit/format_font_size_less.png</normaloff>:/images/textedit/format_font_size_less.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
|
@ -467,7 +467,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/textedit/textbold.png</normaloff>:/images/textedit/textbold.png</iconset>
|
<normaloff>:/images/textedit/textbold.png</normaloff>:/images/textedit/textbold.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
|
@ -508,7 +508,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/textedit/textitalic.png</normaloff>:/images/textedit/textitalic.png</iconset>
|
<normaloff>:/images/textedit/textitalic.png</normaloff>:/images/textedit/textitalic.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
|
@ -614,7 +614,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
|
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
|
@ -640,7 +640,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/textedit/hi22-action-format-text-code.png</normaloff>:/images/textedit/hi22-action-format-text-code.png</iconset>
|
<normaloff>:/images/textedit/hi22-action-format-text-code.png</normaloff>:/images/textedit/hi22-action-format-text-code.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
|
@ -673,7 +673,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
<enum>Qt::NoFocus</enum>
|
<enum>Qt::NoFocus</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/emoticons/kopete/kopete020.png</normaloff>:/images/emoticons/kopete/kopete020.png</iconset>
|
<normaloff>:/images/emoticons/kopete/kopete020.png</normaloff>:/images/emoticons/kopete/kopete020.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
|
@ -711,7 +711,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/textedit/textunder.png</normaloff>:/images/textedit/textunder.png</iconset>
|
<normaloff>:/images/textedit/textunder.png</normaloff>:/images/textedit/textunder.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
|
@ -784,15 +784,6 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
<attribute name="verticalHeaderDefaultSectionSize">
|
<attribute name="verticalHeaderDefaultSectionSize">
|
||||||
<number>22</number>
|
<number>22</number>
|
||||||
</attribute>
|
</attribute>
|
||||||
<attribute name="verticalHeaderVisible">
|
|
||||||
<bool>false</bool>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="verticalHeaderDefaultSectionSize">
|
|
||||||
<number>22</number>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="horizontalHeaderVisible">
|
|
||||||
<bool>false</bool>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" rowspan="2">
|
<item row="2" column="0" rowspan="2">
|
||||||
|
@ -835,7 +826,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
<string>Tags</string>
|
<string>Tags</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/tag24.png</normaloff>:/images/tag24.png</iconset>
|
<normaloff>:/images/tag24.png</normaloff>:/images/tag24.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="flat">
|
<property name="flat">
|
||||||
|
@ -923,41 +914,10 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QScrollArea" name="hashBox">
|
<widget class="HashBox" name="hashBox">
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>560</width>
|
|
||||||
<height>57</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>46</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -1006,7 +966,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
</widget>
|
</widget>
|
||||||
<action name="actionSend">
|
<action name="actionSend">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/send24.png</normaloff>:/images/send24.png</iconset>
|
<normaloff>:/images/send24.png</normaloff>:/images/send24.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -1018,7 +978,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionReply">
|
<action name="actionReply">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/replymail24.png</normaloff>:/images/replymail24.png</iconset>
|
<normaloff>:/images/replymail24.png</normaloff>:/images/replymail24.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -1027,7 +987,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionContactsView">
|
<action name="actionContactsView">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/contacts24.png</normaloff>:/images/contacts24.png</iconset>
|
<normaloff>:/images/contacts24.png</normaloff>:/images/contacts24.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -1039,7 +999,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionSaveas">
|
<action name="actionSaveas">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/save24.png</normaloff>:/images/save24.png</iconset>
|
<normaloff>:/images/save24.png</normaloff>:/images/save24.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -1051,7 +1011,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionAttach">
|
<action name="actionAttach">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/attach.png</normaloff>:/images/attach.png</iconset>
|
<normaloff>:/images/attach.png</normaloff>:/images/attach.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -1066,7 +1026,7 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset>
|
<iconset resource="../images.qrc">
|
||||||
<normaloff>:/images/quote_24.png</normaloff>:/images/quote_24.png</iconset>
|
<normaloff>:/images/quote_24.png</normaloff>:/images/quote_24.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -1077,6 +1037,14 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>HashBox</class>
|
||||||
|
<extends>QScrollArea</extends>
|
||||||
|
<header location="global">gui/common/HashBox.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>recipientWidget</tabstop>
|
<tabstop>recipientWidget</tabstop>
|
||||||
<tabstop>titleEdit</tabstop>
|
<tabstop>titleEdit</tabstop>
|
||||||
|
@ -1093,6 +1061,8 @@ border: 1px solid #CCCCCC;}</string>
|
||||||
<tabstop>comboFont</tabstop>
|
<tabstop>comboFont</tabstop>
|
||||||
<tabstop>hashBox</tabstop>
|
<tabstop>hashBox</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="../images.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
Binary file not shown.
|
@ -219,6 +219,11 @@ p, li { white-space: pre-wrap; }
|
||||||
<source>Cancel Download</source>
|
<source>Cancel Download</source>
|
||||||
<translation>Download abbrechen</translation>
|
<translation>Download abbrechen</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../gui/feeds/AttachFileItem.cpp" line="+230"/>
|
||||||
|
<source>[ERROR])</source>
|
||||||
|
<translation>[Fehler]</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>AvatarWidget</name>
|
<name>AvatarWidget</name>
|
||||||
|
@ -2423,12 +2428,12 @@ p, li { white-space: pre-wrap; }
|
||||||
<context>
|
<context>
|
||||||
<name>CreateForumMsg</name>
|
<name>CreateForumMsg</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/forums/CreateForumMsg.ui" line="+333"/>
|
<location filename="../gui/forums/CreateForumMsg.ui" line="+308"/>
|
||||||
<source>Post Forum Msg</source>
|
<source>Post Forum Msg</source>
|
||||||
<translation>Forumbeitrag schreiben</translation>
|
<translation>Forumbeitrag schreiben</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-274"/>
|
<location line="-249"/>
|
||||||
<source>Forum</source>
|
<source>Forum</source>
|
||||||
<translation>Forum</translation>
|
<translation>Forum</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -2448,18 +2453,18 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Betreff</translation>
|
<translation>Betreff</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+265"/>
|
<location line="+240"/>
|
||||||
<source>Close</source>
|
<source>Close</source>
|
||||||
<translation>Schliessen</translation>
|
<translation>Schliessen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-325"/>
|
<location line="-300"/>
|
||||||
<source>Post Forum Message</source>
|
<source>Post Forum Message</source>
|
||||||
<translation>Erstelle Forumbeitrag</translation>
|
<translation>Erstelle Forumbeitrag</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+185"/>
|
<location line="+185"/>
|
||||||
<location filename="../gui/forums/CreateForumMsg.cpp" line="+73"/>
|
<location filename="../gui/forums/CreateForumMsg.cpp" line="+76"/>
|
||||||
<source>Paste RetroShare Link</source>
|
<source>Paste RetroShare Link</source>
|
||||||
<translation>RetroShare Link einfügen</translation>
|
<translation>RetroShare Link einfügen</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -2499,25 +2504,21 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Hänge Dateien mit Drag'n'Drop an</translation>
|
<translation>Hänge Dateien mit Drag'n'Drop an</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+6"/>
|
<location line="+12"/>
|
||||||
<source>You can attach files via drag and drop here in this window</source>
|
<source>You can attach files via drag and drop here in this window</source>
|
||||||
<translation>Du kannst Dateien mit Drag'n'Drop anhängen</translation>
|
<translation>Du kannst Dateien mit Drag'n'Drop anhängen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/forums/CreateForumMsg.cpp" line="+88"/>
|
|
||||||
<location line="+6"/>
|
|
||||||
<source>Drop file error.</source>
|
<source>Drop file error.</source>
|
||||||
<translation>Dateifehler bei Drag'n'Drop.</translation>
|
<translation type="obsolete">Dateifehler bei Drag'n'Drop.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+0"/>
|
|
||||||
<source>File not found or file name not accepted.</source>
|
<source>File not found or file name not accepted.</source>
|
||||||
<translation>Datei nicht gefunden oder Dateiname nicht akzeptiert.</translation>
|
<translation type="obsolete">Datei nicht gefunden oder Dateiname nicht akzeptiert.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-6"/>
|
|
||||||
<source>Directory can't be dropped, only files are accepted.</source>
|
<source>Directory can't be dropped, only files are accepted.</source>
|
||||||
<translation>Ordner können nicht für Drag'n'Drop genutzt werden. Nur Dateien werden akzeptiert.</translation>
|
<translation type="obsolete">Ordner können nicht für Drag'n'Drop genutzt werden. Nur Dateien werden akzeptiert.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
|
@ -3521,10 +3522,64 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Direkte Freund-Übertragung / Verfügbarkeit angenommen</translation>
|
<translation>Direkte Freund-Übertragung / Verfügbarkeit angenommen</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>FilesDefs</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../gui/common/FilesDefs.cpp" line="+33"/>
|
||||||
|
<source>Picture</source>
|
||||||
|
<translation>Bild</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+4"/>
|
||||||
|
<source>Video</source>
|
||||||
|
<translation>Video</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+2"/>
|
||||||
|
<source>Audio</source>
|
||||||
|
<translation>Audio</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+4"/>
|
||||||
|
<source>Archive</source>
|
||||||
|
<translation>Archiv</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+4"/>
|
||||||
|
<source>Program</source>
|
||||||
|
<translation>Programm</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+2"/>
|
||||||
|
<source>CD/DVD-Image</source>
|
||||||
|
<translation>CD/DVD-Abbild</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+5"/>
|
||||||
|
<location line="+2"/>
|
||||||
|
<source>Document</source>
|
||||||
|
<translation>Dokument</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+2"/>
|
||||||
|
<source>RetroShare collection file</source>
|
||||||
|
<translation>Kollektion</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+2"/>
|
||||||
|
<source>Subtitles</source>
|
||||||
|
<translation>Untertitel</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+2"/>
|
||||||
|
<source>Nintendo DS Rom</source>
|
||||||
|
<translation>Nintendo DS Rom</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FlatStyle_RDM</name>
|
<name>FlatStyle_RDM</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/RemoteDirModel.cpp" line="+674"/>
|
<location filename="../gui/RemoteDirModel.cpp" line="+646"/>
|
||||||
<source>Friends Directories</source>
|
<source>Friends Directories</source>
|
||||||
<translation>Dateien von Freunden</translation>
|
<translation>Dateien von Freunden</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -4430,12 +4485,12 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Gruppenchat</translation>
|
<translation>Gruppenchat</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+465"/>
|
<location line="+456"/>
|
||||||
<source>Messages entered here are sent to all connected friends</source>
|
<source>Messages entered here are sent to all connected friends</source>
|
||||||
<translation>Nachrichten, die Du hier eingibst, werden an alle verbundenen Freunde versendet</translation>
|
<translation>Nachrichten, die Du hier eingibst, werden an alle verbundenen Freunde versendet</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-378"/>
|
<location line="-369"/>
|
||||||
<source>Bold</source>
|
<source>Bold</source>
|
||||||
<translation>Fett</translation>
|
<translation>Fett</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -4470,7 +4525,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Senden</translation>
|
<translation>Senden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+113"/>
|
<location line="+117"/>
|
||||||
<source>Clear Chat History</source>
|
<source>Clear Chat History</source>
|
||||||
<translation>Nachrichtenverlauf leeren</translation>
|
<translation>Nachrichtenverlauf leeren</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -4591,7 +4646,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Löscht den gespeicherten und angezeigten Chat Verlauf</translation>
|
<translation>Löscht den gespeicherten und angezeigten Chat Verlauf</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/FriendsDialog.cpp" line="+89"/>
|
<location filename="../gui/FriendsDialog.cpp" line="+88"/>
|
||||||
<source>Profile</source>
|
<source>Profile</source>
|
||||||
<translation>Profil</translation>
|
<translation>Profil</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -4601,12 +4656,12 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Neuigkeiten</translation>
|
<translation>Neuigkeiten</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+31"/>
|
<location line="+33"/>
|
||||||
<source>Welcome to RetroShare's group chat.</source>
|
<source>Welcome to RetroShare's group chat.</source>
|
||||||
<translation>Willkommen bei RetroShare's Gruppenchat.</translation>
|
<translation>Willkommen bei RetroShare's Gruppenchat.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+64"/>
|
<location line="+66"/>
|
||||||
<source>me</source>
|
<source>me</source>
|
||||||
<translation>ich</translation>
|
<translation>ich</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -4741,23 +4796,19 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Zusätzliche Datei hinzufügen</translation>
|
<translation>Zusätzliche Datei hinzufügen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+97"/>
|
|
||||||
<location line="+6"/>
|
|
||||||
<source>Drop file error.</source>
|
<source>Drop file error.</source>
|
||||||
<translation>Dateifehler bei Drag'n'Drop.</translation>
|
<translation type="obsolete">Dateifehler bei Drag'n'Drop.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-6"/>
|
|
||||||
<source>Directory can't be dropped, only files are accepted.</source>
|
<source>Directory can't be dropped, only files are accepted.</source>
|
||||||
<translation>Ordner können nicht für Drag'n'Drop genutzt werden. Nur Dateien werden akzeptiert.</translation>
|
<translation type="obsolete">Ordner können nicht für Drag'n'Drop genutzt werden. Nur Dateien werden akzeptiert.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+6"/>
|
|
||||||
<source>File not found or file name not accepted.</source>
|
<source>File not found or file name not accepted.</source>
|
||||||
<translation>Datei nicht gefunden oder Dateiname nicht akzeptiert.</translation>
|
<translation type="obsolete">Datei nicht gefunden oder Dateiname nicht akzeptiert.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+51"/>
|
<location line="+57"/>
|
||||||
<source>Save as...</source>
|
<source>Save as...</source>
|
||||||
<translation>Speichern unter...</translation>
|
<translation>Speichern unter...</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -5649,6 +5700,25 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>im Bereich</translation>
|
<translation>im Bereich</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>HashBox</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../gui/common/HashBox.cpp" line="+126"/>
|
||||||
|
<location line="+6"/>
|
||||||
|
<source>Drop file error.</source>
|
||||||
|
<translation>Dateifehler bei Drag'n'Drop.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="-6"/>
|
||||||
|
<source>Directory can't be dropped, only files are accepted.</source>
|
||||||
|
<translation>Ordner können nicht für Drag'n'Drop genutzt werden. Nur Dateien werden akzeptiert.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location line="+6"/>
|
||||||
|
<source>File not found or file name not accepted.</source>
|
||||||
|
<translation>Datei nicht gefunden oder Dateiname nicht akzeptiert.</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>HelpBrowser</name>
|
<name>HelpBrowser</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -6423,18 +6493,18 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
|
||||||
<name>MessageComposer</name>
|
<name>MessageComposer</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/msgs/MessageComposer.ui" line="+17"/>
|
<location filename="../gui/msgs/MessageComposer.ui" line="+17"/>
|
||||||
<location filename="../gui/msgs/MessageComposer.cpp" line="+832"/>
|
<location filename="../gui/msgs/MessageComposer.cpp" line="+836"/>
|
||||||
<source>Compose</source>
|
<source>Compose</source>
|
||||||
<translation>Verfassen</translation>
|
<translation>Verfassen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+49"/>
|
<location line="+49"/>
|
||||||
<location line="+968"/>
|
<location line="+928"/>
|
||||||
<source>Contacts</source>
|
<source>Contacts</source>
|
||||||
<translation>Kontakte</translation>
|
<translation>Kontakte</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-953"/>
|
<location line="-913"/>
|
||||||
<source>Search for Name:</source>
|
<source>Search for Name:</source>
|
||||||
<translation>Suche Name:</translation>
|
<translation>Suche Name:</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -6464,12 +6534,12 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
|
||||||
<translation>>> Bcc</translation>
|
<translation>>> Bcc</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+573"/>
|
<location line="+564"/>
|
||||||
<source>Subject:</source>
|
<source>Subject:</source>
|
||||||
<translation>Betreff:</translation>
|
<translation>Betreff:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-493"/>
|
<location line="-484"/>
|
||||||
<source>Paragraph</source>
|
<source>Paragraph</source>
|
||||||
<translation>Absatz</translation>
|
<translation>Absatz</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -6540,18 +6610,18 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
|
||||||
<translation>Unterstrichen</translation>
|
<translation>Unterstrichen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+111"/>
|
<location line="+102"/>
|
||||||
<source>Tags:</source>
|
<source>Tags:</source>
|
||||||
<translation>Schlagwörter:</translation>
|
<translation>Schlagwörter:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+16"/>
|
<location line="+16"/>
|
||||||
<location filename="../gui/msgs/MessageComposer.cpp" line="-533"/>
|
<location filename="../gui/msgs/MessageComposer.cpp" line="-535"/>
|
||||||
<source>Tags</source>
|
<source>Tags</source>
|
||||||
<translation>Schlagwörter</translation>
|
<translation>Schlagwörter</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-330"/>
|
<location line="-321"/>
|
||||||
<source>Italic</source>
|
<source>Italic</source>
|
||||||
<translation>Kursiv</translation>
|
<translation>Kursiv</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -6576,7 +6646,7 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
|
||||||
<translation>Setzt Schriftart auf Codestil</translation>
|
<translation>Setzt Schriftart auf Codestil</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/msgs/MessageComposer.cpp" line="+1091"/>
|
<location filename="../gui/msgs/MessageComposer.cpp" line="+1093"/>
|
||||||
<source>To</source>
|
<source>To</source>
|
||||||
<translation>An</translation>
|
<translation>An</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -6591,7 +6661,7 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
|
||||||
<translation>Bcc</translation>
|
<translation>Bcc</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/msgs/MessageComposer.ui" line="+253"/>
|
<location filename="../gui/msgs/MessageComposer.ui" line="+244"/>
|
||||||
<source>Recommended Files</source>
|
<source>Recommended Files</source>
|
||||||
<translation>Empfohlene Dateien</translation>
|
<translation>Empfohlene Dateien</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -6611,7 +6681,7 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
|
||||||
<translation>Prüfsumme</translation>
|
<translation>Prüfsumme</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+93"/>
|
<location line="+62"/>
|
||||||
<source>Send</source>
|
<source>Send</source>
|
||||||
<translation>Senden</translation>
|
<translation>Senden</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -6661,7 +6731,7 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
|
||||||
<translation>Blockquote hinzufügen</translation>
|
<translation>Blockquote hinzufügen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/msgs/MessageComposer.cpp" line="-1180"/>
|
<location filename="../gui/msgs/MessageComposer.cpp" line="-1182"/>
|
||||||
<source>&Left</source>
|
<source>&Left</source>
|
||||||
<translation>&Links</translation>
|
<translation>&Links</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -6681,7 +6751,7 @@ Bitte gib etwas Speicher frei und drücke OK.</translation>
|
||||||
<translation>&Blocksatz</translation>
|
<translation>&Blocksatz</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+218"/>
|
<location line="+220"/>
|
||||||
<location line="+1657"/>
|
<location line="+1657"/>
|
||||||
<source>Save Message</source>
|
<source>Save Message</source>
|
||||||
<translation>Nachricht speichern</translation>
|
<translation>Nachricht speichern</translation>
|
||||||
|
@ -6914,23 +6984,19 @@ Möchtest du die Nachricht speichern ?</translation>
|
||||||
<translation>Zusätzliche Datei hinzufügen</translation>
|
<translation>Zusätzliche Datei hinzufügen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+299"/>
|
|
||||||
<location line="+6"/>
|
|
||||||
<source>Drop file error.</source>
|
<source>Drop file error.</source>
|
||||||
<translation>Dateifehler bei Drag'n'Drop.</translation>
|
<translation type="obsolete">Dateifehler bei Drag'n'Drop.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-6"/>
|
|
||||||
<source>Directory can't be dropped, only files are accepted.</source>
|
<source>Directory can't be dropped, only files are accepted.</source>
|
||||||
<translation>Ordner können nicht für Drag'n'Drop genutzt werden. Nur Dateien werden akzeptiert.</translation>
|
<translation type="obsolete">Ordner können nicht für Drag'n'Drop genutzt werden. Nur Dateien werden akzeptiert.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+6"/>
|
|
||||||
<source>File not found or file name not accepted.</source>
|
<source>File not found or file name not accepted.</source>
|
||||||
<translation>Datei nicht gefunden oder Dateiname nicht akzeptiert.</translation>
|
<translation type="obsolete">Datei nicht gefunden oder Dateiname nicht akzeptiert.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-2124"/>
|
<location line="-1819"/>
|
||||||
<source>Friend Recommendation(s)</source>
|
<source>Friend Recommendation(s)</source>
|
||||||
<translation>Freundempfehlung(en)</translation>
|
<translation>Freundempfehlung(en)</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -8975,7 +9041,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<context>
|
<context>
|
||||||
<name>PopupChatDialog</name>
|
<name>PopupChatDialog</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/chat/PopupChatDialog.cpp" line="+708"/>
|
<location filename="../gui/chat/PopupChatDialog.cpp" line="+706"/>
|
||||||
<source>Hide Avatar</source>
|
<source>Hide Avatar</source>
|
||||||
<translation>Avatar verstecken</translation>
|
<translation>Avatar verstecken</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -8995,40 +9061,39 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Lade Bilddatei</translation>
|
<translation>Lade Bilddatei</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+155"/>
|
|
||||||
<source>File not found or file name not accepted.</source>
|
<source>File not found or file name not accepted.</source>
|
||||||
<translation>Datei nicht gefunden oder Dateiname nicht akzeptiert.</translation>
|
<translation type="obsolete">Datei nicht gefunden oder Dateiname nicht akzeptiert.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+89"/>
|
<location line="+102"/>
|
||||||
<source>Messages you send will be delivered after Friend is again Online</source>
|
<source>Messages you send will be delivered after Friend is again Online</source>
|
||||||
<translation>Nachrichten, die Du versendest gehen bei diesem Freund erst wieder ein wenn er Online ist</translation>
|
<translation>Nachrichten, die Du versendest gehen bei diesem Freund erst wieder ein wenn er Online ist</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/chat/PopupChatDialog.ui" line="+561"/>
|
<location filename="../gui/chat/PopupChatDialog.ui" line="+564"/>
|
||||||
<location line="+278"/>
|
<location line="+285"/>
|
||||||
<source>Bold</source>
|
<source>Bold</source>
|
||||||
<translation>Fett</translation>
|
<translation>Fett</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-243"/>
|
<location line="-250"/>
|
||||||
<location line="+253"/>
|
<location line="+260"/>
|
||||||
<source>Underline</source>
|
<source>Underline</source>
|
||||||
<translation>Unterstrichen</translation>
|
<translation>Unterstrichen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-218"/>
|
<location line="-225"/>
|
||||||
<location line="+213"/>
|
<location line="+220"/>
|
||||||
<source>Italic</source>
|
<source>Italic</source>
|
||||||
<translation>Kursiv</translation>
|
<translation>Kursiv</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-143"/>
|
<location line="-150"/>
|
||||||
<source>Text Color</source>
|
<source>Text Color</source>
|
||||||
<translation>Textfarbe</translation>
|
<translation>Textfarbe</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+183"/>
|
<location line="+190"/>
|
||||||
<source>Clear offline messages</source>
|
<source>Clear offline messages</source>
|
||||||
<translation>Entferne offline Nachrichten</translation>
|
<translation>Entferne offline Nachrichten</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -9048,12 +9113,12 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Nachrichtenverlauf leeren</translation>
|
<translation>Nachrichtenverlauf leeren</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-197"/>
|
<location line="-204"/>
|
||||||
<source>Font</source>
|
<source>Font</source>
|
||||||
<translation>Schriftart</translation>
|
<translation>Schriftart</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+235"/>
|
<location line="+242"/>
|
||||||
<source>Delete Chat History</source>
|
<source>Delete Chat History</source>
|
||||||
<translation>Nachrichtenverlauf löschen</translation>
|
<translation>Nachrichtenverlauf löschen</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -9063,12 +9128,12 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Löscht den gespeicherten und angezeigten Chat Verlauf</translation>
|
<translation>Löscht den gespeicherten und angezeigten Chat Verlauf</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-402"/>
|
<location line="-409"/>
|
||||||
<source>Send</source>
|
<source>Send</source>
|
||||||
<translation>Senden</translation>
|
<translation>Senden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+369"/>
|
<location line="+376"/>
|
||||||
<source>Disable Emoticons</source>
|
<source>Disable Emoticons</source>
|
||||||
<translation>Deaktiviere Emoticons</translation>
|
<translation>Deaktiviere Emoticons</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -9078,34 +9143,31 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Durchgestrichen</translation>
|
<translation>Durchgestrichen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/chat/PopupChatDialog.cpp" line="-253"/>
|
<location filename="../gui/chat/PopupChatDialog.cpp" line="-111"/>
|
||||||
<source>Add Extra File</source>
|
<source>Add Extra File</source>
|
||||||
<translation>Zusätzlich eine Datei hinzufügen</translation>
|
<translation>Zusätzlich eine Datei hinzufügen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+158"/>
|
|
||||||
<location line="+6"/>
|
|
||||||
<source>Drop file error.</source>
|
<source>Drop file error.</source>
|
||||||
<translation>Dateifehler bei Drag'n'Drop.</translation>
|
<translation type="obsolete">Dateifehler bei Drag'n'Drop.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-6"/>
|
|
||||||
<source>Directory can't be dropped, only files are accepted.</source>
|
<source>Directory can't be dropped, only files are accepted.</source>
|
||||||
<translation>Ordner können nicht für Drag'n'Drop genutzt werden. Nur Dateien werden akzeptiert.</translation>
|
<translation type="obsolete">Ordner können nicht für Drag'n'Drop genutzt werden. Nur Dateien werden akzeptiert.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/chat/PopupChatDialog.ui" line="-388"/>
|
<location filename="../gui/chat/PopupChatDialog.ui" line="-395"/>
|
||||||
<source>Add a File for your Friend</source>
|
<source>Add a File for your Friend</source>
|
||||||
<translation>Füge eine Datei für deinen Freund hinzu</translation>
|
<translation>Füge eine Datei für deinen Freund hinzu</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+410"/>
|
<location line="+417"/>
|
||||||
<location line="+3"/>
|
<location line="+3"/>
|
||||||
<source>Save Chat History</source>
|
<source>Save Chat History</source>
|
||||||
<translation>Nachrichtenverlauf speichern</translation>
|
<translation>Nachrichtenverlauf speichern</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/chat/PopupChatDialog.cpp" line="+61"/>
|
<location filename="../gui/chat/PopupChatDialog.cpp" line="+77"/>
|
||||||
<source>Save as...</source>
|
<source>Save as...</source>
|
||||||
<translation>Speichern unter...</translation>
|
<translation>Speichern unter...</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -9115,18 +9177,18 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Text Datei (*.txt );;Alle Dateien (*)</translation>
|
<translation>Text Datei (*.txt );;Alle Dateien (*)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-647"/>
|
<location line="-505"/>
|
||||||
<source>Your Friend is offline
|
<source>Your Friend is offline
|
||||||
Do you want to send them a Message instead</source>
|
Do you want to send them a Message instead</source>
|
||||||
<translation>Dein Freund ist Offline. Möchtest du ihm stattdessen eine Nachricht senden</translation>
|
<translation>Dein Freund ist Offline. Möchtest du ihm stattdessen eine Nachricht senden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/chat/PopupChatDialog.ui" line="-445"/>
|
<location filename="../gui/chat/PopupChatDialog.ui" line="-452"/>
|
||||||
<source>Attach a Picture</source>
|
<source>Attach a Picture</source>
|
||||||
<translation>Bild anhängen</translation>
|
<translation>Bild anhängen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/chat/PopupChatDialog.cpp" line="+686"/>
|
<location filename="../gui/chat/PopupChatDialog.cpp" line="+544"/>
|
||||||
<source>is Idle and may not reply</source>
|
<source>is Idle and may not reply</source>
|
||||||
<translation>antwortet möglicherweise nicht, da der Status auf "Untätig" gesetzt wurde</translation>
|
<translation>antwortet möglicherweise nicht, da der Status auf "Untätig" gesetzt wurde</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -9146,7 +9208,7 @@ Do you want to send them a Message instead</source>
|
||||||
<translation>ist Offline.</translation>
|
<translation>ist Offline.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-652"/>
|
<location line="-510"/>
|
||||||
<source>Paste RetroShare Link</source>
|
<source>Paste RetroShare Link</source>
|
||||||
<translation>RetroShare Link einfügen</translation>
|
<translation>RetroShare Link einfügen</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -10439,7 +10501,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<context>
|
<context>
|
||||||
<name>RetroshareDirModel</name>
|
<name>RetroshareDirModel</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/RemoteDirModel.cpp" line="-478"/>
|
<location filename="../gui/RemoteDirModel.cpp" line="-449"/>
|
||||||
<source>Anonymous</source>
|
<source>Anonymous</source>
|
||||||
<translation>Anonym</translation>
|
<translation>Anonym</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -10544,7 +10606,7 @@ p, li { white-space: pre-wrap; }
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+0"/>
|
<location line="+0"/>
|
||||||
<location line="+30"/>
|
<location line="+31"/>
|
||||||
<source>Collection files</source>
|
<source>Collection files</source>
|
||||||
<translation>Kollektion</translation>
|
<translation>Kollektion</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -10687,7 +10749,7 @@ p, li { white-space: pre-wrap; }
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+319"/>
|
<location line="+319"/>
|
||||||
<location filename="../gui/SearchDialog.cpp" line="+292"/>
|
<location filename="../gui/SearchDialog.cpp" line="+293"/>
|
||||||
<source>Download</source>
|
<source>Download</source>
|
||||||
<translation>Herunterladen</translation>
|
<translation>Herunterladen</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -10718,13 +10780,13 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Alle entfernen</translation>
|
<translation>Alle entfernen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+380"/>
|
<location line="+379"/>
|
||||||
<location line="+68"/>
|
<location line="+68"/>
|
||||||
<source>Folder</source>
|
<source>Folder</source>
|
||||||
<translation>Ordner</translation>
|
<translation>Ordner</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+471"/>
|
<location line="+396"/>
|
||||||
<source>New RetroShare Link(s)</source>
|
<source>New RetroShare Link(s)</source>
|
||||||
<translation>Neu(e) RetroShare Link(s)</translation>
|
<translation>Neu(e) RetroShare Link(s)</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -10779,7 +10841,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Such ID</translation>
|
<translation>Such ID</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/SearchDialog.cpp" line="-997"/>
|
<location filename="../gui/SearchDialog.cpp" line="-921"/>
|
||||||
<source>Download Notice</source>
|
<source>Download Notice</source>
|
||||||
<translation>Download</translation>
|
<translation>Download</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -12743,7 +12805,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<context>
|
<context>
|
||||||
<name>TransfersDialog</name>
|
<name>TransfersDialog</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/TransfersDialog.cpp" line="+338"/>
|
<location filename="../gui/TransfersDialog.cpp" line="+339"/>
|
||||||
<source>Cancel</source>
|
<source>Cancel</source>
|
||||||
<translation>Abbrechen</translation>
|
<translation>Abbrechen</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -12941,7 +13003,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Blockstrategie</translation>
|
<translation>Blockstrategie</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+401"/>
|
<location line="+365"/>
|
||||||
<source>Queued</source>
|
<source>Queued</source>
|
||||||
<translation>In Warteschleife</translation>
|
<translation>In Warteschleife</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -12951,12 +13013,12 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Pausiert</translation>
|
<translation>Pausiert</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-138"/>
|
<location line="-137"/>
|
||||||
<source>Transferring</source>
|
<source>Transferring</source>
|
||||||
<translation>Übertrage</translation>
|
<translation>Übertrage</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+369"/>
|
<location line="+368"/>
|
||||||
<source>RetroShare</source>
|
<source>RetroShare</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -12991,7 +13053,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Soll dieser Download wirklich abgebrochen und gelöscht werden?</translation>
|
<translation>Soll dieser Download wirklich abgebrochen und gelöscht werden?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-937"/>
|
<location line="-901"/>
|
||||||
<source>Speed / Queue position</source>
|
<source>Speed / Queue position</source>
|
||||||
<translation>Geschwindigkeits- / Warteschlangenposition</translation>
|
<translation>Geschwindigkeits- / Warteschlangenposition</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -13044,38 +13106,38 @@ p, li { white-space: pre-wrap; }
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+12"/>
|
<location line="+12"/>
|
||||||
<location line="+541"/>
|
<location line="+505"/>
|
||||||
<source>Slower</source>
|
<source>Slower</source>
|
||||||
<translation>Langsamer</translation>
|
<translation>Langsamer</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-539"/>
|
<location line="-503"/>
|
||||||
<location line="+540"/>
|
<location line="+504"/>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>Average</source>
|
<source>Average</source>
|
||||||
<translation>Durchschnitt</translation>
|
<translation>Durchschnitt</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-540"/>
|
<location line="-504"/>
|
||||||
<location line="+539"/>
|
<location line="+503"/>
|
||||||
<source>Faster</source>
|
<source>Faster</source>
|
||||||
<translation>Schneller</translation>
|
<translation>Schneller</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-429"/>
|
<location line="-393"/>
|
||||||
<source>Move in Queue...</source>
|
<source>Move in Queue...</source>
|
||||||
<translation>Verschiebe in Warteschlange...</translation>
|
<translation>Verschiebe in Warteschlange...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+265"/>
|
<location line="+230"/>
|
||||||
<location line="+144"/>
|
<location line="+143"/>
|
||||||
<location line="+135"/>
|
<location line="+135"/>
|
||||||
<source>Failed</source>
|
<source>Failed</source>
|
||||||
<translation>Gescheitert</translation>
|
<translation>Gescheitert</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-275"/>
|
<location line="-274"/>
|
||||||
<location line="+141"/>
|
<location line="+140"/>
|
||||||
<location line="+135"/>
|
<location line="+135"/>
|
||||||
<source>Okay</source>
|
<source>Okay</source>
|
||||||
<translation>OK</translation>
|
<translation>OK</translation>
|
||||||
|
@ -13092,8 +13154,8 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Ladend</translation>
|
<translation>Ladend</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-131"/>
|
<location line="-130"/>
|
||||||
<location line="+132"/>
|
<location line="+131"/>
|
||||||
<location line="+135"/>
|
<location line="+135"/>
|
||||||
<location line="+1"/>
|
<location line="+1"/>
|
||||||
<source>Complete</source>
|
<source>Complete</source>
|
||||||
|
@ -13120,7 +13182,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<translation>Überprüfe...</translation>
|
<translation>Überprüfe...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-566"/>
|
<location line="-530"/>
|
||||||
<source>Force Check</source>
|
<source>Force Check</source>
|
||||||
<translation>Erzwinge Überprüfung</translation>
|
<translation>Erzwinge Überprüfung</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -13128,7 +13190,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<context>
|
<context>
|
||||||
<name>TreeStyle_RDM</name>
|
<name>TreeStyle_RDM</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui/RemoteDirModel.cpp" line="+111"/>
|
<location filename="../gui/RemoteDirModel.cpp" line="+82"/>
|
||||||
<source>My files</source>
|
<source>My files</source>
|
||||||
<translation>Meine Dateien</translation>
|
<translation>Meine Dateien</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue