summaryrefslogtreecommitdiffstats
path: root/src/gui/processesStartDialog.cpp
blob: b4c8c79f087c68cbd2016b1986ee6219bd7c866e (plain) (blame)
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
/*
# Copyright (c) 2010 - OpenSLX Project, Computer Center University of Freiburg
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
#
# If you have any feedback please consult http://openslx.org/feedback and
# send your suggestions, praise, or complaints to feedback@openslx.org
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
# processesStartDialog.cpp
	Dialog to get process to send to clients
# -----------------------------------------------------------------------------
*/

#include "processesStartDialog.h"
#include "ui_processesStartDialog.h"
#include <src/gui/mainWindow.h>

ProcessesStartDialog::ProcessesStartDialog(QWidget *parent) :
    QDialog(parent)
{
    textLabel = new QLabel;
    textLabel->setText("Process to start:");

    messageEdit = new QLineEdit;

    layout = new QGridLayout;

    sendButton = new QPushButton(tr("Start"));
    cancelButton = new QPushButton(tr("Cancel"));

    connect( sendButton, SIGNAL( clicked()), this, SLOT( send()));
    connect( cancelButton, SIGNAL( clicked()), this, SLOT( NotSend()));

    layout->addWidget(textLabel,0,0);
    layout->addWidget(messageEdit,1,0);
    layout->addWidget(cancelButton,2,0);
    layout->addWidget(sendButton,2,0);

    setLayout(layout);
    setWindowTitle(tr("PVS start Process"));
}

ProcessesStartDialog::~ProcessesStartDialog()
{
    //delete procstartui;
}

void ProcessesStartDialog::send()
{
	QString procd = messageEdit->text();
	MainWindow::getWindow()->setProcessesDialog(procd);
	messageEdit->clear();
	emit accept();
}

void ProcessesStartDialog::NotSend()
{
	messageEdit->clear();
	emit reject();
}

/*void ProcessesStartDialog::changeEvent(QEvent *e)
{
    //QDialog::changeEvent(e);
    //switch (e->type()) {
    //case QEvent::LanguageChange:
    //    procstartui->retranslateUi(this);
    //    break;
    //default:
    //    break;
    //}
}*/