added missing NewFriendList.ui

This commit is contained in:
csoler 2019-06-28 11:27:19 +02:00
parent a4f6d89575
commit 1c123d6df9
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
4 changed files with 152 additions and 22 deletions

View File

@ -57,7 +57,7 @@
#include "gui/common/ElidedLabel.h"
#include "NewFriendList.h"
#include "ui_FriendList.h"
#include "ui_NewFriendList.h"
/* Images for context menu icons */
#define IMAGE_DENYFRIEND ":/images/denied16.png"
@ -109,34 +109,36 @@
Q_DECLARE_METATYPE(ElidedLabel*)
NewFriendList::NewFriendList(QWidget *parent) :
QTreeView(parent),
// mCompareRole(new RSTreeWidgetItemCompareRole),
QWidget(parent),
mCompareRole(new RSTreeWidgetItemCompareRole),
mShowGroups(true),
mShowState(false),
mHideUnconnected(false),
groupsHasChanged(false)
{
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(peerTreeWidgetCustomPopupMenu()));
connect(this, SIGNAL(itemExpanded(QTreeWidgetItem *)), this, SLOT(expandItem(QTreeWidgetItem *)));
connect(this, SIGNAL(itemCollapsed(QTreeWidgetItem *)), this, SLOT(collapseItem(QTreeWidgetItem *)));
connect(this, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(expandItem(QTreeWidgetItem *)) );
ui->setupUi(this);
connect(ui->peerTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(peerTreeWidgetCustomPopupMenu()));
connect(ui->peerTreeWidget, SIGNAL(itemExpanded(QTreeWidgetItem *)), this, SLOT(expandItem(QTreeWidgetItem *)));
connect(ui->peerTreeWidget, SIGNAL(itemCollapsed(QTreeWidgetItem *)), this, SLOT(collapseItem(QTreeWidgetItem *)));
connect(ui->peerTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(expandItem(QTreeWidgetItem *)) );
connect(NotifyQt::getInstance(), SIGNAL(groupsChanged(int)), this, SLOT(groupsChanged()));
connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(insertPeers()));
// connect(ui->actionHideOfflineFriends, SIGNAL(triggered(bool)), this, SLOT(setHideUnconnected(bool)));
// connect(ui->actionShowState, SIGNAL(triggered(bool)), this, SLOT(setShowState(bool)));
// connect(ui->actionShowGroups, SIGNAL(triggered(bool)), this, SLOT(setShowGroups(bool)));
// connect(ui->actionExportFriendlist, SIGNAL(triggered()), this, SLOT(exportFriendlistClicked()));
// connect(ui->actionImportFriendlist, SIGNAL(triggered()), this, SLOT(importFriendlistClicked()));
connect(ui->actionHideOfflineFriends, SIGNAL(triggered(bool)), this, SLOT(setHideUnconnected(bool)));
connect(ui->actionShowState, SIGNAL(triggered(bool)), this, SLOT(setShowState(bool)));
connect(ui->actionShowGroups, SIGNAL(triggered(bool)), this, SLOT(setShowGroups(bool)));
connect(ui->actionExportFriendlist, SIGNAL(triggered()), this, SLOT(exportFriendlistClicked()));
connect(ui->actionImportFriendlist, SIGNAL(triggered()), this, SLOT(importFriendlistClicked()));
connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterItems(QString)));
ui->filterLineEdit->setPlaceholderText(tr("Search")) ;
ui->filterLineEdit->showFilterIcon();
// connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterItems(QString)));
//
// ui->filterLineEdit->setPlaceholderText(tr("Search")) ;
// ui->filterLineEdit->showFilterIcon();
//
/* Add filter actions */
QTreeWidgetItem *headerItem = headerItem();
QTreeWidgetItem *headerItem = ui->peerTreeWidget->headerItem();
QString headerText = headerItem->text(COLUMN_NAME);
ui->filterLineEdit->addFilter(QIcon(), headerText, COLUMN_NAME, QString("%1 %2").arg(tr("Search"), headerText));
ui->filterLineEdit->addFilter(QIcon(), tr("ID"), COLUMN_ID, tr("Search ID"));
@ -202,8 +204,8 @@ void NewFriendList::addToolButton(QToolButton *toolButton)
void NewFriendList::processSettings(bool load)
{
// state of peer tree
ui->peerTreeWidget->setSettingsVersion(2);
ui->peerTreeWidget->processSettings(load);
//ui->peerTreeWidget->setSettingsVersion(2);
//ui->peerTreeWidget->processSettings(load);
if (load) {
// load settings

View File

@ -28,14 +28,14 @@
#include "retroshare/rsstatus.h"
namespace Ui {
class FriendList;
class NewFriendList;
}
class RSTreeWidgetItemCompareRole;
class QTreeWidgetItem;
class QToolButton;
class NewFriendList : public QTreeView
class NewFriendList: public QWidget
{
Q_OBJECT
@ -104,6 +104,7 @@ protected:
void createDisplayMenu();
private:
Ui::NewFriendList *ui;
QAction *mActionSortByState;
// Settings for peer list display

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NewFriendList</class>
<widget class="QWidget" name="NewFriendList">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>475</width>
<height>292</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="titleBarFrame">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="LineEditClear" name="filterLineEdit"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTreeView" name="peerTreeWidget">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<action name="actionHideOfflineFriends">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Hide Offline Friends</string>
</property>
</action>
<action name="actionShowState">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show State</string>
</property>
<property name="toolTip">
<string>Show State</string>
</property>
</action>
<action name="actionShowGroups">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show Groups</string>
</property>
<property name="toolTip">
<string>Show Groups</string>
</property>
</action>
<action name="actionExportFriendlist">
<property name="text">
<string>export friendlist</string>
</property>
<property name="toolTip">
<string>export your friendlist including groups</string>
</property>
</action>
<action name="actionImportFriendlist">
<property name="text">
<string>import friendlist</string>
</property>
<property name="toolTip">
<string>import your friendlist including groups</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header location="global">gui/common/LineEditClear.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -692,6 +692,7 @@ FORMS += gui/StartDialog.ui \
gui/common/GroupTreeWidget.ui \
gui/common/AvatarWidget.ui \
gui/common/FriendList.ui \
gui/common/NewFriendList.ui \
gui/common/FriendSelectionWidget.ui \
gui/common/HashBox.ui \
gui/common/RSImageBlockWidget.ui \