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:
thunder2 2013-08-30 12:24:39 +00:00
parent 0fb66c4af4
commit cc92fdfc81
9 changed files with 115 additions and 182 deletions

View File

@ -90,10 +90,6 @@ FriendsDialog::FriendsDialog(QWidget *parent)
connect( ui.actionAdd_Friend, SIGNAL(triggered()), this, SLOT(addFriend()));
connect( ui.actionFriendRecommendations, SIGNAL(triggered()), this, SLOT(recommendFriends()));
connect( ui.actionServicePermission, SIGNAL(triggered()), this, SLOT(servicePermission()));
connect( ui.filter_lineEdit, SIGNAL(textChanged(QString)), ui.friendList, SLOT(filterItems(QString)));
ui.filter_lineEdit->setPlaceholderText(tr("Search")) ;
ui.filter_lineEdit->showFilterIcon();
ui.avatar->setFrameType(AvatarWidget::STATUS_FRAME);
ui.avatar->setOwnId();
@ -194,7 +190,6 @@ FriendsDialog::FriendsDialog(QWidget *parent)
ui.splitter_2->setSizes(sizes);
loadmypersonalstatus();
ui.displayButton->setMenu(ui.friendList->createDisplayMenu());
// load settings
RsAutoUpdatePage::lockAllEvents();

View File

@ -96,51 +96,6 @@
<property name="spacing">
<number>2</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="LineEditClear" name="filter_lineEdit"/>
</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>
</item>
<item>
<widget class="FriendList" name="friendList" native="true">
<property name="sizePolicy">
@ -895,11 +850,6 @@
</action>
</widget>
<customwidgets>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header location="global">gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>LinkTextBrowser</class>
<extends>QTextBrowser</extends>

View File

@ -103,11 +103,7 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
ui.avatar->setFrameType(AvatarWidget::STATUS_FRAME);
ui.avatar->setOwnId();
connect( ui.shareButton, SIGNAL(clicked()), SLOT(openShareManager()));
connect( ui.addIMAccountButton, SIGNAL(clicked( bool ) ), this , SLOT( addFriend() ) );
connect(ui.messagelineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(savestatusmessage()));
connect(ui.filterLineEdit, SIGNAL(textChanged(QString)), ui.friendList, SLOT(filterItems(QString)));
connect(NotifyQt::getInstance(), SIGNAL(ownAvatarChanged()), this, SLOT(updateAvatar()));
connect(NotifyQt::getInstance(), SIGNAL(ownStatusMessageChanged()), this, SLOT(loadmystatusmessage()));
@ -131,10 +127,18 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
ui.messagelineEdit->setMinimumWidth(20);
ui.displaytoolButton->setMenu(ui.friendList->createDisplayMenu());
/* Initialize friend list */
QToolButton *button = new QToolButton(this);
button->setIcon(QIcon(":/images/user/add_user24.png"));
button->setToolTip(tr("Add a Friend"));
connect(button, SIGNAL(clicked()), this, SLOT(addFriend()));
ui.friendList->addToolButton(button);
ui.filterLineEdit->setPlaceholderText(tr("Search")) ;
ui.filterLineEdit->showFilterIcon();
button = new QToolButton(this);
button->setIcon(QIcon(":/images/friendsfolder24.png"));
button->setToolTip(tr("Share files for your friends"));
connect(button, SIGNAL(clicked()), this, SLOT(openShareManager()));
ui.friendList->addToolButton(button);
// load settings
RsAutoUpdatePage::lockAllEvents();

View File

@ -14,7 +14,7 @@
<string>RetroShare Messenger</string>
</property>
<property name="windowIcon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/rstray3.png</normaloff>:/images/rstray3.png</iconset>
</property>
<widget class="QWidget" name="centralwidget">
@ -99,95 +99,7 @@
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="toolBarFrame">
<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_2">
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="LineEditClear" name="filterLineEdit">
<property name="toolTip">
<string>Search Friends</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="addIMAccountButton">
<property name="toolTip">
<string>Add a Friend</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/images/user/add_user24.png</normaloff>:/images/user/add_user24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="shareButton">
<property name="toolTip">
<string>Share files for your friends</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/images/friendsfolder24.png</normaloff>:/images/friendsfolder24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="displaytoolButton">
<property name="icon">
<iconset>
<normaloff>:/images/looknfeel.png</normaloff>:/images/looknfeel.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>24</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">
<item row="2" column="0">
<widget class="LogoBar" name="logoFrame">
<property name="minimumSize">
<size>
@ -203,7 +115,7 @@
</property>
</widget>
</item>
<item row="2" column="0">
<item row="1" column="0">
<widget class="QFrame" name="friendListFrame">
<layout class="QGridLayout" name="gridLayout_3">
<property name="margin">
@ -230,17 +142,12 @@
<x>0</x>
<y>0</y>
<width>258</width>
<height>20</height>
<height>21</height>
</rect>
</property>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>AvatarWidget</class>
<extends>QLabel</extends>
@ -260,6 +167,8 @@
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -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()

View File

@ -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;

View File

@ -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>

View File

@ -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)

View File

@ -5538,6 +5538,10 @@ p, li { white-space: pre-wrap; }
<source>Service permissions matrix</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Display</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FriendRecommendDialog</name>
@ -5610,10 +5614,6 @@ p, li { white-space: pre-wrap; }
<source>Friends</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Display</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Edit status message</source>
<translation type="unfinished"></translation>
@ -5722,10 +5722,6 @@ p, li { white-space: pre-wrap; }
<source>Service permissions</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Local network</source>
<translation type="unfinished"></translation>
@ -9172,10 +9168,6 @@ Do you want to save message ?</source>
<source>RetroShare Messenger</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Search Friends</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Add a Friend</source>
<translation type="unfinished"></translation>
@ -9184,10 +9176,6 @@ Do you want to save message ?</source>
<source>Share files for your friends</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MsgItem</name>