Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

358 enhancement information needed to register ultrascan #134

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 14 additions & 57 deletions gui/us_license.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ US_License::US_License( QWidget* parent, Qt::WindowFlags flags )

// Banner
QLabel* banner = us_banner(
tr( "UltraScan III Registration\nPlease enter all fields" ) );
tr( "Please enter all fields" ) );

banner->setGeometry(
QRect( xpos, ypos, width, spacing + 2 * rowHeight ) );
QRect( xpos, ypos, width, spacing + rowHeight ) );

// Row 1 - Name
ypos += rowHeight * 3 + spacing;
ypos += rowHeight + 2 * spacing;

QLabel* firstname = us_label( tr( "Name (first, last):" ), 0, QFont::Bold );
firstname->setGeometry( xpos, ypos, buttonw, rowHeight );
Expand Down Expand Up @@ -85,20 +85,6 @@ US_License::US_License( QWidget* parent, Qt::WindowFlags flags )
connect( le_institution, SIGNAL( textChanged ( const QString& ) ),
SLOT ( update_institution( const QString& ) ) );

// Row 4 - Address
xpos = spacing;
ypos += rowHeight + spacing;

QLabel* address = us_label( tr( "Address:" ), 0, QFont::Bold );
address->setGeometry( xpos, ypos, buttonw, rowHeight );

xpos += buttonw + spacing;

le_address = us_lineedit( "" );
le_address->setGeometry( xpos, ypos, full_buttonw, rowHeight );
connect( le_address, SIGNAL( textChanged ( const QString& ) ),
SLOT ( update_address( const QString& ) ) );

// Row 5 - City/State/Zip
xpos = spacing;
ypos += rowHeight + spacing;
Expand Down Expand Up @@ -139,31 +125,12 @@ US_License::US_License( QWidget* parent, Qt::WindowFlags flags )

xpos += mediumColumn + spacing + 10; // Adjust

QLabel* zip = us_label( tr( "Zip:" ), 0, QFont::Bold );
zip->setGeometry( xpos, ypos, smallColumn, rowHeight );

xpos += smallColumn + spacing;

le_zip = us_lineedit( "" );
le_zip->setGeometry( xpos, ypos, mediumColumn, rowHeight );
connect( le_zip, SIGNAL( textChanged( const QString& ) ),
SLOT ( update_zip ( const QString& ) ) );

// Row 6 - Phone/License Type/Version
xpos = spacing;
ypos += rowHeight + spacing;
//xpos = spacing;
// ypos += rowHeight + spacing;

QLabel* phone = us_label( tr( "Phone Number:" ), 0, QFont::Bold );
phone->setGeometry( xpos, ypos, buttonw, rowHeight );

xpos += spacing + buttonw;
// xpos += spacing + buttonw;

le_phone = us_lineedit( "" );;
le_phone->setGeometry( xpos, ypos, buttonw, rowHeight );
connect( le_phone, SIGNAL( textChanged ( const QString& ) ),
SLOT ( update_phone( const QString& ) ) );

xpos += buttonw + spacing;
// xpos += buttonw + spacing;

QLabel* lb_licensetype = us_label( tr( "License:" ), 0, QFont::Bold );
lb_licensetype->setGeometry( xpos, ypos, smallColumn, rowHeight );
Expand All @@ -179,13 +146,8 @@ US_License::US_License( QWidget* parent, Qt::WindowFlags flags )
connect( cbb_licensetype, SIGNAL( currentIndexChanged( const QString& ) ),
SLOT ( update_licensetype ( const QString& ) ) );

xpos += mediumColumn + spacing + 10; // Adjust

lbl_version = us_label( tr( "Version:" ), 0, QFont::Bold );
lbl_version->setGeometry( xpos, ypos, smallColumn, rowHeight );

xpos = spacing;
ypos += 2 * rowHeight + spacing;
ypos += rowHeight + spacing;

QLabel* status = us_banner( tr( "License Status" ) );
status->setGeometry( QRect( xpos, ypos, width, spacing + rowHeight ) );
Expand All @@ -211,7 +173,7 @@ US_License::US_License( QWidget* parent, Qt::WindowFlags flags )

// Row 8 - Expiration
xpos = spacing;
ypos += rowHeight + 2 * spacing;
ypos += rowHeight + spacing;

lbl_expiration = us_label( "Expiration:", 0, QFont::Bold );
lbl_expiration->setGeometry( xpos, ypos, buttonw, rowHeight );
Expand All @@ -225,7 +187,7 @@ US_License::US_License( QWidget* parent, Qt::WindowFlags flags )

// Row 9 - Version
xpos = spacing;
ypos += rowHeight + 2 * spacing;
ypos += rowHeight + spacing;

lbl_valid = us_label( "UltraScan III Version:", 0, QFont::Bold );
lbl_valid->setGeometry( xpos, ypos, buttonw, rowHeight );
Expand Down Expand Up @@ -313,11 +275,11 @@ void US_License::load_current( void )
lastname = "";
firstname = "";
institution = "";
address = "";
address = "n/a";
city = "";
state = "NON-US";
zip = "";
phone = "";
zip = "n/a";
phone = "n/a";
email = "";
version = US_Version; // us_defines.h
validation = "";
Expand Down Expand Up @@ -358,10 +320,7 @@ void US_License::update_screen( void )
le_firstname ->setText( firstname );
le_lastname ->setText( lastname );
le_institution ->setText( institution );
le_address ->setText( address );
le_city ->setText( city );
le_zip ->setText( zip );
le_phone ->setText( phone );
le_email ->setText( email );

le_platform ->setText( platform + " / " + os );
Expand Down Expand Up @@ -431,10 +390,8 @@ void US_License::update( void )
if ( firstname == "" ||
lastname == "" ||
institution == "" ||
address == "" ||
state == "" ||
zip == "" ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be removed too?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it can stay, because we init the zip code to be n/a. But the same is true for the address. So for consistency...

phone == "" ||
email == "" )
{
QMessageBox::information ( this,
Expand Down Expand Up @@ -493,7 +450,7 @@ void US_License::update( void )
+ "&licensetype=" + licensetype;
//qDebug() << "requesting update";
// Send request
QString url = "https://ultrascan.aucsolutions.com/update-license.php";
QString url = "https://ultrascan.aucsolutions.com/update-license-new.php";
US_HttpPost* transmit = new US_HttpPost( url, req );
connect( transmit, SIGNAL( US_Http_post_response( const QString& ) ),
this, SLOT ( update_response ( const QString& ) ) );
Expand Down
6 changes: 0 additions & 6 deletions gui/us_license.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@ class US_GUI_EXTERN US_License : public US_Widgets
QLineEdit* le_firstname;
QLineEdit* le_lastname;
QLineEdit* le_institution;
QLineEdit* le_address;
QLineEdit* le_city;
QLineEdit* le_zip;
QLineEdit* le_phone;
QLineEdit* le_email;
QLineEdit* le_platform;
QLineEdit* le_expiration;
Expand Down Expand Up @@ -114,11 +111,8 @@ class US_GUI_EXTERN US_License : public US_Widgets
void update_firstname ( const QString& s ){ firstname = trim( s ); };
void update_lastname ( const QString& s ){ lastname = trim( s ); };
void update_institution( const QString& s ){ institution = trim( s ); };
void update_address ( const QString& s ){ address = trim( s ); };
void update_city ( const QString& s ){ city = trim( s ); };
void update_state ( const QString& s ){ state = trim( s ); };
void update_zip ( const QString& s ){ zip = trim( s ); };
void update_phone ( const QString& s ){ phone = trim( s ); };
void update_email ( const QString& s ){ email = trim( s ); };
void update_licensetype( const QString& s ){ licensetype = trim( s ); };
};
Expand Down