void LoginDialog::readyRead() { qDebug()<<"readyRead"; // QDataStream in(socket); // if (socket->bytesAvailable()<(int)sizeof(quint16)){ // qDebug()<<"bytes available < quint16"; // return; // } // quint16 blockSize; // in>>blockSize; // qDebug()<<"Block size"<<blockSize; // quint8 command; // in>>command; // qDebug()<<"Command"<< command; QString result; switch(Connection::readMessage(socket, result)){ case Connection::AUTH_SECCESSFULL: UserWindow *userswindow = new UserWindow(socket); this->hide(); disconnect(socket, SIGNAL(readyRead()),this, SLOT(readyRead())); disconnect(socket, SIGNAL(connected()), this, SLOT(connected())); disconnect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onConnectionError(QAbstractSocket::SocketError))); disconnect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this , SLOT(onStateChanged(QAbstractSocket::SocketState))); userswindow->show(); break; } }
SharedUserWindow Win32UIBinding::CreateWindow( WindowConfig* config, SharedUserWindow& parent) { UserWindow* w = new Win32UserWindow(this, config, parent); return w->GetSharedPtr(); }
virtual DWORD ThreadMain() { return w.run( 0, (HINSTANCE)mParam, ::LoadIcon(NULL, IDI_APPLICATION), ::LoadIcon(NULL, IDI_APPLICATION), ::LoadCursor(NULL, IDC_ARROW), NULL, NULL, "Satorite_Clipboard_Viewer", 0, "Satorite_Clipboard_Viewer", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, SW_HIDE, NULL); }
void MainWindow::checkForPasswordFile() { QString fileInput = "password.txt"; QString hidden = ".password.txt"; QList<QString> asList; QFile file(fileInput); if (!file.exists() && !QFile(hidden).exists()) { UserWindow * newUser = new UserWindow(0, false); connect(newUser, SIGNAL(createAccount(QString,QString)), this, SLOT(makeAccount(QString,QString))); newUser->show(); }//first run, or file cannot be found. else if (!file.exists() && QFile(hidden).exists()) { QFile file2(hidden); file2.copy(fileInput); /** Load the password into memory. **/ if (!file2.open(QIODevice::ReadOnly)) { QMessageBox::critical(this, tr("Error"), tr("Could not open file")); return; }//end if QTextStream in(&file2); while (!in.atEnd()) { asList.push_back(in.readLine()); }//iterate through the file. All of it. Store. if (asList.size() > 0) { QString current = asList.at(0); int index1 = current.indexOf("User:"******"password: "******"") { /** Load the password into memory. **/ if (!file.open(QIODevice::ReadOnly)) { QMessageBox::critical(this, tr("Error"), tr("Could not open file")); return; }//end if QTextStream in(&file); while (!in.atEnd()) { asList.push_back(in.readLine()); }//iterate through the file. All of it. Store. if (asList.size() > 0) { QString current = asList.at(0); int index1 = current.indexOf("User:"******"password: " current.remove(0, 10); m_password = current; }//end if countCash(); displayInfo(); }//open last save. }