00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "quickopenbase.h"
00013
00014 #include <qvariant.h>
00015 #include <qlabel.h>
00016 #include <klistbox.h>
00017 #include <qpushbutton.h>
00018 #include <klineedit.h>
00019 #include <qlayout.h>
00020 #include <qtooltip.h>
00021 #include <qwhatsthis.h>
00022
00023
00024
00025
00026
00027
00028
00029
00030 QuickOpenDialogBase::QuickOpenDialogBase( QWidget* parent, const char* name, bool modal, WFlags fl )
00031 : QDialog( parent, name, modal, fl )
00032 {
00033 if ( !name )
00034 setName( "QuickOpenDialogBase" );
00035 setSizeGripEnabled( TRUE );
00036 QuickOpenDialogBaseLayout = new QGridLayout( this, 1, 1, 11, 6, "QuickOpenDialogBaseLayout");
00037
00038 nameLabel = new QLabel( this, "nameLabel" );
00039
00040 QuickOpenDialogBaseLayout->addWidget( nameLabel, 0, 0 );
00041
00042 itemListLabel = new QLabel( this, "itemListLabel" );
00043
00044 QuickOpenDialogBaseLayout->addWidget( itemListLabel, 2, 0 );
00045
00046 itemList = new KListBox( this, "itemList" );
00047
00048 QuickOpenDialogBaseLayout->addWidget( itemList, 3, 0 );
00049
00050 Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1");
00051 Horizontal_Spacing2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00052 Layout1->addItem( Horizontal_Spacing2 );
00053
00054 buttonOk = new QPushButton( this, "buttonOk" );
00055 buttonOk->setAutoDefault( TRUE );
00056 buttonOk->setDefault( TRUE );
00057 Layout1->addWidget( buttonOk );
00058
00059 buttonCancel = new QPushButton( this, "buttonCancel" );
00060 buttonCancel->setAutoDefault( TRUE );
00061 Layout1->addWidget( buttonCancel );
00062
00063 QuickOpenDialogBaseLayout->addLayout( Layout1, 4, 0 );
00064
00065 nameEdit = new KLineEdit( this, "nameEdit" );
00066
00067 QuickOpenDialogBaseLayout->addWidget( nameEdit, 1, 0 );
00068 languageChange();
00069 resize( QSize(369, 331).expandedTo(minimumSizeHint()) );
00070 clearWState( WState_Polished );
00071
00072
00073 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
00074 connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
00075 connect( itemList, SIGNAL( returnPressed(QListBoxItem*) ), this, SLOT( slotExecuted(QListBoxItem*) ) );
00076 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( slotReturnPressed() ) );
00077 connect( itemList, SIGNAL( doubleClicked(QListBoxItem*) ), this, SLOT( slotExecuted(QListBoxItem*) ) );
00078 connect( nameEdit, SIGNAL( returnPressed() ), this, SLOT( slotReturnPressed() ) );
00079 connect( nameEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( slotTextChanged(const QString&) ) );
00080
00081
00082 setTabOrder( nameEdit, itemList );
00083 setTabOrder( itemList, buttonOk );
00084 setTabOrder( buttonOk, buttonCancel );
00085
00086
00087 nameLabel->setBuddy( nameEdit );
00088 itemListLabel->setBuddy( itemList );
00089 }
00090
00091
00092
00093
00094 QuickOpenDialogBase::~QuickOpenDialogBase()
00095 {
00096
00097 }
00098
00099
00100
00101
00102
00103 void QuickOpenDialogBase::languageChange()
00104 {
00105 setCaption( tr2i18n( "Quick Open" ) );
00106 nameLabel->setText( tr2i18n( "[NAME]" ) );
00107 itemListLabel->setText( tr2i18n( "[ITEM LIST]" ) );
00108 buttonOk->setText( tr2i18n( "&OK" ) );
00109 buttonOk->setAccel( QKeySequence( QString::null ) );
00110 buttonCancel->setText( tr2i18n( "&Cancel" ) );
00111 buttonCancel->setAccel( QKeySequence( QString::null ) );
00112 }
00113
00114 void QuickOpenDialogBase::slotTextChanged(const QString&)
00115 {
00116 qWarning( "QuickOpenDialogBase::slotTextChanged(const QString&): Not implemented yet" );
00117 }
00118
00119 void QuickOpenDialogBase::slotReturnPressed()
00120 {
00121 qWarning( "QuickOpenDialogBase::slotReturnPressed(): Not implemented yet" );
00122 }
00123
00124 void QuickOpenDialogBase::executed(QListBoxItem*)
00125 {
00126 qWarning( "QuickOpenDialogBase::executed(QListBoxItem*): Not implemented yet" );
00127 }
00128
00129 void QuickOpenDialogBase::slotExecuted(QListBoxItem*)
00130 {
00131 qWarning( "QuickOpenDialogBase::slotExecuted(QListBoxItem*): Not implemented yet" );
00132 }
00133
00134 #include "quickopenbase.moc"