mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-24 00:31:32 -04:00
Moved the filter edit and the display button from FriendsDialog and MessengerWindow into FriendList.
Updated english translation git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6649 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0fb66c4af4
commit
cc92fdfc81
9 changed files with 115 additions and 182 deletions
|
@ -156,6 +156,11 @@ FriendList::FriendList(QWidget *parent) :
|
|||
connect(ui->actionSortPeersAscendingOrder, SIGNAL(triggered()), this, SLOT(sortPeersAscendingOrder()));
|
||||
connect(ui->actionSortPeersDescendingOrder, SIGNAL(triggered()), this, SLOT(sortPeersDescendingOrder()));
|
||||
|
||||
connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterItems(QString)));
|
||||
|
||||
ui->filterLineEdit->setPlaceholderText(tr("Search")) ;
|
||||
ui->filterLineEdit->showFilterIcon();
|
||||
|
||||
initializeHeader(false);
|
||||
|
||||
ui->peerTreeWidget->sortItems(COLUMN_NAME, Qt::AscendingOrder);
|
||||
|
@ -170,6 +175,9 @@ FriendList::FriendList(QWidget *parent) :
|
|||
// http://bugreports.qt.nokia.com/browse/QTBUG-8270
|
||||
QShortcut *Shortcut = new QShortcut(QKeySequence(Qt::Key_Delete), ui->peerTreeWidget, 0, 0, Qt::WidgetShortcut);
|
||||
connect(Shortcut, SIGNAL(activated()), this, SLOT(removefriend()));
|
||||
|
||||
/* Initialize display menu */
|
||||
createDisplayMenu();
|
||||
}
|
||||
|
||||
FriendList::~FriendList()
|
||||
|
@ -178,6 +186,20 @@ FriendList::~FriendList()
|
|||
delete(m_compareRole);
|
||||
}
|
||||
|
||||
void FriendList::addToolButton(QToolButton *toolButton)
|
||||
{
|
||||
if (!toolButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Initialize button */
|
||||
toolButton->setAutoRaise(true);
|
||||
toolButton->setIconSize(ui->displayButton->iconSize());
|
||||
toolButton->setFocusPolicy(ui->displayButton->focusPolicy());
|
||||
|
||||
ui->titleBarFrame->layout()->addWidget(toolButton);
|
||||
}
|
||||
|
||||
void FriendList::processSettings(bool bLoad)
|
||||
{
|
||||
int peerTreeVersion = 2; // version number for the settings to solve problems when modifying the column count
|
||||
|
@ -1965,7 +1987,7 @@ void FriendList::addPeerToExpand(const std::string &gpgId)
|
|||
openPeers->insert(gpgId);
|
||||
}
|
||||
|
||||
QMenu *FriendList::createDisplayMenu()
|
||||
void FriendList::createDisplayMenu()
|
||||
{
|
||||
QMenu *displayMenu = new QMenu(this);
|
||||
connect(displayMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
|
||||
|
@ -1993,7 +2015,7 @@ QMenu *FriendList::createDisplayMenu()
|
|||
// group->addAction(ui->actionSortByLastContact);
|
||||
// group->addAction(ui->actionSortByIP);
|
||||
|
||||
return displayMenu;
|
||||
ui->displayButton->setMenu(displayMenu);
|
||||
}
|
||||
|
||||
void FriendList::updateMenu()
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace Ui {
|
|||
|
||||
class RSTreeWidgetItemCompareRole;
|
||||
class QTreeWidgetItem;
|
||||
class QMenu;
|
||||
class QToolButton;
|
||||
|
||||
class FriendList : public RsAutoUpdatePage
|
||||
{
|
||||
|
@ -52,7 +52,8 @@ public:
|
|||
explicit FriendList(QWidget *parent = 0);
|
||||
~FriendList();
|
||||
|
||||
QMenu *createDisplayMenu();
|
||||
// Add a tool button to the tool area
|
||||
void addToolButton(QToolButton *toolButton);
|
||||
void processSettings(bool bLoad);
|
||||
void addGroupToExpand(const std::string &groupId);
|
||||
bool getExpandedGroups(std::set<std::string> &groups) const;
|
||||
|
@ -98,6 +99,7 @@ public slots:
|
|||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
void createDisplayMenu();
|
||||
|
||||
private:
|
||||
Ui::FriendList *ui;
|
||||
|
|
|
@ -10,10 +10,66 @@
|
|||
<height>229</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<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="margin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="LineEditClear" name="filterLineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="displayButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>30</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<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>
|
||||
<widget class="QTreeWidget" name="peerTreeWidget">
|
||||
<property name="font">
|
||||
|
@ -238,6 +294,13 @@
|
|||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>LineEditClear</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header location="global">gui/common/LineEditClear.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
GroupTreeWidget(QWidget *parent = 0);
|
||||
~GroupTreeWidget();
|
||||
|
||||
// Add a widget to the tool area
|
||||
// Add a tool button to the tool area
|
||||
void addToolButton(QToolButton *toolButton);
|
||||
|
||||
// Load and save settings (group must be startet from the caller)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue