Logo Search packages:      
Sourcecode: kcm-tablet version File versions  Download package

void TabletApplet::buildConfigDialog (  )  [private]

This part of the dialogue creates the actual applet.

The profile selection box as well as a small groupbox with the pad rotation push buttons and pen mode radio button.

Definition at line 233 of file tabletapplet.cpp.

References m_comboBoxProfile, m_configWidget, m_radioButtonAbsolute, m_radioButtonRelative, rotateCcw(), rotateCw(), rotateHalf(), rotateNorm(), selectAbsoluteMode(), selectRelativeMode(), and switchProfile().

Referenced by buildDialog().

{
    //container for the settings when a tablet is available
    m_configWidget = new QGraphicsWidget();
    m_configWidget->setFocusPolicy(Qt::ClickFocus);
    m_configWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);

    QGraphicsLinearLayout *layout_tabletWidget = new QGraphicsLinearLayout(Qt::Vertical, m_configWidget);
    layout_tabletWidget->setSpacing(0);

    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    // create profile box
    QGraphicsLinearLayout *layout_profile = new QGraphicsLinearLayout;
    layout_profile->setSpacing(0);
    layout_profile->setOrientation(Qt::Horizontal);

    Plasma::Label *label_profile = new Plasma::Label(m_configWidget);
    label_profile->setMaximumHeight(KIconLoader::SizeMedium);
    label_profile->nativeWidget()->setWordWrap(false);
    label_profile->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
    label_profile->setText(i18n("Select Profile:"));

    m_comboBoxProfile = new Plasma::ComboBox(m_configWidget);
    connect(m_comboBoxProfile, SIGNAL(textChanged(const QString)), this, SLOT(switchProfile(const QString)));

    QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
    sizePolicy.setHorizontalStretch(0);
    sizePolicy.setVerticalStretch(0);
    sizePolicy.setHeightForWidth(m_comboBoxProfile->sizePolicy().hasHeightForWidth());
    m_comboBoxProfile->setSizePolicy(sizePolicy);

    layout_profile->addItem(label_profile);
    layout_profile->addItem(m_comboBoxProfile);
    layout_tabletWidget->addItem(layout_profile);

    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    // create settings groupbox
    Plasma::GroupBox *groupBox = new Plasma::GroupBox(m_configWidget);
    groupBox->setText(i18nc("Groupbox Settings for the applet to change some values on the fly", "Settings"));
    groupBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);

    QGraphicsLinearLayout *layout_groupbox = new QGraphicsLinearLayout(Qt::Vertical, groupBox);
    layout_groupbox->setSpacing(5);

    // create rotation buttons
    QGraphicsLinearLayout *layout_rotation = new QGraphicsLinearLayout;
    layout_rotation->setSpacing(0);
    layout_rotation->setOrientation(Qt::Horizontal);

    Plasma::Label *label_Rotation = new Plasma::Label(groupBox);
    label_Rotation->nativeWidget()->setWordWrap(false);
    label_Rotation->setText(i18nc("Rotation of the tablet pad", "Rotation:"));
    layout_rotation->addItem(label_Rotation);

    Plasma::IconWidget *pushButton_norm = new Plasma::IconWidget(groupBox);
    pushButton_norm->setIcon(KIcon("input-tablet"));
    pushButton_norm->setMaximumHeight(KIconLoader::SizeSmallMedium);
    pushButton_norm->setMinimumHeight(KIconLoader::SizeSmallMedium);
    pushButton_norm->setDrawBackground(false);
    connect(pushButton_norm, SIGNAL(clicked()), this, SLOT(rotateNorm()));
    layout_rotation->addItem(pushButton_norm);

    Plasma::IconWidget *pushButton_cw = new Plasma::IconWidget(groupBox);
    pushButton_cw->setIcon(KIcon("object-rotate-left"));
    pushButton_cw->setMaximumHeight(KIconLoader::SizeSmallMedium);
    pushButton_cw->setMinimumHeight(KIconLoader::SizeSmallMedium);
    pushButton_cw->setDrawBackground(false);
    connect(pushButton_cw, SIGNAL(clicked()), this, SLOT(rotateCw()));
    layout_rotation->addItem(pushButton_cw);

    Plasma::IconWidget *pushButton_ccw = new Plasma::IconWidget(groupBox);
    pushButton_ccw->setIcon(KIcon("object-rotate-right"));
    pushButton_ccw->setMaximumHeight(KIconLoader::SizeSmallMedium);
    pushButton_ccw->setMinimumHeight(KIconLoader::SizeSmallMedium);
    pushButton_ccw->setDrawBackground(false);
    connect(pushButton_ccw, SIGNAL(clicked()), this, SLOT(rotateCcw()));
    layout_rotation->addItem(pushButton_ccw);

    Plasma::IconWidget *pushButton_half = new Plasma::IconWidget(groupBox);
    pushButton_half->setIcon(KIcon("object-flip-vertical"));
    pushButton_half->setMaximumHeight(KIconLoader::SizeSmallMedium);
    pushButton_half->setMinimumHeight(KIconLoader::SizeSmallMedium);
    pushButton_half->setDrawBackground(false);
    connect(pushButton_half, SIGNAL(clicked()), this, SLOT(rotateHalf()));
    layout_rotation->addItem(pushButton_half);

    layout_groupbox->addStretch(20); //otherwise the title of the groupbox is not visible
    layout_groupbox->addItem(layout_rotation);

    // create mode selection
    QGraphicsLinearLayout *layout_mode = new QGraphicsLinearLayout;
    layout_mode->setSpacing(0);
    layout_mode->setOrientation(Qt::Horizontal);

    Plasma::Label *label_mode = new Plasma::Label(groupBox);
    label_mode->nativeWidget()->setWordWrap(false);
    label_mode->setText(i18nc("Toggle between absolute/relative penmode", "Mode:"));
    layout_mode->addItem(label_mode);
    layout_mode->addStretch();

    m_radioButtonAbsolute = new Plasma::RadioButton(groupBox);
    m_radioButtonAbsolute->setText(i18nc("absolute pen movement (pen mode)", "Absolute"));
    m_radioButtonAbsolute->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
    m_radioButtonAbsolute->nativeWidget()->setAutoExclusive(false);
    m_radioButtonAbsolute->setZValue(10);
    connect(m_radioButtonAbsolute->nativeWidget(), SIGNAL(clicked(bool)), this, SLOT(selectAbsoluteMode(bool)));
    layout_mode->addItem(m_radioButtonAbsolute);

    m_radioButtonRelative = new Plasma::RadioButton(groupBox);
    m_radioButtonRelative->setText(i18nc("relative pen movement (mouse mode)", "Relative"));
    m_radioButtonRelative->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
    m_radioButtonRelative->nativeWidget()->setAutoExclusive(false);
    m_radioButtonRelative->setZValue(10);
    connect(m_radioButtonRelative->nativeWidget(), SIGNAL(clicked(bool)), this, SLOT(selectRelativeMode(bool)));
    layout_mode->addItem(m_radioButtonRelative);

    layout_groupbox->addItem(layout_mode);
    layout_groupbox->addStretch(20);

    layout_tabletWidget->addItem(groupBox);
}


Generated by  Doxygen 1.6.0   Back to index