Redesigned the MessagesDialog to open the message in a new tab or new window for reading.

The MessageComposer is now only for writing a new message or editing a message from the draft box.
Added a new setting to the MessagePage.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4230 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-06-04 00:46:02 +00:00
parent 50e243adf6
commit 7661f4486d
16 changed files with 2740 additions and 1171 deletions

View file

@ -0,0 +1,651 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2006 - 2011 RetroShare Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#include <QMenu>
#include <QToolButton>
#include <QDateTime>
#include <QMessageBox>
#include <QPrinter>
#include <QPrintDialog>
#include "gui/notifyqt.h"
#include "gui/RetroShareLink.h"
#include "gui/common/TagDefs.h"
#include "gui/common/PeerDefs.h"
#include "gui/common/Emoticons.h"
#include "gui/settings/rsharesettings.h"
#include "MessageComposer.h"
#include "MessageWidget.h"
#include "MessageWindow.h"
#include "util/misc.h"
#include "util/printpreview.h"
#include <retroshare/rspeers.h>
#include <retroshare/rsfiles.h>
#include <retroshare/rsmsgs.h>
/* Images for context menu icons */
#define IMAGE_DOWNLOAD ":/images/start.png"
#define IMAGE_DOWNLOADALL ":/images/startall.png"
#define COLUMN_FILE_NAME 0
#define COLUMN_FILE_SIZE 1
#define COLUMN_FILE_HASH 2
#define COLUMN_FILE_COUNT 3
MessageWidget *MessageWidget::openMsg(const std::string &msgId, bool window)
{
if (msgId.empty()) {
return NULL;
}
MessageInfo msgInfo;
if (!rsMsgs->getMessage(msgId, msgInfo)) {
std::cerr << "MessageWidget::openMsg() Couldn't find Msg" << std::endl;
return NULL;
}
MessageWindow *parent = NULL;
if (window) {
parent = new MessageWindow;
}
MessageWidget *msgWidget = new MessageWidget(false, parent);
msgWidget->isWindow = window;
msgWidget->fill(msgId);
if (parent) {
parent->addWidget(msgWidget);
}
if (parent) {
parent->show();
parent->activateWindow();
}
return msgWidget;
}
/** Constructor */
MessageWidget::MessageWidget(bool controlled, QWidget *parent, Qt::WFlags flags)
: QWidget(parent, flags)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
isControlled = controlled;
isWindow = false;
connect(ui.msgList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(msgfilelistWidgetCostumPopupMenu(QPoint)));
connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview()));
connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getallrecommended()));
connect(NotifyQt::getInstance(), SIGNAL(messagesTagsChanged()), this, SLOT(messagesTagsChanged()));
connect(NotifyQt::getInstance(), SIGNAL(messagesChanged()), this, SLOT(messagesChanged()));
/* hide the Tree +/- */
ui.msgList->setRootIsDecorated( false );
ui.msgList->setSelectionMode( QAbstractItemView::ExtendedSelection );
/* Set header resize modes and initial section sizes */
QHeaderView * msglheader = ui.msgList->header () ;
msglheader->setResizeMode (COLUMN_FILE_NAME, QHeaderView::Interactive);
msglheader->setResizeMode (COLUMN_FILE_SIZE, QHeaderView::Interactive);
msglheader->setResizeMode (COLUMN_FILE_HASH, QHeaderView::Interactive);
msglheader->resizeSection (COLUMN_FILE_NAME, 200);
msglheader->resizeSection (COLUMN_FILE_SIZE, 100);
msglheader->resizeSection (COLUMN_FILE_HASH, 200);
QFont font = QFont("Arial", 10, QFont::Bold);
ui.subjectText->setFont(font);
ui.bcclabel->setVisible(false);
ui.bccText->setVisible(false);
ui.cclabel->setVisible(false);
ui.ccText->setVisible(false);
ui.tagsLabel->setVisible(false);
if (isControlled == false) {
processSettings("MessageWidget", true);
}
/* Hide platform specific features */
#ifdef Q_WS_WIN
#endif
}
MessageWidget::~MessageWidget()
{
if (isControlled == false) {
processSettings("MessageWidget", false);
}
}
void MessageWidget::connectAction(enumActionType actionType, QToolButton* button)
{
switch (actionType) {
case ACTION_REMOVE:
connect(button, SIGNAL(clicked()), this, SLOT(remove()));
break;
case ACTION_REPLY:
connect(button, SIGNAL(clicked()), this, SLOT(reply()));
break;
case ACTION_REPLY_ALL:
connect(button, SIGNAL(clicked()), this, SLOT(replyAll()));
break;
case ACTION_FORWARD:
connect(button, SIGNAL(clicked()), this, SLOT(forward()));
break;
case ACTION_PRINT:
connect(button, SIGNAL(clicked()), this, SLOT(print()));
break;
case ACTION_PRINT_PREVIEW:
connect(button, SIGNAL(clicked()), this, SLOT(printPreview()));
break;
case ACTION_SAVE_AS:
connect(button, SIGNAL(clicked()), this, SLOT(saveAs()));
break;
}
}
void MessageWidget::connectAction(enumActionType actionType, QAction *action)
{
switch (actionType) {
case ACTION_REMOVE:
connect(action, SIGNAL(triggered()), this, SLOT(remove()));
break;
case ACTION_REPLY:
connect(action, SIGNAL(triggered()), this, SLOT(reply()));
break;
case ACTION_REPLY_ALL:
connect(action, SIGNAL(triggered()), this, SLOT(replyAll()));
break;
case ACTION_FORWARD:
connect(action, SIGNAL(triggered()), this, SLOT(forward()));
break;
case ACTION_PRINT:
connect(action, SIGNAL(triggered()), this, SLOT(print()));
break;
case ACTION_PRINT_PREVIEW:
connect(action, SIGNAL(triggered()), this, SLOT(printPreview()));
break;
case ACTION_SAVE_AS:
connect(action, SIGNAL(triggered()), this, SLOT(saveAs()));
break;
}
}
void MessageWidget::processSettings(const QString &settingsGroup, bool load)
{
Settings->beginGroup(settingsGroup);
if (load) {
// load settings
// expandFiles
bool value = Settings->value("expandFiles", true).toBool();
ui.expandFilesButton->setChecked(value);
ui.msgList->setVisible(value);
togglefileview();
} else {
// save settings
// expandFiles
Settings->setValue("expandFiles", ui.expandFilesButton->isChecked());
}
Settings->endGroup();
}
QString MessageWidget::subject(bool noEmpty)
{
QString subject = ui.subjectText->text();
if (subject.isEmpty() && noEmpty) {
return "[" + tr("No subject") + "]";
}
return subject;
}
void MessageWidget::msgfilelistWidgetCostumPopupMenu( QPoint point )
{
QMenu contextMnu(this);
contextMnu.addAction(QIcon(IMAGE_DOWNLOAD), tr("Download"), this, SLOT(getcurrentrecommended()));
contextMnu.addAction(QIcon(IMAGE_DOWNLOADALL), tr("Download all"), this, SLOT(getallrecommended()));
contextMnu.exec(QCursor::pos());
}
void MessageWidget::togglefileview()
{
/* if msg header visible -> change icon and tooltip
* three widgets...
*/
if (ui.expandFilesButton->isChecked()) {
ui.expandFilesButton->setIcon(QIcon(QString(":/images/edit_remove24.png")));
ui.expandFilesButton->setToolTip(tr("Hide"));
} else {
ui.expandFilesButton->setIcon(QIcon(QString(":/images/edit_add24.png")));
ui.expandFilesButton->setToolTip(tr("Expand"));
}
}
/* download the recommendations... */
void MessageWidget::getcurrentrecommended()
{
MessageInfo msgInfo;
if (rsMsgs->getMessage(currMsgId, msgInfo) == false) {
return;
}
std::list<std::string> srcIds;
srcIds.push_back(msgInfo.srcId);
QModelIndexList list = ui.msgList->selectionModel()->selectedIndexes();
std::map<int,FileInfo> files ;
for (QModelIndexList::const_iterator it(list.begin());it!=list.end();++it) {
FileInfo& fi(files[it->row()]) ;
switch (it->column()) {
case COLUMN_FILE_NAME:
fi.fname = it->data().toString().toStdString() ;
break ;
case COLUMN_FILE_SIZE:
fi.size = it->data().toULongLong() ;
break ;
case COLUMN_FILE_HASH:
fi.hash = it->data().toString().toStdString() ;
break ;
}
}
for(std::map<int,FileInfo>::const_iterator it(files.begin());it!=files.end();++it) {
const FileInfo& fi(it->second) ;
std::cout << "Requesting file " << fi.fname << ", size=" << fi.size << ", hash=" << fi.hash << std::endl ;
if (rsFiles->FileRequest(fi.fname, fi.hash, fi.size, "", RS_FILE_HINTS_NETWORK_WIDE, srcIds) == false) {
QMessageBox mb(QObject::tr("File Request canceled"), QObject::tr("The following has not been added to your download list, because you already have it:\n ") + QString::fromStdString(fi.fname), QMessageBox::Critical, QMessageBox::Ok, 0, 0);
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
mb.exec();
}
}
}
void MessageWidget::getallrecommended()
{
/* get Message */
MessageInfo msgInfo;
if (rsMsgs->getMessage(currMsgId, msgInfo) == false) {
return;
}
const std::list<FileInfo> &recList = msgInfo.files;
std::list<FileInfo>::const_iterator it;
/* do the requests */
for(it = recList.begin(); it != recList.end(); it++) {
std::cerr << "MessageWidget::getallrecommended() Calling File Request" << std::endl;
std::list<std::string> srcIds;
srcIds.push_back(msgInfo.srcId);
rsFiles->FileRequest(it->fname, it->hash, it->size, "", RS_FILE_HINTS_NETWORK_WIDE, srcIds);
}
}
void MessageWidget::messagesTagsChanged()
{
showTagLabels();
}
void MessageWidget::messagesChanged()
{
if (isControlled) {
/* processed by MessagesDialog */
return;
}
/* test Message */
MessageInfo msgInfo;
if (rsMsgs->getMessage(currMsgId, msgInfo) == false) {
/* messages was removed */
if (isWindow) {
window()->close();
} else {
deleteLater();
}
}
}
void MessageWidget::clearTagLabels()
{
/* clear all tags */
while (tagLabels.size()) {
delete tagLabels.front();
tagLabels.pop_front();
}
while (ui.tagLayout->count()) {
delete ui.tagLayout->takeAt(0);
}
ui.tagsLabel->setVisible(false);
}
void MessageWidget::showTagLabels()
{
clearTagLabels();
if (currMsgId.empty()) {
return;
}
MsgTagInfo tagInfo;
rsMsgs->getMessageTag(currMsgId, tagInfo);
if (tagInfo.tagIds.empty() == false) {
ui.tagsLabel->setVisible(true);
MsgTagType Tags;
rsMsgs->getMessageTagTypes(Tags);
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator Tag;
for (std::list<uint32_t>::iterator tagId = tagInfo.tagIds.begin(); tagId != tagInfo.tagIds.end(); tagId++) {
Tag = Tags.types.find(*tagId);
if (Tag != Tags.types.end()) {
QLabel *tagLabel = new QLabel(TagDefs::name(Tag->first, Tag->second.first), this);
tagLabel->setMaximumHeight(16);
tagLabel->setStyleSheet(TagDefs::labelStyleSheet(Tag->second.second));
tagLabels.push_back(tagLabel);
ui.tagLayout->addWidget(tagLabel);
ui.tagLayout->addSpacing(3);
}
}
ui.tagLayout->addStretch();
} else {
ui.tagsLabel->setVisible(false);
}
}
void MessageWidget::fill(const std::string &msgId)
{
if (currMsgId == msgId) {
// message doesn't changed
return;
}
currMsgId = msgId;
if (currMsgId.empty()) {
/* blank it */
ui.dateText-> setText("");
ui.toText->setText("");
ui.fromText->setText("");
ui.filesText->setText("");
ui.cclabel->setVisible(false);
ui.ccText->setVisible(false);
ui.ccText->clear();
ui.bcclabel->setVisible(false);
ui.bccText->setVisible(false);
ui.bccText->clear();
ui.subjectText->setText("");
ui.msgList->clear();
ui.msgText->clear();
clearTagLabels();
return;
}
clearTagLabels();
MessageInfo msgInfo;
if (rsMsgs->getMessage(currMsgId, msgInfo) == false) {
std::cerr << "MessageWidget::fill() Couldn't find Msg" << std::endl;
return;
}
const std::list<FileInfo> &recList = msgInfo.files;
std::list<FileInfo>::const_iterator it;
ui.msgList->clear();
QList<QTreeWidgetItem*> items;
for (it = recList.begin(); it != recList.end(); it++) {
QTreeWidgetItem *item = new QTreeWidgetItem;
item->setText(COLUMN_FILE_NAME, QString::fromStdString(it->fname));
item->setText(COLUMN_FILE_SIZE, QString::number(it->size));
item->setText(COLUMN_FILE_HASH, QString::fromStdString(it->hash));
/* add to the list */
items.append(item);
}
/* add the items in! */
ui.msgList->insertTopLevelItems(0, items);
/* iterate through the sources */
std::list<std::string>::const_iterator pit;
RetroShareLink link;
QString text;
for(pit = msgInfo.msgto.begin(); pit != msgInfo.msgto.end(); pit++) {
if (link.createMessage(*pit, "")) {
text += link.toHtml() + " ";
}
}
ui.toText->setText(text);
if (msgInfo.msgcc.size() > 0) {
ui.cclabel->setVisible(true);
ui.ccText->setVisible(true);
text.clear();
for(pit = msgInfo.msgcc.begin(); pit != msgInfo.msgcc.end(); pit++) {
if (link.createMessage(*pit, "")) {
text += link.toHtml() + " ";
}
}
ui.ccText->setText(text);
} else {
ui.cclabel->setVisible(false);
ui.ccText->setVisible(false);
ui.ccText->clear();
}
if (msgInfo.msgbcc.size() > 0) {
ui.bcclabel->setVisible(true);
ui.bccText->setVisible(true);
text.clear();
for(pit = msgInfo.msgbcc.begin(); pit != msgInfo.msgbcc.end(); pit++) {
if (link.createMessage(*pit, "")) {
text += link.toHtml() + " ";
}
}
ui.bccText->setText(text);
} else {
ui.bcclabel->setVisible(false);
ui.bccText->setVisible(false);
ui.bccText->clear();
}
{
QDateTime qtime;
qtime.setTime_t(msgInfo.ts);
QString timestamp = qtime.toString("dd.MM.yyyy hh:mm:ss");
ui.dateText->setText(timestamp);
}
std::string srcId;
if ((msgInfo.msgflags & RS_MSG_BOXMASK) == RS_MSG_OUTBOX) {
// outgoing message are from me
srcId = rsPeers->getOwnId();
} else {
srcId = msgInfo.srcId;
}
link.createMessage(srcId, "");
ui.fromText->setText(link.toHtml());
ui.fromText->setToolTip(PeerDefs::rsidFromId(srcId));
ui.subjectText->setText(QString::fromStdWString(msgInfo.title));
text = RsHtml::formatText(QString::fromStdWString(msgInfo.msg), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS);
ui.msgText->setHtml(text);
ui.filesText->setText(QString("(%1 %2)").arg(msgInfo.count).arg(msgInfo.count == 1 ? tr("File") : tr("Files")));
showTagLabels();
}
void MessageWidget::remove()
{
MessageInfo msgInfo;
if (rsMsgs->getMessage(currMsgId, msgInfo) == false) {
std::cerr << "MessageWidget::fill() Couldn't find Msg" << std::endl;
return;
}
bool deleteReal = false;
if (msgInfo.msgflags & RS_MSG_TRASH) {
deleteReal = true;
} else {
if (QApplication::keyboardModifiers() & Qt::ShiftModifier) {
deleteReal = true;
}
}
if (deleteReal) {
rsMsgs->MessageDelete(currMsgId);
} else {
rsMsgs->MessageToTrash(currMsgId, true);
}
if (isWindow) {
window()->close();
} else {
deleteLater();
}
}
void MessageWidget::print()
{
#ifndef QT_NO_PRINTER
QPrinter printer(QPrinter::HighResolution);
printer.setFullPage(true);
QPrintDialog *dlg = new QPrintDialog(&printer, this);
if (ui.msgText->textCursor().hasSelection())
dlg->addEnabledOption(QAbstractPrintDialog::PrintSelection);
dlg->setWindowTitle(tr("Print Document"));
if (dlg->exec() == QDialog::Accepted) {
ui.msgText->print(&printer);
}
delete dlg;
#endif
}
void MessageWidget::printPreview()
{
PrintPreview *preview = new PrintPreview(ui.msgText->document(), this);
preview->setWindowModality(Qt::WindowModal);
preview->setAttribute(Qt::WA_DeleteOnClose);
preview->show();
/* window will destroy itself! */
}
void MessageWidget::saveAs()
{
QString filename;
if (misc::getSaveFileName(window(), RshareSettings::LASTDIR_MESSAGES, tr("Save as..."), tr("HTML-Files (*.htm *.html);;All Files (*)"), filename)) {
QFile file(filename);
if (!file.open(QFile::WriteOnly))
return;
QTextStream ts(&file);
ts.setCodec(QTextCodec::codecForName("UTF-8"));
ts << ui.msgText->document()->toHtml("UTF-8");
ui.msgText->document()->setModified(false);
}
}
void MessageWidget::reply()
{
/* put msg on msgBoard, and switch to it. */
if (currMsgId.empty()) {
return;
}
MessageComposer *msgComposer = MessageComposer::replyMsg(currMsgId, false);
if (msgComposer == NULL) {
return;
}
msgComposer->show();
msgComposer->activateWindow();
/* window will destroy itself! */
}
void MessageWidget::replyAll()
{
/* put msg on msgBoard, and switch to it. */
if (currMsgId.empty()) {
return;
}
MessageComposer *msgComposer = MessageComposer::replyMsg(currMsgId, true);
if (msgComposer == NULL) {
return;
}
msgComposer->show();
msgComposer->activateWindow();
/* window will destroy itself! */
}
void MessageWidget::forward()
{
/* put msg on msgBoard, and switch to it. */
if (currMsgId.empty()) {
return;
}
MessageComposer *msgComposer = MessageComposer::forwardMsg(currMsgId);
if (msgComposer == NULL) {
return;
}
msgComposer->show();
msgComposer->activateWindow();
/* window will destroy itself! */
}

View file

@ -0,0 +1,93 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2006 - 2011, RetroShare Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#ifndef _MESSAGEWIDGET_H
#define _MESSAGEWIDGET_H
#include <QWidget>
#include "ui_MessageWidget.h"
class QToolButton;
class QAction;
class QTextEdit;
class MessageWidget : public QWidget
{
Q_OBJECT
public:
enum enumActionType {
ACTION_REMOVE,
ACTION_REPLY,
ACTION_REPLY_ALL,
ACTION_FORWARD,
ACTION_PRINT,
ACTION_PRINT_PREVIEW,
ACTION_SAVE_AS
};
public:
MessageWidget(bool controlled, QWidget *parent = 0, Qt::WFlags flags = 0);
~MessageWidget();
static MessageWidget *openMsg(const std::string &msgId, bool window);
std::string msgId() { return currMsgId; }
void connectAction(enumActionType actionType, QToolButton* button);
void connectAction(enumActionType actionType, QAction* action);
void fill(const std::string &msgId);
void processSettings(const QString &settingsGroup, bool load);
QString subject(bool noEmpty);
private slots:
void reply();
void replyAll();
void forward();
void remove();
void print();
void printPreview();
void saveAs();
void msgfilelistWidgetCostumPopupMenu(QPoint);
void messagesTagsChanged();
void messagesChanged();
void togglefileview();
void getcurrentrecommended();
void getallrecommended();
private:
void clearTagLabels();
void showTagLabels();
bool isControlled;
bool isWindow;
std::string currMsgId;
QList<QLabel*> tagLabels;
/** Qt Designer generated object */
Ui::MessageWidget ui;
};
#endif

View file

@ -0,0 +1,502 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MessageWidget</class>
<widget class="QWidget" name="MessageWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>698</width>
<height>539</height>
</rect>
</property>
<property name="windowIcon">
<iconset resource="../images.qrc">
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QSplitter" name="msgSplitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QSplitter" name="msgSplitter_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QWidget" name="layoutWidget">
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<widget class="QTextBrowser" name="msgText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="openLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="_2">
<item>
<layout class="QGridLayout" name="_3">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/attachment.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_2">
<property name="text">
<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&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;&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:10pt; font-weight:600;&quot;&gt;Recommended Files&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="filesText">
<property name="font">
<font>
<pointsize>10</pointsize>
<italic>true</italic>
</font>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>351</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="downloadButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Download all Recommended Files</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/down.png</normaloff>:/images/down.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="expandFilesButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/edit_remove24.png</normaloff>:/images/edit_remove24.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="_4">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QGridLayout" name="_5">
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>3</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="subjectlabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Subject:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="fromlabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>From:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="2" colspan="2">
<widget class="QLabel" name="fromText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>2</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="tolabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>To:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="2" colspan="2">
<widget class="QLabel" name="toText">
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="cclabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Cc:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="bcclabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Bcc:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="2" colspan="2">
<widget class="QLabel" name="ccText">
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="2" colspan="2">
<widget class="QLabel" name="bccText">
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="tagsLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Tags:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="2" colspan="2">
<layout class="QHBoxLayout" name="tagLayout"/>
</item>
<item row="0" column="2" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="subjectText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dateText">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string notr="true">Date</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<widget class="QTreeWidget" name="msgList">
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>File Name</string>
</property>
</column>
<column>
<property name="text">
<string>Size</string>
</property>
</column>
<column>
<property name="text">
<string>Hash</string>
</property>
</column>
</widget>
</widget>
</item>
</layout>
<action name="actionPrint">
<property name="text">
<string>Print</string>
</property>
</action>
<action name="actionPrint_Preview">
<property name="text">
<string>Print Preview</string>
</property>
</action>
</widget>
<resources>
<include location="../images.qrc"/>
</resources>
<connections>
<connection>
<sender>expandFilesButton</sender>
<signal>clicked(bool)</signal>
<receiver>msgList</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>672</x>
<y>334</y>
</hint>
<hint type="destinationlabel">
<x>348</x>
<y>432</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View file

@ -0,0 +1,229 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2006 - 2011 RetroShare Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#include "MessageWindow.h"
#include "MessageWidget.h"
#include "MessageComposer.h"
#include "TagsMenu.h"
#include "gui/settings/rsharesettings.h"
#include <retroshare/rsmsgs.h>
/** Constructor */
MessageWindow::MessageWindow(QWidget *parent, Qt::WFlags flags)
: RWindow("MessageWindow", parent, flags)
{
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
actionSaveAs = NULL;
actionPrint = NULL;
actionPrintPreview = NULL;
setupFileActions();
connect(ui.newmessageButton, SIGNAL(clicked()), this, SLOT(newmessage()));
connect(ui.actionTextBesideIcon, SIGNAL(triggered()), this, SLOT(buttonStyle()));
connect(ui.actionIconOnly, SIGNAL(triggered()), this, SLOT(buttonStyle()));
connect(ui.actionTextUnderIcon, SIGNAL(triggered()), this, SLOT(buttonStyle()));
ui.actionTextBesideIcon->setData(Qt::ToolButtonTextBesideIcon);
ui.actionIconOnly->setData(Qt::ToolButtonIconOnly);
ui.actionTextUnderIcon->setData(Qt::ToolButtonTextUnderIcon);
msgWidget = NULL;
// create tag menu
TagsMenu *menu = new TagsMenu (tr("Tags"), this);
connect(menu, SIGNAL(aboutToShow()), this, SLOT(tagAboutToShow()));
connect(menu, SIGNAL(tagSet(int, bool)), this, SLOT(tagSet(int, bool)));
connect(menu, SIGNAL(tagRemoveAll()), this, SLOT(tagRemoveAll()));
ui.tagButton->setMenu(menu);
// create print menu
QMenu *printmenu = new QMenu();
printmenu->addAction(ui.actionPrint);
printmenu->addAction(ui.actionPrint_Preview);
ui.printbutton->setMenu(printmenu);
// create view menu
QMenu *viewmenu = new QMenu();
viewmenu->addAction(ui.actionTextBesideIcon);
viewmenu->addAction(ui.actionIconOnly);
//viewmenu->addAction(ui.actionTextUnderIcon);
ui.viewtoolButton->setMenu(viewmenu);
processSettings(true);
/* Hide platform specific features */
#ifdef Q_WS_WIN
#endif
}
MessageWindow::~MessageWindow()
{
processSettings(false);
}
void MessageWindow::processSettings(bool load)
{
Settings->beginGroup(QString("MessageDialog"));
if (load) {
// load settings
/* toolbar button style */
Qt::ToolButtonStyle style = (Qt::ToolButtonStyle) Settings->value("ToolButon_Stlye", Qt::ToolButtonIconOnly).toInt();
setToolbarButtonStyle(style);
} else {
// save settings
/* toolbar button style */
Settings->setValue("ToolButon_Stlye", ui.newmessageButton->toolButtonStyle());
}
Settings->endGroup();
}
void MessageWindow::addWidget(MessageWidget *widget)
{
if (msgWidget) {
delete(msgWidget);
}
msgWidget = widget;
if (msgWidget) {
ui.msgLayout->addWidget(msgWidget);
setWindowTitle(msgWidget->subject(true));
msgWidget->connectAction(MessageWidget::ACTION_REMOVE, ui.removemessageButton);
msgWidget->connectAction(MessageWidget::ACTION_REPLY, ui.replymessageButton);
msgWidget->connectAction(MessageWidget::ACTION_REPLY_ALL, ui.replyallmessageButton);
msgWidget->connectAction(MessageWidget::ACTION_FORWARD, ui.forwardmessageButton);
msgWidget->connectAction(MessageWidget::ACTION_PRINT, ui.printbutton);
msgWidget->connectAction(MessageWidget::ACTION_PRINT, ui.actionPrint);
msgWidget->connectAction(MessageWidget::ACTION_PRINT, actionPrint);
msgWidget->connectAction(MessageWidget::ACTION_PRINT_PREVIEW, ui.actionPrint_Preview);
msgWidget->connectAction(MessageWidget::ACTION_PRINT_PREVIEW, actionPrintPreview);
// msgWidget->connectAction(ACTION_SAVE,
msgWidget->connectAction(MessageWidget::ACTION_SAVE_AS, actionSaveAs);
} else {
setWindowTitle("");
}
}
void MessageWindow::newmessage()
{
MessageComposer *msgComposer = MessageComposer::newMsg();
if (msgComposer == NULL) {
return;
}
/* fill it in */
msgComposer->show();
msgComposer->activateWindow();
/* window will destroy itself! */
}
void MessageWindow::tagAboutToShow()
{
if (msgWidget == NULL) {
return;
}
TagsMenu *menu = dynamic_cast<TagsMenu*>(ui.tagButton->menu());
if (menu == NULL) {
return;
}
// activate actions
MsgTagInfo tagInfo;
rsMsgs->getMessageTag(msgWidget->msgId(), tagInfo);
menu->activateActions(tagInfo.tagIds);
}
void MessageWindow::tagRemoveAll()
{
if (msgWidget == NULL) {
return;
}
rsMsgs->setMessageTag(msgWidget->msgId(), 0, false);
}
void MessageWindow::tagSet(int tagId, bool set)
{
if (msgWidget == NULL) {
return;
}
if (tagId == 0) {
return;
}
rsMsgs->setMessageTag(msgWidget->msgId(), tagId, set);
}
void MessageWindow::setupFileActions()
{
QMenu *menu = new QMenu(tr("&File"), this);
menuBar()->addMenu(menu);
actionSaveAs = menu->addAction(tr("Save &As File"));
actionPrint = menu->addAction(QIcon(":/images/textedit/fileprint.png"), tr("&Print..."));
actionPrint->setShortcut(QKeySequence::Print);
actionPrintPreview = menu->addAction(QIcon(":/images/textedit/fileprint.png"), tr("Print Preview..."));
// a = new QAction(QIcon(":/images/textedit/exportpdf.png"), tr("&Export PDF..."), this);
// a->setShortcut(Qt::CTRL + Qt::Key_D);
// connect(a, SIGNAL(triggered()), this, SLOT(filePrintPdf()));
// menu->addAction(a);
menu->addSeparator();
QAction *action = menu->addAction(tr("&Quit"), this, SLOT(close()));
action->setShortcut(Qt::CTRL + Qt::Key_Q);
}
void MessageWindow::setToolbarButtonStyle(Qt::ToolButtonStyle style)
{
ui.newmessageButton->setToolButtonStyle(style);
ui.removemessageButton->setToolButtonStyle(style);
ui.replymessageButton->setToolButtonStyle(style);
ui.replyallmessageButton->setToolButtonStyle(style);
ui.forwardmessageButton->setToolButtonStyle(style);
ui.tagButton->setToolButtonStyle(style);
ui.printbutton->setToolButtonStyle(style);
ui.viewtoolButton->setToolButtonStyle(style);
}
void MessageWindow::buttonStyle()
{
setToolbarButtonStyle((Qt::ToolButtonStyle) dynamic_cast<QAction*>(sender())->data().toInt());
}

View file

@ -0,0 +1,64 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2006 - 2011, RetroShare Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#ifndef _MESSAGEWINDOW_H
#define _MESSAGEWINDOW_H
#include "gui/common/rwindow.h"
#include "ui_MessageWindow.h"
class MessageWidget;
class MessageWindow : public RWindow
{
Q_OBJECT
public:
/** Default Constructor */
MessageWindow(QWidget *parent = 0, Qt::WFlags flags = 0);
~MessageWindow();
void addWidget(MessageWidget *widget);
private slots:
void newmessage();
void tagAboutToShow();
void tagSet(int tagId, bool set);
void tagRemoveAll();
void buttonStyle();
private:
void setupFileActions();
void processSettings(bool load);
void setToolbarButtonStyle(Qt::ToolButtonStyle style);
MessageWidget *msgWidget;
QAction *actionSaveAs;
QAction *actionPrint;
QAction *actionPrintPreview;
/** Qt Designer generated object */
Ui::MessageWindow ui;
};
#endif

View file

@ -0,0 +1,400 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MessageWindow</class>
<widget class="QMainWindow" name="MessageWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>698</width>
<height>539</height>
</rect>
</property>
<property name="windowIcon">
<iconset resource="../images.qrc">
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<property name="verticalSpacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>36</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>68</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FEFEFE, stop:1 #E8E8E8);
border: 1px solid #CCCCCC;}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="margin">
<number>2</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QToolButton" name="newmessageButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>New Message</string>
</property>
<property name="text">
<string>Compose</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/folder-draft24.png</normaloff>:/images/folder-draft24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="replymessageButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Reply to selected message</string>
</property>
<property name="text">
<string>Reply</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/replymail-pressed.png</normaloff>:/images/replymail-pressed.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QToolButton" name="replyallmessageButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Reply all to selected message</string>
</property>
<property name="text">
<string>Reply all</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/replymailall24-hover.png</normaloff>:/images/replymailall24-hover.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QToolButton" name="forwardmessageButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777</width>
<height>16777</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Forward selected message</string>
</property>
<property name="text">
<string>Foward</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/mailforward24-hover.png</normaloff>:/images/mailforward24-hover.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QToolButton" name="removemessageButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Remove selected message</string>
</property>
<property name="text">
<string>Delete</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/deletemail24.png</normaloff>:/images/deletemail24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="8">
<widget class="QToolButton" name="printbutton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Print selected message</string>
</property>
<property name="text">
<string>Print</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/print24.png</normaloff>:/images/print24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="9">
<widget class="QToolButton" name="viewtoolButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Display</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/looknfeel.png</normaloff>:/images/looknfeel.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="10">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="6">
<widget class="QToolButton" name="tagButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Tags</string>
</property>
<property name="text">
<string>Tags</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/tag24.png</normaloff>:/images/tag24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="msgLayout"/>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>698</width>
<height>20</height>
</rect>
</property>
</widget>
<action name="actionPrint">
<property name="text">
<string>Print</string>
</property>
</action>
<action name="actionPrint_Preview">
<property name="text">
<string>Print Preview</string>
</property>
</action>
<action name="actionIconOnly">
<property name="text">
<string>Buttons Icon Only</string>
</property>
<property name="toolTip">
<string>Buttons Icon Only</string>
</property>
</action>
<action name="actionTextBesideIcon">
<property name="text">
<string>Buttons Text Beside Icon</string>
</property>
<property name="toolTip">
<string>Buttons with Text</string>
</property>
</action>
<action name="actionTextUnderIcon">
<property name="text">
<string>Buttons Text Under Icon</string>
</property>
<property name="toolTip">
<string>Set Text Under Icon</string>
</property>
</action>
</widget>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>