UltraScan III
us_get_edit.cpp
Go to the documentation of this file.
1 
3 #include "us_get_edit.h"
4 #include "us_widgets.h"
5 #include "us_settings.h"
6 #include "us_gui_settings.h"
7 
8 US_GetEdit::US_GetEdit( int& i, QStringList& filenames )
9 : US_WidgetsDialog( 0, 0 ), index( i )
10 {
11  setWindowTitle( tr( "Load Edits From DB" ) );
12  setPalette( US_GuiSettings::frameColor() );
13 
14  QVBoxLayout* main = new QVBoxLayout( this );
15  main->setSpacing ( 2 );
16  main->setContentsMargins( 2, 2, 2, 2 );
17 
18  lw = new US_ListWidget;
19  lw->addItems( filenames );
20  main->addWidget( lw );
21 
22  // Button Row
23  QHBoxLayout* buttons = new QHBoxLayout;
24 
25  QPushButton* pb_cancel = us_pushbutton( tr( "Cancel" ) );
26  connect( pb_cancel, SIGNAL( clicked() ), SLOT( reject() ) );
27  buttons->addWidget( pb_cancel );
28 
29  QPushButton* pb_accept = us_pushbutton( tr( "Select" ) );
30  connect( pb_accept, SIGNAL( clicked() ), SLOT( select() ) );
31  buttons->addWidget( pb_accept );
32 
33  main->addLayout( buttons );
34  resize( 250, 150 );
35 }
36 
37 void US_GetEdit::select( void )
38 {
39  index = lw->currentRow();
40  accept();
41 }