• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

krfb

trayicon.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                                 trayicon.cpp
00003                              -------------------
00004     begin                : Tue Dec 11 2001
00005     copyright            : (C) 2001-2002 by Tim Jansen
00006     email                : tim@tjansen.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #include "trayicon.h"
00019 
00020 #include <kstandardaction.h>
00021 #include <klocale.h>
00022 #include <kdialog.h>
00023 #include <kmenu.h>
00024 #include <kglobal.h>
00025 #include <kactioncollection.h>
00026 #include <kaboutapplicationdialog.h>
00027 
00028 #include "manageinvitationsdialog.h"
00029 #include "invitedialog.h"
00030 
00031 
00032 TrayIcon::TrayIcon(KDialog *d)
00033   : KSystemTrayIcon(d),
00034     quitting(false)
00035 {
00036     setIcon(KIcon("krfb").pixmap(22, 22, KIcon::Disabled));
00037 
00038     setToolTip(i18n("Desktop Sharing - disconnected"));
00039 
00040 //  manageInvitationsAction = new KAction(i18n("Manage &Invitations"), &actionCollection);
00041 //  actionCollection.addAction("manage_invitations", manageInvitationsAction);
00042 //  connect(manageInvitationsAction, SIGNAL(triggered(bool)), SLOT(showManageInvitations()));
00043 //  contextMenu()->addAction(actionCollection.action("manage_invitations"));
00044 
00045 //  contextMenu()->addSeparator();
00046 
00047     enableControlAction = new KToggleAction(i18n("Enable Remote Control"), actionCollection());
00048     enableControlAction->setCheckedState(KGuiItem(i18n("Disable Remote Control")));
00049     enableControlAction->setEnabled(false);
00050     actionCollection()->addAction("enable_control", enableControlAction);
00051     connect(enableControlAction, SIGNAL(toggled(bool)), SIGNAL(enableDesktopControl(bool)));
00052     contextMenu()->addAction(actionCollection()->action("enable_control"));
00053 
00054     contextMenu()->addSeparator();
00055     contextMenu()->addAction(KStandardAction::aboutApp(this, SLOT(showAbout()), actionCollection()));
00056 
00057     show();
00058 }
00059 
00060 TrayIcon::~TrayIcon()
00061 {
00062 }
00063 
00064 void TrayIcon::showAbout()
00065 {
00066     KAboutApplicationDialog(KGlobal::mainComponent().aboutData()).exec();
00067 }
00068 
00069 void TrayIcon::prepareQuit()
00070 {
00071     quitting = true;
00072 }
00073 
00074 void TrayIcon::showConnectedMessage(const QString &host)
00075 {
00076 
00077     setIcon(KIcon("krfb"));
00078     KPassivePopup::message(i18n("Desktop Sharing"),
00079                            i18n("The remote user has been authenticated and is now connected."),
00080                            KIcon("krfb").pixmap(22, 22),
00081                            this);
00082     setToolTip(i18n("Desktop Sharing - connected with %1", host));
00083 }
00084 
00085 void TrayIcon::showDisconnectedMessage()
00086 {
00087     if (quitting)
00088         return;
00089 
00090     setToolTip(i18n("Desktop Sharing - disconnected"));
00091     setIcon(KIcon("krfb").pixmap(22, 22, KIcon::Disabled));
00092     KPassivePopup *p = KPassivePopup::message(i18n("Desktop Sharing"),
00093                                               i18n("The remote user has closed the connection."),
00094                                               KIcon("krfb").pixmap(22, 22, KIcon::Disabled),
00095                                               this);
00096     connect(p, SIGNAL(hidden()), this, SIGNAL(diconnectedMessageDisplayed()));
00097 }
00098 
00099 void TrayIcon::setDesktopControlSetting(bool b)
00100 {
00101     enableControlAction->setEnabled(true);
00102     enableControlAction->setChecked(b);
00103 }
00104 
00105 void TrayIcon::showManageInvitations()
00106 {
00107     ManageInvitationsDialog invMngDlg(0);
00108     invMngDlg.exec();
00109 }
00110 
00111 #include "trayicon.moc"

krfb

Skip menu "krfb"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal