Init
This commit is contained in:
68
main.cpp
Normal file
68
main.cpp
Normal file
@@ -0,0 +1,68 @@
|
||||
#include <QtGui/QApplication>
|
||||
#include "widget.h"
|
||||
|
||||
#include <qmessagebox.h>
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
|
||||
Widget w;
|
||||
QString str;
|
||||
|
||||
QFile f("c:/Shilka_exe/global.ini");
|
||||
int c=0;
|
||||
|
||||
|
||||
|
||||
if (f.open(QIODevice::ReadOnly |QIODevice::Text ))
|
||||
{
|
||||
while (!f.atEnd())
|
||||
{
|
||||
c++;
|
||||
str = QString(f.readLine());
|
||||
switch (c)
|
||||
{
|
||||
case 1:
|
||||
if (str.section('=', 1, 1).toInt())
|
||||
w.setWindowState(Qt::WindowFullScreen);
|
||||
break;
|
||||
case 2:
|
||||
// silentMode
|
||||
w.silentMode = str.section('=',1,1).toInt();
|
||||
break;
|
||||
case 3:
|
||||
// quickLoad
|
||||
w.quickLoad = str.section('=', 1, 1).toInt();
|
||||
|
||||
break;
|
||||
case 4:
|
||||
w.keybMaxDelay = str.section('=', 1, 1).toInt();
|
||||
if (w.keybMaxDelay<10) w.keybMaxDelay = 10;
|
||||
break;
|
||||
case 5:
|
||||
w.loadingShift = str.section('=',1,1).toInt();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
w.loadingShift=50;
|
||||
w.keybMaxDelay=20;
|
||||
// w.setWindowState(Qt::WindowFullScreen);
|
||||
w.quickLoad = true;
|
||||
w.silentMode = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user