24 #include <qapplication.h>
26 #include <qtextcodec.h>
27 #include <qtranslator.h>
29 #include <qtextstream.h>
30 #include <qmessagebox.h>
44 QFile file(QDir::homeDirPath()+QDir::convertSeparators (
"/.qucs/filterrc"));
45 if(!file.open(IO_ReadOnly))
48 QTextStream stream(&file);
49 QString
Line, Setting;
50 while(!stream.atEnd()) {
51 Line = stream.readLine();
52 Setting = Line.section(
'=',0,0);
53 Line = Line.section(
'=',1,1);
54 if(Setting ==
"FilterWindow") {
63 file.setName(QDir::homeDirPath()+QDir::convertSeparators (
"/.qucs/qucsrc"));
64 if(!file.open(IO_ReadOnly))
67 QTextStream stream(&file);
68 QString
Line, Setting;
69 while(!stream.atEnd()) {
70 Line = stream.readLine();
71 Setting = Line.section(
'=',0,0);
72 Line = Line.section(
'=',1,1).stripWhiteSpace();
75 else if(Setting ==
"Language")
92 QFile file(QDir::homeDirPath()+QDir::convertSeparators (
"/.qucs/filterrc"));
93 if(!file.open(IO_WriteOnly)) {
94 QMessageBox::warning(0, QObject::tr(
"Warning"),
95 QObject::tr(
"Cannot save settings !"));
100 QTextStream stream(&file);
102 stream <<
"Settings file, Qucs Filter " PACKAGE_VERSION
"\n"
103 <<
"FilterWindow=" << qucs->x() <<
',' << qucs->y() <<
'\n';
116 int main(
int argc,
char *argv[])
124 char * var = getenv (
"QUCSDIR");
126 QDir QucsDir = QDir (var);
127 QString QucsDirStr = QucsDir.canonicalPath ();
129 QDir::convertSeparators (QucsDirStr +
"/share/qucs/bitmaps/");
131 QDir::convertSeparators (QucsDirStr +
"/share/qucs/lang/");
139 QApplication a(argc, argv);
142 QTranslator tor( 0 );
145 lang = QTextCodec::locale();
147 a.installTranslator( &tor );
150 a.setMainWidget(qucs);
153 int result = a.exec();