File indexing completed on 2024-09-15 10:32:54
0001 /** 0002 * SPDX-FileCopyrightText: 2009 Michael Jansen <kde@michael-jansen.biz> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "hotkeys_export_widget.h" 0008 0009 #include <QDialogButtonBox> 0010 0011 KHotkeysExportWidget::KHotkeysExportWidget(QWidget *parent) 0012 : QWidget(parent) 0013 { 0014 ui.setupUi(this); 0015 } 0016 0017 KHotkeysExportWidget::~KHotkeysExportWidget() 0018 { 0019 } 0020 0021 KHotkeysExportDialog::KHotkeysExportDialog(QWidget *parent) 0022 : QDialog(parent) 0023 { 0024 setWindowTitle(i18n("Export Group")); 0025 setLayout(new QVBoxLayout); 0026 0027 w = new KHotkeysExportWidget(this); 0028 layout()->addWidget(w); 0029 0030 QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); 0031 0032 layout()->addWidget(buttonBox); 0033 0034 connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); 0035 connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); 0036 } 0037 0038 KHotkeysExportDialog::~KHotkeysExportDialog() 0039 { 0040 } 0041 0042 bool KHotkeysExportDialog::allowMerging() const 0043 { 0044 return w->ui.allowMerging->isChecked(); 0045 } 0046 0047 QString KHotkeysExportDialog::importId() const 0048 { 0049 return w->ui.id->text(); 0050 } 0051 0052 void KHotkeysExportDialog::setAllowMerging(bool allow) 0053 { 0054 w->ui.allowMerging->setChecked(allow); 0055 } 0056 0057 void KHotkeysExportDialog::setImportId(const QString &id) 0058 { 0059 w->ui.id->setText(id); 0060 } 0061 0062 int KHotkeysExportDialog::state() const 0063 { 0064 return w->ui.state->currentIndex(); 0065 } 0066 0067 QUrl KHotkeysExportDialog::url() const 0068 { 0069 return w->ui.filename->url(); 0070 } 0071 0072 #include "moc_hotkeys_export_widget.cpp"