-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.cpp
More file actions
executable file
·76 lines (70 loc) · 2.23 KB
/
Copy pathconfig.cpp
File metadata and controls
executable file
·76 lines (70 loc) · 2.23 KB
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
#include "config.h"
#include <QApplication>
#include <QDesktopWidget>
#include <QNetworkInterface>
#include <QStringList>
#include <QDateTime>
int config::fullScrWidth;
int config::fullScrHeight;
int config::firstScreenWidth;
int config::firstScreenHeight;
bool config::shortcutEnabled;
bool config::winAboutVisible;
bool config::winHistoryVisible;
bool config::winSettingsVisible;
QHash<int, QPixmap> config::capturedQPixes;
QHash<int, QPixmap> config::capturedBackQPix;
QStringList config::filesForUpload;
bool config::_doLog;
config::config(QObject *parent) : QObject(parent){
winHistoryVisible = false;
winSettingsVisible = false;
winAboutVisible = false;
setScreenFullWidhtHeight();
}
void config::setScreenFullWidhtHeight(){
int scrNum = QApplication::desktop()->screenCount();
int fsw, fsh, ffsw, ffsh;
QRect scrGeo;
QList<QRect> rects;
for (int i=0; i < scrNum; i++){
scrGeo = QApplication::desktop()->screenGeometry(i);
if( scrGeo.left() == 0 ){
rects.prepend(scrGeo);
} else {
rects << scrGeo;
}
}
foreach( QRect qrc, rects){
if( qrc.top() == 0 ){
fsw = fsw + qrc.width();
fsh = qrc.height();
}else{
fsw = qrc.width();
fsh = fsh + qrc.height();
}
ffsw = qrc.width();
ffsh = qrc.height();
}
fsw = QApplication::desktop()->size().width();
fsh = QApplication::desktop()->size().height();
setFSWidth(fsw);
setFSHeight(fsh);
setFFSWidth(ffsw);
setFFSHeight(ffsh);
}
QString config::getMacAddress(){
foreach( QNetworkInterface interface, QNetworkInterface::allInterfaces() ) {
// Return only the first non-loopback MAC Address
if (!(interface.flags() & QNetworkInterface::IsLoopBack))
return interface.hardwareAddress();
}
return QString();
}
QString config::getCryptedWithPath(){
QDateTime tt2 = QDateTime::currentDateTime();
QString newName = getMacAddress() + QString::number( tt2.toMSecsSinceEpoch() );
newName = getCryptedName( newName );
newName = getWPath() + "/" + newName + "." + imageFormat;
return newName;
}