summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/categoryeditdialog.cpp2
-rw-r--r--libkdepim/categoryeditdialog_base.cpp2
-rw-r--r--libkdepim/categoryselectdialog.cpp2
-rw-r--r--libkdepim/categoryselectdialog_base.cpp2
-rw-r--r--libkdepim/kdateedit.cpp2
-rw-r--r--libkdepim/kdatepicker.cpp2
-rw-r--r--libkdepim/kprefsdialog.cpp2
-rw-r--r--libkdepim/libkdepimE.pro3
8 files changed, 9 insertions, 8 deletions
diff --git a/libkdepim/categoryeditdialog.cpp b/libkdepim/categoryeditdialog.cpp
index 87172c1..f719c31 100644
--- a/libkdepim/categoryeditdialog.cpp
+++ b/libkdepim/categoryeditdialog.cpp
@@ -39,97 +39,97 @@ CategoryEditDialog::CategoryEditDialog( KPimPrefs *prefs, QWidget* parent,
39 WFlags fl ) 39 WFlags fl )
40 : CategoryEditDialog_base( parent, name, modal, fl ), 40 : CategoryEditDialog_base( parent, name, modal, fl ),
41 mPrefs( prefs ) 41 mPrefs( prefs )
42{ 42{
43 mCategories->header()->hide(); 43 mCategories->header()->hide();
44 44
45 QStringList::Iterator it; 45 QStringList::Iterator it;
46 bool categoriesExist=false; 46 bool categoriesExist=false;
47 for (it = mPrefs->mCustomCategories.begin(); 47 for (it = mPrefs->mCustomCategories.begin();
48 it != mPrefs->mCustomCategories.end(); ++it ) { 48 it != mPrefs->mCustomCategories.end(); ++it ) {
49 new QListViewItem(mCategories,*it); 49 new QListViewItem(mCategories,*it);
50 categoriesExist=true; 50 categoriesExist=true;
51 } 51 }
52 52
53 connect(mCategories,SIGNAL(selectionChanged(QListViewItem *)), 53 connect(mCategories,SIGNAL(selectionChanged(QListViewItem *)),
54 SLOT(editItem(QListViewItem *))); 54 SLOT(editItem(QListViewItem *)));
55 connect(mEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(slotTextChanged(const QString &))); 55 connect(mEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(slotTextChanged(const QString &)));
56 mButtonRemove->setEnabled(categoriesExist); 56 mButtonRemove->setEnabled(categoriesExist);
57 mButtonModify->setEnabled(categoriesExist); 57 mButtonModify->setEnabled(categoriesExist);
58 mButtonAdd->setEnabled(!mEdit->text().isEmpty()); 58 mButtonAdd->setEnabled(!mEdit->text().isEmpty());
59 if ( QApplication::desktop()->width() > 460 ) 59 if ( QApplication::desktop()->width() > 460 )
60 resize( 300, 360 ); 60 resize( 300, 360 );
61} 61}
62 62
63/* 63/*
64 * Destroys the object and frees any allocated resources 64 * Destroys the object and frees any allocated resources
65 */ 65 */
66CategoryEditDialog::~CategoryEditDialog() 66CategoryEditDialog::~CategoryEditDialog()
67{ 67{
68 // no need to delete child widgets, Qt does it all for us 68 // no need to delete child widgets, Qt does it all for us
69} 69}
70 70
71void CategoryEditDialog::slotTextChanged(const QString &text) 71void CategoryEditDialog::slotTextChanged(const QString &text)
72{ 72{
73 mButtonAdd->setEnabled(!text.isEmpty()); 73 mButtonAdd->setEnabled(!text.isEmpty());
74} 74}
75 75
76void CategoryEditDialog::add() 76void CategoryEditDialog::add()
77{ 77{
78 if (!mEdit->text().isEmpty()) { 78 if (!mEdit->text().isEmpty()) {
79 new QListViewItem(mCategories,mEdit->text()); 79 new QListViewItem(mCategories,mEdit->text());
80 mEdit->setText(""); 80 mEdit->setText("");
81 mButtonRemove->setEnabled(mCategories->childCount()>0); 81 mButtonRemove->setEnabled(mCategories->childCount()>0);
82 mButtonModify->setEnabled(mCategories->childCount()>0); 82 mButtonModify->setEnabled(mCategories->childCount()>0);
83 } 83 }
84} 84}
85 85
86void CategoryEditDialog::remove() 86void CategoryEditDialog::remove()
87{ 87{
88 if (mCategories->currentItem()) { 88 if (mCategories->currentItem()) {
89 delete mCategories->currentItem(); 89 delete mCategories->currentItem();
90 mButtonRemove->setEnabled(mCategories->childCount()>0); 90 mButtonRemove->setEnabled(mCategories->childCount()>0);
91 mButtonModify->setEnabled(mCategories->childCount()>0); 91 mButtonModify->setEnabled(mCategories->childCount()>0);
92 } 92 }
93} 93}
94 94
95void CategoryEditDialog::modify() 95void CategoryEditDialog::modify()
96{ 96{
97 if (!mEdit->text().isEmpty()) { 97 if (!mEdit->text().isEmpty()) {
98 if (mCategories->currentItem()) { 98 if (mCategories->currentItem()) {
99 mCategories->currentItem()->setText(0,mEdit->text()); 99 mCategories->currentItem()->setText(0,mEdit->text());
100 } 100 }
101 } 101 }
102} 102}
103void CategoryEditDialog::accept() 103void CategoryEditDialog::accept()
104{ 104{
105 slotOk(); 105 slotOk();
106} 106}
107 107
108void CategoryEditDialog::slotOk() 108void CategoryEditDialog::slotOk()
109{ 109{
110 slotApply(); 110 slotApply();
111 QDialog::accept(); 111 QDialog::accept();
112} 112}
113 113
114void CategoryEditDialog::slotApply() 114void CategoryEditDialog::slotApply()
115{ 115{
116 mPrefs->mCustomCategories.clear(); 116 mPrefs->mCustomCategories.clear();
117 117
118 QListViewItem *item = mCategories->firstChild(); 118 QListViewItem *item = mCategories->firstChild();
119 while(item) { 119 while(item) {
120 mPrefs->mCustomCategories.append(item->text(0)); 120 mPrefs->mCustomCategories.append(item->text(0));
121 item = item->nextSibling(); 121 item = item->nextSibling();
122 } 122 }
123 mPrefs->writeConfig(); 123 mPrefs->writeConfig();
124 124
125 emit categoryConfigChanged(); 125 emit categoryConfigChanged();
126} 126}
127 127
128void CategoryEditDialog::editItem(QListViewItem *item) 128void CategoryEditDialog::editItem(QListViewItem *item)
129{ 129{
130 mEdit->setText(item->text(0)); 130 mEdit->setText(item->text(0));
131 mButtonRemove->setEnabled(true); 131 mButtonRemove->setEnabled(true);
132 mButtonModify->setEnabled(true); 132 mButtonModify->setEnabled(true);
133} 133}
134 134
135#include "categoryeditdialog.moc" 135//US #include "categoryeditdialog.moc"
diff --git a/libkdepim/categoryeditdialog_base.cpp b/libkdepim/categoryeditdialog_base.cpp
index ac99190..2390bbd 100644
--- a/libkdepim/categoryeditdialog_base.cpp
+++ b/libkdepim/categoryeditdialog_base.cpp
@@ -58,97 +58,97 @@ CategoryEditDialog_base::CategoryEditDialog_base( QWidget* parent, const char* n
58 mButtonCancel->setAutoDefault( TRUE ); 58 mButtonCancel->setAutoDefault( TRUE );
59 Layout13->addWidget( mButtonCancel ); 59 Layout13->addWidget( mButtonCancel );
60 60
61 CategoryEditDialog_baseLayout->addMultiCellLayout( Layout13, 2, 2, 0, 1 ); 61 CategoryEditDialog_baseLayout->addMultiCellLayout( Layout13, 2, 2, 0, 1 );
62 62
63 mCategories = new QListView( this, "mCategories" ); 63 mCategories = new QListView( this, "mCategories" );
64 mCategories->addColumn( tr2i18n( "Category" ) ); 64 mCategories->addColumn( tr2i18n( "Category" ) );
65 65
66 CategoryEditDialog_baseLayout->addWidget( mCategories, 0, 0 ); 66 CategoryEditDialog_baseLayout->addWidget( mCategories, 0, 0 );
67 67
68 layout103 = new QVBoxLayout( 0, 0, 6, "layout103"); 68 layout103 = new QVBoxLayout( 0, 0, 6, "layout103");
69 69
70 mButtonAdd = new QPushButton( this, "mButtonAdd" ); 70 mButtonAdd = new QPushButton( this, "mButtonAdd" );
71 layout103->addWidget( mButtonAdd ); 71 layout103->addWidget( mButtonAdd );
72 72
73 mButtonModify = new QPushButton( this, "mButtonModify" ); 73 mButtonModify = new QPushButton( this, "mButtonModify" );
74 layout103->addWidget( mButtonModify ); 74 layout103->addWidget( mButtonModify );
75 75
76 mButtonRemove = new QPushButton( this, "mButtonRemove" ); 76 mButtonRemove = new QPushButton( this, "mButtonRemove" );
77 layout103->addWidget( mButtonRemove ); 77 layout103->addWidget( mButtonRemove );
78 QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); 78 QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
79 layout103->addItem( spacer_2 ); 79 layout103->addItem( spacer_2 );
80 80
81 CategoryEditDialog_baseLayout->addLayout( layout103, 0, 1 ); 81 CategoryEditDialog_baseLayout->addLayout( layout103, 0, 1 );
82 languageChange(); 82 languageChange();
83 resize( sizeHint() ); 83 resize( sizeHint() );
84 84
85 // signals and slots connections 85 // signals and slots connections
86 connect( mButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); 86 connect( mButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
87 connect( mButtonAdd, SIGNAL( clicked() ), this, SLOT( add() ) ); 87 connect( mButtonAdd, SIGNAL( clicked() ), this, SLOT( add() ) );
88 connect( mButtonModify, SIGNAL( clicked() ), this, SLOT( modify() ) ); 88 connect( mButtonModify, SIGNAL( clicked() ), this, SLOT( modify() ) );
89 connect( mButtonRemove, SIGNAL( clicked() ), this, SLOT( remove() ) ); 89 connect( mButtonRemove, SIGNAL( clicked() ), this, SLOT( remove() ) );
90 connect( mButtonOk, SIGNAL( clicked() ), this, SLOT( slotOk() ) ); 90 connect( mButtonOk, SIGNAL( clicked() ), this, SLOT( slotOk() ) );
91 //connect( mApply, SIGNAL( clicked() ), this, SLOT( slotApply() ) ); 91 //connect( mApply, SIGNAL( clicked() ), this, SLOT( slotApply() ) );
92 92
93 // tab order 93 // tab order
94 // setTabOrder( mCategories, mEdit ); 94 // setTabOrder( mCategories, mEdit );
95// setTabOrder( mEdit, mButtonAdd ); 95// setTabOrder( mEdit, mButtonAdd );
96// setTabOrder( mButtonAdd, mButtonModify ); 96// setTabOrder( mButtonAdd, mButtonModify );
97// setTabOrder( mButtonModify, mButtonRemove ); 97// setTabOrder( mButtonModify, mButtonRemove );
98// setTabOrder( mButtonRemove, mButtonHelp ); 98// setTabOrder( mButtonRemove, mButtonHelp );
99// setTabOrder( mButtonHelp, mApply ); 99// setTabOrder( mButtonHelp, mApply );
100// setTabOrder( mApply, mButtonOk ); 100// setTabOrder( mApply, mButtonOk );
101// setTabOrder( mButtonOk, mButtonCancel ); 101// setTabOrder( mButtonOk, mButtonCancel );
102} 102}
103 103
104/* 104/*
105 * Destroys the object and frees any allocated resources 105 * Destroys the object and frees any allocated resources
106 */ 106 */
107CategoryEditDialog_base::~CategoryEditDialog_base() 107CategoryEditDialog_base::~CategoryEditDialog_base()
108{ 108{
109 // no need to delete child widgets, Qt does it all for us 109 // no need to delete child widgets, Qt does it all for us
110} 110}
111 111
112/* 112/*
113 * Sets the strings of the subwidgets using the current 113 * Sets the strings of the subwidgets using the current
114 * language. 114 * language.
115 */ 115 */
116void CategoryEditDialog_base::languageChange() 116void CategoryEditDialog_base::languageChange()
117{ 117{
118 setCaption( tr2i18n( "Edit Categories" ) ); 118 setCaption( tr2i18n( "Edit Categories" ) );
119 // mButtonHelp->setText( tr2i18n( "&Help" ) ); 119 // mButtonHelp->setText( tr2i18n( "&Help" ) );
120 // mApply->setText( tr2i18n( "&Apply" ) ); 120 // mApply->setText( tr2i18n( "&Apply" ) );
121 mButtonOk->setText( tr2i18n( "&OK" ) ); 121 mButtonOk->setText( tr2i18n( "&OK" ) );
122 mButtonCancel->setText( tr2i18n( "&Cancel" ) ); 122 mButtonCancel->setText( tr2i18n( "&Cancel" ) );
123 mCategories->header()->setLabel( 0, tr2i18n( "Category" ) ); 123 mCategories->header()->setLabel( 0, tr2i18n( "Category" ) );
124 mButtonAdd->setText( tr2i18n( "A&dd" ) ); 124 mButtonAdd->setText( tr2i18n( "A&dd" ) );
125 mButtonModify->setText( tr2i18n( "&Modify" ) ); 125 mButtonModify->setText( tr2i18n( "&Modify" ) );
126 mButtonRemove->setText( tr2i18n( "&Remove" ) ); 126 mButtonRemove->setText( tr2i18n( "&Remove" ) );
127} 127}
128 128
129void CategoryEditDialog_base::add() 129void CategoryEditDialog_base::add()
130{ 130{
131 qWarning( "CategoryEditDialog_base::add(): Not implemented yet" ); 131 qWarning( "CategoryEditDialog_base::add(): Not implemented yet" );
132} 132}
133 133
134void CategoryEditDialog_base::modify() 134void CategoryEditDialog_base::modify()
135{ 135{
136 qWarning( "CategoryEditDialog_base::modify(): Not implemented yet" ); 136 qWarning( "CategoryEditDialog_base::modify(): Not implemented yet" );
137} 137}
138 138
139void CategoryEditDialog_base::slotApply() 139void CategoryEditDialog_base::slotApply()
140{ 140{
141 qWarning( "CategoryEditDialog_base::slotApply(): Not implemented yet" ); 141 qWarning( "CategoryEditDialog_base::slotApply(): Not implemented yet" );
142} 142}
143 143
144void CategoryEditDialog_base::remove() 144void CategoryEditDialog_base::remove()
145{ 145{
146 qWarning( "CategoryEditDialog_base::remove(): Not implemented yet" ); 146 qWarning( "CategoryEditDialog_base::remove(): Not implemented yet" );
147} 147}
148 148
149void CategoryEditDialog_base::slotOk() 149void CategoryEditDialog_base::slotOk()
150{ 150{
151 qWarning( "CategoryEditDialog_base::slotOk(): Not implemented yet" ); 151 qWarning( "CategoryEditDialog_base::slotOk(): Not implemented yet" );
152} 152}
153 153
154#include "categoryeditdialog_base.moc" 154//US #include "categoryeditdialog_base.moc"
diff --git a/libkdepim/categoryselectdialog.cpp b/libkdepim/categoryselectdialog.cpp
index 7b0aced..943d35c 100644
--- a/libkdepim/categoryselectdialog.cpp
+++ b/libkdepim/categoryselectdialog.cpp
@@ -77,97 +77,97 @@ void CategorySelectDialog::setCategories()
77CategorySelectDialog::~CategorySelectDialog() 77CategorySelectDialog::~CategorySelectDialog()
78{ 78{
79} 79}
80 80
81void CategorySelectDialog::setSelected(const QStringList &selList) 81void CategorySelectDialog::setSelected(const QStringList &selList)
82{ 82{
83 clear(); 83 clear();
84 84
85 QStringList::ConstIterator it; 85 QStringList::ConstIterator it;
86 QStringList notFound; 86 QStringList notFound;
87 bool found = false; 87 bool found = false;
88 for (it=selList.begin();it!=selList.end();++it) { 88 for (it=selList.begin();it!=selList.end();++it) {
89 //qDebug(" CategorySelectDialog::setSelected("); 89 //qDebug(" CategorySelectDialog::setSelected(");
90 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 90 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild();
91 while (item) { 91 while (item) {
92 if (item->text() == *it) { 92 if (item->text() == *it) {
93 item->setOn(true); 93 item->setOn(true);
94 found = true; 94 found = true;
95 break; 95 break;
96 } 96 }
97 item = (QCheckListItem *)item->nextSibling(); 97 item = (QCheckListItem *)item->nextSibling();
98 } 98 }
99// if ( ! found ) { 99// if ( ! found ) {
100 100
101//emit updateCategoriesGlobal(); 101//emit updateCategoriesGlobal();
102// QMessageBox::information( this, "KO/E: Information!", 102// QMessageBox::information( this, "KO/E: Information!",
103// "Categories found, which were not\n" 103// "Categories found, which were not\n"
104// "in list of categories!\n" 104// "in list of categories!\n"
105// "message", 105// "message",
106// "OK", "", 0, 106// "OK", "", 0,
107// 0, 1 ); 107// 0, 1 );
108// setSelected(selList); 108// setSelected(selList);
109// return; 109// return;
110// } 110// }
111 } 111 }
112} 112}
113 113
114QStringList CategorySelectDialog::selectedCategories() const 114QStringList CategorySelectDialog::selectedCategories() const
115{ 115{
116 return mCategoryList; 116 return mCategoryList;
117} 117}
118 118
119void CategorySelectDialog::slotApply() 119void CategorySelectDialog::slotApply()
120{ 120{
121 QStringList categories; 121 QStringList categories;
122 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 122 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild();
123 while (item) { 123 while (item) {
124 if (item->isOn()) { 124 if (item->isOn()) {
125 categories.append(item->text()); 125 categories.append(item->text());
126 } 126 }
127 item = (QCheckListItem *)item->nextSibling(); 127 item = (QCheckListItem *)item->nextSibling();
128 } 128 }
129 129
130 QString categoriesStr = categories.join(","); 130 QString categoriesStr = categories.join(",");
131 131
132 mCategoryList = categories; 132 mCategoryList = categories;
133 133
134 emit categoriesSelected(categories); 134 emit categoriesSelected(categories);
135 emit categoriesSelected(categoriesStr); 135 emit categoriesSelected(categoriesStr);
136} 136}
137void CategorySelectDialog::accept() 137void CategorySelectDialog::accept()
138{ 138{
139 slotOk(); 139 slotOk();
140} 140}
141 141
142void CategorySelectDialog::slotOk() 142void CategorySelectDialog::slotOk()
143{ 143{
144 slotApply(); 144 slotApply();
145 QDialog::accept(); 145 QDialog::accept();
146} 146}
147 147
148void CategorySelectDialog::clear() 148void CategorySelectDialog::clear()
149{ 149{
150 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 150 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild();
151 while (item) { 151 while (item) {
152 item->setOn(false); 152 item->setOn(false);
153 item = (QCheckListItem *)item->nextSibling(); 153 item = (QCheckListItem *)item->nextSibling();
154 } 154 }
155} 155}
156 156
157void CategorySelectDialog::updateCategoryConfig() 157void CategorySelectDialog::updateCategoryConfig()
158{ 158{
159 QStringList selected; 159 QStringList selected;
160 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild(); 160 QCheckListItem *item = (QCheckListItem *)mCategories->firstChild();
161 while (item) { 161 while (item) {
162 if (item->isOn()) { 162 if (item->isOn()) {
163 selected.append(item->text()); 163 selected.append(item->text());
164 } 164 }
165 item = (QCheckListItem *)item->nextSibling(); 165 item = (QCheckListItem *)item->nextSibling();
166 } 166 }
167 167
168 setCategories(); 168 setCategories();
169 169
170 setSelected(selected); 170 setSelected(selected);
171} 171}
172 172
173#include "categoryselectdialog.moc" 173//#include "categoryselectdialog.moc"
diff --git a/libkdepim/categoryselectdialog_base.cpp b/libkdepim/categoryselectdialog_base.cpp
index 5e5fa72..3f050cf 100644
--- a/libkdepim/categoryselectdialog_base.cpp
+++ b/libkdepim/categoryselectdialog_base.cpp
@@ -32,97 +32,97 @@ CategorySelectDialog_base::CategorySelectDialog_base( QWidget* parent, const cha
32 if ( !name ) 32 if ( !name )
33 setName( "CategorySelectDialog_base" ); 33 setName( "CategorySelectDialog_base" );
34 CategorySelectDialog_baseLayout = new QVBoxLayout( this, 11, 6, "CategorySelectDialog_baseLayout"); 34 CategorySelectDialog_baseLayout = new QVBoxLayout( this, 11, 6, "CategorySelectDialog_baseLayout");
35 35
36 mCategories = new QListView( this, "mCategories" ); 36 mCategories = new QListView( this, "mCategories" );
37 mCategories->addColumn( i18n( "Category" ) ); 37 mCategories->addColumn( i18n( "Category" ) );
38 CategorySelectDialog_baseLayout->addWidget( mCategories ); 38 CategorySelectDialog_baseLayout->addWidget( mCategories );
39 39
40 Layout12 = new QHBoxLayout( 0, 0, 6, "Layout12"); 40 Layout12 = new QHBoxLayout( 0, 0, 6, "Layout12");
41 41
42 mClear = new QPushButton( this, "mClear" ); 42 mClear = new QPushButton( this, "mClear" );
43 Layout12->addWidget( mClear ); 43 Layout12->addWidget( mClear );
44 // QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); 44 // QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
45 //Layout12->addItem( spacer ); 45 //Layout12->addItem( spacer );
46 46
47 mButtonEdit = new QPushButton( this, "mButtonEdit" ); 47 mButtonEdit = new QPushButton( this, "mButtonEdit" );
48 Layout12->addWidget( mButtonEdit ); 48 Layout12->addWidget( mButtonEdit );
49 CategorySelectDialog_baseLayout->addLayout( Layout12 ); 49 CategorySelectDialog_baseLayout->addLayout( Layout12 );
50 50
51 Layout11 = new QHBoxLayout( 0, 0, 6, "Layout11"); 51 Layout11 = new QHBoxLayout( 0, 0, 6, "Layout11");
52 52
53 //mButtonHelp = new QPushButton( this, "mButtonHelp" ); 53 //mButtonHelp = new QPushButton( this, "mButtonHelp" );
54 //Layout11->addWidget( mButtonHelp ); 54 //Layout11->addWidget( mButtonHelp );
55 //QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); 55 //QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
56 // Layout11->addItem( spacer_2 ); 56 // Layout11->addItem( spacer_2 );
57 57
58 //mApply = new QPushButton( this, "mApply" ); 58 //mApply = new QPushButton( this, "mApply" );
59 // Layout11->addWidget( mApply ); 59 // Layout11->addWidget( mApply );
60 60
61 mButtonOk = new QPushButton( this, "mButtonOk" ); 61 mButtonOk = new QPushButton( this, "mButtonOk" );
62 mButtonOk->setOn( FALSE ); 62 mButtonOk->setOn( FALSE );
63 mButtonOk->setDefault( TRUE ); 63 mButtonOk->setDefault( TRUE );
64 Layout11->addWidget( mButtonOk ); 64 Layout11->addWidget( mButtonOk );
65 65
66 mButtonCancel = new QPushButton( this, "mButtonCancel" ); 66 mButtonCancel = new QPushButton( this, "mButtonCancel" );
67 Layout11->addWidget( mButtonCancel ); 67 Layout11->addWidget( mButtonCancel );
68 CategorySelectDialog_baseLayout->addLayout( Layout11 ); 68 CategorySelectDialog_baseLayout->addLayout( Layout11 );
69 languageChange(); 69 languageChange();
70 // resize( sizeHint() ); 70 // resize( sizeHint() );
71 71
72 // signals and slots connections 72 // signals and slots connections
73 connect( mButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); 73 connect( mButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
74 connect( mButtonOk, SIGNAL( clicked() ), this, SLOT( slotOk() ) ); 74 connect( mButtonOk, SIGNAL( clicked() ), this, SLOT( slotOk() ) );
75 connect( mClear, SIGNAL( clicked() ), this, SLOT( clear() ) ); 75 connect( mClear, SIGNAL( clicked() ), this, SLOT( clear() ) );
76 //connect( mApply, SIGNAL( clicked() ), this, SLOT( slotApply() ) ); 76 //connect( mApply, SIGNAL( clicked() ), this, SLOT( slotApply() ) );
77 77
78 // tab order 78 // tab order
79 setTabOrder( mCategories, mClear ); 79 setTabOrder( mCategories, mClear );
80 setTabOrder( mClear, mButtonEdit ); 80 setTabOrder( mClear, mButtonEdit );
81 setTabOrder( mButtonEdit, mButtonOk );//mButtonHelp ); 81 setTabOrder( mButtonEdit, mButtonOk );//mButtonHelp );
82 // setTabOrder( mButtonHelp, mApply ); 82 // setTabOrder( mButtonHelp, mApply );
83 // setTabOrder( mApply, mButtonOk ); 83 // setTabOrder( mApply, mButtonOk );
84 setTabOrder( mButtonOk, mButtonCancel ); 84 setTabOrder( mButtonOk, mButtonCancel );
85 // showMaximized(); 85 // showMaximized();
86 //raise(); 86 //raise();
87} 87}
88 88
89/* 89/*
90 * Destroys the object and frees any allocated resources 90 * Destroys the object and frees any allocated resources
91 */ 91 */
92CategorySelectDialog_base::~CategorySelectDialog_base() 92CategorySelectDialog_base::~CategorySelectDialog_base()
93{ 93{
94 // no need to delete child widgets, Qt does it all for us 94 // no need to delete child widgets, Qt does it all for us
95} 95}
96 96
97/* 97/*
98 * Sets the strings of the subwidgets using the current 98 * Sets the strings of the subwidgets using the current
99 * language. 99 * language.
100 */ 100 */
101void CategorySelectDialog_base::languageChange() 101void CategorySelectDialog_base::languageChange()
102{ 102{
103 setCaption( i18n( "Select Categories" ) ); 103 setCaption( i18n( "Select Categories" ) );
104 mCategories->header()->setLabel( 0, tr2i18n( "Category" ) ); 104 mCategories->header()->setLabel( 0, tr2i18n( "Category" ) );
105 mClear->setText( i18n( " &Deselect All " ) ); 105 mClear->setText( i18n( " &Deselect All " ) );
106 mButtonEdit->setText( i18n( " &Edit Categories " ) ); 106 mButtonEdit->setText( i18n( " &Edit Categories " ) );
107 // mButtonHelp->setText( tr2i18n( "&Help" ) ); 107 // mButtonHelp->setText( tr2i18n( "&Help" ) );
108 //mApply->setText( i18n( "&Apply" ) ); 108 //mApply->setText( i18n( "&Apply" ) );
109 mButtonOk->setText( i18n( "&OK" ) ); 109 mButtonOk->setText( i18n( "&OK" ) );
110 mButtonCancel->setText( i18n( "&Cancel" ) ); 110 mButtonCancel->setText( i18n( "&Cancel" ) );
111} 111}
112 112
113void CategorySelectDialog_base::clear() 113void CategorySelectDialog_base::clear()
114{ 114{
115 qWarning( "CategorySelectDialog_base::clear(): Not implemented yet" ); 115 qWarning( "CategorySelectDialog_base::clear(): Not implemented yet" );
116} 116}
117 117
118void CategorySelectDialog_base::slotApply() 118void CategorySelectDialog_base::slotApply()
119{ 119{
120 qWarning( "CategorySelectDialog_base::slotApply(): Not implemented yet" ); 120 qWarning( "CategorySelectDialog_base::slotApply(): Not implemented yet" );
121} 121}
122 122
123void CategorySelectDialog_base::slotOk() 123void CategorySelectDialog_base::slotOk()
124{ 124{
125 qWarning( "CategorySelectDialog_base::slotOk(): Not implemented yet" ); 125 qWarning( "CategorySelectDialog_base::slotOk(): Not implemented yet" );
126} 126}
127 127
128#include "categoryselectdialog_base.moc" 128//US#include "categoryselectdialog_base.moc"
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp
index 60bd2cf..5fb948a 100644
--- a/libkdepim/kdateedit.cpp
+++ b/libkdepim/kdateedit.cpp
@@ -1,137 +1,137 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 3
4 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24 24
25#include <qapplication.h> 25#include <qapplication.h>
26#include <qevent.h> 26#include <qevent.h>
27#include <qlineedit.h> 27#include <qlineedit.h>
28#include <qpixmap.h> 28#include <qpixmap.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30 30
31#include <kdatepicker.h> 31#include <kdatepicker.h>
32#include <kdebug.h> 32#include <kdebug.h>
33#include <kglobal.h> 33#include <kglobal.h>
34#include <kiconloader.h> 34#include <kiconloader.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kmessagebox.h> 36#include <kmessagebox.h>
37#include <knotifyclient.h> 37#include <knotifyclient.h>
38#include <qpalette.h> 38#include <qpalette.h>
39 39
40#include "kdateedit.h" 40#include "kdateedit.h"
41#include "kdateedit.moc" 41//#include "kdateedit.moc"
42 42
43KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) 43KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP )
44 : QHBox(parent, name) 44 : QHBox(parent, name)
45{ 45{
46 dateFormShort = true; 46 dateFormShort = true;
47 withoutDp = withoutDP; 47 withoutDp = withoutDP;
48 mDateEdit = new QLineEdit(this); 48 mDateEdit = new QLineEdit(this);
49 mDateEdit->setText(KGlobal::locale()->formatDate(QDate::currentDate(),dateFormShort)); 49 mDateEdit->setText(KGlobal::locale()->formatDate(QDate::currentDate(),dateFormShort));
50 setFocusProxy(mDateEdit); 50 setFocusProxy(mDateEdit);
51 mDateEdit->installEventFilter(this); 51 mDateEdit->installEventFilter(this);
52 52
53 // Highlight Background and Textcolor 53 // Highlight Background and Textcolor
54 QPalette palette = QWidget::palette(); 54 QPalette palette = QWidget::palette();
55 unsigned char red, green, blue; 55 unsigned char red, green, blue;
56 red = palette.color( QPalette::Normal , QColorGroup::Background ).red() - 10; 56 red = palette.color( QPalette::Normal , QColorGroup::Background ).red() - 10;
57 green = palette.color( QPalette::Normal , QColorGroup::Background ).green() - 10; 57 green = palette.color( QPalette::Normal , QColorGroup::Background ).green() - 10;
58 blue = palette.color( QPalette::Normal , QColorGroup::Background ).blue() - 10; 58 blue = palette.color( QPalette::Normal , QColorGroup::Background ).blue() - 10;
59 palette.setColor( QColorGroup::Highlight, QColor(red,green,blue) ); 59 palette.setColor( QColorGroup::Highlight, QColor(red,green,blue) );
60 palette.setColor( QColorGroup::HighlightedText, palette.color( QPalette::Normal , QColorGroup::Foreground ) ); 60 palette.setColor( QColorGroup::HighlightedText, palette.color( QPalette::Normal , QColorGroup::Foreground ) );
61 mDateEdit->setPalette( palette ); 61 mDateEdit->setPalette( palette );
62 62
63 if ( withoutDP ) { 63 if ( withoutDP ) {
64 mDateFrame = 0; 64 mDateFrame = 0;
65 mDateButton = 0; 65 mDateButton = 0;
66 mDatePicker = 0; 66 mDatePicker = 0;
67 } else { 67 } else {
68 QPixmap pixmap = SmallIcon("smallcal"); 68 QPixmap pixmap = SmallIcon("smallcal");
69 mDateButton = new QPushButton(this); 69 mDateButton = new QPushButton(this);
70 mDateButton->setPixmap(pixmap); 70 mDateButton->setPixmap(pixmap);
71 71
72 mDateFrame = new QVBox(0,0,WType_Popup); 72 mDateFrame = new QVBox(0,0,WType_Popup);
73 // mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 73 // mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
74 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 74 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
75 mDateFrame->setLineWidth(3); 75 mDateFrame->setLineWidth(3);
76 mDateFrame->hide(); 76 mDateFrame->hide();
77 77
78 mDatePicker = new KDatePicker(mDateFrame,QDate::currentDate()); 78 mDatePicker = new KDatePicker(mDateFrame,QDate::currentDate());
79 connect(mDatePicker,SIGNAL(dateEntered(QDate)),SLOT(setDate(QDate))); 79 connect(mDatePicker,SIGNAL(dateEntered(QDate)),SLOT(setDate(QDate)));
80 connect(mDatePicker,SIGNAL(dateEntered(QDate)),SIGNAL(dateChanged(QDate))); 80 connect(mDatePicker,SIGNAL(dateEntered(QDate)),SIGNAL(dateChanged(QDate)));
81 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(setDate(QDate))); 81 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(setDate(QDate)));
82 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SIGNAL(dateChanged(QDate))); 82 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SIGNAL(dateChanged(QDate)));
83 connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide())); 83 connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide()));
84 connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker())); 84 connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker()));
85 85
86 //mDateFrame->resize( 400, 300 ); 86 //mDateFrame->resize( 400, 300 );
87 87
88 } 88 }
89 connect(mDateEdit,SIGNAL(returnPressed()),SLOT(lineEnterPressed())); 89 connect(mDateEdit,SIGNAL(returnPressed()),SLOT(lineEnterPressed()));
90 connect(mDateEdit,SIGNAL(textChanged(const QString &)), 90 connect(mDateEdit,SIGNAL(textChanged(const QString &)),
91 SLOT(textChanged(const QString &))); 91 SLOT(textChanged(const QString &)));
92 92
93 // Create the keyword list. This will be used to match against when the user 93 // Create the keyword list. This will be used to match against when the user
94 // enters information. 94 // enters information.
95 mKeywordMap[i18n("tomorrow")] = 1; 95 mKeywordMap[i18n("tomorrow")] = 1;
96 mKeywordMap[i18n("today")] = 0; 96 mKeywordMap[i18n("today")] = 0;
97 mKeywordMap[i18n("yesterday")] = -1; 97 mKeywordMap[i18n("yesterday")] = -1;
98 98
99 /* 99 /*
100 * This loop uses some math tricks to figure out the offset in days 100 * This loop uses some math tricks to figure out the offset in days
101 * to the next date the given day of the week occurs. There 101 * to the next date the given day of the week occurs. There
102 * are two cases, that the new day is >= the current day, which means 102 * are two cases, that the new day is >= the current day, which means
103 * the new day has not occured yet or that the new day < the current day, 103 * the new day has not occured yet or that the new day < the current day,
104 * which means the new day is already passed (so we need to find the 104 * which means the new day is already passed (so we need to find the
105 * day in the next week). 105 * day in the next week).
106 */ 106 */
107 QString dayName; 107 QString dayName;
108 int currentDay = QDate::currentDate().dayOfWeek(); 108 int currentDay = QDate::currentDate().dayOfWeek();
109 for (int i = 1; i <= 7; ++i) 109 for (int i = 1; i <= 7; ++i)
110 { 110 {
111 dayName = KGlobal::locale()->weekDayName(i).lower(); 111 dayName = KGlobal::locale()->weekDayName(i).lower();
112 if (i >= currentDay) 112 if (i >= currentDay)
113 mKeywordMap[dayName] = i - currentDay; 113 mKeywordMap[dayName] = i - currentDay;
114 else 114 else
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
123KDateEdit::~KDateEdit() 123KDateEdit::~KDateEdit()
124{ 124{
125 delete mDateFrame; 125 delete mDateFrame;
126} 126}
127 127
128void KDateEdit::setDate(QDate newDate) 128void KDateEdit::setDate(QDate newDate)
129{ 129{
130 if (!newDate.isValid() && !mHandleInvalid) 130 if (!newDate.isValid() && !mHandleInvalid)
131 return; 131 return;
132 if ( readDate() == newDate ) 132 if ( readDate() == newDate )
133 return; 133 return;
134 QString dateString = ""; 134 QString dateString = "";
135 if(newDate.isValid()) 135 if(newDate.isValid())
136 dateString = KGlobal::locale()->formatDate( newDate, dateFormShort ); 136 dateString = KGlobal::locale()->formatDate( newDate, dateFormShort );
137 137
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp
index 6e5ec0f..3fe139c 100644
--- a/libkdepim/kdatepicker.cpp
+++ b/libkdepim/kdatepicker.cpp
@@ -1,134 +1,134 @@
1/* -*- C++ -*- 1/* -*- C++ -*-
2 This file is part of the KDE libraries 2 This file is part of the KDE libraries
3 Copyright (C) 1997 Tim D. Gilman (tdgilman@best.org) 3 Copyright (C) 1997 Tim D. Gilman (tdgilman@best.org)
4 (C) 1998-2001 Mirko Boehm (mirko@kde.org) 4 (C) 1998-2001 Mirko Boehm (mirko@kde.org)
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library 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 GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include "kdatepicker.h" 21#include "kdatepicker.h"
22#include <kglobal.h> 22#include <kglobal.h>
23#include <kapplication.h> 23#include <kapplication.h>
24#include <klocale.h> 24#include <klocale.h>
25#include <kiconloader.h> 25#include <kiconloader.h>
26#include <qframe.h> 26#include <qframe.h>
27#include <qpainter.h> 27#include <qpainter.h>
28#include <qdialog.h> 28#include <qdialog.h>
29#include <qtoolbutton.h> 29#include <qtoolbutton.h>
30#include <qfont.h> 30#include <qfont.h>
31#include <qapplication.h> 31#include <qapplication.h>
32#include <qlineedit.h> 32#include <qlineedit.h>
33#include <qvalidator.h> 33#include <qvalidator.h>
34#include <kdebug.h> 34#include <kdebug.h>
35#include <knotifyclient.h> 35#include <knotifyclient.h>
36#include "kdatetbl.h" 36#include "kdatetbl.h"
37#include "kdateedit.h" 37#include "kdateedit.h"
38#include "kdatepicker.moc" 38//#include "kdatepicker.moc"
39 39
40 40
41KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) 41KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name)
42 : QFrame(parent,name), 42 : QFrame(parent,name),
43 yearForward(new QToolButton(this)), 43 yearForward(new QToolButton(this)),
44 yearBackward(new QToolButton(this)), 44 yearBackward(new QToolButton(this)),
45 monthForward(new QToolButton(this)), 45 monthForward(new QToolButton(this)),
46 monthBackward(new QToolButton(this)), 46 monthBackward(new QToolButton(this)),
47 selectMonth(new QToolButton(this)), 47 selectMonth(new QToolButton(this)),
48 selectYear(new QToolButton(this)), 48 selectYear(new QToolButton(this)),
49 //line(new QLineEdit(this)), 49 //line(new QLineEdit(this)),
50 val(new KDateValidator(this)) 50 val(new KDateValidator(this))
51 //table(new KDateTable(this)), 51 //table(new KDateTable(this)),
52 //fontsize(1) 52 //fontsize(1)
53{ 53{
54 // ----- 54 // -----
55 int size = 12; 55 int size = 12;
56 if ( QApplication::desktop()->width() >= 480 ) 56 if ( QApplication::desktop()->width() >= 480 )
57 size = 18; 57 size = 18;
58 fontsize = size; 58 fontsize = size;
59 setFont ( QFont("helvetica",size) ); 59 setFont ( QFont("helvetica",size) );
60 table = new KDateTable(this); 60 table = new KDateTable(this);
61 setFontSize(size); 61 setFontSize(size);
62 //line->setValidator(val); 62 //line->setValidator(val);
63 lineDate = new KDateEdit( this, "dateediipicker", true ); 63 lineDate = new KDateEdit( this, "dateediipicker", true );
64 yearForward->setPixmap(SmallIcon("2rightarrowB")); 64 yearForward->setPixmap(SmallIcon("2rightarrowB"));
65 yearBackward->setPixmap(SmallIcon("2leftarrowB")); 65 yearBackward->setPixmap(SmallIcon("2leftarrowB"));
66 monthForward->setPixmap(SmallIcon("1rightarrowB")); 66 monthForward->setPixmap(SmallIcon("1rightarrowB"));
67 monthBackward->setPixmap(SmallIcon("1leftarrowB")); 67 monthBackward->setPixmap(SmallIcon("1leftarrowB"));
68 68
69 setDate(dt); // set button texts 69 setDate(dt); // set button texts
70 connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate))); 70 connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate)));
71 connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot())); 71 connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot()));
72 connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked())); 72 connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked()));
73 connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked())); 73 connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked()));
74 connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked())); 74 connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked()));
75 connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked())); 75 connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked()));
76 connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked())); 76 connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked()));
77 connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked())); 77 connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked()));
78 //connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); 78 //connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed()));
79 connect(lineDate, SIGNAL(dateChanged(QDate)), SLOT(slotSetDate(QDate))); 79 connect(lineDate, SIGNAL(dateChanged(QDate)), SLOT(slotSetDate(QDate)));
80 connect(lineDate, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); 80 connect(lineDate, SIGNAL(returnPressed()), SLOT(lineEnterPressed()));
81 table->setFocus(); 81 table->setFocus();
82 82
83} 83}
84 84
85KDatePicker::~KDatePicker() 85KDatePicker::~KDatePicker()
86{ 86{
87} 87}
88 88
89void 89void
90KDatePicker::resizeEvent(QResizeEvent*) 90KDatePicker::resizeEvent(QResizeEvent*)
91{ 91{
92 QWidget *buttons[] = { 92 QWidget *buttons[] = {
93 yearBackward, 93 yearBackward,
94 monthBackward, 94 monthBackward,
95 selectMonth, 95 selectMonth,
96 selectYear, 96 selectYear,
97 monthForward, 97 monthForward,
98 yearForward }; 98 yearForward };
99 const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); 99 const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]);
100 QSize sizes[NoOfButtons]; 100 QSize sizes[NoOfButtons];
101 int buttonHeight=0; 101 int buttonHeight=0;
102 int count; 102 int count;
103 int w; 103 int w;
104 int x=0; 104 int x=0;
105 // ----- calculate button row height: 105 // ----- calculate button row height:
106 for(count=0; count<NoOfButtons; ++count) { 106 for(count=0; count<NoOfButtons; ++count) {
107 int xS = buttons[count]->sizeHint().width(); 107 int xS = buttons[count]->sizeHint().width();
108 int yS = buttons[count]->sizeHint().height(); 108 int yS = buttons[count]->sizeHint().height();
109 sizes[count]=QSize ( xS+10, yS ); 109 sizes[count]=QSize ( xS+10, yS );
110 buttonHeight=QMAX(buttonHeight, sizes[count].height()); 110 buttonHeight=QMAX(buttonHeight, sizes[count].height());
111 } 111 }
112 buttonHeight += 10; 112 buttonHeight += 10;
113 // ----- calculate size of the month button: 113 // ----- calculate size of the month button:
114 w=0; 114 w=0;
115 for(count=0; count<NoOfButtons; ++count) { 115 for(count=0; count<NoOfButtons; ++count) {
116 if(buttons[count]!=selectMonth) 116 if(buttons[count]!=selectMonth)
117 { 117 {
118 w+=sizes[count].width(); 118 w+=sizes[count].width();
119 } else { 119 } else {
120 x=count; 120 x=count;
121 } 121 }
122 } 122 }
123 sizes[x].setWidth(width()-w); // stretch the month button 123 sizes[x].setWidth(width()-w); // stretch the month button
124 // ----- place the buttons: 124 // ----- place the buttons:
125 x=0; 125 x=0;
126 for(count=0; count<NoOfButtons; ++count) 126 for(count=0; count<NoOfButtons; ++count)
127 { 127 {
128 w=sizes[count].width(); 128 w=sizes[count].width();
129 buttons[count]->setGeometry(x, 0, w, buttonHeight); 129 buttons[count]->setGeometry(x, 0, w, buttonHeight);
130 x+=w; 130 x+=w;
131 } 131 }
132 // ----- place the line edit for direct input: 132 // ----- place the line edit for direct input:
133 sizes[0]=lineDate->sizeHint(); 133 sizes[0]=lineDate->sizeHint();
134 //line->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height()); 134 //line->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height());
diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp
index 3a39ea9..205c526 100644
--- a/libkdepim/kprefsdialog.cpp
+++ b/libkdepim/kprefsdialog.cpp
@@ -1,154 +1,154 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@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// $Id$ 24// $Id$
25 25
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qgroupbox.h> 28#include <qgroupbox.h>
29#include <qbuttongroup.h> 29#include <qbuttongroup.h>
30#include <qlineedit.h> 30#include <qlineedit.h>
31#include <qfont.h> 31#include <qfont.h>
32#include <qslider.h> 32#include <qslider.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qtextstream.h> 34#include <qtextstream.h>
35#include <qvbox.h> 35#include <qvbox.h>
36#include <qhbox.h> 36#include <qhbox.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qframe.h> 39#include <qframe.h>
40#include <qcombobox.h> 40#include <qcombobox.h>
41#include <qcheckbox.h> 41#include <qcheckbox.h>
42#include <qradiobutton.h> 42#include <qradiobutton.h>
43#include <qpushbutton.h> 43#include <qpushbutton.h>
44#include <qapplication.h> 44#include <qapplication.h>
45 45
46#include <kcolorbutton.h> 46#include <kcolorbutton.h>
47#include <kdebug.h> 47#include <kdebug.h>
48#include <klocale.h> 48#include <klocale.h>
49#include <kglobal.h> 49#include <kglobal.h>
50#include <kfontdialog.h> 50#include <kfontdialog.h>
51#include <kmessagebox.h> 51#include <kmessagebox.h>
52#include <kcolordialog.h> 52#include <kcolordialog.h>
53#include <kiconloader.h> 53#include <kiconloader.h>
54 54
55#include "kprefs.h" 55#include "kprefs.h"
56 56
57#include "kprefsdialog.h" 57#include "kprefsdialog.h"
58#include "kprefsdialog.moc" 58//#include "kprefsdialog.moc"
59 59
60KPrefsWidBool::KPrefsWidBool(const QString &text,bool *reference, 60KPrefsWidBool::KPrefsWidBool(const QString &text,bool *reference,
61 QWidget *parent) 61 QWidget *parent)
62{ 62{
63 mReference = reference; 63 mReference = reference;
64 64
65 mCheck = new QCheckBox(text,parent); 65 mCheck = new QCheckBox(text,parent);
66} 66}
67 67
68void KPrefsWidBool::readConfig() 68void KPrefsWidBool::readConfig()
69{ 69{
70 mCheck->setChecked(*mReference); 70 mCheck->setChecked(*mReference);
71} 71}
72 72
73void KPrefsWidBool::writeConfig() 73void KPrefsWidBool::writeConfig()
74{ 74{
75 *mReference = mCheck->isChecked(); 75 *mReference = mCheck->isChecked();
76} 76}
77 77
78QCheckBox *KPrefsWidBool::checkBox() 78QCheckBox *KPrefsWidBool::checkBox()
79{ 79{
80 return mCheck; 80 return mCheck;
81} 81}
82 82
83 83
84KPrefsWidColor::KPrefsWidColor(const QString &text,QColor *reference, 84KPrefsWidColor::KPrefsWidColor(const QString &text,QColor *reference,
85 QWidget *parent) 85 QWidget *parent)
86{ 86{
87 mReference = reference; 87 mReference = reference;
88 88
89 mButton = new KColorButton(parent); 89 mButton = new KColorButton(parent);
90 mLabel = new QLabel(mButton, text, parent); 90 mLabel = new QLabel(mButton, text, parent);
91 mButton->setColor( *mReference ); 91 mButton->setColor( *mReference );
92 mButton->setColor( Qt::red ); 92 mButton->setColor( Qt::red );
93 93
94} 94}
95 95
96KPrefsWidColor::~KPrefsWidColor() 96KPrefsWidColor::~KPrefsWidColor()
97{ 97{
98// kdDebug(5300) << "KPrefsWidColor::~KPrefsWidColor()" << endl; 98// kdDebug(5300) << "KPrefsWidColor::~KPrefsWidColor()" << endl;
99} 99}
100 100
101void KPrefsWidColor::readConfig() 101void KPrefsWidColor::readConfig()
102{ 102{
103 mButton->setColor(*mReference); 103 mButton->setColor(*mReference);
104} 104}
105 105
106void KPrefsWidColor::writeConfig() 106void KPrefsWidColor::writeConfig()
107{ 107{
108 *mReference = mButton->color(); 108 *mReference = mButton->color();
109} 109}
110 110
111QLabel *KPrefsWidColor::label() 111QLabel *KPrefsWidColor::label()
112{ 112{
113 return mLabel; 113 return mLabel;
114} 114}
115 115
116KColorButton *KPrefsWidColor::button() 116KColorButton *KPrefsWidColor::button()
117{ 117{
118 return mButton; 118 return mButton;
119} 119}
120 120
121KPrefsWidFont::KPrefsWidFont(const QString &sampleText,const QString &labelText, 121KPrefsWidFont::KPrefsWidFont(const QString &sampleText,const QString &labelText,
122 QFont *reference,QWidget *parent) 122 QFont *reference,QWidget *parent)
123{ 123{
124 mReference = reference; 124 mReference = reference;
125 125
126 mLabel = new QLabel(labelText, parent); 126 mLabel = new QLabel(labelText, parent);
127 127
128 mPreview = new QLabel(sampleText,parent); 128 mPreview = new QLabel(sampleText,parent);
129 mPreview->setFrameStyle(QFrame::Panel|QFrame::Sunken); 129 mPreview->setFrameStyle(QFrame::Panel|QFrame::Sunken);
130 130
131 mButton = new QPushButton(i18n("Choose..."), parent); 131 mButton = new QPushButton(i18n("Choose..."), parent);
132 connect(mButton,SIGNAL(clicked()),SLOT(selectFont())); 132 connect(mButton,SIGNAL(clicked()),SLOT(selectFont()));
133 mPreview->setMaximumHeight( QApplication::desktop()->height() / 12 ); 133 mPreview->setMaximumHeight( QApplication::desktop()->height() / 12 );
134 mPreview->setMaximumWidth( (QApplication::desktop()->width() / 2)-10 ); 134 mPreview->setMaximumWidth( (QApplication::desktop()->width() / 2)-10 );
135} 135}
136 136
137KPrefsWidFont::~KPrefsWidFont() 137KPrefsWidFont::~KPrefsWidFont()
138{ 138{
139} 139}
140 140
141void KPrefsWidFont::readConfig() 141void KPrefsWidFont::readConfig()
142{ 142{
143 mPreview->setFont(*mReference); 143 mPreview->setFont(*mReference);
144} 144}
145 145
146void KPrefsWidFont::writeConfig() 146void KPrefsWidFont::writeConfig()
147{ 147{
148 *mReference = mPreview->font(); 148 *mReference = mPreview->font();
149} 149}
150 150
151QLabel *KPrefsWidFont::label() 151QLabel *KPrefsWidFont::label()
152{ 152{
153 return mLabel; 153 return mLabel;
154} 154}
diff --git a/libkdepim/libkdepimE.pro b/libkdepim/libkdepimE.pro
index 05abaa5..414ac2b 100644
--- a/libkdepim/libkdepimE.pro
+++ b/libkdepim/libkdepimE.pro
@@ -1,43 +1,44 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3TARGET = microkdepim 3TARGET = microkdepim
4INCLUDEPATH += ../microkde ../qtcompat ../libkabcwrap ../microkde/kdecore 4INCLUDEPATH += ../microkde ../qtcompat ../libkabcwrap ../microkde/kdecore
5INCLUDEPATH += . .. 5INCLUDEPATH += . ..
6LIBS += -lmicrokde 6LIBS += -lmicrokde
7LIBS += -L$(QPEDIR)/lib
7OBJECTS_DIR = obj/$(PLATFORM) 8OBJECTS_DIR = obj/$(PLATFORM)
8MOC_DIR = moc/$(PLATFORM) 9MOC_DIR = moc/$(PLATFORM)
9DESTDIR=$(QPEDIR)/lib 10DESTDIR=$(QPEDIR)/lib
10 11
11 12
12INTERFACES = \ 13INTERFACES = \
13 14
14HEADERS = \ 15HEADERS = \
15 categoryeditdialog.h \ 16 categoryeditdialog.h \
16 categoryeditdialog_base.h \ 17 categoryeditdialog_base.h \
17 categoryselectdialog.h \ 18 categoryselectdialog.h \
18 categoryselectdialog_base.h \ 19 categoryselectdialog_base.h \
19 kdateedit.h \ 20 kdateedit.h \
20 kdatepicker.h \ 21 kdatepicker.h \
21 kinputdialog.h \ 22 kinputdialog.h \
22 kincidenceformatter.h \ 23 kincidenceformatter.h \
23 kpimprefs.h \ 24 kpimprefs.h \
24 kprefs.h \ 25 kprefs.h \
25 kprefsdialog.h \ 26 kprefsdialog.h \
26 addresseeview.h \ 27 addresseeview.h \
27 ksyncprofile.h 28 ksyncprofile.h
28 29
29 30
30SOURCES = \ 31SOURCES = \
31 categoryeditdialog.cpp \ 32 categoryeditdialog.cpp \
32 categoryeditdialog_base.cpp \ 33 categoryeditdialog_base.cpp \
33 categoryselectdialog.cpp \ 34 categoryselectdialog.cpp \
34 categoryselectdialog_base.cpp \ 35 categoryselectdialog_base.cpp \
35 kdateedit.cpp \ 36 kdateedit.cpp \
36 kinputdialog.cpp \ 37 kinputdialog.cpp \
37 kdatepicker.cpp \ 38 kdatepicker.cpp \
38 kincidenceformatter.cpp \ 39 kincidenceformatter.cpp \
39 kpimprefs.cpp \ 40 kpimprefs.cpp \
40 kprefs.cpp \ 41 kprefs.cpp \
41 kprefsdialog.cpp \ 42 kprefsdialog.cpp \
42 addresseeview.cpp \ 43 addresseeview.cpp \
43 ksyncprofile.cpp 44 ksyncprofile.cpp