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

void TabletWidget::init (  ) 

Initialize the widget creates all necessary setting widgets and connects their signals

Definition at line 59 of file tabletwidget.cpp.

References addProfile(), changed(), delProfile(), Wacom::PenWidget::isStylus(), loadTabletInformation(), m_deviceInterface, m_eraserPage, m_generalPage, m_padButtonPage, m_padMappingPage, m_profileManagement, m_profilesConfig, m_screenPage, m_stylusPage, m_tabletInterface, m_ui, profileChanged(), and switchProfile().

Referenced by TabletWidget().

{
    m_tabletInterface = new QDBusInterface("de.etricceline.Tablet", "/Tablet", "de.etricceline.Tablet");
    m_deviceInterface = new QDBusInterface("de.etricceline.Tablet", "/Device", "de.etricceline.Device");

    if (!m_tabletInterface->isValid() || !m_deviceInterface->isValid()) {
        kDebug() << "DBus interface not available";
    }

    m_profileManagement = new ProfileManagement(m_deviceInterface);

    m_generalPage = new GeneralWidget(m_deviceInterface);
    m_padButtonPage = new PadButtonWidget(m_profileManagement);
    m_padMappingPage = new PadMapping(m_profileManagement);
    m_screenPage = new ScreenWidget(m_profileManagement);
    m_stylusPage = new PenWidget(m_profileManagement);
    m_eraserPage = new PenWidget(m_profileManagement);
    m_eraserPage->isStylus(false);
    m_ui->setupUi(this);
    m_ui->addProfileButton->setIcon(KIcon("document-new"));
    m_ui->delProfileButton->setIcon(KIcon("edit-delete-page"));

    connect(m_ui->addProfileButton, SIGNAL(clicked(bool)), SLOT(addProfile()));
    connect(m_ui->delProfileButton, SIGNAL(clicked(bool)), SLOT(delProfile()));
    connect(m_ui->profileSelector, SIGNAL(currentIndexChanged(const QString)), SLOT(switchProfile(const QString)));
    connect(m_padButtonPage, SIGNAL(changed()), SLOT(profileChanged()));
    connect(m_padMappingPage, SIGNAL(changed()), SLOT(profileChanged()));
    connect(m_screenPage, SIGNAL(changed()), SLOT(profileChanged()));
    connect(m_stylusPage, SIGNAL(changed()), SLOT(profileChanged()));
    connect(m_eraserPage, SIGNAL(changed()), SLOT(profileChanged()));
    //DBus signals
    connect(m_tabletInterface, SIGNAL(tabletAdded()), SLOT(loadTabletInformation()));
    connect(m_tabletInterface, SIGNAL(tabletRemoved()), SLOT(loadTabletInformation()));

    m_profilesConfig = KSharedConfig::openConfig("tabletprofilesrc", KConfig::SimpleConfig);
}


Generated by  Doxygen 1.6.0   Back to index