Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 98d6b53e11e983e268c3e19f14e091a0 > files > 2405

kdepim-devel-doc-3.5.9-9mdv2008.1.x86_64.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">

<head>
  <title>kmail: kmfilterdlg.cpp Source File (kmail)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <meta http-equiv="Content-Style-Type" content="text/css" />

  <meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline DE v2.0" l gen true for "http://www.kde.org"  r (nz 1 vz 1 lz 1 oz 1 cb 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.kde.org"  r (n 0 s 0 v 0 l 0))' />

  <meta name="trademark" content="KDE e.V." />
  <meta name="description" content="K Desktop Environment Homepage, KDE.org" />
  <meta name="MSSmartTagsPreventParsing" content="true" />
  <meta name="robots" content="all" />

  <link rel="shortcut icon" href="../../favicon.ico" />

<link rel="stylesheet" media="screen" type="text/css" title="APIDOX" href="doxygen.css" />



<style type="text/css">
<!--
hr { display: none; }
#content h2 { margin-left: 0px; }
table.mdTable { background-color: #f8f8f8; border: .2em solid #d7d7d7; }
td.mdRow { padding: 8px 20px; }
td.md { font-weight: bold; }
td.mdname1 { font-weight: bold; color: #602020; }
td.mdname { font-weight: bold; color: #602020;  }

-->
</style>

</head>

<body>

<div id="nav_header_top" align="right">
  <a href="#content" class="doNotDisplay" accesskey="2">Skip to main content ::</a>

  <a href="../.."><img id="nav_header_logo" alt="Home" align="left" src="../../kde_gear_64.png" border="0" /></a>
  <span class="doNotDisplay">::</span>
  <img id="nav_header_logo_right" alt="" align="right" src="../../pimlogo.png" border="0" />

  <div id="nav_header_title" align="left">KDE PIM API Reference</div>


</div>

<div id="nav_header_bottom" align="right">
  <span class="doNotDisplay">:: <a href="#navigation" accesskey="5">Skip to Link Menu</a><br/></span>
  <div id="nav_header_bottom_left" style="text-align: left;">
/ <a href="../../">API Reference</a>
 / <a href=".">kmail</a>
  </div>
</div>


<table id="main" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
      <td valign="top" class="menuheader" height="0"></td>

  <td id="contentcolumn" valign="top" rowspan="2" >
    <div id="content" style="padding-top: 0px;"><div style="width:100%; margin: 0px; padding: 0px;">
    <h2><a name="content"></a>kmail</h2>


<!-- Generated by Doxygen 1.5.5 -->
<h1>kmfilterdlg.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: C++; c-file-style: "gnu" -*-</span>
<a name="l00002"></a>00002 <span class="comment">// kmfilterdlg.cpp</span>
<a name="l00003"></a>00003 <span class="comment">// Author: Marc Mutz &lt;Marc@Mutz.com&gt;</span>
<a name="l00004"></a>00004 <span class="comment">// based on work by Stefan Taferner &lt;taferner@kde.org&gt;</span>
<a name="l00005"></a>00005 <span class="comment">// This code is under the GPL</span>
<a name="l00006"></a>00006 
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;config.h&gt;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include "kmfilterdlg.h"</span>
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 <span class="comment">// other KMail headers:</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include "kmsearchpatternedit.h"</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include "kmfiltermgr.h"</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include "kmmainwidget.h"</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include "accountmanager.h"</span>
<a name="l00015"></a>00015 <span class="keyword">using</span> <a class="code" href="classKMail_1_1AccountManager.html" title="The account manager is responsible for creating accounts of various types via the...">KMail::AccountManager</a>;
<a name="l00016"></a>00016 <span class="preprocessor">#include "filterimporterexporter.h"</span>
<a name="l00017"></a>00017 <span class="keyword">using</span> <a class="code" href="classKMail_1_1FilterImporterExporter.html" title="Utility class that provides persisting of filters to/from KConfig.">KMail::FilterImporterExporter</a>;
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="comment">// other KDE headers:</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;kmessagebox.h&gt;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;kdebug.h&gt;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;klocale.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;kinputdialog.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;kiconloader.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;kapplication.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;kwin.h&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;kconfig.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;kicondialog.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;kkeybutton.h&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;klistview.h&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;kpushbutton.h&gt;</span>
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="comment">// other Qt headers:</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;qlayout.h&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;qlabel.h&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;qcombobox.h&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;qwidgetstack.h&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;qtooltip.h&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;qwhatsthis.h&gt;</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;qcheckbox.h&gt;</span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;qhbox.h&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;qvalidator.h&gt;</span>
<a name="l00043"></a>00043 <span class="preprocessor">#include &lt;qtabwidget.h&gt;</span>
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="comment">// other headers:</span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &lt;assert.h&gt;</span>
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 
<a name="l00049"></a>00049 <span class="comment">// What's this help texts</span>
<a name="l00050"></a>00050 <span class="keyword">const</span> <span class="keywordtype">char</span> * _wt_filterlist =
<a name="l00051"></a>00051 I18N_NOOP( <span class="stringliteral">"&lt;qt&gt;&lt;p&gt;This is the list of defined filters. "</span>
<a name="l00052"></a>00052        <span class="stringliteral">"They are processed top-to-bottom.&lt;/p&gt;"</span>
<a name="l00053"></a>00053        <span class="stringliteral">"&lt;p&gt;Click on any filter to edit it "</span>
<a name="l00054"></a>00054        <span class="stringliteral">"using the controls in the right-hand half "</span>
<a name="l00055"></a>00055        <span class="stringliteral">"of the dialog.&lt;/p&gt;&lt;/qt&gt;"</span> );
<a name="l00056"></a>00056 <span class="keyword">const</span> <span class="keywordtype">char</span> * _wt_filterlist_new =
<a name="l00057"></a>00057 I18N_NOOP( <span class="stringliteral">"&lt;qt&gt;&lt;p&gt;Click this button to create a new filter.&lt;/p&gt;"</span>
<a name="l00058"></a>00058        <span class="stringliteral">"&lt;p&gt;The filter will be inserted just before the currently-"</span>
<a name="l00059"></a>00059        <span class="stringliteral">"selected one, but you can always change that "</span>
<a name="l00060"></a>00060        <span class="stringliteral">"later on.&lt;/p&gt;"</span>
<a name="l00061"></a>00061        <span class="stringliteral">"&lt;p&gt;If you have clicked this button accidentally, you can undo this "</span>
<a name="l00062"></a>00062        <span class="stringliteral">"by clicking on the &lt;em&gt;Delete&lt;/em&gt; button.&lt;/p&gt;&lt;/qt&gt;"</span> );
<a name="l00063"></a>00063 <span class="keyword">const</span> <span class="keywordtype">char</span> * _wt_filterlist_copy =
<a name="l00064"></a>00064 I18N_NOOP( <span class="stringliteral">"&lt;qt&gt;&lt;p&gt;Click this button to copy a filter.&lt;/p&gt;"</span>
<a name="l00065"></a>00065        <span class="stringliteral">"&lt;p&gt;If you have clicked this button accidentally, you can undo this "</span>
<a name="l00066"></a>00066        <span class="stringliteral">"by clicking on the &lt;em&gt;Delete&lt;/em&gt; button.&lt;/p&gt;&lt;/qt&gt;"</span> );
<a name="l00067"></a>00067 <span class="keyword">const</span> <span class="keywordtype">char</span> * _wt_filterlist_delete =
<a name="l00068"></a>00068 I18N_NOOP( <span class="stringliteral">"&lt;qt&gt;&lt;p&gt;Click this button to &lt;em&gt;delete&lt;/em&gt; the currently-"</span>
<a name="l00069"></a>00069        <span class="stringliteral">"selected filter from the list above.&lt;/p&gt;"</span>
<a name="l00070"></a>00070        <span class="stringliteral">"&lt;p&gt;There is no way to get the filter back once "</span>
<a name="l00071"></a>00071        <span class="stringliteral">"it is deleted, but you can always leave the "</span>
<a name="l00072"></a>00072        <span class="stringliteral">"dialog by clicking &lt;em&gt;Cancel&lt;/em&gt; to discard the "</span>
<a name="l00073"></a>00073        <span class="stringliteral">"changes made.&lt;/p&gt;&lt;/qt&gt;"</span> );
<a name="l00074"></a>00074 <span class="keyword">const</span> <span class="keywordtype">char</span> * _wt_filterlist_top =
<a name="l00075"></a>00075 I18N_NOOP( <span class="stringliteral">"&lt;qt&gt;&lt;p&gt;Click this button to move the currently-"</span>
<a name="l00076"></a>00076        <span class="stringliteral">"selected filter to the &lt;em&gt;top&lt;/em&gt; of the list above.&lt;/p&gt;"</span>
<a name="l00077"></a>00077        <span class="stringliteral">"&lt;p&gt;This is useful since the order of the filters in the list "</span>
<a name="l00078"></a>00078        <span class="stringliteral">"determines the order in which they are tried on messages: "</span>
<a name="l00079"></a>00079        <span class="stringliteral">"The topmost filter gets tried first.&lt;/p&gt;&lt;/qt&gt;"</span> );
<a name="l00080"></a>00080 <span class="keyword">const</span> <span class="keywordtype">char</span> * _wt_filterlist_up =
<a name="l00081"></a>00081 I18N_NOOP( <span class="stringliteral">"&lt;qt&gt;&lt;p&gt;Click this button to move the currently-"</span>
<a name="l00082"></a>00082        <span class="stringliteral">"selected filter &lt;em&gt;up&lt;/em&gt; one in the list above.&lt;/p&gt;"</span>
<a name="l00083"></a>00083        <span class="stringliteral">"&lt;p&gt;This is useful since the order of the filters in the list "</span>
<a name="l00084"></a>00084        <span class="stringliteral">"determines the order in which they are tried on messages: "</span>
<a name="l00085"></a>00085        <span class="stringliteral">"The topmost filter gets tried first.&lt;/p&gt;"</span>
<a name="l00086"></a>00086        <span class="stringliteral">"&lt;p&gt;If you have clicked this button accidentally, you can undo this "</span>
<a name="l00087"></a>00087        <span class="stringliteral">"by clicking on the &lt;em&gt;Down&lt;/em&gt; button.&lt;/p&gt;&lt;/qt&gt;"</span> );
<a name="l00088"></a>00088 <span class="keyword">const</span> <span class="keywordtype">char</span> * _wt_filterlist_down =
<a name="l00089"></a>00089 I18N_NOOP( <span class="stringliteral">"&lt;qt&gt;&lt;p&gt;Click this button to move the currently-"</span>
<a name="l00090"></a>00090        <span class="stringliteral">"selected filter &lt;em&gt;down&lt;/em&gt; one in the list above.&lt;/p&gt;"</span>
<a name="l00091"></a>00091        <span class="stringliteral">"&lt;p&gt;This is useful since the order of the filters in the list "</span>
<a name="l00092"></a>00092        <span class="stringliteral">"determines the order in which they are tried on messages: "</span>
<a name="l00093"></a>00093        <span class="stringliteral">"The topmost filter gets tried first.&lt;/p&gt;"</span>
<a name="l00094"></a>00094        <span class="stringliteral">"&lt;p&gt;If you have clicked this button accidentally, you can undo this "</span>
<a name="l00095"></a>00095        <span class="stringliteral">"by clicking on the &lt;em&gt;Up&lt;/em&gt; button.&lt;/p&gt;&lt;/qt&gt;"</span> );
<a name="l00096"></a>00096 <span class="keyword">const</span> <span class="keywordtype">char</span> * _wt_filterlist_bot =
<a name="l00097"></a>00097 I18N_NOOP( <span class="stringliteral">"&lt;qt&gt;&lt;p&gt;Click this button to move the currently-"</span>
<a name="l00098"></a>00098        <span class="stringliteral">"selected filter to the &lt;em&gt;bottom&lt;/em&gt; of the list above.&lt;/p&gt;"</span>
<a name="l00099"></a>00099        <span class="stringliteral">"&lt;p&gt;This is useful since the order of the filters in the list "</span>
<a name="l00100"></a>00100        <span class="stringliteral">"determines the order in which they are tried on messages: "</span>
<a name="l00101"></a>00101        <span class="stringliteral">"The topmost filter gets tried first.&lt;/p&gt;&lt;/qt&gt;"</span> );
<a name="l00102"></a>00102 <span class="keyword">const</span> <span class="keywordtype">char</span> * _wt_filterlist_rename =
<a name="l00103"></a>00103 I18N_NOOP( <span class="stringliteral">"&lt;qt&gt;&lt;p&gt;Click this button to rename the currently-selected filter.&lt;/p&gt;"</span>
<a name="l00104"></a>00104        <span class="stringliteral">"&lt;p&gt;Filters are named automatically, as long as they start with "</span>
<a name="l00105"></a>00105        <span class="stringliteral">"\"&amp;lt;\".&lt;/p&gt;"</span>
<a name="l00106"></a>00106        <span class="stringliteral">"&lt;p&gt;If you have renamed a filter accidentally and want automatic "</span>
<a name="l00107"></a>00107        <span class="stringliteral">"naming back, click this button and select &lt;em&gt;Clear&lt;/em&gt; followed "</span>
<a name="l00108"></a>00108        <span class="stringliteral">"by &lt;em&gt;OK&lt;/em&gt; in the appearing dialog.&lt;/p&gt;&lt;/qt&gt;"</span> );
<a name="l00109"></a>00109 <span class="keyword">const</span> <span class="keywordtype">char</span> * _wt_filterdlg_showLater =
<a name="l00110"></a>00110 I18N_NOOP( <span class="stringliteral">"&lt;qt&gt;&lt;p&gt;Check this button to force the confirmation dialog to be "</span>
<a name="l00111"></a>00111        <span class="stringliteral">"displayed.&lt;/p&gt;&lt;p&gt;This is useful if you have defined a ruleset that tags "</span>
<a name="l00112"></a>00112            <span class="stringliteral">"messages to be downloaded later. Without the possibility to force "</span>
<a name="l00113"></a>00113            <span class="stringliteral">"the dialog popup, these messages could never be downloaded if no "</span>
<a name="l00114"></a>00114            <span class="stringliteral">"other large messages were waiting on the server, or if you wanted to "</span>
<a name="l00115"></a>00115            <span class="stringliteral">"change the ruleset to tag the messages differently.&lt;/p&gt;&lt;/qt&gt;"</span> );
<a name="l00116"></a>00116 
<a name="l00117"></a>00117 <span class="comment">// The anchor of the filter dialog's help.</span>
<a name="l00118"></a>00118 <span class="keyword">const</span> <span class="keywordtype">char</span> * KMFilterDlgHelpAnchor =  <span class="stringliteral">"filters-id"</span> ;
<a name="l00119"></a>00119 <span class="keyword">const</span> <span class="keywordtype">char</span> * KMPopFilterDlgHelpAnchor =  <span class="stringliteral">"popfilters-id"</span> ;
<a name="l00120"></a>00120 
<a name="l00121"></a>00121 <span class="comment">//=============================================================================</span>
<a name="l00122"></a>00122 <span class="comment">//</span>
<a name="l00123"></a>00123 <span class="comment">// class KMFilterDlg (the filter dialog)</span>
<a name="l00124"></a>00124 <span class="comment">//</span>
<a name="l00125"></a>00125 <span class="comment">//=============================================================================</span>
<a name="l00126"></a>00126 
<a name="l00127"></a><a class="code" href="classKMFilterDlg.html#4045bbe72a434c39c198fb4557705b8d">00127</a> <a class="code" href="classKMFilterDlg.html#4045bbe72a434c39c198fb4557705b8d" title="Create the filter dialog.">KMFilterDlg::KMFilterDlg</a>(QWidget* parent, <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">bool</span> popFilter, <span class="keywordtype">bool</span> createDummyFilter )
<a name="l00128"></a>00128   : KDialogBase( parent, name,  false  <span class="comment">/* modality */</span>,
<a name="l00129"></a>00129          (popFilter)? i18n(<span class="stringliteral">"POP3 Filter Rules"</span>): i18n(<span class="stringliteral">"Filter Rules"</span>) <span class="comment">/* caption*/</span>,
<a name="l00130"></a>00130          Help|Ok|Apply|Cancel|User1|User2 <span class="comment">/* button mask */</span>,
<a name="l00131"></a>00131          Ok <span class="comment">/* default btn */</span>,  false  <span class="comment">/* separator */</span>),
<a name="l00132"></a>00132   bPopFilter(popFilter)
<a name="l00133"></a>00133 {
<a name="l00134"></a>00134   KWin::setIcons( winId(), kapp-&gt;icon(), kapp-&gt;miniIcon() );
<a name="l00135"></a>00135   setHelp( (bPopFilter)? KMPopFilterDlgHelpAnchor: KMFilterDlgHelpAnchor );
<a name="l00136"></a>00136   setButtonText( User1, i18n(<span class="stringliteral">"Import"</span>) );
<a name="l00137"></a>00137   setButtonText( User2, i18n(<span class="stringliteral">"Export"</span>) );
<a name="l00138"></a>00138   connect( <span class="keyword">this</span>, SIGNAL(user1Clicked()),
<a name="l00139"></a>00139            <span class="keyword">this</span>, SLOT( <a class="code" href="classKMFilterDlg.html#a39df1feca77e42c2a6b5e56508e21c6" title="Called when a user clicks the import filters button.">slotImportFilters</a>()) );
<a name="l00140"></a>00140   connect( <span class="keyword">this</span>, SIGNAL(user2Clicked()),
<a name="l00141"></a>00141            <span class="keyword">this</span>, SLOT( <a class="code" href="classKMFilterDlg.html#67f786f22570ab7724032631c9950b89" title="Called when a user clicks the export filters button.">slotExportFilters</a>()) );
<a name="l00142"></a>00142 
<a name="l00143"></a>00143   QWidget *w = <span class="keyword">new</span> QWidget( <span class="keyword">this</span> );
<a name="l00144"></a>00144   setMainWidget( w );
<a name="l00145"></a>00145   QHBoxLayout *topLayout = <span class="keyword">new</span> QHBoxLayout( w, 0, spacingHint(), <span class="stringliteral">"topLayout"</span> );
<a name="l00146"></a>00146   QHBoxLayout *hbl = topLayout;
<a name="l00147"></a>00147   QVBoxLayout *vbl2 = 0;
<a name="l00148"></a>00148   QWidget *page1 = 0;
<a name="l00149"></a>00149   QWidget *page2 = 0;
<a name="l00150"></a>00150 
<a name="l00151"></a>00151   <a class="code" href="classKMFilterDlg.html#bbbcef64fb2cbd90d11a4e62d809067d" title="The widget that contains the ListBox showing the filters, and the controls to remove...">mFilterList</a> = <span class="keyword">new</span> <a class="code" href="classKMFilterListBox.html" title="This is a complex widget that is used to manipulate KMail&amp;#39;s filter list.">KMFilterListBox</a>( i18n(<span class="stringliteral">"Available Filters"</span>), w, 0, bPopFilter);
<a name="l00152"></a>00152   topLayout-&gt;addWidget( <a class="code" href="classKMFilterDlg.html#bbbcef64fb2cbd90d11a4e62d809067d" title="The widget that contains the ListBox showing the filters, and the controls to remove...">mFilterList</a>, 1 <span class="comment">/*stretch*/</span> );
<a name="l00153"></a>00153 
<a name="l00154"></a>00154   <span class="keywordflow">if</span>(!bPopFilter) {
<a name="l00155"></a>00155     QTabWidget *tabWidget = <span class="keyword">new</span> QTabWidget( w, <span class="stringliteral">"kmfd_tab"</span> );
<a name="l00156"></a>00156     tabWidget-&gt;setMargin( KDialog::marginHint() );
<a name="l00157"></a>00157     topLayout-&gt;addWidget( tabWidget );
<a name="l00158"></a>00158 
<a name="l00159"></a>00159     page1 = <span class="keyword">new</span> QWidget( tabWidget );
<a name="l00160"></a>00160     tabWidget-&gt;addTab( page1, i18n(<span class="stringliteral">"&amp;General"</span>) );
<a name="l00161"></a>00161     hbl = <span class="keyword">new</span> QHBoxLayout( page1, 0, spacingHint(), <span class="stringliteral">"kmfd_hbl"</span> );
<a name="l00162"></a>00162 
<a name="l00163"></a>00163     page2 = <span class="keyword">new</span> QWidget( tabWidget );
<a name="l00164"></a>00164     tabWidget-&gt;addTab( page2, i18n(<span class="stringliteral">"A&amp;dvanced"</span>) );
<a name="l00165"></a>00165     vbl2 = <span class="keyword">new</span> QVBoxLayout( page2, 0, spacingHint(), <span class="stringliteral">"kmfd_vbl2"</span> );
<a name="l00166"></a>00166   }
<a name="l00167"></a>00167 
<a name="l00168"></a>00168   QVBoxLayout *vbl = <span class="keyword">new</span> QVBoxLayout( hbl, spacingHint(), <span class="stringliteral">"kmfd_vbl"</span> );
<a name="l00169"></a>00169   hbl-&gt;setStretchFactor( vbl, 2 );
<a name="l00170"></a>00170 
<a name="l00171"></a>00171   <a class="code" href="classKMFilterDlg.html#cabd19947f14e439578a432238c2b8c5" title="The widget that allows editing of the filter pattern.">mPatternEdit</a> = <span class="keyword">new</span> <a class="code" href="classKMSearchPatternEdit.html" title="This widget is intended to be used in the filter configuration as well as in the...">KMSearchPatternEdit</a>( i18n(<span class="stringliteral">"Filter Criteria"</span>), bPopFilter ? w : page1 , <span class="stringliteral">"spe"</span>, bPopFilter);
<a name="l00172"></a>00172   vbl-&gt;addWidget( <a class="code" href="classKMFilterDlg.html#cabd19947f14e439578a432238c2b8c5" title="The widget that allows editing of the filter pattern.">mPatternEdit</a>, 0, Qt::AlignTop );
<a name="l00173"></a>00173 
<a name="l00174"></a>00174   <span class="keywordflow">if</span>(bPopFilter){
<a name="l00175"></a>00175     <a class="code" href="classKMFilterDlg.html#0e3572e187d4813202ab9de6272cbb2e" title="The widget that allows editing the popFilter actions.">mActionGroup</a> = <span class="keyword">new</span> KMPopFilterActionWidget( i18n(<span class="stringliteral">"Filter Action"</span>), w );
<a name="l00176"></a>00176     vbl-&gt;addWidget( <a class="code" href="classKMFilterDlg.html#0e3572e187d4813202ab9de6272cbb2e" title="The widget that allows editing the popFilter actions.">mActionGroup</a>, 0, Qt::AlignTop );
<a name="l00177"></a>00177 
<a name="l00178"></a>00178     mGlobalsBox = <span class="keyword">new</span> QVGroupBox(i18n(<span class="stringliteral">"Global Options"</span>), w);
<a name="l00179"></a>00179     mShowLaterBtn = <span class="keyword">new</span> QCheckBox(i18n(<span class="stringliteral">"Always &amp;show matched 'Download Later' messages in confirmation dialog"</span>), mGlobalsBox);
<a name="l00180"></a>00180     QWhatsThis::add( mShowLaterBtn, i18n(_wt_filterdlg_showLater) );
<a name="l00181"></a>00181     vbl-&gt;addWidget( mGlobalsBox, 0, Qt::AlignTop );
<a name="l00182"></a>00182   }
<a name="l00183"></a>00183   <span class="keywordflow">else</span> {
<a name="l00184"></a>00184     QGroupBox *agb = <span class="keyword">new</span> QGroupBox( 1 <span class="comment">/*column*/</span>, Vertical, i18n(<span class="stringliteral">"Filter Actions"</span>), page1 );
<a name="l00185"></a>00185     <a class="code" href="classKMFilterDlg.html#9d34b7e6c3e3a29b5458f8aacd0612b0" title="The widget that allows editing of the filter actions.">mActionLister</a> = <span class="keyword">new</span> KMFilterActionWidgetLister( agb );
<a name="l00186"></a>00186     vbl-&gt;addWidget( agb, 0, Qt::AlignTop );
<a name="l00187"></a>00187 
<a name="l00188"></a>00188     mAdvOptsGroup = <span class="keyword">new</span> QGroupBox ( 1 <span class="comment">/*columns*/</span>, Vertical,
<a name="l00189"></a>00189                     i18n(<span class="stringliteral">"Advanced Options"</span>), page2);
<a name="l00190"></a>00190     {
<a name="l00191"></a>00191       QWidget *adv_w = <span class="keyword">new</span> QWidget( mAdvOptsGroup );
<a name="l00192"></a>00192       QGridLayout *gl = <span class="keyword">new</span> QGridLayout( adv_w, 8 <span class="comment">/*rows*/</span>, 3 <span class="comment">/*cols*/</span>,
<a name="l00193"></a>00193                              0 <span class="comment">/*border*/</span>, spacingHint() );
<a name="l00194"></a>00194 
<a name="l00195"></a>00195       QVBoxLayout *vbl3 = <span class="keyword">new</span> QVBoxLayout( gl, spacingHint(), <span class="stringliteral">"vbl3"</span> );
<a name="l00196"></a>00196       vbl3-&gt;addStretch( 1 );
<a name="l00197"></a>00197       <a class="code" href="classKMFilterDlg.html#c393b56755508cf74bf0c77478e13e7c" title="Lets the user select whether to apply this filter on inbound/outbound messages, both...">mApplyOnIn</a> = <span class="keyword">new</span> QCheckBox( i18n(<span class="stringliteral">"Apply this filter to incoming messages:"</span>), adv_w );
<a name="l00198"></a>00198       vbl3-&gt;addWidget( <a class="code" href="classKMFilterDlg.html#c393b56755508cf74bf0c77478e13e7c" title="Lets the user select whether to apply this filter on inbound/outbound messages, both...">mApplyOnIn</a> );
<a name="l00199"></a>00199       QButtonGroup *bg = <span class="keyword">new</span> QButtonGroup( 0, <span class="stringliteral">"bg"</span> );
<a name="l00200"></a>00200       bg-&gt;setExclusive( <span class="keyword">true</span> );
<a name="l00201"></a>00201       <a class="code" href="classKMFilterDlg.html#1862279aba44b3ea89519abbe123ca01" title="For a filter applied to inbound messages selects whether to apply this filter to...">mApplyOnForAll</a> = <span class="keyword">new</span> QRadioButton( i18n(<span class="stringliteral">"from all accounts"</span>), adv_w );
<a name="l00202"></a>00202       bg-&gt;insert( <a class="code" href="classKMFilterDlg.html#1862279aba44b3ea89519abbe123ca01" title="For a filter applied to inbound messages selects whether to apply this filter to...">mApplyOnForAll</a> );
<a name="l00203"></a>00203       vbl3-&gt;addWidget( <a class="code" href="classKMFilterDlg.html#1862279aba44b3ea89519abbe123ca01" title="For a filter applied to inbound messages selects whether to apply this filter to...">mApplyOnForAll</a> );
<a name="l00204"></a>00204       mApplyOnForTraditional = <span class="keyword">new</span> QRadioButton( i18n(<span class="stringliteral">"from all but online IMAP accounts"</span>), adv_w );
<a name="l00205"></a>00205       bg-&gt;insert( mApplyOnForTraditional );
<a name="l00206"></a>00206       vbl3-&gt;addWidget( mApplyOnForTraditional );
<a name="l00207"></a>00207       mApplyOnForChecked = <span class="keyword">new</span> QRadioButton( i18n(<span class="stringliteral">"from checked accounts only"</span>), adv_w );
<a name="l00208"></a>00208       bg-&gt;insert( mApplyOnForChecked );
<a name="l00209"></a>00209       vbl3-&gt;addWidget( mApplyOnForChecked );
<a name="l00210"></a>00210       vbl3-&gt;addStretch( 2 );
<a name="l00211"></a>00211 
<a name="l00212"></a>00212       <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a> = <span class="keyword">new</span> KListView( adv_w, <span class="stringliteral">"accountList"</span> );
<a name="l00213"></a>00213       <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>-&gt;addColumn( i18n(<span class="stringliteral">"Account Name"</span>) );
<a name="l00214"></a>00214       <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>-&gt;addColumn( i18n(<span class="stringliteral">"Type"</span>) );
<a name="l00215"></a>00215       <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>-&gt;setAllColumnsShowFocus( <span class="keyword">true</span> );
<a name="l00216"></a>00216       <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>-&gt;setFrameStyle( QFrame::WinPanel + QFrame::Sunken );
<a name="l00217"></a>00217       <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>-&gt;setSorting( -1 );
<a name="l00218"></a>00218       gl-&gt;addMultiCellWidget( <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>, 0, 3, 1, 3 );
<a name="l00219"></a>00219 
<a name="l00220"></a>00220       mApplyOnOut = <span class="keyword">new</span> QCheckBox( i18n(<span class="stringliteral">"Apply this filter to &amp;sent messages"</span>), adv_w );
<a name="l00221"></a>00221       gl-&gt;addMultiCellWidget( mApplyOnOut, 4, 4, 0, 3 );
<a name="l00222"></a>00222 
<a name="l00223"></a>00223       mApplyOnCtrlJ = <span class="keyword">new</span> QCheckBox( i18n(<span class="stringliteral">"Apply this filter on manual &amp;filtering"</span>), adv_w );
<a name="l00224"></a>00224       gl-&gt;addMultiCellWidget( mApplyOnCtrlJ, 5, 5, 0, 3 );
<a name="l00225"></a>00225 
<a name="l00226"></a>00226       mStopProcessingHere = <span class="keyword">new</span> QCheckBox( i18n(<span class="stringliteral">"If this filter &amp;matches, stop processing here"</span>), adv_w );
<a name="l00227"></a>00227       gl-&gt;addMultiCellWidget( mStopProcessingHere,
<a name="l00228"></a>00228                   6, 6, <span class="comment">/*from to row*/</span>
<a name="l00229"></a>00229                   0, 3 <span class="comment">/*from to col*/</span> );
<a name="l00230"></a>00230       mConfigureShortcut = <span class="keyword">new</span> QCheckBox( i18n(<span class="stringliteral">"Add this filter to the Apply Filter menu"</span>), adv_w );
<a name="l00231"></a>00231       gl-&gt;addMultiCellWidget( mConfigureShortcut, 7, 7, 0, 1 );
<a name="l00232"></a>00232       QLabel *keyButtonLabel = <span class="keyword">new</span> QLabel( i18n( <span class="stringliteral">"Shortcut:"</span> ), adv_w );
<a name="l00233"></a>00233       keyButtonLabel-&gt;setAlignment( AlignVCenter | AlignRight );
<a name="l00234"></a>00234       gl-&gt;addMultiCellWidget( keyButtonLabel, 7, 7, 2, 2 );
<a name="l00235"></a>00235       mKeyButton = <span class="keyword">new</span> KKeyButton( adv_w, <span class="stringliteral">"FilterShortcutSelector"</span> );
<a name="l00236"></a>00236       gl-&gt;addMultiCellWidget( mKeyButton, 7, 7, 3, 3 );
<a name="l00237"></a>00237       mKeyButton-&gt;setEnabled( <span class="keyword">false</span> );
<a name="l00238"></a>00238       mConfigureToolbar = <span class="keyword">new</span> QCheckBox( i18n(<span class="stringliteral">"Additionally add this filter to the toolbar"</span>), adv_w );
<a name="l00239"></a>00239       gl-&gt;addMultiCellWidget( mConfigureToolbar, 8, 8, 0, 3 );
<a name="l00240"></a>00240       mConfigureToolbar-&gt;setEnabled( <span class="keyword">false</span> );
<a name="l00241"></a>00241 
<a name="l00242"></a>00242       QHBox *hbox = <span class="keyword">new</span> QHBox( adv_w );
<a name="l00243"></a>00243       mFilterActionLabel = <span class="keyword">new</span> QLabel( i18n( <span class="stringliteral">"Icon for this filter:"</span> ),
<a name="l00244"></a>00244                                        hbox );
<a name="l00245"></a>00245       mFilterActionLabel-&gt;setEnabled( <span class="keyword">false</span> );
<a name="l00246"></a>00246 
<a name="l00247"></a>00247       mFilterActionIconButton = <span class="keyword">new</span> KIconButton( hbox );
<a name="l00248"></a>00248       mFilterActionLabel-&gt;setBuddy( mFilterActionIconButton );
<a name="l00249"></a>00249       mFilterActionIconButton-&gt;setIconType( KIcon::NoGroup, KIcon::Any, <span class="keyword">true</span> );
<a name="l00250"></a>00250       mFilterActionIconButton-&gt;setIconSize( 16 );
<a name="l00251"></a>00251       mFilterActionIconButton-&gt;setIcon( <span class="stringliteral">"gear"</span> );
<a name="l00252"></a>00252       mFilterActionIconButton-&gt;setEnabled( <span class="keyword">false</span> );
<a name="l00253"></a>00253 
<a name="l00254"></a>00254       gl-&gt;addMultiCellWidget( hbox, 9, 9, 0, 3 );
<a name="l00255"></a>00255     }
<a name="l00256"></a>00256     vbl2-&gt;addWidget( mAdvOptsGroup, 0, Qt::AlignTop );
<a name="l00257"></a>00257   }
<a name="l00258"></a>00258   <span class="comment">// spacer:</span>
<a name="l00259"></a>00259   vbl-&gt;addStretch( 1 );
<a name="l00260"></a>00260 
<a name="l00261"></a>00261   <span class="comment">// load the filter parts into the edit widgets</span>
<a name="l00262"></a>00262   connect( <a class="code" href="classKMFilterDlg.html#bbbcef64fb2cbd90d11a4e62d809067d" title="The widget that contains the ListBox showing the filters, and the controls to remove...">mFilterList</a>, SIGNAL(filterSelected(KMFilter*)),
<a name="l00263"></a>00263        <span class="keyword">this</span>, SLOT(<a class="code" href="classKMFilterDlg.html#82b6f2a4c3157a8cf1767ea92a3550ac" title="Internally connected to KMFilterListBox::filterSelected.">slotFilterSelected</a>(KMFilter*)) );
<a name="l00264"></a>00264 
<a name="l00265"></a>00265   <span class="keywordflow">if</span> (bPopFilter){
<a name="l00266"></a>00266     <span class="comment">// set the state of the global setting 'show later msgs'</span>
<a name="l00267"></a>00267     connect( mShowLaterBtn, SIGNAL(toggled(<span class="keywordtype">bool</span>)),
<a name="l00268"></a>00268              <a class="code" href="classKMFilterDlg.html#bbbcef64fb2cbd90d11a4e62d809067d" title="The widget that contains the ListBox showing the filters, and the controls to remove...">mFilterList</a>, SLOT(slotShowLaterToggled(<span class="keywordtype">bool</span>)));
<a name="l00269"></a>00269 
<a name="l00270"></a>00270     <span class="comment">// set the action in the filter when changed</span>
<a name="l00271"></a>00271     connect( <a class="code" href="classKMFilterDlg.html#0e3572e187d4813202ab9de6272cbb2e" title="The widget that allows editing the popFilter actions.">mActionGroup</a>, SIGNAL(actionChanged(<span class="keyword">const</span> KMPopFilterAction)),
<a name="l00272"></a>00272          <span class="keyword">this</span>, SLOT(<a class="code" href="classKMFilterDlg.html#cac4424702e4a2ecf5193754ad5978bb" title="Action for popFilter.">slotActionChanged</a>(<span class="keyword">const</span> KMPopFilterAction)) );
<a name="l00273"></a>00273   } <span class="keywordflow">else</span> {
<a name="l00274"></a>00274     <span class="comment">// transfer changes from the 'Apply this filter on...'</span>
<a name="l00275"></a>00275     <span class="comment">// combo box to the filter</span>
<a name="l00276"></a>00276     connect( <a class="code" href="classKMFilterDlg.html#c393b56755508cf74bf0c77478e13e7c" title="Lets the user select whether to apply this filter on inbound/outbound messages, both...">mApplyOnIn</a>, SIGNAL(clicked()),
<a name="l00277"></a>00277          <span class="keyword">this</span>, SLOT(slotApplicabilityChanged()) );
<a name="l00278"></a>00278     connect( <a class="code" href="classKMFilterDlg.html#1862279aba44b3ea89519abbe123ca01" title="For a filter applied to inbound messages selects whether to apply this filter to...">mApplyOnForAll</a>, SIGNAL(clicked()),
<a name="l00279"></a>00279          <span class="keyword">this</span>, SLOT(slotApplicabilityChanged()) );
<a name="l00280"></a>00280     connect( mApplyOnForTraditional, SIGNAL(clicked()),
<a name="l00281"></a>00281          <span class="keyword">this</span>, SLOT(slotApplicabilityChanged()) );
<a name="l00282"></a>00282     connect( mApplyOnForChecked, SIGNAL(clicked()),
<a name="l00283"></a>00283          <span class="keyword">this</span>, SLOT(slotApplicabilityChanged()) );
<a name="l00284"></a>00284     connect( mApplyOnOut, SIGNAL(clicked()),
<a name="l00285"></a>00285          <span class="keyword">this</span>, SLOT(slotApplicabilityChanged()) );
<a name="l00286"></a>00286     connect( mApplyOnCtrlJ, SIGNAL(clicked()),
<a name="l00287"></a>00287          <span class="keyword">this</span>, SLOT(slotApplicabilityChanged()) );
<a name="l00288"></a>00288     connect( <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>, SIGNAL(clicked(QListViewItem*)),
<a name="l00289"></a>00289          <span class="keyword">this</span>, SLOT(slotApplicableAccountsChanged()) );
<a name="l00290"></a>00290     connect( <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>, SIGNAL(spacePressed(QListViewItem*)),
<a name="l00291"></a>00291          <span class="keyword">this</span>, SLOT(slotApplicableAccountsChanged()) );
<a name="l00292"></a>00292 
<a name="l00293"></a>00293     <span class="comment">// transfer changes from the 'stop processing here'</span>
<a name="l00294"></a>00294     <span class="comment">// check box to the filter</span>
<a name="l00295"></a>00295     connect( mStopProcessingHere, SIGNAL(toggled(<span class="keywordtype">bool</span>)),
<a name="l00296"></a>00296          <span class="keyword">this</span>, SLOT(slotStopProcessingButtonToggled(<span class="keywordtype">bool</span>)) );
<a name="l00297"></a>00297 
<a name="l00298"></a>00298     connect( mConfigureShortcut, SIGNAL(toggled(<span class="keywordtype">bool</span>)),
<a name="l00299"></a>00299          <span class="keyword">this</span>, SLOT(slotConfigureShortcutButtonToggled(<span class="keywordtype">bool</span>)) );
<a name="l00300"></a>00300 
<a name="l00301"></a>00301     connect( mKeyButton, SIGNAL( capturedShortcut( <span class="keyword">const</span> KShortcut&amp; ) ),
<a name="l00302"></a>00302              <span class="keyword">this</span>, SLOT( slotCapturedShortcutChanged( <span class="keyword">const</span> KShortcut&amp; ) ) );
<a name="l00303"></a>00303 
<a name="l00304"></a>00304     connect( mConfigureToolbar, SIGNAL(toggled(<span class="keywordtype">bool</span>)),
<a name="l00305"></a>00305          <span class="keyword">this</span>, SLOT(slotConfigureToolbarButtonToggled(<span class="keywordtype">bool</span>)) );
<a name="l00306"></a>00306 
<a name="l00307"></a>00307     connect( mFilterActionIconButton, SIGNAL( iconChanged( QString ) ),
<a name="l00308"></a>00308              <span class="keyword">this</span>, SLOT( slotFilterActionIconChanged( QString ) ) );
<a name="l00309"></a>00309   }
<a name="l00310"></a>00310 
<a name="l00311"></a>00311   <span class="comment">// reset all widgets here</span>
<a name="l00312"></a>00312   connect( <a class="code" href="classKMFilterDlg.html#bbbcef64fb2cbd90d11a4e62d809067d" title="The widget that contains the ListBox showing the filters, and the controls to remove...">mFilterList</a>, SIGNAL(resetWidgets()),
<a name="l00313"></a>00313        <span class="keyword">this</span>, SLOT(slotReset()) );
<a name="l00314"></a>00314 
<a name="l00315"></a>00315   connect( <a class="code" href="classKMFilterDlg.html#bbbcef64fb2cbd90d11a4e62d809067d" title="The widget that contains the ListBox showing the filters, and the controls to remove...">mFilterList</a>, SIGNAL( applyWidgets() ),
<a name="l00316"></a>00316            <span class="keyword">this</span>, SLOT( slotUpdateFilter() ) );
<a name="l00317"></a>00317 
<a name="l00318"></a>00318   <span class="comment">// support auto-naming the filter</span>
<a name="l00319"></a>00319   connect( <a class="code" href="classKMFilterDlg.html#cabd19947f14e439578a432238c2b8c5" title="The widget that allows editing of the filter pattern.">mPatternEdit</a>, SIGNAL(maybeNameChanged()),
<a name="l00320"></a>00320        <a class="code" href="classKMFilterDlg.html#bbbcef64fb2cbd90d11a4e62d809067d" title="The widget that contains the ListBox showing the filters, and the controls to remove...">mFilterList</a>, SLOT(slotUpdateFilterName()) );
<a name="l00321"></a>00321 
<a name="l00322"></a>00322   <span class="comment">// apply changes on 'Apply'</span>
<a name="l00323"></a>00323   connect( <span class="keyword">this</span>, SIGNAL(applyClicked()),
<a name="l00324"></a>00324        <a class="code" href="classKMFilterDlg.html#bbbcef64fb2cbd90d11a4e62d809067d" title="The widget that contains the ListBox showing the filters, and the controls to remove...">mFilterList</a>, SLOT(slotApplyFilterChanges()) );
<a name="l00325"></a>00325 
<a name="l00326"></a>00326   <span class="comment">// apply changes on 'OK'</span>
<a name="l00327"></a>00327   connect( <span class="keyword">this</span>, SIGNAL(okClicked()),
<a name="l00328"></a>00328        <a class="code" href="classKMFilterDlg.html#bbbcef64fb2cbd90d11a4e62d809067d" title="The widget that contains the ListBox showing the filters, and the controls to remove...">mFilterList</a>, SLOT(slotApplyFilterChanges()) );
<a name="l00329"></a>00329 
<a name="l00330"></a>00330   <span class="comment">// save dialog size on 'OK'</span>
<a name="l00331"></a>00331   connect( <span class="keyword">this</span>, SIGNAL(okClicked()),
<a name="l00332"></a>00332        <span class="keyword">this</span>, SLOT(slotSaveSize()) );
<a name="l00333"></a>00333 
<a name="l00334"></a>00334   <span class="comment">// destruct the dialog on OK, close and Cancel</span>
<a name="l00335"></a>00335   connect( <span class="keyword">this</span>, SIGNAL(finished()),
<a name="l00336"></a>00336        <span class="keyword">this</span>, SLOT(slotFinished()) );
<a name="l00337"></a>00337 
<a name="l00338"></a>00338   KConfigGroup geometry( KMKernel::config(), <span class="stringliteral">"Geometry"</span>);
<a name="l00339"></a>00339   <span class="keyword">const</span> <span class="keywordtype">char</span> * configKey
<a name="l00340"></a>00340     = bPopFilter ? <span class="stringliteral">"popFilterDialogSize"</span> : <span class="stringliteral">"filterDialogSize"</span>;
<a name="l00341"></a>00341   <span class="keywordflow">if</span> ( geometry.hasKey( configKey ) )
<a name="l00342"></a>00342     resize( geometry.readSizeEntry( configKey ) );
<a name="l00343"></a>00343   <span class="keywordflow">else</span>
<a name="l00344"></a>00344     adjustSize();
<a name="l00345"></a>00345 
<a name="l00346"></a>00346   <span class="comment">// load the filter list (emits filterSelected())</span>
<a name="l00347"></a>00347   <a class="code" href="classKMFilterDlg.html#bbbcef64fb2cbd90d11a4e62d809067d" title="The widget that contains the ListBox showing the filters, and the controls to remove...">mFilterList</a>-&gt;<a class="code" href="classKMFilterListBox.html#4bd8149655e847c393f5328bf9386343" title="Loads the filter list and selects the first filter.">loadFilterList</a>( createDummyFilter );
<a name="l00348"></a>00348 }
<a name="l00349"></a>00349 
<a name="l00350"></a>00350 <span class="keywordtype">void</span> KMFilterDlg::slotFinished() {
<a name="l00351"></a>00351     delayedDestruct();
<a name="l00352"></a>00352 }
<a name="l00353"></a>00353 
<a name="l00354"></a>00354 <span class="keywordtype">void</span> KMFilterDlg::slotSaveSize() {
<a name="l00355"></a>00355   KConfigGroup geometry( KMKernel::config(), <span class="stringliteral">"Geometry"</span> );
<a name="l00356"></a>00356   geometry.writeEntry( bPopFilter ? <span class="stringliteral">"popFilterDialogSize"</span> : <span class="stringliteral">"filterDialogSize"</span>, size() );
<a name="l00357"></a>00357 }
<a name="l00358"></a>00358 
<a name="l00360"></a><a class="code" href="classKMFilterDlg.html#cac4424702e4a2ecf5193754ad5978bb">00360</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterDlg.html#cac4424702e4a2ecf5193754ad5978bb" title="Action for popFilter.">KMFilterDlg::slotActionChanged</a>(<span class="keyword">const</span> KMPopFilterAction aAction)
<a name="l00361"></a>00361 {
<a name="l00362"></a>00362   mFilter-&gt;setAction(aAction);
<a name="l00363"></a>00363 }
<a name="l00364"></a>00364 
<a name="l00365"></a><a class="code" href="classKMFilterDlg.html#82b6f2a4c3157a8cf1767ea92a3550ac">00365</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterDlg.html#82b6f2a4c3157a8cf1767ea92a3550ac" title="Internally connected to KMFilterListBox::filterSelected.">KMFilterDlg::slotFilterSelected</a>( KMFilter* aFilter )
<a name="l00366"></a>00366 {
<a name="l00367"></a>00367   assert( aFilter );
<a name="l00368"></a>00368 
<a name="l00369"></a>00369   <span class="keywordflow">if</span> (bPopFilter){
<a name="l00370"></a>00370     <a class="code" href="classKMFilterDlg.html#0e3572e187d4813202ab9de6272cbb2e" title="The widget that allows editing the popFilter actions.">mActionGroup</a>-&gt;setAction( aFilter-&gt;action() );
<a name="l00371"></a>00371     mGlobalsBox-&gt;setEnabled( <span class="keyword">true</span> );
<a name="l00372"></a>00372     mShowLaterBtn-&gt;setChecked(<a class="code" href="classKMFilterDlg.html#bbbcef64fb2cbd90d11a4e62d809067d" title="The widget that contains the ListBox showing the filters, and the controls to remove...">mFilterList</a>-&gt;<a class="code" href="classKMFilterListBox.html#59c122807beac41c2a4c362c2d03d065" title="Returns wheather the global option &amp;#39;Show Later Msgs&amp;#39; is set or not.">showLaterMsgs</a>());
<a name="l00373"></a>00373   } <span class="keywordflow">else</span> {
<a name="l00374"></a>00374     <a class="code" href="classKMFilterDlg.html#9d34b7e6c3e3a29b5458f8aacd0612b0" title="The widget that allows editing of the filter actions.">mActionLister</a>-&gt;setActionList( aFilter-&gt;actions() );
<a name="l00375"></a>00375 
<a name="l00376"></a>00376     mAdvOptsGroup-&gt;setEnabled( <span class="keyword">true</span> );
<a name="l00377"></a>00377   }
<a name="l00378"></a>00378 
<a name="l00379"></a>00379   <a class="code" href="classKMFilterDlg.html#cabd19947f14e439578a432238c2b8c5" title="The widget that allows editing of the filter pattern.">mPatternEdit</a>-&gt;<a class="code" href="classKMSearchPatternEdit.html#796c8e566eec7b18e589ce65db253619" title="Set the search pattern.">setSearchPattern</a>( aFilter-&gt;pattern() );
<a name="l00380"></a>00380   mFilter = aFilter;
<a name="l00381"></a>00381 
<a name="l00382"></a>00382   <span class="keywordflow">if</span> (!bPopFilter) {
<a name="l00383"></a>00383     kdDebug(5006) &lt;&lt; <span class="stringliteral">"apply on inbound == "</span>
<a name="l00384"></a>00384           &lt;&lt; aFilter-&gt;applyOnInbound() &lt;&lt; endl;
<a name="l00385"></a>00385     kdDebug(5006) &lt;&lt; <span class="stringliteral">"apply on outbound == "</span>
<a name="l00386"></a>00386           &lt;&lt; aFilter-&gt;applyOnOutbound() &lt;&lt; endl;
<a name="l00387"></a>00387     kdDebug(5006) &lt;&lt; <span class="stringliteral">"apply on explicit == "</span>
<a name="l00388"></a>00388           &lt;&lt; aFilter-&gt;applyOnExplicit() &lt;&lt; endl;
<a name="l00389"></a>00389 
<a name="l00390"></a>00390     <span class="comment">// NOTE: setting these values activates the slot that sets them in</span>
<a name="l00391"></a>00391     <span class="comment">// the filter! So make sure we have the correct values _before_ we</span>
<a name="l00392"></a>00392     <span class="comment">// set the first one:</span>
<a name="l00393"></a>00393     <span class="keyword">const</span> <span class="keywordtype">bool</span> applyOnIn = aFilter-&gt;applyOnInbound();
<a name="l00394"></a>00394     <span class="keyword">const</span> <span class="keywordtype">bool</span> applyOnForAll = aFilter-&gt;applicability() == KMFilter::All;
<a name="l00395"></a>00395     <span class="keyword">const</span> <span class="keywordtype">bool</span> applyOnTraditional = aFilter-&gt;applicability() == KMFilter::ButImap;
<a name="l00396"></a>00396     <span class="keyword">const</span> <span class="keywordtype">bool</span> applyOnOut = aFilter-&gt;applyOnOutbound();
<a name="l00397"></a>00397     <span class="keyword">const</span> <span class="keywordtype">bool</span> applyOnExplicit = aFilter-&gt;applyOnExplicit();
<a name="l00398"></a>00398     <span class="keyword">const</span> <span class="keywordtype">bool</span> stopHere = aFilter-&gt;stopProcessingHere();
<a name="l00399"></a>00399     <span class="keyword">const</span> <span class="keywordtype">bool</span> configureShortcut = aFilter-&gt;configureShortcut();
<a name="l00400"></a>00400     <span class="keyword">const</span> <span class="keywordtype">bool</span> configureToolbar = aFilter-&gt;configureToolbar();
<a name="l00401"></a>00401     <span class="keyword">const</span> QString icon = aFilter-&gt;icon();
<a name="l00402"></a>00402     <span class="keyword">const</span> KShortcut shortcut( aFilter-&gt;shortcut() );
<a name="l00403"></a>00403 
<a name="l00404"></a>00404     <a class="code" href="classKMFilterDlg.html#c393b56755508cf74bf0c77478e13e7c" title="Lets the user select whether to apply this filter on inbound/outbound messages, both...">mApplyOnIn</a>-&gt;setChecked( applyOnIn );
<a name="l00405"></a>00405     <a class="code" href="classKMFilterDlg.html#1862279aba44b3ea89519abbe123ca01" title="For a filter applied to inbound messages selects whether to apply this filter to...">mApplyOnForAll</a>-&gt;setEnabled( applyOnIn );
<a name="l00406"></a>00406     mApplyOnForTraditional-&gt;setEnabled( applyOnIn );
<a name="l00407"></a>00407     mApplyOnForChecked-&gt;setEnabled( applyOnIn );
<a name="l00408"></a>00408     <a class="code" href="classKMFilterDlg.html#1862279aba44b3ea89519abbe123ca01" title="For a filter applied to inbound messages selects whether to apply this filter to...">mApplyOnForAll</a>-&gt;setChecked( applyOnForAll );
<a name="l00409"></a>00409     mApplyOnForTraditional-&gt;setChecked( applyOnTraditional );
<a name="l00410"></a>00410     mApplyOnForChecked-&gt;setChecked( !applyOnForAll &amp;&amp; !applyOnTraditional );
<a name="l00411"></a>00411     <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>-&gt;setEnabled( mApplyOnForChecked-&gt;isEnabled() &amp;&amp; mApplyOnForChecked-&gt;isChecked() );
<a name="l00412"></a>00412     slotUpdateAccountList();
<a name="l00413"></a>00413     mApplyOnOut-&gt;setChecked( applyOnOut );
<a name="l00414"></a>00414     mApplyOnCtrlJ-&gt;setChecked( applyOnExplicit );
<a name="l00415"></a>00415     mStopProcessingHere-&gt;setChecked( stopHere );
<a name="l00416"></a>00416     mConfigureShortcut-&gt;setChecked( configureShortcut );
<a name="l00417"></a>00417     mKeyButton-&gt;setShortcut( shortcut, <span class="keyword">false</span> );
<a name="l00418"></a>00418     mConfigureToolbar-&gt;setChecked( configureToolbar );
<a name="l00419"></a>00419     mFilterActionIconButton-&gt;setIcon( icon );
<a name="l00420"></a>00420   }
<a name="l00421"></a>00421 }
<a name="l00422"></a>00422 
<a name="l00423"></a>00423 <span class="keywordtype">void</span> KMFilterDlg::slotReset()
<a name="l00424"></a>00424 {
<a name="l00425"></a>00425   mFilter = 0;
<a name="l00426"></a>00426   <a class="code" href="classKMFilterDlg.html#cabd19947f14e439578a432238c2b8c5" title="The widget that allows editing of the filter pattern.">mPatternEdit</a>-&gt;<a class="code" href="classKMSearchPatternEdit.html#759a365a27ad0aba48792b7ebd298b8c" title="Called when the widget should let go of the currently referenced filter and disable...">reset</a>();
<a name="l00427"></a>00427 
<a name="l00428"></a>00428   <span class="keywordflow">if</span>(bPopFilter) {
<a name="l00429"></a>00429     <a class="code" href="classKMFilterDlg.html#0e3572e187d4813202ab9de6272cbb2e" title="The widget that allows editing the popFilter actions.">mActionGroup</a>-&gt;reset();
<a name="l00430"></a>00430     mGlobalsBox-&gt;setEnabled( <span class="keyword">false</span> );
<a name="l00431"></a>00431   } <span class="keywordflow">else</span> {
<a name="l00432"></a>00432     <a class="code" href="classKMFilterDlg.html#9d34b7e6c3e3a29b5458f8aacd0612b0" title="The widget that allows editing of the filter actions.">mActionLister</a>-&gt;reset();
<a name="l00433"></a>00433     mAdvOptsGroup-&gt;setEnabled( <span class="keyword">false</span> );
<a name="l00434"></a>00434     slotUpdateAccountList();
<a name="l00435"></a>00435   }
<a name="l00436"></a>00436 }
<a name="l00437"></a>00437 
<a name="l00438"></a>00438 <span class="keywordtype">void</span> KMFilterDlg::slotUpdateFilter()
<a name="l00439"></a>00439 {
<a name="l00440"></a>00440   <a class="code" href="classKMFilterDlg.html#cabd19947f14e439578a432238c2b8c5" title="The widget that allows editing of the filter pattern.">mPatternEdit</a>-&gt;<a class="code" href="classKMSearchPatternEdit.html#469ff6c164f4716af84b26819874845d" title="Updates the search pattern according to the current widget values.">updateSearchPattern</a>();
<a name="l00441"></a>00441   <span class="keywordflow">if</span> ( !bPopFilter ) {
<a name="l00442"></a>00442     <a class="code" href="classKMFilterDlg.html#9d34b7e6c3e3a29b5458f8aacd0612b0" title="The widget that allows editing of the filter actions.">mActionLister</a>-&gt;updateActionList();
<a name="l00443"></a>00443   }
<a name="l00444"></a>00444 }
<a name="l00445"></a>00445 
<a name="l00446"></a>00446 <span class="keywordtype">void</span> KMFilterDlg::slotApplicabilityChanged()
<a name="l00447"></a>00447 {
<a name="l00448"></a>00448   <span class="keywordflow">if</span> ( mFilter ) {
<a name="l00449"></a>00449     mFilter-&gt;setApplyOnInbound( <a class="code" href="classKMFilterDlg.html#c393b56755508cf74bf0c77478e13e7c" title="Lets the user select whether to apply this filter on inbound/outbound messages, both...">mApplyOnIn</a>-&gt;isChecked() );
<a name="l00450"></a>00450     mFilter-&gt;setApplyOnOutbound( mApplyOnOut-&gt;isChecked() );
<a name="l00451"></a>00451     mFilter-&gt;setApplyOnExplicit( mApplyOnCtrlJ-&gt;isChecked() );
<a name="l00452"></a>00452     <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterDlg.html#1862279aba44b3ea89519abbe123ca01" title="For a filter applied to inbound messages selects whether to apply this filter to...">mApplyOnForAll</a>-&gt;isChecked() )
<a name="l00453"></a>00453       mFilter-&gt;setApplicability( KMFilter::All );
<a name="l00454"></a>00454     <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( mApplyOnForTraditional-&gt;isChecked() )
<a name="l00455"></a>00455       mFilter-&gt;setApplicability( KMFilter::ButImap );
<a name="l00456"></a>00456     <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( mApplyOnForChecked-&gt;isChecked() )
<a name="l00457"></a>00457       mFilter-&gt;setApplicability( KMFilter::Checked );
<a name="l00458"></a>00458 
<a name="l00459"></a>00459     <a class="code" href="classKMFilterDlg.html#1862279aba44b3ea89519abbe123ca01" title="For a filter applied to inbound messages selects whether to apply this filter to...">mApplyOnForAll</a>-&gt;setEnabled( <a class="code" href="classKMFilterDlg.html#c393b56755508cf74bf0c77478e13e7c" title="Lets the user select whether to apply this filter on inbound/outbound messages, both...">mApplyOnIn</a>-&gt;isChecked() );
<a name="l00460"></a>00460     mApplyOnForTraditional-&gt;setEnabled(  <a class="code" href="classKMFilterDlg.html#c393b56755508cf74bf0c77478e13e7c" title="Lets the user select whether to apply this filter on inbound/outbound messages, both...">mApplyOnIn</a>-&gt;isChecked() );
<a name="l00461"></a>00461     mApplyOnForChecked-&gt;setEnabled( <a class="code" href="classKMFilterDlg.html#c393b56755508cf74bf0c77478e13e7c" title="Lets the user select whether to apply this filter on inbound/outbound messages, both...">mApplyOnIn</a>-&gt;isChecked() );
<a name="l00462"></a>00462     <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>-&gt;setEnabled( mApplyOnForChecked-&gt;isEnabled() &amp;&amp; mApplyOnForChecked-&gt;isChecked() );
<a name="l00463"></a>00463 
<a name="l00464"></a>00464     <span class="comment">// Advanced tab functionality - Update list of accounts this filter applies to</span>
<a name="l00465"></a>00465     QListViewItemIterator it( <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a> );
<a name="l00466"></a>00466     <span class="keywordflow">while</span> ( it.current() ) {
<a name="l00467"></a>00467       QCheckListItem *item = <span class="keyword">dynamic_cast&lt;</span>QCheckListItem*<span class="keyword">&gt;</span>( it.current() );
<a name="l00468"></a>00468       <span class="keywordflow">if</span> (item) {
<a name="l00469"></a>00469     <span class="keywordtype">int</span> <span class="keywordtype">id</span> = item-&gt;text( 2 ).toInt();
<a name="l00470"></a>00470       item-&gt;setOn( mFilter-&gt;applyOnAccount( <span class="keywordtype">id</span> ) );
<a name="l00471"></a>00471       }
<a name="l00472"></a>00472       ++it;
<a name="l00473"></a>00473     }
<a name="l00474"></a>00474 
<a name="l00475"></a>00475     kdDebug(5006) &lt;&lt; <span class="stringliteral">"KMFilterDlg: setting filter to be applied at "</span>
<a name="l00476"></a>00476                   &lt;&lt; ( mFilter-&gt;applyOnInbound() ? <span class="stringliteral">"incoming "</span> : <span class="stringliteral">""</span> )
<a name="l00477"></a>00477                   &lt;&lt; ( mFilter-&gt;applyOnOutbound() ? <span class="stringliteral">"outgoing "</span> : <span class="stringliteral">""</span> )
<a name="l00478"></a>00478                   &lt;&lt; ( mFilter-&gt;applyOnExplicit() ? <span class="stringliteral">"explicit CTRL-J"</span> : <span class="stringliteral">""</span> )
<a name="l00479"></a>00479                   &lt;&lt; endl;
<a name="l00480"></a>00480   }
<a name="l00481"></a>00481 }
<a name="l00482"></a>00482 
<a name="l00483"></a>00483 <span class="keywordtype">void</span> KMFilterDlg::slotApplicableAccountsChanged()
<a name="l00484"></a>00484 {
<a name="l00485"></a>00485   <span class="keywordflow">if</span> ( mFilter &amp;&amp; mApplyOnForChecked-&gt;isEnabled() &amp;&amp; mApplyOnForChecked-&gt;isChecked() ) {
<a name="l00486"></a>00486     <span class="comment">// Advanced tab functionality - Update list of accounts this filter applies to</span>
<a name="l00487"></a>00487     QListViewItemIterator it( <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a> );
<a name="l00488"></a>00488     <span class="keywordflow">while</span> ( it.current() ) {
<a name="l00489"></a>00489       QCheckListItem *item = <span class="keyword">dynamic_cast&lt;</span>QCheckListItem*<span class="keyword">&gt;</span>( it.current() );
<a name="l00490"></a>00490       <span class="keywordflow">if</span> (item) {
<a name="l00491"></a>00491     <span class="keywordtype">int</span> <span class="keywordtype">id</span> = item-&gt;text( 2 ).toInt();
<a name="l00492"></a>00492     mFilter-&gt;setApplyOnAccount( <span class="keywordtype">id</span>, item-&gt;isOn() );
<a name="l00493"></a>00493       }
<a name="l00494"></a>00494       ++it;
<a name="l00495"></a>00495     }
<a name="l00496"></a>00496   }
<a name="l00497"></a>00497 }
<a name="l00498"></a>00498 
<a name="l00499"></a>00499 <span class="keywordtype">void</span> KMFilterDlg::slotStopProcessingButtonToggled( <span class="keywordtype">bool</span> aChecked )
<a name="l00500"></a>00500 {
<a name="l00501"></a>00501   <span class="keywordflow">if</span> ( mFilter )
<a name="l00502"></a>00502     mFilter-&gt;setStopProcessingHere( aChecked );
<a name="l00503"></a>00503 }
<a name="l00504"></a>00504 
<a name="l00505"></a>00505 <span class="keywordtype">void</span> KMFilterDlg::slotConfigureShortcutButtonToggled( <span class="keywordtype">bool</span> aChecked )
<a name="l00506"></a>00506 {
<a name="l00507"></a>00507   <span class="keywordflow">if</span> ( mFilter ) {
<a name="l00508"></a>00508     mFilter-&gt;setConfigureShortcut( aChecked );
<a name="l00509"></a>00509     mKeyButton-&gt;setEnabled( aChecked );
<a name="l00510"></a>00510     mConfigureToolbar-&gt;setEnabled( aChecked );
<a name="l00511"></a>00511     mFilterActionIconButton-&gt;setEnabled( aChecked );
<a name="l00512"></a>00512     mFilterActionLabel-&gt;setEnabled( aChecked );
<a name="l00513"></a>00513   }
<a name="l00514"></a>00514 }
<a name="l00515"></a>00515 
<a name="l00516"></a>00516 <span class="keywordtype">void</span> KMFilterDlg::slotCapturedShortcutChanged( <span class="keyword">const</span> KShortcut&amp; sc )
<a name="l00517"></a>00517 {
<a name="l00518"></a>00518   KShortcut mySc(sc);
<a name="l00519"></a>00519   <span class="keywordflow">if</span> ( mySc == mKeyButton-&gt;shortcut() ) <span class="keywordflow">return</span>;
<a name="l00520"></a>00520   <span class="comment">// FIXME work around a problem when reseting the shortcut via the shortcut dialog</span>
<a name="l00521"></a>00521   <span class="comment">// somehow the returned shortcut does not evaluate to true in KShortcut::isNull(),</span>
<a name="l00522"></a>00522   <span class="comment">// so we additionally have to check for an empty string</span>
<a name="l00523"></a>00523   <span class="keywordflow">if</span> ( mySc.isNull() || mySc.toString().isEmpty() )
<a name="l00524"></a>00524     mySc.clear();
<a name="l00525"></a>00525   <span class="keywordflow">if</span> ( !mySc.isNull() &amp;&amp; !( kmkernel-&gt;getKMMainWidget()-&gt;shortcutIsValid( mySc ) ) ) {
<a name="l00526"></a>00526     QString msg( i18n( <span class="stringliteral">"The selected shortcut is already used, "</span>
<a name="l00527"></a>00527           <span class="stringliteral">"please select a different one."</span> ) );
<a name="l00528"></a>00528     KMessageBox::sorry( <span class="keyword">this</span>, msg );
<a name="l00529"></a>00529   } <span class="keywordflow">else</span> {
<a name="l00530"></a>00530     mKeyButton-&gt;setShortcut( mySc, <span class="keyword">false</span> );
<a name="l00531"></a>00531     <span class="keywordflow">if</span> ( mFilter )
<a name="l00532"></a>00532       mFilter-&gt;setShortcut( mKeyButton-&gt;shortcut() );
<a name="l00533"></a>00533   }
<a name="l00534"></a>00534 }
<a name="l00535"></a>00535 
<a name="l00536"></a>00536 <span class="keywordtype">void</span> KMFilterDlg::slotConfigureToolbarButtonToggled( <span class="keywordtype">bool</span> aChecked )
<a name="l00537"></a>00537 {
<a name="l00538"></a>00538   <span class="keywordflow">if</span> ( mFilter )
<a name="l00539"></a>00539     mFilter-&gt;setConfigureToolbar( aChecked );
<a name="l00540"></a>00540 }
<a name="l00541"></a>00541 
<a name="l00542"></a>00542 <span class="keywordtype">void</span> KMFilterDlg::slotFilterActionIconChanged( QString icon )
<a name="l00543"></a>00543 {
<a name="l00544"></a>00544   <span class="keywordflow">if</span> ( mFilter )
<a name="l00545"></a>00545     mFilter-&gt;setIcon( icon );
<a name="l00546"></a>00546 }
<a name="l00547"></a>00547 
<a name="l00548"></a>00548 <span class="keywordtype">void</span> KMFilterDlg::slotUpdateAccountList()
<a name="l00549"></a>00549 {
<a name="l00550"></a>00550   <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>-&gt;clear();
<a name="l00551"></a>00551   QListViewItem *top = 0;
<a name="l00552"></a>00552   <span class="keywordflow">for</span>( KMAccount *a = kmkernel-&gt;acctMgr()-&gt;first(); a!=0;
<a name="l00553"></a>00553        a = kmkernel-&gt;acctMgr()-&gt;next() ) {
<a name="l00554"></a>00554     QCheckListItem *listItem =
<a name="l00555"></a>00555       <span class="keyword">new</span> QCheckListItem( <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>, top, a-&gt;name(), QCheckListItem::CheckBox );
<a name="l00556"></a>00556     listItem-&gt;setText( 1, a-&gt;type() );
<a name="l00557"></a>00557     listItem-&gt;setText( 2, QString( <span class="stringliteral">"%1"</span> ).arg( a-&gt;id() ) );
<a name="l00558"></a>00558     <span class="keywordflow">if</span> ( mFilter )
<a name="l00559"></a>00559       listItem-&gt;setOn( mFilter-&gt;applyOnAccount( a-&gt;id() ) );
<a name="l00560"></a>00560     top = listItem;
<a name="l00561"></a>00561   }
<a name="l00562"></a>00562 
<a name="l00563"></a>00563   QListViewItem *listItem = <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>-&gt;firstChild();
<a name="l00564"></a>00564   <span class="keywordflow">if</span> ( listItem ) {
<a name="l00565"></a>00565     <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>-&gt;setCurrentItem( listItem );
<a name="l00566"></a>00566     <a class="code" href="classKMFilterDlg.html#2b6ed0f991f88015e52a9447f4f2b81c" title="ListView that shows the accounts in the advanced tab.">mAccountList</a>-&gt;setSelected( listItem, <span class="keyword">true</span> );
<a name="l00567"></a>00567   }
<a name="l00568"></a>00568 }
<a name="l00569"></a>00569 
<a name="l00570"></a>00570 <span class="comment">//=============================================================================</span>
<a name="l00571"></a>00571 <span class="comment">//</span>
<a name="l00572"></a>00572 <span class="comment">// class KMFilterListBox (the filter list manipulator)</span>
<a name="l00573"></a>00573 <span class="comment">//</span>
<a name="l00574"></a>00574 <span class="comment">//=============================================================================</span>
<a name="l00575"></a>00575 
<a name="l00576"></a><a class="code" href="classKMFilterListBox.html#133699be0c45a3c4793bb9d9be87b5a8">00576</a> <a class="code" href="classKMFilterListBox.html#133699be0c45a3c4793bb9d9be87b5a8" title="Constuctor.">KMFilterListBox::KMFilterListBox</a>( <span class="keyword">const</span> QString &amp; title, QWidget *parent, <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">bool</span> popFilter )
<a name="l00577"></a>00577   : QGroupBox( 1, Horizontal, title, parent, name ),
<a name="l00578"></a>00578     bPopFilter(popFilter)
<a name="l00579"></a>00579 {
<a name="l00580"></a>00580   <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.setAutoDelete( <span class="keyword">true</span> );
<a name="l00581"></a>00581   <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> = -1;
<a name="l00582"></a>00582 
<a name="l00583"></a>00583   <span class="comment">//----------- the list box</span>
<a name="l00584"></a>00584   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a> = <span class="keyword">new</span> QListBox(<span class="keyword">this</span>);
<a name="l00585"></a>00585   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;setMinimumWidth(150);
<a name="l00586"></a>00586   QWhatsThis::add( <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>, i18n(_wt_filterlist) );
<a name="l00587"></a>00587 
<a name="l00588"></a>00588   <span class="comment">//----------- the first row of buttons</span>
<a name="l00589"></a>00589   QHBox *hb = <span class="keyword">new</span> QHBox(<span class="keyword">this</span>);
<a name="l00590"></a>00590   hb-&gt;setSpacing(4);
<a name="l00591"></a>00591   mBtnTop = <span class="keyword">new</span> KPushButton( QString::null, hb );
<a name="l00592"></a>00592   mBtnTop-&gt;setAutoRepeat( <span class="keyword">true</span> );
<a name="l00593"></a>00593   mBtnTop-&gt;setIconSet( BarIconSet( <span class="stringliteral">"top"</span>, KIcon::SizeSmall ) );
<a name="l00594"></a>00594   mBtnTop-&gt;setMinimumSize( mBtnTop-&gt;sizeHint() * 1.2 );
<a name="l00595"></a>00595   mBtnUp = <span class="keyword">new</span> KPushButton( QString::null, hb );
<a name="l00596"></a>00596   mBtnUp-&gt;setAutoRepeat( <span class="keyword">true</span> );
<a name="l00597"></a>00597   mBtnUp-&gt;setIconSet( BarIconSet( <span class="stringliteral">"up"</span>, KIcon::SizeSmall ) );
<a name="l00598"></a>00598   mBtnUp-&gt;setMinimumSize( mBtnUp-&gt;sizeHint() * 1.2 );
<a name="l00599"></a>00599   mBtnDown = <span class="keyword">new</span> KPushButton( QString::null, hb );
<a name="l00600"></a>00600   mBtnDown-&gt;setAutoRepeat( <span class="keyword">true</span> );
<a name="l00601"></a>00601   mBtnDown-&gt;setIconSet( BarIconSet( <span class="stringliteral">"down"</span>, KIcon::SizeSmall ) );
<a name="l00602"></a>00602   mBtnDown-&gt;setMinimumSize( mBtnDown-&gt;sizeHint() * 1.2 );
<a name="l00603"></a>00603   mBtnBot = <span class="keyword">new</span> KPushButton( QString::null, hb );
<a name="l00604"></a>00604   mBtnBot-&gt;setAutoRepeat( <span class="keyword">true</span> );
<a name="l00605"></a>00605   mBtnBot-&gt;setIconSet( BarIconSet( <span class="stringliteral">"bottom"</span>, KIcon::SizeSmall ) );
<a name="l00606"></a>00606   mBtnBot-&gt;setMinimumSize( mBtnBot-&gt;sizeHint() * 1.2 );
<a name="l00607"></a>00607   QToolTip::add( mBtnTop, i18n(<span class="stringliteral">"Top"</span>) );
<a name="l00608"></a>00608   QToolTip::add( mBtnUp, i18n(<span class="stringliteral">"Up"</span>) );
<a name="l00609"></a>00609   QToolTip::add( mBtnDown, i18n(<span class="stringliteral">"Down"</span>) );
<a name="l00610"></a>00610   QToolTip::add( mBtnBot, i18n(<span class="stringliteral">"Bottom"</span>) );
<a name="l00611"></a>00611   QWhatsThis::add( mBtnTop, i18n(_wt_filterlist_top) );
<a name="l00612"></a>00612   QWhatsThis::add( mBtnUp, i18n(_wt_filterlist_up) );
<a name="l00613"></a>00613   QWhatsThis::add( mBtnDown, i18n(_wt_filterlist_down) );
<a name="l00614"></a>00614   QWhatsThis::add( mBtnBot, i18n(_wt_filterlist_bot) );
<a name="l00615"></a>00615 
<a name="l00616"></a>00616   <span class="comment">//----------- the second row of buttons</span>
<a name="l00617"></a>00617   hb = <span class="keyword">new</span> QHBox(<span class="keyword">this</span>);
<a name="l00618"></a>00618   hb-&gt;setSpacing(4);
<a name="l00619"></a>00619   <a class="code" href="classKMFilterListBox.html#4c96a367cb96b88a3ceffbf0b409ba97" title="The various action buttons.">mBtnNew</a> = <span class="keyword">new</span> QPushButton( QString::null, hb );
<a name="l00620"></a>00620   <a class="code" href="classKMFilterListBox.html#4c96a367cb96b88a3ceffbf0b409ba97" title="The various action buttons.">mBtnNew</a>-&gt;setPixmap( BarIcon( <span class="stringliteral">"filenew"</span>, KIcon::SizeSmall ) );
<a name="l00621"></a>00621   <a class="code" href="classKMFilterListBox.html#4c96a367cb96b88a3ceffbf0b409ba97" title="The various action buttons.">mBtnNew</a>-&gt;setMinimumSize( <a class="code" href="classKMFilterListBox.html#4c96a367cb96b88a3ceffbf0b409ba97" title="The various action buttons.">mBtnNew</a>-&gt;sizeHint() * 1.2 );
<a name="l00622"></a>00622   mBtnCopy = <span class="keyword">new</span> QPushButton( QString::null, hb );
<a name="l00623"></a>00623   mBtnCopy-&gt;setIconSet( BarIconSet( <span class="stringliteral">"editcopy"</span>, KIcon::SizeSmall ) );
<a name="l00624"></a>00624   mBtnCopy-&gt;setMinimumSize( mBtnCopy-&gt;sizeHint() * 1.2 );
<a name="l00625"></a>00625   mBtnDelete = <span class="keyword">new</span> QPushButton( QString::null, hb );
<a name="l00626"></a>00626   mBtnDelete-&gt;setIconSet( BarIconSet( <span class="stringliteral">"editdelete"</span>, KIcon::SizeSmall ) );
<a name="l00627"></a>00627   mBtnDelete-&gt;setMinimumSize( mBtnDelete-&gt;sizeHint() * 1.2 );
<a name="l00628"></a>00628   mBtnRename = <span class="keyword">new</span> QPushButton( i18n(<span class="stringliteral">"Rename..."</span>), hb );
<a name="l00629"></a>00629   QToolTip::add( <a class="code" href="classKMFilterListBox.html#4c96a367cb96b88a3ceffbf0b409ba97" title="The various action buttons.">mBtnNew</a>, i18n(<span class="stringliteral">"New"</span>) );
<a name="l00630"></a>00630   QToolTip::add( mBtnCopy, i18n(<span class="stringliteral">"Copy"</span>) );
<a name="l00631"></a>00631   QToolTip::add( mBtnDelete, i18n(<span class="stringliteral">"Delete"</span>));
<a name="l00632"></a>00632   QWhatsThis::add( <a class="code" href="classKMFilterListBox.html#4c96a367cb96b88a3ceffbf0b409ba97" title="The various action buttons.">mBtnNew</a>, i18n(_wt_filterlist_new) );
<a name="l00633"></a>00633   QWhatsThis::add( mBtnCopy, i18n(_wt_filterlist_copy) );
<a name="l00634"></a>00634   QWhatsThis::add( mBtnDelete, i18n(_wt_filterlist_delete) );
<a name="l00635"></a>00635   QWhatsThis::add( mBtnRename, i18n(_wt_filterlist_rename) );
<a name="l00636"></a>00636 
<a name="l00637"></a>00637 
<a name="l00638"></a>00638   <span class="comment">//----------- now connect everything</span>
<a name="l00639"></a>00639   connect( <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>, SIGNAL(highlighted(<span class="keywordtype">int</span>)),
<a name="l00640"></a>00640        <span class="keyword">this</span>, SLOT(<a class="code" href="classKMFilterListBox.html#50c292994edab13f470d162a4cc5ca3f" title="Called when the user clicks on a filter in the filter list.">slotSelected</a>(<span class="keywordtype">int</span>)) );
<a name="l00641"></a>00641   connect( <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>, SIGNAL( doubleClicked ( QListBoxItem * )),
<a name="l00642"></a>00642            <span class="keyword">this</span>, SLOT( <a class="code" href="classKMFilterListBox.html#72c6df5d14b8911c8dd43a12d5de8b49" title="Called when the user clicks the &amp;#39;Rename&amp;#39; button.">slotRename</a>()) );
<a name="l00643"></a>00643   connect( mBtnTop, SIGNAL(clicked()),
<a name="l00644"></a>00644        <span class="keyword">this</span>, SLOT(<a class="code" href="classKMFilterListBox.html#0b73bde8a52220cbe1a1eaf087395149" title="Called when the user clicks the &amp;#39;Top&amp;#39; button.">slotTop</a>()) );
<a name="l00645"></a>00645   connect( mBtnUp, SIGNAL(clicked()),
<a name="l00646"></a>00646        <span class="keyword">this</span>, SLOT(<a class="code" href="classKMFilterListBox.html#7cbba8f9cb4fdb7f32086a24f36f0019" title="Called when the user clicks the &amp;#39;Up&amp;#39; button.">slotUp</a>()) );
<a name="l00647"></a>00647   connect( mBtnDown, SIGNAL(clicked()),
<a name="l00648"></a>00648        <span class="keyword">this</span>, SLOT(<a class="code" href="classKMFilterListBox.html#aae321b0189bae337ebeb07933b0ae3b" title="Called when the user clicks the &amp;#39;Down&amp;#39; button.">slotDown</a>()) );
<a name="l00649"></a>00649   connect( mBtnBot, SIGNAL(clicked()),
<a name="l00650"></a>00650        <span class="keyword">this</span>, SLOT(<a class="code" href="classKMFilterListBox.html#3fb4f13c806d89de48d63b6281a24622" title="Called when the user clicks the &amp;#39;Bottom&amp;#39; button.">slotBottom</a>()) );
<a name="l00651"></a>00651   connect( <a class="code" href="classKMFilterListBox.html#4c96a367cb96b88a3ceffbf0b409ba97" title="The various action buttons.">mBtnNew</a>, SIGNAL(clicked()),
<a name="l00652"></a>00652        <span class="keyword">this</span>, SLOT(<a class="code" href="classKMFilterListBox.html#c5a892e3ecfa988ea7fc2747342e6700" title="Called when the user clicks the &amp;#39;New&amp;#39; button.">slotNew</a>()) );
<a name="l00653"></a>00653   connect( mBtnCopy, SIGNAL(clicked()),
<a name="l00654"></a>00654        <span class="keyword">this</span>, SLOT(<a class="code" href="classKMFilterListBox.html#bc73b24167aca620c638bc1274daa5b4" title="Called when the user clicks the &amp;#39;Copy&amp;#39; button.">slotCopy</a>()) );
<a name="l00655"></a>00655   connect( mBtnDelete, SIGNAL(clicked()),
<a name="l00656"></a>00656        <span class="keyword">this</span>, SLOT(<a class="code" href="classKMFilterListBox.html#d4d0fc3ce484b5af34a67194b9a2587d" title="Called when the user clicks the &amp;#39;Delete&amp;#39; button.">slotDelete</a>()) );
<a name="l00657"></a>00657   connect( mBtnRename, SIGNAL(clicked()),
<a name="l00658"></a>00658        <span class="keyword">this</span>, SLOT(<a class="code" href="classKMFilterListBox.html#72c6df5d14b8911c8dd43a12d5de8b49" title="Called when the user clicks the &amp;#39;Rename&amp;#39; button.">slotRename</a>()) );
<a name="l00659"></a>00659 
<a name="l00660"></a>00660   <span class="comment">// the dialog should call loadFilterList()</span>
<a name="l00661"></a>00661   <span class="comment">// when all signals are connected.</span>
<a name="l00662"></a>00662   enableControls();
<a name="l00663"></a>00663 }
<a name="l00664"></a>00664 
<a name="l00665"></a>00665 
<a name="l00666"></a><a class="code" href="classKMFilterListBox.html#5e7234e20de21dc47c5c4e7916bb1ee5">00666</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#5e7234e20de21dc47c5c4e7916bb1ee5" title="Called from KMFilterDlg.">KMFilterListBox::createFilter</a>( <span class="keyword">const</span> QCString &amp; field,
<a name="l00667"></a>00667                     <span class="keyword">const</span> QString &amp; value )
<a name="l00668"></a>00668 {
<a name="l00669"></a>00669   <a class="code" href="classKMSearchRule.html" title="Incoming mail is sent through the list of mail filter rules before it is placed in...">KMSearchRule</a> *newRule = <a class="code" href="classKMSearchRule.html#de1bc1e12ea216c150c11ec7003942ff" title="Create a search rule of a certain type by instantiating the appro- priate subclass...">KMSearchRule::createInstance</a>( field, KMSearchRule::FuncContains, value );
<a name="l00670"></a>00670 
<a name="l00671"></a>00671   KMFilter *newFilter = <span class="keyword">new</span> KMFilter(0, bPopFilter);
<a name="l00672"></a>00672   newFilter-&gt;pattern()-&gt;append( newRule );
<a name="l00673"></a>00673   newFilter-&gt;pattern()-&gt;setName( QString(<span class="stringliteral">"&lt;%1&gt;:%2"</span>).arg( field ).arg( value) );
<a name="l00674"></a>00674 
<a name="l00675"></a>00675   <a class="code" href="structKMFilterActionDesc.html" title="Auxiliary struct to KMFilterActionDict.">KMFilterActionDesc</a> *desc = (*kmkernel-&gt;filterActionDict())[<span class="stringliteral">"transfer"</span>];
<a name="l00676"></a>00676   <span class="keywordflow">if</span> ( desc )
<a name="l00677"></a>00677     newFilter-&gt;actions()-&gt;append( desc-&gt;<a class="code" href="structKMFilterActionDesc.html#41ec5098c7f8e1c79fa9661b13c07829">create</a>() );
<a name="l00678"></a>00678 
<a name="l00679"></a>00679   insertFilter( newFilter );
<a name="l00680"></a>00680   enableControls();
<a name="l00681"></a>00681 }
<a name="l00682"></a>00682 
<a name="l00683"></a><a class="code" href="classKMFilterListBox.html#59c122807beac41c2a4c362c2d03d065">00683</a> <span class="keywordtype">bool</span> <a class="code" href="classKMFilterListBox.html#59c122807beac41c2a4c362c2d03d065" title="Returns wheather the global option &amp;#39;Show Later Msgs&amp;#39; is set or not.">KMFilterListBox::showLaterMsgs</a>()
<a name="l00684"></a>00684 {
<a name="l00685"></a>00685     <span class="keywordflow">return</span> mShowLater;
<a name="l00686"></a>00686 }
<a name="l00687"></a>00687 
<a name="l00688"></a><a class="code" href="classKMFilterListBox.html#aec541f07c1d4ebbeb08903906755ed9">00688</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#aec541f07c1d4ebbeb08903906755ed9" title="Called when the name of a filter might have changed (e.g.">KMFilterListBox::slotUpdateFilterName</a>()
<a name="l00689"></a>00689 {
<a name="l00690"></a>00690   <a class="code" href="classKMSearchPattern.html" title="This class is an abstraction of a search over messages.">KMSearchPattern</a> *p = <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.at(<a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a>)-&gt;pattern();
<a name="l00691"></a>00691   <span class="keywordflow">if</span> ( !p ) <span class="keywordflow">return</span>;
<a name="l00692"></a>00692 
<a name="l00693"></a>00693   QString shouldBeName = p-&gt;<a class="code" href="classKMSearchPattern.html#4f3ced05235ac6bff9c1f3efa79c2553" title="Get the name of the search pattern.">name</a>();
<a name="l00694"></a>00694   QString displayedName = <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;text( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> );
<a name="l00695"></a>00695 
<a name="l00696"></a>00696   <span class="keywordflow">if</span> ( shouldBeName.stripWhiteSpace().isEmpty() ) {
<a name="l00697"></a>00697     <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.at(<a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a>)-&gt;setAutoNaming( <span class="keyword">true</span> );
<a name="l00698"></a>00698   }
<a name="l00699"></a>00699 
<a name="l00700"></a>00700   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.at(<a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a>)-&gt;isAutoNaming() ) {
<a name="l00701"></a>00701     <span class="comment">// auto-naming of patterns</span>
<a name="l00702"></a>00702     <span class="keywordflow">if</span> ( p-&gt;first() &amp;&amp; !p-&gt;first()-&gt;field().stripWhiteSpace().isEmpty() )
<a name="l00703"></a>00703       shouldBeName = QString( <span class="stringliteral">"&lt;%1&gt;: %2"</span> ).arg( p-&gt;first()-&gt;field() ).arg( p-&gt;first()-&gt;contents() );
<a name="l00704"></a>00704     <span class="keywordflow">else</span>
<a name="l00705"></a>00705       shouldBeName = <span class="stringliteral">"&lt;"</span> + i18n(<span class="stringliteral">"unnamed"</span>) + <span class="stringliteral">"&gt;"</span>;
<a name="l00706"></a>00706     p-&gt;<a class="code" href="classKMSearchPattern.html#022c5bbb5ab6ea11a4eccd2e95ba4faf" title="Set the name of the search pattern.">setName</a>( shouldBeName );
<a name="l00707"></a>00707   }
<a name="l00708"></a>00708 
<a name="l00709"></a>00709   <span class="keywordflow">if</span> ( displayedName == shouldBeName ) <span class="keywordflow">return</span>;
<a name="l00710"></a>00710 
<a name="l00711"></a>00711   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;blockSignals( <span class="keyword">true</span> );
<a name="l00712"></a>00712   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;changeItem( shouldBeName, <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> );
<a name="l00713"></a>00713   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;blockSignals( <span class="keyword">false</span> );
<a name="l00714"></a>00714 }
<a name="l00715"></a>00715 
<a name="l00716"></a><a class="code" href="classKMFilterListBox.html#d556c5f6b0033c103ad0efdb2e3bb407">00716</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#d556c5f6b0033c103ad0efdb2e3bb407" title="Called when the user toggles the &amp;#39;Show Download Later Msgs&amp;#39; Checkbox in the...">KMFilterListBox::slotShowLaterToggled</a>(<span class="keywordtype">bool</span> aOn)
<a name="l00717"></a>00717 {
<a name="l00718"></a>00718   mShowLater = aOn;
<a name="l00719"></a>00719 }
<a name="l00720"></a>00720 
<a name="l00721"></a><a class="code" href="classKMFilterListBox.html#7c9aafd0478a88e6392b5509095fac64">00721</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#7c9aafd0478a88e6392b5509095fac64" title="Called when the user clicks either &amp;#39;Apply&amp;#39; or &amp;#39;OK&amp;#39; in KMFilterDlg...">KMFilterListBox::slotApplyFilterChanges</a>()
<a name="l00722"></a>00722 {
<a name="l00723"></a>00723   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> &gt;= 0 ) {
<a name="l00724"></a>00724     emit <a class="code" href="classKMFilterListBox.html#46074721c41f60021b692fcc7dc7e352" title="Emitted when this widget wants the edit widgets to apply the changes to the current...">applyWidgets</a>();
<a name="l00725"></a>00725     <a class="code" href="classKMFilterListBox.html#50c292994edab13f470d162a4cc5ca3f" title="Called when the user clicks on a filter in the filter list.">slotSelected</a>( <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;currentItem() );
<a name="l00726"></a>00726   }
<a name="l00727"></a>00727 
<a name="l00728"></a>00728   <span class="comment">// by now all edit widgets should have written back</span>
<a name="l00729"></a>00729   <span class="comment">// their widget's data into our filter list.</span>
<a name="l00730"></a>00730 
<a name="l00731"></a>00731   KMFilterMgr *fm;
<a name="l00732"></a>00732   <span class="keywordflow">if</span> (bPopFilter)
<a name="l00733"></a>00733     fm = kmkernel-&gt;popFilterMgr();
<a name="l00734"></a>00734   <span class="keywordflow">else</span>
<a name="l00735"></a>00735     fm = kmkernel-&gt;filterMgr();
<a name="l00736"></a>00736 
<a name="l00737"></a>00737   QValueList&lt;KMFilter*&gt; newFilters = <a class="code" href="classKMFilterListBox.html#2be2ab3c9431ba3e8d014377cc3d1ad7" title="Returns a list of _copies_ of the current list of filters.">filtersForSaving</a>();
<a name="l00738"></a>00738 
<a name="l00739"></a>00739   <span class="keywordflow">if</span> (bPopFilter)
<a name="l00740"></a>00740     fm-&gt;setShowLaterMsgs(mShowLater);
<a name="l00741"></a>00741 
<a name="l00742"></a>00742   fm-&gt;setFilters( newFilters );
<a name="l00743"></a>00743   <span class="keywordflow">if</span> (fm-&gt;atLeastOneOnlineImapFolderTarget()) {
<a name="l00744"></a>00744     QString str = i18n(<span class="stringliteral">"At least one filter targets a folder on an online "</span>
<a name="l00745"></a>00745                <span class="stringliteral">"IMAP account. Such filters will only be applied "</span>
<a name="l00746"></a>00746                <span class="stringliteral">"when manually filtering and when filtering "</span>
<a name="l00747"></a>00747                <span class="stringliteral">"incoming online IMAP mail."</span>);
<a name="l00748"></a>00748     KMessageBox::information( <span class="keyword">this</span>, str, QString::null,
<a name="l00749"></a>00749                   <span class="stringliteral">"filterDlgOnlineImapCheck"</span> );
<a name="l00750"></a>00750   }
<a name="l00751"></a>00751 }
<a name="l00752"></a>00752 
<a name="l00753"></a><a class="code" href="classKMFilterListBox.html#2be2ab3c9431ba3e8d014377cc3d1ad7">00753</a> QValueList&lt;KMFilter*&gt; <a class="code" href="classKMFilterListBox.html#2be2ab3c9431ba3e8d014377cc3d1ad7" title="Returns a list of _copies_ of the current list of filters.">KMFilterListBox::filtersForSaving</a>()<span class="keyword"> const</span>
<a name="l00754"></a>00754 <span class="keyword"></span>{
<a name="l00755"></a>00755       <span class="keyword">const_cast&lt;</span><a class="code" href="classKMFilterListBox.html" title="This is a complex widget that is used to manipulate KMail&amp;#39;s filter list.">KMFilterListBox</a>*<span class="keyword">&gt;</span>( this )-&gt;<a class="code" href="classKMFilterListBox.html#46074721c41f60021b692fcc7dc7e352" title="Emitted when this widget wants the edit widgets to apply the changes to the current...">applyWidgets</a>(); <span class="comment">// signals aren't const</span>
<a name="l00756"></a>00756       QValueList&lt;KMFilter*&gt; filters;
<a name="l00757"></a>00757       QStringList emptyFilters;
<a name="l00758"></a>00758       QPtrListIterator&lt;KMFilter&gt; it( <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a> );
<a name="l00759"></a>00759       <span class="keywordflow">for</span> ( it.toFirst() ; it.current() ; ++it ) {
<a name="l00760"></a>00760         KMFilter *f = <span class="keyword">new</span> KMFilter( **it ); <span class="comment">// deep copy</span>
<a name="l00761"></a>00761         f-&gt;purify();
<a name="l00762"></a>00762         <span class="keywordflow">if</span> ( !f-&gt;isEmpty() )
<a name="l00763"></a>00763           <span class="comment">// the filter is valid:</span>
<a name="l00764"></a>00764           filters.append( f );
<a name="l00765"></a>00765         <span class="keywordflow">else</span> {
<a name="l00766"></a>00766           <span class="comment">// the filter is invalid:</span>
<a name="l00767"></a>00767           emptyFilters &lt;&lt; f-&gt;name();
<a name="l00768"></a>00768           <span class="keyword">delete</span> f;
<a name="l00769"></a>00769         }
<a name="l00770"></a>00770       }
<a name="l00771"></a>00771 
<a name="l00772"></a>00772       <span class="comment">// report on invalid filters:</span>
<a name="l00773"></a>00773       <span class="keywordflow">if</span> ( !emptyFilters.empty() ) {
<a name="l00774"></a>00774         QString msg = i18n(<span class="stringliteral">"The following filters have not been saved because they "</span>
<a name="l00775"></a>00775                    <span class="stringliteral">"were invalid (e.g. containing no actions or no search "</span>
<a name="l00776"></a>00776                    <span class="stringliteral">"rules)."</span>);
<a name="l00777"></a>00777         KMessageBox::informationList( 0, msg, emptyFilters, QString::null,
<a name="l00778"></a>00778                       <span class="stringliteral">"ShowInvalidFilterWarning"</span> );
<a name="l00779"></a>00779       }
<a name="l00780"></a>00780       <span class="keywordflow">return</span> filters;
<a name="l00781"></a>00781 }
<a name="l00782"></a>00782 
<a name="l00783"></a><a class="code" href="classKMFilterListBox.html#50c292994edab13f470d162a4cc5ca3f">00783</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#50c292994edab13f470d162a4cc5ca3f" title="Called when the user clicks on a filter in the filter list.">KMFilterListBox::slotSelected</a>( <span class="keywordtype">int</span> aIdx )
<a name="l00784"></a>00784 {
<a name="l00785"></a>00785   <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> = aIdx;
<a name="l00786"></a>00786   <span class="comment">// QPtrList::at(i) will return 0 if i is out of range.</span>
<a name="l00787"></a>00787   KMFilter *f = <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.at(aIdx);
<a name="l00788"></a>00788   <span class="keywordflow">if</span> ( f )
<a name="l00789"></a>00789     emit <a class="code" href="classKMFilterListBox.html#be9ebad55595ea9a4b8c79ee369d8f73" title="Emitted when a new filter has been selected by the user or if the current filter...">filterSelected</a>( f );
<a name="l00790"></a>00790   <span class="keywordflow">else</span>
<a name="l00791"></a>00791     emit <a class="code" href="classKMFilterListBox.html#a11b511f967873e493c3ab932fecc5c9" title="Emitted when this widget wants the edit widgets to let go of their filter reference...">resetWidgets</a>();
<a name="l00792"></a>00792   enableControls();
<a name="l00793"></a>00793 }
<a name="l00794"></a>00794 
<a name="l00795"></a><a class="code" href="classKMFilterListBox.html#c5a892e3ecfa988ea7fc2747342e6700">00795</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#c5a892e3ecfa988ea7fc2747342e6700" title="Called when the user clicks the &amp;#39;New&amp;#39; button.">KMFilterListBox::slotNew</a>()
<a name="l00796"></a>00796 {
<a name="l00797"></a>00797   <span class="comment">// just insert a new filter.</span>
<a name="l00798"></a>00798   insertFilter( <span class="keyword">new</span> KMFilter(0, bPopFilter) );
<a name="l00799"></a>00799   enableControls();
<a name="l00800"></a>00800 }
<a name="l00801"></a>00801 
<a name="l00802"></a><a class="code" href="classKMFilterListBox.html#bc73b24167aca620c638bc1274daa5b4">00802</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#bc73b24167aca620c638bc1274daa5b4" title="Called when the user clicks the &amp;#39;Copy&amp;#39; button.">KMFilterListBox::slotCopy</a>()
<a name="l00803"></a>00803 {
<a name="l00804"></a>00804   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> &lt; 0 ) {
<a name="l00805"></a>00805     kdDebug(5006) &lt;&lt; <span class="stringliteral">"KMFilterListBox::slotCopy called while no filter is selected, ignoring."</span> &lt;&lt; endl;
<a name="l00806"></a>00806     <span class="keywordflow">return</span>;
<a name="l00807"></a>00807   }
<a name="l00808"></a>00808 
<a name="l00809"></a>00809   <span class="comment">// make sure that all changes are written to the filter before we copy it</span>
<a name="l00810"></a>00810   emit <a class="code" href="classKMFilterListBox.html#46074721c41f60021b692fcc7dc7e352" title="Emitted when this widget wants the edit widgets to apply the changes to the current...">applyWidgets</a>();
<a name="l00811"></a>00811 
<a name="l00812"></a>00812   KMFilter *filter = <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.at( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> );
<a name="l00813"></a>00813 
<a name="l00814"></a>00814   <span class="comment">// enableControls should make sure this method is</span>
<a name="l00815"></a>00815   <span class="comment">// never called when no filter is selected.</span>
<a name="l00816"></a>00816   assert( filter );
<a name="l00817"></a>00817 
<a name="l00818"></a>00818   <span class="comment">// inserts a copy of the current filter.</span>
<a name="l00819"></a>00819   insertFilter( <span class="keyword">new</span> KMFilter( *filter ) );
<a name="l00820"></a>00820   enableControls();
<a name="l00821"></a>00821 }
<a name="l00822"></a>00822 
<a name="l00823"></a><a class="code" href="classKMFilterListBox.html#d4d0fc3ce484b5af34a67194b9a2587d">00823</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#d4d0fc3ce484b5af34a67194b9a2587d" title="Called when the user clicks the &amp;#39;Delete&amp;#39; button.">KMFilterListBox::slotDelete</a>()
<a name="l00824"></a>00824 {
<a name="l00825"></a>00825   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> &lt; 0 ) {
<a name="l00826"></a>00826     kdDebug(5006) &lt;&lt; <span class="stringliteral">"KMFilterListBox::slotDelete called while no filter is selected, ignoring."</span> &lt;&lt; endl;
<a name="l00827"></a>00827     <span class="keywordflow">return</span>;
<a name="l00828"></a>00828   }
<a name="l00829"></a>00829 
<a name="l00830"></a>00830   <span class="keywordtype">int</span> oIdxSelItem = <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a>;
<a name="l00831"></a>00831   <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> = -1;
<a name="l00832"></a>00832   <span class="comment">// unselect all</span>
<a name="l00833"></a>00833   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;selectAll( <span class="keyword">false</span> );
<a name="l00834"></a>00834   <span class="comment">// broadcast that all widgets let go</span>
<a name="l00835"></a>00835   <span class="comment">// of the filter</span>
<a name="l00836"></a>00836   emit <a class="code" href="classKMFilterListBox.html#a11b511f967873e493c3ab932fecc5c9" title="Emitted when this widget wants the edit widgets to let go of their filter reference...">resetWidgets</a>();
<a name="l00837"></a>00837 
<a name="l00838"></a>00838   <span class="comment">// remove the filter from both the filter list...</span>
<a name="l00839"></a>00839   <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.remove( oIdxSelItem );
<a name="l00840"></a>00840   <span class="comment">// and the listbox</span>
<a name="l00841"></a>00841   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;removeItem( oIdxSelItem );
<a name="l00842"></a>00842 
<a name="l00843"></a>00843   <span class="keywordtype">int</span> count = (int)<a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;count();
<a name="l00844"></a>00844   <span class="comment">// and set the new current item.</span>
<a name="l00845"></a>00845   <span class="keywordflow">if</span> ( count &gt; oIdxSelItem )
<a name="l00846"></a>00846     <span class="comment">// oIdxItem is still a valid index</span>
<a name="l00847"></a>00847     <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;setSelected( oIdxSelItem, <span class="keyword">true</span> );
<a name="l00848"></a>00848   <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( count )
<a name="l00849"></a>00849     <span class="comment">// oIdxSelIdx is no longer valid, but the</span>
<a name="l00850"></a>00850     <span class="comment">// list box isn't empty</span>
<a name="l00851"></a>00851     <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;setSelected( count - 1, <span class="keyword">true</span> );
<a name="l00852"></a>00852   <span class="comment">// the list is empty - keep index -1</span>
<a name="l00853"></a>00853 
<a name="l00854"></a>00854   enableControls();
<a name="l00855"></a>00855 }
<a name="l00856"></a>00856 
<a name="l00857"></a><a class="code" href="classKMFilterListBox.html#0b73bde8a52220cbe1a1eaf087395149">00857</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#0b73bde8a52220cbe1a1eaf087395149" title="Called when the user clicks the &amp;#39;Top&amp;#39; button.">KMFilterListBox::slotTop</a>()
<a name="l00858"></a>00858 {
<a name="l00859"></a>00859   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> &lt; 0 ) {
<a name="l00860"></a>00860     kdDebug(5006) &lt;&lt; <span class="stringliteral">"KMFilterListBox::slotTop called while no filter is selected, ignoring."</span> &lt;&lt; endl;
<a name="l00861"></a>00861     <span class="keywordflow">return</span>;
<a name="l00862"></a>00862   }
<a name="l00863"></a>00863   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> == 0 ) {
<a name="l00864"></a>00864     kdDebug(5006) &lt;&lt; <span class="stringliteral">"KMFilterListBox::slotTop called while the _topmost_ filter is selected, ignoring."</span> &lt;&lt; endl;
<a name="l00865"></a>00865     <span class="keywordflow">return</span>;
<a name="l00866"></a>00866   }
<a name="l00867"></a>00867 
<a name="l00868"></a>00868   swapFilters( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a>, 0 );
<a name="l00869"></a>00869   enableControls();
<a name="l00870"></a>00870 }
<a name="l00871"></a>00871 
<a name="l00872"></a><a class="code" href="classKMFilterListBox.html#7cbba8f9cb4fdb7f32086a24f36f0019">00872</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#7cbba8f9cb4fdb7f32086a24f36f0019" title="Called when the user clicks the &amp;#39;Up&amp;#39; button.">KMFilterListBox::slotUp</a>()
<a name="l00873"></a>00873 {
<a name="l00874"></a>00874   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> &lt; 0 ) {
<a name="l00875"></a>00875     kdDebug(5006) &lt;&lt; <span class="stringliteral">"KMFilterListBox::slotUp called while no filter is selected, ignoring."</span> &lt;&lt; endl;
<a name="l00876"></a>00876     <span class="keywordflow">return</span>;
<a name="l00877"></a>00877   }
<a name="l00878"></a>00878   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> == 0 ) {
<a name="l00879"></a>00879     kdDebug(5006) &lt;&lt; <span class="stringliteral">"KMFilterListBox::slotUp called while the _topmost_ filter is selected, ignoring."</span> &lt;&lt; endl;
<a name="l00880"></a>00880     <span class="keywordflow">return</span>;
<a name="l00881"></a>00881   }
<a name="l00882"></a>00882 
<a name="l00883"></a>00883   swapNeighbouringFilters( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a>, <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> - 1 );
<a name="l00884"></a>00884   enableControls();
<a name="l00885"></a>00885 }
<a name="l00886"></a>00886 
<a name="l00887"></a><a class="code" href="classKMFilterListBox.html#aae321b0189bae337ebeb07933b0ae3b">00887</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#aae321b0189bae337ebeb07933b0ae3b" title="Called when the user clicks the &amp;#39;Down&amp;#39; button.">KMFilterListBox::slotDown</a>()
<a name="l00888"></a>00888 {
<a name="l00889"></a>00889   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> &lt; 0 ) {
<a name="l00890"></a>00890     kdDebug(5006) &lt;&lt; <span class="stringliteral">"KMFilterListBox::slotDown called while no filter is selected, ignoring."</span> &lt;&lt; endl;
<a name="l00891"></a>00891     <span class="keywordflow">return</span>;
<a name="l00892"></a>00892   }
<a name="l00893"></a>00893   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> == (<span class="keywordtype">int</span>)<a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;count() - 1 ) {
<a name="l00894"></a>00894     kdDebug(5006) &lt;&lt; <span class="stringliteral">"KMFilterListBox::slotDown called while the _last_ filter is selected, ignoring."</span> &lt;&lt; endl;
<a name="l00895"></a>00895     <span class="keywordflow">return</span>;
<a name="l00896"></a>00896   }
<a name="l00897"></a>00897 
<a name="l00898"></a>00898   swapNeighbouringFilters( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a>, <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> + 1);
<a name="l00899"></a>00899   enableControls();
<a name="l00900"></a>00900 }
<a name="l00901"></a>00901 
<a name="l00902"></a><a class="code" href="classKMFilterListBox.html#3fb4f13c806d89de48d63b6281a24622">00902</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#3fb4f13c806d89de48d63b6281a24622" title="Called when the user clicks the &amp;#39;Bottom&amp;#39; button.">KMFilterListBox::slotBottom</a>()
<a name="l00903"></a>00903 {
<a name="l00904"></a>00904   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> &lt; 0 ) {
<a name="l00905"></a>00905     kdDebug(5006) &lt;&lt; <span class="stringliteral">"KMFilterListBox::slotBottom called while no filter is selected, ignoring."</span> &lt;&lt; endl;
<a name="l00906"></a>00906     <span class="keywordflow">return</span>;
<a name="l00907"></a>00907   }
<a name="l00908"></a>00908   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> == (<span class="keywordtype">int</span>)<a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;count() - 1 ) {
<a name="l00909"></a>00909     kdDebug(5006) &lt;&lt; <span class="stringliteral">"KMFilterListBox::slotBottom called while the _last_ filter is selected, ignoring."</span> &lt;&lt; endl;
<a name="l00910"></a>00910     <span class="keywordflow">return</span>;
<a name="l00911"></a>00911   }
<a name="l00912"></a>00912 
<a name="l00913"></a>00913   swapFilters( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a>, <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;count()-1 );
<a name="l00914"></a>00914   enableControls();
<a name="l00915"></a>00915 }
<a name="l00916"></a>00916 
<a name="l00917"></a><a class="code" href="classKMFilterListBox.html#72c6df5d14b8911c8dd43a12d5de8b49">00917</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#72c6df5d14b8911c8dd43a12d5de8b49" title="Called when the user clicks the &amp;#39;Rename&amp;#39; button.">KMFilterListBox::slotRename</a>()
<a name="l00918"></a>00918 {
<a name="l00919"></a>00919   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> &lt; 0 ) {
<a name="l00920"></a>00920     kdDebug(5006) &lt;&lt; <span class="stringliteral">"KMFilterListBox::slotRename called while no filter is selected, ignoring."</span> &lt;&lt; endl;
<a name="l00921"></a>00921     <span class="keywordflow">return</span>;
<a name="l00922"></a>00922   }
<a name="l00923"></a>00923 
<a name="l00924"></a>00924   <span class="keywordtype">bool</span> okPressed =  false ;
<a name="l00925"></a>00925   KMFilter *filter = <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.at( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> );
<a name="l00926"></a>00926 
<a name="l00927"></a>00927   <span class="comment">// enableControls should make sure this method is</span>
<a name="l00928"></a>00928   <span class="comment">// never called when no filter is selected.</span>
<a name="l00929"></a>00929   assert( filter );
<a name="l00930"></a>00930 
<a name="l00931"></a>00931   <span class="comment">// allow empty names - those will turn auto-naming on again</span>
<a name="l00932"></a>00932   QValidator *validator = <span class="keyword">new</span> QRegExpValidator( QRegExp( <span class="stringliteral">".*"</span> ), 0 );
<a name="l00933"></a>00933   QString newName = KInputDialog::getText
<a name="l00934"></a>00934     (
<a name="l00935"></a>00935      i18n(<span class="stringliteral">"Rename Filter"</span>),
<a name="l00936"></a>00936      i18n(<span class="stringliteral">"Rename filter \"%1\" to:\n(leave the field empty for automatic naming)"</span>)
<a name="l00937"></a>00937         .arg( filter-&gt;pattern()-&gt;name() ) <span class="comment">/*label*/</span>,
<a name="l00938"></a>00938      filter-&gt;pattern()-&gt;name() <span class="comment">/* initial value */</span>,
<a name="l00939"></a>00939      &amp;okPressed, topLevelWidget(), 0, validator
<a name="l00940"></a>00940      );
<a name="l00941"></a>00941   <span class="keyword">delete</span> validator;
<a name="l00942"></a>00942 
<a name="l00943"></a>00943   <span class="keywordflow">if</span> ( !okPressed ) <span class="keywordflow">return</span>;
<a name="l00944"></a>00944 
<a name="l00945"></a>00945   <span class="keywordflow">if</span> ( newName.isEmpty() ) {
<a name="l00946"></a>00946     <span class="comment">// bait for slotUpdateFilterName to</span>
<a name="l00947"></a>00947     <span class="comment">// use automatic naming again.</span>
<a name="l00948"></a>00948     filter-&gt;pattern()-&gt;setName( <span class="stringliteral">"&lt;&gt;"</span> );
<a name="l00949"></a>00949     filter-&gt;setAutoNaming( <span class="keyword">true</span> );
<a name="l00950"></a>00950   } <span class="keywordflow">else</span> {
<a name="l00951"></a>00951     filter-&gt;pattern()-&gt;setName( newName );
<a name="l00952"></a>00952     filter-&gt;setAutoNaming( <span class="keyword">false</span> );
<a name="l00953"></a>00953   }
<a name="l00954"></a>00954 
<a name="l00955"></a>00955   <a class="code" href="classKMFilterListBox.html#aec541f07c1d4ebbeb08903906755ed9" title="Called when the name of a filter might have changed (e.g.">slotUpdateFilterName</a>();
<a name="l00956"></a>00956 }
<a name="l00957"></a>00957 
<a name="l00958"></a>00958 <span class="keywordtype">void</span> KMFilterListBox::enableControls()
<a name="l00959"></a>00959 {
<a name="l00960"></a>00960   <span class="keywordtype">bool</span> theFirst = ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> == 0 );
<a name="l00961"></a>00961   <span class="keywordtype">bool</span> theLast = ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> &gt;= (int)<a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.count() - 1 );
<a name="l00962"></a>00962   <span class="keywordtype">bool</span> aFilterIsSelected = ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> &gt;= 0 );
<a name="l00963"></a>00963 
<a name="l00964"></a>00964   mBtnTop-&gt;setEnabled( aFilterIsSelected &amp;&amp; !theFirst );
<a name="l00965"></a>00965   mBtnUp-&gt;setEnabled( aFilterIsSelected &amp;&amp; !theFirst );
<a name="l00966"></a>00966   mBtnDown-&gt;setEnabled( aFilterIsSelected &amp;&amp; !theLast );
<a name="l00967"></a>00967   mBtnBot-&gt;setEnabled( aFilterIsSelected &amp;&amp; !theLast );
<a name="l00968"></a>00968   mBtnCopy-&gt;setEnabled( aFilterIsSelected );
<a name="l00969"></a>00969   mBtnDelete-&gt;setEnabled( aFilterIsSelected );
<a name="l00970"></a>00970   mBtnRename-&gt;setEnabled( aFilterIsSelected );
<a name="l00971"></a>00971 
<a name="l00972"></a>00972   <span class="keywordflow">if</span> ( aFilterIsSelected )
<a name="l00973"></a>00973     <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;ensureCurrentVisible();
<a name="l00974"></a>00974 }
<a name="l00975"></a>00975 
<a name="l00976"></a><a class="code" href="classKMFilterListBox.html#4bd8149655e847c393f5328bf9386343">00976</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterListBox.html#4bd8149655e847c393f5328bf9386343" title="Loads the filter list and selects the first filter.">KMFilterListBox::loadFilterList</a>( <span class="keywordtype">bool</span> createDummyFilter )
<a name="l00977"></a>00977 {
<a name="l00978"></a>00978   assert(<a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>);
<a name="l00979"></a>00979   setEnabled( <span class="keyword">false</span> );
<a name="l00980"></a>00980   emit <a class="code" href="classKMFilterListBox.html#a11b511f967873e493c3ab932fecc5c9" title="Emitted when this widget wants the edit widgets to let go of their filter reference...">resetWidgets</a>();
<a name="l00981"></a>00981   <span class="comment">// we don't want the insertion to</span>
<a name="l00982"></a>00982   <span class="comment">// cause flicker in the edit widgets.</span>
<a name="l00983"></a>00983   blockSignals( <span class="keyword">true</span> );
<a name="l00984"></a>00984 
<a name="l00985"></a>00985   <span class="comment">// clear both lists</span>
<a name="l00986"></a>00986   <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.clear();
<a name="l00987"></a>00987   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;clear();
<a name="l00988"></a>00988 
<a name="l00989"></a>00989   <span class="keyword">const</span> KMFilterMgr *manager = 0;
<a name="l00990"></a>00990   <span class="keywordflow">if</span>(bPopFilter)
<a name="l00991"></a>00991   {
<a name="l00992"></a>00992     mShowLater = kmkernel-&gt;popFilterMgr()-&gt;showLaterMsgs();
<a name="l00993"></a>00993     manager = kmkernel-&gt;popFilterMgr();
<a name="l00994"></a>00994   }
<a name="l00995"></a>00995   <span class="keywordflow">else</span>
<a name="l00996"></a>00996   {
<a name="l00997"></a>00997     manager = kmkernel-&gt;filterMgr();
<a name="l00998"></a>00998   }
<a name="l00999"></a>00999   Q_ASSERT( manager );
<a name="l01000"></a>01000 
<a name="l01001"></a>01001   QValueListConstIterator&lt;KMFilter*&gt; it;
<a name="l01002"></a>01002   <span class="keywordflow">for</span> ( it = manager-&gt;filters().constBegin() ; it != manager-&gt;filters().constEnd() ; ++it ) {
<a name="l01003"></a>01003     <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.append( <span class="keyword">new</span> KMFilter( **it ) ); <span class="comment">// deep copy</span>
<a name="l01004"></a>01004     <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;insertItem( (*it)-&gt;pattern()-&gt;name() );
<a name="l01005"></a>01005   }
<a name="l01006"></a>01006 
<a name="l01007"></a>01007   blockSignals( <span class="keyword">false</span> );
<a name="l01008"></a>01008   setEnabled( <span class="keyword">true</span> );
<a name="l01009"></a>01009 
<a name="l01010"></a>01010   <span class="comment">// create an empty filter when there's none, to avoid a completely</span>
<a name="l01011"></a>01011   <span class="comment">// disabled dialog (usability tests indicated that the new-filter</span>
<a name="l01012"></a>01012   <span class="comment">// button is too hard to find that way):</span>
<a name="l01013"></a>01013   <span class="keywordflow">if</span> ( !<a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;count() &amp;&amp; createDummyFilter )
<a name="l01014"></a>01014     <a class="code" href="classKMFilterListBox.html#c5a892e3ecfa988ea7fc2747342e6700" title="Called when the user clicks the &amp;#39;New&amp;#39; button.">slotNew</a>();
<a name="l01015"></a>01015 
<a name="l01016"></a>01016   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;count() &gt; 0 )
<a name="l01017"></a>01017     <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;setSelected( 0, <span class="keyword">true</span> );
<a name="l01018"></a>01018 
<a name="l01019"></a>01019   enableControls();
<a name="l01020"></a>01020 }
<a name="l01021"></a>01021 
<a name="l01022"></a>01022 <span class="keywordtype">void</span> KMFilterListBox::insertFilter( KMFilter* aFilter )
<a name="l01023"></a>01023 {
<a name="l01024"></a>01024   <span class="comment">// must be really a filter...</span>
<a name="l01025"></a>01025   assert( aFilter );
<a name="l01026"></a>01026 
<a name="l01027"></a>01027   <span class="comment">// if mIdxSelItem &lt; 0, QListBox::insertItem will append.</span>
<a name="l01028"></a>01028   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;insertItem( aFilter-&gt;pattern()-&gt;name(), <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> );
<a name="l01029"></a>01029   <span class="keywordflow">if</span> ( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> &lt; 0 ) {
<a name="l01030"></a>01030     <span class="comment">// none selected -&gt; append</span>
<a name="l01031"></a>01031     <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.append( aFilter );
<a name="l01032"></a>01032     <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;setSelected( <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;count() - 1, true );
<a name="l01033"></a>01033     <span class="comment">//    slotSelected( mListBox-&gt;count() - 1 );</span>
<a name="l01034"></a>01034   } <span class="keywordflow">else</span> {
<a name="l01035"></a>01035     <span class="comment">// insert just before selected</span>
<a name="l01036"></a>01036     <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.insert( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a>, aFilter );
<a name="l01037"></a>01037     <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;setSelected( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a>, <span class="keyword">true</span> );
<a name="l01038"></a>01038     <span class="comment">//    slotSelected( mIdxSelItem );</span>
<a name="l01039"></a>01039   }
<a name="l01040"></a>01040 
<a name="l01041"></a>01041 }
<a name="l01042"></a>01042 
<a name="l01043"></a>01043 <span class="keywordtype">void</span> KMFilterListBox::appendFilter( KMFilter* aFilter )
<a name="l01044"></a>01044 {
<a name="l01045"></a>01045     <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.append( aFilter );
<a name="l01046"></a>01046     <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;insertItem( aFilter-&gt;pattern()-&gt;name(), -1 );
<a name="l01047"></a>01047 }
<a name="l01048"></a>01048 
<a name="l01049"></a>01049 <span class="keywordtype">void</span> KMFilterListBox::swapNeighbouringFilters( <span class="keywordtype">int</span> untouchedOne, <span class="keywordtype">int</span> movedOne )
<a name="l01050"></a>01050 {
<a name="l01051"></a>01051   <span class="comment">// must be neighbours...</span>
<a name="l01052"></a>01052   assert( untouchedOne - movedOne == 1 || movedOne - untouchedOne == 1 );
<a name="l01053"></a>01053 
<a name="l01054"></a>01054   <span class="comment">// untouchedOne is at idx. to move it down(up),</span>
<a name="l01055"></a>01055   <span class="comment">// remove item at idx+(-)1 w/o deleting it.</span>
<a name="l01056"></a>01056   QListBoxItem *item = <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;item( movedOne );
<a name="l01057"></a>01057   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;takeItem( item );
<a name="l01058"></a>01058   <span class="comment">// now selected item is at idx(idx-1), so</span>
<a name="l01059"></a>01059   <span class="comment">// insert the other item at idx, ie. above(below).</span>
<a name="l01060"></a>01060   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;insertItem( item, untouchedOne );
<a name="l01061"></a>01061 
<a name="l01062"></a>01062   KMFilter* filter = <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.take( movedOne );
<a name="l01063"></a>01063   <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.insert( untouchedOne, filter );
<a name="l01064"></a>01064 
<a name="l01065"></a>01065   <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> += movedOne - untouchedOne;
<a name="l01066"></a>01066 }
<a name="l01067"></a>01067 
<a name="l01068"></a>01068 <span class="keywordtype">void</span> KMFilterListBox::swapFilters( <span class="keywordtype">int</span> from, <span class="keywordtype">int</span> to )
<a name="l01069"></a>01069 {
<a name="l01070"></a>01070   QListBoxItem *item = <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;item( from );
<a name="l01071"></a>01071   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;takeItem( item );
<a name="l01072"></a>01072   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;insertItem( item, to );
<a name="l01073"></a>01073 
<a name="l01074"></a>01074   KMFilter* filter = <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.take( from );
<a name="l01075"></a>01075   <a class="code" href="classKMFilterListBox.html#b9c09b6e7f58ae24a80886f1c5e7aefe" title="The deep copy of the filter list.">mFilterList</a>.insert( to, filter );
<a name="l01076"></a>01076 
<a name="l01077"></a>01077   <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> = to;
<a name="l01078"></a>01078   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;setCurrentItem( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a> );
<a name="l01079"></a>01079   <a class="code" href="classKMFilterListBox.html#7165d79f98c7f134321483e891238234" title="The listbox displaying the filter list.">mListBox</a>-&gt;setSelected( <a class="code" href="classKMFilterListBox.html#cdd851c49f03a4a48c2e5db3ad9a4293" title="The index of the currently selected item.">mIdxSelItem</a>, <span class="keyword">true</span> );
<a name="l01080"></a>01080 }
<a name="l01081"></a>01081 
<a name="l01082"></a>01082 <span class="comment">//=============================================================================</span>
<a name="l01083"></a>01083 <span class="comment">//</span>
<a name="l01084"></a>01084 <span class="comment">// class KMFilterActionWidget</span>
<a name="l01085"></a>01085 <span class="comment">//</span>
<a name="l01086"></a>01086 <span class="comment">//=============================================================================</span>
<a name="l01087"></a>01087 
<a name="l01088"></a><a class="code" href="classKMFilterActionWidget.html#346ea2075fc411450df7d38a3781fc83">01088</a> <a class="code" href="classKMFilterActionWidget.html#346ea2075fc411450df7d38a3781fc83" title="Constructor.">KMFilterActionWidget::KMFilterActionWidget</a>( QWidget *parent, <span class="keyword">const</span> <span class="keywordtype">char</span>* name )
<a name="l01089"></a>01089   : QHBox( parent, name )
<a name="l01090"></a>01090 {
<a name="l01091"></a>01091   <span class="keywordtype">int</span> i;
<a name="l01092"></a>01092   mActionList.setAutoDelete( <span class="keyword">true</span> );
<a name="l01093"></a>01093 
<a name="l01094"></a>01094   mComboBox = <span class="keyword">new</span> QComboBox(  <span class="keyword">false</span> , <span class="keyword">this</span> );
<a name="l01095"></a>01095   assert( mComboBox );
<a name="l01096"></a>01096   mWidgetStack = <span class="keyword">new</span> QWidgetStack(<span class="keyword">this</span>);
<a name="l01097"></a>01097   assert( mWidgetStack );
<a name="l01098"></a>01098 
<a name="l01099"></a>01099   setSpacing( 4 );
<a name="l01100"></a>01100 
<a name="l01101"></a>01101   QPtrListIterator&lt;KMFilterActionDesc&gt; it ( kmkernel-&gt;filterActionDict()-&gt;list() );
<a name="l01102"></a>01102   <span class="keywordflow">for</span> ( i=0, it.toFirst() ; it.current() ; ++it, ++i ) {
<a name="l01103"></a>01103     <span class="comment">//create an instance:</span>
<a name="l01104"></a>01104     <a class="code" href="classKMFilterAction.html" title="Abstract base class for KMail&amp;#39;s filter actions.">KMFilterAction</a> *a = (*it)-&gt;create();
<a name="l01105"></a>01105     <span class="comment">// append to the list of actions:</span>
<a name="l01106"></a>01106     mActionList.append( a );
<a name="l01107"></a>01107     <span class="comment">// add parameter widget to widget stack:</span>
<a name="l01108"></a>01108     mWidgetStack-&gt;addWidget( a-&gt;<a class="code" href="classKMFilterAction.html#db348aaf173031b4b47493ea6e5151b5" title="Creates a widget for setting the filter action parameter.">createParamWidget</a>( mWidgetStack ), i );
<a name="l01109"></a>01109     <span class="comment">// add (i18n-ized) name to combo box</span>
<a name="l01110"></a>01110     mComboBox-&gt;insertItem( (*it)-&gt;label );
<a name="l01111"></a>01111   }
<a name="l01112"></a>01112   <span class="comment">// widget for the case where no action is selected.</span>
<a name="l01113"></a>01113   mWidgetStack-&gt;addWidget( <span class="keyword">new</span> QLabel( i18n(<span class="stringliteral">"Please select an action."</span>), mWidgetStack ), i );
<a name="l01114"></a>01114   mWidgetStack-&gt;raiseWidget(i);
<a name="l01115"></a>01115   mComboBox-&gt;insertItem( <span class="stringliteral">" "</span> );
<a name="l01116"></a>01116   mComboBox-&gt;setCurrentItem(i);
<a name="l01117"></a>01117 
<a name="l01118"></a>01118   <span class="comment">// don't show scroll bars.</span>
<a name="l01119"></a>01119   mComboBox-&gt;setSizeLimit( mComboBox-&gt;count() );
<a name="l01120"></a>01120   <span class="comment">// layout management:</span>
<a name="l01121"></a>01121   <span class="comment">// o the combo box is not to be made larger than it's sizeHint(),</span>
<a name="l01122"></a>01122   <span class="comment">//   the parameter widget should grow instead.</span>
<a name="l01123"></a>01123   <span class="comment">// o the whole widget takes all space horizontally, but is fixed vertically.</span>
<a name="l01124"></a>01124   mComboBox-&gt;adjustSize();
<a name="l01125"></a>01125   mComboBox-&gt;setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
<a name="l01126"></a>01126   setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) );
<a name="l01127"></a>01127   updateGeometry();
<a name="l01128"></a>01128 
<a name="l01129"></a>01129   <span class="comment">// redirect focus to the filter action combo box</span>
<a name="l01130"></a>01130   setFocusProxy( mComboBox );
<a name="l01131"></a>01131 
<a name="l01132"></a>01132   <span class="comment">// now connect the combo box and the widget stack</span>
<a name="l01133"></a>01133   connect( mComboBox, SIGNAL(activated(<span class="keywordtype">int</span>)),
<a name="l01134"></a>01134        mWidgetStack, SLOT(raiseWidget(<span class="keywordtype">int</span>)) );
<a name="l01135"></a>01135 }
<a name="l01136"></a>01136 
<a name="l01137"></a><a class="code" href="classKMFilterActionWidget.html#0a3e57fa236802c80aeb68df01112e3f">01137</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterActionWidget.html#0a3e57fa236802c80aeb68df01112e3f" title="Set an action.">KMFilterActionWidget::setAction</a>( <span class="keyword">const</span> <a class="code" href="classKMFilterAction.html" title="Abstract base class for KMail&amp;#39;s filter actions.">KMFilterAction</a>* aAction )
<a name="l01138"></a>01138 {
<a name="l01139"></a>01139   <span class="keywordtype">int</span> i=0;
<a name="l01140"></a>01140   <span class="keywordtype">bool</span> found =  false ;
<a name="l01141"></a>01141   <span class="keywordtype">int</span> count = mComboBox-&gt;count() - 1 ; <span class="comment">// last entry is the empty one</span>
<a name="l01142"></a>01142   QString label = ( aAction ) ? aAction-&gt;<a class="code" href="classKMFilterAction.html#9400f2af5575088a32bd46231c3c763b" title="Returns nationalized label, ie.">label</a>() : QString::null ;
<a name="l01143"></a>01143 
<a name="l01144"></a>01144   <span class="comment">// find the index of typeOf(aAction) in mComboBox</span>
<a name="l01145"></a>01145   <span class="comment">// and clear the other widgets on the way.</span>
<a name="l01146"></a>01146   <span class="keywordflow">for</span> ( ; i &lt; count ; i++ )
<a name="l01147"></a>01147     <span class="keywordflow">if</span> ( aAction &amp;&amp; mComboBox-&gt;text(i) == label ) {
<a name="l01148"></a>01148       <span class="comment">//...set the parameter widget to the settings</span>
<a name="l01149"></a>01149       <span class="comment">// of aAction...</span>
<a name="l01150"></a>01150       aAction-&gt;<a class="code" href="classKMFilterAction.html#c7f7f473f1912cc86921ff32a836945d" title="The filter action shall set it&amp;#39;s widget&amp;#39;s contents from it&amp;#39;s parameter...">setParamWidgetValue</a>( mWidgetStack-&gt;widget(i) );
<a name="l01151"></a>01151       <span class="comment">//...and show the correct entry of</span>
<a name="l01152"></a>01152       <span class="comment">// the combo box</span>
<a name="l01153"></a>01153       mComboBox-&gt;setCurrentItem(i); <span class="comment">// (mm) also raise the widget, but doesn't</span>
<a name="l01154"></a>01154       mWidgetStack-&gt;raiseWidget(i);
<a name="l01155"></a>01155       found = <span class="keyword">true</span>;
<a name="l01156"></a>01156     } <span class="keywordflow">else</span> <span class="comment">// clear the parameter widget</span>
<a name="l01157"></a>01157       mActionList.at(i)-&gt;clearParamWidget( mWidgetStack-&gt;widget(i) );
<a name="l01158"></a>01158   <span class="keywordflow">if</span> ( found ) <span class="keywordflow">return</span>;
<a name="l01159"></a>01159 
<a name="l01160"></a>01160   <span class="comment">// not found, so set the empty widget</span>
<a name="l01161"></a>01161   mComboBox-&gt;setCurrentItem( count ); <span class="comment">// last item</span>
<a name="l01162"></a>01162   mWidgetStack-&gt;raiseWidget( count) ;
<a name="l01163"></a>01163 }
<a name="l01164"></a>01164 
<a name="l01165"></a><a class="code" href="classKMFilterActionWidget.html#8a1ac6e65cd10a38313a4d12774d8dad">01165</a> <a class="code" href="classKMFilterAction.html" title="Abstract base class for KMail&amp;#39;s filter actions.">KMFilterAction</a> * <a class="code" href="classKMFilterActionWidget.html#8a1ac6e65cd10a38313a4d12774d8dad" title="Retrieve the action.">KMFilterActionWidget::action</a>()
<a name="l01166"></a>01166 {
<a name="l01167"></a>01167   <span class="comment">// look up the action description via the label</span>
<a name="l01168"></a>01168   <span class="comment">// returned by QComboBox::currentText()...</span>
<a name="l01169"></a>01169   <a class="code" href="structKMFilterActionDesc.html" title="Auxiliary struct to KMFilterActionDict.">KMFilterActionDesc</a> *desc = (*kmkernel-&gt;filterActionDict())[ mComboBox-&gt;currentText() ];
<a name="l01170"></a>01170   <span class="keywordflow">if</span> ( desc ) {
<a name="l01171"></a>01171     <span class="comment">// ...create an instance...</span>
<a name="l01172"></a>01172     <a class="code" href="classKMFilterAction.html" title="Abstract base class for KMail&amp;#39;s filter actions.">KMFilterAction</a> *fa = desc-&gt;<a class="code" href="structKMFilterActionDesc.html#41ec5098c7f8e1c79fa9661b13c07829">create</a>();
<a name="l01173"></a>01173     <span class="keywordflow">if</span> ( fa ) {
<a name="l01174"></a>01174       <span class="comment">// ...and apply the setting of the parameter widget.</span>
<a name="l01175"></a>01175       fa-&gt;<a class="code" href="classKMFilterAction.html#d4bd86ff6495ca6034140833b0a63aa0" title="The filter action shall set it&amp;#39;s parameter from the widget&amp;#39;s contents.">applyParamWidgetValue</a>( mWidgetStack-&gt;visibleWidget() );
<a name="l01176"></a>01176       <span class="keywordflow">return</span> fa;
<a name="l01177"></a>01177     }
<a name="l01178"></a>01178   }
<a name="l01179"></a>01179 
<a name="l01180"></a>01180   <span class="keywordflow">return</span> 0;
<a name="l01181"></a>01181 }
<a name="l01182"></a>01182 
<a name="l01183"></a>01183 <span class="comment">//=============================================================================</span>
<a name="l01184"></a>01184 <span class="comment">//</span>
<a name="l01185"></a>01185 <span class="comment">// class KMFilterActionWidgetLister (the filter action editor)</span>
<a name="l01186"></a>01186 <span class="comment">//</span>
<a name="l01187"></a>01187 <span class="comment">//=============================================================================</span>
<a name="l01188"></a>01188 
<a name="l01189"></a>01189 KMFilterActionWidgetLister::KMFilterActionWidgetLister( QWidget *parent, <span class="keyword">const</span> <span class="keywordtype">char</span>* name )
<a name="l01190"></a>01190   : KWidgetLister( 1, FILTER_MAX_ACTIONS, parent, name )
<a name="l01191"></a>01191 {
<a name="l01192"></a>01192   mActionList = 0;
<a name="l01193"></a>01193 }
<a name="l01194"></a>01194 
<a name="l01195"></a>01195 KMFilterActionWidgetLister::~KMFilterActionWidgetLister()
<a name="l01196"></a>01196 {
<a name="l01197"></a>01197 }
<a name="l01198"></a>01198 
<a name="l01199"></a>01199 <span class="keywordtype">void</span> KMFilterActionWidgetLister::setActionList( QPtrList&lt;KMFilterAction&gt; *aList )
<a name="l01200"></a>01200 {
<a name="l01201"></a>01201   assert ( aList );
<a name="l01202"></a>01202 
<a name="l01203"></a>01203   <span class="keywordflow">if</span> ( mActionList )
<a name="l01204"></a>01204     regenerateActionListFromWidgets();
<a name="l01205"></a>01205 
<a name="l01206"></a>01206   mActionList = aList;
<a name="l01207"></a>01207 
<a name="l01208"></a>01208   ((QWidget*)parent())-&gt;setEnabled( <span class="keyword">true</span> );
<a name="l01209"></a>01209 
<a name="l01210"></a>01210   <span class="keywordflow">if</span> ( aList-&gt;count() == 0 ) {
<a name="l01211"></a>01211     slotClear();
<a name="l01212"></a>01212     <span class="keywordflow">return</span>;
<a name="l01213"></a>01213   }
<a name="l01214"></a>01214 
<a name="l01215"></a>01215   <span class="keywordtype">int</span> superfluousItems = (int)mActionList-&gt;count() - mMaxWidgets ;
<a name="l01216"></a>01216   <span class="keywordflow">if</span> ( superfluousItems &gt; 0 ) {
<a name="l01217"></a>01217     kdDebug(5006) &lt;&lt; <span class="stringliteral">"KMFilterActionWidgetLister: Clipping action list to "</span>
<a name="l01218"></a>01218           &lt;&lt; mMaxWidgets &lt;&lt; <span class="stringliteral">" items!"</span> &lt;&lt; endl;
<a name="l01219"></a>01219 
<a name="l01220"></a>01220     <span class="keywordflow">for</span> ( ; superfluousItems ; superfluousItems-- )
<a name="l01221"></a>01221       mActionList-&gt;removeLast();
<a name="l01222"></a>01222   }
<a name="l01223"></a>01223 
<a name="l01224"></a>01224   <span class="comment">// set the right number of widgets</span>
<a name="l01225"></a>01225   setNumberOfShownWidgetsTo( mActionList-&gt;count() );
<a name="l01226"></a>01226 
<a name="l01227"></a>01227   <span class="comment">// load the actions into the widgets</span>
<a name="l01228"></a>01228   QPtrListIterator&lt;KMFilterAction&gt; aIt( *mActionList );
<a name="l01229"></a>01229   QPtrListIterator&lt;QWidget&gt; wIt( mWidgetList );
<a name="l01230"></a>01230   <span class="keywordflow">for</span> ( aIt.toFirst(), wIt.toFirst() ;
<a name="l01231"></a>01231     aIt.current() &amp;&amp; wIt.current() ; ++aIt, ++wIt )
<a name="l01232"></a>01232     ((<a class="code" href="classKMFilterActionWidget.html" title="This widgets allows to edit a single KMFilterAction (in fact any derived class that...">KMFilterActionWidget</a>*)(*wIt))-&gt;<a class="code" href="classKMFilterActionWidget.html#0a3e57fa236802c80aeb68df01112e3f" title="Set an action.">setAction</a>( (*aIt) );
<a name="l01233"></a>01233 }
<a name="l01234"></a>01234 
<a name="l01235"></a>01235 <span class="keywordtype">void</span> KMFilterActionWidgetLister::reset()
<a name="l01236"></a>01236 {
<a name="l01237"></a>01237   <span class="keywordflow">if</span> ( mActionList )
<a name="l01238"></a>01238     regenerateActionListFromWidgets();
<a name="l01239"></a>01239 
<a name="l01240"></a>01240   mActionList = 0;
<a name="l01241"></a>01241   slotClear();
<a name="l01242"></a>01242   ((QWidget*)parent())-&gt;setEnabled(  <span class="keyword">false</span>  );
<a name="l01243"></a>01243 }
<a name="l01244"></a>01244 
<a name="l01245"></a>01245 QWidget* KMFilterActionWidgetLister::createWidget( QWidget *parent )
<a name="l01246"></a>01246 {
<a name="l01247"></a>01247   <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classKMFilterActionWidget.html#346ea2075fc411450df7d38a3781fc83" title="Constructor.">KMFilterActionWidget</a>(parent);
<a name="l01248"></a>01248 }
<a name="l01249"></a>01249 
<a name="l01250"></a>01250 <span class="keywordtype">void</span> KMFilterActionWidgetLister::clearWidget( QWidget *aWidget )
<a name="l01251"></a>01251 {
<a name="l01252"></a>01252   <span class="keywordflow">if</span> ( aWidget )
<a name="l01253"></a>01253     ((<a class="code" href="classKMFilterActionWidget.html" title="This widgets allows to edit a single KMFilterAction (in fact any derived class that...">KMFilterActionWidget</a>*)aWidget)-&gt;setAction(0);
<a name="l01254"></a>01254 }
<a name="l01255"></a>01255 
<a name="l01256"></a>01256 <span class="keywordtype">void</span> KMFilterActionWidgetLister::regenerateActionListFromWidgets()
<a name="l01257"></a>01257 {
<a name="l01258"></a>01258   <span class="keywordflow">if</span> ( !mActionList ) <span class="keywordflow">return</span>;
<a name="l01259"></a>01259 
<a name="l01260"></a>01260   mActionList-&gt;clear();
<a name="l01261"></a>01261 
<a name="l01262"></a>01262   QPtrListIterator&lt;QWidget&gt; it( mWidgetList );
<a name="l01263"></a>01263   <span class="keywordflow">for</span> ( it.toFirst() ; it.current() ; ++it ) {
<a name="l01264"></a>01264     <a class="code" href="classKMFilterAction.html" title="Abstract base class for KMail&amp;#39;s filter actions.">KMFilterAction</a> *a = ((<a class="code" href="classKMFilterActionWidget.html" title="This widgets allows to edit a single KMFilterAction (in fact any derived class that...">KMFilterActionWidget</a>*)(*it))-&gt;<a class="code" href="classKMFilterActionWidget.html#8a1ac6e65cd10a38313a4d12774d8dad" title="Retrieve the action.">action</a>();
<a name="l01265"></a>01265     <span class="keywordflow">if</span> ( a )
<a name="l01266"></a>01266       mActionList-&gt;append( a );
<a name="l01267"></a>01267   }
<a name="l01268"></a>01268 
<a name="l01269"></a>01269 }
<a name="l01270"></a>01270 
<a name="l01271"></a>01271 <span class="comment">//=============================================================================</span>
<a name="l01272"></a>01272 <span class="comment">//</span>
<a name="l01273"></a>01273 <span class="comment">// class KMPopFilterActionWidget</span>
<a name="l01274"></a>01274 <span class="comment">//</span>
<a name="l01275"></a>01275 <span class="comment">//=============================================================================</span>
<a name="l01276"></a>01276 
<a name="l01277"></a>01277 KMPopFilterActionWidget::KMPopFilterActionWidget( <span class="keyword">const</span> QString&amp; title, QWidget *parent, <span class="keyword">const</span> <span class="keywordtype">char</span>* name )
<a name="l01278"></a>01278   : QVButtonGroup( title, parent, name )
<a name="l01279"></a>01279 {
<a name="l01280"></a>01280   mActionMap[Down] = <span class="keyword">new</span> QRadioButton( i18n(<span class="stringliteral">"&amp;Download mail"</span>), <span class="keyword">this</span> );
<a name="l01281"></a>01281   mActionMap[Later] = <span class="keyword">new</span> QRadioButton( i18n(<span class="stringliteral">"Download mail la&amp;ter"</span>), <span class="keyword">this</span> );
<a name="l01282"></a>01282   mActionMap[Delete] = <span class="keyword">new</span> QRadioButton( i18n(<span class="stringliteral">"D&amp;elete mail from server"</span>), <span class="keyword">this</span> );
<a name="l01283"></a>01283   mIdMap[id(mActionMap[Later])] = Later;
<a name="l01284"></a>01284   mIdMap[id(mActionMap[Down])] = Down;
<a name="l01285"></a>01285   mIdMap[id(mActionMap[Delete])] = Delete;
<a name="l01286"></a>01286 
<a name="l01287"></a>01287   connect( <span class="keyword">this</span>, SIGNAL(clicked(<span class="keywordtype">int</span>)),
<a name="l01288"></a>01288        <span class="keyword">this</span>, SLOT( slotActionClicked(<span class="keywordtype">int</span>)) );
<a name="l01289"></a>01289 }
<a name="l01290"></a>01290 
<a name="l01291"></a>01291 <span class="keywordtype">void</span> KMPopFilterActionWidget::setAction( KMPopFilterAction aAction )
<a name="l01292"></a>01292 {
<a name="l01293"></a>01293   <span class="keywordflow">if</span>( aAction == NoAction)
<a name="l01294"></a>01294   {
<a name="l01295"></a>01295     aAction = Later;
<a name="l01296"></a>01296   }
<a name="l01297"></a>01297 
<a name="l01298"></a>01298   mAction = aAction;
<a name="l01299"></a>01299 
<a name="l01300"></a>01300   blockSignals( <span class="keyword">true</span> );
<a name="l01301"></a>01301   <span class="keywordflow">if</span>(!mActionMap[aAction]-&gt;isChecked())
<a name="l01302"></a>01302   {
<a name="l01303"></a>01303     mActionMap[aAction]-&gt;setChecked( <span class="keyword">true</span> );
<a name="l01304"></a>01304   }
<a name="l01305"></a>01305   blockSignals( <span class="keyword">false</span> );
<a name="l01306"></a>01306 
<a name="l01307"></a>01307   setEnabled( <span class="keyword">true</span> );
<a name="l01308"></a>01308 }
<a name="l01309"></a>01309 
<a name="l01310"></a>01310 KMPopFilterAction  KMPopFilterActionWidget::action()
<a name="l01311"></a>01311 {
<a name="l01312"></a>01312   <span class="keywordflow">return</span> mAction;
<a name="l01313"></a>01313 }
<a name="l01314"></a>01314 
<a name="l01315"></a>01315 <span class="keywordtype">void</span> KMPopFilterActionWidget::slotActionClicked(<span class="keywordtype">int</span> aId)
<a name="l01316"></a>01316 {
<a name="l01317"></a>01317   emit actionChanged(mIdMap[aId]);
<a name="l01318"></a>01318   <a class="code" href="classKMFilterActionWidget.html#0a3e57fa236802c80aeb68df01112e3f" title="Set an action.">setAction</a>(mIdMap[aId]);
<a name="l01319"></a>01319 }
<a name="l01320"></a>01320 
<a name="l01321"></a>01321 <span class="keywordtype">void</span> KMPopFilterActionWidget::reset()
<a name="l01322"></a>01322 {
<a name="l01323"></a>01323   blockSignals( <span class="keyword">true</span> );
<a name="l01324"></a>01324   mActionMap[Down]-&gt;setChecked( <span class="keyword">true</span> );
<a name="l01325"></a>01325   blockSignals( <span class="keyword">false</span> );
<a name="l01326"></a>01326 
<a name="l01327"></a>01327   setEnabled(  <span class="keyword">false</span>  );
<a name="l01328"></a>01328 }
<a name="l01329"></a>01329 
<a name="l01330"></a><a class="code" href="classKMFilterDlg.html#a39df1feca77e42c2a6b5e56508e21c6">01330</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterDlg.html#a39df1feca77e42c2a6b5e56508e21c6" title="Called when a user clicks the import filters button.">KMFilterDlg::slotImportFilters</a>()
<a name="l01331"></a>01331 {
<a name="l01332"></a>01332     <a class="code" href="classKMail_1_1FilterImporterExporter.html" title="Utility class that provides persisting of filters to/from KConfig.">FilterImporterExporter</a> importer( <span class="keyword">this</span>, bPopFilter );
<a name="l01333"></a>01333     QValueList&lt;KMFilter*&gt; filters = importer.<a class="code" href="classKMail_1_1FilterImporterExporter.html#f7cd5cd0c7004f0a2781904b81643d2f" title="Import filters.">importFilters</a>();
<a name="l01334"></a>01334     <span class="comment">// FIXME message box how many were imported?</span>
<a name="l01335"></a>01335     <span class="keywordflow">if</span> (filters.isEmpty()) <span class="keywordflow">return</span>;
<a name="l01336"></a>01336 
<a name="l01337"></a>01337     QValueListConstIterator&lt;KMFilter*&gt; it;
<a name="l01338"></a>01338 
<a name="l01339"></a>01339     <span class="keywordflow">for</span> ( it = filters.constBegin() ; it != filters.constEnd() ; ++it ) {
<a name="l01340"></a>01340         <a class="code" href="classKMFilterDlg.html#bbbcef64fb2cbd90d11a4e62d809067d" title="The widget that contains the ListBox showing the filters, and the controls to remove...">mFilterList</a>-&gt;<a class="code" href="classKMFilterListBox.html#58403cdd3abe6296d74e5b040ab7a023">appendFilter</a>( *it ); <span class="comment">// no need to deep copy, ownership passes to the list</span>
<a name="l01341"></a>01341     }
<a name="l01342"></a>01342 }
<a name="l01343"></a>01343 
<a name="l01344"></a><a class="code" href="classKMFilterDlg.html#67f786f22570ab7724032631c9950b89">01344</a> <span class="keywordtype">void</span> <a class="code" href="classKMFilterDlg.html#67f786f22570ab7724032631c9950b89" title="Called when a user clicks the export filters button.">KMFilterDlg::slotExportFilters</a>()
<a name="l01345"></a>01345 {
<a name="l01346"></a>01346     <a class="code" href="classKMail_1_1FilterImporterExporter.html" title="Utility class that provides persisting of filters to/from KConfig.">FilterImporterExporter</a> exporter( <span class="keyword">this</span>, bPopFilter );
<a name="l01347"></a>01347     QValueList&lt;KMFilter*&gt; filters = <a class="code" href="classKMFilterDlg.html#bbbcef64fb2cbd90d11a4e62d809067d" title="The widget that contains the ListBox showing the filters, and the controls to remove...">mFilterList</a>-&gt;<a class="code" href="classKMFilterListBox.html#2be2ab3c9431ba3e8d014377cc3d1ad7" title="Returns a list of _copies_ of the current list of filters.">filtersForSaving</a>();
<a name="l01348"></a>01348     exporter.<a class="code" href="classKMail_1_1FilterImporterExporter.html#5158a090b5567c4183e614c224af52f7" title="Export the given filter rules to a file which is asked from the user.">exportFilters</a>( filters );
<a name="l01349"></a>01349     QValueList&lt;KMFilter*&gt;::iterator it;
<a name="l01350"></a>01350     <span class="keywordflow">for</span> ( it = filters.begin(); it != filters.end(); ++it )
<a name="l01351"></a>01351         <span class="keyword">delete</span> *it;
<a name="l01352"></a>01352 }
<a name="l01353"></a>01353 
<a name="l01354"></a>01354 <span class="preprocessor">#include "kmfilterdlg.moc"</span>
</pre></div></div>
    </div></div>


      </td>
  </tr>
  <tr>
    <td valign="top" id="leftmenu" width="25%">
      <a name="navigation"></a>
      <div class="menu_box"><h2>kmail</h2>
<div class="nav_list">
<ul><li><a href="index.html">Main Page</a></li><li><a href="namespaces.html">Namespace List</a></li><li><a href="hierarchy.html">Class Hierarchy</a></li><li><a href="classes.html">Alphabetical List</a></li><li><a href="annotated.html">Class List</a></li><li><a href="files.html">File List</a></li><li><a href="namespacemembers.html">Namespace Members</a></li><li><a href="functions.html">Class Members</a></li><li><a href="pages.html">Related Pages</a></li></ul>
<!--
<h2>Class Picker</h2>
<div style="text-align: center;">
<form name="guideform">
<select name="guidelinks" style="width:100%;" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value">
<option value="annotated.html">-- Choose --</option>
  <option value="classAccountUpdater.html">accountupdater</option>,  <option value="classAttachmentModifyCommand.html">attachmentmodifycommand</option>,  <option value="classFolderStorage.html">folderstorage</option>,  <option value="classKCursorSaver.html">kcursorsaver</option>,  <option value="classKleo_1_1KeyResolver.html">kleo::keyresolver</option>,  <option value="classKListViewIndexedSearchLine.html">klistviewindexedsearchline</option>,  <option value="classKMAcctFolder.html">kmacctfolder</option>,  <option value="classKMAcctSelDlg.html">kmacctseldlg</option>,  <option value="classKMail_1_1AccountComboBox.html">kmail::accountcombobox</option>,  <option value="classKMail_1_1AccountManager.html">kmail::accountmanager</option>,  <option value="classKMail_1_1ACLEntryDialog.html">kmail::aclentrydialog</option>,  <option value="classKMail_1_1ACLJobs_1_1DeleteACLJob.html">kmail::acljobs::deleteacljob</option>,  <option value="classKMail_1_1ACLJobs_1_1GetACLJob.html">kmail::acljobs::getacljob</option>,  <option value="classKMail_1_1ACLJobs_1_1GetUserRightsJob.html">kmail::acljobs::getuserrightsjob</option>,  <option value="classKMail_1_1ACLJobs_1_1MultiSetACLJob.html">kmail::acljobs::multisetacljob</option>,  <option value="classKMail_1_1AnnotationJobs_1_1GetAnnotationJob.html">kmail::annotationjobs::getannotationjob</option>,  <option value="classKMail_1_1AnnotationJobs_1_1MultiGetAnnotationJob.html">kmail::annotationjobs::multigetannotationjob</option>,  <option value="classKMail_1_1AnnotationJobs_1_1MultiSetAnnotationJob.html">kmail::annotationjobs::multisetannotationjob</option>,  <option value="classKMail_1_1AnnotationJobs_1_1MultiUrlGetAnnotationJob.html">kmail::annotationjobs::multiurlgetannotationjob</option>,  <option value="classKMail_1_1AntiSpamConfig.html">kmail::antispamconfig</option>,  <option value="classKMail_1_1AntiSpamWizard.html">kmail::antispamwizard</option>,  <option value="classKMail_1_1AntiSpamWizard_1_1ConfigReader.html">kmail::antispamwizard::configreader</option>,  <option value="classKMail_1_1AntiSpamWizard_1_1SpamToolConfig.html">kmail::antispamwizard::spamtoolconfig</option>,  <option value="classKMail_1_1Callback.html">kmail::callback</option>,  <option value="classKMail_1_1CopyFolderJob.html">kmail::copyfolderjob</option>,  <option value="classKMail_1_1DictionaryComboBox.html">kmail::dictionarycombobox</option>,  <option value="classKMail_1_1EditorWatcher.html">kmail::editorwatcher</option>,  <option value="classKMail_1_1FilterImporterExporter.html">kmail::filterimporterexporter</option>,  <option value="classKMail_1_1FilterLog.html">kmail::filterlog</option>,  <option value="classKMail_1_1FilterLogDialog.html">kmail::filterlogdialog</option>,  <option value="classKMail_1_1FolderDiaACLTab.html">kmail::folderdiaacltab</option>,  <option value="classKMail_1_1FolderDiaGeneralTab.html">kmail::folderdiageneraltab</option>,  <option value="classKMail_1_1FolderDiaQuotaTab.html">kmail::folderdiaquotatab</option>,  <option value="classKMail_1_1FolderDiaTab.html">kmail::folderdiatab</option>,  <option value="classKMail_1_1FolderDiaTemplatesTab.html">kmail::folderdiatemplatestab</option>,  <option value="classKMail_1_1FolderRequester.html">kmail::folderrequester</option>,  <option value="classKMail_1_1HeaderItem.html">kmail::headeritem</option>,  <option value="classKMail_1_1HeaderStyle.html">kmail::headerstyle</option>,  <option value="classKMail_1_1HtmlStatusBar.html">kmail::htmlstatusbar</option>,  <option value="classKMail_1_1HtmlWriter.html">kmail::htmlwriter</option>,  <option value="classKMail_1_1IdentityDrag.html">kmail::identitydrag</option>,  <option value="classKMail_1_1IdentityListView.html">kmail::identitylistview</option>,  <option value="classKMail_1_1IdentityListViewItem.html">kmail::identitylistviewitem</option>,  <option value="classKMail_1_1Interface_1_1BodyPart.html">kmail::interface::bodypart</option>,  <option value="classKMail_1_1Interface_1_1BodyPartFormatterPlugin.html">kmail::interface::bodypartformatterplugin</option>,  <option value="classKMail_1_1Interface_1_1BodyPartMemento.html">kmail::interface::bodypartmemento</option>,  <option value="classKMail_1_1Interface_1_1BodyPartURLHandler.html">kmail::interface::bodyparturlhandler</option>,  <option value="classKMail_1_1Interface_1_1Observable.html">kmail::interface::observable</option>,  <option value="classKMail_1_1Interface_1_1Observer.html">kmail::interface::observer</option>,  <option value="classKMail_1_1JobScheduler.html">kmail::jobscheduler</option>,  <option value="classKMail_1_1ListJob.html">kmail::listjob</option>,  <option value="classKMail_1_1MaildirCompactionJob.html">kmail::maildircompactionjob</option>,  <option value="classKMail_1_1MailingList.html">kmail::mailinglist</option>,  <option value="classKMail_1_1MboxCompactionJob.html">kmail::mboxcompactionjob</option>,  <option value="classKMail_1_1MessageActions.html">kmail::messageactions</option>,  <option value="classKMail_1_1MessageCopyHelper.html">kmail::messagecopyhelper</option>,  <option value="classKMail_1_1PartNodeBodyPart.html">kmail::partnodebodypart</option>,  <option value="classKMail_1_1PopAccount.html">kmail::popaccount</option>,  <option value="classKMail_1_1QuotaJobs_1_1GetQuotarootJob.html">kmail::quotajobs::getquotarootjob</option>,  <option value="classKMail_1_1QuotaJobs_1_1GetStorageQuotaJob.html">kmail::quotajobs::getstoragequotajob</option>,  <option value="classKMail_1_1RedirectDialog.html">kmail::redirectdialog</option>,  <option value="classKMail_1_1RenameJob.html">kmail::renamejob</option>,  <option value="classKMail_1_1RuleWidgetHandler.html">kmail::rulewidgethandler</option>,  <option value="classKMail_1_1RuleWidgetHandlerManager.html">kmail::rulewidgethandlermanager</option>,  <option value="classKMail_1_1ScheduledCompactionTask.html">kmail::scheduledcompactiontask</option>,  <option value="classKMail_1_1ScheduledExpireTask.html">kmail::scheduledexpiretask</option>,  <option value="classKMail_1_1ScheduledJob.html">kmail::scheduledjob</option>,  <option value="classKMail_1_1ScheduledTask.html">kmail::scheduledtask</option>,  <option value="classKMail_1_1SearchJob.html">kmail::searchjob</option>,  <option value="classKMail_1_1SearchWindow.html">kmail::searchwindow</option>,  <option value="classKMail_1_1SecondaryWindow.html">kmail::secondarywindow</option>,  <option value="classKMail_1_1SieveDebugDialog.html">kmail::sievedebugdialog</option>,  <option value="classKMail_1_1SortCacheItem.html">kmail::sortcacheitem</option>,  <option value="classKMail_1_1SpamHeaderAnalyzer.html">kmail::spamheaderanalyzer</option>,  <option value="classKMail_1_1SpamScore.html">kmail::spamscore</option>,  <option value="classKMail_1_1TeeHtmlWriter.html">kmail::teehtmlwriter</option>,  <option value="classKMail_1_1TransportManager.html">kmail::transportmanager</option>,  <option value="classKMail_1_1UndoInfo.html">kmail::undoinfo</option>,  <option value="classKMail_1_1URLHandler.html">kmail::urlhandler</option>,  <option value="classKMail_1_1URLHandlerManager.html">kmail::urlhandlermanager</option>,  <option value="classKMail_1_1Util_1_1LaterDeleter.html">kmail::util::laterdeleter</option>,  <option value="classKMailICalIfaceImpl.html">kmailicalifaceimpl</option>,  <option value="classKMailIface.html">kmailiface</option>,  <option value="classKMDict.html">kmdict</option>,  <option value="classKMDictItem.html">kmdictitem</option>,  <option value="classKMFilterAction.html">kmfilteraction</option>,  <option value="classKMFilterActionDict.html">kmfilteractiondict</option>,  <option value="classKMFilterActionWidget.html">kmfilteractionwidget</option>,  <option value="classKMFilterActionWithAddress.html">kmfilteractionwithaddress</option>,  <option value="classKMFilterActionWithFolder.html">kmfilteractionwithfolder</option>,  <option value="classKMFilterActionWithNone.html">kmfilteractionwithnone</option>,  <option value="classKMFilterActionWithString.html">kmfilteractionwithstring</option>,  <option value="classKMFilterActionWithStringList.html">kmfilteractionwithstringlist</option>,  <option value="classKMFilterActionWithUOID.html">kmfilteractionwithuoid</option>,  <option value="classKMFilterActionWithUrl.html">kmfilteractionwithurl</option>,  <option value="classKMFilterDlg.html">kmfilterdlg</option>,  <option value="classKMFilterListBox.html">kmfilterlistbox</option>,  <option value="classKMFolder.html">kmfolder</option>,  <option value="classKMFolderDialog.html">kmfolderdialog</option>,  <option value="classKMFolderDir.html">kmfolderdir</option>,  <option value="classKMFolderIndex.html">kmfolderindex</option>,  <option value="classKMFolderOpener.html">kmfolderopener</option>,  <option value="classKMHeaders.html">kmheaders</option>,  <option value="classKMKernel.html">kmkernel</option>,  <option value="classKMMenuCommand.html">kmmenucommand</option>,  <option value="classKMMessage.html">kmmessage</option>,  <option value="classKMMsgDict.html">kmmsgdict</option>,  <option value="classKMMsgList.html">kmmsglist</option>,  <option value="classKMMsgPartDialog.html">kmmsgpartdialog</option>,  <option value="classKMMsgPartDialogCompat.html">kmmsgpartdialogcompat</option>,  <option value="classKMPopHeadersView.html">kmpopheadersview</option>,  <option value="classKMReaderWin.html">kmreaderwin</option>,  <option value="classKMSearchPattern.html">kmsearchpattern</option>,  <option value="classKMSearchPatternEdit.html">kmsearchpatternedit</option>,  <option value="classKMSearchRule.html">kmsearchrule</option>,  <option value="classKMSearchRuleNumerical.html">kmsearchrulenumerical</option>,  <option value="classKMSearchRuleStatus.html">kmsearchrulestatus</option>,  <option value="classKMSearchRuleString.html">kmsearchrulestring</option>,  <option value="classKMSearchRuleWidget.html">kmsearchrulewidget</option>,  <option value="classKMSystemTray.html">kmsystemtray</option>,  <option value="classMailComposerIface.html">mailcomposeriface</option>,  <option value="classScalix_1_1FolderAttributeParser.html">scalix::folderattributeparser</option>,  <option value="classSnippetConfig.html">snippetconfig</option>,  <option value="classSnippetGroup.html">snippetgroup</option>,  <option value="classSnippetItem.html">snippetitem</option>,  <option value="classSnippetSettings.html">snippetsettings</option>,  <option value="classSnippetWidget.html">snippetwidget</option>,
</select>
</form>
</div>
-->
</div></div>
<div class="menu_box"><h2>API Dox</h2>
<div class="nav_list">
<ul>
<li><a href="../../akregator/html/index.html">akregator</a></li><li>&nbsp;&nbsp;<a href="../../akregator/src/html/index.html">src</a></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../akregator/src/librss/html/index.html">librss</a></li><li><a href="../../certmanager/html/index.html">certmanager</a></li><li>&nbsp;&nbsp;<a href="../../certmanager/lib/html/index.html">lib</a></li><li><a href="../../kaddressbook/html/index.html">kaddressbook</a></li><li><a href="../../kalarm/html/index.html">kalarm</a></li><li>&nbsp;&nbsp;<a href="../../kalarm/lib/html/index.html">lib</a></li><li><a href="../../kandy/html/index.html">kandy</a></li><li><a href="../../karm/html/index.html">karm</a></li><li><a href="../../kdgantt/html/index.html">kdgantt</a></li><li><a href="../../kgantt/html/index.html">kgantt</a></li><li><a href="../../kioslaves/html/index.html">kioslaves</a></li><li>&nbsp;&nbsp;<a href="../../kioslaves/imap4/html/index.html">imap4</a></li><li>&nbsp;&nbsp;<a href="../../kioslaves/mbox/html/index.html">mbox</a></li><li><a href="../../kitchensync/html/index.html">kitchensync</a></li><li><a href="../../kmail/html/index.html">kmail</a></li><li><a href="../../knotes/html/index.html">knotes</a></li><li><a href="../../konsolekalendar/html/index.html">konsolekalendar</a></li><li><a href="../../kontact/html/index.html">kontact</a></li><li><a href="../../korganizer/html/index.html">korganizer</a></li><li><a href="../../kpilot/html/index.html">kpilot</a></li><li>&nbsp;&nbsp;<a href="../../kpilot/kpilot/html/index.html">kpilot</a></li><li>&nbsp;&nbsp;<a href="../../kpilot/lib/html/index.html">lib</a></li><li><a href="../../libemailfunctions/html/index.html">libemailfunctions</a></li><li><a href="../../libkcal/html/index.html">libkcal</a></li><li><a href="../../libkdepim/html/index.html">libkdepim</a></li><li><a href="../../libkholidays/html/index.html">libkholidays</a></li><li><a href="../../libkmime/html/index.html">libkmime</a></li><li><a href="../../libkpgp/html/index.html">libkpgp</a></li><li><a href="../../libkpimidentities/html/index.html">libkpimidentities</a></li>
</ul></div></div>


        </td>
</tr>
</table>

<span class="doNotDisplay">
  <a href="http://www.kde.org/" accesskey="8">KDE Home</a> |
  <a href="http://accessibility.kde.org/" accesskey="9">KDE Accessibility Home</a> |
  <a href="http://www.kde.org/media/accesskeys.php" accesskey="0">Description of Access Keys</a>
</span>


<div style="height: 8px"></div>

<div id="footer">
  <div id="footer_left">
    Maintained by <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;groo&#116;&#64;kde&#46;or&#x67;">Adriaan de Groot</a>
and
<a href="&#109;a&#105;&#108;&#116;&#111;&#58;w&#105;nter&#64;kde&#46;or&#x67">Allen Winter</a>.
<br/>
    KDE and K Desktop Environment are trademarks of <a href="http://www.kde.org/areas/kde-ev/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> |
    <a href="http://www.kde.org/contact/impressum.php">Legal</a>
  </div>
  <div id="footer_right"><img src="/media/images/footer_right.png" style="margin: 0px" alt="" /></div>
</div>

<!--
WARNING: DO NOT SEND MAIL TO THE FOLLOWING EMAIL ADDRESS! YOU WILL
BE BLOCKED INSTANTLY AND PERMANENTLY!
<a href="mailto:aaaatrap-425acc3b5374943f@kde.org">Block me</a>
WARNING END
-->

</body>
</html>