add file button to general message; add extra file sending from chat dialog; Add a link when sending a file; Add a link for downloading in the reciever chat dialog; Little gui improvement

Merge branch 'extraFile'


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1181 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2009-05-06 21:15:12 +00:00
parent e34173759e
commit 8e6f082025
8 changed files with 441 additions and 269 deletions

View File

@ -45,9 +45,11 @@ GeneralMsgDialog::GeneralMsgDialog(QWidget *parent, uint32_t type)
connect(addButton, SIGNAL(clicked()), this, SLOT(newDestination()));
connect(typeComboBox, SIGNAL(currentIndexChanged( int )), this, SLOT(updateGroupId()));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(sendMsg()));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(sendMsg()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(cancelMsg()));
connect(addFileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
/* set the type to ...
* const uint32_t GMD_TYPE_MESSAGE_IDX = 0;
* const uint32_t GMD_TYPE_FORUM_IDX = 1;
@ -289,6 +291,23 @@ void GeneralMsgDialog::addAttachment(std::string hash, std::string fname, uint64
}
void GeneralMsgDialog::addExtraFile()
{
/* add a SubFileItem to the attachment section */
std::cerr << "GeneralMsgDialog::addExtraFile() opening file dialog";
std::cerr << std::endl;
// select a file
QString qfile = QFileDialog::getOpenFileName(this, tr("Add Extra File"), "", "", 0,
QFileDialog::DontResolveSymlinks);
std::string filePath = qfile.toStdString();
if (filePath != "")
{
addAttachment(filePath);
}
}
void GeneralMsgDialog::addAttachment(std::string path)
{
/* add a SubFileItem to the attachment section */

View File

@ -54,6 +54,7 @@ virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dropEvent(QDropEvent *event);
private slots:
void addExtraFile();
void checkAttachmentReady();
void updateGroupId();
void newDestination();

View File

@ -1,7 +1,8 @@
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>GeneralMsgDialog</class>
<widget class="QDialog" name="GeneralMsgDialog" >
<property name="geometry" >
<widget class="QDialog" name="GeneralMsgDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@ -9,37 +10,37 @@
<height>516</height>
</rect>
</property>
<property name="acceptDrops" >
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout">
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<widget class="QComboBox" name="typeComboBox" >
<property name="acceptDrops" >
<widget class="QComboBox" name="typeComboBox">
<property name="acceptDrops">
<bool>true</bool>
</property>
<item>
<property name="text" >
<property name="text">
<string>Friend</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>Channel</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>Forum</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>Blog</string>
</property>
</item>
@ -47,13 +48,13 @@
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
@ -62,14 +63,14 @@
</spacer>
</item>
<item>
<widget class="QComboBox" name="destIdComboBox" />
<widget class="QComboBox" name="destIdComboBox"/>
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
@ -78,59 +79,60 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="addButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<widget class="QPushButton" name="addButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<property name="toolTip">
<string>Add Message Destination</string>
</property>
<property name="text" >
<property name="text">
<string/>
</property>
<property name="icon" >
<iconset resource="images.qrc" >:/images/loadcert16.png</iconset>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/loadcert16.png</normaloff>:/images/loadcert16.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QFrame" name="destFrame" >
<property name="acceptDrops" >
<widget class="QFrame" name="destFrame">
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="frameShape" >
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout">
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label_2" >
<property name="text" >
<widget class="QLabel" name="label_2">
<property name="text">
<string/>
</property>
<property name="pixmap" >
<pixmap resource="images.qrc" >:/images/contacts24.png</pixmap>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/contacts24.png</pixmap>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
@ -139,24 +141,24 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="label" >
<property name="font" >
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text" >
<property name="text">
<string>Message Destination</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>271</width>
<height>20</height>
@ -170,122 +172,133 @@
</widget>
</item>
<item>
<widget class="QFrame" name="fileFrame" >
<property name="minimumSize" >
<widget class="QFrame" name="fileFrame">
<property name="minimumSize">
<size>
<width>16</width>
<height>60</height>
</size>
</property>
<property name="acceptDrops" >
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="toolTip" >
<property name="toolTip">
<string>Drag and Drop Files from Search Results</string>
</property>
<property name="frameShape" >
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_3" >
<property name="text" >
<widget class="QLabel" name="label_3">
<property name="text">
<string/>
</property>
<property name="pixmap" >
<pixmap resource="images.qrc" >:/images/attachment.png</pixmap>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/attachment.png</pixmap>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<width>13</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_4" >
<property name="font" >
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text" >
<property name="text">
<string>Attachments</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>271</width>
<width>218</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="addFileButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label_5" >
<property name="font" >
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text" >
<property name="text">
<string>Subject :</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="subjectEdit" />
<widget class="QLineEdit" name="subjectEdit"/>
</item>
</layout>
</item>
<item>
<widget class="QTextEdit" name="msgEdit" />
<widget class="QTextEdit" name="msgEdit"/>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="images.qrc" />
<include location="images.qrc"/>
</resources>
<connections>
<connection>
@ -294,11 +307,11 @@
<receiver>GeneralMsgDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
@ -310,11 +323,11 @@
<receiver>GeneralMsgDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>

View File

@ -36,6 +36,9 @@
#include "rsiface/rspeers.h"
#include "rsiface/rsmsgs.h"
#include "rsiface/rsfiles.h"
#include "gui/feeds/SubFileItem.h"
#define appDir QApplication::applicationDirPath()
@ -76,7 +79,8 @@ PopupChatDialog::PopupChatDialog(std::string id, std::string name,
connect(ui.chattextEdit, SIGNAL(textChanged ( ) ), this, SLOT(checkChat( ) ));
connect(ui.sendButton, SIGNAL(clicked( ) ), this, SLOT(sendChat( ) ));
connect(ui.addFileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
connect(ui.textboldButton, SIGNAL(clicked()), this, SLOT(setFont()));
connect(ui.textunderlineButton, SIGNAL(clicked()), this, SLOT(setFont()));
connect(ui.textitalicButton, SIGNAL(clicked()), this, SLOT(setFont()));
@ -85,10 +89,13 @@ PopupChatDialog::PopupChatDialog(std::string id, std::string name,
connect(ui.emoteiconButton, SIGNAL(clicked()), this, SLOT(smileyWidget()));
connect(ui.styleButton, SIGNAL(clicked()), SLOT(changeStyle()));
connect(ui.textBrowser, SIGNAL(anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
// Create the status bar
resetStatusBar() ;
ui.textBrowser->setOpenExternalLinks ( false );
ui.textBrowser->setOpenLinks ( false );
QString title = QString::fromStdString(name) + " :" + tr(" RetroShare - Encrypted Chat") ;
setWindowTitle(title);
@ -294,7 +301,7 @@ void PopupChatDialog::checkChat()
void PopupChatDialog::sendChat()
{
QTextEdit *chatWidget = ui.chattextEdit;
QTextEdit *chatWidget = ui.chattextEdit;
ChatInfo ci;
@ -678,3 +685,99 @@ void PopupChatDialog::getAvatar()
}
}
void PopupChatDialog::addExtraFile()
{
// select a file
QString qfile = QFileDialog::getOpenFileName(this, tr("Add Extra File"), "", "", 0,
QFileDialog::DontResolveSymlinks);
std::string filePath = qfile.toStdString();
if (filePath != "")
{
/* add a SubFileItem to the attachment section */
std::cerr << "PopupChatDialog::addExtraFile() hashing file.";
std::cerr << std::endl;
/* add widget in for new destination */
SubFileItem *file = new SubFileItem(filePath);
//file->
ui.SendLayout->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() == SFI_STATE_LOCAL) {
fileHashingFinished(file);
} else {
QObject::connect(file,SIGNAL(fileFinished(SubFileItem *)), SLOT(fileHashingFinished(SubFileItem *))) ;
}
}
}
void PopupChatDialog::fileHashingFinished(SubFileItem* file) {
std::cerr << "PopupChatDialog::fileHashingFinished() started.";
std::cerr << std::endl;
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='file:?fileHash=" + (file->FileHash()) + "&fileName=" + (file->FileName()) + "&fileSize=" + fileSize + "'>" + (file->FileName()) + "</a>";
#ifdef CHAT_DEBUG
std::cerr << "PopupChatDialog::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_PRIVATE;
addChatMsg(&ci);
/* put proper destination */
ci.rsid = dialogId;
ci.name = dialogName;
rsMsgs -> ChatSend(ci);
}
void PopupChatDialog::anchorClicked (const QUrl& link ) {
std::string fileName = link.queryItemValue(QString("fileName")).toStdString();
std::string fileHash = link.queryItemValue(QString("fileHash")).toStdString();
uint32_t fileSize = link.queryItemValue(QString("fileSize")).toInt();
#ifdef CHAT_DEBUG
std::cerr << "PopupChatDialog::anchorClicked FileRequest : fileName : " << fileName << ". fileHash : " << fileHash << ". fileSize : " << fileSize;
std::cerr << ". source id : " << dialogId << std::endl;
#endif
std::list<std::string> srcIds;
srcIds.push_front(dialogId);
rsFiles->FileRequest(fileName, fileHash, fileSize, "", 0, srcIds);
}

View File

@ -30,6 +30,7 @@
#include <gui/Preferences/rsharesettings.h>
#include "rsiface/rsiface.h"
#include "gui/feeds/SubFileItem.h"
@ -74,15 +75,19 @@ public slots:
void addSmiley();
void changeStyle();
void fileHashingFinished(SubFileItem* file);
void resetStatusBar() ;
void updateStatusTyping() ;
void updateStatusString(const QString&) ;
void anchorClicked (const QUrl &);
protected:
void closeEvent (QCloseEvent * event);
private slots:
void addExtraFile();
void showAvatarFrame(bool show);
void setColor();
@ -95,7 +100,6 @@ private slots:
void getAvatar();
private:
void colorChanged(const QColor &c);
@ -120,10 +124,9 @@ private:
QStringList history;
QString wholeChat;
/** Qt Designer generated object */
Ui::PopupChatDialog ui;
};
#endif

View File

@ -1,7 +1,8 @@
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PopupChatDialog</class>
<widget class="QMainWindow" name="PopupChatDialog" >
<property name="geometry" >
<widget class="QMainWindow" name="PopupChatDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@ -9,38 +10,35 @@
<height>437</height>
</rect>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget" >
<layout class="QGridLayout" >
<property name="rightMargin" >
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout">
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin" >
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing" >
<property name="spacing">
<number>0</number>
</property>
<property name="verticalSpacing" >
<number>0</number>
</property>
<item row="0" column="0" >
<widget class="QTextBrowser" name="textBrowser" >
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Expanding" >
<item row="0" column="0">
<widget class="QTextBrowser" name="textBrowser">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="sizeIncrement" >
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
@ -48,61 +46,61 @@
</property>
</widget>
</item>
<item rowspan="4" row="0" column="1" >
<widget class="QFrame" name="avatarframe" >
<property name="frameShape" >
<item row="0" column="1" rowspan="4">
<widget class="QFrame" name="avatarframe">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<layout class="QGridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin" >
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin" >
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin" >
<property name="bottomMargin">
<number>9</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="avatarlabel" >
<property name="minimumSize" >
<item row="0" column="0">
<widget class="QLabel" name="avatarlabel">
<property name="minimumSize">
<size>
<width>116</width>
<height>116</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>116</width>
<height>116</height>
</size>
</property>
<property name="styleSheet" >
<property name="styleSheet">
<string>QLabel{
border-image: url(:/images/mystatus_bg.png);
}</string>
</property>
<property name="text" >
<property name="text">
<string/>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0" >
<item row="1" column="0">
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>61</width>
<height>141</height>
@ -110,43 +108,43 @@ border-image: url(:/images/mystatus_bg.png);
</property>
</spacer>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="myavatarlabel" >
<property name="minimumSize" >
<item row="2" column="0">
<widget class="QLabel" name="myavatarlabel">
<property name="minimumSize">
<size>
<width>116</width>
<height>116</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>116</width>
<height>116</height>
</size>
</property>
<property name="styleSheet" >
<property name="styleSheet">
<string>QLabel{
border-image: url(:/images/mystatus_bg.png);
}</string>
</property>
<property name="text" >
<property name="text">
<string/>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="0" >
<item row="3" column="0">
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>61</width>
<height>30</height>
@ -157,42 +155,42 @@ border-image: url(:/images/mystatus_bg.png);
</layout>
</widget>
</item>
<item rowspan="4" row="0" column="2" >
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QPushButton" name="avatarFrameButton" >
<property name="minimumSize" >
<item row="0" column="2" rowspan="4">
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QPushButton" name="avatarFrameButton">
<property name="minimumSize">
<size>
<width>14</width>
<height>31</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>14</width>
<height>31</height>
</size>
</property>
<property name="text" >
<property name="text">
<string/>
</property>
<property name="iconSize" >
<property name="iconSize">
<size>
<width>16</width>
<height>31</height>
</size>
</property>
<property name="checkable" >
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" >
<item row="1" column="0">
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>14</width>
<height>321</height>
@ -202,33 +200,33 @@ border-image: url(:/images/mystatus_bg.png);
</item>
</layout>
</item>
<item row="1" column="0" >
<widget class="QFrame" name="Chatbuttonframe" >
<property name="minimumSize" >
<item row="1" column="0">
<widget class="QFrame" name="Chatbuttonframe">
<property name="minimumSize">
<size>
<width>16</width>
<height>46</height>
</size>
</property>
<property name="frameShape" >
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" >
<property name="topMargin" >
<layout class="QGridLayout">
<property name="topMargin">
<number>9</number>
</property>
<property name="horizontalSpacing" >
<property name="horizontalSpacing">
<number>6</number>
</property>
<item row="0" column="0" >
<item row="0" column="0">
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>190</width>
<height>25</height>
@ -236,30 +234,30 @@ border-image: url(:/images/mystatus_bg.png);
</property>
</spacer>
</item>
<item row="0" column="1" >
<widget class="QPushButton" name="emoteiconButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<item row="0" column="1">
<widget class="QPushButton" name="emoteiconButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="text" >
<property name="text">
<string/>
</property>
<property name="iconSize" >
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
@ -267,30 +265,30 @@ border-image: url(:/images/mystatus_bg.png);
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QPushButton" name="styleButton" >
<property name="minimumSize" >
<item row="0" column="2">
<widget class="QPushButton" name="styleButton">
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="toolTip" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
<property name="toolTip">
<string>&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>&lt;/head>&lt;body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Set Chat Window Style&lt;/p>&lt;/body>&lt;/html></string>
&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;Set Chat Window Style&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text" >
<property name="text">
<string/>
</property>
<property name="iconSize" >
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
@ -298,136 +296,140 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="0" column="3" >
<widget class="QPushButton" name="textboldButton" >
<property name="minimumSize" >
<item row="0" column="3">
<widget class="QPushButton" name="textboldButton">
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="toolTip" >
<property name="toolTip">
<string>Bold</string>
</property>
<property name="text" >
<property name="text">
<string/>
</property>
<property name="icon" >
<iconset>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset>
<property name="icon">
<iconset>
<normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset>
</property>
<property name="checkable" >
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="4" >
<widget class="QPushButton" name="textunderlineButton" >
<property name="minimumSize" >
<item row="0" column="4">
<widget class="QPushButton" name="textunderlineButton">
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="toolTip" >
<property name="toolTip">
<string>Underline</string>
</property>
<property name="text" >
<property name="text">
<string/>
</property>
<property name="icon" >
<iconset>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset>
<property name="icon">
<iconset>
<normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset>
</property>
<property name="checkable" >
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="5" >
<widget class="QPushButton" name="textitalicButton" >
<property name="minimumSize" >
<item row="0" column="5">
<widget class="QPushButton" name="textitalicButton">
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="toolTip" >
<property name="toolTip">
<string>Italic</string>
</property>
<property name="text" >
<property name="text">
<string/>
</property>
<property name="icon" >
<iconset>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset>
<property name="icon">
<iconset>
<normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset>
</property>
<property name="checkable" >
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="6" >
<widget class="QPushButton" name="fontButton" >
<property name="minimumSize" >
<item row="0" column="6">
<widget class="QPushButton" name="fontButton">
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="toolTip" >
<property name="toolTip">
<string>Set Font</string>
</property>
<property name="text" >
<property name="text">
<string/>
</property>
<property name="icon" >
<iconset>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset>
<property name="icon">
<iconset>
<normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset>
</property>
<property name="checkable" >
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="7" >
<widget class="QPushButton" name="colorButton" >
<property name="minimumSize" >
<item row="0" column="7">
<widget class="QPushButton" name="colorButton">
<property name="minimumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="toolTip" >
<property name="toolTip">
<string>Text Color</string>
</property>
<property name="text" >
<property name="text">
<string/>
</property>
</widget>
@ -435,107 +437,129 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
</item>
<item row="2" column="0" >
<widget class="QTextEdit" name="chattextEdit" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Maximum" hsizetype="Expanding" >
<item row="2" column="0">
<widget class="QTextEdit" name="chattextEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0" >
<layout class="QGridLayout" >
<property name="leftMargin" >
<item row="3" column="0">
<layout class="QVBoxLayout" name="SendLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin" >
<property name="topMargin">
<number>2</number>
</property>
<property name="bottomMargin" >
<property name="bottomMargin">
<number>2</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
<item>
<layout class="QHBoxLayout" name="SendLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="sizeHint" >
<size>
<width>351</width>
<height>20</height>
</size>
<property name="topMargin">
<number>2</number>
</property>
</spacer>
</item>
<item row="0" column="1" >
<widget class="QPushButton" name="sendButton" >
<property name="text" >
<string>Send</string>
<property name="bottomMargin">
<number>2</number>
</property>
</widget>
<item>
<widget class="QPushButton" name="addFileButton">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>331</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="sendButton">
<property name="text">
<string>Send</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusbar" />
<widget class="QToolBar" name="toolBar" >
<property name="windowTitle" >
<widget class="QStatusBar" name="statusbar"/>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<property name="iconSize" >
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<attribute name="toolBarArea" >
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak" >
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="actionAvatar" />
<addaction name="actionAvatar"/>
</widget>
<action name="actionBold" >
<property name="text" >
<action name="actionBold">
<property name="text">
<string>Bold</string>
</property>
</action>
<action name="actionItalic" >
<property name="text" >
<action name="actionItalic">
<property name="text">
<string>Italic</string>
</property>
</action>
<action name="actionUnderline" >
<property name="text" >
<action name="actionUnderline">
<property name="text">
<string>Underline</string>
</property>
</action>
<action name="actionStrike" >
<property name="text" >
<action name="actionStrike">
<property name="text">
<string>Strike</string>
</property>
</action>
<action name="actionAvatar" >
<property name="icon" >
<iconset resource="../images.qrc" >:/images/add_image24.png</iconset>
<action name="actionAvatar">
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
</property>
<property name="text" >
<property name="text">
<string>Avatar</string>
</property>
<property name="toolTip" >
<property name="toolTip">
<string>Set your Avatar Picture</string>
</property>
</action>
</widget>
<resources>
<include location="../images.qrc" />
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -482,6 +482,7 @@ void SubFileItem::updateItem()
}
uint32_t repeat = 0;
switch (mMode)
{
case SFI_STATE_ERROR:
@ -505,6 +506,7 @@ void SubFileItem::updateItem()
case SFI_STATE_LOCAL:
repeat = 0;
emit fileFinished(this);
break;
case SFI_STATE_UPLOAD:
@ -644,4 +646,6 @@ void SubFileItem::save()
}
}
uint32_t SubFileItem::getState() {
return mMode;
}

View File

@ -63,6 +63,7 @@ public:
bool done();
bool ready();
uint32_t getState();
public slots:
void download();
@ -93,6 +94,10 @@ private:
/* for display purposes */
float amountDone;
signals:
void fileFinished(SubFileItem * subFileItem) const ;
};