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

void TabletWidget::addProfile (  )  [slot]

Slot that opens up a dialogue to create a new profile for the connected tablet. Starting parameter of the profile will be the default params as detected by xsetwacom.

Definition at line 157 of file tabletwidget.cpp.

References Wacom::ProfileManagement::availableProfiles(), Wacom::ProfileManagement::createNewProfile(), m_profileManagement, m_ui, and switchProfile().

Referenced by init().

{
    bool ok;
    QString text = KInputDialog::getText(i18n("Add new profile"),
                                         i18n("Profile name:"), QString(), &ok, this);
    if (ok && !text.isEmpty()) {
        m_profileManagement->createNewProfile(text);
    } else {
        return;
    }

    // refill combobox with all available profiles
    KConfigGroup deviceGroup = m_profileManagement->availableProfiles();
    m_ui->profileSelector->blockSignals(true);
    m_ui->profileSelector->clear();
    m_ui->profileSelector->addItems(deviceGroup.groupList());
    int index = m_ui->profileSelector->findText(text);
    m_ui->profileSelector->setCurrentIndex(index);
    m_ui->profileSelector->blockSignals(false);

    switchProfile(text);
}


Generated by  Doxygen 1.6.0   Back to index