DockWidget Class Reference
The dock widget for the system tray. More...
#include <dockwidget.h>
Inherits KSystemTray.
Inheritance diagram for DockWidget:
Public Slots | |
void | dock (SetiLoc *loc=0) |
void | undock () |
void | updateDockWidget (SetiLoc *loc) |
Public Methods | |
DockWidget (QWidget *parent=0, const char *name=0) | |
~DockWidget () | |
const bool | isDocked () |
Protected Methods | |
void | paintEvent (QPaintEvent *e) |
void | timerEvent (QTimerEvent *e) |
Private Types | |
enum | popupIDs |
Private Slots | |
void | handlePopupCommand (int id) |
void | preparePopupMenu () |
void | paintIcon (int st, int ls) |
void | slotBlinkIcon () |
void | updateProgress () |
void | updateState (int st, int ls) |
Detailed Description
The dock widget for the system tray.If `Minimize to Panel' is enabled, this widget will be shown in the system tray area of the Kicker panel. It either displays the standard Ksetiwatch icon, or, if a location is selected in the Analysis tab, an icon showing the progress and state of said location. In the latter case, the client can be started or stopped via the right-click context menu.
Definition at line 32 of file dockwidget.h.
Member Enumeration Documentation
|
Identifiers for the menu items in the right-click popup menu.
Definition at line 139 of file dockwidget.h. |
Constructor & Destructor Documentation
|
The constructor.
Definition at line 28 of file dockwidget.cpp. References QToolTip::add(), KPopupMenu::changeTitle(), QObject::connect(), KSystemTray::contextMenu(), handlePopupCommand(), preparePopupMenu(), and QObject::startTimer(). |
|
The destructor.
Definition at line 53 of file dockwidget.cpp. |
Member Function Documentation
|
Returns the status of the dock widget. TRUE if it is docked (and visible), otherwise FALSE. Definition at line 47 of file dockwidget.h. |
|
Shows the dock widget.
Definition at line 64 of file dockwidget.cpp. References QWidget::show(). Referenced by Ksetiwatch::event(), Ksetiwatch::Ksetiwatch(), and Ksetiwatch::toggleIcon(). |
|
Hides the dock widget.
Definition at line 76 of file dockwidget.cpp. References QWidget::hide(). Referenced by Ksetiwatch::toggleIcon(). |
|
Connects the dock widget to another location.
Definition at line 308 of file dockwidget.cpp. References QObject::connect(), QObject::disconnect(), updateProgress(), and updateState(). |
|
Reimplemented for customized painting of the dock widget.
Reimplemented from QFrame. Definition at line 86 of file dockwidget.cpp. References paintIcon(). |
|
Reimplemented to catch internal timer events. The internal timer generates an event every second in order to have a blinking icon in case the state of the location is Stopped, Loading, or Finished.
Reimplemented from QObject. Definition at line 58 of file dockwidget.cpp. References slotBlinkIcon(). |
|
Executes the selected command from the right-click popup menu of the dock widget.
Definition at line 265 of file dockwidget.cpp. References SetiLoc::startClient(), and SetiLoc::stopClient(). Referenced by DockWidget(). |
|
Prepares the right-click popup menu just before showing it. Checks if the popup menu commands are allowed or make sense in the current situation, and enables or disables the menu items appropriately. Definition at line 279 of file dockwidget.cpp. References SetiContainer::clientState(), KSystemTray::contextMenu(), and SetiContainer::isClientRunning(). Referenced by DockWidget(). |
|
Paints the dock widget. If the dock widget is connected to a S@h location, progress and state of said location is shown, otherwise the default Ksetiwatch icon is displayed. Definition at line 156 of file dockwidget.cpp. References QPaintDevice::bitBlt(), SetiContainer::clientState(), QPainter::drawText(), QWidget::erase(), QPainter::fillRect(), QSize::height(), QWidget::icon(), QPainter::lineTo(), QPainter::moveTo(), SetiContainer::progress(), QPainter::setFont(), QPainter::setPen(), QPixmap::size(), QString::sprintf(), QSize::width(), QWidget::x(), and QWidget::y(). Referenced by paintEvent(), slotBlinkIcon(), and updateState(). |
|
Performs blinking of the state icon. This slot is called whenever an internal timer event occurs. It causes the state icon in the dock widget to periodically toggle between two pixmaps so as to provide a visual feedback. Blinking occurs only if the state of the location is Stopped, Loading, or Finished. Definition at line 334 of file dockwidget.cpp. References SetiContainer::clientState(), and paintIcon(). Referenced by timerEvent(). |
|
Updates the progress information in the dock widget. The progress is shown as a mini progress bar. Definition at line 92 of file dockwidget.cpp. References SetiContainer::clientState(), and updateState(). Referenced by updateDockWidget(). |
|
Updates the state information in the dock widget. A running client is represented by a small green telescope dish, all other states are displayed as blinking icons.
Definition at line 102 of file dockwidget.cpp. References QToolTip::add(), QString::arg(), SetiContainer::clientState(), SetiLoc::description(), QString::isEmpty(), paintIcon(), SetiContainer::progress(), SetiContainer::remainingTimeAsString(), and QToolTip::remove(). Referenced by updateDockWidget(), and updateProgress(). |
The documentation for this class was generated from the following files: