-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathrtspdialog.cpp
More file actions
76 lines (57 loc) · 1.72 KB
/
rtspdialog.cpp
File metadata and controls
76 lines (57 loc) · 1.72 KB
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
#include <QMessageBox>
#include <QFileDialog>
#include <QRegExp>
#include <QDebug>
#include "rtspdialog.h"
RtspDialog::RtspDialog(QWidget *parent)
: QDialog(parent)
{
ui = new Ui::RtspDialog;
ui->setupUi(this);
connect(ui->ok, SIGNAL(clicked()), this, SLOT(OK()));
connect(ui->cancel, SIGNAL(clicked()), this, SLOT(Cancel()));
connect(ui->lookFile, SIGNAL(clicked()), this, SLOT(OpenFile()));
connect(ui->lookPath, SIGNAL(clicked()), this, SLOT(OpenPath()));
}
RtspDialog::~RtspDialog()
{
delete ui;
}
void RtspDialog::OK()
{
//[c-zC-Z]:(/\\w+)*([/]|[.][sdp]+)?"), [c-zC-Z]:(/\\w+)*/
QRegExp sdpFileExp(QString("*"), Qt::CaseInsensitive);
QRegExp recordDirExp(QString("*"),Qt::CaseInsensitive);
// if (sdpFileExp.exactMatch(ui->filePath->text()) && recordDirExp.exactMatch(ui->recordPath->text()))
{
QString text = ui->filePath->text();
QString record_text = ui->recordPath->text();
QString current_text = ui->format->currentText();
emit fileComplete(text, record_text, current_text);
this->close();
}
// else
// {
// QMessageBox::warning(this, "Invalid Input", "<p>Example:</p> \
// <p>SdpFile:</p> \
// <p><font color=RED>D:/UserName/test.sdp</font></p> \
// <p>RecordPath:</p> \
// <p><font color=RED>D:/output/ </font></p> \
// ");
// }
}
void RtspDialog::Cancel()
{
this->close();
}
void RtspDialog::OpenFile()
{
QString file = QFileDialog::getOpenFileName(this, tr("Open File"), "D:\\", tr("SDP File (*.sdp)"));
ui->filePath->setText(file);
}
void RtspDialog::OpenPath()
{
QString path = QFileDialog::getExistingDirectory(this, tr("Select Directory"), "D:\\");
path += QString("/");
ui->recordPath->setText(path);
}