mirror of
https://github.com/KDE/krfb
synced 2026-07-01 15:51:18 -07:00
Port to knotificationitem
svn path=/trunk/KDE/kdenetwork/krfb/; revision=989474
This commit is contained in:
@@ -5,6 +5,7 @@ macro_bool_to_01(X11_Xdamage_FOUND HAVE_XDAMAGE)
|
||||
macro_bool_to_01(X11_XShm_FOUND HAVE_XSHM)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-krfb.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-krfb.h )
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}) # for config-krfb.h
|
||||
include_directories(${LIBKNOTIFICATIONITEM-1_INCLUDE_DIR})
|
||||
|
||||
if(Q_WS_X11)
|
||||
if(NOT X11_XTest_FOUND)
|
||||
@@ -45,7 +46,7 @@ kde4_add_ui_files(krfb_SRCS connectionwidget.ui
|
||||
|
||||
kde4_add_executable(krfb ${krfb_SRCS})
|
||||
|
||||
target_link_libraries(krfb ${JPEG_LIBRARIES} ${LIBVNCSERVER_LIBRARIES} ${X11_Xdamage_LIB} ${KDE4_KDNSSD_LIBS})
|
||||
target_link_libraries(krfb ${LIBKNOTIFICATIONITEM-1_LIBRARIES} ${JPEG_LIBRARIES} ${LIBVNCSERVER_LIBRARIES} ${X11_Xdamage_LIB} ${KDE4_KDNSSD_LIBS})
|
||||
if(X11_XTest_FOUND)
|
||||
target_link_libraries(krfb ${X11_XTest_LIB})
|
||||
endif(X11_XTest_FOUND)
|
||||
|
||||
21
trayicon.cpp
21
trayicon.cpp
@@ -30,13 +30,13 @@
|
||||
|
||||
|
||||
TrayIcon::TrayIcon(KDialog *d)
|
||||
: KSystemTrayIcon(d),
|
||||
: Experimental::KNotificationItem(d),
|
||||
quitting(false)
|
||||
{
|
||||
setIcon(KIcon("krfb").pixmap(22, 22, KIcon::Disabled));
|
||||
|
||||
setToolTip(i18n("Desktop Sharing - disconnected"));
|
||||
setIconByPixmap(KIcon("krfb").pixmap(22, 22, KIcon::Disabled));
|
||||
|
||||
setToolTipTitle(i18n("Desktop Sharing - disconnected"));
|
||||
setCategory(Experimental::KNotificationItem::ApplicationStatus);
|
||||
// manageInvitationsAction = new KAction(i18n("Manage &Invitations"), &actionCollection);
|
||||
// actionCollection.addAction("manage_invitations", manageInvitationsAction);
|
||||
// connect(manageInvitationsAction, SIGNAL(triggered(bool)), SLOT(showManageInvitations()));
|
||||
@@ -54,7 +54,6 @@ TrayIcon::TrayIcon(KDialog *d)
|
||||
contextMenu()->addSeparator();
|
||||
contextMenu()->addAction(KStandardAction::aboutApp(this, SLOT(showAbout()), actionCollection()));
|
||||
|
||||
show();
|
||||
}
|
||||
|
||||
TrayIcon::~TrayIcon()
|
||||
@@ -74,12 +73,12 @@ void TrayIcon::prepareQuit()
|
||||
void TrayIcon::showConnectedMessage(const QString &host)
|
||||
{
|
||||
|
||||
setIcon(KIcon("krfb"));
|
||||
setIconByPixmap(KIcon("krfb"));
|
||||
KPassivePopup::message(i18n("Desktop Sharing"),
|
||||
i18n("The remote user has been authenticated and is now connected."),
|
||||
KIcon("krfb").pixmap(22, 22),
|
||||
this);
|
||||
setToolTip(i18n("Desktop Sharing - connected with %1", host));
|
||||
(QWidget*)0);
|
||||
setToolTipTitle(i18n("Desktop Sharing - connected with %1", host));
|
||||
}
|
||||
|
||||
void TrayIcon::showDisconnectedMessage()
|
||||
@@ -87,12 +86,12 @@ void TrayIcon::showDisconnectedMessage()
|
||||
if (quitting)
|
||||
return;
|
||||
|
||||
setToolTip(i18n("Desktop Sharing - disconnected"));
|
||||
setIcon(KIcon("krfb").pixmap(22, 22, KIcon::Disabled));
|
||||
setToolTipTitle(i18n("Desktop Sharing - disconnected"));
|
||||
setIconByPixmap(KIcon("krfb").pixmap(22, 22, KIcon::Disabled));
|
||||
KPassivePopup *p = KPassivePopup::message(i18n("Desktop Sharing"),
|
||||
i18n("The remote user has closed the connection."),
|
||||
KIcon("krfb").pixmap(22, 22, KIcon::Disabled),
|
||||
this);
|
||||
(QWidget*)0);
|
||||
connect(p, SIGNAL(hidden()), this, SIGNAL(diconnectedMessageDisplayed()));
|
||||
}
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
#ifndef TRAYICON_H
|
||||
#define TRAYICON_H
|
||||
|
||||
#include <ksystemtrayicon.h>
|
||||
#include <kpassivepopup.h>
|
||||
#include <KActionCollection>
|
||||
#include <KToggleAction>
|
||||
#include <knotificationitem.h>
|
||||
|
||||
class KDialog;
|
||||
|
||||
@@ -30,7 +30,7 @@ class KDialog;
|
||||
* @author Tim Jansen
|
||||
*/
|
||||
|
||||
class TrayIcon : public KSystemTrayIcon {
|
||||
class TrayIcon : public Experimental::KNotificationItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
TrayIcon(KDialog*);
|
||||
|
||||
Reference in New Issue
Block a user