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

void TabletWidget::switchProfile ( const QString &  profile  )  [slot]

Switch from one profile to another and updates all other widgets. This slot will be called from the profile selector combobox.

Parameters:
profile The profile name the widget should switch to as written in the KConfig file

Definition at line 207 of file tabletwidget.cpp.

References applyProfile(), changed(), Wacom::PenWidget::loadFromProfile(), Wacom::ScreenWidget::loadFromProfile(), Wacom::PadMapping::loadFromProfile(), Wacom::PadButtonWidget::loadFromProfile(), m_eraserPage, m_padButtonPage, m_padMappingPage, m_profileChanged, m_profileManagement, m_screenPage, m_stylusPage, saveProfile(), and Wacom::ProfileManagement::setProfileName().

Referenced by addProfile(), delProfile(), and init().

{
    if (m_profileChanged) {
        QPointer<KDialog> saveDialog = new KDialog();
        Ui::SaveProfile askToSave;
        QWidget *widget = new QWidget(this);
        askToSave.setupUi(widget);
        saveDialog->setMainWidget(widget);
        saveDialog->setButtons(KDialog::Apply | KDialog::Cancel);
        connect(saveDialog, SIGNAL(applyClicked()), saveDialog, SLOT(accept()));
        int ret;
        ret = saveDialog->exec();

        if (ret == KDialog::Accepted) {
            saveProfile();
        }
    }

    m_profileManagement->setProfileName(profile);

    m_padButtonPage->loadFromProfile();
    m_padMappingPage->loadFromProfile();
    m_screenPage->loadFromProfile();
    m_stylusPage->loadFromProfile();
    m_eraserPage->loadFromProfile();

    m_profileChanged = false;
    emit changed(false);

    applyProfile();
}


Generated by  Doxygen 1.6.0   Back to index