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

KNewStuff

  • 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
35class KJob;
36class KLineEdit;
37class QComboBox;
38class QHideEvent;
39class QLabel;
40class QProgressIndicator;
41class QSortFilterProxyModel;
42
43namespace KNS
44{
45
46class DownloadDialog;
47class ItemsModel;
48class ItemsViewDelegate;
49
68class DownloadDialog : public KDialog, public Ui::DownloadDialog
69{
70 Q_OBJECT
71
72public:
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
104private 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);
139protected:
140 virtual void hideEvent(QHideEvent * event);
141
142private:
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
category.h
KDialog
KJob
KLineEdit
KNS::DownloadDialog
KNewStuff download dialog.
Definition: knewstuff2/ui/downloaddialog.h:69
KNS::DownloadDialog::hideEvent
virtual void hideEvent(QHideEvent *event)
Definition: knewstuff2/ui/downloaddialog.cpp:266
KNS::DownloadDialog::refresh
void refresh()
Definition: knewstuff2/ui/downloaddialog.cpp:454
KNS::DownloadDialog::displayMessage
void displayMessage(const QString &msg, KTitleWidget::MessageType type=KTitleWidget::PlainMessage, int timeOutMs=0)
Definition: knewstuff2/ui/downloaddialog.cpp:273
KNS::DownloadDialog::installItem
void installItem(Entry *entry)
Definition: knewstuff2/ui/downloaddialog.cpp:288
KNS::DownloadDialog::~DownloadDialog
~DownloadDialog()
Definition: knewstuff2/ui/downloaddialog.cpp:160
KNS::DownloadDialog::EntryAction
EntryAction
Definition: knewstuff2/ui/downloaddialog.h:76
KNS::DownloadDialog::kInstall
@ kInstall
Definition: knewstuff2/ui/downloaddialog.h:86
KNS::DownloadDialog::kCollabTranslate
@ kCollabTranslate
Definition: knewstuff2/ui/downloaddialog.h:82
KNS::DownloadDialog::kUninstall
@ kUninstall
Definition: knewstuff2/ui/downloaddialog.h:85
KNS::DownloadDialog::kComments
@ kComments
Definition: knewstuff2/ui/downloaddialog.h:78
KNS::DownloadDialog::kCollabRemoval
@ kCollabRemoval
Definition: knewstuff2/ui/downloaddialog.h:83
KNS::DownloadDialog::kCollabRate
@ kCollabRate
Definition: knewstuff2/ui/downloaddialog.h:88
KNS::DownloadDialog::kCollabSubscribe
@ kCollabSubscribe
Definition: knewstuff2/ui/downloaddialog.h:84
KNS::DownloadDialog::kContactEmail
@ kContactEmail
Definition: knewstuff2/ui/downloaddialog.h:80
KNS::DownloadDialog::kChanges
@ kChanges
Definition: knewstuff2/ui/downloaddialog.h:79
KNS::DownloadDialog::kContactJabber
@ kContactJabber
Definition: knewstuff2/ui/downloaddialog.h:81
KNS::DownloadDialog::kCollabComment
@ kCollabComment
Definition: knewstuff2/ui/downloaddialog.h:87
KNS::DownloadDialog::kViewInfo
@ kViewInfo
Definition: knewstuff2/ui/downloaddialog.h:77
KNS::DownloadDialog::removeItem
void removeItem(Entry *entry)
Definition: knewstuff2/ui/downloaddialog.cpp:301
KNS::DxsEngine
KNewStuff DXS engine.
Definition: dxsengine.h:40
KNS::Entry
KNewStuff data entry container.
Definition: knewstuff2/core/entry.h:47
KNS::Feed
KNewStuff feed.
Definition: feed.h:46
KNS::ItemsViewDelegate
Definition: knewstuff2/ui/itemsviewdelegate.h:40
KNS::Provider
KNewStuff provider container.
Definition: knewstuff2/core/provider.h:52
KTitleWidget::MessageType
MessageType
KTitleWidget::PlainMessage
PlainMessage
KUrl
QAction
QComboBox
QLabel
QList
QMap
QProgressIndicator
Embedded progress indicator for the download dialog.
Definition: qprogressindicator.h:41
QSortFilterProxyModel
QWidget
dxsengine.h
kdialog.h
ktitlewidget.h
KNS
Definition: knewstuff2/core/author.h:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
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