updated branch to upstream/master
|
@ -24,10 +24,15 @@
|
|||
#include "HelpDialog.h"
|
||||
#include "rshare.h"
|
||||
|
||||
#include <retroshare/rsiface.h>
|
||||
#include <retroshare/rsplugin.h>
|
||||
#include <retroshare/rsdisc.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
#include "settings/rsharesettings.h"
|
||||
#include <microhttpd.h>
|
||||
|
||||
#include <QClipboard>
|
||||
#include <QSysInfo>
|
||||
#include <QHBoxLayout>
|
||||
#include <QPainter>
|
||||
#include <QBrush>
|
||||
|
@ -721,3 +726,79 @@ NextPieceLabel::NextPieceLabel( QWidget* parent /* = 0*/ ) : QLabel(parent)
|
|||
setAlignment(Qt::AlignCenter);
|
||||
setAutoFillBackground(true);
|
||||
}
|
||||
|
||||
static QString addLibraries(const std::string &name, const std::list<RsLibraryInfo> &libraries)
|
||||
{
|
||||
QString mTextEdit;
|
||||
mTextEdit+=QString::fromUtf8(name.c_str());
|
||||
mTextEdit+="\n";
|
||||
|
||||
std::list<RsLibraryInfo>::const_iterator libraryIt;
|
||||
for (libraryIt = libraries.begin(); libraryIt != libraries.end(); ++libraryIt) {
|
||||
|
||||
mTextEdit+=" - ";
|
||||
mTextEdit+=QString::fromUtf8(libraryIt->mName.c_str());
|
||||
mTextEdit+=": ";
|
||||
mTextEdit+=QString::fromUtf8(libraryIt->mVersion.c_str());
|
||||
mTextEdit+="\n";
|
||||
}
|
||||
mTextEdit+="\n";
|
||||
return mTextEdit;
|
||||
}
|
||||
|
||||
|
||||
void AboutDialog::on_copy_button_clicked()
|
||||
{
|
||||
QString verInfo;
|
||||
QString rsVerString = "RetroShare Version: ";
|
||||
rsVerString+=Rshare::retroshareVersion(true);
|
||||
verInfo+=rsVerString;
|
||||
verInfo+="\n";
|
||||
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
|
||||
#if QT_VERSION >= QT_VERSION_CHECK (5, 4, 0)
|
||||
verInfo+=QSysInfo::prettyProductName();
|
||||
#endif
|
||||
#else
|
||||
#ifdef Q_OS_LINUX
|
||||
verInfo+="Linux";
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
verInfo+="Windows";
|
||||
#endif
|
||||
#ifdef Q_OS_MAC
|
||||
verInfo+="Mac";
|
||||
#endif
|
||||
#endif
|
||||
verInfo+=" ";
|
||||
QString qtver = QString("QT ")+QT_VERSION_STR;
|
||||
verInfo+=qtver;
|
||||
verInfo+="\n\n";
|
||||
|
||||
/* Add version numbers of libretroshare */
|
||||
std::list<RsLibraryInfo> libraries;
|
||||
RsControl::instance()->getLibraries(libraries);
|
||||
verInfo+=addLibraries("libretroshare", libraries);
|
||||
|
||||
/* Add version numbers of RetroShare */
|
||||
// Add versions here. Find a better place.
|
||||
libraries.clear();
|
||||
libraries.push_back(RsLibraryInfo("Libmicrohttpd", MHD_get_version()));
|
||||
verInfo+=addLibraries("RetroShare", libraries);
|
||||
|
||||
/* Add version numbers of plugins */
|
||||
if (rsPlugins) {
|
||||
for (int i = 0; i < rsPlugins->nbPlugins(); ++i) {
|
||||
RsPlugin *plugin = rsPlugins->plugin(i);
|
||||
if (plugin) {
|
||||
libraries.clear();
|
||||
plugin->getLibraries(libraries);
|
||||
verInfo+=addLibraries(plugin->getPluginName(), libraries);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QApplication::clipboard()->setText(verInfo);
|
||||
}
|
||||
|
|
|
@ -50,6 +50,8 @@ private slots:
|
|||
void sl_levelChanged(int);
|
||||
void on_help_button_clicked();
|
||||
|
||||
void on_copy_button_clicked();
|
||||
|
||||
signals:
|
||||
void si_scoreChanged(QString);
|
||||
void si_maxScoreChanged(QString);
|
||||
|
|
|
@ -23,7 +23,16 @@
|
|||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
|
@ -52,6 +61,17 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="copy_button">
|
||||
<property name="text">
|
||||
<string>Copy Info</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/images/copy.png</normaloff>:/images/copy.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
|
@ -76,7 +96,9 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="images.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>close_button</sender>
|
||||
|
|
|
@ -22,18 +22,21 @@
|
|||
#include "retroshare/rsnotify.h"
|
||||
#include "retroshare/rsidentity.h"
|
||||
|
||||
//#define CHAT_LOBBY_GUI_DEBUG 1
|
||||
|
||||
#define COLUMN_NAME 0
|
||||
#define COLUMN_USER_COUNT 1
|
||||
#define COLUMN_TOPIC 2
|
||||
#define COLUMN_SUBSCRIBED 3
|
||||
#define COLUMN_COUNT 4
|
||||
|
||||
#define COLUMN_DATA 0
|
||||
#define ROLE_SORT Qt::UserRole
|
||||
#define ROLE_ID Qt::UserRole + 1
|
||||
#define ROLE_SUBSCRIBED Qt::UserRole + 2
|
||||
#define ROLE_PRIVACYLEVEL Qt::UserRole + 3
|
||||
|
||||
#define ROLE_SORT Qt::UserRole
|
||||
#define ROLE_ID Qt::UserRole + 1
|
||||
#define ROLE_SUBSCRIBED Qt::UserRole + 2
|
||||
#define ROLE_PRIVACYLEVEL Qt::UserRole + 3
|
||||
#define ROLE_AUTOSUBSCRIBE Qt::UserRole + 4
|
||||
#define ROLE_FLAGS Qt::UserRole + 5
|
||||
|
||||
|
||||
#define TYPE_FOLDER 0
|
||||
|
@ -129,10 +132,12 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
|
|||
ui.lobbyTreeWidget->setColumnHidden(COLUMN_SUBSCRIBED,true) ;
|
||||
ui.lobbyTreeWidget->setSortingEnabled(true) ;
|
||||
|
||||
float fact = QFontMetricsF(font()).height()/14.0f;
|
||||
|
||||
ui.lobbyTreeWidget->adjustSize();
|
||||
ui.lobbyTreeWidget->setColumnWidth(COLUMN_NAME,100);
|
||||
ui.lobbyTreeWidget->setColumnWidth(COLUMN_USER_COUNT, 50);
|
||||
ui.lobbyTreeWidget->setColumnWidth(COLUMN_TOPIC, 50);
|
||||
ui.lobbyTreeWidget->setColumnWidth(COLUMN_NAME,100*fact);
|
||||
ui.lobbyTreeWidget->setColumnWidth(COLUMN_USER_COUNT, 50*fact);
|
||||
ui.lobbyTreeWidget->setColumnWidth(COLUMN_TOPIC, 50*fact);
|
||||
|
||||
/** Setup the actions for the header context menu */
|
||||
showUserCountAct= new QAction(headerItem->text(COLUMN_USER_COUNT),this);
|
||||
|
@ -150,7 +155,7 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
|
|||
ui.splitter->setStretchFactor(1, 1);
|
||||
|
||||
QList<int> sizes;
|
||||
sizes << 200 << width(); // Qt calculates the right sizes
|
||||
sizes << 200*fact << width(); // Qt calculates the right sizes
|
||||
ui.splitter->setSizes(sizes);
|
||||
|
||||
lobbyChanged();
|
||||
|
@ -222,6 +227,25 @@ void ChatLobbyWidget::updateNotify(ChatLobbyId id, unsigned int count)
|
|||
}
|
||||
}
|
||||
|
||||
static bool trimAnonIds(std::list<RsGxsId>& lst)
|
||||
{
|
||||
// trim down identities that are unsigned, because the lobby requires it.
|
||||
bool removed = false ;
|
||||
|
||||
RsIdentityDetails idd ;
|
||||
|
||||
for(std::list<RsGxsId>::iterator it = lst.begin();it!=lst.end();)
|
||||
if(!rsIdentity->getIdDetails(*it,idd) || !idd.mPgpLinked)
|
||||
{
|
||||
it = lst.erase(it) ;
|
||||
removed= true ;
|
||||
}
|
||||
else
|
||||
++it ;
|
||||
|
||||
return removed ;
|
||||
}
|
||||
|
||||
void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint)
|
||||
{
|
||||
std::cerr << "Creating customPopupMennu" << std::endl;
|
||||
|
@ -244,10 +268,19 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint)
|
|||
else
|
||||
{
|
||||
QTreeWidgetItem *item = ui.lobbyTreeWidget->currentItem();
|
||||
uint32_t item_flags = item->data(COLUMN_DATA,ROLE_ID).toUInt() ;
|
||||
|
||||
ChatLobbyId id = item->data(COLUMN_DATA, ROLE_ID).toULongLong();
|
||||
ChatLobbyFlags flags(item->data(COLUMN_DATA, ROLE_FLAGS).toUInt());
|
||||
|
||||
bool removed = false ;
|
||||
if(flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED)
|
||||
removed = trimAnonIds(own_identities) ;
|
||||
|
||||
if(own_identities.empty())
|
||||
{
|
||||
if(removed)
|
||||
contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Create a non anonymous identity and enter this lobby"), this, SLOT(createIdentityAndSubscribe()));
|
||||
else
|
||||
contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Create an identity and enter this lobby"), this, SLOT(createIdentityAndSubscribe()));
|
||||
}
|
||||
else if(own_identities.size() == 1)
|
||||
|
@ -300,7 +333,7 @@ void ChatLobbyWidget::lobbyChanged()
|
|||
updateDisplay();
|
||||
}
|
||||
|
||||
static void updateItem(QTreeWidget *treeWidget, QTreeWidgetItem *item, ChatLobbyId id, const std::string &name, const std::string &topic, int count, bool subscribed, bool autoSubscribe)
|
||||
static void updateItem(QTreeWidget *treeWidget, QTreeWidgetItem *item, ChatLobbyId id, const std::string &name, const std::string &topic, int count, bool subscribed, bool autoSubscribe,ChatLobbyFlags lobby_flags)
|
||||
{
|
||||
item->setText(COLUMN_NAME, QString::fromUtf8(name.c_str()));
|
||||
item->setData(COLUMN_NAME, ROLE_SORT, QString::fromUtf8(name.c_str()));
|
||||
|
@ -323,9 +356,11 @@ static void updateItem(QTreeWidget *treeWidget, QTreeWidgetItem *item, ChatLobby
|
|||
|
||||
item->setData(COLUMN_DATA, ROLE_ID, (qulonglong)id);
|
||||
item->setData(COLUMN_DATA, ROLE_SUBSCRIBED, subscribed);
|
||||
item->setData(COLUMN_DATA, ROLE_FLAGS, lobby_flags.toUInt32());
|
||||
item->setData(COLUMN_DATA, ROLE_AUTOSUBSCRIBE, autoSubscribe);
|
||||
|
||||
QColor color = treeWidget->palette().color(QPalette::Active, QPalette::Text);
|
||||
|
||||
if (!subscribed) {
|
||||
// Average between Base and Text colors
|
||||
QColor color2 = treeWidget->palette().color(QPalette::Active, QPalette::Base);
|
||||
|
@ -335,10 +370,15 @@ static void updateItem(QTreeWidget *treeWidget, QTreeWidgetItem *item, ChatLobby
|
|||
for (int column = 0; column < COLUMN_COUNT; ++column) {
|
||||
item->setTextColor(column, color);
|
||||
}
|
||||
item->setToolTip(0,QObject::tr("Subject:")+" "+item->text(COLUMN_TOPIC)+"\n"
|
||||
QString tooltipstr = QObject::tr("Subject:")+" "+item->text(COLUMN_TOPIC)+"\n"
|
||||
+QObject::tr("Participants:")+" "+QString::number(count)+"\n"
|
||||
+QObject::tr("Auto Subscribe:")+" "+(autoSubscribe? QObject::tr("enabled"): QObject::tr("disabled"))+"\n"
|
||||
+QObject::tr("Id:")+" "+QString::number(id,16)) ;
|
||||
+QObject::tr("Id:")+" "+QString::number(id,16) ;
|
||||
|
||||
if(lobby_flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED)
|
||||
tooltipstr += QObject::tr("\nSecurity: no anonymous ids") ;
|
||||
|
||||
item->setToolTip(0,tooltipstr) ;
|
||||
}
|
||||
|
||||
void ChatLobbyWidget::addChatPage(ChatLobbyDialog *d)
|
||||
|
@ -380,7 +420,6 @@ void ChatLobbyWidget::setCurrentChatPage(ChatLobbyDialog *d)
|
|||
}
|
||||
}
|
||||
|
||||
//#define CHAT_LOBBY_GUI_DEBUG
|
||||
void ChatLobbyWidget::updateDisplay()
|
||||
{
|
||||
#ifdef CHAT_LOBBY_GUI_DEBUG
|
||||
|
@ -521,12 +560,15 @@ void ChatLobbyWidget::updateDisplay()
|
|||
}
|
||||
}
|
||||
|
||||
ChatLobbyFlags lobby_flags = lobby.lobby_flags ;
|
||||
|
||||
QIcon icon;
|
||||
if (item == NULL)
|
||||
{
|
||||
item = new RSTreeWidgetItem(compareRole, TYPE_LOBBY);
|
||||
icon = (lobby.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? QIcon(IMAGE_PUBLIC) : QIcon(IMAGE_PRIVATE);
|
||||
lobby_item->addChild(item);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -554,7 +596,7 @@ void ChatLobbyWidget::updateDisplay()
|
|||
}
|
||||
}
|
||||
|
||||
updateItem(ui.lobbyTreeWidget, item, lobby.lobby_id, lobby.lobby_name,lobby.lobby_topic, lobby.total_number_of_peers, subscribed, autoSubscribe);
|
||||
updateItem(ui.lobbyTreeWidget, item, lobby.lobby_id, lobby.lobby_name,lobby.lobby_topic, lobby.total_number_of_peers, subscribed, autoSubscribe,lobby_flags);
|
||||
}
|
||||
|
||||
// time_t now = time(NULL) ;
|
||||
|
@ -589,7 +631,11 @@ void ChatLobbyWidget::updateDisplay()
|
|||
}
|
||||
|
||||
QIcon icon;
|
||||
if (item == NULL) {
|
||||
|
||||
ChatLobbyFlags lobby_flags = lobby.lobby_flags ;
|
||||
|
||||
if (item == NULL)
|
||||
{
|
||||
item = new RSTreeWidgetItem(compareRole, TYPE_LOBBY);
|
||||
icon = (lobby.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? QIcon(IMAGE_PUBLIC) : QIcon(IMAGE_PRIVATE);
|
||||
itemParent->addChild(item);
|
||||
|
@ -605,7 +651,7 @@ void ChatLobbyWidget::updateDisplay()
|
|||
|
||||
bool autoSubscribe = rsMsgs->getLobbyAutoSubscribe(lobby.lobby_id);
|
||||
|
||||
updateItem(ui.lobbyTreeWidget, item, lobby.lobby_id, lobby.lobby_name,lobby.lobby_topic, lobby.gxs_ids.size(), true, autoSubscribe);
|
||||
updateItem(ui.lobbyTreeWidget, item, lobby.lobby_id, lobby.lobby_name,lobby.lobby_topic, lobby.gxs_ids.size(), true, autoSubscribe,lobby_flags);
|
||||
}
|
||||
publicSubLobbyItem->setHidden(publicSubLobbyItem->childCount()==0);
|
||||
privateSubLobbyItem->setHidden(privateSubLobbyItem->childCount()==0);
|
||||
|
@ -647,9 +693,14 @@ void ChatLobbyWidget::createIdentityAndSubscribe()
|
|||
return ;
|
||||
|
||||
ChatLobbyId id = item->data(COLUMN_DATA, ROLE_ID).toULongLong();
|
||||
ChatLobbyFlags flags(item->data(COLUMN_DATA, ROLE_FLAGS).toUInt());
|
||||
|
||||
IdEditDialog dlg(this);
|
||||
dlg.setupNewId(false);
|
||||
|
||||
if(flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED) //
|
||||
dlg.enforceNoAnonIds() ;
|
||||
|
||||
dlg.exec();
|
||||
// fetch new id
|
||||
std::list<RsGxsId> own_ids;
|
||||
|
@ -711,6 +762,7 @@ void ChatLobbyWidget::subscribeChatLobbyAtItem(QTreeWidgetItem *item)
|
|||
}
|
||||
|
||||
ChatLobbyId id = item->data(COLUMN_DATA, ROLE_ID).toULongLong();
|
||||
ChatLobbyFlags flags ( item->data(COLUMN_DATA, ROLE_FLAGS).toUInt());
|
||||
RsGxsId gxs_id ;
|
||||
|
||||
std::list<RsGxsId> own_ids;
|
||||
|
@ -726,6 +778,9 @@ void ChatLobbyWidget::subscribeChatLobbyAtItem(QTreeWidgetItem *item)
|
|||
{
|
||||
IdEditDialog dlg(this);
|
||||
dlg.setupNewId(false);
|
||||
|
||||
if(flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED) //
|
||||
dlg.enforceNoAnonIds() ;
|
||||
dlg.exec();
|
||||
// fetch new id
|
||||
if(!rsIdentity->getOwnIds(own_ids) || own_ids.empty())
|
||||
|
@ -733,7 +788,19 @@ void ChatLobbyWidget::subscribeChatLobbyAtItem(QTreeWidgetItem *item)
|
|||
gxs_id = own_ids.front();
|
||||
}
|
||||
else
|
||||
{
|
||||
rsMsgs->getDefaultIdentityForChatLobby(gxs_id);
|
||||
|
||||
RsIdentityDetails idd ;
|
||||
if(!rsIdentity->getIdDetails(gxs_id,idd))
|
||||
return ;
|
||||
|
||||
if(flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED)
|
||||
{
|
||||
QMessageBox::warning(NULL,tr("Default identity is anonymous"),tr("You cannot join this lobby with your default identity, since it is anonymous and the lobby forbids it.")) ;
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
if(rsMsgs->joinVisibleChatLobby(id,gxs_id))
|
||||
ChatDialog::chatFriend(ChatId(id),true) ;
|
||||
|
@ -763,18 +830,25 @@ void ChatLobbyWidget::showBlankPage(ChatLobbyId id)
|
|||
std::list<RsGxsId> my_ids ;
|
||||
rsIdentity->getOwnIds(my_ids) ;
|
||||
|
||||
trimAnonIds(my_ids) ;
|
||||
|
||||
for(std::vector<VisibleChatLobbyRecord>::const_iterator it(lobbies.begin());it!=lobbies.end();++it)
|
||||
if( (*it).lobby_id == id)
|
||||
{
|
||||
ui.lobbyname_lineEdit->setText( RsHtml::plainText(it->lobby_name) );
|
||||
ui.lobbyid_lineEdit->setText( QString::number((*it).lobby_id,16) );
|
||||
ui.lobbytopic_lineEdit->setText( RsHtml::plainText(it->lobby_topic) );
|
||||
ui.lobbytype_lineEdit->setText( (( (*it).lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC)?tr("Public"):tr("Private")) );
|
||||
ui.lobbytype_lineEdit->setText( (( (*it).lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC)?tr("Public"):tr("Private")) );
|
||||
ui.lobbysec_lineEdit->setText( (( (*it).lobby_flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED)?tr("No anonymous IDs"):tr("Anonymous ids accepted")) );
|
||||
ui.lobbypeers_lineEdit->setText( QString::number((*it).total_number_of_peers) );
|
||||
|
||||
QString text = tr("You're not subscribed to this lobby; Double click-it to enter and chat.") ;
|
||||
|
||||
if(my_ids.empty())
|
||||
text += "\n\n"+tr("You will need to create an identity in order to join chat lobbies.") ;
|
||||
if( (*it).lobby_flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED)
|
||||
text += "\n\n"+tr("You will need to create a non anonymous identity in order to join this chat lobby.") ;
|
||||
else
|
||||
text += "\n\n"+tr("You will need to create an identity in order to join chat lobbies.") ;
|
||||
|
||||
ui.lobbyInfoLabel->setText(text);
|
||||
return ;
|
||||
|
@ -785,6 +859,7 @@ void ChatLobbyWidget::showBlankPage(ChatLobbyId id)
|
|||
ui.lobbytopic_lineEdit->clear();
|
||||
ui.lobbytype_lineEdit->clear();
|
||||
ui.lobbypeers_lineEdit->clear();
|
||||
ui.lobbysec_lineEdit->clear();
|
||||
|
||||
QString text = tr("No lobby selected. \nSelect lobbies at left to show details.\nDouble click lobbies to enter and chat.") ;
|
||||
ui.lobbyInfoLabel->setText(text) ;
|
||||
|
|
|
@ -6,21 +6,12 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>643</width>
|
||||
<height>426</height>
|
||||
<width>803</width>
|
||||
<height>517</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
|
@ -99,7 +90,7 @@
|
|||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="">
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QFrame" name="toolBarFrame">
|
||||
|
@ -201,9 +192,6 @@
|
|||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="lobbyinfo_groupBox">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Selected lobby info</string>
|
||||
</property>
|
||||
|
@ -264,6 +252,19 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Security:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="font">
|
||||
|
@ -336,6 +337,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lobbysec_lineEdit">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lobbypeers_lineEdit">
|
||||
<property name="sizePolicy">
|
||||
|
|
|
@ -142,9 +142,7 @@ QList<int> sizes;
|
|||
|
||||
// load settings
|
||||
RsAutoUpdatePage::lockAllEvents();
|
||||
ui.friendList->setColumnVisible(FriendList::COLUMN_STATE, false);
|
||||
ui.friendList->setColumnVisible(FriendList::COLUMN_LAST_CONTACT, false);
|
||||
ui.friendList->setColumnVisible(FriendList::COLUMN_AVATAR, true);
|
||||
ui.friendList->setColumnVisible(FriendList::COLUMN_IP, false);
|
||||
ui.friendList->setShowGroups(true);
|
||||
processSettings(true);
|
||||
|
|
|
@ -189,7 +189,7 @@ void GetStartedDialog::tickFirewallChanged()
|
|||
static void sendMail(const QString &address, const QString &subject, QString body)
|
||||
{
|
||||
/* Only under windows do we need to do this! */
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef Q_OS_WIN
|
||||
/* search and replace the end of lines with: "%0D%0A" */
|
||||
body.replace("\n", "%0D%0A");
|
||||
#endif
|
||||
|
@ -343,7 +343,7 @@ void GetStartedDialog::emailSupport()
|
|||
|
||||
#ifdef __APPLE__
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
switch(QSysInfo::MacintoshVersion)
|
||||
{
|
||||
case QSysInfo::MV_9:
|
||||
|
@ -383,7 +383,7 @@ void GetStartedDialog::emailSupport()
|
|||
#else
|
||||
#if defined(_WIN32) || defined(__MINGW32__)
|
||||
// Windows
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef Q_OS_WIN
|
||||
switch(QSysInfo::windowsVersion())
|
||||
{
|
||||
case QSysInfo::WV_32s:
|
||||
|
|
|
@ -81,9 +81,9 @@ IdDialog::IdDialog(QWidget *parent) :
|
|||
|
||||
/* Setup UI helper */
|
||||
mStateHelper = new UIStateHelper(this);
|
||||
// mStateHelper->addWidget(IDDIALOG_IDLIST, ui->treeWidget_IdList);
|
||||
mStateHelper->addLoadPlaceholder(IDDIALOG_IDLIST, ui->treeWidget_IdList, false);
|
||||
mStateHelper->addClear(IDDIALOG_IDLIST, ui->treeWidget_IdList);
|
||||
// mStateHelper->addWidget(IDDIALOG_IDLIST, ui->idTreeWidget);
|
||||
mStateHelper->addLoadPlaceholder(IDDIALOG_IDLIST, ui->idTreeWidget, false);
|
||||
mStateHelper->addClear(IDDIALOG_IDLIST, ui->idTreeWidget);
|
||||
|
||||
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname);
|
||||
mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_KeyId);
|
||||
|
@ -142,8 +142,8 @@ IdDialog::IdDialog(QWidget *parent) :
|
|||
connect(ui->editIdentity, SIGNAL(triggered()), this, SLOT(editIdentity()));
|
||||
connect(ui->chatIdentity, SIGNAL(triggered()), this, SLOT(chatIdentity()));
|
||||
|
||||
connect(ui->treeWidget_IdList, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelection()));
|
||||
connect(ui->treeWidget_IdList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(IdListCustomPopupMenu(QPoint)));
|
||||
connect(ui->idTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelection()));
|
||||
connect(ui->idTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(IdListCustomPopupMenu(QPoint)));
|
||||
|
||||
connect(ui->filterComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(filterComboBoxChanged()));
|
||||
connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
|
||||
|
@ -172,34 +172,29 @@ IdDialog::IdDialog(QWidget *parent) :
|
|||
ui->filterComboBox->setCurrentIndex(0);
|
||||
|
||||
/* Add filter actions */
|
||||
QTreeWidgetItem *headerItem = ui->treeWidget_IdList->headerItem();
|
||||
QTreeWidgetItem *headerItem = ui->idTreeWidget->headerItem();
|
||||
QString headerText = headerItem->text(RSID_COL_NICKNAME);
|
||||
ui->filterLineEdit->addFilter(QIcon(), headerText, RSID_COL_NICKNAME, QString("%1 %2").arg(tr("Search"), headerText));
|
||||
headerText = headerItem->text(RSID_COL_KEYID);
|
||||
ui->filterLineEdit->addFilter(QIcon(), headerItem->text(RSID_COL_KEYID), RSID_COL_KEYID, QString("%1 %2").arg(tr("Search"), headerText));
|
||||
|
||||
initializeHeader(true);
|
||||
|
||||
/* Setup tree */
|
||||
ui->treeWidget_IdList->sortByColumn(RSID_COL_NICKNAME, Qt::AscendingOrder);
|
||||
ui->treeWidget_IdList->setContextMenuPolicy(Qt::CustomContextMenu) ;
|
||||
|
||||
/** Setup the actions for the header context menu */
|
||||
hideIdAct= new QAction(headerItem->text(RSID_COL_KEYID),this);
|
||||
hideIdAct->setCheckable(true); hideIdAct->setToolTip(tr("Show")+" "+hideIdAct->text()+" "+tr("column"));
|
||||
connect(hideIdAct,SIGNAL(triggered(bool)),this,SLOT(setHideIdColumn(bool))) ;
|
||||
|
||||
hideTypeAct= new QAction(headerItem->text(RSID_COL_IDTYPE),this);
|
||||
hideTypeAct->setCheckable(true); hideTypeAct->setToolTip(tr("Show")+" "+hideTypeAct->text()+" "+tr("column"));
|
||||
connect(hideTypeAct,SIGNAL(triggered(bool)),this,SLOT(setHideIdTypeColumn(bool))) ;
|
||||
|
||||
ui->idTreeWidget->sortByColumn(RSID_COL_NICKNAME, Qt::AscendingOrder);
|
||||
|
||||
ui->idTreeWidget->enableColumnCustomize(true);
|
||||
ui->idTreeWidget->setColumnCustomizable(RSID_COL_NICKNAME, false);
|
||||
|
||||
/* Set initial column width */
|
||||
int fontWidth = QFontMetricsF(ui->idTreeWidget->font()).width("W");
|
||||
ui->idTreeWidget->setColumnWidth(RSID_COL_NICKNAME, 18 * fontWidth);
|
||||
ui->idTreeWidget->setColumnWidth(RSID_COL_KEYID, 25 * fontWidth);
|
||||
ui->idTreeWidget->setColumnWidth(RSID_COL_IDTYPE, 18 * fontWidth);
|
||||
|
||||
mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this);
|
||||
|
||||
mStateHelper->setActive(IDDIALOG_IDDETAILS, false);
|
||||
mStateHelper->setActive(IDDIALOG_REPLIST, false);
|
||||
|
||||
ui->treeWidget_IdList->setColumnHidden(RSID_COL_IDTYPE, true);
|
||||
|
||||
// Hiding RepList until that part is finished.
|
||||
//ui->treeWidget_RepList->setVisible(false);
|
||||
ui->toolButton_Reputation->setVisible(false);
|
||||
|
@ -243,18 +238,6 @@ IdDialog::~IdDialog()
|
|||
delete(mIdQueue);
|
||||
}
|
||||
|
||||
void IdDialog::initializeHeader(bool )
|
||||
{
|
||||
/* Set header resize modes and initial section sizes ID TreeView*/
|
||||
QHeaderView * _idheader = ui->treeWidget_IdList->header () ;
|
||||
_idheader->resizeSection ( RSID_COL_NICKNAME, 170 );
|
||||
_idheader->resizeSection ( RSID_COL_KEYID, 120 );
|
||||
_idheader->resizeSection ( RSID_COL_IDTYPE, 170 );
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void IdDialog::todo()
|
||||
{
|
||||
QMessageBox::information(this, "Todo",
|
||||
|
@ -265,19 +248,17 @@ void IdDialog::todo()
|
|||
|
||||
void IdDialog::processSettings(bool load)
|
||||
{
|
||||
QHeaderView *header = ui->treeWidget_IdList->header();
|
||||
|
||||
Settings->beginGroup("IdDialog");
|
||||
|
||||
// state of peer tree
|
||||
ui->idTreeWidget->processSettings(load);
|
||||
|
||||
if (load) {
|
||||
// load settings
|
||||
|
||||
// filterColumn
|
||||
ui->filterLineEdit->setCurrentFilter(Settings->value("filterColumn", RSID_COL_NICKNAME).toInt());
|
||||
|
||||
// state of thread tree
|
||||
header->restoreState(Settings->value("IdList").toByteArray());
|
||||
|
||||
// state of splitter
|
||||
ui->splitter->restoreState(Settings->value("splitter").toByteArray());
|
||||
} else {
|
||||
|
@ -286,9 +267,6 @@ void IdDialog::processSettings(bool load)
|
|||
// filterColumn
|
||||
Settings->setValue("filterColumn", ui->filterLineEdit->currentFilter());
|
||||
|
||||
// state of thread tree
|
||||
Settings->setValue("IdList", header->saveState());
|
||||
|
||||
// state of splitter
|
||||
Settings->setValue("splitter", ui->splitter->saveState());
|
||||
}
|
||||
|
@ -308,7 +286,7 @@ void IdDialog::filterChanged(const QString& /*text*/)
|
|||
|
||||
void IdDialog::updateSelection()
|
||||
{
|
||||
QTreeWidgetItem *item = ui->treeWidget_IdList->currentItem();
|
||||
QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
|
||||
RsGxsGroupId id;
|
||||
|
||||
if (item) {
|
||||
|
@ -478,7 +456,7 @@ void IdDialog::insertIdList(uint32_t token)
|
|||
RsPgpId ownPgpId = rsPeers->getGPGOwnId();
|
||||
|
||||
/* Update existing and remove not existing items */
|
||||
QTreeWidgetItemIterator itemIterator(ui->treeWidget_IdList);
|
||||
QTreeWidgetItemIterator itemIterator(ui->idTreeWidget);
|
||||
QTreeWidgetItem *item = NULL;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
++itemIterator;
|
||||
|
@ -510,7 +488,7 @@ void IdDialog::insertIdList(uint32_t token)
|
|||
item = NULL;
|
||||
if (fillIdListItem(*vit, item, ownPgpId, accept))
|
||||
{
|
||||
ui->treeWidget_IdList->addTopLevelItem(item);
|
||||
ui->idTreeWidget->addTopLevelItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -853,7 +831,7 @@ void IdDialog::addIdentity()
|
|||
|
||||
void IdDialog::removeIdentity()
|
||||
{
|
||||
QTreeWidgetItem *item = ui->treeWidget_IdList->currentItem();
|
||||
QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
|
||||
if (!item)
|
||||
{
|
||||
#ifdef ID_DEBUG
|
||||
|
@ -876,7 +854,7 @@ void IdDialog::removeIdentity()
|
|||
|
||||
void IdDialog::editIdentity()
|
||||
{
|
||||
QTreeWidgetItem *item = ui->treeWidget_IdList->currentItem();
|
||||
QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
|
||||
if (!item)
|
||||
{
|
||||
#ifdef ID_DEBUG
|
||||
|
@ -901,7 +879,7 @@ void IdDialog::filterIds()
|
|||
int filterColumn = ui->filterLineEdit->currentFilter();
|
||||
QString text = ui->filterLineEdit->text();
|
||||
|
||||
ui->treeWidget_IdList->filterItems(filterColumn, text);
|
||||
ui->idTreeWidget->filterItems(filterColumn, text);
|
||||
}
|
||||
|
||||
void IdDialog::requestRepList()
|
||||
|
@ -970,7 +948,7 @@ void IdDialog::IdListCustomPopupMenu( QPoint )
|
|||
std::list<RsGxsId> own_identities ;
|
||||
rsIdentity->getOwnIds(own_identities) ;
|
||||
|
||||
QTreeWidgetItem *item = ui->treeWidget_IdList->currentItem();
|
||||
QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
|
||||
if (item) {
|
||||
uint32_t item_flags = item->data(RSID_COL_KEYID,Qt::UserRole).toUInt() ;
|
||||
|
||||
|
@ -1015,19 +993,12 @@ void IdDialog::IdListCustomPopupMenu( QPoint )
|
|||
|
||||
contextMnu.addSeparator();
|
||||
|
||||
hideIdAct->setChecked(!ui->treeWidget_IdList->isColumnHidden(RSID_COL_KEYID));
|
||||
hideTypeAct->setChecked(!ui->treeWidget_IdList->isColumnHidden(RSID_COL_IDTYPE));
|
||||
|
||||
QMenu *menu = contextMnu.addMenu(tr("Columns"));
|
||||
menu->addAction(hideIdAct);
|
||||
menu->addAction(hideTypeAct);
|
||||
|
||||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void IdDialog::chatIdentity()
|
||||
{
|
||||
QTreeWidgetItem *item = ui->treeWidget_IdList->currentItem();
|
||||
QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
|
||||
if (!item)
|
||||
{
|
||||
std::cerr << "IdDialog::editIdentity() Invalid item";
|
||||
|
@ -1050,7 +1021,7 @@ void IdDialog::chatIdentity()
|
|||
|
||||
void IdDialog::sendMsg()
|
||||
{
|
||||
QTreeWidgetItem *item = ui->treeWidget_IdList->currentItem();
|
||||
QTreeWidgetItem *item = ui->idTreeWidget->currentItem();
|
||||
if (!item)
|
||||
{
|
||||
return;
|
||||
|
@ -1070,34 +1041,3 @@ void IdDialog::sendMsg()
|
|||
/* window will destroy itself! */
|
||||
|
||||
}
|
||||
|
||||
void IdDialog::setHideIdColumn(bool show)
|
||||
{
|
||||
if (ui->treeWidget_IdList->isColumnHidden(RSID_COL_KEYID) == show) {
|
||||
ui->treeWidget_IdList->setColumnHidden(RSID_COL_KEYID, !show);
|
||||
}
|
||||
ui->treeWidget_IdList->header()->setVisible(getNumColVisible()>1);
|
||||
|
||||
initializeHeader(true);
|
||||
}
|
||||
|
||||
void IdDialog::setHideIdTypeColumn(bool show)
|
||||
{
|
||||
if (ui->treeWidget_IdList->isColumnHidden(RSID_COL_IDTYPE) == show) {
|
||||
ui->treeWidget_IdList->setColumnHidden(RSID_COL_IDTYPE, !show);
|
||||
}
|
||||
ui->treeWidget_IdList->header()->setVisible(getNumColVisible()>1);
|
||||
|
||||
initializeHeader(true);
|
||||
}
|
||||
|
||||
int IdDialog::getNumColVisible()
|
||||
{
|
||||
int iNumColVis=0;
|
||||
for (int iColumn = 0; iColumn <RSID_COL_IDTYPE; ++iColumn) {
|
||||
if (!ui->treeWidget_IdList->isColumnHidden(iColumn)) {
|
||||
++iNumColVis;
|
||||
}
|
||||
}
|
||||
return iNumColVis;
|
||||
}
|
||||
|
|
|
@ -74,9 +74,6 @@ private slots:
|
|||
|
||||
/** Create the context popup menu and it's submenus */
|
||||
void IdListCustomPopupMenu( QPoint point );
|
||||
|
||||
void setHideIdColumn(bool hide);
|
||||
void setHideIdTypeColumn(bool hide);
|
||||
|
||||
private:
|
||||
void processSettings(bool load);
|
||||
|
@ -95,19 +92,12 @@ private:
|
|||
|
||||
void requestIdEdit(std::string &id);
|
||||
void showIdEdit(uint32_t token);
|
||||
|
||||
void initializeHeader(bool);
|
||||
|
||||
private:
|
||||
TokenQueue *mIdQueue;
|
||||
UIStateHelper *mStateHelper;
|
||||
|
||||
RsGxsGroupId mId;
|
||||
|
||||
/** Defines the actions for the header context menu */
|
||||
QAction* hideIdAct;
|
||||
QAction* hideTypeAct;
|
||||
int getNumColVisible();
|
||||
|
||||
/* UI - Designer */
|
||||
Ui::IdDialog *ui;
|
||||
|
|
|
@ -177,22 +177,22 @@
|
|||
<layout class="QHBoxLayout" name="filterLayout"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="RSTreeWidget" name="treeWidget_IdList">
|
||||
<widget class="RSTreeWidget" name="idTreeWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>22</width>
|
||||
<height>22</height>
|
||||
</size>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Identity name</string>
|
||||
|
@ -725,7 +725,7 @@
|
|||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>todoPushButton</tabstop>
|
||||
<tabstop>treeWidget_IdList</tabstop>
|
||||
<tabstop>idTreeWidget</tabstop>
|
||||
<tabstop>lineEdit_Nickname</tabstop>
|
||||
<tabstop>lineEdit_KeyId</tabstop>
|
||||
<tabstop>lineEdit_GpgId</tabstop>
|
||||
|
|
|
@ -207,7 +207,13 @@ void IdEditDialog::setupExistingId(const RsGxsGroupId &keyId)
|
|||
groupIds.push_back(keyId);
|
||||
|
||||
uint32_t token;
|
||||
mIdQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds, IDEDITDIALOG_LOADID);
|
||||
mIdQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds, IDEDITDIALOG_LOADID);
|
||||
}
|
||||
|
||||
void IdEditDialog::enforceNoAnonIds()
|
||||
{
|
||||
ui->radioButton_GpgId->setChecked(true);
|
||||
ui->radioButton_GpgId->setEnabled(false);
|
||||
}
|
||||
|
||||
void IdEditDialog::loadExistingId(uint32_t token)
|
||||
|
|
|
@ -47,6 +47,7 @@ public:
|
|||
|
||||
void setupNewId(bool pseudo);
|
||||
void setupExistingId(const RsGxsGroupId &keyId);
|
||||
void enforceNoAnonIds() ;
|
||||
|
||||
RsGxsGroupId groupId() { return mGroupId; }
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||
nameAndLocation = QString("%1 (%2)").arg(QString::fromUtf8(pd.name.c_str())).arg(QString::fromUtf8(pd.location.c_str()));
|
||||
}
|
||||
|
||||
setWindowTitle(tr("RetroShare %1 a secure decentralized communication platform").arg(Rshare::retroshareVersion(false)) + " - " + nameAndLocation);
|
||||
setWindowTitle(tr("RetroShare %1 a secure decentralized communication platform").arg(Rshare::retroshareVersion(true)) + " - " + nameAndLocation);
|
||||
|
||||
/* add url handler for RetroShare links */
|
||||
QDesktopServices::setUrlHandler(RSLINK_SCHEME, this, "retroshareLinkActivated");
|
||||
|
@ -391,17 +391,17 @@ void MainWindow::initStackedPage()
|
|||
std::cerr << "Looking for interfaces in existing plugins:" << std::endl;
|
||||
for(int i = 0;i<rsPlugins->nbPlugins();++i)
|
||||
{
|
||||
QIcon icon ;
|
||||
MainPage *pluginPage = NULL;
|
||||
QIcon icon, *pIcon = NULL;
|
||||
|
||||
if(rsPlugins->plugin(i) != NULL && rsPlugins->plugin(i)->qt_page() != NULL)
|
||||
if(rsPlugins->plugin(i) != NULL && (pluginPage = rsPlugins->plugin(i)->qt_page()) != NULL)
|
||||
{
|
||||
if(rsPlugins->plugin(i)->qt_icon() != NULL)
|
||||
icon = *rsPlugins->plugin(i)->qt_icon() ;
|
||||
if((pIcon = rsPlugins->plugin(i)->qt_icon()) != NULL)
|
||||
icon = *pIcon ;
|
||||
else
|
||||
icon = QIcon(":images/extension_48.png") ;
|
||||
|
||||
std::cerr << " Addign widget page for plugin " << rsPlugins->plugin(i)->getPluginName() << std::endl;
|
||||
MainPage *pluginPage = rsPlugins->plugin(i)->qt_page();
|
||||
pluginPage->setIconPixmap(icon);
|
||||
pluginPage->setPageName(QString::fromUtf8(rsPlugins->plugin(i)->getPluginName().c_str()));
|
||||
addPage(pluginPage, grp, ¬ify);
|
||||
|
|
|
@ -142,13 +142,10 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||
|
||||
// load settings
|
||||
RsAutoUpdatePage::lockAllEvents();
|
||||
ui.friendList->setColumnVisible(FriendList::COLUMN_STATE, false);
|
||||
ui.friendList->setColumnVisible(FriendList::COLUMN_LAST_CONTACT, false);
|
||||
ui.friendList->setColumnVisible(FriendList::COLUMN_AVATAR, true);
|
||||
ui.friendList->setColumnVisible(FriendList::COLUMN_IP, false);
|
||||
ui.friendList->setShowGroups(false);
|
||||
processSettings(true);
|
||||
ui.friendList->setBigName(true);
|
||||
RsAutoUpdatePage::unlockAllEvents();
|
||||
|
||||
// add self nick
|
||||
|
|
|
@ -169,10 +169,6 @@ NetworkDialog::NetworkDialog(QWidget *parent)
|
|||
//updateNetworkStatus();
|
||||
//loadtabsettings();
|
||||
|
||||
/* Hide platform specific features */
|
||||
#ifdef Q_WS_WIN
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void NetworkDialog::changeEvent(QEvent *e)
|
||||
|
|
|
@ -220,7 +220,7 @@ void PhotoDialog::setFullScreen()
|
|||
if (!isFullScreen()) {
|
||||
// hide menu & toolbars
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
#ifdef Q_OS_LINUX
|
||||
show();
|
||||
raise();
|
||||
setWindowState( windowState() | Qt::WindowFullScreen );
|
||||
|
|
|
@ -299,7 +299,7 @@ void PhotoSlideShow::setFullScreen()
|
|||
if (!isFullScreen()) {
|
||||
// hide menu & toolbars
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
#ifdef Q_OS_LINUX
|
||||
show();
|
||||
raise();
|
||||
setWindowState( windowState() | Qt::WindowFullScreen );
|
||||
|
|
|
@ -44,14 +44,14 @@ PostedListWidget::PostedListWidget(const RsGxsGroupId &postedId, QWidget *parent
|
|||
ui->setupUi(this);
|
||||
|
||||
/* Setup UI helper */
|
||||
mStateHelper->addWidget(mTokenTypeAllPosts, ui->hotSortButton);
|
||||
mStateHelper->addWidget(mTokenTypeAllPosts, ui->newSortButton);
|
||||
mStateHelper->addWidget(mTokenTypeAllPosts, ui->topSortButton);
|
||||
|
||||
mStateHelper->addWidget(mTokenTypePosts, ui->hotSortButton);
|
||||
mStateHelper->addWidget(mTokenTypePosts, ui->newSortButton);
|
||||
mStateHelper->addWidget(mTokenTypePosts, ui->topSortButton);
|
||||
|
||||
mStateHelper->addWidget(mTokenTypeRelatedPosts, ui->hotSortButton);
|
||||
mStateHelper->addWidget(mTokenTypeRelatedPosts, ui->newSortButton);
|
||||
mStateHelper->addWidget(mTokenTypeRelatedPosts, ui->topSortButton);
|
||||
|
||||
mStateHelper->addWidget(mTokenTypeGroupData, ui->submitPostButton);
|
||||
mStateHelper->addWidget(mTokenTypeGroupData, ui->subscribeToolButton);
|
||||
|
||||
|
@ -107,7 +107,7 @@ void PostedListWidget::processSettings(bool /*load*/)
|
|||
|
||||
QIcon PostedListWidget::groupIcon()
|
||||
{
|
||||
if (mStateHelper->isLoading(mTokenTypeGroupData) || mStateHelper->isLoading(mTokenTypePosts)) {
|
||||
if (mStateHelper->isLoading(mTokenTypeGroupData) || mStateHelper->isLoading(mTokenTypeAllPosts)) {
|
||||
// return QIcon(":/images/kalarm.png");
|
||||
}
|
||||
|
||||
|
@ -526,7 +526,7 @@ bool PostedListWidget::insertGroupData(const uint32_t &token, RsGroupMetaData &m
|
|||
return false;
|
||||
}
|
||||
|
||||
void PostedListWidget::insertPosts(const uint32_t &token, GxsMessageFramePostThread */*thread*/)
|
||||
void PostedListWidget::insertAllPosts(const uint32_t &token, GxsMessageFramePostThread */*thread*/)
|
||||
{
|
||||
std::vector<RsPostedPost> posts;
|
||||
rsPosted->getPostData(token, posts);
|
||||
|
@ -541,10 +541,10 @@ void PostedListWidget::insertPosts(const uint32_t &token, GxsMessageFramePostThr
|
|||
applyRanking();
|
||||
}
|
||||
|
||||
void PostedListWidget::insertRelatedPosts(const uint32_t &token)
|
||||
void PostedListWidget::insertPosts(const uint32_t &token)
|
||||
{
|
||||
std::vector<RsPostedPost> posts;
|
||||
rsPosted->getRelatedPosts(token, posts);
|
||||
rsPosted->getPostData(token, posts);
|
||||
|
||||
std::vector<RsPostedPost>::iterator vit;
|
||||
for(vit = posts.begin(); vit != posts.end(); ++vit)
|
||||
|
|
|
@ -60,8 +60,8 @@ public:
|
|||
protected:
|
||||
/* GxsMessageFramePostWidget */
|
||||
virtual bool insertGroupData(const uint32_t &token, RsGroupMetaData &metaData);
|
||||
virtual void insertPosts(const uint32_t &token, GxsMessageFramePostThread *thread);
|
||||
virtual void insertRelatedPosts(const uint32_t &token);
|
||||
virtual void insertAllPosts(const uint32_t &token, GxsMessageFramePostThread *thread);
|
||||
virtual void insertPosts(const uint32_t &token);
|
||||
virtual void clearPosts();
|
||||
virtual bool navigatePostItem(const RsGxsMessageId& msgId);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ QuickStartWizard::QuickStartWizard(QWidget *parent) :
|
|||
ui.shareddirList->horizontalHeader()->setStretchLastSection(false);
|
||||
|
||||
/* Hide platform specific features */
|
||||
#ifndef Q_WS_WIN
|
||||
#ifndef Q_OS_WIN
|
||||
ui.checkBoxRunRetroshareAtSystemStartup->setVisible(false);
|
||||
ui.chkRunRetroshareAtSystemStartupMinimized->setVisible(false);
|
||||
#endif
|
||||
|
@ -192,7 +192,7 @@ void QuickStartWizard::on_pushButtonSystemFinish_clicked()
|
|||
{
|
||||
Settings->setStartMinimized(ui.checkBoxStartMinimized->isChecked());
|
||||
Settings->setValue("doQuit", ui.checkBoxQuit->isChecked());
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef Q_OS_WIN
|
||||
Settings->setRunRetroshareOnBoot(ui.checkBoxRunRetroshareAtSystemStartup->isChecked(), ui.chkRunRetroshareAtSystemStartupMinimized->isChecked());
|
||||
#endif
|
||||
|
||||
|
@ -381,7 +381,7 @@ bool QuickStartWizard::messageBoxOk(QString msg)
|
|||
void
|
||||
QuickStartWizard::loadGeneral()
|
||||
{
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef Q_OS_WIN
|
||||
bool minimized;
|
||||
ui.checkBoxRunRetroshareAtSystemStartup->setChecked(Settings->runRetroshareOnBoot(minimized));
|
||||
ui.chkRunRetroshareAtSystemStartupMinimized->setChecked(minimized);
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "util/misc.h"
|
||||
#include "common/PeerDefs.h"
|
||||
#include "common/RsCollectionFile.h"
|
||||
#include <gui/common/RsUrlHandler.h>
|
||||
#include "gui/connect/ConnectFriendWizard.h"
|
||||
#include "gui/connect/ConfCertDialog.h"
|
||||
#include "gui/connect/PGPKeyDialog.h"
|
||||
|
@ -986,7 +987,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
}
|
||||
|
||||
QString content;
|
||||
if (fileAdd.size()) {
|
||||
if (!fileAdd.isEmpty()) {
|
||||
processList(fileAdd, QObject::tr("Add file"), QObject::tr("Add files"), content);
|
||||
}
|
||||
|
||||
|
@ -1012,6 +1013,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
|
||||
int countInvalid = 0;
|
||||
int countUnknown = 0;
|
||||
int countFileOpened = 0;
|
||||
bool needNotifySuccess = false;
|
||||
|
||||
// file
|
||||
|
@ -1045,8 +1047,8 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
QStringList messageReceipientUnknown;
|
||||
|
||||
// Certificate
|
||||
QStringList GPGBase64Strings ;
|
||||
QStringList SSLIds ;
|
||||
//QStringList GPGBase64Strings ;
|
||||
//QStringList SSLIds ;
|
||||
|
||||
// summary
|
||||
QList<QStringList*> processedList;
|
||||
|
@ -1069,7 +1071,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
{
|
||||
case TYPE_UNKNOWN:
|
||||
++countUnknown;
|
||||
break;
|
||||
break;
|
||||
|
||||
case TYPE_CERTIFICATE:
|
||||
{
|
||||
|
@ -1086,7 +1088,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
connectFriendWizard.exec();
|
||||
needNotifySuccess = false;
|
||||
}
|
||||
break ;
|
||||
break ;
|
||||
|
||||
case TYPE_PUBLIC_MSG:
|
||||
{
|
||||
|
@ -1104,7 +1106,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
//
|
||||
// MessageComposer::msgDistantPeer(link._hash.toStdString(),link._GPGid.toStdString()) ;
|
||||
}
|
||||
break ;
|
||||
break ;
|
||||
|
||||
case TYPE_FILE:
|
||||
case TYPE_EXTRAFILE:
|
||||
|
@ -1150,13 +1152,41 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
flag |= RSLINK_PROCESS_NOTIFY_BAD_CHARS ;
|
||||
}
|
||||
|
||||
bool bFileOpened = false;
|
||||
FileInfo fi;
|
||||
if (rsFiles->alreadyHaveFile(RsFileHash(link.hash().toStdString()), fi)) {
|
||||
/* make path for downloaded file */
|
||||
std::string path;
|
||||
path = fi.path;//Shared files has path with filename included
|
||||
if (fi.downloadStatus == FT_STATE_COMPLETE)
|
||||
path = fi.path + "/" + fi.fname;
|
||||
|
||||
QFileInfo qinfo;
|
||||
qinfo.setFile(QString::fromUtf8(path.c_str()));
|
||||
if (qinfo.exists() && qinfo.isFile()) {
|
||||
QString question = "<html><body>";
|
||||
question += QObject::tr("This file already exists. Do you want to open it ?");
|
||||
question += "<br><br>" + cleanname + "</body></html>";
|
||||
|
||||
QMessageBox mb(QObject::tr("Confirmation"), question, QMessageBox::Question, QMessageBox::Yes,QMessageBox::No, 0);
|
||||
if (mb.exec() == QMessageBox::Yes) {
|
||||
++countFileOpened;
|
||||
bFileOpened = true;
|
||||
/* open file with a suitable application */
|
||||
if (!RsUrlHandler::openUrl(QUrl::fromLocalFile(qinfo.absoluteFilePath()))) {
|
||||
std::cerr << "RetroShareLink::process(): can't open file " << path << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rsFiles->FileRequest(cleanname.toUtf8().constData(), RsFileHash(link.hash().toStdString()), link.size(), "", RS_FILE_REQ_ANONYMOUS_ROUTING, srcIds)) {
|
||||
fileAdded.append(link.name());
|
||||
} else {
|
||||
fileExist.append(link.name());
|
||||
if (!bFileOpened) fileExist.append(link.name());
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case TYPE_PERSON:
|
||||
{
|
||||
|
@ -1170,7 +1200,6 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
else
|
||||
personNotFound.append(PeerDefs::rsid(link.name().toUtf8().constData(), RsPgpId(link.hash().toStdString())));
|
||||
|
||||
break;
|
||||
// needNotifySuccess = true;
|
||||
|
||||
// RsPeerDetails detail;
|
||||
|
@ -1198,8 +1227,8 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
// }
|
||||
//
|
||||
// personNotFound.append(PeerDefs::rsid(link.name().toUtf8().constData(), RsPgpId(link.hash().toStdString())));
|
||||
// break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case TYPE_FORUM:
|
||||
|
@ -1227,8 +1256,9 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
forumMsgUnknown.append(link.name());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case TYPE_CHANNEL:
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
|
@ -1254,8 +1284,8 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
channelMsgUnknown.append(link.name());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case TYPE_SEARCH:
|
||||
{
|
||||
|
@ -1272,8 +1302,8 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
MainWindow::showWindow(MainWindow::Search);
|
||||
searchDialog->searchKeywords(link.name());
|
||||
searchStarted.append(link.name());
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case TYPE_MESSAGE:
|
||||
{
|
||||
|
@ -1322,7 +1352,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
}
|
||||
messageReceipientUnknown.append(PeerDefs::rsidFromId(RsPeerId(link.hash().toStdString())));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
std::cerr << " RetroShareLink::process unknown type: " << link.type() << std::endl;
|
||||
|
@ -1358,60 +1388,60 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
|
||||
// file
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_SUCCESS) {
|
||||
if (fileAdded.size()) {
|
||||
if (!fileAdded.isEmpty()) {
|
||||
processList(fileAdded, QObject::tr("File added"), QObject::tr("Files added"), result);
|
||||
}
|
||||
}
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
if (fileExist.size()) {
|
||||
if (!fileExist.isEmpty()) {
|
||||
processList(fileExist, QObject::tr("File exist"), QObject::tr("Files exist"), result);
|
||||
}
|
||||
}
|
||||
|
||||
// person
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_SUCCESS) {
|
||||
if (personAdded.size()) {
|
||||
if (!personAdded.isEmpty()) {
|
||||
processList(personAdded, QObject::tr("Friend added"), QObject::tr("Friends added"), result);
|
||||
}
|
||||
}
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
if (personExist.size()) {
|
||||
if (!personExist.isEmpty()) {
|
||||
processList(personExist, QObject::tr("Friend exist"), QObject::tr("Friends exist"), result);
|
||||
}
|
||||
if (personFailed.size()) {
|
||||
if (!personFailed.isEmpty()) {
|
||||
processList(personFailed, QObject::tr("Friend not added"), QObject::tr("Friends not added"), result);
|
||||
}
|
||||
if (personNotFound.size()) {
|
||||
if (!personNotFound.isEmpty()) {
|
||||
processList(personNotFound, QObject::tr("Friend not found"), QObject::tr("Friends not found"), result);
|
||||
}
|
||||
}
|
||||
|
||||
// forum
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
if (forumUnknown.size()) {
|
||||
if (!forumUnknown.isEmpty()) {
|
||||
processList(forumUnknown, QObject::tr("Forum not found"), QObject::tr("Forums not found"), result);
|
||||
}
|
||||
if (forumMsgUnknown.size()) {
|
||||
if (!forumMsgUnknown.isEmpty()) {
|
||||
processList(forumMsgUnknown, QObject::tr("Forum message not found"), QObject::tr("Forum messages not found"), result);
|
||||
}
|
||||
}
|
||||
|
||||
// channel
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
if (channelUnknown.size()) {
|
||||
if (!channelUnknown.isEmpty()) {
|
||||
processList(channelUnknown, QObject::tr("Channel not found"), QObject::tr("Channels not found"), result);
|
||||
}
|
||||
if (channelMsgUnknown.size()) {
|
||||
if (!channelMsgUnknown.isEmpty()) {
|
||||
processList(channelMsgUnknown, QObject::tr("Channel message not found"), QObject::tr("Channel messages not found"), result);
|
||||
}
|
||||
}
|
||||
|
||||
// message
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ERROR) {
|
||||
if (messageReceipientNotAccepted.size()) {
|
||||
if (!messageReceipientNotAccepted.isEmpty()) {
|
||||
processList(messageReceipientNotAccepted, QObject::tr("Recipient not accepted"), QObject::tr("Recipients not accepted"), result);
|
||||
}
|
||||
if (messageReceipientUnknown.size()) {
|
||||
if (!messageReceipientUnknown.isEmpty()) {
|
||||
processList(messageReceipientUnknown, QObject::tr("Unkown recipient"), QObject::tr("Unkown recipients"), result);
|
||||
}
|
||||
}
|
||||
|
@ -1427,7 +1457,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
|||
if(flag & RSLINK_PROCESS_NOTIFY_BAD_CHARS)
|
||||
result += QString("<br>%1").arg(QObject::tr("Warning: forbidden characters found in filenames. \nCharacters <b>\",|,/,\\,<,>,*,?</b> will be replaced by '_'.")) ;
|
||||
|
||||
if (result.isEmpty() == false) {
|
||||
if ((result.isEmpty() == false) && (links.count() > countFileOpened)) { //Don't count files opened
|
||||
QMessageBox mb(QObject::tr("Result"), "<html><body>" + result + "</body></html>", QMessageBox::Information, QMessageBox::Ok, 0, 0);
|
||||
mb.exec();
|
||||
}
|
||||
|
|
|
@ -213,10 +213,6 @@ SearchDialog::SearchDialog(QWidget *parent)
|
|||
|
||||
checkText(ui.lineEdit->text());
|
||||
|
||||
/* Hide platform specific features */
|
||||
#ifdef Q_WS_WIN
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
SearchDialog::~SearchDialog()
|
||||
|
|
|
@ -70,11 +70,7 @@ SoundManager::SoundManager() : QObject()
|
|||
|
||||
void SoundManager::soundEvents(SoundEvents &events)
|
||||
{
|
||||
#ifdef WINDOWS_SYS
|
||||
QDir baseDir = QDir(qApp->applicationDirPath() + "/sounds");
|
||||
#else
|
||||
QDir baseDir = QDir("/usr/share/RetroShare06/sounds");
|
||||
#endif
|
||||
QDir baseDir = QDir(QString::fromUtf8(RsAccounts::DataDirectory().c_str()) + "/sounds");
|
||||
|
||||
events.mDefaultPath = baseDir.absolutePath();
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <QMessageBox>
|
||||
#include <QInputDialog>
|
||||
#include <QMenu>
|
||||
#include <QWidgetAction>
|
||||
|
||||
#include "ChatLobbyDialog.h"
|
||||
#include "gui/ChatLobbyWidget.h"
|
||||
|
@ -81,8 +82,8 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi
|
|||
// Add a button to invite friends.
|
||||
//
|
||||
inviteFriendsButton = new QToolButton ;
|
||||
inviteFriendsButton->setMinimumSize(QSize(2*S,2*S)) ;
|
||||
inviteFriendsButton->setMaximumSize(QSize(2*S,2*S)) ;
|
||||
inviteFriendsButton->setMinimumSize(QSize(2*S,2*S)) ;
|
||||
inviteFriendsButton->setMaximumSize(QSize(2*S,2*S)) ;
|
||||
inviteFriendsButton->setText(QString()) ;
|
||||
inviteFriendsButton->setAutoRaise(true) ;
|
||||
inviteFriendsButton->setToolTip(tr("Invite friends to this lobby"));
|
||||
|
@ -106,8 +107,14 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi
|
|||
|
||||
ownIdChooser = new GxsIdChooser() ;
|
||||
ownIdChooser->loadIds(IDCHOOSER_ID_REQUIRED,current_id) ;
|
||||
|
||||
QWidgetAction *checkableAction = new QWidgetAction(this);
|
||||
checkableAction->setDefaultWidget(ownIdChooser);
|
||||
|
||||
ui.chatWidget->addToolsAction(checkableAction);
|
||||
//getChatWidget()->addChatBarWidget(ownIdChooser);
|
||||
|
||||
|
||||
getChatWidget()->addChatBarWidget(ownIdChooser) ;
|
||||
|
||||
connect(ownIdChooser,SIGNAL(currentIndexChanged(int)),this,SLOT(changeNickname())) ;
|
||||
|
||||
|
@ -664,7 +671,7 @@ void ChatLobbyDialog::displayLobbyEvent(int event_type, const RsGxsId& gxs_id, c
|
|||
|
||||
ui.chatWidget->addChatMsg(true, tr("Lobby management"), QDateTime::currentDateTime(),
|
||||
QDateTime::currentDateTime(),
|
||||
tr("%1 changed his name to: %2").arg(name).arg(newname),
|
||||
tr("%1 changed his name to: %2").arg(RsHtml::plainText(name)).arg(RsHtml::plainText(newname)),
|
||||
ChatWidget::MSGTYPE_SYSTEM);
|
||||
|
||||
// TODO if a user was muted and changed his name, update mute list, but only, when the muted peer, dont change his name to a other peer in your chat lobby
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
class GxsIdChooser ;
|
||||
class QToolButton;
|
||||
class QWidgetAction;
|
||||
|
||||
class ChatLobbyDialog: public ChatDialog
|
||||
{
|
||||
|
@ -55,7 +56,7 @@ private slots:
|
|||
signals:
|
||||
void lobbyLeave(ChatLobbyId) ;
|
||||
void typingEventReceived(ChatLobbyId) ;
|
||||
void messageReceived(bool incoming, ChatLobbyId lobby_id, QDateTime time, QString senderName, QString msg) ;
|
||||
void messageReceived(bool incoming, ChatLobbyId lobby_id, QDateTime time, QString senderName, QString msg) ;
|
||||
void peerJoined(ChatLobbyId) ;
|
||||
void peerLeft(ChatLobbyId) ;
|
||||
|
||||
|
@ -102,6 +103,7 @@ private:
|
|||
|
||||
QAction *muteAct;
|
||||
QAction *distantChatAct;
|
||||
QWidgetAction *checkableAction;
|
||||
|
||||
GxsIdChooser *ownIdChooser ;
|
||||
};
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "gui/settings/rsharesettings.h"
|
||||
#include "util/DateTime.h"
|
||||
#include <retroshare/rsidentity.h>
|
||||
#include <util/HandleRichText.h>
|
||||
|
||||
ChatLobbyUserNotify::ChatLobbyUserNotify(QObject *parent) :
|
||||
UserNotify(parent)
|
||||
|
@ -257,9 +258,8 @@ void ChatLobbyUserNotify::chatLobbyNewMessage(ChatLobbyId lobby_id, QDateTime ti
|
|||
|
||||
if ((bGetNickName || bFoundTextToNotify || _bCountUnRead)){
|
||||
QString strAnchor = time.toString(Qt::ISODate);
|
||||
strAnchor.append("_").append(senderName);
|
||||
MsgData msgData;
|
||||
msgData.text=msg;
|
||||
msgData.text=RsHtml::plainText(senderName) + ": " + msg;
|
||||
msgData.unread=!(bGetNickName || bFoundTextToNotify);
|
||||
|
||||
_listMsg[lobby_id][strAnchor]=msgData;
|
||||
|
|
|
@ -144,35 +144,30 @@ void ChatStyle::styleChanged(int styleType)
|
|||
}
|
||||
}
|
||||
|
||||
static QString getBaseDir()
|
||||
static QStringList getBaseDirList()
|
||||
{
|
||||
// application path
|
||||
QString baseDir = QString::fromUtf8(RsAccounts::ConfigDirectory().c_str());
|
||||
// Search chat styles in config dir and data dir (is application dir for portable)
|
||||
QStringList baseDirs;
|
||||
baseDirs.append(QString::fromUtf8(RsAccounts::ConfigDirectory().c_str()));
|
||||
baseDirs.append(QString::fromUtf8(RsAccounts::DataDirectory().c_str()));
|
||||
|
||||
#ifdef WIN32
|
||||
if (RsInit::isPortable ()) {
|
||||
// application dir for portable version
|
||||
baseDir = QApplication::applicationDirPath();
|
||||
}
|
||||
#endif
|
||||
|
||||
return baseDir;
|
||||
return baseDirs;
|
||||
}
|
||||
|
||||
bool ChatStyle::setStylePath(const QString &stylePath, const QString &styleVariant)
|
||||
{
|
||||
m_styleType = TYPE_UNKNOWN;
|
||||
|
||||
m_styleDir.setPath(getBaseDir());
|
||||
if (m_styleDir.cd(stylePath) == false) {
|
||||
m_styleDir = QDir("");
|
||||
m_styleVariant.clear();
|
||||
return false;
|
||||
foreach (QString dir, getBaseDirList()) {
|
||||
m_styleDir.setPath(dir);
|
||||
if (m_styleDir.cd(stylePath)) {
|
||||
m_styleVariant = styleVariant;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
m_styleVariant = styleVariant;
|
||||
|
||||
return true;
|
||||
m_styleDir.setPath("");
|
||||
m_styleVariant.clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ChatStyle::setStyleFromSettings(enumStyleType styleType)
|
||||
|
@ -471,9 +466,6 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
|
|||
{
|
||||
styles.clear();
|
||||
|
||||
// base dir
|
||||
QDir baseDir(getBaseDir());
|
||||
|
||||
ChatStyleInfo standardInfo;
|
||||
QString stylePath;
|
||||
|
||||
|
@ -516,25 +508,27 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
|
|||
return false;
|
||||
}
|
||||
|
||||
QDir dir(baseDir);
|
||||
if (dir.cd("stylesheets") == false) {
|
||||
// no user styles available
|
||||
return true;
|
||||
}
|
||||
|
||||
// get all style directories
|
||||
QFileInfoList dirList = dir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
|
||||
|
||||
// iterate style directories and get info
|
||||
for (QFileInfoList::iterator it = dirList.begin(); it != dirList.end(); ++it) {
|
||||
QDir styleDir = QDir(it->absoluteFilePath());
|
||||
if (styleDir.cd(stylePath) == false) {
|
||||
// no user styles available
|
||||
foreach (QDir baseDir, getBaseDirList()) {
|
||||
QDir dir(baseDir);
|
||||
if (dir.cd("stylesheets") == false) {
|
||||
// no user styles available here
|
||||
continue;
|
||||
}
|
||||
ChatStyleInfo info;
|
||||
if (getStyleInfo(styleDir.absolutePath(), baseDir.relativeFilePath(styleDir.absolutePath()), info)) {
|
||||
styles.append(info);
|
||||
|
||||
// get all style directories
|
||||
QFileInfoList dirList = dir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
|
||||
|
||||
// iterate style directories and get info
|
||||
for (QFileInfoList::iterator it = dirList.begin(); it != dirList.end(); ++it) {
|
||||
QDir styleDir = QDir(it->absoluteFilePath());
|
||||
if (styleDir.cd(stylePath) == false) {
|
||||
// no user styles available
|
||||
continue;
|
||||
}
|
||||
ChatStyleInfo info;
|
||||
if (getStyleInfo(styleDir.absolutePath(), baseDir.relativeFilePath(styleDir.absolutePath()), info)) {
|
||||
styles.append(info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -298,6 +298,9 @@ void ChatWidget::init(const ChatId &chat_id, const QString &title)
|
|||
// initialize first custom state string
|
||||
QString customStateString = QString::fromUtf8(rsMsgs->getCustomStateString(chatId.toPeerId()).c_str());
|
||||
updatePeersCustomStateString(QString::fromStdString(chatId.toPeerId().toStdString()), customStateString);
|
||||
} else if (chatType() == CHATTYPE_DISTANT){
|
||||
hist_chat_type = RS_HISTORY_TYPE_PRIVATE ;
|
||||
messageCount = Settings->getPrivateChatHistoryCount();
|
||||
} else if(chatId.isBroadcast()){
|
||||
hist_chat_type = RS_HISTORY_TYPE_PUBLIC;
|
||||
messageCount = Settings->getPublicChatHistoryCount();
|
||||
|
@ -321,8 +324,21 @@ void ChatWidget::init(const ChatId &chat_id, const QString &title)
|
|||
// it can happen that a message is first added to the message history
|
||||
// and later the gui receives the message through notify
|
||||
// avoid this by not adding history entries if their age is < 2secs
|
||||
if((time(NULL)-2) > historyIt->recvTime)
|
||||
addChatMsg(historyIt->incoming, QString::fromUtf8(historyIt->peerName.c_str()), QDateTime::fromTime_t(historyIt->sendTime), QDateTime::fromTime_t(historyIt->recvTime), QString::fromUtf8(historyIt->message.c_str()), MSGTYPE_HISTORY);
|
||||
if ((time(NULL)-2) <= historyIt->recvTime)
|
||||
continue;
|
||||
|
||||
QString name;
|
||||
if (chatId.isLobbyId() || chatId.isGxsId()) {
|
||||
RsIdentityDetails details;
|
||||
if (rsIdentity->getIdDetails(RsGxsId(historyIt->peerName), details))
|
||||
name = QString::fromUtf8(details.mNickname.c_str());
|
||||
else
|
||||
name = QString::fromUtf8(historyIt->peerName.c_str());
|
||||
} else {
|
||||
name = QString::fromUtf8(historyIt->peerName.c_str());
|
||||
}
|
||||
|
||||
addChatMsg(historyIt->incoming, name, QDateTime::fromTime_t(historyIt->sendTime), QDateTime::fromTime_t(historyIt->recvTime), QString::fromUtf8(historyIt->message.c_str()), MSGTYPE_HISTORY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -432,7 +448,7 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
if (chatType() == CHATTYPE_LOBBY) {
|
||||
if (notify && chatType() == CHATTYPE_LOBBY) {
|
||||
if ((event->type() == QEvent::KeyPress)
|
||||
|| (event->type() == QEvent::MouseMove)
|
||||
|| (event->type() == QEvent::Enter)
|
||||
|
@ -444,9 +460,11 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
|||
QPoint bottom_right(ui->textBrowser->viewport()->width() - 1, ui->textBrowser->viewport()->height() - 1);
|
||||
int end_pos = ui->textBrowser->cursorForPosition(bottom_right).position();
|
||||
cursor.setPosition(end_pos, QTextCursor::KeepAnchor);
|
||||
|
||||
if (!cursor.selectedText().isEmpty()){
|
||||
QRegExp rx("<a\\s+name\\s*=\\s*\"(.*)\"",Qt::CaseInsensitive, QRegExp::RegExp2);
|
||||
if ((cursor.position() != lastUpdateCursorPos || cursor.selectionEnd() != lastUpdateCursorEnd) &&
|
||||
!cursor.selectedText().isEmpty()) {
|
||||
lastUpdateCursorPos = cursor.position();
|
||||
lastUpdateCursorEnd = cursor.selectionEnd();
|
||||
QRegExp rx("<a name=\"(.*)\"",Qt::CaseSensitive, QRegExp::RegExp2);
|
||||
rx.setMinimal(true);
|
||||
QString sel=cursor.selection().toHtml();
|
||||
QStringList anchors;
|
||||
|
@ -457,13 +475,9 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
|||
}
|
||||
if (!anchors.isEmpty()){
|
||||
for (QStringList::iterator it=anchors.begin();it!=anchors.end();++it) {
|
||||
QByteArray bytArray=it->toUtf8();
|
||||
std::string stdString=std::string(bytArray.begin(),bytArray.end());
|
||||
if (notify) notify->chatLobbyCleared(chatId.toLobbyId()
|
||||
,QString::fromUtf8(stdString.c_str())
|
||||
,obj != ui->textBrowser && obj != ui->textBrowser->viewport());//, true);
|
||||
notify->chatLobbyCleared(chatId.toLobbyId(), *it);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -474,11 +488,11 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
|||
|
||||
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
|
||||
if (keyEvent) {
|
||||
if (keyEvent->key() == Qt::Key_Delete ) {
|
||||
if (notify && keyEvent->key() == Qt::Key_Delete) {
|
||||
// Delete key pressed
|
||||
if (ui->textBrowser->textCursor().selectedText().length() > 0) {
|
||||
if (chatType() == CHATTYPE_LOBBY) {
|
||||
QRegExp rx("<a\\s+name\\s*=\\s*\"(.*)\"",Qt::CaseInsensitive, QRegExp::RegExp2);
|
||||
QRegExp rx("<a name=\"(.*)\"",Qt::CaseSensitive, QRegExp::RegExp2);
|
||||
rx.setMinimal(true);
|
||||
QString sel=ui->textBrowser->textCursor().selection().toHtml();
|
||||
QStringList anchors;
|
||||
|
@ -489,9 +503,7 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
|||
}
|
||||
|
||||
for (QStringList::iterator it=anchors.begin();it!=anchors.end();++it) {
|
||||
QByteArray bytArray=it->toUtf8();
|
||||
std::string stdString=std::string(bytArray.begin(),bytArray.end());
|
||||
if (notify) notify->chatLobbyCleared(chatId.toLobbyId(), QString::fromUtf8(stdString.c_str()));
|
||||
notify->chatLobbyCleared(chatId.toLobbyId(), *it);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -513,7 +525,7 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
|||
cursor.select(QTextCursor::WordUnderCursor);
|
||||
QString toolTipText = "";
|
||||
if (!cursor.selectedText().isEmpty()){
|
||||
QRegExp rx("<a\\s+name\\s*=\\s*\"(.*)\"",Qt::CaseInsensitive, QRegExp::RegExp2);
|
||||
QRegExp rx("<a name=\"(.*)\"",Qt::CaseSensitive, QRegExp::RegExp2);
|
||||
rx.setMinimal(true);
|
||||
QString sel=cursor.selection().toHtml();
|
||||
QStringList anchors;
|
||||
|
@ -586,14 +598,14 @@ bool ChatWidget::eventFilter(QObject *obj, QEvent *event)
|
|||
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
|
||||
if (keyEvent) {
|
||||
QString qsTextToFind=ui->leSearch->text();
|
||||
if (((qsTextToFind.length()>iCharToStartSearch) || (keyEvent->key()==Qt::Key_Return)) && (keyEvent->text().length()>0))
|
||||
if (keyEvent->key()==Qt::Key_Backspace) {
|
||||
qsTextToFind=qsTextToFind.left(qsTextToFind.length()-1);// "\010"
|
||||
} else if (keyEvent->key()==Qt::Key_Tab) { // "\011"
|
||||
} else if (keyEvent->key()==Qt::Key_Return) { // "\015"
|
||||
} else if (keyEvent->text().length()==1)
|
||||
qsTextToFind+=keyEvent->text();
|
||||
if (((qsTextToFind.length()>=iCharToStartSearch) || (keyEvent->key()==Qt::Key_Return)) && (keyEvent->text().length()>0))
|
||||
{
|
||||
if (keyEvent->key()==Qt::Key_Backspace) {
|
||||
qsTextToFind=qsTextToFind.left(qsTextToFind.length()-1);// "\010"
|
||||
} else if (keyEvent->key()==Qt::Key_Tab) { // "\011"
|
||||
} else if (keyEvent->key()==Qt::Key_Return) { // "\015"
|
||||
} else if (keyEvent->text().length()==1)
|
||||
qsTextToFind+=keyEvent->text();
|
||||
|
||||
findText(qsTextToFind);
|
||||
} else {
|
||||
|
@ -886,9 +898,11 @@ void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime
|
|||
QString formatMsg = chatStyle.formatMessage(type, name, dtTimestamp, formattedMessage, formatFlag);
|
||||
QString timeStamp = dtTimestamp.toString(Qt::ISODate);
|
||||
|
||||
formatMsg.prepend(QString("<a name=\"%1_%2\"/>").arg(timeStamp).arg(name));
|
||||
formatMsg.prepend(QString("<a name=\"%1\"/>").arg(timeStamp));
|
||||
//To call this anchor do: ui->textBrowser->scrollToAnchor(QString("%1_%2").arg(timeStamp).arg(name));
|
||||
ui->textBrowser->textCursor().setBlockFormat(QTextBlockFormat ());
|
||||
QTextCursor textCursor = QTextCursor(ui->textBrowser->textCursor());
|
||||
textCursor.movePosition(QTextCursor::End);
|
||||
textCursor.setBlockFormat(QTextBlockFormat ());
|
||||
ui->textBrowser->append(formatMsg);
|
||||
|
||||
if (ui->leSearch->isVisible()) {
|
||||
|
|
|
@ -238,6 +238,9 @@ private:
|
|||
|
||||
QTextCursor qtcMark;
|
||||
|
||||
int lastUpdateCursorPos;
|
||||
int lastUpdateCursorEnd;
|
||||
|
||||
TransferRequestFlags mDefaultExtraFileFlags ; // flags for extra files shared in this chat. Will be 0 by default, but might be ANONYMOUS for chat lobbies.
|
||||
QDate lastMsgDate ;
|
||||
|
||||
|
|
|
@ -47,17 +47,17 @@ CreateLobbyDialog::CreateLobbyDialog(const std::set<RsPeerId>& peer_list, int pr
|
|||
|
||||
ui->idChooser_CB->loadIds(IDCHOOSER_ID_REQUIRED, default_identity);
|
||||
|
||||
//#if QT_VERSION >= 0x040700
|
||||
// ui->lobbyName_LE->setPlaceholderText(tr("Put a sensible lobby name here")) ;
|
||||
// ui->nickName_LE->setPlaceholderText(tr("Your nickname for this lobby (Change default name in options->chat)")) ;
|
||||
//#endif
|
||||
// ui->nickName_LE->setText(QString::fromUtf8(default_nick.c_str())) ;
|
||||
#if QT_VERSION >= 0x040700
|
||||
ui->lobbyName_LE->setPlaceholderText(tr("Put a sensible lobby name here"));
|
||||
ui->lobbyTopic_LE->setPlaceholderText(tr("Set a descriptive topic here"));
|
||||
#endif
|
||||
|
||||
connect( ui->buttonBox, SIGNAL(accepted()), this, SLOT(createLobby()));
|
||||
connect( ui->buttonBox, SIGNAL(rejected()), this, SLOT(close()));
|
||||
connect( ui->lobbyName_LE, SIGNAL( textChanged ( QString ) ), this, SLOT( checkTextFields( ) ) );
|
||||
connect( ui->lobbyTopic_LE, SIGNAL( textChanged ( QString ) ), this, SLOT( checkTextFields( ) ) );
|
||||
connect( ui->idChooser_CB, SIGNAL( currentChanged ( int ) ), this, SLOT( checkTextFields( ) ) );
|
||||
connect( ui->idChooser_CB, SIGNAL( currentIndexChanged ( int ) ), this, SLOT( checkTextFields( ) ) );
|
||||
connect( ui->pgp_signed_CB, SIGNAL( toggled ( bool ) ), this, SLOT( checkTextFields( ) ) );
|
||||
|
||||
/* initialize key share list */
|
||||
ui->keyShareList->setHeaderText(tr("Contacts:"));
|
||||
|
@ -105,6 +105,13 @@ void CreateLobbyDialog::checkTextFields()
|
|||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true) ;
|
||||
break ;
|
||||
}
|
||||
|
||||
RsIdentityDetails(idd) ;
|
||||
|
||||
rsIdentity->getIdDetails(id,idd) ;
|
||||
|
||||
if( (!idd.mPgpKnown) && ui->pgp_signed_CB->isChecked())
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false) ;
|
||||
}
|
||||
|
||||
void CreateLobbyDialog::createLobby()
|
||||
|
@ -128,6 +135,7 @@ void CreateLobbyDialog::createLobby()
|
|||
case GxsIdChooser::NoId:
|
||||
case GxsIdChooser::None:
|
||||
return ;
|
||||
default: break ;
|
||||
}
|
||||
// add to group
|
||||
|
||||
|
@ -136,6 +144,9 @@ void CreateLobbyDialog::createLobby()
|
|||
if(ui->security_CB->currentIndex() == 0)
|
||||
lobby_flags |= RS_CHAT_LOBBY_FLAGS_PUBLIC ;
|
||||
|
||||
if(ui->pgp_signed_CB->isChecked())
|
||||
lobby_flags |= RS_CHAT_LOBBY_FLAGS_PGP_SIGNED ;
|
||||
|
||||
ChatLobbyId id = rsMsgs->createChatLobby(lobby_name,gxs_id, lobby_topic, shareList, lobby_flags);
|
||||
|
||||
std::cerr << "gui: Created chat lobby " << std::hex << id << std::dec << std::endl ;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>787</width>
|
||||
<width>800</width>
|
||||
<height>486</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -86,7 +86,7 @@
|
|||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Security policy:</string>
|
||||
<string>Visibility:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
|
@ -110,6 +110,29 @@
|
|||
<item row="2" column="2">
|
||||
<widget class="GxsIdChooser" name="idChooser_CB"/>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QCheckBox" name="pgp_signed_CB">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>If you check this, only PGP-signed ids can be used to join and talk in this lobby. This limitation prevents anonymous spamming as it becomes possible for at least some people in the lobby to locate the spammer's node.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>require PGP-signed identities</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Security:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
|
|
@ -40,23 +40,30 @@
|
|||
|
||||
#include "ElidedLabel.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QTextLayout>
|
||||
#include <QDebug>
|
||||
#include <QPainter>
|
||||
#include <QStyleOption>
|
||||
#include <QTextDocument>
|
||||
#include <QTextLayout>
|
||||
#include <QToolTip>
|
||||
|
||||
ElidedLabel::ElidedLabel(const QString &text, QWidget *parent)
|
||||
: QLabel(parent)
|
||||
, mElided(false)
|
||||
, mOnlyPlainText(false)
|
||||
, mContent(text)
|
||||
{
|
||||
mRectElision = QRect();
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||
}
|
||||
|
||||
ElidedLabel::ElidedLabel(QWidget *parent)
|
||||
: QLabel(parent)
|
||||
, mElided(false)
|
||||
, mOnlyPlainText(false)
|
||||
, mContent("")
|
||||
{
|
||||
mRectElision = QRect();
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||
}
|
||||
|
||||
|
@ -66,6 +73,12 @@ void ElidedLabel::setText(const QString &newText)
|
|||
update();
|
||||
}
|
||||
|
||||
void ElidedLabel::setOnlyPlainText(const bool &value)
|
||||
{
|
||||
mOnlyPlainText = value;
|
||||
update();
|
||||
}
|
||||
|
||||
void ElidedLabel::clear()
|
||||
{
|
||||
mContent.clear();
|
||||
|
@ -75,43 +88,138 @@ void ElidedLabel::clear()
|
|||
void ElidedLabel::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QLabel::paintEvent(event);
|
||||
|
||||
QList<QPair<QTextLine,QPoint> > lLines;
|
||||
QString elidedLastLine = "";
|
||||
QPainter painter(this);
|
||||
QFontMetrics fontMetrics = painter.fontMetrics();
|
||||
QRect cr = contentsRect();
|
||||
cr.adjust(margin(), margin(), -margin(), -margin());
|
||||
|
||||
bool didElide = false;
|
||||
QChar ellipsisChar(0x2026);//= "…"
|
||||
int lineSpacing = fontMetrics.lineSpacing();
|
||||
int x, y = x =cr.top()+(cr.height()-lineSpacing)/2;
|
||||
|
||||
QTextLayout textLayout(mContent, painter.font());
|
||||
int y = 0;
|
||||
|
||||
QString plainText = "";
|
||||
if (mOnlyPlainText)
|
||||
{
|
||||
plainText = mContent;
|
||||
} else {
|
||||
QTextDocument td;
|
||||
td.setHtml(mContent);
|
||||
plainText = td.toPlainText();
|
||||
}
|
||||
plainText = plainText.replace("\n",QChar(QChar::LineSeparator));
|
||||
plainText = plainText.replace("\r",QChar(QChar::LineSeparator));
|
||||
|
||||
QTextLayout textLayout(plainText, painter.font());
|
||||
QTextOption to = textLayout.textOption();
|
||||
to.setAlignment(alignment());
|
||||
to.setWrapMode(wordWrap() ? QTextOption::WrapAtWordBoundaryOrAnywhere : QTextOption::NoWrap);
|
||||
textLayout.setTextOption(to);
|
||||
|
||||
textLayout.beginLayout();
|
||||
forever {
|
||||
//Get new line for text.
|
||||
QTextLine line = textLayout.createLine();
|
||||
|
||||
|
||||
if (!line.isValid())
|
||||
break;
|
||||
|
||||
line.setLineWidth(cr.width()+2*x);
|
||||
break;// No more line to write
|
||||
|
||||
line.setLineWidth(cr.width());
|
||||
int nextLineY = y + lineSpacing;
|
||||
|
||||
if (cr.height() >= nextLineY + lineSpacing) {
|
||||
line.draw(&painter, QPoint(x, y));
|
||||
|
||||
if ((cr.height() >= nextLineY + lineSpacing) && wordWrap()) {
|
||||
//Line written normaly, next line will too
|
||||
lLines.append(QPair<QTextLine, QPoint>(line, QPoint(0, y)));
|
||||
y = nextLineY;
|
||||
} else {
|
||||
QString lastLine = mContent.mid(line.textStart());
|
||||
QString elidedLastLine = fontMetrics.elidedText(lastLine, Qt::ElideRight, cr.width());
|
||||
painter.drawText(QPoint(x, y + fontMetrics.ascent()), elidedLastLine);
|
||||
line = textLayout.createLine();
|
||||
didElide = line.isValid();
|
||||
break;
|
||||
//The next line can't be written.
|
||||
QString lastLine = plainText.mid(line.textStart()).split(QChar(QChar::LineSeparator)).at(0);
|
||||
QTextLine lineEnd = textLayout.createLine();
|
||||
if (!lineEnd.isValid() && (wordWrap()
|
||||
|| (fontMetrics.width(lastLine) < cr.width()))) {
|
||||
//No more text for next line so this one is OK
|
||||
lLines.append(QPair<QTextLine, QPoint>(line, QPoint(0, y)));
|
||||
elidedLastLine="";
|
||||
didElide = false;
|
||||
} else {
|
||||
//Text is left, so get elided text
|
||||
if (lastLine == "") {
|
||||
elidedLastLine = ellipsisChar;
|
||||
} else {
|
||||
elidedLastLine = fontMetrics.elidedText(lastLine, Qt::ElideRight, cr.width()-1);
|
||||
if (elidedLastLine.right(1) != ellipsisChar)
|
||||
elidedLastLine.append(ellipsisChar);//New line at end
|
||||
}
|
||||
didElide = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
textLayout.endLayout();
|
||||
|
||||
|
||||
int iTransX, iTransY = iTransX = 0;
|
||||
int iHeight = lLines.count() * lineSpacing;
|
||||
if (didElide) iHeight += lineSpacing;
|
||||
|
||||
//Compute lines translation with alignment
|
||||
if (alignment() & Qt::AlignTop)
|
||||
iTransY = 0;
|
||||
if (alignment() & Qt::AlignBottom)
|
||||
iTransY = cr.height() - iHeight;
|
||||
if (alignment() & Qt::AlignVCenter)
|
||||
iTransY = (cr.height() - iHeight) / 2;
|
||||
|
||||
QPair<QTextLine,QPoint> pair;
|
||||
QPoint lastPos(-1,-1);
|
||||
//Now we know how many lines to redraw at good position
|
||||
foreach (pair, lLines){
|
||||
lastPos = pair.second + QPoint(0, iTransY);
|
||||
pair.first.draw(&painter, lastPos);
|
||||
}
|
||||
|
||||
//Print last elided line
|
||||
if (didElide) {
|
||||
int width = fontMetrics.width(elidedLastLine);
|
||||
if (lastPos.y() == -1){
|
||||
y = iTransY;// Only one line
|
||||
} else {
|
||||
y = lastPos.y() + lineSpacing;
|
||||
}
|
||||
if (width < cr.width()){
|
||||
//Text don't taking all line (with line break), so align it
|
||||
if (alignment() & Qt::AlignLeft)
|
||||
iTransX = 0;
|
||||
if (alignment() & Qt::AlignRight)
|
||||
iTransX = cr.width() - width;
|
||||
if (alignment() & Qt::AlignHCenter)
|
||||
iTransX = (cr.width() - width) / 2;
|
||||
if (alignment() & Qt::AlignJustify)
|
||||
iTransX = 0;
|
||||
}
|
||||
|
||||
painter.drawText(QPoint(iTransX, y + fontMetrics.ascent()), elidedLastLine);
|
||||
//Draw button to get ToolTip
|
||||
mRectElision = QRect(iTransX + width - fontMetrics.width(ellipsisChar)
|
||||
, y
|
||||
, fontMetrics.width(ellipsisChar)
|
||||
, fontMetrics.height() - 1);
|
||||
painter.drawRoundRect(mRectElision);
|
||||
} else {
|
||||
mRectElision = QRect();
|
||||
}
|
||||
|
||||
//Send signal if changed
|
||||
if (didElide != mElided) {
|
||||
mElided = didElide;
|
||||
emit elisionChanged(didElide);
|
||||
}
|
||||
}
|
||||
|
||||
void ElidedLabel::mousePressEvent(QMouseEvent *ev)
|
||||
{
|
||||
if (mElided && (ev->buttons()==Qt::LeftButton) && (mRectElision.contains(ev->pos()))){
|
||||
QToolTip::showText(mapToGlobal(QPoint(0, 0)),QString("<FONT>") + mContent + QString("</FONT>"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ class ElidedLabel : public QLabel
|
|||
Q_OBJECT
|
||||
Q_PROPERTY(QString text READ text WRITE setText)
|
||||
Q_PROPERTY(bool isElided READ isElided)
|
||||
Q_PROPERTY(bool isOnlyPlainText READ isOnlyPlainText WRITE setOnlyPlainText)
|
||||
|
||||
public:
|
||||
ElidedLabel(const QString &text, QWidget *parent = 0);
|
||||
|
@ -59,20 +60,25 @@ public:
|
|||
|
||||
const QString & text() const { return mContent; }
|
||||
bool isElided() const { return mElided; }
|
||||
bool isOnlyPlainText() const { return mOnlyPlainText; }
|
||||
|
||||
public slots:
|
||||
void setText(const QString &text);
|
||||
void setOnlyPlainText(const bool &value);
|
||||
void clear();
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void mousePressEvent(QMouseEvent *ev);
|
||||
|
||||
signals:
|
||||
void elisionChanged(bool elided);
|
||||
|
||||
private:
|
||||
bool mElided;
|
||||
bool mOnlyPlainText;
|
||||
QString mContent;
|
||||
QRect mRectElision;
|
||||
};
|
||||
|
||||
#endif // ELIDEDLABEL_H
|
||||
|
|
|
@ -40,7 +40,7 @@ void Emoticons::load()
|
|||
QString sm_codes;
|
||||
bool internalEmoticons = true;
|
||||
|
||||
#if defined(Q_OS_WIN32)
|
||||
#if defined(Q_OS_WIN)
|
||||
// first try external emoticons
|
||||
QFile sm_file(QApplication::applicationDirPath() + "/emoticons/emotes.acs");
|
||||
if(sm_file.open(QIODevice::ReadOnly))
|
||||
|
|
|
@ -52,10 +52,8 @@ public:
|
|||
enum Column
|
||||
{
|
||||
COLUMN_NAME = 0,
|
||||
COLUMN_AVATAR = 1,
|
||||
COLUMN_STATE = 2,
|
||||
COLUMN_LAST_CONTACT = 3,
|
||||
COLUMN_IP = 4
|
||||
COLUMN_LAST_CONTACT = 1,
|
||||
COLUMN_IP = 2
|
||||
};
|
||||
|
||||
public:
|
||||
|
@ -74,7 +72,9 @@ public:
|
|||
|
||||
virtual void updateDisplay();
|
||||
void setColumnVisible(Column column, bool visible);
|
||||
|
||||
void sortByColumn(Column column, Qt::SortOrder sortOrder);
|
||||
bool isSortByState();
|
||||
|
||||
QColor textColorGroup() const { return mTextColorGroup; }
|
||||
QColor textColorStatusOffline() const { return mTextColorStatus[RS_STATUS_OFFLINE]; }
|
||||
|
@ -92,14 +92,15 @@ public:
|
|||
|
||||
public slots:
|
||||
void filterItems(const QString &text);
|
||||
void sortByState(bool sort);
|
||||
|
||||
void setBigName(bool bigName); // show customStateString in second line of the name cell
|
||||
void setShowGroups(bool show);
|
||||
void setHideUnconnected(bool hidden);
|
||||
void setHideState(bool hidden);
|
||||
void setShowState(bool show);
|
||||
|
||||
private slots:
|
||||
void peerTreeColumnVisibleChanged(int column, bool visible);
|
||||
void peerTreeItemCollapsedExpanded(QTreeWidgetItem *item);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
@ -107,12 +108,12 @@ protected:
|
|||
|
||||
private:
|
||||
Ui::FriendList *ui;
|
||||
RSTreeWidgetItemCompareRole *m_compareRole;
|
||||
RSTreeWidgetItemCompareRole *mCompareRole;
|
||||
QAction *mActionSortByState;
|
||||
|
||||
// Settings for peer list display
|
||||
bool mBigName;
|
||||
bool mShowGroups;
|
||||
bool mHideState;
|
||||
bool mShowState;
|
||||
bool mHideUnconnected;
|
||||
|
||||
QString mFilterText;
|
||||
|
@ -126,14 +127,19 @@ private:
|
|||
QColor mTextColorStatus[RS_STATUS_COUNT];
|
||||
|
||||
QTreeWidgetItem *getCurrentPeer() const;
|
||||
void initializeHeader(bool afterLoadSettings);
|
||||
void getSslIdsFromItem(QTreeWidgetItem *item, std::list<RsPeerId> &sslIds);
|
||||
|
||||
bool getOrCreateGroup(const std::string &name, const uint &flag, std::string &id);
|
||||
bool getGroupIdByName(const std::string &name, std::string &id);
|
||||
|
||||
bool importExportFriendlistFileDialog(QString &fileName, bool import);
|
||||
bool exportFriendlist(QString &fileName);
|
||||
bool importFriendlist(QString &fileName, bool &errorPeers, bool &errorGroups);
|
||||
|
||||
private slots:
|
||||
void groupsChanged();
|
||||
void insertPeers();
|
||||
void peerTreeWidgetCustomPopupMenu();
|
||||
void updateAvatar(const QString &);
|
||||
void updateMenu();
|
||||
|
||||
void pastePerson();
|
||||
|
@ -161,6 +167,9 @@ private slots:
|
|||
void editGroup();
|
||||
void removeGroup();
|
||||
|
||||
void exportFriendlistClicked();
|
||||
void importFriendlistClicked();
|
||||
|
||||
// void inviteToLobby();
|
||||
// void createchatlobby();
|
||||
// void unsubscribeToLobby();
|
||||
|
|
|
@ -14,7 +14,16 @@
|
|||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
|
@ -29,7 +38,16 @@
|
|||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
|
@ -75,18 +93,6 @@
|
|||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>38</width>
|
||||
<height>38</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoExpandDelay">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="indentation">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
@ -97,7 +103,7 @@
|
|||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>5</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>false</bool>
|
||||
|
@ -106,15 +112,8 @@
|
|||
<property name="text">
|
||||
<string>Friend nodes</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Avatar</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Status</string>
|
||||
<property name="textAlignment">
|
||||
<set>AlignCenter</set>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
|
@ -138,15 +137,15 @@
|
|||
<string>Hide Offline Friends</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionHideState">
|
||||
<action name="actionShowState">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hide State</string>
|
||||
<string>Show State</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show State</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionShowGroups">
|
||||
|
@ -160,6 +159,22 @@
|
|||
<string>Show Groups</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExportFriendlist">
|
||||
<property name="text">
|
||||
<string>export friendlist</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>export your friendlist including groups</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionImportFriendlist">
|
||||
<property name="text">
|
||||
<string>import friendlist</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>import your friendlist including groups</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
****************************************************************/
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QMenu>
|
||||
#include "FriendSelectionWidget.h"
|
||||
#include "ui_FriendSelectionWidget.h"
|
||||
#include "gui/gxs/GxsIdDetails.h"
|
||||
|
@ -44,8 +45,11 @@
|
|||
|
||||
#define IDDIALOG_IDLIST 1
|
||||
|
||||
#define ROLE_ID Qt::UserRole
|
||||
#define ROLE_SORT Qt::UserRole + 1
|
||||
#define ROLE_ID Qt::UserRole
|
||||
#define ROLE_SORT_GROUP Qt::UserRole + 1
|
||||
#define ROLE_SORT_STANDARD_GROUP Qt::UserRole + 2
|
||||
#define ROLE_SORT_NAME Qt::UserRole + 3
|
||||
#define ROLE_SORT_STATE Qt::UserRole + 4
|
||||
|
||||
#define IMAGE_GROUP16 ":/images/user/group16.png"
|
||||
#define IMAGE_FRIENDINFO ":/images/peerdetails_16x16.png"
|
||||
|
@ -94,15 +98,17 @@ FriendSelectionWidget::FriendSelectionWidget(QWidget *parent)
|
|||
connect(ui->friendList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequested(QPoint)));
|
||||
connect(ui->friendList, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*,int)));
|
||||
connect(ui->friendList, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(itemChanged(QTreeWidgetItem*,int)));
|
||||
connect(ui->selectAll_PB, SIGNAL(clicked()), this, SLOT(selectAll()));
|
||||
connect(ui->deselectAll_PB, SIGNAL(clicked()), this, SLOT(deselectAll()));
|
||||
connect(ui->friendList, SIGNAL(itemSelectionChanged()), this, SIGNAL(itemSelectionChanged()));
|
||||
connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterItems(QString)));
|
||||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(groupsChanged(int)), this, SLOT(groupsChanged(int)));
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&,int)), this, SLOT(peerStatusChanged(const QString&,int)));
|
||||
|
||||
mCompareRole = new RSTreeWidgetItemCompareRole;
|
||||
mCompareRole->setRole(COLUMN_NAME, ROLE_SORT);
|
||||
mActionSortByState = new QAction(tr("Sort by state"), this);
|
||||
mActionSortByState->setCheckable(true);
|
||||
connect(mActionSortByState, SIGNAL(toggled(bool)), this, SLOT(sortByState(bool)));
|
||||
ui->friendList->addHeaderContextMenuAction(mActionSortByState);
|
||||
|
||||
/* initialize list */
|
||||
ui->friendList->setColumnCount(COLUMN_COUNT);
|
||||
|
@ -110,6 +116,7 @@ FriendSelectionWidget::FriendSelectionWidget(QWidget *parent)
|
|||
|
||||
/* sort list by name ascending */
|
||||
ui->friendList->sortItems(COLUMN_NAME, Qt::AscendingOrder);
|
||||
sortByState(false);
|
||||
|
||||
ui->filterLineEdit->setPlaceholderText(tr("Search Friends"));
|
||||
ui->filterLineEdit->showFilterIcon();
|
||||
|
@ -156,17 +163,6 @@ void FriendSelectionWidget::setModus(Modus modus)
|
|||
break;
|
||||
}
|
||||
|
||||
if(modus == MODUS_CHECK)
|
||||
{
|
||||
ui->selectAll_PB->setHidden(false) ;
|
||||
ui->deselectAll_PB->setHidden(false) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->selectAll_PB->setHidden(true) ;
|
||||
ui->deselectAll_PB->setHidden(true) ;
|
||||
}
|
||||
|
||||
fillList();
|
||||
}
|
||||
|
||||
|
@ -216,8 +212,12 @@ static void initSslItem(QTreeWidgetItem *item, const RsPeerDetails &detail, cons
|
|||
}
|
||||
|
||||
item->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(state)));
|
||||
item->setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(detail.id.toStdString()));
|
||||
item->setData(COLUMN_DATA, ROLE_SORT, "2 " + name);
|
||||
item->setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(detail.id.toStdString()));
|
||||
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_GROUP, 1);
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_STANDARD_GROUP, 0);
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_STATE, (state != (int) RS_STATUS_OFFLINE) ? 0 : 1);
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_NAME, name);
|
||||
}
|
||||
|
||||
void FriendSelectionWidget::fillList()
|
||||
|
@ -349,7 +349,11 @@ void FriendSelectionWidget::secured_fillList()
|
|||
|
||||
QString groupName = GroupDefs::name(*groupInfo);
|
||||
groupItem->setText(COLUMN_NAME, groupName);
|
||||
groupItem->setData(COLUMN_DATA, ROLE_SORT, ((groupInfo->flag & RS_GROUP_FLAG_STANDARD) ? "0 " : "1 ") + groupName);
|
||||
|
||||
groupItem->setData(COLUMN_NAME, ROLE_SORT_GROUP, 0);
|
||||
groupItem->setData(COLUMN_NAME, ROLE_SORT_STANDARD_GROUP, (groupInfo->flag & RS_GROUP_FLAG_STANDARD) ? 0 : 1);
|
||||
groupItem->setData(COLUMN_NAME, ROLE_SORT_STATE, 0);
|
||||
groupItem->setData(COLUMN_NAME, ROLE_SORT_NAME, groupName);
|
||||
|
||||
if (mListModus == MODUS_CHECK) {
|
||||
groupItem->setCheckState(0, Qt::Unchecked);
|
||||
|
@ -411,8 +415,12 @@ void FriendSelectionWidget::secured_fillList()
|
|||
|
||||
gpgItem->setFlags(Qt::ItemIsUserCheckable | gpgItem->flags());
|
||||
gpgItem->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(state)));
|
||||
gpgItem->setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(detail.gpg_id.toStdString()));
|
||||
gpgItem->setData(COLUMN_DATA, ROLE_SORT, "2 " + name);
|
||||
gpgItem->setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(detail.gpg_id.toStdString()));
|
||||
|
||||
gpgItem->setData(COLUMN_NAME, ROLE_SORT_GROUP, 1);
|
||||
gpgItem->setData(COLUMN_NAME, ROLE_SORT_STANDARD_GROUP, 0);
|
||||
gpgItem->setData(COLUMN_NAME, ROLE_SORT_STATE, (state != (int) RS_STATUS_OFFLINE) ? 0 : 1);
|
||||
gpgItem->setData(COLUMN_NAME, ROLE_SORT_NAME, name);
|
||||
|
||||
if (mListModus == MODUS_CHECK) {
|
||||
gpgItem->setCheckState(0, Qt::Unchecked);
|
||||
|
@ -542,7 +550,12 @@ void FriendSelectionWidget::secured_fillList()
|
|||
gxsItem->setFlags(Qt::ItemIsUserCheckable | gxsItem->flags());
|
||||
gxsItem->setIcon(COLUMN_NAME, identicon);
|
||||
gxsItem->setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(detail.mId.toStdString()));
|
||||
gxsItem->setData(COLUMN_DATA, ROLE_SORT, "2 " + name);
|
||||
|
||||
gxsItem->setData(COLUMN_NAME, ROLE_SORT_GROUP, 1);
|
||||
gxsItem->setData(COLUMN_NAME, ROLE_SORT_STANDARD_GROUP, 0);
|
||||
//TODO: online state for gxs items
|
||||
gxsItem->setData(COLUMN_NAME, ROLE_SORT_STATE, 1);
|
||||
gxsItem->setData(COLUMN_NAME, ROLE_SORT_NAME, name);
|
||||
|
||||
if (mListModus == MODUS_CHECK)
|
||||
gxsItem->setCheckState(0, Qt::Unchecked);
|
||||
|
@ -573,6 +586,8 @@ void FriendSelectionWidget::secured_fillList()
|
|||
|
||||
mInFillList = false;
|
||||
|
||||
ui->friendList->resort();
|
||||
|
||||
emit contentChanged();
|
||||
}
|
||||
void FriendSelectionWidget::updateDisplay(bool)
|
||||
|
@ -658,6 +673,7 @@ void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status)
|
|||
switch (idTypeFromItem(item)) {
|
||||
case IDTYPE_NONE:
|
||||
case IDTYPE_GROUP:
|
||||
case IDTYPE_GXS:
|
||||
break;
|
||||
case IDTYPE_GPG:
|
||||
{
|
||||
|
@ -672,6 +688,8 @@ void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status)
|
|||
item->setTextColor(COLUMN_NAME, color);
|
||||
item->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(gpgStatus)));
|
||||
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_STATE, (gpgStatus != (int) RS_STATUS_OFFLINE) ? 0 : 1);
|
||||
|
||||
bFoundGPG = true;
|
||||
}
|
||||
}
|
||||
|
@ -689,6 +707,8 @@ void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status)
|
|||
item->setTextColor(COLUMN_NAME, color);
|
||||
item->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(status)));
|
||||
|
||||
item->setData(COLUMN_NAME, ROLE_SORT_STATE, (status != (int) RS_STATUS_OFFLINE) ? 0 : 1);
|
||||
|
||||
bFoundSSL = true;
|
||||
}
|
||||
}
|
||||
|
@ -714,11 +734,48 @@ void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
ui->friendList->resort();
|
||||
}
|
||||
|
||||
void FriendSelectionWidget::contextMenuRequested(const QPoint &pos)
|
||||
void FriendSelectionWidget::addContextMenuAction(QAction *action)
|
||||
{
|
||||
emit customContextMenuRequested(pos);
|
||||
mContextMenuActions.push_back(action);
|
||||
}
|
||||
|
||||
void FriendSelectionWidget::contextMenuRequested(const QPoint &/*pos*/)
|
||||
{
|
||||
QMenu contextMenu(this);
|
||||
|
||||
if (mListModus == MODUS_CHECK) {
|
||||
contextMenu.addAction(QIcon(), tr("Mark all"), this, SLOT(selectAll()));
|
||||
contextMenu.addAction(QIcon(), tr("Mark none"), this, SLOT(deselectAll()));
|
||||
}
|
||||
|
||||
if (!mContextMenuActions.isEmpty()) {
|
||||
bool addSeparator = false;
|
||||
if (!contextMenu.isEmpty()) {
|
||||
// Check for visible action
|
||||
foreach (QAction *action, mContextMenuActions) {
|
||||
if (action->isVisible()) {
|
||||
addSeparator = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (addSeparator) {
|
||||
contextMenu.addSeparator();
|
||||
}
|
||||
|
||||
contextMenu.addActions(mContextMenuActions);
|
||||
}
|
||||
|
||||
if (contextMenu.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
contextMenu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void FriendSelectionWidget::itemDoubleClicked(QTreeWidgetItem *item, int /*column*/)
|
||||
|
@ -1030,3 +1087,25 @@ std::string FriendSelectionWidget::idFromItem(QTreeWidgetItem *item)
|
|||
return item->data(COLUMN_DATA, ROLE_ID).toString().toStdString();
|
||||
}
|
||||
|
||||
void FriendSelectionWidget::sortByState(bool sort)
|
||||
{
|
||||
mCompareRole->setRole(COLUMN_NAME, ROLE_SORT_GROUP);
|
||||
mCompareRole->addRole(COLUMN_NAME, ROLE_SORT_STANDARD_GROUP);
|
||||
|
||||
if (sort) {
|
||||
mCompareRole->addRole(COLUMN_NAME, ROLE_SORT_STATE);
|
||||
mCompareRole->addRole(COLUMN_NAME, ROLE_SORT_NAME);
|
||||
} else {
|
||||
mCompareRole->addRole(COLUMN_NAME, ROLE_SORT_NAME);
|
||||
mCompareRole->addRole(COLUMN_NAME, ROLE_SORT_STATE);
|
||||
}
|
||||
|
||||
mActionSortByState->setChecked(sort);
|
||||
|
||||
ui->friendList->resort();
|
||||
}
|
||||
|
||||
bool FriendSelectionWidget::isSortByState()
|
||||
{
|
||||
return mActionSortByState->isChecked();
|
||||
}
|
||||
|
|
|
@ -80,6 +80,8 @@ public:
|
|||
int addColumn(const QString &title);
|
||||
void start();
|
||||
|
||||
bool isSortByState();
|
||||
|
||||
int selectedItemCount();
|
||||
std::string selectedId(IdType &idType);
|
||||
|
||||
|
@ -109,6 +111,9 @@ public:
|
|||
|
||||
void setTextColorOnline(QColor color) { mTextColorOnline = color; }
|
||||
|
||||
// Add QAction to context menu (action won't be deleted)
|
||||
void addContextMenuAction(QAction *action);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
|
@ -118,9 +123,12 @@ protected:
|
|||
signals:
|
||||
void itemAdded(int idType, const QString &id, QTreeWidgetItem *item);
|
||||
void contentChanged();
|
||||
void customContextMenuRequested(const QPoint &pos);
|
||||
void doubleClicked(int idType, const QString &id);
|
||||
void itemChanged(int idType, const QString &id, QTreeWidgetItem *item, int column);
|
||||
void itemSelectionChanged();
|
||||
|
||||
public slots:
|
||||
void sortByState(bool sort);
|
||||
|
||||
private slots:
|
||||
void groupsChanged(int type);
|
||||
|
@ -142,6 +150,7 @@ private:
|
|||
|
||||
void requestGXSIdList() ;
|
||||
|
||||
private:
|
||||
bool mStarted;
|
||||
RSTreeWidgetItemCompareRole *mCompareRole;
|
||||
Modus mListModus;
|
||||
|
@ -150,6 +159,7 @@ private:
|
|||
bool mInGpgItemChanged;
|
||||
bool mInSslItemChanged;
|
||||
bool mInFillList;
|
||||
QAction *mActionSortByState;
|
||||
|
||||
/* Color definitions (for standard see qss.default) */
|
||||
QColor mTextColorOnline;
|
||||
|
@ -160,6 +170,7 @@ private:
|
|||
|
||||
std::vector<RsGxsGroupId> gxsIds ;
|
||||
TokenQueue *mIdQueue ;
|
||||
QList<QAction*> mContextMenuActions;
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(FriendSelectionWidget::ShowTypes)
|
||||
|
|
|
@ -26,24 +26,10 @@
|
|||
<item>
|
||||
<widget class="LineEditClear" name="filterLineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="selectAll_PB">
|
||||
<property name="text">
|
||||
<string>All</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="deselectAll_PB">
|
||||
<property name="text">
|
||||
<string>None</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="friendList">
|
||||
<widget class="RSTreeWidget" name="friendList">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
|
@ -80,6 +66,11 @@
|
|||
<extends>QLineEdit</extends>
|
||||
<header location="global">gui/common/LineEditClear.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>RSTreeWidget</class>
|
||||
<extends>QTreeWidget</extends>
|
||||
<header>gui/common/RSTreeWidget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QMimeData>
|
||||
#include <QTextDocumentFragment>
|
||||
#include <QCompleter>
|
||||
|
@ -228,6 +230,7 @@ void MimeTextEdit::contextMenuEvent(QContextMenuEvent *e)
|
|||
QMenu *contextMenu = createStandardContextMenu(e->pos());
|
||||
|
||||
/* Add actions for pasting links */
|
||||
contextMenu->addAction( tr("Paste as plain text"), this, SLOT(pastePlainText()));
|
||||
contextMenu->addSeparator();
|
||||
QAction *pasteLinkAction = contextMenu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste RetroShare Link"), this, SLOT(pasteLink()));
|
||||
contextMenu->addAction(QIcon(":/images/pasterslink.png"), tr("Paste my certificate link"), this, SLOT(pasteOwnCertificateLink()));
|
||||
|
@ -260,3 +263,8 @@ void MimeTextEdit::pasteOwnCertificateLink()
|
|||
insertHtml(link.toHtml() + " ");
|
||||
}
|
||||
}
|
||||
|
||||
void MimeTextEdit::pastePlainText()
|
||||
{
|
||||
insertPlainText(QApplication::clipboard()->text());
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ private slots:
|
|||
void insertCompletion(const QString &completion);
|
||||
void pasteLink();
|
||||
void pasteOwnCertificateLink();
|
||||
|
||||
void pastePlainText();
|
||||
private:
|
||||
QString textUnderCursor() const;
|
||||
|
||||
|
|
|
@ -518,7 +518,7 @@ void RSGraphWidget::paintTotals()
|
|||
int x = SCALE_WIDTH*fact + FS, y = 0;
|
||||
int rowHeight = FS;
|
||||
|
||||
#if !defined(Q_WS_MAC)
|
||||
#if !defined(Q_OS_MAC)
|
||||
/* On Mac, we don't need vertical spacing between the text rows. */
|
||||
rowHeight += 5;
|
||||
#endif
|
||||
|
|
|
@ -29,7 +29,12 @@
|
|||
|
||||
RSTreeWidget::RSTreeWidget(QWidget *parent) : QTreeWidget(parent)
|
||||
{
|
||||
mColumnCustomizable = false;
|
||||
mEnableColumnCustomize = false;
|
||||
mSettingsVersion = 0; // disabled
|
||||
|
||||
QHeaderView *h = header();
|
||||
h->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(h, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(headerContextMenuRequested(QPoint)));
|
||||
}
|
||||
|
||||
void RSTreeWidget::setPlaceholderText(const QString &text)
|
||||
|
@ -76,11 +81,11 @@ void RSTreeWidget::mousePressEvent(QMouseEvent *event)
|
|||
QTreeWidget::mousePressEvent(event);
|
||||
}
|
||||
|
||||
void RSTreeWidget::filterItems(int filterColumn, const QString &text)
|
||||
void RSTreeWidget::filterItems(int filterColumn, const QString &text, int role)
|
||||
{
|
||||
int count = topLevelItemCount();
|
||||
for (int index = 0; index < count; ++index) {
|
||||
filterItem(topLevelItem(index), filterColumn, text);
|
||||
filterItem(topLevelItem(index), filterColumn, text, role);
|
||||
}
|
||||
|
||||
QTreeWidgetItem *item = currentItem();
|
||||
|
@ -90,12 +95,12 @@ void RSTreeWidget::filterItems(int filterColumn, const QString &text)
|
|||
}
|
||||
}
|
||||
|
||||
bool RSTreeWidget::filterItem(QTreeWidgetItem *item, int filterColumn, const QString &text)
|
||||
bool RSTreeWidget::filterItem(QTreeWidgetItem *item, int filterColumn, const QString &text, int role)
|
||||
{
|
||||
bool itemVisible = true;
|
||||
|
||||
if (!text.isEmpty()) {
|
||||
if (!item->text(filterColumn).contains(text, Qt::CaseInsensitive)) {
|
||||
if (!item->data(filterColumn, role).toString().contains(text, Qt::CaseInsensitive)) {
|
||||
itemVisible = false;
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +108,7 @@ bool RSTreeWidget::filterItem(QTreeWidgetItem *item, int filterColumn, const QSt
|
|||
int visibleChildCount = 0;
|
||||
int count = item->childCount();
|
||||
for (int index = 0; index < count; ++index) {
|
||||
if (filterItem(item->child(index), filterColumn, text)) {
|
||||
if (filterItem(item->child(index), filterColumn, text, role)) {
|
||||
++visibleChildCount;
|
||||
}
|
||||
}
|
||||
|
@ -117,55 +122,93 @@ bool RSTreeWidget::filterItem(QTreeWidgetItem *item, int filterColumn, const QSt
|
|||
return (itemVisible || visibleChildCount);
|
||||
}
|
||||
|
||||
void RSTreeWidget::setSettingsVersion(qint32 version)
|
||||
{
|
||||
mSettingsVersion = version;
|
||||
}
|
||||
|
||||
void RSTreeWidget::processSettings(bool load)
|
||||
{
|
||||
if (load) {
|
||||
// load settings
|
||||
// Load settings
|
||||
|
||||
// state of tree widget
|
||||
header()->restoreState(Settings->value(objectName()).toByteArray());
|
||||
// State of tree widget
|
||||
if (mSettingsVersion == 0 || Settings->value(QString("%1Version").arg(objectName())) == mSettingsVersion) {
|
||||
// Compare version, because Qt can crash in restoreState after column changes
|
||||
header()->restoreState(Settings->value(objectName()).toByteArray());
|
||||
}
|
||||
} else {
|
||||
// save settings
|
||||
// Save settings
|
||||
|
||||
// state of tree widget
|
||||
Settings->setValue(objectName(), header()->saveState());
|
||||
|
||||
// Save version
|
||||
if (mSettingsVersion) {
|
||||
Settings->setValue(QString("%1Version").arg(objectName()), mSettingsVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RSTreeWidget::setColumnCustomizable(bool customizable)
|
||||
void RSTreeWidget::enableColumnCustomize(bool customizable)
|
||||
{
|
||||
if (customizable == mColumnCustomizable) {
|
||||
if (customizable == mEnableColumnCustomize) {
|
||||
return;
|
||||
}
|
||||
|
||||
mColumnCustomizable = customizable;
|
||||
mEnableColumnCustomize = customizable;
|
||||
}
|
||||
|
||||
QHeaderView *h = header();
|
||||
void RSTreeWidget::setColumnCustomizable(int column, bool customizable)
|
||||
{
|
||||
mColumnCustomizable[column] = customizable;
|
||||
}
|
||||
|
||||
if (mColumnCustomizable) {
|
||||
h->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(h, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(headerContextMenuRequested(QPoint)));
|
||||
} else {
|
||||
h->setContextMenuPolicy(Qt::DefaultContextMenu);
|
||||
disconnect(h, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(headerContextMenuRequested(QPoint)));
|
||||
}
|
||||
void RSTreeWidget::addHeaderContextMenuAction(QAction *action)
|
||||
{
|
||||
mHeaderContextMenuActions.push_back(action);
|
||||
}
|
||||
|
||||
void RSTreeWidget::headerContextMenuRequested(const QPoint &pos)
|
||||
{
|
||||
if (!mColumnCustomizable) {
|
||||
return;
|
||||
}
|
||||
|
||||
QMenu contextMenu(this);
|
||||
|
||||
QTreeWidgetItem *item = headerItem();
|
||||
int columnCount = item->columnCount();
|
||||
for (int column = 0; column < columnCount; ++column) {
|
||||
QAction *action = contextMenu.addAction(QIcon(), item->text(column), this, SLOT(columnVisible()));
|
||||
action->setCheckable(true);
|
||||
action->setData(column);
|
||||
action->setChecked(!isColumnHidden(column));
|
||||
if (mEnableColumnCustomize) {
|
||||
QTreeWidgetItem *item = headerItem();
|
||||
int columnCount = item->columnCount();
|
||||
for (int column = 0; column < columnCount; ++column) {
|
||||
QMap<int, bool>::const_iterator it = mColumnCustomizable.find(column);
|
||||
if (it != mColumnCustomizable.end() && *it == false) {
|
||||
continue;
|
||||
}
|
||||
QAction *action = contextMenu.addAction(QIcon(), item->text(column), this, SLOT(columnVisible()));
|
||||
action->setCheckable(true);
|
||||
action->setData(column);
|
||||
action->setChecked(!isColumnHidden(column));
|
||||
}
|
||||
}
|
||||
|
||||
if (!mHeaderContextMenuActions.isEmpty()) {
|
||||
bool addSeparator = false;
|
||||
if (!contextMenu.isEmpty()) {
|
||||
// Check for visible action
|
||||
foreach (QAction *action, mHeaderContextMenuActions) {
|
||||
if (action->isVisible()) {
|
||||
addSeparator = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (addSeparator) {
|
||||
contextMenu.addSeparator();
|
||||
}
|
||||
|
||||
contextMenu.addActions(mHeaderContextMenuActions);
|
||||
}
|
||||
|
||||
if (contextMenu.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
contextMenu.exec(mapToGlobal(pos));
|
||||
|
@ -184,3 +227,10 @@ void RSTreeWidget::columnVisible()
|
|||
|
||||
emit columnVisibleChanged(column, visible);
|
||||
}
|
||||
|
||||
void RSTreeWidget::resort()
|
||||
{
|
||||
if (isSortingEnabled()) {
|
||||
sortByColumn(header()->sortIndicatorSection(), header()->sortIndicatorOrder());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,18 +35,25 @@ public:
|
|||
QString placeholderText() { return mPlaceholderText; }
|
||||
void setPlaceholderText(const QString &text);
|
||||
|
||||
void filterItems(int filterColumn, const QString &text);
|
||||
void filterItems(int filterColumn, const QString &text, int role = Qt::DisplayRole);
|
||||
|
||||
void setSettingsVersion(qint32 version);
|
||||
void processSettings(bool load);
|
||||
|
||||
void setColumnCustomizable(bool customizable);
|
||||
void enableColumnCustomize(bool customizable);
|
||||
void setColumnCustomizable(int column, bool customizable);
|
||||
|
||||
void resort();
|
||||
|
||||
// Add QAction to context menu (action won't be deleted)
|
||||
void addHeaderContextMenuAction(QAction *action);
|
||||
|
||||
signals:
|
||||
void signalMouseMiddleButtonClicked(QTreeWidgetItem *item);
|
||||
void columnVisibleChanged(int column, bool visible);
|
||||
|
||||
private:
|
||||
bool filterItem(QTreeWidgetItem *item, int filterColumn, const QString &text);
|
||||
bool filterItem(QTreeWidgetItem *item, int filterColumn, const QString &text, int role);
|
||||
|
||||
private slots:
|
||||
void headerContextMenuRequested(const QPoint &pos);
|
||||
|
@ -58,7 +65,10 @@ protected:
|
|||
|
||||
private:
|
||||
QString mPlaceholderText;
|
||||
bool mColumnCustomizable;
|
||||
bool mEnableColumnCustomize;
|
||||
quint32 mSettingsVersion;
|
||||
QMap<int, bool> mColumnCustomizable;
|
||||
QList<QAction*> mHeaderContextMenuActions;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -86,15 +86,15 @@ const char *StatusDefs::imageStatus(unsigned int status)
|
|||
{
|
||||
switch (status) {
|
||||
case RS_STATUS_OFFLINE:
|
||||
return ":/images/status/user-offline.png";
|
||||
return ":/icons/user-offline_64.png";
|
||||
case RS_STATUS_AWAY:
|
||||
return ":/images/status/user-away.png";
|
||||
return ":/icons/user-away_64.png";
|
||||
case RS_STATUS_BUSY:
|
||||
return ":/images/status/user-busy.png";
|
||||
return ":/icons/user-busy_64.png";
|
||||
case RS_STATUS_ONLINE:
|
||||
return ":/images/status/user-online.png";
|
||||
return ":/icons/user-online_64.png";
|
||||
case RS_STATUS_INACTIVE:
|
||||
return ":/images/status/user-away-extended.png";
|
||||
return ":/icons/user-away-extended_64.png";
|
||||
}
|
||||
|
||||
std::cerr << "StatusDefs::imageUser: Unknown status requested " << status;
|
||||
|
|
|
@ -77,7 +77,7 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
|
|||
mTitleFontWeight = 0; // Standard
|
||||
|
||||
// this define comes from Qt example. I don't have mac, so it wasn't tested
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
setWizardStyle(ModernStyle);
|
||||
#endif
|
||||
|
||||
|
@ -568,7 +568,7 @@ void ConnectFriendWizard::initializePage(int id)
|
|||
|
||||
static void sendMail(QString sAddress, QString sSubject, QString sBody)
|
||||
{
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef Q_OS_WIN
|
||||
/* search and replace the end of lines with: "%0D%0A" */
|
||||
sBody.replace("\n", "%0D%0A");
|
||||
#endif
|
||||
|
|
|
@ -41,6 +41,10 @@ GxsCommentDialog::GxsCommentDialog(QWidget *parent, RsTokenService *token_servic
|
|||
//ui->postFrame->setVisible(false);
|
||||
|
||||
ui->treeWidget->setup(token_service, comment_service);
|
||||
|
||||
/* Set header resize modes and initial section sizes */
|
||||
QHeaderView * ttheader = ui->treeWidget->header () ;
|
||||
ttheader->resizeSection (0, 440);
|
||||
|
||||
/* fill in the available OwnIds for signing */
|
||||
ui->idChooser->loadIds(IDCHOOSER_ID_REQUIRED, RsGxsId());
|
||||
|
|
|
@ -73,6 +73,7 @@ GxsGroupFrameDialog::GxsGroupFrameDialog(RsGxsIfaceHelper *ifaceImpl, QWidget *p
|
|||
ui->setupUi(this);
|
||||
|
||||
mInitialized = false;
|
||||
mInFill = false;
|
||||
mCountChildMsgs = false;
|
||||
mYourGroups = NULL;
|
||||
mSubscribedGroups = NULL;
|
||||
|
@ -555,6 +556,10 @@ GxsCommentDialog *GxsGroupFrameDialog::commentWidget(const RsGxsMessageId &msgId
|
|||
|
||||
void GxsGroupFrameDialog::changedGroup(const QString &groupId)
|
||||
{
|
||||
if (mInFill) {
|
||||
return;
|
||||
}
|
||||
|
||||
mGroupId = RsGxsGroupId(groupId.toStdString());
|
||||
if (mGroupId.isNull()) {
|
||||
return;
|
||||
|
@ -689,6 +694,8 @@ void GxsGroupFrameDialog::insertGroupsData(const std::list<RsGroupMetaData> &gro
|
|||
return;
|
||||
}
|
||||
|
||||
mInFill = true;
|
||||
|
||||
std::list<RsGroupMetaData>::const_iterator it;
|
||||
|
||||
QList<GroupItemInfo> adminList;
|
||||
|
@ -752,6 +759,8 @@ void GxsGroupFrameDialog::insertGroupsData(const std::list<RsGroupMetaData> &gro
|
|||
ui->groupTreeWidget->fillGroupItems(mPopularGroups, popList);
|
||||
ui->groupTreeWidget->fillGroupItems(mOtherGroups, otherList);
|
||||
|
||||
mInFill = false;
|
||||
|
||||
/* Re-fill group */
|
||||
if (!ui->groupTreeWidget->activateId(QString::fromStdString(mGroupId.toStdString()), true)) {
|
||||
mGroupId.clear();
|
||||
|
|
|
@ -175,6 +175,7 @@ protected:
|
|||
|
||||
private:
|
||||
bool mInitialized;
|
||||
bool mInFill;
|
||||
QString mSettingsName;
|
||||
RsGxsGroupId mGroupId;
|
||||
RsGxsIfaceHelper *mInterface;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
/* Images for tag icons */
|
||||
#define IMAGE_LOADING ":/images/folder-draft.png"
|
||||
#define IMAGE_PGPKNOWN ":/images/tags/pgp-known.png"
|
||||
#define IMAGE_PGPKNOWN ":/images/contact.png"
|
||||
#define IMAGE_PGPUNKNOWN ":/images/tags/pgp-unknown.png"
|
||||
#define IMAGE_ANON ":/images/tags/anon.png"
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ GxsMessageFramePostWidget::GxsMessageFramePostWidget(RsGxsIfaceHelper *ifaceImpl
|
|||
mFillThread = NULL;
|
||||
|
||||
mTokenTypeGroupData = nextTokenType();
|
||||
mTokenTypeAllPosts = nextTokenType();
|
||||
mTokenTypePosts = nextTokenType();
|
||||
mTokenTypeRelatedPosts = nextTokenType();
|
||||
}
|
||||
|
||||
GxsMessageFramePostWidget::~GxsMessageFramePostWidget()
|
||||
|
@ -76,7 +76,7 @@ bool GxsMessageFramePostWidget::navigate(const RsGxsMessageId &msgId)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (mStateHelper->isLoading(mTokenTypePosts) || mStateHelper->isLoading(mTokenTypeRelatedPosts)) {
|
||||
if (mStateHelper->isLoading(mTokenTypeAllPosts) || mStateHelper->isLoading(mTokenTypePosts)) {
|
||||
mNavigatePendingMsgId = msgId;
|
||||
|
||||
/* No information if group is available */
|
||||
|
@ -88,7 +88,7 @@ bool GxsMessageFramePostWidget::navigate(const RsGxsMessageId &msgId)
|
|||
|
||||
bool GxsMessageFramePostWidget::isLoading()
|
||||
{
|
||||
if (mStateHelper->isLoading(mTokenTypePosts) || mStateHelper->isLoading(mTokenTypeRelatedPosts)) {
|
||||
if (mStateHelper->isLoading(mTokenTypeAllPosts) || mStateHelper->isLoading(mTokenTypePosts)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ void GxsMessageFramePostWidget::updateDisplay(bool complete)
|
|||
if (complete) {
|
||||
/* Fill complete */
|
||||
requestGroupData();
|
||||
requestPosts();
|
||||
requestAllPosts();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -118,14 +118,14 @@ void GxsMessageFramePostWidget::updateDisplay(bool complete)
|
|||
if (!groupId().isNull() && std::find(grpIds.begin(), grpIds.end(), groupId()) != grpIds.end()) {
|
||||
updateGroup = true;
|
||||
/* Do we need to fill all posts? */
|
||||
requestPosts();
|
||||
requestAllPosts();
|
||||
} else {
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > msgs;
|
||||
getAllMsgIds(msgs);
|
||||
if (!msgs.empty()) {
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >::const_iterator mit = msgs.find(groupId());
|
||||
if (mit != msgs.end()) {
|
||||
requestRelatedPosts(mit->second);
|
||||
requestPosts(mit->second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ void GxsMessageFramePostWidget::fillThreadFinished()
|
|||
/* Current thread has finished */
|
||||
mFillThread = NULL;
|
||||
|
||||
mStateHelper->setLoading(mTokenTypePosts, false);
|
||||
mStateHelper->setLoading(mTokenTypeAllPosts, false);
|
||||
emit groupChanged(this);
|
||||
|
||||
if (!mNavigatePendingMsgId.isNull()) {
|
||||
|
@ -258,10 +258,10 @@ void GxsMessageFramePostWidget::loadGroupData(const uint32_t &token)
|
|||
emit groupChanged(this);
|
||||
}
|
||||
|
||||
void GxsMessageFramePostWidget::requestPosts()
|
||||
void GxsMessageFramePostWidget::requestAllPosts()
|
||||
{
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::requestPosts()";
|
||||
std::cerr << "GxsMessageFramePostWidget::requestAllPosts()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
|
@ -269,7 +269,7 @@ void GxsMessageFramePostWidget::requestPosts()
|
|||
|
||||
/* Request all posts */
|
||||
|
||||
mTokenQueue->cancelActiveRequestTokens(mTokenTypePosts);
|
||||
mTokenQueue->cancelActiveRequestTokens(mTokenTypeAllPosts);
|
||||
|
||||
if (mFillThread) {
|
||||
/* Stop current fill thread */
|
||||
|
@ -277,20 +277,20 @@ void GxsMessageFramePostWidget::requestPosts()
|
|||
mFillThread = NULL;
|
||||
thread->stop(false);
|
||||
|
||||
mStateHelper->setLoading(mTokenTypePosts, false);
|
||||
mStateHelper->setLoading(mTokenTypeAllPosts, false);
|
||||
}
|
||||
|
||||
clearPosts();
|
||||
|
||||
if (groupId().isNull()) {
|
||||
mStateHelper->setActive(mTokenTypePosts, false);
|
||||
mStateHelper->setLoading(mTokenTypePosts, false);
|
||||
mStateHelper->clear(mTokenTypePosts);
|
||||
mStateHelper->setActive(mTokenTypeAllPosts, false);
|
||||
mStateHelper->setLoading(mTokenTypeAllPosts, false);
|
||||
mStateHelper->clear(mTokenTypeAllPosts);
|
||||
emit groupChanged(this);
|
||||
return;
|
||||
}
|
||||
|
||||
mStateHelper->setLoading(mTokenTypePosts, true);
|
||||
mStateHelper->setLoading(mTokenTypeAllPosts, true);
|
||||
emit groupChanged(this);
|
||||
|
||||
std::list<RsGxsGroupId> groupIds;
|
||||
|
@ -300,17 +300,17 @@ void GxsMessageFramePostWidget::requestPosts()
|
|||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
|
||||
uint32_t token;
|
||||
mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds, mTokenTypePosts);
|
||||
mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, groupIds, mTokenTypeAllPosts);
|
||||
}
|
||||
|
||||
void GxsMessageFramePostWidget::loadPosts(const uint32_t &token)
|
||||
void GxsMessageFramePostWidget::loadAllPosts(const uint32_t &token)
|
||||
{
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::loadPosts()";
|
||||
std::cerr << "GxsMessageFramePostWidget::loadAllPosts()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
mStateHelper->setActive(mTokenTypePosts, true);
|
||||
mStateHelper->setActive(mTokenTypeAllPosts, true);
|
||||
|
||||
if (useThread()) {
|
||||
/* Create fill thread */
|
||||
|
@ -321,15 +321,15 @@ void GxsMessageFramePostWidget::loadPosts(const uint32_t &token)
|
|||
connect(mFillThread, SIGNAL(addPost(QVariant,bool,int,int)), this, SLOT(fillThreadAddPost(QVariant,bool,int,int)), Qt::BlockingQueuedConnection);
|
||||
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::loadPosts() Start fill thread" << std::endl;
|
||||
std::cerr << "GxsMessageFramePostWidget::loadAllPosts() Start fill thread" << std::endl;
|
||||
#endif
|
||||
|
||||
/* Start thread */
|
||||
mFillThread->start();
|
||||
} else {
|
||||
insertPosts(token, NULL);
|
||||
insertAllPosts(token, NULL);
|
||||
|
||||
mStateHelper->setLoading(mTokenTypePosts, false);
|
||||
mStateHelper->setLoading(mTokenTypeAllPosts, false);
|
||||
|
||||
if (!mNavigatePendingMsgId.isNull()) {
|
||||
navigate(mNavigatePendingMsgId);
|
||||
|
@ -341,21 +341,21 @@ void GxsMessageFramePostWidget::loadPosts(const uint32_t &token)
|
|||
emit groupChanged(this);
|
||||
}
|
||||
|
||||
void GxsMessageFramePostWidget::requestRelatedPosts(const std::vector<RsGxsMessageId> &msgIds)
|
||||
void GxsMessageFramePostWidget::requestPosts(const std::vector<RsGxsMessageId> &msgIds)
|
||||
{
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::requestRelatedPosts()";
|
||||
std::cerr << "GxsMessageFramePostWidget::requestPosts()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
mNavigatePendingMsgId.clear();
|
||||
|
||||
mTokenQueue->cancelActiveRequestTokens(mTokenTypeRelatedPosts);
|
||||
mTokenQueue->cancelActiveRequestTokens(mTokenTypePosts);
|
||||
|
||||
if (groupId().isNull()) {
|
||||
mStateHelper->setActive(mTokenTypeRelatedPosts, false);
|
||||
mStateHelper->setLoading(mTokenTypeRelatedPosts, false);
|
||||
mStateHelper->clear(mTokenTypeRelatedPosts);
|
||||
mStateHelper->setActive(mTokenTypePosts, false);
|
||||
mStateHelper->setLoading(mTokenTypePosts, false);
|
||||
mStateHelper->clear(mTokenTypePosts);
|
||||
emit groupChanged(this);
|
||||
return;
|
||||
}
|
||||
|
@ -364,33 +364,30 @@ void GxsMessageFramePostWidget::requestRelatedPosts(const std::vector<RsGxsMessa
|
|||
return;
|
||||
}
|
||||
|
||||
mStateHelper->setLoading(mTokenTypeRelatedPosts, true);
|
||||
mStateHelper->setLoading(mTokenTypePosts, true);
|
||||
emit groupChanged(this);
|
||||
|
||||
RsTokReqOptions opts;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_RELATED_DATA;
|
||||
opts.mOptions = RS_TOKREQOPT_MSG_VERSIONS;
|
||||
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
|
||||
|
||||
uint32_t token;
|
||||
std::vector<RsGxsGrpMsgIdPair> relatedMsgIds;
|
||||
for (std::vector<RsGxsMessageId>::const_iterator msgIt = msgIds.begin(); msgIt != msgIds.end(); ++msgIt) {
|
||||
relatedMsgIds.push_back(RsGxsGrpMsgIdPair(groupId(), *msgIt));
|
||||
}
|
||||
mTokenQueue->requestMsgRelatedInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, relatedMsgIds, mTokenTypeRelatedPosts);
|
||||
GxsMsgReq requestMsgIds;
|
||||
requestMsgIds[groupId()] = msgIds;
|
||||
mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, requestMsgIds, mTokenTypePosts);
|
||||
}
|
||||
|
||||
void GxsMessageFramePostWidget::loadRelatedPosts(const uint32_t &token)
|
||||
void GxsMessageFramePostWidget::loadPosts(const uint32_t &token)
|
||||
{
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostWidget::loadRelatedPosts()";
|
||||
std::cerr << "GxsMessageFramePostWidget::loadPosts()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
mStateHelper->setActive(mTokenTypeRelatedPosts, true);
|
||||
mStateHelper->setActive(mTokenTypePosts, true);
|
||||
|
||||
insertRelatedPosts(token);
|
||||
insertPosts(token);
|
||||
|
||||
mStateHelper->setLoading(mTokenTypeRelatedPosts, false);
|
||||
mStateHelper->setLoading(mTokenTypePosts, false);
|
||||
emit groupChanged(this);
|
||||
|
||||
if (!mNavigatePendingMsgId.isNull()) {
|
||||
|
@ -414,13 +411,13 @@ void GxsMessageFramePostWidget::loadRequest(const TokenQueue *queue, const Token
|
|||
return;
|
||||
}
|
||||
|
||||
if (req.mUserType == mTokenTypePosts) {
|
||||
loadPosts(req.mToken);
|
||||
if (req.mUserType == mTokenTypeAllPosts) {
|
||||
loadAllPosts(req.mToken);
|
||||
return;
|
||||
}
|
||||
|
||||
if (req.mUserType == mTokenTypeRelatedPosts) {
|
||||
loadRelatedPosts(req.mToken);
|
||||
if (req.mUserType == mTokenTypePosts) {
|
||||
loadPosts(req.mToken);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -465,7 +462,7 @@ void GxsMessageFramePostThread::run()
|
|||
std::cerr << "GxsMessageFramePostThread::run()" << std::endl;
|
||||
#endif
|
||||
|
||||
mParent->insertPosts(mToken, this);
|
||||
mParent->insertAllPosts(mToken, this);
|
||||
|
||||
#ifdef ENABLE_DEBUG
|
||||
std::cerr << "GxsMessageFramePostThread::run() stopped: " << (stopped() ? "yes" : "no") << std::endl;
|
||||
|
|
|
@ -68,13 +68,13 @@ protected:
|
|||
void loadGroupData(const uint32_t &token);
|
||||
virtual bool insertGroupData(const uint32_t &token, RsGroupMetaData &metaData) = 0;
|
||||
|
||||
void requestPosts();
|
||||
void loadPosts(const uint32_t &token);
|
||||
virtual void insertPosts(const uint32_t &token, GxsMessageFramePostThread *thread) = 0;
|
||||
void requestAllPosts();
|
||||
void loadAllPosts(const uint32_t &token);
|
||||
virtual void insertAllPosts(const uint32_t &token, GxsMessageFramePostThread *thread) = 0;
|
||||
|
||||
void requestRelatedPosts(const std::vector<RsGxsMessageId> &msgIds);
|
||||
void loadRelatedPosts(const uint32_t &token);
|
||||
virtual void insertRelatedPosts(const uint32_t &token) = 0;
|
||||
void requestPosts(const std::vector<RsGxsMessageId> &msgIds);
|
||||
void loadPosts(const uint32_t &token);
|
||||
virtual void insertPosts(const uint32_t &token) = 0;
|
||||
|
||||
private slots:
|
||||
void fillThreadFinished();
|
||||
|
@ -82,8 +82,8 @@ private slots:
|
|||
|
||||
protected:
|
||||
uint32_t mTokenTypeGroupData;
|
||||
uint32_t mTokenTypeAllPosts;
|
||||
uint32_t mTokenTypePosts;
|
||||
uint32_t mTokenTypeRelatedPosts;
|
||||
RsGxsMessageId mNavigatePendingMsgId;
|
||||
|
||||
private:
|
||||
|
|
|
@ -55,11 +55,11 @@ GxsChannelPostsWidget::GxsChannelPostsWidget(const RsGxsGroupId &channelId, QWid
|
|||
|
||||
/* Setup UI helper */
|
||||
|
||||
mStateHelper->addWidget(mTokenTypePosts, ui->progressBar, UISTATE_LOADING_VISIBLE);
|
||||
mStateHelper->addWidget(mTokenTypePosts, ui->loadingLabel, UISTATE_LOADING_VISIBLE);
|
||||
mStateHelper->addWidget(mTokenTypePosts, ui->filterLineEdit);
|
||||
mStateHelper->addWidget(mTokenTypeAllPosts, ui->progressBar, UISTATE_LOADING_VISIBLE);
|
||||
mStateHelper->addWidget(mTokenTypeAllPosts, ui->loadingLabel, UISTATE_LOADING_VISIBLE);
|
||||
mStateHelper->addWidget(mTokenTypeAllPosts, ui->filterLineEdit);
|
||||
|
||||
mStateHelper->addWidget(mTokenTypeRelatedPosts, ui->loadingLabel, UISTATE_LOADING_VISIBLE);
|
||||
mStateHelper->addWidget(mTokenTypePosts, ui->loadingLabel, UISTATE_LOADING_VISIBLE);
|
||||
|
||||
mStateHelper->addLoadPlaceholder(mTokenTypeGroupData, ui->nameLabel);
|
||||
|
||||
|
@ -175,7 +175,7 @@ void GxsChannelPostsWidget::groupNameChanged(const QString &name)
|
|||
|
||||
QIcon GxsChannelPostsWidget::groupIcon()
|
||||
{
|
||||
if (mStateHelper->isLoading(mTokenTypeGroupData) || mStateHelper->isLoading(mTokenTypePosts)) {
|
||||
if (mStateHelper->isLoading(mTokenTypeGroupData) || mStateHelper->isLoading(mTokenTypeAllPosts)) {
|
||||
return QIcon(":/images/kalarm.png");
|
||||
}
|
||||
|
||||
|
@ -488,7 +488,7 @@ bool GxsChannelPostsWidget::insertGroupData(const uint32_t &token, RsGroupMetaDa
|
|||
return false;
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidget::insertPosts(const uint32_t &token, GxsMessageFramePostThread *thread)
|
||||
void GxsChannelPostsWidget::insertAllPosts(const uint32_t &token, GxsMessageFramePostThread *thread)
|
||||
{
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
rsGxsChannels->getPostData(token, posts);
|
||||
|
@ -496,10 +496,10 @@ void GxsChannelPostsWidget::insertPosts(const uint32_t &token, GxsMessageFramePo
|
|||
insertChannelPosts(posts, thread, false);
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidget::insertRelatedPosts(const uint32_t &token)
|
||||
void GxsChannelPostsWidget::insertPosts(const uint32_t &token)
|
||||
{
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
rsGxsChannels->getRelatedPosts(token, posts);
|
||||
rsGxsChannels->getPostData(token, posts);
|
||||
|
||||
insertChannelPosts(posts, NULL, true);
|
||||
}
|
||||
|
|
|
@ -67,8 +67,8 @@ protected:
|
|||
/* GxsMessageFramePostWidget */
|
||||
virtual void groupNameChanged(const QString &name);
|
||||
virtual bool insertGroupData(const uint32_t &token, RsGroupMetaData &metaData);
|
||||
virtual void insertPosts(const uint32_t &token, GxsMessageFramePostThread *thread);
|
||||
virtual void insertRelatedPosts(const uint32_t &token);
|
||||
virtual void insertAllPosts(const uint32_t &token, GxsMessageFramePostThread *thread);
|
||||
virtual void insertPosts(const uint32_t &token);
|
||||
virtual void clearPosts();
|
||||
virtual bool useThread() { return mUseThread; }
|
||||
virtual void fillThreadCreatePost(const QVariant &post, bool related, int current, int count);
|
||||
|
|
|
@ -206,6 +206,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
|
|||
ui->subscribeToolButton->setToolTip(tr("<p>Subscribing to the forum will gather \
|
||||
available posts from your subscribed friends, and make the \
|
||||
forum visible to all other friends.</p><p>Afterwards you can unsubscribe from the context menu of the forum list at left.</p>"));
|
||||
ui->threadTreeWidget->enableColumnCustomize(true);
|
||||
}
|
||||
|
||||
GxsForumThreadWidget::~GxsForumThreadWidget()
|
||||
|
|
|
@ -58,10 +58,10 @@ HelpBrowser::HelpBrowser(QWidget *parent)
|
|||
{
|
||||
/* Invoke Qt Designer generated QObject setup routine */
|
||||
ui.setupUi(this);
|
||||
#if defined(Q_WS_MAC)
|
||||
#if defined(Q_OS_MAC)
|
||||
ui.actionHome->setShortcut(QString("Shift+Ctrl+H"));
|
||||
#endif
|
||||
#if !defined(Q_WS_WIN)
|
||||
#if !defined(Q_OS_WIN)
|
||||
ui.actionClose->setShortcut(QString("Ctrl+W"));
|
||||
#endif
|
||||
|
||||
|
|
4
retroshare-gui/src/gui/help/version.html.in
Normal file
|
@ -0,0 +1,4 @@
|
|||
Retroshare Gui version :
|
||||
Git version : $Branch$
|
||||
$Hash$
|
||||
$Date$
|
|
@ -55,5 +55,10 @@
|
|||
<file>icons/tile_downloaded_48.png</file>
|
||||
<file>icons/tile_downloading_48.png</file>
|
||||
<file>icons/tile_inactive_48.png</file>
|
||||
<file>icons/user-away_64.png</file>
|
||||
<file>icons/user-away-extended_64.png</file>
|
||||
<file>icons/user-busy_64.png</file>
|
||||
<file>icons/user-offline_64.png</file>
|
||||
<file>icons/user-online_64.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
BIN
retroshare-gui/src/gui/icons/user-away-extended_64.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
retroshare-gui/src/gui/icons/user-away_64.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
retroshare-gui/src/gui/icons/user-busy_64.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
retroshare-gui/src/gui/icons/user-offline_64.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
retroshare-gui/src/gui/icons/user-online_64.png
Normal file
After Width: | Height: | Size: 19 KiB |
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include "rshare.h"
|
||||
#include <retroshare/rshistory.h>
|
||||
#include <retroshare/rsidentity.h>
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/notifyqt.h"
|
||||
|
||||
|
@ -272,7 +273,19 @@ void ImHistoryBrowser::fillItem(QListWidgetItem *itemWidget, HistoryMsg& msg)
|
|||
}
|
||||
|
||||
QString messageText = RsHtml().formatText(NULL, QString::fromUtf8(msg.message.c_str()), formatTextFlag);
|
||||
QString formatMsg = style.formatMessage(type, QString::fromUtf8(msg.peerName.c_str()), QDateTime::fromTime_t(msg.sendTime), messageText);
|
||||
|
||||
QString name;
|
||||
if (m_chatId.isLobbyId() || m_chatId.isGxsId()) {
|
||||
RsIdentityDetails details;
|
||||
if (rsIdentity->getIdDetails(RsGxsId(msg.peerName), details))
|
||||
name = QString::fromUtf8(details.mNickname.c_str());
|
||||
else
|
||||
name = QString::fromUtf8(msg.peerName.c_str());
|
||||
} else {
|
||||
name = QString::fromUtf8(msg.peerName.c_str());
|
||||
}
|
||||
|
||||
QString formatMsg = style.formatMessage(type, name, QDateTime::fromTime_t(msg.sendTime), messageText);
|
||||
|
||||
itemWidget->setData(Qt::DisplayRole, qVariantFromValue(IMHistoryItemPainter(formatMsg)));
|
||||
itemWidget->setData(ROLE_MSGID, msg.msgId);
|
||||
|
|
|
@ -60,10 +60,7 @@
|
|||
<file>images/btn_green.png</file>
|
||||
<file>images/btn_green_hover.png</file>
|
||||
<file>images/btn_green_pressed.png</file>
|
||||
<file>images/connect_established.png</file>
|
||||
<file>images/connect_established_low.png</file>
|
||||
<file>images/connect_creating.png</file>
|
||||
<file>images/connect_no.png</file>
|
||||
<file>images/dht16.png</file>
|
||||
<file>images/dht32.png</file>
|
||||
<file>images/edit-clear-history.png</file>
|
||||
|
@ -424,7 +421,6 @@
|
|||
<file>images/replymail-pressed.png</file>
|
||||
<file>images/replymail24.png</file>
|
||||
<file>images/replymailall24-hover.png</file>
|
||||
<file>images/reload24.png</file>
|
||||
<file>images/reset.png</file>
|
||||
<file>images/resume.png</file>
|
||||
<file>images/security-high-16.png</file>
|
||||
|
@ -694,11 +690,6 @@
|
|||
<file>images/tags/dev-translator.png</file>
|
||||
<file>images/tags/dev-patcher.png</file>
|
||||
<file>images/tags/developer.png</file>
|
||||
<file>images/status/user-online.png</file>
|
||||
<file>images/status/user-offline.png</file>
|
||||
<file>images/status/user-busy.png</file>
|
||||
<file>images/status/user-away-extended.png</file>
|
||||
<file>images/status/user-away.png</file>
|
||||
<file>images/circles/circles_32.png</file>
|
||||
<file>images/circles/circles_64.png</file>
|
||||
<file>images/newsfeed/news-feed-32.png</file>
|
||||
|
|
Before Width: | Height: | Size: 818 B |
Before Width: | Height: | Size: 856 B |
Before Width: | Height: | Size: 757 B |
Before Width: | Height: | Size: 1.4 KiB |
|
@ -5,11 +5,11 @@
|
|||
IDI_ICON1 ICON "logo/logo_64.ico"
|
||||
|
||||
#define STRINGIZER(version) #version
|
||||
#define VERSION_STRING(major,minor,build,buildadd,revision) STRINGIZER(major) "." STRINGIZER(minor) "." STRINGIZER(build) buildadd "." STRINGIZER(revision)
|
||||
#define VERSION_STRING(major,minor,build,buildadd,revision) STRINGIZER(major) "." STRINGIZER(minor) "." STRINGIZER(build) buildadd "." revision
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION RS_MAJOR_VERSION,RS_MINOR_VERSION,RS_BUILD_NUMBER,RS_REVISION_NUMBER
|
||||
PRODUCTVERSION RS_MAJOR_VERSION,RS_MINOR_VERSION,RS_BUILD_NUMBER,RS_REVISION_NUMBER
|
||||
FILEVERSION RS_MAJOR_VERSION,RS_MINOR_VERSION,RS_BUILD_NUMBER,0
|
||||
PRODUCTVERSION RS_MAJOR_VERSION,RS_MINOR_VERSION,RS_BUILD_NUMBER,0
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
FILEFLAGS 0
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
|
@ -22,11 +22,11 @@ BEGIN
|
|||
BEGIN
|
||||
VALUE "CompanyName", ""
|
||||
VALUE "FileDescription", "RetroShare"
|
||||
VALUE "FileVersion", VERSION_STRING(RS_MAJOR_VERSION, RS_MINOR_VERSION, RS_BUILD_NUMBER, RS_BUILD_NUMBER_ADD, RS_REVISION_NUMBER)
|
||||
VALUE "FileVersion", VERSION_STRING(RS_MAJOR_VERSION, RS_MINOR_VERSION, RS_BUILD_NUMBER, RS_BUILD_NUMBER_ADD, RS_REVISION_STRING)
|
||||
VALUE "InternalName", "RetroShare"
|
||||
VALUE "OriginalFilename", "RetroShare.exe"
|
||||
VALUE "ProductName", "RetroShare"
|
||||
VALUE "ProductVersion", VERSION_STRING(RS_MAJOR_VERSION, RS_MINOR_VERSION, RS_BUILD_NUMBER, RS_BUILD_NUMBER_ADD, RS_REVISION_NUMBER)
|
||||
VALUE "ProductVersion", VERSION_STRING(RS_MAJOR_VERSION, RS_MINOR_VERSION, RS_BUILD_NUMBER, RS_BUILD_NUMBER_ADD, RS_REVISION_STRING)
|
||||
VALUE "LegalCopyright", ""
|
||||
END
|
||||
END
|
||||
|
|
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB |
|
@ -128,6 +128,7 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WindowFlags flags)
|
|||
setupEditActions();
|
||||
setupViewActions();
|
||||
setupInsertActions();
|
||||
setupContactActions();
|
||||
|
||||
m_compareRole = new RSTreeWidgetItemCompareRole;
|
||||
m_compareRole->setRole(COLUMN_CONTACT_NAME, ROLE_CONTACT_SORT);
|
||||
|
@ -210,8 +211,8 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WindowFlags flags)
|
|||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&,int)), this, SLOT(peerStatusChanged(const QString&,int)));
|
||||
connect(ui.friendSelectionWidget, SIGNAL(contentChanged()), this, SLOT(buildCompleter()));
|
||||
connect(ui.friendSelectionWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuMsgSendList(QPoint)));
|
||||
connect(ui.friendSelectionWidget, SIGNAL(doubleClicked(int,QString)), this, SLOT(addTo()));
|
||||
connect(ui.friendSelectionWidget, SIGNAL(itemSelectionChanged()), this, SLOT(friendSelectionChanged()));
|
||||
|
||||
/* hide the Tree +/- */
|
||||
ui.msgFileList -> setRootIsDecorated( false );
|
||||
|
@ -698,35 +699,6 @@ void MessageComposer::contextMenuFileList(QPoint)
|
|||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void MessageComposer::contextMenuMsgSendList(QPoint)
|
||||
{
|
||||
QMenu contextMnu(this);
|
||||
|
||||
int selectedCount = ui.friendSelectionWidget->selectedItemCount();
|
||||
|
||||
FriendSelectionWidget::IdType idType;
|
||||
ui.friendSelectionWidget->selectedId(idType);
|
||||
|
||||
QAction *action = contextMnu.addAction(QIcon(), tr("Add to \"To\""), this, SLOT(addTo()));
|
||||
action->setEnabled(selectedCount);
|
||||
action = contextMnu.addAction(QIcon(), tr("Add to \"CC\""), this, SLOT(addCc()));
|
||||
action->setEnabled(selectedCount);
|
||||
action = contextMnu.addAction(QIcon(), tr("Add to \"BCC\""), this, SLOT(addBcc()));
|
||||
action->setEnabled(selectedCount);
|
||||
action = contextMnu.addAction(QIcon(), tr("Add as Recommend"), this, SLOT(addRecommend()));
|
||||
action->setEnabled(selectedCount);
|
||||
|
||||
contextMnu.addSeparator();
|
||||
|
||||
action = contextMnu.addAction(QIcon(IMAGE_FRIENDINFO), tr("Friend Details"), this, SLOT(friendDetails()));
|
||||
action->setEnabled(selectedCount == 1 && idType == FriendSelectionWidget::IDTYPE_SSL);
|
||||
|
||||
action = contextMnu.addAction(QIcon(), tr("Person Details"), this, SLOT(identityDetails()));
|
||||
action->setEnabled(selectedCount == 1 && idType == FriendSelectionWidget::IDTYPE_GXS);
|
||||
|
||||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void MessageComposer::pasteRecommended()
|
||||
{
|
||||
QList<RetroShareLink> links;
|
||||
|
@ -2009,6 +1981,31 @@ void MessageComposer::setupFormatActions()
|
|||
|
||||
}
|
||||
|
||||
void MessageComposer::setupContactActions()
|
||||
{
|
||||
mActionAddTo = new QAction(tr("Add to \"To\""), this);
|
||||
connect(mActionAddTo, SIGNAL(triggered(bool)), this, SLOT(addTo()));
|
||||
mActionAddCC = new QAction(tr("Add to \"CC\""), this);
|
||||
connect(mActionAddCC, SIGNAL(triggered(bool)), this, SLOT(addCc()));
|
||||
mActionAddBCC = new QAction(tr("Add to \"BCC\""), this);
|
||||
connect(mActionAddBCC, SIGNAL(triggered(bool)), this, SLOT(addBcc()));
|
||||
mActionAddRecommend = new QAction(tr("Add as Recommend"), this);
|
||||
connect(mActionAddRecommend, SIGNAL(triggered(bool)), this, SLOT(addRecommend()));
|
||||
mActionContactDetails = new QAction(QIcon(IMAGE_FRIENDINFO), tr("Details"), this);
|
||||
connect(mActionContactDetails, SIGNAL(triggered(bool)), this, SLOT(contactDetails()));
|
||||
|
||||
ui.friendSelectionWidget->addContextMenuAction(mActionAddTo);
|
||||
ui.friendSelectionWidget->addContextMenuAction(mActionAddCC);
|
||||
ui.friendSelectionWidget->addContextMenuAction(mActionAddBCC);
|
||||
ui.friendSelectionWidget->addContextMenuAction(mActionAddRecommend);
|
||||
|
||||
QAction *action = new QAction(this);
|
||||
action->setSeparator(true);
|
||||
ui.friendSelectionWidget->addContextMenuAction(action);
|
||||
|
||||
ui.friendSelectionWidget->addContextMenuAction(mActionContactDetails);
|
||||
}
|
||||
|
||||
void MessageComposer::textBold()
|
||||
{
|
||||
QTextCharFormat fmt;
|
||||
|
@ -2577,6 +2574,27 @@ void MessageComposer::filterComboBoxChanged(int i)
|
|||
|
||||
}
|
||||
|
||||
void MessageComposer::friendSelectionChanged()
|
||||
{
|
||||
std::set<RsPeerId> peerIds;
|
||||
ui.friendSelectionWidget->selectedIds<RsPeerId,FriendSelectionWidget::IDTYPE_SSL>(peerIds, false);
|
||||
|
||||
std::set<RsGxsId> gxsIds;
|
||||
ui.friendSelectionWidget->selectedIds<RsGxsId,FriendSelectionWidget::IDTYPE_GXS>(gxsIds, false);
|
||||
|
||||
int selectedCount = peerIds.size() + gxsIds.size();
|
||||
|
||||
mActionAddTo->setEnabled(selectedCount);
|
||||
mActionAddCC->setEnabled(selectedCount);
|
||||
mActionAddBCC->setEnabled(selectedCount);
|
||||
mActionAddRecommend->setEnabled(selectedCount);
|
||||
|
||||
FriendSelectionWidget::IdType idType;
|
||||
ui.friendSelectionWidget->selectedId(idType);
|
||||
|
||||
mActionContactDetails->setEnabled(selectedCount == 1 && (idType == FriendSelectionWidget::IDTYPE_SSL || idType == FriendSelectionWidget::IDTYPE_GXS));
|
||||
}
|
||||
|
||||
void MessageComposer::addTo()
|
||||
{
|
||||
addContact(TO);
|
||||
|
@ -2613,35 +2631,37 @@ void MessageComposer::addRecommend()
|
|||
ui.msgText->setFocus(Qt::OtherFocusReason);
|
||||
}
|
||||
|
||||
void MessageComposer::friendDetails()
|
||||
void MessageComposer::contactDetails()
|
||||
{
|
||||
FriendSelectionWidget::IdType idType;
|
||||
std::string id = ui.friendSelectionWidget->selectedId(idType);
|
||||
|
||||
if (id.empty() || idType != FriendSelectionWidget::IDTYPE_SSL) {
|
||||
if (id.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ConfCertDialog::showIt(RsPeerId(id), ConfCertDialog::PageDetails);
|
||||
}
|
||||
switch (idType) {
|
||||
case FriendSelectionWidget::IDTYPE_NONE:
|
||||
case FriendSelectionWidget::IDTYPE_GROUP:
|
||||
case FriendSelectionWidget::IDTYPE_GPG:
|
||||
break;
|
||||
case FriendSelectionWidget::IDTYPE_SSL:
|
||||
ConfCertDialog::showIt(RsPeerId(id), ConfCertDialog::PageDetails);
|
||||
break;
|
||||
case FriendSelectionWidget::IDTYPE_GXS:
|
||||
{
|
||||
if (RsGxsGroupId(id).isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
void MessageComposer::identityDetails()
|
||||
{
|
||||
FriendSelectionWidget::IdType idType;
|
||||
std::string id = ui.friendSelectionWidget->selectedId(idType);
|
||||
IdDetailsDialog *dialog = new IdDetailsDialog(RsGxsGroupId(id));
|
||||
dialog->show();
|
||||
|
||||
if (id.empty() || idType != FriendSelectionWidget::IDTYPE_GXS) {
|
||||
return;
|
||||
/* Dialog will destroy itself */
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (RsGxsGroupId(id).isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
IdDetailsDialog *dialog = new IdDetailsDialog(RsGxsGroupId(id));
|
||||
dialog->show();
|
||||
|
||||
/* Dialog will destroy itself */
|
||||
}
|
||||
|
||||
void MessageComposer::tagAboutToShow()
|
||||
|
|
|
@ -97,7 +97,6 @@ protected:
|
|||
private slots:
|
||||
/* toggle Contacts DockWidget */
|
||||
void contextMenuFileList(QPoint);
|
||||
void contextMenuMsgSendList(QPoint);
|
||||
void pasteRecommended();
|
||||
void on_contactsdockWidget_visibilityChanged(bool visible);
|
||||
void toggleContacts();
|
||||
|
@ -153,10 +152,10 @@ private slots:
|
|||
void addBcc();
|
||||
void addRecommend();
|
||||
void editingRecipientFinished();
|
||||
void friendDetails();
|
||||
void identityDetails();
|
||||
void contactDetails();
|
||||
|
||||
void peerStatusChanged(const QString& peer_id, int status);
|
||||
void friendSelectionChanged();
|
||||
|
||||
void tagAboutToShow();
|
||||
void tagSet(int tagId, bool set);
|
||||
|
@ -179,6 +178,7 @@ private:
|
|||
void setupViewActions();
|
||||
void setupInsertActions();
|
||||
void setupFormatActions();
|
||||
void setupContactActions();
|
||||
|
||||
bool load(const QString &f);
|
||||
bool maybeSave();
|
||||
|
@ -222,6 +222,11 @@ private:
|
|||
*actionUpperRoman;
|
||||
|
||||
QAction *contactSidebarAction;
|
||||
QAction *mActionAddTo;
|
||||
QAction *mActionAddCC;
|
||||
QAction *mActionAddBCC;
|
||||
QAction *mActionAddRecommend;
|
||||
QAction *mActionContactDetails;
|
||||
|
||||
QTreeView *channelstreeView;
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "notifyqt.h"
|
||||
#include <retroshare/rsnotify.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rsidentity.h>
|
||||
#include <util/rsdir.h>
|
||||
|
||||
#include "RsAutoUpdatePage.h"
|
||||
|
@ -862,28 +863,23 @@ void NotifyQt::UpdateGUI()
|
|||
case RS_POPUP_CHATLOBBY:
|
||||
if ((popupflags & RS_POPUP_CHATLOBBY) && !_disableAllToaster)
|
||||
{
|
||||
if(RsPeerId::SIZE_IN_BYTES < sizeof(ChatLobbyId))
|
||||
{
|
||||
std::cerr << "NotifyQt::UpdateGUI() Error: ChatLobbyId does not fit into a RsPeerId, this should not happen!" << std::endl;
|
||||
break;
|
||||
}
|
||||
RsPeerId vpid(id); // create virtual peer id
|
||||
ChatLobbyId lobby_id;
|
||||
// copy first bytes of virtual peer id, to make a chat lobby id
|
||||
memcpy(&lobby_id, vpid.toByteArray(), sizeof(ChatLobbyId));
|
||||
ChatLobbyId lobby_id;
|
||||
if(!rsMsgs->isLobbyId(RsPeerId(id), lobby_id))
|
||||
break;
|
||||
|
||||
ChatDialog *chatDialog = ChatDialog::getChat(ChatId(lobby_id));
|
||||
ChatWidget *chatWidget;
|
||||
ChatDialog *chatDialog = ChatDialog::getChat(ChatId(lobby_id));
|
||||
ChatWidget *chatWidget;
|
||||
if (chatDialog && (chatWidget = chatDialog->getChatWidget()) && chatWidget->isActive()) {
|
||||
// do not show when active
|
||||
break;
|
||||
}
|
||||
ChatLobbyDialog *chatLobbyDialog = dynamic_cast<ChatLobbyDialog*>(chatDialog);
|
||||
|
||||
if (!chatLobbyDialog || chatLobbyDialog->isParticipantMuted(RsGxsId(title)))
|
||||
RsGxsId sender(title);
|
||||
if (!chatLobbyDialog || chatLobbyDialog->isParticipantMuted(sender))
|
||||
break; // participant is muted
|
||||
|
||||
toaster = new ToasterItem(new ChatLobbyToaster(lobby_id, QString::fromUtf8(title.c_str()), QString::fromUtf8(msg.c_str())));
|
||||
toaster = new ToasterItem(new ChatLobbyToaster(lobby_id, sender, QString::fromUtf8(msg.c_str())));
|
||||
}
|
||||
break;
|
||||
case RS_POPUP_CONNECT_ATTEMPT:
|
||||
|
@ -1002,8 +998,13 @@ void NotifyQt::testToasters(uint notifyFlags, /*RshareSettings::enumToasterPosit
|
|||
toaster = new ToasterItem(new GroupChatToaster(id, message));
|
||||
break;
|
||||
case RS_POPUP_CHATLOBBY:
|
||||
toaster = new ToasterItem(new ChatLobbyToaster(0, title, message));
|
||||
break;
|
||||
{
|
||||
std::list<RsGxsId> gxsid;
|
||||
if(rsIdentity->getOwnIds(gxsid) && (gxsid.size() > 0)){
|
||||
toaster = new ToasterItem(new ChatLobbyToaster(0, gxsid.front(), message));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case RS_POPUP_CONNECT_ATTEMPT:
|
||||
toaster = new ToasterItem(new FriendRequestToaster(pgpid, title, id));
|
||||
break;
|
||||
|
|
|
@ -3,21 +3,35 @@
|
|||
</style>
|
||||
|
||||
|
||||
<table class='bubble-red' width="100%" cellspacing='0' cellpadding='0'>
|
||||
<table width="100%" ><tr><td align="left">
|
||||
|
||||
<table class='bubble-orange' cellspacing='0' cellpadding='0' style='float:left;'>
|
||||
<tr>
|
||||
<td width="1%"><img src="%style-dir%/img/bubble-red/bubble_TL.png"></td>
|
||||
<td class='bubble-redTC' width="100%"></td>
|
||||
<td width="1%"><img src="%style-dir%/img/bubble-red/bubble_TR.png"></td>
|
||||
<td><img src="%style-dir%/img/bubble-orange/bubble_TL.png"></td>
|
||||
<td class='bubble-orangeTC'></td>
|
||||
<td><img src="%style-dir%/img/bubble-orange/bubble_TR.png"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='bubble-redCL' width="1%"></td>
|
||||
<td class='bubble-redCC' width="100%" align="center"> %name% %time% - %message%</td>
|
||||
<td class='bubble-redCR' width="1%"></td>
|
||||
<td class='bubble-orangeCL'></td>
|
||||
<td class='bubble-orangeCC'>
|
||||
%message%
|
||||
</td>
|
||||
<td class='bubble-orangeCR'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="1%"><img src="%style-dir%/img/bubble-red/bubble_BL.png"></td>
|
||||
<td class='bubble-redBC' width="100%"></td>
|
||||
<td width="1%"><img src="%style-dir%/img/bubble-red/bubble_BR.png"></td>
|
||||
<td><img src="%style-dir%/img/bubble-orange/bubble_BL.png"></td>
|
||||
<td class='bubble-orangeBC'><img src="%style-dir%/img/bubble-orange/bubble_tick.png"></td>
|
||||
<td><img src="%style-dir%/img/bubble-orange/bubble_BR.png"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class='bubbleFooter' width='100%'>
|
||||
<tr>
|
||||
<td align='left'>
|
||||
<span class='name'> %name% - </span>
|
||||
<span width='130' align='right' class='time'>%time%</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td></tr></table>
|
||||
|
|
|
@ -3,21 +3,35 @@
|
|||
</style>
|
||||
|
||||
|
||||
<table class='bubble-red' width="100%" cellspacing='0' cellpadding='0'>
|
||||
<table width="100%" ><tr><td align="left">
|
||||
|
||||
<table class='bubble-orange' cellspacing='0' cellpadding='0' style='float:left;'>
|
||||
<tr>
|
||||
<td width="1%"><img src="%style-dir%/img/bubble-red/bubble_TL.png"></td>
|
||||
<td class='bubble-redTC' width="100%"></td>
|
||||
<td width="1%"><img src="%style-dir%/img/bubble-red/bubble_TR.png"></td>
|
||||
<td><img src="%style-dir%/img/bubble-orange/bubble_TL.png"></td>
|
||||
<td class='bubble-orangeTC'></td>
|
||||
<td><img src="%style-dir%/img/bubble-orange/bubble_TR.png"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='bubble-redCL' width="1%"></td>
|
||||
<td class='bubble-redCC' width="100%" align="center"> %name% %time% - %message%</td>
|
||||
<td class='bubble-redCR' width="1%"></td>
|
||||
<td class='bubble-orangeCL'></td>
|
||||
<td class='bubble-orangeCC'>
|
||||
%message%
|
||||
</td>
|
||||
<td class='bubble-orangeCR'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="1%"><img src="%style-dir%/img/bubble-red/bubble_BL.png"></td>
|
||||
<td class='bubble-redBC' width="100%"></td>
|
||||
<td width="1%"><img src="%style-dir%/img/bubble-red/bubble_BR.png"></td>
|
||||
<td><img src="%style-dir%/img/bubble-orange/bubble_BL.png"></td>
|
||||
<td class='bubble-orangeBC'><img src="%style-dir%/img/bubble-orange/bubble_tick.png"></td>
|
||||
<td><img src="%style-dir%/img/bubble-orange/bubble_BR.png"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class='bubbleFooter' width='100%'>
|
||||
<tr>
|
||||
<td align='left'>
|
||||
<span class='name'> %name% - </span>
|
||||
<span width='130' align='right' class='time'>%time%</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td></tr></table>
|
||||
|
|