Merged branch for GUI improvements into trunk. The improvement phase is not finsihed yet. The work on GUI will continue into trunk

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6138 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-02-22 21:42:27 +00:00
parent c23cfd4a0f
commit 50db473329
46 changed files with 2536 additions and 2984 deletions

View File

@ -3,6 +3,7 @@
#include <QMessageBox> #include <QMessageBox>
#include "ChatLobbyWidget.h" #include "ChatLobbyWidget.h"
#include "chat/CreateLobbyDialog.h" #include "chat/CreateLobbyDialog.h"
#include "chat/ChatTabWidget.h"
#include "common/RSTreeWidgetItem.h" #include "common/RSTreeWidgetItem.h"
#include "notifyqt.h" #include "notifyqt.h"
#include "chat/ChatLobbyDialog.h" #include "chat/ChatLobbyDialog.h"
@ -40,6 +41,12 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WFlags flags)
QObject::connect(NotifyQt::getInstance(), SIGNAL(chatLobbyEvent(qulonglong,int,const QString&,const QString&)), this, SLOT(displayChatLobbyEvent(qulonglong,int,const QString&,const QString&))); QObject::connect(NotifyQt::getInstance(), SIGNAL(chatLobbyEvent(qulonglong,int,const QString&,const QString&)), this, SLOT(displayChatLobbyEvent(qulonglong,int,const QString&,const QString&)));
QObject::connect(NotifyQt::getInstance(), SIGNAL(chatLobbyInviteReceived()), this, SLOT(readChatLobbyInvites())); QObject::connect(NotifyQt::getInstance(), SIGNAL(chatLobbyInviteReceived()), this, SLOT(readChatLobbyInvites()));
lobbyTreeWidget = new QTreeWidget ;
getTabWidget()->addTab(lobbyTreeWidget,tr("Lobby list")) ;
layout()->addWidget( getTabWidget() ) ;
layout()->update() ;
QObject::connect(lobbyTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(lobbyTreeWidgetCostumPopupMenu())); QObject::connect(lobbyTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(lobbyTreeWidgetCostumPopupMenu()));
QObject::connect(lobbyTreeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*,int))); QObject::connect(lobbyTreeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*,int)));
@ -349,6 +356,13 @@ void ChatLobbyWidget::itemDoubleClicked(QTreeWidgetItem *item, int /*column*/)
subscribeLobby(item); subscribeLobby(item);
} }
ChatTabWidget *ChatLobbyWidget::getTabWidget()
{
static ChatTabWidget *instance = new ChatTabWidget() ;
return instance ;
}
void ChatLobbyWidget::displayChatLobbyEvent(qulonglong lobby_id, int event_type, const QString& nickname, const QString& str) void ChatLobbyWidget::displayChatLobbyEvent(qulonglong lobby_id, int event_type, const QString& nickname, const QString& str)
{ {
std::cerr << "Received displayChatLobbyEvent()!" << std::endl; std::cerr << "Received displayChatLobbyEvent()!" << std::endl;

View File

@ -1,9 +1,11 @@
#pragma once #pragma once
#include <QTreeWidget>
#include "ui_ChatLobbyWidget.h" #include "ui_ChatLobbyWidget.h"
#include "RsAutoUpdatePage.h" #include "RsAutoUpdatePage.h"
class RSTreeWidgetItemCompareRole; class RSTreeWidgetItemCompareRole;
class ChatTabWidget ;
class ChatLobbyWidget : public RsAutoUpdatePage, Ui::ChatLobbyWidget class ChatLobbyWidget : public RsAutoUpdatePage, Ui::ChatLobbyWidget
{ {
@ -18,6 +20,7 @@ public:
virtual void updateDisplay(); virtual void updateDisplay();
static ChatTabWidget *getTabWidget() ;
protected slots: protected slots:
void lobbyChanged(); void lobbyChanged();
void lobbyTreeWidgetCostumPopupMenu(); void lobbyTreeWidgetCostumPopupMenu();
@ -32,4 +35,7 @@ private:
RSTreeWidgetItemCompareRole *compareRole; RSTreeWidgetItemCompareRole *compareRole;
QTreeWidgetItem *privateLobbyItem; QTreeWidgetItem *privateLobbyItem;
QTreeWidgetItem *publicLobbyItem; QTreeWidgetItem *publicLobbyItem;
ChatTabWidget *tabWidget ;
QTreeWidget *lobbyTreeWidget ;
}; };

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>608</width> <width>608</width>
<height>397</height> <height>188</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
@ -89,40 +89,6 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QTreeWidget" name="lobbyTreeWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="itemsExpandable">
<bool>false</bool>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<property name="expandsOnDoubleClick">
<bool>false</bool>
</property>
<property name="columnCount">
<number>0</number>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources> <resources>

View File

@ -20,11 +20,15 @@
****************************************************************/ ****************************************************************/
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QClipboard>
#include "DetailsDialog.h" #include "DetailsDialog.h"
#include "TransfersDialog.h" #include "TransfersDialog.h"
#include "retroshare/rsfiles.h"
#include "util/misc.h" #include "util/misc.h"
#include "FileTransferInfoWidget.h"
#include "RetroShareLink.h"
/** Default constructor */ /** Default constructor */
DetailsDialog::DetailsDialog(QWidget *parent, Qt::WFlags flags) DetailsDialog::DetailsDialog(QWidget *parent, Qt::WFlags flags)
@ -41,34 +45,44 @@ DetailsDialog::DetailsDialog(QWidget *parent, Qt::WFlags flags)
CommentsModel->setHeaderData(1, Qt::Horizontal, tr("Comments")); CommentsModel->setHeaderData(1, Qt::Horizontal, tr("Comments"));
CommentsModel->setHeaderData(2, Qt::Horizontal, tr("File Name")); CommentsModel->setHeaderData(2, Qt::Horizontal, tr("File Name"));
ui.commentsTreeView->setModel(CommentsModel); //ui.commentsTreeView->setModel(CommentsModel);
ui.commentsTreeView->setSortingEnabled(true); //ui.commentsTreeView->setSortingEnabled(true);
ui.commentsTreeView->setRootIsDecorated(false); //ui.commentsTreeView->setRootIsDecorated(false);
/* Set header resize modes and initial section sizes */ /* Set header resize modes and initial section sizes */
QHeaderView * _coheader = ui.commentsTreeView->header(); //QHeaderView * _coheader = ui.commentsTreeView->header();
_coheader->setResizeMode ( 0, QHeaderView::Custom); //_coheader->setResizeMode ( 0, QHeaderView::Custom);
_coheader->resizeSection ( 0, 100 ); //_coheader->resizeSection ( 0, 100 );
_coheader->resizeSection ( 1, 240 ); //_coheader->resizeSection ( 1, 240 );
_coheader->resizeSection ( 2, 100 ); //_coheader->resizeSection ( 2, 100 );
FileTransferInfoWidget *ftiw = new FileTransferInfoWidget();
ui.fileTransferInfoWidget->setWidget(ftiw);
ui.fileTransferInfoWidget->setWidgetResizable(true);
ui.fileTransferInfoWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
ui.fileTransferInfoWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
ui.fileTransferInfoWidget->viewport()->setBackgroundRole(QPalette::NoRole);
ui.fileTransferInfoWidget->setFrameStyle(QFrame::NoFrame);
ui.fileTransferInfoWidget->setFocusPolicy(Qt::NoFocus);
setAttribute(Qt::WA_DeleteOnClose,false) ;
connect(ui.copylinkdetailsButton,SIGNAL(clicked()),this,SLOT(copyLink())) ;
} }
/** Destructor. */ void DetailsDialog::copyLink()
DetailsDialog::~DetailsDialog()
{ {
TransfersDialog::detailsdlg = NULL; QApplication::clipboard()->setText( ui.Linktext->toPlainText() );
} }
void DetailsDialog::on_ok_dButton_clicked() void DetailsDialog::on_ok_dButton_clicked()
{ {
QDialog::close(); QDialog::hide();
} }
void DetailsDialog::on_cancel_dButton_clicked() void DetailsDialog::on_cancel_dButton_clicked()
{ {
//reject(); //reject();
QDialog::close(); QDialog::hide();
} }
@ -85,101 +99,17 @@ DetailsDialog::show()
} }
} }
void DetailsDialog::closeEvent (QCloseEvent * event) void DetailsDialog::setFileHash(const std::string & hash)
{ {
QWidget::closeEvent(event); dynamic_cast<FileTransferInfoWidget*>(ui.fileTransferInfoWidget->widget())->setFileHash(hash) ;
FileInfo nfo ;
if(!rsFiles->FileDetails(hash, RS_FILE_HINTS_DOWNLOAD, nfo))
return ;
RetroShareLink link ;
link.createFile(QString::fromStdString(nfo.fname),nfo.size,QString::fromStdString(nfo.hash)) ;
ui.Linktext->setText(link.toString()) ;
} }
void DetailsDialog::setFileName(const QString & filename)
{
int c;
QModelIndex index;
c = CommentsModel->rowCount();
CommentsModel->removeRows(0,c);
c = CommentsModel->rowCount();
CommentsModel->insertRow(c);
index = CommentsModel->index(c, 0);
CommentsModel->setData(index, tr("Not Rated"));
index = CommentsModel->index(c, 1);
CommentsModel->setData(index, tr("No Comments"));
index = CommentsModel->index(c, 2);
CommentsModel->setData(index, filename);
ui.name_label_2->setText(filename);
}
void DetailsDialog::setHash(const QString & hash)
{
ui.hash_label_2->setText(hash);
}
void DetailsDialog::setSize(const qulonglong & size)
{
ui.size_label_2->setText(misc::friendlyUnit(size) + " " + "(" + QString::number(size) + " " + "Bytes" + ")");
}
void DetailsDialog::setStatus(const QString & status)
{
ui.status_label_2->setText(status);
}
void DetailsDialog::setPriority(const QString & priority)
{
ui.priority_label_2->setText(priority);
}
void DetailsDialog::setType(const QString & type)
{
ui.type_label_2->setText(type);
}
void DetailsDialog::setSources(const QString & sources)
{
ui.sources_line->setText(sources);
}
void DetailsDialog::setDatarate(const double & datarate)
{
QString temp;
temp.clear();
temp.sprintf("%.2f", datarate/1024.);
temp += " KB/s";
ui.datarate_line->setText(temp);
}
void DetailsDialog::setCompleted(const QString & completed)
{
ui.completed_line->setText(completed);
}
void DetailsDialog::setRemaining(const QString & remaining)
{
ui.remaining_line->setText(remaining);
}
void DetailsDialog::setDownloadtime(const QString & downloadtime)
{
ui.downloadtime_line->setText(downloadtime);
}
void DetailsDialog::setLink(const QString & link)
{
ui.Linktext->setText(link);
}
void DetailsDialog::setChunkSize(uint32_t chunksize)
{
ui.chunksizelabel->setText(misc::friendlyUnit(chunksize));
}
void DetailsDialog::setNumberOfChunks(size_t numberofchunks)
{
ui.numberofchunkslabel->setText(QString::number(numberofchunks));
}

View File

@ -35,32 +35,14 @@ public:
/** Default constructor */ /** Default constructor */
DetailsDialog(QWidget *parent = 0, Qt::WFlags flags = 0); DetailsDialog(QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default destructor */ /** Default destructor */
~DetailsDialog(); ~DetailsDialog() {}
void setFileHash(const std::string& hash) { _file_hash = hash ; } void setFileHash(const std::string& hash) ;
public slots: public slots:
/** Overloaded QWidget.show */ /** Overloaded QWidget.show */
void show(); void show();
void copyLink() ;
void setFileName(const QString & filename);
void setHash(const QString & hash);
void setLink(const QString & link);
void setSize(const qulonglong & size);
void setStatus(const QString & status);
void setPriority(const QString & priority);
void setSources(const QString & sources);
void setDatarate(const double & datarate);
void setCompleted(const QString & completed);
void setRemaining(const QString & remaining) ;
void setDownloadtime(const QString & downloadtime);
void setType(const QString & type);
void setChunkSize(const uint32_t chunksize);
void setNumberOfChunks(const size_t numberofchunks);
protected:
void closeEvent (QCloseEvent * event);
private slots: private slots:
void on_ok_dButton_clicked(); void on_ok_dButton_clicked();

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>525</width> <width>787</width>
<height>477</height> <height>644</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -21,348 +21,143 @@
<item row="0" column="0" colspan="3"> <item row="0" column="0" colspan="3">
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tabGeneral"> <widget class="QWidget" name="tabGeneral">
<attribute name="icon"> <attribute name="icon">
<iconset resource="images.qrc"> <iconset resource="images.qrc">
<normaloff>:/images/fileinfo.png</normaloff>:/images/fileinfo.png</iconset> <normaloff>:/images/blockdevice.png</normaloff>:/images/blockdevice.png</iconset>
</attribute> </attribute>
<attribute name="title"> <attribute name="title">
<string>General</string> <string>General</string>
</attribute> </attribute>
<layout class="QGridLayout"> <layout class="QGridLayout">
<item row="1" column="0">
<layout class="QGridLayout" name="_2">
<property name="margin">
<number>6</number>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QGroupBox" name="genralgroupBox"> <layout class="QGridLayout" name="_3">
<property name="title">
<string>General</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="name_label"> <widget class="QLabel" name="label_3">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text"> <property name="text">
<string>File Name:</string> <string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/graph-downloaded.png</pixmap>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="name_label_2"> <widget class="QLabel" name="label_5">
<property name="text"> <property name="text">
<string notr="true">Name Label</string> <string>Done</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="0" column="2" rowspan="7">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>336</width>
<height>98</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="hash_label">
<property name="maximumSize">
<size>
<width>1677215</width>
<height>16777215</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Hash:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="size_label">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Size:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="size_label_2">
<property name="text">
<string notr="true">Size Label</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="status_label">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Status:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="status_label_2">
<property name="text">
<string notr="true">Status Label</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="priority_label">
<property name="text">
<string>Priority:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="priority_label_2">
<property name="text">
<string notr="true">Priority Label</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse</set>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="type_label_2">
<property name="text">
<string notr="true">Type Label</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="type_label">
<property name="text">
<string>Type:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="hash_label_2">
<property name="text">
<string notr="true">Hash Label</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
<item row="1" column="0"> <item row="0" column="1">
<widget class="QGroupBox" name="groupBox_2"> <layout class="QGridLayout" name="_4">
<property name="title">
<string>Transfer</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="sources_label"> <widget class="QLabel" name="label_6">
<property name="text"> <property name="text">
<string>Sources:</string> <string/>
</property> </property>
</widget> <property name="pixmap">
</item> <pixmap resource="images.qrc">:/images/graph-downloading.png</pixmap>
<item row="1" column="0">
<widget class="QLabel" name="datarate_label">
<property name="text">
<string>Datarate:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="completed_label">
<property name="text">
<string>Completed:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="sources_line"> <widget class="QLabel" name="label_7">
<property name="text"> <property name="text">
<string notr="true">Source Label</string> <string>Active</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="datarate_line">
<property name="text">
<string notr="true">Datarate Label</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="completed_line">
<property name="text">
<string notr="true">Completed Label</string>
</property>
</widget>
</item>
<item row="0" column="2" rowspan="7">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QLabel" name="chunksizelabel">
<property name="text">
<string notr="true">Chunks Label</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Chunk size:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="numberofchunkslabel">
<property name="toolTip">
<string>Number of Chunks</string>
</property>
<property name="text">
<string notr="true">Chunks Number Label</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_2">
<property name="toolTip">
<string>Number of Chunks</string>
</property>
<property name="text">
<string>Chunks:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="remaining_line">
<property name="text">
<string notr="true">Remaining Label</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="remaining_label">
<property name="text">
<string>Remaining:</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
<item row="2" column="0"> <item row="0" column="3">
<widget class="QGroupBox" name="groupBox_3"> <layout class="QGridLayout" name="_5">
<property name="title">
<string>Date</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Download time:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="downloadtime_line">
<property name="text">
<string notr="true">Download Time Label</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>274</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabComments">
<attribute name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/filecomments.png</normaloff>:/images/filecomments.png</iconset>
</attribute>
<attribute name="title">
<string>Comments</string>
</attribute>
<layout class="QGridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QTreeView" name="commentsTreeView"/> <widget class="QLabel" name="label_8">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/graph-notdownload.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Outstanding</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="4">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>368</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/graph-checking.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string>Needs checking</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QScrollArea" name="fileTransferInfoWidget">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>747</width>
<height>505</height>
</rect>
</property>
</widget>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -374,37 +169,24 @@
<item row="0" column="0" colspan="2"> <item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>retroshare link(s)</string> <string>retroshare link</string>
</property> </property>
<layout class="QGridLayout"> <layout class="QGridLayout">
<item row="0" column="0"> <item row="1" column="0">
<widget class="QTextEdit" name="Linktext"/> <widget class="QTextEdit" name="Linktext"/>
</item> </item>
</layout> <item row="0" column="0">
</widget>
</item>
<item row="1" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>351</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="copylinkdetailsButton"> <widget class="QPushButton" name="copylinkdetailsButton">
<property name="text"> <property name="text">
<string>Copy</string> <string>Copy link to clipboard</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">

View File

@ -28,6 +28,7 @@
#include <retroshare/rstypes.h> #include <retroshare/rstypes.h>
#include "util/misc.h" #include "util/misc.h"
#include "FileTransferInfoWidget.h" #include "FileTransferInfoWidget.h"
#include "RetroShareLink.h"
// Variables to decide of display behaviour. Should be adapted to window size. // Variables to decide of display behaviour. Should be adapted to window size.
// //
@ -110,7 +111,7 @@ void FileTransferInfoWidget::paintEvent(QPaintEvent */*event*/)
void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info,QPainter *painter) void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info,QPainter *painter)
{ {
x=0; x=0;
y=0; y=5;
int blocks = info.chunks.size() ; int blocks = info.chunks.size() ;
uint64_t fileSize = info.file_size ; uint64_t fileSize = info.file_size ;
uint32_t blockSize = info.chunk_size ; uint32_t blockSize = info.chunk_size ;
@ -240,10 +241,11 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
// various info: // various info:
// //
painter->setPen(QColor::fromRgb(0,0,0)) ; painter->setPen(QColor::fromRgb(0,0,0)) ;
y += text_height ; painter->drawText(0,y,tr("File info") + ":") ; y += text_height ; painter->drawText(0,y,tr("File info") + ":") ;
y += block_sep ; y += block_sep ;
y += text_height ; painter->drawText(20,y,tr("File name") + ":") ; painter->drawText(tab_size,y,QString::fromStdString(nfo.fname)) ;
y += block_sep ;
y += text_height ; painter->drawText(20,y,tr("File hash") + ":") ; painter->drawText(tab_size,y,QString::fromStdString(nfo.hash)) ; y += text_height ; painter->drawText(20,y,tr("File hash") + ":") ; painter->drawText(tab_size,y,QString::fromStdString(nfo.hash)) ;
y += block_sep ; y += block_sep ;
y += text_height ; painter->drawText(20,y,tr("File size") + ":") ; painter->drawText(tab_size,y,QString::number(info.file_size) + " " + tr("bytes") + " " + "(" + misc::friendlyUnit(info.file_size) + ")") ; y += text_height ; painter->drawText(20,y,tr("File size") + ":") ; painter->drawText(tab_size,y,QString::number(info.file_size) + " " + tr("bytes") + " " + "(" + misc::friendlyUnit(info.file_size) + ")") ;

View File

@ -42,7 +42,6 @@
#include "im_history/ImHistoryBrowser.h" #include "im_history/ImHistoryBrowser.h"
#include "MainWindow.h" #include "MainWindow.h"
#include "NewsFeed.h" #include "NewsFeed.h"
#include "ChatLobbyWidget.h"
#include "notifyqt.h" #include "notifyqt.h"
#include "profile/ProfileWidget.h" #include "profile/ProfileWidget.h"
#include "profile/StatusMessage.h" #include "profile/StatusMessage.h"
@ -51,14 +50,17 @@
#include "util/misc.h" #include "util/misc.h"
#include "util/HandleRichText.h" #include "util/HandleRichText.h"
#include "util/DateTime.h" #include "util/DateTime.h"
#include "chat/CreateLobbyDialog.h"
#include "FriendRecommendDialog.h" #include "FriendRecommendDialog.h"
#include "FriendsDialog.h" #include "FriendsDialog.h"
#include "ServicePermissionDialog.h" #include "ServicePermissionDialog.h"
#include "NetworkView.h"
#include "NetworkDialog.h"
/* Images for Newsfeed icons */ /* Images for Newsfeed icons */
#define IMAGE_NEWSFEED "" #define IMAGE_NEWSFEED ""
#define IMAGE_NEWSFEED_NEW ":/images/message-state-new.png" #define IMAGE_NEWSFEED_NEW ":/images/message-state-new.png"
#define IMAGE_NETWORK2 ":/images/rs1.png"
#define IMAGE_PEERS ":/images/groupchat.png"
/****** /******
* #define FRIENDS_DEBUG 1 * #define FRIENDS_DEBUG 1
@ -85,7 +87,6 @@ FriendsDialog::FriendsDialog(QWidget *parent)
connect( ui.actionSet_your_Personal_Message, SIGNAL(triggered()), this, SLOT(statusmessage())); connect( ui.actionSet_your_Personal_Message, SIGNAL(triggered()), this, SLOT(statusmessage()));
connect( ui.addfileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile())); connect( ui.addfileButton, SIGNAL(clicked() ), this , SLOT(addExtraFile()));
connect( ui.actionAdd_Friend, SIGNAL(triggered()), this, SLOT(addFriend())); connect( ui.actionAdd_Friend, SIGNAL(triggered()), this, SLOT(addFriend()));
connect( ui.actionCreate_new_Chat_lobby, SIGNAL(triggered()), this, SLOT(createChatLobby()));
connect( ui.actionFriendRecommendations, SIGNAL(triggered()), this, SLOT(recommendFriends())); connect( ui.actionFriendRecommendations, SIGNAL(triggered()), this, SLOT(recommendFriends()));
connect( ui.actionServicePermission, SIGNAL(triggered()), this, SLOT(servicePermission())); connect( ui.actionServicePermission, SIGNAL(triggered()), this, SLOT(servicePermission()));
connect( ui.filter_lineEdit, SIGNAL(textChanged(QString)), ui.friendList, SLOT(filterItems(QString))); connect( ui.filter_lineEdit, SIGNAL(textChanged(QString)), ui.friendList, SLOT(filterItems(QString)));
@ -97,11 +98,13 @@ FriendsDialog::FriendsDialog(QWidget *parent)
ui.avatar->setOwnId(); ui.avatar->setOwnId();
ui.tabWidget->setTabPosition(QTabWidget::North); ui.tabWidget->setTabPosition(QTabWidget::North);
ui.tabWidget->addTab(new ChatLobbyWidget(), tr("Chat lobbies")); ui.tabWidget->addTab(networkView = new NetworkView(),QIcon(IMAGE_NETWORK2), tr("Local network"));
ui.tabWidget->addTab(new ProfileWidget(), tr("Profile")); ui.tabWidget->addTab(networkDialog = new NetworkDialog(),QIcon(IMAGE_PEERS), tr("Known people"));
newsFeed = new NewsFeed();
int newsFeedTabIndex = ui.tabWidget->insertTab(0, newsFeed, tr("News Feed")); //ui.tabWidget->addTab(new ProfileWidget(), tr("Profile"));
ui.tabWidget->setCurrentIndex(newsFeedTabIndex); //newsFeed = new NewsFeed();
//int newsFeedTabIndex = ui.tabWidget->insertTab(0, newsFeed, tr("News Feed"));
//ui.tabWidget->setCurrentIndex(newsFeedTabIndex);
ui.tabWidget->hideCloseButton(0); ui.tabWidget->hideCloseButton(0);
ui.tabWidget->hideCloseButton(1); ui.tabWidget->hideCloseButton(1);
@ -109,10 +112,10 @@ FriendsDialog::FriendsDialog(QWidget *parent)
ui.tabWidget->hideCloseButton(3); ui.tabWidget->hideCloseButton(3);
/* get the current text and text color of the tab bar */ /* get the current text and text color of the tab bar */
newsFeedTabColor = ui.tabWidget->tabBar()->tabTextColor(newsFeedTabIndex); //newsFeedTabColor = ui.tabWidget->tabBar()->tabTextColor(newsFeedTabIndex);
newsFeedText = ui.tabWidget->tabBar()->tabText(newsFeedTabIndex); //newsFeedText = ui.tabWidget->tabBar()->tabText(newsFeedTabIndex);
connect(newsFeed, SIGNAL(newsFeedChanged(int)), this, SLOT(newsFeedChanged(int))); //connect(newsFeed, SIGNAL(newsFeedChanged(int)), this, SLOT(newsFeedChanged(int)));
connect(ui.Sendbtn, SIGNAL(clicked()), this, SLOT(sendMsg())); connect(ui.Sendbtn, SIGNAL(clicked()), this, SLOT(sendMsg()));
connect(ui.emoticonBtn, SIGNAL(clicked()), this, SLOT(smileyWidgetgroupchat())); connect(ui.emoticonBtn, SIGNAL(clicked()), this, SLOT(smileyWidgetgroupchat()));
@ -849,29 +852,23 @@ void FriendsDialog::on_actionAdd_Group_activated()
createGrpDialog.exec(); createGrpDialog.exec();
} }
void FriendsDialog::newsFeedChanged(int count) // void FriendsDialog::newsFeedChanged(int count)
{ // {
int newsFeedTabIndex = ui.tabWidget->indexOf(newsFeed); // int newsFeedTabIndex = ui.tabWidget->indexOf(newsFeed);
if (newsFeedTabIndex < 0) { // if (newsFeedTabIndex < 0) {
return; // return;
} // }
//
if (count) { // if (count) {
ui.tabWidget->tabBar()->setTabText(newsFeedTabIndex, QString("%1 (%2)").arg(newsFeedText).arg(count)); // ui.tabWidget->tabBar()->setTabText(newsFeedTabIndex, QString("%1 (%2)").arg(newsFeedText).arg(count));
ui.tabWidget->tabBar()->setTabTextColor(newsFeedTabIndex, Qt::blue); // ui.tabWidget->tabBar()->setTabTextColor(newsFeedTabIndex, Qt::blue);
ui.tabWidget->tabBar()->setTabIcon(newsFeedTabIndex, QIcon(IMAGE_NEWSFEED_NEW)); // ui.tabWidget->tabBar()->setTabIcon(newsFeedTabIndex, QIcon(IMAGE_NEWSFEED_NEW));
} else { // } else {
ui.tabWidget->tabBar()->setTabText(newsFeedTabIndex, newsFeedText); // ui.tabWidget->tabBar()->setTabText(newsFeedTabIndex, newsFeedText);
ui.tabWidget->tabBar()->setTabTextColor(newsFeedTabIndex, newsFeedTabColor); // ui.tabWidget->tabBar()->setTabTextColor(newsFeedTabIndex, newsFeedTabColor);
ui.tabWidget->tabBar()->setTabIcon(newsFeedTabIndex, QIcon(IMAGE_NEWSFEED)); // ui.tabWidget->tabBar()->setTabIcon(newsFeedTabIndex, QIcon(IMAGE_NEWSFEED));
} // }
} // }
void FriendsDialog::createChatLobby()
{
std::list<std::string> friends;
CreateLobbyDialog(friends).exec();
}
void FriendsDialog::recommendFriends() void FriendsDialog::recommendFriends()
{ {
@ -884,11 +881,6 @@ void FriendsDialog::servicePermission()
dlg.exec(); dlg.exec();
} }
/*static*/ ChatTabWidget *FriendsDialog::getTabWidget()
{
return instance ? instance->ui.tabWidget : NULL;
}
/*static*/ bool FriendsDialog::isGroupChatActive() /*static*/ bool FriendsDialog::isGroupChatActive()
{ {
FriendsDialog *friendsDialog = dynamic_cast<FriendsDialog*>(MainWindow::getPage(MainWindow::Friends)); FriendsDialog *friendsDialog = dynamic_cast<FriendsDialog*>(MainWindow::getPage(MainWindow::Friends));

View File

@ -32,6 +32,8 @@ class QAction;
class QTextEdit; class QTextEdit;
class QTextCharFormat; class QTextCharFormat;
class ChatTabWidget; class ChatTabWidget;
class NetworkDialog;
class NetworkView;
class FriendsDialog : public RsAutoUpdatePage class FriendsDialog : public RsAutoUpdatePage
{ {
@ -47,10 +49,11 @@ public:
virtual void updateDisplay() ; // overloaded from RsAutoUpdatePage virtual void updateDisplay() ; // overloaded from RsAutoUpdatePage
static ChatTabWidget *getTabWidget();
static bool isGroupChatActive(); static bool isGroupChatActive();
static void groupChatActivate(); static void groupChatActivate();
NetworkDialog *networkDialog ;
NetworkView *networkView ;
public slots: public slots:
void publicChatChanged(int type); void publicChatChanged(int type);
@ -111,9 +114,8 @@ private slots:
void setCurrentFileName(const QString &fileName); void setCurrentFileName(const QString &fileName);
void newsFeedChanged(int count); //void newsFeedChanged(int count);
void createChatLobby();
void recommendFriends(); void recommendFriends();
void servicePermission(); void servicePermission();
@ -137,9 +139,9 @@ private:
QFont mCurrentFont; /* how the text will come out */ QFont mCurrentFont; /* how the text will come out */
QWidget *newsFeed; //QWidget *newsFeed;
QColor newsFeedTabColor; //QColor newsFeedTabColor;
QString newsFeedText; //QString newsFeedText;
bool inChatCharFormatChanged; bool inChatCharFormatChanged;
/** Qt Designer generated object */ /** Qt Designer generated object */

View File

@ -291,7 +291,7 @@
</property> </property>
<widget class="QWidget" name="groupChatTab"> <widget class="QWidget" name="groupChatTab">
<attribute name="title"> <attribute name="title">
<string>Group Chat</string> <string>Broadcast</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0"> <item row="1" column="0">

View File

@ -43,15 +43,16 @@
#include "SearchDialog.h" #include "SearchDialog.h"
#include "TransfersDialog.h" #include "TransfersDialog.h"
#include "MessagesDialog.h" #include "MessagesDialog.h"
#include "SharedFilesDialog.h" //#include "SharedFilesDialog.h"
#include "PluginsPage.h" #include "PluginsPage.h"
#include "NewsFeed.h"
#include "ShareManager.h" #include "ShareManager.h"
#include "NetworkView.h" #include "NetworkView.h"
#include "ForumsDialog.h" #include "ForumsDialog.h"
#include "FriendsDialog.h" #include "FriendsDialog.h"
#include "ChatLobbyWidget.h"
#include "HelpDialog.h" #include "HelpDialog.h"
#include "AboutDialog.h" #include "AboutDialog.h"
#include "QuickStartWizard.h"
#include "ChannelFeed.h" #include "ChannelFeed.h"
#include "bwgraph/bwgraph.h" #include "bwgraph/bwgraph.h"
#include "help/browser/helpbrowser.h" #include "help/browser/helpbrowser.h"
@ -118,9 +119,8 @@
/* Images for toolbar icons */ /* Images for toolbar icons */
#define IMAGE_NETWORK2 ":/images/rs1.png" //#define IMAGE_NETWORK2 ":/images/rs1.png"
#define IMAGE_PEERS ":/images/groupchat.png" #define IMAGE_PEERS ":/images/groupchat.png"
#define IMAGE_SEARCH ":/images/filefind.png"
#define IMAGE_TRANSFERS ":/images/ktorrent32.png" #define IMAGE_TRANSFERS ":/images/ktorrent32.png"
#define IMAGE_FILES ":/images/fileshare32.png" #define IMAGE_FILES ":/images/fileshare32.png"
#define IMAGE_CHANNELS ":/images/channels.png" #define IMAGE_CHANNELS ":/images/channels.png"
@ -238,22 +238,26 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
QActionGroup *grp = new QActionGroup(this); QActionGroup *grp = new QActionGroup(this);
QAction *action; QAction *action;
ui->stackPages->add(networkDialog = new NetworkDialog(ui->stackPages), ui->stackPages->add(newsFeed = new NewsFeed(ui->stackPages),
createPageAction(QIcon(IMAGE_NETWORK2), tr("Network"), grp)); createPageAction(QIcon(IMAGE_NEWSFEED), tr("News feed"), grp));
// ui->stackPages->add(networkDialog = new NetworkDialog(ui->stackPages),
// createPageAction(QIcon(IMAGE_NETWORK2), tr("Network"), grp));
ui->stackPages->add(friendsDialog = new FriendsDialog(ui->stackPages), ui->stackPages->add(friendsDialog = new FriendsDialog(ui->stackPages),
action = createPageAction(QIcon(IMAGE_PEERS), tr("Friends"), grp)); action = createPageAction(QIcon(IMAGE_PEERS), tr("Friends"), grp));
notify.push_back(QPair<MainPage*, QAction*>(friendsDialog, action)); notify.push_back(QPair<MainPage*, QAction*>(friendsDialog, action));
ui->stackPages->add(searchDialog = new SearchDialog(ui->stackPages), // ui->stackPages->add(searchDialog = new SearchDialog(ui->stackPages),
createPageAction(QIcon(IMAGE_SEARCH), tr("Search"), grp)); // createPageAction(QIcon(IMAGE_SEARCH), tr("Search"), grp));
ui->stackPages->add(transfersDialog = new TransfersDialog(ui->stackPages), ui->stackPages->add(transfersDialog = new TransfersDialog(ui->stackPages),
action = createPageAction(QIcon(IMAGE_TRANSFERS), tr("Transfers"), grp)); action = createPageAction(QIcon(IMAGE_TRANSFERS), tr("Transfers"), grp));
notify.push_back(QPair<MainPage*, QAction*>(transfersDialog, action)); notify.push_back(QPair<MainPage*, QAction*>(transfersDialog, action));
ui->stackPages->add(sharedfilesDialog = new SharedFilesDialog(ui->stackPages), ui->stackPages->add(chatLobbyDialog = new ChatLobbyWidget(ui->stackPages),
createPageAction(QIcon(IMAGE_FILES), tr("Files"), grp)); action = createPageAction(QIcon(IMAGE_CHAT), tr("Chat Lobbies"), grp));
notify.push_back(QPair<MainPage*, QAction*>(chatLobbyDialog, action));
ui->stackPages->add(messagesDialog = new MessagesDialog(ui->stackPages), ui->stackPages->add(messagesDialog = new MessagesDialog(ui->stackPages),
action = createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp)); action = createPageAction(QIcon(IMAGE_MESSAGES), tr("Messages"), grp));
@ -785,20 +789,20 @@ void SetForegroundWindowInternal(HWND hWnd)
MainPage *Page = NULL; MainPage *Page = NULL;
switch (page) { switch (page) {
case Network: // case Network:
Page = _instance->networkDialog; // Page = _instance->networkDialog;
break; // break;
case Friends: case Friends:
Page = _instance->friendsDialog; Page = _instance->friendsDialog;
break; break;
case Search: case ChatLobby:
Page = _instance->searchDialog; Page = _instance->chatLobbyDialog;
break; break;
case Transfers: case Transfers:
Page = _instance->transfersDialog; Page = _instance->transfersDialog;
break; break;
case SharedDirectories: // case SharedDirectories:
Page = _instance->sharedfilesDialog; // Page = _instance->sharedfilesDialog;
break; break;
case Messages: case Messages:
Page = _instance->messagesDialog; Page = _instance->messagesDialog;
@ -814,6 +818,8 @@ void SetForegroundWindowInternal(HWND hWnd)
Page = _instance->blogsFeed; Page = _instance->blogsFeed;
break; break;
#endif #endif
default:
std::cerr << "Show page called on value that is not handled yet. Please code it! (value = " << Page << ")" << std::endl;
} }
if (Page) { if (Page) {
@ -834,21 +840,21 @@ void SetForegroundWindowInternal(HWND hWnd)
QWidget *page = _instance->ui->stackPages->currentWidget(); QWidget *page = _instance->ui->stackPages->currentWidget();
if (page == _instance->networkDialog) { // if (page == _instance->networkDialog) {
return Network; // return Network;
} // }
if (page == _instance->friendsDialog) { if (page == _instance->friendsDialog) {
return Friends; return Friends;
} }
if (page == _instance->searchDialog) { if (page == _instance->chatLobbyDialog) {
return Search; return ChatLobby;
} }
if (page == _instance->transfersDialog) { if (page == _instance->transfersDialog) {
return Transfers; return Transfers;
} }
if (page == _instance->sharedfilesDialog) { // if (page == _instance->sharedfilesDialog) {
return SharedDirectories; // return SharedDirectories;
} // }
if (page == _instance->messagesDialog) { if (page == _instance->messagesDialog) {
return Messages; return Messages;
} }
@ -880,16 +886,16 @@ void SetForegroundWindowInternal(HWND hWnd)
} }
switch (page) { switch (page) {
case Network: // case Network:
return _instance->networkDialog; // return _instance->networkDialog;
case Friends: case Friends:
return _instance->friendsDialog; return _instance->friendsDialog;
case Search: case ChatLobby:
return _instance->searchDialog; return _instance->chatLobbyDialog;
case Transfers: case Transfers:
return _instance->transfersDialog; return _instance->transfersDialog;
case SharedDirectories: // case SharedDirectories:
return _instance->sharedfilesDialog; // return _instance->sharedfilesDialog;
case Messages: case Messages:
return _instance->messagesDialog; return _instance->messagesDialog;
#ifdef RS_USE_LINKS #ifdef RS_USE_LINKS
@ -1080,12 +1086,6 @@ void MainWindow::showHelpDialog(const QString &topic)
HelpBrowser::showWindow(topic); HelpBrowser::showWindow(topic);
} }
void MainWindow::on_actionQuick_Start_Wizard_activated()
{
QuickStartWizard qstartwizard(this);
qstartwizard.exec();
}
/** Called when the user changes the UI translation. */ /** Called when the user changes the UI translation. */
void void
MainWindow::retranslateUi() MainWindow::retranslateUi()

View File

@ -43,6 +43,7 @@ class DHTStatus;
class HashingStatus; class HashingStatus;
class ForumsDialog; class ForumsDialog;
class FriendsDialog; class FriendsDialog;
class ChatLobbyWidget;
class ChatDialog; class ChatDialog;
class NetworkDialog; class NetworkDialog;
class SearchDialog; class SearchDialog;
@ -54,6 +55,7 @@ class PluginsPage;
class ChannelFeed; class ChannelFeed;
class BandwidthGraph; class BandwidthGraph;
class MainPage; class MainPage;
class NewsFeed;
class UserNotify; class UserNotify;
#ifdef RS_USE_LINKS #ifdef RS_USE_LINKS
@ -78,17 +80,18 @@ public:
/* Fixed numbers for load and save the last page */ /* Fixed numbers for load and save the last page */
Network = 0, /** Network page. */ Network = 0, /** Network page. */
Friends = 1, /** Friends page. */ Friends = 1, /** Friends page. */
Search = 2, /** Search page. */ ChatLobby = 2, /** Chat Lobby page. */
Transfers = 3, /** Transfers page. */ Transfers = 3, /** Transfers page. */
SharedDirectories = 4, /** Shared Directories page. */ SharedDirectories = 4, /** Shared Directories page. */
Messages = 5, /** Messages page. */ Messages = 5, /** Messages page. */
Channels = 6, /** Channels page. */ Channels = 6, /** Channels page. */
Forums = 7, /** Forums page. */ Forums = 7, /** Forums page. */
Search = 8, /** Search page. */
#ifdef BLOGS #ifdef BLOGS
Blogs = 8, /** Blogs page. */ Blogs = 9, /** Blogs page. */
#endif #endif
#ifdef RS_USE_LINKS #ifdef RS_USE_LINKS
Links = 9, /** Links page. */ Links = 10, /** Links page. */
#endif #endif
}; };
@ -117,10 +120,13 @@ public:
* Notify Class... * Notify Class...
*/ */
NetworkDialog *networkDialog; // NetworkDialog *networkDialog;
// SearchDialog *searchDialog;
NewsFeed *newsFeed;
FriendsDialog *friendsDialog; FriendsDialog *friendsDialog;
SearchDialog *searchDialog;
TransfersDialog *transfersDialog; TransfersDialog *transfersDialog;
ChatLobbyWidget *chatLobbyDialog;
MessagesDialog *messagesDialog; MessagesDialog *messagesDialog;
SharedFilesDialog *sharedfilesDialog; SharedFilesDialog *sharedfilesDialog;
ForumsDialog *forumsDialog; ForumsDialog *forumsDialog;
@ -203,7 +209,6 @@ private slots:
/** Called when user attempts to quit via quit button*/ /** Called when user attempts to quit via quit button*/
void doQuit(); void doQuit();
void on_actionQuick_Start_Wizard_activated();
void updateTrayCombine(); void updateTrayCombine();
private: private:

View File

@ -53,7 +53,6 @@
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionMessenger"/> <addaction name="actionMessenger"/>
<addaction name="actionAbout"/> <addaction name="actionAbout"/>
<addaction name="actionQuick_Start_Wizard"/>
<addaction name="actionOptions"/> <addaction name="actionOptions"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionQuit"/> <addaction name="actionQuit"/>

View File

@ -134,7 +134,7 @@ NetworkDialog::NetworkDialog(QWidget *parent)
ui.unvalidGPGkeyWidget->sortItems( 1, Qt::AscendingOrder ); ui.unvalidGPGkeyWidget->sortItems( 1, Qt::AscendingOrder );
// ui.networkTab->addTab(new TrustView(),QString(tr("Authentication matrix"))); // ui.networkTab->addTab(new TrustView(),QString(tr("Authentication matrix")));
ui.networkTab->addTab(networkview = new NetworkView(),QString(tr("Network View"))); // ui.networkTab->addTab(networkview = new NetworkView(),QString(tr("Network View")));
ui.showUnvalidKeys->setMinimumWidth(20); ui.showUnvalidKeys->setMinimumWidth(20);
@ -159,7 +159,7 @@ NetworkDialog::NetworkDialog(QWidget *parent)
menu->addSeparator(); menu->addSeparator();
menu->addAction(ui.actionTabsTriangular); menu->addAction(ui.actionTabsTriangular);
menu->addAction(ui.actionTabsRounded); menu->addAction(ui.actionTabsRounded);
ui.viewButton->setMenu(menu); //ui.viewButton->setMenu(menu);
QTimer *timer2 = new QTimer(this); QTimer *timer2 = new QTimer(this);
connect(timer2, SIGNAL(timeout()), this, SLOT(updateNetworkStatus())); connect(timer2, SIGNAL(timeout()), this, SLOT(updateNetworkStatus()));
@ -170,8 +170,8 @@ NetworkDialog::NetworkDialog(QWidget *parent)
ui.filterLineEdit->addFilter(QIcon(), tr("Peer ID"), COLUMN_PEERID, tr("Search Peer ID")); ui.filterLineEdit->addFilter(QIcon(), tr("Peer ID"), COLUMN_PEERID, tr("Search Peer ID"));
ui.filterLineEdit->setCurrentFilter(COLUMN_PEERNAME); ui.filterLineEdit->setCurrentFilter(COLUMN_PEERNAME);
updateNetworkStatus(); //updateNetworkStatus();
loadtabsettings(); //loadtabsettings();
/* Hide platform specific features */ /* Hide platform specific features */
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
@ -192,12 +192,12 @@ void NetworkDialog::changeEvent(QEvent *e)
} }
} }
void NetworkDialog::updateNewDiscoveryInfo() //void NetworkDialog::updateNewDiscoveryInfo()
{ //{
//std::cerr << "Received new p3disc info. Updating networkview." << std::endl; // //std::cerr << "Received new p3disc info. Updating networkview." << std::endl;
networkview->update(); // //networkview->update();
networkview->updateDisplay(); // //networkview->updateDisplay();
} //}
void NetworkDialog::connecttreeWidgetCostumPopupMenu( QPoint /*point*/ ) void NetworkDialog::connecttreeWidgetCostumPopupMenu( QPoint /*point*/ )
{ {
@ -687,117 +687,74 @@ void NetworkDialog::on_actionCreate_New_Profile_activated()
// gencertdialog.exec (); // gencertdialog.exec ();
} }
void NetworkDialog::updateNetworkStatus() // void NetworkDialog::on_actionTabsnorth_activated()
{ // {
if(RsAutoUpdatePage::eventsLocked()) // ui.networkTab->setTabPosition(QTabWidget::North);
return ; //
// Settings->setValueToGroup("NetworkDialog", "TabWidget_Position",ui.networkTab->tabPosition());
rsiface->lockData(); /* Lock Interface */ // }
//
/* now the extra bit .... switch on check boxes */ // void NetworkDialog::on_actionTabssouth_activated()
const RsConfig &config = rsiface->getConfig(); // {
// ui.networkTab->setTabPosition(QTabWidget::South);
//
/******* Network Status Tab *******/ // Settings->setValueToGroup("NetworkDialog", "TabWidget_Position",ui.networkTab->tabPosition());
//
if(config.netUpnpOk) // }
{ //
ui.iconlabel_upnp->setPixmap(QPixmap(":/images/ledon1.png")); // void NetworkDialog::on_actionTabswest_activated()
} // {
else // ui.networkTab->setTabPosition(QTabWidget::West);
{ //
ui.iconlabel_upnp->setPixmap(QPixmap(":/images/ledoff1.png")); // Settings->setValueToGroup("NetworkDialog", "TabWidget_Position",ui.networkTab->tabPosition());
} // }
//
if (config.netLocalOk) // void NetworkDialog::on_actionTabsright_activated()
{ // {
ui.iconlabel_netLimited->setPixmap(QPixmap(":/images/ledon1.png")); // ui.networkTab->setTabPosition(QTabWidget::East);
} //
else // Settings->setValueToGroup("NetworkDialog", "TabWidget_Position",ui.networkTab->tabPosition());
{ // }
ui.iconlabel_netLimited->setPixmap(QPixmap(":/images/ledoff1.png")); //
} // void NetworkDialog::on_actionTabsTriangular_activated()
// {
if (config.netExtraAddressOk) // ui.networkTab->setTabShape(QTabWidget::Triangular);
{ // ui.tabBottom->setTabShape(QTabWidget::Triangular);
ui.iconlabel_ext->setPixmap(QPixmap(":/images/ledon1.png")); // }
} //
else // void NetworkDialog::on_actionTabsRounded_activated()
{ // {
ui.iconlabel_ext->setPixmap(QPixmap(":/images/ledoff1.png")); // ui.networkTab->setTabShape(QTabWidget::Rounded);
} // ui.tabBottom->setTabShape(QTabWidget::Rounded);
// }
rsiface->unlockData(); /* UnLock Interface */ //
} // void NetworkDialog::loadtabsettings()
// {
void NetworkDialog::on_actionTabsnorth_activated() // Settings->beginGroup("NetworkDialog");
{ //
ui.networkTab->setTabPosition(QTabWidget::North); // if(Settings->value("TabWidget_Position","0").toInt() == 0)
// {
Settings->setValueToGroup("NetworkDialog", "TabWidget_Position",ui.networkTab->tabPosition()); // qDebug() << "Tab North";
} // ui.networkTab->setTabPosition(QTabWidget::North);
// }
void NetworkDialog::on_actionTabssouth_activated() // else if (Settings->value("TabWidget_Position","1").toInt() == 1)
{ // {
ui.networkTab->setTabPosition(QTabWidget::South); // qDebug() << "Tab South";
// ui.networkTab->setTabPosition(QTabWidget::South);
Settings->setValueToGroup("NetworkDialog", "TabWidget_Position",ui.networkTab->tabPosition()); // }
// else if (Settings->value("TabWidget_Position","2").toInt() ==2)
} // {
// qDebug() << "Tab West";
void NetworkDialog::on_actionTabswest_activated() // ui.networkTab->setTabPosition(QTabWidget::West);
{ // }
ui.networkTab->setTabPosition(QTabWidget::West); // else if(Settings->value("TabWidget_Position","3").toInt() ==3)
// {
Settings->setValueToGroup("NetworkDialog", "TabWidget_Position",ui.networkTab->tabPosition()); // qDebug() << "Tab East";
} // ui.networkTab->setTabPosition(QTabWidget::East);
// }
void NetworkDialog::on_actionTabsright_activated() //
{ // Settings->endGroup();
ui.networkTab->setTabPosition(QTabWidget::East); // }
Settings->setValueToGroup("NetworkDialog", "TabWidget_Position",ui.networkTab->tabPosition());
}
void NetworkDialog::on_actionTabsTriangular_activated()
{
ui.networkTab->setTabShape(QTabWidget::Triangular);
ui.tabBottom->setTabShape(QTabWidget::Triangular);
}
void NetworkDialog::on_actionTabsRounded_activated()
{
ui.networkTab->setTabShape(QTabWidget::Rounded);
ui.tabBottom->setTabShape(QTabWidget::Rounded);
}
void NetworkDialog::loadtabsettings()
{
Settings->beginGroup("NetworkDialog");
if(Settings->value("TabWidget_Position","0").toInt() == 0)
{
qDebug() << "Tab North";
ui.networkTab->setTabPosition(QTabWidget::North);
}
else if (Settings->value("TabWidget_Position","1").toInt() == 1)
{
qDebug() << "Tab South";
ui.networkTab->setTabPosition(QTabWidget::South);
}
else if (Settings->value("TabWidget_Position","2").toInt() ==2)
{
qDebug() << "Tab West";
ui.networkTab->setTabPosition(QTabWidget::West);
}
else if(Settings->value("TabWidget_Position","3").toInt() ==3)
{
qDebug() << "Tab East";
ui.networkTab->setTabPosition(QTabWidget::East);
}
Settings->endGroup();
}
void NetworkDialog::filterColumnChanged(int) void NetworkDialog::filterColumnChanged(int)
{ {

View File

@ -59,7 +59,7 @@ public slots:
void insertConnect(); void insertConnect();
// std::string loadneighbour(); // std::string loadneighbour();
/* void loadneighbour(); */ /* void loadneighbour(); */
void updateNewDiscoveryInfo() ; //void updateNewDiscoveryInfo() ;
protected: protected:
void changeEvent(QEvent *e); void changeEvent(QEvent *e);
@ -87,17 +87,17 @@ private slots:
void on_actionCreate_New_Profile_activated(); void on_actionCreate_New_Profile_activated();
void updateNetworkStatus(); //void updateNetworkStatus();
void loadtabsettings(); // void loadtabsettings();
void on_actionTabsright_activated(); // void on_actionTabsright_activated();
void on_actionTabsnorth_activated(); // void on_actionTabsnorth_activated();
void on_actionTabssouth_activated(); // void on_actionTabssouth_activated();
void on_actionTabswest_activated(); // void on_actionTabswest_activated();
//
void on_actionTabsRounded_activated(); // void on_actionTabsRounded_activated();
void on_actionTabsTriangular_activated(); // void on_actionTabsTriangular_activated();
void filterColumnChanged(int); void filterColumnChanged(int);
void filterItems(const QString &text); void filterItems(const QString &text);
@ -107,7 +107,7 @@ private:
QTreeWidget *connecttreeWidget; QTreeWidget *connecttreeWidget;
class NetworkView *networkview; // class NetworkView *networkview;
bool filterItem(QTreeWidgetItem *item, const QString &text, int filterColumn); bool filterItem(QTreeWidgetItem *item, const QString &text, int filterColumn);

View File

@ -6,46 +6,48 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>629</width> <width>825</width>
<height>346</height> <height>567</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin"> <item>
<number>6</number> <layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="titleBarLabel">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="topMargin"> <property name="text">
<number>9</number> <string>Filter:</string>
</property> </property>
<property name="rightMargin"> </widget>
<number>6</number> </item>
<item>
<widget class="LineEditClear" name="filterLineEdit">
<property name="toolTip">
<string>Search Network</string>
</property> </property>
<property name="bottomMargin"> </widget>
<number>0</number> </item>
<item>
<widget class="QCheckBox" name="showUnvalidKeys">
<property name="text">
<string>Show all accessible keys</string>
</property> </property>
<item row="0" column="0"> </widget>
<widget class="QTabWidget" name="networkTab"> </item>
<property name="tabPosition"> </layout>
<enum>QTabWidget::North</enum> </item>
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property> </property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="networkTab_1">
<attribute name="title">
<string>Network</string>
</attribute>
<layout class="QGridLayout">
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item row="1" column="0">
<widget class="QTreeWidget" name="connecttreeWidget"> <widget class="QTreeWidget" name="connecttreeWidget">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
@ -124,231 +126,6 @@
</property> </property>
</column> </column>
</widget> </widget>
</item>
<item row="0" column="0">
<widget class="QFrame" name="titleBarFrame">
<property name="minimumSize">
<size>
<width>0</width>
<height>32</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="titleBarPixmap">
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/rs1.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="titleBarLabel">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Network</string>
</property>
</widget>
</item>
<item>
<widget class="LineEditClear" name="filterLineEdit">
<property name="toolTip">
<string>Search Network</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showUnvalidKeys">
<property name="text">
<string>Show keys that are not validated by the PGP web of trust</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="viewButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Display</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/looknfeel.png</normaloff>:/images/looknfeel.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>16</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QTabWidget" name="tabBottom">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>60</height>
</size>
</property>
<property name="tabPosition">
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="networkstatus">
<attribute name="title">
<string>Network Status</string>
</attribute>
<layout class="QGridLayout">
<item row="0" column="0">
<layout class="QGridLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="iconlabel_netLimited">
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/ledoff1.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="textlabel_netLimited">
<property name="text">
<string>Local network</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<layout class="QGridLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="iconlabel_upnp">
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/ledoff1.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="textlabel_upnp">
<property name="text">
<string>UPnP</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="2">
<layout class="QGridLayout">
<property name="leftMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="iconlabel_ext">
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/ledoff1.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="textlabel_ext">
<property name="text">
<string>External ip address finder</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>250</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item row="2" column="0">
<widget class="QTreeWidget" name="unvalidGPGkeyWidget"> <widget class="QTreeWidget" name="unvalidGPGkeyWidget">
<property name="contextMenuPolicy"> <property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum> <enum>Qt::CustomContextMenu</enum>
@ -394,9 +171,6 @@
</property> </property>
</column> </column>
</widget> </widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
</layout> </layout>

View File

@ -118,9 +118,9 @@ void NetworkView::updateDisplay()
/* add all friends */ /* add all friends */
std::string ownGPGId = rsPeers->getGPGOwnId(); std::string ownGPGId = rsPeers->getGPGOwnId();
#ifdef DEBUG_NETWORKVIEW //#ifdef DEBUG_NETWORKVIEW
std::cerr << "NetworkView::updateDisplay()" << std::endl; std::cerr << "NetworkView::updateDisplay()" << std::endl;
#endif //#endif
std::deque<NodeInfo> nodes_to_treat ; // list of nodes to be treated. Used as a queue. The int is the level of friendness std::deque<NodeInfo> nodes_to_treat ; // list of nodes to be treated. Used as a queue. The int is the level of friendness
std::set<std::string> nodes_considered ; // list of nodes already considered. Eases lookup. std::set<std::string> nodes_considered ; // list of nodes already considered. Eases lookup.

View File

@ -619,7 +619,7 @@ QVariant TreeStyle_RDM::headerData(int section, Qt::Orientation orientation, int
if (RemoteMode) if (RemoteMode)
return tr("Friend"); return tr("Friend");
else else
return tr("Share Type"); return tr("Share Flags");
case 4: case 4:
if (RemoteMode) if (RemoteMode)
return tr("What's new"); return tr("What's new");
@ -665,7 +665,7 @@ QVariant FlatStyle_RDM::headerData(int section, Qt::Orientation orientation, int
if(RemoteMode) if(RemoteMode)
return tr("Friend"); return tr("Friend");
else else
return tr("Share Type"); return tr("Share Flags");
case 4: case 4:
return tr("Directory"); return tr("Directory");
} }
@ -1307,8 +1307,9 @@ void FlatStyle_RDM::updateRefs()
#endif #endif
_ref_stack.pop_back() ; _ref_stack.pop_back() ;
DirDetails details ; DirDetails details ;
FileSearchFlags flags = (RemoteMode)?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL;
if (requestDirDetails(ref, details, RS_FILE_HINTS_REMOTE)) if (requestDirDetails(ref, details, flags))
{ {
if(details.type == DIR_TYPE_FILE) // only push files, not directories nor persons. if(details.type == DIR_TYPE_FILE) // only push files, not directories nor persons.
_ref_entries.push_back(std::pair<void*,QString>(ref,computeDirectoryPath(details))); _ref_entries.push_back(std::pair<void*,QString>(ref,computeDirectoryPath(details)));

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>581</width> <width>758</width>
<height>331</height> <height>339</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -16,14 +16,8 @@
<verstretch>1</verstretch> <verstretch>1</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<layout class="QGridLayout" name="gridLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="horizontalSpacing"> <item>
<number>6</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="0" colspan="3">
<widget class="QFrame" name="titleBarFrame"> <widget class="QFrame" name="titleBarFrame">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
@ -41,6 +35,281 @@
<property name="margin"> <property name="margin">
<number>2</number> <number>2</number>
</property> </property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="searchLineFrame">
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="horizontalSpacing">
<number>0</number>
</property>
<property name="verticalSpacing">
<number>1</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="LineEditClear" name="lineEdit">
<property name="toolTip">
<string>Enter a keyword here (at least 3 char long)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonSearch">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Start Search</string>
</property>
<property name="text">
<string>Search</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="toggleAdvancedSearchBtn">
<property name="toolTip">
<string>Advanced Search</string>
</property>
<property name="text">
<string>Advanced</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_friendListsearch_SB">
<property name="toolTip">
<string>Search inside &quot;browsable&quot; files of your friends</string>
</property>
<property name="text">
<string>Browsable files</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_anonF2Fsearch_CB">
<property name="toolTip">
<string>Multi-hop search at distance 6 in the network
(always reports available files)</string>
</property>
<property name="text">
<string>Distant</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_ownFiles_CB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Include files from your own file list in the search result</string>
</property>
<property name="text">
<string>Own files</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cloaseallsearchresultsButton">
<property name="toolTip">
<string>Close all Search Results</string>
</property>
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QTreeWidget" name="searchSummaryWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>KeyWords</string>
</property>
</column>
<column>
<property name="text">
<string>Results</string>
</property>
</column>
<column>
<property name="text">
<string>Search Id</string>
</property>
</column>
</widget>
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="SearchTreeWidget" name="searchResultWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragOnly</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Filename</string>
</property>
</column>
<column>
<property name="text">
<string>Size</string>
</property>
</column>
<column>
<property name="text">
<string>Sources</string>
</property>
</column>
<column>
<property name="text">
<string>Type</string>
</property>
</column>
<column>
<property name="text">
<string>Age</string>
</property>
</column>
<column>
<property name="text">
<string>Hash</string>
</property>
</column>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Filter:</string>
</property>
</widget>
</item>
<item>
<widget class="LineEditClear" name="filterLineEdit">
<property name="toolTip">
<string>Filter Search Result</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Max results:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="_max_results_SB">
<property name="suffix">
<string/>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>5000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>1000</number>
</property>
</widget>
</item>
<item> <item>
<widget class="QComboBox" name="FileTypeComboBox"> <widget class="QComboBox" name="FileTypeComboBox">
<item> <item>
@ -127,252 +396,6 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>13</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="searchLineFrame">
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="horizontalSpacing">
<number>0</number>
</property>
<property name="verticalSpacing">
<number>1</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="LineEditClear" name="lineEdit">
<property name="toolTip">
<string>Enter a keyword here (at least 3 char long)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonSearch">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Start Search</string>
</property>
<property name="text">
<string>Search</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>50</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="toggleAdvancedSearchBtn">
<property name="toolTip">
<string>Advanced Search</string>
</property>
<property name="text">
<string>Advanced</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QTreeWidget" name="searchSummaryWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>KeyWords</string>
</property>
</column>
<column>
<property name="text">
<string>Results</string>
</property>
</column>
<column>
<property name="text">
<string>Search Id</string>
</property>
</column>
</widget>
<widget class="QWidget" name="layoutWidget">
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="0">
<widget class="SearchTreeWidget" name="searchResultWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragOnly</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Filename</string>
</property>
</column>
<column>
<property name="text">
<string>Size</string>
</property>
</column>
<column>
<property name="text">
<string>Sources</string>
</property>
</column>
<column>
<property name="text">
<string>Type</string>
</property>
</column>
<column>
<property name="text">
<string>Age</string>
</property>
</column>
<column>
<property name="text">
<string>Hash</string>
</property>
</column>
</widget>
</item>
<item row="0" column="0">
<widget class="LineEditClear" name="filterLineEdit">
<property name="toolTip">
<string>Filter Search Result</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="cloaseallsearchresultsButton">
<property name="toolTip">
<string>Close all Search Results</string>
</property>
<property name="text">
<string>Close All Search Results</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>29</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="pushButtonDownload"> <widget class="QPushButton" name="pushButtonDownload">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -390,7 +413,7 @@
<string>Download Selected</string> <string>Download Selected</string>
</property> </property>
<property name="text"> <property name="text">
<string>Download</string> <string>Download selected</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset resource="images.qrc">
@ -398,114 +421,11 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="3"> </layout>
<widget class="QFrame" name="buttonFrame">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>38</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>1</number>
</property>
<property name="margin">
<number>3</number>
</property>
<item row="1" column="0">
<widget class="QCheckBox" name="_ownFiles_CB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Include files from your own file list in the search result</string>
</property>
<property name="text">
<string>Include my files</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="_friendListsearch_SB">
<property name="toolTip">
<string>Search inside &quot;browsable&quot; files of your friends</string>
</property>
<property name="text">
<string>Search in friends lists</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="_anonF2Fsearch_CB">
<property name="toolTip">
<string>Multi-hop search at distance 6 in the network
(always reports available files)</string>
</property>
<property name="text">
<string>F2F search</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label">
<property name="text">
<string>Limit number of results to :</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QSpinBox" name="_max_results_SB">
<property name="suffix">
<string/>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>5000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>1000</number>
</property>
</widget>
</item>
<item row="1" column="5">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>5</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>

View File

@ -35,6 +35,7 @@
#include "AddLinksDialog.h" #include "AddLinksDialog.h"
#endif #endif
#include "RetroShareLink.h" #include "RetroShareLink.h"
#include "ShareManager.h"
#include "RemoteDirModel.h" #include "RemoteDirModel.h"
#include "ShareDialog.h" #include "ShareDialog.h"
#include "common/PeerDefs.h" #include "common/PeerDefs.h"
@ -90,36 +91,23 @@ private:
}; };
/** Constructor */ /** Constructor */
SharedFilesDialog::SharedFilesDialog(QWidget *parent) SharedFilesDialog::SharedFilesDialog(RetroshareDirModel *_tree_model,RetroshareDirModel *_flat_model,QWidget *parent)
: RsAutoUpdatePage(1000,parent),model(NULL) : RsAutoUpdatePage(1000,parent),model(NULL)
{ {
/* Invoke the Qt Designer generated object setup routine */ /* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this); ui.setupUi(this);
connect(ui.checkButton, SIGNAL(clicked()), this, SLOT(forceCheck())); //== connect(ui.localButton, SIGNAL(toggled(bool)), this, SLOT(showFrame(bool)));
connect(ui.localButton, SIGNAL(toggled(bool)), this, SLOT(showFrame(bool))); //== connect(ui.remoteButton, SIGNAL(toggled(bool)), this, SLOT(showFrameRemote(bool)));
connect(ui.remoteButton, SIGNAL(toggled(bool)), this, SLOT(showFrameRemote(bool))); //== connect(ui.splittedButton, SIGNAL(toggled(bool)), this, SLOT(showFrameSplitted(bool)));
connect(ui.splittedButton, SIGNAL(toggled(bool)), this, SLOT(showFrameSplitted(bool)));
connect(ui.viewType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changeCurrentViewModel(int))); connect(ui.viewType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changeCurrentViewModel(int)));
connect( ui.localDirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( sharedDirTreeWidgetContextMenu( QPoint ) ) ); connect( ui.dirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( spawnCustomPopupMenu( QPoint ) ) );
connect( ui.remoteDirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( shareddirtreeviewCostumPopupMenu( QPoint ) ) );
// connect( ui.remoteDirTreeView, SIGNAL( doubleClicked(const QModelIndex&)), this, SLOT( downloadRemoteSelected()));
connect( ui.downloadButton, SIGNAL( clicked()), this, SLOT( downloadRemoteSelected()));
connect(ui.indicatorCBox, SIGNAL(currentIndexChanged(int)), this, SLOT(indicatorChanged(int))); connect(ui.indicatorCBox, SIGNAL(currentIndexChanged(int)), this, SLOT(indicatorChanged(int)));
/* tree_model = _tree_model ;
connect( ui.remoteDirTreeView, SIGNAL( itemExpanded( QTreeWidgetItem * ) ), flat_model = _flat_model ;
this, SLOT( checkForLocalDirRequest( QTreeWidgetItem * ) ) );
connect( ui.localDirTreeWidget, SIGNAL( itemExpanded( QTreeWidgetItem * ) ),
this, SLOT( checkForRemoteDirRequest( QTreeWidgetItem * ) ) );
*/
tree_model = new TreeStyle_RDM(true);
flat_model = new FlatStyle_RDM(true);
tree_proxyModel = new SFDSortFilterProxyModel(tree_model, this); tree_proxyModel = new SFDSortFilterProxyModel(tree_model, this);
tree_proxyModel->setDynamicSortFilter(true); tree_proxyModel->setDynamicSortFilter(true);
@ -135,88 +123,31 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
flat_proxyModel->setSortRole(RetroshareDirModel::SortRole); flat_proxyModel->setSortRole(RetroshareDirModel::SortRole);
flat_proxyModel->sort(0); flat_proxyModel->sort(0);
localModel = new TreeStyle_RDM(false);
localProxyModel = new SFDSortFilterProxyModel(localModel, this);
localProxyModel->setDynamicSortFilter(true);
localProxyModel->setSourceModel(localModel);
localProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
localProxyModel->setSortRole(RetroshareDirModel::SortRole);
localProxyModel->sort(0);
ui.localDirTreeView->setModel(localProxyModel);
connect( ui.localDirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), localModel, SLOT( collapsed(const QModelIndex & ) ) );
connect( ui.localDirTreeView, SIGNAL( expanded(const QModelIndex & ) ), localModel, SLOT( expanded(const QModelIndex & ) ) );
connect( localModel, SIGNAL( layoutAboutToBeChanged() ), ui.localDirTreeView, SLOT( reset() ) );
connect( localModel, SIGNAL( layoutChanged() ), ui.localDirTreeView, SLOT( update() ) );
connect(ui.filterClearButton, SIGNAL(clicked()), this, SLOT(clearFilter())); connect(ui.filterClearButton, SIGNAL(clicked()), this, SLOT(clearFilter()));
connect(ui.filterStartButton, SIGNAL(clicked()), this, SLOT(startFilter())); connect(ui.filterStartButton, SIGNAL(clicked()), this, SLOT(startFilter()));
connect(ui.filterPatternLineEdit, SIGNAL(returnPressed()), this, SLOT(startFilter())); connect(ui.filterPatternLineEdit, SIGNAL(returnPressed()), this, SLOT(startFilter()));
connect(ui.filterPatternLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterRegExpChanged())); connect(ui.filterPatternLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterRegExpChanged()));
/* Set header resize modes and initial section sizes */ /* Set header resize modes and initial section sizes */
QHeaderView * l_header = ui.localDirTreeView->header () ; QHeaderView * header = ui.dirTreeView->header () ;
header->setResizeMode (0, QHeaderView::Interactive);
l_header->resizeSection ( 0, 490 ); header->resizeSection ( 0, 490 );
l_header->resizeSection ( 1, 70 ); header->resizeSection ( 1, 70 );
l_header->resizeSection ( 2, 100 ); header->resizeSection ( 2, 100 );
l_header->resizeSection ( 3, 100 ); header->resizeSection ( 3, 100 );
l_header->resizeSection ( 4, 100 ); header->resizeSection ( 4, 100 );
l_header->setStretchLastSection(false); header->setStretchLastSection(false);
// l_header->setHighlightSections(false);
// Setup the current view model.
//
changeCurrentViewModel(ui.viewType_CB->currentIndex()) ;
/* Set header resize modes and initial section sizes */
QHeaderView * r_header = ui.remoteDirTreeView->header () ;
r_header->setResizeMode (0, QHeaderView::Interactive);
r_header->setStretchLastSection(false);
// r_header->setResizeMode (1, QHeaderView::Fixed);
// // r_header->setResizeMode (2, QHeaderView::Interactive);
// r_header->setResizeMode (3, QHeaderView::Fixed);
// // r_header->setResizeMode (4, QHeaderView::Interactive);
r_header->resizeSection ( 0, 490 );
r_header->resizeSection ( 1, 70 );
r_header->resizeSection ( 2, 80 );
r_header->resizeSection ( 3, 100 );
r_header->resizeSection ( 4, 80 );
// r_header->setHighlightSections(false);
/* Set Multi Selection */ /* Set Multi Selection */
ui.remoteDirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection); ui.dirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
ui.localDirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
//#ifdef RS_RELEASE_VERSION
// ui.filterLabel->hide();
// ui.filterPatternLineEdit->hide();
//#endif
// load settings
processSettings(true);
// Hide columns after loading the settings
ui.remoteDirTreeView->setColumnHidden(3,false) ;
ui.remoteDirTreeView->setColumnHidden(4,true) ;
ui.localDirTreeView->setColumnHidden(4,false) ;
/* Hide platform specific features */ /* Hide platform specific features */
#ifdef Q_WS_WIN copylinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard" ), this );
connect( copylinkAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) );
#endif copylinkhtmlAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard (HTML)" ), this );
copylinklocalAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard" ), this ); connect( copylinkhtmlAct , SIGNAL( triggered() ), this, SLOT( copyLinkhtml() ) );
connect( copylinklocalAct , SIGNAL( triggered() ), this, SLOT( copyLinkLocal() ) );
copylinklocalhtmlAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard (HTML)" ), this );
connect( copylinklocalhtmlAct , SIGNAL( triggered() ), this, SLOT( copyLinkhtml() ) );
sendlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links" ), this ); sendlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links" ), this );
connect( sendlinkAct , SIGNAL( triggered() ), this, SLOT( sendLinkTo( ) ) ); connect( sendlinkAct , SIGNAL( triggered() ), this, SLOT( sendLinkTo( ) ) );
#ifdef RS_USE_LINKS #ifdef RS_USE_LINKS
@ -225,21 +156,62 @@ SharedFilesDialog::SharedFilesDialog(QWidget *parent)
addlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Add Links to Cloud" ), this ); addlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Add Links to Cloud" ), this );
connect( addlinkCloudAct , SIGNAL( triggered() ), this, SLOT( addLinkToCloud( ) ) ); connect( addlinkCloudAct , SIGNAL( triggered() ), this, SLOT( addLinkToCloud( ) ) );
#endif #endif
}
LocalSharedFilesDialog::LocalSharedFilesDialog(QWidget *parent)
: SharedFilesDialog(new TreeStyle_RDM(false),new FlatStyle_RDM(false),parent)
{
// Hide columns after loading the settings
ui.dirTreeView->setColumnHidden(4,false) ;
ui.downloadButton->hide() ;
// load settings
processSettings(true);
// Setup the current view model.
//
changeCurrentViewModel(ui.viewType_CB->currentIndex()) ;
connect(ui.addShares_PB, SIGNAL(clicked()), this, SLOT(addShares()));
connect(ui.checkButton, SIGNAL(clicked()), this, SLOT(forceCheck()));
createcollectionfileAct = new QAction(QIcon(IMAGE_COLLECTION), tr("Create collection file"), this); createcollectionfileAct = new QAction(QIcon(IMAGE_COLLECTION), tr("Create collection file"), this);
connect(createcollectionfileAct, SIGNAL(triggered()), this, SLOT(createCollectionFile()));
openfileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Open File"), this); openfileAct = new QAction(QIcon(IMAGE_OPENFILE), tr("Open File"), this);
connect(openfileAct, SIGNAL(triggered()), this, SLOT(openfile()));
openfolderAct = new QAction(QIcon(IMAGE_OPENFOLDER), tr("Open Folder"), this); openfolderAct = new QAction(QIcon(IMAGE_OPENFOLDER), tr("Open Folder"), this);
connect(openfolderAct, SIGNAL(triggered()), this, SLOT(openfolder()));
editshareAct = new QAction(QIcon(IMAGE_EDITSHARE), tr("Edit Share Permissions"), this); editshareAct = new QAction(QIcon(IMAGE_EDITSHARE), tr("Edit Share Permissions"), this);
connect(createcollectionfileAct, SIGNAL(triggered()), this, SLOT(createCollectionFile()));
connect(openfileAct, SIGNAL(triggered()), this, SLOT(openfile()));
connect(openfolderAct, SIGNAL(triggered()), this, SLOT(openfolder()));
connect(editshareAct, SIGNAL(triggered()), this, SLOT(editSharePermissions())); connect(editshareAct, SIGNAL(triggered()), this, SLOT(editSharePermissions()));
} }
RemoteSharedFilesDialog::RemoteSharedFilesDialog(QWidget *parent)
: SharedFilesDialog(new TreeStyle_RDM(true),new FlatStyle_RDM(true),parent)
{
ui.dirTreeView->setColumnHidden(3,false) ;
ui.dirTreeView->setColumnHidden(4,true) ;
ui.checkButton->hide() ;
connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(downloadRemoteSelected()));
// load settings
processSettings(true);
// Setup the current view model.
//
changeCurrentViewModel(ui.viewType_CB->currentIndex()) ;
ui.addShares_PB->hide() ;
}
void LocalSharedFilesDialog::addShares()
{
ShareManager::showYourself();
}
void SharedFilesDialog::hideEvent(QHideEvent *) void SharedFilesDialog::hideEvent(QHideEvent *)
{ {
if(model!=NULL) if(model!=NULL)
model->setVisible(false) ; model->setVisible(false) ;
//std::cerr << "Hidden!"<< std::endl;
} }
void SharedFilesDialog::showEvent(QShowEvent *) void SharedFilesDialog::showEvent(QShowEvent *)
{ {
@ -248,15 +220,50 @@ void SharedFilesDialog::showEvent(QShowEvent *)
model->setVisible(true) ; model->setVisible(true) ;
model->update() ; model->update() ;
} }
//std::cerr << "Shown!"<< std::endl;
} }
SharedFilesDialog::~SharedFilesDialog() RemoteSharedFilesDialog::~RemoteSharedFilesDialog()
{ {
// save settings // save settings
processSettings(false); processSettings(false);
} }
void SharedFilesDialog::processSettings(bool bLoad) LocalSharedFilesDialog::~LocalSharedFilesDialog()
{
// save settings
processSettings(false);
}
void LocalSharedFilesDialog::processSettings(bool bLoad)
{
Settings->beginGroup("LocalSharedFilesDialog");
if (bLoad) {
// load settings
// state of the trees
ui.dirTreeView->header()->restoreState(Settings->value("LocalDirTreeView").toByteArray());
// state of splitter
ui.splitter->restoreState(Settings->value("LocalSplitter").toByteArray());
// view type
ui.viewType_CB->setCurrentIndex(Settings->value("LocalViewType").toInt());
} else {
// save settings
// state of trees
Settings->setValue("LocalDirTreeView", ui.dirTreeView->header()->saveState());
// state of splitter
Settings->setValue("LocalSplitter", ui.splitter->saveState());
// view type
Settings->setValue("LocalViewType", ui.viewType_CB->currentIndex());
}
Settings->endGroup();
}
void RemoteSharedFilesDialog::processSettings(bool bLoad)
{ {
Settings->beginGroup("SharedFilesDialog"); Settings->beginGroup("SharedFilesDialog");
@ -264,26 +271,24 @@ void SharedFilesDialog::processSettings(bool bLoad)
// load settings // load settings
// state of the trees // state of the trees
ui.localDirTreeView->header()->restoreState(Settings->value("LocalDirTreeView").toByteArray()); ui.dirTreeView->header()->restoreState(Settings->value("RemoteDirTreeView").toByteArray());
ui.remoteDirTreeView->header()->restoreState(Settings->value("RemoteDirTreeView").toByteArray());
// state of splitter // state of splitter
ui.splitter->restoreState(Settings->value("Splitter").toByteArray()); ui.splitter->restoreState(Settings->value("RemoteSplitter").toByteArray());
// view type // view type
ui.viewType_CB->setCurrentIndex(Settings->value("ViewType").toInt()); ui.viewType_CB->setCurrentIndex(Settings->value("RemoteViewType").toInt());
} else { } else {
// save settings // save settings
// state of trees // state of trees
Settings->setValue("LocalDirTreeView", ui.localDirTreeView->header()->saveState()); Settings->setValue("RemoteDirTreeView", ui.dirTreeView->header()->saveState());
Settings->setValue("RemoteDirTreeView", ui.remoteDirTreeView->header()->saveState());
// state of splitter // state of splitter
Settings->setValue("Splitter", ui.splitter->saveState()); Settings->setValue("RemoteSplitter", ui.splitter->saveState());
// view type // view type
Settings->setValue("ViewType", ui.viewType_CB->currentIndex()); Settings->setValue("RemoteViewType", ui.viewType_CB->currentIndex());
} }
Settings->endGroup(); Settings->endGroup();
@ -291,18 +296,51 @@ void SharedFilesDialog::processSettings(bool bLoad)
void SharedFilesDialog::changeCurrentViewModel(int c) void SharedFilesDialog::changeCurrentViewModel(int c)
{ {
disconnect( ui.remoteDirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), 0, 0 ); disconnect( ui.dirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), 0, 0 );
disconnect( ui.remoteDirTreeView, SIGNAL( expanded(const QModelIndex & ) ), 0, 0 ); disconnect( ui.dirTreeView, SIGNAL( expanded(const QModelIndex & ) ), 0, 0 );
if(model!=NULL) if(model!=NULL)
model->setVisible(false) ; model->setVisible(false) ;
if(c == 0) if(c==0)
{ {
model = tree_model ; model = tree_model ;
proxyModel = tree_proxyModel ; proxyModel = tree_proxyModel ;
ui.remoteDirTreeView->setColumnHidden(3,true) ; }
ui.remoteDirTreeView->setColumnHidden(4,true) ; else
{
model = flat_model ;
proxyModel = flat_proxyModel ;
}
showProperColumns() ;
if(isVisible())
{
model->setVisible(true) ;
model->update() ;
}
connect( ui.dirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), model, SLOT( collapsed(const QModelIndex & ) ) );
connect( ui.dirTreeView, SIGNAL( expanded(const QModelIndex & ) ), model, SLOT( expanded(const QModelIndex & ) ) );
ui.dirTreeView->setModel(proxyModel);
ui.dirTreeView->update();
ui.dirTreeView->header()->headerDataChanged(Qt::Horizontal,0,4) ;
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW
if(c == 1)
#endif
FilterItems();
}
void LocalSharedFilesDialog::showProperColumns()
{
if(model == tree_model)
{
ui.dirTreeView->setColumnHidden(3,false) ;
ui.dirTreeView->setColumnHidden(4,false) ;
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW #ifdef DONT_USE_SEARCH_IN_TREE_VIEW
ui.filterLabel->hide(); ui.filterLabel->hide();
ui.filterPatternLineEdit->hide(); ui.filterPatternLineEdit->hide();
@ -312,37 +350,39 @@ void SharedFilesDialog::changeCurrentViewModel(int c)
} }
else else
{ {
model = flat_model ; ui.dirTreeView->setColumnHidden(3,true) ;
proxyModel = flat_proxyModel ; ui.dirTreeView->setColumnHidden(4,false) ;
ui.remoteDirTreeView->setColumnHidden(3,false) ;
ui.remoteDirTreeView->setColumnHidden(4,false) ;
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW #ifdef DONT_USE_SEARCH_IN_TREE_VIEW
ui.filterLabel->show(); ui.filterLabel->show();
ui.filterPatternLineEdit->show(); ui.filterPatternLineEdit->show();
#endif #endif
} }
}
if(isVisible()) void RemoteSharedFilesDialog::showProperColumns()
{
if(model == tree_model)
{ {
model->setVisible(true) ; ui.dirTreeView->setColumnHidden(3,true) ;
model->update() ; ui.dirTreeView->setColumnHidden(4,true) ;
}
connect( ui.remoteDirTreeView, SIGNAL( collapsed(const QModelIndex & ) ), model, SLOT( collapsed(const QModelIndex & ) ) );
connect( ui.remoteDirTreeView, SIGNAL( expanded(const QModelIndex & ) ), model, SLOT( expanded(const QModelIndex & ) ) );
ui.remoteDirTreeView->setModel(proxyModel);
ui.remoteDirTreeView->update();
ui.remoteDirTreeView->header()->headerDataChanged(Qt::Horizontal,0,4) ;
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW #ifdef DONT_USE_SEARCH_IN_TREE_VIEW
if(c == 1) ui.filterLabel->hide();
ui.filterPatternLineEdit->hide();
ui.filterStartButton->hide();
ui.filterClearButton->hide();
#endif #endif
FilterItems(); }
else
{
ui.dirTreeView->setColumnHidden(3,false) ;
ui.dirTreeView->setColumnHidden(4,false) ;
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW
ui.filterLabel->show();
ui.filterPatternLineEdit->show();
#endif
}
} }
void SharedFilesDialog::checkUpdate() void LocalSharedFilesDialog::checkUpdate()
{ {
/* update */ /* update */
if (rsFiles->InDirectoryCheck()) if (rsFiles->InDirectoryCheck())
@ -359,17 +399,15 @@ void SharedFilesDialog::checkUpdate()
return; return;
} }
void LocalSharedFilesDialog::forceCheck()
void SharedFilesDialog::forceCheck()
{ {
rsFiles->ForceDirectoryCheck(); rsFiles->ForceDirectoryCheck();
return; return;
} }
void RemoteSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
void SharedFilesDialog::shareddirtreeviewCostumPopupMenu( QPoint point )
{ {
QModelIndex idx = ui.remoteDirTreeView->indexAt(point); QModelIndex idx = ui.dirTreeView->indexAt(point);
if (!idx.isValid()) if (!idx.isValid())
return; return;
QModelIndex midx = proxyModel->mapToSource(idx); QModelIndex midx = proxyModel->mapToSource(idx);
@ -388,36 +426,25 @@ void SharedFilesDialog::shareddirtreeviewCostumPopupMenu( QPoint point )
contextMnu.addAction( downloadAct); contextMnu.addAction( downloadAct);
if (type == DIR_TYPE_FILE) { if (type == DIR_TYPE_FILE) {
QAction *copyremotelinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), &contextMnu ); //QAction *copyremotelinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), &contextMnu );
connect( copyremotelinkAct , SIGNAL( triggered() ), this, SLOT( copyLinkRemote() ) ); //connect( copyremotelinkAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) );
QAction *sendremotelinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link" ), &contextMnu ); //QAction *sendremotelinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link" ), &contextMnu );
connect( sendremotelinkAct , SIGNAL( triggered() ), this, SLOT( sendremoteLinkTo( ) ) ); //connect( sendremotelinkAct , SIGNAL( triggered() ), this, SLOT( sendremoteLinkTo( ) ) );
contextMnu.addSeparator(); contextMnu.addSeparator();
contextMnu.addAction( copyremotelinkAct); contextMnu.addAction( copylinkAct);
contextMnu.addAction( sendremotelinkAct); contextMnu.addAction( sendlinkAct);
contextMnu.addSeparator(); contextMnu.addSeparator();
contextMnu.addAction(QIcon(IMAGE_MSG), tr("Recommend in a message to"), this, SLOT(addMsgRemoteSelected())); contextMnu.addAction(QIcon(IMAGE_MSG), tr("Recommend in a message to"), this, SLOT(recommendFilesToMsg()));
} }
contextMnu.exec(QCursor::pos()); contextMnu.exec(QCursor::pos());
} }
QModelIndexList SharedFilesDialog::getLocalSelected() QModelIndexList SharedFilesDialog::getSelected()
{ {
QModelIndexList list = ui.localDirTreeView->selectionModel()->selectedIndexes(); QModelIndexList list = ui.dirTreeView->selectionModel()->selectedIndexes();
QModelIndexList proxyList;
for (QModelIndexList::iterator index = list.begin(); index != list.end(); index++) {
proxyList.append(localProxyModel->mapToSource(*index));
}
return proxyList;
}
QModelIndexList SharedFilesDialog::getRemoteSelected()
{
QModelIndexList list = ui.remoteDirTreeView->selectionModel()->selectedIndexes();
QModelIndexList proxyList; QModelIndexList proxyList;
for (QModelIndexList::iterator index = list.begin(); index != list.end(); index++) { for (QModelIndexList::iterator index = list.begin(); index != list.end(); index++) {
proxyList.append(proxyModel->mapToSource(*index)); proxyList.append(proxyModel->mapToSource(*index));
@ -426,27 +453,27 @@ QModelIndexList SharedFilesDialog::getRemoteSelected()
return proxyList; return proxyList;
} }
void SharedFilesDialog::createCollectionFile() void LocalSharedFilesDialog::createCollectionFile()
{ {
/* call back to the model (which does all the interfacing? */ /* call back to the model (which does all the interfacing? */
std::cerr << "Creating a collection file!" << std::endl; std::cerr << "Creating a collection file!" << std::endl;
QModelIndexList lst = getLocalSelected(); QModelIndexList lst = getSelected();
localModel->createCollectionFile(this, lst); model->createCollectionFile(this, lst);
} }
void SharedFilesDialog::downloadRemoteSelected() void RemoteSharedFilesDialog::downloadRemoteSelected()
{ {
/* call back to the model (which does all the interfacing? */ /* call back to the model (which does all the interfacing? */
std::cerr << "Downloading Files"; std::cerr << "Downloading Files";
std::cerr << std::endl; std::cerr << std::endl;
QModelIndexList lst = getRemoteSelected(); QModelIndexList lst = getSelected();
model -> downloadSelected(lst); model -> downloadSelected(lst);
} }
void SharedFilesDialog::editSharePermissions() void LocalSharedFilesDialog::editSharePermissions()
{ {
std::list<SharedDirInfo> dirs; std::list<SharedDirInfo> dirs;
rsFiles->getSharedDirectories(dirs); rsFiles->getSharedDirectories(dirs);
@ -468,10 +495,7 @@ void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote)
{ {
std::vector<DirDetails> dirVec; std::vector<DirDetails> dirVec;
if (remote)
model->getDirDetailsFromSelect(lst, dirVec); model->getDirDetailsFromSelect(lst, dirVec);
else
localModel->getDirDetailsFromSelect(lst, dirVec);
QList<RetroShareLink> urls ; QList<RetroShareLink> urls ;
@ -509,55 +533,24 @@ void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote)
RSLinkClipboard::copyLinks(urls) ; RSLinkClipboard::copyLinks(urls) ;
} }
void SharedFilesDialog::copyLinkRemote() void SharedFilesDialog::copyLink()
{ {
QModelIndexList lst = getRemoteSelected(); copyLink ( getSelected() , isRemote());
copyLink (lst, true);
}
void SharedFilesDialog::copyLinkLocal()
{
QModelIndexList lst = getLocalSelected();
copyLink (lst, false);
} }
void SharedFilesDialog::copyLinkhtml( ) void SharedFilesDialog::copyLinkhtml( )
{ {
copyLinkLocal (); copyLink();
QString link = QApplication::clipboard()->text(); QString link = QApplication::clipboard()->text();
QClipboard *clipboard = QApplication::clipboard(); QClipboard *clipboard = QApplication::clipboard();
clipboard->setText("<a href='" + link + "'> " + link + "</a>"); clipboard->setText("<a href='" + link + "'> " + link + "</a>");
}
void SharedFilesDialog::sendremoteLinkTo()
{
copyLinkRemote ();
/* create a message */
MessageComposer *nMsgDialog = MessageComposer::newMsg();
if (nMsgDialog == NULL) {
return;
}
/* fill it in
* files are receommended already
* just need to set peers
*/
std::cerr << "SharedFilesDialog::sendremoteLinkTo()" << std::endl;
nMsgDialog->setTitleText(tr("RetroShare Link"));
nMsgDialog->setMsgText(RSLinkClipboard::toHtml(), true);
nMsgDialog->show();
/* window will destroy itself! */
} }
void SharedFilesDialog::sendLinkTo() void SharedFilesDialog::sendLinkTo()
{ {
copyLinkLocal (); copyLink();
/* create a message */ /* create a message */
MessageComposer *nMsgDialog = MessageComposer::newMsg(); MessageComposer *nMsgDialog = MessageComposer::newMsg();
@ -581,7 +574,7 @@ void SharedFilesDialog::sendLinkTo()
#ifdef RS_USE_LINKS #ifdef RS_USE_LINKS
void SharedFilesDialog::sendLinkToCloud() void SharedFilesDialog::sendLinkToCloud()
{ {
copyLinkLocal (); copyLink();
AddLinksDialog *nAddLinksDialog = new AddLinksDialog(QApplication::clipboard()->text()); AddLinksDialog *nAddLinksDialog = new AddLinksDialog(QApplication::clipboard()->text());
@ -593,7 +586,7 @@ void SharedFilesDialog::sendLinkToCloud()
void SharedFilesDialog::addLinkToCloud() void SharedFilesDialog::addLinkToCloud()
{ {
copyLinkLocal (); copyLink();
AddLinksDialog *nAddLinksDialog = new AddLinksDialog(QApplication::clipboard()->text()); AddLinksDialog *nAddLinksDialog = new AddLinksDialog(QApplication::clipboard()->text());
@ -603,7 +596,7 @@ void SharedFilesDialog::addLinkToCloud()
} }
#endif #endif
void SharedFilesDialog::playselectedfiles() void LocalSharedFilesDialog::playselectedfiles()
{ {
/* call back to the model (which does all the interfacing? */ /* call back to the model (which does all the interfacing? */
@ -611,7 +604,7 @@ void SharedFilesDialog::playselectedfiles()
std::cerr << std::endl; std::cerr << std::endl;
std::list<std::string> paths; std::list<std::string> paths;
localModel -> getFilePaths(getLocalSelected(), paths); model -> getFilePaths(getSelected(), paths);
std::list<std::string>::iterator it; std::list<std::string>::iterator it;
QStringList fullpaths; QStringList fullpaths;
@ -623,7 +616,6 @@ void SharedFilesDialog::playselectedfiles()
std::cerr << "Playing: " << fullpath; std::cerr << "Playing: " << fullpath;
std::cerr << std::endl; std::cerr << std::endl;
} }
playFiles(fullpaths); playFiles(fullpaths);
@ -632,35 +624,11 @@ void SharedFilesDialog::playselectedfiles()
std::cerr << std::endl; std::cerr << std::endl;
} }
void SharedFilesDialog::addMsgRemoteSelected()
{
std::list<DirDetails> files_info ;
model->getFileInfoFromIndexList(getRemoteSelected(),files_info);
if(files_info.empty())
return ;
/* create a message */
MessageComposer *nMsgDialog = MessageComposer::newMsg();
if (nMsgDialog == NULL) {
return;
}
nMsgDialog->setFileList(files_info) ;
nMsgDialog->setTitleText(tr("Recommendation(s)"));
nMsgDialog->setMsgText(tr("Recommendation(s)"));
nMsgDialog->show();
/* window will destroy itself! */
}
void SharedFilesDialog::recommendFilesToMsg() void SharedFilesDialog::recommendFilesToMsg()
{ {
std::list<DirDetails> files_info ; std::list<DirDetails> files_info ;
localModel->getFileInfoFromIndexList(getLocalSelected(),files_info); model->getFileInfoFromIndexList(getSelected(),files_info);
if(files_info.empty()) if(files_info.empty())
return ; return ;
@ -680,98 +648,75 @@ void SharedFilesDialog::recommendFilesToMsg()
/* window will destroy itself! */ /* window will destroy itself! */
} }
void SharedFilesDialog::openfile() void LocalSharedFilesDialog::openfile()
{ {
/* call back to the model (which does all the interfacing? */ /* call back to the model (which does all the interfacing? */
std::cerr << "SharedFilesDialog::openfile" << std::endl; std::cerr << "SharedFilesDialog::openfile" << std::endl;
QModelIndexList qmil = getLocalSelected(); QModelIndexList qmil = getSelected();
localModel->openSelected(qmil); model->openSelected(qmil);
} }
void SharedFilesDialog::openfolder() void LocalSharedFilesDialog::openfolder()
{ {
std::cerr << "SharedFilesDialog::openfolder" << std::endl; std::cerr << "SharedFilesDialog::openfolder" << std::endl;
QModelIndexList qmil = getLocalSelected(); QModelIndexList qmil = getSelected();
localModel->openSelected(qmil); model->openSelected(qmil);
} }
void SharedFilesDialog::preModDirectories(bool update_local) void SharedFilesDialog::preModDirectories()
{ {
//std::cerr << "SharedFilesDialog::preModDirectories called with update_local = " << update_local << std::endl ;
if (update_local)
localModel->preMods();
else
model->preMods(); model->preMods();
} }
void SharedFilesDialog::postModDirectories()
void SharedFilesDialog::postModDirectories(bool update_local)
{ {
//std::cerr << "SharedFilesDialog::postModDirectories called with update_local = " << update_local << std::endl ;
if (update_local)
{
localModel->postMods();
ui.localDirTreeView->update() ;
}
else
{
model->postMods(); model->postMods();
ui.remoteDirTreeView->update() ; ui.dirTreeView->update() ;
if (ui.filterPatternLineEdit->text().isEmpty() == false) { if (ui.filterPatternLineEdit->text().isEmpty() == false)
FilterItems(); FilterItems();
}
}
QCoreApplication::flush(); QCoreApplication::flush();
} }
void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point ) void LocalSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
{ {
if (!rsPeers) { if (!rsPeers)
{
/* not ready yet! */ /* not ready yet! */
return; return;
} }
QModelIndex idx = ui.localDirTreeView->indexAt(point); QModelIndex idx = ui.dirTreeView->indexAt(point);
if (!idx.isValid()) if (!idx.isValid())
return; return;
QModelIndex midx = localProxyModel->mapToSource(idx); QModelIndex midx = proxyModel->mapToSource(idx);
if (!midx.isValid()) if (!midx.isValid())
return; return;
currentFile = localModel->data(midx, RetroshareDirModel::FileNameRole).toString(); currentFile = model->data(midx, RetroshareDirModel::FileNameRole).toString();
int type = localModel->getType(midx); int type = model->getType(midx);
QMenu contextMnu(this); QMenu contextMnu(this);
// QAction* menuAction = fileAssotiationAction(currentFile) ; switch (type)
//new QAction(QIcon(IMAGE_PLAY), currentFile, this); {
//tr( "111Play File(s)" ), this );
// connect( openfolderAct , SIGNAL( triggered() ), this,
// SLOT( playselectedfiles() ) );
switch (type) {
case DIR_TYPE_DIR: case DIR_TYPE_DIR:
contextMnu.addAction(openfolderAct); contextMnu.addAction(openfolderAct);
//contextMnu.addSeparator(); contextMnu.addSeparator() ;
//contextMnu.addAction(editshareAct) ;
contextMnu.addSeparator();
contextMnu.addAction(createcollectionfileAct) ; contextMnu.addAction(createcollectionfileAct) ;
break; break;
case DIR_TYPE_FILE: case DIR_TYPE_FILE:
contextMnu.addAction(openfileAct); contextMnu.addAction(openfileAct);
contextMnu.addSeparator(); contextMnu.addSeparator();
contextMnu.addAction(copylinklocalAct); contextMnu.addAction(copylinkAct);
// contextMnu.addAction(copylinklocalhtmlAct);
contextMnu.addAction(sendlinkAct); contextMnu.addAction(sendlinkAct);
// contextMnu.addAction(sendhtmllinkAct);
contextMnu.addSeparator(); contextMnu.addSeparator();
contextMnu.addAction(createcollectionfileAct) ; contextMnu.addAction(createcollectionfileAct) ;
contextMnu.addSeparator(); contextMnu.addSeparator();
@ -793,7 +738,7 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point )
//============================================================================ //============================================================================
QAction* QAction*
SharedFilesDialog::fileAssotiationAction(const QString /*fileName*/) LocalSharedFilesDialog::fileAssotiationAction(const QString /*fileName*/)
{ {
QAction* result = 0; QAction* result = 0;
@ -824,22 +769,17 @@ SharedFilesDialog::fileAssotiationAction(const QString /*fileName*/)
//============================================================================ //============================================================================
void void
SharedFilesDialog::runCommandForFile() LocalSharedFilesDialog::runCommandForFile()
{ {
QStringList tsl; QStringList tsl;
tsl.append( currentFile ); tsl.append( currentFile );
QProcess::execute( currentCommand, tsl); QProcess::execute( currentCommand, tsl);
//QString("%1 %2").arg(currentCommand).arg(currentFile) );
// QString tmess = "Some command(%1) should be executed here for file %2";
// tmess = tmess.arg(currentCommand).arg(currentFile);
// QMessageBox::warning(this, tr("RetroShare"), tmess, QMessageBox::Ok);
} }
//============================================================================ //============================================================================
void void
SharedFilesDialog::tryToAddNewAssotiation() LocalSharedFilesDialog::tryToAddNewAssotiation()
{ {
AddFileAssociationDialog afad(true, this);//'add file assotiations' dialog AddFileAssociationDialog afad(true, this);//'add file assotiations' dialog
@ -856,72 +796,18 @@ SharedFilesDialog::tryToAddNewAssotiation()
} }
} }
//============================================================================
/**
Toggles the Splitted, Remote and Local View on and off*/
void SharedFilesDialog::showFrame(bool show)
{
if (show) {
ui.localframe->setVisible(true);
ui.remoteframe->setVisible(false);
ui.localButton->setChecked(true);
ui.remoteButton->setChecked(false);
ui.splittedButton->setChecked(false);
ui.titleBarLabel->setText( tr("<strong>My Shared Files</strong>"));
}
}
void SharedFilesDialog::showFrameRemote(bool show)
{
if (show) {
ui.remoteframe->setVisible(true);
ui.localframe->setVisible(false);
ui.remoteButton->setChecked(true);
ui.localButton->setChecked(false);
ui.splittedButton->setChecked(false);
ui.titleBarLabel->setText( tr("<strong>Friends Files</strong>"));
}
}
void SharedFilesDialog::showFrameSplitted(bool show)
{
if (show) {
ui.remoteframe->setVisible(true);
ui.localframe->setVisible(true);
ui.splittedButton->setChecked(true);
ui.localButton->setChecked(false);
ui.remoteButton->setChecked(false);
ui.titleBarLabel->setText( tr("<strong>Files</strong>"));
}
}
void SharedFilesDialog::indicatorChanged(int index) void SharedFilesDialog::indicatorChanged(int index)
{ {
static uint32_t correct_indicator[4] = { IND_ALWAYS,IND_LAST_DAY,IND_LAST_WEEK,IND_LAST_MONTH } ; static uint32_t correct_indicator[4] = { IND_ALWAYS,IND_LAST_DAY,IND_LAST_WEEK,IND_LAST_MONTH } ;
model->changeAgeIndicator(correct_indicator[index]); model->changeAgeIndicator(correct_indicator[index]);
localModel->changeAgeIndicator(correct_indicator[index]);
ui.remoteDirTreeView->update(ui.remoteDirTreeView->rootIndex()); ui.dirTreeView->update(ui.dirTreeView->rootIndex());
ui.localDirTreeView->update(ui.localDirTreeView->rootIndex()) ;
if (correct_indicator[index] != IND_ALWAYS) if (correct_indicator[index] != IND_ALWAYS)
{ ui.dirTreeView->sortByColumn(2, Qt::AscendingOrder);
ui.remoteDirTreeView->sortByColumn(2, Qt::AscendingOrder);
}
else else
{ ui.dirTreeView->sortByColumn(0, Qt::AscendingOrder);
ui.remoteDirTreeView->sortByColumn(0, Qt::AscendingOrder);
}
updateDisplay() ; updateDisplay() ;
} }
@ -968,12 +854,12 @@ void SharedFilesDialog::FilterItems()
setCursor(Qt::WaitCursor); setCursor(Qt::WaitCursor);
QCoreApplication::processEvents() ; QCoreApplication::processEvents() ;
int rowCount = ui.remoteDirTreeView->model()->rowCount(); int rowCount = ui.dirTreeView->model()->rowCount();
for (int row = 0; row < rowCount; row++) for (int row = 0; row < rowCount; row++)
if(proxyModel == tree_proxyModel) if(proxyModel == tree_proxyModel)
tree_FilterItem(ui.remoteDirTreeView->model()->index(row, 0), text, 0); tree_FilterItem(ui.dirTreeView->model()->index(row, 0), text, 0);
else else
flat_FilterItem(ui.remoteDirTreeView->model()->index(row, 0), text, 0); flat_FilterItem(ui.dirTreeView->model()->index(row, 0), text, 0);
setCursor(Qt::ArrowCursor); setCursor(Qt::ArrowCursor);
} }
@ -982,12 +868,12 @@ bool SharedFilesDialog::flat_FilterItem(const QModelIndex &index, const QString
{ {
if(index.data(RetroshareDirModel::FileNameRole).toString().contains(text, Qt::CaseInsensitive)) if(index.data(RetroshareDirModel::FileNameRole).toString().contains(text, Qt::CaseInsensitive))
{ {
ui.remoteDirTreeView->setRowHidden(index.row(), index.parent(), false); ui.dirTreeView->setRowHidden(index.row(), index.parent(), false);
return false ; return false ;
} }
else else
{ {
ui.remoteDirTreeView->setRowHidden(index.row(), index.parent(), true); ui.dirTreeView->setRowHidden(index.row(), index.parent(), true);
return true ; return true ;
} }
} }
@ -1008,17 +894,17 @@ bool SharedFilesDialog::tree_FilterItem(const QModelIndex &index, const QString
} }
int visibleChildCount = 0; int visibleChildCount = 0;
int rowCount = ui.remoteDirTreeView->model()->rowCount(index); int rowCount = ui.dirTreeView->model()->rowCount(index);
for (int row = 0; row < rowCount; row++) { for (int row = 0; row < rowCount; row++) {
if (tree_FilterItem(ui.remoteDirTreeView->model()->index(row, index.column(), index), text, level + 1)) { if (tree_FilterItem(ui.dirTreeView->model()->index(row, index.column(), index), text, level + 1)) {
visibleChildCount++; visibleChildCount++;
} }
} }
if (visible || visibleChildCount) { if (visible || visibleChildCount) {
ui.remoteDirTreeView->setRowHidden(index.row(), index.parent(), false); ui.dirTreeView->setRowHidden(index.row(), index.parent(), false);
} else { } else {
ui.remoteDirTreeView->setRowHidden(index.row(), index.parent(), true); ui.dirTreeView->setRowHidden(index.row(), index.parent(), true);
} }
return (visible || visibleChildCount); return (visible || visibleChildCount);

View File

@ -34,55 +34,44 @@ class SharedFilesDialog : public RsAutoUpdatePage
public: public:
/** Default Constructor */ /** Default Constructor */
SharedFilesDialog(QWidget *parent = 0); SharedFilesDialog(RetroshareDirModel *tree_model,RetroshareDirModel *flat_model,QWidget *parent = 0);
/** Default Destructor */
~SharedFilesDialog(); /** Default Destructor */
~SharedFilesDialog() {}
virtual void updatePage() { checkUpdate() ; }
virtual void hideEvent(QHideEvent *) ; virtual void hideEvent(QHideEvent *) ;
virtual void showEvent(QShowEvent *) ; virtual void showEvent(QShowEvent *) ;
protected:
QTreeView *directoryView() ;
virtual void showProperColumns() = 0 ;
virtual bool isRemote() const = 0 ;
protected slots:
virtual void spawnCustomPopupMenu(QPoint point) = 0;
private slots: private slots:
/* For handling the model updates */ /* For handling the model updates */
void preModDirectories(bool update_local); void preModDirectories() ;
void postModDirectories(bool update_local); void postModDirectories() ;
void checkUpdate();
void forceCheck();
/** Create the context popup menu and it's submenus */ /** Create the context popup menu and it's submenus */
void shareddirtreeviewCostumPopupMenu( QPoint point ); // void customPopupMenu(QPoint point) ;
void sharedDirTreeWidgetContextMenu( QPoint point ); void copyLink();
void downloadRemoteSelected();
void createCollectionFile();
void addMsgRemoteSelected();
void copyLinkRemote();
void copyLinkLocal();
void copyLinkhtml(); void copyLinkhtml();
void sendLinkTo(); void sendLinkTo();
void sendremoteLinkTo();
#ifdef RS_USE_LINKS #ifdef RS_USE_LINKS
void sendLinkToCloud(); void sendLinkToCloud();
void addLinkToCloud(); void addLinkToCloud();
#endif #endif
void showFrame(bool show); //== void showFrame(bool show);
void showFrameRemote(bool show); //== void showFrameRemote(bool show);
void showFrameSplitted(bool show); //== void showFrameSplitted(bool show);
void playselectedfiles();
void openfile();
void openfolder();
void editSharePermissions();
void recommendFilesToMsg(); void recommendFilesToMsg();
void runCommandForFile();
void tryToAddNewAssotiation();
void indicatorChanged(int index); void indicatorChanged(int index);
@ -95,7 +84,12 @@ private slots:
signals: signals:
void playFiles(QStringList files); void playFiles(QStringList files);
private: protected:
/** Qt Designer generated object */
Ui::SharedFilesDialog ui;
virtual void processSettings(bool bLoad) = 0;
protected:
//now context menu are created again every time theu are called ( in some //now context menu are created again every time theu are called ( in some
//slots.. Maybe it's not good... //slots.. Maybe it's not good...
//** Define the popup menus for the Context menu */ //** Define the popup menus for the Context menu */
@ -103,34 +97,23 @@ private:
//QMenu* contextMnu2; //QMenu* contextMnu2;
void processSettings(bool bLoad);
void copyLink (const QModelIndexList& lst, bool remote); void copyLink (const QModelIndexList& lst, bool remote);
void FilterItems(); void FilterItems();
bool tree_FilterItem(const QModelIndex &index, const QString &text, int level); bool tree_FilterItem(const QModelIndex &index, const QString &text, int level);
bool flat_FilterItem(const QModelIndex &index, const QString &text, int level); bool flat_FilterItem(const QModelIndex &index, const QString &text, int level);
QModelIndexList getRemoteSelected(); QModelIndexList getSelected();
QModelIndexList getLocalSelected();
/** Defines the actions for the context menu for QTreeWidget */ /** Defines the actions for the context menu for QTreeWidget */
QAction* openfileAct; QAction* copylinkAct;
QAction* createcollectionfileAct;
QAction* openfolderAct;
QAction* copyremotelinkAct;
QAction* copylinklocalAct;
QAction* sendlinkAct; QAction* sendlinkAct;
QAction* editshareAct;
#ifdef RS_USE_LINKS #ifdef RS_USE_LINKS
QAction* sendlinkCloudAct; QAction* sendlinkCloudAct;
QAction* addlinkCloudAct; QAction* addlinkCloudAct;
#endif #endif
QAction* sendchatlinkAct; QAction* sendchatlinkAct;
QAction* copylinklocalhtmlAct; QAction* copylinkhtmlAct;
/** Qt Designer generated object */
Ui::SharedFilesDialog ui;
/* RetroshareDirModel */ /* RetroshareDirModel */
RetroshareDirModel *tree_model; RetroshareDirModel *tree_model;
@ -140,15 +123,65 @@ private:
QSortFilterProxyModel *flat_proxyModel; QSortFilterProxyModel *flat_proxyModel;
QSortFilterProxyModel *proxyModel; QSortFilterProxyModel *proxyModel;
RetroshareDirModel *localModel;
QSortFilterProxyModel *localProxyModel;
QString currentCommand; QString currentCommand;
QString currentFile; QString currentFile;
QString lastFilterString; QString lastFilterString;
};
class LocalSharedFilesDialog : public SharedFilesDialog
{
Q_OBJECT
public:
LocalSharedFilesDialog(QWidget *parent=NULL) ;
virtual ~LocalSharedFilesDialog();
virtual void spawnCustomPopupMenu(QPoint point);
virtual void updatePage() { checkUpdate() ; }
protected:
virtual void processSettings(bool bLoad) ;
virtual void showProperColumns() ;
virtual bool isRemote() const { return false ; }
private slots:
void addShares();
void createCollectionFile();
void checkUpdate() ;
void editSharePermissions();
void playselectedfiles();
void openfile();
void openfolder();
void runCommandForFile();
void tryToAddNewAssotiation();
void forceCheck();
QAction* fileAssotiationAction(const QString fileName); QAction* fileAssotiationAction(const QString fileName);
private:
QAction* openfileAct;
QAction* createcollectionfileAct;
QAction* openfolderAct;
QAction* editshareAct;
};
class RemoteSharedFilesDialog : public SharedFilesDialog
{
Q_OBJECT
public:
RemoteSharedFilesDialog(QWidget *parent=NULL) ;
virtual ~RemoteSharedFilesDialog() ;
virtual void spawnCustomPopupMenu(QPoint point);
protected:
virtual void processSettings(bool bLoad) ;
virtual void showProperColumns() ;
virtual bool isRemote() const { return true ; }
private slots:
void downloadRemoteSelected();
}; };
#endif #endif

View File

@ -14,167 +14,6 @@
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>0</number> <number>0</number>
</property> </property>
<item row="1" column="0">
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QFrame" name="remoteframe">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QTreeView" name="remoteDirTreeView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>4</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragOnly</enum>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
</property>
<property name="autoExpandDelay">
<number>0</number>
</property>
<property name="itemsExpandable">
<bool>true</bool>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="headerStretchLastSection">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>
</widget>
<widget class="QFrame" name="localframe">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QTreeView" name="localDirTreeView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragOnly</enum>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ContiguousSelection</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="headerStretchLastSection">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="2" column="0">
<layout class="QGridLayout" name="gridLayout_4">
<property name="topMargin">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QPushButton" name="downloadButton">
<property name="minimumSize">
<size>
<width>140</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>28</height>
</size>
</property>
<property name="toolTip">
<string>Download selected</string>
</property>
<property name="text">
<string>Download</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/download16.png</normaloff>:/images/download16.png</iconset>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>391</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="checkButton">
<property name="text">
<string>check files</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="hashLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QFrame" name="titleBarFrame"> <widget class="QFrame" name="titleBarFrame">
<property name="sizePolicy"> <property name="sizePolicy">
@ -297,8 +136,7 @@
</size> </size>
</property> </property>
<property name="font"> <property name="font">
<font> <font/>
</font>
</property> </property>
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::NoFocus</enum> <enum>Qt::NoFocus</enum>
@ -330,8 +168,7 @@
</size> </size>
</property> </property>
<property name="font"> <property name="font">
<font> <font/>
</font>
</property> </property>
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::NoFocus</enum> <enum>Qt::NoFocus</enum>
@ -416,89 +253,113 @@ border-image: url(:/images/closepressed.png)
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="splittedButton"> <widget class="QLabel" name="hashLabel">
<property name="maximumSize"> <property name="text">
<size> <string/>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Split View</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/view_split_top_bottom.png</normaloff>:/images/view_split_top_bottom.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="remoteButton"> <widget class="QPushButton" name="checkButton">
<property name="maximumSize"> <property name="text">
<size> <string>check files</string>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Friends Folders</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/friendsfolder24.png</normaloff>:/images/friendsfolder24.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="localButton"> <widget class="QPushButton" name="downloadButton">
<property name="maximumSize"> <property name="minimumSize">
<size> <size>
<width>24</width> <width>140</width>
<height>24</height> <height>0</height>
</size> </size>
</property> </property>
<property name="focusPolicy"> <property name="maximumSize">
<enum>Qt::NoFocus</enum> <size>
<width>16777215</width>
<height>28</height>
</size>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>My Folders</string> <string>Download selected</string>
</property>
<property name="text">
<string>Download</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="images.qrc"> <iconset resource="images.qrc">
<normaloff>:/images/folder16.png</normaloff>:/images/folder16.png</iconset> <normaloff>:/images/download16.png</normaloff>:/images/download16.png</iconset>
</property> </property>
<property name="checkable"> </widget>
<bool>true</bool> </item>
<item>
<widget class="QPushButton" name="addShares_PB">
<property name="text">
<string/>
</property> </property>
<property name="autoRaise"> <property name="icon">
<bool>true</bool> <iconset resource="images.qrc">
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QFrame" name="remoteframe">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QTreeView" name="dirTreeView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>4</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragOnly</enum>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
</property>
<property name="autoExpandDelay">
<number>0</number>
</property>
<property name="itemsExpandable">
<bool>true</bool>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="headerStretchLastSection">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources> <resources>

View File

@ -42,8 +42,8 @@
#include "DLListDelegate.h" #include "DLListDelegate.h"
#include "ULListDelegate.h" #include "ULListDelegate.h"
#include "FileTransferInfoWidget.h" #include "FileTransferInfoWidget.h"
#include "TurtleRouterDialog.h" #include "SearchDialog.h"
#include "TurtleRouterStatistics.h" #include "SharedFilesDialog.h"
#include "xprogressbar.h" #include "xprogressbar.h"
#include "settings/rsharesettings.h" #include "settings/rsharesettings.h"
#include "util/misc.h" #include "util/misc.h"
@ -66,6 +66,7 @@
/* Images for context menu icons */ /* Images for context menu icons */
#define IMAGE_INFO ":/images/fileinfo.png" #define IMAGE_INFO ":/images/fileinfo.png"
#define IMAGE_CANCEL ":/images/delete.png" #define IMAGE_CANCEL ":/images/delete.png"
#define IMAGE_LIBRARY ":/images/library.png"
#define IMAGE_CLEARCOMPLETED ":/images/deleteall.png" #define IMAGE_CLEARCOMPLETED ":/images/deleteall.png"
#define IMAGE_PLAY ":/images/player_play.png" #define IMAGE_PLAY ":/images/player_play.png"
#define IMAGE_COPYLINK ":/images/copyrslink.png" #define IMAGE_COPYLINK ":/images/copyrslink.png"
@ -81,11 +82,10 @@
#define IMAGE_PRIORITYNORMAL ":/images/prioritynormal.png" #define IMAGE_PRIORITYNORMAL ":/images/prioritynormal.png"
#define IMAGE_PRIORITYHIGH ":/images/priorityhigh.png" #define IMAGE_PRIORITYHIGH ":/images/priorityhigh.png"
#define IMAGE_PRIORITYAUTO ":/images/priorityauto.png" #define IMAGE_PRIORITYAUTO ":/images/priorityauto.png"
#define IMAGE_SEARCH ":/images/filefind.png"
Q_DECLARE_METATYPE(FileProgressInfo) Q_DECLARE_METATYPE(FileProgressInfo)
DetailsDialog *TransfersDialog::detailsdlg = NULL;
class SortByNameItem : public QStandardItem class SortByNameItem : public QStandardItem
{ {
public: public:
@ -292,20 +292,24 @@ TransfersDialog::TransfersDialog(QWidget *parent)
// set default column and sort order for upload // set default column and sort order for upload
ui.uploadsList->sortByColumn(UNAME, Qt::AscendingOrder); ui.uploadsList->sortByColumn(UNAME, Qt::AscendingOrder);
FileTransferInfoWidget *ftiw = new FileTransferInfoWidget(); // FileTransferInfoWidget *ftiw = new FileTransferInfoWidget();
ui.fileTransferInfoWidget->setWidget(ftiw); // ui.fileTransferInfoWidget->setWidget(ftiw);
ui.fileTransferInfoWidget->setWidgetResizable(true); // ui.fileTransferInfoWidget->setWidgetResizable(true);
ui.fileTransferInfoWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // ui.fileTransferInfoWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
ui.fileTransferInfoWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); // ui.fileTransferInfoWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
ui.fileTransferInfoWidget->viewport()->setBackgroundRole(QPalette::NoRole); // ui.fileTransferInfoWidget->viewport()->setBackgroundRole(QPalette::NoRole);
ui.fileTransferInfoWidget->setFrameStyle(QFrame::NoFrame); // ui.fileTransferInfoWidget->setFrameStyle(QFrame::NoFrame);
ui.fileTransferInfoWidget->setFocusPolicy(Qt::NoFocus); // ui.fileTransferInfoWidget->setFocusPolicy(Qt::NoFocus);
QObject::connect(ui.downloadList->selectionModel(),SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)),this,SLOT(showFileDetails())) ; QObject::connect(ui.downloadList->selectionModel(),SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)),this,SLOT(showFileDetails())) ;
ui.tabWidget->addTab( new TurtleRouterStatistics(), tr("Router Statistics")) ; ui.tabWidget->insertTab(2,searchDialog = new SearchDialog(), QIcon(IMAGE_SEARCH), tr("Search")) ;
ui.tabWidget->insertTab(3,remoteSharedFiles = new RemoteSharedFilesDialog(), QIcon(IMAGE_SEARCH), tr("Friends files")) ;
ui.tabWidget->addTab( new TurtleRouterDialog(), tr("Router Requests")) ; ui.tabWidget->addTab(localSharedFiles = new LocalSharedFilesDialog(), QIcon(IMAGE_SEARCH), tr("Your files")) ;
//ui.tabWidget->addTab( new TurtleRouterStatistics(), tr("Router Statistics")) ;
//ui.tabWidget->addTab( new TurtleRouterDialog(), tr("Router Requests")) ;
for(int i=0;i<rsPlugins->nbPlugins();++i) for(int i=0;i<rsPlugins->nbPlugins();++i)
if(rsPlugins->plugin(i) != NULL && rsPlugins->plugin(i)->qt_transfers_tab() != NULL) if(rsPlugins->plugin(i) != NULL && rsPlugins->plugin(i)->qt_transfers_tab() != NULL)
@ -327,8 +331,12 @@ TransfersDialog::TransfersDialog(QWidget *parent)
#endif #endif
QObject::connect(ui._showCacheTransfers_CB,SIGNAL(toggled(bool)),this,SLOT(insertTransfers())) ; toggleShowCacheTransfersAct = new QAction(tr( "Show cache transfers" ), this );
QObject::connect(ui.openCollection, SIGNAL(clicked()), this, SLOT(openCollection())); toggleShowCacheTransfersAct->setCheckable(true) ;
connect(toggleShowCacheTransfersAct,SIGNAL(triggered()),this,SLOT(toggleShowCacheTransfers())) ;
openCollectionAct = new QAction(QIcon(IMAGE_LIBRARY), tr( "Download from collection file..." ), this );
connect(openCollectionAct, SIGNAL(triggered()), this, SLOT(openCollection()));
// Actions. Only need to be defined once. // Actions. Only need to be defined once.
pauseAct = new QAction(QIcon(IMAGE_PAUSE), tr("Pause"), this); pauseAct = new QAction(QIcon(IMAGE_PAUSE), tr("Pause"), this);
@ -405,6 +413,12 @@ UserNotify *TransfersDialog::getUserNotify(QObject *parent)
return new TransferUserNotify(parent); return new TransferUserNotify(parent);
} }
void TransfersDialog::toggleShowCacheTransfers()
{
_show_cache_transfers = !_show_cache_transfers ;
insertTransfers() ;
}
void TransfersDialog::processSettings(bool bLoad) void TransfersDialog::processSettings(bool bLoad)
{ {
m_bProcessSettings = true; m_bProcessSettings = true;
@ -418,14 +432,14 @@ void TransfersDialog::processSettings(bool bLoad)
// load settings // load settings
// state of checks // state of checks
ui._showCacheTransfers_CB->setChecked(Settings->value("showCacheTransfers", false).toBool()); _show_cache_transfers = Settings->value("showCacheTransfers", false).toBool();
// state of the lists // state of the lists
DLHeader->restoreState(Settings->value("downloadList").toByteArray()); DLHeader->restoreState(Settings->value("downloadList").toByteArray());
ULHeader->restoreState(Settings->value("uploadList").toByteArray()); ULHeader->restoreState(Settings->value("uploadList").toByteArray());
// state of splitter // state of splitter
ui.splitter->restoreState(Settings->value("Splitter").toByteArray()); // ui.splitter->restoreState(Settings->value("Splitter").toByteArray());
// selected tab // selected tab
ui.tabWidget->setCurrentIndex(Settings->value("selectedTab").toInt()); ui.tabWidget->setCurrentIndex(Settings->value("selectedTab").toInt());
@ -433,14 +447,14 @@ void TransfersDialog::processSettings(bool bLoad)
// save settings // save settings
// state of checks // state of checks
Settings->setValue("showCacheTransfers", ui._showCacheTransfers_CB->isChecked()); Settings->setValue("showCacheTransfers", _show_cache_transfers);
// state of the lists // state of the lists
Settings->setValue("downloadList", DLHeader->saveState()); Settings->setValue("downloadList", DLHeader->saveState());
Settings->setValue("uploadList", ULHeader->saveState()); Settings->setValue("uploadList", ULHeader->saveState());
// state of splitter // state of splitter
Settings->setValue("Splitter", ui.splitter->saveState()); // Settings->setValue("Splitter", ui.splitter->saveState());
// selected tab // selected tab
Settings->setValue("selectedTab", ui.tabWidget->currentIndex()); Settings->setValue("selectedTab", ui.tabWidget->currentIndex());
@ -606,6 +620,12 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint /*point*/ )
contextMnu.addSeparator(); contextMnu.addSeparator();
contextMnu.addAction( toggleShowCacheTransfersAct ) ;
toggleShowCacheTransfersAct->setChecked(_show_cache_transfers) ;
contextMnu.addAction( openCollectionAct ) ;
contextMnu.addSeparator();
contextMnu.exec(QCursor::pos()); contextMnu.exec(QCursor::pos());
} }
@ -908,8 +928,6 @@ void TransfersDialog::insertTransfers()
std::list<std::string> downHashes; std::list<std::string> downHashes;
rsFiles->FileDownloads(downHashes); rsFiles->FileDownloads(downHashes);
bool showCacheTransfers = ui._showCacheTransfers_CB->isChecked();
/* get only once */ /* get only once */
std::map<std::string, std::string> versions; std::map<std::string, std::string> versions;
rsDisc->getDiscVersions(versions); rsDisc->getDiscVersions(versions);
@ -945,7 +963,7 @@ void TransfersDialog::insertTransfers()
continue; continue;
} }
if ((fileInfo.transfer_info_flags & RS_FILE_REQ_CACHE) && !showCacheTransfers) { if ((fileInfo.transfer_info_flags & RS_FILE_REQ_CACHE) && !_show_cache_transfers) {
// if file transfer is a cache file index file, don't show it // if file transfer is a cache file index file, don't show it
DLListModel->removeRow(row); DLListModel->removeRow(row);
rowCount = DLListModel->rowCount(); rowCount = DLListModel->rowCount();
@ -971,7 +989,7 @@ void TransfersDialog::insertTransfers()
continue; continue;
} }
if ((fileInfo.transfer_info_flags & RS_FILE_REQ_CACHE) && !showCacheTransfers) { if ((fileInfo.transfer_info_flags & RS_FILE_REQ_CACHE) && !_show_cache_transfers) {
//if file transfer is a cache file index file, don't show it //if file transfer is a cache file index file, don't show it
continue; continue;
} }
@ -998,7 +1016,7 @@ void TransfersDialog::insertTransfers()
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_UPLOAD, info)) if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_UPLOAD, info))
continue; continue;
if((info.transfer_info_flags & RS_FILE_REQ_CACHE) && showCacheTransfers) if((info.transfer_info_flags & RS_FILE_REQ_CACHE) && _show_cache_transfers)
continue ; continue ;
std::list<TransferInfo>::iterator pit; std::list<TransferInfo>::iterator pit;
@ -1170,39 +1188,23 @@ void TransfersDialog::copyLink ()
RSLinkClipboard::copyLinks(links) ; RSLinkClipboard::copyLinks(links) ;
} }
DetailsDialog *TransfersDialog::detailsDialog()
{
static DetailsDialog *detailsdlg = new DetailsDialog ;
return detailsdlg ;
}
void TransfersDialog::showDetailsDialog() void TransfersDialog::showDetailsDialog()
{ {
if (detailsdlg == NULL) {
// create window
detailsdlg = new DetailsDialog ();
}
updateDetailsDialog (); updateDetailsDialog ();
detailsdlg->show(); detailsDialog()->show();
} }
void TransfersDialog::updateDetailsDialog() void TransfersDialog::updateDetailsDialog()
{ {
if (detailsdlg == NULL) {
return;
}
std::string file_hash ; std::string file_hash ;
QString fhash;
QString fsize;
QString fname;
QString fstatus;
QString fpriority;
QString fsources;
qulonglong filesize = 0;
double fdatarate = 0;
qulonglong fcompleted = 0;
qulonglong fremaining = 0;
qulonglong fdownloadtime = 0;
std::set<int> rows; std::set<int> rows;
std::set<int>::iterator it; std::set<int>::iterator it;
getSelectedItems(NULL, &rows); getSelectedItems(NULL, &rows);
@ -1210,84 +1212,10 @@ void TransfersDialog::updateDetailsDialog()
if (rows.size()) { if (rows.size()) {
int row = *rows.begin(); int row = *rows.begin();
fhash = getID(row, DLListModel);
fsize = getFileSize(row, DLListModel);
fname = getFileName(row, DLListModel);
fstatus = getStatus(row, DLListModel);
fpriority = getPriority(row, DLListModel);
fsources = getSources(row, DLListModel);
filesize = getFileSize(row, DLListModel);
fdatarate = getSpeed(row, DLListModel);
fcompleted = getTransfered(row, DLListModel);
fremaining = getRemainingTime(row, DLListModel);
fdownloadtime = getDownloadTime(row, DLListModel);
// maybe show all links in retroshare link(s) Tab
// int nb_select = 0 ;
//
// for(int i = 0; i <= DLListModel->rowCount(); i++)
// if(selection->isRowSelected(i, QModelIndex()))
// {
// file_hash = getID(i, DLListModel).toStdString();
// ++nb_select ;
// }
file_hash = getID(row, DLListModel).toStdString(); file_hash = getID(row, DLListModel).toStdString();
} }
detailsdlg->setFileHash(file_hash); detailsDialog()->setFileHash(file_hash);
// Set Details.. Window Title
detailsdlg->setWindowTitle(tr("Details:") + fname);
// General GroupBox
detailsdlg->setHash(fhash);
detailsdlg->setFileName(fname);
detailsdlg->setSize(filesize);
detailsdlg->setStatus(fstatus);
detailsdlg->setPriority(fpriority);
detailsdlg->setType(QFileInfo(fname).suffix());
// Transfer GroupBox
detailsdlg->setSources(fsources);
detailsdlg->setDatarate(fdatarate);
if (fname.isEmpty()) {
detailsdlg->setCompleted(misc::friendlyUnit(-1));
detailsdlg->setRemaining(misc::friendlyUnit(-1));
} else {
detailsdlg->setCompleted(misc::friendlyUnit(fcompleted));
detailsdlg->setRemaining(misc::friendlyUnit(fremaining));
}
//Date GroupBox
if (fname.isEmpty()) {
detailsdlg->setDownloadtime(misc::userFriendlyDuration(-1));
} else {
detailsdlg->setDownloadtime(misc::userFriendlyDuration(fdownloadtime));
}
// retroshare link(s) Tab
if (fname.isEmpty()) {
detailsdlg->setLink("");
} else {
RetroShareLink link;
if (link.createFile(fname, filesize, fhash)) {
detailsdlg->setLink(link.toString());
} else {
detailsdlg->setLink("");
}
}
FileChunksInfo info ;
if (fhash.isEmpty() == false && rsFiles->FileDownloadChunksDetails(fhash.toStdString(), info)) {
detailsdlg->setChunkSize(info.chunk_size);
detailsdlg->setNumberOfChunks(info.chunks.size());
} else {
detailsdlg->setChunkSize(0);
detailsdlg->setNumberOfChunks(0);
}
} }
void TransfersDialog::pasteLink() void TransfersDialog::pasteLink()
@ -1593,13 +1521,9 @@ void TransfersDialog::showFileDetails()
++nb_select ; ++nb_select ;
} }
if(nb_select != 1) if(nb_select != 1)
dynamic_cast<FileTransferInfoWidget*>(ui.fileTransferInfoWidget->widget())->setFileHash("") ; detailsDialog()->setFileHash("") ;
else else
dynamic_cast<FileTransferInfoWidget*>(ui.fileTransferInfoWidget->widget())->setFileHash(file_hash) ; detailsDialog()->setFileHash(file_hash) ;
std::cout << "calling update " << std::endl ;
dynamic_cast<FileTransferInfoWidget*>(ui.fileTransferInfoWidget->widget())->updateDisplay() ;
std::cout << "done" << std::endl ;
updateDetailsDialog (); updateDetailsDialog ();
} }

View File

@ -36,6 +36,9 @@ class QStandardItemModel;
class QStandardItem; class QStandardItem;
class DetailsDialog; class DetailsDialog;
class FileProgressInfo; class FileProgressInfo;
class SearchDialog;
class LocalSharedFilesDialog;
class RemoteSharedFilesDialog;
class TransfersDialog : public RsAutoUpdatePage class TransfersDialog : public RsAutoUpdatePage
{ {
@ -52,7 +55,11 @@ public:
// virtual void keyPressEvent(QKeyEvent *) ; // virtual void keyPressEvent(QKeyEvent *) ;
virtual void updateDisplay() ; // derived from RsAutoUpdateWidget virtual void updateDisplay() ; // derived from RsAutoUpdateWidget
static DetailsDialog *detailsdlg; static DetailsDialog *detailsDialog() ;
SearchDialog *searchDialog ;
LocalSharedFilesDialog *localSharedFiles ;
RemoteSharedFilesDialog *remoteSharedFiles ;
public slots: public slots:
void insertTransfers(); void insertTransfers();
@ -150,6 +157,8 @@ private:
QAction *chunkRandomAct; QAction *chunkRandomAct;
QAction *chunkStreamingAct; QAction *chunkStreamingAct;
QAction *detailsfileAct; QAction *detailsfileAct;
QAction *toggleShowCacheTransfersAct;
QAction *openCollectionAct;
bool m_bProcessSettings; bool m_bProcessSettings;
void processSettings(bool bLoad); void processSettings(bool bLoad);
@ -167,6 +176,7 @@ private:
/** Qt Designer generated object */ /** Qt Designer generated object */
Ui::TransfersDialog ui; Ui::TransfersDialog ui;
bool _show_cache_transfers ;
public slots: public slots:
// these two functions add entries to the transfers dialog, and return the row id of the entry modified/added // these two functions add entries to the transfers dialog, and return the row id of the entry modified/added
// //
@ -176,6 +186,7 @@ public slots:
int addUploadItem(const QString& symbol, const QString& name, const QString& coreID, qlonglong size, const FileProgressInfo& pinfo, double dlspeed, const QString& sources,const QString& source_id, const QString& status, qlonglong completed, qlonglong remaining); int addUploadItem(const QString& symbol, const QString& name, const QString& coreID, qlonglong size, const FileProgressInfo& pinfo, double dlspeed, const QString& sources,const QString& source_id, const QString& status, qlonglong completed, qlonglong remaining);
void showFileDetails() ; void showFileDetails() ;
void toggleShowCacheTransfers() ;
double getProgress(int row, QStandardItemModel *model); double getProgress(int row, QStandardItemModel *model);
double getSpeed(int row, QStandardItemModel *model); double getSpeed(int row, QStandardItemModel *model);

View File

@ -10,18 +10,31 @@
<height>353</height> <height>353</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item row="0" column="0"> <item>
<widget class="QSplitter" name="splitter"> <widget class="QTabWidget" name="tabWidget">
<property name="orientation"> <property name="font">
<enum>Qt::Vertical</enum> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<widget class="QWidget" name="layoutWidget"> <property name="currentIndex">
<layout class="QGridLayout"> <number>1</number>
<property name="spacing"> </property>
<widget class="QWidget" name="tab">
<attribute name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/down.png</normaloff>:/images/down.png</iconset>
</attribute>
<attribute name="title">
<string>Downloads</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<item row="1" column="0"> <item>
<widget class="QTreeView" name="downloadList"> <widget class="QTreeView" name="downloadList">
<property name="font"> <property name="font">
<font> <font>
@ -72,102 +85,8 @@
</attribute> </attribute>
</widget> </widget>
</item> </item>
<item row="0" column="0">
<widget class="QFrame" name="titleBarFrame">
<property name="minimumSize">
<size>
<width>0</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="titleBarPixmap">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/down.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="titleBarLabel">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Downloads</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>483</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="openCollection">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Open Collection</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="_showCacheTransfers_CB">
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="text">
<string>Show cache transfers</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item>
</layout>
</widget>
<widget class="QTabWidget" name="tabWidget">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="uploadsTab"> <widget class="QWidget" name="uploadsTab">
<attribute name="icon"> <attribute name="icon">
<iconset resource="images.qrc"> <iconset resource="images.qrc">
@ -197,151 +116,6 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="transferTab">
<attribute name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/blockdevice.png</normaloff>:/images/blockdevice.png</iconset>
</attribute>
<attribute name="title">
<string>Selected transfer</string>
</attribute>
<layout class="QGridLayout">
<property name="margin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QScrollArea" name="fileTransferInfoWidget">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>30</height>
</rect>
</property>
</widget>
</widget>
</item>
<item row="1" column="0">
<layout class="QGridLayout">
<property name="margin">
<number>6</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/graph-downloaded.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Done</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/graph-downloading.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Active</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="3">
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/graph-notdownload.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Outstanding</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="4">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>368</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/graph-checking.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>Needs checking</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</widget> </widget>
</item> </item>
</layout> </layout>

View File

@ -25,6 +25,7 @@
#include <QMenu> #include <QMenu>
#include "ChatLobbyDialog.h" #include "ChatLobbyDialog.h"
#include "gui/ChatLobbyWidget.h"
#include "ChatTabWidget.h" #include "ChatTabWidget.h"
#include "gui/settings/rsharesettings.h" #include "gui/settings/rsharesettings.h"
#include "gui/settings/RsharePeerSettings.h" #include "gui/settings/RsharePeerSettings.h"
@ -32,6 +33,7 @@
#include "gui/FriendsDialog.h" #include "gui/FriendsDialog.h"
#include <gui/common/html.h> #include <gui/common/html.h>
#include "gui/common/RSTreeWidgetItem.h" #include "gui/common/RSTreeWidgetItem.h"
#include "gui/common/FriendSelectionDialog.h"
#include <retroshare/rsnotify.h> #include <retroshare/rsnotify.h>
@ -56,9 +58,45 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::WF
ui.participantsList->setColumnCount(COLUMN_COUNT); ui.participantsList->setColumnCount(COLUMN_COUNT);
ui.participantsList->setColumnWidth(COLUMN_ICON, 20); ui.participantsList->setColumnWidth(COLUMN_ICON, 20);
// Mute a Participant
muteAct = new QAction(QIcon(), tr("Mute participant"), this); muteAct = new QAction(QIcon(), tr("Mute participant"), this);
connect(muteAct, SIGNAL(triggered()), this, SLOT(changePartipationState())); connect(muteAct, SIGNAL(triggered()), this, SLOT(changePartipationState()));
// Add a button to invite friends.
//
inviteFriendsButton = new QPushButton ;
inviteFriendsButton->setMinimumSize(QSize(28,28)) ;
inviteFriendsButton->setMaximumSize(QSize(28,28)) ;
inviteFriendsButton->setText(QString()) ;
inviteFriendsButton->setToolTip(tr("Invite friends to this lobby"));
QIcon icon ;
icon.addPixmap(QPixmap(":/images/edit_add24.png")) ;
inviteFriendsButton->setIcon(icon) ;
inviteFriendsButton->setIconSize(QSize(22,22)) ;
connect(inviteFriendsButton, SIGNAL(clicked()), this , SLOT(inviteFriends()));
getChatWidget()->addChatButton(inviteFriendsButton) ;
}
void ChatLobbyDialog::inviteFriends()
{
std::cerr << "Inviting friends" << std::endl;
std::list<std::string> ids = FriendSelectionDialog::selectFriends() ;
std::cerr << "Inviting these friends:" << std::endl;
ChatLobbyId lobby_id;
if (!rsMsgs->isLobbyId(getPeerId(), lobby_id))
return ;
for(std::list<std::string>::const_iterator it(ids.begin());it!=ids.end();++it)
{
std::cerr << " " << *it << std::endl;
rsMsgs->invitePeerToLobby(lobby_id,*it) ;
}
} }
void ChatLobbyDialog::participantsTreeWidgetCostumPopupMenu(QPoint) void ChatLobbyDialog::participantsTreeWidgetCostumPopupMenu(QPoint)
@ -123,7 +161,8 @@ void ChatLobbyDialog::init(const std::string &peerId, const QString &title)
showParticipantsFrame(PeerSettings->getShowParticipantsFrame(peerId)); showParticipantsFrame(PeerSettings->getShowParticipantsFrame(peerId));
// add to window // add to window
ChatTabWidget *tabWidget = FriendsDialog::getTabWidget(); ChatTabWidget *tabWidget = ChatLobbyWidget::getTabWidget();
if (tabWidget) { if (tabWidget) {
tabWidget->addDialog(this); tabWidget->addDialog(this);
} }
@ -285,10 +324,10 @@ void ChatLobbyDialog::updateParticipantsList()
} else { } else {
widgetitem->setIcon(COLUMN_ICON, QIcon(":/images/greenled.png")); widgetitem->setIcon(COLUMN_ICON, QIcon(":/images/greenled.png"));
} }
widgetitem->setToolTip(COLUMN_ICON, tr("Double click to mute/unmute participant")); //widgetitem->setToolTip(COLUMN_ICON, tr("Double click to mute/unmute participant"));
widgetitem->setText(COLUMN_NAME, participant); widgetitem->setText(COLUMN_NAME, participant);
widgetitem->setToolTip(COLUMN_NAME, tr("Right click to mute/unmute participants")); widgetitem->setToolTip(COLUMN_NAME,tr("Right click to mute/unmute participants<br/>Double click to address this person"));
ui.participantsList->addTopLevelItem(widgetitem); ui.participantsList->addTopLevelItem(widgetitem);
if (selectedParcipants.contains(participant)) { if (selectedParcipants.contains(participant)) {
@ -340,20 +379,26 @@ void ChatLobbyDialog::participantsTreeWidgetDoubleClicked(QTreeWidgetItem *item,
return; return;
} }
if (column != COLUMN_ICON) { if(column == COLUMN_NAME)
return; {
getChatWidget()->pasteText("@"+item->text(COLUMN_NAME)) ;
return ;
} }
QString nickname = item->text(COLUMN_NAME); // if (column == COLUMN_ICON) {
if (isParticipantMuted(nickname)) { // return;
unMuteParticipant(nickname); // }
} else { //
muteParticipant(nickname); // QString nickname = item->text(COLUMN_NAME);
} // if (isParticipantMuted(nickname)) {
// unMuteParticipant(nickname);
mutedParticipants->removeDuplicates(); // } else {
// muteParticipant(nickname);
updateParticipantsList(); // }
//
// mutedParticipants->removeDuplicates();
//
// updateParticipantsList();
} }
void ChatLobbyDialog::muteParticipant(const QString &nickname) { void ChatLobbyDialog::muteParticipant(const QString &nickname) {
@ -455,8 +500,8 @@ bool ChatLobbyDialog::canClose()
void ChatLobbyDialog::showDialog(uint chatflags) void ChatLobbyDialog::showDialog(uint chatflags)
{ {
if (chatflags & RS_CHAT_FOCUS) { if (chatflags & RS_CHAT_FOCUS) {
MainWindow::showWindow(MainWindow::Friends); MainWindow::showWindow(MainWindow::ChatLobby);
ChatTabWidget *tabWidget = FriendsDialog::getTabWidget(); ChatTabWidget *tabWidget = ChatLobbyWidget::getTabWidget();
if (tabWidget) { if (tabWidget) {
tabWidget->setCurrentWidget(this); tabWidget->setCurrentWidget(this);
} }

View File

@ -45,6 +45,7 @@ public:
private slots: private slots:
void showParticipantsFrame(bool show); void showParticipantsFrame(bool show);
void participantsTreeWidgetCostumPopupMenu( QPoint point ); void participantsTreeWidgetCostumPopupMenu( QPoint point );
void inviteFriends() ;
protected: protected:
/** Default constructor */ /** Default constructor */
@ -75,6 +76,8 @@ private:
QString _lobby_name ; QString _lobby_name ;
time_t lastUpdateListTime; time_t lastUpdateListTime;
QPushButton *inviteFriendsButton ;
/** Qt Designer generated object */ /** Qt Designer generated object */
Ui::ChatLobbyDialog ui; Ui::ChatLobbyDialog ui;

View File

@ -387,15 +387,21 @@ bool ChatWidget::isActive()
return true; return true;
} }
void ChatWidget::pasteText(const QString& S)
{
//std::cerr << "In paste link" << std::endl;
ui->chatTextEdit->insertHtml(S);
}
void ChatWidget::pasteLink() void ChatWidget::pasteLink()
{ {
std::cerr << "In paste link" << std::endl; //std::cerr << "In paste link" << std::endl;
ui->chatTextEdit->insertHtml(RSLinkClipboard::toHtml()); ui->chatTextEdit->insertHtml(RSLinkClipboard::toHtml());
} }
void ChatWidget::pasteOwnCertificateLink() void ChatWidget::pasteOwnCertificateLink()
{ {
std::cerr << "In paste own certificate link" << std::endl; //std::cerr << "In paste own certificate link" << std::endl;
RetroShareLink link ; RetroShareLink link ;
std::string ownId = rsPeers->getOwnId() ; std::string ownId = rsPeers->getOwnId() ;

View File

@ -78,6 +78,7 @@ public:
bool isActive(); bool isActive();
void setDefaultExtraFileFlags(TransferRequestFlags f) ; void setDefaultExtraFileFlags(TransferRequestFlags f) ;
void pasteText(const QString&);
private slots: private slots:
void clearChatHistory(); void clearChatHistory();

View File

@ -0,0 +1,48 @@
#include <list>
#include <QLayout>
#include <QDialogButtonBox>
#include "FriendSelectionDialog.h"
std::list<std::string> FriendSelectionDialog::selectFriends()
{
FriendSelectionDialog dialog ;
dialog.friends_widget->start() ;
dialog.setWindowTitle(tr("Choose some friends")) ;
if(QDialog::Rejected == dialog.exec())
return std::list<std::string>() ;
std::list<std::string> ids ;
dialog.friends_widget->selectedSslIds(ids,false) ;
return ids ;
}
FriendSelectionDialog::FriendSelectionDialog(QWidget *parent)
: QDialog(parent)
{
friends_widget = new FriendSelectionWidget(this) ;
friends_widget->setHeaderText(tr("Contacts:"));
friends_widget->setModus(FriendSelectionWidget::MODUS_CHECK);
friends_widget->setShowType(FriendSelectionWidget::SHOW_GROUP | FriendSelectionWidget::SHOW_SSL);
QLayout *l = new QVBoxLayout ;
setLayout(l) ;
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
l->addWidget(friends_widget) ;
l->addWidget(buttonBox) ;
l->update() ;
}
FriendSelectionDialog::~FriendSelectionDialog()
{
delete friends_widget ;
}

View File

@ -0,0 +1,17 @@
#pragma once
#include <QDialog>
#include <gui/common/FriendSelectionWidget.h>
class FriendSelectionDialog : public QDialog
{
public:
static std::list<std::string> selectFriends() ;
private:
virtual ~FriendSelectionDialog() ;
FriendSelectionDialog(QWidget *parent = NULL) ;
FriendSelectionWidget *friends_widget ;
};

View File

@ -20,6 +20,7 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
****************************************************************/ ****************************************************************/
#include <QDialogButtonBox>
#include "FriendSelectionWidget.h" #include "FriendSelectionWidget.h"
#include "ui_FriendSelectionWidget.h" #include "ui_FriendSelectionWidget.h"
#include "gui/notifyqt.h" #include "gui/notifyqt.h"
@ -835,3 +836,4 @@ std::string FriendSelectionWidget::idFromItem(QTreeWidgetItem *item)
return item->data(COLUMN_DATA, ROLE_ID).toString().toStdString(); return item->data(COLUMN_DATA, ROLE_ID).toString().toStdString();
} }

View File

@ -24,6 +24,7 @@
#define FRIENDSELECTIONWIDGET_H #define FRIENDSELECTIONWIDGET_H
#include <QWidget> #include <QWidget>
#include <QDialog>
namespace Ui { namespace Ui {
class FriendSelectionWidget; class FriendSelectionWidget;

View File

@ -122,7 +122,7 @@ void SecurityItem::updateItemStatic()
avatar->setDefaultAvatar(":images/avatar_request.png"); avatar->setDefaultAvatar(":images/avatar_request.png");
break; break;
case SEC_TYPE_AUTH_DENIED: case SEC_TYPE_AUTH_DENIED:
title = tr("Not Yet Friends"); title = tr("Connection refused by remote peer");
requestLabel->hide(); requestLabel->hide();
avatar->setDefaultAvatar(":images/avatar_request.png"); avatar->setDefaultAvatar(":images/avatar_request.png");
break; break;

View File

@ -19,6 +19,7 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
****************************************************************/ ****************************************************************/
#include <QDate>
#include <QMessageBox> #include <QMessageBox>
#include <QClipboard> #include <QClipboard>
#include <QFile> #include <QFile>
@ -27,9 +28,12 @@
#include "CryptoPage.h" #include "CryptoPage.h"
#include "util/misc.h" #include "util/misc.h"
#include "util/DateTime.h"
#include <gui/RetroShareLink.h> #include <gui/RetroShareLink.h>
#include <gui/profile/ProfileManager.h>
#include <retroshare/rspeers.h> //for rsPeers variable #include <retroshare/rspeers.h> //for rsPeers variable
#include <retroshare/rsdisc.h> //for rsPeers variable
/** Constructor */ /** Constructor */
CryptoPage::CryptoPage(QWidget * parent, Qt::WFlags flags) CryptoPage::CryptoPage(QWidget * parent, Qt::WFlags flags)
@ -38,7 +42,7 @@ CryptoPage::CryptoPage(QWidget * parent, Qt::WFlags flags)
/* Invoke the Qt Designer generated object setup routine */ /* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this); ui.setupUi(this);
connect(ui.copykeyButton, SIGNAL(clicked()), this, SLOT(copyPublicKey())); // connect(ui.copykeyButton, SIGNAL(clicked()), this, SLOT(copyPublicKey()));
connect(ui.saveButton, SIGNAL(clicked()), this, SLOT(fileSaveAs())); connect(ui.saveButton, SIGNAL(clicked()), this, SLOT(fileSaveAs()));
connect(ui._includeSignatures_CB, SIGNAL(toggled(bool)), this, SLOT(load())); connect(ui._includeSignatures_CB, SIGNAL(toggled(bool)), this, SLOT(load()));
connect(ui._copyLink_PB, SIGNAL(clicked()), this, SLOT(copyRSLink())); connect(ui._copyLink_PB, SIGNAL(clicked()), this, SLOT(copyRSLink()));
@ -48,7 +52,45 @@ CryptoPage::CryptoPage(QWidget * parent, Qt::WFlags flags)
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
#endif #endif
connect(ui.profile_Button,SIGNAL(clicked()), this, SLOT(profilemanager()));
ui.onlinesince->setText(DateTime::formatLongDateTime(QDateTime::currentDateTime()));
} }
void CryptoPage::profilemanager()
{
ProfileManager profilemanager;
profilemanager.exec();
}
void CryptoPage::showEvent ( QShowEvent * /*event*/ )
{
RsPeerDetails detail;
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),detail))
{
ui.name->setText(QString::fromUtf8(detail.name.c_str()));
ui.country->setText(QString::fromUtf8(detail.location.c_str()));
ui.peerid->setText(QString::fromStdString(detail.id));
ui.pgpid->setText(QString::fromStdString(detail.gpg_id));
/* set retroshare version */
std::map<std::string, std::string>::iterator vit;
std::map<std::string, std::string> versions;
bool retv = rsDisc->getDiscVersions(versions);
if (retv && versions.end() != (vit = versions.find(detail.id)))
{
ui.version->setText(QString::fromStdString(vit->second));
}
std::list<std::string> ids;
ids.clear();
rsPeers->getGPGAcceptedList(ids);
int friends = ids.size();
ui.friendsEdit->setText(QString::number(friends));
}
load() ;
}
CryptoPage::~CryptoPage() CryptoPage::~CryptoPage()
{ {

View File

@ -46,7 +46,8 @@ class CryptoPage : public ConfigPage
virtual void load(); virtual void load();
void copyPublicKey(); void copyPublicKey();
void copyRSLink() ; void copyRSLink() ;
virtual void showEvent ( QShowEvent * event );
void profilemanager();
bool fileSave(); bool fileSave();
bool fileSaveAs(); bool fileSaveAs();

View File

@ -6,18 +6,440 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>542</width> <width>650</width>
<height>355</height> <height>566</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="6"> <item row="0" column="0">
<widget class="QGroupBox" name="groupBox"> <widget class="QTabWidget" name="tabWidget">
<property name="title"> <property name="currentIndex">
<string>Public Key</string> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Profile</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QToolButton" name="profile_Button">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Profile Manager</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/contact_new.png</normaloff>:/images/contact_new.png</iconset>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QFrame" name="frame_1">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/info16.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Public Information</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="name">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_8">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Location:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="country">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Location ID:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="peerid">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Identity ID:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="pgpid">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_6" columnstretch="0,0,0" columnminimumwidth="0,0,0">
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Number of Friends:</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QLabel" name="friendsEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Software Version:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_16">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Online since:</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QLabel" name="version">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QLabel" name="onlinesince">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_12">
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/info16.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_13">
<property name="font">
<font>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Other Information</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>205</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Certificate</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTextEdit" name="certtextEdit"> <widget class="QTextEdit" name="certtextEdit">
<property name="font"> <property name="font">
<font> <font>
@ -29,20 +451,16 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item>
</widget> <layout class="QHBoxLayout" name="horizontalLayout">
</item> <item>
<item row="1" column="0"> <widget class="QPushButton" name="_copyLink_PB">
<widget class="QPushButton" name="copykeyButton">
<property name="toolTip">
<string>Copy my Key to Clipboard</string>
</property>
<property name="text"> <property name="text">
<string>Copy Key</string> <string>Copy link to clipboard</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item>
<widget class="QPushButton" name="saveButton"> <widget class="QPushButton" name="saveButton">
<property name="toolTip"> <property name="toolTip">
<string>Save Key into a file</string> <string>Save Key into a file</string>
@ -52,34 +470,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="5"> <item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>278</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="4">
<widget class="QCheckBox" name="_includeSignatures_CB">
<property name="text">
<string>Include signatures</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QPushButton" name="_copyLink_PB">
<property name="text">
<string>Copy RetroShare link to clipboard</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="_useOldFormat_CB"> <widget class="QCheckBox" name="_useOldFormat_CB">
<property name="text"> <property name="text">
<string>Use old key format</string> <string>Use old key format</string>
@ -89,8 +480,23 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="_includeSignatures_CB">
<property name="text">
<string>Include signatures</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<resources/> </widget>
</item>
</layout>
</widget>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -29,6 +29,7 @@
#include <util/stringutil.h> #include <util/stringutil.h>
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include "rsharesettings.h" #include "rsharesettings.h"
#include <gui/QuickStartWizard.h>
/** Constructor */ /** Constructor */
GeneralPage::GeneralPage(QWidget * parent, Qt::WFlags flags) GeneralPage::GeneralPage(QWidget * parent, Qt::WFlags flags)
@ -51,12 +52,17 @@ GeneralPage::GeneralPage(QWidget * parent, Qt::WFlags flags)
ui.enableRetroShareProtocol->setVisible(false); ui.enableRetroShareProtocol->setVisible(false);
ui.adminLabel->setVisible(false); ui.adminLabel->setVisible(false);
#endif #endif
connect(ui.runStartWizard_PB,SIGNAL(clicked()), this,SLOT(runStartWizard())) ;
} }
/** Destructor */ /** Destructor */
GeneralPage::~GeneralPage() GeneralPage::~GeneralPage()
{ {
} }
void GeneralPage::runStartWizard()
{
QuickStartWizard(this).exec();
}
/** Saves the changes on this page */ /** Saves the changes on this page */
bool GeneralPage::save(QString &/*errmsg*/) bool GeneralPage::save(QString &/*errmsg*/)

View File

@ -44,6 +44,8 @@ public:
virtual QPixmap iconPixmap() const { return QPixmap(":/images/kcmsystem24.png") ; } virtual QPixmap iconPixmap() const { return QPixmap(":/images/kcmsystem24.png") ; }
virtual QString pageName() const { return tr("General") ; } virtual QString pageName() const { return tr("General") ; }
public slots:
void runStartWizard() ;
private: private:
/** Qt Designer generated object */ /** Qt Designer generated object */
Ui::GeneralPage ui; Ui::GeneralPage ui;

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>411</width> <width>485</width>
<height>400</height> <height>465</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
@ -182,18 +182,29 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>178</width> <width>20</width>
<height>95</height> <height>40</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QPushButton" name="runStartWizard_PB">
<property name="text">
<string>Launch startup wizard</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/tools_wizard.png</normaloff>:/images/tools_wizard.png</iconset>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources> <resources>

View File

@ -21,6 +21,7 @@
#include "ServerPage.h" #include "ServerPage.h"
#include <gui/TurtleRouterDialog.h> #include <gui/TurtleRouterDialog.h>
#include <gui/TurtleRouterStatistics.h>
#include "rshare.h" #include "rshare.h"
#include "rsharesettings.h" #include "rsharesettings.h"
@ -30,6 +31,7 @@
#include <retroshare/rsconfig.h> #include <retroshare/rsconfig.h>
#include <retroshare/rspeers.h> #include <retroshare/rspeers.h>
#include <retroshare/rsturtle.h> #include <retroshare/rsturtle.h>
#include <retroshare/rsiface.h>
#include <QTimer> #include <QTimer>
@ -44,11 +46,14 @@ ServerPage::ServerPage(QWidget * parent, Qt::WFlags flags)
connect( ui.allowTunnelConnectionCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleTunnelConnection(bool) ) ); connect( ui.allowTunnelConnectionCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleTunnelConnection(bool) ) );
connect( ui._max_tr_up_per_sec_SB, SIGNAL( valueChanged( int ) ), this, SLOT( updateMaxTRUpRate(int) ) ); connect( ui._max_tr_up_per_sec_SB, SIGNAL( valueChanged( int ) ), this, SLOT( updateMaxTRUpRate(int) ) );
connect( ui._turtle_enabled_CB, SIGNAL( toggled( bool ) ), this, SLOT( toggleTurtleRouting(bool) ) ); connect( ui._turtle_enabled_CB, SIGNAL( toggled( bool ) ), this, SLOT( toggleTurtleRouting(bool) ) );
connect( ui._routing_info_PB, SIGNAL( clicked() ), this, SLOT( showRoutingInfo() ) );
QTimer *timer = new QTimer(this); QTimer *timer = new QTimer(this);
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus())); timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus()));
timer->start(1000); timer->start(1000);
_routing_info_page = NULL ;
//load(); //load();
updateStatus(); updateStatus();
@ -70,12 +75,30 @@ ServerPage::ServerPage(QWidget * parent, Qt::WFlags flags)
for(std::list<std::string>::const_iterator it(ip_servers.begin());it!=ip_servers.end();++it) for(std::list<std::string>::const_iterator it(ip_servers.begin());it!=ip_servers.end();++it)
ui.IPServersLV->addItem(QString::fromStdString(*it)) ; ui.IPServersLV->addItem(QString::fromStdString(*it)) ;
TurtleRouterStatistics *trs = new TurtleRouterStatistics ;
trs->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding)) ;
ui.tabWidget->widget(2)->layout()->addWidget(trs) ;
ui.tabWidget->widget(2)->layout()->setContentsMargins(0,5,0,0) ;
QSpacerItem *verticalSpacer = new QSpacerItem(0,0,QSizePolicy::Expanding, QSizePolicy::Minimum);
ui.tabWidget->widget(2)->layout()->addItem(verticalSpacer) ;
ui.tabWidget->widget(2)->layout()->update() ;
/* Hide platform specific features */ /* Hide platform specific features */
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
#endif #endif
} }
void ServerPage::showRoutingInfo()
{
if(_routing_info_page == NULL)
_routing_info_page = new TurtleRouterDialog ;
_routing_info_page->show() ;
}
void ServerPage::updateMaxTRUpRate(int b) void ServerPage::updateMaxTRUpRate(int b)
{ {
rsTurtle->setMaxTRForwardRate(b) ; rsTurtle->setMaxTRForwardRate(b) ;
@ -192,12 +215,18 @@ void ServerPage::load()
ui.showDiscStatusBar->setChecked(Settings->getStatusBarFlags() & STATUSBAR_DISC); ui.showDiscStatusBar->setChecked(Settings->getStatusBarFlags() & STATUSBAR_DISC);
ui._max_tr_up_per_sec_SB->setValue(rsTurtle->getMaxTRForwardRate()) ; ui._max_tr_up_per_sec_SB->setValue(rsTurtle->getMaxTRForwardRate()) ;
ui._turtle_enabled_CB->setChecked(rsTurtle->enabled()) ; ui._turtle_enabled_CB->setChecked(rsTurtle->enabled()) ;
ui.ipAddressList->clear();
for(std::list<std::string>::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it)
ui.ipAddressList->addItem(QString::fromStdString(*it));
} }
void ServerPage::toggleTurtleRouting(bool b) void ServerPage::toggleTurtleRouting(bool b)
{ {
ui._max_tr_up_per_sec_SB->setEnabled(b) ;
ui._routing_info_PB->setEnabled(true) ; // always enabled!
rsTurtle->setEnabled(b) ; rsTurtle->setEnabled(b) ;
} }
@ -224,6 +253,34 @@ void ServerPage::updateStatus()
ui.localAddress->setText(QString::fromStdString(detail.localAddr)); ui.localAddress->setText(QString::fromStdString(detail.localAddr));
/* set the server address */ /* set the server address */
ui.extAddress->setText(QString::fromStdString(detail.extAddr)); ui.extAddress->setText(QString::fromStdString(detail.extAddr));
// Now update network bits.
//
rsiface->lockData(); /* Lock Interface */
/* now the extra bit .... switch on check boxes */
const RsConfig &config = rsiface->getConfig();
/******* Network Status Tab *******/
if(config.netUpnpOk)
ui.iconlabel_upnp->setPixmap(QPixmap(":/images/ledon1.png"));
else
ui.iconlabel_upnp->setPixmap(QPixmap(":/images/ledoff1.png"));
if (config.netLocalOk)
ui.iconlabel_netLimited->setPixmap(QPixmap(":/images/ledon1.png"));
else
ui.iconlabel_netLimited->setPixmap(QPixmap(":/images/ledoff1.png"));
if (config.netExtraAddressOk)
ui.iconlabel_ext->setPixmap(QPixmap(":/images/ledon1.png"));
else
ui.iconlabel_ext->setPixmap(QPixmap(":/images/ledoff1.png"));
rsiface->unlockData(); /* UnLock Interface */
} }
void ServerPage::toggleUPnP() void ServerPage::toggleUPnP()

View File

@ -25,6 +25,8 @@
#include <retroshare-gui/configpage.h> #include <retroshare-gui/configpage.h>
#include "ui_ServerPage.h" #include "ui_ServerPage.h"
class TurtleRouterDialog ;
class ServerPage: public ConfigPage class ServerPage: public ConfigPage
{ {
Q_OBJECT Q_OBJECT
@ -47,6 +49,7 @@ public slots:
private slots: private slots:
void saveAddresses(); void saveAddresses();
void toggleUPnP(); void toggleUPnP();
void showRoutingInfo();
void toggleIpDetermination(bool) ; void toggleIpDetermination(bool) ;
void toggleTunnelConnection(bool) ; void toggleTunnelConnection(bool) ;
void updateMaxTRUpRate(int) ; void updateMaxTRUpRate(int) ;
@ -54,6 +57,8 @@ private slots:
private: private:
Ui::ServerPage ui; Ui::ServerPage ui;
TurtleRouterDialog *_routing_info_page ;
}; };
#endif // !SERVERPAGE_H #endif // !SERVERPAGE_H

View File

@ -6,26 +6,24 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>573</width> <width>632</width>
<height>421</height> <height>683</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout"> <layout class="QGridLayout">
<property name="margin"> <property name="margin">
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="0"> <item row="1" column="0">
<widget class="QGroupBox" name="groupBox_2"> <widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy"> <property name="currentIndex">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <number>0</number>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="title"> <widget class="QWidget" name="tab">
<attribute name="title">
<string>Network Configuration</string> <string>Network Configuration</string>
</property> </attribute>
<layout class="QHBoxLayout"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
@ -106,108 +104,9 @@ peers still need to trust each other to allow connection. </string>
</item> </item>
</layout> </layout>
</item> </item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Transfer Rates</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<layout class="QHBoxLayout"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<widget class="QLabel" name="label_14">
<property name="text">
<string>Download (KB/s) </string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="totalDownloadRate">
<property name="suffix">
<string>kB/s</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="_2">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_15">
<property name="text">
<string>Upload (KB/s) </string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="totalUploadRate">
<property name="suffix">
<string>kB/s</string>
</property>
<property name="prefix">
<string/>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Network Configuration</string>
</attribute>
<layout class="QGridLayout">
<item row="2" column="0">
<widget class="QCheckBox" name="allowTunnelConnectionCB">
<property name="toolTip">
<string>If you uncheck this, RetroShare will not use tunnel connection between peers that are firewalled and cannot connect directly. This is independent from F2F routing (turtle router).</string>
</property>
<property name="text">
<string>Allow Tunnel Connection</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout"> <layout class="QHBoxLayout">
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
@ -301,34 +200,136 @@ peers still need to trust each other to allow connection. </string>
</item> </item>
</layout> </layout>
</item> </item>
<item row="4" column="0"> <item>
<spacer name="verticalSpacer"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="orientation"> <item>
<enum>Qt::Vertical</enum> <layout class="QGridLayout" name="_4">
<property name="leftMargin">
<number>6</number>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="rightMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="iconlabel_netLimited">
<property name="maximumSize">
<size> <size>
<width>20</width> <width>16</width>
<height>40</height> <height>16</height>
</size> </size>
</property> </property>
</spacer> <property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/ledoff1.png</pixmap>
</property>
</widget>
</item> </item>
<item row="3" column="0"> <item row="0" column="1">
<widget class="QLabel" name="textlabel_netLimited">
<property name="text">
<string>Local network</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="_6">
<property name="leftMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="iconlabel_ext">
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/ledoff1.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="textlabel_ext">
<property name="text">
<string>External ip address finder</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="_5">
<property name="leftMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="iconlabel_upnp">
<property name="maximumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/ledoff1.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="textlabel_upnp">
<property name="text">
<string>UPnP</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Known / Previous IPs:</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="ipAddressList">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>150</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showDiscStatusBar"> <widget class="QCheckBox" name="showDiscStatusBar">
<property name="text"> <property name="text">
<string>Show Discovery information in statusbar</string> <string>Show Discovery information in statusbar</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>IP Service</string>
</attribute>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="allowIpDeterminationCB"> <widget class="QCheckBox" name="allowIpDeterminationCB">
<property name="toolTip"> <property name="toolTip">
<string>If you uncheck this, RetroShare can only determine your IP <string>If you uncheck this, RetroShare can only determine your IP
@ -344,68 +345,172 @@ behind a firewall or a VPN.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item>
<widget class="QListWidget" name="IPServersLV"> <widget class="QListWidget" name="IPServersLV">
<property name="editTriggers"> <property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set> <set>QAbstractItemView::NoEditTriggers</set>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
<zorder>showDiscStatusBar</zorder>
<zorder>allowIpDeterminationCB</zorder>
<zorder>IPServersLV</zorder>
<zorder></zorder>
<zorder>textlabel_ext</zorder>
<zorder>textlabel_netLimited</zorder>
<zorder>ipAddressList</zorder>
<zorder>label_7</zorder>
</widget> </widget>
<widget class="QWidget" name="tab_3"> <widget class="QWidget" name="tab_2">
<attribute name="title"> <attribute name="title">
<string>Turtle router</string> <string>Bandwidth</string>
</attribute> </attribute>
<layout class="QGridLayout"> <layout class="QGridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_7"> <widget class="QGroupBox" name="groupBox_3">
<property name="maximumSize"> <property name="sizePolicy">
<size> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<width>24</width> <horstretch>0</horstretch>
<height>24</height> <verstretch>0</verstretch>
</size> </sizepolicy>
</property> </property>
<property name="title">
<string>Max Transfer Rates</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label_14">
<property name="text"> <property name="text">
<string>Download (KB/s) </string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="totalDownloadRate">
<property name="suffix">
<string>kB/s</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="_2">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_15">
<property name="text">
<string>Upload (KB/s) </string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="totalUploadRate">
<property name="suffix">
<string>kB/s</string>
</property>
<property name="prefix">
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="minimum">
<pixmap resource="../images.qrc">:/images/informations_24x24.png</pixmap> <number>1</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="value">
<number>1</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> </layout>
<widget class="QLabel" name="label_8"> </item>
<property name="font"> <item>
<font> <widget class="QCheckBox" name="allowTunnelConnectionCB">
<pointsize>11</pointsize> <property name="toolTip">
<weight>75</weight> <string>If you uncheck this, RetroShare will not use tunnel connection between peers that are firewalled and cannot connect directly. This is independent from F2F routing (turtle router).</string>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="text">
<string>Warning</string> <string>Allow Tunnel Connection</string>
</property>
<property name="checked">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="2"> <item>
<widget class="QPlainTextEdit" name="plainTextEdit"> <spacer name="verticalSpacer_3">
<property name="font"> <property name="orientation">
<font> <enum>Qt::Vertical</enum>
<pointsize>11</pointsize>
</font>
</property> </property>
<property name="plainText"> <property name="sizeHint" stdset="0">
<string>This tab contains hard-core parameters which are unlikely to need modification. Don't change them unless you really know what you're doing.</string> <size>
<width>20</width>
<height>40</height>
</size>
</property> </property>
</spacer>
</item>
</layout>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="2"> </layout>
</widget>
<widget class="QWidget" name="TurtleRouter_TAB">
<attribute name="title">
<string>Turtle router</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="_turtle_enabled_CB">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;Unchecking this disables all anonymous routing activity, except cache cleaning. Incoming tunnel requests are discarded, and no tunnel requests are sent to anyone.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="_routing_info_PB">
<property name="text">
<string>Show routing info</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
<property name="text"> <property name="text">
<string>Max. tunnel requests forwarded per second:</string> <string>Max. tunnel req. forwarded per second:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -436,29 +541,6 @@ The default value is 20.</string>
</item> </item>
</layout> </layout>
</item> </item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="_turtle_enabled_CB">
<property name="toolTip">
<string>Unchecking this disables all anonymous routing activity, except cache cleaning. Incoming tunnel requests are discarded, and no tunnel requests are sent to anyone.</string>
</property>
<property name="text">
<string>Enable anonymous data routing</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
@ -474,17 +556,14 @@ The default value is 20.</string>
<tabstop>extAddress</tabstop> <tabstop>extAddress</tabstop>
<tabstop>extPort</tabstop> <tabstop>extPort</tabstop>
<tabstop>dynDNS</tabstop> <tabstop>dynDNS</tabstop>
<tabstop>allowTunnelConnectionCB</tabstop>
<tabstop>showDiscStatusBar</tabstop> <tabstop>showDiscStatusBar</tabstop>
<tabstop>totalDownloadRate</tabstop> <tabstop>totalDownloadRate</tabstop>
<tabstop>totalUploadRate</tabstop> <tabstop>totalUploadRate</tabstop>
<tabstop>allowIpDeterminationCB</tabstop>
<tabstop>IPServersLV</tabstop>
<tabstop>plainTextEdit</tabstop>
<tabstop>_max_tr_up_per_sec_SB</tabstop> <tabstop>_max_tr_up_per_sec_SB</tabstop>
</tabstops> </tabstops>
<resources> <resources>
<include location="../images.qrc"/> <include location="../images.qrc"/>
<include location="images.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -194,12 +194,6 @@ void xProgressBar::overPaintSelectedChunks(const std::vector<uint32_t>& chunks,c
painter->setBrush(linearGrad); painter->setBrush(linearGrad);
std::cerr << "painting chunks: " ;
for(uint32_t i=0;i<chunks.size();++i)
std::cerr << chunks[i] << " " ;
std::cerr << std::endl;
if(chunks.empty()) if(chunks.empty())
return ; return ;

View File

@ -43,6 +43,7 @@
#include "util/EventReceiver.h" #include "util/EventReceiver.h"
#include "gui/RetroShareLink.h" #include "gui/RetroShareLink.h"
#include "gui/SoundManager.h" #include "gui/SoundManager.h"
#include "gui/NetworkView.h"
#include "lang/languagesupport.h" #include "lang/languagesupport.h"
/*** WINDOWS DON'T LIKE THIS - REDEFINES VER numbers. /*** WINDOWS DON'T LIKE THIS - REDEFINES VER numbers.
@ -322,22 +323,24 @@ int main(int argc, char *argv[])
qRegisterMetaType<FileDetail>("FileDetail") ; qRegisterMetaType<FileDetail>("FileDetail") ;
std::cerr << "connecting signals and slots" << std::endl ; std::cerr << "connecting signals and slots" << std::endl ;
QObject::connect(notify,SIGNAL(gotTurtleSearchResult(qulonglong,FileDetail)),w->searchDialog ,SLOT(updateFiles(qulonglong,FileDetail))) ; QObject::connect(notify,SIGNAL(gotTurtleSearchResult(qulonglong,FileDetail)),w->transfersDialog->searchDialog ,SLOT(updateFiles(qulonglong,FileDetail))) ;
QObject::connect(notify,SIGNAL(diskFull(int,int)) ,w ,SLOT(displayDiskSpaceWarning(int,int))) ; QObject::connect(notify,SIGNAL(diskFull(int,int)) ,w ,SLOT(displayDiskSpaceWarning(int,int))) ;
QObject::connect(notify,SIGNAL(filesPreModChanged(bool)) ,w->sharedfilesDialog ,SLOT(preModDirectories(bool) )) ; QObject::connect(notify,SIGNAL(filesPreModChanged(bool)) ,w->transfersDialog->localSharedFiles ,SLOT(preModDirectories(bool) )) ;
QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w->sharedfilesDialog ,SLOT(postModDirectories(bool) )) ; QObject::connect(notify,SIGNAL(filesPreModChanged(bool)) ,w->transfersDialog->remoteSharedFiles ,SLOT(preModDirectories(bool) )) ;
QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w->transfersDialog->localSharedFiles ,SLOT(postModDirectories(bool) )) ;
QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w->transfersDialog->remoteSharedFiles ,SLOT(postModDirectories(bool) )) ;
QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w ,SLOT(postModDirectories(bool) )) ; QObject::connect(notify,SIGNAL(filesPostModChanged(bool)) ,w ,SLOT(postModDirectories(bool) )) ;
QObject::connect(notify,SIGNAL(transfersChanged()) ,w->transfersDialog ,SLOT(insertTransfers() )) ; QObject::connect(notify,SIGNAL(transfersChanged()) ,w->transfersDialog ,SLOT(insertTransfers() )) ;
QObject::connect(notify,SIGNAL(publicChatChanged(int)) ,w->friendsDialog ,SLOT(publicChatChanged(int) )); QObject::connect(notify,SIGNAL(publicChatChanged(int)) ,w->friendsDialog ,SLOT(publicChatChanged(int) ));
QObject::connect(notify,SIGNAL(neighboursChanged()) ,w->networkDialog ,SLOT(insertConnect() )) ; QObject::connect(notify,SIGNAL(neighboursChanged()) ,w->friendsDialog->networkDialog ,SLOT(insertConnect() )) ;
QObject::connect(notify,SIGNAL(messagesChanged()) ,w->messagesDialog ,SLOT(insertMessages() )) ; QObject::connect(notify,SIGNAL(messagesChanged()) ,w->messagesDialog ,SLOT(insertMessages() )) ;
QObject::connect(notify,SIGNAL(messagesTagsChanged()) ,w->messagesDialog ,SLOT(messagesTagsChanged() )) ; QObject::connect(notify,SIGNAL(messagesTagsChanged()) ,w->messagesDialog ,SLOT(messagesTagsChanged() )) ;
QObject::connect(notify,SIGNAL(chatStatusChanged(const QString&,const QString&,bool)),w->friendsDialog,SLOT(updatePeerStatusString(const QString&,const QString&,bool))); QObject::connect(notify,SIGNAL(chatStatusChanged(const QString&,const QString&,bool)),w->friendsDialog,SLOT(updatePeerStatusString(const QString&,const QString&,bool)));
QObject::connect(notify,SIGNAL(ownStatusMessageChanged()),w->friendsDialog,SLOT(loadmypersonalstatus())); QObject::connect(notify,SIGNAL(ownStatusMessageChanged()),w->friendsDialog,SLOT(loadmypersonalstatus()));
QObject::connect(notify,SIGNAL(logInfoChanged(const QString&)) ,w->networkDialog,SLOT(setLogInfo(QString))) ; QObject::connect(notify,SIGNAL(logInfoChanged(const QString&)) ,w->friendsDialog->networkDialog,SLOT(setLogInfo(QString))) ;
QObject::connect(notify,SIGNAL(discInfoChanged()) ,w->networkDialog,SLOT(updateNewDiscoveryInfo()),Qt::QueuedConnection) ; QObject::connect(notify,SIGNAL(discInfoChanged()) ,w->friendsDialog->networkView,SLOT(update()),Qt::QueuedConnection) ;
QObject::connect(notify,SIGNAL(errorOccurred(int,int,const QString&)),w,SLOT(displayErrorMessage(int,int,const QString&))) ; QObject::connect(notify,SIGNAL(errorOccurred(int,int,const QString&)),w,SLOT(displayErrorMessage(int,int,const QString&))) ;
w->installGroupChatNotifier(); w->installGroupChatNotifier();

View File

@ -411,6 +411,7 @@ HEADERS += rshare.h \
gui/common/AvatarWidget.h \ gui/common/AvatarWidget.h \
gui/common/FriendList.h \ gui/common/FriendList.h \
gui/common/FriendSelectionWidget.h \ gui/common/FriendSelectionWidget.h \
gui/common/FriendSelectionDialog.h \
gui/common/HashBox.h \ gui/common/HashBox.h \
gui/common/LineEditClear.h \ gui/common/LineEditClear.h \
gui/common/DropLineEdit.h \ gui/common/DropLineEdit.h \
@ -682,6 +683,7 @@ SOURCES += main.cpp \
gui/common/AvatarWidget.cpp \ gui/common/AvatarWidget.cpp \
gui/common/FriendList.cpp \ gui/common/FriendList.cpp \
gui/common/FriendSelectionWidget.cpp \ gui/common/FriendSelectionWidget.cpp \
gui/common/FriendSelectionDialog.cpp \
gui/common/HashBox.cpp \ gui/common/HashBox.cpp \
gui/common/LineEditClear.cpp \ gui/common/LineEditClear.cpp \
gui/common/DropLineEdit.cpp \ gui/common/DropLineEdit.cpp \