-rw-r--r-- | kabc/addressee.cpp | 62 | ||||
-rw-r--r-- | kaddressbook/addresseeeditorwidget.cpp | 56 | ||||
-rw-r--r-- | kaddressbook/mainembedded.cpp | 15 | ||||
-rw-r--r-- | kaddressbook/nameeditdialog.cpp | 7 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/genericwrapper.cpp | 2 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 8 | ||||
-rw-r--r-- | libkdepim/addresseeview.cpp | 10 | ||||
-rw-r--r-- | libkdepim/kdateedit.cpp | 17 | ||||
-rw-r--r-- | libkdepim/kdateedit.h | 3 | ||||
-rw-r--r-- | microkde/kdeui/kaction.cpp | 44 |
10 files changed, 144 insertions, 80 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 6b282e2..4cdd5e5 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -792,53 +792,57 @@ Agent Addressee::agent() const | |||
792 | QString Addressee::agentLabel() | 792 | QString Addressee::agentLabel() |
793 | { | 793 | { |
794 | return i18n("Agent"); | 794 | return i18n("Agent"); |
795 | } | 795 | } |
796 | 796 | ||
797 | 797 | ||
798 | 798 | ||
799 | void Addressee::setNameFromString( const QString &str ) | 799 | void Addressee::setNameFromString( const QString &str ) |
800 | { | 800 | { |
801 | setFormattedName( str ); | 801 | setFormattedName( str ); |
802 | setName( str ); | 802 | setName( str ); |
803 | 803 | ||
804 | QStringList titles; | 804 | static bool first = true; |
805 | titles += i18n( "Dr." ); | 805 | static QStringList titles; |
806 | titles += i18n( "Miss" ); | 806 | static QStringList suffixes; |
807 | titles += i18n( "Mr." ); | 807 | static QStringList prefixes; |
808 | titles += i18n( "Mrs." ); | 808 | |
809 | titles += i18n( "Ms." ); | 809 | if ( first ) { |
810 | titles += i18n( "Prof." ); | 810 | first = false; |
811 | 811 | titles += i18n( "Dr." ); | |
812 | QStringList suffixes; | 812 | titles += i18n( "Miss" ); |
813 | suffixes += i18n( "I" ); | 813 | titles += i18n( "Mr." ); |
814 | suffixes += i18n( "II" ); | 814 | titles += i18n( "Mrs." ); |
815 | suffixes += i18n( "III" ); | 815 | titles += i18n( "Ms." ); |
816 | suffixes += i18n( "Jr." ); | 816 | titles += i18n( "Prof." ); |
817 | suffixes += i18n( "Sr." ); | 817 | |
818 | 818 | suffixes += i18n( "I" ); | |
819 | QStringList prefixes; | 819 | suffixes += i18n( "II" ); |
820 | prefixes += "van"; | 820 | suffixes += i18n( "III" ); |
821 | prefixes += "von"; | 821 | suffixes += i18n( "Jr." ); |
822 | prefixes += "de"; | 822 | suffixes += i18n( "Sr." ); |
823 | 823 | ||
824 | //US KConfig config( "kabcrc" ); | 824 | prefixes += "van"; |
825 | KConfig config( locateLocal( "config", "kabcrc") ); | 825 | prefixes += "von"; |
826 | config.setGroup( "General" ); | 826 | prefixes += "de"; |
827 | titles += config.readListEntry( "Prefixes" ); | 827 | |
828 | titles.remove( "" ); | 828 | KConfig config( locateLocal( "config", "kabcrc") ); |
829 | prefixes += config.readListEntry( "Inclusions" ); | 829 | config.setGroup( "General" ); |
830 | prefixes.remove( "" ); | 830 | titles += config.readListEntry( "Prefixes" ); |
831 | suffixes += config.readListEntry( "Suffixes" ); | 831 | titles.remove( "" ); |
832 | suffixes.remove( "" ); | 832 | prefixes += config.readListEntry( "Inclusions" ); |
833 | prefixes.remove( "" ); | ||
834 | suffixes += config.readListEntry( "Suffixes" ); | ||
835 | suffixes.remove( "" ); | ||
836 | } | ||
833 | 837 | ||
834 | // clear all name parts | 838 | // clear all name parts |
835 | setPrefix( "" ); | 839 | setPrefix( "" ); |
836 | setGivenName( "" ); | 840 | setGivenName( "" ); |
837 | setAdditionalName( "" ); | 841 | setAdditionalName( "" ); |
838 | setFamilyName( "" ); | 842 | setFamilyName( "" ); |
839 | setSuffix( "" ); | 843 | setSuffix( "" ); |
840 | 844 | ||
841 | if ( str.isEmpty() ) | 845 | if ( str.isEmpty() ) |
842 | return; | 846 | return; |
843 | 847 | ||
844 | int i = str.find(','); | 848 | int i = str.find(','); |
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp index 3cfc1f2..826c69b 100644 --- a/kaddressbook/addresseeeditorwidget.cpp +++ b/kaddressbook/addresseeeditorwidget.cpp | |||
@@ -78,25 +78,24 @@ | |||
78 | #include "addresseeeditorwidget.h" | 78 | #include "addresseeeditorwidget.h" |
79 | 79 | ||
80 | 80 | ||
81 | 81 | ||
82 | AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension, | 82 | AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension, |
83 | QWidget *parent, const char *name ) | 83 | QWidget *parent, const char *name ) |
84 | : ExtensionWidget( core, parent, name ), mIsExtension( isExtension ), | 84 | : ExtensionWidget( core, parent, name ), mIsExtension( isExtension ), |
85 | mBlockSignals( false ) | 85 | mBlockSignals( false ) |
86 | { | 86 | { |
87 | 87 | ||
88 | mAConfig = AddresseeConfig::instance(); | 88 | mAConfig = AddresseeConfig::instance(); |
89 | 89 | ||
90 | kdDebug(5720) << "AddresseeEditorWidget()" << endl; | ||
91 | mFormattedNameType = NameEditDialog::CustomName; | 90 | mFormattedNameType = NameEditDialog::CustomName; |
92 | initGUI(); | 91 | initGUI(); |
93 | mCategoryDialog = 0; | 92 | mCategoryDialog = 0; |
94 | mCategoryEditDialog = 0; | 93 | mCategoryEditDialog = 0; |
95 | 94 | ||
96 | // Load the empty addressee as defaults | 95 | // Load the empty addressee as defaults |
97 | load(); | 96 | load(); |
98 | 97 | ||
99 | mDirty = false; | 98 | mDirty = false; |
100 | } | 99 | } |
101 | 100 | ||
102 | AddresseeEditorWidget::~AddresseeEditorWidget() | 101 | AddresseeEditorWidget::~AddresseeEditorWidget() |
@@ -623,24 +622,25 @@ void AddresseeEditorWidget::setupTab2() | |||
623 | layout->addWidget( label, 7, 1 ); | 622 | layout->addWidget( label, 7, 1 ); |
624 | mSpouseEdit = new KLineEdit( tab2 ); | 623 | mSpouseEdit = new KLineEdit( tab2 ); |
625 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), | 624 | connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), |
626 | SLOT( textChanged( const QString& ) ) ); | 625 | SLOT( textChanged( const QString& ) ) ); |
627 | label->setBuddy( mSpouseEdit ); | 626 | label->setBuddy( mSpouseEdit ); |
628 | //US layout->addWidget( mSpouseEdit, 5, 2 ); | 627 | //US layout->addWidget( mSpouseEdit, 5, 2 ); |
629 | layout->addWidget( mSpouseEdit, 7, 2 ); | 628 | layout->addWidget( mSpouseEdit, 7, 2 ); |
630 | 629 | ||
631 | label = new QLabel( i18n( "Birthday:" ), tab2 ); | 630 | label = new QLabel( i18n( "Birthday:" ), tab2 ); |
632 | //US layout->addWidget( label, 4, 3 ); | 631 | //US layout->addWidget( label, 4, 3 ); |
633 | layout->addWidget( label, 8, 1 ); | 632 | layout->addWidget( label, 8, 1 ); |
634 | mBirthdayPicker = new KDateEdit( tab2 ); | 633 | mBirthdayPicker = new KDateEdit( tab2 ); |
634 | mBirthdayPicker->toggleDateFormat(); | ||
635 | mBirthdayPicker->setHandleInvalid( true ); | 635 | mBirthdayPicker->setHandleInvalid( true ); |
636 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), | 636 | connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), |
637 | SLOT( dateChanged( QDate ) ) ); | 637 | SLOT( dateChanged( QDate ) ) ); |
638 | 638 | ||
639 | 639 | ||
640 | #ifndef KAB_EMBEDDED | 640 | #ifndef KAB_EMBEDDED |
641 | //US invalid dates are handdled by the KDateEdit widget itself | 641 | //US invalid dates are handdled by the KDateEdit widget itself |
642 | connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), | 642 | connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), |
643 | SLOT( invalidDate() ) ); | 643 | SLOT( invalidDate() ) ); |
644 | connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), | 644 | connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), |
645 | SLOT( emitModified() ) ); | 645 | SLOT( emitModified() ) ); |
646 | #endif //KAB_EMBEDDED | 646 | #endif //KAB_EMBEDDED |
@@ -938,25 +938,24 @@ void AddresseeEditorWidget::setupTab3_1() | |||
938 | // Keys | 938 | // Keys |
939 | mKeyWidget = new KeyWidget( tab3 ); | 939 | mKeyWidget = new KeyWidget( tab3 ); |
940 | mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); | 940 | mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); |
941 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); | 941 | connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); |
942 | layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); | 942 | layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); |
943 | */ | 943 | */ |
944 | mTabWidget->addTab( tab3, i18n( "&Images" ) ); | 944 | mTabWidget->addTab( tab3, i18n( "&Images" ) ); |
945 | } | 945 | } |
946 | 946 | ||
947 | 947 | ||
948 | void AddresseeEditorWidget::load() | 948 | void AddresseeEditorWidget::load() |
949 | { | 949 | { |
950 | kdDebug(5720) << "AddresseeEditorWidget::load()" << endl; | ||
951 | 950 | ||
952 | // Block signals in case anything tries to emit modified | 951 | // Block signals in case anything tries to emit modified |
953 | // CS: This doesn't seem to work. | 952 | // CS: This doesn't seem to work. |
954 | bool block = signalsBlocked(); | 953 | bool block = signalsBlocked(); |
955 | blockSignals( true ); | 954 | blockSignals( true ); |
956 | mBlockSignals = true; // used for internal signal blocking | 955 | mBlockSignals = true; // used for internal signal blocking |
957 | 956 | ||
958 | mNameEdit->setText( mAddressee.assembledName() ); | 957 | mNameEdit->setText( mAddressee.assembledName() ); |
959 | 958 | ||
960 | if ( mAddressee.formattedName().isEmpty() ) { | 959 | if ( mAddressee.formattedName().isEmpty() ) { |
961 | //US KConfig config( "kaddressbookrc" ); | 960 | //US KConfig config( "kaddressbookrc" ); |
962 | KConfig config( locateLocal("config", "kaddressbookrc") ); | 961 | KConfig config( locateLocal("config", "kaddressbookrc") ); |
@@ -1019,66 +1018,73 @@ void AddresseeEditorWidget::load() | |||
1019 | mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) ); | 1018 | mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) ); |
1020 | mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) ); | 1019 | mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) ); |
1021 | mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) ); | 1020 | mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) ); |
1022 | 1021 | ||
1023 | blockSignals( block ); | 1022 | blockSignals( block ); |
1024 | mBlockSignals = false; | 1023 | mBlockSignals = false; |
1025 | 1024 | ||
1026 | mDirty = false; | 1025 | mDirty = false; |
1027 | } | 1026 | } |
1028 | 1027 | ||
1029 | void AddresseeEditorWidget::save() | 1028 | void AddresseeEditorWidget::save() |
1030 | { | 1029 | { |
1031 | if ( !mDirty ) return; | 1030 | if ( !dirty() ) { |
1031 | return; | ||
1032 | } | ||
1032 | 1033 | ||
1033 | mAddressee.setRole( mRoleEdit->text() ); | 1034 | mAddressee.setRole( mRoleEdit->text() ); |
1034 | mAddressee.setOrganization( mOrgEdit->text() ); | 1035 | mAddressee.setOrganization( mOrgEdit->text() ); |
1035 | mAddressee.setUrl( KURL( mURLEdit->text() ) ); | 1036 | mAddressee.setUrl( KURL( mURLEdit->text() ) ); |
1036 | mAddressee.setNote( mNoteEdit->text() ); | 1037 | mAddressee.setNote( mNoteEdit->text() ); |
1037 | if ( mBirthdayPicker->inputIsValid() ) | 1038 | if ( mBirthdayPicker->inputIsValid() ) { |
1038 | mAddressee.setBirthday( QDateTime( mBirthdayPicker->date() ) ); | 1039 | QDate da = mBirthdayPicker->date(); |
1039 | else | 1040 | if ( da > QDate::currentDate() ) |
1041 | da.setYMD(da.year()-100, da.month(), da.day() ); | ||
1042 | mAddressee.setBirthday( QDateTime( da ) ); | ||
1043 | qDebug("bday %s ",da.toString().latin1()); | ||
1044 | } | ||
1045 | else { | ||
1040 | mAddressee.setBirthday( QDateTime() ); | 1046 | mAddressee.setBirthday( QDateTime() ); |
1041 | 1047 | mBirthdayPicker->clear(); | |
1048 | } | ||
1042 | mAddressee.setNickName( mNicknameEdit->text() ); | 1049 | mAddressee.setNickName( mNicknameEdit->text() ); |
1043 | mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) ); | 1050 | mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) ); |
1044 | 1051 | ||
1045 | mAddressee.setGeo( mGeoWidget->geo() ); | 1052 | mAddressee.setGeo( mGeoWidget->geo() ); |
1046 | mAddressee.setPhoto( mImageWidget->photo() ); | 1053 | mAddressee.setPhoto( mImageWidget->photo() ); |
1047 | mAddressee.setLogo( mImageWidget->logo() ); | 1054 | mAddressee.setLogo( mImageWidget->logo() ); |
1048 | mAddressee.setKeys( mKeyWidget->keys() ); | 1055 | mAddressee.setKeys( mKeyWidget->keys() ); |
1049 | #ifndef KAB_EMBEDDED | 1056 | #ifndef KAB_EMBEDDED |
1050 | mAddressee.setSound( mSoundWidget->sound() ); | 1057 | mAddressee.setSound( mSoundWidget->sound() ); |
1051 | #else //KAB_EMBEDDED | 1058 | #else //KAB_EMBEDDED |
1052 | //US qDebug("AddresseeEditorWidget::save sound not supported"); | 1059 | //US qDebug("AddresseeEditorWidget::save sound not supported"); |
1053 | #endif //KAB_EMBEDDED | 1060 | #endif //KAB_EMBEDDED |
1054 | mAddressee.setSecrecy( mSecrecyWidget->secrecy() ); | 1061 | mAddressee.setSecrecy( mSecrecyWidget->secrecy() ); |
1055 | 1062 | ||
1056 | // save custom fields | 1063 | // save custom fields |
1057 | mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() ); | 1064 | mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() ); |
1058 | mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() ); | 1065 | mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() ); |
1059 | mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() ); | 1066 | mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() ); |
1060 | mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() ); | 1067 | mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() ); |
1061 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() ); | 1068 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() ); |
1062 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() ); | 1069 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() ); |
1063 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() ); | 1070 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() ); |
1064 | if ( mAnniversaryPicker->inputIsValid() ) { | 1071 | if ( mAnniversaryPicker->inputIsValid() ) { |
1065 | |||
1066 | //US mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", | ||
1067 | //US mAnniversaryPicker->date().toString( Qt::ISODate ) ); | ||
1068 | QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate); | 1072 | QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate); |
1069 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); | 1073 | mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); |
1070 | } | 1074 | } |
1071 | else | 1075 | else { |
1072 | mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" ); | 1076 | mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" ); |
1077 | mAnniversaryPicker->clear(); | ||
1078 | } | ||
1073 | 1079 | ||
1074 | // Save the email addresses | 1080 | // Save the email addresses |
1075 | QStringList emails = mAddressee.emails(); | 1081 | QStringList emails = mAddressee.emails(); |
1076 | QStringList::Iterator iter; | 1082 | QStringList::Iterator iter; |
1077 | for ( iter = emails.begin(); iter != emails.end(); ++iter ) | 1083 | for ( iter = emails.begin(); iter != emails.end(); ++iter ) |
1078 | mAddressee.removeEmail( *iter ); | 1084 | mAddressee.removeEmail( *iter ); |
1079 | 1085 | ||
1080 | emails = mEmailWidget->emails(); | 1086 | emails = mEmailWidget->emails(); |
1081 | bool first = true; | 1087 | bool first = true; |
1082 | for ( iter = emails.begin(); iter != emails.end(); ++iter ) { | 1088 | for ( iter = emails.begin(); iter != emails.end(); ++iter ) { |
1083 | mAddressee.insertEmail( *iter, first ); | 1089 | mAddressee.insertEmail( *iter, first ); |
1084 | first = false; | 1090 | first = false; |
@@ -1105,36 +1111,56 @@ void AddresseeEditorWidget::save() | |||
1105 | ++addressIter ) | 1111 | ++addressIter ) |
1106 | mAddressee.removeAddress( *addressIter ); | 1112 | mAddressee.removeAddress( *addressIter ); |
1107 | 1113 | ||
1108 | addresses = mAddressEditWidget->addresses(); | 1114 | addresses = mAddressEditWidget->addresses(); |
1109 | for ( addressIter = addresses.begin(); addressIter != addresses.end(); | 1115 | for ( addressIter = addresses.begin(); addressIter != addresses.end(); |
1110 | ++addressIter ) | 1116 | ++addressIter ) |
1111 | mAddressee.insertAddress( *addressIter ); | 1117 | mAddressee.insertAddress( *addressIter ); |
1112 | mDirty = false; | 1118 | mDirty = false; |
1113 | } | 1119 | } |
1114 | 1120 | ||
1115 | bool AddresseeEditorWidget::dirty() | 1121 | bool AddresseeEditorWidget::dirty() |
1116 | { | 1122 | { |
1123 | |||
1124 | if ( ! mDirty ) { | ||
1125 | if ( mBirthdayPicker->inputIsValid() ) { | ||
1126 | QDate da = mBirthdayPicker->date(); | ||
1127 | if ( !(da == mAddressee.birthday().date())) | ||
1128 | mDirty = true; | ||
1129 | } | ||
1130 | else { | ||
1131 | mBirthdayPicker->clear(); | ||
1132 | } | ||
1133 | if ( mAnniversaryPicker->inputIsValid() ) { | ||
1134 | QDate da = mAnniversaryPicker->date(); | ||
1135 | if ( da != KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), | ||
1136 | "%Y-%m-%d")) | ||
1137 | mDirty = true; | ||
1138 | } | ||
1139 | else { | ||
1140 | mAnniversaryPicker->clear(); | ||
1141 | } | ||
1142 | } | ||
1117 | return mDirty; | 1143 | return mDirty; |
1118 | } | 1144 | } |
1119 | 1145 | ||
1120 | void AddresseeEditorWidget::nameTextChanged( const QString &text ) | 1146 | void AddresseeEditorWidget::nameTextChanged( const QString &text ) |
1121 | { | 1147 | { |
1122 | // use the addressee class to parse the name for us | 1148 | // use the addressee class to parse the name for us |
1123 | mAConfig->setUid( mAddressee.uid() ); | 1149 | mAConfig->setUid( mAddressee.uid() ); |
1124 | if ( mAConfig->automaticNameParsing() ) { | 1150 | if ( mAConfig->automaticNameParsing() ) { |
1125 | if ( !mAddressee.formattedName().isEmpty() ) { | 1151 | if ( !mAddressee.formattedName().isEmpty() ) { |
1126 | QString fn = mAddressee.formattedName(); | 1152 | QString fn = mAddressee.formattedName(); |
1127 | mAddressee.setNameFromString( text ); | 1153 | mAddressee.setNameFromString( text ); |
1128 | mAddressee.setFormattedName( fn ); | 1154 | mAddressee.setFormattedName( fn ); |
1129 | } else { | 1155 | } else { |
1130 | // use extra addressee to avoid a formatted name assignment | 1156 | // use extra addressee to avoid a formatted name assignment |
1131 | Addressee addr; | 1157 | Addressee addr; |
1132 | addr.setNameFromString( text ); | 1158 | addr.setNameFromString( text ); |
1133 | mAddressee.setPrefix( addr.prefix() ); | 1159 | mAddressee.setPrefix( addr.prefix() ); |
1134 | mAddressee.setGivenName( addr.givenName() ); | 1160 | mAddressee.setGivenName( addr.givenName() ); |
1135 | mAddressee.setAdditionalName( addr.additionalName() ); | 1161 | mAddressee.setAdditionalName( addr.additionalName() ); |
1136 | mAddressee.setFamilyName( addr.familyName() ); | 1162 | mAddressee.setFamilyName( addr.familyName() ); |
1137 | mAddressee.setSuffix( addr.suffix() ); | 1163 | mAddressee.setSuffix( addr.suffix() ); |
1138 | } | 1164 | } |
1139 | } | 1165 | } |
1140 | 1166 | ||
@@ -1160,25 +1186,25 @@ void AddresseeEditorWidget::nameBoxChanged() | |||
1160 | 1186 | ||
1161 | if ( mFormattedNameType != NameEditDialog::CustomName ) { | 1187 | if ( mFormattedNameType != NameEditDialog::CustomName ) { |
1162 | mFormattedNameLabel->setText( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); | 1188 | mFormattedNameLabel->setText( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); |
1163 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); | 1189 | mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); |
1164 | } | 1190 | } |
1165 | } | 1191 | } |
1166 | 1192 | ||
1167 | void AddresseeEditorWidget::nameButtonClicked() | 1193 | void AddresseeEditorWidget::nameButtonClicked() |
1168 | { | 1194 | { |
1169 | // show the name dialog. | 1195 | // show the name dialog. |
1170 | NameEditDialog dialog( mAddressee, mFormattedNameType, this ); | 1196 | NameEditDialog dialog( mAddressee, mFormattedNameType, this ); |
1171 | 1197 | ||
1172 | if ( dialog.exec() ) { | 1198 | if ( KApplication::execDialog( &dialog) ) { |
1173 | if ( dialog.changed() ) { | 1199 | if ( dialog.changed() ) { |
1174 | mAddressee.setFamilyName( dialog.familyName() ); | 1200 | mAddressee.setFamilyName( dialog.familyName() ); |
1175 | mAddressee.setGivenName( dialog.givenName() ); | 1201 | mAddressee.setGivenName( dialog.givenName() ); |
1176 | mAddressee.setPrefix( dialog.prefix() ); | 1202 | mAddressee.setPrefix( dialog.prefix() ); |
1177 | mAddressee.setSuffix( dialog.suffix() ); | 1203 | mAddressee.setSuffix( dialog.suffix() ); |
1178 | mAddressee.setAdditionalName( dialog.additionalName() ); | 1204 | mAddressee.setAdditionalName( dialog.additionalName() ); |
1179 | mFormattedNameType = dialog.formattedNameType(); | 1205 | mFormattedNameType = dialog.formattedNameType(); |
1180 | if ( mFormattedNameType == NameEditDialog::CustomName ) { | 1206 | if ( mFormattedNameType == NameEditDialog::CustomName ) { |
1181 | mFormattedNameLabel->setText( dialog.customFormattedName() ); | 1207 | mFormattedNameLabel->setText( dialog.customFormattedName() ); |
1182 | mAddressee.setFormattedName( dialog.customFormattedName() ); | 1208 | mAddressee.setFormattedName( dialog.customFormattedName() ); |
1183 | } | 1209 | } |
1184 | // Update the name edit. | 1210 | // Update the name edit. |
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index d781f67..4230c07 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -62,24 +62,39 @@ int main( int argc, char **argv ) | |||
62 | #else | 62 | #else |
63 | QString fileName ; | 63 | QString fileName ; |
64 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; | 64 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; |
65 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 65 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
66 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); | 66 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); |
67 | 67 | ||
68 | #endif | 68 | #endif |
69 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); | 69 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); |
70 | KAddressBookMain m ; | 70 | KAddressBookMain m ; |
71 | //US MainWindow m; | 71 | //US MainWindow m; |
72 | QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 72 | QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
73 | 73 | ||
74 | { | ||
75 | KConfig kon ( locateLocal( "config", "korganizerrc" ) ); | ||
76 | kon.setGroup("Locale"); | ||
77 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) ); | ||
78 | QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( ""); | ||
79 | KGlobal::locale()->setHore24Format( !kon.readBoolEntry( "PreferredTime",0 ) ); | ||
80 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); | ||
81 | dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" ); | ||
82 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); | ||
83 | kon.setGroup("Time & Date"); | ||
84 | KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ), | ||
85 | kon.readNumEntry( "DaylightsavingStart", 90), | ||
86 | kon.readNumEntry( "DaylightsavingEnd",304) ); | ||
87 | KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") ); | ||
88 | } | ||
74 | #ifndef DESKTOP_VERSION | 89 | #ifndef DESKTOP_VERSION |
75 | a.showMainWidget( &m ); | 90 | a.showMainWidget( &m ); |
76 | #else | 91 | #else |
77 | a.setMainWidget( &m ); | 92 | a.setMainWidget( &m ); |
78 | m.resize (640, 480 ); | 93 | m.resize (640, 480 ); |
79 | m.show(); | 94 | m.show(); |
80 | #endif | 95 | #endif |
81 | a.exec(); | 96 | a.exec(); |
82 | 97 | ||
83 | } | 98 | } |
84 | qDebug("KA: Bye! "); | 99 | qDebug("KA: Bye! "); |
85 | } | 100 | } |
diff --git a/kaddressbook/nameeditdialog.cpp b/kaddressbook/nameeditdialog.cpp index fb7eb22..8213c2b 100644 --- a/kaddressbook/nameeditdialog.cpp +++ b/kaddressbook/nameeditdialog.cpp | |||
@@ -100,25 +100,25 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type, | |||
100 | mFormattedNameCombo->setMaximumWidth(100); | 100 | mFormattedNameCombo->setMaximumWidth(100); |
101 | 101 | ||
102 | layout->addMultiCellWidget( mFormattedNameCombo, 5, 5, 0, 0 ); | 102 | layout->addMultiCellWidget( mFormattedNameCombo, 5, 5, 0, 0 ); |
103 | connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SLOT( typeChanged( int ) ) ); | 103 | connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SLOT( typeChanged( int ) ) ); |
104 | 104 | ||
105 | mFormattedNameEdit = new KLineEdit( page ); | 105 | mFormattedNameEdit = new KLineEdit( page ); |
106 | mFormattedNameEdit->setEnabled( type == CustomName ); | 106 | mFormattedNameEdit->setEnabled( type == CustomName ); |
107 | layout->addMultiCellWidget( mFormattedNameEdit, 5, 5, 1, 2 ); | 107 | layout->addMultiCellWidget( mFormattedNameEdit, 5, 5, 1, 2 ); |
108 | 108 | ||
109 | mParseBox = new QCheckBox( i18n( "Parse name automatically" ), page ); | 109 | mParseBox = new QCheckBox( i18n( "Parse name automatically" ), page ); |
110 | connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( parseBoxChanged(bool) ) ); | 110 | connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( parseBoxChanged(bool) ) ); |
111 | connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( modified() ) ); | 111 | connect( mParseBox, SIGNAL( toggled(bool) ), SLOT( modified() ) ); |
112 | layout->addMultiCellWidget( mParseBox, 6, 6, 0, 1 ); | 112 | layout->addMultiCellWidget( mParseBox, 6, 6, 0, 2 ); |
113 | 113 | ||
114 | // Fill in the values | 114 | // Fill in the values |
115 | mFamilyNameEdit->setText( addr.familyName() ); | 115 | mFamilyNameEdit->setText( addr.familyName() ); |
116 | mGivenNameEdit->setText( addr.givenName() ); | 116 | mGivenNameEdit->setText( addr.givenName() ); |
117 | mAdditionalNameEdit->setText( addr.additionalName() ); | 117 | mAdditionalNameEdit->setText( addr.additionalName() ); |
118 | mFormattedNameEdit->setText( addr.formattedName() ); | 118 | mFormattedNameEdit->setText( addr.formattedName() ); |
119 | 119 | ||
120 | // Prefix and suffix combos | 120 | // Prefix and suffix combos |
121 | //US KConfig config( "kabcrc" ); | 121 | //US KConfig config( "kabcrc" ); |
122 | KConfig config( locateLocal("config", "kabcrc") ); | 122 | KConfig config( locateLocal("config", "kabcrc") ); |
123 | config.setGroup( "General" ); | 123 | config.setGroup( "General" ); |
124 | 124 | ||
@@ -166,28 +166,25 @@ NameEditDialog::NameEditDialog( const KABC::Addressee &addr, int type, | |||
166 | connect( mAdditionalNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); | 166 | connect( mAdditionalNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); |
167 | connect( mAdditionalNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) ); | 167 | connect( mAdditionalNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) ); |
168 | connect( mFamilyNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); | 168 | connect( mFamilyNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); |
169 | connect( mFamilyNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) ); | 169 | connect( mFamilyNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) ); |
170 | connect( mSuffixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); | 170 | connect( mSuffixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); |
171 | connect( mSuffixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) ); | 171 | connect( mSuffixCombo, SIGNAL( textChanged( const QString& ) ), SLOT( updateTypeCombo() ) ); |
172 | connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SLOT( modified() ) ); | 172 | connect( mFormattedNameCombo, SIGNAL( activated( int ) ), SLOT( modified() ) ); |
173 | connect( mFormattedNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); | 173 | connect( mFormattedNameEdit, SIGNAL( textChanged( const QString& ) ), SLOT( modified() ) ); |
174 | 174 | ||
175 | updateTypeCombo(); | 175 | updateTypeCombo(); |
176 | mFormattedNameCombo->setCurrentItem( type ); | 176 | mFormattedNameCombo->setCurrentItem( type ); |
177 | 177 | ||
178 | #ifdef KAB_EMBEDDED | 178 | |
179 | resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300)); | ||
180 | #endif //KAB_EMBEDDED | ||
181 | |||
182 | mChanged = false; | 179 | mChanged = false; |
183 | } | 180 | } |
184 | 181 | ||
185 | NameEditDialog::~NameEditDialog() | 182 | NameEditDialog::~NameEditDialog() |
186 | { | 183 | { |
187 | } | 184 | } |
188 | 185 | ||
189 | QString NameEditDialog::familyName() const | 186 | QString NameEditDialog::familyName() const |
190 | { | 187 | { |
191 | return mFamilyNameEdit->text(); | 188 | return mFamilyNameEdit->text(); |
192 | } | 189 | } |
193 | 190 | ||
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp index ed591fc..c3a1627 100644 --- a/kmicromail/libmailwrapper/genericwrapper.cpp +++ b/kmicromail/libmailwrapper/genericwrapper.cpp | |||
@@ -28,24 +28,26 @@ Genericwrapper::~Genericwrapper() | |||
28 | cleanMimeCache(); | 28 | cleanMimeCache(); |
29 | } | 29 | } |
30 | QString Genericwrapper::parseDateTime( mailimf_date_time *date ) | 30 | QString Genericwrapper::parseDateTime( mailimf_date_time *date ) |
31 | { | 31 | { |
32 | static bool init = false ; | 32 | static bool init = false ; |
33 | if ( ! init ) { | 33 | if ( ! init ) { |
34 | KConfig kon ( locateLocal( "config", "korganizerrc" ) ); | 34 | KConfig kon ( locateLocal( "config", "korganizerrc" ) ); |
35 | kon.setGroup("Locale"); | 35 | kon.setGroup("Locale"); |
36 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) ); | 36 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) ); |
37 | QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( ""); | 37 | QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( ""); |
38 | KGlobal::locale()->setHore24Format( !kon.readBoolEntry( "PreferredTime",0 ) ); | 38 | KGlobal::locale()->setHore24Format( !kon.readBoolEntry( "PreferredTime",0 ) ); |
39 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); | 39 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); |
40 | dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" ); | ||
41 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); | ||
40 | kon.setGroup("Time & Date"); | 42 | kon.setGroup("Time & Date"); |
41 | KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ), | 43 | KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ), |
42 | kon.readNumEntry( "DaylightsavingStart", 90), | 44 | kon.readNumEntry( "DaylightsavingStart", 90), |
43 | kon.readNumEntry( "DaylightsavingEnd",304) ); | 45 | kon.readNumEntry( "DaylightsavingEnd",304) ); |
44 | KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") ); | 46 | KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") ); |
45 | 47 | ||
46 | init = true; | 48 | init = true; |
47 | 49 | ||
48 | } | 50 | } |
49 | QDate da (date->dt_year,date->dt_month, date->dt_day ); | 51 | QDate da (date->dt_year,date->dt_month, date->dt_day ); |
50 | QTime ti ( date->dt_hour, date->dt_min, date->dt_sec ); | 52 | QTime ti ( date->dt_hour, date->dt_min, date->dt_sec ); |
51 | QDateTime dt ( da ,ti ); | 53 | QDateTime dt ( da ,ti ); |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index d5d31e2..258bd43 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1251,27 +1251,29 @@ void CalendarView::syncExternal( int mode ) | |||
1251 | } else | 1251 | } else |
1252 | return; | 1252 | return; |
1253 | if ( loadSuccess ) { | 1253 | if ( loadSuccess ) { |
1254 | getEventViewerDialog()->setSyncMode( true ); | 1254 | getEventViewerDialog()->setSyncMode( true ); |
1255 | syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs ); | 1255 | syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs ); |
1256 | getEventViewerDialog()->setSyncMode( false ); | 1256 | getEventViewerDialog()->setSyncMode( false ); |
1257 | qApp->processEvents(); | 1257 | qApp->processEvents(); |
1258 | if ( syncOK ) { | 1258 | if ( syncOK ) { |
1259 | if ( KOPrefs::instance()->mWriteBackFile ) | 1259 | if ( KOPrefs::instance()->mWriteBackFile ) |
1260 | { | 1260 | { |
1261 | QPtrList<Incidence> iL = mCalendar->rawIncidences(); | 1261 | QPtrList<Incidence> iL = mCalendar->rawIncidences(); |
1262 | Incidence* inc = iL.first(); | 1262 | Incidence* inc = iL.first(); |
1263 | while ( inc ) { | 1263 | if ( phoneFormat ) { |
1264 | inc->removeID(mCurrentSyncDevice); | 1264 | while ( inc ) { |
1265 | inc = iL.next(); | 1265 | inc->removeID(mCurrentSyncDevice); |
1266 | inc = iL.next(); | ||
1267 | } | ||
1266 | } | 1268 | } |
1267 | #ifndef DESKTOP_VERSION | 1269 | #ifndef DESKTOP_VERSION |
1268 | if ( sharpFormat ) | 1270 | if ( sharpFormat ) |
1269 | sharpFormat->save(calendar); | 1271 | sharpFormat->save(calendar); |
1270 | #endif | 1272 | #endif |
1271 | if ( phoneFormat ) | 1273 | if ( phoneFormat ) |
1272 | phoneFormat->save(calendar); | 1274 | phoneFormat->save(calendar); |
1273 | iL = calendar->rawIncidences(); | 1275 | iL = calendar->rawIncidences(); |
1274 | inc = iL.first(); | 1276 | inc = iL.first(); |
1275 | Incidence* loc; | 1277 | Incidence* loc; |
1276 | while ( inc ) { | 1278 | while ( inc ) { |
1277 | if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { | 1279 | if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { |
diff --git a/libkdepim/addresseeview.cpp b/libkdepim/addresseeview.cpp index d710541..5c69010 100644 --- a/libkdepim/addresseeview.cpp +++ b/libkdepim/addresseeview.cpp | |||
@@ -56,25 +56,25 @@ AddresseeView::AddresseeView( QWidget *parent, const char *name ) | |||
56 | setLinkUnderline( false ); | 56 | setLinkUnderline( false ); |
57 | // setVScrollBarMode( QScrollView::AlwaysOff ); | 57 | // setVScrollBarMode( QScrollView::AlwaysOff ); |
58 | //setHScrollBarMode( QScrollView::AlwaysOff ); | 58 | //setHScrollBarMode( QScrollView::AlwaysOff ); |
59 | 59 | ||
60 | //US QStyleSheet *sheet = styleSheet(); | 60 | //US QStyleSheet *sheet = styleSheet(); |
61 | //US QStyleSheetItem *link = sheet->item( "a" ); | 61 | //US QStyleSheetItem *link = sheet->item( "a" ); |
62 | //US link->setColor( KGlobalSettings::linkColor() ); | 62 | //US link->setColor( KGlobalSettings::linkColor() ); |
63 | 63 | ||
64 | } | 64 | } |
65 | 65 | ||
66 | void AddresseeView::setSource(const QString& n) | 66 | void AddresseeView::setSource(const QString& n) |
67 | { | 67 | { |
68 | qDebug("********AddresseeView::setSource %s", n.latin1()); | 68 | //qDebug("********AddresseeView::setSource %s", n.latin1()); |
69 | 69 | ||
70 | if ( n.left( 6 ) == "mailto" ) | 70 | if ( n.left( 6 ) == "mailto" ) |
71 | ExternalAppHandler::instance()->mailToOneContact( n.mid(7) ); | 71 | ExternalAppHandler::instance()->mailToOneContact( n.mid(7) ); |
72 | else if ( n.left( 7 ) == "phoneto" ) | 72 | else if ( n.left( 7 ) == "phoneto" ) |
73 | ExternalAppHandler::instance()->callByPhone( n.mid(8) ); | 73 | ExternalAppHandler::instance()->callByPhone( n.mid(8) ); |
74 | else if ( n.left( 5 ) == "faxto" ) | 74 | else if ( n.left( 5 ) == "faxto" ) |
75 | ExternalAppHandler::instance()->callByFax( n.mid(6) ); | 75 | ExternalAppHandler::instance()->callByFax( n.mid(6) ); |
76 | else if ( n.left( 5 ) == "smsto" ) | 76 | else if ( n.left( 5 ) == "smsto" ) |
77 | ExternalAppHandler::instance()->callBySMS( n.mid(6) ); | 77 | ExternalAppHandler::instance()->callBySMS( n.mid(6) ); |
78 | else if ( n.left( 7 ) == "pagerto" ) | 78 | else if ( n.left( 7 ) == "pagerto" ) |
79 | ExternalAppHandler::instance()->callByPager( n.mid(8) ); | 79 | ExternalAppHandler::instance()->callByPager( n.mid(8) ); |
80 | 80 | ||
@@ -115,25 +115,31 @@ void AddresseeView::setAddressee( const KABC::Addressee& addr ) | |||
115 | .arg( *emailIt ) | 115 | .arg( *emailIt ) |
116 | .arg( *emailIt ); | 116 | .arg( *emailIt ); |
117 | ++emailIt; | 117 | ++emailIt; |
118 | } else { | 118 | } else { |
119 | dynamicPart += QString( | 119 | dynamicPart += QString( |
120 | "<tr><td align=\"right\"><b>%1</b></td>" | 120 | "<tr><td align=\"right\"><b>%1</b></td>" |
121 | "<td align=\"left\">%2</td></tr>" ) | 121 | "<td align=\"left\">%2</td></tr>" ) |
122 | .arg( type ) | 122 | .arg( type ) |
123 | .arg( *emailIt ); | 123 | .arg( *emailIt ); |
124 | ++emailIt; | 124 | ++emailIt; |
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | if ( mAddressee.birthday().date().isValid() ) { | |
128 | dynamicPart += QString( | ||
129 | "<tr><td align=\"right\"><b>%1</b></td>" | ||
130 | "<td align=\"left\">%2</td></tr>" ) | ||
131 | .arg( i18n ("Birthday") ) | ||
132 | .arg( KGlobal::locale()->formatDate( mAddressee.birthday().date() ,true) ); | ||
133 | } | ||
128 | KABC::PhoneNumber::List phones = mAddressee.phoneNumbers(); | 134 | KABC::PhoneNumber::List phones = mAddressee.phoneNumbers(); |
129 | KABC::PhoneNumber::List::ConstIterator phoneIt; | 135 | KABC::PhoneNumber::List::ConstIterator phoneIt; |
130 | QString extension; | 136 | QString extension; |
131 | int phonetype; | 137 | int phonetype; |
132 | QString sms; | 138 | QString sms; |
133 | for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { | 139 | for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { |
134 | phonetype = (*phoneIt).type(); | 140 | phonetype = (*phoneIt).type(); |
135 | if (ksmsAvail && | 141 | if (ksmsAvail && |
136 | ( | 142 | ( |
137 | ((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) || | 143 | ((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) || |
138 | ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell) | 144 | ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell) |
139 | ) | 145 | ) |
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp index 5fb948a..c4c0081 100644 --- a/libkdepim/kdateedit.cpp +++ b/libkdepim/kdateedit.cpp | |||
@@ -115,25 +115,31 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) | |||
115 | mKeywordMap[dayName] = 7 - currentDay + i; | 115 | mKeywordMap[dayName] = 7 - currentDay + i; |
116 | } | 116 | } |
117 | 117 | ||
118 | mTextChanged = false; | 118 | mTextChanged = false; |
119 | mHandleInvalid = false; | 119 | mHandleInvalid = false; |
120 | QWidget::setTabOrder( mDateEdit, mDateButton ); | 120 | QWidget::setTabOrder( mDateEdit, mDateButton ); |
121 | } | 121 | } |
122 | 122 | ||
123 | KDateEdit::~KDateEdit() | 123 | KDateEdit::~KDateEdit() |
124 | { | 124 | { |
125 | delete mDateFrame; | 125 | delete mDateFrame; |
126 | } | 126 | } |
127 | 127 | void KDateEdit::clear() | |
128 | { | ||
129 | bool b = mDateEdit->signalsBlocked(); | ||
130 | mDateEdit->blockSignals(true); | ||
131 | mDateEdit->setText(""); | ||
132 | mDateEdit->blockSignals(b); | ||
133 | } | ||
128 | void KDateEdit::setDate(QDate newDate) | 134 | void KDateEdit::setDate(QDate newDate) |
129 | { | 135 | { |
130 | if (!newDate.isValid() && !mHandleInvalid) | 136 | if (!newDate.isValid() && !mHandleInvalid) |
131 | return; | 137 | return; |
132 | if ( readDate() == newDate ) | 138 | if ( readDate() == newDate ) |
133 | return; | 139 | return; |
134 | QString dateString = ""; | 140 | QString dateString = ""; |
135 | if(newDate.isValid()) | 141 | if(newDate.isValid()) |
136 | dateString = KGlobal::locale()->formatDate( newDate, dateFormShort ); | 142 | dateString = KGlobal::locale()->formatDate( newDate, dateFormShort ); |
137 | 143 | ||
138 | mTextChanged = false; | 144 | mTextChanged = false; |
139 | 145 | ||
@@ -454,33 +460,38 @@ QDate KDateEdit::readDate() const | |||
454 | bool KDateEdit::eventFilter(QObject *, QEvent *e) | 460 | bool KDateEdit::eventFilter(QObject *, QEvent *e) |
455 | { | 461 | { |
456 | // We only process the focus out event if the text has changed | 462 | // We only process the focus out event if the text has changed |
457 | // since we got focus | 463 | // since we got focus |
458 | if ((e->type() == QEvent::FocusOut) && mTextChanged) | 464 | if ((e->type() == QEvent::FocusOut) && mTextChanged) |
459 | { | 465 | { |
460 | lineEnterPressed(); | 466 | lineEnterPressed(); |
461 | mTextChanged = false; | 467 | mTextChanged = false; |
462 | } | 468 | } |
463 | // switch dateFormShort by double klick with mouse | 469 | // switch dateFormShort by double klick with mouse |
464 | else if (e->type() == QEvent::MouseButtonDblClick) | 470 | else if (e->type() == QEvent::MouseButtonDblClick) |
465 | { | 471 | { |
466 | dateFormShort = dateFormShort?false:true; | 472 | toggleDateFormat(); |
467 | mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort)); | ||
468 | } | 473 | } |
469 | else if (e->type() == QEvent::FocusIn) | 474 | else if (e->type() == QEvent::FocusIn) |
470 | { | 475 | { |
471 | maxDay = readDate().day(); | 476 | maxDay = readDate().day(); |
472 | } | 477 | } |
473 | 478 | ||
474 | return false; | 479 | return false; |
475 | } | 480 | } |
481 | void KDateEdit::toggleDateFormat() | ||
482 | { | ||
483 | dateFormShort = ! dateFormShort; | ||
484 | mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort)); | ||
485 | |||
486 | } | ||
476 | 487 | ||
477 | void KDateEdit::textChanged(const QString &) | 488 | void KDateEdit::textChanged(const QString &) |
478 | { | 489 | { |
479 | if(mHandleInvalid && mDateEdit->text().stripWhiteSpace().isEmpty()) { | 490 | if(mHandleInvalid && mDateEdit->text().stripWhiteSpace().isEmpty()) { |
480 | QDate date; //invalid date | 491 | QDate date; //invalid date |
481 | emit(dateChanged(date)); | 492 | emit(dateChanged(date)); |
482 | } else { | 493 | } else { |
483 | mTextChanged = true; | 494 | mTextChanged = true; |
484 | } | 495 | } |
485 | maxDay = readDate().day(); | 496 | maxDay = readDate().day(); |
486 | } | 497 | } |
diff --git a/libkdepim/kdateedit.h b/libkdepim/kdateedit.h index 742d843..cf3b90a 100644 --- a/libkdepim/kdateedit.h +++ b/libkdepim/kdateedit.h | |||
@@ -69,25 +69,26 @@ class KDateEdit : public QHBox | |||
69 | 69 | ||
70 | /** @param handleInvalid If true the date edit accepts invalid dates | 70 | /** @param handleInvalid If true the date edit accepts invalid dates |
71 | * and displays them as the empty ("") string. It also returns an invalid date. | 71 | * and displays them as the empty ("") string. It also returns an invalid date. |
72 | * If false (default) invalid dates are not accepted and instead the date | 72 | * If false (default) invalid dates are not accepted and instead the date |
73 | * of today will be returned. | 73 | * of today will be returned. |
74 | */ | 74 | */ |
75 | void setHandleInvalid(bool handleInvalid); | 75 | void setHandleInvalid(bool handleInvalid); |
76 | 76 | ||
77 | /** Checks for a focus out event. The display of the date is updated | 77 | /** Checks for a focus out event. The display of the date is updated |
78 | * to display the proper date when the focus leaves. | 78 | * to display the proper date when the focus leaves. |
79 | */ | 79 | */ |
80 | virtual bool eventFilter(QObject *o, QEvent *e); | 80 | virtual bool eventFilter(QObject *o, QEvent *e); |
81 | 81 | void toggleDateFormat(); | |
82 | void clear(); | ||
82 | signals: | 83 | signals: |
83 | /** This signal is emitted whenever the user modifies the date. This | 84 | /** This signal is emitted whenever the user modifies the date. This |
84 | * may not get emitted until the user presses enter in the line edit or | 85 | * may not get emitted until the user presses enter in the line edit or |
85 | * focus leaves the widget (ie: the user confirms their selection). | 86 | * focus leaves the widget (ie: the user confirms their selection). |
86 | */ | 87 | */ |
87 | void dateChanged(QDate); | 88 | void dateChanged(QDate); |
88 | void returnPressed(); | 89 | void returnPressed(); |
89 | public slots: | 90 | public slots: |
90 | /** Sets the date. | 91 | /** Sets the date. |
91 | * | 92 | * |
92 | * @param date The new date to display. This date must be valid or | 93 | * @param date The new date to display. This date must be valid or |
93 | * it will not be displayed. | 94 | * it will not be displayed. |
diff --git a/microkde/kdeui/kaction.cpp b/microkde/kdeui/kaction.cpp index 77d36a5..d38a6d5 100644 --- a/microkde/kdeui/kaction.cpp +++ b/microkde/kdeui/kaction.cpp | |||
@@ -203,25 +203,24 @@ KAction::KAction( const QString& text, const QString& pix, | |||
203 | } | 203 | } |
204 | 204 | ||
205 | KAction::KAction( QObject* parent, const char* name ) | 205 | KAction::KAction( QObject* parent, const char* name ) |
206 | : QObject( parent, name ) | 206 | : QObject( parent, name ) |
207 | { | 207 | { |
208 | 208 | ||
209 | initPrivate( QString::null, KShortcut(), 0, 0 ); | 209 | initPrivate( QString::null, KShortcut(), 0, 0 ); |
210 | } | 210 | } |
211 | // KDE 4: remove end | 211 | // KDE 4: remove end |
212 | 212 | ||
213 | KAction::~KAction() | 213 | KAction::~KAction() |
214 | { | 214 | { |
215 | kdDebug(129) << "KAction::~KAction( this = \"" << name() << "\" )" << endl; // -- ellis | ||
216 | #ifndef KDE_NO_COMPAT | 215 | #ifndef KDE_NO_COMPAT |
217 | if (d->m_kaccel) | 216 | if (d->m_kaccel) |
218 | unplugAccel(); | 217 | unplugAccel(); |
219 | #endif | 218 | #endif |
220 | 219 | ||
221 | // If actionCollection hasn't already been destructed, | 220 | // If actionCollection hasn't already been destructed, |
222 | if ( m_parentCollection ) { | 221 | if ( m_parentCollection ) { |
223 | m_parentCollection->take( this ); | 222 | m_parentCollection->take( this ); |
224 | for( uint i = 0; i < d->m_kaccelList.count(); i++ ) | 223 | for( uint i = 0; i < d->m_kaccelList.count(); i++ ) |
225 | //US d->m_kaccelList[i]->remove( name() ); | 224 | //US d->m_kaccelList[i]->remove( name() ); |
226 | qDebug("KAction::KAction~ ...1 has top be fixed"); | 225 | qDebug("KAction::KAction~ ...1 has top be fixed"); |
227 | } | 226 | } |
@@ -426,25 +425,26 @@ bool KAction::setShortcut( const KShortcut& cut ) | |||
426 | // KDE 4: remove end | 425 | // KDE 4: remove end |
427 | int len = containerCount(); | 426 | int len = containerCount(); |
428 | for( int i = 0; i < len; ++i ) | 427 | for( int i = 0; i < len; ++i ) |
429 | updateShortcut( i ); | 428 | updateShortcut( i ); |
430 | } | 429 | } |
431 | */ | 430 | */ |
432 | 431 | ||
433 | return true; | 432 | return true; |
434 | } | 433 | } |
435 | 434 | ||
436 | bool KAction::updateKAccelShortcut( KAccel* kaccel ) | 435 | bool KAction::updateKAccelShortcut( KAccel* kaccel ) |
437 | { | 436 | { |
438 | qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed"); | 437 | //qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed"); |
438 | |||
439 | // Check if action is permitted | 439 | // Check if action is permitted |
440 | /*US | 440 | /*US |
441 | if (kapp && !kapp->authorizeKAction(name())) | 441 | if (kapp && !kapp->authorizeKAction(name())) |
442 | return false; | 442 | return false; |
443 | 443 | ||
444 | bool b = true; | 444 | bool b = true; |
445 | 445 | ||
446 | if ( !kaccel->actions().actionPtr( name() ) ) { | 446 | if ( !kaccel->actions().actionPtr( name() ) ) { |
447 | if(!d->m_cut.isNull() ) { | 447 | if(!d->m_cut.isNull() ) { |
448 | kdDebug(129) << "Inserting " << name() << ", " << d->text() << ", " << d->plainText() << endl; | 448 | kdDebug(129) << "Inserting " << name() << ", " << d->text() << ", " << d->plainText() << endl; |
449 | b = kaccel->insert( name(), d->plainText(), QString::null, | 449 | b = kaccel->insert( name(), d->plainText(), QString::null, |
450 | d->m_cut, | 450 | d->m_cut, |
@@ -453,41 +453,43 @@ bool KAction::updateKAccelShortcut( KAccel* kaccel ) | |||
453 | } | 453 | } |
454 | } | 454 | } |
455 | else | 455 | else |
456 | b = kaccel->setShortcut( name(), d->m_cut ); | 456 | b = kaccel->setShortcut( name(), d->m_cut ); |
457 | 457 | ||
458 | return b; | 458 | return b; |
459 | */ | 459 | */ |
460 | return true; | 460 | return true; |
461 | } | 461 | } |
462 | 462 | ||
463 | void KAction::insertKAccel( KAccel* kaccel ) | 463 | void KAction::insertKAccel( KAccel* kaccel ) |
464 | { | 464 | { |
465 | qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed"); | 465 | //qDebug("KAction::updateKAccelShortcut~ ...1 has top be fixed"); |
466 | |||
466 | /*US | 467 | /*US |
467 | //kdDebug(129) << "KAction::insertKAccel( " << kaccel << " ): this = " << this << endl; | 468 | //kdDebug(129) << "KAction::insertKAccel( " << kaccel << " ): this = " << this << endl; |
468 | if ( !kaccel->actions().actionPtr( name() ) ) { | 469 | if ( !kaccel->actions().actionPtr( name() ) ) { |
469 | if( updateKAccelShortcut( kaccel ) ) { | 470 | if( updateKAccelShortcut( kaccel ) ) { |
470 | d->m_kaccelList.append( kaccel ); | 471 | d->m_kaccelList.append( kaccel ); |
471 | connect( kaccel, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) ); | 472 | connect( kaccel, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) ); |
472 | } | 473 | } |
473 | } | 474 | } |
474 | else | 475 | else |
475 | kdWarning(129) << "KAction::insertKAccel( kaccel = " << kaccel << " ): KAccel object already contains an action name \"" << name() << "\"" << endl; // -- ellis | 476 | kdWarning(129) << "KAction::insertKAccel( kaccel = " << kaccel << " ): KAccel object already contains an action name \"" << name() << "\"" << endl; // -- ellis |
476 | */ | 477 | */ |
477 | } | 478 | } |
478 | 479 | ||
479 | void KAction::removeKAccel( KAccel* kaccel ) | 480 | void KAction::removeKAccel( KAccel* kaccel ) |
480 | { | 481 | { |
481 | qDebug("KAction::removeKAccel~ ...1 has top be fixed"); | 482 | // qDebug("KAction::removeKAccel~ ...1 has top be fixed"); |
483 | |||
482 | /*US | 484 | /*US |
483 | //kdDebug(129) << "KAction::removeKAccel( " << i << " ): this = " << this << endl; | 485 | //kdDebug(129) << "KAction::removeKAccel( " << i << " ): this = " << this << endl; |
484 | for( uint i = 0; i < d->m_kaccelList.count(); i++ ) { | 486 | for( uint i = 0; i < d->m_kaccelList.count(); i++ ) { |
485 | if( d->m_kaccelList[i] == kaccel ) { | 487 | if( d->m_kaccelList[i] == kaccel ) { |
486 | kaccel->remove( name() ); | 488 | kaccel->remove( name() ); |
487 | d->m_kaccelList.remove( d->m_kaccelList.at( i ) ); | 489 | d->m_kaccelList.remove( d->m_kaccelList.at( i ) ); |
488 | disconnect( kaccel, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) ); | 490 | disconnect( kaccel, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) ); |
489 | break; | 491 | break; |
490 | } | 492 | } |
491 | } | 493 | } |
492 | */ | 494 | */ |
493 | } | 495 | } |
@@ -502,25 +504,26 @@ void KAction::setAccel( int keyQt ) | |||
502 | void KAction::updateShortcut( int i ) | 504 | void KAction::updateShortcut( int i ) |
503 | { | 505 | { |
504 | int id = itemId( i ); | 506 | int id = itemId( i ); |
505 | 507 | ||
506 | QWidget* w = container( i ); | 508 | QWidget* w = container( i ); |
507 | if ( w->inherits( "QPopupMenu" ) ) { | 509 | if ( w->inherits( "QPopupMenu" ) ) { |
508 | QPopupMenu* menu = static_cast<QPopupMenu*>(w); | 510 | QPopupMenu* menu = static_cast<QPopupMenu*>(w); |
509 | updateShortcut( menu, id ); | 511 | updateShortcut( menu, id ); |
510 | } | 512 | } |
511 | else if ( w->inherits( "QMenuBar" ) ) | 513 | else if ( w->inherits( "QMenuBar" ) ) |
512 | //US static_cast<QMenuBar*>(w)->setAccel( d->m_cut.keyCodeQt(), id ); | 514 | //US static_cast<QMenuBar*>(w)->setAccel( d->m_cut.keyCodeQt(), id ); |
513 | //US (QMenuBar*)(w)->setAccel( d->m_cut.keyCodeQt(), id ); | 515 | //US (QMenuBar*)(w)->setAccel( d->m_cut.keyCodeQt(), id ); |
514 | qDebug("KAction::updateShortcut( int i ) ...1 has top be fixed"); | 516 | |
517 | ; //qDebug("KAction::updateShortcut( int i ) ...1 has top be fixed"); | ||
515 | 518 | ||
516 | } | 519 | } |
517 | 520 | ||
518 | void KAction::updateShortcut( QPopupMenu* menu, int id ) | 521 | void KAction::updateShortcut( QPopupMenu* menu, int id ) |
519 | { | 522 | { |
520 | /*US | 523 | /*US |
521 | //kdDebug(129) << "KAction::updateShortcut(): this = " << this << " d->m_kaccelList.count() = " << d->m_kaccelList.count() << endl; | 524 | //kdDebug(129) << "KAction::updateShortcut(): this = " << this << " d->m_kaccelList.count() = " << d->m_kaccelList.count() << endl; |
522 | // If the action has a KAccel object, | 525 | // If the action has a KAccel object, |
523 | // show the string representation of its shortcut. | 526 | // show the string representation of its shortcut. |
524 | if ( d->m_kaccel || d->m_kaccelList.count() ) { | 527 | if ( d->m_kaccel || d->m_kaccelList.count() ) { |
525 | QString s = menu->text( id ); | 528 | QString s = menu->text( id ); |
526 | int i = s.find( '\t' ); | 529 | int i = s.find( '\t' ); |
@@ -530,25 +533,27 @@ void KAction::updateShortcut( QPopupMenu* menu, int id ) | |||
530 | s += "\t" + d->m_cut.seq(0).toString(); | 533 | s += "\t" + d->m_cut.seq(0).toString(); |
531 | 534 | ||
532 | menu->changeItem( id, s ); | 535 | menu->changeItem( id, s ); |
533 | } | 536 | } |
534 | // Otherwise insert the shortcut itself into the popup menu. | 537 | // Otherwise insert the shortcut itself into the popup menu. |
535 | else { | 538 | else { |
536 | // This is a fall-hack in case the KAction is missing a proper parent collection. | 539 | // This is a fall-hack in case the KAction is missing a proper parent collection. |
537 | // It should be removed eventually. --ellis | 540 | // It should be removed eventually. --ellis |
538 | menu->setAccel( d->m_cut.keyCodeQt(), id ); | 541 | menu->setAccel( d->m_cut.keyCodeQt(), id ); |
539 | kdWarning(129) << "KAction::updateShortcut(): name = \"" << name() << "\", cut = " << d->m_cut.toStringInternal() << "; No KAccel, probably missing a parent collection." << endl; | 542 | kdWarning(129) << "KAction::updateShortcut(): name = \"" << name() << "\", cut = " << d->m_cut.toStringInternal() << "; No KAccel, probably missing a parent collection." << endl; |
540 | } | 543 | } |
541 | */ | 544 | */ |
542 | qDebug("KAction::updateShortcut( QPopupMenu* menu, int id ) ...1 has top be fixed"); | 545 | |
546 | |||
547 | //qDebug("KAction::updateShortcut( QPopupMenu* menu, int id ) ...1 has top be fixed"); | ||
543 | 548 | ||
544 | } | 549 | } |
545 | 550 | ||
546 | const KShortcut& KAction::shortcut() const | 551 | const KShortcut& KAction::shortcut() const |
547 | { | 552 | { |
548 | return d->m_cut; | 553 | return d->m_cut; |
549 | } | 554 | } |
550 | 555 | ||
551 | const KShortcut& KAction::shortcutDefault() const | 556 | const KShortcut& KAction::shortcutDefault() const |
552 | { | 557 | { |
553 | return d->m_cutDefault; | 558 | return d->m_cutDefault; |
554 | } | 559 | } |
@@ -556,25 +561,25 @@ const KShortcut& KAction::shortcutDefault() const | |||
556 | QString KAction::shortcutText() const | 561 | QString KAction::shortcutText() const |
557 | { | 562 | { |
558 | return d->m_cut.toStringInternal(); | 563 | return d->m_cut.toStringInternal(); |
559 | } | 564 | } |
560 | 565 | ||
561 | void KAction::setShortcutText( const QString& s ) | 566 | void KAction::setShortcutText( const QString& s ) |
562 | { | 567 | { |
563 | setShortcut( KShortcut(s) ); | 568 | setShortcut( KShortcut(s) ); |
564 | } | 569 | } |
565 | 570 | ||
566 | int KAction::accel() const | 571 | int KAction::accel() const |
567 | { | 572 | { |
568 | qDebug("KAction::accel() ...1 has top be fixed"); | 573 | // qDebug("KAction::accel() ...1 has top be fixed"); |
569 | //US return d->m_cut.keyCodeQt(); | 574 | //US return d->m_cut.keyCodeQt(); |
570 | return 0; | 575 | return 0; |
571 | } | 576 | } |
572 | 577 | ||
573 | void KAction::setGroup( const QString& grp ) | 578 | void KAction::setGroup( const QString& grp ) |
574 | { | 579 | { |
575 | d->m_group = grp; | 580 | d->m_group = grp; |
576 | 581 | ||
577 | int len = containerCount(); | 582 | int len = containerCount(); |
578 | for( int i = 0; i < len; ++i ) | 583 | for( int i = 0; i < len; ++i ) |
579 | updateGroup( i ); | 584 | updateGroup( i ); |
580 | } | 585 | } |
@@ -592,64 +597,57 @@ QString KAction::group() const | |||
592 | bool KAction::isEnabled() const | 597 | bool KAction::isEnabled() const |
593 | { | 598 | { |
594 | return d->isEnabled(); | 599 | return d->isEnabled(); |
595 | } | 600 | } |
596 | 601 | ||
597 | bool KAction::isShortcutConfigurable() const | 602 | bool KAction::isShortcutConfigurable() const |
598 | { | 603 | { |
599 | return d->m_configurable; | 604 | return d->m_configurable; |
600 | } | 605 | } |
601 | 606 | ||
602 | void KAction::setToolTip( const QString& tt ) | 607 | void KAction::setToolTip( const QString& tt ) |
603 | { | 608 | { |
604 | qDebug("KAction::setToolTip ...1 has top be fixed"); | 609 | //qDebug("KAction::setToolTip ...1 has top be fixed"); |
605 | d->setToolTip( tt ); | 610 | d->setToolTip( tt ); |
606 | 611 | ||
607 | int len = containerCount(); | 612 | int len = containerCount(); |
608 | for( int i = 0; i < len; ++i ) | 613 | for( int i = 0; i < len; ++i ) |
609 | updateToolTip( i ); | 614 | updateToolTip( i ); |
610 | } | 615 | } |
611 | 616 | ||
612 | void KAction::updateToolTip( int i ) | 617 | void KAction::updateToolTip( int i ) |
613 | { | 618 | { |
614 | qDebug("KAction::updateToolTip ...1 has top be fixed"); | 619 | //qDebug("KAction::updateToolTip ...1 has top be fixed"); |
615 | QWidget *w = container( i ); | 620 | QWidget *w = container( i ); |
616 | 621 | ||
617 | if ( w->inherits( "KToolBar" ) ) | 622 | if ( w->inherits( "KToolBar" ) ) |
618 | QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); | 623 | QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); |
619 | else if ( w->inherits( "QToolBar" ) ) | 624 | else if ( w->inherits( "QToolBar" ) ) |
620 | QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); | 625 | QToolTip::add( static_cast<KToolBar*>(w)->getWidget( itemId( i ) ), d->toolTip() ); |
621 | } | 626 | } |
622 | 627 | ||
623 | QString KAction::toolTip() const | 628 | QString KAction::toolTip() const |
624 | { | 629 | { |
625 | return d->toolTip(); | 630 | return d->toolTip(); |
626 | } | 631 | } |
627 | 632 | ||
628 | int KAction::plug( QWidget *w, int index ) | 633 | int KAction::plug( QWidget *w, int index ) |
629 | { | 634 | { |
630 | //kdDebug(129) << "KAction::plug( " << w << ", " << index << " )" << endl; | 635 | //kdDebug(129) << "KAction::plug( " << w << ", " << index << " )" << endl; |
631 | if (w == 0) { | 636 | if (w == 0) { |
632 | kdWarning(129) << "KAction::plug called with 0 argument\n"; | 637 | kdWarning(129) << "KAction::plug called with 0 argument\n"; |
633 | return -1; | 638 | return -1; |
634 | } | 639 | } |
635 | 640 | ||
636 | #ifndef NDEBUG | 641 | |
637 | KAccel* kaccel = kaccelCurrent(); | ||
638 | // If there is a shortcut, but no KAccel available | ||
639 | if( !d->m_cut.isNull() && kaccel == 0 ) { | ||
640 | kdWarning(129) << "KAction::plug(): has no KAccel object; this = " << this << " name = " << name() << " parentCollection = " << m_parentCollection << endl; // ellis | ||
641 | //US kdDebug(129) << kdBacktrace() << endl; | ||
642 | } | ||
643 | #endif | ||
644 | 642 | ||
645 | // Check if action is permitted | 643 | // Check if action is permitted |
646 | //US if (kapp && !kapp->authorizeKAction(name())) | 644 | //US if (kapp && !kapp->authorizeKAction(name())) |
647 | //US return -1; | 645 | //US return -1; |
648 | 646 | ||
649 | plugShortcut(); | 647 | plugShortcut(); |
650 | 648 | ||
651 | if ( w->inherits("QPopupMenu") ) | 649 | if ( w->inherits("QPopupMenu") ) |
652 | { | 650 | { |
653 | QPopupMenu* menu = static_cast<QPopupMenu*>( w ); | 651 | QPopupMenu* menu = static_cast<QPopupMenu*>( w ); |
654 | int id; | 652 | int id; |
655 | // Don't insert shortcut into menu if it's already in a KAccel object. | 653 | // Don't insert shortcut into menu if it's already in a KAccel object. |
@@ -766,25 +764,26 @@ void KAction::unplug( QWidget *w ) | |||
766 | QMenuBar *bar = static_cast<QMenuBar *>( w ); | 764 | QMenuBar *bar = static_cast<QMenuBar *>( w ); |
767 | bar->removeItem( id ); | 765 | bar->removeItem( id ); |
768 | } | 766 | } |
769 | 767 | ||
770 | removeContainer( i ); | 768 | removeContainer( i ); |
771 | 769 | ||
772 | if ( m_parentCollection ) | 770 | if ( m_parentCollection ) |
773 | m_parentCollection->disconnectHighlight( w, this ); | 771 | m_parentCollection->disconnectHighlight( w, this ); |
774 | } | 772 | } |
775 | 773 | ||
776 | void KAction::plugAccel(KAccel *kacc, bool configurable) | 774 | void KAction::plugAccel(KAccel *kacc, bool configurable) |
777 | { | 775 | { |
778 | qDebug("KAction::plugAccel ...1 has top be fixed"); | 776 | // qDebug("KAction::plugAccel ...1 has top be fixed"); |
777 | |||
779 | /*US | 778 | /*US |
780 | kdWarning(129) << "KAction::plugAccel(): call to deprecated action." << endl; | 779 | kdWarning(129) << "KAction::plugAccel(): call to deprecated action." << endl; |
781 | kdDebug(129) << kdBacktrace() << endl; | 780 | kdDebug(129) << kdBacktrace() << endl; |
782 | //kdDebug(129) << "KAction::plugAccel( kacc = " << kacc << " ): name \"" << name() << "\"" << endl; | 781 | //kdDebug(129) << "KAction::plugAccel( kacc = " << kacc << " ): name \"" << name() << "\"" << endl; |
783 | if ( d->m_kaccel ) | 782 | if ( d->m_kaccel ) |
784 | unplugAccel(); | 783 | unplugAccel(); |
785 | 784 | ||
786 | // If the parent collection's accel ptr isn't set yet | 785 | // If the parent collection's accel ptr isn't set yet |
787 | //if ( m_parentCollection && !m_parentCollection->accel() ) | 786 | //if ( m_parentCollection && !m_parentCollection->accel() ) |
788 | // m_parentCollection->setAccel( kacc ); | 787 | // m_parentCollection->setAccel( kacc ); |
789 | 788 | ||
790 | // We can only plug this action into the given KAccel object | 789 | // We can only plug this action into the given KAccel object |
@@ -797,38 +796,39 @@ void KAction::plugAccel(KAccel *kacc, bool configurable) | |||
797 | this, SLOT(slotActivated()), | 796 | this, SLOT(slotActivated()), |
798 | configurable, isEnabled()); | 797 | configurable, isEnabled()); |
799 | connect(d->m_kaccel, SIGNAL(destroyed()), this, SLOT(slotDestroyed())); | 798 | connect(d->m_kaccel, SIGNAL(destroyed()), this, SLOT(slotDestroyed())); |
800 | //connect(d->m_kaccel, SIGNAL(keycodeChanged()), this, SLOT(slotKeycodeChanged())); | 799 | //connect(d->m_kaccel, SIGNAL(keycodeChanged()), this, SLOT(slotKeycodeChanged())); |
801 | } | 800 | } |
802 | else | 801 | else |
803 | kdWarning(129) << "KAction::plugAccel( kacc = " << kacc << " ): KAccel object already contains an action name \"" << name() << "\"" << endl; // -- ellis | 802 | kdWarning(129) << "KAction::plugAccel( kacc = " << kacc << " ): KAccel object already contains an action name \"" << name() << "\"" << endl; // -- ellis |
804 | */ | 803 | */ |
805 | } | 804 | } |
806 | 805 | ||
807 | void KAction::unplugAccel() | 806 | void KAction::unplugAccel() |
808 | { | 807 | { |
809 | qDebug("KAction::unplugAccel ...1 has top be fixed"); | 808 | // qDebug("KAction::unplugAccel ...1 has top be fixed"); |
810 | /*US | 809 | /*US |
811 | //kdDebug(129) << "KAction::unplugAccel() " << this << " " << name() << endl; | 810 | //kdDebug(129) << "KAction::unplugAccel() " << this << " " << name() << endl; |
812 | if ( d->m_kaccel ) | 811 | if ( d->m_kaccel ) |
813 | { | 812 | { |
814 | d->m_kaccel->remove(name()); | 813 | d->m_kaccel->remove(name()); |
815 | d->m_kaccel = 0; | 814 | d->m_kaccel = 0; |
816 | } | 815 | } |
817 | */ | 816 | */ |
818 | } | 817 | } |
819 | 818 | ||
820 | void KAction::plugMainWindowAccel( QWidget *w ) | 819 | void KAction::plugMainWindowAccel( QWidget *w ) |
821 | { | 820 | { |
822 | qDebug("KAction::plugMainWindowAccel ...1 has top be fixed"); | 821 | // qDebug("KAction::plugMainWindowAccel ...1 has top be fixed"); |
822 | |||
823 | /*US | 823 | /*US |
824 | // Note: topLevelWidget() stops too early, we can't use it. | 824 | // Note: topLevelWidget() stops too early, we can't use it. |
825 | QWidget * tl = w; | 825 | QWidget * tl = w; |
826 | QWidget * n; | 826 | QWidget * n; |
827 | while ( !tl->isDialog() && ( n = tl->parentWidget() ) ) // lookup parent and store | 827 | while ( !tl->isDialog() && ( n = tl->parentWidget() ) ) // lookup parent and store |
828 | tl = n; | 828 | tl = n; |
829 | 829 | ||
830 | KMainWindow * mw = dynamic_cast<KMainWindow *>(tl); // try to see if it's a kmainwindow | 830 | KMainWindow * mw = dynamic_cast<KMainWindow *>(tl); // try to see if it's a kmainwindow |
831 | if (mw) | 831 | if (mw) |
832 | plugAccel( mw->accel() ); | 832 | plugAccel( mw->accel() ); |
833 | else | 833 | else |
834 | kdDebug(129) << "KAction::plugMainWindowAccel: Toplevel widget isn't a KMainWindow, can't plug accel. " << tl << endl; | 834 | kdDebug(129) << "KAction::plugMainWindowAccel: Toplevel widget isn't a KMainWindow, can't plug accel. " << tl << endl; |
@@ -906,25 +906,25 @@ void KAction::updateText( int i ) | |||
906 | { | 906 | { |
907 | QWidget *w = container( i ); | 907 | QWidget *w = container( i ); |
908 | 908 | ||
909 | if ( w->inherits( "QPopupMenu" ) ) { | 909 | if ( w->inherits( "QPopupMenu" ) ) { |
910 | int id = itemId( i ); | 910 | int id = itemId( i ); |
911 | static_cast<QPopupMenu*>(w)->changeItem( id, d->text() ); | 911 | static_cast<QPopupMenu*>(w)->changeItem( id, d->text() ); |
912 | updateShortcut( static_cast<QPopupMenu*>(w), id ); | 912 | updateShortcut( static_cast<QPopupMenu*>(w), id ); |
913 | } | 913 | } |
914 | else if ( w->inherits( "QMenuBar" ) ) | 914 | else if ( w->inherits( "QMenuBar" ) ) |
915 | static_cast<QMenuBar*>(w)->changeItem( itemId( i ), d->text() ); | 915 | static_cast<QMenuBar*>(w)->changeItem( itemId( i ), d->text() ); |
916 | else if ( w->inherits( "KToolBar" ) ) | 916 | else if ( w->inherits( "KToolBar" ) ) |
917 | { | 917 | { |
918 | qDebug("KAction::updateText ...3 has top be fixed"); | 918 | //qDebug("KAction::updateText ...3 has top be fixed"); |
919 | QWidget *button = static_cast<KToolBar *>(w)->getWidget( itemId( i ) ); | 919 | QWidget *button = static_cast<KToolBar *>(w)->getWidget( itemId( i ) ); |
920 | if ( button->inherits( "KToolBarButton" ) ) | 920 | if ( button->inherits( "KToolBarButton" ) ) |
921 | static_cast<KToolBarButton *>(button)->setText( d->plainText() ); | 921 | static_cast<KToolBarButton *>(button)->setText( d->plainText() ); |
922 | 922 | ||
923 | } | 923 | } |
924 | } | 924 | } |
925 | 925 | ||
926 | QString KAction::text() const | 926 | QString KAction::text() const |
927 | { | 927 | { |
928 | return d->text(); | 928 | return d->text(); |
929 | } | 929 | } |
930 | 930 | ||
@@ -1109,25 +1109,25 @@ void KAction::addContainer( QWidget* c, QWidget* w ) | |||
1109 | void KAction::activate() | 1109 | void KAction::activate() |
1110 | { | 1110 | { |
1111 | slotActivated(); | 1111 | slotActivated(); |
1112 | } | 1112 | } |
1113 | 1113 | ||
1114 | void KAction::slotActivated() | 1114 | void KAction::slotActivated() |
1115 | { | 1115 | { |
1116 | emit activated(); | 1116 | emit activated(); |
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | void KAction::slotDestroyed() | 1119 | void KAction::slotDestroyed() |
1120 | { | 1120 | { |
1121 | kdDebug(129) << "KAction::slotDestroyed(): this = " << this << ", name = \"" << name() << "\", sender = " << sender() << endl; | 1121 | |
1122 | const QObject* o = sender(); | 1122 | const QObject* o = sender(); |
1123 | 1123 | ||
1124 | /* | 1124 | /* |
1125 | 1125 | ||
1126 | 1126 | ||
1127 | // KDE 4: remove | 1127 | // KDE 4: remove |
1128 | if ( o == d->m_kaccel ) | 1128 | if ( o == d->m_kaccel ) |
1129 | { | 1129 | { |
1130 | d->m_kaccel = 0; | 1130 | d->m_kaccel = 0; |
1131 | return; | 1131 | return; |
1132 | } | 1132 | } |
1133 | // KDE 4: remove end | 1133 | // KDE 4: remove end |