1/*
2 Copyright (c) 2009 Volker Krause <vkrause@kde.org>
3 Copyright (c) 2010 Tom Albers <toma@kde.org>
4
5 This library is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version.
9
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 02110-1301, USA.
19*/
20
21#ifndef PROVIDERPAGE_H
22#define PROVIDERPAGE_H
23
24#include "page.h"
25#include <QStandardItemModel>
26
27#include "ui_providerpage.h"
28#include <knewstuff3/entry.h>
29
30struct Provider {
31 QString entryId;
32 QString entryProviderId;
33};
34
35namespace KNS3 {
36 class DownloadManager;
37}
38
39class ProviderPage : public Page
40{
41 Q_OBJECT
42 public:
43 explicit ProviderPage( KAssistantDialog* parent = 0 );
44
45 virtual void leavePageNext();
46 virtual void leavePageNextRequested();
47 virtual void leavePageBackRequested();
48
49 QTreeView *treeview() const;
50
51 signals:
52 void ghnsNotWanted();
53
54 public slots:
55 void startFetchingData();
56
57 private slots:
58 void fillModel( const KNS3::Entry::List& );
59 void selectionChanged();
60 void providerStatusChanged( const KNS3::Entry& );
61
62 private:
63 void findDesktopAndSetAssistant( const QStringList& list );
64
65 Ui::ProviderPage ui;
66 QStandardItemModel *m_model;
67 QStandardItem *m_fetchItem;
68 KNS3::DownloadManager *m_downloadManager;
69 KNS3::Entry::List m_providerEntries;
70 Provider m_wantedProvider;
71 bool m_newPageWanted;
72 bool m_newPageReady;
73};
74
75#endif
76