Added attaching files to Public Chat via Button/Drag and Drop

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2168 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-01-31 22:29:30 +00:00
parent 470ec8d11a
commit 1600831e16
4 changed files with 593 additions and 220 deletions

View File

@ -45,6 +45,7 @@
#include <sstream> #include <sstream>
#include <time.h> #include <time.h>
#include <sys/stat.h>
#include <QTextCodec> #include <QTextCodec>
#include <QTextEdit> #include <QTextEdit>
@ -62,7 +63,8 @@
#include <QMessageBox> #include <QMessageBox>
#include <QHeaderView> #include <QHeaderView>
#include <QtGui/QKeyEvent> #include <QtGui/QKeyEvent>
#include <QHashIterator>
#include <QDesktopServices>
/* Images for context menu icons */ /* Images for context menu icons */
#define IMAGE_REMOVEFRIEND ":/images/removefriend16.png" #define IMAGE_REMOVEFRIEND ":/images/removefriend16.png"
@ -106,10 +108,12 @@ PeersDialog::PeersDialog(QWidget *parent)
connect( ui.mypersonalstatuslabel, SIGNAL(clicked()), SLOT(statusmessage())); connect( ui.mypersonalstatuslabel, SIGNAL(clicked()), SLOT(statusmessage()));
connect( ui.actionSet_your_Avatar, SIGNAL(triggered()), this, SLOT(getAvatar())); connect( ui.actionSet_your_Avatar, SIGNAL(triggered()), this, SLOT(getAvatar()));
connect( ui.actionSet_your_Personal_Message, SIGNAL(triggered()), this, SLOT(statusmessage())); connect( ui.actionSet_your_Personal_Message, SIGNAL(triggered()), this, SLOT(statusmessage()));
connect( ui.addfileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
connect( ui.msgText, SIGNAL(anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
connect(ui.hide_unconnected, SIGNAL(clicked()), this, SLOT(insertPeers())); connect(ui.hide_unconnected, SIGNAL(clicked()), this, SLOT(insertPeers()));
ui.peertabWidget->setTabPosition(QTabWidget::East); ui.peertabWidget->setTabPosition(QTabWidget::North);
ui.peertabWidget->addTab(new ProfileWidget(),QString(tr("Profile"))); ui.peertabWidget->addTab(new ProfileWidget(),QString(tr("Profile")));
ui.peertreeWidget->setColumnCount(4); ui.peertreeWidget->setColumnCount(4);
@ -133,8 +137,6 @@ PeersDialog::PeersDialog(QWidget *parent)
headerItem->setTextAlignment(1, Qt::AlignLeft | Qt::AlignVCenter); headerItem->setTextAlignment(1, Qt::AlignLeft | Qt::AlignVCenter);
headerItem->setTextAlignment(2, Qt::AlignHCenter | Qt::AlignVCenter); headerItem->setTextAlignment(2, Qt::AlignHCenter | Qt::AlignVCenter);
loadEmoticonsgroupchat();
connect(ui.lineEdit, SIGNAL(textChanged ( ) ), this, SLOT(checkChat( ) )); connect(ui.lineEdit, SIGNAL(textChanged ( ) ), this, SLOT(checkChat( ) ));
connect(ui.Sendbtn, SIGNAL(clicked()), this, SLOT(sendMsg())); connect(ui.Sendbtn, SIGNAL(clicked()), this, SLOT(sendMsg()));
connect(ui.emoticonBtn, SIGNAL(clicked()), this, SLOT(smileyWidgetgroupchat())); connect(ui.emoticonBtn, SIGNAL(clicked()), this, SLOT(smileyWidgetgroupchat()));
@ -189,8 +191,15 @@ PeersDialog::PeersDialog(QWidget *parent)
ui.menupushButton->setMenu(menu); ui.menupushButton->setMenu(menu);
ui.msgText->setOpenExternalLinks ( false );
ui.msgText->setOpenLinks ( false );
setAcceptDrops(true);
ui.lineEdit->setAcceptDrops(false);
updateAvatar(); updateAvatar();
loadmypersonalstatus(); loadmypersonalstatus();
loadEmoticonsgroupchat();
/* Hide platform specific features */ /* Hide platform specific features */
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
@ -1481,3 +1490,234 @@ void PeersDialog::statusmessage()
static StatusMessage *statusmsgdialog = new StatusMessage(); static StatusMessage *statusmsgdialog = new StatusMessage();
statusmsgdialog->show(); statusmsgdialog->show();
} }
void PeersDialog::addExtraFile()
{
// select a file
QString qfile = QFileDialog::getOpenFileName(this, tr("Add Extra File"), "", "", 0,
QFileDialog::DontResolveSymlinks);
std::string filePath = qfile.toStdString();
if (filePath != "")
{
PeersDialog::addAttachment(filePath);
}
}
void PeersDialog::addAttachment(std::string filePath) {
/* add a AttachFileItem to the attachment section */
std::cerr << "PopupChatDialog::addExtraFile() hashing file.";
std::cerr << 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 PeersDialog::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;
}
ChatInfo ci;
{
rsiface->lockData(); /* Lock Interface */
const RsConfig &conf = rsiface->getConfig();
ci.rsid = conf.ownId;
ci.name = conf.ownName;
rsiface->unlockData(); /* Unlock Interface */
}
//convert fileSize from uint_64 to string for html link
char fileSizeChar [100];
sprintf(fileSizeChar, "%lld", file->FileSize());
std::string fileSize = *(&fileSizeChar);
std::string mesgString = "<a href='retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "'>"
+ "retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "</a>";
#ifdef CHAT_DEBUG
std::cerr << "CreateForumMsg::anchorClicked mesgString : " << mesgString << std::endl;
#endif
const char * messageString = mesgString.c_str ();
//convert char massageString to w_char
wchar_t* message;
int requiredSize = mbstowcs(NULL, messageString, 0); // C4996
/* Add one to leave room for the NULL terminator */
message = (wchar_t *)malloc( (requiredSize + 1) * sizeof( wchar_t ));
if (! message) {
std::cerr << ("Memory allocation failure.\n");
}
int size = mbstowcs( message, messageString, requiredSize + 1); // C4996
if (size == (size_t) (-1)) {
printf("Couldn't convert string--invalid multibyte character.\n");
}
ci.msg = message;
ci.chatflags = RS_CHAT_PUBLIC;
rsMsgs -> ChatSend(ci);
setFont();
}
void PeersDialog::anchorClicked (const QUrl& link )
{
#ifdef FORUM_DEBUG
std::cerr << "ForumsDialog::anchorClicked link.scheme() : " << link.scheme().toStdString() << std::endl;
#endif
if (link.scheme() == "retroshare")
{
QStringList L = link.toString().split("|") ;
std::string fileName = L.at(1).toStdString() ;
uint64_t fileSize = L.at(2).toULongLong();
std::string fileHash = L.at(3).toStdString() ;
#ifdef FORUM_DEBUG
std::cerr << "ForumsDialog::anchorClicked FileRequest : fileName : " << fileName << ". fileHash : " << fileHash << ". fileSize : " << fileSize << std::endl;
#endif
if (fileName != "" && fileHash != "")
{
std::list<std::string> srcIds;
if(rsFiles->FileRequest(fileName, fileHash, fileSize, "", RS_FILE_HINTS_NETWORK_WIDE, srcIds))
{
QMessageBox mb(tr("File Request Confirmation"), tr("The file has been added to your download list."),QMessageBox::Information,QMessageBox::Ok,0,0);
mb.setButtonText( QMessageBox::Ok, "OK" );
mb.exec();
}
else
{
QMessageBox mb(tr("File Request canceled"), tr("The file has not been added to your download list, because you already have it."),QMessageBox::Information,QMessageBox::Ok,0,0);
mb.setButtonText( QMessageBox::Ok, "OK" );
mb.exec();
}
}
else
{
QMessageBox mb(tr("File Request Error"), tr("The file link is malformed."),QMessageBox::Information,QMessageBox::Ok,0,0);
mb.setButtonText( QMessageBox::Ok, "OK" );
mb.exec();
}
}
else if (link.scheme() == "http")
{
QDesktopServices::openUrl(link);
}
else if (link.scheme() == "")
{
//it's probably a web adress, let's add http:// at the beginning of the link
QString newAddress = link.toString();
newAddress.prepend("http://");
QDesktopServices::openUrl(QUrl(newAddress));
}
}
void PeersDialog::dropEvent(QDropEvent *event)
{
if (!(Qt::CopyAction & event->possibleActions()))
{
std::cerr << "PeersDialog::dropEvent() Rejecting uncopyable DropAction";
std::cerr << std::endl;
/* can't do it */
return;
}
std::cerr << "PeersDialog::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 << "PeersDialog::dropEvent() Urls:";
std::cerr << std::endl;
QList<QUrl> urls = event->mimeData()->urls();
QList<QUrl>::iterator uit;
for(uit = urls.begin(); uit != urls.end(); uit++)
{
std::string localpath = uit->toLocalFile().toStdString();
std::cerr << "Whole URL: " << uit->toString().toStdString();
std::cerr << std::endl;
std::cerr << "or As Local File: " << localpath;
std::cerr << std::endl;
if (localpath.size() > 0)
{
struct stat buf;
//Check that the file does exist and is not a directory
if ((-1 == stat(localpath.c_str(), &buf))) {
std::cerr << "PeersDialog::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);
mb.setButtonText( QMessageBox::Ok, "OK" );
mb.exec();
} else if (S_ISDIR(buf.st_mode)) {
std::cerr << "PeersDialog::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);
mb.setButtonText( QMessageBox::Ok, "OK" );
mb.exec();
} else {
PeersDialog::addAttachment(localpath);
}
}
}
}
event->setDropAction(Qt::CopyAction);
event->accept();
}
void PeersDialog::dragEnterEvent(QDragEnterEvent *event)
{
/* print out mimeType */
std::cerr << "PeersDialog::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 << "PeersDialog::dragEnterEvent() Accepting Urls";
std::cerr << std::endl;
event->acceptProposedAction();
}
else
{
std::cerr << "PeersDialog::dragEnterEvent() No Urls";
std::cerr << std::endl;
}
}

View File

@ -42,7 +42,7 @@ class PeersDialog : public RsAutoUpdatePage
{ {
Q_OBJECT Q_OBJECT
public: public:
/** Default Constructor */ /** Default Constructor */
PeersDialog(QWidget *parent = 0); PeersDialog(QWidget *parent = 0);
/** Default Destructor */ /** Default Destructor */
@ -57,7 +57,7 @@ class PeersDialog : public RsAutoUpdatePage
virtual void updateDisplay() ; // overloaded from RsAutoUpdatePage virtual void updateDisplay() ; // overloaded from RsAutoUpdatePage
virtual void keyPressEvent(QKeyEvent *) ; virtual void keyPressEvent(QKeyEvent *) ;
public slots: public slots:
void insertPeers(); void insertPeers();
void toggleSendItem( QTreeWidgetItem *item, int col ); void toggleSendItem( QTreeWidgetItem *item, int col );
@ -66,6 +66,7 @@ class PeersDialog : public RsAutoUpdatePage
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 smileyWidgetgroupchat(); void smileyWidgetgroupchat();
void addSmileys(); void addSmileys();
@ -79,11 +80,15 @@ class PeersDialog : public RsAutoUpdatePage
void updatePeersCustomStateString(const QString& peer_id) ; void updatePeersCustomStateString(const QString& peer_id) ;
void updatePeersAvatar(const QString& peer_id); void updatePeersAvatar(const QString& peer_id);
void updateAvatar(); // called by notifyQt to update the avatar when it gets changed by another component void updateAvatar(); // called by notifyQt to update the avatar when it gets changed by another component
protected:
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dropEvent(QDropEvent *event);
private slots: private slots:
/** Create the context popup menu and it's submenus */ /** Create the context popup menu and it's submenus */
void peertreeWidgetCostumPopupMenu( QPoint point ); void peertreeWidgetCostumPopupMenu( QPoint point );
void updateStatusString(const QString& statusString) ; // called when a peer is typing in group chat void updateStatusString(const QString& statusString) ; // called when a peer is typing in group chat
void updateStatusTyping() ; // called each time a key is hit void updateStatusTyping() ; // called each time a key is hit
@ -114,8 +119,6 @@ class PeersDialog : public RsAutoUpdatePage
void statusmessage(); void statusmessage();
//void privchat();
void setFont(); void setFont();
void getFont(); void getFont();
void underline(); void underline();
@ -128,12 +131,17 @@ class PeersDialog : public RsAutoUpdatePage
void on_actionCreate_New_Channel_activated(); void on_actionCreate_New_Channel_activated();
void loadmypersonalstatus(); void loadmypersonalstatus();
void addExtraFile();
void anchorClicked (const QUrl &);
void addAttachment(std::string);
signals: signals:
void friendsUpdated() ; void friendsUpdated() ;
void notifyGroupChat(const QString&,const QString&) ; void notifyGroupChat(const QString&,const QString&) ;
private: private:
class QLabel *iconLabel, *textLabel; class QLabel *iconLabel, *textLabel;
class QWidget *widget; class QWidget *widget;
class QWidgetAction *widgetAction; class QWidgetAction *widgetAction;

View File

@ -864,207 +864,336 @@ background: white;}</string>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <widget class="QFrame" name="buttonframe">
<item> <property name="maximumSize">
<widget class="QLabel" name="statusStringLabel"> <size>
<property name="text"> <width>16777215</width>
<string/> <height>38</height>
</property> </size>
</widget> </property>
</item> <property name="styleSheet">
<item> <string notr="true"> QFrame#buttonframe{
<spacer> background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
<property name="orientation"> stop:0 #FEFEFE, stop:1 #E8E8E8);
<enum>Qt::Horizontal</enum>
</property> border: 1px solid #CCCCCC;}</string>
<property name="sizeHint" stdset="0"> </property>
<size> <layout class="QHBoxLayout" name="horizontalLayout">
<width>88</width> <property name="margin">
<height>21</height> <number>6</number>
</size> </property>
</property> <item>
</spacer> <widget class="QLabel" name="statusStringLabel">
</item> <property name="text">
<item> <string/>
<widget class="QPushButton" name="emoticonBtn"> </property>
<property name="minimumSize"> </widget>
<size> </item>
<width>24</width> <item>
<height>24</height> <spacer>
</size> <property name="orientation">
</property> <enum>Qt::Horizontal</enum>
<property name="maximumSize"> </property>
<size> <property name="sizeHint" stdset="0">
<width>24</width> <size>
<height>24</height> <width>88</width>
</size> <height>21</height>
</property> </size>
<property name="text"> </property>
<string/> </spacer>
</property> </item>
<property name="icon"> <item>
<iconset resource="images.qrc"> <widget class="QToolButton" name="emoticonBtn">
<normaloff>:/images/emoticons/kopete/kopete020.png</normaloff>:/images/emoticons/kopete/kopete020.png</iconset> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<property name="iconSize"> <horstretch>0</horstretch>
<size> <verstretch>0</verstretch>
<width>24</width> </sizepolicy>
<height>24</height> </property>
</size> <property name="minimumSize">
</property> <size>
</widget> <width>24</width>
</item> <height>24</height>
<item> </size>
<widget class="QPushButton" name="textboldChatButton"> </property>
<property name="minimumSize"> <property name="maximumSize">
<size> <size>
<width>24</width> <width>24</width>
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="text">
<size> <string/>
<width>24</width> </property>
<height>24</height> <property name="icon">
</size> <iconset resource="images.qrc">
</property> <normaloff>:/images/emoticons/kopete/kopete020.png</normaloff>:/images/emoticons/kopete/kopete020.png</iconset>
<property name="toolTip"> </property>
<string>Bold</string> <property name="iconSize">
</property> <size>
<property name="text"> <width>24</width>
<string/> <height>24</height>
</property> </size>
<property name="icon"> </property>
<iconset resource="images.qrc"> <property name="autoRaise">
<normaloff>:/images/edit-bold.png</normaloff>:/images/edit-bold.png</iconset> <bool>true</bool>
</property> </property>
<property name="checkable"> </widget>
<bool>true</bool> </item>
</property> <item>
</widget> <widget class="QToolButton" name="textboldChatButton">
</item> <property name="sizePolicy">
<item> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<widget class="QPushButton" name="textunderlineChatButton"> <horstretch>0</horstretch>
<property name="minimumSize"> <verstretch>0</verstretch>
<size> </sizepolicy>
<width>24</width> </property>
<height>24</height> <property name="minimumSize">
</size> <size>
</property> <width>24</width>
<property name="maximumSize"> <height>24</height>
<size> </size>
<width>24</width> </property>
<height>24</height> <property name="maximumSize">
</size> <size>
</property> <width>24</width>
<property name="toolTip"> <height>24</height>
<string>Underline</string> </size>
</property> </property>
<property name="text"> <property name="toolTip">
<string/> <string>Bold</string>
</property> </property>
<property name="icon"> <property name="text">
<iconset resource="images.qrc"> <string/>
<normaloff>:/images/edit-underline.png</normaloff>:/images/edit-underline.png</iconset> </property>
</property> <property name="icon">
<property name="checkable"> <iconset resource="images.qrc">
<bool>true</bool> <normaloff>:/images/edit-bold.png</normaloff>:/images/edit-bold.png</iconset>
</property> </property>
</widget> <property name="checkable">
</item> <bool>true</bool>
<item> </property>
<widget class="QPushButton" name="textitalicChatButton"> <property name="autoRaise">
<property name="minimumSize"> <bool>true</bool>
<size> </property>
<width>24</width> </widget>
<height>24</height> </item>
</size> <item>
</property> <widget class="QToolButton" name="textunderlineChatButton">
<property name="maximumSize"> <property name="sizePolicy">
<size> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<width>24</width> <horstretch>0</horstretch>
<height>24</height> <verstretch>0</verstretch>
</size> </sizepolicy>
</property> </property>
<property name="toolTip"> <property name="minimumSize">
<string>Italic</string> <size>
</property> <width>24</width>
<property name="text"> <height>24</height>
<string/> </size>
</property> </property>
<property name="icon"> <property name="maximumSize">
<iconset resource="images.qrc"> <size>
<normaloff>:/images/edit-italic.png</normaloff>:/images/edit-italic.png</iconset> <width>24</width>
</property> <height>24</height>
<property name="checkable"> </size>
<bool>true</bool> </property>
</property> <property name="toolTip">
</widget> <string>Underline</string>
</item> </property>
<item> <property name="text">
<widget class="QPushButton" name="fontsButton"> <string/>
<property name="minimumSize"> </property>
<size> <property name="icon">
<width>24</width> <iconset resource="images.qrc">
<height>24</height> <normaloff>:/images/edit-underline.png</normaloff>:/images/edit-underline.png</iconset>
</size> </property>
</property> <property name="checkable">
<property name="maximumSize"> <bool>true</bool>
<size> </property>
<width>24</width> <property name="autoRaise">
<height>24</height> <bool>true</bool>
</size> </property>
</property> </widget>
<property name="toolTip"> </item>
<string>Font</string> <item>
</property> <widget class="QToolButton" name="textitalicChatButton">
<property name="text"> <property name="sizePolicy">
<string/> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
</property> <horstretch>0</horstretch>
</widget> <verstretch>0</verstretch>
</item> </sizepolicy>
<item> </property>
<widget class="QPushButton" name="colorChatButton"> <property name="minimumSize">
<property name="minimumSize"> <size>
<size> <width>24</width>
<width>24</width> <height>24</height>
<height>24</height> </size>
</size> </property>
</property> <property name="maximumSize">
<property name="maximumSize"> <size>
<size> <width>24</width>
<width>24</width> <height>24</height>
<height>24</height> </size>
</size> </property>
</property> <property name="toolTip">
<property name="toolTip"> <string>Italic</string>
<string>Text Color</string> </property>
</property> <property name="text">
<property name="text"> <string/>
<string/> </property>
</property> <property name="icon">
</widget> <iconset resource="images.qrc">
</item> <normaloff>:/images/edit-italic.png</normaloff>:/images/edit-italic.png</iconset>
<item> </property>
<widget class="QPushButton" name="menuButton"> <property name="checkable">
<property name="minimumSize"> <bool>true</bool>
<size> </property>
<width>24</width> <property name="autoRaise">
<height>24</height> <bool>true</bool>
</size> </property>
</property> </widget>
<property name="maximumSize"> </item>
<size> <item>
<width>24</width> <widget class="QToolButton" name="fontsButton">
<height>24</height> <property name="sizePolicy">
</size> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
</property> <horstretch>0</horstretch>
<property name="text"> <verstretch>0</verstretch>
<string/> </sizepolicy>
</property> </property>
</widget> <property name="minimumSize">
</item> <size>
</layout> <width>24</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Font</string>
</property>
<property name="text">
<string/>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="colorChatButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;set Text Color&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="menuButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="autoRaise">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="addfileButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>26</width>
<height>26</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>26</width>
<height>26</height>
</size>
</property>
<property name="toolTip">
<string>Attach File</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item> </item>
<item> <item>
<widget class="QTextEdit" name="lineEdit"> <widget class="QTextEdit" name="lineEdit">
@ -1122,6 +1251,9 @@ background: white;}</string>
</item> </item>
</layout> </layout>
</item> </item>
<item>
<layout class="QVBoxLayout" name="verticalLayout"/>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>

View File

@ -662,18 +662,11 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point )
if(localModel->isDir( midx ) ) if(localModel->isDir( midx ) )
{
contextMnu2.addAction( openfolderAct); contextMnu2.addAction( openfolderAct);
contextMnu2.addSeparator();
contextMnu2.addAction( copylinklocalAct);
contextMnu2.addAction( sendlinkAct);
contextMnu2.addAction( sendhtmllinkAct);
}
else else
{ {
contextMnu2.addAction( menuAction ); contextMnu2.addAction( menuAction );
contextMnu2.addAction( openfileAct); contextMnu2.addAction( openfileAct);
contextMnu2.addAction( openfolderAct);
} }
contextMnu2.addSeparator(); contextMnu2.addSeparator();