cleaning up source code removed GeneralMsgDialog and ConnectDialog

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2984 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-05-23 22:35:51 +00:00
parent 757aa7a95d
commit c3e1a71279
17 changed files with 1 additions and 2324 deletions

View File

@ -219,7 +219,6 @@ HEADERS += rshare.h \
gui/channels/CreateChannel.h \
gui/channels/ChannelDetails.h \
gui/channels/CreateChannelMsg.h \
gui/connect/ConnectDialog.h \
gui/connect/ConfCertDialog.h \
gui/msgs/MessageComposer.h \
gui/msgs/textformat.h \
@ -265,7 +264,6 @@ HEADERS += rshare.h \
gui/elastic/node.h \
gui/NewsFeed.h \
gui/ChannelFeed.h \
gui/GeneralMsgDialog.h \
gui/ChanGroupDelegate.h \
gui/feeds/FeedHolder.h \
gui/feeds/ForumNewItem.h \
@ -319,7 +317,6 @@ FORMS += gui/StartDialog.ui \
gui/channels/CreateChannelMsg.ui \
gui/channels/ChannelDetails.ui \
gui/chat/PopupChatDialog.ui \
gui/connect/ConnectDialog.ui \
gui/connect/ConfCertDialog.ui \
gui/msgs/MessageComposer.ui \
gui/settings/settings.ui \
@ -342,7 +339,6 @@ FORMS += gui/StartDialog.ui \
gui/advsearch/expressionwidget.ui \
gui/NewsFeed.ui \
gui/ChannelFeed.ui \
gui/GeneralMsgDialog.ui \
gui/feeds/ForumNewItem.ui \
gui/feeds/ForumMsgItem.ui \
gui/feeds/PeerItem.ui \
@ -428,7 +424,6 @@ SOURCES += main.cpp \
gui/channels/ChannelDetails.cpp \
gui/chat/PopupChatDialog.cpp \
gui/chat/HandleRichText.cpp \
gui/connect/ConnectDialog.cpp \
gui/connect/ConfCertDialog.cpp \
gui/msgs/MessageComposer.cpp \
gui/common/vmessagebox.cpp \
@ -467,7 +462,6 @@ SOURCES += main.cpp \
gui/elastic/node.cpp \
gui/NewsFeed.cpp \
gui/ChannelFeed.cpp \
gui/GeneralMsgDialog.cpp \
gui/ChanGroupDelegate.cpp \
gui/feeds/ForumNewItem.cpp \
gui/feeds/ForumMsgItem.cpp \

View File

@ -34,8 +34,6 @@
#include "gui/channels/CreateChannelMsg.h"
#include "gui/ChanGroupDelegate.h"
#include "GeneralMsgDialog.h"
#define CHAN_DEFAULT_IMAGE ":/images/channels.png"
@ -217,22 +215,6 @@ void ChannelFeed::openChat(std::string peerId)
return;
}
void ChannelFeed::openMsg(uint32_t type, std::string grpId, std::string inReplyTo)
{
#ifdef CHAN_DEBUG
std::cerr << "ChannelFeed::openMsg()";
std::cerr << std::endl;
#endif
GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL);
msgDialog->addDestination(type, grpId, inReplyTo);
msgDialog->show();
/* window will destroy itself! */
}
void ChannelFeed::createMsg()
{
if (mChannelId == "")

View File

@ -48,7 +48,6 @@ public:
virtual void deleteFeedItem(QWidget *item, uint32_t type);
virtual void openChat(std::string peerId);
virtual void openMsg(uint32_t type, std::string grpId, std::string inReplyTo);
public slots:

View File

@ -1,664 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2008 Robert Fernie
*
* 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 <QtGui>
#include "GeneralMsgDialog.h"
#include "gui/feeds/FeedHolder.h"
#include "gui/feeds/AttachFileItem.h"
#include "gui/feeds/SubDestItem.h"
#include "rsiface/rstypes.h"
#include "rsiface/rspeers.h"
#include "rsiface/rsforums.h"
#include "rsiface/rschannels.h"
#include "rsiface/rsmsgs.h"
#include "rsiface/rsfiles.h"
#include <iostream>
/** Constructor */
GeneralMsgDialog::GeneralMsgDialog(QWidget *parent, uint32_t type)
: QDialog (parent), mCheckAttachment(true)
{
/* Invoke the Qt Designer generated object setup routine */
setupUi(this);
setAttribute ( Qt::WA_DeleteOnClose, true );
connect(addButton, SIGNAL(clicked()), this, SLOT(newDestination()));
connect(typeComboBox, SIGNAL(currentIndexChanged( int )), this, SLOT(updateGroupId()));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(sendMsg()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(cancelMsg()));
connect(addFileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
/* set the type to ...
* const uint32_t GMD_TYPE_MESSAGE_IDX = 0;
* const uint32_t GMD_TYPE_FORUM_IDX = 1;
* const uint32_t GMD_TYPE_CHANNEL_IDX = 2;
* const uint32_t GMD_TYPE_BLOG_IDX = 3;
* */
typeComboBox->clear();
typeComboBox->addItem(QIcon(QString(":/images/evolution.png")),tr("Message"));
typeComboBox->addItem(QIcon(QString(":/images/konversation16.png")),tr("Forum"));
typeComboBox->addItem(QIcon(QString(":/images/channels16.png")),tr("Channel"));
typeComboBox->addItem(QIcon(QString(":/images/kblogger.png")),tr("Blog"));
typeComboBox->setCurrentIndex(type);
setAcceptDrops(true);
}
/* Dropping */
void GeneralMsgDialog::dragEnterEvent(QDragEnterEvent *event)
{
/* print out mimeType */
std::cerr << "GeneralMsgDialog::dragEnterEvent() Formats";
std::cerr << std::endl;
QStringList formats = event->mimeData()->formats();
QStringList::iterator it;
for(it = formats.begin(); it != formats.end(); it++)
{
std::cerr << "Format: " << (*it).toStdString();
std::cerr << std::endl;
}
if (event->mimeData()->hasFormat("text/plain"))
{
std::cerr << "GeneralMsgDialog::dragEnterEvent() Accepting PlainText";
std::cerr << std::endl;
event->acceptProposedAction();
}
else if (event->mimeData()->hasUrls())
{
std::cerr << "GeneralMsgDialog::dragEnterEvent() Accepting Urls";
std::cerr << std::endl;
event->acceptProposedAction();
}
else if (event->mimeData()->hasFormat("application/x-rsfilelist"))
{
std::cerr << "GeneralMsgDialog::dragEnterEvent() accepting Application/x-qabs...";
std::cerr << std::endl;
event->acceptProposedAction();
}
else
{
std::cerr << "GeneralMsgDialog::dragEnterEvent() No PlainText/Urls";
std::cerr << std::endl;
}
}
void GeneralMsgDialog::dropEvent(QDropEvent *event)
{
if (!(Qt::CopyAction & event->possibleActions()))
{
std::cerr << "GeneralMsgDialog::dropEvent() Rejecting uncopyable DropAction";
std::cerr << std::endl;
/* can't do it */
return;
}
std::cerr << "GeneralMsgDialog::dropEvent() Formats";
std::cerr << std::endl;
QStringList formats = event->mimeData()->formats();
QStringList::iterator it;
for(it = formats.begin(); it != formats.end(); it++)
{
std::cerr << "Format: " << (*it).toStdString();
std::cerr << std::endl;
}
if (event->mimeData()->hasText())
{
std::cerr << "GeneralMsgDialog::dropEvent() Plain Text:";
std::cerr << std::endl;
std::cerr << event->mimeData()->text().toStdString();
std::cerr << std::endl;
}
if (event->mimeData()->hasUrls())
{
std::cerr << "GeneralMsgDialog::dropEvent() Urls:";
std::cerr << std::endl;
QList<QUrl> urls = event->mimeData()->urls();
QList<QUrl>::iterator uit;
for(uit = urls.begin(); uit != urls.end(); uit++)
{
std::string localpath = uit->toLocalFile().toStdString();
std::cerr << "Whole URL: " << uit->toString().toStdString();
std::cerr << std::endl;
std::cerr << "or As Local File: " << localpath;
std::cerr << std::endl;
if (localpath.size() > 0)
{
addAttachment(localpath);
}
}
}
else if (event->mimeData()->hasFormat("application/x-rsfilelist"))
{
std::cerr << "GeneralMsgDialog::dropEvent() Application/x-rsfilelist";
std::cerr << std::endl;
QByteArray data = event->mimeData()->data("application/x-rsfilelist");
std::cerr << "Data Len:" << data.length();
std::cerr << std::endl;
std::cerr << "Data is:" << data.data();
std::cerr << std::endl;
std::string newattachments(data.data());
parseRsFileListAttachments(newattachments);
}
event->setDropAction(Qt::CopyAction);
event->accept();
}
void GeneralMsgDialog::parseRsFileListAttachments(std::string attachList)
{
/* split into lines */
QString input = QString::fromStdString(attachList);
QStringList attachItems = input.split("\n");
QStringList::iterator it;
QStringList::iterator it2;
for(it = attachItems.begin(); it != attachItems.end(); it++)
{
std::cerr << "GeneralMsgDialog::parseRsFileListAttachments() Entry: ";
QStringList parts = (*it).split("/");
bool ok = false;
quint64 qsize = 0;
std::string fname;
std::string hash;
uint64_t size = 0;
std::string source;
int i = 0;
for(it2 = parts.begin(); it2 != parts.end(); it2++, i++)
{
std::cerr << "\"" << it2->toStdString() << "\" ";
switch(i)
{
case 0:
fname = it2->toStdString();
break;
case 1:
hash = it2->toStdString();
break;
case 2:
qsize = it2->toULongLong(&ok, 10);
size = qsize;
break;
case 3:
source = it2->toStdString();
break;
}
}
std::cerr << std::endl;
std::cerr << "\tfname: " << fname << std::endl;
std::cerr << "\thash: " << hash << std::endl;
std::cerr << "\tsize: " << size << std::endl;
std::cerr << "\tsource: " << source << std::endl;
/* basic error checking */
if ((ok) && (hash.size() == 40))
{
std::cerr << "Item Ok" << std::endl;
if (source == "Local")
{
addAttachment(hash, fname, size, true, "");
}
else
{
// TEMP NOT ALLOWED UNTIL FT WORKING.
addAttachment(hash, fname, size, false, source);
}
}
else
{
std::cerr << "Error Decode: Hash size: " << hash.size() << std::endl;
}
}
}
void GeneralMsgDialog::addAttachment(std::string hash, std::string fname, uint64_t size, bool local, std::string srcId)
{
/* add a AttachFileItem to the attachment section */
std::cerr << "GeneralMsgDialog::addAttachment()";
std::cerr << std::endl;
/* add widget in for new destination */
uint32_t flags = AFI_TYPE_ATTACH;
if (local)
{
flags |= AFI_STATE_LOCAL;
}
else
{
flags |= AFI_STATE_REMOTE;
// TMP REMOVED REMOTE ADD FOR DEMONSTRATOR
return;
}
AttachFileItem *file = new AttachFileItem(hash, fname, size, flags, srcId);
mAttachments.push_back(file);
verticalLayout_2->addWidget(file);
if (mCheckAttachment)
{
checkAttachmentReady();
}
return;
}
void GeneralMsgDialog::addExtraFile()
{
/* add a AttachFileItem to the attachment section */
std::cerr << "GeneralMsgDialog::addExtraFile() opening file dialog";
std::cerr << std::endl;
// select a file
QString qfile = QFileDialog::getOpenFileName(this, tr("Add Extra File"), "", "", 0,
QFileDialog::DontResolveSymlinks);
std::string filePath = qfile.toStdString();
if (filePath != "")
{
addAttachment(filePath);
}
}
void GeneralMsgDialog::addAttachment(std::string path)
{
/* add a AttachFileItem to the attachment section */
std::cerr << "GeneralMsgDialog::addAttachment()";
std::cerr << std::endl;
/* add to ExtraList here,
* use default TIMEOUT of 30 days (time to fetch it).
*/
//uint32_t period = 30 * 24 * 60 * 60;
//uint32_t flags = 0;
//rsFiles->ExtraFileHash(localpath, period, flags);
/* add widget in for new destination */
AttachFileItem *file = new AttachFileItem(path);
mAttachments.push_back(file);
verticalLayout_2->addWidget(file);
if (mCheckAttachment)
{
checkAttachmentReady();
}
return;
}
void GeneralMsgDialog::checkAttachmentReady()
{
std::list<AttachFileItem *>::iterator fit;
mCheckAttachment = false;
for(fit = mAttachments.begin(); fit != mAttachments.end(); fit++)
{
if (!(*fit)->isHidden())
{
if (!(*fit)->ready())
{
/*
*/
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
break;
return;
}
}
}
if (fit == mAttachments.end())
{
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
}
/* repeat... */
int msec_rate = 1000;
QTimer::singleShot( msec_rate, this, SLOT(checkAttachmentReady(void)));
}
void GeneralMsgDialog::cancelMsg()
{
std::cerr << "GeneralMsgDialog::cancelMsg()";
std::cerr << std::endl;
return;
}
void GeneralMsgDialog::addDestination(uint32_t type, std::string grpId, std::string inReplyTo)
{
std::cerr << "GeneralMsgDialog::addDestination()";
std::cerr << std::endl;
/* add widget in for new destination */
SubDestItem *dest = new SubDestItem(type, grpId, inReplyTo);
mDestinations.push_back(dest);
//QLayout *layout = destFrame->layout();
verticalLayout->addWidget(dest);
return;
}
void GeneralMsgDialog::setMsgType(uint32_t type)
{
switch(type)
{
default:
case FEEDHOLDER_MSG_MESSAGE:
typeComboBox->setCurrentIndex(GMD_TYPE_MESSAGE_IDX);
break;
case FEEDHOLDER_MSG_FORUM:
typeComboBox->setCurrentIndex(GMD_TYPE_FORUM_IDX);
break;
case FEEDHOLDER_MSG_CHANNEL:
typeComboBox->setCurrentIndex(GMD_TYPE_CHANNEL_IDX);
break;
case FEEDHOLDER_MSG_BLOG:
typeComboBox->setCurrentIndex(GMD_TYPE_BLOG_IDX);
break;
}
}
void GeneralMsgDialog::updateGroupId()
{
std::cerr << "GeneralMsgDialog::updateGroupId()";
std::cerr << std::endl;
int idx = typeComboBox->currentIndex();
destIdComboBox->clear();
switch(idx)
{
case GMD_TYPE_MESSAGE_IDX:
{
/* add a list of friends */
if (rsPeers)
{
std::list<std::string> friends;
std::list<std::string>::iterator it;
rsPeers->getFriendList(friends);
for(it = friends.begin(); it != friends.end(); it++)
{
QString id = QString::fromStdString(*it);
QString name = QString::fromStdString(rsPeers->getPeerName(*it));
destIdComboBox->addItem(name, id);
}
}
}
break;
case GMD_TYPE_FORUM_IDX:
{
/* add a list of publishable forums */
if (rsForums)
{
std::list<ForumInfo> forumList;
std::list<ForumInfo>::iterator it;
rsForums->getForumList(forumList);
for(it = forumList.begin(); it != forumList.end(); it++)
{
if (it->forumFlags & RS_DISTRIB_PUBLISH)
{
QString id = QString::fromStdString(it->forumId);
QString name = QString::fromStdWString(it->forumName);
destIdComboBox->addItem(name, id);
}
}
}
}
break;
case GMD_TYPE_CHANNEL_IDX:
{
/* add a list of publishable channels */
if (rsChannels)
{
std::list<ChannelInfo> channelList;
std::list<ChannelInfo>::iterator it;
rsChannels->getChannelList(channelList);
for(it = channelList.begin(); it != channelList.end(); it++)
{
if (it->channelFlags & RS_DISTRIB_PUBLISH)
{
QString id = QString::fromStdString(it->channelId);
QString name = QString::fromStdWString(it->channelName);
destIdComboBox->addItem(name, id);
}
}
}
}
break;
default:
case GMD_TYPE_BLOG_IDX:
{
/* empty list */
}
break;
}
}
void GeneralMsgDialog::newDestination()
{
/* get details from uint32_t type, std::string grpId, std::string inReplyTo)
*/
std::cerr << "GeneralMsgDialog::newDestination()";
std::cerr << std::endl;
int idx = typeComboBox->currentIndex();
std::string grpId;
if (destIdComboBox->currentIndex() >= 0)
{
QVariant qv = destIdComboBox->itemData(destIdComboBox->currentIndex());
grpId = qv.toString().toStdString();
}
switch(idx)
{
case GMD_TYPE_MESSAGE_IDX:
addDestination(FEEDHOLDER_MSG_MESSAGE, grpId, "");
break;
case GMD_TYPE_FORUM_IDX:
addDestination(FEEDHOLDER_MSG_FORUM, grpId, "");
break;
case GMD_TYPE_CHANNEL_IDX:
addDestination(FEEDHOLDER_MSG_CHANNEL, grpId, "");
break;
case GMD_TYPE_BLOG_IDX:
addDestination(FEEDHOLDER_MSG_BLOG, "", "");
break;
default:
break;
}
}
void GeneralMsgDialog::sendMsg()
{
std::cerr << "GeneralMsgDialog::sendMsg()";
std::cerr << std::endl;
/* construct message bits */
std::wstring subject = subjectEdit->text().toStdWString();
std::wstring msg = msgEdit->toPlainText().toStdWString();
std::list<FileInfo> files;
std::list<SubDestItem *>::iterator it;
std::list<AttachFileItem *>::iterator fit;
for(fit = mAttachments.begin(); fit != mAttachments.end(); fit++)
{
if (!(*fit)->isHidden())
{
FileInfo fi;
fi.hash = (*fit)->FileHash();
fi.fname = (*fit)->FileName();
fi.size = (*fit)->FileSize();
files.push_back(fi);
/* commence downloads - if we don't have the file */
if (!(*fit)->done())
{
if ((*fit)->ready())
{
//(*fit)->download();
}
// Skips unhashed files.
}
}
}
/* iterate through each mDestinations that is visible, and send */
for(it = mDestinations.begin(); it != mDestinations.end(); it++)
{
if (!(*it)->isHidden())
{
sendMessage((*it)->DestType(), (*it)->DestGroupId(),
(*it)->DestInReplyTo(), subject, msg, files);
}
}
}
void GeneralMsgDialog::sendMessage(uint32_t type, std::string grpId, std::string inReplyTo,
std::wstring subject, std::wstring msg, std::list<FileInfo> &files)
{
std::cerr << "GeneralMsgDialog::sendMessage() Type: " << type << " GroupId: " << grpId;
std::cerr << std::endl;
/* construct specific messages */
switch(type)
{
case FEEDHOLDER_MSG_MESSAGE:
{
if (rsMsgs)
{
/* construct a message */
MessageInfo mi;
mi.title = subject;
mi.msg = msg;
mi.files = files;
mi.msgto.push_back(grpId);
rsMsgs->MessageSend(mi);
}
}
break;
case FEEDHOLDER_MSG_FORUM:
{
/* rsForum */
if (rsForums)
{
ForumMsgInfo msgInfo;
msgInfo.forumId = grpId;
msgInfo.threadId = "";
msgInfo.parentId = inReplyTo;
msgInfo.msgId = "";
msgInfo.title = subject;
msgInfo.msg = msg;
rsForums->ForumMessageSend(msgInfo);
}
}
break;
case FEEDHOLDER_MSG_CHANNEL:
{
/* rsChannels */
if (rsChannels)
{
ChannelMsgInfo msgInfo;
msgInfo.channelId = grpId;
msgInfo.msgId = "";
msgInfo.subject = subject;
msgInfo.msg = msg;
msgInfo.files = files;
rsChannels->ChannelMessageSend(msgInfo);
}
}
break;
case FEEDHOLDER_MSG_BLOG:
break;
default:
break;
}
}

View File

@ -1,83 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2008 Robert Fernie
*
* 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 _GENERAL_MSG_DIALOG_H
#define _GENERAL_MSG_DIALOG_H
#include "ui_GeneralMsgDialog.h"
#include <stdint.h>
class SubDestItem;
class AttachFileItem;
class FileInfo;
const uint32_t GMD_TYPE_MESSAGE_IDX = 0;
const uint32_t GMD_TYPE_FORUM_IDX = 1;
const uint32_t GMD_TYPE_CHANNEL_IDX = 2;
const uint32_t GMD_TYPE_BLOG_IDX = 3;
class GeneralMsgDialog : public QDialog, private Ui::GeneralMsgDialog
{
Q_OBJECT
public:
/** Default Constructor */
GeneralMsgDialog(QWidget *parent = 0, uint32_t type = 0);
/** Default Destructor */
void addAttachment(std::string path);
void addAttachment(std::string hash, std::string fname, uint64_t size,
bool local, std::string srcId);
void addDestination(uint32_t type, std::string grpId, std::string inReplyTo);
void setMsgType(uint32_t type);
protected:
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dropEvent(QDropEvent *event);
private slots:
void addExtraFile();
void checkAttachmentReady();
void updateGroupId();
void newDestination();
void cancelMsg();
void sendMsg();
private:
void parseRsFileListAttachments(std::string attachList);
void sendMessage(uint32_t type, std::string grpId, std::string inReplyTo,
std::wstring subject, std::wstring msg, std::list<FileInfo> &files);
/* maps of files and destinations */
std::list<SubDestItem *> mDestinations;
std::list<AttachFileItem *> mAttachments;
bool mCheckAttachment;
};
#endif

View File

@ -1,508 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>GeneralMsgDialog</class>
<widget class="QDialog" name="GeneralMsgDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>548</width>
<height>458</height>
</rect>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="windowTitle">
<string>General Message</string>
</property>
<property name="windowIcon">
<iconset resource="images.qrc">
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="1" column="0">
<layout class="QHBoxLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<item>
<widget class="QComboBox" name="typeComboBox">
<property name="acceptDrops">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Friend</string>
</property>
</item>
<item>
<property name="text">
<string>Channel</string>
</property>
</item>
<item>
<property name="text">
<string>Forum</string>
</property>
</item>
<item>
<property name="text">
<string>Blog</string>
</property>
</item>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="destIdComboBox"/>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="addButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Add Message Destination</string>
</property>
<property name="text">
<string>Add Message Destination</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/edit_add24.png</normaloff>:/images/edit_add24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QFrame" name="frame">
<property name="styleSheet">
<string notr="true">QFrame#frame{background-image: url(:/images/connect/connectFriendBanner.png);}
</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/new-mail-alert.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_7">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:18pt; font-weight:600; color:#ffffff;&quot;&gt;General Message&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<property name="topMargin">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Message</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/contacts24.png</pixmap>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Message Destination</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>271</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QScrollArea" name="scrollArea_2">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>485</width>
<height>60</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="2" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayout"/>
</item>
</layout>
</widget>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Message</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QHBoxLayout" name="_2">
<item>
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Subject :</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="subjectEdit"/>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QTextEdit" name="msgEdit"/>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Attachments</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_9">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/attachment.png</pixmap>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>13</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Attachments</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>218</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="addFileButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>24</width>
<height>0</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QScrollArea" name="scrollArea">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>485</width>
<height>270</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="images.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>GeneralMsgDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>GeneralMsgDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -28,7 +28,6 @@
#include "NetworkDialog.h"
#include "NetworkView.h"
#include "TrustView.h"
#include "connect/ConnectDialog.h"
#include "GenCertDialog.h"
#include "rsiface/rsiface.h"
#include "rsiface/rspeers.h"

View File

@ -30,9 +30,6 @@
#include "ui_NetworkDialog.h"
#include "RsAutoUpdatePage.h"
#include "connect/ConnectDialog.h"
class NetworkDialog : public RsAutoUpdatePage
{
Q_OBJECT

View File

@ -37,9 +37,6 @@
#include "settings/rsharesettings.h"
#include "GeneralMsgDialog.h"
const uint32_t NEWSFEED_PEERLIST = 0x0001;
const uint32_t NEWSFEED_FORUMNEWLIST = 0x0002;
const uint32_t NEWSFEED_FORUMMSGLIST = 0x0003;
@ -418,20 +415,4 @@ void NewsFeed::openChat(std::string peerId)
#endif
}
void NewsFeed::openMsg(uint32_t type, std::string grpId, std::string inReplyTo)
{
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::openMsg()";
std::cerr << std::endl;
#endif
GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL);
msgDialog->addDestination(type, grpId, inReplyTo);
msgDialog->show();
/* window will destroy itself! */
}

View File

@ -43,7 +43,6 @@ public:
/* FeedHolder Functions (for FeedItem functionality) */
virtual void deleteFeedItem(QWidget *item, uint32_t type);
virtual void openChat(std::string peerId);
virtual void openMsg(uint32_t type, std::string grpId, std::string inReplyTo);
private slots:
// void toggleChanMsgItems(bool on);

View File

@ -1,184 +0,0 @@
/****************************************************************
* RShare is distributed under the following license:
*
* Copyright (C) 2006, crypton
*
* 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 <rshare.h>
#include "ConnectDialog.h"
#include "rsiface/rsiface.h"
#include "rsiface/rspeers.h"
#include <iostream>
#include <sstream>
/** Default constructor */
ConnectDialog::ConnectDialog(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
// Create the status bar
statusBar()->showMessage("Peer Informations");
//setFixedSize(QSize(330, 412));
connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(closeinfodlg()));
connect(ui.okButton, SIGNAL(clicked()), this, SLOT(authAttempt()));
connect(ui.Ledit_name, SIGNAL(textChanged ( const QString & ) ), this, SLOT(checkAuthCode( const QString & )));
}
/** Destructor. */
ConnectDialog::~ConnectDialog()
{
}
/**
Overloads the default show() slot so we can set opacity*/
void
ConnectDialog::show()
{
//loadSettings();
if(!this->isVisible()) {
QMainWindow::show();
}
}
void ConnectDialog::closeEvent (QCloseEvent * event)
{
QWidget::closeEvent(event);
}
void ConnectDialog::closeinfodlg()
{
close();
}
void ConnectDialog::setInfo(std::string name,
std::string trust,
std::string org,
std::string loc,
std::string country,
std::string signers)
{
ui.name->setText(QString::fromStdString(name));
ui.trust->setText(QString::fromStdString(trust));
ui.org->setText(QString::fromStdString(org));
ui.loc->setText(QString::fromStdString(loc));
ui.country->setText(QString::fromStdString(country));
ui.signers->setText(QString::fromStdString(signers));
}
void ConnectDialog::setAuthCode(std::string id, std::string code)
{
authId = id;
authCode = code;
ui.Ledit_name->setText(QString::fromStdString(code));
//ui.okButton ->setEnabled(true);
}
void ConnectDialog::checkAuthCode(const QString &txt)
{
//std::cerr << "AuthCode:" << authCode << std::endl;
//std::cerr << "Entered:" << ui.Ledit_name -> text().toStdString() << std::endl;
//std::cerr << "Entered:" << txt.toStdString() << std::endl;
if (authCode == txt.toStdString())
{
/* enable ok button */
ui.okButton ->setEnabled(true);
}
else
{
/* disable ok button */
ui.okButton ->setEnabled(false);
}
}
void ConnectDialog::authAttempt()
{
/* well lets do it ! */
std::cerr << "Attempting AuthCode:" << authCode << std::endl;
//rsPeers->AuthCertificate(authId, authCode);
rsPeers->addDummyFriend(authId);
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_NEIGHBOURS,1) ;
/* close it up! */
closeinfodlg();
}
bool ConnectDialog::loadPeer(std::string id)
{
RsPeerDetails detail;
if (!rsPeers->getPeerDetails(id, detail))
{
rsiface->unlockData(); /* UnLock Interface */
return false;
}
std::string trustString;
switch(detail.trustLvl)
{
case RS_TRUST_LVL_ULTIMATE:
trustString = "Ultimate";
break;
case RS_TRUST_LVL_FULL:
trustString = "Full";
break;
case RS_TRUST_LVL_MARGINAL:
trustString = "Marginal";
break;
case RS_TRUST_LVL_NONE:
trustString = "None";
break;
default:
trustString = "Unknown";
break;
}
std::ostringstream out;
std::list<std::string>::iterator it;
for(it = detail.gpgSigners.begin(); it != detail.gpgSigners.end(); it++)
{
out << rsPeers->getPeerName(*it) << " <" << *it << ">";
out << std::endl;
}
/* setup the gui */
setInfo(detail.name, trustString, detail.org,
detail.location, detail.email, out.str());
setAuthCode(id, detail.authcode);
return true;
}

View File

@ -1,76 +0,0 @@
/****************************************************************
* RShare is distributed under the following license:
*
* Copyright (C) 2006, crypton
*
* 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 _CONNECTDIALOG_H
#define _CONNECTDIALOG_H
#include "ui_ConnectDialog.h"
class ConnectDialog : public QMainWindow
{
Q_OBJECT
public:
/** Default constructor */
ConnectDialog(QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default destructor */
~ConnectDialog();
bool loadPeer(std::string id);
public slots:
/** Overloaded QWidget.show */
void checkAuthCode( const QString &txt );
void show();
protected:
void closeEvent (QCloseEvent * event);
private slots:
void closeinfodlg();
void authAttempt();
private:
void setInfo(std::string name,
std::string trust,
std::string org,
std::string loc,
std::string country,
std::string signers);
void setAuthCode(std::string id, std::string code);
std::string authCode;
std::string authId;
/** Qt Designer generated object */
Ui::ConnectDialog ui;
};
#endif

View File

@ -1,740 +0,0 @@
<ui version="4.0" >
<class>ConnectDialog</class>
<widget class="QMainWindow" name="ConnectDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>462</width>
<height>475</height>
</rect>
</property>
<property name="palette" >
<palette>
<active>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>16</red>
<green>16</green>
<blue>16</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>160</red>
<green>160</green>
<blue>160</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>16</red>
<green>16</green>
<blue>16</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>160</red>
<green>160</green>
<blue>160</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>208</red>
<green>208</green>
<blue>208</blue>
</color>
</brush>
</colorrole>
<colorrole role="Light" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>160</red>
<green>160</green>
<blue>160</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>104</red>
<green>104</green>
<blue>104</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
<colorrole role="Shadow" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Highlight" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="HighlightedText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Link" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="LinkVisited" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>255</red>
<green>0</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>247</red>
<green>247</green>
<blue>247</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font" >
<font>
<family>Arial</family>
<pointsize>8</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="contextMenuPolicy" >
<enum>Qt::NoContextMenu</enum>
</property>
<property name="windowTitle" >
<string>Make Friend</string>
</property>
<property name="windowIcon" >
<iconset resource="../images.qrc" >
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property>
<widget class="QWidget" name="centralwidget" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>462</width>
<height>453</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2" >
<item row="0" column="0" colspan="3" >
<widget class="QLabel" name="label_8" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>70</height>
</size>
</property>
<property name="styleSheet" >
<string notr="true" >background-image: url(:/images/addfriendlabel.png)</string>
</property>
<property name="text" >
<string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:16pt; font-weight:600; color:#000000;"> Make Friend&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Peer Details</string>
</property>
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Trust:</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="trust" >
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Name:</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="name" >
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Org:</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLineEdit" name="org" >
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Loc:</string>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QLineEdit" name="loc" >
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0" >
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>Country:</string>
</property>
</widget>
</item>
<item row="4" column="1" >
<widget class="QLineEdit" name="country" >
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0" >
<widget class="QLabel" name="label_6" >
<property name="text" >
<string>signers:</string>
</property>
</widget>
</item>
<item row="5" column="1" >
<widget class="QTextBrowser" name="signers" />
</item>
</layout>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_7" >
<property name="text" >
<string>AUTH CODE:</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLineEdit" name="Ledit_name" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="2" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>235</width>
<height>18</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0" colspan="3" >
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>131</width>
<height>31</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="cancelButton" >
<property name="minimumSize" >
<size>
<width>77</width>
<height>0</height>
</size>
</property>
<property name="text" >
<string>Cancel</string>
</property>
<property name="icon" >
<iconset resource="../images.qrc" >
<normaloff>:/images/cancel.png</normaloff>:/images/cancel.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="okButton" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="minimumSize" >
<size>
<width>77</width>
<height>0</height>
</size>
</property>
<property name="text" >
<string>Make Friend</string>
</property>
<property name="icon" >
<iconset resource="../images.qrc" >
<normaloff>:/images/user/add_user16.png</normaloff>:/images/user/add_user16.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusbar" >
<property name="geometry" >
<rect>
<x>0</x>
<y>453</y>
<width>462</width>
<height>22</height>
</rect>
</property>
</widget>
</widget>
<tabstops>
<tabstop>trust</tabstop>
<tabstop>name</tabstop>
<tabstop>org</tabstop>
<tabstop>loc</tabstop>
<tabstop>country</tabstop>
<tabstop>signers</tabstop>
<tabstop>Ledit_name</tabstop>
</tabstops>
<resources>
<include location="../images.qrc" />
</resources>
<connections/>
</ui>

View File

@ -36,7 +36,6 @@ class FeedHolder
virtual void deleteFeedItem(QWidget *item, uint32_t type) = 0;
virtual void openChat(std::string peerId) = 0;
virtual void openMsg(uint32_t type, std::string grpId, std::string inReplyTo) = 0;
};
#endif

View File

@ -208,7 +208,7 @@ void ForumNewItem::postToForum()
#endif
if (mParent)
{
mParent->openMsg(FEEDHOLDER_MSG_FORUM, mForumId, "");
//mParent->openMsg(FEEDHOLDER_MSG_FORUM, mForumId, "");
}
}

View File

@ -38,7 +38,6 @@
#include "BlogDetails.h"
#include "gui/ChanGroupDelegate.h"
#include "gui/GeneralMsgDialog.h"
#define BLOG_DEFAULT_IMAGE ":/images/hi64-app-kblogger.png"
@ -196,22 +195,6 @@ void BlogsDialog::openChat(std::string peerId)
return;
}
void BlogsDialog::openMsg(uint32_t type, std::string grpId, std::string inReplyTo)
{
#ifdef BLOG_DEBUG
std::cerr << "BlogsDialog::openMsg()";
std::cerr << std::endl;
#endif
GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL);
msgDialog->addDestination(type, grpId, inReplyTo);
msgDialog->show();
/* window will destroy itself! */
}
void BlogsDialog::createMsg()
{
if (mBlogId == "")

View File

@ -49,7 +49,6 @@ public:
virtual void deleteFeedItem(QWidget *item, uint32_t type);
virtual void openChat(std::string peerId);
virtual void openMsg(uint32_t type, std::string grpId, std::string inReplyTo);
public slots: