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(addButton, SIGNAL(clicked()), this, SLOT(newDestination()));
connect(typeComboBox, SIGNAL(currentIndexChanged( int )), this, SLOT(updateGroupId())); 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(buttonBox, SIGNAL(rejected()), this, SLOT(cancelMsg()));
connect(addFileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
/* set the type to ... /* set the type to ...
* const uint32_t GMD_TYPE_MESSAGE_IDX = 0; * const uint32_t GMD_TYPE_MESSAGE_IDX = 0;
* const uint32_t GMD_TYPE_FORUM_IDX = 1; * 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) void GeneralMsgDialog::addAttachment(std::string path)
{ {
/* add a SubFileItem to the attachment section */ /* add a SubFileItem to the attachment section */

View File

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

View File

@ -36,6 +36,9 @@
#include "rsiface/rspeers.h" #include "rsiface/rspeers.h"
#include "rsiface/rsmsgs.h" #include "rsiface/rsmsgs.h"
#include "rsiface/rsfiles.h"
#include "gui/feeds/SubFileItem.h"
#define appDir QApplication::applicationDirPath() #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.chattextEdit, SIGNAL(textChanged ( ) ), this, SLOT(checkChat( ) ));
connect(ui.sendButton, SIGNAL(clicked( ) ), this, SLOT(sendChat( ) )); 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.textboldButton, SIGNAL(clicked()), this, SLOT(setFont()));
connect(ui.textunderlineButton, SIGNAL(clicked()), this, SLOT(setFont())); connect(ui.textunderlineButton, SIGNAL(clicked()), this, SLOT(setFont()));
connect(ui.textitalicButton, 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.emoteiconButton, SIGNAL(clicked()), this, SLOT(smileyWidget()));
connect(ui.styleButton, SIGNAL(clicked()), SLOT(changeStyle())); connect(ui.styleButton, SIGNAL(clicked()), SLOT(changeStyle()));
connect(ui.textBrowser, SIGNAL(anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
// Create the status bar // Create the status bar
resetStatusBar() ; resetStatusBar() ;
ui.textBrowser->setOpenExternalLinks ( false ); ui.textBrowser->setOpenExternalLinks ( false );
ui.textBrowser->setOpenLinks ( false );
QString title = QString::fromStdString(name) + " :" + tr(" RetroShare - Encrypted Chat") ; QString title = QString::fromStdString(name) + " :" + tr(" RetroShare - Encrypted Chat") ;
setWindowTitle(title); setWindowTitle(title);
@ -294,7 +301,7 @@ void PopupChatDialog::checkChat()
void PopupChatDialog::sendChat() void PopupChatDialog::sendChat()
{ {
QTextEdit *chatWidget = ui.chattextEdit; QTextEdit *chatWidget = ui.chattextEdit;
ChatInfo ci; 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 <gui/Preferences/rsharesettings.h>
#include "rsiface/rsiface.h" #include "rsiface/rsiface.h"
#include "gui/feeds/SubFileItem.h"
@ -74,15 +75,19 @@ public slots:
void addSmiley(); void addSmiley();
void changeStyle(); void changeStyle();
void fileHashingFinished(SubFileItem* file);
void resetStatusBar() ; void resetStatusBar() ;
void updateStatusTyping() ; void updateStatusTyping() ;
void updateStatusString(const QString&) ; void updateStatusString(const QString&) ;
void anchorClicked (const QUrl &);
protected: protected:
void closeEvent (QCloseEvent * event); void closeEvent (QCloseEvent * event);
private slots: private slots:
void addExtraFile();
void showAvatarFrame(bool show); void showAvatarFrame(bool show);
void setColor(); void setColor();
@ -95,7 +100,6 @@ private slots:
void getAvatar(); void getAvatar();
private: private:
void colorChanged(const QColor &c); void colorChanged(const QColor &c);
@ -120,10 +124,9 @@ private:
QStringList history; QStringList history;
QString wholeChat; QString wholeChat;
/** Qt Designer generated object */ /** Qt Designer generated object */
Ui::PopupChatDialog ui; Ui::PopupChatDialog ui;
}; };
#endif #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> <class>PopupChatDialog</class>
<widget class="QMainWindow" name="PopupChatDialog" > <widget class="QMainWindow" name="PopupChatDialog">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -9,38 +10,35 @@
<height>437</height> <height>437</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle">
<string>MainWindow</string> <string>MainWindow</string>
</property> </property>
<widget class="QWidget" name="centralwidget" > <widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" > <layout class="QGridLayout">
<property name="rightMargin" > <property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin" > <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="horizontalSpacing" > <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="verticalSpacing" > <item row="0" column="0">
<number>0</number> <widget class="QTextBrowser" name="textBrowser">
</property> <property name="sizePolicy">
<item row="0" column="0" > <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<widget class="QTextBrowser" name="textBrowser" >
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Expanding" >
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="sizeIncrement" > <property name="sizeIncrement">
<size> <size>
<width>0</width> <width>0</width>
<height>0</height> <height>0</height>
@ -48,61 +46,61 @@
</property> </property>
</widget> </widget>
</item> </item>
<item rowspan="4" row="0" column="1" > <item row="0" column="1" rowspan="4">
<widget class="QFrame" name="avatarframe" > <widget class="QFrame" name="avatarframe">
<property name="frameShape" > <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
<property name="frameShadow" > <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout">
<property name="leftMargin" > <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin" > <property name="topMargin">
<number>9</number> <number>9</number>
</property> </property>
<property name="rightMargin" > <property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin" > <property name="bottomMargin">
<number>9</number> <number>9</number>
</property> </property>
<item row="0" column="0" > <item row="0" column="0">
<widget class="QLabel" name="avatarlabel" > <widget class="QLabel" name="avatarlabel">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>116</width> <width>116</width>
<height>116</height> <height>116</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>116</width> <width>116</width>
<height>116</height> <height>116</height>
</size> </size>
</property> </property>
<property name="styleSheet" > <property name="styleSheet">
<string>QLabel{ <string>QLabel{
border-image: url(:/images/mystatus_bg.png); border-image: url(:/images/mystatus_bg.png);
}</string> }</string>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="alignment" > <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" > <item row="1" column="0">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>61</width> <width>61</width>
<height>141</height> <height>141</height>
@ -110,43 +108,43 @@ border-image: url(:/images/mystatus_bg.png);
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="2" column="0" > <item row="2" column="0">
<widget class="QLabel" name="myavatarlabel" > <widget class="QLabel" name="myavatarlabel">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>116</width> <width>116</width>
<height>116</height> <height>116</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>116</width> <width>116</width>
<height>116</height> <height>116</height>
</size> </size>
</property> </property>
<property name="styleSheet" > <property name="styleSheet">
<string>QLabel{ <string>QLabel{
border-image: url(:/images/mystatus_bg.png); border-image: url(:/images/mystatus_bg.png);
}</string> }</string>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="alignment" > <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" > <item row="3" column="0">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType" > <property name="sizeType">
<enum>QSizePolicy::Fixed</enum> <enum>QSizePolicy::Fixed</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>61</width> <width>61</width>
<height>30</height> <height>30</height>
@ -157,42 +155,42 @@ border-image: url(:/images/mystatus_bg.png);
</layout> </layout>
</widget> </widget>
</item> </item>
<item rowspan="4" row="0" column="2" > <item row="0" column="2" rowspan="4">
<layout class="QGridLayout" > <layout class="QGridLayout">
<item row="0" column="0" > <item row="0" column="0">
<widget class="QPushButton" name="avatarFrameButton" > <widget class="QPushButton" name="avatarFrameButton">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>14</width> <width>14</width>
<height>31</height> <height>31</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>14</width> <width>14</width>
<height>31</height> <height>31</height>
</size> </size>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="iconSize" > <property name="iconSize">
<size> <size>
<width>16</width> <width>16</width>
<height>31</height> <height>31</height>
</size> </size>
</property> </property>
<property name="checkable" > <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" > <item row="1" column="0">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>14</width> <width>14</width>
<height>321</height> <height>321</height>
@ -202,33 +200,33 @@ border-image: url(:/images/mystatus_bg.png);
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="0" > <item row="1" column="0">
<widget class="QFrame" name="Chatbuttonframe" > <widget class="QFrame" name="Chatbuttonframe">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>16</width> <width>16</width>
<height>46</height> <height>46</height>
</size> </size>
</property> </property>
<property name="frameShape" > <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
<property name="frameShadow" > <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout">
<property name="topMargin" > <property name="topMargin">
<number>9</number> <number>9</number>
</property> </property>
<property name="horizontalSpacing" > <property name="horizontalSpacing">
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="0" > <item row="0" column="0">
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>190</width> <width>190</width>
<height>25</height> <height>25</height>
@ -236,30 +234,30 @@ border-image: url(:/images/mystatus_bg.png);
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="0" column="1" > <item row="0" column="1">
<widget class="QPushButton" name="emoteiconButton" > <widget class="QPushButton" name="emoteiconButton">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" > <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="iconSize" > <property name="iconSize">
<size> <size>
<width>24</width> <width>24</width>
<height>24</height> <height>24</height>
@ -267,30 +265,30 @@ border-image: url(:/images/mystatus_bg.png);
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2" > <item row="0" column="2">
<widget class="QPushButton" name="styleButton" > <widget class="QPushButton" name="styleButton">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="toolTip" > <property name="toolTip">
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css"> <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; } 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;/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=" 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;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>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="iconSize" > <property name="iconSize">
<size> <size>
<width>24</width> <width>24</width>
<height>24</height> <height>24</height>
@ -298,136 +296,140 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="3" > <item row="0" column="3">
<widget class="QPushButton" name="textboldButton" > <widget class="QPushButton" name="textboldButton">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="toolTip" > <property name="toolTip">
<string>Bold</string> <string>Bold</string>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="icon" > <property name="icon">
<iconset>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset> <iconset>
<normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset>
</property> </property>
<property name="checkable" > <property name="checkable">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="4" > <item row="0" column="4">
<widget class="QPushButton" name="textunderlineButton" > <widget class="QPushButton" name="textunderlineButton">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="toolTip" > <property name="toolTip">
<string>Underline</string> <string>Underline</string>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="icon" > <property name="icon">
<iconset>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset> <iconset>
<normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset>
</property> </property>
<property name="checkable" > <property name="checkable">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="5" > <item row="0" column="5">
<widget class="QPushButton" name="textitalicButton" > <widget class="QPushButton" name="textitalicButton">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="toolTip" > <property name="toolTip">
<string>Italic</string> <string>Italic</string>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="icon" > <property name="icon">
<iconset>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset> <iconset>
<normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset>
</property> </property>
<property name="checkable" > <property name="checkable">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="6" > <item row="0" column="6">
<widget class="QPushButton" name="fontButton" > <widget class="QPushButton" name="fontButton">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="toolTip" > <property name="toolTip">
<string>Set Font</string> <string>Set Font</string>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
<property name="icon" > <property name="icon">
<iconset>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset> <iconset>
<normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</normaloff>C:/Dokumente und Einstellungen/Linux/.designer/backup</iconset>
</property> </property>
<property name="checkable" > <property name="checkable">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="7" > <item row="0" column="7">
<widget class="QPushButton" name="colorButton" > <widget class="QPushButton" name="colorButton">
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="maximumSize" > <property name="maximumSize">
<size> <size>
<width>28</width> <width>28</width>
<height>28</height> <height>28</height>
</size> </size>
</property> </property>
<property name="toolTip" > <property name="toolTip">
<string>Text Color</string> <string>Text Color</string>
</property> </property>
<property name="text" > <property name="text">
<string/> <string/>
</property> </property>
</widget> </widget>
@ -435,107 +437,129 @@ p, li { white-space: pre-wrap; }
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="2" column="0" > <item row="2" column="0">
<widget class="QTextEdit" name="chattextEdit" > <widget class="QTextEdit" name="chattextEdit">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy vsizetype="Maximum" hsizetype="Expanding" > <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" > <item row="3" column="0">
<layout class="QGridLayout" > <layout class="QVBoxLayout" name="SendLayout">
<property name="leftMargin" > <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin" > <property name="topMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="bottomMargin" > <property name="bottomMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="horizontalSpacing" > <item>
<number>6</number> <layout class="QHBoxLayout" name="SendLayout">
</property> <property name="leftMargin">
<item row="0" column="0" > <number>0</number>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="topMargin">
<size> <number>2</number>
<width>351</width>
<height>20</height>
</size>
</property> </property>
</spacer> <property name="bottomMargin">
</item> <number>2</number>
<item row="0" column="1" >
<widget class="QPushButton" name="sendButton" >
<property name="text" >
<string>Send</string>
</property> </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> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QStatusBar" name="statusbar" /> <widget class="QStatusBar" name="statusbar"/>
<widget class="QToolBar" name="toolBar" > <widget class="QToolBar" name="toolBar">
<property name="windowTitle" > <property name="windowTitle">
<string>toolBar</string> <string>toolBar</string>
</property> </property>
<property name="iconSize" > <property name="iconSize">
<size> <size>
<width>24</width> <width>24</width>
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
<attribute name="toolBarArea" > <attribute name="toolBarArea">
<enum>TopToolBarArea</enum> <enum>TopToolBarArea</enum>
</attribute> </attribute>
<attribute name="toolBarBreak" > <attribute name="toolBarBreak">
<bool>false</bool> <bool>false</bool>
</attribute> </attribute>
<addaction name="actionAvatar" /> <addaction name="actionAvatar"/>
</widget> </widget>
<action name="actionBold" > <action name="actionBold">
<property name="text" > <property name="text">
<string>Bold</string> <string>Bold</string>
</property> </property>
</action> </action>
<action name="actionItalic" > <action name="actionItalic">
<property name="text" > <property name="text">
<string>Italic</string> <string>Italic</string>
</property> </property>
</action> </action>
<action name="actionUnderline" > <action name="actionUnderline">
<property name="text" > <property name="text">
<string>Underline</string> <string>Underline</string>
</property> </property>
</action> </action>
<action name="actionStrike" > <action name="actionStrike">
<property name="text" > <property name="text">
<string>Strike</string> <string>Strike</string>
</property> </property>
</action> </action>
<action name="actionAvatar" > <action name="actionAvatar">
<property name="icon" > <property name="icon">
<iconset resource="../images.qrc" >:/images/add_image24.png</iconset> <iconset resource="../images.qrc">
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
</property> </property>
<property name="text" > <property name="text">
<string>Avatar</string> <string>Avatar</string>
</property> </property>
<property name="toolTip" > <property name="toolTip">
<string>Set your Avatar Picture</string> <string>Set your Avatar Picture</string>
</property> </property>
</action> </action>
</widget> </widget>
<resources> <resources>
<include location="../images.qrc" /> <include location="../images.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -482,6 +482,7 @@ void SubFileItem::updateItem()
} }
uint32_t repeat = 0; uint32_t repeat = 0;
switch (mMode) switch (mMode)
{ {
case SFI_STATE_ERROR: case SFI_STATE_ERROR:
@ -505,6 +506,7 @@ void SubFileItem::updateItem()
case SFI_STATE_LOCAL: case SFI_STATE_LOCAL:
repeat = 0; repeat = 0;
emit fileFinished(this);
break; break;
case SFI_STATE_UPLOAD: 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 done();
bool ready(); bool ready();
uint32_t getState();
public slots: public slots:
void download(); void download();
@ -93,6 +94,10 @@ private:
/* for display purposes */ /* for display purposes */
float amountDone; float amountDone;
signals:
void fileFinished(SubFileItem * subFileItem) const ;
}; };