📄 lxddvcardinitdialog.cc
字号:
// ****************************************************************************// // LxBank - home-banking for Linux using the HBCI standard// // Author: Franz Zimmermann 83043 Bad Aibling// // Copyright (C) 2002-2003 Franz Zimmermann - arafang@users.sourceforge.net// // This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.// // This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU General Public License for more details.// // You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.// // ***************************************************************************//// ***************************************************************************// /*! \file \brief LxDDVcardInitDialog: Account selection dialog for LxBank*/ // ***************************************************************************//// $Name: $//// $State: Exp $//// $Log: LxDDVcardInitDialog.cc,v $// Revision 1.4 2003/03/17 23:14:11 arafang// Create the lxbank home directory (~/.LxBank) if it does not exists.//// Revision 1.3 2003/02/20 02:38:03 arafang// Default args in some constructor implementions removed.//// Revision 1.2 2003/02/08 15:25:21 franz// Mail address changed.//// Revision 1.1 2003/01/02 15:04:45 franz// Started to use the openHBCI lib.////#ifdef HAVE_CONFIG_H#include <config.h>#endif#include "LxDDVcardInitDialog.h"#include <qstring.h>#include <qlabel.h>#include <qlineedit.h> #include <qpushbutton.h>#include <qlayout.h>#include <qgroupbox.h>LxDDVcardInitDialog::LxDDVcardInitDialog(LxInstituteContextData &oldData, LxInstituteContextData &newData, QWidget *parent, const char *name, bool modal, WFlags f) : QDialog( parent, name, modal, f ), oldContextData(oldData), newContextData(newData){ QString oldSType, newSType; const HBCICard::instituteData &oldInstData = oldContextData.instData(); const HBCICard::instituteData &newInstData = newContextData.instData(); setCaption (tr("DDV-Card Initiation")); vBox = new QVBoxLayout( this, 3, 5); dataBox = new QGroupBox( 3, Qt::Horizontal, tr("Institute and User Data"), this); vBox->addWidget( dataBox, 10 ); dataBox->addSpace(0); captionOld = new QLabel (tr("Data currently on card:"), dataBox); captionOld->setMinimumWidth ( 180 ); captionNew = new QLabel (tr("Data to write to card:"), dataBox); captionNew->setMinimumWidth ( 180 ); // code (BLZ) setupDataRow (code, "Code (BLZ):", oldCode, oldInstData.code().c_str(), newCode, newInstData.code().c_str(), dataBox); // service typ switch (oldInstData.service()){ case 1: oldSType = "CEPT"; break; case 2: oldSType = "TCP"; break; default: oldSType = "unknown"; } switch (newInstData.service()){ case 1: newSType = "CEPT"; break; case 2: newSType = "TCP"; break; default: newSType = "unknown"; } setupDataRow (serviceTyp, "Service Typ", oldServiceTyp, oldSType, newServiceTyp, newSType, dataBox); // server address setupDataRow (server, "Server:", oldServer, oldInstData.address().c_str(), newServer, newInstData.address().c_str(), dataBox); // Internet address suffix setupDataRow (serverSuffix, "Address Suffix", oldServerSuffix, oldInstData.addressSuffix().c_str(), newServerSuffix, newInstData.addressSuffix().c_str(), dataBox); // short name setupDataRow (shortName, "Short Name:", oldShortName, oldInstData.name().c_str(), newShortName, newInstData.name().c_str(), dataBox); // country setupDataRow (country, "Country:", oldCountry, QString::number(oldInstData.country()), newCountry, QString::number(newInstData.country()), dataBox); // user-id setupDataRow (userId, "User Id:", oldUserId, oldInstData.user().c_str(), newUserId, newInstData.user().c_str(), dataBox); hBox = new QHBoxLayout(vBox, 3); hBox->addStretch ( 10 ); okButton = new QPushButton(tr("OK"), this); okButton->setDefault(TRUE); hBox->addWidget ( okButton, 0 ); hBox->addStretch ( 10 ); connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); cancelButton = new QPushButton(tr("Cancel"), this); hBox->addWidget ( cancelButton, 0 ); hBox->addStretch ( 10 ); connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );}void LxDDVcardInitDialog::setupDataRow (QLabel *lab, QString labelStr, QLabel *oldDat, QString oldDatStr, QLineEdit *newDat, QString newDatStr, QWidget *parent){ lab = new QLabel(tr(labelStr), parent); oldDat = new QLabel(tr(oldDatStr), parent); oldDat->setFrameStyle ( QFrame::Panel | QFrame::Sunken ); oldDat->setBackgroundMode( PaletteBase ); newDat = new QLineEdit(tr(newDatStr), parent); newDat->setReadOnly (TRUE);}LxDDVcardDataDialog::LxDDVcardDataDialog(LxInstituteContextData &newData, QWidget *parent, const char *name, bool modal, WFlags f) : QDialog( parent, name, modal, f ), newContextData(newData){ QString newSType; const HBCICard::instituteData &newInstData = newContextData.instData(); setCaption (QWidget::tr("DDV-Card Data")); vBox = new QVBoxLayout( this, 3, 5); dataBox = new QGroupBox( 2, Qt::Horizontal, tr("Institute and User Data"), this); vBox->addWidget( dataBox, 10 ); dataBox->addSpace(0); captionNew = new QLabel (tr("Data on card:"), dataBox); captionNew->setMinimumWidth ( 180 ); // code (BLZ) setupDataRow (code, "Code (BLZ):", newCode, newInstData.code().c_str(), dataBox); // service typ switch (newInstData.service()){ case 1: newSType = "CEPT"; break; case 2: newSType = "TCP"; break; default: newSType = "unknown"; } setupDataRow (serviceTyp, "Service Typ", newServiceTyp, newSType, dataBox); // server address setupDataRow (server, "Server:", newServer, newInstData.address().c_str(), dataBox); // Internet address suffix setupDataRow (serverSuffix, "Address Suffix", newServerSuffix, newInstData.addressSuffix().c_str(), dataBox); // short name setupDataRow (shortName, "Short Name:", newShortName, newInstData.name().c_str(), dataBox); // country setupDataRow (country, "Country:", newCountry, QString::number(newInstData.country()), dataBox); // user-id setupDataRow (userId, "User Id:", newUserId, newInstData.user().c_str(), dataBox); hBox = new QHBoxLayout(vBox, 3); hBox->addStretch ( 10 ); dismissButton = new QPushButton(tr("Dismiss"), this); dismissButton->setDefault(TRUE); hBox->addWidget ( dismissButton, 0 ); hBox->addStretch ( 10 ); connect( dismissButton, SIGNAL( clicked() ), this, SLOT( accept() ) );}void LxDDVcardDataDialog::setupDataRow (QLabel *lab, QString labelStr, QLabel *newDat, QString newDatStr, QWidget *parent){ lab = new QLabel(tr(labelStr), parent); newDat = new QLabel(tr(newDatStr), parent); newDat->setFrameStyle ( QFrame::Panel | QFrame::Sunken ); newDat->setBackgroundMode( PaletteBase );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -