From 6ac9b5f81ca16fb4f53a8f6b70ff2ed7a621fcef Mon Sep 17 00:00:00 2001 From: Robert Hemstedt Date: Sun, 2 Oct 2011 13:22:59 +0200 Subject: [PATCH] started implementing the ordering process. still closing the program if account is blocked does not work --- cuedussmann.cpp | 73 +++++++++++++++++++++++++++++++++++++++++++------ cuedussmann.h | 4 ++- cuedussmann.pro | 20 ++++++++++++-- dussmanbot.cpp | 60 +++++++++++++++++++++------------------- pwduidialog.cpp | 1 - 5 files changed, 117 insertions(+), 41 deletions(-) diff --git a/cuedussmann.cpp b/cuedussmann.cpp index 8dcd803..b536f0b 100644 --- a/cuedussmann.cpp +++ b/cuedussmann.cpp @@ -29,16 +29,37 @@ cuedussmann::cuedussmann(QWidget *parent) : int cuedussmann::initialize() { loadPWDUID(); - while(loginandcookie(uid, pwd)==0) + int log; + while((log=loginandcookie(uid, pwd))!=1) { - QMessageBox msg; - msg.setText("Falsche Nutzernummer/Passwort Kombination"); - msg.setWindowTitle("Fehler beim Login"); - msg.addButton("Benutzername und Passwort neu setzen",QMessageBox::AcceptRole); - int ret = msg.exec(); - if(ret==QMessageBox::AcceptRole) + if(log==0) { - cuedussmann::on_actionUID_PWD_ndern_triggered(); + QMessageBox msg; + msg.setText("Falsche Nutzernummer/Passwort Kombination"); + msg.setWindowTitle("Fehler beim Login"); + msg.addButton("Benutzername und Passwort neu setzen",QMessageBox::AcceptRole); + int ret = msg.exec(); + if(ret==QMessageBox::AcceptRole) + { + cuedussmann::on_actionUID_PWD_ndern_triggered(); + } + } + if(log==2) + { + QMessageBox msg; + msg.setText(QString("Der Account für die eingegebene Benutzernummer ist gesperrt. Tut mir sehr leid.")); + msg.setWindowTitle("Fehler beim Login"); + msg.setStandardButtons(QMessageBox::Abort); + msg.addButton("Anderen Account einstellen",QMessageBox::AcceptRole); + int ret = msg.exec(); + if(ret==QMessageBox::AcceptRole) + { + cuedussmann::on_actionUID_PWD_ndern_triggered(); + } + if(ret==QMessageBox::RejectRole) + { + QApplication::exit(0); + } } } if(initialized==0) @@ -73,6 +94,36 @@ int cuedussmann::initialize() } setcombobox(startwoche, startwoche+anzwoche-1); parsemenufile(0); + hidden=(char***)calloc(anzwoche,sizeof(char**)); + bergruen=(char***)calloc(anzwoche, sizeof(char**)); + bergruend=(char***)calloc(anzwoche,sizeof(char**)); + for(int i = 0 ; i < anzwoche; i++) + { + hidden[i]=(char**)calloc(35,sizeof(char*)); + bergruen[i]=(char**)calloc(35,sizeof(char*)); + bergruend[i]=(char**)calloc(35,sizeof(char*)); + + for(int k=0;k<35;k++) + { + hidden[i][k]=(char*)malloc(50); strcpy(hidden[i][k],"\0"); + bergruen[i][k]=(char*)malloc(50);strcpy(bergruen[i][k],"\0"); + bergruend[i][k]=(char*)malloc(50);strcpy(bergruend[i][k],"\0"); + } + } + wocheplustagplusdaten=(char****)calloc(anzwoche,sizeof(char***)); + for(int i=0;i