17#include <QStandardPaths>
21#include <swlistcontrol.h>
22#include <swradiyomainwidget.h>
35 _itemList->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
43 connect( _itemList, SIGNAL( itemClicked(QListWidgetItem*) ),
this, SLOT( onItemActivated(QListWidgetItem*) ) );
45 connect( _itemList, SIGNAL( itemActivated(QListWidgetItem*) ),
this, SLOT( onItemActivated(QListWidgetItem*) ) );
53SWListControl::~SWListControl()
66void SWListControl::onDialClicked()
73 QListWidgetItem* item = _itemList->item( _idx );
75 onItemActivated( item );
76 qDebug() <<
"nach EMIT: onDialClicked() " << _idx;
86void SWListControl::onDialValueChanged(
int value )
88 _itemList->setFocus();
89 _idx = value % _itemList->count();
90 _itemList->setCurrentRow( _idx, QItemSelectionModel::ClearAndSelect );
92 qDebug() <<
"on Value: " << value <<
": " << _idx;
102void SWListControl::onItemActivated( QListWidgetItem* item )
109 QString urltext = item->data( SWListControlRole ).toString();
110 qDebug() <<
"EMIT on entry activated: " << item->text() <<
": " << urltext;
112 emit entryActivated( entry );
122 if( _idx < 0 || _itemList->count() == 0)
124 entry.title = raDIYo::NoMedia;
128 QListWidgetItem* item = _itemList->currentItem();
130 QString urltext = item->data( SWListControlRole ).toString();
132 entry.title = item->text();
133 entry.urlText = urltext;