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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
#include "form1.h"
#include "ui_form1.h"
#include <QSystemTrayIcon>
#include "QMenu"
#include "QMessageBox"
#include "crp.h"
#include "opt.h"
#include "blr.h"
#include "drp.h"
#include "quit.h"
#include "QTimer"
#include "QSettings"
#include "QString"
#include "QStringList"
Form1::Form1(QWidget *parent) :
QWidget(parent),
ui(new Ui::Form1)
{
ui->setupUi(this);
notifyIcon = new QSystemTrayIcon(this);
notifyIcon->setIcon(QIcon("usb.png"));
notifyIcon->show();
notifyIcon->showMessage("Usb Protect", "Crée Par Kevin", QSystemTrayIcon::Information, 1500);
// Création du menu contextuel de notre icône
QMenu* stmenu = new QMenu(this);
QAction* actTexte1 = new QAction("Cryptage",this);
QAction* actTexte2 = new QAction("Démarrer Protection",this);
QAction* actTexte3 = new QAction("Arreter Protection",this);
QAction* actTexte4 = new QAction("Options",this);
QAction* actTexte5 = new QAction("Décrypté Lecteur",this);
QAction* actTexte6 = new QAction("Quitter",this);
stmenu->addAction(actTexte1);
stmenu->addAction(actTexte2);
stmenu->addAction(actTexte3);
stmenu->addAction(actTexte4);
stmenu->addAction(actTexte5);
stmenu->addAction(actTexte6);
notifyIcon->setContextMenu(stmenu); // On assigne le menu contextuel à l'icône de notification
//on connecter les Signaux
QObject::connect(actTexte1, SIGNAL(triggered()), this, SLOT(CRYPTER()));
QObject::connect(actTexte2, SIGNAL(triggered()), this, SLOT(START()));
QObject::connect(actTexte3, SIGNAL(triggered()), this, SLOT(STOP()));
QObject::connect(actTexte4, SIGNAL(triggered()), this, SLOT(Options()));
QObject::connect(actTexte5, SIGNAL(triggered()), this, SLOT(decrypt()));
QObject::connect(actTexte6, SIGNAL(triggered()), this, SLOT(quit()));
}
Form1::~Form1()
{
delete ui;
}
void Form1::CRYPTER()
{
CRP *crp = new CRP;
crp->show();
}
void Form1::START()
{
BLR *blr = new BLR;
blr->setWindowState(Qt::WindowFullScreen);
blr->setWindowFlags(Qt::Dialog|Qt::FramelessWindowHint);
blr->show();
}
void Form1::MySlot()
{
QMessageBox::information(this,"timer","timeout");
}
void Form1::STOP()
{
}
void Form1::Options()
{
OPT *opt = new OPT;
opt->show();
}
void Form1::decrypt()
{
DRP *drp = new DRP;
drp->show();
}
void Form1::quit()
{
QUIT *quit = new QUIT;
quit->show();
} |
Partager