summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt2
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt2
-rw-r--r--kaddressbook/filtereditdialog.cpp2
-rw-r--r--kaddressbook/kabcore.cpp3
-rw-r--r--korganizer/koagenda.cpp3
-rw-r--r--korganizer/koeditorgeneral.cpp15
-rw-r--r--korganizer/koeditorgeneral.h1
-rw-r--r--libkdepim/ksyncmanager.cpp15
-rw-r--r--microkde/kglobalsettings.cpp8
9 files changed, 37 insertions, 14 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 706fb7f..1c2bff8 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,54 +1,56 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.0.21 ************ 3********** VERSION 2.0.21 ************
4 4
5Fixed another SMTP problem in OM/Pi. 5Fixed another SMTP problem in OM/Pi.
6Some small changed in the new datenavigator in KO/Pi. 6Some small changed in the new datenavigator in KO/Pi.
7Changed default setting for new filter in KA/Pi to "exclude categories".
8Changed the default font size for 640x480 display
7 9
8********** VERSION 2.0.20 ************ 10********** VERSION 2.0.20 ************
9 11
10Two small fixes in OM/Pi. 12Two small fixes in OM/Pi.
11 13
12Better resizing of the new datenavigator in KO/Pi. 14Better resizing of the new datenavigator in KO/Pi.
13 15
14********** VERSION 2.0.19 ************ 16********** VERSION 2.0.19 ************
15KO/Pi: 17KO/Pi:
16Enhancements and bugfixes in the new datenavigator. 18Enhancements and bugfixes in the new datenavigator.
17Bugfix in this changelog: 19Bugfix in this changelog:
18The datenavigator was changed in version 2.0.18, not the datepicker. 20The datenavigator was changed in version 2.0.18, not the datepicker.
19 21
20********** VERSION 2.0.18 ************ 22********** VERSION 2.0.18 ************
21KO/Pi: 23KO/Pi:
22Fixed some minor problems. 24Fixed some minor problems.
23Cleaned up the KO/Pi config dialog. 25Cleaned up the KO/Pi config dialog.
24Fixed problem moving events in aganda view. 26Fixed problem moving events in aganda view.
25Made datepicker scaleable, i.e. if the datenavigator shows now a 27Made datepicker scaleable, i.e. if the datenavigator shows now a
26datenavigator matrix depending on its size. 28datenavigator matrix depending on its size.
27Birthdays are now displayed green in the datenavigator. 29Birthdays are now displayed green in the datenavigator.
28What'sThis Help in datenavigator shows all events of the day. 30What'sThis Help in datenavigator shows all events of the day.
29 31
30OM/Pi: 32OM/Pi:
31Updated the backend mail library to the latest version. 33Updated the backend mail library to the latest version.
32Please backup your mail before using this version. 34Please backup your mail before using this version.
33 35
34********** VERSION 2.0.17 ************ 36********** VERSION 2.0.17 ************
35 37
36KO/Pi: 38KO/Pi:
37Tooltips in month view were not sorted. Fixed. 39Tooltips in month view were not sorted. Fixed.
38Daylabel in agenda view ( for display of one day ) was too short. Fixed. 40Daylabel in agenda view ( for display of one day ) was too short. Fixed.
39Conflict display dialog for syncing was not on top of other windows. Fixed. 41Conflict display dialog for syncing was not on top of other windows. Fixed.
40Fixed some minor problems. 42Fixed some minor problems.
41 43
42Fixed an endless loop when importing vcs file with RESOURCES entry. 44Fixed an endless loop when importing vcs file with RESOURCES entry.
43 45
44********** VERSION 2.0.16 ************ 46********** VERSION 2.0.16 ************
45OM/Pi: 47OM/Pi:
46Fixed the SMTP account setting the option. 48Fixed the SMTP account setting the option.
47Fixed something in mail sending. 49Fixed something in mail sending.
48 50
49KO/Pi: 51KO/Pi:
50Added possibility to export selected events/todos as vcal file. 52Added possibility to export selected events/todos as vcal file.
51 53
52********** VERSION 2.0.15 ************ 54********** VERSION 2.0.15 ************
53 55
54PwM/Pi: 56PwM/Pi:
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index b976f1b..c6cd0ae 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1257,53 +1257,53 @@
1257{ "Received sync request","Sync Anfrage erhalten" }, 1257{ "Received sync request","Sync Anfrage erhalten" },
1258{ "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, 1258{ "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." },
1259{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, 1259{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." },
1260{ "Data saved to temp file!","Daten in temp Datei gespeichert!" }, 1260{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
1261{ "Sending file...","Sende Datei..." }, 1261{ "Sending file...","Sende Datei..." },
1262{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 1262{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
1263{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 1263{ "Receiving synced file...","Gesyncte Daten erhalten..." },
1264{ "Received %1 bytes","%1 Bytes erhalten" }, 1264{ "Received %1 bytes","%1 Bytes erhalten" },
1265{ "Writing file to disk...","Speichere Datei..." }, 1265{ "Writing file to disk...","Speichere Datei..." },
1266{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 1266{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
1267{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 1267{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
1268{ "Synchronize!","Synchronisiere!" }, 1268{ "Synchronize!","Synchronisiere!" },
1269{ "High clock skew!","Großer Uhrzeitunterschied!" }, 1269{ "High clock skew!","Großer Uhrzeitunterschied!" },
1270{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 1270{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
1271{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, 1271{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" },
1272{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, 1272{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
1273{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, 1273{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
1274{ "List week view","Listenwochenansicht" }, 1274{ "List week view","Listenwochenansicht" },
1275{ "List week","Listenwochenansicht" }, 1275{ "List week","Listenwochenansicht" },
1276{ "Next Week","Nächste Woche" }, 1276{ "Next Week","Nächste Woche" },
1277{ "Previous Week","Vorherige Woche" }, 1277{ "Previous Week","Vorherige Woche" },
1278{ "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, 1278{ "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." },
1279{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, 1279{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" },
1280{ "Details","Details" }, 1280{ "Details","Details" },
1281{ "Created time","Erstellt Zeit" }, 1281{ "Created time","Erstellt Zeit" },
1282{ "Last modified time","Geändert Zeit" }, 1282{ "Last modified time","Geändert Zeit" },
1283{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, 1283{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" },
1284{ "View Options","Anzeige Optionen" }, 1284{ "View Options","Anzeige Optionen" },
1285{ "<b>Created: ","<b>Erstellt am: " }, 1285{ "<b>Created: ","<b>Erstellt am: " },
1286{ "<b>Last modified: ","<b>Zuletzt geändert am: " }, 1286{ "<b>Last modified: ","<b>Zuletzt geändert am: " },
1287{ "Journal: ","Journal: " }, 1287{ "Journal: ","Journal: " },
1288{ "yearly","jährlich" }, 1288{ "yearly","jährlich" },
1289{ "(%1) ","%1-" }, 1289{ "(%1) ","%1-" },
1290{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, 1290{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" },
1291{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, 1291{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" },
1292{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, 1292{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" },
1293{ "Summary/Loc.","Titel/Ort" }, 1293{ "Summary/Loc.","Titel/Ort" },
1294{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, 1294{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." },
1295{ "Week Number","Wochennummer" }, 1295{ "Week Number","Wochennummer" },
1296{ "Import","Importiere" }, 1296{ "Import","Importiere" },
1297{ "Export","Exportiere" }, 1297{ "Export","Exportiere" },
1298{ "Beam","Beame" }, 1298{ "Beam","Beame" },
1299{ "Export selected","Exportiere Selektierte" }, 1299{ "Export selected","Exportiere Selektierte" },
1300{ "As iCal (ics) file...","Als iCal (ics) Datei..." }, 1300{ "As iCal (ics) file...","Als iCal (ics) Datei..." },
1301{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, 1301{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." },
1302{ "Journal/Details...","Journale/Details..." }, 1302{ "Journal/Details...","Journale/Details..." },
1303{ "Agenda View","Agenda Ansicht" }, 1303{ "Agenda View","Agenda Ansicht" },
1304{ "Show current time","Zeige aktuelle Zeit" }, 1304{ "Show current time","Zeige aktuelle Zeit" },
1305{ "","" }, 1305{ "Edit new item","Bearbeite neuen Eintrag" },
1306{ "","" }, 1306{ "","" },
1307{ "","" }, 1307{ "","" },
1308{ "","" }, 1308{ "","" },
1309{ "","" }, 1309{ "","" },
diff --git a/kaddressbook/filtereditdialog.cpp b/kaddressbook/filtereditdialog.cpp
index 1194406..ef9b979 100644
--- a/kaddressbook/filtereditdialog.cpp
+++ b/kaddressbook/filtereditdialog.cpp
@@ -113,99 +113,99 @@ Filter FilterEditDialog::filter()
113 113
114 item = item->nextSibling(); 114 item = item->nextSibling();
115 } 115 }
116 filter.setCategories( categories ); 116 filter.setCategories( categories );
117 117
118 if ( mMatchRuleGroup->find( 0 )->isOn() ) 118 if ( mMatchRuleGroup->find( 0 )->isOn() )
119 filter.setMatchRule( Filter::Matching ); 119 filter.setMatchRule( Filter::Matching );
120 else 120 else
121 filter.setMatchRule( Filter::NotMatching ); 121 filter.setMatchRule( Filter::NotMatching );
122 122
123 int c = 0; 123 int c = 0;
124 if (mPublic->isChecked()) c |= Filter::ShowPublic; 124 if (mPublic->isChecked()) c |= Filter::ShowPublic;
125 if (mPrivate->isChecked()) c |= Filter::ShowPrivate; 125 if (mPrivate->isChecked()) c |= Filter::ShowPrivate;
126 if (mConfidential->isChecked()) c |= Filter::ShowConfidential; 126 if (mConfidential->isChecked()) c |= Filter::ShowConfidential;
127 filter.setCriteria( c ) ; 127 filter.setCriteria( c ) ;
128 128
129 return filter; 129 return filter;
130} 130}
131 131
132void FilterEditDialog::initGUI() 132void FilterEditDialog::initGUI()
133{ 133{
134#ifndef KAB_EMBEDDED 134#ifndef KAB_EMBEDDED
135 resize( 490, 300 ); 135 resize( 490, 300 );
136#else //KAB_EMBEDDED 136#else //KAB_EMBEDDED
137 resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300)); 137 resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300));
138#endif //KAB_EMBEDDED 138#endif //KAB_EMBEDDED
139 139
140 140
141 QWidget *page = plainPage(); 141 QWidget *page = plainPage();
142 QLabel *label; 142 QLabel *label;
143 143
144 QGridLayout *topLayout = new QGridLayout( page, 3, 2, 0, spacingHint() ); 144 QGridLayout *topLayout = new QGridLayout( page, 3, 2, 0, spacingHint() );
145 145
146 label = new QLabel( i18n( "Name" ), page ); 146 label = new QLabel( i18n( "Name" ), page );
147 mNameEdit = new KLineEdit( page ); 147 mNameEdit = new KLineEdit( page );
148 mNameEdit->setFocus(); 148 mNameEdit->setFocus();
149 topLayout->addWidget( label, 0, 0 ); 149 topLayout->addWidget( label, 0, 0 );
150 topLayout->addWidget( mNameEdit, 0, 1 ); 150 topLayout->addWidget( mNameEdit, 0, 1 );
151 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), 151 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ),
152 SLOT( filterNameTextChanged( const QString&) ) ); 152 SLOT( filterNameTextChanged( const QString&) ) );
153 153
154 mCategoriesView = new KListView( page ); 154 mCategoriesView = new KListView( page );
155 mCategoriesView->addColumn( i18n( "Categories" ) ); 155 mCategoriesView->addColumn( i18n( "Categories" ) );
156 topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 ); 156 topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 );
157 157
158 mMatchRuleGroup = new QHButtonGroup( i18n( "Category rule" ), page ); 158 mMatchRuleGroup = new QHButtonGroup( i18n( "Category rule" ), page );
159 mMatchRuleGroup->setExclusive( true ); 159 mMatchRuleGroup->setExclusive( true );
160 QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup ); 160 QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup );
161 radio->setChecked( true );
162 //mMatchRuleGroup->insert( radio ); 161 //mMatchRuleGroup->insert( radio );
163 radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup ); 162 radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup );
163 radio->setChecked( true );
164 //mMatchRuleGroup->insert( radio ); 164 //mMatchRuleGroup->insert( radio );
165 topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 ); 165 topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 );
166 166
167 QHButtonGroup * mMatchPPCGroup = new QHButtonGroup(i18n( "Include contacts, that are:" ), page ); 167 QHButtonGroup * mMatchPPCGroup = new QHButtonGroup(i18n( "Include contacts, that are:" ), page );
168 mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup ); 168 mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup );
169 mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup ); 169 mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup );
170 mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup ); 170 mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup );
171 mPublic->setChecked( true ); 171 mPublic->setChecked( true );
172 mPrivate->setChecked( true ); 172 mPrivate->setChecked( true );
173 mConfidential->setChecked( true ); 173 mConfidential->setChecked( true );
174 topLayout->addMultiCellWidget( mMatchPPCGroup, 3, 3, 0, 1 ); 174 topLayout->addMultiCellWidget( mMatchPPCGroup, 3, 3, 0, 1 );
175 175
176} 176}
177 177
178void FilterEditDialog::filterNameTextChanged( const QString &text ) 178void FilterEditDialog::filterNameTextChanged( const QString &text )
179{ 179{
180 enableButtonOK( !text.isEmpty() ); 180 enableButtonOK( !text.isEmpty() );
181} 181}
182 182
183void FilterEditDialog::slotHelp() 183void FilterEditDialog::slotHelp()
184{ 184{
185#ifndef KAB_EMBEDDED 185#ifndef KAB_EMBEDDED
186 kapp->invokeHelp( "using-filters" ); 186 kapp->invokeHelp( "using-filters" );
187#endif //KAB_EMBEDDED 187#endif //KAB_EMBEDDED
188} 188}
189 189
190FilterDialog::FilterDialog( QWidget *parent, const char *name ) 190FilterDialog::FilterDialog( QWidget *parent, const char *name )
191 : KDialogBase( Plain, i18n( "Edit Address Book Filters" ), 191 : KDialogBase( Plain, i18n( "Edit Address Book Filters" ),
192 Ok | Cancel, Ok, parent, name, /*US false*/true, true ) 192 Ok | Cancel, Ok, parent, name, /*US false*/true, true )
193{ 193{
194 initGUI(); 194 initGUI();
195} 195}
196 196
197FilterDialog::~FilterDialog() 197FilterDialog::~FilterDialog()
198{ 198{
199} 199}
200 200
201void FilterDialog::setFilters( const Filter::List &list ) 201void FilterDialog::setFilters( const Filter::List &list )
202{ 202{
203 mFilterList.clear(); 203 mFilterList.clear();
204 mInternalFilterList.clear(); 204 mInternalFilterList.clear();
205 205
206 Filter::List::ConstIterator it; 206 Filter::List::ConstIterator it;
207 for ( it = list.begin(); it != list.end(); ++it ) { 207 for ( it = list.begin(); it != list.end(); ++it ) {
208 if ( (*it).isInternal() ) 208 if ( (*it).isInternal() )
209 mInternalFilterList.append( *it ); 209 mInternalFilterList.append( *it );
210 else 210 else
211 mFilterList.append( *it ); 211 mFilterList.append( *it );
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index e8f6132..59aa5a5 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -3141,194 +3141,197 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
3141 qDebug("KA: WB cancelled "); 3141 qDebug("KA: WB cancelled ");
3142 syncManager->mWriteBackFile = false; 3142 syncManager->mWriteBackFile = false;
3143 return syncOK; 3143 return syncOK;
3144 } 3144 }
3145 } 3145 }
3146 return syncOK; 3146 return syncOK;
3147} 3147}
3148 3148
3149 3149
3150//this is a overwritten callbackmethods from the syncinterface 3150//this is a overwritten callbackmethods from the syncinterface
3151bool KABCore::sync(KSyncManager* manager, QString filename, int mode) 3151bool KABCore::sync(KSyncManager* manager, QString filename, int mode)
3152{ 3152{
3153 3153
3154 //pending prepare addresseeview for output 3154 //pending prepare addresseeview for output
3155 //pending detect, if remote file has REV field. if not switch to external sync 3155 //pending detect, if remote file has REV field. if not switch to external sync
3156 mGlobalSyncMode = SYNC_MODE_NORMAL; 3156 mGlobalSyncMode = SYNC_MODE_NORMAL;
3157 if ( manager != syncManager ) 3157 if ( manager != syncManager )
3158 qDebug("KABCore::sync:: ERROR! :: manager != syncManager "); 3158 qDebug("KABCore::sync:: ERROR! :: manager != syncManager ");
3159 QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); 3159 QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
3160 3160
3161 AddressBook abLocal(filename,"syncContact"); 3161 AddressBook abLocal(filename,"syncContact");
3162 bool syncOK = false; 3162 bool syncOK = false;
3163 if ( abLocal.load() ) { 3163 if ( abLocal.load() ) {
3164 qDebug("KA: Sync::AB loaded %s,sync mode %d",filename.latin1(), mode ); 3164 qDebug("KA: Sync::AB loaded %s,sync mode %d",filename.latin1(), mode );
3165 bool external = false; 3165 bool external = false;
3166 bool isXML = false; 3166 bool isXML = false;
3167 if ( filename.right(4) == ".xml") { 3167 if ( filename.right(4) == ".xml") {
3168 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3168 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3169 isXML = true; 3169 isXML = true;
3170 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 3170 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
3171 } else { 3171 } else {
3172 external = !manager->mIsKapiFile; 3172 external = !manager->mIsKapiFile;
3173 if ( external ) { 3173 if ( external ) {
3174 qDebug("KA: Sync::Setting vcf mode to external "); 3174 qDebug("KA: Sync::Setting vcf mode to external ");
3175 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3175 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3176 AddressBook::Iterator it; 3176 AddressBook::Iterator it;
3177 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { 3177 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
3178 (*it).setID( mCurrentSyncDevice, (*it).uid() ); 3178 (*it).setID( mCurrentSyncDevice, (*it).uid() );
3179 (*it).computeCsum( mCurrentSyncDevice ); 3179 (*it).computeCsum( mCurrentSyncDevice );
3180 } 3180 }
3181 } 3181 }
3182 } 3182 }
3183 //AddressBook::Iterator it; 3183 //AddressBook::Iterator it;
3184 //QStringList vcards; 3184 //QStringList vcards;
3185 //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { 3185 //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
3186 // qDebug("Name %s ", (*it).familyName().latin1()); 3186 // qDebug("Name %s ", (*it).familyName().latin1());
3187 //} 3187 //}
3188 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); 3188 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode );
3189 syncManager->hideProgressBar();
3189 if ( syncOK ) { 3190 if ( syncOK ) {
3190 if ( syncManager->mWriteBackFile ) 3191 if ( syncManager->mWriteBackFile )
3191 { 3192 {
3192 if ( external ) 3193 if ( external )
3193 abLocal.removeSyncAddressees( !isXML); 3194 abLocal.removeSyncAddressees( !isXML);
3194 qDebug("KA: Sync::Saving remote AB "); 3195 qDebug("KA: Sync::Saving remote AB ");
3195 if ( ! abLocal.saveAB()) 3196 if ( ! abLocal.saveAB())
3196 qDebug("KA: sync::Error writing back AB to file "); 3197 qDebug("KA: sync::Error writing back AB to file ");
3197 if ( external ) { 3198 if ( external ) {
3198 // afterwrite processing 3199 // afterwrite processing
3199 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); 3200 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML);
3200 } 3201 }
3201 } 3202 }
3202 } 3203 }
3203 setModified(); 3204 setModified();
3204 3205
3205 } 3206 }
3206 abLocal.removeResources(); 3207 abLocal.removeResources();
3207 if ( syncOK ) 3208 if ( syncOK )
3208 mViewManager->refreshView(); 3209 mViewManager->refreshView();
3209 return syncOK; 3210 return syncOK;
3210 3211
3211} 3212}
3212void KABCore::removeSyncInfo( QString syncProfile) 3213void KABCore::removeSyncInfo( QString syncProfile)
3213{ 3214{
3214 qDebug("KA: AB:removeSyncInfo for profile %s ", syncProfile.latin1()); 3215 qDebug("KA: AB:removeSyncInfo for profile %s ", syncProfile.latin1());
3215 mAddressBook->removeSyncInfo( syncProfile ); 3216 mAddressBook->removeSyncInfo( syncProfile );
3216 setModified(); 3217 setModified();
3217} 3218}
3218 3219
3219 3220
3220//this is a overwritten callbackmethods from the syncinterface 3221//this is a overwritten callbackmethods from the syncinterface
3221bool KABCore::syncExternal(KSyncManager* manager, QString resource) 3222bool KABCore::syncExternal(KSyncManager* manager, QString resource)
3222{ 3223{
3223 if ( resource == "phone" ) 3224 if ( resource == "phone" )
3224 return syncPhone(); 3225 return syncPhone();
3225 disableBR( true ); 3226 disableBR( true );
3226 if ( manager != syncManager ) 3227 if ( manager != syncManager )
3227 qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager "); 3228 qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager ");
3228 QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); 3229 QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
3229 3230
3230 AddressBook abLocal( resource,"syncContact"); 3231 AddressBook abLocal( resource,"syncContact");
3231 bool syncOK = false; 3232 bool syncOK = false;
3232 message(i18n("Loading DTM address data..."), false); 3233 message(i18n("Loading DTM address data..."), false);
3233 if ( abLocal.load() ) { 3234 if ( abLocal.load() ) {
3234 qDebug("KA: AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); 3235 qDebug("KA: AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1());
3235 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3236 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3236 message(i18n("Sync preprocessing..."),false); 3237 message(i18n("Sync preprocessing..."),false);
3237 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); 3238 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false );
3238 message(i18n("Synchronizing..."),false); 3239 message(i18n("Synchronizing..."),false);
3239 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 3240 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
3241 syncManager->hideProgressBar();
3240 if ( syncOK ) { 3242 if ( syncOK ) {
3241 if ( syncManager->mWriteBackFile ) { 3243 if ( syncManager->mWriteBackFile ) {
3242 abLocal.removeSyncAddressees( false ); 3244 abLocal.removeSyncAddressees( false );
3243 message(i18n("Saving DTM address data..."),false); 3245 message(i18n("Saving DTM address data..."),false);
3244 abLocal.saveAB(); 3246 abLocal.saveAB();
3245 message(i18n("Sync postprocessing..."),false); 3247 message(i18n("Sync postprocessing..."),false);
3246 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3248 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3247 } 3249 }
3248 } else 3250 } else
3249 message( i18n("Sync cancelled or failed.") ); 3251 message( i18n("Sync cancelled or failed.") );
3250 setModified(); 3252 setModified();
3251 } 3253 }
3252 abLocal.removeResources(); 3254 abLocal.removeResources();
3253 if ( syncOK ) { 3255 if ( syncOK ) {
3254 mViewManager->refreshView(); 3256 mViewManager->refreshView();
3255 message(i18n("DTM syncing finished.")); 3257 message(i18n("DTM syncing finished."));
3256 } 3258 }
3257 disableBR( false ); 3259 disableBR( false );
3258 return syncOK; 3260 return syncOK;
3259 3261
3260} 3262}
3261void KABCore::message( QString m, bool startTimer) 3263void KABCore::message( QString m, bool startTimer)
3262{ 3264{
3263 topLevelWidget()->setCaption( m ); 3265 topLevelWidget()->setCaption( m );
3264 qApp->processEvents(); 3266 qApp->processEvents();
3265 if ( startTimer ) 3267 if ( startTimer )
3266 mMessageTimer->start( 15000, true ); 3268 mMessageTimer->start( 15000, true );
3267 else 3269 else
3268 mMessageTimer->stop(); 3270 mMessageTimer->stop();
3269} 3271}
3270bool KABCore::syncPhone() 3272bool KABCore::syncPhone()
3271{ 3273{
3272 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 3274 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
3273 QString fileName = getPhoneFile(); 3275 QString fileName = getPhoneFile();
3274 if ( !PhoneAccess::readFromPhone( fileName) ) { 3276 if ( !PhoneAccess::readFromPhone( fileName) ) {
3275 message(i18n("Phone access failed!")); 3277 message(i18n("Phone access failed!"));
3276 return false; 3278 return false;
3277 } 3279 }
3278 AddressBook abLocal( fileName,"syncContact"); 3280 AddressBook abLocal( fileName,"syncContact");
3279 bool syncOK = false; 3281 bool syncOK = false;
3280 { 3282 {
3281 abLocal.importFromFile( fileName ); 3283 abLocal.importFromFile( fileName );
3282 qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); 3284 qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1());
3283 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3285 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3284 abLocal.preparePhoneSync( mCurrentSyncDevice, true ); 3286 abLocal.preparePhoneSync( mCurrentSyncDevice, true );
3285 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 3287 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
3286 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 3288 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
3289 syncManager->hideProgressBar();
3287 if ( syncOK ) { 3290 if ( syncOK ) {
3288 if ( syncManager->mWriteBackFile ) { 3291 if ( syncManager->mWriteBackFile ) {
3289 abLocal.removeSyncAddressees( true ); 3292 abLocal.removeSyncAddressees( true );
3290 abLocal.saveABphone( fileName ); 3293 abLocal.saveABphone( fileName );
3291 abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); 3294 abLocal.findNewExtIds( fileName, mCurrentSyncDevice );
3292 //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); 3295 //abLocal.preparePhoneSync( mCurrentSyncDevice, false );
3293 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3296 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3294 } 3297 }
3295 } 3298 }
3296 setModified(); 3299 setModified();
3297 } 3300 }
3298 abLocal.removeResources(); 3301 abLocal.removeResources();
3299 if ( syncOK ) 3302 if ( syncOK )
3300 mViewManager->refreshView(); 3303 mViewManager->refreshView();
3301 return syncOK; 3304 return syncOK;
3302} 3305}
3303void KABCore::getFile( bool success ) 3306void KABCore::getFile( bool success )
3304{ 3307{
3305 if ( ! success ) { 3308 if ( ! success ) {
3306 message( i18n("Error receiving file. Nothing changed!") ); 3309 message( i18n("Error receiving file. Nothing changed!") );
3307 return; 3310 return;
3308 } 3311 }
3309 int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); 3312 int count = mAddressBook->importFromFile( sentSyncFile() , false, true );
3310 if ( count ) 3313 if ( count )
3311 setModified( true ); 3314 setModified( true );
3312 message( i18n("Pi-Sync successful!") ); 3315 message( i18n("Pi-Sync successful!") );
3313 mViewManager->refreshView(); 3316 mViewManager->refreshView();
3314} 3317}
3315void KABCore::syncFileRequest() 3318void KABCore::syncFileRequest()
3316{ 3319{
3317 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { 3320 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) {
3318 syncManager->slotSyncMenu( 999 ); 3321 syncManager->slotSyncMenu( 999 );
3319 } 3322 }
3320 mAddressBook->export2File( sentSyncFile() ); 3323 mAddressBook->export2File( sentSyncFile() );
3321} 3324}
3322QString KABCore::sentSyncFile() 3325QString KABCore::sentSyncFile()
3323{ 3326{
3324#ifdef DESKTOP_VERSION 3327#ifdef DESKTOP_VERSION
3325 return locateLocal( "tmp", "copysyncab.vcf" ); 3328 return locateLocal( "tmp", "copysyncab.vcf" );
3326#else 3329#else
3327 return QString( "/tmp/copysyncab.vcf" ); 3330 return QString( "/tmp/copysyncab.vcf" );
3328#endif 3331#endif
3329} 3332}
3330 3333
3331void KABCore::setCaptionBack() 3334void KABCore::setCaptionBack()
3332{ 3335{
3333 mMessageTimer->stop(); 3336 mMessageTimer->stop();
3334 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); 3337 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") );
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 5420822..2820ca2 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -503,96 +503,99 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
503 mStartCellY = gy; 503 mStartCellY = gy;
504 mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); 504 mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) );
505 } 505 }
506 } 506 }
507 else if (me->button() == LeftButton && leftMouseDown ) { //left click 507 else if (me->button() == LeftButton && leftMouseDown ) { //left click
508 endSelectAction( true ); // emit new event signal 508 endSelectAction( true ); // emit new event signal
509 } 509 }
510 } 510 }
511 if (me->button() == LeftButton) 511 if (me->button() == LeftButton)
512 leftMouseDown = false; 512 leftMouseDown = false;
513 else if (me->button() == RightButton) 513 else if (me->button() == RightButton)
514 rightMouseDown = false; 514 rightMouseDown = false;
515 break; 515 break;
516 516
517 case QEvent::MouseMove: 517 case QEvent::MouseMove:
518 if ( !rightMouseDown && !leftMouseDown ) 518 if ( !rightMouseDown && !leftMouseDown )
519 return true; 519 return true;
520 if ( blockMoving ) { 520 if ( blockMoving ) {
521 int dX, dY; 521 int dX, dY;
522 dX = startX - viewportPos.x(); 522 dX = startX - viewportPos.x();
523 if ( dX < 0 ) 523 if ( dX < 0 )
524 dX = -dX; 524 dX = -dX;
525 dY = viewportPos.y() - startY; 525 dY = viewportPos.y() - startY;
526 if ( dY < 0 ) 526 if ( dY < 0 )
527 dY = -dY; 527 dY = -dY;
528 //qDebug("%d %d %d ", dX, dY , blockmoveDist ); 528 //qDebug("%d %d %d ", dX, dY , blockmoveDist );
529 if ( dX > blockmoveDist || dY > blockmoveDist ) { 529 if ( dX > blockmoveDist || dY > blockmoveDist ) {
530 blockMoving = false; 530 blockMoving = false;
531 } 531 }
532 } 532 }
533 if (object != viewport()) { 533 if (object != viewport()) {
534 KOAgendaItem *moveItem = (KOAgendaItem *)object; 534 KOAgendaItem *moveItem = (KOAgendaItem *)object;
535 if (!moveItem->incidence()->isReadOnly() ) { 535 if (!moveItem->incidence()->isReadOnly() ) {
536 if (!mActionItem) 536 if (!mActionItem)
537 setNoActionCursor(moveItem,viewportPos); 537 setNoActionCursor(moveItem,viewportPos);
538 else { 538 else {
539 if ( !blockMoving ) 539 if ( !blockMoving )
540 performItemAction(viewportPos); 540 performItemAction(viewportPos);
541 } 541 }
542 } 542 }
543 } else { // ---------- viewport() 543 } else { // ---------- viewport()
544 if ( mActionType == SELECT ) { 544 if ( mActionType == SELECT ) {
545 performSelectAction( viewportPos ); 545 performSelectAction( viewportPos );
546 } 546 }
547 } 547 }
548 break; 548 break;
549 549
550 case QEvent::MouseButtonDblClick: 550 case QEvent::MouseButtonDblClick:
551 blockMoving = false;
552 leftMouseDown = false;
553 rightMouseDown = false;
551 if (object == viewport()) { 554 if (object == viewport()) {
552 selectItem(0); 555 selectItem(0);
553 int x,y; 556 int x,y;
554 viewportToContents(viewportPos.x(),viewportPos.y(),x,y); 557 viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
555 int gx,gy; 558 int gx,gy;
556 contentsToGrid(x,y,gx,gy); 559 contentsToGrid(x,y,gx,gy);
557 emit newEventSignal(gx,gy); 560 emit newEventSignal(gx,gy);
558 } else { 561 } else {
559 KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; 562 KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object;
560 selectItem(doubleClickedItem); 563 selectItem(doubleClickedItem);
561 if ( KOPrefs::instance()->mEditOnDoubleClick ) 564 if ( KOPrefs::instance()->mEditOnDoubleClick )
562 emit editIncidenceSignal(doubleClickedItem->incidence()); 565 emit editIncidenceSignal(doubleClickedItem->incidence());
563 else 566 else
564 emit showIncidenceSignal(doubleClickedItem->incidence()); 567 emit showIncidenceSignal(doubleClickedItem->incidence());
565 } 568 }
566 break; 569 break;
567 570
568 default: 571 default:
569 break; 572 break;
570 } 573 }
571 return true; 574 return true;
572} 575}
573 576
574void KOAgenda::newItem( int item ) 577void KOAgenda::newItem( int item )
575{ 578{
576 if ( item == 1 ) { //new event 579 if ( item == 1 ) { //new event
577 newEventSignal(mStartCellX ,mStartCellY ); 580 newEventSignal(mStartCellX ,mStartCellY );
578 } else 581 } else
579 if ( item == 2 ) { //new event 582 if ( item == 2 ) { //new event
580 newTodoSignal(mStartCellX ,mStartCellY ); 583 newTodoSignal(mStartCellX ,mStartCellY );
581 } else 584 } else
582 { 585 {
583 QDate day = mSelectedDates[mStartCellX]; 586 QDate day = mSelectedDates[mStartCellX];
584 emit showDateView( item, day ); 587 emit showDateView( item, day );
585 // 3Day view 588 // 3Day view
586 // 4Week view 589 // 4Week view
587 // 5Month view 590 // 5Month view
588 // 6Journal view 591 // 6Journal view
589 } 592 }
590} 593}
591void KOAgenda::startSelectAction(QPoint viewportPos) 594void KOAgenda::startSelectAction(QPoint viewportPos)
592{ 595{
593 //emit newStartSelectSignal(); 596 //emit newStartSelectSignal();
594 597
595 mActionType = SELECT; 598 mActionType = SELECT;
596 599
597 int x,y; 600 int x,y;
598 viewportToContents(viewportPos.x(),viewportPos.y(),x,y); 601 viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index 496f125..4ee5292 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -180,265 +180,272 @@ void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout)
180 mAlarmButton = new QCheckBox(i18n("Rem."),parent); 180 mAlarmButton = new QCheckBox(i18n("Rem."),parent);
181 else 181 else
182 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); 182 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent);
183 183
184 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); 184 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool)));
185 alarmLayout->addWidget(mAlarmButton); 185 alarmLayout->addWidget(mAlarmButton);
186 186
187 mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; 187 mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ;
188 alarmLayout->addWidget(mAlarmTimeEdit); 188 alarmLayout->addWidget(mAlarmTimeEdit);
189 mAlarmIncrCombo = new QComboBox(false, parent); 189 mAlarmIncrCombo = new QComboBox(false, parent);
190 if ( QApplication::desktop()->width() < 320 ) { 190 if ( QApplication::desktop()->width() < 320 ) {
191 mAlarmIncrCombo->insertItem(i18n("min")); 191 mAlarmIncrCombo->insertItem(i18n("min"));
192 mAlarmIncrCombo->insertItem(i18n("hou")); 192 mAlarmIncrCombo->insertItem(i18n("hou"));
193 mAlarmIncrCombo->insertItem(i18n("day")); 193 mAlarmIncrCombo->insertItem(i18n("day"));
194 mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() ); 194 mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() );
195 mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() ); 195 mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() );
196 } else { 196 } else {
197 mAlarmIncrCombo->insertItem(i18n("minute(s)")); 197 mAlarmIncrCombo->insertItem(i18n("minute(s)"));
198 mAlarmIncrCombo->insertItem(i18n("hour(s)")); 198 mAlarmIncrCombo->insertItem(i18n("hour(s)"));
199 mAlarmIncrCombo->insertItem(i18n("day(s)")); 199 mAlarmIncrCombo->insertItem(i18n("day(s)"));
200 } 200 }
201 201
202 // mAlarmIncrCombo->setMinimumHeight(20); 202 // mAlarmIncrCombo->setMinimumHeight(20);
203 alarmLayout->addWidget(mAlarmIncrCombo); 203 alarmLayout->addWidget(mAlarmIncrCombo);
204 mAlarmSoundButton = new QPushButton(parent); 204 mAlarmSoundButton = new QPushButton(parent);
205 mAlarmSoundButton->setPixmap(SmallIcon("playsound")); 205 mAlarmSoundButton->setPixmap(SmallIcon("playsound"));
206 mAlarmSoundButton->setToggleButton(true); 206 mAlarmSoundButton->setToggleButton(true);
207 QToolTip::add(mAlarmSoundButton, i18n("No sound set")); 207 QToolTip::add(mAlarmSoundButton, i18n("No sound set"));
208 connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); 208 connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound()));
209 alarmLayout->addWidget(mAlarmSoundButton); 209 alarmLayout->addWidget(mAlarmSoundButton);
210 210
211 mAlarmProgramButton = new QPushButton(parent); 211 mAlarmProgramButton = new QPushButton(parent);
212 mAlarmProgramButton->setPixmap(SmallIcon("run")); 212 mAlarmProgramButton->setPixmap(SmallIcon("run"));
213 mAlarmProgramButton->setToggleButton(true); 213 mAlarmProgramButton->setToggleButton(true);
214 QToolTip::add(mAlarmProgramButton, i18n("No program set")); 214 QToolTip::add(mAlarmProgramButton, i18n("No program set"));
215 connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); 215 connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram()));
216 alarmLayout->addWidget(mAlarmProgramButton); 216 alarmLayout->addWidget(mAlarmProgramButton);
217 mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); 217 mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 );
218 mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); 218 mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 );
219 // if ( KOPrefs::instance()->mCompactDialogs ) { 219 // if ( KOPrefs::instance()->mCompactDialogs ) {
220 // mAlarmSoundButton->hide(); 220 // mAlarmSoundButton->hide();
221 // mAlarmProgramButton->hide(); 221 // mAlarmProgramButton->hide();
222 // } 222 // }
223} 223}
224 224
225void KOEditorGeneral::pickAlarmSound() 225void KOEditorGeneral::pickAlarmSound()
226{ 226{
227 227
228 qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() );
228 //QString prefix = mAlarmSound; 229 //QString prefix = mAlarmSound;
229 if (!mAlarmSoundButton->isOn()) { 230 if (!mAlarmSoundButton->isOn()) {
230 //mAlarmSound = ""; 231 //mAlarmSound = "";
231 QToolTip::remove(mAlarmSoundButton); 232 QToolTip::remove(mAlarmSoundButton);
232 QToolTip::add(mAlarmSoundButton, i18n("No sound set")); 233 QToolTip::add(mAlarmSoundButton, i18n("No sound set"));
233 mAlarmProgramButton->setOn(true); 234 mAlarmProgramButton->setOn(true);
234 mAlarmSoundButton->setOn(false); 235 mAlarmSoundButton->setOn(false);
236 pickAlarmProgram();
235 } else { 237 } else {
236 QString fileName(KFileDialog::getOpenFileName(mAlarmSound, 238 QString fileName(KFileDialog::getOpenFileName(mAlarmSound,
237 i18n("*.wav|Wav Files"), 0)); 239 i18n("*.wav|Wav Files"), 0));
238 if (!fileName.isEmpty()) { 240 if (!fileName.isEmpty()) {
239 mAlarmSound = fileName; 241 mAlarmSound = fileName;
240 QToolTip::remove(mAlarmSoundButton); 242 QToolTip::remove(mAlarmSoundButton);
241 QString dispStr = i18n("Playing '%1'").arg(fileName); 243 QString dispStr = i18n("Playing '%1'").arg(fileName);
242 QToolTip::add(mAlarmSoundButton, dispStr); 244 QToolTip::add(mAlarmSoundButton, dispStr);
243 mAlarmProgramButton->setOn(false); 245 mAlarmProgramButton->setOn(false);
244 mAlarmSoundButton->setOn(true); 246 mAlarmSoundButton->setOn(true);
245 } else { 247 } else {
246 mAlarmProgramButton->setOn(true); 248 mAlarmProgramButton->setOn(true);
247 mAlarmSoundButton->setOn(false); 249 mAlarmSoundButton->setOn(false);
248 250
249 } 251 }
250 } 252 }
251 253
252 if (mAlarmProgramButton->isOn()) 254 if (mAlarmProgramButton->isOn())
253 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); 255 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
254 if ( mAlarmSoundButton->isOn()) 256 if ( mAlarmSoundButton->isOn())
255 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio.Al.: ") + getFittingPath(mAlarmSound) ); 257 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
256} 258}
257 259
258void KOEditorGeneral::pickAlarmProgram() 260void KOEditorGeneral::pickAlarmProgram()
259{ 261{
260 if (!mAlarmProgramButton->isOn()) { 262 if (!mAlarmProgramButton->isOn()) {
261 //mAlarmProgram = ""; 263 //mAlarmProgram = "";
262 QToolTip::remove(mAlarmProgramButton); 264 QToolTip::remove(mAlarmProgramButton);
263 QToolTip::add(mAlarmProgramButton, i18n("No program set")); 265 QToolTip::add(mAlarmProgramButton, i18n("No program set"));
264 mAlarmProgramButton->setOn(false); 266 mAlarmProgramButton->setOn(false);
265 mAlarmSoundButton->setOn(true); 267 mAlarmSoundButton->setOn(true);
268 pickAlarmSound();
266 } else { 269 } else {
267 QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm.: ") , 0)); 270 QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0));
268 if (!fileName.isEmpty()) { 271 if (!fileName.isEmpty()) {
269 mAlarmProgram = fileName; 272 mAlarmProgram = fileName;
270 QToolTip::remove(mAlarmProgramButton); 273 QToolTip::remove(mAlarmProgramButton);
271 QString dispStr = i18n("Running '%1'").arg(fileName); 274 QString dispStr = i18n("Running '%1'").arg(fileName);
272 QToolTip::add(mAlarmProgramButton, dispStr); 275 QToolTip::add(mAlarmProgramButton, dispStr);
273 mAlarmSoundButton->setOn(false); 276 mAlarmSoundButton->setOn(false);
274 mAlarmProgramButton->setOn(true); 277 mAlarmProgramButton->setOn(true);
275 } else { 278 } else {
276 mAlarmProgramButton->setOn(false); 279 mAlarmProgramButton->setOn(false);
277 mAlarmSoundButton->setOn(true); 280 mAlarmSoundButton->setOn(true);
278 } 281 }
279 } 282 }
280 if (mAlarmProgramButton->isOn()) 283 if (mAlarmProgramButton->isOn())
281 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); 284 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
282 if ( mAlarmSoundButton->isOn()) 285 if ( mAlarmSoundButton->isOn())
283 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + getFittingPath(mAlarmSound) ); 286 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
284} 287}
285 288
286 289
287QString KOEditorGeneral::getFittingPath( const QString s ) 290QString KOEditorGeneral::getFittingPath( const QString s )
288{ 291{
289 int maxlen = 50; 292 int maxlen = 50;
290 if ( QApplication::desktop()->width() < 640 ) { 293 if ( QApplication::desktop()->width() < 640 ) {
291 if ( QApplication::desktop()->width() < 320 ) 294 if ( QApplication::desktop()->width() < 320 )
292 maxlen = 22; 295 maxlen = 22;
293 else 296 else
294 maxlen = 35; 297 maxlen = 35;
295 } 298 }
296 if ( s.length() > maxlen ) { 299 if ( s.length() > maxlen ) {
297 return "..."+s.right(maxlen -3); 300 return "..."+s.right(maxlen -3);
298 } 301 }
299 return s; 302 return s;
300} 303}
301 304
302void KOEditorGeneral::enableAlarmEdit(bool enable) 305void KOEditorGeneral::enableAlarmEdit(bool enable)
303{ 306{
304 if ( enable ) { 307 if ( enable ) {
305 if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { 308 if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) {
306 mAlarmSoundButton->setOn( true ); 309 mAlarmSoundButton->setOn( true );
307 if ( mAlarmSound.isEmpty() ) 310 if ( mAlarmSound.isEmpty() )
308 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 311 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
309 else { 312 else {
310 if ( ! QFile::exists( mAlarmSound ) ) 313 if ( ! QFile::exists( mAlarmSound ) )
311 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 314 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
312 } 315 }
313 } 316 }
314 if (mAlarmProgramButton->isOn()) 317 if (mAlarmProgramButton->isOn())
315 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); 318 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
316 if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) 319 if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn())
317 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); 320 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
318 } 321 }
319 else { 322 else {
320 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled for this item")); 323 ((QWidget*)parent())->topLevelWidget()->setCaption(mAlarmMessage);
324 //((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Edit item: ") + mSummaryEdit->currentText());
325
321 326
322 } 327 }
323 mAlarmTimeEdit->setEnabled(enable); 328 mAlarmTimeEdit->setEnabled(enable);
324 mAlarmSoundButton->setEnabled(enable); 329 mAlarmSoundButton->setEnabled(enable);
325 mAlarmProgramButton->setEnabled(enable); 330 mAlarmProgramButton->setEnabled(enable);
326 mAlarmIncrCombo->setEnabled(enable); 331 mAlarmIncrCombo->setEnabled(enable);
327} 332}
328 333
329void KOEditorGeneral::disableAlarmEdit(bool disable) 334void KOEditorGeneral::disableAlarmEdit(bool disable)
330{ 335{
331 enableAlarmEdit( !disable ); 336 enableAlarmEdit( !disable );
332} 337}
333 338
334void KOEditorGeneral::enableAlarm( bool enable ) 339void KOEditorGeneral::enableAlarm( bool enable )
335{ 340{
336 enableAlarmEdit( enable ); 341 enableAlarmEdit( enable );
337} 342}
338 343
339void KOEditorGeneral::alarmDisable(bool disable) 344void KOEditorGeneral::alarmDisable(bool disable)
340{ 345{
341 if (!disable) { 346 if (!disable) {
342 //mAlarmBell->setEnabled(true); 347 //mAlarmBell->setEnabled(true);
343 mAlarmButton->setEnabled(true); 348 mAlarmButton->setEnabled(true);
344 } else { 349 } else {
345 //mAlarmBell->setEnabled(false); 350 //mAlarmBell->setEnabled(false);
346 mAlarmButton->setEnabled(false); 351 mAlarmButton->setEnabled(false);
347 mAlarmButton->setChecked(false); 352 mAlarmButton->setChecked(false);
348 mAlarmTimeEdit->setEnabled(false); 353 mAlarmTimeEdit->setEnabled(false);
349 mAlarmSoundButton->setEnabled(false); 354 mAlarmSoundButton->setEnabled(false);
350 mAlarmProgramButton->setEnabled(false); 355 mAlarmProgramButton->setEnabled(false);
351 mAlarmIncrCombo->setEnabled(false); 356 mAlarmIncrCombo->setEnabled(false);
352 } 357 }
353} 358}
354 359
355void KOEditorGeneral::setCategories(const QString &str) 360void KOEditorGeneral::setCategories(const QString &str)
356{ 361{
357 mCategoriesLabel->setText(str); 362 mCategoriesLabel->setText(str);
358} 363}
359 364
360void KOEditorGeneral::setDefaults(bool allDay) 365void KOEditorGeneral::setDefaults(bool allDay)
361{ 366{
362#if 0 367#if 0
363 mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); 368 mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName());
364#endif 369#endif
365 370
371 mAlarmMessage = i18n("Edit new item");
366 enableAlarmEdit( !allDay ); 372 enableAlarmEdit( !allDay );
367 373
368 // TODO: Implement a KPrefsComboItem to solve this in a clean way. 374 // TODO: Implement a KPrefsComboItem to solve this in a clean way.
369 int alarmTime; 375 int alarmTime;
370 int a[] = { 1,5,10,15,30,60,180, 1440 }; 376 int a[] = { 1,5,10,15,30,60,180, 1440 };
371 int index = KOPrefs::instance()->mAlarmTime; 377 int index = KOPrefs::instance()->mAlarmTime;
372 if (index < 0 || index > 7) { 378 if (index < 0 || index > 7) {
373 alarmTime = 15; 379 alarmTime = 15;
374 } else { 380 } else {
375 alarmTime = a[index]; 381 alarmTime = a[index];
376 } 382 }
377 mAlarmButton ->setChecked( false ); 383 mAlarmButton ->setChecked( false );
378 mAlarmTimeEdit->setValue(alarmTime); 384 mAlarmTimeEdit->setValue(alarmTime);
379 mAlarmIncrCombo->setCurrentItem(0); 385 mAlarmIncrCombo->setCurrentItem(0);
380 enableAlarmEdit( false ); 386 enableAlarmEdit( false );
381 //alarmDisable (false); 387 //alarmDisable (false);
382 mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); 388 mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic);
383 mCancelBox->setChecked( false ); 389 mCancelBox->setChecked( false );
384 mSummaryEdit->setEditText(""); 390 mSummaryEdit->setEditText("");
385 mLocationEdit->setEditText(""); 391 mLocationEdit->setEditText("");
386 mDescriptionEdit->setText(""); 392 mDescriptionEdit->setText("");
387 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 393 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
388 setCategories(""); 394 setCategories("");
389} 395}
390void KOEditorGeneral::setSecrecy( int num ) 396void KOEditorGeneral::setSecrecy( int num )
391{ 397{
392 mSecrecyCombo->setCurrentItem(num); 398 mSecrecyCombo->setCurrentItem(num);
393} 399}
394void KOEditorGeneral::readIncidence(Incidence *event) 400void KOEditorGeneral::readIncidence(Incidence *event)
395{ 401{
396 402
403 mAlarmMessage = i18n("Edit") +" "+event->summary();
397 mAlarmIncrCombo->setCurrentItem(0); 404 mAlarmIncrCombo->setCurrentItem(0);
398 mSummaryEdit->setEditText(event->summary()); 405 mSummaryEdit->setEditText(event->summary());
399 mLocationEdit->setEditText(event->location()); 406 mLocationEdit->setEditText(event->location());
400 mDescriptionEdit->setText(event->description()); 407 mDescriptionEdit->setText(event->description());
401 408
402#if 0 409#if 0
403 // organizer information 410 // organizer information
404 mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); 411 mOwnerLabel->setText(i18n("Owner: ") + event->organizer());
405#endif 412#endif
406 413
407 enableAlarmEdit( event->isAlarmEnabled() ); 414 enableAlarmEdit( event->isAlarmEnabled() );
408 //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); 415 //qDebug("KOEditorGeneral::readIncidence(Incidence *event) ");
409 if(!event->isAlarmEnabled()) { 416 if(!event->isAlarmEnabled()) {
410 // TODO: Implement a KPrefsComboItem to solve this in a clean way. 417 // TODO: Implement a KPrefsComboItem to solve this in a clean way.
411 int alarmTime; 418 int alarmTime;
412 int a[] = { 1,5,10,15,30,60,180, 1440 }; 419 int a[] = { 1,5,10,15,30,60,180, 1440 };
413 int index = KOPrefs::instance()->mAlarmTime; 420 int index = KOPrefs::instance()->mAlarmTime;
414 if (index < 0 || index > 7) { 421 if (index < 0 || index > 7) {
415 alarmTime = 15; 422 alarmTime = 15;
416 } else { 423 } else {
417 alarmTime = a[index]; 424 alarmTime = a[index];
418 } 425 }
419 mAlarmTimeEdit->setValue(alarmTime); 426 mAlarmTimeEdit->setValue(alarmTime);
420 } 427 }
421 mAlarmButton->setChecked( event->isAlarmEnabled() ); 428 mAlarmButton->setChecked( event->isAlarmEnabled() );
422 mSecrecyCombo->setCurrentItem(event->secrecy()); 429 mSecrecyCombo->setCurrentItem(event->secrecy());
423 mCancelBox->setChecked( event->cancelled() ); 430 mCancelBox->setChecked( event->cancelled() );
424 mAlarmProgramButton->setOn(false); 431 mAlarmProgramButton->setOn(false);
425 mAlarmSoundButton->setOn(false); 432 mAlarmSoundButton->setOn(false);
426 433
427 // set up alarm stuff 434 // set up alarm stuff
428 QPtrList<Alarm> alarms = event->alarms(); 435 QPtrList<Alarm> alarms = event->alarms();
429 Alarm* alarm; 436 Alarm* alarm;
430 mAlarmIncrCombo->setCurrentItem(0); 437 mAlarmIncrCombo->setCurrentItem(0);
431 for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { 438 for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) {
432 int offset; 439 int offset;
433 if ( alarm->hasTime() ) { 440 if ( alarm->hasTime() ) {
434 QDateTime t = alarm->time(); 441 QDateTime t = alarm->time();
435 offset = event->dtStart().secsTo( t ); 442 offset = event->dtStart().secsTo( t );
436 } else { 443 } else {
437 offset = alarm->startOffset().asSeconds(); 444 offset = alarm->startOffset().asSeconds();
438 } 445 }
439 if ( offset != 0 ) { 446 if ( offset != 0 ) {
440 offset = offset / -60; // make minutes 447 offset = offset / -60; // make minutes
441 if (offset % 60 == 0) { // divides evenly into hours? 448 if (offset % 60 == 0) { // divides evenly into hours?
442 offset = offset / 60; 449 offset = offset / 60;
443 mAlarmIncrCombo->setCurrentItem(1); 450 mAlarmIncrCombo->setCurrentItem(1);
444 if (offset % 24 == 0) { // divides evenly into days? 451 if (offset % 24 == 0) { // divides evenly into days?
diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h
index de8edaf..f4728c7 100644
--- a/korganizer/koeditorgeneral.h
+++ b/korganizer/koeditorgeneral.h
@@ -63,51 +63,52 @@ class KOEditorGeneral : public QObject
63 void setDefaults(bool allDay); 63 void setDefaults(bool allDay);
64 /** Read event object and setup widgets accordingly */ 64 /** Read event object and setup widgets accordingly */
65 void readIncidence(Incidence *); 65 void readIncidence(Incidence *);
66 /** Write event settings to event object */ 66 /** Write event settings to event object */
67 void writeIncidence(Incidence *); 67 void writeIncidence(Incidence *);
68 68
69 /** Check if the input is valid. */ 69 /** Check if the input is valid. */
70 bool validateInput() { return true; } 70 bool validateInput() { return true; }
71 71
72 void enableAlarm( bool enable ); 72 void enableAlarm( bool enable );
73 void setSecrecy( int num ); 73 void setSecrecy( int num );
74 public slots: 74 public slots:
75 void setCategories(const QString &); 75 void setCategories(const QString &);
76 void editCategories(); 76 void editCategories();
77 77
78 protected slots: 78 protected slots:
79 void enableAlarmEdit( bool enable ); 79 void enableAlarmEdit( bool enable );
80 void disableAlarmEdit( bool disable ); 80 void disableAlarmEdit( bool disable );
81 void alarmDisable( bool disable ); 81 void alarmDisable( bool disable );
82 void pickAlarmSound(); 82 void pickAlarmSound();
83 void pickAlarmProgram(); 83 void pickAlarmProgram();
84 84
85 signals: 85 signals:
86 void openCategoryDialog(); 86 void openCategoryDialog();
87 void allAccepted(); 87 void allAccepted();
88 88
89 protected: 89 protected:
90 //QLineEdit *mSummaryEdit; 90 //QLineEdit *mSummaryEdit;
91 //QLineEdit *mLocationEdit; 91 //QLineEdit *mLocationEdit;
92 KOLocationBox *mSummaryEdit; 92 KOLocationBox *mSummaryEdit;
93 KOLocationBox *mLocationEdit; 93 KOLocationBox *mLocationEdit;
94 QLabel *mAlarmBell; 94 QLabel *mAlarmBell;
95 QCheckBox *mAlarmButton; 95 QCheckBox *mAlarmButton;
96 QSpinBox *mAlarmTimeEdit; 96 QSpinBox *mAlarmTimeEdit;
97 QPushButton *mAlarmSoundButton; 97 QPushButton *mAlarmSoundButton;
98 QPushButton *mAlarmProgramButton; 98 QPushButton *mAlarmProgramButton;
99 QComboBox *mAlarmIncrCombo; 99 QComboBox *mAlarmIncrCombo;
100 KTextEdit *mDescriptionEdit; 100 KTextEdit *mDescriptionEdit;
101 QLabel *mOwnerLabel; 101 QLabel *mOwnerLabel;
102 QComboBox *mSecrecyCombo; 102 QComboBox *mSecrecyCombo;
103 QCheckBox *mCancelBox; 103 QCheckBox *mCancelBox;
104 QPushButton *mCategoriesButton; 104 QPushButton *mCategoriesButton;
105 QLabel *mCategoriesLabel; 105 QLabel *mCategoriesLabel;
106 106
107 private: 107 private:
108 QString getFittingPath( const QString ) ; 108 QString getFittingPath( const QString ) ;
109 QString mAlarmSound; 109 QString mAlarmSound;
110 QString mAlarmProgram; 110 QString mAlarmProgram;
111 QString mAlarmMessage;
111}; 112};
112 113
113#endif 114#endif
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 7319285..184cb39 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -20,103 +20,97 @@
20 20
21// $Id$ 21// $Id$
22 22
23#include "ksyncmanager.h" 23#include "ksyncmanager.h"
24 24
25#include <stdlib.h> 25#include <stdlib.h>
26 26
27#ifndef _WIN32_ 27#ifndef _WIN32_
28#include <unistd.h> 28#include <unistd.h>
29#endif 29#endif
30 30
31 31
32#include "ksyncprofile.h" 32#include "ksyncprofile.h"
33#include "ksyncprefsdialog.h" 33#include "ksyncprefsdialog.h"
34#include "kpimprefs.h" 34#include "kpimprefs.h"
35#include <kmessagebox.h> 35#include <kmessagebox.h>
36 36
37#include <qdir.h> 37#include <qdir.h>
38#include <qprogressbar.h> 38#include <qprogressbar.h>
39#include <qpopupmenu.h> 39#include <qpopupmenu.h>
40#include <qpushbutton.h> 40#include <qpushbutton.h>
41#include <qradiobutton.h> 41#include <qradiobutton.h>
42#include <qbuttongroup.h> 42#include <qbuttongroup.h>
43#include <qtimer.h> 43#include <qtimer.h>
44#include <qmessagebox.h> 44#include <qmessagebox.h>
45#include <qapplication.h> 45#include <qapplication.h>
46#include <qlineedit.h> 46#include <qlineedit.h>
47#include <qdialog.h> 47#include <qdialog.h>
48#include <qlayout.h> 48#include <qlayout.h>
49#include <qtextcodec.h> 49#include <qtextcodec.h>
50#include <qlabel.h> 50#include <qlabel.h>
51#include <qcheckbox.h> 51#include <qcheckbox.h>
52 52
53#include <klocale.h> 53#include <klocale.h>
54#include <kglobal.h> 54#include <kglobal.h>
55#include <kconfig.h> 55#include <kconfig.h>
56#include <kfiledialog.h> 56#include <kfiledialog.h>
57 57
58QDateTime KSyncManager::mRequestedSyncEvent; 58QDateTime KSyncManager::mRequestedSyncEvent;
59 59
60 60
61KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) 61KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu)
62 : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) 62 : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu)
63{ 63{
64 mServerSocket = 0; 64 mServerSocket = 0;
65 bar = new QProgressBar ( 1, 0 ); 65 bar = new QProgressBar ( 1, 0 );
66 bar->setCaption (""); 66 bar->setCaption ("");
67 mWriteBackInPast = 2; 67 mWriteBackInPast = 2;
68 int w = 300; 68
69 if ( QApplication::desktop()->width() < 320 )
70 w = 220;
71 int h = bar->sizeHint().height() ;
72 int dw = QApplication::desktop()->width();
73 int dh = QApplication::desktop()->height();
74 bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
75 69
76} 70}
77 71
78KSyncManager::~KSyncManager() 72KSyncManager::~KSyncManager()
79{ 73{
80 delete bar; 74 delete bar;
81} 75}
82 76
83void KSyncManager::setDefaultFileName( QString s) 77void KSyncManager::setDefaultFileName( QString s)
84{ 78{
85 mDefFileName = s ; 79 mDefFileName = s ;
86 if ( mPrefs->mPassiveSyncAutoStart ) 80 if ( mPrefs->mPassiveSyncAutoStart )
87 enableQuick( false ); 81 enableQuick( false );
88} 82}
89 83
90void KSyncManager::fillSyncMenu() 84void KSyncManager::fillSyncMenu()
91{ 85{
92 if ( mSyncMenu->count() ) 86 if ( mSyncMenu->count() )
93 mSyncMenu->clear(); 87 mSyncMenu->clear();
94 88
95 mSyncMenu->insertItem( i18n("Configure..."), 0 ); 89 mSyncMenu->insertItem( i18n("Configure..."), 0 );
96 mSyncMenu->insertSeparator(); 90 mSyncMenu->insertSeparator();
97 QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); 91 QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu );
98 mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); 92 mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 );
99 clearMenu->insertItem( i18n("For all profiles"), 1 ); 93 clearMenu->insertItem( i18n("For all profiles"), 1 );
100 clearMenu->insertSeparator(); 94 clearMenu->insertSeparator();
101 connect ( clearMenu, SIGNAL( activated ( int ) ), this, SLOT (slotClearMenu( int ) ) ); 95 connect ( clearMenu, SIGNAL( activated ( int ) ), this, SLOT (slotClearMenu( int ) ) );
102 mSyncMenu->insertSeparator(); 96 mSyncMenu->insertSeparator();
103 if ( mServerSocket == 0 ) { 97 if ( mServerSocket == 0 ) {
104 mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 ); 98 mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 );
105 } else { 99 } else {
106 mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 ); 100 mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 );
107 } 101 }
108 mSyncMenu->insertSeparator(); 102 mSyncMenu->insertSeparator();
109 mSyncMenu->insertItem( i18n("Multiple sync"), 1 ); 103 mSyncMenu->insertItem( i18n("Multiple sync"), 1 );
110 mSyncMenu->insertSeparator(); 104 mSyncMenu->insertSeparator();
111 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 105 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
112 config.setGroup("General"); 106 config.setGroup("General");
113 QStringList prof = config.readListEntry("SyncProfileNames"); 107 QStringList prof = config.readListEntry("SyncProfileNames");
114 mLocalMachineName = config.readEntry("LocalMachineName","undefined"); 108 mLocalMachineName = config.readEntry("LocalMachineName","undefined");
115 if ( prof.count() < 2 ) { 109 if ( prof.count() < 2 ) {
116 prof.clear(); 110 prof.clear();
117 QString externalName; 111 QString externalName;
118#ifdef DESKTOP_VERSION 112#ifdef DESKTOP_VERSION
119#ifdef _WIN32_ 113#ifdef _WIN32_
120 externalName = "OutLook(not_implemented)"; 114 externalName = "OutLook(not_implemented)";
121#else 115#else
122 externalName = "KDE_Desktop"; 116 externalName = "KDE_Desktop";
@@ -964,96 +958,103 @@ void KSyncManager::syncKDE()
964 break; 958 break;
965 case (PWMPI): 959 case (PWMPI):
966 960
967 break; 961 break;
968 default: 962 default:
969 qDebug("KSM::slotSyncMenu: invalid apptype selected"); 963 qDebug("KSM::slotSyncMenu: invalid apptype selected");
970 break; 964 break;
971 965
972 } 966 }
973} 967}
974 968
975void KSyncManager::syncSharp() 969void KSyncManager::syncSharp()
976{ 970{
977 971
978 if ( ! syncExternalApplication("sharp") ) 972 if ( ! syncExternalApplication("sharp") )
979 qDebug("KSM::ERROR sync sharp "); 973 qDebug("KSM::ERROR sync sharp ");
980} 974}
981 975
982bool KSyncManager::syncExternalApplication(QString resource) 976bool KSyncManager::syncExternalApplication(QString resource)
983{ 977{
984 978
985 emit save(); 979 emit save();
986 980
987 if ( mAskForPreferences ) 981 if ( mAskForPreferences )
988 if ( !edit_sync_options()) { 982 if ( !edit_sync_options()) {
989 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); 983 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") );
990 return false; 984 return false;
991 } 985 }
992 986
993 qDebug("KSM::Sync extern %s", resource.latin1()); 987 qDebug("KSM::Sync extern %s", resource.latin1());
994 988
995 bool syncOK = mImplementation->syncExternal(this, resource); 989 bool syncOK = mImplementation->syncExternal(this, resource);
996 990
997 return syncOK; 991 return syncOK;
998 992
999} 993}
1000 994
1001void KSyncManager::syncPhone() 995void KSyncManager::syncPhone()
1002{ 996{
1003 997
1004 syncExternalApplication("phone"); 998 syncExternalApplication("phone");
1005 999
1006} 1000}
1007 1001
1008void KSyncManager::showProgressBar(int percentage, QString caption, int total) 1002void KSyncManager::showProgressBar(int percentage, QString caption, int total)
1009{ 1003{
1010 if (!bar->isVisible()) 1004 if (!bar->isVisible())
1011 { 1005 {
1006 int w = 300;
1007 if ( QApplication::desktop()->width() < 320 )
1008 w = 220;
1009 int h = bar->sizeHint().height() ;
1010 int dw = QApplication::desktop()->width();
1011 int dh = QApplication::desktop()->height();
1012 bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1012 bar->setCaption (caption); 1013 bar->setCaption (caption);
1013 bar->setTotalSteps ( total ) ; 1014 bar->setTotalSteps ( total ) ;
1014 bar->show(); 1015 bar->show();
1015 } 1016 }
1016 bar->raise(); 1017 bar->raise();
1017 bar->setProgress( percentage ); 1018 bar->setProgress( percentage );
1018 qApp->processEvents(); 1019 qApp->processEvents();
1019} 1020}
1020 1021
1021void KSyncManager::hideProgressBar() 1022void KSyncManager::hideProgressBar()
1022{ 1023{
1023 bar->hide(); 1024 bar->hide();
1024 qApp->processEvents(); 1025 qApp->processEvents();
1025} 1026}
1026 1027
1027bool KSyncManager::isProgressBarCanceled() 1028bool KSyncManager::isProgressBarCanceled()
1028{ 1029{
1029 return !bar->isVisible(); 1030 return !bar->isVisible();
1030} 1031}
1031 1032
1032QString KSyncManager::syncFileName() 1033QString KSyncManager::syncFileName()
1033{ 1034{
1034 1035
1035 QString fn = "tempfile"; 1036 QString fn = "tempfile";
1036 switch(mTargetApp) 1037 switch(mTargetApp)
1037 { 1038 {
1038 case (KAPI): 1039 case (KAPI):
1039 fn = "tempsyncab.vcf"; 1040 fn = "tempsyncab.vcf";
1040 break; 1041 break;
1041 case (KOPI): 1042 case (KOPI):
1042 fn = "tempsynccal.ics"; 1043 fn = "tempsynccal.ics";
1043 break; 1044 break;
1044 case (PWMPI): 1045 case (PWMPI):
1045 fn = "tempsyncpw.pwm"; 1046 fn = "tempsyncpw.pwm";
1046 break; 1047 break;
1047 default: 1048 default:
1048 break; 1049 break;
1049 } 1050 }
1050#ifdef _WIN32_ 1051#ifdef _WIN32_
1051 return locateLocal( "tmp", fn ); 1052 return locateLocal( "tmp", fn );
1052#else 1053#else
1053 return (QString( "/tmp/" )+ fn ); 1054 return (QString( "/tmp/" )+ fn );
1054#endif 1055#endif
1055} 1056}
1056 1057
1057void KSyncManager::syncPi() 1058void KSyncManager::syncPi()
1058{ 1059{
1059 mIsKapiFile = true; 1060 mIsKapiFile = true;
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp
index e57defe..b6d2feb 100644
--- a/microkde/kglobalsettings.cpp
+++ b/microkde/kglobalsettings.cpp
@@ -1,44 +1,50 @@
1#include "kglobalsettings.h" 1#include "kglobalsettings.h"
2#include "kconfig.h" 2#include "kconfig.h"
3#include "kglobal.h" 3#include "kglobal.h"
4#include "kconfigbase.h" 4#include "kconfigbase.h"
5 5
6#include <qapplication.h> 6#include <qapplication.h>
7 7
8QFont KGlobalSettings::generalFont() 8QFont KGlobalSettings::generalFont()
9{ 9{
10 int size = 12; 10 int size = 12;
11 if (QApplication::desktop()->width() < 480 ) 11 if (QApplication::desktop()->width() < 480 ) {
12 size = 10; 12 size = 10;
13 }
14#ifndef DESKTOP_VERSION
15 else
16 if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
17 size = 18;
18#endif
13 QFont f = QApplication::font(); 19 QFont f = QApplication::font();
14 //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1()); 20 //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1());
15 f.setPointSize( size ); 21 f.setPointSize( size );
16 return f; 22 return f;
17} 23}
18QFont KGlobalSettings::toolBarFont() 24QFont KGlobalSettings::toolBarFont()
19{ 25{
20 return QApplication::font(); 26 return QApplication::font();
21} 27}
22 28
23QColor KGlobalSettings::toolBarHighlightColor() 29QColor KGlobalSettings::toolBarHighlightColor()
24{ 30{
25 return QColor( "black" ); 31 return QColor( "black" );
26} 32}
27 33
28QRect KGlobalSettings::desktopGeometry( QWidget * ) 34QRect KGlobalSettings::desktopGeometry( QWidget * )
29{ 35{
30 return QApplication::desktop()->rect(); 36 return QApplication::desktop()->rect();
31} 37}
32 38
33 /** 39 /**
34 * Returns whether KDE runs in single (default) or double click 40 * Returns whether KDE runs in single (default) or double click
35 * mode. 41 * mode.
36 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html 42 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html
37 * @return true if single click mode, or false if double click mode. 43 * @return true if single click mode, or false if double click mode.
38 **/ 44 **/
39bool KGlobalSettings::singleClick() 45bool KGlobalSettings::singleClick()
40{ 46{
41 KConfig *c = KGlobal::config(); 47 KConfig *c = KGlobal::config();
42 KConfigGroupSaver cgs( c, "KDE" ); 48 KConfigGroupSaver cgs( c, "KDE" );
43 return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); 49 return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK);
44} 50}