Browse the code
| Revision log Information on the revision | |
|---|---|
| Revision: | 54 (differences) |
| Author: | livemix |
| Log message: | 0.45svn20070917 |
| Change revision: | |
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* Copyright 2004 - 2007 Arnold Krille <arnold@arnoldarts.de> Copyright 2007 Stéphane Brunner <stephane.brunner@gmail.com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; version 2 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "channelselector.h" //#include "channelselector.moc" #include <QtCore/QString> #include <QtGui/QLayout> #include <QtGui/QLabel> #include <QtGui/QListWidget> #include <QtGui/QPushButton> #include <QDebug> namespace LiveMix { ChannelSelector::ChannelSelector( QString title, QString label, QStringList channels, QWidget* p ) : QDialog( p ) { this->setWindowTitle( title ); QGridLayout *_layout = new QGridLayout( this ); QLabel *_label = new QLabel( label, this ); _layout->addWidget( _label, 0,0, 1,4 ); _list = new QListWidget( this ); _list->setSelectionMode(QAbstractItemView::MultiSelection); _list->addItems( channels ); _layout->addWidget( _list, 1,0, 1,4 ); _layout->addItem( new QSpacerItem( 10,10 ), 2,0, 1,4 ); _layout->addItem( new QSpacerItem( 40,10 ), 3,0 ); _commit_n_quit = new QPushButton( trUtf8("Commit && Quit"), this ); _commit_n_quit->setDefault( true ); connect( _commit_n_quit, SIGNAL( clicked() ), this, SLOT( commitnquit() ) ); _layout->addWidget( _commit_n_quit, 3,3 ); _commit = new QPushButton( trUtf8("Commit"), this ); connect( _commit, SIGNAL( clicked() ), this, SLOT( commit() ) ); _layout->addWidget( _commit, 3,2 ); _cancel = new QPushButton( trUtf8("Cancel"), this ); connect( _cancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); _layout->addWidget( _cancel, 3,1 ); } ChannelSelector::~ChannelSelector() {} void ChannelSelector::commit() { // qDebug( "ChannelSelector::commit()" ); // qDebug( "Returning: %s", _list->currentItem()->text().toStdString().c_str() ); foreach (QListWidgetItem * item, _list->selectedItems ()) { emit selectedChannel(item->text()); #if QT_VERSION >= 0x040300 _list->removeItemWidget(item); #endif } } void ChannelSelector::commitnquit() { // qDebug( "ChannelSelector::commitnquit()" ); commit(); // qDebug( "Now quit..." ); done( 0 ); } void ChannelSelector::addChannel( QString ) {} void ChannelSelector::removeChannel( QString ) {} }; //LiveMix

