00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "quickopenfunctionchooseformbase.h"
00013
00014 #include <qvariant.h>
00015 #include <ksqueezedtextlabel.h>
00016 #include <klistbox.h>
00017 #include <qlabel.h>
00018 #include <qpushbutton.h>
00019 #include <qlayout.h>
00020 #include <qtooltip.h>
00021 #include <qwhatsthis.h>
00022
00023
00024
00025
00026
00027
00028
00029
00030 QuickOpenFunctionChooseFormBase::QuickOpenFunctionChooseFormBase( QWidget* parent, const char* name, bool modal, WFlags fl )
00031 : QDialog( parent, name, modal, fl )
00032 {
00033 if ( !name )
00034 setName( "QuickOpenFunctionChooseFormBase" );
00035
00036 filepathlabel = new KSqueezedTextLabel( this, "filepathlabel" );
00037 filepathlabel->setGeometry( QRect( 10, 320, 585, 20 ) );
00038 filepathlabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, filepathlabel->sizePolicy().hasHeightForWidth() ) );
00039
00040 argBox = new KListBox( this, "argBox" );
00041 argBox->setGeometry( QRect( 240, 40, 360, 260 ) );
00042 argBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, argBox->sizePolicy().hasHeightForWidth() ) );
00043
00044 fileBox = new KListBox( this, "fileBox" );
00045 fileBox->setGeometry( QRect( 10, 40, 220, 260 ) );
00046 fileBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, fileBox->sizePolicy().hasHeightForWidth() ) );
00047
00048 textLabel1 = new QLabel( this, "textLabel1" );
00049 textLabel1->setGeometry( QRect( 11, 11, 200, 20 ) );
00050
00051 textLabel2 = new QLabel( this, "textLabel2" );
00052 textLabel2->setGeometry( QRect( 236, 11, 358, 20 ) );
00053 textLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, textLabel2->sizePolicy().hasHeightForWidth() ) );
00054
00055 okBtn = new QPushButton( this, "okBtn" );
00056 okBtn->setGeometry( QRect( 240, 360, 175, 26 ) );
00057 okBtn->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, okBtn->sizePolicy().hasHeightForWidth() ) );
00058 okBtn->setDefault( TRUE );
00059 okBtn->setFlat( FALSE );
00060
00061 cancelBtn = new QPushButton( this, "cancelBtn" );
00062 cancelBtn->setGeometry( QRect( 430, 360, 170, 28 ) );
00063 cancelBtn->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)5, 0, 0, cancelBtn->sizePolicy().hasHeightForWidth() ) );
00064 languageChange();
00065 resize( QSize(615, 399).expandedTo(minimumSizeHint()) );
00066 clearWState( WState_Polished );
00067
00068
00069 connect( okBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
00070 connect( argBox, SIGNAL( highlighted(int) ), this, SLOT( slotFileChange(int) ) );
00071 connect( fileBox, SIGNAL( highlighted(int) ), this, SLOT( slotArgsChange(int) ) );
00072 connect( argBox, SIGNAL( returnPressed(QListBoxItem*) ), this, SLOT( accept() ) );
00073 connect( argBox, SIGNAL( clicked(QListBoxItem*) ), this, SLOT( accept() ) );
00074 connect( fileBox, SIGNAL( returnPressed(QListBoxItem*) ), this, SLOT( accept() ) );
00075 connect( fileBox, SIGNAL( clicked(QListBoxItem*) ), this, SLOT( accept() ) );
00076 connect( cancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
00077
00078
00079 setTabOrder( fileBox, argBox );
00080 setTabOrder( argBox, okBtn );
00081 setTabOrder( okBtn, cancelBtn );
00082 }
00083
00084
00085
00086
00087 QuickOpenFunctionChooseFormBase::~QuickOpenFunctionChooseFormBase()
00088 {
00089
00090 }
00091
00092
00093
00094
00095
00096 void QuickOpenFunctionChooseFormBase::languageChange()
00097 {
00098 filepathlabel->setText( QString::null );
00099 argBox->setCurrentItem( -1 );
00100 textLabel1->setText( tr2i18n( "File name:" ) );
00101 textLabel2->setText( tr2i18n( "Function arguments list:" ) );
00102 okBtn->setText( tr2i18n( "&OK" ) );
00103 cancelBtn->setText( tr2i18n( "&Cancel" ) );
00104 }
00105
00106 #include "quickopenfunctionchooseformbase.moc"