-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathcalcdialog.cpp
59 lines (45 loc) · 1.04 KB
/
calcdialog.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <stdio.h>
#include <stdlib.h>
#include <QDialog>
#include <QPushButton>
#include <QLabel>
#include <QVBoxLayout>
#include <QMessageBox>
#include "calcdialog.h"
#include "encrypt.h"
CalcDialog::CalcDialog(QWidget *parent) : QDialog(parent) {
setupUi(this);
setWindowFlags (windowFlags() & ~Qt::WindowContextHelpButtonHint);
imei->setFocus();
}
void CalcDialog::reverse() {
char imeibuf[30];
int i;
char c;
strcpy(imeibuf,imei->text().toLatin1());
for (i=0;i<7;i++) {
c=imeibuf[i];
imeibuf[i]=imeibuf[14-i];
imeibuf[14-i]=c;
}
imei->setText(imeibuf);
}
void CalcDialog::calc() {
char imeibuf[30];
char codebuf[30];
QMessageBox errBox;
strcpy(imeibuf,imei->text().toLatin1());
if (strlen(imeibuf) != 15) {
errBox.setText("Incorrect IMEI");
errBox.exec();
return;
}
encrypt_v1(imeibuf,codebuf,"e630upgrade");
flashcode->setText(codebuf);
encrypt_v1(imeibuf,codebuf,"hwe620datacard");
v1code->setText(codebuf);
calc2(imeibuf,codebuf);
v2code->setText(codebuf);
calc201(imeibuf,codebuf);
v201code->setText(codebuf);
}