• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KIO

pastedialog.cpp

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2005 David Faure <faure@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #include "pastedialog.h"
00020 
00021 #include <kcombobox.h>
00022 #include <klineedit.h>
00023 #include <klocale.h>
00024 
00025 #include <QApplication>
00026 #include <QLabel>
00027 #include <QLayout>
00028 #include <QClipboard>
00029 
00030 KIO::PasteDialog::PasteDialog( const QString &caption, const QString &label,
00031                                const QString &value, const QStringList& items,
00032                                QWidget *parent,
00033                                bool clipboard )
00034     : KDialog( parent )
00035 {
00036     setCaption( caption );
00037     setButtons( Ok | Cancel );
00038     setModal( true );
00039     showButtonSeparator( true );
00040     setDefaultButton( Ok );
00041 
00042     QFrame *frame = new QFrame;
00043     setMainWidget( frame );
00044 
00045     QVBoxLayout *layout = new QVBoxLayout( frame );
00046     layout->setSpacing( spacingHint() );
00047 
00048     m_label = new QLabel( label, frame );
00049     layout->addWidget( m_label );
00050 
00051     m_lineEdit = new KLineEdit( value, frame );
00052     layout->addWidget( m_lineEdit );
00053 
00054     m_lineEdit->setFocus();
00055     m_label->setBuddy( m_lineEdit );
00056 
00057     layout->addWidget( new QLabel( i18n( "Data format:" ), frame ) );
00058     m_comboBox = new KComboBox( frame );
00059     m_comboBox->addItems( items );
00060     layout->addWidget( m_comboBox );
00061 
00062     layout->addStretch();
00063 
00064     //connect( m_lineEdit, SIGNAL( textChanged( const QString & ) ),
00065     //    SLOT( slotEditTextChanged( const QString & ) ) );
00066     //connect( this, SIGNAL( user1Clicked() ), m_lineEdit, SLOT( clear() ) );
00067 
00068     //slotEditTextChanged( value );
00069     setMinimumWidth( 350 );
00070 
00071     m_clipboardChanged = false;
00072     if ( clipboard )
00073         connect( QApplication::clipboard(), SIGNAL( dataChanged() ),
00074                  this, SLOT( slotClipboardDataChanged() ) );
00075 }
00076 
00077 void KIO::PasteDialog::slotClipboardDataChanged()
00078 {
00079     m_clipboardChanged = true;
00080 }
00081 
00082 QString KIO::PasteDialog::lineEditText() const
00083 {
00084     return m_lineEdit->text();
00085 }
00086 
00087 int KIO::PasteDialog::comboItem() const
00088 {
00089     return m_comboBox->currentIndex();
00090 }
00091 
00092 #include "pastedialog.moc"

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal