mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-29 01:16:20 -05:00
fixed up top bar tooltips to display what the numbers actually mean
This commit is contained in:
parent
28a6b43357
commit
f5af7dfeb3
@ -1110,10 +1110,16 @@ int pqissl::SSL_Connection_Complete()
|
||||
if(rsEvents)
|
||||
{
|
||||
X509 *x509 = SSL_get_peer_certificate(ssl_connection);
|
||||
auto ev = std::make_shared<RsAuthSslConnectionAutenticationEvent>();
|
||||
ev->mSslId = RsX509Cert::getCertSslId(*x509);
|
||||
ev->mErrorCode = RsAuthSslError::PEER_REFUSED_CONNECTION;
|
||||
rsEvents->postEvent(ev);
|
||||
|
||||
if(x509)
|
||||
{
|
||||
auto ev = std::make_shared<RsAuthSslConnectionAutenticationEvent>();
|
||||
ev->mSslId = RsX509Cert::getCertSslId(*x509);
|
||||
ev->mErrorCode = RsAuthSslError::PEER_REFUSED_CONNECTION;
|
||||
|
||||
if(!ev->mSslId.isNull())
|
||||
rsEvents->postEvent(ev);
|
||||
}
|
||||
}
|
||||
|
||||
std::string out;
|
||||
|
@ -31,6 +31,7 @@ public:
|
||||
TransferUserNotify(QObject *parent = 0);
|
||||
|
||||
virtual bool hasSetting(QString *name, QString *group);
|
||||
virtual QString textInfo() const override { return tr("completed transfer(s)"); }
|
||||
|
||||
private:
|
||||
virtual QIcon getIcon();
|
||||
|
@ -483,7 +483,7 @@ void MainWindow::initStackedPage()
|
||||
for (notifyIt = notify.begin(); notifyIt != notify.end(); ++notifyIt) {
|
||||
UserNotify *userNotify = notifyIt->first->getUserNotify();
|
||||
if (userNotify) {
|
||||
userNotify->initialize(ui->toolBarPage, notifyIt->second.first, notifyIt->second.second);
|
||||
userNotify->initialize(ui->toolBarPage, notifyIt->second.first, notifyIt->second.second,userNotify->textInfo());
|
||||
connect(userNotify, SIGNAL(countChanged()), this, SLOT(updateTrayCombine()));
|
||||
userNotifyList.push_back(userNotify);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "retroshare/rsposted.h"
|
||||
#include "PostedUserNotify.h"
|
||||
#include "gui/MainWindow.h"
|
||||
#include "gui/common/FilesDefs.h"
|
||||
|
||||
PostedUserNotify::PostedUserNotify(RsGxsIfaceHelper *ifaceImpl, const GxsGroupFrameDialog *g, QObject *parent) :
|
||||
GxsUserNotify(ifaceImpl, g, parent)
|
||||
@ -37,12 +38,12 @@ bool PostedUserNotify::hasSetting(QString *name, QString *group)
|
||||
|
||||
QIcon PostedUserNotify::getIcon()
|
||||
{
|
||||
return QIcon(":/icons/png/posted.png");
|
||||
return FilesDefs::getIconFromQtResourcePath(":/icons/png/posted.png");
|
||||
}
|
||||
|
||||
QIcon PostedUserNotify::getMainIcon(bool hasNew)
|
||||
{
|
||||
return hasNew ? QIcon(":/icons/png/posted-notify.png") : QIcon(":/icons/png/posted.png");
|
||||
return hasNew ? FilesDefs::getIconFromQtResourcePath(":/icons/png/posted-notify.png") : FilesDefs::getIconFromQtResourcePath(":/icons/png/posted.png");
|
||||
}
|
||||
|
||||
void PostedUserNotify::iconClicked()
|
||||
|
@ -31,6 +31,7 @@ public:
|
||||
PostedUserNotify(RsGxsIfaceHelper *ifaceImpl, const GxsGroupFrameDialog *g, QObject *parent = 0);
|
||||
|
||||
virtual bool hasSetting(QString *name, QString *group);
|
||||
virtual QString textInfo() const override { return tr("new board post(s)"); }
|
||||
|
||||
private:
|
||||
virtual QIcon getIcon();
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
~ChatUserNotify();
|
||||
|
||||
virtual bool hasSetting(QString *name, QString *group);
|
||||
virtual QString textInfo() const override { return tr("mention(s)"); }
|
||||
|
||||
private slots:
|
||||
void chatMessageReceived(ChatMessage msg);
|
||||
|
@ -88,11 +88,12 @@ void UserNotify::setNotifyEnabled(bool enabled, bool combined, bool blink)
|
||||
Settings->endGroup();
|
||||
}
|
||||
|
||||
void UserNotify::initialize(QToolBar *mainToolBar, QAction *mainAction, QListWidgetItem *listItem)
|
||||
void UserNotify::initialize(QToolBar *mainToolBar, QAction *mainAction, QListWidgetItem *listItem,const QString& subtext)
|
||||
{
|
||||
mMainAction = mainAction;
|
||||
if (mMainAction) {
|
||||
mButtonText = mMainAction->text();
|
||||
mButtonText2 = subtext;
|
||||
if (mainToolBar) {
|
||||
mMainToolButton = dynamic_cast<QToolButton*>(mainToolBar->widgetForAction(mMainAction));
|
||||
}
|
||||
@ -165,7 +166,10 @@ void UserNotify::update()
|
||||
|
||||
if (mMainAction) {
|
||||
mMainAction->setIcon(getMainIcon(count > 0));
|
||||
mMainAction->setText((count > 0) ? QString("%1 (%2)").arg(mButtonText).arg(count) : mButtonText);
|
||||
|
||||
|
||||
mMainAction->setText((count > 0) ? (!mButtonText2.isNull())?QString("%1 (%2)").arg(mButtonText).arg(count).arg(mButtonText2) : QString("%1 (%2 %3)").arg(mButtonText).arg(count) : mButtonText);
|
||||
mMainAction->setToolTip((count > 0) ? (!mButtonText2.isNull())?QString("%1 %2").arg(count).arg(mButtonText2) : QString("%1").arg(count) : mButtonText);
|
||||
|
||||
QFont font = mMainAction->font();
|
||||
font.setBold(count > 0);
|
||||
|
@ -37,12 +37,17 @@ public:
|
||||
UserNotify(QObject *parent = 0);
|
||||
virtual ~UserNotify();
|
||||
|
||||
void initialize(QToolBar *mainToolBar, QAction *mainAction, QListWidgetItem *listItem);
|
||||
void initialize(QToolBar *mainToolBar, QAction *mainAction, QListWidgetItem *listItem,const QString& subtext);
|
||||
void createIcons(QMenu *notifyMenu);
|
||||
QSystemTrayIcon* getTrayIcon(){ return mTrayIcon;}
|
||||
QAction* getNotifyIcon(){ return mNotifyIcon;}
|
||||
|
||||
virtual bool hasSetting(QString */*name*/, QString */*group*/) { return false; }
|
||||
|
||||
// UserNotify is used to display tooltips when some services have no messages and so on, in the format of "Name (43242 new messages)"
|
||||
// This method is used to pass the string that comes after the number.
|
||||
virtual QString textInfo() const { return QString() ; }
|
||||
|
||||
bool notifyEnabled();
|
||||
bool notifyCombined();
|
||||
bool notifyBlink();
|
||||
@ -82,6 +87,7 @@ private:
|
||||
QAction *mNotifyIcon;
|
||||
unsigned int mNewCount;
|
||||
QString mButtonText;
|
||||
QString mButtonText2;
|
||||
bool mLastBlinking;
|
||||
};
|
||||
|
||||
|
@ -29,6 +29,7 @@ class NewsFeedUserNotify : public UserNotify
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
virtual QString textInfo() const override { return tr("logged event(s)"); }
|
||||
public:
|
||||
NewsFeedUserNotify(NewsFeed *newsFeed, QObject *parent = 0);
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "retroshare/rsgxschannels.h"
|
||||
#include "GxsChannelUserNotify.h"
|
||||
#include "gui/MainWindow.h"
|
||||
#include "gui/common/FilesDefs.h"
|
||||
|
||||
GxsChannelUserNotify::GxsChannelUserNotify(RsGxsIfaceHelper *ifaceImpl, const GxsGroupFrameDialog *g, QObject *parent) :
|
||||
GxsUserNotify(ifaceImpl, g, parent)
|
||||
@ -37,12 +38,12 @@ bool GxsChannelUserNotify::hasSetting(QString *name, QString *group)
|
||||
|
||||
QIcon GxsChannelUserNotify::getIcon()
|
||||
{
|
||||
return QIcon(":/icons/png/channel.png");
|
||||
return FilesDefs::getIconFromQtResourcePath(":/icons/png/channel.png");
|
||||
}
|
||||
|
||||
QIcon GxsChannelUserNotify::getMainIcon(bool hasNew)
|
||||
{
|
||||
return hasNew ? QIcon(":/icons/png/channels-notify.png") : QIcon(":/icons/png/channel.png");
|
||||
return hasNew ? FilesDefs::getIconFromQtResourcePath(":/icons/png/channels-notify.png") : FilesDefs::getIconFromQtResourcePath(":/icons/png/channel.png");
|
||||
}
|
||||
|
||||
void GxsChannelUserNotify::iconClicked()
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
GxsChannelUserNotify(RsGxsIfaceHelper *ifaceImpl, const GxsGroupFrameDialog *g, QObject *parent = 0);
|
||||
|
||||
virtual bool hasSetting(QString *name, QString *group);
|
||||
virtual QString textInfo() const override { return tr("new message(s)"); }
|
||||
|
||||
private:
|
||||
virtual QIcon getIcon();
|
||||
|
@ -19,6 +19,7 @@
|
||||
*******************************************************************************/
|
||||
|
||||
#include "retroshare/rsgxsforums.h"
|
||||
#include "gui/common/FilesDefs.h"
|
||||
#include "GxsForumUserNotify.h"
|
||||
#include "gui/MainWindow.h"
|
||||
|
||||
@ -38,12 +39,12 @@ bool GxsForumUserNotify::hasSetting(QString *name, QString *group)
|
||||
|
||||
QIcon GxsForumUserNotify::getIcon()
|
||||
{
|
||||
return QIcon(":/icons/png/forums.png");
|
||||
return FilesDefs::getIconFromQtResourcePath(":/icons/png/forums.png");
|
||||
}
|
||||
|
||||
QIcon GxsForumUserNotify::getMainIcon(bool hasNew)
|
||||
{
|
||||
return hasNew ? QIcon(":/icons/png/forums-notify.png") : QIcon(":/icons/png/forums.png");
|
||||
return hasNew ? FilesDefs::getIconFromQtResourcePath(":/icons/png/forums-notify.png") : FilesDefs::getIconFromQtResourcePath(":/icons/png/forums.png");
|
||||
}
|
||||
|
||||
void GxsForumUserNotify::iconClicked()
|
||||
|
@ -31,6 +31,7 @@ public:
|
||||
GxsForumUserNotify(RsGxsIfaceHelper *ifaceImpl, const GxsGroupFrameDialog *g, QObject *parent = 0);
|
||||
|
||||
virtual bool hasSetting(QString *name, QString *group);
|
||||
virtual QString textInfo() const override { return tr("new message(s)"); }
|
||||
|
||||
private:
|
||||
virtual QIcon getIcon();
|
||||
|
@ -31,6 +31,7 @@ public:
|
||||
MessageUserNotify(QObject *parent = 0);
|
||||
|
||||
virtual bool hasSetting(QString *name, QString *group);
|
||||
virtual QString textInfo() const override { return tr("new mail(s)"); }
|
||||
|
||||
private:
|
||||
virtual QIcon getIcon();
|
||||
|
Loading…
Reference in New Issue
Block a user