- Remember the last selected folder.

- Sort the groups in kmail.kcfg alphabetically.

svn path=/trunk/kdepim/; revision=304735
wilder-work
Ingo Klcker 22 years ago
parent fcbc2b35d1
commit 791180f0e3
  1. 90
      kmail.kcfg
  2. 43
      kmfolderseldlg.cpp
  3. 5
      kmfolderseldlg.h

@ -1,50 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg>
<kcfgfile name="kmailrc"/>
<kcfgfile name="kmailrc"/>
<group name="Behaviour">
<entry name="DelayedMarkAsRead" type="Bool">
<entry name="DelayedMarkAsRead" type="Bool">
<label> </label>
<whatsthis> </whatsthis>
<default>true</default>
</entry>
<entry name="DelayedMarkTime" type="UInt">
</entry>
<entry name="DelayedMarkTime" type="UInt">
<label> </label>
<whatsthis> </whatsthis>
<default>0</default>
</entry>
<entry name="JumpToUnread" type="Bool">
</entry>
<entry name="JumpToUnread" type="Bool">
<label> </label>
<whatsthis> </whatsthis>
<default>false</default>
</entry>
<entry name="LoopOnGotoUnread" type="Enum">
</entry>
<entry name="LoopOnGotoUnread" type="Enum">
<label> </label>
<whatsthis> </whatsthis>
<choices>
<choice name="DontLoop"/>
<choice name="LoopInCurrentFolder"/>
<choice name="LoopInAllFolders"/>
<choice name="DontLoop"/>
<choice name="LoopInCurrentFolder"/>
<choice name="LoopInAllFolders"/>
</choices>
<default>DontLoop</default>
</entry>
<entry name="ShowPopupAfterDnD" type="Bool">
</entry>
<entry name="ShowPopupAfterDnD" type="Bool">
<label> </label>
<whatsthis> </whatsthis>
<default>true</default>
</entry>
<entry name="ExcludeImportantMailFromExpiry" type="Bool">
</entry>
<entry name="ExcludeImportantMailFromExpiry" type="Bool">
<label></label>
<whatsthis></whatsthis>
<default>true</default>
</entry>
</entry>
</group>
<group name="UserInterface">
<entry name="QuickSearchActive" type="Bool">
<label>Show quick search line edit</label>
<whatsthis>This option enabled or disables the search line edit above the message list which can be used to quickly search the information shown in the message list.</whatsthis>
<default>true</default>
<group name="FolderSelectionDialog">
<entry name="LastSelectedFolder" type="String">
<default>inbox</default>
<whatsthis>The most recently selected folder in the folder selection "
"dialog.</whatsthis>
</entry>
</group>
@ -54,15 +54,33 @@
</entry>
</group>
<group name="Groupware">
<entry name="GroupwareEnabled" type="Bool">
<label>Enable groupware functionality</label>
<whatsthis></whatsthis>
<default>true</default>
</entry>
<entry name="GroupwareLegacyMangleFromToHeaders" type="Bool">
<label>Legacy mode: Mangle From:/To: headers in replies to invitations</label>
<whatsthis>Microsoft Outlook has a number of shortcomings "
"in its implementation of the iCalendar standard; "
"this option works around one of them. If you have "
"problems with Outlook users not being able to "
"get your replies, try setting this option.</whatsthis>
<default>false</default>
</entry>
</group>
<group name="IMAP Resource">
<entry name="TheIMAPResourceEnabled" type="Bool">
<default>false</default>
<whatsthis>&lt;p&gt;Enabling this makes it possible to store the "
"entries from the Kontact applications (KOrganizer, "
"KAddressBook, and KNotes.)&lt;/p&gt;&lt;p&gt;If you want to set "
"this option you must also set the applications to use the "
"IMAP resource; this is done in the KDE Control "
"Center.&lt;/p&gt;</whatsthis>
"entries from the Kontact applications (KOrganizer, "
"KAddressBook, and KNotes.)&lt;/p&gt;&lt;p&gt;If you want to set "
"this option you must also set the applications to use the "
"IMAP resource; this is done in the KDE Control "
"Center.&lt;/p&gt;</whatsthis>
</entry>
<entry name="HideGroupwareFolders" type="Bool">
@ -92,22 +110,14 @@
</entry>
</group>
<group name="Groupware">
<entry name="GroupwareEnabled" type="Bool">
<label>Enable groupware functionality</label>
<whatsthis></whatsthis>
<group name="UserInterface">
<entry name="QuickSearchActive" type="Bool">
<label>Show quick search line edit</label>
<whatsthis>This option enabled or disables the search line edit "
"above the message list which can be used to quickly search the "
"information shown in the message list.</whatsthis>
<default>true</default>
</entry>
<entry name="GroupwareLegacyMangleFromToHeaders" type="Bool">
<label>Legacy mode: Mangle From:/To: headers in replies to invitations</label>
<whatsthis>Microsoft Outlook has a number of shortcomings "
"in its implementation of the iCalendar standard; "
"this option works around one of them. If you have "
"problems with Outlook users not being able to "
"get your replies, try setting this option.</whatsthis>
<default>false</default>
</entry>
</group>
</kcfg>

@ -4,6 +4,7 @@
#include "kmfolderseldlg.h"
#include "kmfoldertree.h"
#include "kmmainwidget.h"
#include "globalsettings.h"
#include <kdebug.h>
#include <qvbox.h>
@ -19,10 +20,10 @@ class FolderItem : public KListViewItem
FolderItem( QListView * listView, QListViewItem * afterListViewItem );
FolderItem( QListViewItem * listViewItem );
FolderItem( QListViewItem * listViewItem, QListViewItem * afterListViewItem );
void setFolder( KMFolder * folder ) { mFolder = folder; };
const KMFolder * folder() { return mFolder; };
private:
KMFolder * mFolder;
};
@ -53,12 +54,13 @@ FolderItem::FolderItem( QListViewItem * listViewItem, QListViewItem * afterListV
//-----------------------------------------------------------------------------
SimpleFolderTree::SimpleFolderTree( QWidget * parent,
KMFolderTree * folderTree, QString & preSelection )
SimpleFolderTree::SimpleFolderTree( QWidget * parent,
KMFolderTree * folderTree,
const QString & preSelection )
: KListView( parent )
{
assert( folderTree );
int columnIdx = addColumn( i18n( "Folder" ) );
setRootIsDecorated( true );
setSorting( -1 );
@ -67,20 +69,20 @@ SimpleFolderTree::SimpleFolderTree( QWidget * parent,
FolderItem * lastTopItem = 0;
FolderItem * selectedItem = 0;
int lastDepth = 0;
for ( QListViewItemIterator it( folderTree ) ; it.current() ; ++it ) {
KMFolderTreeItem * fti = static_cast<KMFolderTreeItem *>( it.current() );
if ( !fti || fti->protocol() == KFolderTreeItem::Search )
continue;
int depth = fti->depth();// - 1;
//kdDebug( 5006 ) << "LastDepth=" << lastDepth << "\tdepth=" << depth
//kdDebug( 5006 ) << "LastDepth=" << lastDepth << "\tdepth=" << depth
// << "\tname=" << fti->text( 0 ) << endl;
FolderItem * item = 0;
if ( depth <= 0 ) {
// top level - first top level item or after last existing top level item
if ( lastTopItem )
if ( lastTopItem )
item = new FolderItem( this, lastTopItem );
else
item = new FolderItem( this );
@ -92,7 +94,7 @@ SimpleFolderTree::SimpleFolderTree( QWidget * parent,
// next lower level - parent node will get opened
item = new FolderItem( lastItem );
lastItem->setOpen( true );
}
}
else {
if ( depth == lastDepth )
// same level - behind previous item
@ -107,7 +109,7 @@ SimpleFolderTree::SimpleFolderTree( QWidget * parent,
item = new FolderItem( lastItem->parent(), lastItem );
else {
// chain somehow broken - what does cause this ???
kdDebug( 5006 ) << "You shouldn't get here: depth=" << depth
kdDebug( 5006 ) << "You shouldn't get here: depth=" << depth
<< "folder name=" << fti->text( 0 ) << endl;
item = new FolderItem( this );
lastTopItem = item;
@ -115,7 +117,7 @@ SimpleFolderTree::SimpleFolderTree( QWidget * parent,
}
}
}
item->setText( columnIdx, fti->text( 0 ) );
// Make items without folders and top level items unselectable
// (i.e. root item Local Folders and IMAP accounts)
@ -123,13 +125,13 @@ SimpleFolderTree::SimpleFolderTree( QWidget * parent,
item->setSelectable( false );
else {
item->setFolder( fti->folder() );
if ( !preSelection.isNull() && preSelection == item->folder()->idString() )
if ( preSelection == item->folder()->idString() )
selectedItem = item;
}
lastItem = item;
lastDepth = depth;
}
if ( selectedItem ) {
setSelected( selectedItem, true );
ensureItemVisible( selectedItem );
@ -150,9 +152,6 @@ const KMFolder * SimpleFolderTree::folder() const
} // namespace KMail
//-----------------------------------------------------------------------------
QString KMFolderSelDlg::oldSelection;
//-----------------------------------------------------------------------------
KMFolderSelDlg::KMFolderSelDlg( KMMainWidget * parent, const QString& caption )
: KDialogBase( parent, "folder dialog", true, caption,
@ -161,9 +160,10 @@ KMFolderSelDlg::KMFolderSelDlg( KMMainWidget * parent, const QString& caption )
KMFolderTree * ft = parent->folderTree();
assert( ft );
mTreeView = new KMail::SimpleFolderTree( makeVBoxMainWidget(), ft, oldSelection );
mTreeView = new KMail::SimpleFolderTree( makeVBoxMainWidget(), ft,
GlobalSettings::lastSelectedFolder() );
mTreeView->setFocus();
connect( mTreeView, SIGNAL( doubleClicked( QListViewItem*, const QPoint&, int ) ),
connect( mTreeView, SIGNAL( doubleClicked( QListViewItem*, const QPoint&, int ) ),
this, SLOT( slotSelect() ) );
resize(220, 300);
@ -174,8 +174,9 @@ KMFolderSelDlg::KMFolderSelDlg( KMMainWidget * parent, const QString& caption )
KMFolderSelDlg::~KMFolderSelDlg()
{
const KMFolder * cur = folder();
if( cur )
oldSelection = cur->idString();
if ( cur ) {
GlobalSettings::setLastSelectedFolder( cur->idString() );
}
}

@ -19,7 +19,8 @@ namespace KMail {
class SimpleFolderTree : public KListView
{
public:
SimpleFolderTree( QWidget * parent, KMFolderTree * folderTree, QString & preSelection );
SimpleFolderTree( QWidget * parent, KMFolderTree * folderTree,
const QString & preSelection );
const KMFolder * folder() const;
};
@ -45,8 +46,6 @@ protected slots:
protected:
KMail::SimpleFolderTree * mTreeView;
static QString oldSelection;
};
#endif /*kmfolderseldlg_h*/

Loading…
Cancel
Save