Warning, file /plasma/khotkeys/kcm_hotkeys/helper_widgets/gesture_widget.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* SPDX-FileCopyrightText: 2009 Michael Jansen <kde@michael-jansen.biz>
0002 
0003    SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005 
0006 #include "gesture_widget.h"
0007 #include "helper_widgets/edit_gesture_dialog.h"
0008 
0009 GestureWidget::GestureWidget(QWidget *parent)
0010     : QWidget(parent)
0011 {
0012     ui.setupUi(this);
0013 
0014     connect(ui.edit_button, SIGNAL(clicked(bool)), SLOT(edit()));
0015 }
0016 
0017 GestureWidget::~GestureWidget()
0018 {
0019 }
0020 
0021 void GestureWidget::edit()
0022 {
0023     EditGestureDialog dia(ui.gesture->pointData());
0024     switch (dia.exec()) {
0025     case QDialog::Accepted:
0026         setPointData(dia.pointData(), true);
0027         break;
0028 
0029     case QDialog::Rejected:
0030         break;
0031 
0032     default:
0033         Q_ASSERT(false);
0034     }
0035 }
0036 
0037 KHotKeys::StrokePoints GestureWidget::pointData() const
0038 {
0039     return ui.gesture->pointData();
0040 }
0041 
0042 void GestureWidget::setPointData(const KHotKeys::StrokePoints &data, bool emitSignal)
0043 {
0044     ui.gesture->setPointData(data);
0045     if (emitSignal)
0046         emit changed();
0047 }
0048 
0049 #include "moc_gesture_widget.cpp"