summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp1
-rw-r--r--kaddressbook/kcmconfigs/addresseewidget.cpp14
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp14
-rw-r--r--kaddressbook/kcmconfigs/kcmkabconfig.cpp6
4 files changed, 26 insertions, 9 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 7bf1a2f..a6d722d 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -819,384 +819,385 @@ void KABCore::addEmail( QString aStr )
819 found = true; 819 found = true;
820 (*it).setNameFromString( fullName ); 820 (*it).setNameFromString( fullName );
821 editContact( (*it).uid() ); 821 editContact( (*it).uid() );
822 } 822 }
823 } 823 }
824 824
825 if ( !found ) { 825 if ( !found ) {
826 KABC::Addressee addr; 826 KABC::Addressee addr;
827 addr.setNameFromString( fullName ); 827 addr.setNameFromString( fullName );
828 addr.insertEmail( email, true ); 828 addr.insertEmail( email, true );
829 829
830 mAddressBook->insertAddressee( addr ); 830 mAddressBook->insertAddressee( addr );
831 mViewManager->refreshView( addr.uid() ); 831 mViewManager->refreshView( addr.uid() );
832 editContact( addr.uid() ); 832 editContact( addr.uid() );
833 } 833 }
834#else //KAB_EMBEDDED 834#else //KAB_EMBEDDED
835 qDebug("KABCore::addEmail finsih method"); 835 qDebug("KABCore::addEmail finsih method");
836#endif //KAB_EMBEDDED 836#endif //KAB_EMBEDDED
837} 837}
838 838
839void KABCore::importVCard( const KURL &url, bool showPreview ) 839void KABCore::importVCard( const KURL &url, bool showPreview )
840{ 840{
841 mXXPortManager->importVCard( url, showPreview ); 841 mXXPortManager->importVCard( url, showPreview );
842} 842}
843 843
844void KABCore::importVCard( const QString &vCard, bool showPreview ) 844void KABCore::importVCard( const QString &vCard, bool showPreview )
845{ 845{
846 mXXPortManager->importVCard( vCard, showPreview ); 846 mXXPortManager->importVCard( vCard, showPreview );
847} 847}
848 848
849//US added a second method without defaultparameter 849//US added a second method without defaultparameter
850void KABCore::editContact2() { 850void KABCore::editContact2() {
851 editContact( QString::null ); 851 editContact( QString::null );
852} 852}
853 853
854void KABCore::editContact( const QString &uid ) 854void KABCore::editContact( const QString &uid )
855{ 855{
856 856
857 if ( mExtensionManager->isQuickEditVisible() ) 857 if ( mExtensionManager->isQuickEditVisible() )
858 return; 858 return;
859 859
860 // First, locate the contact entry 860 // First, locate the contact entry
861 QString localUID = uid; 861 QString localUID = uid;
862 if ( localUID.isNull() ) { 862 if ( localUID.isNull() ) {
863 QStringList uidList = mViewManager->selectedUids(); 863 QStringList uidList = mViewManager->selectedUids();
864 if ( uidList.count() > 0 ) 864 if ( uidList.count() > 0 )
865 localUID = *( uidList.at( 0 ) ); 865 localUID = *( uidList.at( 0 ) );
866 } 866 }
867 867
868 KABC::Addressee addr = mAddressBook->findByUid( localUID ); 868 KABC::Addressee addr = mAddressBook->findByUid( localUID );
869 if ( !addr.isEmpty() ) { 869 if ( !addr.isEmpty() ) {
870 AddresseeEditorDialog *dialog = mEditorDict.find( addr.uid() ); 870 AddresseeEditorDialog *dialog = mEditorDict.find( addr.uid() );
871 if ( !dialog ) { 871 if ( !dialog ) {
872 dialog = createAddresseeEditorDialog( this ); 872 dialog = createAddresseeEditorDialog( this );
873 873
874 mEditorDict.insert( addr.uid(), dialog ); 874 mEditorDict.insert( addr.uid(), dialog );
875 875
876 dialog->setAddressee( addr ); 876 dialog->setAddressee( addr );
877 } 877 }
878 878
879 dialog->raise(); 879 dialog->raise();
880 dialog->show(); 880 dialog->show();
881 } 881 }
882} 882}
883 883
884void KABCore::save() 884void KABCore::save()
885{ 885{
886 if ( !mModified ) 886 if ( !mModified )
887 return; 887 return;
888 QString text = i18n( "There was an error while attempting to save\n the " 888 QString text = i18n( "There was an error while attempting to save\n the "
889 "address book. Please check that some \nother application is " 889 "address book. Please check that some \nother application is "
890 "not using it. " ); 890 "not using it. " );
891 statusMessage(i18n("Saving addressbook ... ")); 891 statusMessage(i18n("Saving addressbook ... "));
892#ifndef KAB_EMBEDDED 892#ifndef KAB_EMBEDDED
893 KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook ); 893 KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook );
894 if ( !b || !b->save() ) { 894 if ( !b || !b->save() ) {
895 KMessageBox::error( this, text, i18n( "Unable to Save" ) ); 895 KMessageBox::error( this, text, i18n( "Unable to Save" ) );
896 } 896 }
897#else //KAB_EMBEDDED 897#else //KAB_EMBEDDED
898 KABC::StdAddressBook *b = (KABC::StdAddressBook*)( mAddressBook ); 898 KABC::StdAddressBook *b = (KABC::StdAddressBook*)( mAddressBook );
899 if ( !b || !b->save() ) { 899 if ( !b || !b->save() ) {
900 QMessageBox::critical( this, i18n( "Unable to Save" ), text, i18n("Ok")); 900 QMessageBox::critical( this, i18n( "Unable to Save" ), text, i18n("Ok"));
901 } 901 }
902#endif //KAB_EMBEDDED 902#endif //KAB_EMBEDDED
903 903
904 statusMessage(i18n("Addressbook saved!")); 904 statusMessage(i18n("Addressbook saved!"));
905 setModified( false ); 905 setModified( false );
906} 906}
907 907
908void KABCore::statusMessage(QString mess , int time ) 908void KABCore::statusMessage(QString mess , int time )
909{ 909{
910 //topLevelWidget()->setCaption( mess ); 910 //topLevelWidget()->setCaption( mess );
911 // pending setting timer to revome message 911 // pending setting timer to revome message
912} 912}
913void KABCore::undo() 913void KABCore::undo()
914{ 914{
915 UndoStack::instance()->undo(); 915 UndoStack::instance()->undo();
916 916
917 // Refresh the view 917 // Refresh the view
918 mViewManager->refreshView(); 918 mViewManager->refreshView();
919} 919}
920 920
921void KABCore::redo() 921void KABCore::redo()
922{ 922{
923 RedoStack::instance()->redo(); 923 RedoStack::instance()->redo();
924 924
925 // Refresh the view 925 // Refresh the view
926 mViewManager->refreshView(); 926 mViewManager->refreshView();
927} 927}
928 928
929void KABCore::setJumpButtonBarVisible( bool visible ) 929void KABCore::setJumpButtonBarVisible( bool visible )
930{ 930{
931 if ( visible ) 931 if ( visible )
932 mJumpButtonBar->show(); 932 mJumpButtonBar->show();
933 else 933 else
934 mJumpButtonBar->hide(); 934 mJumpButtonBar->hide();
935} 935}
936void KABCore::setDetailsToState() 936void KABCore::setDetailsToState()
937{ 937{
938 setDetailsVisible( mActionDetails->isChecked() ); 938 setDetailsVisible( mActionDetails->isChecked() );
939} 939}
940 940
941void KABCore::setDetailsVisible( bool visible ) 941void KABCore::setDetailsVisible( bool visible )
942{ 942{
943 if ( visible ) 943 if ( visible )
944 mDetails->show(); 944 mDetails->show();
945 else 945 else
946 mDetails->hide(); 946 mDetails->hide();
947} 947}
948 948
949void KABCore::extensionModified( const KABC::Addressee::List &list ) 949void KABCore::extensionModified( const KABC::Addressee::List &list )
950{ 950{
951 951
952 if ( list.count() != 0 ) { 952 if ( list.count() != 0 ) {
953 KABC::Addressee::List::ConstIterator it; 953 KABC::Addressee::List::ConstIterator it;
954 for ( it = list.begin(); it != list.end(); ++it ) 954 for ( it = list.begin(); it != list.end(); ++it )
955 mAddressBook->insertAddressee( *it ); 955 mAddressBook->insertAddressee( *it );
956 if ( list.count() > 1 ) 956 if ( list.count() > 1 )
957 setModified(); 957 setModified();
958 else 958 else
959 setModifiedWOrefresh(); 959 setModifiedWOrefresh();
960 } 960 }
961 if ( list.count() == 0 ) 961 if ( list.count() == 0 )
962 mViewManager->refreshView(); 962 mViewManager->refreshView();
963 else 963 else
964 mViewManager->refreshView( list[ 0 ].uid() ); 964 mViewManager->refreshView( list[ 0 ].uid() );
965 965
966 966
967 967
968} 968}
969 969
970QString KABCore::getNameByPhone( const QString &phone ) 970QString KABCore::getNameByPhone( const QString &phone )
971{ 971{
972#ifndef KAB_EMBEDDED 972#ifndef KAB_EMBEDDED
973 QRegExp r( "[/*/-/ ]" ); 973 QRegExp r( "[/*/-/ ]" );
974 QString localPhone( phone ); 974 QString localPhone( phone );
975 975
976 bool found = false; 976 bool found = false;
977 QString ownerName = ""; 977 QString ownerName = "";
978 KABC::AddressBook::Iterator iter; 978 KABC::AddressBook::Iterator iter;
979 KABC::PhoneNumber::List::Iterator phoneIter; 979 KABC::PhoneNumber::List::Iterator phoneIter;
980 KABC::PhoneNumber::List phoneList; 980 KABC::PhoneNumber::List phoneList;
981 for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) { 981 for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) {
982 phoneList = (*iter).phoneNumbers(); 982 phoneList = (*iter).phoneNumbers();
983 for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() ); 983 for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() );
984 ++phoneIter) { 984 ++phoneIter) {
985 // Get rid of separator chars so just the numbers are compared. 985 // Get rid of separator chars so just the numbers are compared.
986 if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { 986 if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) {
987 ownerName = (*iter).formattedName(); 987 ownerName = (*iter).formattedName();
988 found = true; 988 found = true;
989 } 989 }
990 } 990 }
991 } 991 }
992 992
993 return ownerName; 993 return ownerName;
994#else //KAB_EMBEDDED 994#else //KAB_EMBEDDED
995 qDebug("KABCore::getNameByPhone finsih method"); 995 qDebug("KABCore::getNameByPhone finsih method");
996 return ""; 996 return "";
997#endif //KAB_EMBEDDED 997#endif //KAB_EMBEDDED
998 998
999} 999}
1000 1000
1001void KABCore::openConfigDialog() 1001void KABCore::openConfigDialog()
1002{ 1002{
1003 KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); 1003 KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true );
1004 KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); 1004 KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" );
1005 ConfigureDialog->addModule(kabcfg ); 1005 ConfigureDialog->addModule(kabcfg );
1006 connect( ConfigureDialog, SIGNAL( applyClicked() ), 1006 connect( ConfigureDialog, SIGNAL( applyClicked() ),
1007 this, SLOT( configurationChanged() ) ); 1007 this, SLOT( configurationChanged() ) );
1008 connect( ConfigureDialog, SIGNAL( okClicked() ), 1008 connect( ConfigureDialog, SIGNAL( okClicked() ),
1009 this, SLOT( configurationChanged() ) ); 1009 this, SLOT( configurationChanged() ) );
1010 saveSettings(); 1010 saveSettings();
1011 ConfigureDialog->showMaximized();
1011 ConfigureDialog->exec(); 1012 ConfigureDialog->exec();
1012 delete ConfigureDialog; 1013 delete ConfigureDialog;
1013} 1014}
1014 1015
1015void KABCore::openLDAPDialog() 1016void KABCore::openLDAPDialog()
1016{ 1017{
1017#ifndef KAB_EMBEDDED 1018#ifndef KAB_EMBEDDED
1018 if ( !mLdapSearchDialog ) { 1019 if ( !mLdapSearchDialog ) {
1019 mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); 1020 mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this );
1020 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, 1021 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager,
1021 SLOT( refreshView() ) ); 1022 SLOT( refreshView() ) );
1022 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, 1023 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this,
1023 SLOT( setModified() ) ); 1024 SLOT( setModified() ) );
1024 } else 1025 } else
1025 mLdapSearchDialog->restoreSettings(); 1026 mLdapSearchDialog->restoreSettings();
1026 1027
1027 if ( mLdapSearchDialog->isOK() ) 1028 if ( mLdapSearchDialog->isOK() )
1028 mLdapSearchDialog->exec(); 1029 mLdapSearchDialog->exec();
1029#else //KAB_EMBEDDED 1030#else //KAB_EMBEDDED
1030 qDebug("KABCore::openLDAPDialog() finsih method"); 1031 qDebug("KABCore::openLDAPDialog() finsih method");
1031#endif //KAB_EMBEDDED 1032#endif //KAB_EMBEDDED
1032} 1033}
1033 1034
1034void KABCore::print() 1035void KABCore::print()
1035{ 1036{
1036#ifndef KAB_EMBEDDED 1037#ifndef KAB_EMBEDDED
1037 KPrinter printer; 1038 KPrinter printer;
1038 if ( !printer.setup( this ) ) 1039 if ( !printer.setup( this ) )
1039 return; 1040 return;
1040 1041
1041 KABPrinting::PrintingWizard wizard( &printer, mAddressBook, 1042 KABPrinting::PrintingWizard wizard( &printer, mAddressBook,
1042 mViewManager->selectedUids(), this ); 1043 mViewManager->selectedUids(), this );
1043 1044
1044 wizard.exec(); 1045 wizard.exec();
1045#else //KAB_EMBEDDED 1046#else //KAB_EMBEDDED
1046 qDebug("KABCore::print() finsih method"); 1047 qDebug("KABCore::print() finsih method");
1047#endif //KAB_EMBEDDED 1048#endif //KAB_EMBEDDED
1048 1049
1049} 1050}
1050 1051
1051 1052
1052void KABCore::addGUIClient( KXMLGUIClient *client ) 1053void KABCore::addGUIClient( KXMLGUIClient *client )
1053{ 1054{
1054 if ( mGUIClient ) 1055 if ( mGUIClient )
1055 mGUIClient->insertChildClient( client ); 1056 mGUIClient->insertChildClient( client );
1056 else 1057 else
1057 KMessageBox::error( this, "no KXMLGUICLient"); 1058 KMessageBox::error( this, "no KXMLGUICLient");
1058} 1059}
1059 1060
1060 1061
1061void KABCore::configurationChanged() 1062void KABCore::configurationChanged()
1062{ 1063{
1063 mExtensionManager->reconfigure(); 1064 mExtensionManager->reconfigure();
1064} 1065}
1065 1066
1066void KABCore::addressBookChanged() 1067void KABCore::addressBookChanged()
1067{ 1068{
1068#ifndef KAB_EMBEDDED 1069#ifndef KAB_EMBEDDED
1069 QDictIterator<AddresseeEditorDialog> it( mEditorDict ); 1070 QDictIterator<AddresseeEditorDialog> it( mEditorDict );
1070 while ( it.current() ) { 1071 while ( it.current() ) {
1071 if ( it.current()->dirty() ) { 1072 if ( it.current()->dirty() ) {
1072 QString text = i18n( "Data has been changed externally. Unsaved " 1073 QString text = i18n( "Data has been changed externally. Unsaved "
1073 "changes will be lost." ); 1074 "changes will be lost." );
1074 KMessageBox::information( this, text ); 1075 KMessageBox::information( this, text );
1075 } 1076 }
1076 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); 1077 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) );
1077 ++it; 1078 ++it;
1078 } 1079 }
1079 1080
1080 mViewManager->refreshView(); 1081 mViewManager->refreshView();
1081#else //KAB_EMBEDDED 1082#else //KAB_EMBEDDED
1082 qDebug("KABCore::addressBookChanged() finsih method"); 1083 qDebug("KABCore::addressBookChanged() finsih method");
1083#endif //KAB_EMBEDDED 1084#endif //KAB_EMBEDDED
1084} 1085}
1085 1086
1086AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, 1087AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
1087 const char *name ) 1088 const char *name )
1088{ 1089{
1089 AddresseeEditorDialog *dialog = new AddresseeEditorDialog( this, parent, 1090 AddresseeEditorDialog *dialog = new AddresseeEditorDialog( this, parent,
1090 name ? name : "editorDialog" ); 1091 name ? name : "editorDialog" );
1091 1092
1092//US 1093//US
1093 dialog->setMaximumSize( 640, 480 ); 1094 dialog->setMaximumSize( 640, 480 );
1094 dialog->showMaximized(); 1095 dialog->showMaximized();
1095 1096
1096 connect( dialog, SIGNAL( contactModified( const KABC::Addressee& ) ), 1097 connect( dialog, SIGNAL( contactModified( const KABC::Addressee& ) ),
1097 SLOT( contactModified( const KABC::Addressee& ) ) ); 1098 SLOT( contactModified( const KABC::Addressee& ) ) );
1098 connect( dialog, SIGNAL( editorDestroyed( const QString& ) ), 1099 connect( dialog, SIGNAL( editorDestroyed( const QString& ) ),
1099 SLOT( slotEditorDestroyed( const QString& ) ) ); 1100 SLOT( slotEditorDestroyed( const QString& ) ) );
1100 1101
1101 return dialog; 1102 return dialog;
1102} 1103}
1103 1104
1104void KABCore::slotEditorDestroyed( const QString &uid ) 1105void KABCore::slotEditorDestroyed( const QString &uid )
1105{ 1106{
1106 mEditorDict.remove( uid ); 1107 mEditorDict.remove( uid );
1107} 1108}
1108 1109
1109void KABCore::initGUI() 1110void KABCore::initGUI()
1110{ 1111{
1111#ifndef KAB_EMBEDDED 1112#ifndef KAB_EMBEDDED
1112 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1113 QHBoxLayout *topLayout = new QHBoxLayout( this );
1113 topLayout->setSpacing( KDialogBase::spacingHint() ); 1114 topLayout->setSpacing( KDialogBase::spacingHint() );
1114 1115
1115 mExtensionBarSplitter = new QSplitter( this ); 1116 mExtensionBarSplitter = new QSplitter( this );
1116 mExtensionBarSplitter->setOrientation( Qt::Vertical ); 1117 mExtensionBarSplitter->setOrientation( Qt::Vertical );
1117 1118
1118 mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); 1119 mDetailsSplitter = new QSplitter( mExtensionBarSplitter );
1119 1120
1120 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1121 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1121 mIncSearchWidget = new IncSearchWidget( viewSpace ); 1122 mIncSearchWidget = new IncSearchWidget( viewSpace );
1122 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1123 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1123 SLOT( incrementalSearch( const QString& ) ) ); 1124 SLOT( incrementalSearch( const QString& ) ) );
1124 1125
1125 mViewManager = new ViewManager( this, viewSpace ); 1126 mViewManager = new ViewManager( this, viewSpace );
1126 viewSpace->setStretchFactor( mViewManager, 1 ); 1127 viewSpace->setStretchFactor( mViewManager, 1 );
1127 1128
1128 mDetails = new ViewContainer( mDetailsSplitter ); 1129 mDetails = new ViewContainer( mDetailsSplitter );
1129 1130
1130 mJumpButtonBar = new JumpButtonBar( this, this ); 1131 mJumpButtonBar = new JumpButtonBar( this, this );
1131 1132
1132 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1133 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1133 1134
1134 topLayout->addWidget( mExtensionBarSplitter ); 1135 topLayout->addWidget( mExtensionBarSplitter );
1135 topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); 1136 topLayout->setStretchFactor( mExtensionBarSplitter, 100 );
1136 topLayout->addWidget( mJumpButtonBar ); 1137 topLayout->addWidget( mJumpButtonBar );
1137 topLayout->setStretchFactor( mJumpButtonBar, 1 ); 1138 topLayout->setStretchFactor( mJumpButtonBar, 1 );
1138 1139
1139 mXXPortManager = new XXPortManager( this, this ); 1140 mXXPortManager = new XXPortManager( this, this );
1140 1141
1141#else //KAB_EMBEDDED 1142#else //KAB_EMBEDDED
1142 //US initialize viewMenu before settingup viewmanager. 1143 //US initialize viewMenu before settingup viewmanager.
1143 // Viewmanager needs this menu to plugin submenues. 1144 // Viewmanager needs this menu to plugin submenues.
1144 viewMenu = new QPopupMenu( this ); 1145 viewMenu = new QPopupMenu( this );
1145 settingsMenu = new QPopupMenu( this ); 1146 settingsMenu = new QPopupMenu( this );
1146 //filterMenu = new QPopupMenu( this ); 1147 //filterMenu = new QPopupMenu( this );
1147 ImportMenu = new QPopupMenu( this ); 1148 ImportMenu = new QPopupMenu( this );
1148 ExportMenu = new QPopupMenu( this ); 1149 ExportMenu = new QPopupMenu( this );
1149 1150
1150 1151
1151//US since we have no splitter for the embedded system, setup 1152//US since we have no splitter for the embedded system, setup
1152// a layout with two frames. One left and one right. 1153// a layout with two frames. One left and one right.
1153 1154
1154 QBoxLayout *topLayout; 1155 QBoxLayout *topLayout;
1155 1156
1156 // = new QHBoxLayout( this ); 1157 // = new QHBoxLayout( this );
1157// QBoxLayout *topLayout = (QBoxLayout*)layout(); 1158// QBoxLayout *topLayout = (QBoxLayout*)layout();
1158 1159
1159// QWidget *mainBox = new QWidget( this ); 1160// QWidget *mainBox = new QWidget( this );
1160// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); 1161// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox);
1161 1162
1162#ifdef DESKTOP_VERSION 1163#ifdef DESKTOP_VERSION
1163 topLayout = new QHBoxLayout( this ); 1164 topLayout = new QHBoxLayout( this );
1164 1165
1165 1166
1166 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1167 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1167 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1168 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1168 1169
1169 topLayout->addWidget(mMiniSplitter ); 1170 topLayout->addWidget(mMiniSplitter );
1170 1171
1171 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); 1172 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter );
1172 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1173 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1173 mViewManager = new ViewManager( this, mExtensionBarSplitter ); 1174 mViewManager = new ViewManager( this, mExtensionBarSplitter );
1174 mDetails = new ViewContainer( mMiniSplitter ); 1175 mDetails = new ViewContainer( mMiniSplitter );
1175 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1176 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1176#else 1177#else
1177 if ( QApplication::desktop()->width() > 480 ) { 1178 if ( QApplication::desktop()->width() > 480 ) {
1178 topLayout = new QHBoxLayout( this ); 1179 topLayout = new QHBoxLayout( this );
1179 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1180 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1180 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1181 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1181 } else { 1182 } else {
1182 1183
1183 topLayout = new QVBoxLayout( this ); 1184 topLayout = new QVBoxLayout( this );
1184 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); 1185 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this);
1185 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1186 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1186 } 1187 }
1187 1188
1188 topLayout->addWidget(mMiniSplitter ); 1189 topLayout->addWidget(mMiniSplitter );
1189 mViewManager = new ViewManager( this, mMiniSplitter ); 1190 mViewManager = new ViewManager( this, mMiniSplitter );
1190 mDetails = new ViewContainer( mMiniSplitter ); 1191 mDetails = new ViewContainer( mMiniSplitter );
1191 1192
1192 1193
1193 mExtensionManager = new ExtensionManager( this, mMiniSplitter ); 1194 mExtensionManager = new ExtensionManager( this, mMiniSplitter );
1194#endif 1195#endif
1195 //eh->hide(); 1196 //eh->hide();
1196 // topLayout->addWidget(mExtensionManager ); 1197 // topLayout->addWidget(mExtensionManager );
1197 1198
1198 1199
1199/*US 1200/*US
1200#ifndef KAB_NOSPLITTER 1201#ifndef KAB_NOSPLITTER
1201 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1202 QHBoxLayout *topLayout = new QHBoxLayout( this );
1202//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1203//US topLayout->setSpacing( KDialogBase::spacingHint() );
diff --git a/kaddressbook/kcmconfigs/addresseewidget.cpp b/kaddressbook/kcmconfigs/addresseewidget.cpp
index 0f3c353..f84b2ba 100644
--- a/kaddressbook/kcmconfigs/addresseewidget.cpp
+++ b/kaddressbook/kcmconfigs/addresseewidget.cpp
@@ -1,236 +1,242 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qgroupbox.h> 24#include <qgroupbox.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlistbox.h> 27#include <qlistbox.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29 29
30#include <kbuttonbox.h> 30#include <kbuttonbox.h>
31#include <kcombobox.h> 31#include <kcombobox.h>
32#include <kconfig.h> 32#include <kconfig.h>
33#include <kdialog.h> 33#include <kdialog.h>
34#include <klocale.h> 34#include <klocale.h>
35#include <kglobal.h> 35#include <kglobal.h>
36#include <klineedit.h> 36#include <klineedit.h>
37#include <kstandarddirs.h> 37#include <kstandarddirs.h>
38 38
39#include "addresseewidget.h" 39#include "addresseewidget.h"
40 40
41NamePartWidget::NamePartWidget( const QString &title, QWidget *parent, 41NamePartWidget::NamePartWidget( const QString &title, QWidget *parent,
42 const char *name ) 42 const char *name )
43 : QWidget( parent, name ) 43 : QWidget( parent, name )
44{ 44{
45 if (KGlobal::getOrientation() == KGlobal::Portrait) 45 if (KGlobal::getOrientation() == KGlobal::Portrait)
46 { 46 {
47 QGridLayout* layout = new QGridLayout( this, 1, 1, KDialog::marginHintSmall(), 47 QGridLayout* layout = new QGridLayout( this, 1, 1, KDialog::marginHintSmall(),
48 KDialog::spacingHintSmall() ); 48 KDialog::spacingHintSmall() );
49 49
50 QLabel *label = new QLabel( i18n( title ), this ); 50 QLabel *label = new QLabel( i18n( title ), this );
51 layout->addWidget( label, 0, 1 ); 51 layout->addWidget( label, 0, 1 );
52 52
53 mBox = new QListBox( this ); 53 mBox = new QListBox( this );
54 mBox->setMaximumSize(70, 70); 54 mBox->setMaximumSize(70, 70);
55 layout->addMultiCellWidget( mBox, 0, 1, 0, 0 ); 55 layout->addMultiCellWidget( mBox, 0, 1, 0, 0 );
56 56
57 KButtonBox *bbox = new KButtonBox( this, Qt::Vertical ); 57 KButtonBox *bbox = new KButtonBox( this, Qt::Vertical );
58 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); 58 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) );
59 mRemoveButton = bbox->addButton( i18n( "Rem" ), this, SLOT( remove() ) ); 59 mRemoveButton = bbox->addButton( i18n( "Rem" ), this, SLOT( remove() ) );
60 bbox->layout(); 60 bbox->layout();
61 layout->addMultiCellWidget( bbox, 0, 2, 2,2); 61 layout->addMultiCellWidget( bbox, 0, 1, 2,2);
62 62
63 mEdit = new KLineEdit( this ); 63 mEdit = new KLineEdit( this );
64 layout->addWidget( mEdit, 1, 1 ); 64 layout->addWidget( mEdit, 1, 1 );
65 //mEdit->setMinimumWidth(50); 65 //mEdit->setMinimumWidth(50);
66 66
67// layout->addWidget( group ); 67// layout->addWidget( group );
68 68
69 } 69 }
70 else 70 else
71 { 71 {
72 QHBoxLayout *layout = new QHBoxLayout( this ); 72 QHBoxLayout *layout = new QHBoxLayout( this );
73 73
74 QGroupBox *group = new QGroupBox( 0, Qt::Vertical, title, this ); 74 QGroupBox *group = new QGroupBox( 0, Qt::Vertical, title, this );
75 QGridLayout *groupLayout = new QGridLayout( group->layout(), 2, 2, 75 QGridLayout *groupLayout = new QGridLayout( group->layout(), 2, 2,
76 KDialog::spacingHint() ); 76 KDialog::spacingHint() );
77 77
78 mBox = new QListBox( group ); 78 mBox = new QListBox( group );
79 79
80 groupLayout->addWidget( mBox, 0, 0 ); 80 groupLayout->addWidget( mBox, 0, 0 );
81 81
82 KButtonBox *bbox = new KButtonBox( group, Qt::Vertical ); 82 KButtonBox *bbox = new KButtonBox( group, Qt::Vertical );
83 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) ); 83 mAddButton = bbox->addButton( i18n( "Add" ), this, SLOT( add() ) );
84 mRemoveButton = bbox->addButton( i18n( "Remove" ), this, SLOT( remove() ) ); 84 mRemoveButton = bbox->addButton( i18n( "Remove" ), this, SLOT( remove() ) );
85 bbox->layout(); 85 bbox->layout();
86 groupLayout->addWidget( bbox, 0, 1 ); 86 groupLayout->addWidget( bbox, 0, 1 );
87 87
88 mEdit = new KLineEdit( group ); 88 mEdit = new KLineEdit( group );
89 groupLayout->addMultiCellWidget( mEdit, 1, 1, 0, 1 ); 89 groupLayout->addMultiCellWidget( mEdit, 1, 1, 0, 1 );
90 90
91 layout->addWidget( group ); 91 layout->addWidget( group );
92 92
93 } 93 }
94 94
95 mAddButton->setEnabled( false ); 95 mAddButton->setEnabled( false );
96 mRemoveButton->setEnabled( false ); 96 mRemoveButton->setEnabled( false );
97 97
98 98
99 connect( mBox, SIGNAL( selectionChanged( QListBoxItem* ) ), 99 connect( mBox, SIGNAL( selectionChanged( QListBoxItem* ) ),
100 SLOT( selectionChanged( QListBoxItem* ) ) ); 100 SLOT( selectionChanged( QListBoxItem* ) ) );
101 connect( mEdit, SIGNAL( textChanged( const QString& ) ), 101 connect( mEdit, SIGNAL( textChanged( const QString& ) ),
102 SLOT( textChanged( const QString& ) ) ); 102 SLOT( textChanged( const QString& ) ) );
103 connect( mEdit, SIGNAL( returnPressed() ), SLOT( add() ) ); 103 connect( mEdit, SIGNAL( returnPressed() ), SLOT( add() ) );
104 104
105} 105}
106 106
107NamePartWidget::~NamePartWidget() 107NamePartWidget::~NamePartWidget()
108{ 108{
109} 109}
110 110
111void NamePartWidget::setNameParts( const QStringList &list ) 111void NamePartWidget::setNameParts( const QStringList &list )
112{ 112{
113 mBox->clear(); 113 mBox->clear();
114 mBox->insertStringList( list ); 114 mBox->insertStringList( list );
115} 115}
116 116
117QStringList NamePartWidget::nameParts() const 117QStringList NamePartWidget::nameParts() const
118{ 118{
119 QStringList parts; 119 QStringList parts;
120 for ( uint i = 0; i < mBox->count(); ++i ) 120 for ( uint i = 0; i < mBox->count(); ++i )
121 parts.append( mBox->text( i ) ); 121 parts.append( mBox->text( i ) );
122 122
123 return parts; 123 return parts;
124} 124}
125 125
126void NamePartWidget::add() 126void NamePartWidget::add()
127{ 127{
128 if ( !mEdit->text().isEmpty() ) { 128 if ( !mEdit->text().isEmpty() ) {
129 mBox->insertItem( mEdit->text() ); 129 mBox->insertItem( mEdit->text() );
130 emit modified(); 130 emit modified();
131 } 131 }
132 132
133 mEdit->setText( "" ); 133 mEdit->setText( "" );
134} 134}
135 135
136void NamePartWidget::remove() 136void NamePartWidget::remove()
137{ 137{
138 mBox->removeItem( mBox->currentItem() ); 138 mBox->removeItem( mBox->currentItem() );
139 if ( mBox->count() == 0 ) 139 if ( mBox->count() == 0 )
140 selectionChanged( 0 ); 140 selectionChanged( 0 );
141 141
142 emit modified(); 142 emit modified();
143} 143}
144 144
145void NamePartWidget::selectionChanged( QListBoxItem *item ) 145void NamePartWidget::selectionChanged( QListBoxItem *item )
146{ 146{
147 mRemoveButton->setEnabled( item != 0 ); 147 mRemoveButton->setEnabled( item != 0 );
148} 148}
149 149
150void NamePartWidget::textChanged( const QString& text ) 150void NamePartWidget::textChanged( const QString& text )
151{ 151{
152 mAddButton->setEnabled( !text.isEmpty() ); 152 mAddButton->setEnabled( !text.isEmpty() );
153} 153}
154 154
155 155
156AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name ) 156AddresseeWidget::AddresseeWidget( QWidget *parent, const char *name )
157 : QWidget( parent, name ) 157 : QWidget( parent, name )
158{ 158{
159 QGridLayout *layout; 159 QGridLayout *layout;
160 160
161 mPrefix = new NamePartWidget( i18n( "Prefixes" ), this ); 161 mPrefix = new NamePartWidget( i18n( "Prefixes" ), this );
162 mInclusion = new NamePartWidget( i18n( "Inclusions" ), this ); 162 mInclusion = new NamePartWidget( i18n( "Inclusions" ), this );
163 mSuffix = new NamePartWidget( i18n( "Suffixes" ), this ); 163 mSuffix = new NamePartWidget( i18n( "Suffixes" ), this );
164 QLabel *label = new QLabel( i18n( "Default formatted name:" ), this ); 164 QString dfn;
165 if (QApplication::desktop()->width() > 320 )
166 dfn = i18n( "Default formatted name:" );
167 else
168 dfn = i18n( "Def. formatted name:" );
169
170 QLabel *label = new QLabel( dfn, this );
165 171
166 mFormattedNameCombo = new KComboBox( this ); 172 mFormattedNameCombo = new KComboBox( this );
167 mFormattedNameCombo->insertItem( i18n( "Empty" ) ); 173 mFormattedNameCombo->insertItem( i18n( "Empty" ) );
168 mFormattedNameCombo->insertItem( i18n( "Simple Name" ) ); 174 mFormattedNameCombo->insertItem( i18n( "Simple Name" ) );
169 mFormattedNameCombo->insertItem( i18n( "Full Name" ) ); 175 mFormattedNameCombo->insertItem( i18n( "Full Name" ) );
170 mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) ); 176 mFormattedNameCombo->insertItem( i18n( "Reverse Name" ) );
171 177
172 if (KGlobal::getOrientation() == KGlobal::Portrait) 178 if (KGlobal::getOrientation() == KGlobal::Portrait)
173 { 179 {
174 layout = new QGridLayout( this, 4, 2, KDialog::marginHint(), 180 layout = new QGridLayout( this, 4, 2, KDialog::marginHintSmall(),
175 KDialog::spacingHint() ); 181 KDialog::spacingHintSmall() );
176 182
177 layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 ); 183 layout->addMultiCellWidget( mPrefix, 0, 0, 0, 1 );
178 layout->addMultiCellWidget( mInclusion, 1, 1, 0, 1 ); 184 layout->addMultiCellWidget( mInclusion, 1, 1, 0, 1 );
179 layout->addMultiCellWidget( mSuffix, 2, 2, 0, 1 ); 185 layout->addMultiCellWidget( mSuffix, 2, 2, 0, 1 );
180 layout->addWidget( label, 3, 0 ); 186 layout->addWidget( label, 3, 0 );
181 layout->addWidget( mFormattedNameCombo, 3, 1 ); 187 layout->addWidget( mFormattedNameCombo, 3, 1 );
182 188
183 } 189 }
184 else 190 else
185 { 191 {
186 layout = new QGridLayout( this, 2, 3, KDialog::marginHint(), 192 layout = new QGridLayout( this, 2, 3, KDialog::marginHint(),
187 KDialog::spacingHint() ); 193 KDialog::spacingHint() );
188 194
189 layout->addWidget( mPrefix, 0, 0 ); 195 layout->addWidget( mPrefix, 0, 0 );
190 layout->addWidget( mInclusion, 0, 1 ); 196 layout->addWidget( mInclusion, 0, 1 );
191 layout->addWidget( mSuffix, 0, 2 ); 197 layout->addWidget( mSuffix, 0, 2 );
192 layout->addWidget( label, 1, 0 ); 198 layout->addWidget( label, 1, 0 );
193 layout->addMultiCellWidget( mFormattedNameCombo, 1, 1, 1, 2 ); 199 layout->addMultiCellWidget( mFormattedNameCombo, 1, 1, 1, 2 );
194 } 200 }
195 201
196 connect( mPrefix, SIGNAL( modified() ), SIGNAL( modified() ) ); 202 connect( mPrefix, SIGNAL( modified() ), SIGNAL( modified() ) );
197 connect( mInclusion, SIGNAL( modified() ), SIGNAL( modified() ) ); 203 connect( mInclusion, SIGNAL( modified() ), SIGNAL( modified() ) );
198 connect( mSuffix, SIGNAL( modified() ), SIGNAL( modified() ) ); 204 connect( mSuffix, SIGNAL( modified() ), SIGNAL( modified() ) );
199 connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SIGNAL( modified() ) ); 205 connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SIGNAL( modified() ) );
200} 206}
201 207
202AddresseeWidget::~AddresseeWidget() 208AddresseeWidget::~AddresseeWidget()
203{ 209{
204} 210}
205 211
206void AddresseeWidget::restoreSettings() 212void AddresseeWidget::restoreSettings()
207{ 213{
208 KConfig config( locateLocal("config", "kabcrc") ); 214 KConfig config( locateLocal("config", "kabcrc") );
209 config.setGroup( "General" ); 215 config.setGroup( "General" );
210 216
211 mPrefix->setNameParts( config.readListEntry( "Prefixes" ) ); 217 mPrefix->setNameParts( config.readListEntry( "Prefixes" ) );
212 mInclusion->setNameParts( config.readListEntry( "Inclusions" ) ); 218 mInclusion->setNameParts( config.readListEntry( "Inclusions" ) );
213 mSuffix->setNameParts( config.readListEntry( "Suffixes" ) ); 219 mSuffix->setNameParts( config.readListEntry( "Suffixes" ) );
214 220
215 KConfig cfg( locateLocal("config","kaddressbookrc") ); 221 KConfig cfg( locateLocal("config","kaddressbookrc") );
216 cfg.setGroup( "General" ); 222 cfg.setGroup( "General" );
217 mFormattedNameCombo->setCurrentItem( cfg.readNumEntry( "FormattedNameType", 1 ) ); 223 mFormattedNameCombo->setCurrentItem( cfg.readNumEntry( "FormattedNameType", 1 ) );
218} 224}
219 225
220void AddresseeWidget::saveSettings() 226void AddresseeWidget::saveSettings()
221{ 227{
222 KConfig config( locateLocal("config","kabcrc") ); 228 KConfig config( locateLocal("config","kabcrc") );
223 config.setGroup( "General" ); 229 config.setGroup( "General" );
224 230
225 config.writeEntry( "Prefixes", mPrefix->nameParts() ); 231 config.writeEntry( "Prefixes", mPrefix->nameParts() );
226 config.writeEntry( "Inclusions", mInclusion->nameParts() ); 232 config.writeEntry( "Inclusions", mInclusion->nameParts() );
227 config.writeEntry( "Suffixes", mSuffix->nameParts() ); 233 config.writeEntry( "Suffixes", mSuffix->nameParts() );
228 234
229 KConfig cfg( locateLocal("config","kaddressbookrc") ); 235 KConfig cfg( locateLocal("config","kaddressbookrc") );
230 cfg.setGroup( "General" ); 236 cfg.setGroup( "General" );
231 cfg.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() ); 237 cfg.writeEntry( "FormattedNameType", mFormattedNameCombo->currentItem() );
232} 238}
233 239
234#ifndef KAB_EMBEDDED 240#ifndef KAB_EMBEDDED
235#include "addresseewidget.moc" 241#include "addresseewidget.moc"
236#endif //KAB_EMBEDDED 242#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
index 7b3e5c6..38c7946 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
@@ -1,304 +1,310 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qframe.h> 25#include <qframe.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qtabwidget.h> 29#include <qtabwidget.h>
30 30
31#include <kconfig.h> 31#include <kconfig.h>
32#include <kdebug.h> 32#include <kdebug.h>
33#include <kdialog.h> 33#include <kdialog.h>
34#include <klistview.h> 34#include <klistview.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kglobal.h> 36#include <kglobal.h>
37#include <kmessagebox.h> 37#include <kmessagebox.h>
38#include <kstandarddirs.h> 38#include <kstandarddirs.h>
39 39
40#ifndef KAB_EMBEDDED 40#ifndef KAB_EMBEDDED
41#include <ktrader.h> 41#include <ktrader.h>
42#else // KAB_EMBEDDED 42#else // KAB_EMBEDDED
43#include <mergewidget.h> 43#include <mergewidget.h>
44#include <distributionlistwidget.h> 44#include <distributionlistwidget.h>
45#endif // KAB_EMBEDDED 45#endif // KAB_EMBEDDED
46 46
47#include "addresseewidget.h" 47#include "addresseewidget.h"
48#include "extensionconfigdialog.h" 48#include "extensionconfigdialog.h"
49#include "extensionwidget.h" 49#include "extensionwidget.h"
50#include "kabprefs.h" 50#include "kabprefs.h"
51 51
52#include "kabconfigwidget.h" 52#include "kabconfigwidget.h"
53 53
54class ExtensionItem : public QCheckListItem 54class ExtensionItem : public QCheckListItem
55{ 55{
56 public: 56 public:
57 57
58#ifndef KAB_EMBEDDED 58#ifndef KAB_EMBEDDED
59 ExtensionItem( QListView *parent, const QString &text ); 59 ExtensionItem( QListView *parent, const QString &text );
60 void setService( const KService::Ptr &ptr ); 60 void setService( const KService::Ptr &ptr );
61#else //KAB_EMBEDDED 61#else //KAB_EMBEDDED
62 ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ); 62 ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment );
63 void setFactory( ExtensionFactory* fac ); 63 void setFactory( ExtensionFactory* fac );
64#endif //KAB_EMBEDDED 64#endif //KAB_EMBEDDED
65 65
66 bool configWidgetAvailable() const; 66 bool configWidgetAvailable() const;
67 ExtensionFactory *factory() const; 67 ExtensionFactory *factory() const;
68 68
69 virtual QString text( int column ) const; 69 virtual QString text( int column ) const;
70 70
71 private: 71 private:
72#ifndef KAB_EMBEDDED 72#ifndef KAB_EMBEDDED
73 KService::Ptr mPtr; 73 KService::Ptr mPtr;
74#else //KAB_EMBEDDED 74#else //KAB_EMBEDDED
75 ExtensionFactory* mFactory; 75 ExtensionFactory* mFactory;
76 QString mName; 76 QString mName;
77 QString mComment; 77 QString mComment;
78 78
79#endif //KAB_EMBEDDED 79#endif //KAB_EMBEDDED
80 80
81}; 81};
82 82
83KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name ) 83KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name )
84 : QWidget( parent, name ) 84 : QWidget( parent, name )
85{ 85{
86 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 86 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
87 KDialog::spacingHint() ); 87 KDialog::spacingHint() );
88 88
89 QTabWidget *tabWidget = new QTabWidget( this ); 89 QTabWidget *tabWidget = new QTabWidget( this );
90 topLayout->addWidget( tabWidget ); 90 topLayout->addWidget( tabWidget );
91 91
92 // General page 92 // General page
93 QWidget *generalPage = new QWidget( this ); 93 QWidget *generalPage = new QWidget( this );
94 QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHint(), 94 QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(),
95 KDialog::spacingHint() ); 95 KDialog::spacingHintSmall() );
96 96
97 QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "General" ), generalPage ); 97 QGroupBox *groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "General" ), generalPage );
98 QVBoxLayout *boxLayout = new QVBoxLayout( groupBox->layout() ); 98 QVBoxLayout *boxLayout = new QVBoxLayout( groupBox->layout() );
99 boxLayout->setAlignment( Qt::AlignTop ); 99 boxLayout->setAlignment( Qt::AlignTop );
100 100 boxLayout->setMargin(KDialog::marginHintSmall() );
101 groupBox->layout()->setMargin(KDialog::marginHintSmall()) ;
102 groupBox->layout()->setSpacing(KDialog::spacingHintSmall());
103 boxLayout->setSpacing( KDialog::spacingHintSmall() );
101 mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), groupBox, "msingle" ); 104 mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), groupBox, "msingle" );
102 boxLayout->addWidget( mViewsSingleClickBox ); 105 boxLayout->addWidget( mViewsSingleClickBox );
103 106
104 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), groupBox, "mparse" ); 107 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), groupBox, "mparse" );
105 boxLayout->addWidget( mNameParsing ); 108 boxLayout->addWidget( mNameParsing );
106 109
107 layout->addWidget( groupBox ); 110 layout->addWidget( groupBox );
108 111
109 groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions" ), generalPage ); 112 groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions" ), generalPage );
110 boxLayout = new QVBoxLayout( groupBox->layout() ); 113 boxLayout = new QVBoxLayout( groupBox->layout() );
111 boxLayout->setAlignment( Qt::AlignTop ); 114 boxLayout->setAlignment( Qt::AlignTop );
112 115 boxLayout->setMargin(KDialog::marginHintSmall());
116 boxLayout->setSpacing(KDialog::spacingHintSmall());
117 groupBox->layout()->setMargin(1) ;
118 groupBox->layout()->setSpacing(0);
113 mExtensionView = new KListView( groupBox ); 119 mExtensionView = new KListView( groupBox );
114 mExtensionView->setAllColumnsShowFocus( true ); 120 mExtensionView->setAllColumnsShowFocus( true );
115 mExtensionView->addColumn( i18n( "Name" ) ); 121 mExtensionView->addColumn( i18n( "Name" ) );
116 mExtensionView->addColumn( i18n( "Description" ) ); 122 mExtensionView->addColumn( i18n( "Description" ) );
117 mExtensionView->setMaximumHeight(80); 123 mExtensionView->setMaximumHeight(80);
118 124
119 boxLayout->addWidget( mExtensionView ); 125 boxLayout->addWidget( mExtensionView );
120 126
121 mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); 127 mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox );
122 mConfigureButton->setEnabled( false ); 128 mConfigureButton->setEnabled( false );
123 boxLayout->addWidget( mConfigureButton ); 129 boxLayout->addWidget( mConfigureButton );
124 130
125 layout->addWidget( groupBox ); 131 layout->addWidget( groupBox );
126 132
127 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 133 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
128 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 134 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
129 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), 135 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ),
130 SLOT( selectionChanged( QListViewItem* ) ) ); 136 SLOT( selectionChanged( QListViewItem* ) ) );
131 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), 137 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ),
132 SLOT( itemClicked( QListViewItem* ) ) ); 138 SLOT( itemClicked( QListViewItem* ) ) );
133 connect( mConfigureButton, SIGNAL( clicked() ), 139 connect( mConfigureButton, SIGNAL( clicked() ),
134 SLOT( configureExtension() ) ); 140 SLOT( configureExtension() ) );
135 141
136 tabWidget->addTab( generalPage, i18n( "General" ) ); 142 tabWidget->addTab( generalPage, i18n( "General" ) );
137 143
138 // Addressee page 144 // Addressee page
139 mAddresseeWidget = new AddresseeWidget( this ); 145 mAddresseeWidget = new AddresseeWidget( this );
140 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); 146 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) );
141 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); 147 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) );
142} 148}
143 149
144void KABConfigWidget::restoreSettings() 150void KABConfigWidget::restoreSettings()
145{ 151{
146 bool blocked = signalsBlocked(); 152 bool blocked = signalsBlocked();
147 blockSignals( true ); 153 blockSignals( true );
148 154
149 mNameParsing->setChecked( KABPrefs::instance()->mAutomaticNameParsing ); 155 mNameParsing->setChecked( KABPrefs::instance()->mAutomaticNameParsing );
150 mViewsSingleClickBox->setChecked( KABPrefs::instance()->mHonorSingleClick ); 156 mViewsSingleClickBox->setChecked( KABPrefs::instance()->mHonorSingleClick );
151 mAddresseeWidget->restoreSettings(); 157 mAddresseeWidget->restoreSettings();
152 158
153 restoreExtensionSettings(); 159 restoreExtensionSettings();
154 160
155 blockSignals( blocked ); 161 blockSignals( blocked );
156 162
157 emit changed( false ); 163 emit changed( false );
158} 164}
159 165
160void KABConfigWidget::saveSettings() 166void KABConfigWidget::saveSettings()
161{ 167{
162 KABPrefs::instance()->mAutomaticNameParsing = mNameParsing->isChecked(); 168 KABPrefs::instance()->mAutomaticNameParsing = mNameParsing->isChecked();
163 KABPrefs::instance()->mHonorSingleClick = mViewsSingleClickBox->isChecked(); 169 KABPrefs::instance()->mHonorSingleClick = mViewsSingleClickBox->isChecked();
164 mAddresseeWidget->saveSettings(); 170 mAddresseeWidget->saveSettings();
165 171
166 saveExtensionSettings(); 172 saveExtensionSettings();
167 KABPrefs::instance()->writeConfig(); 173 KABPrefs::instance()->writeConfig();
168 174
169 emit changed( false ); 175 emit changed( false );
170} 176}
171 177
172void KABConfigWidget::defaults() 178void KABConfigWidget::defaults()
173{ 179{
174 mNameParsing->setChecked( true ); 180 mNameParsing->setChecked( true );
175 mViewsSingleClickBox->setChecked( false ); 181 mViewsSingleClickBox->setChecked( false );
176 182
177 emit changed( true ); 183 emit changed( true );
178} 184}
179 185
180void KABConfigWidget::modified() 186void KABConfigWidget::modified()
181{ 187{
182 emit changed( true ); 188 emit changed( true );
183} 189}
184 190
185void KABConfigWidget::restoreExtensionSettings() 191void KABConfigWidget::restoreExtensionSettings()
186{ 192{
187 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; 193 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions;
188 194
189 mExtensionView->clear(); 195 mExtensionView->clear();
190 196
191#ifndef KAB_EMBEDDED 197#ifndef KAB_EMBEDDED
192 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); 198 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" );
193 KTrader::OfferList::ConstIterator it; 199 KTrader::OfferList::ConstIterator it;
194 for ( it = plugins.begin(); it != plugins.end(); ++it ) { 200 for ( it = plugins.begin(); it != plugins.end(); ++it ) {
195 if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) ) 201 if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) )
196 continue; 202 continue;
197 203
198 ExtensionItem *item = new ExtensionItem( mExtensionView, (*it)->name() ); 204 ExtensionItem *item = new ExtensionItem( mExtensionView, (*it)->name() );
199 item->setService( *it ); 205 item->setService( *it );
200 if ( activeExtensions.contains( item->factory()->identifier() ) ) 206 if ( activeExtensions.contains( item->factory()->identifier() ) )
201 item->setOn( true ); 207 item->setOn( true );
202 } 208 }
203#else //KAB_EMBEDDED 209#else //KAB_EMBEDDED
204 ExtensionFactory *extensionFactory = new MergeFactory(); 210 ExtensionFactory *extensionFactory = new MergeFactory();
205 211
206 ExtensionItem *item = new ExtensionItem( mExtensionView, "Merge", "Merge", "Merge contacts"); 212 ExtensionItem *item = new ExtensionItem( mExtensionView, "Merge", "Merge", "Merge contacts");
207 213
208 item->setFactory( extensionFactory ); 214 item->setFactory( extensionFactory );
209 if ( activeExtensions.contains( extensionFactory->identifier() ) ) 215 if ( activeExtensions.contains( extensionFactory->identifier() ) )
210 item->setOn( true ); 216 item->setOn( true );
211 217
212 218
213 219
214 extensionFactory = new DistributionListFactory(); 220 extensionFactory = new DistributionListFactory();
215 221
216 item = new ExtensionItem( mExtensionView, "Distribution List", "Distribution List", "Manage Distribution Lists"); 222 item = new ExtensionItem( mExtensionView, "Distribution List", "Distribution List", "Manage Distribution Lists");
217 223
218 item->setFactory( extensionFactory ); 224 item->setFactory( extensionFactory );
219 if ( activeExtensions.contains( extensionFactory->identifier() ) ) 225 if ( activeExtensions.contains( extensionFactory->identifier() ) )
220 item->setOn( true ); 226 item->setOn( true );
221 227
222 228
223#endif //KAB_EMBEDDED 229#endif //KAB_EMBEDDED
224 230
225} 231}
226 232
227void KABConfigWidget::saveExtensionSettings() 233void KABConfigWidget::saveExtensionSettings()
228{ 234{
229 QStringList activeExtensions; 235 QStringList activeExtensions;
230 236
231 QPtrList<QListViewItem> list; 237 QPtrList<QListViewItem> list;
232 QListViewItemIterator it( mExtensionView ); 238 QListViewItemIterator it( mExtensionView );
233 while ( it.current() ) { 239 while ( it.current() ) {
234 ExtensionItem *item = static_cast<ExtensionItem*>( it.current() ); 240 ExtensionItem *item = static_cast<ExtensionItem*>( it.current() );
235 if ( item ) { 241 if ( item ) {
236 if ( item->isOn() ) 242 if ( item->isOn() )
237 activeExtensions.append( item->factory()->identifier() ); 243 activeExtensions.append( item->factory()->identifier() );
238 } 244 }
239 ++it; 245 ++it;
240 } 246 }
241 247
242 KABPrefs::instance()->mActiveExtensions = activeExtensions; 248 KABPrefs::instance()->mActiveExtensions = activeExtensions;
243} 249}
244 250
245void KABConfigWidget::configureExtension() 251void KABConfigWidget::configureExtension()
246{ 252{
247 ExtensionItem *item = static_cast<ExtensionItem*>( mExtensionView->currentItem() ); 253 ExtensionItem *item = static_cast<ExtensionItem*>( mExtensionView->currentItem() );
248 if ( !item ) 254 if ( !item )
249 return; 255 return;
250 256
251#ifndef KAB_EMBEDDED 257#ifndef KAB_EMBEDDED
252 KConfig config( "kaddressbookrc" ); 258 KConfig config( "kaddressbookrc" );
253#else //KAB_EMBEDDED 259#else //KAB_EMBEDDED
254 KConfig config( locateLocal("config", "kaddressbookrc") ); 260 KConfig config( locateLocal("config", "kaddressbookrc") );
255#endif //KAB_EMBEDDED 261#endif //KAB_EMBEDDED
256 config.setGroup( QString( "Extensions_%1" ).arg( item->factory()->identifier() ) ); 262 config.setGroup( QString( "Extensions_%1" ).arg( item->factory()->identifier() ) );
257 263
258 ExtensionConfigDialog dlg( item->factory(), &config, this ); 264 ExtensionConfigDialog dlg( item->factory(), &config, this );
259 dlg.exec(); 265 dlg.exec();
260 266
261 config.sync(); 267 config.sync();
262} 268}
263 269
264void KABConfigWidget::selectionChanged( QListViewItem *i ) 270void KABConfigWidget::selectionChanged( QListViewItem *i )
265{ 271{
266 ExtensionItem *item = static_cast<ExtensionItem*>( i ); 272 ExtensionItem *item = static_cast<ExtensionItem*>( i );
267 if ( !item ) 273 if ( !item )
268 return; 274 return;
269 275
270 mConfigureButton->setEnabled( item->configWidgetAvailable() ); 276 mConfigureButton->setEnabled( item->configWidgetAvailable() );
271} 277}
272 278
273void KABConfigWidget::itemClicked( QListViewItem *item ) 279void KABConfigWidget::itemClicked( QListViewItem *item )
274{ 280{
275 if ( item != 0 ) 281 if ( item != 0 )
276 modified(); 282 modified();
277} 283}
278 284
279#ifndef KAB_EMBEDDED 285#ifndef KAB_EMBEDDED
280ExtensionItem::ExtensionItem( QListView *parent, const QString &text ) 286ExtensionItem::ExtensionItem( QListView *parent, const QString &text )
281 : QCheckListItem( parent, text, CheckBox ) 287 : QCheckListItem( parent, text, CheckBox )
282{ 288{
283} 289}
284 290
285void ExtensionItem::setService( const KService::Ptr &ptr ) 291void ExtensionItem::setService( const KService::Ptr &ptr )
286{ 292{
287 mPtr = ptr; 293 mPtr = ptr;
288} 294}
289#else //KAB_EMBEDDED 295#else //KAB_EMBEDDED
290ExtensionItem::ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ) 296ExtensionItem::ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment )
291 : QCheckListItem( parent, text, CheckBox ) 297 : QCheckListItem( parent, text, CheckBox )
292{ 298{
293 mName = name; 299 mName = name;
294 mComment = comment; 300 mComment = comment;
295} 301}
296 302
297 303
298void ExtensionItem::setFactory( ExtensionFactory* fac ) 304void ExtensionItem::setFactory( ExtensionFactory* fac )
299{ 305{
300 mFactory = fac; 306 mFactory = fac;
301} 307}
302#endif //KAB_EMBEDDED 308#endif //KAB_EMBEDDED
303 309
304bool ExtensionItem::configWidgetAvailable() const 310bool ExtensionItem::configWidgetAvailable() const
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.cpp b/kaddressbook/kcmconfigs/kcmkabconfig.cpp
index 791a940..a278042 100644
--- a/kaddressbook/kcmconfigs/kcmkabconfig.cpp
+++ b/kaddressbook/kcmconfigs/kcmkabconfig.cpp
@@ -1,86 +1,90 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25 25
26#ifndef KAB_EMBEDDED 26#ifndef KAB_EMBEDDED
27#include <kaboutdata.h> 27#include <kaboutdata.h>
28#endif //KAB_EMBEDDED 28#endif //KAB_EMBEDDED
29#include <kdebug.h> 29#include <kdebug.h>
30#include <klocale.h> 30#include <klocale.h>
31#include <stdlib.h>
31 32
32#include "kabconfigwidget.h" 33#include "kabconfigwidget.h"
33 34
34#include "kcmkabconfig.h" 35#include "kcmkabconfig.h"
35 36
36extern "C" 37extern "C"
37{ 38{
38 KCModule *create_kabconfig( QWidget *parent, const char * ) { 39 KCModule *create_kabconfig( QWidget *parent, const char * ) {
39 return new KCMKabConfig( parent, "kcmkabconfig" ); 40 return new KCMKabConfig( parent, "kcmkabconfig" );
40 } 41 }
41} 42}
42 43
43KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) 44KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name )
44 : KCModule( parent, name ) 45 : KCModule( parent, name )
45{ 46{
47 //abort();
46 QVBoxLayout *layout = new QVBoxLayout( this ); 48 QVBoxLayout *layout = new QVBoxLayout( this );
47 mConfigWidget = new KABConfigWidget( this, "mConfigWidget" ); 49 mConfigWidget = new KABConfigWidget( this, "mConfigWidget" );
48 layout->addWidget( mConfigWidget ); 50 layout->addWidget( mConfigWidget );
49 51 layout->setSpacing( 0 );
52 layout->setMargin( 0 );
53
50 connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); 54 connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) );
51 load(); 55 load();
52} 56}
53 57
54void KCMKabConfig::load() 58void KCMKabConfig::load()
55{ 59{
56 mConfigWidget->restoreSettings(); 60 mConfigWidget->restoreSettings();
57} 61}
58 62
59void KCMKabConfig::save() 63void KCMKabConfig::save()
60{ 64{
61 mConfigWidget->saveSettings(); 65 mConfigWidget->saveSettings();
62} 66}
63 67
64void KCMKabConfig::defaults() 68void KCMKabConfig::defaults()
65{ 69{
66 mConfigWidget->defaults(); 70 mConfigWidget->defaults();
67} 71}
68 72
69#ifndef KAB_EMBEDDED 73#ifndef KAB_EMBEDDED
70const KAboutData* KCMKabConfig::aboutData() const 74const KAboutData* KCMKabConfig::aboutData() const
71{ 75{
72 KAboutData *about = new KAboutData( I18N_NOOP( "kcmkabconfig" ), 76 KAboutData *about = new KAboutData( I18N_NOOP( "kcmkabconfig" ),
73 I18N_NOOP( "KAddressBook Configure Dialog" ), 77 I18N_NOOP( "KAddressBook Configure Dialog" ),
74 0, 0, KAboutData::License_GPL, 78 0, 0, KAboutData::License_GPL,
75 I18N_NOOP( "(c), 2003 Tobias Koenig" ) ); 79 I18N_NOOP( "(c), 2003 Tobias Koenig" ) );
76 80
77 about->addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" ); 81 about->addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" );
78 82
79 return about; 83 return about;
80 84
81} 85}
82#endif //KAB_EMBEDDED 86#endif //KAB_EMBEDDED
83 87
84#ifndef KAB_EMBEDDED 88#ifndef KAB_EMBEDDED
85#include "kcmkabconfig.moc" 89#include "kcmkabconfig.moc"
86#endif //KAB_EMBEDDED 90#endif //KAB_EMBEDDED