Browse the code
| Revision log Information on the revision | |
|---|---|
| Revision: | 142 (differences) |
| Author: | livemix |
| Log message: | translation, devian version |
| 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
/* * Copyright 2004 - 2006 Arnold Krille <arnold@arnoldarts.de> * Copyright 2007 Stéphane Brunner <stephane.brunner@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include "channelselector.h" #include <QString> #include <QLayout> #include <QLabel> #include <QListWidget> #include <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

