00001 #include "sessiondlg.h" 00002 00003 SessionDlg::SessionDlg( Session &ses ) : 00004 mSession( ses ) { 00005 00006 QVBoxLayout *vboxl = new QVBoxLayout( this ); 00007 vboxl->setAutoAdd( true ); 00008 00009 QVBox *mainVB = new QVBox( this ); 00010 mainVB->setMargin( 8 ); 00011 QGrid *grid = NULL; 00012 QLabel *lbl = NULL; 00013 00014 00015 grid = new QGrid( 2, mainVB ); 00016 00017 // ADD SOURCE FIELD 00018 lbl = new QLabel( "RC ID: ", grid ); 00019 mtxtRCID = new QLineEdit( grid ); 00020 mtxtRCID->setMaxLength (3) ; 00021 00022 00023 // FIRST SECTION GRID SPACE 00024 grid = new QGrid( 4, mainVB ); 00025 00026 // ADD F/L NAME FIELDS 00027 lbl = new QLabel( "First Name: ", grid ); 00028 mtxtFName = new QLineEdit( grid ); 00029 00030 lbl = new QLabel( " Last Name: ", grid ); 00031 mtxtLName = new QLineEdit( grid ); 00032 00033 grid = new QGrid( 2, mainVB ); 00034 00035 // ADD SOURCE FIELD 00036 lbl = new QLabel( "Analysis Time: ", grid ); 00037 mtxtAnalysisTime = new QLineEdit( grid ); 00038 00039 00040 grid = new QGrid( 2, mainVB ); 00041 00042 // ADD SOURCE FIELD 00043 lbl = new QLabel( "Source: ", grid ); 00044 mtxtDataSource = new QLineEdit( grid ); 00045 00046 // ADD PROCESS DESCRIPTION FIELD 00047 lbl = new QLabel( "Process Desc: ", grid ); 00048 // mtxtProcDesc = new QLineEdit( grid ); 00049 mtxtProcDesc = new QMultiLineEdit ( grid ); 00050 mtxtProcDesc->setWordWrap (QMultiLineEdit::WidgetWidth) ; 00051 00052 // ADD 3D INFO DESCRIPTION 00053 lbl = new QLabel( "3D Info Desc: ", grid ); 00054 // mtxt3dDesc = new QLineEdit( grid ); 00055 mtxt3dDesc = new QMultiLineEdit ( grid ); 00056 mtxt3dDesc->setWordWrap (QMultiLineEdit::WidgetWidth) ; 00057 00058 connect( mtxtDataSource, 00059 SIGNAL( textChanged( const QString & ) ), 00060 this, 00061 SLOT( dschanged( const QString & ) ) ); 00062 00063 connect( mtxtFName, 00064 SIGNAL( textChanged( const QString & ) ), 00065 this, 00066 SLOT( fnchanged( const QString & ) ) ); 00067 00068 connect( mtxtLName, 00069 SIGNAL( textChanged( const QString & ) ), 00070 this, 00071 SLOT( lnchanged( const QString & ) ) ); 00072 00073 /* 00074 connect( mtxtProcDesc, 00075 SIGNAL( textChanged( const QString & ) ), 00076 this, 00077 SLOT( pdchanged( const QString & ) ) ); 00078 00079 connect( mtxt3dDesc, 00080 SIGNAL( textChanged( const QString & ) ), 00081 this, 00082 SLOT( d3changed( const QString & ) ) ); 00083 */ 00084 00085 connect( mtxtProcDesc, 00086 SIGNAL( textChanged( ) ), 00087 this, 00088 SLOT( pdchanged( ) ) ); 00089 00090 connect( mtxt3dDesc, 00091 SIGNAL( textChanged( ) ), 00092 this, 00093 SLOT( d3changed( ) ) ); 00094 00095 00096 connect( mtxtAnalysisTime, 00097 SIGNAL( textChanged( const QString & ) ), 00098 this, 00099 SLOT( atchanged( const QString & ) ) ); 00100 00101 connect( mtxtRCID, 00102 SIGNAL( textChanged( const QString & ) ), 00103 this, 00104 SLOT( rcchanged( const QString & ) ) ); 00105 00106 loadData(); 00107 } 00108 00109 SessionDlg::~SessionDlg( ) { 00110 00111 } 00112 00113 void SessionDlg::loadData( ) { 00114 mtxt3dDesc ->setText( mSession.m3d_desc.c_str() ); 00115 mtxtDataSource ->setText( mSession.mDataSrc.c_str() ); 00116 mtxtFName ->setText( mSession.manlst_givn.c_str() ); 00117 mtxtLName ->setText( mSession.manlst_surn.c_str() ); 00118 mtxtProcDesc ->setText( mSession.mProcDesc.c_str() ); 00119 mtxtAnalysisTime->setText( mSession.manaly_time.c_str() ) ; 00120 00121 // get RC ID and convert from int to string 00122 stringstream rcid ; 00123 rcid << mSession.mRC_ID ; 00124 mtxtRCID->setText( (rcid.str()).c_str() ); 00125 } 00126 00127 void SessionDlg::dschanged( const QString &newtxt ) { 00128 mSession.mDataSrc = newtxt.latin1(); 00129 } 00130 00131 void SessionDlg::fnchanged( const QString &newtxt ) { 00132 mSession.manlst_givn = newtxt.latin1(); 00133 } 00134 00135 void SessionDlg::lnchanged( const QString &newtxt ) { 00136 mSession.manlst_surn = newtxt.latin1(); 00137 } 00138 00139 00140 00141 void SessionDlg::pdchanged( ) { 00142 mSession.mProcDesc = mtxtProcDesc->text().utf8() ; 00143 } 00144 00145 void SessionDlg::d3changed( ) { 00146 mSession.m3d_desc = mtxt3dDesc->text().utf8() ; 00147 } 00148 00149 00150 00151 void SessionDlg::pdchanged( const QString &newtxt ) { 00152 mSession.mProcDesc = newtxt.latin1(); 00153 } 00154 00155 void SessionDlg::d3changed( const QString &newtxt ) { 00156 mSession.m3d_desc = newtxt.latin1(); 00157 } 00158 00159 00160 00161 void SessionDlg::atchanged( const QString &newtxt ) { 00162 mSession.manaly_time = newtxt.latin1(); 00163 } 00164 00165 void SessionDlg::rcchanged( const QString &newtxt ) { 00166 mSession.mRC_ID = newtxt.toInt(); 00167 } 00168 00169
Home |
Search |
Disclaimers & Privacy |
Contact Us GLIMSView Maintainer: dsoltesz@usgs.gov |