mirror of
https://github.com/KDE/krfb
synced 2026-07-01 07:41:17 -07:00
Add tooltips to systray icon
svn path=/trunk/kdenetwork/krfb/; revision=195816
This commit is contained in:
1
TODO
1
TODO
@@ -2,7 +2,6 @@
|
||||
For 3.2:
|
||||
- write SLP service template for remote desktop protocols
|
||||
(documentation)
|
||||
- trayicon mouse-over text
|
||||
- when krfb is started with URL arguments and without connection
|
||||
quality, add some kind of smart algorithm to determine whether the
|
||||
other host is local (maybe using SLP to announce the connectivity
|
||||
|
||||
@@ -159,8 +159,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
QObject::connect(&controller, SIGNAL(sessionRefused()),
|
||||
&app, SLOT(quit()));
|
||||
QObject::connect(&controller, SIGNAL(sessionEstablished()),
|
||||
&trayicon, SLOT(showConnectedMessage()));
|
||||
QObject::connect(&controller, SIGNAL(sessionEstablished(QString)),
|
||||
&trayicon, SLOT(showConnectedMessage(QString)));
|
||||
QObject::connect(&controller, SIGNAL(sessionFinished()),
|
||||
&trayicon, SLOT(showDisconnectedMessage()));
|
||||
QObject::connect(&controller, SIGNAL(desktopControlSettingChanged(bool)),
|
||||
|
||||
@@ -453,7 +453,7 @@ void RFBController::connectionAccepted(bool aRC)
|
||||
server->rfbClientHead->clientGoneHook = clientGoneHook;
|
||||
state = RFB_CONNECTED;
|
||||
if (!server->rfbAuthPasswdData)
|
||||
emit sessionEstablished();
|
||||
emit sessionEstablished(remoteIp);
|
||||
}
|
||||
|
||||
void RFBController::acceptConnection(bool aRemoteControl)
|
||||
@@ -735,7 +735,7 @@ void RFBController::sendKNotifyEvent(const QString &n, const QString &d)
|
||||
|
||||
void RFBController::sendSessionEstablished()
|
||||
{
|
||||
emit sessionEstablished();
|
||||
emit sessionEstablished(remoteIp);
|
||||
}
|
||||
|
||||
#ifdef __osf__
|
||||
|
||||
@@ -149,7 +149,7 @@ public slots:
|
||||
void enableDesktopControl(bool c);
|
||||
|
||||
signals:
|
||||
void sessionEstablished();
|
||||
void sessionEstablished(QString host);
|
||||
void sessionFinished();
|
||||
void sessionRefused();
|
||||
void quitApp();
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "trayicon.h"
|
||||
#include <qtooltip.h>
|
||||
#include <kstdaction.h>
|
||||
#include <kapplication.h>
|
||||
#include <klocale.h>
|
||||
@@ -57,6 +58,7 @@ TrayIcon::TrayIcon(KDialog *d, Configuration *c) :
|
||||
trayIconOpen = loader->loadIcon("eyes-open24", KIcon::User);
|
||||
trayIconClosed = loader->loadIcon("eyes-closed24", KIcon::User);
|
||||
setPixmap(trayIconClosed);
|
||||
QToolTip::add(this, i18n("Desktop Sharing - connecting"));
|
||||
|
||||
manageInvitationsAction = new KAction(i18n("Manage &Invitations"), QString::null,
|
||||
0, this, SIGNAL(showManageInvitations()),
|
||||
@@ -91,19 +93,21 @@ void TrayIcon::prepareQuit() {
|
||||
|
||||
|
||||
|
||||
void TrayIcon::showConnectedMessage() {
|
||||
void TrayIcon::showConnectedMessage(QString host) {
|
||||
|
||||
setPixmap(trayIconOpen);
|
||||
KPassivePopup2::message(i18n("Desktop Sharing"),
|
||||
i18n("The remote user has been authenticated and is now connected."),
|
||||
trayIconOpen,
|
||||
this);
|
||||
QToolTip::add(this, i18n("Desktop Sharing - connected with %1").arg(host));
|
||||
}
|
||||
|
||||
void TrayIcon::showDisconnectedMessage() {
|
||||
if (quitting)
|
||||
return;
|
||||
|
||||
QToolTip::add(this, i18n("Desktop Sharing - disconnected"));
|
||||
setPixmap(trayIconClosed);
|
||||
KPassivePopup2 *p = KPassivePopup2::message(i18n("Desktop Sharing"),
|
||||
i18n("The remote user has closed the connection."),
|
||||
|
||||
@@ -64,7 +64,7 @@ signals:
|
||||
|
||||
public slots:
|
||||
void prepareQuit();
|
||||
void showConnectedMessage();
|
||||
void showConnectedMessage(QString host);
|
||||
void showDisconnectedMessage();
|
||||
void setDesktopControlSetting(bool);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user