summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-12-13 12:35:00 (UTC)
committer zautrix <zautrix>2004-12-13 12:35:00 (UTC)
commit7ac6c21e832b7d16bd0888d0b66252b6e152005a (patch) (unidiff)
treec7610e0e25020f19af82ac6257c2debab2638316
parent17b25691f0332e648dd1d800e89ccf4e1da8955d (diff)
downloadkdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.zip
kdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.tar.gz
kdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.tar.bz2
many bugfixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt10
-rw-r--r--kaddressbook/kabcore.cpp11
-rw-r--r--kaddressbook/viewmanager.cpp11
-rw-r--r--kmicromail/libmailwrapper/settings.cpp2
-rw-r--r--kmicromail/opiemail.cpp27
-rw-r--r--kmicromail/opiemail.h2
-rw-r--r--kmicromail/viewmail.cpp5
-rw-r--r--kmicromail/viewmail.h1
-rw-r--r--korganizer/calendarview.cpp24
-rw-r--r--qtcompat/qinputdialog.cpp7
10 files changed, 80 insertions, 20 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 46d59a3..ec75fad 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,37 +1,47 @@
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 1.9.15 ************ 3********** VERSION 1.9.15 ************
4 4
5Usebilty enhancements in KO/Pi: 5Usebilty enhancements in KO/Pi:
6When clicking on the date in a month view cell, the day view is shown. 6When clicking on the date in a month view cell, the day view is shown.
7Old behaviour was, that the "new event" dialog popped up. 7Old behaviour was, that the "new event" dialog popped up.
8 8
9Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). 9Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu).
10That means, you can restore the latest 10That means, you can restore the latest
11event/todo/journal you have deleted. 11event/todo/journal you have deleted.
12A journal is deleted, if you clear all the text of the journal. 12A journal is deleted, if you clear all the text of the journal.
13 13
14Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14.
15
16KA/Pi starting in 480x640 resolution:
17Hide the filter action in toolbar
18and added icons for undo/delete/redo in toolbar.
19
20Change in OM/Pi ViewMail dialog:
21When clicking on the "delete" icon the mail is deleted after confirmation as usual. But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any).
22
23Fixed a crash when deleting mail-accounts in OM/Pi.
14 24
15 25
16********** VERSION 1.9.14 ************ 26********** VERSION 1.9.14 ************
17 27
18Fixed some problems with the dialog sizes when switching 28Fixed some problems with the dialog sizes when switching
19portrait/landscape mode on 640x480 PDA display. 29portrait/landscape mode on 640x480 PDA display.
20 30
21Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. 31Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi.
22 32
23Fixed an ugly bug in KOpieMail: 33Fixed an ugly bug in KOpieMail:
24KOpieMail was not able to write files (mails) to MSDOS file system, 34KOpieMail was not able to write files (mails) to MSDOS file system,
25like on an usual preformatted SD card. That should work now. 35like on an usual preformatted SD card. That should work now.
26To save your mail data on the Sd card do the following: 36To save your mail data on the Sd card do the following:
27Create a dir on the SD card: 37Create a dir on the SD card:
28mkdir /mnt/card/localmail 38mkdir /mnt/card/localmail
29Go to your home dir: 39Go to your home dir:
30cd 40cd
31Go to kopiemail data storage dir: 41Go to kopiemail data storage dir:
32cd kdepim/apps/kopiemail 42cd kdepim/apps/kopiemail
33Create a symlink to the SD card: 43Create a symlink to the SD card:
34ls -s /mnt/card/localmail 44ls -s /mnt/card/localmail
35Now KOpieMail will store all mails on the SD card. 45Now KOpieMail will store all mails on the SD card.
36 46
37KO/Pi Monthview: 47KO/Pi Monthview:
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index b7edccd..f6bdda4 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -766,48 +766,49 @@ void KABCore::beamMySelf()
766{ 766{
767 KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); 767 KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI();
768 if (!a.isEmpty()) 768 if (!a.isEmpty())
769 { 769 {
770 QStringList uids; 770 QStringList uids;
771 uids << a.uid(); 771 uids << a.uid();
772 772
773 beamVCard(uids); 773 beamVCard(uids);
774 } else { 774 } else {
775 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); 775 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) );
776 776
777 777
778 } 778 }
779} 779}
780void KABCore::updateMainWindow() 780void KABCore::updateMainWindow()
781{ 781{
782 782
783 mMainWindow->showMaximized(); 783 mMainWindow->showMaximized();
784 mMainWindow->update(); 784 mMainWindow->update();
785} 785}
786void KABCore::resizeEvent(QResizeEvent* e ) 786void KABCore::resizeEvent(QResizeEvent* e )
787{ 787{
788 if ( !mMiniSplitter ) 788 if ( !mMiniSplitter )
789 return; 789 return;
790 //qDebug("KABCore::resizeEvent(QResizeEvent* e ) ");
790 if ( QApplication::desktop()->width() >= 480 ) { 791 if ( QApplication::desktop()->width() >= 480 ) {
791 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 792 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480
792 if ( mMiniSplitter->orientation() == Qt::Vertical ) { 793 if ( mMiniSplitter->orientation() == Qt::Vertical ) {
793 mMiniSplitter->setOrientation( Qt::Horizontal); 794 mMiniSplitter->setOrientation( Qt::Horizontal);
794 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 795 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
795 if ( QApplication::desktop()->width() <= 640 ) { 796 if ( QApplication::desktop()->width() <= 640 ) {
796 //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); 797 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
797 mViewManager->getFilterAction()->setComboWidth( 150 ); 798 mViewManager->getFilterAction()->setComboWidth( 150 );
798 QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); 799 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
799 } 800 }
800 } 801 }
801 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 802 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640
802 if ( mMiniSplitter->orientation() == Qt::Horizontal ) { 803 if ( mMiniSplitter->orientation() == Qt::Horizontal ) {
803 mMiniSplitter->setOrientation( Qt::Vertical ); 804 mMiniSplitter->setOrientation( Qt::Vertical );
804 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 805 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
805 if ( QApplication::desktop()->width() <= 640 ) { 806 if ( QApplication::desktop()->width() <= 640 ) {
806 //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); 807 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
807 mMainWindow->showMinimized(); 808 mMainWindow->showMinimized();
808 mViewManager->getFilterAction()->setComboWidth( 0 ); 809 mViewManager->getFilterAction()->setComboWidth( 0 );
809 QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); 810 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
810 } 811 }
811 } 812 }
812 } 813 }
813 } 814 }
@@ -2171,53 +2172,55 @@ void KABCore::addActionsManually()
2171 settingsMenu->insertSeparator(); 2172 settingsMenu->insertSeparator();
2172 2173
2173 mActionWhoAmI->plug( settingsMenu ); 2174 mActionWhoAmI->plug( settingsMenu );
2174 mActionEditCategories->plug( settingsMenu ); 2175 mActionEditCategories->plug( settingsMenu );
2175 mActionEditCategories->plug( changeMenu ); 2176 mActionEditCategories->plug( changeMenu );
2176 mActionCategories->plug( changeMenu ); 2177 mActionCategories->plug( changeMenu );
2177 mActionManageCategories->plug( changeMenu ); 2178 mActionManageCategories->plug( changeMenu );
2178 2179
2179 mActionCategories->plug( settingsMenu ); 2180 mActionCategories->plug( settingsMenu );
2180 mActionManageCategories->plug( settingsMenu ); 2181 mActionManageCategories->plug( settingsMenu );
2181 2182
2182 2183
2183 mActionWN->plug( helpMenu ); 2184 mActionWN->plug( helpMenu );
2184 mActionSyncHowto->plug( helpMenu ); 2185 mActionSyncHowto->plug( helpMenu );
2185 mActionKdeSyncHowto->plug( helpMenu ); 2186 mActionKdeSyncHowto->plug( helpMenu );
2186 mActionMultiSyncHowto->plug( helpMenu ); 2187 mActionMultiSyncHowto->plug( helpMenu );
2187 mActionFaq->plug( helpMenu ); 2188 mActionFaq->plug( helpMenu );
2188 mActionLicence->plug( helpMenu ); 2189 mActionLicence->plug( helpMenu );
2189 mActionAboutKAddressbook->plug( helpMenu ); 2190 mActionAboutKAddressbook->plug( helpMenu );
2190 2191
2191 if (KGlobal::getDesktopSize() > KGlobal::Small ) { 2192 if (KGlobal::getDesktopSize() > KGlobal::Small ) {
2192 2193
2193 mActionSave->plug( tb ); 2194 mActionSave->plug( tb );
2194 mViewManager->getFilterAction()->plug ( tb); 2195 mViewManager->getFilterAction()->plug ( tb);
2195 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { 2196 //LR hide filteraction on started in 480x640
2196 mActionUndo->plug( tb ); 2197 if (QApplication::desktop()->width() == 480 ) {
2197 mActionDelete->plug( tb ); 2198 mViewManager->getFilterAction()->setComboWidth( 0 );
2198 mActionRedo->plug( tb );
2199 } 2199 }
2200 mActionUndo->plug( tb );
2201 mActionDelete->plug( tb );
2202 mActionRedo->plug( tb );
2200 } else { 2203 } else {
2201 mActionSave->plug( tb ); 2204 mActionSave->plug( tb );
2202 tb->enableMoving(false); 2205 tb->enableMoving(false);
2203 } 2206 }
2204 //mActionQuit->plug ( tb ); 2207 //mActionQuit->plug ( tb );
2205 // tb->insertWidget(-1, 0, mIncSearchWidget, 6); 2208 // tb->insertWidget(-1, 0, mIncSearchWidget, 6);
2206 2209
2207 //US link the searchwidget first to this. 2210 //US link the searchwidget first to this.
2208 // The real linkage to the toolbar happens later. 2211 // The real linkage to the toolbar happens later.
2209//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 2212//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
2210//US tb->insertItem( mIncSearchWidget ); 2213//US tb->insertItem( mIncSearchWidget );
2211/*US 2214/*US
2212 mIncSearchWidget = new IncSearchWidget( tb ); 2215 mIncSearchWidget = new IncSearchWidget( tb );
2213 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 2216 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
2214 SLOT( incrementalSearch( const QString& ) ) ); 2217 SLOT( incrementalSearch( const QString& ) ) );
2215 2218
2216 mJumpButtonBar = new JumpButtonBar( this, this ); 2219 mJumpButtonBar = new JumpButtonBar( this, this );
2217 2220
2218//US topLayout->addWidget( mJumpButtonBar ); 2221//US topLayout->addWidget( mJumpButtonBar );
2219 this->layout()->add( mJumpButtonBar ); 2222 this->layout()->add( mJumpButtonBar );
2220*/ 2223*/
2221 2224
2222#endif //KAB_EMBEDDED 2225#endif //KAB_EMBEDDED
2223 2226
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index 0d91c12..33bef5a 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -39,95 +39,99 @@ $Id$
39#include <kmessagebox.h> 39#include <kmessagebox.h>
40#include <kmultipledrag.h> 40#include <kmultipledrag.h>
41#include <ktrader.h> 41#include <ktrader.h>
42#include <kurldrag.h> 42#include <kurldrag.h>
43 43
44#include "addresseeutil.h" 44#include "addresseeutil.h"
45#else //KAB_EMBEDDED 45#else //KAB_EMBEDDED
46#include "views/kaddressbookiconview.h" 46#include "views/kaddressbookiconview.h"
47#include "views/kaddressbooktableview.h" 47#include "views/kaddressbooktableview.h"
48#include "views/kaddressbookcardview.h" 48#include "views/kaddressbookcardview.h"
49#include "kaddressbookview.h" 49#include "kaddressbookview.h"
50 50
51#include <qaction.h> 51#include <qaction.h>
52#include <qmessagebox.h> 52#include <qmessagebox.h>
53#include <qpopupmenu.h> 53#include <qpopupmenu.h>
54#include <kconfigbase.h> 54#include <kconfigbase.h>
55 55
56#endif //KAB_EMBEDDED 56#endif //KAB_EMBEDDED
57 57
58 58
59#include <kdebug.h> 59#include <kdebug.h>
60#include <kactionclasses.h> 60#include <kactionclasses.h>
61 61
62#include <qlayout.h> 62#include <qlayout.h>
63#include <qapplication.h>
63#include <qwidgetstack.h> 64#include <qwidgetstack.h>
64 65
65#include <kabc/addressbook.h> 66#include <kabc/addressbook.h>
66#include "filtereditdialog.h" 67#include "filtereditdialog.h"
67#include "addviewdialog.h" 68#include "addviewdialog.h"
68#include "kabcore.h" 69#include "kabcore.h"
69#include "kabprefs.h" 70#include "kabprefs.h"
70#include "viewmanager.h" 71#include "viewmanager.h"
71 72
72ViewManager::ViewManager( KABCore *core, QWidget *parent, const char *name ) 73ViewManager::ViewManager( KABCore *core, QWidget *parent, const char *name )
73 : QWidget( parent, name ), mCore( core ), mActiveView( 0 ) 74 : QWidget( parent, name ), mCore( core ), mActiveView( 0 )
74{ 75{
75 initGUI(); 76 initGUI();
76 initActions(); 77 initActions();
77 78
78 mViewDict.setAutoDelete( true ); 79 mViewDict.setAutoDelete( true );
79 80
80 createViewFactories(); 81 createViewFactories();
81} 82}
82 83
83ViewManager::~ViewManager() 84ViewManager::~ViewManager()
84{ 85{
85 unloadViews(); 86 unloadViews();
86 mViewFactoryDict.clear(); 87 mViewFactoryDict.clear();
87} 88}
88void ViewManager::scrollUP() 89void ViewManager::scrollUP()
89{ 90{
90 if ( mActiveView ) 91 if ( mActiveView )
91 mActiveView->scrollUP(); 92 mActiveView->scrollUP();
92} 93}
93void ViewManager::scrollDOWN() 94void ViewManager::scrollDOWN()
94{ 95{
95 if ( mActiveView ) 96 if ( mActiveView )
96 mActiveView->scrollDOWN(); 97 mActiveView->scrollDOWN();
97} 98}
98void ViewManager::restoreSettings() 99void ViewManager::restoreSettings()
99{ 100{
100 mViewNameList = KABPrefs::instance()->mViewNames; 101 mViewNameList = KABPrefs::instance()->mViewNames;
101 QString activeViewName = KABPrefs::instance()->mCurrentView; 102 QString activeViewName = KABPrefs::instance()->mCurrentView;
102 103
103 mActionSelectView->setItems( mViewNameList ); 104 mActionSelectView->setItems( mViewNameList );
104 105
105 // Filter 106 // Filter
106 mFilterList = Filter::restore( mCore->config(), "Filter" ); 107 mFilterList = Filter::restore( mCore->config(), "Filter" );
107 mActionSelectFilter->setItems( filterNames() ); 108 mActionSelectFilter->setItems( filterNames() );
108 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter ); 109 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter );
109 mActionSelectFilter->setComboWidth( 150 ); 110 int cw = 150;
111 if (QApplication::desktop()->width() == 480 )
112 cw = 0;
113 mActionSelectFilter->setComboWidth( cw );
110 // Tell the views to reread their config, since they may have 114 // Tell the views to reread their config, since they may have
111 // been modified by global settings 115 // been modified by global settings
112 QString _oldgroup = mCore->config()->group(); 116 QString _oldgroup = mCore->config()->group();
113 117
114 QDictIterator<KAddressBookView> it( mViewDict ); 118 QDictIterator<KAddressBookView> it( mViewDict );
115 for ( it.toFirst(); it.current(); ++it ) { 119 for ( it.toFirst(); it.current(); ++it ) {
116 KConfigGroupSaver saver( mCore->config(), it.currentKey() ); 120 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
117 it.current()->readConfig( mCore->config() ); 121 it.current()->readConfig( mCore->config() );
118 } 122 }
119 setActiveView( activeViewName ); 123 setActiveView( activeViewName );
120 124
121 mActionDeleteView->setEnabled( mViewNameList.count() > 1 ); 125 mActionDeleteView->setEnabled( mViewNameList.count() > 1 );
122} 126}
123 127
124void ViewManager::saveSettings() 128void ViewManager::saveSettings()
125{ 129{
126 QString _oldgroup = mCore->config()->group(); 130 QString _oldgroup = mCore->config()->group();
127 131
128 QDictIterator<KAddressBookView> it( mViewDict ); 132 QDictIterator<KAddressBookView> it( mViewDict );
129 for ( it.toFirst(); it.current(); ++it ) { 133 for ( it.toFirst(); it.current(); ++it ) {
130 KConfigGroupSaver saver( mCore->config(), it.currentKey() ); 134 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
131#ifdef DESKTOP_VERSION 135#ifdef DESKTOP_VERSION
132 (*it)->writeConfig( mCore->config() ); 136 (*it)->writeConfig( mCore->config() );
133#else 137#else
@@ -576,49 +580,52 @@ void ViewManager::setActiveFilter( int index )
576 currentFilter = mFilterList[ index - 1 ]; 580 currentFilter = mFilterList[ index - 1 ];
577 581
578 // Check if we have a view. Since the filter combo is created before 582 // Check if we have a view. Since the filter combo is created before
579 // the view, this slot could be called before there is a valid view. 583 // the view, this slot could be called before there is a valid view.
580 if ( mActiveView ) { 584 if ( mActiveView ) {
581 mActiveView->setFilter( currentFilter ); 585 mActiveView->setFilter( currentFilter );
582 mActiveView->refresh(); 586 mActiveView->refresh();
583 emit selected( QString::null ); 587 emit selected( QString::null );
584 } 588 }
585} 589}
586 590
587void ViewManager::configureFilters() 591void ViewManager::configureFilters()
588{ 592{
589 FilterDialog dlg( this ); 593 FilterDialog dlg( this );
590 594
591 dlg.setFilters( mFilterList ); 595 dlg.setFilters( mFilterList );
592 596
593 if ( dlg.exec() ) 597 if ( dlg.exec() )
594 mFilterList = dlg.filters(); 598 mFilterList = dlg.filters();
595 599
596 uint pos = mActionSelectFilter->currentItem(); 600 uint pos = mActionSelectFilter->currentItem();
597 mActionSelectFilter->setItems( filterNames() ); 601 mActionSelectFilter->setItems( filterNames() );
598 mActionSelectFilter->setCurrentItem( pos ); 602 mActionSelectFilter->setCurrentItem( pos );
599 setActiveFilter( pos ); 603 setActiveFilter( pos );
600 mActionSelectFilter->setComboWidth( 150 ); 604 int cw = 150;
605 if (QApplication::desktop()->width() == 480 )
606 cw = 0;
607 mActionSelectFilter->setComboWidth( cw );
601} 608}
602 609
603QStringList ViewManager::filterNames() const 610QStringList ViewManager::filterNames() const
604{ 611{
605 QStringList names( i18n( "No Filter" ) ); 612 QStringList names( i18n( "No Filter" ) );
606 613
607 Filter::List::ConstIterator it; 614 Filter::List::ConstIterator it;
608 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it ) 615 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it )
609 names.append( (*it).name() ); 616 names.append( (*it).name() );
610 617
611 return names; 618 return names;
612} 619}
613 620
614int ViewManager::filterPosition( const QString &name ) const 621int ViewManager::filterPosition( const QString &name ) const
615{ 622{
616 int pos = 0; 623 int pos = 0;
617 624
618 Filter::List::ConstIterator it; 625 Filter::List::ConstIterator it;
619 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it, ++pos ) 626 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it, ++pos )
620 if ( name == (*it).name() ) 627 if ( name == (*it).name() )
621 return pos + 1; 628 return pos + 1;
622 629
623 return 0; 630 return 0;
624} 631}
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp
index 04afe7c..19093b1 100644
--- a/kmicromail/libmailwrapper/settings.cpp
+++ b/kmicromail/libmailwrapper/settings.cpp
@@ -29,50 +29,50 @@ Settings::Settings()
29void Settings::checkDirectory() 29void Settings::checkDirectory()
30{ 30{
31 return; 31 return;
32 locateLocal("data", "kopiemail" ); 32 locateLocal("data", "kopiemail" );
33 /* 33 /*
34 if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { 34 if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) {
35 system( "mkdir -p $HOME/Applications/opiemail" ); 35 system( "mkdir -p $HOME/Applications/opiemail" );
36 qDebug("$HOME/Applications/opiemail created "); 36 qDebug("$HOME/Applications/opiemail created ");
37 } 37 }
38 */ 38 */
39} 39}
40 40
41QList<Account> Settings::getAccounts() 41QList<Account> Settings::getAccounts()
42{ 42{
43 return accounts; 43 return accounts;
44} 44}
45 45
46void Settings::addAccount( Account *account ) 46void Settings::addAccount( Account *account )
47{ 47{
48 accounts.append( account ); 48 accounts.append( account );
49} 49}
50 50
51void Settings::delAccount( Account *account ) 51void Settings::delAccount( Account *account )
52{ 52{
53 accounts.remove( account );
54 account->remove(); 53 account->remove();
54 accounts.remove( account );
55} 55}
56 56
57void Settings::updateAccounts() 57void Settings::updateAccounts()
58{ 58{
59 accounts.clear(); 59 accounts.clear();
60 QDir dir( locateLocal("data", "kopiemail" ) ); 60 QDir dir( locateLocal("data", "kopiemail" ) );
61 QStringList::Iterator it; 61 QStringList::Iterator it;
62 62
63 QStringList imap = dir.entryList( "imap-*" ); 63 QStringList imap = dir.entryList( "imap-*" );
64 for ( it = imap.begin(); it != imap.end(); it++ ) { 64 for ( it = imap.begin(); it != imap.end(); it++ ) {
65 IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); 65 IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") );
66 accounts.append( account ); 66 accounts.append( account );
67 } 67 }
68 68
69 QStringList pop3 = dir.entryList( "pop3-*" ); 69 QStringList pop3 = dir.entryList( "pop3-*" );
70 for ( it = pop3.begin(); it != pop3.end(); it++ ) { 70 for ( it = pop3.begin(); it != pop3.end(); it++ ) {
71 POP3account *account = new POP3account( (*it).replace(0, 5, "") ); 71 POP3account *account = new POP3account( (*it).replace(0, 5, "") );
72 accounts.append( account ); 72 accounts.append( account );
73 } 73 }
74 74
75 QStringList smtp = dir.entryList( "smtp-*" ); 75 QStringList smtp = dir.entryList( "smtp-*" );
76 for ( it = smtp.begin(); it != smtp.end(); it++ ) { 76 for ( it = smtp.begin(); it != smtp.end(); it++ ) {
77 SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); 77 SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") );
78 accounts.append( account ); 78 accounts.append( account );
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index ec192ea..915b3e8 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -278,78 +278,105 @@ void OpieMail::replyMail()
278 rtext += "\n"; 278 rtext += "\n";
279 279
280 QString prefix; 280 QString prefix;
281 if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; 281 if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = "";
282 else prefix = "Re: "; // no i18n on purpose 282 else prefix = "Re: "; // no i18n on purpose
283 283
284 Settings *settings = new Settings(); 284 Settings *settings = new Settings();
285 ComposeMail composer( settings ,this, 0, true); 285 ComposeMail composer( settings ,this, 0, true);
286 if (mail->Replyto().isEmpty()) { 286 if (mail->Replyto().isEmpty()) {
287 composer.setTo( mail->getFrom()); 287 composer.setTo( mail->getFrom());
288 } else { 288 } else {
289 composer.setTo( mail->Replyto()); 289 composer.setTo( mail->Replyto());
290 } 290 }
291 composer.setSubject( prefix + mail->getSubject()); 291 composer.setSubject( prefix + mail->getSubject());
292 composer.setMessage( rtext ); 292 composer.setMessage( rtext );
293 composer.setInReplyTo( mail->Msgid()); 293 composer.setInReplyTo( mail->Msgid());
294 composer.setCharset( body->getCharset() ); 294 composer.setCharset( body->getCharset() );
295 if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) 295 if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
296 { 296 {
297 mail->Wrapper()->answeredMail(mail); 297 mail->Wrapper()->answeredMail(mail);
298 } 298 }
299 delete settings; 299 delete settings;
300 300
301} 301}
302void OpieMail::closeViewMail(ViewMail * vm)
303{
304 vm->hide();
305}
306void OpieMail::deleteAndDisplayNextMail(ViewMail * vm)
307{
308 QListViewItem*item = mailView->currentItem();
309 if (!item ) {
310 closeViewMail(vm);
311 return;
312 }
313 RecMailP mail = ((MailListViewItem*)item)->data();
314 mail->Wrapper()->deleteMail( mail );
315 item = item->itemBelow();
316 if (!item ) {
317 closeViewMail(vm);
318 return;
319 }
320 mailView->setCurrentItem(item);
321 mail = ((MailListViewItem*)item)->data();
322 RecBodyP body = folderView->fetchBody(mail);
323 vm->setBody( body );
324 vm->setMail( mail );
325}
302void OpieMail::displayNextMail(ViewMail * vm) 326void OpieMail::displayNextMail(ViewMail * vm)
303{ 327{
304 QListViewItem*item = mailView->currentItem(); 328 QListViewItem*item = mailView->currentItem();
305 if (!item) return; 329 if (!item) return;
330 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
306 item = item->itemBelow(); 331 item = item->itemBelow();
307 if (!item) { 332 if (!item) {
308 vm->setCaption(i18n("End of List" )); 333 vm->setCaption(i18n("End of List" ));
309 return; 334 return;
310 } 335 }
311 mailView->setCurrentItem(item); 336 mailView->setCurrentItem(item);
312 RecMailP mail = ((MailListViewItem*)item)->data(); 337 RecMailP mail = ((MailListViewItem*)item)->data();
313 RecBodyP body = folderView->fetchBody(mail); 338 RecBodyP body = folderView->fetchBody(mail);
314 vm->setBody( body ); 339 vm->setBody( body );
315 vm->setMail( mail ); 340 vm->setMail( mail );
316} 341}
317void OpieMail::displayMail() 342void OpieMail::displayMail()
318{ 343{
319 QListViewItem*item = mailView->currentItem(); 344 QListViewItem*item = mailView->currentItem();
320 if (!item) return; 345 if (!item) return;
321 RecMailP mail = ((MailListViewItem*)item)->data(); 346 RecMailP mail = ((MailListViewItem*)item)->data();
322 RecBodyP body = folderView->fetchBody(mail); 347 RecBodyP body = folderView->fetchBody(mail);
323 ViewMail readMail( this,"", Qt::WType_Modal ); 348 ViewMail readMail( this,"", Qt::WType_Modal );
324 readMail.setBody( body ); 349 readMail.setBody( body );
325 readMail.setMail( mail ); 350 readMail.setMail( mail );
326#ifndef DESKTOP_VERSION 351#ifndef DESKTOP_VERSION
327 readMail.showMaximized(); 352 readMail.showMaximized();
328#else 353#else
329 readMail.resize( 640, 480); 354 readMail.resize( 640, 480);
330#endif 355#endif
331 connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); 356 connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) );
357 connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) );
358
332 readMail.exec(); 359 readMail.exec();
333 360
334 if ( readMail.deleted ) 361 if ( readMail.deleted )
335 { 362 {
336 folderView->refreshCurrent(); 363 folderView->refreshCurrent();
337 } 364 }
338 else 365 else
339 { 366 {
340 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); 367 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
341 } 368 }
342} 369}
343void OpieMail::slotGetAllMail() 370void OpieMail::slotGetAllMail()
344{ 371{
345 QListViewItem * item = folderView->firstChild(); 372 QListViewItem * item = folderView->firstChild();
346 while ( item ){ 373 while ( item ){
347 ((AccountViewItem *)item)->contextMenuSelected( 101 ); 374 ((AccountViewItem *)item)->contextMenuSelected( 101 );
348 item = item->nextSibling (); 375 item = item->nextSibling ();
349 } 376 }
350} 377}
351void OpieMail::slotGetMail() 378void OpieMail::slotGetMail()
352{ 379{
353 QListViewItem * item = folderView->currentItem(); 380 QListViewItem * item = folderView->currentItem();
354 if ( ! item ) return; 381 if ( ! item ) return;
355 ((AccountViewItem *)item)->contextMenuSelected( 101 ); 382 ((AccountViewItem *)item)->contextMenuSelected( 101 );
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h
index 30968a7..a81a34c 100644
--- a/kmicromail/opiemail.h
+++ b/kmicromail/opiemail.h
@@ -5,54 +5,56 @@
5#include "mainwindow.h" 5#include "mainwindow.h"
6#include <libmailwrapper/settings.h> 6#include <libmailwrapper/settings.h>
7 7
8#include <opie2/osmartpointer.h> 8#include <opie2/osmartpointer.h>
9#include <libmailwrapper/mailtypes.h> 9#include <libmailwrapper/mailtypes.h>
10#include <viewmail.h> 10#include <viewmail.h>
11 11
12class OpieMail : public MainWindow 12class OpieMail : public MainWindow
13{ 13{
14 Q_OBJECT 14 Q_OBJECT
15 15
16public: 16public:
17 OpieMail( QWidget *parent = 0, const char *name = 0 ); 17 OpieMail( QWidget *parent = 0, const char *name = 0 );
18 virtual ~OpieMail(); 18 virtual ~OpieMail();
19 static QString appName() { return QString::fromLatin1("kopiemail"); } 19 static QString appName() { return QString::fromLatin1("kopiemail"); }
20 20
21public slots: 21public slots:
22 virtual void slotwriteMail(const QString&name,const QString&email); 22 virtual void slotwriteMail(const QString&name,const QString&email);
23 virtual void slotwriteMail2(const QString&nameemail); 23 virtual void slotwriteMail2(const QString&nameemail);
24 virtual void slotComposeMail(); 24 virtual void slotComposeMail();
25 virtual void slotExtAppHandler(); 25 virtual void slotExtAppHandler();
26 virtual void appMessage(const QCString &msg, const QByteArray &data); 26 virtual void appMessage(const QCString &msg, const QByteArray &data);
27 virtual void message(const QCString &msg, const QByteArray &data); 27 virtual void message(const QCString &msg, const QByteArray &data);
28protected slots: 28protected slots:
29 virtual void deleteAndDisplayNextMail(ViewMail * vm);
29 virtual void displayNextMail(ViewMail * vm); 30 virtual void displayNextMail(ViewMail * vm);
30 virtual void slotSendQueued(); 31 virtual void slotSendQueued();
31 virtual void slotSearchMails(); 32 virtual void slotSearchMails();
32 virtual void slotEditSettings(); 33 virtual void slotEditSettings();
33 virtual void slotEditAccounts(); 34 virtual void slotEditAccounts();
34 virtual void displayMail(); 35 virtual void displayMail();
35 virtual void replyMail(); 36 virtual void replyMail();
36 virtual void slotDeleteMail(); 37 virtual void slotDeleteMail();
37 virtual void slotGetMail(); 38 virtual void slotGetMail();
38 virtual void slotGetAllMail(); 39 virtual void slotGetAllMail();
39 virtual void slotDeleteAllMail(); 40 virtual void slotDeleteAllMail();
40 virtual void mailHold(int, QListViewItem *,const QPoint&,int); 41 virtual void mailHold(int, QListViewItem *,const QPoint&,int);
41 virtual void slotShowFolders( bool show ); 42 virtual void slotShowFolders( bool show );
42 virtual void refreshMailView(const QValueList<RecMailP>&); 43 virtual void refreshMailView(const QValueList<RecMailP>&);
43 virtual void mailLeftClicked( QListViewItem * ); 44 virtual void mailLeftClicked( QListViewItem * );
44 virtual void slotMoveCopyMail(); 45 virtual void slotMoveCopyMail();
45 virtual void slotMoveCopyAllMail(); 46 virtual void slotMoveCopyAllMail();
46 virtual void reEditMail(); 47 virtual void reEditMail();
47 void clearSelection(); 48 void clearSelection();
48 49
49private: 50private:
51 void closeViewMail(ViewMail * vm);
50 QString mPendingEmail; 52 QString mPendingEmail;
51 QString mPendingName; 53 QString mPendingName;
52 QByteArray mPendingData; 54 QByteArray mPendingData;
53 QCString mPendingMessage; 55 QCString mPendingMessage;
54 Settings *settings; 56 Settings *settings;
55 57
56}; 58};
57 59
58#endif 60#endif
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index 60c764c..6d88cad 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -485,49 +485,50 @@ void ViewMail::slotForward()
485 ftext += QString("From: %1\n") 485 ftext += QString("From: %1\n")
486 .arg( m_mail[0] ); 486 .arg( m_mail[0] );
487 if (!m_mail[1].isNull()) 487 if (!m_mail[1].isNull())
488 ftext += QString("Subject: %1\n") 488 ftext += QString("Subject: %1\n")
489 .arg( m_mail[1] ); 489 .arg( m_mail[1] );
490 490
491 ftext += QString("\n%1\n") 491 ftext += QString("\n%1\n")
492 .arg( m_mail[2]); 492 .arg( m_mail[2]);
493 493
494 ftext += QString("----- End forwarded message -----\n"); 494 ftext += QString("----- End forwarded message -----\n");
495 495
496 Settings *settings = new Settings(); 496 Settings *settings = new Settings();
497 ComposeMail composer( settings ,this, 0, true); 497 ComposeMail composer( settings ,this, 0, true);
498 composer.setSubject( "Fwd: " + m_mail[1] ); 498 composer.setSubject( "Fwd: " + m_mail[1] );
499 composer.setMessage( ftext ); 499 composer.setMessage( ftext );
500 if ( QDialog::Accepted == KApplication::execDialog( &composer )) 500 if ( QDialog::Accepted == KApplication::execDialog( &composer ))
501 { 501 {
502 } 502 }
503} 503}
504 504
505void ViewMail::slotDeleteMail( ) 505void ViewMail::slotDeleteMail( )
506{ 506{
507 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) 507 if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + m_mail[0] + " - " + m_mail[1] ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes )
508 { 508 {
509 m_recMail->Wrapper()->deleteMail( m_recMail ); 509 emit deleteAndDisplayNextMail( this);
510 hide(); 510 //m_recMail->Wrapper()->deleteMail( m_recMail );
511 //hide();
511 deleted = true; 512 deleted = true;
512 } 513 }
513} 514}
514 515
515MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, WFlags f) 516MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, WFlags f)
516 : QDialog(parent,name,modal) 517 : QDialog(parent,name,modal)
517{ 518{
518 QVBoxLayout*dlglayout = new QVBoxLayout(this); 519 QVBoxLayout*dlglayout = new QVBoxLayout(this);
519 dlglayout->setSpacing(2); 520 dlglayout->setSpacing(2);
520 dlglayout->setMargin(1); 521 dlglayout->setMargin(1);
521 //m_imageview = new Opie::MM::OImageScrollView(this); 522 //m_imageview = new Opie::MM::OImageScrollView(this);
522 //dlglayout->addWidget(m_imageview); 523 //dlglayout->addWidget(m_imageview);
523} 524}
524 525
525MailImageDlg::~MailImageDlg() 526MailImageDlg::~MailImageDlg()
526{ 527{
527} 528}
528 529
529void MailImageDlg::setName(const QString&fname) 530void MailImageDlg::setName(const QString&fname)
530{ 531{
531 qDebug("viewmail.cpp: MailImageDlg::setName Pending"); 532 qDebug("viewmail.cpp: MailImageDlg::setName Pending");
532 // m_imageview->setImage(fname); 533 // m_imageview->setImage(fname);
533} 534}
diff --git a/kmicromail/viewmail.h b/kmicromail/viewmail.h
index c2c2ce3..d85b8b2 100644
--- a/kmicromail/viewmail.h
+++ b/kmicromail/viewmail.h
@@ -23,48 +23,49 @@ public:
23 int Partnumber() { return _partNum; } 23 int Partnumber() { return _partNum; }
24 bool isParentof(const QValueList<int>&path); 24 bool isParentof(const QValueList<int>&path);
25 25
26private: 26private:
27 int _partNum; 27 int _partNum;
28 /* needed for a better display of attachments */ 28 /* needed for a better display of attachments */
29 QValueList<int> _path; 29 QValueList<int> _path;
30}; 30};
31 31
32class ViewMail : public ViewMailBase 32class ViewMail : public ViewMailBase
33{ 33{
34 Q_OBJECT 34 Q_OBJECT
35 35
36public: 36public:
37 ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = 0); 37 ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
38 ~ViewMail(); 38 ~ViewMail();
39 39
40 void hide(); 40 void hide();
41 void exec(); 41 void exec();
42 void setMail(const RecMailP&mail ); 42 void setMail(const RecMailP&mail );
43 void setBody(const RecBodyP&body); 43 void setBody(const RecBodyP&body);
44 bool deleted; 44 bool deleted;
45 signals: 45 signals:
46 void showNextMail(ViewMail*); 46 void showNextMail(ViewMail*);
47 void deleteAndDisplayNextMail(ViewMail *);
47protected: 48protected:
48 QString deHtml(const QString &string); 49 QString deHtml(const QString &string);
49 AttachItem* searchParent(const QValueList<int>&path); 50 AttachItem* searchParent(const QValueList<int>&path);
50 AttachItem* lastChild(AttachItem*parent); 51 AttachItem* lastChild(AttachItem*parent);
51 52
52protected slots: 53protected slots:
53 void slotNextMail() { emit showNextMail(this); }; 54 void slotNextMail() { emit showNextMail(this); };
54 void slotReply(); 55 void slotReply();
55 void slotForward(); 56 void slotForward();
56 void setText(); 57 void setText();
57 void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); 58 void slotItemClicked( QListViewItem * item , const QPoint & point, int c );
58 void slotDeleteMail( ); 59 void slotDeleteMail( );
59 void slotShowHtml( bool ); 60 void slotShowHtml( bool );
60 61
61private: 62private:
62 void readConfig(); 63 void readConfig();
63 64
64 bool _inLoop; 65 bool _inLoop;
65 QString m_mailHtml; 66 QString m_mailHtml;
66 bool m_gotBody; 67 bool m_gotBody;
67 RecBodyP m_body; 68 RecBodyP m_body;
68 RecMailP m_recMail; 69 RecMailP m_recMail;
69 bool m_showHtml; 70 bool m_showHtml;
70 71
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 15c5dd9..a46cd87 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2452,63 +2452,65 @@ void CalendarView::moveIncidence(Incidence * inc )
2452 mDatePicker->setDate( da ); 2452 mDatePicker->setDate( da );
2453} 2453}
2454void CalendarView::showDatePicker( ) 2454void CalendarView::showDatePicker( )
2455{ 2455{
2456 //qDebug("CalendarView::showDatePicker( ) "); 2456 //qDebug("CalendarView::showDatePicker( ) ");
2457 if ( mDateFrame->isVisible() ) 2457 if ( mDateFrame->isVisible() )
2458 mDateFrame->hide(); 2458 mDateFrame->hide();
2459 else { 2459 else {
2460 int w =mDatePicker->sizeHint().width() ; 2460 int w =mDatePicker->sizeHint().width() ;
2461 int h = mDatePicker->sizeHint().height() ; 2461 int h = mDatePicker->sizeHint().height() ;
2462 int dw = QApplication::desktop()->width(); 2462 int dw = QApplication::desktop()->width();
2463 int dh = QApplication::desktop()->height(); 2463 int dh = QApplication::desktop()->height();
2464 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2464 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2465 mDateFrame->show(); 2465 mDateFrame->show();
2466 } 2466 }
2467 mDatePickerMode = 1; 2467 mDatePickerMode = 1;
2468 mDatePicker->setDate( mNavigator->selectedDates().first() ); 2468 mDatePicker->setDate( mNavigator->selectedDates().first() );
2469} 2469}
2470 2470
2471void CalendarView::showEventEditor() 2471void CalendarView::showEventEditor()
2472{ 2472{
2473#ifdef DESKTOP_VERSION 2473#ifdef DESKTOP_VERSION
2474 mEventEditor->show(); 2474 mEventEditor->show();
2475#else 2475#else
2476 if ( mEventEditor->width() != QApplication::desktop()->width() ) { 2476 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) {
2477 qDebug("CalendarView: recreate mEventEditor "); 2477 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
2478 qDebug("CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() );
2478 delete mEventEditor; 2479 delete mEventEditor;
2479 mEventEditor = mDialogManager->getEventEditor(); 2480 mEventEditor = mDialogManager->getEventEditor();
2480 } 2481 }
2481 mEventEditor->showMaximized(); 2482 mEventEditor->showMaximized();
2482#endif 2483#endif
2483} 2484}
2484void CalendarView::showTodoEditor() 2485void CalendarView::showTodoEditor()
2485{ 2486{
2486#ifdef DESKTOP_VERSION 2487#ifdef DESKTOP_VERSION
2487 mTodoEditor->show(); 2488 mTodoEditor->show();
2488#else 2489#else
2489 if ( mTodoEditor->width() != QApplication::desktop()->width() ) { 2490 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) {
2490 qDebug("CalendarView: recreate mTodoEditor "); 2491 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
2492 qDebug("CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() );
2491 delete mTodoEditor; 2493 delete mTodoEditor;
2492 mTodoEditor = mDialogManager->getTodoEditor(); 2494 mTodoEditor = mDialogManager->getTodoEditor();
2493 } 2495 }
2494 mTodoEditor->showMaximized(); 2496 mTodoEditor->showMaximized();
2495#endif 2497#endif
2496} 2498}
2497 2499
2498void CalendarView::cloneIncidence() 2500void CalendarView::cloneIncidence()
2499{ 2501{
2500 Incidence *incidence = currentSelection(); 2502 Incidence *incidence = currentSelection();
2501 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2503 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2502 if ( incidence ) { 2504 if ( incidence ) {
2503 cloneIncidence(incidence); 2505 cloneIncidence(incidence);
2504 } 2506 }
2505} 2507}
2506void CalendarView::moveIncidence() 2508void CalendarView::moveIncidence()
2507{ 2509{
2508 Incidence *incidence = currentSelection(); 2510 Incidence *incidence = currentSelection();
2509 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2511 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2510 if ( incidence ) { 2512 if ( incidence ) {
2511 moveIncidence(incidence); 2513 moveIncidence(incidence);
2512 } 2514 }
2513} 2515}
2514void CalendarView::beamIncidence() 2516void CalendarView::beamIncidence()
@@ -2521,61 +2523,61 @@ void CalendarView::beamIncidence()
2521} 2523}
2522void CalendarView::toggleCancelIncidence() 2524void CalendarView::toggleCancelIncidence()
2523{ 2525{
2524 Incidence *incidence = currentSelection(); 2526 Incidence *incidence = currentSelection();
2525 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 2527 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
2526 if ( incidence ) { 2528 if ( incidence ) {
2527 cancelIncidence(incidence); 2529 cancelIncidence(incidence);
2528 } 2530 }
2529} 2531}
2530 2532
2531 2533
2532void CalendarView::cancelIncidence(Incidence * inc ) 2534void CalendarView::cancelIncidence(Incidence * inc )
2533{ 2535{
2534 inc->setCancelled( ! inc->cancelled() ); 2536 inc->setCancelled( ! inc->cancelled() );
2535 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); 2537 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED );
2536 updateView(); 2538 updateView();
2537} 2539}
2538void CalendarView::cloneIncidence(Incidence * orgInc ) 2540void CalendarView::cloneIncidence(Incidence * orgInc )
2539{ 2541{
2540 Incidence * newInc = orgInc->clone(); 2542 Incidence * newInc = orgInc->clone();
2541 newInc->recreate(); 2543 newInc->recreate();
2542 2544
2543 if ( newInc->type() == "Todo" ) { 2545 if ( newInc->type() == "Todo" ) {
2544 Todo* t = (Todo*) newInc; 2546 Todo* t = (Todo*) newInc;
2545 mTodoEditor->editTodo( t );
2546 showTodoEditor(); 2547 showTodoEditor();
2548 mTodoEditor->editTodo( t );
2547 if ( mTodoEditor->exec() ) { 2549 if ( mTodoEditor->exec() ) {
2548 mCalendar->addTodo( t ); 2550 mCalendar->addTodo( t );
2549 updateView(); 2551 updateView();
2550 } else { 2552 } else {
2551 delete t; 2553 delete t;
2552 } 2554 }
2553 } 2555 }
2554 else { 2556 else {
2555 Event* e = (Event*) newInc; 2557 Event* e = (Event*) newInc;
2556 mEventEditor->editEvent( e );
2557 showEventEditor(); 2558 showEventEditor();
2559 mEventEditor->editEvent( e );
2558 if ( mEventEditor->exec() ) { 2560 if ( mEventEditor->exec() ) {
2559 mCalendar->addEvent( e ); 2561 mCalendar->addEvent( e );
2560 updateView(); 2562 updateView();
2561 } else { 2563 } else {
2562 delete e; 2564 delete e;
2563 } 2565 }
2564 } 2566 }
2565} 2567}
2566 2568
2567void CalendarView::newEvent() 2569void CalendarView::newEvent()
2568{ 2570{
2569 // TODO: Replace this code by a common eventDurationHint of KOBaseView. 2571 // TODO: Replace this code by a common eventDurationHint of KOBaseView.
2570 KOAgendaView *aView = mViewManager->agendaView(); 2572 KOAgendaView *aView = mViewManager->agendaView();
2571 if (aView) { 2573 if (aView) {
2572 if (aView->selectionStart().isValid()) { 2574 if (aView->selectionStart().isValid()) {
2573 if (aView->selectedIsAllDay()) { 2575 if (aView->selectedIsAllDay()) {
2574 newEvent(aView->selectionStart(),aView->selectionEnd(),true); 2576 newEvent(aView->selectionStart(),aView->selectionEnd(),true);
2575 } else { 2577 } else {
2576 newEvent(aView->selectionStart(),aView->selectionEnd()); 2578 newEvent(aView->selectionStart(),aView->selectionEnd());
2577 } 2579 }
2578 return; 2580 return;
2579 } 2581 }
2580 } 2582 }
2581 2583
@@ -2585,149 +2587,149 @@ void CalendarView::newEvent()
2585 int hour = current.time().hour() +1; 2587 int hour = current.time().hour() +1;
2586 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), 2588 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ),
2587 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 2589 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
2588 } else 2590 } else
2589 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), 2591 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ),
2590 QDateTime( date, QTime( KOPrefs::instance()->mStartTime + 2592 QDateTime( date, QTime( KOPrefs::instance()->mStartTime +
2591 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 2593 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
2592} 2594}
2593 2595
2594void CalendarView::newEvent(QDateTime fh) 2596void CalendarView::newEvent(QDateTime fh)
2595{ 2597{
2596 newEvent(fh, 2598 newEvent(fh,
2597 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); 2599 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration)));
2598} 2600}
2599 2601
2600void CalendarView::newEvent(QDate dt) 2602void CalendarView::newEvent(QDate dt)
2601{ 2603{
2602 newEvent(QDateTime(dt, QTime(0,0,0)), 2604 newEvent(QDateTime(dt, QTime(0,0,0)),
2603 QDateTime(dt, QTime(0,0,0)), true); 2605 QDateTime(dt, QTime(0,0,0)), true);
2604} 2606}
2605 2607
2606void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) 2608void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay)
2607{ 2609{
2608 2610
2611 showEventEditor();
2609 mEventEditor->newEvent(fromHint,toHint,allDay); 2612 mEventEditor->newEvent(fromHint,toHint,allDay);
2610 if ( mFilterView->filtersEnabled() ) { 2613 if ( mFilterView->filtersEnabled() ) {
2611 CalFilter *filter = mFilterView->selectedFilter(); 2614 CalFilter *filter = mFilterView->selectedFilter();
2612 if (filter && filter->showCategories()) { 2615 if (filter && filter->showCategories()) {
2613 mEventEditor->setCategories(filter->categoryList().join(",") ); 2616 mEventEditor->setCategories(filter->categoryList().join(",") );
2614 } 2617 }
2615 if ( filter ) 2618 if ( filter )
2616 mEventEditor->setSecrecy( filter->getSecrecy() ); 2619 mEventEditor->setSecrecy( filter->getSecrecy() );
2617 } 2620 }
2618 showEventEditor();
2619} 2621}
2620void CalendarView::todoAdded(Todo * t) 2622void CalendarView::todoAdded(Todo * t)
2621{ 2623{
2622 2624
2623 changeTodoDisplay ( t ,KOGlobals::EVENTADDED); 2625 changeTodoDisplay ( t ,KOGlobals::EVENTADDED);
2624 updateTodoViews(); 2626 updateTodoViews();
2625} 2627}
2626void CalendarView::todoChanged(Todo * t) 2628void CalendarView::todoChanged(Todo * t)
2627{ 2629{
2628 emit todoModified( t, 4 ); 2630 emit todoModified( t, 4 );
2629 // updateTodoViews(); 2631 // updateTodoViews();
2630} 2632}
2631void CalendarView::todoToBeDeleted(Todo *) 2633void CalendarView::todoToBeDeleted(Todo *)
2632{ 2634{
2633 //qDebug("todoToBeDeleted(Todo *) "); 2635 //qDebug("todoToBeDeleted(Todo *) ");
2634 updateTodoViews(); 2636 updateTodoViews();
2635} 2637}
2636void CalendarView::todoDeleted() 2638void CalendarView::todoDeleted()
2637{ 2639{
2638 //qDebug(" todoDeleted()"); 2640 //qDebug(" todoDeleted()");
2639 updateTodoViews(); 2641 updateTodoViews();
2640} 2642}
2641 2643
2642 2644
2643 2645
2644void CalendarView::newTodo() 2646void CalendarView::newTodo()
2645{ 2647{
2646 2648
2649 showTodoEditor();
2647 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true); 2650 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true);
2648 if ( mFilterView->filtersEnabled() ) { 2651 if ( mFilterView->filtersEnabled() ) {
2649 CalFilter *filter = mFilterView->selectedFilter(); 2652 CalFilter *filter = mFilterView->selectedFilter();
2650 if (filter && filter->showCategories()) { 2653 if (filter && filter->showCategories()) {
2651 mTodoEditor->setCategories(filter->categoryList().join(",") ); 2654 mTodoEditor->setCategories(filter->categoryList().join(",") );
2652 } 2655 }
2653 if ( filter ) 2656 if ( filter )
2654 mTodoEditor->setSecrecy( filter->getSecrecy() ); 2657 mTodoEditor->setSecrecy( filter->getSecrecy() );
2655 } 2658 }
2656 showTodoEditor();
2657} 2659}
2658 2660
2659void CalendarView::newSubTodo() 2661void CalendarView::newSubTodo()
2660{ 2662{
2661 Todo *todo = selectedTodo(); 2663 Todo *todo = selectedTodo();
2662 if ( todo ) newSubTodo( todo ); 2664 if ( todo ) newSubTodo( todo );
2663} 2665}
2664 2666
2665void CalendarView::newSubTodo(Todo *parentEvent) 2667void CalendarView::newSubTodo(Todo *parentEvent)
2666{ 2668{
2667 2669
2668 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true);
2669 showTodoEditor(); 2670 showTodoEditor();
2671 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true);
2670} 2672}
2671 2673
2672void CalendarView::newFloatingEvent() 2674void CalendarView::newFloatingEvent()
2673{ 2675{
2674 DateList tmpList = mNavigator->selectedDates(); 2676 DateList tmpList = mNavigator->selectedDates();
2675 QDate date = tmpList.first(); 2677 QDate date = tmpList.first();
2676 2678
2677 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), 2679 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ),
2678 QDateTime( date, QTime( 12, 0, 0 ) ), true ); 2680 QDateTime( date, QTime( 12, 0, 0 ) ), true );
2679} 2681}
2680 2682
2681 2683
2682void CalendarView::editEvent( Event *event ) 2684void CalendarView::editEvent( Event *event )
2683{ 2685{
2684 2686
2685 if ( !event ) return; 2687 if ( !event ) return;
2686 if ( event->isReadOnly() ) { 2688 if ( event->isReadOnly() ) {
2687 showEvent( event ); 2689 showEvent( event );
2688 return; 2690 return;
2689 } 2691 }
2690 mEventEditor->editEvent( event , mFlagEditDescription);
2691 showEventEditor(); 2692 showEventEditor();
2693 mEventEditor->editEvent( event , mFlagEditDescription);
2692} 2694}
2693void CalendarView::editJournal( Journal *jour ) 2695void CalendarView::editJournal( Journal *jour )
2694{ 2696{
2695 if ( !jour ) return; 2697 if ( !jour ) return;
2696 mDialogManager->hideSearchDialog(); 2698 mDialogManager->hideSearchDialog();
2697 mViewManager->showJournalView(); 2699 mViewManager->showJournalView();
2698 mNavigator->slotDaySelect( jour->dtStart().date() ); 2700 mNavigator->slotDaySelect( jour->dtStart().date() );
2699} 2701}
2700void CalendarView::editTodo( Todo *todo ) 2702void CalendarView::editTodo( Todo *todo )
2701{ 2703{
2702 if ( !todo ) return; 2704 if ( !todo ) return;
2703 2705
2704 if ( todo->isReadOnly() ) { 2706 if ( todo->isReadOnly() ) {
2705 showTodo( todo ); 2707 showTodo( todo );
2706 return; 2708 return;
2707 } 2709 }
2708 mTodoEditor->editTodo( todo ,mFlagEditDescription);
2709 showTodoEditor(); 2710 showTodoEditor();
2711 mTodoEditor->editTodo( todo ,mFlagEditDescription);
2710 2712
2711} 2713}
2712 2714
2713KOEventViewerDialog* CalendarView::getEventViewerDialog() 2715KOEventViewerDialog* CalendarView::getEventViewerDialog()
2714{ 2716{
2715 if ( !mEventViewerDialog ) { 2717 if ( !mEventViewerDialog ) {
2716 mEventViewerDialog = new KOEventViewerDialog(this); 2718 mEventViewerDialog = new KOEventViewerDialog(this);
2717 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); 2719 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) );
2718 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); 2720 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig()));
2719 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), 2721 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)),
2720 dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 2722 dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
2721 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), 2723 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ),
2722 viewManager(), SLOT( showAgendaView( bool ) ) ); 2724 viewManager(), SLOT( showAgendaView( bool ) ) );
2723 mEventViewerDialog->resize( 640, 480 ); 2725 mEventViewerDialog->resize( 640, 480 );
2724 2726
2725 } 2727 }
2726 return mEventViewerDialog; 2728 return mEventViewerDialog;
2727} 2729}
2728void CalendarView::showEvent(Event *event) 2730void CalendarView::showEvent(Event *event)
2729{ 2731{
2730 getEventViewerDialog()->setEvent(event); 2732 getEventViewerDialog()->setEvent(event);
2731 getEventViewerDialog()->showMe(); 2733 getEventViewerDialog()->showMe();
2732} 2734}
2733 2735
diff --git a/qtcompat/qinputdialog.cpp b/qtcompat/qinputdialog.cpp
index 770b281..64c581e 100644
--- a/qtcompat/qinputdialog.cpp
+++ b/qtcompat/qinputdialog.cpp
@@ -14,48 +14,50 @@
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software 17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38//Edited Lutz Rogowski 2004-12-13
39
38#include "qinputdialog.h" 40#include "qinputdialog.h"
39 41
40#include <qlayout.h> 42#include <qlayout.h>
41#include <qlabel.h> 43#include <qlabel.h>
42#include <qlineedit.h> 44#include <qlineedit.h>
43#include <qpushbutton.h> 45#include <qpushbutton.h>
44#include <qspinbox.h> 46#include <qspinbox.h>
45#include <qcombobox.h> 47#include <qcombobox.h>
46#include <qwidgetstack.h> 48#include <qwidgetstack.h>
47#include <qvalidator.h> 49#include <qvalidator.h>
48#include <qapplication.h> 50#include <qapplication.h>
49 51
50class QInputDialogPrivate 52class QInputDialogPrivate
51{ 53{
52public: 54public:
53 friend class QInputDialog; 55 friend class QInputDialog;
54 QLineEdit *lineEdit; 56 QLineEdit *lineEdit;
55 QSpinBox *spinBox; 57 QSpinBox *spinBox;
56 QComboBox *comboBox, *editComboBox; 58 QComboBox *comboBox, *editComboBox;
57 QPushButton *ok; 59 QPushButton *ok;
58 QWidgetStack *stack; 60 QWidgetStack *stack;
59 QInputDialog::Type type; 61 QInputDialog::Type type;
60}; 62};
61 63
@@ -432,48 +434,53 @@ double QInputDialog::getDouble( const QString &caption, const QString &label, do
432 QString res = QInputDialog::getItem( tr( "Please select an item" ), lst, 1, TRUE, &ok, this ); 434 QString res = QInputDialog::getItem( tr( "Please select an item" ), lst, 1, TRUE, &ok, this );
433 if ( ok ) 435 if ( ok )
434 ;// user selected an item and pressed ok 436 ;// user selected an item and pressed ok
435 else 437 else
436 ;// user pressed cancel 438 ;// user pressed cancel
437 \endcode 439 \endcode
438*/ 440*/
439 441
440QString QInputDialog::getItem( const QString &caption, const QString &label, const QStringList &list, 442QString QInputDialog::getItem( const QString &caption, const QString &label, const QStringList &list,
441 int current, bool editable, 443 int current, bool editable,
442 bool *ok, QWidget *parent, const char *name ) 444 bool *ok, QWidget *parent, const char *name )
443{ 445{
444 QInputDialog *dlg = new QInputDialog( label, parent, name, TRUE, editable ? EditableComboBox : ComboBox ); 446 QInputDialog *dlg = new QInputDialog( label, parent, name, TRUE, editable ? EditableComboBox : ComboBox );
445 dlg->setCaption( caption ); 447 dlg->setCaption( caption );
446 if ( editable ) { 448 if ( editable ) {
447 dlg->editableComboBox()->insertStringList( list ); 449 dlg->editableComboBox()->insertStringList( list );
448 dlg->editableComboBox()->setCurrentItem( current ); 450 dlg->editableComboBox()->setCurrentItem( current );
449 } else { 451 } else {
450 dlg->comboBox()->insertStringList( list ); 452 dlg->comboBox()->insertStringList( list );
451 dlg->comboBox()->setCurrentItem( current ); 453 dlg->comboBox()->setCurrentItem( current );
452 } 454 }
453 455
454 bool ok_ = FALSE; 456 bool ok_ = FALSE;
455 QString result; 457 QString result;
458 int fixWid = 320;
459 if ( QApplication::desktop()->width() <= 240 ) {
460 fixWid = 230;
461 }
462 dlg->setFixedWidth( fixWid);
456 ok_ = dlg->exec() == QDialog::Accepted; 463 ok_ = dlg->exec() == QDialog::Accepted;
457 if ( ok ) 464 if ( ok )
458 *ok = ok_; 465 *ok = ok_;
459 if ( editable ) 466 if ( editable )
460 result = dlg->editableComboBox()->currentText(); 467 result = dlg->editableComboBox()->currentText();
461 else 468 else
462 result = dlg->comboBox()->currentText(); 469 result = dlg->comboBox()->currentText();
463 470
464 delete dlg; 471 delete dlg;
465 return result; 472 return result;
466} 473}
467 474
468/*! 475/*!
469 \internal 476 \internal
470*/ 477*/
471 478
472void QInputDialog::textChanged( const QString &s ) 479void QInputDialog::textChanged( const QString &s )
473{ 480{
474 bool on; 481 bool on;
475 if ( d->lineEdit->validator() ) { 482 if ( d->lineEdit->validator() ) {
476 QString str = d->lineEdit->text(); 483 QString str = d->lineEdit->text();
477 int index = d->lineEdit->cursorPosition(); 484 int index = d->lineEdit->cursorPosition();
478 on = ( d->lineEdit->validator()->validate(str, index) == 485 on = ( d->lineEdit->validator()->validate(str, index) ==
479 QValidator::Acceptable ); 486 QValidator::Acceptable );