fixed a few more icons (help icons, grou tree widgets, bullets)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8573 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-06-30 16:44:58 +00:00
parent 636635a8b8
commit d3257e4455
44 changed files with 90 additions and 148 deletions

View File

@ -163,12 +163,13 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
// load settings
processSettings(true);
int S = QFontMetricsF(font()).height();
QString help_str = tr("\
<h1><img width=\"32\" src=\":/images/64px_help.png\">&nbsp;&nbsp;Chat Lobbies</h1> \
<h1><img width=\"%1\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Chat Lobbies</h1> \
<p>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.</p> \
<p>A chat lobby can be public (your friends see it) or private (your friends can't see it, unless you \
invite them with <img src=\":/images/add_24x24.png\" width=12/>). \
invite them with <img src=\":/images/add_24x24.png\" width=%2/>). \
Once you have been invited to a private lobby, you will be able to see it when your friends \
are using it.</p> \
<p>The list at left shows \
@ -180,7 +181,7 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
Note: For the chat lobbies to work properly, your computer needs be on time. So check your system clock!\
</p> \
"
) ;
).arg(QString::number(2*S)).arg(QString::number(S)) ;
registerHelpButton(ui.helpButton,help_str) ;
}

View File

@ -81,7 +81,7 @@
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/64px_help.png</normaloff>:/images/64px_help.png</iconset>
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>

View File

@ -478,17 +478,18 @@ TransfersDialog::TransfersDialog(QWidget *parent)
// load settings
processSettings(true);
int S = QFontMetricsF(font()).height();
QString help_str = tr(
" <h1><img width=\"32\" src=\":/images/64px_help.png\">&nbsp;&nbsp;File Transfer</h1> \
" <h1><img width=\"%1\" src=\":/icons/help_64.png\">&nbsp;&nbsp;File Transfer</h1> \
<p>Retroshare brings two ways of transferring files: direct transfers from your friends, and \
distant anonymous tunnelled transfers. In addition, file transfer is multi-source and allows swarming \
(you can be a source while downloading)</p> \
<p>You can share files using the <img src=\":/images/directoryadd_24x24_shadow.png\" width=16 /> icon from the left side bar. \
<p>You can share files using the <img src=\":/images/directoryadd_24x24_shadow.png\" width=%2 /> icon from the left side bar. \
These files will be listed in the My Files tab. You can decide for each friend group whether they can or not see these files \
in their Friends Files tab</p>\
<p>The search tab reports files from your friends' file lists, and distant files that can be reached \
anonymously using the multi-hop tunnelling system.</p> \
") ;
").arg(QString::number(2*S)).arg(QString::number(S)) ;
registerHelpButton(ui.helpButton,help_str) ;

View File

@ -81,7 +81,7 @@
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/64px_help.png</normaloff>:/images/64px_help.png</iconset>
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>

View File

@ -174,14 +174,9 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
QSize ULListDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
{
float w = QFontMetricsF(option.font).width(index.data(Qt::DisplayRole).toString());
int S = QFontMetricsF(option.font).height() ;
return QSize(4*S,S);
//return QSize(50,17);
//QVariant value = index.data(Qt::FontRole);
//QFont fnt = value.isValid() ? qvariant_cast<QFont>(value) : option.font;
//QFontMetrics fontMetrics(fnt);
//const QString text = index.data(Qt::DisplayRole).toString();
//QRect textRect = QRect(0, 0, 0, fontMetrics.lineSpacing() * (text.count(QLatin1Char('\n')) + 1));
//return textRect.size();
return QSize(w,S);
}

View File

@ -159,7 +159,7 @@ QList<int> sizes;
}
QString hlp_str = tr(
" <h1><img width=\"32\" src=\":/images/64px_help.png\">&nbsp;&nbsp;Network</h1> \
" <h1><img width=\"32\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Network</h1> \
<p>The Network tab shows your friend Retroshare nodes: the neighbor Retroshare nodes that are connected to you. \
</p> \
<p>You can group nodes together to allow a finer level of information access, for instance to only allow \

View File

@ -69,7 +69,7 @@
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/64px_help.png</normaloff>:/images/64px_help.png</iconset>
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>

View File

@ -208,7 +208,7 @@ IdDialog::IdDialog(QWidget *parent) :
#endif
QString hlp_str = tr(
" <h1><img width=\"32\" src=\":/images/64px_help.png\">&nbsp;&nbsp;Identities</h1> \
" <h1><img width=\"32\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Identities</h1> \
<p>In this tab you can create/edit pseudo-anonymous identities. \
</p> \
<p>Identities are used to securely identify your data: sign forum and channel posts,\

View File

@ -100,7 +100,7 @@
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/64px_help.png</normaloff>:/images/64px_help.png</iconset>
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>

View File

@ -120,6 +120,9 @@
#define IMAGE_ABOUT ":/icons/information_128.png"
#define IMAGE_ADDFRIEND ":/icons/add_user_256.png"
#define IMAGE_RETROSHARE ":/icons/logo_128.png"
#define IMAGE_NOONLINE ":/icons/logo_0_connected_128.png"
#define IMAGE_ONEONLINE ":/icons/logo_1_connected_128.png"
#define IMAGE_TWOONLINE ":/icons/logo_2_connected_128.png"
/* Images for toolbar icons */
//#define IMAGE_NETWORK2 ":/images/rs1.png"
@ -148,9 +151,6 @@
//#define IMG_HELP ":/images/help24.png"
//#define IMAGE_NEWSFEED ":/images/newsfeed/news-feed-32.png"
#define IMAGE_PLUGINS ":/images/extension_32.png"
#define IMAGE_NOONLINE ":/images/logo/logo_24_0.png"
#define IMAGE_ONEONLINE ":/images/logo/logo_24_1.png"
#define IMAGE_TWOONLINE ":/images/logo/logo_24_2.png"
#define IMAGE_BLOGS ":/images/kblogger.png"
#define IMAGE_DHT ":/images/dht16.png"
//#define IMAGE_CHATLOBBY ":/images/chat_32.png"

View File

@ -293,18 +293,17 @@ MessagesDialog::MessagesDialog(QWidget *parent)
// remove close button of the the first tab
ui.tabWidget->hideCloseButton(0);
int S = QFontMetricsF(font()).height();
QString help_str = tr(
" <h1><img width=\"32\" src=\":/images/64px_help.png\">&nbsp;&nbsp;Messages</h1> \
" <h1><img width=\"%1\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Messages</h1> \
<p>Retroshare has its own internal email system. You can send/receive emails to/from connected friend nodes.</p> \
<p>It is also possible to send messages to other people's Identities using the global routing system. These messages \
are always encrypted and are relayed by intermediate nodes until they reach their final destination. </p>\
<p>It is recommended to cryptographically sign distant messages, as a proof of your identity, using \
the <img width=\"16\" src=\":/images/stock_signature_ok.png\"/> button \
in the message composer window. Distant messages stay into your Outbox until an acknowledgement of receipt has been received.</p>\
are always encrypted and signed, and are relayed by intermediate nodes until they reach their final destination. </p>\
<p>Distant messages stay into your Outbox until an acknowledgement of receipt has been received.</p>\
<p>Generally, you may use messages to recommend files to your friends by pasting file links, \
or recommend friend nodes to other friend nodes, in order to strenghten your network, or send feedback \
to a channel's owner.</p> \
") ;
").arg(QString::number(2*S)).arg(QString::number(S)) ;
registerHelpButton(ui.helpButton,help_str) ;
}

View File

@ -437,7 +437,7 @@
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/64px_help.png</normaloff>:/images/64px_help.png</iconset>
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>

View File

@ -123,7 +123,7 @@ NewsFeed::NewsFeed(QWidget *parent) :
connect(ui->feedWidget, SIGNAL(feedCountChanged()), this, SLOT(sendNewsFeedChanged()));
QString hlp_str = tr(
" <h1><img width=\"32\" src=\":/images/64px_help.png\">&nbsp;&nbsp;News Feed</h1> \
" <h1><img width=\"32\" src=\":/icons/help_64.png\">&nbsp;&nbsp;News Feed</h1> \
<p>The News Feed displays the last events on your network, sorted by the time you received them. \
This gives you a summary of the activity of your friends. \
You can configure which events to show by pressing on <b>Options</b>. </p> \

View File

@ -58,7 +58,7 @@ UserNotify *PostedDialog::getUserNotify(QObject *parent)
QString PostedDialog::getHelpString() const
{
QString hlp_str = tr("<h1><img width=\"32\" src=\":/images/64px_help.png\">&nbsp;&nbsp;Posted</h1> \
QString hlp_str = tr("<h1><img width=\"32\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Posted</h1> \
<p>The posted service allows you to share internet links, that spread among Retroshare nodes like forums and \
channels</p> \
<p>Links can be commented by subscribed users. A promotion system also gives the opportunity to \

View File

@ -430,11 +430,11 @@ void ChatLobbyDialog::updateParticipantsList()
time_t now = time(NULL);
if(isParticipantMuted(it2->first))
widgetitem->setIcon(COLUMN_ICON, QIcon(":/images/redled.png")) ;
widgetitem->setIcon(COLUMN_ICON, QIcon(":/icons/bullet_red_32.png"));
else if (tLastAct<now-60*30)
widgetitem->setIcon(COLUMN_ICON, QIcon(":/images/grayled.png"));
widgetitem->setIcon(COLUMN_ICON, QIcon(":/icons/bullet_grey_32.png"));
else
widgetitem->setIcon(COLUMN_ICON, QIcon(":/images/greenled.png"));
widgetitem->setIcon(COLUMN_ICON, QIcon(":/icons/bullet_green_32.png"));
RsGxsId gxs_id;
rsMsgs->getIdentityForChatLobby(lobbyId, gxs_id);

View File

@ -32,10 +32,10 @@
#include "RsAutoUpdatePage.h"
#include "PopupDistantChatDialog.h"
#define IMAGE_RED_LED ":/images/redled.png"
#define IMAGE_YEL_LED ":/images/yellowled.png"
#define IMAGE_GRN_LED ":/images/greenled.png"
#define IMAGE_GRY_LED ":/images/grayled.png"
#define IMAGE_RED_LED ":/icons/bullet_red_64.png"
#define IMAGE_YEL_LED ":/icons/bullet_yellow_64.png"
#define IMAGE_GRN_LED ":/icons/bullet_green_64.png"
#define IMAGE_GRY_LED ":/icons/bullet_grey_64.png"
PopupDistantChatDialog::~PopupDistantChatDialog()
{

View File

@ -89,12 +89,14 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) :
/* Initialize tree widget */
ui->treeWidget->setColumnCount(COLUMN_COUNT);
int S = QFontMetricsF(font()).height();
/* Set header resize modes and initial section sizes */
QHeaderView *header = ui->treeWidget->header ();
QHeaderView_setSectionResizeModeColumn(header, COLUMN_NAME, QHeaderView::Stretch);
header->resizeSection(COLUMN_NAME, 170);
header->resizeSection(COLUMN_NAME, 10*S);
QHeaderView_setSectionResizeModeColumn(header, COLUMN_POPULARITY, QHeaderView::Fixed);
header->resizeSection(COLUMN_POPULARITY, 25);
header->resizeSection(COLUMN_POPULARITY, 1.5*S);
/* add filter actions */
ui->filterLineEdit->addFilter(QIcon(), tr("Title"), FILTER_NAME_INDEX , tr("Search Title"));
@ -103,6 +105,8 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) :
/* Initialize display button */
initDisplayMenu(ui->displayButton);
ui->treeWidget->setIconSize(QSize(S*1.2,S*1.2)) ;
}
GroupTreeWidget::~GroupTreeWidget()
@ -283,7 +287,10 @@ QTreeWidgetItem *GroupTreeWidget::addCategoryItem(const QString &name, const QIc
item->setData(COLUMN_DATA, ROLE_NAME, name);
item->setFont(COLUMN_NAME, font);
item->setIcon(COLUMN_NAME, icon);
item->setSizeHint(COLUMN_NAME, QSize(18, 18));
int S = QFontMetricsF(font).height();
item->setSizeHint(COLUMN_NAME, QSize(S*1.1, S*1.1));
item->setForeground(COLUMN_NAME, QBrush(textColorCategory()));
item->setData(COLUMN_DATA, ROLE_COLOR, GROUPTREEWIDGET_COLOR_CATEGORY);

View File

@ -101,7 +101,7 @@
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/64px_help.png</normaloff>:/images/64px_help.png</iconset>
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>

View File

@ -51,7 +51,7 @@ GxsChannelDialog::~GxsChannelDialog()
QString GxsChannelDialog::getHelpString() const
{
QString hlp_str = tr("<h1><img width=\"32\" src=\":/images/64px_help.png\">&nbsp;&nbsp;Channels</h1> \
QString hlp_str = tr("<h1><img width=\"32\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Channels</h1> \
<p>Channels allow you to post data (e.g. movies, music) that will spread in the network</p> \
<p>You can see the channels your friends are subscribed to, and you automatically forward subscribed channels to \
your friends. This promotes good channels in the network.</p>\

View File

@ -50,7 +50,7 @@ GxsForumsDialog::~GxsForumsDialog()
QString GxsForumsDialog::getHelpString() const
{
QString hlp_str = tr(
"<h1><img width=\"32\" src=\":/images/64px_help.png\">&nbsp;&nbsp;Forums</h1> \
"<h1><img width=\"32\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Forums</h1> \
<p>Retroshare Forums look like internet forums, but they work in a decentralized way</p> \
<p>You see forums your friends are subscribed to, and you forward subscribed forums to \
your friends. This automatically promotes interesting forums in the network.</p> \

View File

@ -7,6 +7,10 @@
<file>icons/blank_green_128.png</file>
<file>icons/browsable_blue_128.png</file>
<file>icons/browsable_green_128.png</file>
<file>icons/bullet_green_64.png</file>
<file>icons/bullet_grey_64.png</file>
<file>icons/bullet_red_64.png</file>
<file>icons/bullet_yellow_64.png</file>
<file>icons/channels_128.png</file>
<file>icons/channels_red_128.png</file>
<file>icons/chat_128.png</file>
@ -14,14 +18,19 @@
<file>icons/circles_128.png</file>
<file>icons/friends_128.png</file>
<file>icons/help_128.png</file>
<file>icons/help_64.png</file>
<file>icons/information_128.png</file>
<file>icons/internet_128.png</file>
<file>icons/knews_128.png</file>
<file>icons/knews_red_128.png</file>
<file>icons/konversation_128.png</file>
<file>icons/konversation128.png</file>
<file>icons/konversation_red_128.png</file>
<file>icons/ktorrent_128.png</file>
<file>icons/logo_0_connected_128.png</file>
<file>icons/logo_128.png</file>
<file>icons/logo_1_connected_128.png</file>
<file>icons/logo_2_connected_128.png</file>
<file>icons/mail_128.png</file>
<file>icons/mail_old_128.png</file>
<file>icons/mail_red_128.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -34,7 +34,7 @@
<file>images/help/addafriend.png</file>
<file>images/help/addfriendkey.png</file>
<file>images/help/dhtgreen.png</file>
<file>images/64px_help.png</file>
<file>icons/help_64.png</file>
<file>images/help/natgreen.png</file>
<file>images/help/natred.png</file>
<file>images/attach.png</file>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 410 B

View File

@ -173,7 +173,7 @@ uint NotifyPage::getNewsFlags()
QString NotifyPage::helpText() const
{
return tr("<h1><img width=\"24\" src=\":/images/64px_help.png\">&nbsp;&nbsp;Notify</h1> \
return tr("<h1><img width=\"24\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Notify</h1> \
<p>Retroshare will notify you about what happens in your network. \
Depending on your usage, you may want to enable or disable some of the \
notifications. This page is designed for that!</p> \

View File

@ -151,7 +151,7 @@ PluginsPage::PluginsPage(QWidget * parent, Qt::WindowFlags flags)
}
QString PluginsPage::helpText() const
{
return tr("<h1><img width=\"24\" src=\":/images/64px_help.png\">&nbsp;&nbsp;Plugins</h1> \
return tr("<h1><img width=\"24\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Plugins</h1> \
<p>Plugins are loaded from the directories listed in the bottom list.</p> \
<p>For security reasons, accepted plugins load automatically until \
the main Retroshare executable or the plugin library changes. In \

View File

@ -55,7 +55,7 @@ RelayPage::RelayPage(QWidget * parent, Qt::WindowFlags flags)
QString RelayPage::helpText() const
{
return tr("<h1><img width=\"24\" src=\":/images/64px_help.png\">&nbsp;&nbsp;Relays</h1> \
return tr("<h1><img width=\"24\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Relays</h1> \
<p>By activating relays, you allow your Retroshare node to act as a bridge between Retroshare \
users who cannot connect directly, e.g. because they're firewalled.</p> \
<p>You may choose to act as a relay by checking <i>enable relay connections</i>, or simply \

View File

@ -42,7 +42,7 @@ ServicePermissionsPage::ServicePermissionsPage(QWidget * parent, Qt::WindowFlags
QString ServicePermissionsPage::helpText() const
{
return tr("<h1><img width=\"24\" src=\":/images/64px_help.png\">&nbsp;&nbsp;Permissions</h1> \
return tr("<h1><img width=\"24\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Permissions</h1> \
<p>Permissions allow you to control which services are available to which friends</p>\
<p>Each interruptor shows two lights, indicating whether you or your friend has enabled\
that service. Both needs to be ON (showing <img height=20 src=\":/images/switch11.png\"/>) to\

View File

@ -66,7 +66,7 @@ void WebuiPage::load()
QString WebuiPage::helpText() const
{
return tr("<h1><img width=\"24\" src=\":/images/64px_help.png\">&nbsp;&nbsp;Webinterface</h1> \
return tr("<h1><img width=\"24\" src=\":/icons/help_64.png\">&nbsp;&nbsp;Webinterface</h1> \
<p>The webinterface allows to control Retroshare from the browser. Multiple devices can share control over one Retroshare instance. So you could start a conversation on a tablet computer and later use a desktop computer to continue it.</p>\
<p>Warning: don't expose the webinterface to the internet, because there is no access control and no encryption. If you want to use the webinterface over the internet, use a SSH tunnel or a proxy to secure the connection.</p>");
}

View File

@ -76,7 +76,7 @@
</property>
<property name="icon">
<iconset resource="../images.qrc">
<normaloff>:/images/64px_help.png</normaloff>:/images/64px_help.png</iconset>
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>

View File

@ -75,10 +75,11 @@ void DHTStatus::getDHTStatus()
RsConfigNetStatus config;
rsConfig->getConfigNetStatus(config);
int S = QFontMetricsF(dhtstatusLabel->font()).height();
if (!(config.DHTActive))
{
// GRAY.
dhtstatusLabel->setPixmap(QPixmap(":/images/grayled.png"));
dhtstatusLabel->setPixmap(QPixmap(":/icons/bullet_grey_64.png").scaledToHeight(S,Qt::SmoothTransformation));
dhtstatusLabel->setToolTip( text + tr("DHT Off"));
spaceLabel->setVisible(false);
@ -96,7 +97,7 @@ void DHTStatus::getDHTStatus()
// YELLOW or GREEN.
if (config.netDhtRsNetSize < MIN_RS_NET_SIZE)
{
dhtstatusLabel->setPixmap(QPixmap(":/images/yellowled.png"));
dhtstatusLabel->setPixmap(QPixmap(":/icons/bullet_yellow_64.png").scaledToHeight(S,Qt::SmoothTransformation));
dhtstatusLabel->setToolTip( text + tr("DHT Searching for RetroShare Peers"));
spaceLabel->setVisible(true);
@ -108,7 +109,7 @@ void DHTStatus::getDHTStatus()
}
else
{
dhtstatusLabel->setPixmap(QPixmap(":/images/greenled.png"));
dhtstatusLabel->setPixmap(QPixmap(":/icons/bullet_green_64.png").scaledToHeight(S,Qt::SmoothTransformation));
dhtstatusLabel->setToolTip( text + tr("DHT Good"));
spaceLabel->setVisible(true);
@ -122,7 +123,7 @@ void DHTStatus::getDHTStatus()
else
{
// RED - some issue.
dhtstatusLabel->setPixmap(QPixmap(":/images/redled.png"));
dhtstatusLabel->setPixmap(QPixmap(":/icons/bullet_red_64.png").scaledToHeight(S,Qt::SmoothTransformation));
dhtstatusLabel->setToolTip( text + tr("DHT Error"));
spaceLabel->setVisible(false);

View File

@ -56,20 +56,21 @@ void NATStatus::getNATStatus()
statusNAT->setVisible(!_compactMode);
QString text = _compactMode?statusNAT->text():"";
int S = QFontMetricsF(iconLabel->font()).height() ;
switch(netState)
{
default:
case RSNET_NETSTATE_BAD_UNKNOWN:
{
iconLabel->setPixmap(QPixmap(":/images/yellowled.png")) ;
iconLabel->setPixmap(QPixmap(":/icons/bullet_yellow_64.png").scaledToHeight(S,Qt::SmoothTransformation)) ;
iconLabel->setToolTip( text + tr("Network Status Unknown")) ;
}
break ;
case RSNET_NETSTATE_BAD_OFFLINE:
{
iconLabel->setPixmap(QPixmap(":/images/grayled.png")) ;
iconLabel->setPixmap(QPixmap(":/icons/bullet_grey_64.png").scaledToHeight(S,Qt::SmoothTransformation)) ;
iconLabel->setToolTip( text + tr("Offline")) ;
}
break ;
@ -77,14 +78,14 @@ void NATStatus::getNATStatus()
// BAD. (RED)
case RSNET_NETSTATE_BAD_NATSYM:
{
iconLabel->setPixmap(QPixmap(":/images/redled.png")) ;
iconLabel->setPixmap(QPixmap(":/icons/bullet_red_64.png").scaledToHeight(S,Qt::SmoothTransformation)) ;
iconLabel->setToolTip( text + tr("Nasty Firewall")) ;
}
break ;
case RSNET_NETSTATE_BAD_NODHT_NAT:
{
iconLabel->setPixmap(QPixmap(":/images/redled.png")) ;
iconLabel->setPixmap(QPixmap(":/icons/bullet_red_64.png").scaledToHeight(S,Qt::SmoothTransformation)) ;
iconLabel->setToolTip( text + tr("DHT Disabled and Firewalled")) ;
}
break ;
@ -92,21 +93,21 @@ void NATStatus::getNATStatus()
// CAUTION. (ORANGE)
case RSNET_NETSTATE_WARNING_RESTART:
{
iconLabel->setPixmap(QPixmap(":/images/yellowled.png")) ;
iconLabel->setPixmap(QPixmap(":/icons/bullet_yellow_64.png").scaledToHeight(S,Qt::SmoothTransformation)) ;
iconLabel->setToolTip( text + tr("Network Restarting")) ;
}
break ;
case RSNET_NETSTATE_WARNING_NATTED:
{
iconLabel->setPixmap(QPixmap(":/images/yellowled.png")) ;
iconLabel->setPixmap(QPixmap(":/icons/bullet_yellow_64.png").scaledToHeight(S,Qt::SmoothTransformation)) ;
iconLabel->setToolTip( text + tr("Behind Firewall")) ;
}
break ;
case RSNET_NETSTATE_WARNING_NODHT:
{
iconLabel->setPixmap(QPixmap(":/images/yellowled.png")) ;
iconLabel->setPixmap(QPixmap(":/icons/bullet_yellow_64.png").scaledToHeight(S,Qt::SmoothTransformation)) ;
iconLabel->setToolTip( text + tr("DHT Disabled")) ;
}
break ;
@ -114,89 +115,17 @@ void NATStatus::getNATStatus()
// GOOD (GREEN)
case RSNET_NETSTATE_GOOD:
{
iconLabel->setPixmap(QPixmap(":/images/greenled.png")) ;
iconLabel->setPixmap(QPixmap(":/icons/bullet_green_64.png").scaledToHeight(S,Qt::SmoothTransformation)) ;
iconLabel->setToolTip( text + tr("RetroShare Server")) ;
}
break ;
case RSNET_NETSTATE_ADV_FORWARD:
{
iconLabel->setPixmap(QPixmap(":/images/greenled.png")) ;
iconLabel->setPixmap(QPixmap(":/icons/bullet_green_64.png").scaledToHeight(S,Qt::SmoothTransformation)) ;
iconLabel->setToolTip( text + tr("Forwarded Port")) ;
}
break ;
}
}
#if 0
void NATStatus::getNATStatus()
{
uint32_t netMode = rsConfig -> getNetworkMode();
uint32_t natType = rsConfig -> getNatTypeMode();
uint32_t natHole = rsConfig -> getNatHoleMode();
rsiface->lockData(); /* Lock Interface */
/* now the extra bit .... switch on check boxes */
const RsConfig &config = rsiface->getConfig();
// if(config.netUpnpOk)
// {
// iconLabel->setPixmap(QPixmap::QPixmap(":/images/greenled.png"));
// iconLabel->setToolTip(tr("UPNP is active."));
// }
// else
// {
// iconLabel->setPixmap(QPixmap::QPixmap(":/images/yellowled.png"));
// iconLabel->setToolTip(tr("UPNP NOT FOUND."));
// }
//
// if(config.netExtOk)
// {
// iconLabel->setPixmap(QPixmap::QPixmap(":/images/greenled.png"));
// iconLabel->setToolTip(tr("Stable External IP Address"));
// }
// else
// {
// iconLabel->setPixmap(QPixmap::QPixmap(":/images/yellowled.png"));
// iconLabel->setToolTip(tr("Not Found External Address"));
// }
//
// if(config.netUdpOk)
// {
// iconLabel->setPixmap(QPixmap::QPixmap(":/images/yellowled.png"));
// iconLabel->setToolTip(tr("UDP Port is reachable"));
// }
// else
// {
// iconLabel->setPixmap(QPixmap::QPixmap(":/images/grayled.png"));
// iconLabel->setToolTip(tr("UDP Port is not reachable"));
// }
if (config.netUpnpOk)
{
iconLabel->setPixmap(QPixmap(":/images/greenled.png"));
iconLabel->setToolTip(tr("OK | RetroShare Server"));
}
else if (config.netStunOk || config.netExtraAddressOk)
{
iconLabel->setPixmap(QPixmap(":/images/greenled.png"));
iconLabel->setToolTip(tr("Internet connection"));
}
else if (config.netLocalOk)
{
iconLabel->setPixmap(QPixmap(":/images/grayled.png"));
iconLabel->setToolTip(tr("No internet connection"));
}
else
{
iconLabel->setPixmap(QPixmap(":/images/redled.png"));
iconLabel->setToolTip(tr("No local network"));
}
rsiface->unlockData(); /* UnLock Interface */
}
#endif