22 #include "downloaddialog.h"
23 #include "downloaddialog.moc"
25 #include <tdelocale.h>
26 #include <tdelistview.h>
28 #include <tdeio/job.h>
29 #include <tdeio/netaccess.h>
30 #include <tdemessagebox.h>
32 #include <tdeconfig.h>
33 #include <tdeapplication.h>
34 #include <kiconloader.h>
36 #include <tdenewstuff/entry.h>
37 #include <tdenewstuff/knewstuffgeneric.h>
38 #include <tdenewstuff/engine.h>
41 #include <tqpushbutton.h>
44 #include <tqtextbrowser.h>
45 #include <tqtabwidget.h>
48 #define OPENDESKTOP_REDIRECT_URL "opendesktop.org/content/download.php?content="
49 #define OPENDESKTOP_REDIRECT_TEXT "If the download does not start in 3 seconds:</span><span class=\"defaulttext\"> <a href=\""
53 struct DownloadDialog::Private
55 TQString m_providerlist;
57 TQFrame *m_loadingFrame;
58 TQLabel *m_loadingLabel;
59 TDEListView *m_lvtmp_r, *m_lvtmp_d, *m_lvtmp_l;
60 TQPtrList<Entry> m_installlist;
61 TQMap<TDEIO::Job*, Provider*> m_variantjobs;
62 TQMap<TDEIO::Job*, TQStringList> m_variants;
63 TQMap<Provider*, Provider*> m_newproviders;
66 class NumSortListViewItem :
public TDEListViewItem
69 NumSortListViewItem( TQListView * parent, TQString label1, TQString label2 = TQString::null, TQString label3 = TQString::null, TQString label4 = TQString::null, TQString label5 = TQString::null, TQString label6 = TQString::null, TQString label7 = TQString::null, TQString label8 = TQString::null ) :
70 TDEListViewItem( parent, label1, label2, label3, label4, label5, label6, label7, label8 )
74 TQString key(
int col,
bool asc)
const {
78 s.sprintf(
"%08d", text(col).toInt());
81 return TDEListViewItem::key( col, asc );
85 class DateSortListViewItem :
public TDEListViewItem
88 DateSortListViewItem( TQListView * parent, TQString label1, TQString label2 = TQString::null, TQString label3 = TQString::null, TQString label4 = TQString::null, TQString label5 = TQString::null, TQString label6 = TQString::null, TQString label7 = TQString::null, TQString label8 = TQString::null ) :
89 TDEListViewItem( parent, label1, label2, label3, label4, label5, label6, label7, label8 )
93 TQString key(
int col,
bool asc)
const {
97 TQDate date = TDEGlobal::locale()->readDate(text(col));
98 s.sprintf(
"%08d", date.year() * 366 + date.dayOfYear());
101 return TDEListViewItem::key( col, asc );
107 : KDialogBase(KDialogBase::IconList, i18n(
"Get Hot New Stuff"),
108 KDialogBase::Close, KDialogBase::Close)
114 : KDialogBase(KDialogBase::IconList, i18n(
"Get Hot New Stuff"),
115 KDialogBase::Close, KDialogBase::Close)
130 : KDialogBase(KDialogBase::IconList, (caption.isNull() ? i18n(
"Get Hot New Stuff") : caption),
131 KDialogBase::Close, KDialogBase::Close)
137 : KDialogBase(KDialogBase::IconList, (caption.isNull() ? i18n(
"Get Hot New Stuff") : caption),
138 KDialogBase::Close, KDialogBase::Close)
143 void DownloadDialog::init(
Engine *engine)
152 d->m_loadingFrame = addPage(i18n(
"Welcome"), i18n(
"Welcome"), TQPixmap(TQString(
"")));
153 d->m_loadingLabel =
new TQLabel(d->m_loadingFrame);
154 d->m_loadingLabel->setText(i18n(
"Loading data providers..."));
155 TQVBoxLayout *box =
new TQVBoxLayout(d->m_loadingFrame);
156 box->add(d->m_loadingLabel);
157 box->addItem(
new TQSpacerItem(0, 0, TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding));
159 connect(
this, TQ_SIGNAL(aboutToShowPage(TQWidget*)), TQ_SLOT(slotPage(TQWidget*)));
164 connect(m_loader, TQ_SIGNAL(providersLoaded(Provider::List*)), TQ_SLOT(
slotProviders(Provider::List*)));
167 m_entries.setAutoDelete(
true);
172 for (TQMap<TQWidget *, TQValueList<TQPushButton *>* >::const_iterator it = m_buttons.constBegin(); it != m_buttons.constEnd(); ++it)
174 for (TQMap<TQWidget *, TQValueList<TDEListView *>* >::const_iterator it = m_map.constBegin(); it != m_map.constEnd(); ++it)
181 m_loader->
load(m_filter, d->m_providerlist);
186 m_loader->
load(m_filter, providerList);
191 TQMap<TQWidget*, TQValueList<TDEListView*>* >::Iterator it;
192 TQMap<TQWidget*, TQValueList<TDEListView*>* >::Iterator end(m_map.end());
193 for(it = m_map.begin(); it != end; ++it)
195 TQValueList<TDEListView*> *v = it.data();
196 kdDebug() <<
"clear listviews in " << v << endl;
199 (*(v->at(0)))->clear();
200 (*(v->at(1)))->clear();
201 (*(v->at(2)))->clear();
213 d->m_loadingLabel->setText(i18n(
"Loading data listings..."));
218 for(p = list->first(); p; p = list->next())
220 kdDebug() <<
"++ provider ++ " << p->
name() << endl;
222 if(!m_filter.isEmpty())
235 TQWidget *w_d, *w_r, *w_l;
241 kdDebug() <<
"addProvider()/begin" << endl;
244 if(p->
icon().path().isEmpty()) ret =
false;
247 if(!p->
icon().protocol().isEmpty())
249 ret = TDEIO::NetAccess::download(p->
icon(), tmp,
this);
250 if(ret) pix = TQPixmap(tmp);
254 pix = TDEGlobal::iconLoader()->loadIcon(p->
icon().path(), TDEIcon::Panel);
258 if(!ret) pix = TDEGlobal::iconLoader()->loadIcon(
"knewstuff", TDEIcon::Panel);
259 if (d->m_loadingFrame) {
260 delete d->m_loadingFrame;
261 d->m_loadingFrame = NULL;
263 frame = addPage(p->
name(), p->
name(), pix);
266 w_d =
new TQWidget(frame);
267 w_r =
new TQWidget(frame);
268 w_l =
new TQWidget(frame);
270 ctl =
new TQTabWidget(frame);
271 ctl->addTab(w_r, i18n(
"Highest Rated"));
272 ctl->addTab(w_d, i18n(
"Most Downloads"));
273 ctl->addTab(w_l, i18n(
"Latest"));
276 connect(ctl, TQ_SIGNAL(currentChanged(TQWidget *)), TQ_SLOT(slotTab()));
278 TQHBoxLayout *box =
new TQHBoxLayout(frame);
281 d->m_lvtmp_r =
new TDEListView(w_r);
282 d->m_lvtmp_r->addColumn(i18n(
"Name"));
283 d->m_lvtmp_r->addColumn(i18n(
"Version"));
284 d->m_lvtmp_r->addColumn(i18n(
"Rating"));
285 d->m_lvtmp_r->setSorting(2,
false);
287 d->m_lvtmp_d =
new TDEListView(w_d);
288 d->m_lvtmp_d->addColumn(i18n(
"Name"));
289 d->m_lvtmp_d->addColumn(i18n(
"Version"));
290 d->m_lvtmp_d->addColumn(i18n(
"Downloads"));
291 d->m_lvtmp_d->setSorting(2,
false);
293 d->m_lvtmp_l =
new TDEListView(w_l);
294 d->m_lvtmp_l->addColumn(i18n(
"Name"));
295 d->m_lvtmp_l->addColumn(i18n(
"Version"));
296 d->m_lvtmp_l->addColumn(i18n(
"Release Date"));
297 d->m_lvtmp_l->setSorting(2,
false);
299 connect(d->m_lvtmp_r, TQ_SIGNAL(clicked(TQListViewItem*)), TQ_SLOT(slotSelected()));
300 connect(d->m_lvtmp_d, TQ_SIGNAL(clicked(TQListViewItem*)), TQ_SLOT(slotSelected()));
301 connect(d->m_lvtmp_l, TQ_SIGNAL(clicked(TQListViewItem*)), TQ_SLOT(slotSelected()));
303 rt =
new TQTextBrowser(frame);
304 rt->setMinimumWidth(150);
306 TQPushButton *in =
new TQPushButton(i18n(
"Install"), frame);
307 TQPushButton *de =
new TQPushButton(i18n(
"Details"), frame);
308 in->setEnabled(
false);
309 de->setEnabled(
false);
311 box->addSpacing(spacingHint());
312 TQVBoxLayout *vbox =
new TQVBoxLayout(box);
314 vbox->addSpacing(spacingHint());
318 connect(rt, TQ_SIGNAL(linkClicked(
const TQString&)), TQ_SLOT(slotEmail(
const TQString&)));
320 connect(in, TQ_SIGNAL(clicked()), TQ_SLOT(slotInstall()));
321 connect(de, TQ_SIGNAL(clicked()), TQ_SLOT(slotDetails()));
323 TQVBoxLayout *box2 =
new TQVBoxLayout(w_r);
324 box2->add(d->m_lvtmp_r);
325 TQVBoxLayout *box3 =
new TQVBoxLayout(w_d);
326 box3->add(d->m_lvtmp_d);
327 TQVBoxLayout *box4 =
new TQVBoxLayout(w_l);
328 box4->add(d->m_lvtmp_l);
330 TQValueList<TDEListView*> *v =
new TQValueList<TDEListView*>;
331 *v << d->m_lvtmp_r << d->m_lvtmp_d << d->m_lvtmp_l;
334 TQValueList<TQPushButton*> *vb =
new TQValueList<TQPushButton*>;
336 m_buttons[frame] = vb;
337 m_providers[frame] = p;
339 kdDebug() <<
"addProvider()/end; d->m_lvtmp_r = " << d->m_lvtmp_r << endl;
341 if(m_engine) slotPage(frame);
343 TQTimer::singleShot(100,
this, TQ_SLOT(slotFinish()));
346 void DownloadDialog::slotResult(TDEIO::Job *job)
349 TQDomElement knewstuff;
350 TQDomElement content;
352 kdDebug() <<
"got data: " << m_data[job] << endl;
354 kapp->config()->setGroup(
"TDENewStuffStatus");
356 dom.setContent(m_data[job]);
357 knewstuff = dom.documentElement();
359 for(TQDomNode pn = knewstuff.firstChild(); !pn.isNull(); pn = pn.nextSibling())
361 TQDomElement stuff = pn.toElement();
363 if(stuff.tagName() ==
"data")
365 content = pn.toElement();
369 for(TQDomNode pn = content.firstChild(); !pn.isNull(); pn = pn.nextSibling())
371 TQDomElement stuff = pn.toElement();
373 kdDebug() <<
"element: " << stuff.tagName() << endl;
375 if(stuff.tagName() ==
"content")
378 kdDebug() <<
"TYPE::" << entry->
type() <<
" FILTER::" << m_filter << endl;
379 if(!entry->
type().isEmpty())
381 if((!m_filter.isEmpty()) && (entry->
type() != m_filter))
continue;
394 if((!m_filter.isEmpty()) && (d->m_variantjobs[job]))
396 Provider *p = d->m_variantjobs[job];
408 if(d->m_newproviders[p])
412 d->m_newproviders[p] = 0;
418 if(d->m_variantjobs[job]) {
419 addEntry(entry, d->m_variants[job]);
424 if(d->m_variantjobs[job]) {
425 d->m_variantjobs.remove(job);
429 int DownloadDialog::installStatus(
Entry *entry)
435 TQString lang = TDEGlobal::locale()->language();
437 kapp->config()->setGroup(
"TDENewStuffStatus");
438 datestring = kapp->config()->readEntry(entry->
name(lang));
439 if(datestring.isNull()) installed = 0;
442 date = TQDate::fromString(datestring, TQt::ISODate);
443 if(!date.isValid()) installed = 0;
444 else if(date < entry->releaseDate()) installed = -1;
456 installed = installStatus(entry);
458 if(installed > 0) pix = TDEGlobal::iconLoader()->loadIcon(
"ok", TDEIcon::Small);
459 else if(installed < 0) pix = TDEGlobal::iconLoader()->loadIcon(
"history", TDEIcon::Small);
460 else pix = TQPixmap();
462 TQString lang = TDEGlobal::locale()->language();
464 if(variants.contains(
"score"))
466 TDEListViewItem *tmp_r =
new NumSortListViewItem(lv_r,
468 tmp_r->setPixmap(0, pix);
470 if(variants.contains(
"downloads"))
472 TDEListViewItem *tmp_d =
new NumSortListViewItem(lv_d,
474 tmp_d->setPixmap(0, pix);
476 if(variants.contains(
"latest"))
478 TDEListViewItem *tmp_l =
new DateSortListViewItem(lv_l,
480 tmp_l->setPixmap(0, pix);
483 m_entries.append(entry);
485 kdDebug() <<
"added entry " << entry->
name() <<
" for variants " << variants << endl;
490 TQStringList variants;
493 variants <<
"downloads";
494 variants <<
"latest";
499 kdDebug() <<
"added entry " << entry->
name() << endl;
502 void DownloadDialog::slotData(TDEIO::Job *job,
const TQByteArray &a)
504 TQCString tmp(a, a.size() + 1);
505 m_data[job].append(TQString::fromUtf8(tmp));
508 void DownloadDialog::slotDetails()
510 Entry *e = getEntry();
513 TQString lang = TDEGlobal::locale()->language();
533 ).arg(TDEGlobal::locale()->formatDate(e->
releaseDate())
545 KMessageBox::information(
this, info, i18n(
"Details"));
548 TQListViewItem *DownloadDialog::currentEntryItem()
550 if((m_curtab == 0) && (lv_r->selectedItem()))
return lv_r->selectedItem();
551 if((m_curtab == 1) && (lv_d->selectedItem()))
return lv_d->selectedItem();
552 if((m_curtab == 2) && (lv_l->selectedItem()))
return lv_l->selectedItem();
557 void DownloadDialog::slotInstall()
559 Entry *e = getEntry();
562 TQPushButton *de, *in;
563 in = *(m_buttons[d->m_page]->at(0));
564 de = *(m_buttons[d->m_page]->at(1));
566 if(in) in->setEnabled(
false);
567 if(de) de->setEnabled(
false);
569 d->m_lvtmp_r->setEnabled(
false );
570 d->m_lvtmp_l->setEnabled(
false );
571 d->m_lvtmp_d->setEnabled(
false );
573 kdDebug() <<
"download entry now" << endl;
584 if (e->
payload().url().contains(OPENDESKTOP_REDIRECT_URL)) {
585 TDEIO::TransferJob *job = TDEIO::get( KURL( e->
payload() ),
false,
false );
586 connect( job, TQ_SIGNAL( result( TDEIO::Job * ) ),
587 TQ_SLOT( slotJobResult( TDEIO::Job * ) ) );
588 connect( job, TQ_SIGNAL( data( TDEIO::Job *,
const TQByteArray & ) ),
589 TQ_SLOT( slotJobData( TDEIO::Job *,
const TQByteArray & ) ) );
596 void DownloadDialog::slotInstallPhase2()
598 Entry *e = getEntry();
601 m_entryitem = currentEntryItem();
602 m_entryname = m_entryitem->text(0);
604 kdDebug() <<
"download entry now (phase 2)" << endl;
618 TDEIO::FileCopyJob *job = TDEIO::file_copy(source, dest, -1,
true);
619 connect(job, TQ_SIGNAL(result(TDEIO::Job*)), TQ_SLOT(slotInstalled(TDEIO::Job*)));
623 void DownloadDialog::slotJobData( TDEIO::Job *,
const TQByteArray &data )
625 kdDebug() <<
"DownloadDialog::slotJobData()" << endl;
627 if ( data.size() == 0 )
return;
629 TQCString str( data, data.size() + 1 );
631 mJobData.append( TQString::fromUtf8( str ) );
634 void DownloadDialog::slotJobResult( TDEIO::Job *job )
636 if ( job->error() ) {
637 job->showErrorDialog(
this );
641 Entry *e = getEntry();
645 if (e->
payload().url().contains(OPENDESKTOP_REDIRECT_URL)) {
646 int pos = mJobData.find(
"<a href=\"/CONTENT/content-files/");
648 TQString realURL = mJobData.mid(pos);
649 realURL = realURL.mid(0, realURL.find(
"\">"));
650 realURL = realURL.mid(strlen(
"<a href=\""));
651 realURL = e->
payload().protocol() +
"://opendesktop.org" + realURL;
654 else if ((pos = mJobData.find(OPENDESKTOP_REDIRECT_TEXT)) > 0) {
655 pos = pos + strlen(OPENDESKTOP_REDIRECT_TEXT);
656 TQString realURL = mJobData.mid(pos);
657 realURL = realURL.mid(0, realURL.find(
"\">"));
663 mJobData = TQString::null;
668 void DownloadDialog::install(
Entry *e)
670 kapp->config()->setGroup(
"TDENewStuffStatus");
671 kapp->config()->writeEntry(m_entryname, TQString(e->
releaseDate().toString(TQt::ISODate)));
672 kapp->config()->sync();
674 TQPixmap pix = TDEGlobal::iconLoader()->loadIcon(
"ok", TDEIcon::Small);
676 TQString lang = TDEGlobal::locale()->language();
680 m_entryitem->setPixmap(0, pix);
682 TQListViewItem *item;
683 item = lv_r->findItem(e->
name(lang), 0);
684 if(item) item->setPixmap(0, pix);
685 item = lv_d->findItem(e->
name(lang), 0);
686 if(item) item->setPixmap(0, pix);
687 item = lv_l->findItem(e->
name(lang), 0);
688 if(item) item->setPixmap(0, pix);
691 if(currentEntryItem() == m_entryitem)
694 in = *(m_buttons[d->m_page]->at(0));
695 if(in) in->setEnabled(
false);
698 d->m_installlist.append(e);
699 d->m_lvtmp_r->setEnabled(
true );
700 d->m_lvtmp_l->setEnabled(
true );
701 d->m_lvtmp_d->setEnabled(
true );
704 void DownloadDialog::slotInstalled(TDEIO::Job *job)
706 TQPushButton *de, *in;
707 in = *(m_buttons[d->m_page]->at(0));
708 de = *(m_buttons[d->m_page]->at(1));
710 if(in) in->setEnabled(
true);
711 if(de) de->setEnabled(
true);
713 bool ret = job && (job->error() == 0);
716 TDEIO::FileCopyJob *cjob = ::tqt_cast<TDEIO::FileCopyJob*>(job);
719 ret = m_s->
install(cjob->destURL().path());
728 KMessageBox::information(
this, i18n(
"Installation successful."), i18n(
"Installation"));
730 else KMessageBox::error(
this, i18n(
"Installation failed."), i18n(
"Installation"));
731 d->m_lvtmp_r->setEnabled(
true );
732 d->m_lvtmp_l->setEnabled(
true );
733 d->m_lvtmp_d->setEnabled(
true );
738 void DownloadDialog::slotTab()
740 int tab =
static_cast<const TQTabWidget *
>(sender())->currentPageIndex();
741 kdDebug() <<
"switch tab to: " << tab << endl;
743 Entry *eold = getEntry();
745 Entry *e = getEntry();
747 if(e == eold)
return;
755 TQPushButton *de, *in;
756 in = *(m_buttons[d->m_page]->at(0));
757 de = *(m_buttons[d->m_page]->at(1));
759 if(in) in->setEnabled(
false);
760 if(de) de->setEnabled(
false);
766 void DownloadDialog::slotSelected()
770 Entry *e = getEntry();
771 TQString lang = TDEGlobal::locale()->language();
776 TQString lang = TDEGlobal::locale()->language();
778 TQListViewItem *item;
781 lv_r->clearSelection();
782 item = lv_r->findItem(e->
name(lang), 0);
783 if(item) lv_r->setSelected(item,
true);
787 lv_d->clearSelection();
788 item = lv_d->findItem(e->
name(lang), 0);
789 if(item) lv_d->setSelected(item,
true);
793 lv_l->clearSelection();
794 item = lv_l->findItem(e->
name(lang), 0);
795 if(item) lv_l->setSelected(item,
true);
798 if(!e->
preview(lang).isValid())
804 ret = TDEIO::NetAccess::download(e->
preview(lang), tmp,
this);
807 TQString desc = TQString(
"<b>%1</b><br>").arg(e->
name(lang));
810 desc += TQString(
"<a href='mailto:" + e->
authorEmail() +
"'>" + e->
author() +
"</a>");
814 desc += TQString(
"%1").arg(e->
author());
816 desc += TQString(
"<br>%1").arg(TDEGlobal::locale()->formatDate(e->
releaseDate()));
817 desc += TQString(
"<br><br>");
820 desc += TQString(
"<img src='%1'>").arg(tmp);
824 desc += i18n(
"Preview not available.");
826 desc += TQString(
"<br><i>%1</i>").arg(e->
summary(lang));
827 desc += TQString(
"<br>(%1)").arg(e->
license());
832 if(installStatus(e) == 1) enabled =
false;
835 TQPushButton *de, *in;
836 in = *(m_buttons[d->m_page]->at(0));
837 de = *(m_buttons[d->m_page]->at(1));
838 if(in) in->setEnabled(enabled);
839 if(de) de->setEnabled(
true);
843 void DownloadDialog::slotEmail(
const TQString& link)
845 kdDebug() <<
"EMAIL: " << link << endl;
846 kapp->invokeMailer(link);
850 Entry *DownloadDialog::getEntry()
852 TQListViewItem *entryItem = currentEntryItem();
857 TQString entryName = entryItem->text(0);
859 TQString lang = TDEGlobal::locale()->language();
861 for(
Entry *e = m_entries.first(); e; e = m_entries.next())
862 if(e->
name(lang) == entryName)
868 void DownloadDialog::slotPage(TQWidget *w)
872 kdDebug() <<
"changed widget!!!" << endl;
874 if(m_map.find(w) == m_map.end())
return;
878 lv_r = *(m_map[w]->at(0));
879 lv_d = *(m_map[w]->at(1));
880 lv_l = *(m_map[w]->at(2));
884 kdDebug() <<
"valid change!!!; lv_r = " << lv_r << endl;
888 if(!m_filter.isEmpty())
return;
894 kdDebug() <<
"-- fetch -- " << p->
downloadUrl() << endl;
899 void DownloadDialog::loadProvider(
Provider *p)
901 TQMap<TDEIO::Job*, Provider*>::Iterator it;
903 for(it = d->m_variantjobs.begin(); it != d->m_variantjobs.end(); it++)
907 kdDebug() <<
"-- found provider data in cache" << endl;
908 slotResult(it.key());
913 TQStringList variants;
915 variants <<
"downloads";
916 variants <<
"latest";
920 TQMap<TQString, TQStringList> urls;
922 for(TQStringList::Iterator it = variants.begin(); it != variants.end(); it++)
925 if(!urls.contains(url))
927 urls[url] = TQStringList();
931 it = variants.remove(it);
936 for(TQMap<TQString, TQStringList>::Iterator it = urls.begin(); it != urls.end(); it++)
938 TQString url = it.key();
939 TQStringList urlvariants = it.data();
941 TDEIO::TransferJob *variantjob = TDEIO::get(url,
false,
false);
942 d->m_newproviders[p] = p;
943 d->m_variantjobs[variantjob] = p;
944 d->m_variants[variantjob] = urlvariants;
945 m_data[variantjob] =
"";
947 connect(variantjob, TQ_SIGNAL(result(TDEIO::Job*)), TQ_SLOT(slotResult(TDEIO::Job*)));
948 connect(variantjob, TQ_SIGNAL(data(TDEIO::Job*,
const TQByteArray&)),
949 TQ_SLOT(slotData(TDEIO::Job*,
const TQByteArray&)));
952 if(variants.count() == 0)
return;
956 kdDebug() <<
"-- reached old downloadurl section; variants left: " << variants.count() << endl;
958 TDEIO::TransferJob *job = TDEIO::get(p->
downloadUrl());
960 d->m_newproviders[p] = p;
961 d->m_variantjobs[job] = p;
962 d->m_variants[job] = variants;
966 connect(job, TQ_SIGNAL(result(TDEIO::Job*)), TQ_SLOT(slotResult(TDEIO::Job*)));
967 connect(job, TQ_SIGNAL(data(TDEIO::Job*,
const TQByteArray&)),
968 TQ_SLOT(slotData(TDEIO::Job*,
const TQByteArray&)));
978 d->m_providerlist = providerList;
981 void DownloadDialog::slotOk()
985 void DownloadDialog::slotApply()
997 void DownloadDialog::slotFinish()
1005 return d->m_installlist;
Common download dialog for data browsing and installation.
void setType(TQString type)
Restricts the display of available data to a certain data type.
void addProvider(Provider *p)
Adds another provider to the download dialog.
TQPtrList< Entry > installedEntries()
Returns the list of installed data entries.
void addEntry(Entry *entry)
Adds an additional entry to the current provider.
void clear()
Clears the entry list of the current provider.
void setProviderList(const TQString &providerList)
Explicitly uses this provider list instead of the one read from the application configuration.
void slotProviders(Provider::List *list)
Availability of the provider list.
~DownloadDialog()
Destructor.
static void open(const TQString &type, const TQString &caption)
Opens the download dialog.
DownloadDialog(Engine *engine, TQWidget *parent, const TQString &caption)
Constructor.
void load()
Fetches descriptions of all available data, optionally considering a previously set type.
Central class combining all possible TDENewStuff operations.
void download()
Initiates the download process, retrieving provider lists and invoking the download dialog.
TDENewStuff data entry container.
TQString authorEmail() const
Retrieve the author's email address of the object.
int rating()
Retrieve the rating for the object, which has been determined by its users and thus might change over...
int downloads()
Retrieve the download count for the object, which has been determined by its hosting sites and thus m...
TQString name() const
Retrieve the name of the data object.
TQDate releaseDate() const
Retrieve the date of the object's publication.
KURL payload(const TQString &lang=TQString::null) const
Retrieve the file name of the object.
KURL preview(const TQString &lang=TQString::null) const
Retrieve the file name of an image containing a preview of the object.
int release() const
Retrieve the release number of the object.
TQString type() const
Retrieve the type of the data object.
TQString author() const
Retrieve the author's name of the object.
TQString summary(const TQString &lang=TQString::null) const
Retrieve a short description about the object.
TQString version() const
Retrieve the version string of the object.
TQString license() const
Retrieve the license name of the object.
void setPayload(const KURL &, const TQString &lang=TQString::null)
Sets the object's file.
TDENewStuff provider loader.
void load(const TQString &type, const TQString &providerList=TQString::null)
Starts asynchronously loading the list of providers of the specified type.
TDENewStuff provider container.
KURL downloadUrl() const
Retrieves the download URL.
TQString name() const
Retrieves the common name of the provider.
KURL icon() const
Retrieves the icon URL for this provider.
KURL downloadUrlVariant(TQString variant) const
Variant to retrieve 'tagged' download URLs.
Basic TDENewStuff class with predefined actions.
bool install(const TQString &fileName)
Installs a downloaded file according to the application's configuration.
TQString downloadDestination(KNS::Entry *entry)
Queries the preferred destination file for a download.
Handles security releated issues, like signing, verifying.