Logo Search packages:      
Sourcecode: kcpuload version File versions  Download package

void StatPopup::initDock ( StatDock target,
KPopupMenu *  menu,
int  whichDock 
) [virtual]

Initialises the given system tray window and its context menu.

All global application properties (i.e., properties held by this pop-up) will be propagated to the system tray window, and all global application actions will be added to the given menu.

Parameter whichDock must be either 0 or 1 to specify whether the given system tray window will become window dock[0] or dock[1].

This routine must be called when a system tray window is first created, though in general this will be done automatically by the StatDock constructor.

Definition at line 94 of file statpopup.cpp.

References actActive, color, fillStyle, insertCustomItems(), isSplit(), StatDock::setActive(), StatDock::setColor(), setCustomProperties(), StatDock::setFill(), StatDock::setGrid(), StatDock::setLabelled(), StatDock::setSoft(), StatDock::setSplit(), and supportSplit.

Referenced by StatDock::StatDock().

                                                                          {
    // Initialise the menus.
    actActive->plug(menu);
    actClearHistory->plug(menu);
    menu->insertSeparator();
    actSpeed->plug(menu);
    if (supportSplit)
        actSplit->plug(menu);
    menu->insertSeparator();

    insertCustomItems(menu);

    KPopupMenu* fillMenu = new KPopupMenu(menu);
    actFillLines->plug(fillMenu);
    actFillBars->plug(fillMenu);
    actFillShaded->plug(fillMenu);
    menu->insertItem(SmallIcon("style"), i18n("St&yle"), fillMenu);

    actSoft->plug(menu);
    actLabelled->plug(menu);
    actGrid->plug(menu);
    actColor0->plug(menu);
    actColor1->plug(menu);
    menu->insertSeparator();
    menu->insertItem(SmallIcon("help"), i18n("&Help"),
        (new KHelpMenu(0, KGlobal::instance()->aboutData(), false))->menu());

    // Set up display properties for the dock.
    target->setActive(actActive->isChecked());
    target->setSplit(isSplit());
    target->setFill(fillStyle);
    target->setSoft(actSoft->isChecked());
    target->setLabelled(actLabelled->isChecked());
    target->setGrid(actGrid->isChecked());
    if (whichDock == 0) {
        target->setColor(color[0]);
        actColor0->setEnabled(true);
    } else if (whichDock == 1) {
        target->setColor(color[1]);
        actColor1->setEnabled(true);
    }
    setCustomProperties(target);
}


Generated by  Doxygen 1.6.0   Back to index