summaryrefslogtreecommitdiffabout
path: root/kaddressbook/addresseeeditorwidget.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/addresseeeditorwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp46
1 files changed, 25 insertions, 21 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 4313998..a95db03 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -9,49 +9,53 @@
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 <q3hbox.h>
#include <qlabel.h>
#include <qlayout.h>
-#include <qlistbox.h>
+#include <q3listbox.h>
#include <qpushbutton.h>
#include <qtabwidget.h>
#include <qapplication.h>
#ifndef KAB_EMBEDDED
-#include <qtextedit.h>
+#include <q3textedit.h>
+//Added by qt3to4:
+#include <Q3GridLayout>
+#include <Q3PopupMenu>
+#include <Q3VBoxLayout>
#include <kaccelmanager.h>
#include "keywidget.h"
#include "soundwidget.h"
#else //KAB_EMBEDDED
-#include <qmultilineedit.h>
+#include <q3multilineedit.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>
@@ -117,63 +121,63 @@ 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 );
+ Q3VBoxLayout *layout = new Q3VBoxLayout( 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 );
bool horLayout = false;
int maxCol = 1;
if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) {
horLayout = true;
maxCol = 3;
}
- QGridLayout *layout = new QGridLayout( tab1, 7-maxCol, maxCol );
+ Q3GridLayout *layout = new Q3GridLayout( tab1, 7-maxCol, maxCol );
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 ) );
@@ -314,43 +318,43 @@ void AddresseeEditorWidget::setupTab1()
layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 );
label = new QLabel( i18n( "&IM address:" ), tab1 );
mIMAddressEdit = new KLineEdit( tab1 );
connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ),
SLOT( textChanged( const QString& ) ) );
label->setBuddy( mIMAddressEdit );
layout->addWidget( label, 9, 4 );
layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 );
layout->addColSpacing( 6, 50 );
bar = new KSeparator( KSeparator::HLine, tab1 );
layout->addMultiCellWidget( bar, 10, 10, 0, 6 );
*/
///////////////////////////////////////
- QHBox *categoryBox = new QHBox( tab1 ,"cato");
+ Q3HBox *categoryBox = new Q3HBox( tab1 ,"cato");
categoryBox->setSpacing( KDialogBase::spacingHint() );
categoryBox->setMargin( KDialogBase::marginHintSmall() );
// Categories
button = new QPushButton( i18n( "Categories" )+":", categoryBox );
connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) );
mCategoryEdit = new QPushButton ( categoryBox );
mCategoryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
- mCatPopup = new QPopupMenu ( categoryBox );
+ mCatPopup = new Q3PopupMenu ( categoryBox );
mCategoryEdit->setPopup( mCatPopup );
connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup()));
connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int )));
//connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ),
// SLOT( textChanged( const QString& ) ) );
mSecrecyWidget = new SecrecyWidget( categoryBox );
connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
//US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 );
layout->addMultiCellWidget( categoryBox, iii, iii, 0, maxCol );
// Build the layout and add to the tab widget
layout->activate(); // required
mTabWidget->addTab( tab1, i18n( "&General" ) );
@@ -398,33 +402,33 @@ void AddresseeEditorWidget::setRole2FN()
}
void AddresseeEditorWidget::setCompany2FN()
{
if ( mOrgEdit->text().isEmpty() ) return;
mFormattedNameType = NameEditDialog::CustomName;
mAddressee.setFormattedName( mOrgEdit->text() );
mFormattedNameLabel->setText( mOrgEdit->text() );
emitModified();
}
void AddresseeEditorWidget::setupTab1_1()
{
// This is the Address tab
QWidget *tab1_1 = new QWidget( mTabWidget );
//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 );
- QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 );
+ Q3GridLayout *layout = new Q3GridLayout( tab1_1, 7, 2 );
layout->setMargin( KDialogBase::marginHintSmall() );
layout->setSpacing( KDialogBase::spacingHintSmall() );
QLabel *label;
KSeparator* bar;
QPushButton *button;
/*US
//////////////////////////////////
// Upper left group (person info)
// Person icon
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 ) );
@@ -599,33 +603,33 @@ qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 );
*/
// Build the layout and add to the tab widget
layout->activate(); // required
mTabWidget->addTab( tab1_1, i18n( "&Address" ) );
}
void AddresseeEditorWidget::setupTab2()
{
// This is the Details tab
QWidget *tab2 = new QWidget( mTabWidget );
- QGridLayout *layout = new QGridLayout( tab2, 8, 3 );
+ Q3GridLayout *layout = new Q3GridLayout( tab2, 8, 3 );
layout->setMargin( KDialogBase::marginHintSmall() );
layout->setSpacing( KDialogBase::spacingHintSmall() );
QLabel *label;
KSeparator* bar;
///////////////////////
// Office info
// Department
label = new QLabel( tab2 );
//US loadIcon call is ambiguous. Add one more parameter
//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) );
label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) );
layout->addMultiCellWidget( label, 0, 1, 0, 0 );
@@ -678,33 +682,33 @@ void AddresseeEditorWidget::setupTab2()
layout->addMultiCellWidget( bar, 5, 5, 0, 2 );
/////////////////////////////////////////////////
// Personal info
//label = new QLabel( tab2 );
//US loadIcon call is ambiguous. Add one more parameter
//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
//label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
//US layout->addMultiCellWidget( label, 4, 5, 0, 0 );
//layout->addMultiCellWidget( label, 6, 7, 0, 0 );
int iii = 6;
if ( QApplication::desktop()->width() == 640 ) {
- QHBox * nbox = new QHBox ( tab2 );
+ Q3HBox * nbox = new Q3HBox ( tab2 );
label = new QLabel( i18n( "Nick name:" )+" ", nbox );
mNicknameEdit = new KLineEdit( nbox );
connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
SLOT( textChanged( const QString& ) ) );
label->setBuddy( mNicknameEdit );
label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox );
mSpouseEdit = new KLineEdit( nbox );
connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
SLOT( textChanged( const QString& ) ) );
label->setBuddy( mSpouseEdit );
layout->addMultiCellWidget( nbox, iii, iii, 1, 2 );
++iii;
} else {
label = new QLabel( i18n( "Nick name:" ), tab2 );
@@ -722,33 +726,33 @@ void AddresseeEditorWidget::setupTab2()
connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
SLOT( textChanged( const QString& ) ) );
label->setBuddy( mSpouseEdit );
layout->addWidget( mSpouseEdit, iii, 2 );
++iii;
}
label = new QLabel( i18n( "Children's names:" ), tab2 );
layout->addWidget( label, iii, 1 );
mChildEdit = new KLineEdit( tab2 );
connect( mChildEdit, SIGNAL( textChanged( const QString& ) ),
SLOT( textChanged( const QString& ) ) );
label->setBuddy( mChildEdit );
layout->addWidget( mChildEdit, iii, 2 );
++iii;
if ( QApplication::desktop()->width() == 640 ) {
- QHBox * nbox = new QHBox ( tab2 );
+ Q3HBox * nbox = new Q3HBox ( tab2 );
label = new QLabel( i18n( "Birthday:" )+" ", nbox );
mBirthdayPicker = new KDateEdit( nbox );
//mBirthdayPicker->toggleDateFormat();
mBirthdayPicker->setHandleInvalid( true );
connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
SLOT( dateChanged( QDate ) ) );
label->setBuddy( mBirthdayPicker );
label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox );
mAnniversaryPicker = new KDateEdit( nbox );
mAnniversaryPicker->setHandleInvalid( true );
connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
SLOT( dateChanged( QDate ) ) );
label->setBuddy( mAnniversaryPicker );
@@ -791,33 +795,33 @@ void AddresseeEditorWidget::setupTab2()
connect( mGenderBox, SIGNAL( activated ( const QString & ) ),
SLOT( textChanged( const QString& ) ) );
label->setBuddy( mGenderBox );
layout->addWidget( mGenderBox, iii, 2 );
++iii;
// Build the layout and add to the tab widget
layout->activate(); // required
mTabWidget->addTab( tab2, i18n( "&Details" ) );
}
void AddresseeEditorWidget::setupTab2_1()
{
// This is the Details tab
QWidget *tab2_2 = new QWidget( mTabWidget );
- QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 );
+ Q3GridLayout *layout = new Q3GridLayout( tab2_2, 1, 2 );
layout->setMargin( KDialogBase::marginHintSmall() );
layout->setSpacing( KDialogBase::spacingHintSmall() );
QLabel *label;
KSeparator* bar;
/*US
///////////////////////
// Office info
// Department
label = new QLabel( tab2 );
//US loadIcon call is ambiguous. Add one more parameter
//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) );
label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) );
layout->addMultiCellWidget( label, 0, 1, 0, 0 );
@@ -913,60 +917,60 @@ void AddresseeEditorWidget::setupTab2_1()
SLOT( invalidDate() ) );
connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ),
SLOT( emitModified() ) );
label->setBuddy( mAnniversaryPicker );
layout->addWidget( mAnniversaryPicker, 5, 4 );
bar = new KSeparator( KSeparator::HLine, tab2 );
layout->addMultiCellWidget( bar, 6, 6, 0, 5 );
*/
//////////////////////////////////////
// Notes
label = new QLabel( i18n( "Note:" ), tab2_2 );
label->setAlignment( Qt::AlignTop | Qt::AlignLeft );
//US layout->addWidget( label, 7, 0 );
layout->addWidget( label, 0, 0 );
#ifndef KAB_EMBEDDED
- mNoteEdit = new QTextEdit( tab2_2 );
- mNoteEdit->setWordWrap( QTextEdit::WidgetWidth );
+ mNoteEdit = new Q3TextEdit( tab2_2 );
+ mNoteEdit->setWordWrap( Q3TextEdit::WidgetWidth );
mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
#else //KAB_EMBEDDED
- mNoteEdit = new QMultiLineEdit( tab2_2 );
- mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth );
+ mNoteEdit = new Q3MultiLineEdit( tab2_2 );
+ mNoteEdit->setWordWrap( Q3MultiLineEdit::WidgetWidth );
mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
#endif //KAB_EMBEDDED
connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) );
label->setBuddy( mNoteEdit );
//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 );
layout->addWidget( mNoteEdit, 1, 0);
// Build the layout and add to the tab widget
layout->activate(); // required
mTabWidget->addTab( tab2_2, i18n( "&Notes" ) );
}
void AddresseeEditorWidget::setupTab3()
{
// This is the Misc tab
QWidget *tab3 = new QWidget( mTabWidget );
- QGridLayout *layout = new QGridLayout( tab3, 1, 1 );
+ Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 );
layout->setMargin( KDialogBase::marginHintSmall() );
layout->setSpacing( KDialogBase::spacingHintSmall() );
//US layout->setColStretch( 2, 1 );
//////////////////////////////////////
// Geo
mGeoWidget = new GeoWidget( tab3 );
// mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() );
connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
layout->addWidget( mGeoWidget, 0, 0 );
/*US
//////////////////////////////////////
// Sound
#ifndef KAB_EMBEDDED
mSoundWidget = new SoundWidget( tab3 );
mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() );
@@ -992,33 +996,33 @@ qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be
// Keys
mKeyWidget = new KeyWidget( tab3 );
//mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() );
connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
//US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop );
layout->addWidget( mKeyWidget, 1, 0 );
mTabWidget->addTab( tab3, i18n( "&Misc" ) );
}
void AddresseeEditorWidget::setupTab3_1()
{
// This is the Misc tab
QWidget *tab3 = new QWidget( mTabWidget );
//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 );
- QGridLayout *layout = new QGridLayout( tab3, 1, 1 );
+ Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 );
layout->setMargin( KDialogBase::marginHint() );
layout->setSpacing( KDialogBase::spacingHint() );
//US layout->setColStretch( 2, 1 );
/*US
//////////////////////////////////////
// Geo
mGeoWidget = new GeoWidget( tab3 );
mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() );
connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop );
*/
//////////////////////////////////////
// Sound
#ifndef KAB_EMBEDDED
mSoundWidget = new SoundWidget( tab3 );
@@ -1417,19 +1421,19 @@ void AddresseeEditorWidget::pageChanged( QWidget *wdg )
#else //KAB_EMBEDDED
//US
#endif //KAB_EMBEDDED
}
QString AddresseeEditorWidget::title() const
{
return i18n( "Contact Editor" );
}
QString AddresseeEditorWidget::identifier() const
{
return i18n( "contact_editor" );
}
-#ifndef KAB_EMBEDDED
-#include "addresseeeditorwidget.moc"
+#ifndef KAB_EMBEDDED_
+#include "moc_addresseeeditorwidget.cpp"
#endif //KAB_EMBEDDED