tdeio/tdeio
pastedialog.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "pastedialog.h"
00020
00021 #include <klineedit.h>
00022 #include <kmimetype.h>
00023 #include <tdelocale.h>
00024
00025 #include <tqlayout.h>
00026 #include <tqlabel.h>
00027 #include <tqcombobox.h>
00028 #include <tqapplication.h>
00029 #include <tqclipboard.h>
00030
00031 TDEIO::PasteDialog::PasteDialog( const TQString &caption, const TQString &label,
00032 const TQString &value, const TQStringList& items,
00033 TQWidget *parent,
00034 bool clipboard )
00035 : KDialogBase( parent, 0 , true, caption, Ok|Cancel, Ok, true )
00036 {
00037 TQFrame *frame = makeMainWidget();
00038 TQVBoxLayout *layout = new TQVBoxLayout( frame, 0, spacingHint() );
00039
00040 m_label = new TQLabel( label, frame );
00041 layout->addWidget( m_label );
00042
00043 m_lineEdit = new KLineEdit( value, frame );
00044 layout->addWidget( m_lineEdit );
00045
00046 m_lineEdit->setFocus();
00047 m_label->setBuddy( m_lineEdit );
00048
00049 layout->addWidget( new TQLabel( i18n( "Data format:" ), frame ) );
00050 m_comboBox = new TQComboBox( frame );
00051 m_comboBox->insertStringList( items );
00052 layout->addWidget( m_comboBox );
00053
00054 layout->addStretch();
00055
00056
00057
00058
00059
00060
00061 setMinimumWidth( 350 );
00062
00063 m_clipboardChanged = false;
00064 if ( clipboard )
00065 connect( TQApplication::clipboard(), TQT_SIGNAL( dataChanged() ),
00066 this, TQT_SLOT( slotClipboardDataChanged() ) );
00067 }
00068
00069 void TDEIO::PasteDialog::slotClipboardDataChanged()
00070 {
00071 m_clipboardChanged = true;
00072 }
00073
00074 TQString TDEIO::PasteDialog::lineEditText() const
00075 {
00076 return m_lineEdit->text();
00077 }
00078
00079 int TDEIO::PasteDialog::comboItem() const
00080 {
00081 return m_comboBox->currentItem();
00082 }
00083
00084 #include "pastedialog.moc"