- Moved display button and new forum/channel button into GroupTreeWidget

- Fixed size of display button in FriendsDialog
- Updated english translation

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6645 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-08-29 20:32:14 +00:00
parent 4ee3bec87e
commit 21eed4c956
13 changed files with 137 additions and 265 deletions

View file

@ -71,7 +71,6 @@ ChannelFeed::ChannelFeed(QWidget *parent)
/* Invoke the Qt Designer generated object setup routine */
setupUi(this);
connect(newChannelButton, SIGNAL(clicked()), this, SLOT(createChannel()));
connect(postButton, SIGNAL(clicked()), this, SLOT(createMsg()));
connect(NotifyQt::getInstance(), SIGNAL(channelMsgReadSatusChanged(QString,QString,int)), this, SLOT(channelMsgReadSatusChanged(QString,QString,int)));
@ -88,7 +87,11 @@ ChannelFeed::ChannelFeed(QWidget *parent)
splitter->setSizes(sizes);
/* Initialize group tree */
treeWidget->initDisplayMenu(displayButton);
QToolButton *newChannelButton = new QToolButton(this);
newChannelButton->setIcon(QIcon(":/images/add_channel24.png"));
newChannelButton->setToolTip(tr("Create Channel"));
connect(newChannelButton, SIGNAL(clicked()), this, SLOT(createChannel()));
treeWidget->addToolButton(newChannelButton);
ownChannels = treeWidget->addCategoryItem(tr("My Channels"), QIcon(IMAGE_CHANNELBLUE), true);
subcribedChannels = treeWidget->addCategoryItem(tr("Subscribed Channels"), QIcon(IMAGE_CHANNELRED), true);

View file

@ -75,58 +75,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="displayButton">
<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>
<item>
<widget class="QToolButton" name="newChannelButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Create Channel</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/add_channel24.png</normaloff>:/images/add_channel24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>16</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="helpButton">
<property name="sizePolicy">
@ -166,7 +114,7 @@
</sizepolicy>
</property>
</widget>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QFrame" name="headFrame">
@ -312,7 +260,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>625</width>
<width>513</width>
<height>16</height>
</rect>
</property>
@ -355,9 +303,7 @@
</property>
</action>
<zorder>splitter</zorder>
<zorder>treeWidget</zorder>
<zorder>titleBarFrame</zorder>
<zorder>treeWidget</zorder>
</widget>
<customwidgets>
<customwidget>

View file

@ -117,7 +117,6 @@ ForumsDialog::ForumsDialog(QWidget *parent)
connect( ui.forumTreeWidget, SIGNAL( treeCustomContextMenuRequested( QPoint ) ), this, SLOT( forumListCustomPopupMenu( QPoint ) ) );
connect( ui.threadTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( threadListCustomPopupMenu( QPoint ) ) );
connect(ui.newForumButton, SIGNAL(clicked()), this, SLOT(newforum()));
connect(ui.newmessageButton, SIGNAL(clicked()), this, SLOT(createmessage()));
connect(ui.newthreadButton, SIGNAL(clicked()), this, SLOT(createthread()));
@ -162,7 +161,11 @@ ForumsDialog::ForumsDialog(QWidget *parent)
headerItem->setText(COLUMN_THREAD_READ, "");
/* Initialize group tree */
ui.forumTreeWidget->initDisplayMenu(ui.displayButton);
QToolButton *newForumButton = new QToolButton(this);
newForumButton->setIcon(QIcon(":/images/new_forum16.png"));
newForumButton->setToolTip(tr("Create Forum"));
connect(newForumButton, SIGNAL(clicked()), this, SLOT(newforum()));
ui.forumTreeWidget->addToolButton(newForumButton);
/* create forum tree */
yourForums = ui.forumTreeWidget->addCategoryItem(tr("My Forums"), QIcon(IMAGE_FOLDER), true);

View file

@ -75,55 +75,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="displayButton">
<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>
<item>
<widget class="QToolButton" name="newForumButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Create Forum</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/new_forum16.png</normaloff>:/images/new_forum16.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>16</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="helpButton">
<property name="sizePolicy">
@ -472,11 +423,11 @@
</item>
<item row="0" column="0">
<widget class="QFrame" name="toolBarFrame">
<property name="minimumSize">
<size>
<width>0</width>
<height>32</height>
</size>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
@ -502,7 +453,7 @@
</property>
<property name="iconSize">
<size>
<width>24</width>
<width>32</width>
<height>16</height>
</size>
</property>
@ -525,7 +476,7 @@
</property>
<property name="iconSize">
<size>
<width>24</width>
<width>32</width>
<height>16</height>
</size>
</property>
@ -622,22 +573,22 @@
<zorder>titleBarFrame</zorder>
</widget>
<customwidgets>
<customwidget>
<class>GroupTreeWidget</class>
<extends>QWidget</extends>
<header>gui/common/GroupTreeWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
<header location="global">gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>LinkTextBrowser</class>
<extends>QTextBrowser</extends>
<header>gui/common/LinkTextBrowser.h</header>
</customwidget>
<customwidget>
<class>GroupTreeWidget</class>
<extends>QWidget</extends>
<header>gui/common/GroupTreeWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="images.qrc"/>

View file

@ -121,12 +121,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
@ -910,7 +904,7 @@
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
<header location="global">gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>LinkTextBrowser</class>

View file

@ -95,6 +95,9 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) :
ui->filterLineEdit->addFilter(QIcon(), tr("Title"), FILTER_NAME_INDEX , tr("Search Title"));
ui->filterLineEdit->addFilter(QIcon(), tr("Description"), FILTER_DESC_INDEX , tr("Search Description"));
ui->filterLineEdit->setCurrentFilter(FILTER_NAME_INDEX);
/* Initialize display button */
initDisplayMenu(ui->displayButton);
}
GroupTreeWidget::~GroupTreeWidget()
@ -118,6 +121,20 @@ void GroupTreeWidget::changeEvent(QEvent *e)
}
}
void GroupTreeWidget::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 GroupTreeWidget::processSettings(RshareSettings *settings, bool load)
{
if (settings == NULL) {

View file

@ -73,10 +73,11 @@ public:
GroupTreeWidget(QWidget *parent = 0);
~GroupTreeWidget();
// Add a widget to the tool area
void addToolButton(QToolButton *toolButton);
// Load and save settings (group must be startet from the caller)
void processSettings(RshareSettings *settings, bool load);
// Initialize the display menu for sorting
void initDisplayMenu(QToolButton *toolButton);
// Add a new category item
QTreeWidgetItem *addCategoryItem(const QString &name, const QIcon &icon, bool expand);
@ -117,6 +118,8 @@ private slots:
void sort();
private:
// Initialize the display menu for sorting
void initDisplayMenu(QToolButton *toolButton);
void calculateScore(QTreeWidgetItem *item, const QString &filterText);
void resort(QTreeWidgetItem *categoryItem);
void updateColors();

View file

@ -10,7 +10,7 @@
<height>257</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>2</number>
</property>
@ -18,7 +18,54 @@
<number>0</number>
</property>
<item>
<widget class="LineEditClear" name="filterLineEdit"/>
<widget class="QFrame" name="titleBarFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</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="LineEditClear" name="filterLineEdit"/>
</item>
<item>
<widget class="QToolButton" name="displayButton">
<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="RSTreeWidget" name="treeWidget">
@ -78,6 +125,8 @@
<header>gui/common/RSTreeWidget.h</header>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View file

@ -75,7 +75,6 @@ GxsChannelDialog::GxsChannelDialog(QWidget *parent)
mChannelQueue = new TokenQueue(rsGxsChannels->getTokenService(), this);
connect(ui.newChannelButton, SIGNAL(clicked()), this, SLOT(createChannel()));
connect(ui.postButton, SIGNAL(clicked()), this, SLOT(createMsg()));
// connect(NotifyQt::getInstance(), SIGNAL(channelMsgReadSatusChanged(QString,QString,int)), this, SLOT(channelMsgReadSatusChanged(QString,QString,int)));
@ -93,7 +92,11 @@ GxsChannelDialog::GxsChannelDialog(QWidget *parent)
ui.splitter->setSizes(sizes);
/* Initialize group tree */
ui.treeWidget->initDisplayMenu(ui.displayButton);
QToolButton *newChannelButton = new QToolButton(this);
newChannelButton->setIcon(QIcon(":/images/add_channel24.png"));
newChannelButton->setToolTip(tr("Create Channel"));
connect(newChannelButton, SIGNAL(clicked()), this, SLOT(createChannel()));
ui.treeWidget->addToolButton(newChannelButton);
ownChannels = ui.treeWidget->addCategoryItem(tr("My Channels"), QIcon(IMAGE_CHANNELBLUE), true);
subcribedChannels = ui.treeWidget->addCategoryItem(tr("Subscribed Channels"), QIcon(IMAGE_CHANNELRED), true);

View file

@ -95,58 +95,6 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="displayButton">
<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>
<item>
<widget class="QToolButton" name="newChannelButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Create Channel</string>
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/add_channel24.png</normaloff>:/images/add_channel24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>16</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -236,7 +184,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>362</width>
<width>389</width>
<height>16</height>
</rect>
</property>

View file

@ -21,6 +21,7 @@
#include <QMenu>
#include <QMessageBox>
#include <QToolButton>
#include "GxsForumsDialog.h"
#include "GxsForumGroupDialog.h"
@ -81,7 +82,6 @@ GxsForumsDialog::GxsForumsDialog(QWidget *parent)
// no widget to add yet
connect(ui.forumTreeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT(forumListCustomPopupMenu(QPoint)));
connect(ui.newForumButton, SIGNAL(clicked()), this, SLOT(newforum()));
connect(ui.forumTreeWidget, SIGNAL(treeItemActivated(QString)), this, SLOT(changedForum(QString)));
connect(ui.forumTreeWidget->treeWidget(), SIGNAL(signalMouseMiddleButtonClicked(QTreeWidgetItem*)), this, SLOT(forumTreeMiddleButtonClicked(QTreeWidgetItem*)));
connect(ui.threadTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(threadTabCloseRequested(int)));
@ -92,7 +92,11 @@ GxsForumsDialog::GxsForumsDialog(QWidget *parent)
connect(ui.todoPushButton, SIGNAL(clicked()), this, SLOT(todo()));
/* Initialize group tree */
ui.forumTreeWidget->initDisplayMenu(ui.displayButton);
QToolButton *newForumButton = new QToolButton(this);
newForumButton->setIcon(QIcon(":/images/new_forum16.png"));
newForumButton->setToolTip(tr("Create Forum"));
connect(newForumButton, SIGNAL(clicked()), this, SLOT(newforum()));
ui.forumTreeWidget->addToolButton(newForumButton);
/* Set initial size the splitter */
QList<int> sizes;

View file

@ -63,7 +63,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/konversation.png</pixmap>
<pixmap resource="../images.qrc">:/images/konversation.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
@ -104,55 +104,6 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="displayButton">
<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>
<item>
<widget class="QToolButton" name="newForumButton">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Create Forum</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/new_forum16.png</normaloff>:/images/new_forum16.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>16</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -208,7 +159,7 @@
</customwidget>
</customwidgets>
<resources>
<include location="images.qrc"/>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>