[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    [Patch] kmfolderdia
From:       Carsten Burghardt <cb () emedia-consult ! de>
Date:       2001-11-26 19:26:15
[Download RAW message or body]

Hi again,

some of the items of the new folder dialog are not relevant or not active for 
imap-folders. Therefore this patch deactivates them if the user selects a 
imap-folder (apart from the noContent() change...)
The only thing I inserted is the selection of the folder type (mbox,maildir) 
which is obviously not relevant. I don't know if the others (mailinglist, 
expire) are implemented for imap. Comments?

Thanks,

Carsten
-- 
Carsten Burghardt
PGP/GPG: http://www.emedia-consult.de/security.html

["patch_folderdia.diff" (text/x-diff)]

Index: kdenetwork/kmail/kmfolderdia.h
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmfolderdia.h,v
retrieving revision 1.17
diff -u -3 -p -r1.17 kmfolderdia.h
--- kdenetwork/kmail/kmfolderdia.h	2001/11/18 00:23:12	1.17
+++ kdenetwork/kmail/kmfolderdia.h	2001/11/26 19:19:14
@@ -30,6 +30,12 @@ protected slots:
   virtual void slotHoldsML( bool );
   virtual void slotExpireFolder( bool );
 
+	/*
+	* is called if the folder dropdown changes
+	* then we update the other items to reflect the capabilities
+	*/
+	void slotUpdateItems( int );
+
 protected:
   QComboBox *fileInFolder;
   QComboBox *mailboxType;
Index: kdenetwork/kmail/kmfolderdia.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmfolderdia.cpp,v
retrieving revision 1.51
diff -u -3 -p -r1.51 kmfolderdia.cpp
--- kdenetwork/kmail/kmfolderdia.cpp	2001/11/16 10:40:03	1.51
+++ kdenetwork/kmail/kmfolderdia.cpp	2001/11/26 19:19:29
@@ -94,13 +94,16 @@ KMFolderDialog::KMFolderDialog(KMFolder*
   int i = 1;
   while (mFolders.at(i - 1) != mFolders.end()) {
     curFolder = *mFolders.at(i - 1);
-    if (curFolder->isSystemFolder() && curFolder->protocol() != "imap") {
+    if ( (curFolder->isSystemFolder() && curFolder->protocol() != "imap") 
+		|| curFolder->noContent() ) {
       mFolders.remove(mFolders.at(i-1));
       str.remove(str.at(i));
     } else
       ++i;
   }
   fileInFolder->insertStringList( str );
+	// we want to know if the activated changes
+	connect( fileInFolder, SIGNAL(activated(int)), SLOT(slotUpdateItems(int)) );
 
   for( i = 1; mFolders.at(i - 1) != mFolders.end(); ++i ) {
     curFolder = *mFolders.at(i - 1);
@@ -299,6 +302,22 @@ KMFolderDialog::KMFolderDialog(KMFolder*
   kdDebug(5006)<<"Exiting KMFolderDialog::KMFolderDialog()\n";
 }
 
+
+//-----------------------------------------------------------------------------
+void KMFolderDialog::slotUpdateItems ( int current )
+{
+	KMFolder* selectedFolder = NULL;
+	// first check if the index is valid (the top level has no entrance in the mFolders)
+	if (current > 0) selectedFolder = *mFolders.at(current - 1);
+	if (selectedFolder && selectedFolder->protocol() == "imap")
+	{
+		// deactivate stuff that is not available for imap
+		mailboxType->setEnabled( false );
+	} else {
+		// activate it in has it was disabled
+		mailboxType->setEnabled( true );
+	}
+}
 
 //-----------------------------------------------------------------------------
 void KMFolderDialog::slotOk()

_______________________________________________
kmail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic