-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFrmNewSource.cpp
More file actions
55 lines (46 loc) · 1.33 KB
/
FrmNewSource.cpp
File metadata and controls
55 lines (46 loc) · 1.33 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
/*
Written By Pradipna Nepal
www.pradsprojects.com
Copyright (C) 2013 Pradipna Nepal
Please read COPYING.txt included along with this source code for more detail.
If not included, see http://www.gnu.org/licenses/
*/
#include <QtGui>
#include <QFileDialog>
#include "FrmNewSource.h"
#include "ui_frmNewSource.h"
FrmNewSource::FrmNewSource(QWidget *parent) :
QDialog(parent),
ui(new Ui::FrmNewSource)
{
ui->setupUi(this);
connect(ui->btnOk, SIGNAL(clicked()), this, SLOT(ok()));
connect(ui->btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(ui->btnBrowse, SIGNAL(clicked()), this, SLOT(browse()));
}
FrmNewSource::~FrmNewSource()
{
delete ui;
}
QString FrmNewSource::getName() {
return name;
}
QString FrmNewSource::getSrcPath() {
return srcPath;
}
bool FrmNewSource::addExistingFile() {
return addExisting;
}
void FrmNewSource::ok() {
name = ui->txtSourceName->text();
srcPath = ui->txtSrcPath->text();
addExisting = ui->chkAddExisting->isChecked();
accept();
}
void FrmNewSource::browse() {
QString path = QFileDialog::getOpenFileName(this, "Add Existing Source", "", "despairSource(*.dsrc)");
if (path != "") {
ui->txtSrcPath->setText(path);
ui->chkAddExisting->setChecked(true);
}
}