Newer
Older
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
76
77
78
79
80
/***************************************************************************
* Copyright (C) 2007 by Claudio Scafuri, Giacomo Strangolino *
* claudio@hyo *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <TApplication>
#include <TSplashScreen>
// #include <EStyleLoader> /* see comment below */
//
#define CVSVERSION "$Name: $"
#include "tdklambda-genesis.h"
#include <tutil.h> /* N.B.: prima degli include di X11 */
#include <X11/Xlib.h>
#include <QX11Info>
#include <elettracolors.h>
int main( int argc, char ** argv ) {
const char *cvs_version = CVSVERSION;
TApplication a( argc, argv );
/* uncomment to set application color */
a.setPalette(EPalette("fermi"));
a.setApplicationVersion(CVSVERSION);
a.setApplicationName("PowerSupplyTDKLambda");
a.setProperty("author", "Giacomo");
a.setProperty("mail", "giacomo.strangolino@elettra.trieste.it");
a.setProperty("phone", "375-8073");
a.setProperty("office", "T2PT025");
a.setProperty("hwReferent", "Stefano C."); /* name of the referent that provides the device server */
/* load the style sheet for QTango application.
* The file is read from the "${INSTALL_ROOT}/share/qtango/stylesheets/qtango.css"
* file. You can load a custom stylesheet by exporting the environment variable
* "QTANGO_STYLESHEET" and setting it to a different path.
* Moreover, you can construct EStyleLoader with a file name as argument, to ignore
* the installed "${INSTALL_ROOT}/share/qtango/stylesheets/qtango.css" and the value
* of the environment variable.
* This does not work as expected in Qt version 4.4.x. So the following two lines are
* commented. Uncomment them when upgrading to a newer Qt version.
*/
// EStyleLoader sLoader;
// a.setStyleSheet(sLoader.styleSheet());
/* splash screen */
TSplashScreen splash;
TUtil::instance()->setLoggingTarget(argv[0]);
TdkLG mw;
QString title("pstdklambda-genesis");
if (QApplication::arguments().size() > 1)
title = QApplication::arguments()[1].split('/').last(); /* solo il member */
mw.setWindowTitle(title);
mw.show();
/* hide splash screen */
splash.finish(&mw);
/* register to window manager */
Display *disp = QX11Info::display();
Window root_win = (Window) mw.winId();
XSetCommand(disp, root_win, argv, argc);
return a.exec();
}