示例#1
0
文件: tray.cpp 项目: KDE/kget
/** class Tray
  * Reimplementation of the KStatusNotifierItem class
  */
Tray::Tray(MainWindow * parent)
    : KStatusNotifierItem(parent)
{
    // set up the context menu
    KMenu * cm = contextMenu();
    cm->addAction( parent->actionCollection()->action("new_download") );
    cm->addAction( parent->actionCollection()->action("import_links") );
    cm->addSeparator();
    cm->addAction( parent->actionCollection()->action("start_all_download") );
    cm->addAction( parent->actionCollection()->action("stop_all_download") );
    cm->addSeparator();
    cm->addAction( parent->actionCollection()->action("konqueror_integration") );
    cm->addAction( parent->actionCollection()->action("options_configure") );

    // Set up basic tray parameters
    setCategory(ApplicationStatus);
    setIconByName("kget");
    setTitle(i18n("KGet"));
    setContextMenu(cm);
    setAssociatedWidget(parent);
    setToolTipIconByName("kget");
    setToolTipTitle(i18n("Download Manager"));
    // Not of much use atm, but maybe we want to set this later?
    // setToolTipSubTitle("[..]");

    // filter middle mouse clicks to ask scheduler to paste URL
    connect( this, SIGNAL(secondaryActivateRequested(QPoint)),
             this, SLOT(slotActivated()) );
}
示例#2
0
void ImageDisplay::onInitialize()
{
  ImageDisplayBase::onInitialize();
  {
    static uint32_t count = 0;
    std::stringstream ss;
    ss << "ImageDisplay" << count++;
    img_scene_manager_ = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC, ss.str());
  }

  img_scene_node_ = img_scene_manager_->getRootSceneNode()->createChildSceneNode();

  {
    static int count = 0;
    std::stringstream ss;
    ss << "ImageDisplayObject" << count++;

    screen_rect_ = new Ogre::Rectangle2D(true);
    screen_rect_->setRenderQueueGroup(Ogre::RENDER_QUEUE_OVERLAY - 1);
    screen_rect_->setCorners(-1.0f, 1.0f, 1.0f, -1.0f);

    ss << "Material";
    material_ = Ogre::MaterialManager::getSingleton().create( ss.str(), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME );
    material_->setSceneBlending( Ogre::SBT_REPLACE );
    material_->setDepthWriteEnabled(false);
    material_->setReceiveShadows(false);
    material_->setDepthCheckEnabled(false);

    material_->getTechnique(0)->setLightingEnabled(false);
    Ogre::TextureUnitState* tu = material_->getTechnique(0)->getPass(0)->createTextureUnitState();
    tu->setTextureName(texture_.getTexture()->getName());
    tu->setTextureFiltering( Ogre::TFO_NONE );

    material_->setCullingMode(Ogre::CULL_NONE);
    Ogre::AxisAlignedBox aabInf;
    aabInf.setInfinite();
    screen_rect_->setBoundingBox(aabInf);
    screen_rect_->setMaterial(material_->getName());
    img_scene_node_->attachObject(screen_rect_);
  }

  render_panel_ = new RenderPanel();
  render_panel_->getRenderWindow()->setAutoUpdated(false);
  render_panel_->getRenderWindow()->setActive( false );

  render_panel_->resize( 640, 480 );
  render_panel_->initialize(img_scene_manager_, context_);

  setAssociatedWidget( render_panel_ );

  render_panel_->setAutoRender(false);
  render_panel_->setOverlaysEnabled(false);
  render_panel_->getCamera()->setNearClipDistance( 0.01f );

  updateNormalizeOptions();
}
示例#3
0
SysTrayIcon::SysTrayIcon( Choqok::UI::MainWindow* parent )
: KStatusNotifierItem( parent ), _mainwin(parent), isOffline(false)
{
    kDebug();
    unread = 0;
    setAssociatedWidget(parent);
    setCategory(ApplicationStatus);
    setStandardActionsEnabled(false);
    setStatus(Active);
    setIconByName( currentIconName() );
}
示例#4
0
KrcdNotifierItem::KrcdNotifierItem(){
    setCategory(KStatusNotifierItem::Hardware);
    updateTray();
    setContextMenu(&m_menu);

    // No need for close button...
    setStandardActionsEnabled(false);
    setAssociatedWidget(&m_menu);
    updateContextMenu();
    QDBusConnection::sessionBus().connect(QLatin1String( "org.kde.kded" ), QLatin1String( "/modules/kremotecontroldaemon" ), QLatin1String( "org.kde.krcd" ), QLatin1String( "connectionChanged" ),  this, SLOT(updateTray()));
    QDBusConnection::sessionBus().connect(QLatin1String( "org.kde.kded" ), QLatin1String( "/modules/kremotecontroldaemon" ), QLatin1String( "org.kde.krcd" ), QLatin1String( "remoteControlAdded" ),  this, SLOT(updateTray()));
    QDBusConnection::sessionBus().connect(QLatin1String( "org.kde.kded" ), QLatin1String( "/modules/kremotecontroldaemon" ), QLatin1String( "org.kde.krcd" ), QLatin1String( "remoteControlAdded" ),  this, SLOT(updateContextMenu()));
    QDBusConnection::sessionBus().connect(QLatin1String( "org.kde.kded" ), QLatin1String( "/modules/kremotecontroldaemon" ), QLatin1String( "org.kde.krcd" ), QLatin1String( "remoteControlRemoved" ),  this, SLOT(updateTray()));
    QDBusConnection::sessionBus().connect(QLatin1String( "org.kde.kded" ), QLatin1String( "/modules/kremotecontroldaemon" ), QLatin1String( "org.kde.krcd" ), QLatin1String( "remoteControlRemoved" ),  this, SLOT(updateContextMenu()));
    QDBusConnection::sessionBus().connect(QLatin1String( "org.kde.kded" ), QLatin1String( "/modules/kremotecontroldaemon" ), QLatin1String( "org.kde.krcd" ), QLatin1String( "buttonPressed" ),  this, SLOT(flash()));
    QDBusConnection::sessionBus().connect(QLatin1String( "org.kde.kded" ), QLatin1String( "/modules/kremotecontroldaemon" ), QLatin1String( "org.kde.krcd" ), QLatin1String( "modeChanged" ),  this, SLOT(updateContextMenu()));
}