Bug 32305

Summary: Don't close composer after saving message in drafts folder
Product: [Unmaintained] kmail Reporter: Harshad Rj <harshad_rj>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED DUPLICATE    
Severity: wishlist CC: esigra, kde_bugs
Priority: NOR    
Version: 1.3   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Other   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Harshad Rj 2001-09-10 05:39:02 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kmail
Version:           1.3 (using KDE 2.2.0 )
Severity:          wishlist
Installed from:    Compiled From Sources
Compiler:          Not Specified
OS:                Not Specified
OS/Compiler notes: Not Specified

When composing a shortcut like Ctrl+S to save in drafts will be blissfull.
Also after saving in drafts is successful the composing can continue (currently the compose window is closed)


(Submitted via bugs.kde.org)
Comment 1 Ingo Kl 2001-09-11 19:29:07 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Montag 10. September 2001 07:39 harshad_rj@hotmail.com wrote:
> When composing a shortcut like Ctrl+S to save in drafts will be
> blissfull. Also after saving in drafts is successful the composing
> can continue (currently the compose window is closed)

1. You can assign your own shortcuts (in the composer and in the main=20
window) via Settings->Assign keys (or whatever it's labeled in the=20
english version). So simply assign Ctrl+S to "Save in drafts".

2. The purpose of saving a message in the drafts folder is to be able=20
to continue editting it at a later time. I don't think it makes sense=20
to save the message if you intend to continue composing it.

Regards
Ingo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7nmYDGnR+RTDgudgRAiT5AKDITDGMIyeeM3oQ4k6fvFn95zjDlwCg0OPy
+sh7dWJhDa9KCOY1M5UOrHY=3D
=3D5T9Z
-----END PGP SIGNATURE-----
Comment 2 esigra 2001-10-21 21:38:07 UTC
--------------Boundary-00=_J3SKP0DG9RH4QZB1BJUB
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

Here is a patch that should be enough to close the bug:
diff -uXi kmail-orig/configuredialog.cpp kmail/configuredialog.cpp
--- kmail-orig/configuredialog.cpp      Sun Oct 21 22:44:13 2001
+++ kmail/configuredialog.cpp   Sun Oct 21 22:30:33 2001
@@ -18926 +18929 @@
     state = config->readBoolEntry( "pgp-auto-sign" false );
     mComposer.pgpAutoSignatureCheck->setChecked(state);

+    state = config->readBoolEntry( "close-after-save" false );
+    mComposer.closeAfterSave->setChecked(state);
+
     state = config->readBoolEntry( "word-wrap" true );
     mComposer.wordWrapCheck->setChecked( state );

@@ -24116 +24147 @@
       config->writeEntry("smart-quote" 
mComposer.smartQuoteCheck->isChecked() );
       config->writeEntry("pgp-auto-sign"
                         mComposer.pgpAutoSignatureCheck->isChecked() );
+      config->writeEntry("close-after-save" 
mComposer.closeAfterSave->isChecked() );
       config->writeEntry("word-wrap" mComposer.wordWrapCheck->isChecked() );
       config->writeEntry("break-at" mComposer.wrapColumnSpin->value() );
       // charset settings
diff -uXi kmail-orig/configuredialog.h kmail/configuredialog.h
--- kmail-orig/configuredialog.h        Sun Oct 21 22:44:13 2001
+++ kmail/configuredialog.h     Sun Oct 21 22:31:00 2001
@@ -3656 +3657 @@
       QCheckBox    *autoAppSignFileCheck;
       QCheckBox    *smartQuoteCheck;
       QCheckBox    *pgpAutoSignatureCheck;
+      QCheckBox    *closeAfterSave;
       QCheckBox    *wordWrapCheck;
       KIntNumInput *wrapColumnSpin;
       QCheckBox   *externalEditorCheck;
diff -uXi kmail-orig/kmcomposewin.cpp kmail/kmcomposewin.cpp
--- kmail-orig/kmcomposewin.cpp Sun Oct 21 22:44:13 2001
+++ kmail/kmcomposewin.cpp      Sun Oct 21 23:28:21 2001
@@ -7447 +7447 @@
                         actionCollection() "send_alternative");
   }

-  (void) new KAction (i18n("Save in &drafts folder") 0
+  (void) new KAction (i18n("Save in &drafts folder") CTRL+Key_S
                      this SLOT(slotSaveDraft())
                      actionCollection() "save_in_drafts");
   (void) new KAction (i18n("&Insert File...") "fileopen" 0
@@ -21229 +212213 @@
     KMRecentAddresses::self()->add( cc() );
     KMRecentAddresses::self()->add( to() );

-    mAutoDeleteMsg = FALSE;
-    mFolder = NULL;
-    close();
+    kapp->config()->setGroup("Composer");
+    if (kapp->config()->readBoolEntry("close-after-save" false))
+    {
+      mAutoDeleteMsg = FALSE;
+      mFolder = NULL;
+      close();
+    }
   }

   // Warning this is an ugly hack but it covers all the changes needed
--------------Boundary-00=_J3SKP0DG9RH4QZB1BJUB
Content-Type: application/x-bzip2;
  name="closeAfterSave.diff.bz2"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="closeAfterSave.diff.bz2"

QlpoOTFBWSZTWXaFb1IAAo7/gHgwAgBRf//7f6++wL/v/+pQBBj1VEaaCigN
KgPUA0aNNA0NGIAAADTTEYjA4yZNGIYmmAgYE0wRgmJppoAMIJEhE9EphpGz
Um00j0TTamg0GgGhoDQbUOMmTRiGJpgIGBNMEYJiaaaADCCSJGgCmZAhPJgC
aKZMmmmhk8UbRDxTS1AigfbpbZtLXwjelp7kEMTbeKcIjJAa3bgoo3W5zpOD
49ds0kGQBpJB2Iw2RttTE9pg4QptUpSAzXtj/KOqa2+psYNx/OPws5MyMSjU
bg25KRML6HkWqNlao7Sj/k5hFJx6D+8dckyomUxrsInm6228ND4XFeBrFvqu
x+8sWZN4lzYF23FigO1e7QnYZmTDcmL1sU8WIC8/KmIUxNJgJSkPGYdX7CUl
SJbEDGEqIJEOUm+UbT40LKJqEfKzF47hwg2RwPcb/f72YgVBqEyrRQdBtLmx
qRyD5Zokp0NAsM63y5YHAVoXF422wgXEW899G22xjyzOjcFIWpihLLuwUWmW
XP4FW3U3eKrFZbcSFEp2IorXJUpStHBqLFJcxjVRhWtSrUzoInTzSlrLSVGd
LOs2aAiGt/k7QvSwiR6xDo1I+Z3rWVrX5m1bQrFTCIzMy2eIqMQMXkThUBWU
cTaDswVqeJQ37YJVv+Jr+vQfYt7igtKSyZxVfJgkNjYeMDICyRkUSrjkCcac
E68UBdo8yt3QZkANipjKMSYBST1/AD5rN95LKEuJ5QqVfOKsHPtrOtMDZ6/B
rhj0dJHhliu8ptDKULdMy7wITAaRcVWWDZ2Zhepc5MGu5BYU8gMDnXo8xovO
7hpcLPwiic1BIhXxChzDSPJBJnR6yZJEpPqStiBh/0qOTaSigIWJgGRY/gxS
MiI1KYOr2Zt6iepQUwg1wOkOlMqSWIjtAYT5nFeiDgaAoxF/Ykhj0X0WUCtc
HV4jILAcQgBcC+A9pd9QbViwAS6TrB7EWy4hWMkXYXSmBcA6cwKbGA5AbUEk
gwEwG7CJGjlvvb6GNyln4gVUwgxIWMagV12N9KoRExDtIYiCjYERBLO0fQiN
yQY0F4HBUB1HUa0LKFaTCDzCunUj2CrA1oTZFhooFKBcSuYkQQ+Dgbzr3nOh
VATnHfgvAKmXLcsR+KYlRkXIHZAFhMVEYjH2RDawEbubekOkRAw2Vl6CoZhd
xB0F+4puDZKH6lJ2UZ8/MT8eRMZs4rb4T5Nkt5IDOYbxRB2GJ0RJheWTmOzN
alTJaBS9qClVRWNc1c3xc2C+/cXYFnA367FuR1OXsBPzq5LQaDRjHehEwo3Y
0D6Mg3/i7kinChIO0K3qQA==

--------------Boundary-00=_J3SKP0DG9RH4QZB1BJUB--
Comment 3 esigra 2001-10-21 22:04:47 UTC
--------------Boundary-00=_ZBTKI7HJPA1Q0IDHB3YK
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

Sorry for that stupid patch I just sent. DON'T LOOK AT IT. Here is the patch 
that should REALLY fix the issue (bzipped and attached):

diff -uXi kmail-orig/configuredialog.cpp kmail/configuredialog.cpp
--- kmail-orig/configuredialog.cpp      Sun Oct 21 23:55:46 2001
+++ kmail/configuredialog.cpp   Sun Oct 21 22:30:33 2001
@@ -11256 +112510 @@
     new QCheckBox( i18n("Automatically &sign messages using PGP") page );
   topLevel->addWidget( mComposer.pgpAutoSignatureCheck );

+  mComposer.closeAfterSave =
+    new QCheckBox( i18n("Close composer after saving to &drafts folder") 
page );
+  topLevel->addWidget( mComposer.closeAfterSave );
+
   QHBoxLayout *hlay = new QHBoxLayout( topLevel );
   mComposer.wordWrapCheck =
     new QCheckBox( i18n("&Word wrap at column:") page );
@@ -18886 +18929 @@
     state = config->readBoolEntry( "pgp-auto-sign" false );
     mComposer.pgpAutoSignatureCheck->setChecked(state);

+    state = config->readBoolEntry( "close-after-save" false );
+    mComposer.closeAfterSave->setChecked(state);
+
     state = config->readBoolEntry( "word-wrap" true );
     mComposer.wordWrapCheck->setChecked( state );

@@ -24076 +24147 @@
       config->writeEntry("smart-quote" 
mComposer.smartQuoteCheck->isChecked() );
       config->writeEntry("pgp-auto-sign"
                         mComposer.pgpAutoSignatureCheck->isChecked() );
+      config->writeEntry("close-after-save" 
mComposer.closeAfterSave->isChecked() );
       config->writeEntry("word-wrap" mComposer.wordWrapCheck->isChecked() );
       config->writeEntry("break-at" mComposer.wrapColumnSpin->value() );
       // charset settings
diff -uXi kmail-orig/configuredialog.h kmail/configuredialog.h
--- kmail-orig/configuredialog.h        Sun Oct 21 23:55:46 2001
+++ kmail/configuredialog.h     Sun Oct 21 22:31:00 2001
@@ -3656 +3657 @@
       QCheckBox    *autoAppSignFileCheck;
       QCheckBox    *smartQuoteCheck;
       QCheckBox    *pgpAutoSignatureCheck;
+      QCheckBox    *closeAfterSave;
       QCheckBox    *wordWrapCheck;
       KIntNumInput *wrapColumnSpin;
       QCheckBox   *externalEditorCheck;
Only in kmail: kmail_meta_unload.cpp
diff -uXi kmail-orig/kmcomposewin.cpp kmail/kmcomposewin.cpp
--- kmail-orig/kmcomposewin.cpp Sun Oct 21 23:55:46 2001
+++ kmail/kmcomposewin.cpp      Sun Oct 21 23:40:08 2001
@@ -7447 +7447 @@
                         actionCollection() "send_alternative");
   }

-  (void) new KAction (i18n("Save in &drafts folder") 0
+  (void) new KAction (i18n("Save in &drafts folder") CTRL+Key_S
                      this SLOT(slotSaveDraft())
                      actionCollection() "save_in_drafts");
   (void) new KAction (i18n("&Insert File...") "fileopen" 0
@@ -21229 +212213 @@
     KMRecentAddresses::self()->add( cc() );
     KMRecentAddresses::self()->add( to() );

-    mAutoDeleteMsg = FALSE;
-    mFolder = NULL;
-    close();
+    kapp->config()->setGroup("Composer");
+    if (not saveInDrafts or 
kapp->config()->readBoolEntry("close-after-save" false))
+    {
+      mAutoDeleteMsg = FALSE;
+      mFolder = NULL;
+      close();
+    }
   }

   // Warning this is an ugly hack but it covers all the changes needed
--------------Boundary-00=_ZBTKI7HJPA1Q0IDHB3YK
Content-Type: application/x-bzip2;
  name="closeAfterSave.diff.bz2"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="closeAfterSave.diff.bz2"

QlpoOTFBWSZTWX8yMpAAAxD/gHgwAgBRf//7f+/+wL/v/+pQBNi81EU0aUUL
YEpFNGU/SJ+qeo8pkw1MgHlNqGgyaDCNHqPUPU0HGTJoxDTQwE0MTRpkxAyM
Jo00wgyYSJCRkKbKZPKe1NI9Tym9TUNABoGg9QyaAeocZMmjENNDATQxNGmT
EDIwmjTTCDJhJEmmpgINCU/RmphJqeynop6gNNMmhp6mQepppeBIoHR8mN41
u0pvW1qg4JEMTbdcoKMVJ78g3O/OLU4bswOc6UkS+P5qoIRvoGhCP8i3eG2w
mA8jBwhTYqUpCbbWfC2PqPxuhdFS6oZ1KFBQtFqHKSUmUYbwjErNKqSyTMEu
iNsUFItM1FGPGrNpX805nFXBZGn524GGTVlnsexPQsSyyU48I09XmzM2uxt7
Pl+uvLa+54MRs2LI8yuuajDQOUk9OLfMRPHYbXvXssq1AZOs6xWMbaY/EMMy
xXK8QOsL7Ii7POqQSnOwzESoPhIdabkoKLwucZDBCIiTHERKG1yjGn3kBwia
gXzqv9NxASeaEoT5vU/BsjmbJmELhNYhVmo0Gw4HmVIJRnmiSnQqFb21xFit
NRXQLMDbdIhhIDYXvRgo222232ecTheKYWeDc4CmF24dECgmlNHkLFI51Aoz
0EBPCBEnepRjEKIs8W6h053jrWrAnVI4W1VPsKwIj5M80bBqKky6yw2AbFqp
ghQ3P7Wd3hnEZQF5AUC1C+BtWswo1/w4wu4wxINphv1DG21d0oKtAMU5yQ9Y
Kwoj3GsIMwVqac8aayeb2ZcS7vWcPjrP5Mf6n3mdVFpWY6HF1eT3e5gdE593
wP8oI6zqGTuzdC4eQlE9AziLyg1pnXsWeGlvpangdD5CFsyLQiSTtEpXS9/t
A961/OOStB4H+wrUbrxQsRA/viGRMDLo3G6nNme8YY1MIXl0yXkFkjGGodds
mXkBCSDsFzVZYNq2uzCxqBMiYcNMAnJ70SHA5L1ehacBotu+2qUETWmchSpJ
QSIWKIRkmxzickNjhHiSBKJRvSunAzYl5lR6G2lNJCx07pgTJSe4Y2VDwGCE
h9yrScOv6ujtUjYoKQg3wWtGtDRYUVQjYAxTUn1y2YHYFSANIWZTLygkzL8l
8Z0xWBG1cjumWcRqFmXFEALxL1j1q/+gbhi0YYwJbz0g9qLo6QLmEo5HScS4
hwwY6kKWkHsdDkRohGYa5gOmkRkgiKxb5em21Mx6mTcpaeQSwKyAqzUUxBjG
oFGDE8b+oqiiORwf2MxN0EAlUGMuegQSVTYq+/dYVDc0GpI0INarDabV0nSx
J3QmC5JhB8gmVeV+G8XiK1I4CDrfOtH2FliRJLoYYnc6RQFeoXJ+RxXHuOsQ
VoKDlky6FUwIZkd/FM2haQYilmDkH/OBOTCoi+YfZENrhEZrdEk6Q3EDDv41
nzviMSbA2jixEidH9wHqoZTtfIeV+OOBGSSjo8RiNsxObTHFFTjnvJgZyeF4
pBBhjEiYkg/LTceGL6LUnmLRDKlrUFKKpwzq6uX4uuAvD5+4zZAwAoh9PB7V
2pbXC9kGVRfUoJGBgsK9BCFKKEiV9LGhBCBhSN/4u5IpwoSD+ZGUgA==

--------------Boundary-00=_ZBTKI7HJPA1Q0IDHB3YK--
Comment 4 Michael H 2001-10-22 11:07:14 UTC
On Monday 22 October 2001 00:04 Erik Sigra wrote:
> Sorry for that stupid patch I just sent. DON'T LOOK AT IT. Here is the
> patch that should REALLY fix the issue (bzipped and attached):

Ok besides one problem it looks good.
If I save a message in the drafts folder and keep the composer open then 
select this message in the folder select a different message and save again 
the current message in the drafts folder KMail crashes.

Regards
Michael Häckel
Comment 5 Anguo 2002-09-26 19:13:05 UTC
"When composing a shortcut like Ctrl+S to save in drafts will be blissfull.   
Also after saving in drafts is successful the composing can continue  
(currently the compose window is closed)" 
 
Actually, this point is not relevant because of bug 46540: when the composer 
window is open, the message doesn't exist in the draft folder. The only way to 
actually save the draft mail is when the composer window is closed.  
Once 46540 is solved, then we would be very close to have a solution to this 
bug.    
 
Anguo. 
 

*** This bug has been marked as a duplicate of 46540 ***
Comment 6 Stefan Monov 2006-02-25 18:08:11 UTC
Now that bug 46540 has been fixed, please fix this one.