forked from WorldsOfBabylon/ISIS-Messanger
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
41 lines (34 loc) · 1.13 KB
/
main.cpp
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
#include "mainwindow.h"
#include"startsettings.h"
#include"enterwidget.h"
#include"config.h"
#include <QApplication>
#include<QCoreApplication>
#include<QDir>
#include<QDebug>
#include<QFile>
#include<QFileInfo>
#include"aes.h"
char * PassOfGuy;
char * UsernameOfGuy;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
StartSettings settings;
enterWidget enter;
QFileInfo finfo(QCoreApplication::applicationFilePath());
std::string pathF = finfo.absoluteDir().currentPath().toStdString() + "/" + CONFIG_PATH + "/config.ini";
qDebug() << pathF.c_str();
QFile Config( pathF.c_str() );
if( ! Config.open( QIODevice::ReadOnly | QIODevice::Text ) ){
settings.show();
QObject::connect(&settings, SIGNAL(Registered(bool)), &w, SLOT(setActiv(void)));
}else{
enter.show();
QObject::connect(&enter, SIGNAL(PassCorrect()), &w, SLOT(setActiv(void)));
QObject::connect(&enter, SIGNAL(NewAccount()), &settings, SLOT(setActiv(void)));
QObject::connect(&settings, SIGNAL(Registered(bool)), &w, SLOT(setActiv(void)));
}
return a.exec();
}