File indexing completed on 2024-04-21 05:45:00

0001 /***************************************************************************
0002  *   Copyright (C) 2008-2011 by Daniel Nicoletti                           *
0003  *   dantti12@gmail.com                                                    *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  *                                                                         *
0010  *   This program is distributed in the hope that it will be useful,       *
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *   GNU General Public License for more details.                          *
0014  *                                                                         *
0015  *   You should have received a copy of the GNU General Public License     *
0016  *   along with this program; see the file COPYING. If not, write to       *
0017  *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
0018  *   Boston, MA 02110-1301, USA.                                           *
0019  ***************************************************************************/
0020 
0021 #ifndef SETTINGS_H
0022 #define SETTINGS_H
0023 
0024 #include <QWidget>
0025 #include <KPixmapSequenceOverlayPainter>
0026 
0027 #include <Transaction>
0028 
0029 using namespace PackageKit;
0030 
0031 namespace Ui {
0032     class Settings;
0033 }
0034 
0035 class OriginModel;
0036 class Settings : public QWidget
0037 {
0038     Q_OBJECT
0039 public:
0040     Settings(Transaction::Roles roles, QWidget *parent);
0041     ~Settings() override;
0042 
0043     bool hasChanges() const;
0044 
0045 public Q_SLOTS:
0046     void load();
0047     void save();
0048     void defaults();
0049     void showGeneralSettings();
0050     void showRepoSettings();
0051 
0052 Q_SIGNALS:
0053     void changed(bool state);
0054     void refreshCache();
0055 
0056 private Q_SLOTS:
0057     void refreshRepoModel();
0058     void on_showOriginsCB_stateChanged(int state);
0059     void on_editOriginsPB_clicked();
0060     void checkChanges();
0061 
0062 private:
0063     Ui::Settings *ui;
0064     KPixmapSequenceOverlayPainter *m_busySeq;
0065     OriginModel *m_originModel;
0066     Transaction::Roles  m_roles;
0067 };
0068 
0069 #endif