forked from OpenDDS/OpenDDS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRepoSelect.cpp
More file actions
63 lines (52 loc) · 1.18 KB
/
Copy pathRepoSelect.cpp
File metadata and controls
63 lines (52 loc) · 1.18 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
/*
*
*
* Distributed under the OpenDDS License.
* See: http://www.opendds.org/license.html
*/
// Tell GCC to ignore implicitly declared copy methods as long as
// Qt is not compliant.
#ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
#include <QtGui/QtGui>
#include <QtWidgets/QFileDialog>
#ifdef __GNUC__
# pragma GCC diagnostic pop
#endif
#include "RepoSelect.h"
namespace Monitor {
RepoSelect::RepoSelect( QWidget* parent)
: QDialog( parent)
{
ui.setupUi( this);
connect( ui.fileButton, SIGNAL(clicked()), this, SLOT(fileIOR()));
}
QString
RepoSelect::getRepoIOR( QWidget* parent, bool* status)
{
RepoSelect dialog( parent);
switch( dialog.exec()) {
case Accepted:
dialog.ior_ = dialog.ui.iorLineEdit->displayText();
*status = true;
break;
case Rejected:
default:
*status = false;
break;
}
return dialog.ior_;
}
void
RepoSelect::fileIOR()
{
QString fileName = QFileDialog::getOpenFileName( this);
if( !fileName.isEmpty()) {
QString fileIor( "file://");
fileIor.append( fileName);
this->ui.iorLineEdit->setText( fileIor);
}
}
} // End of namespace Monitor