File indexing completed on 2024-04-28 04:57:32

0001 /* This file is part of the KDE project
0002 
0003    Copyright (C) 2008 Manolo Valdes <nolis71cu@gmail.com>
0004 
0005    This program is free software; you can redistribute it and/or
0006    modify it under the terms of the GNU General Public
0007    License as published by the Free Software Foundation; either
0008    version 2 of the License, or (at your option) any later version.
0009 */
0010 
0011 #ifndef DLGMIRRORSEARCH_H
0012 #define DLGMIRRORSEARCH_H
0013 
0014 #include "ui_dlgengineediting.h"
0015 #include "ui_dlgmirrorsearch.h"
0016 
0017 #include <KCModule>
0018 #include <QDialog>
0019 
0020 class DlgEngineEditing : public QDialog
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     DlgEngineEditing(QWidget *parent = nullptr);
0026     ~DlgEngineEditing() override;
0027 
0028     QString engineName() const;
0029     QString engineUrl() const;
0030 private Q_SLOTS:
0031     void slotChangeText();
0032 
0033 private:
0034     Ui::DlgEngineEditing ui;
0035     QPushButton *okButton;
0036 };
0037 
0038 class DlgSettingsWidget : public KCModule
0039 {
0040     Q_OBJECT
0041 
0042 public:
0043     explicit DlgSettingsWidget(QObject *parent = nullptr, const KPluginMetaData &args = {});
0044     ~DlgSettingsWidget() override;
0045 
0046 public Q_SLOTS:
0047     void save() override;
0048     void load() override;
0049 
0050 private Q_SLOTS:
0051     void slotNewEngine();
0052     void slotRemoveEngine();
0053 
0054 private:
0055     void addSearchEngineItem(const QString &name, const QString &url);
0056 
0057     void loadSearchEnginesSettings();
0058     void saveSearchEnginesSettings();
0059 
0060     Ui::DlgMirrorSearch ui;
0061     QDialog *m_parent;
0062 };
0063 
0064 #endif // DLGMULTISEGKIO_H