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

void TabletApplet::updateProfile (  )  [slot]

Updates the list off all available profiles.

Called when the tablet device changes or when a profile is created/deleted via the kcmodule.

Definition at line 102 of file tabletapplet.cpp.

References m_comboBoxProfile, m_deviceInterface, m_deviceName, m_radioButtonAbsolute, m_radioButtonRelative, m_stylusName, and m_tabletInterface.

Referenced by Wacom::TabletSettings::configAccepted(), setProfile(), and updateWidget().

{
    //get list of all profiles
    KSharedConfig::Ptr profilesConfig = KSharedConfig::openConfig("tabletprofilesrc", KConfig::SimpleConfig);
    KConfigGroup deviceGroup = KConfigGroup(profilesConfig, m_deviceName->text());

    //fill comboBox
    m_comboBoxProfile->blockSignals(true);
    KComboBox* nativeBox = m_comboBoxProfile->nativeWidget();
    nativeBox->clear();
    nativeBox->addItems(deviceGroup.groupList());

    //set current profile
    QDBusReply<QString> profileName  = m_tabletInterface->call("profile");

    int index = nativeBox->findText(profileName);
    nativeBox->setCurrentIndex(index);
    m_comboBoxProfile->blockSignals(false);

    QDBusReply<QString> stylusMode  = m_deviceInterface->call("getConfiguration", m_stylusName, "Mode");
    if (stylusMode.isValid()) {
        if (QString(stylusMode).contains("1")) {        // "1" as return value is equal to absolute mode in the xsetwacom get function
            m_radioButtonRelative->setChecked(false);
            m_radioButtonAbsolute->setChecked(true);
        } else {
            m_radioButtonRelative->setChecked(true);
            m_radioButtonAbsolute->setChecked(false);
        }
    }
}


Generated by  Doxygen 1.6.0   Back to index