<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>kshowmail: kshowmail/kshowmailview.cpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.0 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li><a href="classes.html"><span>Classes</span></a></li>
    <li id="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="dirs.html"><span>Directories</span></a></li>
  </ul></div>
<div class="nav">
<a class="el" href="dir_656923b733374505e0e2f68ecb68d952.html">kshowmail</a></div>
<h1>kshowmailview.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/***************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment">                          kshowmailview.cpp  -  description</span>
<a name="l00003"></a>00003 <span class="comment">                             -------------------</span>
<a name="l00004"></a>00004 <span class="comment">    begin                : Sat May  6 12:13:57 MEST 2000</span>
<a name="l00005"></a>00005 <span class="comment">    copyright            : (C) 2000-2001 by Eggert Ehmke</span>
<a name="l00006"></a>00006 <span class="comment">    email                : eggert.ehmke@berlin.de</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment">     26 Sep 2002 - Allow for columns to be hidden. Allistar Melville</span>
<a name="l00009"></a>00009 <span class="comment"> ***************************************************************************/</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="comment">/***************************************************************************</span>
<a name="l00012"></a>00012 <span class="comment"> *                                                                         *</span>
<a name="l00013"></a>00013 <span class="comment"> *   This program is free software; you can redistribute it and/or modify  *</span>
<a name="l00014"></a>00014 <span class="comment"> *   it under the terms of the GNU General Public License as published by  *</span>
<a name="l00015"></a>00015 <span class="comment"> *   the Free Software Foundation; either version 2 of the License, or     *</span>
<a name="l00016"></a>00016 <span class="comment"> *   (at your option) any later version.                                   *</span>
<a name="l00017"></a>00017 <span class="comment"> *                                                                         *</span>
<a name="l00018"></a>00018 <span class="comment"> ***************************************************************************/</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="comment">// include files for TQt</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;ntqprinter.h&gt;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;ntqpainter.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;ntqmessagebox.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;ntqkeycode.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;ntqvaluelist.h&gt;</span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;kstandarddirs.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;tdelocale.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;kdebug.h&gt;</span>
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 <span class="comment">// application specific includes</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include "kshowmailview.h"</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include "kshowmaildoc.h"</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include "kshowmail.h"</span>
<a name="l00035"></a>00035 
<a name="l00036"></a><a class="code" href="classKshowmailView.html#6c0f3a139aba59b618178cffec9fdbf4">00036</a> <a class="code" href="classKshowmailView.html#6c0f3a139aba59b618178cffec9fdbf4">KshowmailView::KshowmailView</a>(TQWidget *parent, <span class="keyword">const</span> <span class="keywordtype">char</span> *name):
<a name="l00037"></a>00037        TQSplitter(Vertical, parent, name)
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039   <span class="comment">//get application config object (kshowmailrc)</span>
<a name="l00040"></a>00040   <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a> = TDEApplication::kApplication()-&gt;config();
<a name="l00041"></a>00041 
<a name="l00042"></a>00042        <a class="code" href="classKshowmailView.html#ac2789d0c2b897f4a9589c21a8eae2eb">m_pixOk</a> = <span class="keyword">new</span> TQPixmap (::locate (<span class="stringliteral">"data"</span>, <span class="stringliteral">"kshowmail/pics/ok.png"</span>));
<a name="l00043"></a>00043 
<a name="l00044"></a>00044        <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a> = <span class="keyword">new</span> TDEListView (<span class="keyword">this</span>, <span class="stringliteral">"accounts"</span>);
<a name="l00045"></a>00045        <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a> = <span class="keyword">new</span> TDEListView (<span class="keyword">this</span>, <span class="stringliteral">"messages"</span>);
<a name="l00046"></a>00046   setBackgroundMode(PaletteBase);
<a name="l00047"></a>00047 
<a name="l00048"></a>00048   <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;setSelectionMode (TQListView::Extended);
<a name="l00049"></a>00049        <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;setAllColumnsShowFocus (<span class="keyword">true</span>);
<a name="l00050"></a>00050   <span class="comment">// sort account column</span>
<a name="l00051"></a>00051   <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;setSorting (1);
<a name="l00052"></a>00052   <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;setShowSortIndicator (<span class="keyword">true</span>);
<a name="l00053"></a>00053        <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;addColumn (i18n(<span class="stringliteral">"Active"</span>), DEFAULT_WIDTH_ACCOUNT_ACTIVE );
<a name="l00054"></a>00054        <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;addColumn (i18n(<span class="stringliteral">"Account"</span>), DEFAULT_WIDTH_ACCOUNT_ACCOUNT );
<a name="l00055"></a>00055        <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;addColumn (i18n(<span class="stringliteral">"Server"</span>), DEFAULT_WIDTH_ACCOUNT_SERVER );
<a name="l00056"></a>00056        <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;addColumn (i18n(<span class="stringliteral">"User"</span>), DEFAULT_WIDTH_ACCOUNT_USER );
<a name="l00057"></a>00057        <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;addColumn (i18n(<span class="stringliteral">"Messages"</span>), DEFAULT_WIDTH_ACCOUNT_MESSAGES );
<a name="l00058"></a>00058        <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;addColumn (i18n(<span class="stringliteral">"Size"</span>), DEFAULT_WIDTH_ACCOUNT_SIZE );
<a name="l00059"></a>00059 
<a name="l00060"></a>00060   <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;setSelectionMode (TQListView::Extended);
<a name="l00061"></a>00061        <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;setAllColumnsShowFocus (<span class="keyword">true</span>);
<a name="l00062"></a>00062   <span class="comment">// sort number column</span>
<a name="l00063"></a>00063        <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;setSorting (ShowListViewItem::_colNumber);
<a name="l00064"></a>00064   <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;setShowSortIndicator (<span class="keyword">true</span>);
<a name="l00065"></a>00065        setFocusPolicy (TQWidget::StrongFocus);
<a name="l00066"></a>00066 
<a name="l00067"></a>00067        <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;addColumn (i18n(<span class="stringliteral">"Number"</span>), DEFAULT_WIDTH_MESSAGE_NUMBER );
<a name="l00068"></a>00068        <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;addColumn (i18n(<span class="stringliteral">"Account"</span>), DEFAULT_WIDTH_MESSAGE_ACCOUNT );
<a name="l00069"></a>00069        <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;addColumn (i18n(<span class="stringliteral">"From"</span>), DEFAULT_WIDTH_MESSAGE_FROM );
<a name="l00070"></a>00070        <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;addColumn (i18n(<span class="stringliteral">"To"</span>),  DEFAULT_WIDTH_MESSAGE_TO );
<a name="l00071"></a>00071        <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;addColumn (i18n(<span class="stringliteral">"Subject"</span>), DEFAULT_WIDTH_MESSAGE_SUBJECT );
<a name="l00072"></a>00072        <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;addColumn (i18n(<span class="stringliteral">"Date"</span>), DEFAULT_WIDTH_MESSAGE_DATE );
<a name="l00073"></a>00073        <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;addColumn (i18n(<span class="stringliteral">"Size"</span>), DEFAULT_WIDTH_MESSAGE_SIZE );
<a name="l00074"></a>00074        <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;addColumn (i18n(<span class="stringliteral">"Content"</span>), DEFAULT_WIDTH_MESSAGE_CONTENT );
<a name="l00075"></a>00075        <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;addColumn (i18n(<span class="stringliteral">"State"</span>),  DEFAULT_WIDTH_MESSAGE_STATE );
<a name="l00076"></a>00076 
<a name="l00077"></a>00077        connect (<a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>, SIGNAL (rightButtonClicked (TQListViewItem*, <span class="keyword">const</span> TQPoint &amp;, <span class="keywordtype">int</span>)),
<a name="l00078"></a>00078                                                         SLOT (<a class="code" href="classKshowmailView.html#8635cb9ee8e7859f9b78ced5378c668d">slotAccountContext</a>(TQListViewItem*, <span class="keyword">const</span> TQPoint &amp;, <span class="keywordtype">int</span>)));
<a name="l00079"></a>00079        connect (<a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>, SIGNAL (clicked (TQListViewItem*, <span class="keyword">const</span> TQPoint &amp;, <span class="keywordtype">int</span>)),
<a name="l00080"></a>00080                                                         SLOT (<a class="code" href="classKshowmailView.html#49db2d15dcecf0ad09fed9565d506138">slotAccountClicked</a>(TQListViewItem*, <span class="keyword">const</span> TQPoint &amp;, <span class="keywordtype">int</span>)));
<a name="l00081"></a>00081        connect (<a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>, SIGNAL (rightButtonClicked (TQListViewItem*, <span class="keyword">const</span> TQPoint &amp;, <span class="keywordtype">int</span>)),
<a name="l00082"></a>00082                                                         SLOT (<a class="code" href="classKshowmailView.html#877ac2a28b5a126946199642842a8039">slotMessageContext</a>(TQListViewItem*, <span class="keyword">const</span> TQPoint &amp;, <span class="keywordtype">int</span>)));
<a name="l00083"></a>00083        connect (<a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>, SIGNAL (doubleClicked (TQListViewItem*)),
<a name="l00084"></a>00084                                                         SLOT (<a class="code" href="classKshowmailView.html#5d39dff853dab5efb5eecba7e8237d9a">slotMessageDoubleClicked</a> (TQListViewItem*)));
<a name="l00085"></a>00085        connect (<a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>, SIGNAL (clicked (TQListViewItem*)),
<a name="l00086"></a>00086                                                         SLOT (<a class="code" href="classKshowmailView.html#2fc28b0734bd9b2af83a7a9a23875ed3">slotMessageClicked</a> (TQListViewItem*)));
<a name="l00087"></a>00087 
<a name="l00088"></a>00088   <span class="comment">//read the geometry from the application config file</span>
<a name="l00089"></a>00089   <a class="code" href="classKshowmailView.html#ff3699740af2b58e299bc4b2326cad20">readOptions</a>();
<a name="l00090"></a>00090 
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 }
<a name="l00093"></a>00093 
<a name="l00094"></a><a class="code" href="classKshowmailView.html#208c56da5fe95348bd13435ff44c8aae">00094</a> <a class="code" href="classKshowmailView.html#208c56da5fe95348bd13435ff44c8aae">KshowmailView::~KshowmailView</a>()
<a name="l00095"></a>00095 {
<a name="l00096"></a>00096        <span class="keyword">delete</span> <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>;
<a name="l00097"></a>00097        <span class="keyword">delete</span> <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>;
<a name="l00098"></a>00098 }
<a name="l00099"></a>00099 
<a name="l00100"></a><a class="code" href="classKshowmailView.html#ff3699740af2b58e299bc4b2326cad20">00100</a> <span class="keywordtype">void</span> <a class="code" href="classKshowmailView.html#ff3699740af2b58e299bc4b2326cad20">KshowmailView::readOptions</a>()
<a name="l00101"></a>00101 {
<a name="l00102"></a>00102   <span class="comment">//read splitter geometry</span>
<a name="l00103"></a>00103   <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>-&gt;setGroup (<span class="stringliteral">"Display Options"</span>);
<a name="l00104"></a>00104   TQValueList&lt;int&gt; size;
<a name="l00105"></a>00105   size.append (<a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>-&gt;readNumEntry (<span class="stringliteral">"sizeaccounts"</span>, 40));
<a name="l00106"></a>00106   size.append (<a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>-&gt;readNumEntry (<span class="stringliteral">"sizemessages"</span>, 50));
<a name="l00107"></a>00107   setSizes (size);
<a name="l00108"></a>00108 
<a name="l00109"></a>00109   <span class="comment">// read layout of the list views</span>
<a name="l00110"></a>00110   <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;restoreLayout( <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>, CONFIG_GROUP_ACCOUNT_LIST );
<a name="l00111"></a>00111   <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;restoreLayout( <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>, CONFIG_GROUP_MESSAGE_LIST );
<a name="l00112"></a>00112 }
<a name="l00113"></a>00113 
<a name="l00114"></a><a class="code" href="classKshowmailView.html#53d81f575c855870a8112ec67ade5575">00114</a> <span class="keywordtype">void</span> <a class="code" href="classKshowmailView.html#53d81f575c855870a8112ec67ade5575">KshowmailView::saveOptions</a> (TDEConfig* config)
<a name="l00115"></a>00115 {
<a name="l00116"></a>00116 <span class="comment">//     kdDebug () &lt;&lt; "KshowmailView::saveOptions" &lt;&lt; endl;</span>
<a name="l00117"></a>00117        config-&gt;setGroup(<span class="stringliteral">"Display Options"</span>);
<a name="l00118"></a>00118        <span class="comment">//splitter</span>
<a name="l00119"></a>00119        TQValueList&lt;int&gt; size = sizes ();
<a name="l00120"></a>00120        config-&gt;writeEntry (<span class="stringliteral">"sizeaccounts"</span>,  size [0]);
<a name="l00121"></a>00121        config-&gt;writeEntry (<span class="stringliteral">"sizemessages"</span>,  size [1]);
<a name="l00122"></a>00122        <span class="comment">// layout</span>
<a name="l00123"></a>00123   <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;saveLayout ( config, CONFIG_GROUP_ACCOUNT_LIST );
<a name="l00124"></a>00124   <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;saveLayout (config, CONFIG_GROUP_MESSAGE_LIST );
<a name="l00125"></a>00125 }
<a name="l00126"></a>00126 
<a name="l00127"></a>00127 
<a name="l00128"></a><a class="code" href="classKshowmailView.html#877ac2a28b5a126946199642842a8039">00128</a> <span class="keywordtype">void</span> <a class="code" href="classKshowmailView.html#877ac2a28b5a126946199642842a8039">KshowmailView::slotMessageContext</a>( TQListViewItem* pItem, <span class="keyword">const</span> TQPoint&amp;, <span class="keywordtype">int</span> )
<a name="l00129"></a>00129 {
<a name="l00130"></a>00130   <span class="keywordflow">if</span>( pItem != NULL )
<a name="l00131"></a>00131   {
<a name="l00132"></a>00132     <span class="comment">//get pointer to the main widget</span>
<a name="l00133"></a>00133     <a class="code" href="classKShowMailApp.html">KShowMailApp</a>* theApp = ( <a class="code" href="classKShowMailApp.html">KShowMailApp</a> * )parentWidget();
<a name="l00134"></a>00134 
<a name="l00135"></a>00135     <span class="comment">//create and show popup menu</span>
<a name="l00136"></a>00136     TQWidget* w = theApp-&gt;factory()-&gt;container( <span class="stringliteral">"mail_context_popup"</span>, theApp );
<a name="l00137"></a>00137     TQPopupMenu* popup = static_cast&lt;TQPopupMenu*&gt;( w );
<a name="l00138"></a>00138     popup-&gt;exec( TQCursor::pos() );
<a name="l00139"></a>00139 
<a name="l00140"></a>00140     <span class="comment">//select clicked item</span>
<a name="l00141"></a>00141     <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;setSelected (pItem, <span class="keyword">true</span>);
<a name="l00142"></a>00142   }
<a name="l00143"></a>00143 }
<a name="l00144"></a>00144 
<a name="l00145"></a><a class="code" href="classKshowmailView.html#8635cb9ee8e7859f9b78ced5378c668d">00145</a> <span class="keywordtype">void</span> <a class="code" href="classKshowmailView.html#8635cb9ee8e7859f9b78ced5378c668d">KshowmailView::slotAccountContext</a>( TQListViewItem* pItem, <span class="keyword">const</span> TQPoint&amp;, <span class="keywordtype">int</span> )
<a name="l00146"></a>00146 {
<a name="l00147"></a>00147   <span class="keywordflow">if</span> ( pItem != NULL )
<a name="l00148"></a>00148   {
<a name="l00149"></a>00149     <span class="comment">//get pointer to the main widget</span>
<a name="l00150"></a>00150     <a class="code" href="classKShowMailApp.html">KShowMailApp</a>* theApp = ( <a class="code" href="classKShowMailApp.html">KShowMailApp</a> * )parentWidget();
<a name="l00151"></a>00151 
<a name="l00152"></a>00152     <span class="comment">//create and show popup menu</span>
<a name="l00153"></a>00153     TQWidget* w = theApp-&gt;factory()-&gt;container( <span class="stringliteral">"account_context_popup"</span>, theApp );
<a name="l00154"></a>00154     TQPopupMenu* popup = static_cast&lt;TQPopupMenu*&gt;( w );
<a name="l00155"></a>00155     popup-&gt;exec( TQCursor::pos() );
<a name="l00156"></a>00156 
<a name="l00157"></a>00157     <span class="comment">//select clicked item</span>
<a name="l00158"></a>00158     <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;setSelected( pItem, <span class="keyword">true</span> );
<a name="l00159"></a>00159   }
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161 
<a name="l00162"></a><a class="code" href="classKshowmailView.html#49db2d15dcecf0ad09fed9565d506138">00162</a> <span class="keywordtype">void</span> <a class="code" href="classKshowmailView.html#49db2d15dcecf0ad09fed9565d506138">KshowmailView::slotAccountClicked</a> (TQListViewItem* pItem, <span class="keyword">const</span> TQPoint&amp;, <span class="keywordtype">int</span> col)
<a name="l00163"></a>00163 {
<a name="l00164"></a>00164        <span class="keywordflow">if</span> (col == 0)
<a name="l00165"></a>00165        {
<a name="l00166"></a>00166               <a class="code" href="classKShowMailApp.html">KShowMailApp</a> *theApp=(<a class="code" href="classKShowMailApp.html">KShowMailApp</a> *) parentWidget();
<a name="l00167"></a>00167         <a class="code" href="classConfigElem.html">ConfigElem</a>* pElem = theApp-&gt;<a class="code" href="classKShowMailApp.html#5c7aa11169cab91aefb86d4b3cc7a767">m_ConfigList</a>.<a class="code" href="classConfigList.html#83776f91a264d92cea2b6f7ef0c02765">getSelectedAccount</a>();
<a name="l00168"></a>00168         <span class="keywordflow">if</span>( pElem != NULL )
<a name="l00169"></a>00169         {
<a name="l00170"></a>00170           pElem-&gt;<a class="code" href="classConfigElem.html#4a5aa6b86e56403fa453c9d642b71812">setActive</a>( !pElem-&gt;<a class="code" href="classConfigElem.html#9c91fce81b58e9d0d1b37688711e9014">isActive</a>() );
<a name="l00171"></a>00171           <span class="keywordflow">if</span> (pElem-&gt;<a class="code" href="classConfigElem.html#9c91fce81b58e9d0d1b37688711e9014">isActive</a>() )
<a name="l00172"></a>00172             pItem-&gt;setPixmap (0, *<a class="code" href="classKshowmailView.html#ac2789d0c2b897f4a9589c21a8eae2eb">m_pixOk</a>);
<a name="l00173"></a>00173           <span class="keywordflow">else</span>
<a name="l00174"></a>00174             pItem-&gt;setPixmap (0, 0);
<a name="l00175"></a>00175           emit <a class="code" href="classKshowmailView.html#6fb6da4d1c23d42efe9118748b19b0f8">signalActiveChanged</a> ();
<a name="l00176"></a>00176         }
<a name="l00177"></a>00177        }
<a name="l00178"></a>00178 }
<a name="l00179"></a>00179 
<a name="l00180"></a><a class="code" href="classKshowmailView.html#5d39dff853dab5efb5eecba7e8237d9a">00180</a> <span class="keywordtype">void</span> <a class="code" href="classKshowmailView.html#5d39dff853dab5efb5eecba7e8237d9a">KshowmailView::slotMessageDoubleClicked</a> (TQListViewItem* pItem)
<a name="l00181"></a>00181 {
<a name="l00182"></a>00182        <span class="keywordflow">if</span> (pItem)
<a name="l00183"></a>00183        {
<a name="l00184"></a>00184 <span class="comment">//            m_pListMessages-&gt;setSelected (pItem, true);</span>
<a name="l00185"></a>00185 
<a name="l00186"></a>00186        <a class="code" href="classKShowMailApp.html">KShowMailApp</a> *theApp=(<a class="code" href="classKShowMailApp.html">KShowMailApp</a> *) parentWidget();
<a name="l00187"></a>00187               theApp-&gt;<a class="code" href="classKShowMailApp.html#7b9553bf179124f9f1eb56bdd094b901">slotShowHeader</a> ();
<a name="l00188"></a>00188        }
<a name="l00189"></a>00189 }
<a name="l00190"></a>00190 
<a name="l00191"></a><a class="code" href="classKshowmailView.html#2fc28b0734bd9b2af83a7a9a23875ed3">00191</a> <span class="keywordtype">void</span> <a class="code" href="classKshowmailView.html#2fc28b0734bd9b2af83a7a9a23875ed3">KshowmailView::slotMessageClicked</a> (TQListViewItem* pItem)
<a name="l00192"></a>00192 {
<a name="l00193"></a>00193   kdDebug () &lt;&lt; <span class="stringliteral">"slotMessageClicked"</span> &lt;&lt; endl;
<a name="l00194"></a>00194   <span class="keywordflow">if</span> (pItem)
<a name="l00195"></a>00195        {
<a name="l00196"></a>00196 <span class="comment">//            m_pListMessages-&gt;setSelected (pItem, true);</span>
<a name="l00197"></a>00197 
<a name="l00198"></a>00198        <a class="code" href="classKShowMailApp.html">KShowMailApp</a> *theApp=(<a class="code" href="classKShowMailApp.html">KShowMailApp</a> *) parentWidget();
<a name="l00199"></a>00199               theApp-&gt;<a class="code" href="classKShowMailApp.html#14a17e70bed413c7d4ebffc9f5e87892">delayNextRefresh</a>();
<a name="l00200"></a>00200        }
<a name="l00201"></a>00201 }
<a name="l00202"></a>00202 
<a name="l00203"></a><a class="code" href="classKshowmailView.html#5cc4e2c1caaf6fae6af80b068aada95e">00203</a> <span class="keywordtype">void</span> <a class="code" href="classKshowmailView.html#5cc4e2c1caaf6fae6af80b068aada95e">KshowmailView::clearMailListView</a>( )
<a name="l00204"></a>00204 {
<a name="l00205"></a>00205   <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;clear();
<a name="l00206"></a>00206 }
<a name="l00207"></a>00207 
<a name="l00208"></a><a class="code" href="classKshowmailView.html#8330c6f139457ae5dd1510efb3f665e4">00208</a> <a class="code" href="classShowListViewItem.html">ShowListViewItem</a>* <a class="code" href="classKshowmailView.html#8330c6f139457ae5dd1510efb3f665e4">KshowmailView::insertMail</a>( TQString&amp; number, TQString&amp; account, TQString&amp; from, TQString&amp; to, TQString&amp; subject, TQString&amp; date, TQString&amp; size, TQString&amp; content, TQString&amp; state, TQString&amp; time )
<a name="l00209"></a>00209 {
<a name="l00210"></a>00210   <span class="comment">//create item</span>
<a name="l00211"></a>00211   <a class="code" href="classShowListViewItem.html">ShowListViewItem</a>* item = <span class="keyword">new</span> <a class="code" href="classShowListViewItem.html">ShowListViewItem</a>( <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a> );
<a name="l00212"></a>00212 
<a name="l00213"></a>00213   <span class="comment">//set content</span>
<a name="l00214"></a>00214   item-&gt;<a class="code" href="classShowListViewItem.html#2f82fc18123a144ec93f94384c936172">setNumber</a>( number );
<a name="l00215"></a>00215   item-&gt;<a class="code" href="classShowListViewItem.html#d757b7cadf50f4b7e8af5f1f7fe09b02">setAccount</a>( account );
<a name="l00216"></a>00216   item-&gt;<a class="code" href="classShowListViewItem.html#9ff7a14853167240196c9289924a39d6">setFrom</a>( from );
<a name="l00217"></a>00217   item-&gt;<a class="code" href="classShowListViewItem.html#633d447c919be4b754def3ae9b03c9f6">setTo</a>( to );
<a name="l00218"></a>00218   item-&gt;<a class="code" href="classShowListViewItem.html#c20d53f3d7d4c60bb054c958531f5d92">setSubject</a>( subject );
<a name="l00219"></a>00219   item-&gt;<a class="code" href="classShowListViewItem.html#b96fe5949709d9ccd3d414ac81671577">setDate</a>( date );
<a name="l00220"></a>00220   item-&gt;<a class="code" href="classShowListViewItem.html#0bb549ead9f623377fa2a240e76e3e90">setSize</a>( size );
<a name="l00221"></a>00221   item-&gt;<a class="code" href="classShowListViewItem.html#2b5c115276821d6137cf14940d264606">setContent</a>( content );
<a name="l00222"></a>00222   item-&gt;<a class="code" href="classShowListViewItem.html#120d8cdc825924cf408ba99c6667cf34">setState</a>( state );
<a name="l00223"></a>00223   item-&gt;<a class="code" href="classShowListViewItem.html#0d78b8e18cae5e309719b498f40f2f89">setTime</a>( time );
<a name="l00224"></a>00224 
<a name="l00225"></a>00225   <span class="keywordflow">return</span> item;
<a name="l00226"></a>00226 }
<a name="l00227"></a>00227 
<a name="l00228"></a><a class="code" href="classKshowmailView.html#4fde61960c62edd44d8eb88a82360a2a">00228</a> <span class="keywordtype">void</span> <a class="code" href="classKshowmailView.html#4fde61960c62edd44d8eb88a82360a2a">KshowmailView::refreshSetup</a>( )
<a name="l00229"></a>00229 {
<a name="l00230"></a>00230   TQString ConfigEntryDisplay;     <span class="comment">//entry of the config about show or hide column</span>
<a name="l00231"></a>00231   TQString ConfigEntrySavedWidth;  <span class="comment">//entry of the config about saved width</span>
<a name="l00232"></a>00232   <span class="keywordtype">int</span> DefaultWidth = 100;         <span class="comment">//default width of the proceeded column</span>
<a name="l00233"></a>00233   <span class="keywordtype">bool</span> DefaultDisplay = <span class="keyword">true</span>;     <span class="comment">//default show or hide of the proceeded column</span>
<a name="l00234"></a>00234 
<a name="l00235"></a>00235   <span class="comment">//set columns of the account list</span>
<a name="l00236"></a>00236   <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>-&gt;setGroup( CONFIG_GROUP_ACCOUNT_LIST );
<a name="l00237"></a>00237   <span class="keywordflow">for</span>( <span class="keywordtype">int</span> column = 0; column &lt;= 5; column++ )  <span class="comment">//iterate over all columns</span>
<a name="l00238"></a>00238   {
<a name="l00239"></a>00239     <span class="comment">//get config entries and defaults of the proceeded column from the constants header</span>
<a name="l00240"></a>00240     <span class="keywordflow">switch</span>( column )
<a name="l00241"></a>00241     {
<a name="l00242"></a>00242       <span class="keywordflow">case</span> 0: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_ACCOUNT_ACTIVE;
<a name="l00243"></a>00243               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_ACCOUNT_ACTIVE;
<a name="l00244"></a>00244               DefaultWidth = DEFAULT_WIDTH_ACCOUNT_ACTIVE;
<a name="l00245"></a>00245               DefaultDisplay = DEFAULT_DISPLAY_ACCOUNT_ACTIVE;
<a name="l00246"></a>00246               <span class="keywordflow">break</span>;
<a name="l00247"></a>00247 
<a name="l00248"></a>00248       <span class="keywordflow">case</span> 1: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_ACCOUNT_ACCOUNT;
<a name="l00249"></a>00249               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_ACCOUNT_ACCOUNT;
<a name="l00250"></a>00250               DefaultWidth = DEFAULT_WIDTH_ACCOUNT_ACCOUNT;
<a name="l00251"></a>00251               DefaultDisplay = DEFAULT_DISPLAY_ACCOUNT_ACCOUNT;
<a name="l00252"></a>00252               <span class="keywordflow">break</span>;
<a name="l00253"></a>00253 
<a name="l00254"></a>00254       <span class="keywordflow">case</span> 2: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_ACCOUNT_SERVER;
<a name="l00255"></a>00255               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_ACCOUNT_SERVER;
<a name="l00256"></a>00256               DefaultWidth = DEFAULT_WIDTH_ACCOUNT_SERVER;
<a name="l00257"></a>00257               DefaultDisplay = DEFAULT_DISPLAY_ACCOUNT_SERVER;
<a name="l00258"></a>00258               <span class="keywordflow">break</span>;
<a name="l00259"></a>00259 
<a name="l00260"></a>00260       <span class="keywordflow">case</span> 3: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_ACCOUNT_USER;
<a name="l00261"></a>00261               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_ACCOUNT_USER;
<a name="l00262"></a>00262               DefaultWidth = DEFAULT_WIDTH_ACCOUNT_USER;
<a name="l00263"></a>00263               DefaultDisplay = DEFAULT_DISPLAY_ACCOUNT_USER;
<a name="l00264"></a>00264               <span class="keywordflow">break</span>;
<a name="l00265"></a>00265 
<a name="l00266"></a>00266       <span class="keywordflow">case</span> 4: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_ACCOUNT_MESSAGES;
<a name="l00267"></a>00267               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_ACCOUNT_MESSAGES;
<a name="l00268"></a>00268               DefaultWidth = DEFAULT_WIDTH_ACCOUNT_MESSAGES;
<a name="l00269"></a>00269               DefaultDisplay = DEFAULT_DISPLAY_ACCOUNT_MESSAGES;
<a name="l00270"></a>00270               <span class="keywordflow">break</span>;
<a name="l00271"></a>00271 
<a name="l00272"></a>00272       <span class="keywordflow">case</span> 5: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_ACCOUNT_SIZE;
<a name="l00273"></a>00273               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_ACCOUNT_SIZE;
<a name="l00274"></a>00274               DefaultWidth = DEFAULT_WIDTH_ACCOUNT_SIZE;
<a name="l00275"></a>00275               DefaultDisplay = DEFAULT_DISPLAY_ACCOUNT_SIZE;
<a name="l00276"></a>00276               <span class="keywordflow">break</span>;
<a name="l00277"></a>00277     } <span class="comment">//end select</span>
<a name="l00278"></a>00278 
<a name="l00279"></a>00279     <span class="comment">//get desired column state</span>
<a name="l00280"></a>00280     <span class="keywordtype">bool</span> showColumn = <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>-&gt;readBoolEntry( ConfigEntryDisplay, DefaultDisplay );
<a name="l00281"></a>00281 
<a name="l00282"></a>00282     <span class="comment">//get currently column state</span>
<a name="l00283"></a>00283     <span class="keywordtype">bool</span> curShowed = <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;columnWidth( column ) &gt; 0;
<a name="l00284"></a>00284 
<a name="l00285"></a>00285     <span class="keywordflow">if</span>( showColumn )
<a name="l00286"></a>00286     {
<a name="l00287"></a>00287       <span class="comment">//column will be shown</span>
<a name="l00288"></a>00288 
<a name="l00289"></a>00289       <span class="keywordflow">if</span>( !curShowed )
<a name="l00290"></a>00290       {
<a name="l00291"></a>00291         <span class="comment">//the column is currently not be shown</span>
<a name="l00292"></a>00292 
<a name="l00293"></a>00293         <span class="comment">//get saved width or take default width</span>
<a name="l00294"></a>00294         <span class="keywordtype">int</span> savedWidth = <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>-&gt;readNumEntry( ConfigEntrySavedWidth, DefaultWidth );
<a name="l00295"></a>00295 
<a name="l00296"></a>00296         <span class="comment">//set column width</span>
<a name="l00297"></a>00297         <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;setColumnWidth( column, savedWidth );
<a name="l00298"></a>00298       }
<a name="l00299"></a>00299         <span class="comment">//else: the column is currently shown; do nothing</span>
<a name="l00300"></a>00300     }
<a name="l00301"></a>00301     <span class="keywordflow">else</span>
<a name="l00302"></a>00302     {
<a name="l00303"></a>00303       <span class="comment">//column will not be shown</span>
<a name="l00304"></a>00304 
<a name="l00305"></a>00305       <span class="keywordflow">if</span>( curShowed )
<a name="l00306"></a>00306       {
<a name="l00307"></a>00307         <span class="comment">//the column is currently shown</span>
<a name="l00308"></a>00308 
<a name="l00309"></a>00309         <span class="comment">//save current width</span>
<a name="l00310"></a>00310         <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>-&gt;writeEntry( ConfigEntrySavedWidth, <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;columnWidth( column ) );
<a name="l00311"></a>00311 
<a name="l00312"></a>00312         <span class="comment">//hide column</span>
<a name="l00313"></a>00313         <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;hideColumn( column );
<a name="l00314"></a>00314       }
<a name="l00315"></a>00315         <span class="comment">//else: the column is already hidden; do nothing</span>
<a name="l00316"></a>00316     }
<a name="l00317"></a>00317 
<a name="l00318"></a>00318   } <span class="comment">//end column loop</span>
<a name="l00319"></a>00319 
<a name="l00320"></a>00320   <span class="comment">//set columns of the message list</span>
<a name="l00321"></a>00321   <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>-&gt;setGroup( CONFIG_GROUP_MESSAGE_LIST );
<a name="l00322"></a>00322   <span class="keywordflow">for</span>( <span class="keywordtype">int</span> column = 0; column &lt;= 8; column++ )  <span class="comment">//iterate over all columns</span>
<a name="l00323"></a>00323   {
<a name="l00324"></a>00324     <span class="comment">//get config entries and defaults of the proceeded column from the constants header</span>
<a name="l00325"></a>00325     <span class="keywordflow">switch</span>( column )
<a name="l00326"></a>00326     {
<a name="l00327"></a>00327       <span class="keywordflow">case</span> 0: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_MESSAGE_NUMBER;
<a name="l00328"></a>00328               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_MESSAGE_NUMBER;
<a name="l00329"></a>00329               DefaultWidth = DEFAULT_WIDTH_MESSAGE_NUMBER;
<a name="l00330"></a>00330               DefaultDisplay = DEFAULT_DISPLAY_MESSAGE_NUMBER;
<a name="l00331"></a>00331               <span class="keywordflow">break</span>;
<a name="l00332"></a>00332 
<a name="l00333"></a>00333       <span class="keywordflow">case</span> 1: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_MESSAGE_ACCOUNT;
<a name="l00334"></a>00334               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_MESSAGE_ACCOUNT;
<a name="l00335"></a>00335               DefaultWidth = DEFAULT_WIDTH_MESSAGE_ACCOUNT;
<a name="l00336"></a>00336               DefaultDisplay = DEFAULT_DISPLAY_MESSAGE_ACCOUNT;
<a name="l00337"></a>00337               <span class="keywordflow">break</span>;
<a name="l00338"></a>00338 
<a name="l00339"></a>00339       <span class="keywordflow">case</span> 2: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_MESSAGE_FROM;
<a name="l00340"></a>00340               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_MESSAGE_FROM;
<a name="l00341"></a>00341               DefaultWidth = DEFAULT_WIDTH_MESSAGE_FROM;
<a name="l00342"></a>00342               DefaultDisplay = DEFAULT_DISPLAY_MESSAGE_FROM;
<a name="l00343"></a>00343               <span class="keywordflow">break</span>;
<a name="l00344"></a>00344 
<a name="l00345"></a>00345       <span class="keywordflow">case</span> 3: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_MESSAGE_TO;
<a name="l00346"></a>00346               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_MESSAGE_TO;
<a name="l00347"></a>00347               DefaultWidth = DEFAULT_WIDTH_MESSAGE_TO;
<a name="l00348"></a>00348               DefaultDisplay = DEFAULT_DISPLAY_MESSAGE_TO;
<a name="l00349"></a>00349               <span class="keywordflow">break</span>;
<a name="l00350"></a>00350 
<a name="l00351"></a>00351       <span class="keywordflow">case</span> 4: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_MESSAGE_SUBJECT;
<a name="l00352"></a>00352               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_MESSAGE_SUBJECT;
<a name="l00353"></a>00353               DefaultWidth = DEFAULT_WIDTH_MESSAGE_SUBJECT;
<a name="l00354"></a>00354               DefaultDisplay = DEFAULT_DISPLAY_MESSAGE_SUBJECT;
<a name="l00355"></a>00355               <span class="keywordflow">break</span>;
<a name="l00356"></a>00356 
<a name="l00357"></a>00357       <span class="keywordflow">case</span> 5: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_MESSAGE_DATE;
<a name="l00358"></a>00358               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_MESSAGE_DATE;
<a name="l00359"></a>00359               DefaultWidth = DEFAULT_WIDTH_MESSAGE_DATE;
<a name="l00360"></a>00360               DefaultDisplay = DEFAULT_DISPLAY_MESSAGE_DATE;
<a name="l00361"></a>00361               <span class="keywordflow">break</span>;
<a name="l00362"></a>00362 
<a name="l00363"></a>00363       <span class="keywordflow">case</span> 6: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_MESSAGE_SIZE;
<a name="l00364"></a>00364               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_MESSAGE_SIZE;
<a name="l00365"></a>00365               DefaultWidth = DEFAULT_WIDTH_MESSAGE_SIZE;
<a name="l00366"></a>00366               DefaultDisplay = DEFAULT_DISPLAY_MESSAGE_SIZE;
<a name="l00367"></a>00367               <span class="keywordflow">break</span>;
<a name="l00368"></a>00368 
<a name="l00369"></a>00369       <span class="keywordflow">case</span> 7: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_MESSAGE_CONTENT;
<a name="l00370"></a>00370               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_MESSAGE_CONTENT;
<a name="l00371"></a>00371               DefaultWidth = DEFAULT_WIDTH_MESSAGE_CONTENT;
<a name="l00372"></a>00372               DefaultDisplay = DEFAULT_DISPLAY_MESSAGE_CONTENT;
<a name="l00373"></a>00373               <span class="keywordflow">break</span>;
<a name="l00374"></a>00374 
<a name="l00375"></a>00375       <span class="keywordflow">case</span> 8: ConfigEntryDisplay = CONFIG_ENTRY_DISPLAY_MESSAGE_STATE;
<a name="l00376"></a>00376               ConfigEntrySavedWidth = CONFIG_ENTRY_OLD_WIDTH_MESSAGE_STATE;
<a name="l00377"></a>00377               DefaultWidth = DEFAULT_WIDTH_MESSAGE_STATE;
<a name="l00378"></a>00378               DefaultDisplay = DEFAULT_DISPLAY_MESSAGE_STATE;
<a name="l00379"></a>00379               <span class="keywordflow">break</span>;
<a name="l00380"></a>00380 
<a name="l00381"></a>00381     } <span class="comment">//end select</span>
<a name="l00382"></a>00382 
<a name="l00383"></a>00383     <span class="comment">//get desired column state</span>
<a name="l00384"></a>00384     <span class="keywordtype">bool</span> showColumn = <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>-&gt;readBoolEntry( ConfigEntryDisplay, DefaultDisplay );
<a name="l00385"></a>00385 
<a name="l00386"></a>00386     <span class="comment">//get currently column state</span>
<a name="l00387"></a>00387     <span class="keywordtype">bool</span> curShowed = <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;columnWidth( column ) &gt; 0;
<a name="l00388"></a>00388 
<a name="l00389"></a>00389     <span class="keywordflow">if</span>( showColumn )
<a name="l00390"></a>00390     {
<a name="l00391"></a>00391       <span class="comment">//column will be shown</span>
<a name="l00392"></a>00392 
<a name="l00393"></a>00393       <span class="keywordflow">if</span>( !curShowed )
<a name="l00394"></a>00394       {
<a name="l00395"></a>00395         <span class="comment">//the column is currently not be shown</span>
<a name="l00396"></a>00396 
<a name="l00397"></a>00397         <span class="comment">//get saved width or take default width</span>
<a name="l00398"></a>00398         <span class="keywordtype">int</span> savedWidth = <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>-&gt;readNumEntry( ConfigEntrySavedWidth, DefaultWidth );
<a name="l00399"></a>00399 
<a name="l00400"></a>00400         <span class="comment">//set column width</span>
<a name="l00401"></a>00401         <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;setColumnWidth( column, savedWidth );
<a name="l00402"></a>00402       }
<a name="l00403"></a>00403         <span class="comment">//else: the column is currently shown; do nothing</span>
<a name="l00404"></a>00404     }
<a name="l00405"></a>00405     <span class="keywordflow">else</span>
<a name="l00406"></a>00406     {
<a name="l00407"></a>00407       <span class="comment">//column will not be shown</span>
<a name="l00408"></a>00408 
<a name="l00409"></a>00409       <span class="keywordflow">if</span>( curShowed )
<a name="l00410"></a>00410       {
<a name="l00411"></a>00411         <span class="comment">//the column is currently shown</span>
<a name="l00412"></a>00412 
<a name="l00413"></a>00413         <span class="comment">//save current width</span>
<a name="l00414"></a>00414         <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>-&gt;writeEntry( ConfigEntrySavedWidth, <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;columnWidth( column ) );
<a name="l00415"></a>00415 
<a name="l00416"></a>00416         <span class="comment">//hide column</span>
<a name="l00417"></a>00417         <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;hideColumn( column );
<a name="l00418"></a>00418       }
<a name="l00419"></a>00419         <span class="comment">//else: the column is already hidden; do nothing</span>
<a name="l00420"></a>00420     }
<a name="l00421"></a>00421 
<a name="l00422"></a>00422   } <span class="comment">//end column loop</span>
<a name="l00423"></a>00423 
<a name="l00424"></a>00424   <span class="comment">//save current layout</span>
<a name="l00425"></a>00425   <a class="code" href="classKshowmailView.html#2ba6c19f2ac544b028934170d6443aad">m_pListAccounts</a>-&gt;saveLayout( <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>, CONFIG_GROUP_ACCOUNT_LIST );
<a name="l00426"></a>00426   <a class="code" href="classKshowmailView.html#a319aa36e7f38a92d8691742ad52be6b">m_pListMessages</a>-&gt;saveLayout( <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>, CONFIG_GROUP_MESSAGE_LIST );
<a name="l00427"></a>00427   <a class="code" href="classKshowmailView.html#232c0c7b5295a864e22bd5365044b21d">config</a>-&gt;sync();
<a name="l00428"></a>00428 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu Jul 5 19:36:07 2007 for kshowmail by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.0 </small></address>
</body>
</html>