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

QWidget * DBusService::widget ( QWidget *  parent  )  const [virtual]

See also:
DBusItem::widget

Implements DBusItem.

Definition at line 118 of file dbusservice.cpp.

References DBusItem::addErrorInfo().

                                                      {
    QScrollView * scrollview = new QScrollView( parent );
    QVBox * vbox = new QVBox( scrollview->viewport() );
    scrollview->addChild( vbox );
    scrollview->setMidLineWidth( 0 );
    scrollview->setLineWidth( 0 );
    scrollview->setResizePolicy( QScrollView::AutoOneFit );

    new QLabel( i18n( "Service: %1" ).arg( m_service ), vbox );

    if ( d->pid != -1 ) {
    
        // Try to verify...
        QFileInfo fileinfo( QString("/proc/%1").arg( d->pid ) );
        if ( !fileinfo.exists() )
            new QLabel(
              i18n(
                "Process owning this service: %1"
              ).arg(
                i18n(
                  "unknown (D-BUS reports %1, but process "
                  "with that PID does not seem to exist!)"
                ).arg( d->pid )
              ),
              vbox
            );

        else if ( !d->processName.isNull() )
            new QLabel(
              i18n(
                "Process owning this service: %1"
              ).arg(
                QString(
                  "%1 ( %2 )"
                ).arg( d->pid ).arg( d->processName )
              ),
              vbox
            );
        
        else
            new QLabel(
              i18n(
                "Process owning this service: %1"
              ).arg( d->pid ),
              vbox
            );

    }
    else
        new QLabel(
          i18n( "Process owning this service: %1" )
          .arg( i18n( "unknown" ) ),
          vbox
        );


    if ( !d->alias.isNull() )
        new QLabel(
          i18n(
            "This service is also known as service %1."
          ).arg( d->alias ),
          vbox
        );

    addErrorInfo( vbox );

    return scrollview;
}


Generated by  Doxygen 1.6.0   Back to index