• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KNewStuff

  • sources
  • kde-4.14
  • kdelibs
  • knewstuff
  • knewstuff2
  • ui
knewstuff2/ui/downloaddialog.h
Go to the documentation of this file.
1 /*
2  This file is part of KNewStuff2.
3  Copyright (C) 2005 by Enrico Ros <eros.kde@email.it>
4  Copyright (C) 2005 - 2007 Josef Spillner <spillner@kde.org>
5  Copyright (C) 2007 Dirk Mueller <mueller@kde.org>
6  Copyright (C) 2007 Jeremy Whiting <jpwhiting@kde.org>
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation; either
11  version 2.1 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #ifndef KNEWSTUFF2_UI_DOWNLOADDIALOG_H
23 #define KNEWSTUFF2_UI_DOWNLOADDIALOG_H
24 
25 #include <QMutex>
26 
27 #include <kdialog.h>
28 #include <ktitlewidget.h>
29 
30 #include <knewstuff2/dxs/dxsengine.h>
31 #include <knewstuff2/core/category.h>
32 
33 #include "ui_DownloadDialog.h"
34 
35 class KJob;
36 class KLineEdit;
37 class QComboBox;
38 class QHideEvent;
39 class QLabel;
40 class QProgressIndicator;
41 class QSortFilterProxyModel;
42 
43 namespace KNS
44 {
45 
46 class DownloadDialog;
47 class ItemsModel;
48 class ItemsViewDelegate;
49 
68 class DownloadDialog : public KDialog, public Ui::DownloadDialog
69 {
70  Q_OBJECT
71 
72 public:
73  DownloadDialog(DxsEngine* engine, QWidget * parent);
74  ~DownloadDialog();
75 
76  enum EntryAction {
77  kViewInfo,
78  kComments,
79  kChanges,
80  kContactEmail,
81  kContactJabber,
82  kCollabTranslate,
83  kCollabRemoval,
84  kCollabSubscribe,
85  kUninstall,
86  kInstall,
87  kCollabComment,
88  kCollabRate
89  };
90 
91  void refresh();
92 
93  // show a message in the bottom bar
94  void displayMessage(const QString & msg,
95  KTitleWidget::MessageType type = KTitleWidget::PlainMessage,
96  int timeOutMs = 0);
97 
98  // begin installing that item
99  void installItem(Entry * entry);
100 
101  // remove an already installed item
102  void removeItem(Entry * entry);
103 
104 private Q_SLOTS:
106  void slotEntryLoaded(KNS::Entry *entry, const KNS::Feed *feed, const KNS::Provider *provider);
107  void slotEntryRemoved(KNS::Entry *entry, const KNS::Feed *feed);
108  void slotEntriesFailed();
109  void slotPayloadFailed(KNS::Entry * entry);
110  void slotPayloadLoaded(KUrl url);
111 
112  void slotResetMessage();
113  void slotNetworkTimeout();
114  void slotSortingSelected(int sortType);
115  void slotSearchTextChanged();
116  void slotUpdateSearch();
117 
118  void slotInfo(QString provider, QString server, QString version);
119  void slotComments(QStringList comments);
120  // DXS
121  void slotLoadProvidersListDXS();
122  void slotLoadProviderDXS();
123  void slotCategories(QList<Category*> categories);
124  void slotEntries(QList<Entry*> entries);
125  void slotFault();
126  void slotError();
127  // file downloading
128  void slotEntryChanged(KNS::Entry *);
129  //void slotItemMessage( KJob *, const QString & );
130  //void slotItemPercentage( KJob *, unsigned long );
131  //void slotItemResult( KJob * );
132  void slotProgress(const QString & text, int percentage);
133  void slotProvidersFailed();
134 
135  void slotPerformAction(DownloadDialog::EntryAction action, KNS::Entry * entry);
136  void slotCollabAction(QAction * action);
137 
138  void slotListIndexChanged(const QModelIndex &index, const QModelIndex &old);
139 protected:
140  virtual void hideEvent(QHideEvent * event);
141 
142 private:
143 
144  void populateSortCombo(const Provider * provider);
145 
146  // Contents
147  // gui related vars
148  //Ui::DownloadDialog * m_ui;
149 
150  // other classes
151  QTimer * m_searchTimer;
152  QTimer * messageTimer;
153  QTimer * networkTimer;
154 
155  DxsEngine *m_engine;
156  QMap<QString, QString> categorymap;
157  QMap<const Feed*, KNS::ItemsModel*> m_models;
158  QSortFilterProxyModel * m_filteredModel;
159  ItemsViewDelegate * mDelegate;
160 
161  //QList<Entry*> m_entries;
162  QMap<const Feed*, Entry::List> entries;
163  QMap<const Provider*, Entry::List> m_entriesByProvider;
164  QMap<Entry*, const Provider*> m_providers;
165 
166  QMutex mMutex;
167  bool m_hasDxs;
168 };
169 
170 }
171 
172 #endif
QHideEvent
dxsengine.h
kdialog.h
QModelIndex
QMutex
QWidget
KNS::DownloadDialog::~DownloadDialog
~DownloadDialog()
Definition: knewstuff2/ui/downloaddialog.cpp:160
QDialog::event
virtual bool event(QEvent *e)
KNS::DownloadDialog::kCollabSubscribe
Definition: knewstuff2/ui/downloaddialog.h:84
KNS::DownloadDialog::displayMessage
void displayMessage(const QString &msg, KTitleWidget::MessageType type=KTitleWidget::PlainMessage, int timeOutMs=0)
Definition: knewstuff2/ui/downloaddialog.cpp:273
ktitlewidget.h
KNS::DownloadDialog::kCollabRate
Definition: knewstuff2/ui/downloaddialog.h:88
KNS::Entry
KNewStuff data entry container.
Definition: knewstuff2/core/entry.h:46
category.h
QMap< QString, QString >
KDialog
KNS::ItemsViewDelegate
Definition: knewstuff2/ui/itemsviewdelegate.h:39
KNS::DownloadDialog::EntryAction
EntryAction
Definition: knewstuff2/ui/downloaddialog.h:76
KUrl
KTitleWidget::MessageType
MessageType
KNS::DownloadDialog::hideEvent
virtual void hideEvent(QHideEvent *event)
Definition: knewstuff2/ui/downloaddialog.cpp:266
KNS::DxsEngine
KNewStuff DXS engine.
Definition: dxsengine.h:39
QProgressIndicator
Embedded progress indicator for the download dialog.
Definition: qprogressindicator.h:40
QTimer
KTitleWidget::PlainMessage
KNS::DownloadDialog::DownloadDialog
DownloadDialog(DxsEngine *engine, QWidget *parent)
Definition: knewstuff2/ui/downloaddialog.cpp:56
KNS::DownloadDialog::kComments
Definition: knewstuff2/ui/downloaddialog.h:78
KNS::DownloadDialog::kContactJabber
Definition: knewstuff2/ui/downloaddialog.h:81
QString
QList
KNS::DownloadDialog::kCollabTranslate
Definition: knewstuff2/ui/downloaddialog.h:82
QStringList
KNS::DownloadDialog::kContactEmail
Definition: knewstuff2/ui/downloaddialog.h:80
QSortFilterProxyModel
KNS::DownloadDialog::installItem
void installItem(Entry *entry)
Definition: knewstuff2/ui/downloaddialog.cpp:288
KNS::DownloadDialog::kUninstall
Definition: knewstuff2/ui/downloaddialog.h:85
KLineEdit
KNS::DownloadDialog::removeItem
void removeItem(Entry *entry)
Definition: knewstuff2/ui/downloaddialog.cpp:301
KNS::DownloadDialog::kInstall
Definition: knewstuff2/ui/downloaddialog.h:86
KNS::DownloadDialog::kViewInfo
Definition: knewstuff2/ui/downloaddialog.h:77
QAction
KNS::DownloadDialog::kCollabComment
Definition: knewstuff2/ui/downloaddialog.h:87
KNS::DownloadDialog::refresh
void refresh()
Definition: knewstuff2/ui/downloaddialog.cpp:454
KNS::DownloadDialog::kChanges
Definition: knewstuff2/ui/downloaddialog.h:79
KNS::Feed
KNewStuff feed.
Definition: feed.h:45
QLabel
QObject::parent
QObject * parent() const
KNS::DownloadDialog::kCollabRemoval
Definition: knewstuff2/ui/downloaddialog.h:83
KJob
KNS::Provider
KNewStuff provider container.
Definition: knewstuff2/core/provider.h:51
KNS::DownloadDialog
KNewStuff download dialog.
Definition: knewstuff2/ui/downloaddialog.h:68
QComboBox
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KNewStuff

Skip menu "KNewStuff"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal