25 #include <klistview.h>
27 #include <kmessagebox.h>
32 #include "providerdialog.h"
33 #include "providerdialog.moc"
37 class ProviderItem :
public KListViewItem
40 ProviderItem( KListView *parent,
Provider *provider ) :
41 KListViewItem( parent ), mProvider( provider )
43 setText( 0, provider->
name() );
46 Provider *provider() {
return mProvider; }
53 KDialogBase( Plain, i18n(
"Hot New Stuff Providers"), Ok | Cancel, Cancel,
54 parent, 0, false, true ),
57 TQFrame *topPage = plainPage();
59 TQBoxLayout *topLayout =
new TQVBoxLayout( topPage );
61 TQLabel *description =
new TQLabel( i18n(
"Please select one of the providers listed below:"), topPage );
62 topLayout->addWidget( description );
64 mListView =
new KListView( topPage );
65 mListView->addColumn( i18n(
"Name") );
66 topLayout->addWidget( mListView );
76 new ProviderItem( mListView, provider );
77 if ( mListView->childCount() == 1 ) {
78 mListView->setSelected(mListView->firstChild(),
true);
79 }
else if (mListView->childCount() > 1) {
80 mListView->setSelected(mListView->firstChild(),
false);
84 void ProviderDialog::slotOk()
86 ProviderItem *item =
static_cast<ProviderItem *
>( mListView->selectedItem() );
88 KMessageBox::error(
this, i18n(
"No provider selected.") );
ProviderDialog(Engine *engine, TQWidget *parent)
Constructor.
void addProvider(Provider *)
Adds a Hotstuff provider to the list.
void requestMetaInformation(Provider *provider)
Asynchronous lookup of provider information such as upload and download locations, icon etc.
void clear()
Clears the list of providers.
TQString name() const
Retrieves the common name of the provider.
Central class combining all possible KNewStuff operations.
KNewStuff provider container.