00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "ListDialogBase.h"
00011
00012 #include <qvariant.h>
00013 #include <qlabel.h>
00014 #include <qheader.h>
00015 #include <qlistview.h>
00016 #include <qpushbutton.h>
00017 #include <qlayout.h>
00018 #include <qtooltip.h>
00019 #include <qwhatsthis.h>
00020
00021
00022
00023
00024
00025
00026
00027
00028 ListDialogBase::ListDialogBase( QWidget* parent, const char* name, bool modal, WFlags fl )
00029 : QDialog( parent, name, modal, fl )
00030 {
00031 if ( !name )
00032 setName( "ListDialogBase" );
00033
00034 textLabel1 = new QLabel( this, "textLabel1" );
00035 textLabel1->setGeometry( QRect( 10, 10, 280, 101 ) );
00036
00037 m_tuple_list = new QListView( this, "m_tuple_list" );
00038 m_tuple_list->addColumn( tr( "Item" ) );
00039 m_tuple_list->addColumn( tr( "Name" ) );
00040 m_tuple_list->setGeometry( QRect( 10, 110, 280, 100 ) );
00041 m_tuple_list->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)7, 0, 0, m_tuple_list->sizePolicy().hasHeightForWidth() ) );
00042 m_tuple_list->setFrameShape( QListView::StyledPanel );
00043 m_tuple_list->setFrameShadow( QListView::Sunken );
00044 m_tuple_list->setHScrollBarMode( QListView::Auto );
00045 m_tuple_list->setAllColumnsShowFocus( TRUE );
00046 m_tuple_list->setShowSortIndicator( TRUE );
00047 m_tuple_list->setResizeMode( QListView::AllColumns );
00048
00049 m_select_button = new QPushButton( this, "m_select_button" );
00050 m_select_button->setGeometry( QRect( 160, 225, 91, 28 ) );
00051 m_select_button->setAutoDefault( FALSE );
00052 m_select_button->setDefault( TRUE );
00053
00054 m_cancel_button = new QPushButton( this, "m_cancel_button" );
00055 m_cancel_button->setGeometry( QRect( 40, 225, 91, 28 ) );
00056 m_cancel_button->setAutoDefault( FALSE );
00057 languageChange();
00058 resize( QSize(307, 272).expandedTo(minimumSizeHint()) );
00059 clearWState( WState_Polished );
00060
00061
00062 connect( m_select_button, SIGNAL( clicked() ), this, SLOT( accept() ) );
00063 connect( m_cancel_button, SIGNAL( clicked() ), this, SLOT( reject() ) );
00064 connect( m_tuple_list, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( doubleClicked() ) );
00065 }
00066
00067
00068
00069
00070 ListDialogBase::~ListDialogBase()
00071 {
00072
00073 }
00074
00075
00076
00077
00078
00079 void ListDialogBase::languageChange()
00080 {
00081 setCaption( tr( "Select ntuple" ) );
00082 textLabel1->setText( tr( "The selected file contains\n"
00083 "more than one ntuple.\n"
00084 "\n"
00085 "Select which one you want from list below.\n"
00086 "" ) );
00087 m_tuple_list->header()->setLabel( 0, tr( "Item" ) );
00088 m_tuple_list->header()->setLabel( 1, tr( "Name" ) );
00089 m_select_button->setText( tr( "Select" ) );
00090 m_cancel_button->setText( tr( "Cancel" ) );
00091 }
00092