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

View File

@ -1064,10 +1064,6 @@ p, li { white-space: pre-wrap; }
<source>Channels</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Display</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create Channel</source>
<translation type="unfinished"></translation>
@ -1397,7 +1393,7 @@ Double click lobbies to enter and chat.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source> &lt;h1&gt;&lt;img width=&quot;32&quot; src=&quot;:/images/64px_help.png&quot;&gt;&amp;nbsp;&amp;nbsp;Chat Lobbies&lt;/h1&gt; &lt;p&gt;Chat lobbies are distributed chat rooms, and work pretty much like IRC. They allow you to talk anonymously with tons of people without the need to make friends.&lt;/p&gt; &lt;p&gt;A chat lobby can be public (you friends see it) or private (your friends can&apos;t see it, unless you invite them with &lt;img src=&quot;:/images/add_24x24.png&quot; width=12/&gt;). Once you have been invited to a private lobby, you will be able to see it when your friends are using it.&lt;/p&gt; &lt;p&gt;The list at left shows chat lobbies your friends are participating into. You can either &lt;ul&gt; &lt;li&gt;Right click to create a new chat lobby&lt;/li&gt; &lt;li&gt;Double click a chat lobby to enter, chat, and show it to your friends&lt;/li&gt; &lt;/ul&gt; &lt;/p&gt; </source>
<source> &lt;h1&gt;&lt;img width=&quot;32&quot; src=&quot;:/images/64px_help.png&quot;&gt;&amp;nbsp;&amp;nbsp;Chat Lobbies&lt;/h1&gt; &lt;p&gt;Chat lobbies are distributed chat rooms, and work pretty much like IRC. They allow you to talk anonymously with tons of people without the need to make friends.&lt;/p&gt; &lt;p&gt;A chat lobby can be public (you friends see it) or private (your friends can&apos;t see it, unless you invite them with &lt;img src=&quot;:/images/add_24x24.png&quot; width=12/&gt;). Once you have been invited to a private lobby, you will be able to see it when your friends are using it.&lt;/p&gt; &lt;p&gt;The list at left shows chat lobbies your friends are participating into. You can either &lt;ul&gt; &lt;li&gt;Right click to create a new chat lobby&lt;/li&gt; &lt;li&gt;Double click a chat lobby to enter, chat, and show it to your friends&lt;/li&gt; &lt;/ul&gt; Note: For the chat lobbies to work properly, your computer needs be on time. So check your system clock! &lt;/p&gt; </source>
<translation type="unfinished"></translation>
</message>
</context>
@ -5076,10 +5072,6 @@ p, li { white-space: pre-wrap; }
<source>Forums</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Display</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create Forum</source>
<translation type="unfinished"></translation>
@ -6543,6 +6535,10 @@ p, li { white-space: pre-wrap; }
<source>Private Key Available</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Display</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>GuiExprElement</name>
@ -6629,10 +6625,6 @@ p, li { white-space: pre-wrap; }
<source>Channels</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Display</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create Channel</source>
<translation type="unfinished"></translation>
@ -7129,10 +7121,6 @@ before you can comment</source>
<source>Forums</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Display</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Create Forum</source>
<translation type="unfinished"></translation>
@ -9527,6 +9515,10 @@ Right-click and select &apos;make friend&apos; to be able to connect.</source>
<source>Only show people you trusted</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Send Message</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>NetworkPage</name>
@ -10994,11 +10986,6 @@ Characters &lt;b&gt;&quot;,|,/,\,&amp;lt;,&amp;gt;,*,?&lt;/b&gt; will be replace
<source>Failed to process collection file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The collection file %1 could not be opened.
Reported error is: %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Deny friend</source>
<translation type="unfinished"></translation>
@ -11144,6 +11131,13 @@ Reported error is: %2</source>
<source>Secured tunnel is working. You can talk!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The collection file %1 could not be opened.
Reported error is:
%2</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QuickStartWizard</name>
@ -11514,6 +11508,12 @@ Characters &lt;b&gt;&quot;,|,/,\,&amp;lt;,&amp;gt;,*,?&lt;/b&gt; will be replace
<source>Create collection file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>This file contains the string &quot;%1&quot; and is therefore an invalid collection file.
If you believe it is correct, remove the corresponding line from the file and re-open it with Retroshare.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RsHtml</name>