Added a placeholder text to the message list in the MessagesDialog (currently used when Starred is selected).

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4235 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-06-05 20:19:10 +00:00
parent 3b89616334
commit 9fb2ddfec0
7 changed files with 172 additions and 51 deletions

View File

@ -310,6 +310,7 @@ HEADERS += rshare.h \
gui/common/PeerDefs.h \
gui/common/PopularityDefs.h \
gui/common/GroupTreeWidget.h \
gui/common/RSTreeView.h \
gui/style/RSStyle.h \
gui/style/StyleDialog.h \
gui/MessagesDialog.h \
@ -523,6 +524,7 @@ SOURCES += main.cpp \
gui/common/PeerDefs.cpp \
gui/common/PopularityDefs.cpp \
gui/common/GroupTreeWidget.cpp \
gui/common/RSTreeView.cpp \
gui/style/RSStyle.cpp \
gui/style/StyleDialog.cpp \
gui/settings/rsharesettings.cpp \

View File

@ -846,6 +846,7 @@ void MessagesDialog::insertMessages()
uint32_t quickViewId = 0;
QString boxText;
QIcon boxIcon;
QString placeholderText;
switch (m_eListMode) {
case LIST_NOTHING:
@ -898,8 +899,19 @@ void MessagesDialog::insertMessages()
boxText = item->text();
boxIcon = item->icon();
if (quickViewType == QUICKVIEW_TYPE_NOTHING) {
switch (quickViewType) {
case QUICKVIEW_TYPE_NOTHING:
doFill = false;
break;
case QUICKVIEW_TYPE_STATIC:
switch (quickViewId) {
case QUICKVIEW_STATIC_ID_STARRED:
placeholderText = tr("No starred messages available. Stars let you give messages a special status to make them easier to find. To star a message, click on the light grey star beside any message.");
break;
}
break;
case QUICKVIEW_TYPE_TAG:
break;
}
} else {
doFill = false;
@ -913,6 +925,7 @@ void MessagesDialog::insertMessages()
ui.tabWidget->setTabText (0, boxText);
ui.tabWidget->setTabIcon (0, boxIcon);
ui.messagestreeView->setPlaceholderText(placeholderText);
if (msgbox == RS_MSG_INBOX) {
MessagesModel->setHeaderData(COLUMN_FROM, Qt::Horizontal, tr("From"));

View File

@ -582,7 +582,7 @@ border: 1px solid #CCCCCC;}</string>
<string>Compose</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/folder-draft24.png</normaloff>:/images/folder-draft24.png</iconset>
</property>
<property name="iconSize">
@ -639,7 +639,7 @@ border: 1px solid #CCCCCC;}</string>
<string>Reply</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/replymail-pressed.png</normaloff>:/images/replymail-pressed.png</iconset>
</property>
<property name="iconSize">
@ -680,7 +680,7 @@ border: 1px solid #CCCCCC;}</string>
<string>Reply all</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/replymailall24-hover.png</normaloff>:/images/replymailall24-hover.png</iconset>
</property>
<property name="iconSize">
@ -721,7 +721,7 @@ border: 1px solid #CCCCCC;}</string>
<string>Foward</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/mailforward24-hover.png</normaloff>:/images/mailforward24-hover.png</iconset>
</property>
<property name="iconSize">
@ -772,7 +772,7 @@ border: 1px solid #CCCCCC;}</string>
<string>Delete</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/deletemail24.png</normaloff>:/images/deletemail24.png</iconset>
</property>
<property name="iconSize">
@ -819,7 +819,7 @@ border: 1px solid #CCCCCC;}</string>
<string>Print</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/print24.png</normaloff>:/images/print24.png</iconset>
</property>
<property name="iconSize">
@ -854,7 +854,7 @@ border: 1px solid #CCCCCC;}</string>
<string>Display</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/looknfeel.png</normaloff>:/images/looknfeel.png</iconset>
</property>
<property name="iconSize">
@ -895,7 +895,7 @@ border: 1px solid #CCCCCC;}</string>
<string/>
</property>
<property name="pixmap">
<pixmap>:/images/find-16.png</pixmap>
<pixmap resource="images.qrc">:/images/find-16.png</pixmap>
</property>
</widget>
</item>
@ -993,7 +993,7 @@ border-image: url(:/images/closepressed.png)
<string>Tags</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/tag24.png</normaloff>:/images/tag24.png</iconset>
</property>
<property name="iconSize">
@ -1129,7 +1129,7 @@ border-image: url(:/images/closepressed.png)
<string>Inbox</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/folder-inbox.png</normaloff>:/images/folder-inbox.png</iconset>
</property>
</item>
@ -1138,7 +1138,7 @@ border-image: url(:/images/closepressed.png)
<string>Outbox</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/folder-outbox.png</normaloff>:/images/folder-outbox.png</iconset>
</property>
</item>
@ -1147,7 +1147,7 @@ border-image: url(:/images/closepressed.png)
<string>Draft</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/folder-draft.png</normaloff>:/images/folder-draft.png</iconset>
</property>
</item>
@ -1156,7 +1156,7 @@ border-image: url(:/images/closepressed.png)
<string>Sent</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/folder-sent.png</normaloff>:/images/folder-sent.png</iconset>
</property>
</item>
@ -1165,7 +1165,7 @@ border-image: url(:/images/closepressed.png)
<string>Trash</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/folder-trash.png</normaloff>:/images/folder-trash.png</iconset>
</property>
</item>
@ -1212,7 +1212,7 @@ border: 1px solid #CCCCCC;}</string>
<string>Quick View</string>
</property>
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/tag24.png</normaloff>:/images/tag24.png</iconset>
</property>
<property name="checkable">
@ -1296,7 +1296,7 @@ padding: 4px;
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QTreeView" name="messagestreeView">
<widget class="RSTreeView" name="messagestreeView">
<property name="font">
<font>
<pointsize>9</pointsize>
@ -1368,7 +1368,7 @@ padding: 4px;
</action>
<action name="actionReply">
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/mail_reply.png</normaloff>:/images/mail_reply.png</iconset>
</property>
<property name="text">
@ -1377,7 +1377,7 @@ padding: 4px;
</action>
<action name="actionReplyAll">
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/mail_replyall.png</normaloff>:/images/mail_replyall.png</iconset>
</property>
<property name="text">
@ -1386,7 +1386,7 @@ padding: 4px;
</action>
<action name="actionForward">
<property name="icon">
<iconset>
<iconset resource="images.qrc">
<normaloff>:/images/mail_forward.png</normaloff>:/images/mail_forward.png</iconset>
</property>
<property name="text">
@ -1401,13 +1401,20 @@ padding: 4px;
<header>gui/common/RSTabWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>RSTreeView</class>
<extends>QTreeView</extends>
<header>gui/common/RSTreeView.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>newmessageButton</tabstop>
<tabstop>replymessageButton</tabstop>
<tabstop>listWidget</tabstop>
</tabstops>
<resources/>
<resources>
<include location="images.qrc"/>
</resources>
<connections>
<connection>
<sender>quickViewsButton</sender>

View File

@ -0,0 +1,51 @@
/****************************************************************
* This file is distributed under the following license:
*
* Copyright (c) 2010, RetroShare Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#include <QPainter>
#include "RSTreeView.h"
RSTreeView::RSTreeView(QWidget *parent) : QTreeView(parent)
{
}
void RSTreeView::setPlaceholderText(const QString &text)
{
placeholderText = text;
repaint();
}
void RSTreeView::paintEvent(QPaintEvent *event)
{
QTreeView::paintEvent(event);
if (placeholderText.isEmpty() == false && model() && model()->rowCount() == 0) {
QWidget *vieportWidget = viewport();
QPainter painter(vieportWidget);
QPen pen = painter.pen();
QColor color = pen.color();
color.setAlpha(128);
pen.setColor(color);
painter.setPen(pen);
painter.drawText(QRect(QPoint(), vieportWidget->size()), Qt::AlignHCenter | Qt::AlignVCenter | Qt::TextWordWrap, placeholderText);
}
};

View File

@ -0,0 +1,43 @@
/****************************************************************
* This file is distributed under the following license:
*
* Copyright (c) 2010, RetroShare Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#ifndef _RSTREEVIEW_H
#define _RSTREEVIEW_H
#include <QTreeView>
/* Subclassing QTreeView */
class RSTreeView : public QTreeView
{
Q_OBJECT
public:
RSTreeView(QWidget *parent = 0);
void setPlaceholderText(const QString &text);
protected:
void paintEvent(QPaintEvent *event);
QString placeholderText;
};
#endif

View File

@ -6956,17 +6956,17 @@ p, li { white-space: pre-wrap; }
<name>MessagesDialog</name>
<message>
<location filename="../gui/MessagesDialog.ui" line="+576"/>
<location filename="../gui/MessagesDialog.cpp" line="+627"/>
<location filename="../gui/MessagesDialog.cpp" line="+621"/>
<source>New Message</source>
<translation>Neue Nachricht</translation>
</message>
<message>
<location filename="../gui/MessagesDialog.cpp" line="-66"/>
<location line="+799"/>
<source>Reply to Message</source>
<translation>Antworten nur an Absender</translation>
</message>
<message>
<location line="-12"/>
<location filename="../gui/MessagesDialog.cpp" line="-74"/>
<source>Open in a new window</source>
<translation>In neuem Fenster öffnen</translation>
</message>
@ -6976,20 +6976,20 @@ p, li { white-space: pre-wrap; }
<translation>In neuem Tab öffnen</translation>
</message>
<message>
<location line="+55"/>
<location line="+51"/>
<source>Remove Message</source>
<translation>Nachricht entfernen</translation>
</message>
<message>
<location filename="../gui/MessagesDialog.ui" line="+393"/>
<location filename="../gui/MessagesDialog.cpp" line="-412"/>
<location filename="../gui/MessagesDialog.ui" line="-406"/>
<location filename="../gui/MessagesDialog.cpp" line="-408"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location line="-5"/>
<location filename="../gui/MessagesDialog.cpp" line="-1"/>
<location line="+728"/>
<location line="+736"/>
<source>From</source>
<translation>Von</translation>
</message>
@ -7071,16 +7071,16 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location line="+175"/>
<location filename="../gui/MessagesDialog.cpp" line="-51"/>
<location line="+823"/>
<location filename="../gui/MessagesDialog.cpp" line="-62"/>
<location line="+834"/>
<location line="+10"/>
<source>Inbox</source>
<translation>Posteingang</translation>
</message>
<message>
<location line="+9"/>
<location filename="../gui/MessagesDialog.cpp" line="-829"/>
<location line="+842"/>
<location filename="../gui/MessagesDialog.cpp" line="-840"/>
<location line="+853"/>
<location line="+8"/>
<source>Outbox</source>
<translation>Postausgang</translation>
@ -7092,7 +7092,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location line="+9"/>
<location filename="../gui/MessagesDialog.cpp" line="-842"/>
<location filename="../gui/MessagesDialog.cpp" line="-853"/>
<source>Sent</source>
<translation>Gesendet</translation>
</message>
@ -7165,7 +7165,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location line="-407"/>
<location filename="../gui/MessagesDialog.cpp" line="-691"/>
<location filename="../gui/MessagesDialog.cpp" line="-688"/>
<source>Subject</source>
<translation>Betreff</translation>
</message>
@ -7205,7 +7205,7 @@ p, li { white-space: pre-wrap; }
<translation>Gekennzeichnet</translation>
</message>
<message>
<location line="+167"/>
<location line="+163"/>
<source>Edit</source>
<translation>Bearbeiten</translation>
</message>
@ -7220,12 +7220,12 @@ p, li { white-space: pre-wrap; }
<translation>Nachrichten entfernen</translation>
</message>
<message>
<location line="-40"/>
<location filename="../gui/MessagesDialog.ui" line="+574"/>
<source>Forward Message</source>
<translation>Weiterleiten</translation>
</message>
<message>
<location line="-367"/>
<location filename="../gui/MessagesDialog.cpp" line="-403"/>
<source>Click to sort by attachments</source>
<translation>Klicken, um nach Anhang zu sortieren</translation>
</message>
@ -7241,12 +7241,12 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location line="+1"/>
<location line="+720"/>
<location line="+728"/>
<source>Click to sort by from</source>
<translation>Klicken, um nach Von zu sortieren</translation>
</message>
<message>
<location line="-719"/>
<location line="-727"/>
<source>Click to sort by date</source>
<translation>Klicken, um nach Datum zu sortieren</translation>
</message>
@ -7272,7 +7272,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Empfohlene Dateien einblenden</translation>
</message>
<message>
<location line="+721"/>
<location line="+729"/>
<source>Click to sort by to</source>
<translation>Klicken, um nach Empfänger zu sortieren</translation>
</message>
@ -7293,8 +7293,8 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">HTML-Dateien (*.htm *.html);;Alle Dateien (*)</translation>
</message>
<message>
<location line="-676"/>
<location line="+313"/>
<location filename="../gui/MessagesDialog.ui" line="-9"/>
<location filename="../gui/MessagesDialog.cpp" line="-684"/>
<source>Reply to All</source>
<translation>Allen antworten</translation>
</message>
@ -7306,13 +7306,13 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;p, li { white-space: pre-wrap; }&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;Arial&apos;; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Alle Dateien runterladen&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<location filename="../gui/MessagesDialog.ui" line="+427"/>
<location line="-138"/>
<source>Total Inbox:</source>
<translation>Posteingang gesamt:</translation>
</message>
<message>
<location line="-272"/>
<location filename="../gui/MessagesDialog.cpp" line="-366"/>
<location filename="../gui/MessagesDialog.cpp" line="-53"/>
<source>Content</source>
<translation>Inhalt</translation>
</message>
@ -7331,8 +7331,8 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location line="+172"/>
<location filename="../gui/MessagesDialog.cpp" line="+601"/>
<location line="+869"/>
<location filename="../gui/MessagesDialog.cpp" line="+598"/>
<location line="+880"/>
<location line="+5"/>
<source>Trash</source>
<translation>Papierkorb</translation>
@ -7355,7 +7355,7 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Neues Schlagwort...</translation>
</message>
<message>
<location filename="../gui/MessagesDialog.cpp" line="-1187"/>
<location filename="../gui/MessagesDialog.cpp" line="-1199"/>
<source>Mark as read</source>
<translation>Als gelesen markieren</translation>
</message>
@ -7380,8 +7380,8 @@ p, li { white-space: pre-wrap; }
<translation>Papierkorb leeren</translation>
</message>
<message>
<location line="+240"/>
<location line="+858"/>
<location line="+241"/>
<location line="+869"/>
<location line="+8"/>
<source>Drafts</source>
<translation>Entwürfe</translation>
@ -7396,12 +7396,17 @@ p, li { white-space: pre-wrap; }
<translation type="obsolete">Editieren...</translation>
</message>
<message>
<location line="-719"/>
<location line="-727"/>
<source>Click to sort by star</source>
<translation>Klicken, um nach Kennzeichnung zu sortieren</translation>
</message>
<message>
<location line="+1459"/>
<location line="+703"/>
<source>No starred messages available. Stars let you give messages a special status to make them easier to find. To star a message, click on the light grey star beside any message.</source>
<translation>Es sind keine gekennzeichneten Nachrichten vorhanden. Durch die Kennzeichnung kannst du Nachrichten mit einem speziellen Status versehen, sodass sie leichter zu finden sind. Klicke zum Kennzeichnen einer Nachricht auf den hellgrauen Stern neben der jeweiligen Nachricht.</translation>
</message>
<message>
<location line="+764"/>
<location line="+4"/>
<location line="+4"/>
<location line="+4"/>