コード例 #1
0
ファイル: common-uimstateindicator.cpp プロジェクト: m8a/uim
UimStateIndicator::UimStateIndicator( QWidget *parent )
        : QFrame( parent )
{
    m_layout = new QHBoxLayout;
    m_layout->setMargin( 0 );
    m_layout->setSpacing( 0 );

    if ( !fallbackButton )
    {
        fallbackButton = new QHelperToolbarButton( this );
        m_layout->addWidget( fallbackButton );
        QPixmap icon = QPixmap( ICONDIR + '/' + "uim-icon.png" );
        if ( !icon.isNull() ) {
            QPixmap scaledIcon = icon.scaled( ICON_SIZE, ICON_SIZE,
                    Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
            fallbackButton->setIcon( QIcon( scaledIcon ) );
        } else {
            fallbackButton->setText( "?" );
        }
        fallbackButton->show();
    }

    clearButtons();

    uim_fd = -1;
    checkHelperConnection();
    uim_helper_client_get_prop_list();
    popupMenuShowing = false;

    setLayout( m_layout );
}
コード例 #2
0
ファイル: qt4.cpp プロジェクト: DirtYiCE/uim
UimImSwitcher::UimImSwitcher( QWidget *parent )
        : QDialog( parent )
{
    /* connect to uim helper message bus */
    uim_fd = -1;
    checkHelperConnection();

    /* to check if another uim-im-switcher exists */
    uim_helper_send_message( uim_fd, "im_switcher_start\n" );

    /* to load input method list */
    uim_helper_send_message( uim_fd, "im_list_get\n" );

    uim_init();
    customEnabled = uim_custom_enable();

    /* create GUI */
    createGUI();
}