blob: cdec4c9f09d02c192784ff89fb62e22c296f2147 (
plain)
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
|
// Copyright 2008 Nanorex, Inc. See LICENSE file for details.
#include "JobSelectorDialog.h"
/* CONSTRUCTORS */
JobSelectorDialog::JobSelectorDialog(QWidget *parent)
: QDialog(parent), Ui_JobSelectorDialog() {
setupUi(this);
buttonBox->button(QDialogButtonBox::Ok)->setDisabled(true);
connect(listWidget, SIGNAL(itemClicked(QListWidgetItem*)),
this, SLOT(itemSelected(QListWidgetItem*)));
}
/* DESTRUCTOR */
JobSelectorDialog::~JobSelectorDialog() {
}
/* FUNCTION: addActiveJobs */
void JobSelectorDialog::addActiveJobs(const QStringList& activeJobs) {
listWidget->addItems(activeJobs);
}
/* FUNCTION: getSelection */
QString JobSelectorDialog::getSelection() {
return listWidget->selectedItems().first()->text();
}
/* FUNCTION: itemSelected */
void JobSelectorDialog::itemSelected(QListWidgetItem* item) {
buttonBox->button(QDialogButtonBox::Ok)->setDisabled(false);
}
|