-rw-r--r-- | kaddressbook/addresseeeditorwidget.cpp | 12 | ||||
-rw-r--r-- | kaddressbook/imagewidget.cpp | 28 | ||||
-rw-r--r-- | kaddressbook/imagewidget.h | 2 |
3 files changed, 36 insertions, 6 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp index c6993e9..bd32859 100644 --- a/kaddressbook/addresseeeditorwidget.cpp +++ b/kaddressbook/addresseeeditorwidget.cpp | |||
@@ -745,604 +745,614 @@ void AddresseeEditorWidget::setupTab2_1() | |||
745 | 745 | ||
746 | label = new QLabel( i18n( "Department:" ), tab2 ); | 746 | label = new QLabel( i18n( "Department:" ), tab2 ); |
747 | layout->addWidget( label, 0, 1 ); | 747 | layout->addWidget( label, 0, 1 ); |
748 | mDepartmentEdit = new KLineEdit( tab2 ); | 748 | mDepartmentEdit = new KLineEdit( tab2 ); |
749 | connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), | 749 | connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), |
750 | SLOT( textChanged( const QString& ) ) ); | 750 | SLOT( textChanged( const QString& ) ) ); |
751 | label->setBuddy( mDepartmentEdit ); | 751 | label->setBuddy( mDepartmentEdit ); |
752 | layout->addWidget( mDepartmentEdit, 0, 2 ); | 752 | layout->addWidget( mDepartmentEdit, 0, 2 ); |
753 | 753 | ||
754 | label = new QLabel( i18n( "Office:" ), tab2 ); | 754 | label = new QLabel( i18n( "Office:" ), tab2 ); |
755 | layout->addWidget( label, 1, 1 ); | 755 | layout->addWidget( label, 1, 1 ); |
756 | mOfficeEdit = new KLineEdit( tab2 ); | 756 | mOfficeEdit = new KLineEdit( tab2 ); |
757 | connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), | 757 | connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), |
758 | SLOT( textChanged( const QString& ) ) ); | 758 | SLOT( textChanged( const QString& ) ) ); |
759 | label->setBuddy( mOfficeEdit ); | 759 | label->setBuddy( mOfficeEdit ); |
760 | layout->addWidget( mOfficeEdit, 1, 2 ); | 760 | layout->addWidget( mOfficeEdit, 1, 2 ); |
761 | 761 | ||
762 | label = new QLabel( i18n( "Profession:" ), tab2 ); | 762 | label = new QLabel( i18n( "Profession:" ), tab2 ); |
763 | layout->addWidget( label, 2, 1 ); | 763 | layout->addWidget( label, 2, 1 ); |
764 | mProfessionEdit = new KLineEdit( tab2 ); | 764 | mProfessionEdit = new KLineEdit( tab2 ); |
765 | connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), | 765 | connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), |
766 | SLOT( textChanged( const QString& ) ) ); | 766 | SLOT( textChanged( const QString& ) ) ); |
767 | label->setBuddy( mProfessionEdit ); | 767 | label->setBuddy( mProfessionEdit ); |
768 | layout->addWidget( mProfessionEdit, 2, 2 ); | 768 | layout->addWidget( mProfessionEdit, 2, 2 ); |
769 | 769 | ||
770 | label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); | 770 | label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); |
771 | layout->addWidget( label, 0, 3 ); | 771 | layout->addWidget( label, 0, 3 ); |
772 | mManagerEdit = new KLineEdit( tab2 ); | 772 | mManagerEdit = new KLineEdit( tab2 ); |
773 | connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), | 773 | connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), |
774 | SLOT( textChanged( const QString& ) ) ); | 774 | SLOT( textChanged( const QString& ) ) ); |
775 | label->setBuddy( mManagerEdit ); | 775 | label->setBuddy( mManagerEdit ); |
776 | layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); | 776 | layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); |
777 | 777 | ||
778 | label = new QLabel( i18n( "Assistant's name:" ), tab2 ); | 778 | label = new QLabel( i18n( "Assistant's name:" ), tab2 ); |
779 | layout->addWidget( label, 1, 3 ); | 779 | layout->addWidget( label, 1, 3 ); |
780 | mAssistantEdit = new KLineEdit( tab2 ); | 780 | mAssistantEdit = new KLineEdit( tab2 ); |
781 | connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), | 781 | connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), |
782 | SLOT( textChanged( const QString& ) ) ); | 782 | SLOT( textChanged( const QString& ) ) ); |
783 | label->setBuddy( mAssistantEdit ); | 783 | label->setBuddy( mAssistantEdit ); |
784 | layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); | 784 | layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); |
785 | 785 | ||
786 | bar = new KSeparator( KSeparator::HLine, tab2 ); | 786 | bar = new KSeparator( KSeparator::HLine, tab2 ); |
787 | layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); | 787 | layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); |
788 | 788 | ||
789 | ///////////////////////////////////////////////// | 789 | ///////////////////////////////////////////////// |
790 | // Personal info | 790 | // Personal info |
791 | 791 | ||
792 | label = new QLabel( tab2 ); | 792 | label = new QLabel( tab2 ); |
793 | //US loadIcon call is ambiguous. Add one more parameter | 793 | //US loadIcon call is ambiguous. Add one more parameter |
794 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); | 794 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); |
795 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); | 795 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); |
796 | layout->addMultiCellWidget( label, 4, 5, 0, 0 ); | 796 | layout->addMultiCellWidget( label, 4, 5, 0, 0 ); |
797 | 797 | ||
798 | label = new QLabel( i18n( "Nick name:" ), tab2 ); | 798 | label = new QLabel( i18n( "Nick name:" ), tab2 ); |
799 | layout->addWidget( label, 4, 1 ); | 799 | layout->addWidget( label, 4, 1 ); |
800 | mNicknameEdit = new KLineEdit( tab2 ); | 800 | mNicknameEdit = new KLineEdit( tab2 ); |
801 | connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), | 801 | connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), |
802 | SLOT( textChanged( const QString& ) ) ); | 802 | SLOT( textChanged( const QString& ) ) ); |
803 | label->setBuddy( mNicknameEdit ); | 803 | label->setBuddy( mNicknameEdit ); |
804 | layout->addWidget( mNicknameEdit, 4, 2 ); | 804 | layout->addWidget( mNicknameEdit, 4, 2 ); |
805 | 805 | ||
806 | label = new QLabel( i18n( "Spouse's name:" ), tab2 ); | 806 | label = new QLabel( i18n( "Spouse's name:" ), tab2 ); |
807 | layout->addWidget( label, 5, 1 ); | 807 | layout->addWidget( label, 5, 1 ); |
808 | mSpouseEdit = new KLineEdit( tab2 ); | 808 | mSpouseEdit = new KLineEdit( tab2 ); |
809 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), | 809 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), |
810 | SLOT( textChanged( const QString& ) ) ); | 810 | SLOT( textChanged( const QString& ) ) ); |
811 | label->setBuddy( mSpouseEdit ); | 811 | label->setBuddy( mSpouseEdit ); |
812 | layout->addWidget( mSpouseEdit, 5, 2 ); | 812 | layout->addWidget( mSpouseEdit, 5, 2 ); |
813 | 813 | ||
814 | label = new QLabel( i18n( "Birthday:" ), tab2 ); | 814 | label = new QLabel( i18n( "Birthday:" ), tab2 ); |
815 | layout->addWidget( label, 4, 3 ); | 815 | layout->addWidget( label, 4, 3 ); |
816 | mBirthdayPicker = new KDateEdit( tab2 ); | 816 | mBirthdayPicker = new KDateEdit( tab2 ); |
817 | mBirthdayPicker->setHandleInvalid( true ); | 817 | mBirthdayPicker->setHandleInvalid( true ); |
818 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), | 818 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), |
819 | SLOT( dateChanged( QDate ) ) ); | 819 | SLOT( dateChanged( QDate ) ) ); |
820 | connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), | 820 | connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), |
821 | SLOT( invalidDate() ) ); | 821 | SLOT( invalidDate() ) ); |
822 | connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), | 822 | connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), |
823 | SLOT( emitModified() ) ); | 823 | SLOT( emitModified() ) ); |
824 | label->setBuddy( mBirthdayPicker ); | 824 | label->setBuddy( mBirthdayPicker ); |
825 | layout->addWidget( mBirthdayPicker, 4, 4 ); | 825 | layout->addWidget( mBirthdayPicker, 4, 4 ); |
826 | 826 | ||
827 | label = new QLabel( i18n( "Anniversary:" ), tab2 ); | 827 | label = new QLabel( i18n( "Anniversary:" ), tab2 ); |
828 | layout->addWidget( label, 5, 3 ); | 828 | layout->addWidget( label, 5, 3 ); |
829 | mAnniversaryPicker = new KDateEdit( tab2 ); | 829 | mAnniversaryPicker = new KDateEdit( tab2 ); |
830 | mAnniversaryPicker->setHandleInvalid( true ); | 830 | mAnniversaryPicker->setHandleInvalid( true ); |
831 | connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), | 831 | connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), |
832 | SLOT( dateChanged( QDate ) ) ); | 832 | SLOT( dateChanged( QDate ) ) ); |
833 | connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ), | 833 | connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ), |
834 | SLOT( invalidDate() ) ); | 834 | SLOT( invalidDate() ) ); |
835 | connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ), | 835 | connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ), |
836 | SLOT( emitModified() ) ); | 836 | SLOT( emitModified() ) ); |
837 | label->setBuddy( mAnniversaryPicker ); | 837 | label->setBuddy( mAnniversaryPicker ); |
838 | layout->addWidget( mAnniversaryPicker, 5, 4 ); | 838 | layout->addWidget( mAnniversaryPicker, 5, 4 ); |
839 | 839 | ||
840 | bar = new KSeparator( KSeparator::HLine, tab2 ); | 840 | bar = new KSeparator( KSeparator::HLine, tab2 ); |
841 | layout->addMultiCellWidget( bar, 6, 6, 0, 5 ); | 841 | layout->addMultiCellWidget( bar, 6, 6, 0, 5 ); |
842 | */ | 842 | */ |
843 | ////////////////////////////////////// | 843 | ////////////////////////////////////// |
844 | // Notes | 844 | // Notes |
845 | label = new QLabel( i18n( "Note:" ), tab2_2 ); | 845 | label = new QLabel( i18n( "Note:" ), tab2_2 ); |
846 | label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); | 846 | label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); |
847 | //US layout->addWidget( label, 7, 0 ); | 847 | //US layout->addWidget( label, 7, 0 ); |
848 | layout->addWidget( label, 0, 0 ); | 848 | layout->addWidget( label, 0, 0 ); |
849 | #ifndef KAB_EMBEDDED | 849 | #ifndef KAB_EMBEDDED |
850 | mNoteEdit = new QTextEdit( tab2_2 ); | 850 | mNoteEdit = new QTextEdit( tab2_2 ); |
851 | mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); | 851 | mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); |
852 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); | 852 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); |
853 | #else //KAB_EMBEDDED | 853 | #else //KAB_EMBEDDED |
854 | mNoteEdit = new QMultiLineEdit( tab2_2 ); | 854 | mNoteEdit = new QMultiLineEdit( tab2_2 ); |
855 | mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); | 855 | mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); |
856 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); | 856 | mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); |
857 | #endif //KAB_EMBEDDED | 857 | #endif //KAB_EMBEDDED |
858 | 858 | ||
859 | connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); | 859 | connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); |
860 | label->setBuddy( mNoteEdit ); | 860 | label->setBuddy( mNoteEdit ); |
861 | //US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); | 861 | //US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); |
862 | layout->addWidget( mNoteEdit, 1, 0); | 862 | layout->addWidget( mNoteEdit, 1, 0); |
863 | 863 | ||
864 | // Build the layout and add to the tab widget | 864 | // Build the layout and add to the tab widget |
865 | layout->activate(); // required | 865 | layout->activate(); // required |
866 | 866 | ||
867 | mTabWidget->addTab( tab2_2, i18n( "&Notes" ) ); | 867 | mTabWidget->addTab( tab2_2, i18n( "&Notes" ) ); |
868 | } | 868 | } |
869 | 869 | ||
870 | 870 | ||
871 | 871 | ||
872 | void AddresseeEditorWidget::setupTab3() | 872 | void AddresseeEditorWidget::setupTab3() |
873 | { | 873 | { |
874 | // This is the Misc tab | 874 | // This is the Misc tab |
875 | QWidget *tab3 = new QWidget( mTabWidget ); | 875 | QWidget *tab3 = new QWidget( mTabWidget ); |
876 | 876 | ||
877 | QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); | 877 | QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); |
878 | layout->setMargin( KDialogBase::marginHintSmall() ); | 878 | layout->setMargin( KDialogBase::marginHintSmall() ); |
879 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 879 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
880 | //US layout->setColStretch( 2, 1 ); | 880 | //US layout->setColStretch( 2, 1 ); |
881 | 881 | ||
882 | ////////////////////////////////////// | 882 | ////////////////////////////////////// |
883 | // Geo | 883 | // Geo |
884 | mGeoWidget = new GeoWidget( tab3 ); | 884 | mGeoWidget = new GeoWidget( tab3 ); |
885 | // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); | 885 | // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); |
886 | connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 886 | connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
887 | layout->addWidget( mGeoWidget, 0, 0 ); | 887 | layout->addWidget( mGeoWidget, 0, 0 ); |
888 | /*US | 888 | /*US |
889 | ////////////////////////////////////// | 889 | ////////////////////////////////////// |
890 | // Sound | 890 | // Sound |
891 | #ifndef KAB_EMBEDDED | 891 | #ifndef KAB_EMBEDDED |
892 | mSoundWidget = new SoundWidget( tab3 ); | 892 | mSoundWidget = new SoundWidget( tab3 ); |
893 | mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); | 893 | mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); |
894 | connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 894 | connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
895 | layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); | 895 | layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); |
896 | #else //KAB_EMBEDDED | 896 | #else //KAB_EMBEDDED |
897 | qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); | 897 | qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); |
898 | #endif //KAB_EMBEDDED | 898 | #endif //KAB_EMBEDDED |
899 | 899 | ||
900 | ////////////////////////////////////// | 900 | ////////////////////////////////////// |
901 | // Images | 901 | // Images |
902 | mImageWidget = new ImageWidget( tab3 ); | 902 | mImageWidget = new ImageWidget( tab3 ); |
903 | mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); | 903 | mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); |
904 | connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 904 | connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
905 | layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop ); | 905 | layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop ); |
906 | */ | 906 | */ |
907 | //US | 907 | //US |
908 | /* | 908 | /* |
909 | KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 ); | 909 | KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 ); |
910 | layout->addMultiCellWidget( bar, 1, 1, 0, 0 ); | 910 | layout->addMultiCellWidget( bar, 1, 1, 0, 0 ); |
911 | */ | 911 | */ |
912 | ////////////////////////////////////// | 912 | ////////////////////////////////////// |
913 | // Keys | 913 | // Keys |
914 | mKeyWidget = new KeyWidget( tab3 ); | 914 | mKeyWidget = new KeyWidget( tab3 ); |
915 | //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); | 915 | //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); |
916 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 916 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
917 | //US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); | 917 | //US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); |
918 | layout->addWidget( mKeyWidget, 1, 0 ); | 918 | layout->addWidget( mKeyWidget, 1, 0 ); |
919 | 919 | ||
920 | mTabWidget->addTab( tab3, i18n( "&Misc" ) ); | 920 | mTabWidget->addTab( tab3, i18n( "&Misc" ) ); |
921 | } | 921 | } |
922 | 922 | ||
923 | void AddresseeEditorWidget::setupTab3_1() | 923 | void AddresseeEditorWidget::setupTab3_1() |
924 | { | 924 | { |
925 | // This is the Misc tab | 925 | // This is the Misc tab |
926 | QWidget *tab3 = new QWidget( mTabWidget ); | 926 | QWidget *tab3 = new QWidget( mTabWidget ); |
927 | 927 | ||
928 | //US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); | 928 | //US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); |
929 | QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); | 929 | QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); |
930 | layout->setMargin( KDialogBase::marginHint() ); | 930 | layout->setMargin( KDialogBase::marginHint() ); |
931 | layout->setSpacing( KDialogBase::spacingHint() ); | 931 | layout->setSpacing( KDialogBase::spacingHint() ); |
932 | //US layout->setColStretch( 2, 1 ); | 932 | //US layout->setColStretch( 2, 1 ); |
933 | 933 | ||
934 | /*US | 934 | /*US |
935 | ////////////////////////////////////// | 935 | ////////////////////////////////////// |
936 | // Geo | 936 | // Geo |
937 | mGeoWidget = new GeoWidget( tab3 ); | 937 | mGeoWidget = new GeoWidget( tab3 ); |
938 | mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); | 938 | mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); |
939 | connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 939 | connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
940 | layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop ); | 940 | layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop ); |
941 | */ | 941 | */ |
942 | ////////////////////////////////////// | 942 | ////////////////////////////////////// |
943 | // Sound | 943 | // Sound |
944 | #ifndef KAB_EMBEDDED | 944 | #ifndef KAB_EMBEDDED |
945 | mSoundWidget = new SoundWidget( tab3 ); | 945 | mSoundWidget = new SoundWidget( tab3 ); |
946 | mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); | 946 | mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); |
947 | connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 947 | connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
948 | layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); | 948 | layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); |
949 | #else //KAB_EMBEDDED | 949 | #else //KAB_EMBEDDED |
950 | //US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); | 950 | //US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); |
951 | #endif //KAB_EMBEDDED | 951 | #endif //KAB_EMBEDDED |
952 | 952 | ||
953 | ////////////////////////////////////// | 953 | ////////////////////////////////////// |
954 | // Images | 954 | // Images |
955 | mImageWidget = new ImageWidget( tab3 ); | 955 | mImageWidget = new ImageWidget( tab3 ); |
956 | mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); | 956 | mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); |
957 | connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 957 | connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
958 | layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop ); | 958 | layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop ); |
959 | /*US | 959 | /*US |
960 | ////////////////////////////////////// | 960 | ////////////////////////////////////// |
961 | // Keys | 961 | // Keys |
962 | mKeyWidget = new KeyWidget( tab3 ); | 962 | mKeyWidget = new KeyWidget( tab3 ); |
963 | mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); | 963 | mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); |
964 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 964 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
965 | layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); | 965 | layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); |
966 | */ | 966 | */ |
967 | mTabWidget->addTab( tab3, i18n( "&Images" ) ); | 967 | mTabWidget->addTab( tab3, i18n( "&Images" ) ); |
968 | } | 968 | } |
969 | 969 | ||
970 | 970 | ||
971 | void AddresseeEditorWidget::load() | 971 | void AddresseeEditorWidget::load() |
972 | { | 972 | { |
973 | 973 | ||
974 | // Block signals in case anything tries to emit modified | 974 | // Block signals in case anything tries to emit modified |
975 | // CS: This doesn't seem to work. | 975 | // CS: This doesn't seem to work. |
976 | bool block = signalsBlocked(); | 976 | bool block = signalsBlocked(); |
977 | blockSignals( true ); | 977 | blockSignals( true ); |
978 | mBlockSignals = true; // used for internal signal blocking | 978 | mBlockSignals = true; // used for internal signal blocking |
979 | 979 | ||
980 | mNameEdit->setText( mAddressee.assembledName() ); | 980 | mNameEdit->setText( mAddressee.assembledName() ); |
981 | 981 | ||
982 | if ( mAddressee.formattedName().isEmpty() ) { | 982 | if ( mAddressee.formattedName().isEmpty() ) { |
983 | //US KConfig config( "kaddressbookrc" ); | 983 | //US KConfig config( "kaddressbookrc" ); |
984 | KConfig config( locateLocal("config", "kabcrc") ); | 984 | KConfig config( locateLocal("config", "kabcrc") ); |
985 | config.setGroup( "General" ); | 985 | config.setGroup( "General" ); |
986 | mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 ); | 986 | mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 ); |
987 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); | 987 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); |
988 | } else {; | 988 | } else {; |
989 | if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) ) | 989 | if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) ) |
990 | mFormattedNameType = NameEditDialog::SimpleName; | 990 | mFormattedNameType = NameEditDialog::SimpleName; |
991 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) ) | 991 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) ) |
992 | mFormattedNameType = NameEditDialog::FullName; | 992 | mFormattedNameType = NameEditDialog::FullName; |
993 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) ) | 993 | else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) ) |
994 | mFormattedNameType = NameEditDialog::ReverseName; | 994 | mFormattedNameType = NameEditDialog::ReverseName; |
995 | else | 995 | else |
996 | mFormattedNameType = NameEditDialog::CustomName; | 996 | mFormattedNameType = NameEditDialog::CustomName; |
997 | } | 997 | } |
998 | 998 | ||
999 | mFormattedNameLabel->setText( mAddressee.formattedName() ); | 999 | mFormattedNameLabel->setText( mAddressee.formattedName() ); |
1000 | 1000 | ||
1001 | mAConfig->setUid( mAddressee.uid() ); | ||
1002 | if ( mAConfig->automaticNameParsing() ) { | ||
1003 | mNameLabel->hide(); | ||
1004 | mNameEdit->show(); | ||
1005 | } else { | ||
1006 | mNameEdit->hide(); | ||
1007 | mNameLabel->setText( mNameEdit->text() ); | ||
1008 | mNameLabel->show(); | ||
1009 | } | ||
1010 | |||
1001 | mRoleEdit->setText( mAddressee.role() ); | 1011 | mRoleEdit->setText( mAddressee.role() ); |
1002 | mOrgEdit->setText( mAddressee.organization() ); | 1012 | mOrgEdit->setText( mAddressee.organization() ); |
1003 | 1013 | ||
1004 | //US mURLEdit->setURL( mAddressee.url().url() ); | 1014 | //US mURLEdit->setURL( mAddressee.url().url() ); |
1005 | mURLEdit->setText( mAddressee.url().prettyURL() ); | 1015 | mURLEdit->setText( mAddressee.url().prettyURL() ); |
1006 | //US?? mURLEdit->home( false ); | 1016 | //US?? mURLEdit->home( false ); |
1007 | 1017 | ||
1008 | // mNoteEdit->setText( mAddressee.note() ); | 1018 | // mNoteEdit->setText( mAddressee.note() ); |
1009 | mNoteEdit->setText( mAddressee.note() ); | 1019 | mNoteEdit->setText( mAddressee.note() ); |
1010 | mEmailWidget->setEmails( mAddressee.emails() ); | 1020 | mEmailWidget->setEmails( mAddressee.emails() ); |
1011 | mPhoneEditWidget->setPhoneNumbers( mAddressee.phoneNumbers() ); | 1021 | mPhoneEditWidget->setPhoneNumbers( mAddressee.phoneNumbers() ); |
1012 | mAddressEditWidget->setAddresses( mAddressee, mAddressee.addresses() ); | 1022 | mAddressEditWidget->setAddresses( mAddressee, mAddressee.addresses() ); |
1013 | mBirthdayPicker->setDate( mAddressee.birthday().date() ); | 1023 | mBirthdayPicker->setDate( mAddressee.birthday().date() ); |
1014 | 1024 | ||
1015 | //US mAnniversaryPicker->setDate( QDate::fromString( mAddressee.custom( | 1025 | //US mAnniversaryPicker->setDate( QDate::fromString( mAddressee.custom( |
1016 | //US "KADDRESSBOOK", "X-Anniversary" ), Qt::ISODate) ); | 1026 | //US "KADDRESSBOOK", "X-Anniversary" ), Qt::ISODate) ); |
1017 | QDate dt = KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), | 1027 | QDate dt = KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), |
1018 | "%Y-%m-%d"); // = Qt::ISODate | 1028 | "%Y-%m-%d"); // = Qt::ISODate |
1019 | mAnniversaryPicker->setDate( dt ); | 1029 | mAnniversaryPicker->setDate( dt ); |
1020 | 1030 | ||
1021 | 1031 | ||
1022 | mNicknameEdit->setText( mAddressee.nickName() ); | 1032 | mNicknameEdit->setText( mAddressee.nickName() ); |
1023 | mCategoryEdit->setText( mAddressee.categories().join( "," ) ); | 1033 | mCategoryEdit->setText( mAddressee.categories().join( "," ) ); |
1024 | 1034 | ||
1025 | mGeoWidget->setGeo( mAddressee.geo() ); | 1035 | mGeoWidget->setGeo( mAddressee.geo() ); |
1026 | mImageWidget->setPhoto( mAddressee.photo() ); | 1036 | mImageWidget->setPhoto( mAddressee.photo() ); |
1027 | mImageWidget->setLogo( mAddressee.logo() ); | 1037 | mImageWidget->setLogo( mAddressee.logo() ); |
1028 | mKeyWidget->setKeys( mAddressee.keys() ); | 1038 | mKeyWidget->setKeys( mAddressee.keys() ); |
1029 | mSecrecyWidget->setSecrecy( mAddressee.secrecy() ); | 1039 | mSecrecyWidget->setSecrecy( mAddressee.secrecy() ); |
1030 | #ifndef KAB_EMBEDDED | 1040 | #ifndef KAB_EMBEDDED |
1031 | mSoundWidget->setSound( mAddressee.sound() ); | 1041 | mSoundWidget->setSound( mAddressee.sound() ); |
1032 | #else //KAB_EMBEDDED | 1042 | #else //KAB_EMBEDDED |
1033 | //US qDebug("AddresseeEditorWidget::load has to be changed 2"); | 1043 | //US qDebug("AddresseeEditorWidget::load has to be changed 2"); |
1034 | #endif //KAB_EMBEDDED | 1044 | #endif //KAB_EMBEDDED |
1035 | 1045 | ||
1036 | // Load customs | 1046 | // Load customs |
1037 | mIMAddressEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-IMAddress" ) ); | 1047 | mIMAddressEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-IMAddress" ) ); |
1038 | mSpouseEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ) ); | 1048 | mSpouseEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ) ); |
1039 | mChildEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Children" ) ); | 1049 | mChildEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Children" ) ); |
1040 | mManagerEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-ManagersName" ) ); | 1050 | mManagerEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-ManagersName" ) ); |
1041 | mAssistantEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-AssistantsName" ) ); | 1051 | mAssistantEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-AssistantsName" ) ); |
1042 | mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) ); | 1052 | mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) ); |
1043 | mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) ); | 1053 | mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) ); |
1044 | mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) ); | 1054 | mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) ); |
1045 | QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" ); | 1055 | QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" ); |
1046 | if ( gen == "female" ) | 1056 | if ( gen == "female" ) |
1047 | mGenderBox->setCurrentItem ( 1 ); | 1057 | mGenderBox->setCurrentItem ( 1 ); |
1048 | else if ( gen == "male" ) | 1058 | else if ( gen == "male" ) |
1049 | mGenderBox->setCurrentItem ( 2 ); | 1059 | mGenderBox->setCurrentItem ( 2 ); |
1050 | else | 1060 | else |
1051 | mGenderBox->setCurrentItem ( 0 ); | 1061 | mGenderBox->setCurrentItem ( 0 ); |
1052 | blockSignals( block ); | 1062 | blockSignals( block ); |
1053 | mBlockSignals = false; | 1063 | mBlockSignals = false; |
1054 | 1064 | ||
1055 | mDirty = false; | 1065 | mDirty = false; |
1056 | } | 1066 | } |
1057 | 1067 | ||
1058 | void AddresseeEditorWidget::save() | 1068 | void AddresseeEditorWidget::save() |
1059 | { | 1069 | { |
1060 | if ( !dirty() ) { | 1070 | if ( !dirty() ) { |
1061 | return; | 1071 | return; |
1062 | } | 1072 | } |
1063 | 1073 | ||
1064 | mAddressee.setRevision( QDateTime::currentDateTime() ); | 1074 | mAddressee.setRevision( QDateTime::currentDateTime() ); |
1065 | 1075 | ||
1066 | mAddressee.setRole( mRoleEdit->text() ); | 1076 | mAddressee.setRole( mRoleEdit->text() ); |
1067 | mAddressee.setOrganization( mOrgEdit->text() ); | 1077 | mAddressee.setOrganization( mOrgEdit->text() ); |
1068 | mAddressee.setUrl( KURL( mURLEdit->text() ) ); | 1078 | mAddressee.setUrl( KURL( mURLEdit->text() ) ); |
1069 | mAddressee.setNote( mNoteEdit->text() ); | 1079 | mAddressee.setNote( mNoteEdit->text() ); |
1070 | if ( mBirthdayPicker->inputIsValid() ) { | 1080 | if ( mBirthdayPicker->inputIsValid() ) { |
1071 | QDate da = mBirthdayPicker->date(); | 1081 | QDate da = mBirthdayPicker->date(); |
1072 | if ( da > QDate::currentDate() ) | 1082 | if ( da > QDate::currentDate() ) |
1073 | da.setYMD(da.year()-100, da.month(), da.day() ); | 1083 | da.setYMD(da.year()-100, da.month(), da.day() ); |
1074 | mAddressee.setBirthday( QDateTime( da ) ); | 1084 | mAddressee.setBirthday( QDateTime( da ) ); |
1075 | //qDebug("bday %s ",da.toString().latin1()); | 1085 | //qDebug("bday %s ",da.toString().latin1()); |
1076 | } | 1086 | } |
1077 | else { | 1087 | else { |
1078 | mAddressee.setBirthday( QDateTime() ); | 1088 | mAddressee.setBirthday( QDateTime() ); |
1079 | mBirthdayPicker->clear(); | 1089 | mBirthdayPicker->clear(); |
1080 | } | 1090 | } |
1081 | mAddressee.setNickName( mNicknameEdit->text() ); | 1091 | mAddressee.setNickName( mNicknameEdit->text() ); |
1082 | mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) ); | 1092 | mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) ); |
1083 | 1093 | ||
1084 | mAddressee.setGeo( mGeoWidget->geo() ); | 1094 | mAddressee.setGeo( mGeoWidget->geo() ); |
1085 | mAddressee.setPhoto( mImageWidget->photo() ); | 1095 | mAddressee.setPhoto( mImageWidget->photo() ); |
1086 | mAddressee.setLogo( mImageWidget->logo() ); | 1096 | mAddressee.setLogo( mImageWidget->logo() ); |
1087 | mAddressee.setKeys( mKeyWidget->keys() ); | 1097 | mAddressee.setKeys( mKeyWidget->keys() ); |
1088 | #ifndef KAB_EMBEDDED | 1098 | #ifndef KAB_EMBEDDED |
1089 | mAddressee.setSound( mSoundWidget->sound() ); | 1099 | mAddressee.setSound( mSoundWidget->sound() ); |
1090 | #else //KAB_EMBEDDED | 1100 | #else //KAB_EMBEDDED |
1091 | //US qDebug("AddresseeEditorWidget::save sound not supported"); | 1101 | //US qDebug("AddresseeEditorWidget::save sound not supported"); |
1092 | #endif //KAB_EMBEDDED | 1102 | #endif //KAB_EMBEDDED |
1093 | mAddressee.setSecrecy( mSecrecyWidget->secrecy() ); | 1103 | mAddressee.setSecrecy( mSecrecyWidget->secrecy() ); |
1094 | 1104 | ||
1095 | // save custom fields | 1105 | // save custom fields |
1096 | mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() ); | 1106 | mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() ); |
1097 | mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() ); | 1107 | mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() ); |
1098 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Children", mChildEdit->text() ); | 1108 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Children", mChildEdit->text() ); |
1099 | mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() ); | 1109 | mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() ); |
1100 | mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() ); | 1110 | mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() ); |
1101 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() ); | 1111 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() ); |
1102 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() ); | 1112 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() ); |
1103 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() ); | 1113 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() ); |
1104 | if ( mAnniversaryPicker->inputIsValid() ) { | 1114 | if ( mAnniversaryPicker->inputIsValid() ) { |
1105 | QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate); | 1115 | QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate); |
1106 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); | 1116 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); |
1107 | } | 1117 | } |
1108 | else { | 1118 | else { |
1109 | mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" ); | 1119 | mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" ); |
1110 | mAnniversaryPicker->clear(); | 1120 | mAnniversaryPicker->clear(); |
1111 | } | 1121 | } |
1112 | int gen = mGenderBox->currentItem (); | 1122 | int gen = mGenderBox->currentItem (); |
1113 | if ( gen == 1 ) | 1123 | if ( gen == 1 ) |
1114 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female"); | 1124 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female"); |
1115 | else if ( gen == 2 ) | 1125 | else if ( gen == 2 ) |
1116 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male"); | 1126 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male"); |
1117 | else | 1127 | else |
1118 | mAddressee.removeCustom( "KADDRESSBOOK", "X-Gender" ); | 1128 | mAddressee.removeCustom( "KADDRESSBOOK", "X-Gender" ); |
1119 | 1129 | ||
1120 | // Save the email addresses | 1130 | // Save the email addresses |
1121 | QStringList emails = mAddressee.emails(); | 1131 | QStringList emails = mAddressee.emails(); |
1122 | QStringList::Iterator iter; | 1132 | QStringList::Iterator iter; |
1123 | for ( iter = emails.begin(); iter != emails.end(); ++iter ) | 1133 | for ( iter = emails.begin(); iter != emails.end(); ++iter ) |
1124 | mAddressee.removeEmail( *iter ); | 1134 | mAddressee.removeEmail( *iter ); |
1125 | 1135 | ||
1126 | emails = mEmailWidget->emails(); | 1136 | emails = mEmailWidget->emails(); |
1127 | bool first = true; | 1137 | bool first = true; |
1128 | for ( iter = emails.begin(); iter != emails.end(); ++iter ) { | 1138 | for ( iter = emails.begin(); iter != emails.end(); ++iter ) { |
1129 | mAddressee.insertEmail( *iter, first ); | 1139 | mAddressee.insertEmail( *iter, first ); |
1130 | first = false; | 1140 | first = false; |
1131 | } | 1141 | } |
1132 | 1142 | ||
1133 | // Save the phone numbers | 1143 | // Save the phone numbers |
1134 | KABC::PhoneNumber::List phoneNumbers; | 1144 | KABC::PhoneNumber::List phoneNumbers; |
1135 | KABC::PhoneNumber::List::Iterator phoneIter; | 1145 | KABC::PhoneNumber::List::Iterator phoneIter; |
1136 | phoneNumbers = mAddressee.phoneNumbers(); | 1146 | phoneNumbers = mAddressee.phoneNumbers(); |
1137 | for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); | 1147 | for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); |
1138 | ++phoneIter ) | 1148 | ++phoneIter ) |
1139 | mAddressee.removePhoneNumber( *phoneIter ); | 1149 | mAddressee.removePhoneNumber( *phoneIter ); |
1140 | 1150 | ||
1141 | phoneNumbers = mPhoneEditWidget->phoneNumbers(); | 1151 | phoneNumbers = mPhoneEditWidget->phoneNumbers(); |
1142 | for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); | 1152 | for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); |
1143 | ++phoneIter ) | 1153 | ++phoneIter ) |
1144 | mAddressee.insertPhoneNumber( *phoneIter ); | 1154 | mAddressee.insertPhoneNumber( *phoneIter ); |
1145 | 1155 | ||
1146 | // Save the addresses | 1156 | // Save the addresses |
1147 | KABC::Address::List addresses; | 1157 | KABC::Address::List addresses; |
1148 | KABC::Address::List::Iterator addressIter; | 1158 | KABC::Address::List::Iterator addressIter; |
1149 | addresses = mAddressee.addresses(); | 1159 | addresses = mAddressee.addresses(); |
1150 | for ( addressIter = addresses.begin(); addressIter != addresses.end(); | 1160 | for ( addressIter = addresses.begin(); addressIter != addresses.end(); |
1151 | ++addressIter ) | 1161 | ++addressIter ) |
1152 | mAddressee.removeAddress( *addressIter ); | 1162 | mAddressee.removeAddress( *addressIter ); |
1153 | 1163 | ||
1154 | addresses = mAddressEditWidget->addresses(); | 1164 | addresses = mAddressEditWidget->addresses(); |
1155 | for ( addressIter = addresses.begin(); addressIter != addresses.end(); | 1165 | for ( addressIter = addresses.begin(); addressIter != addresses.end(); |
1156 | ++addressIter ) | 1166 | ++addressIter ) |
1157 | mAddressee.insertAddress( *addressIter ); | 1167 | mAddressee.insertAddress( *addressIter ); |
1158 | mDirty = false; | 1168 | mDirty = false; |
1159 | } | 1169 | } |
1160 | 1170 | ||
1161 | bool AddresseeEditorWidget::dirty() | 1171 | bool AddresseeEditorWidget::dirty() |
1162 | { | 1172 | { |
1163 | 1173 | ||
1164 | if ( ! mDirty ) { | 1174 | if ( ! mDirty ) { |
1165 | if ( mBirthdayPicker->inputIsValid() ) { | 1175 | if ( mBirthdayPicker->inputIsValid() ) { |
1166 | QDate da = mBirthdayPicker->date(); | 1176 | QDate da = mBirthdayPicker->date(); |
1167 | if ( !(da == mAddressee.birthday().date())) | 1177 | if ( !(da == mAddressee.birthday().date())) |
1168 | mDirty = true; | 1178 | mDirty = true; |
1169 | } | 1179 | } |
1170 | else { | 1180 | else { |
1171 | mBirthdayPicker->clear(); | 1181 | mBirthdayPicker->clear(); |
1172 | } | 1182 | } |
1173 | if ( mAnniversaryPicker->inputIsValid() ) { | 1183 | if ( mAnniversaryPicker->inputIsValid() ) { |
1174 | QDate da = mAnniversaryPicker->date(); | 1184 | QDate da = mAnniversaryPicker->date(); |
1175 | if ( da != KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), | 1185 | if ( da != KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), |
1176 | "%Y-%m-%d")) | 1186 | "%Y-%m-%d")) |
1177 | mDirty = true; | 1187 | mDirty = true; |
1178 | } | 1188 | } |
1179 | else { | 1189 | else { |
1180 | mAnniversaryPicker->clear(); | 1190 | mAnniversaryPicker->clear(); |
1181 | } | 1191 | } |
1182 | } | 1192 | } |
1183 | return mDirty; | 1193 | return mDirty; |
1184 | } | 1194 | } |
1185 | 1195 | ||
1186 | void AddresseeEditorWidget::nameTextChanged( const QString &text ) | 1196 | void AddresseeEditorWidget::nameTextChanged( const QString &text ) |
1187 | { | 1197 | { |
1188 | if ( mBlockSignals ) | 1198 | if ( mBlockSignals ) |
1189 | return; | 1199 | return; |
1190 | // use the addressee class to parse the name for us | 1200 | // use the addressee class to parse the name for us |
1191 | mAConfig->setUid( mAddressee.uid() ); | 1201 | mAConfig->setUid( mAddressee.uid() ); |
1192 | if ( mAConfig->automaticNameParsing() ) { | 1202 | if ( mAConfig->automaticNameParsing() ) { |
1193 | if ( !mAddressee.formattedName().isEmpty() ) { | 1203 | if ( !mAddressee.formattedName().isEmpty() ) { |
1194 | QString fn = mAddressee.formattedName(); | 1204 | QString fn = mAddressee.formattedName(); |
1195 | mAddressee.setNameFromString( text ); | 1205 | mAddressee.setNameFromString( text ); |
1196 | mAddressee.setFormattedName( fn ); | 1206 | mAddressee.setFormattedName( fn ); |
1197 | } else { | 1207 | } else { |
1198 | // use extra addressee to avoid a formatted name assignment | 1208 | // use extra addressee to avoid a formatted name assignment |
1199 | Addressee addr; | 1209 | Addressee addr; |
1200 | addr.setNameFromString( text ); | 1210 | addr.setNameFromString( text ); |
1201 | mAddressee.setPrefix( addr.prefix() ); | 1211 | mAddressee.setPrefix( addr.prefix() ); |
1202 | mAddressee.setGivenName( addr.givenName() ); | 1212 | mAddressee.setGivenName( addr.givenName() ); |
1203 | mAddressee.setAdditionalName( addr.additionalName() ); | 1213 | mAddressee.setAdditionalName( addr.additionalName() ); |
1204 | mAddressee.setFamilyName( addr.familyName() ); | 1214 | mAddressee.setFamilyName( addr.familyName() ); |
1205 | mAddressee.setSuffix( addr.suffix() ); | 1215 | mAddressee.setSuffix( addr.suffix() ); |
1206 | } | 1216 | } |
1207 | } | 1217 | } |
1208 | |||
1209 | nameBoxChanged(); | 1218 | nameBoxChanged(); |
1210 | 1219 | ||
1220 | |||
1211 | emitModified(); | 1221 | emitModified(); |
1212 | } | 1222 | } |
1213 | 1223 | ||
1214 | void AddresseeEditorWidget::nameBoxChanged() | 1224 | void AddresseeEditorWidget::nameBoxChanged() |
1215 | { | 1225 | { |
1216 | KABC::Addressee addr; | 1226 | KABC::Addressee addr; |
1217 | mAConfig->setUid( mAddressee.uid() ); | 1227 | mAConfig->setUid( mAddressee.uid() ); |
1218 | if ( mAConfig->automaticNameParsing() ) { | 1228 | if ( mAConfig->automaticNameParsing() ) { |
1219 | addr.setNameFromString( mNameEdit->text() ); | 1229 | addr.setNameFromString( mNameEdit->text() ); |
1220 | mNameLabel->hide(); | 1230 | mNameLabel->hide(); |
1221 | mNameEdit->show(); | 1231 | mNameEdit->show(); |
1222 | } else { | 1232 | } else { |
1223 | addr = mAddressee; | 1233 | addr = mAddressee; |
1224 | mNameEdit->hide(); | 1234 | mNameEdit->hide(); |
1225 | mNameLabel->setText( mNameEdit->text() ); | 1235 | mNameLabel->setText( mNameEdit->text() ); |
1226 | mNameLabel->show(); | 1236 | mNameLabel->show(); |
1227 | } | 1237 | } |
1228 | 1238 | ||
1229 | if ( mFormattedNameType != NameEditDialog::CustomName ) { | 1239 | if ( mFormattedNameType != NameEditDialog::CustomName ) { |
1230 | mFormattedNameLabel->setText( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); | 1240 | mFormattedNameLabel->setText( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); |
1231 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); | 1241 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); |
1232 | } | 1242 | } |
1233 | } | 1243 | } |
1234 | 1244 | ||
1235 | void AddresseeEditorWidget::nameButtonClicked() | 1245 | void AddresseeEditorWidget::nameButtonClicked() |
1236 | { | 1246 | { |
1237 | // show the name dialog. | 1247 | // show the name dialog. |
1238 | NameEditDialog dialog( mAddressee, mFormattedNameType, this ); | 1248 | NameEditDialog dialog( mAddressee, mFormattedNameType, this ); |
1239 | 1249 | ||
1240 | if ( KApplication::execDialog( &dialog) ) { | 1250 | if ( KApplication::execDialog( &dialog) ) { |
1241 | if ( dialog.changed() ) { | 1251 | if ( dialog.changed() ) { |
1242 | mAddressee.setFamilyName( dialog.familyName() ); | 1252 | mAddressee.setFamilyName( dialog.familyName() ); |
1243 | mAddressee.setGivenName( dialog.givenName() ); | 1253 | mAddressee.setGivenName( dialog.givenName() ); |
1244 | mAddressee.setPrefix( dialog.prefix() ); | 1254 | mAddressee.setPrefix( dialog.prefix() ); |
1245 | mAddressee.setSuffix( dialog.suffix() ); | 1255 | mAddressee.setSuffix( dialog.suffix() ); |
1246 | mAddressee.setAdditionalName( dialog.additionalName() ); | 1256 | mAddressee.setAdditionalName( dialog.additionalName() ); |
1247 | mFormattedNameType = dialog.formattedNameType(); | 1257 | mFormattedNameType = dialog.formattedNameType(); |
1248 | if ( mFormattedNameType == NameEditDialog::CustomName ) { | 1258 | if ( mFormattedNameType == NameEditDialog::CustomName ) { |
1249 | mFormattedNameLabel->setText( dialog.customFormattedName() ); | 1259 | mFormattedNameLabel->setText( dialog.customFormattedName() ); |
1250 | mAddressee.setFormattedName( dialog.customFormattedName() ); | 1260 | mAddressee.setFormattedName( dialog.customFormattedName() ); |
1251 | } | 1261 | } |
1252 | // Update the name edit. | 1262 | // Update the name edit. |
1253 | bool block = mNameEdit->signalsBlocked(); | 1263 | bool block = mNameEdit->signalsBlocked(); |
1254 | mNameEdit->blockSignals( true ); | 1264 | mNameEdit->blockSignals( true ); |
1255 | mNameEdit->setText( mAddressee.assembledName() ); | 1265 | mNameEdit->setText( mAddressee.assembledName() ); |
1256 | mNameEdit->blockSignals( block ); | 1266 | mNameEdit->blockSignals( block ); |
1257 | 1267 | ||
1258 | // Update the combo box. | 1268 | // Update the combo box. |
1259 | nameBoxChanged(); | 1269 | nameBoxChanged(); |
1260 | 1270 | ||
1261 | emitModified(); | 1271 | emitModified(); |
1262 | } | 1272 | } |
1263 | } | 1273 | } |
1264 | } | 1274 | } |
1265 | 1275 | ||
1266 | void AddresseeEditorWidget::categoryButtonClicked() | 1276 | void AddresseeEditorWidget::categoryButtonClicked() |
1267 | { | 1277 | { |
1268 | // Show the category dialog | 1278 | // Show the category dialog |
1269 | if ( mCategoryDialog == 0 ) { | 1279 | if ( mCategoryDialog == 0 ) { |
1270 | mCategoryDialog = new KPIM::CategorySelectDialog( KABPrefs::instance(), this ); | 1280 | mCategoryDialog = new KPIM::CategorySelectDialog( KABPrefs::instance(), this ); |
1271 | connect( mCategoryDialog, SIGNAL( categoriesSelected( const QStringList& ) ), | 1281 | connect( mCategoryDialog, SIGNAL( categoriesSelected( const QStringList& ) ), |
1272 | SLOT(categoriesSelected( const QStringList& ) ) ); | 1282 | SLOT(categoriesSelected( const QStringList& ) ) ); |
1273 | connect( mCategoryDialog, SIGNAL( editCategories() ), SLOT( editCategories() ) ); | 1283 | connect( mCategoryDialog, SIGNAL( editCategories() ), SLOT( editCategories() ) ); |
1274 | } | 1284 | } |
1275 | 1285 | ||
1276 | mCategoryDialog->setCategories(); | 1286 | mCategoryDialog->setCategories(); |
1277 | mCategoryDialog->setSelected( QStringList::split( ",", mCategoryEdit->text() ) ); | 1287 | mCategoryDialog->setSelected( QStringList::split( ",", mCategoryEdit->text() ) ); |
1278 | mCategoryDialog->show(); | 1288 | mCategoryDialog->show(); |
1279 | mCategoryDialog->raise(); | 1289 | mCategoryDialog->raise(); |
1280 | } | 1290 | } |
1281 | 1291 | ||
1282 | void AddresseeEditorWidget::categoriesSelected( const QStringList &list ) | 1292 | void AddresseeEditorWidget::categoriesSelected( const QStringList &list ) |
1283 | { | 1293 | { |
1284 | mCategoryEdit->setText( list.join( "," ) ); | 1294 | mCategoryEdit->setText( list.join( "," ) ); |
1285 | } | 1295 | } |
1286 | 1296 | ||
1287 | void AddresseeEditorWidget::editCategories() | 1297 | void AddresseeEditorWidget::editCategories() |
1288 | { | 1298 | { |
1289 | if ( mCategoryEditDialog == 0 ) { | 1299 | if ( mCategoryEditDialog == 0 ) { |
1290 | mCategoryEditDialog = new KPIM::CategoryEditDialog( KABPrefs::instance(), this ); | 1300 | mCategoryEditDialog = new KPIM::CategoryEditDialog( KABPrefs::instance(), this ); |
1291 | connect( mCategoryEditDialog, SIGNAL( categoryConfigChanged() ), | 1301 | connect( mCategoryEditDialog, SIGNAL( categoryConfigChanged() ), |
1292 | SLOT( categoryButtonClicked() ) ); | 1302 | SLOT( categoryButtonClicked() ) ); |
1293 | } | 1303 | } |
1294 | 1304 | ||
1295 | mCategoryEditDialog->show(); | 1305 | mCategoryEditDialog->show(); |
1296 | mCategoryEditDialog->raise(); | 1306 | mCategoryEditDialog->raise(); |
1297 | } | 1307 | } |
1298 | 1308 | ||
1299 | void AddresseeEditorWidget::emitModified() | 1309 | void AddresseeEditorWidget::emitModified() |
1300 | { | 1310 | { |
1301 | mDirty = true; | 1311 | mDirty = true; |
1302 | 1312 | ||
1303 | KABC::Addressee::List list; | 1313 | KABC::Addressee::List list; |
1304 | 1314 | ||
1305 | if ( mIsExtension && !mBlockSignals ) { | 1315 | if ( mIsExtension && !mBlockSignals ) { |
1306 | save(); | 1316 | save(); |
1307 | list.append( mAddressee ); | 1317 | list.append( mAddressee ); |
1308 | } | 1318 | } |
1309 | 1319 | ||
1310 | emit modified( list ); | 1320 | emit modified( list ); |
1311 | } | 1321 | } |
1312 | 1322 | ||
1313 | void AddresseeEditorWidget::dateChanged( QDate ) | 1323 | void AddresseeEditorWidget::dateChanged( QDate ) |
1314 | { | 1324 | { |
1315 | emitModified(); | 1325 | emitModified(); |
1316 | } | 1326 | } |
1317 | 1327 | ||
1318 | //US invalid dates are handdled by the KDateEdit widget itself | 1328 | //US invalid dates are handdled by the KDateEdit widget itself |
1319 | void AddresseeEditorWidget::invalidDate() | 1329 | void AddresseeEditorWidget::invalidDate() |
1320 | { | 1330 | { |
1321 | KMessageBox::sorry( this, i18n( "You must specify a valid date" ) ); | 1331 | KMessageBox::sorry( this, i18n( "You must specify a valid date" ) ); |
1322 | } | 1332 | } |
1323 | 1333 | ||
1324 | 1334 | ||
1325 | void AddresseeEditorWidget::pageChanged( QWidget *wdg ) | 1335 | void AddresseeEditorWidget::pageChanged( QWidget *wdg ) |
1326 | { | 1336 | { |
1327 | #ifndef KAB_EMBEDDED | 1337 | #ifndef KAB_EMBEDDED |
1328 | if ( wdg ) | 1338 | if ( wdg ) |
1329 | KAcceleratorManager::manage( wdg ); | 1339 | KAcceleratorManager::manage( wdg ); |
1330 | #else //KAB_EMBEDDED | 1340 | #else //KAB_EMBEDDED |
1331 | //US | 1341 | //US |
1332 | #endif //KAB_EMBEDDED | 1342 | #endif //KAB_EMBEDDED |
1333 | 1343 | ||
1334 | } | 1344 | } |
1335 | 1345 | ||
1336 | QString AddresseeEditorWidget::title() const | 1346 | QString AddresseeEditorWidget::title() const |
1337 | { | 1347 | { |
1338 | return i18n( "Contact Editor" ); | 1348 | return i18n( "Contact Editor" ); |
1339 | } | 1349 | } |
1340 | 1350 | ||
1341 | QString AddresseeEditorWidget::identifier() const | 1351 | QString AddresseeEditorWidget::identifier() const |
1342 | { | 1352 | { |
1343 | return i18n( "contact_editor" ); | 1353 | return i18n( "contact_editor" ); |
1344 | } | 1354 | } |
1345 | 1355 | ||
1346 | #ifndef KAB_EMBEDDED | 1356 | #ifndef KAB_EMBEDDED |
1347 | #include "addresseeeditorwidget.moc" | 1357 | #include "addresseeeditorwidget.moc" |
1348 | #endif //KAB_EMBEDDED | 1358 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp index 48370e3..9ee4eac 100644 --- a/kaddressbook/imagewidget.cpp +++ b/kaddressbook/imagewidget.cpp | |||
@@ -1,294 +1,312 @@ | |||
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 <kabc/picture.h> | 24 | #include <kabc/picture.h> |
25 | 25 | ||
26 | #ifndef KAB_EMBEDDED | 26 | #ifndef KAB_EMBEDDED |
27 | #include <kaccelmanager.h> | 27 | #include <kaccelmanager.h> |
28 | #include <kio/netaccess.h> | 28 | #include <kio/netaccess.h> |
29 | #include <kimageio.h> | 29 | #include <kimageio.h> |
30 | #endif //KAB_EMBEDDED | 30 | #endif //KAB_EMBEDDED |
31 | 31 | ||
32 | #include <kdebug.h> | 32 | #include <kdebug.h> |
33 | #include <kdialog.h> | 33 | #include <kdialog.h> |
34 | #include <kiconloader.h> | 34 | #include <kiconloader.h> |
35 | #include <klocale.h> | 35 | #include <klocale.h> |
36 | #include <kurlrequester.h> | 36 | #include <kurlrequester.h> |
37 | #include <kurl.h> | 37 | #include <kurl.h> |
38 | 38 | ||
39 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
40 | #include <qgroupbox.h> | 40 | #include <qgroupbox.h> |
41 | #include <qlabel.h> | 41 | #include <qlabel.h> |
42 | #include <qlayout.h> | 42 | #include <qlayout.h> |
43 | #include <qpixmap.h> | 43 | #include <qpixmap.h> |
44 | #include <qpushbutton.h> | ||
44 | #include <qapplication.h> | 45 | #include <qapplication.h> |
45 | 46 | ||
46 | #include "imagewidget.h" | 47 | #include "imagewidget.h" |
47 | 48 | ||
48 | ImageWidget::ImageWidget( QWidget *parent, const char *name ) | 49 | ImageWidget::ImageWidget( QWidget *parent, const char *name ) |
49 | : QWidget( parent, name ) | 50 | : QWidget( parent, name ) |
50 | { | 51 | { |
51 | QGridLayout *topLayout = new QGridLayout( this, 2, 1, KDialog::marginHint(), | 52 | QGridLayout *topLayout = new QGridLayout( this, 2, 1, KDialog::marginHint(), |
52 | KDialog::spacingHint() ); | 53 | KDialog::spacingHint() ); |
53 | 54 | ||
54 | QGroupBox *photoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Photo" ), this ); | 55 | QGroupBox *photoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Photo" ), this ); |
55 | QGridLayout *boxLayout = new QGridLayout( photoBox->layout(), 3, 2, | 56 | QGridLayout *boxLayout = new QGridLayout( photoBox->layout(), 4, 2, |
56 | KDialog::spacingHint() ); | 57 | KDialog::spacingHint() ); |
57 | boxLayout->setRowStretch( 2, 1 ); | 58 | boxLayout->setRowStretch( 2, 1 ); |
58 | 59 | ||
59 | mPhotoLabel = new QLabel( photoBox ); | 60 | mPhotoLabel = new QLabel( photoBox ); |
60 | int fac = 9; | 61 | int fac = 9; |
61 | if ( QApplication::desktop()->width() > 320 ) | 62 | if ( QApplication::desktop()->width() > 320 ) |
62 | fac = 6; | 63 | fac = 6; |
63 | mPhotoLabel->setFixedSize( 50*9/fac, 70*9/fac ); | 64 | mPhotoLabel->setFixedSize( 50*9/fac, 70*9/fac ); |
64 | mPhotoLabel->setScaledContents( true ); | 65 | mPhotoLabel->setScaledContents( true ); |
65 | mPhotoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 66 | mPhotoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
66 | boxLayout->addMultiCellWidget( mPhotoLabel, 0, 2, 0, 0 ); | 67 | boxLayout->addMultiCellWidget( mPhotoLabel, 0, 3, 0, 0 ); |
67 | 68 | ||
68 | mPhotoUrl = new KURLRequester( photoBox ); | 69 | mPhotoUrl = new KURLRequester( photoBox ); |
69 | #ifndef KAB_EMBEDDED | 70 | #ifndef KAB_EMBEDDED |
70 | mPhotoUrl->setFilter( KImageIO::pattern() ); | 71 | mPhotoUrl->setFilter( KImageIO::pattern() ); |
71 | #else //KAB_EMBEDDED | 72 | #else //KAB_EMBEDDED |
72 | //US qDebug("ImageWidget::ImageWidget KImageIO not defined. Does this harm ???"); | 73 | //US qDebug("ImageWidget::ImageWidget KImageIO not defined. Does this harm ???"); |
73 | #endif //KAB_EMBEDDED | 74 | #endif //KAB_EMBEDDED |
74 | 75 | ||
75 | 76 | ||
76 | boxLayout->addWidget( mPhotoUrl, 0, 1 ); | 77 | boxLayout->addWidget( mPhotoUrl, 0, 1 ); |
77 | 78 | ||
78 | mUsePhotoUrl = new QCheckBox( i18n( "Store as URL" ), photoBox ); | 79 | mUsePhotoUrl = new QCheckBox( i18n( "Store as URL" ), photoBox ); |
79 | mUsePhotoUrl->setEnabled( false ); | 80 | mUsePhotoUrl->setEnabled( false ); |
80 | boxLayout->addWidget( mUsePhotoUrl, 1, 1 ); | 81 | boxLayout->addWidget( mUsePhotoUrl, 1, 1 ); |
81 | 82 | ||
83 | QPushButton * pb = new QPushButton( i18n( "Remove" ), photoBox ); | ||
84 | connect( pb, SIGNAL( clicked() ),this, SLOT( removePhoto() ) ); | ||
85 | boxLayout->addWidget( pb, 2, 1 ); | ||
86 | boxLayout->addWidget( new QLabel( photoBox ), 3, 1 ); | ||
87 | |||
82 | topLayout->addWidget( photoBox, 0, 0 ); | 88 | topLayout->addWidget( photoBox, 0, 0 ); |
83 | 89 | ||
84 | QGroupBox *logoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Logo" ), this ); | 90 | QGroupBox *logoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Logo" ), this ); |
85 | boxLayout = new QGridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() ); | 91 | boxLayout = new QGridLayout( logoBox->layout(), 4, 2, KDialog::spacingHint() ); |
86 | boxLayout->setRowStretch( 2, 1 ); | 92 | boxLayout->setRowStretch( 2, 1 ); |
87 | 93 | ||
88 | mLogoLabel = new QLabel( logoBox ); | 94 | mLogoLabel = new QLabel( logoBox ); |
89 | mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac ); | 95 | mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac ); |
90 | mLogoLabel->setScaledContents( true ); | 96 | mLogoLabel->setScaledContents( true ); |
91 | mLogoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 97 | mLogoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
92 | boxLayout->addMultiCellWidget( mLogoLabel, 0, 2, 0, 0 ); | 98 | boxLayout->addMultiCellWidget( mLogoLabel, 0, 3, 0, 0 ); |
93 | 99 | ||
94 | mLogoUrl = new KURLRequester( logoBox ); | 100 | mLogoUrl = new KURLRequester( logoBox ); |
95 | #ifndef KAB_EMBEDDED | 101 | #ifndef KAB_EMBEDDED |
96 | mLogoUrl->setFilter( KImageIO::pattern() ); | 102 | mLogoUrl->setFilter( KImageIO::pattern() ); |
97 | #else //KAB_EMBEDDED | 103 | #else //KAB_EMBEDDED |
98 | //US qDebug("ImageWidget::ImageWidget KImageIO not defined 2"); | 104 | //US qDebug("ImageWidget::ImageWidget KImageIO not defined 2"); |
99 | #endif //KAB_EMBEDDED | 105 | #endif //KAB_EMBEDDED |
100 | boxLayout->addWidget( mLogoUrl, 0, 1 ); | 106 | boxLayout->addWidget( mLogoUrl, 0, 1 ); |
101 | 107 | ||
102 | mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), logoBox ); | 108 | mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), logoBox ); |
103 | mUseLogoUrl->setEnabled( false ); | 109 | mUseLogoUrl->setEnabled( false ); |
104 | boxLayout->addWidget( mUseLogoUrl, 1, 1 ); | 110 | boxLayout->addWidget( mUseLogoUrl, 1, 1 ); |
105 | 111 | ||
112 | pb = new QPushButton( i18n( "Remove" ), logoBox ); | ||
113 | connect( pb, SIGNAL( clicked() ),this, SLOT( removeLogo() ) ); | ||
114 | boxLayout->addWidget( pb, 2, 1 ); | ||
115 | boxLayout->addWidget( new QLabel( logoBox ), 3, 1 ); | ||
106 | topLayout->addWidget( logoBox, 1, 0 ); | 116 | topLayout->addWidget( logoBox, 1, 0 ); |
107 | 117 | ||
108 | connect( mPhotoUrl, SIGNAL( textChanged( const QString& ) ), | 118 | connect( mPhotoUrl, SIGNAL( textChanged( const QString& ) ), |
109 | SIGNAL( changed() ) ); | 119 | SIGNAL( changed() ) ); |
110 | connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ), | 120 | connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ), |
111 | SLOT( loadPhoto() ) ); | 121 | SLOT( loadPhoto() ) ); |
112 | connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ), | 122 | connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ), |
113 | SIGNAL( changed() ) ); | 123 | SIGNAL( changed() ) ); |
114 | connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ), | 124 | connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ), |
115 | SLOT( updateGUI() ) ); | 125 | SLOT( updateGUI() ) ); |
116 | connect( mUsePhotoUrl, SIGNAL( toggled( bool ) ), | 126 | connect( mUsePhotoUrl, SIGNAL( toggled( bool ) ), |
117 | SIGNAL( changed() ) ); | 127 | SIGNAL( changed() ) ); |
118 | 128 | ||
119 | connect( mLogoUrl, SIGNAL( textChanged( const QString& ) ), | 129 | connect( mLogoUrl, SIGNAL( textChanged( const QString& ) ), |
120 | SIGNAL( changed() ) ); | 130 | SIGNAL( changed() ) ); |
121 | connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), | 131 | connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), |
122 | SLOT( loadLogo() ) ); | 132 | SLOT( loadLogo() ) ); |
123 | connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), | 133 | connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), |
124 | SIGNAL( changed() ) ); | 134 | SIGNAL( changed() ) ); |
125 | connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), | 135 | connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), |
126 | SLOT( updateGUI() ) ); | 136 | SLOT( updateGUI() ) ); |
127 | connect( mUseLogoUrl, SIGNAL( toggled( bool ) ), | 137 | connect( mUseLogoUrl, SIGNAL( toggled( bool ) ), |
128 | SIGNAL( changed() ) ); | 138 | SIGNAL( changed() ) ); |
129 | 139 | ||
130 | #ifndef KAB_EMBEDDED | 140 | #ifndef KAB_EMBEDDED |
131 | KAcceleratorManager::manage( this ); | 141 | KAcceleratorManager::manage( this ); |
132 | #endif //KAB_EMBEDDED | 142 | #endif //KAB_EMBEDDED |
133 | 143 | ||
134 | } | 144 | } |
135 | 145 | ||
136 | ImageWidget::~ImageWidget() | 146 | ImageWidget::~ImageWidget() |
137 | { | 147 | { |
138 | } | 148 | } |
139 | 149 | ||
140 | void ImageWidget::setPhoto( const KABC::Picture &photo ) | 150 | void ImageWidget::setPhoto( const KABC::Picture &photo ) |
141 | { | 151 | { |
142 | bool blocked = signalsBlocked(); | 152 | bool blocked = signalsBlocked(); |
143 | blockSignals( true ); | 153 | blockSignals( true ); |
144 | 154 | ||
145 | if ( photo.isIntern() ) { | 155 | if ( photo.isIntern() ) { |
146 | //US | 156 | //US |
147 | //US mPhotoLabel->setPixmap( photo.data() ); | 157 | //US mPhotoLabel->setPixmap( photo.data() ); |
148 | if (photo.data().isNull() != true) | 158 | if (photo.data().isNull() != true) |
149 | { | 159 | { |
150 | QPixmap pm; | 160 | QPixmap pm; |
151 | pm.convertFromImage(photo.data()); | 161 | pm.convertFromImage(photo.data()); |
152 | 162 | ||
153 | mPhotoLabel->setPixmap( pm ); | 163 | mPhotoLabel->setPixmap( pm ); |
154 | } | 164 | } |
155 | 165 | ||
156 | mUsePhotoUrl->setChecked( false ); | 166 | mUsePhotoUrl->setChecked( false ); |
157 | } else { | 167 | } else { |
158 | mPhotoUrl->setURL( photo.url() ); | 168 | mPhotoUrl->setURL( photo.url() ); |
159 | if ( !photo.url().isEmpty() ) | 169 | if ( !photo.url().isEmpty() ) |
160 | mUsePhotoUrl->setChecked( true ); | 170 | mUsePhotoUrl->setChecked( true ); |
161 | loadPhoto(); | 171 | loadPhoto(); |
162 | } | 172 | } |
163 | 173 | ||
164 | blockSignals( blocked ); | 174 | blockSignals( blocked ); |
165 | } | 175 | } |
166 | 176 | ||
167 | KABC::Picture ImageWidget::photo() const | 177 | KABC::Picture ImageWidget::photo() const |
168 | { | 178 | { |
169 | KABC::Picture photo; | 179 | KABC::Picture photo; |
170 | 180 | ||
171 | if ( mUsePhotoUrl->isChecked() ) | 181 | if ( mUsePhotoUrl->isChecked() ) |
172 | photo.setUrl( mPhotoUrl->url() ); | 182 | photo.setUrl( mPhotoUrl->url() ); |
173 | else { | 183 | else { |
174 | QPixmap *px = mPhotoLabel->pixmap(); | 184 | QPixmap *px = mPhotoLabel->pixmap(); |
175 | if ( px ) { | 185 | if ( px ) { |
176 | #ifndef KAB_EMBEDDED | 186 | #ifndef KAB_EMBEDDED |
177 | if ( px->height() > px->width() ) | 187 | if ( px->height() > px->width() ) |
178 | photo.setData( px->convertToImage().scaleHeight( 140 ) ); | 188 | photo.setData( px->convertToImage().scaleHeight( 140 ) ); |
179 | else | 189 | else |
180 | photo.setData( px->convertToImage().scaleWidth( 100 ) ); | 190 | photo.setData( px->convertToImage().scaleWidth( 100 ) ); |
181 | #else //KAB_EMBEDDED | 191 | #else //KAB_EMBEDDED |
182 | //US add teh nullcheck | 192 | //US add teh nullcheck |
183 | if (px->isNull() != true ) | 193 | if (px->isNull() != true ) |
184 | photo.setData( px->convertToImage() ); | 194 | photo.setData( px->convertToImage() ); |
185 | #endif //KAB_EMBEDDED | 195 | #endif //KAB_EMBEDDED |
186 | 196 | ||
187 | photo.setType( "PNG" ); | 197 | photo.setType( "PNG" ); |
188 | } | 198 | } |
189 | } | 199 | } |
190 | 200 | ||
191 | return photo; | 201 | return photo; |
192 | } | 202 | } |
193 | 203 | ||
194 | void ImageWidget::setLogo( const KABC::Picture &logo ) | 204 | void ImageWidget::setLogo( const KABC::Picture &logo ) |
195 | { | 205 | { |
196 | bool blocked = signalsBlocked(); | 206 | bool blocked = signalsBlocked(); |
197 | blockSignals( true ); | 207 | blockSignals( true ); |
198 | 208 | ||
199 | if ( logo.isIntern() ) { | 209 | if ( logo.isIntern() ) { |
200 | //US | 210 | //US |
201 | //US mLogoLabel->setPixmap( logo.data() ); | 211 | //US mLogoLabel->setPixmap( logo.data() ); |
202 | if (logo.data().isNull() != true) | 212 | if (logo.data().isNull() != true) |
203 | { | 213 | { |
204 | QPixmap pm; | 214 | QPixmap pm; |
205 | pm.convertFromImage(logo.data()); | 215 | pm.convertFromImage(logo.data()); |
206 | mLogoLabel->setPixmap( pm ); | 216 | mLogoLabel->setPixmap( pm ); |
207 | } | 217 | } |
208 | mUseLogoUrl->setChecked( false ); | 218 | mUseLogoUrl->setChecked( false ); |
209 | } else { | 219 | } else { |
210 | mLogoUrl->setURL( logo.url() ); | 220 | mLogoUrl->setURL( logo.url() ); |
211 | if ( !logo.url().isEmpty() ) | 221 | if ( !logo.url().isEmpty() ) |
212 | mUseLogoUrl->setChecked( true ); | 222 | mUseLogoUrl->setChecked( true ); |
213 | loadLogo(); | 223 | loadLogo(); |
214 | } | 224 | } |
215 | 225 | ||
216 | blockSignals( blocked ); | 226 | blockSignals( blocked ); |
217 | } | 227 | } |
218 | 228 | ||
219 | KABC::Picture ImageWidget::logo() const | 229 | KABC::Picture ImageWidget::logo() const |
220 | { | 230 | { |
221 | KABC::Picture logo; | 231 | KABC::Picture logo; |
222 | 232 | ||
223 | if ( mUseLogoUrl->isChecked() ) | 233 | if ( mUseLogoUrl->isChecked() ) |
224 | logo.setUrl( mLogoUrl->url() ); | 234 | logo.setUrl( mLogoUrl->url() ); |
225 | else { | 235 | else { |
226 | QPixmap *px = mLogoLabel->pixmap(); | 236 | QPixmap *px = mLogoLabel->pixmap(); |
227 | if ( px ) { | 237 | if ( px ) { |
228 | #ifndef KAB_EMBEDDED | 238 | #ifndef KAB_EMBEDDED |
229 | if ( px->height() > px->width() ) | 239 | if ( px->height() > px->width() ) |
230 | logo.setData( px->convertToImage().scaleHeight( 140 ) ); | 240 | logo.setData( px->convertToImage().scaleHeight( 140 ) ); |
231 | else | 241 | else |
232 | logo.setData( px->convertToImage().scaleWidth( 100 ) ); | 242 | logo.setData( px->convertToImage().scaleWidth( 100 ) ); |
233 | #else //KAB_EMBEDDED | 243 | #else //KAB_EMBEDDED |
234 | logo.setData( px->convertToImage() ); | 244 | logo.setData( px->convertToImage() ); |
235 | #endif //KAB_EMBEDDED | 245 | #endif //KAB_EMBEDDED |
236 | 246 | ||
237 | logo.setType( "PNG" ); | 247 | logo.setType( "PNG" ); |
238 | 248 | ||
239 | } | 249 | } |
240 | } | 250 | } |
241 | |||
242 | return logo; | 251 | return logo; |
243 | } | 252 | } |
253 | void ImageWidget::removePhoto() | ||
254 | { | ||
255 | setPhoto(KABC::Picture() ); | ||
256 | } | ||
257 | |||
258 | void ImageWidget::removeLogo() | ||
259 | { | ||
260 | setLogo(KABC::Picture() ); | ||
261 | } | ||
244 | 262 | ||
245 | void ImageWidget::loadPhoto() | 263 | void ImageWidget::loadPhoto() |
246 | { | 264 | { |
247 | mPhotoLabel->setPixmap( loadPixmap( mPhotoUrl->url() ) ); | 265 | mPhotoLabel->setPixmap( loadPixmap( mPhotoUrl->url() ) ); |
248 | } | 266 | } |
249 | 267 | ||
250 | void ImageWidget::loadLogo() | 268 | void ImageWidget::loadLogo() |
251 | { | 269 | { |
252 | mLogoLabel->setPixmap( loadPixmap( mLogoUrl->url() ) ); | 270 | mLogoLabel->setPixmap( loadPixmap( mLogoUrl->url() ) ); |
253 | } | 271 | } |
254 | 272 | ||
255 | void ImageWidget::updateGUI() | 273 | void ImageWidget::updateGUI() |
256 | { | 274 | { |
257 | KURLRequester *ptr = (KURLRequester*)sender(); | 275 | KURLRequester *ptr = (KURLRequester*)sender(); |
258 | 276 | ||
259 | 277 | ||
260 | if ( ptr == mPhotoUrl ) | 278 | if ( ptr == mPhotoUrl ) |
261 | mUsePhotoUrl->setEnabled( true ); | 279 | mUsePhotoUrl->setEnabled( true ); |
262 | else if ( ptr == mLogoUrl ) | 280 | else if ( ptr == mLogoUrl ) |
263 | mUseLogoUrl->setEnabled( true ); | 281 | mUseLogoUrl->setEnabled( true ); |
264 | } | 282 | } |
265 | 283 | ||
266 | QPixmap ImageWidget::loadPixmap( const KURL &url ) | 284 | QPixmap ImageWidget::loadPixmap( const KURL &url ) |
267 | { | 285 | { |
268 | QString tempFile; | 286 | QString tempFile; |
269 | QPixmap pixmap; | 287 | QPixmap pixmap; |
270 | 288 | ||
271 | if ( url.isEmpty() ) | 289 | if ( url.isEmpty() ) |
272 | return pixmap; | 290 | return pixmap; |
273 | 291 | ||
274 | if ( url.isLocalFile() ) | 292 | if ( url.isLocalFile() ) |
275 | pixmap = QPixmap( url.path() ); | 293 | pixmap = QPixmap( url.path() ); |
276 | else | 294 | else |
277 | { | 295 | { |
278 | #ifndef KAB_EMBEDDED | 296 | #ifndef KAB_EMBEDDED |
279 | if ( KIO::NetAccess::download( url, tempFile ) ) { | 297 | if ( KIO::NetAccess::download( url, tempFile ) ) { |
280 | pixmap = QPixmap( tempFile ); | 298 | pixmap = QPixmap( tempFile ); |
281 | KIO::NetAccess::removeTempFile( tempFile ); | 299 | KIO::NetAccess::removeTempFile( tempFile ); |
282 | } | 300 | } |
283 | #else //KAB_EMBEDDED | 301 | #else //KAB_EMBEDDED |
284 | qDebug("ImageWidget::loadPixmap : only local pixmaps are allowed"); | 302 | qDebug("ImageWidget::loadPixmap : only local pixmaps are allowed"); |
285 | #endif //KAB_EMBEDDED | 303 | #endif //KAB_EMBEDDED |
286 | 304 | ||
287 | } | 305 | } |
288 | 306 | ||
289 | return pixmap; | 307 | return pixmap; |
290 | } | 308 | } |
291 | 309 | ||
292 | #ifndef KAB_EMBEDDED | 310 | #ifndef KAB_EMBEDDED |
293 | #include "imagewidget.moc" | 311 | #include "imagewidget.moc" |
294 | #endif //KAB_EMBEDDED | 312 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/imagewidget.h b/kaddressbook/imagewidget.h index b3ca0bd..afb9aa7 100644 --- a/kaddressbook/imagewidget.h +++ b/kaddressbook/imagewidget.h | |||
@@ -1,86 +1,88 @@ | |||
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 | #ifndef IMAGEWIDGET_H | 24 | #ifndef IMAGEWIDGET_H |
25 | #define IMAGEWIDGET_H | 25 | #define IMAGEWIDGET_H |
26 | 26 | ||
27 | #include <qwidget.h> | 27 | #include <qwidget.h> |
28 | 28 | ||
29 | #include <kabc/picture.h> | 29 | #include <kabc/picture.h> |
30 | #include <kdialogbase.h> | 30 | #include <kdialogbase.h> |
31 | 31 | ||
32 | class KURL; | 32 | class KURL; |
33 | class KURLRequester; | 33 | class KURLRequester; |
34 | 34 | ||
35 | class QCheckBox; | 35 | class QCheckBox; |
36 | class QLabel; | 36 | class QLabel; |
37 | 37 | ||
38 | class ImageWidget : public QWidget | 38 | class ImageWidget : public QWidget |
39 | { | 39 | { |
40 | Q_OBJECT | 40 | Q_OBJECT |
41 | 41 | ||
42 | public: | 42 | public: |
43 | ImageWidget( QWidget *parent, const char *name = 0 ); | 43 | ImageWidget( QWidget *parent, const char *name = 0 ); |
44 | ~ImageWidget(); | 44 | ~ImageWidget(); |
45 | 45 | ||
46 | /** | 46 | /** |
47 | Sets the photo object. | 47 | Sets the photo object. |
48 | */ | 48 | */ |
49 | void setPhoto( const KABC::Picture &photo ); | 49 | void setPhoto( const KABC::Picture &photo ); |
50 | 50 | ||
51 | /** | 51 | /** |
52 | Returns a photo object. | 52 | Returns a photo object. |
53 | */ | 53 | */ |
54 | KABC::Picture photo() const; | 54 | KABC::Picture photo() const; |
55 | 55 | ||
56 | /** | 56 | /** |
57 | Sets the logo object. | 57 | Sets the logo object. |
58 | */ | 58 | */ |
59 | void setLogo( const KABC::Picture &photo ); | 59 | void setLogo( const KABC::Picture &photo ); |
60 | 60 | ||
61 | /** | 61 | /** |
62 | Returns a logo object. | 62 | Returns a logo object. |
63 | */ | 63 | */ |
64 | KABC::Picture logo() const; | 64 | KABC::Picture logo() const; |
65 | 65 | ||
66 | signals: | 66 | signals: |
67 | void changed(); | 67 | void changed(); |
68 | 68 | ||
69 | private slots: | 69 | private slots: |
70 | void loadPhoto(); | 70 | void loadPhoto(); |
71 | void loadLogo(); | 71 | void loadLogo(); |
72 | void removePhoto(); | ||
73 | void removeLogo(); | ||
72 | void updateGUI(); | 74 | void updateGUI(); |
73 | 75 | ||
74 | private: | 76 | private: |
75 | QPixmap loadPixmap( const KURL &url ); | 77 | QPixmap loadPixmap( const KURL &url ); |
76 | 78 | ||
77 | KURLRequester *mPhotoUrl; | 79 | KURLRequester *mPhotoUrl; |
78 | KURLRequester *mLogoUrl; | 80 | KURLRequester *mLogoUrl; |
79 | 81 | ||
80 | QCheckBox *mUsePhotoUrl; | 82 | QCheckBox *mUsePhotoUrl; |
81 | QCheckBox *mUseLogoUrl; | 83 | QCheckBox *mUseLogoUrl; |
82 | QLabel *mPhotoLabel; | 84 | QLabel *mPhotoLabel; |
83 | QLabel *mLogoLabel; | 85 | QLabel *mLogoLabel; |
84 | }; | 86 | }; |
85 | 87 | ||
86 | #endif | 88 | #endif |