-rw-r--r-- | kaddressbook/addresseeeditorwidget.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp index dbbf7fe..50b6b6d 100644 --- a/kaddressbook/addresseeeditorwidget.cpp +++ b/kaddressbook/addresseeeditorwidget.cpp @@ -1,222 +1,223 @@ /* This file is part of KAddressBook. Copyright (c) 2002 Mike Pilone <mpilone@slac.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #include <qcheckbox.h> #include <qhbox.h> #include <qlabel.h> #include <qlayout.h> #include <qlistbox.h> #include <qpushbutton.h> #include <qtabwidget.h> +#include <qapplication.h> #ifndef KAB_EMBEDDED #include <qtextedit.h> #include <kaccelmanager.h> #include "keywidget.h" #include "soundwidget.h" #else //KAB_EMBEDDED #include <qmultilineedit.h> #endif //KAB_EMBEDDED #include "keywidget.h" #include "geowidget.h" #include "imagewidget.h" #include "nameeditdialog.h" #include "phoneeditwidget.h" #include "secrecywidget.h" #include <qtoolbutton.h> #include <qtooltip.h> #include <kapplication.h> #include <kconfig.h> #include <kcombobox.h> #include <kdebug.h> #include <kdialogbase.h> #include <kglobal.h> #include <kiconloader.h> #include <klineedit.h> #include <klocale.h> #include <kmessagebox.h> #include <kseparator.h> #include <ksqueezedtextlabel.h> #include <libkdepim/categoryeditdialog.h> #include <libkdepim/categoryselectdialog.h> #include <libkdepim/kdateedit.h> #include "addresseditwidget.h" #include "emaileditwidget.h" #include "kabcore.h" #include "kabprefs.h" #include "addresseeeditorwidget.h" AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension, QWidget *parent, const char *name ) : ExtensionWidget( core, parent, name ), mIsExtension( isExtension ), mBlockSignals( false ) { mAConfig = AddresseeConfig::instance(); mFormattedNameType = NameEditDialog::CustomName; initGUI(); mCategoryDialog = 0; mCategoryEditDialog = 0; // Load the empty addressee as defaults load(); mDirty = false; } AddresseeEditorWidget::~AddresseeEditorWidget() { kdDebug(5720) << "~AddresseeEditorWidget()" << endl; } void AddresseeEditorWidget::contactsSelectionChanged() { KABC::Addressee::List list = selectedContacts(); mAddressee = list[ 0 ]; load(); } void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr ) { mAddressee = addr; load(); } const KABC::Addressee &AddresseeEditorWidget::addressee() { return mAddressee; } void AddresseeEditorWidget::textChanged( const QString& ) { emitModified(); } void AddresseeEditorWidget::initGUI() { QVBoxLayout *layout = new QVBoxLayout( this ); mTabWidget = new QTabWidget( this ); layout->addWidget( mTabWidget ); setupTab1(); setupTab1_1(); setupTab2(); setupTab2_1(); setupTab3(); setupTab3_1(); mNameEdit->setFocus(); connect( mTabWidget, SIGNAL( currentChanged(QWidget*) ), SLOT( pageChanged(QWidget*) ) ); } void AddresseeEditorWidget::setupTab1() { // This is the General tab QWidget *tab1 = new QWidget( mTabWidget ); //US QGridLayout *layout = new QGridLayout( tab1, 11, 7 ); QGridLayout *layout = new QGridLayout( tab1, 7, 1 ); layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); QLabel *label; KSeparator* bar; QPushButton *button; ////////////////////////////////// // Upper left group (person info) // Person icon /* LR label = new QLabel( tab1 ); //US ambiguous call. Add one more parameter //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); layout->addMultiCellWidget( label, 0, 1, 0, 0 ); */ // First name button = new QPushButton( i18n( "Name..." ), tab1 ); //US QToolTip::add( button, i18n( "Edit the contact's name" ) ); mNameEdit = new KLineEdit( tab1, "mNameEdit" ); connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( nameTextChanged( const QString& ) ) ); connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); mNameLabel = new KSqueezedTextLabel( tab1 ); mNameLabel->hide(); layout->addWidget( button, 0, 0 ); layout->addWidget( mNameEdit, 0, 1 ); layout->addWidget( mNameLabel, 0, 1 ); label = new QLabel( i18n( "Role:" ), tab1 ); mRoleEdit = new KLineEdit( tab1 ); connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), SLOT( textChanged( const QString& ) ) ); label->setBuddy( mRoleEdit ); layout->addWidget( label, 1, 0 ); layout->addWidget( mRoleEdit, 1, 1 ); // Organization label = new QLabel( i18n( "Organization:" ), tab1 ); mOrgEdit = new KLineEdit( tab1 ); label->setBuddy( mOrgEdit ); connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), SLOT( textChanged( const QString& ) ) ); layout->addWidget( label, 2, 0 ); layout->addWidget( mOrgEdit, 2, 1 ); // File as (formatted name) label = new QLabel( i18n( "Formatted name:" ), tab1 ); mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); layout->addWidget( label, 3, 0 ); layout->addWidget( mFormattedNameLabel, 3, 1 ); /* LR // Left hand separator. This separator doesn't go all the way // across so the dialog still flows from top to bottom bar = new KSeparator( KSeparator::HLine, tab1 ); layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); */ ////////////////////////////////////// /* LR // Phone numbers (upper right) label = new QLabel( tab1 ); |