1 #include "kde_pluginsbox.h"
2 #include "kde_preferences.h"
4 #include <videolan/vlc.h>
10 #include <kbuttonbox.h>
12 KPluginsBox::KPluginsBox(QString text, QString value, QWidget *parent,
13 int spacing, KPreferences *pref) :
14 QGroupBox( 1, Vertical, text, parent )
17 QVBox *item_vbox = new QVBox( this );
18 item_vbox->setSpacing(spacing);
20 listView = new KListView(item_vbox);
21 listView->setAllColumnsShowFocus(true);
22 listView->addColumn(_("Name"));
23 listView->addColumn(_("Description"));
24 KButtonBox *item_bbox = new KButtonBox(item_vbox);
25 configure = item_bbox->addButton( _("Configure") );
26 configure->setEnabled(false);
27 selectButton = item_bbox->addButton( _("Select") );
28 QHBox *item_hbox = new QHBox(item_vbox);
29 item_hbox->setSpacing(spacing);
30 new QLabel( _("Selected:"), item_hbox );
31 line = new KLineEdit( value, item_hbox );
32 connect(selectButton, SIGNAL(clicked()), this, SLOT(selectClicked()));
33 connect(configure, SIGNAL(clicked()), this, SLOT(configureClicked()));
34 connect(listView, SIGNAL(selectionChanged( QListViewItem *)),
35 this, SLOT( selectionChanged( QListViewItem *)));
38 KPluginsBox::~KPluginsBox()
43 QListView* KPluginsBox::getListView()
48 void KPluginsBox::selectClicked()
50 if (listView->selectedItem()) {
51 line->setText(listView->selectedItem()->text(0));
52 emit selectionChanged(listView->selectedItem()->text(0));
56 void KPluginsBox::configureClicked()
58 if (listView->selectedItem()) {
59 new KPreferences(listView->selectedItem()->text(0), this);
62 void KPluginsBox::selectionChanged( QListViewItem *item )
64 selectButton->setEnabled(true);
65 /* look for module 'psz_name' */
66 configure->setEnabled(owner->isConfigureable(item->text(0)));