Source
18
18
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19
19
//#
20
20
//# Correspondence concerning AIPS++ should be addressed as follows:
21
21
//# Internet email: aips2-request@nrao.edu.
22
22
//# Postal address: AIPS++ Project Office
23
23
//# National Radio Astronomy Observatory
24
24
//# 520 Edgemont Road
25
25
//# Charlottesville, VA 22903-2475 USA
26
26
//#
27
27
//# $Id$
28
+
#if ! defined(WITHOUT_DBUS)
28
29
#include <display/QtViewer/QtDBusViewerAdaptor.qo.h>
30
+
#endif
29
31
#include <display/QtViewer/QtViewer.qo.h>
30
32
#include <display/QtViewer/QtDisplayPanelGui.qo.h>
31
33
#include <display/QtViewer/QtCleanPanelGui.qo.h>
32
34
#include <display/QtViewer/QtCleanPanelGui2.qo.h>
33
35
34
36
35
37
extern int qInitResources_QtViewer();
36
38
37
39
using namespace casacore;
38
40
namespace casa { //# NAMESPACE CASA - BEGIN
39
41
40
42
41
43
QString QtViewer::name_;
42
44
43
45
const QString &QtViewer::name( ) {
44
46
return name_;
45
47
}
46
48
47
49
QtViewer::QtViewer( const std::list<std::string> &args, bool is_server, const char *dbus_name ) :
48
-
QtViewerBase(is_server), dbus_(NULL), args_(args), is_server_(is_server) {
50
+
QtViewerBase(is_server),
51
+
#if ! defined(WITHOUT_DBUS)
52
+
dbus_(NULL),
53
+
#endif
54
+
args_(args), is_server_(is_server) {
49
55
50
56
name_ = (is_server_ ? "view_server" : "viewer");
51
57
dbus_name_ = (dbus_name ? dbus_name : 0);
52
58
53
59
qInitResources_QtViewer();
54
60
// Makes QtViewer icons, etc. available via Qt resource system.
55
61
//
56
62
// You would normally use this macro for the purpose instead:
57
63
//
58
64
// Q_INIT_RESOURCE(QtViewer);
59
65
//
60
66
// It translates as:
61
67
//
62
68
// extern int qInitResources_QtViewer();
63
69
// qInitResources_QtViewer();
64
70
//
65
71
// It doesn't work here because it makes the linker looks for
66
72
// casa::qInitResources_QtViewer() :-) dk
67
73
68
74
if ( is_server_ ) {
75
+
#if ! defined(WITHOUT_DBUS)
69
76
dbus_ = new QtDBusViewerAdaptor(this);
70
77
dbus_->connectToDBus(dbus_name_);
71
78
} else {
72
79
dbus_ = 0;
80
+
#else
81
+
fprintf( stderr, "CONNECTION TO DBUS WOULD HAPPEN HERE\n" );
82
+
fflush( stderr );
83
+
#endif
73
84
}
74
85
}
75
86
76
87
77
88
QtViewer::~QtViewer() {
78
89
// wonder if we need to delete dbus adaptor...
79
90
}
80
91
81
92
QtDisplayPanelGui *QtViewer::createDPG() {
82
93
// Create a main display panel Gui.