File indexing completed on 2024-10-06 13:19:04

0001 /*
0002    SPDX-FileCopyrightText: 2008 Michael Jansen <kde@michael-jansen.biz>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "hotkeys_widget_base.h"
0008 
0009 #include "action_data/action_data_group.h"
0010 
0011 #include <QDebug>
0012 
0013 HotkeysWidgetBase::HotkeysWidgetBase(QWidget *parent)
0014     : HotkeysWidgetIFace(parent)
0015 {
0016     ui.setupUi(this);
0017 
0018     connect(ui.comment, SIGNAL(textChanged()), _changedSignals, SLOT(map()));
0019     _changedSignals->setMapping(ui.comment, "comment");
0020 }
0021 
0022 HotkeysWidgetBase::~HotkeysWidgetBase()
0023 {
0024 }
0025 
0026 void HotkeysWidgetBase::apply()
0027 {
0028     HotkeysWidgetIFace::apply();
0029     emit changed(_data);
0030 }
0031 
0032 void HotkeysWidgetBase::extend(QWidget *w, const QString &label)
0033 {
0034     ui.tabs->addTab(w, label);
0035 }
0036 
0037 bool HotkeysWidgetBase::isChanged() const
0038 {
0039     return _data->comment() != ui.comment->toPlainText();
0040 }
0041 
0042 void HotkeysWidgetBase::doCopyFromObject()
0043 {
0044     ui.comment->setText(_data->comment());
0045 }
0046 
0047 void HotkeysWidgetBase::doCopyToObject()
0048 {
0049     _data->set_comment(ui.comment->toPlainText());
0050 }
0051 
0052 #include "moc_hotkeys_widget_base.cpp"