File: main.cpp

package info (click to toggle)
sdrangelove 0.0.1.20140824-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,560 kB
  • ctags: 2,668
  • sloc: cpp: 17,760; ansic: 142; makefile: 17; sh: 1
file content (101 lines) | stat: -rw-r--r-- 3,683 bytes parent folder | download | duplicates (2)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
// written by Christian Daniel                                                   //
//                                                                               //
// 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 as version 3 of the License, or                  //
//                                                                               //
// 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 V3 for more details.                               //
//                                                                               //
// You should have received a copy of the GNU General Public License             //
// along with this program. If not, see <http://www.gnu.org/licenses/>.          //
///////////////////////////////////////////////////////////////////////////////////

#include <QApplication>
#include <QTextCodec>
#include <QProxyStyle>
#include <QStyleFactory>
#include <QFontDatabase>
#include "mainwindow.h"

static int runQtApplication(int argc, char* argv[])
{
	QApplication a(argc, argv);
/*
	QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
	QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
*/
	QCoreApplication::setOrganizationName("osmocom");
	QCoreApplication::setApplicationName("SDRangelove");

#if 1
	qApp->setStyle(QStyleFactory::create("fusion"));

	QPalette palette;
	palette.setColor(QPalette::Window, QColor(53,53,53));
	palette.setColor(QPalette::WindowText, Qt::white);
	palette.setColor(QPalette::Base, QColor(25,25,25));
	palette.setColor(QPalette::AlternateBase, QColor(53,53,53));
	palette.setColor(QPalette::ToolTipBase, Qt::white);
	palette.setColor(QPalette::ToolTipText, Qt::black);
	palette.setColor(QPalette::Text, Qt::white);
	palette.setColor(QPalette::Button, QColor(0x40, 0x40, 0x40));
	palette.setColor(QPalette::ButtonText, Qt::white);
	palette.setColor(QPalette::BrightText, Qt::red);

	palette.setColor(QPalette::Light, QColor(53,53,53).lighter(125).lighter());
	palette.setColor(QPalette::Mid, QColor(53,53,53).lighter(125));
	palette.setColor(QPalette::Dark, QColor(53,53,53).lighter(125).darker());

	palette.setColor(QPalette::Link, QColor(0,0xa0,0xa0));
	palette.setColor(QPalette::LinkVisited, QColor(0,0xa0,0xa0).lighter());
	palette.setColor(QPalette::Highlight, QColor(0xff, 0x8c, 0x00));
	palette.setColor(QPalette::HighlightedText, Qt::black);
	qApp->setPalette(palette);

#if 0
	if(QFontDatabase::addApplicationFont("/tmp/Cuprum.otf") >= 0) {
		QFont font("CuprumFFU");
		font.setPointSize(10);
		qApp->setFont(font);
	}
#endif
#if 0
	if(QFontDatabase::addApplicationFont("/tmp/PTN57F.ttf") >= 0) {
		QFont font("PT Sans Narrow");
		font.setPointSize(10);
		qApp->setFont(font);
	}
#endif
#if 0
	if(QFontDatabase::addApplicationFont("/tmp/PTS55F.ttf") >= 0) {
		QFont font("PT Sans");
		font.setPointSize(10);
		qApp->setFont(font);
	}
#endif
#if 0
	{
		QFont font("Ubuntu Condensed");
		font.setPointSize(10);
		qApp->setFont(font);
	}
#endif

#endif
	MainWindow w;
	w.show();

	return a.exec();
}

int main(int argc, char* argv[])
{
	int res = runQtApplication(argc, argv);
	qDebug("regular program exit");
	return res;
}