<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>AlbumShaper: configurationWidget.cpp Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>configurationWidget.cpp</h1><a href="configurationWidget_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//==============================================</span> <a name="l00002"></a>00002 <span class="comment">// copyright : (C) 2003-2005 by Will Stokes</span> <a name="l00003"></a>00003 <span class="comment">//==============================================</span> <a name="l00004"></a>00004 <span class="comment">// This program is free software; you can redistribute it</span> <a name="l00005"></a>00005 <span class="comment">// and/or modify it under the terms of the GNU General</span> <a name="l00006"></a>00006 <span class="comment">// Public License as published by the Free Software</span> <a name="l00007"></a>00007 <span class="comment">// Foundation; either version 2 of the License, or</span> <a name="l00008"></a>00008 <span class="comment">// (at your option) any later version.</span> <a name="l00009"></a>00009 <span class="comment">//==============================================</span> <a name="l00010"></a>00010 <a name="l00011"></a>00011 <span class="comment">//Systemwide includes</span> <a name="l00012"></a>00012 <span class="preprocessor">#include <qwidget.h></span> <a name="l00013"></a>00013 <span class="preprocessor">#include <qlayout.h></span> <a name="l00014"></a>00014 <span class="preprocessor">#include <qpixmap.h></span> <a name="l00015"></a>00015 <span class="preprocessor">#include <qapplication.h></span> <a name="l00016"></a>00016 <span class="preprocessor">#include <qtooltip.h></span> <a name="l00017"></a>00017 <span class="preprocessor">#include <qpushbutton.h></span> <a name="l00018"></a>00018 <a name="l00019"></a>00019 <span class="comment">//Projectwide includes</span> <a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="configuration_8h.html">configuration.h</a>"</span> <a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="configurationWidget_8h.html">configurationWidget.h</a>"</span> <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="groupsWidget_8h.html">groupsWidget.h</a>"</span> <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="groupIcon_8h.html">groupIcon.h</a>"</span> <a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="layoutSettingsWidget_8h.html">layoutSettingsWidget.h</a>"</span> <a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="loadingSavingWidget_8h.html">loadingSavingWidget.h</a>"</span> <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="alertsWidget_8h.html">alertsWidget.h</a>"</span> <a name="l00027"></a>00027 <span class="preprocessor">#include "../config.h"</span> <a name="l00028"></a>00028 <a name="l00029"></a>00029 <span class="comment">//==============================================</span> <a name="l00030"></a><a class="code" href="classConfigurationWidget.html#22e96eca6f8d02346bb2352c226a434e">00030</a> <a class="code" href="classConfigurationWidget.html#22e96eca6f8d02346bb2352c226a434e">ConfigurationWidget::ConfigurationWidget</a>(<a class="code" href="classConfiguration.html" title="Configuration object manages all user-specific application settings.">Configuration</a>* config, <a name="l00031"></a>00031 <a class="code" href="classQWidget.html">QWidget</a> *parent, <a name="l00032"></a>00032 <span class="keyword">const</span> <span class="keywordtype">char</span>* name ) : <a name="l00033"></a>00033 <a class="code" href="classQDialog.html">QDialog</a>(parent,name) <a name="l00034"></a>00034 { <a name="l00035"></a>00035 <span class="comment">//store config pointer</span> <a name="l00036"></a>00036 this->config = config; <a name="l00037"></a>00037 <span class="comment">//--</span> <a name="l00038"></a>00038 <span class="comment">//set window title</span> <a name="l00039"></a>00039 setCaption( tr(<span class="stringliteral">"Settings"</span>)); <a name="l00040"></a>00040 <span class="comment">//--</span> <a name="l00041"></a>00041 <span class="comment">//no icon currently hovered over</span> <a name="l00042"></a>00042 <a class="code" href="classConfigurationWidget.html#22db8b0bfab6285f5cf237c372f9dc5e">currentPseudoSelection</a> = NULL; <a name="l00043"></a>00043 <span class="comment">//----------------------------------------------</span> <a name="l00044"></a>00044 <span class="comment">//create settings widget</span> <a name="l00045"></a>00045 <a class="code" href="classConfigurationWidget.html#fa10d0855148a2302419d3224769f039">layoutWidget</a> = <span class="keyword">new</span> <a class="code" href="classLayoutSettingsWidget.html" title="Layout Settings.">LayoutSettingsWidget</a>(config, <span class="keyword">this</span>); <a name="l00046"></a>00046 <a class="code" href="classConfigurationWidget.html#4a92da0a6e1d43373d13019d84ff9252" title="settings widgets">loadingSavingWidget</a> = <span class="keyword">new</span> <a class="code" href="classLoadingSavingWidget.html" title="Loading/Saving Settings.">LoadingSavingWidget</a>(config, <span class="keyword">this</span>); <a name="l00047"></a>00047 <a class="code" href="classConfigurationWidget.html#b4aae9cd5f1317e33c20d7396b9ec6d2">alertsWidget</a> = <span class="keyword">new</span> <a class="code" href="classAlertsWidget.html" title="Alerts Settings.">AlertsWidget</a>( config, <span class="keyword">this</span> ); <a name="l00048"></a>00048 <span class="comment">//----------------------------------------------</span> <a name="l00049"></a>00049 <span class="comment">//create iconview and icons for groups</span> <a name="l00050"></a>00050 <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a> = <span class="keyword">new</span> <a class="code" href="classGroupsWidget.html" title="Displays group icon and text, also contains pointer to widget for setting group settings...">GroupsWidget</a>( <span class="keyword">this</span> ); <a name="l00051"></a>00051 <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>->setItemTextPos( QIconView::Right ); <a name="l00052"></a>00052 <span class="comment">// groups->setMaxItemWidth(20);</span> <a name="l00053"></a>00053 <span class="comment">//----</span> <a name="l00054"></a>00054 <span class="comment">//construct group labels</span> <a name="l00055"></a>00055 QString labels[3]; <a name="l00056"></a>00056 labels[0] = tr(<span class="stringliteral">"Appearance"</span>); <a name="l00057"></a>00057 labels[1] = tr(<span class="stringliteral">"Load/Save"</span>); <a name="l00058"></a>00058 labels[2] = tr(<span class="stringliteral">"Alerts"</span>); <a name="l00059"></a>00059 <span class="comment">//----</span> <a name="l00060"></a>00060 <span class="comment">//find max text width</span> <a name="l00061"></a>00061 <span class="keywordtype">int</span> maxLabelWidth = 0; <a name="l00062"></a>00062 <span class="keywordtype">int</span> i; <a name="l00063"></a>00063 QFontMetrics fm( qApp->font() ); <a name="l00064"></a>00064 <span class="keywordflow">for</span>(i=0; i<3; i++) <a name="l00065"></a>00065 { <a name="l00066"></a>00066 <span class="keywordflow">if</span>( fm.width( labels[i] ) > maxLabelWidth ) <a name="l00067"></a>00067 maxLabelWidth = fm.width( labels[i] ); <a name="l00068"></a>00068 } <a name="l00069"></a>00069 <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>-><a class="code" href="classGroupsWidget.html#d769b1460640d784ce3abb9b73689294">setTextWidth</a>( maxLabelWidth ); <a name="l00070"></a>00070 <span class="comment">//----</span> <a name="l00071"></a>00071 <span class="comment">//construct actual group icons</span> <a name="l00072"></a>00072 <a class="code" href="classConfigurationWidget.html#bca959eaa916526308d25726202581ea">layoutIcon</a> = <span class="keyword">new</span> <a class="code" href="classGroupIcon.html" title="Displays group icon and text, also contains pointer to widget for setting group settings...">GroupIcon</a>( <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>, QPixmap(QString(<a class="code" href="config_8cpp.html#59e02362a9a29a755712dc830a3eb513">IMAGE_PATH</a>)+<span class="stringliteral">"settingsIcons/layout.png"</span> ), <a name="l00073"></a>00073 labels[0], <a class="code" href="classConfigurationWidget.html#fa10d0855148a2302419d3224769f039">layoutWidget</a> ); <a name="l00074"></a>00074 <a class="code" href="classConfigurationWidget.html#bca959eaa916526308d25726202581ea">layoutIcon</a>->setDragEnabled(<span class="keyword">false</span>); <a name="l00075"></a>00075 <span class="comment">//----</span> <a name="l00076"></a>00076 <a class="code" href="classConfigurationWidget.html#15e641ef244b4d314dbc57761b033bac">loadingSavingIcon</a> = <span class="keyword">new</span> <a class="code" href="classGroupIcon.html" title="Displays group icon and text, also contains pointer to widget for setting group settings...">GroupIcon</a>( <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>, QPixmap(QString(<a class="code" href="config_8cpp.html#59e02362a9a29a755712dc830a3eb513">IMAGE_PATH</a>)+<span class="stringliteral">"settingsIcons/loadsave.png"</span> ), <a name="l00077"></a>00077 labels[1], <a class="code" href="classConfigurationWidget.html#4a92da0a6e1d43373d13019d84ff9252" title="settings widgets">loadingSavingWidget</a> ); <a name="l00078"></a>00078 <a class="code" href="classConfigurationWidget.html#15e641ef244b4d314dbc57761b033bac">loadingSavingIcon</a>->setDragEnabled(<span class="keyword">false</span>); <a name="l00079"></a>00079 <span class="comment">//----</span> <a name="l00080"></a>00080 <a class="code" href="classConfigurationWidget.html#6e0f27ed0cc091339649dc3801b8dd58" title="settings icons">alertsIcon</a> = <span class="keyword">new</span> <a class="code" href="classGroupIcon.html" title="Displays group icon and text, also contains pointer to widget for setting group settings...">GroupIcon</a>( <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>, QPixmap(QString(<a class="code" href="config_8cpp.html#59e02362a9a29a755712dc830a3eb513">IMAGE_PATH</a>)+<span class="stringliteral">"settingsIcons/alerts.png"</span> ), <a name="l00081"></a>00081 labels[2], <a class="code" href="classConfigurationWidget.html#b4aae9cd5f1317e33c20d7396b9ec6d2">alertsWidget</a> ); <a name="l00082"></a>00082 <a class="code" href="classConfigurationWidget.html#6e0f27ed0cc091339649dc3801b8dd58" title="settings icons">alertsIcon</a>->setDragEnabled(<span class="keyword">false</span>); <a name="l00083"></a>00083 <span class="comment">//-------------------------</span> <a name="l00084"></a>00084 <span class="comment">//set default selection</span> <a name="l00085"></a>00085 <a class="code" href="classConfigurationWidget.html#f24bc3c85ef858f5ef16b2bec48bc1ad">currentSettingsWidget</a> = <a class="code" href="classConfigurationWidget.html#fa10d0855148a2302419d3224769f039">layoutWidget</a>; <a name="l00086"></a>00086 <a class="code" href="classConfigurationWidget.html#bca959eaa916526308d25726202581ea">layoutIcon</a>->setSelected(<span class="keyword">true</span>); <a name="l00087"></a>00087 <a class="code" href="classConfigurationWidget.html#4a92da0a6e1d43373d13019d84ff9252" title="settings widgets">loadingSavingWidget</a>->hide(); <a name="l00088"></a>00088 <a class="code" href="classConfigurationWidget.html#b4aae9cd5f1317e33c20d7396b9ec6d2">alertsWidget</a>->hide(); <a name="l00089"></a>00089 <span class="comment">//-------------------------</span> <a name="l00090"></a>00090 <span class="comment">//connect selectionChanged signal to update which settings dialog is displayed</span> <a name="l00091"></a>00091 connect( <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>, SIGNAL(selectionChanged(<a class="code" href="classQIconViewItem.html">QIconViewItem</a>*)), <a name="l00092"></a>00092 SLOT(<a class="code" href="classConfigurationWidget.html#c4b9c1e691cac88117a6308cf6cabfb9" title="updates shown settings dialogue based on newly selected group">updateDialogue</a>(<a class="code" href="classQIconViewItem.html">QIconViewItem</a>*)) ); <a name="l00093"></a>00093 <a name="l00094"></a>00094 <span class="comment">//connect mouse over events to paint pseudo selection in ligher blue</span> <a name="l00095"></a>00095 connect( <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>, SIGNAL(onItem(<a class="code" href="classQIconViewItem.html">QIconViewItem</a>*)), <a name="l00096"></a>00096 SLOT(<a class="code" href="classConfigurationWidget.html#84905f741c60c11c08b9b796a7d50f76" title="repaints a group icon if move is moved over it">repaintGroup</a>(<a class="code" href="classQIconViewItem.html">QIconViewItem</a>*)) ); <a name="l00097"></a>00097 <a name="l00098"></a>00098 <span class="comment">//clear any pseudo selection when mouse moves off icons</span> <a name="l00099"></a>00099 connect( <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>, SIGNAL(onViewport()), <a name="l00100"></a>00100 SLOT(<a class="code" href="classConfigurationWidget.html#2362ebc5177bafc9f19b4cbf58ea3bb9" title="clears any pseudo selections">clearPseudoSelection</a>()) ); <a name="l00101"></a>00101 <a name="l00102"></a>00102 <a name="l00103"></a>00103 <span class="comment">//create buttons frame and widgets</span> <a name="l00104"></a>00104 <a class="code" href="classConfigurationWidget.html#4a99f6dd97ed2ac25bf321309fb0364d">buttonsFrame</a> = <span class="keyword">new</span> <a class="code" href="classQFrame.html">QFrame</a>( <span class="keyword">this</span> ); <a name="l00105"></a>00105 <a class="code" href="classConfigurationWidget.html#ad6a971ed7af6b0a724ebc8028607322">okButton</a> = <span class="keyword">new</span> QPushButton( tr(<span class="stringliteral">"Apply"</span>), <a class="code" href="classConfigurationWidget.html#4a99f6dd97ed2ac25bf321309fb0364d">buttonsFrame</a> ); <a name="l00106"></a>00106 <a class="code" href="classConfigurationWidget.html#ad6a971ed7af6b0a724ebc8028607322">okButton</a>->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); <a name="l00107"></a>00107 <a class="code" href="classConfigurationWidget.html#ad6a971ed7af6b0a724ebc8028607322">okButton</a>->setDefault(<span class="keyword">true</span>); <a name="l00108"></a>00108 connect( <a class="code" href="classConfigurationWidget.html#ad6a971ed7af6b0a724ebc8028607322">okButton</a>, SIGNAL(clicked()), SLOT(<a class="code" href="classConfigurationWidget.html#2a379c54f2dad1fd00b2aa1b76c80fc2">saveSettings</a>()) ); <a name="l00109"></a>00109 <a class="code" href="classConfigurationWidget.html#bec91cc73265e103eb8a364b50ba50b8">cancelButton</a> = <span class="keyword">new</span> QPushButton( tr(<span class="stringliteral">"Cancel"</span>), <a class="code" href="classConfigurationWidget.html#4a99f6dd97ed2ac25bf321309fb0364d">buttonsFrame</a> ); <a name="l00110"></a>00110 <a class="code" href="classConfigurationWidget.html#bec91cc73265e103eb8a364b50ba50b8">cancelButton</a>->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); <a name="l00111"></a>00111 connect( <a class="code" href="classConfigurationWidget.html#bec91cc73265e103eb8a364b50ba50b8">cancelButton</a>, SIGNAL(clicked()), SLOT(<a class="code" href="classConfigurationWidget.html#21f0bf797bf4d1835ed6bc185373cce2">reject</a>()) ); <a name="l00112"></a>00112 <a class="code" href="classConfigurationWidget.html#9271d21f1ddc14daac5abc44fb3a6c89">buttonsGrid</a> = <span class="keyword">new</span> QGridLayout( <a class="code" href="classConfigurationWidget.html#4a99f6dd97ed2ac25bf321309fb0364d">buttonsFrame</a>, 1, 5, 0 ); <a name="l00113"></a>00113 <a class="code" href="classConfigurationWidget.html#9271d21f1ddc14daac5abc44fb3a6c89">buttonsGrid</a>->setColStretch( 0, 1 ); <a name="l00114"></a>00114 <a class="code" href="classConfigurationWidget.html#9271d21f1ddc14daac5abc44fb3a6c89">buttonsGrid</a>->addWidget( <a class="code" href="classConfigurationWidget.html#ad6a971ed7af6b0a724ebc8028607322">okButton</a>, 0, 1 ); <a name="l00115"></a>00115 <a class="code" href="classConfigurationWidget.html#9271d21f1ddc14daac5abc44fb3a6c89">buttonsGrid</a>->addColSpacing( 2, 10 ); <a name="l00116"></a>00116 <a class="code" href="classConfigurationWidget.html#9271d21f1ddc14daac5abc44fb3a6c89">buttonsGrid</a>->addWidget( <a class="code" href="classConfigurationWidget.html#bec91cc73265e103eb8a364b50ba50b8">cancelButton</a>, 0, 3 ); <a name="l00117"></a>00117 <a class="code" href="classConfigurationWidget.html#9271d21f1ddc14daac5abc44fb3a6c89">buttonsGrid</a>->setColStretch( 4, 1 ); <a name="l00118"></a>00118 <span class="comment">//----------------------------------------------</span> <a name="l00119"></a>00119 <span class="comment">//place all widgets in a grid</span> <a name="l00120"></a>00120 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a> = <span class="keyword">new</span> QGridLayout( <span class="keyword">this</span>, 5, 5, 0 ); <a name="l00121"></a>00121 <a name="l00122"></a>00122 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a>->setRowSpacing(0,8); <a name="l00123"></a>00123 <a name="l00124"></a>00124 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a>->addWidget( <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>, 1, 1); <a name="l00125"></a>00125 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a>->addWidget( <a class="code" href="classConfigurationWidget.html#b4aae9cd5f1317e33c20d7396b9ec6d2">alertsWidget</a>, 1, 3); <a name="l00126"></a>00126 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a>->addWidget( <a class="code" href="classConfigurationWidget.html#fa10d0855148a2302419d3224769f039">layoutWidget</a>, 1, 3); <a name="l00127"></a>00127 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a>->addWidget( <a class="code" href="classConfigurationWidget.html#4a92da0a6e1d43373d13019d84ff9252" title="settings widgets">loadingSavingWidget</a>, 1, 3); <a name="l00128"></a>00128 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a>->setRowStretch( 1, 1 ); <a name="l00129"></a>00129 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a>->setColStretch( 3, 1 ); <a name="l00130"></a>00130 <a name="l00131"></a>00131 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a>->setRowSpacing(2,8); <a name="l00132"></a>00132 <a name="l00133"></a>00133 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a>->addMultiCellWidget( <a class="code" href="classConfigurationWidget.html#4a99f6dd97ed2ac25bf321309fb0364d">buttonsFrame</a>, 3, 3, 0, 4); <a name="l00134"></a>00134 <a name="l00135"></a>00135 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a>->setRowSpacing(4,8); <a name="l00136"></a>00136 <a name="l00137"></a>00137 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a>->setColSpacing(0,8); <a name="l00138"></a>00138 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a>->setColSpacing(2,8); <a name="l00139"></a>00139 <a class="code" href="classConfigurationWidget.html#2c94cce2076488af4b1bad1aba290f1e" title="Grid widgets place in.">grid</a>->setColSpacing(4,8); <a name="l00140"></a>00140 <a name="l00141"></a>00141 <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>->setGridX(1); <a name="l00142"></a>00142 <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>->arrangeItemsInGrid(); <a name="l00143"></a>00143 <a name="l00144"></a>00144 <span class="keywordtype">int</span> maxWidth = 0; <a name="l00145"></a>00145 <span class="keywordtype">int</span> maxHeight = 0; <a name="l00146"></a>00146 <a name="l00147"></a>00147 <a class="code" href="classConfigurationWidget.html#fa10d0855148a2302419d3224769f039">layoutWidget</a>->constPolish(); <a name="l00148"></a>00148 <a class="code" href="classConfigurationWidget.html#4a92da0a6e1d43373d13019d84ff9252" title="settings widgets">loadingSavingWidget</a>->constPolish(); <a name="l00149"></a>00149 <a class="code" href="classConfigurationWidget.html#b4aae9cd5f1317e33c20d7396b9ec6d2">alertsWidget</a>->constPolish(); <a name="l00150"></a>00150 <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>->constPolish(); <a name="l00151"></a>00151 <a name="l00152"></a>00152 QSize s = <a class="code" href="classConfigurationWidget.html#fa10d0855148a2302419d3224769f039">layoutWidget</a>->minimumSizeHint(); <a name="l00153"></a>00153 <span class="keywordflow">if</span>(maxWidth < s.width()) maxWidth = s.width(); <a name="l00154"></a>00154 <span class="keywordflow">if</span>(maxHeight < s.height()) maxHeight = s.height(); <a name="l00155"></a>00155 <a name="l00156"></a>00156 s = <a class="code" href="classConfigurationWidget.html#4a92da0a6e1d43373d13019d84ff9252" title="settings widgets">loadingSavingWidget</a>->minimumSizeHint(); <a name="l00157"></a>00157 <span class="keywordflow">if</span>(maxWidth < s.width()) maxWidth = s.width(); <a name="l00158"></a>00158 <span class="keywordflow">if</span>(maxHeight < s.height()) maxHeight = s.height(); <a name="l00159"></a>00159 <a name="l00160"></a>00160 s = <a class="code" href="classConfigurationWidget.html#b4aae9cd5f1317e33c20d7396b9ec6d2">alertsWidget</a>->minimumSizeHint(); <a name="l00161"></a>00161 <span class="keywordflow">if</span>(maxWidth < s.width()) maxWidth = s.width(); <a name="l00162"></a>00162 <span class="keywordflow">if</span>(maxHeight < s.height()) maxHeight = s.height(); <a name="l00163"></a>00163 <a name="l00164"></a>00164 s = <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>->minimumSizeHint(); <a name="l00165"></a>00165 <span class="keywordflow">if</span>(maxHeight < s.height()) maxHeight = s.height(); <a name="l00166"></a>00166 <a name="l00167"></a>00167 maxWidth = maxWidth + s.width(); <a name="l00168"></a>00168 maxHeight += <a class="code" href="classConfigurationWidget.html#ad6a971ed7af6b0a724ebc8028607322">okButton</a>->minimumSizeHint().height(); <a name="l00169"></a>00169 <span class="comment">//add padding</span> <a name="l00170"></a>00170 maxWidth += 3*8; <a name="l00171"></a>00171 maxHeight += 3*8; <a name="l00172"></a>00172 <a name="l00173"></a>00173 <span class="comment">//add a little extra for when text entries need more space</span> <a name="l00174"></a>00174 maxWidth += 100; <a name="l00175"></a>00175 <a name="l00176"></a>00176 resize( maxWidth, maxHeight ); <a name="l00177"></a>00177 <a name="l00178"></a>00178 show(); <a name="l00179"></a>00179 setFixedSize(size()); <a name="l00180"></a>00180 <span class="comment">//----------------------------------------------</span> <a name="l00181"></a>00181 <span class="comment">//load setting values</span> <a name="l00182"></a>00182 <a class="code" href="classConfigurationWidget.html#fa10d0855148a2302419d3224769f039">layoutWidget</a>-><a class="code" href="classLayoutSettingsWidget.html#28dfa4fdbf9b2c9d2760dcfe97be7a25">loadSettings</a>(); <a name="l00183"></a>00183 <a class="code" href="classConfigurationWidget.html#4a92da0a6e1d43373d13019d84ff9252" title="settings widgets">loadingSavingWidget</a>-><a class="code" href="classLoadingSavingWidget.html#13c734fed532ec6291c2b6efab8f27bd">loadSettings</a>(); <a name="l00184"></a>00184 <a class="code" href="classConfigurationWidget.html#b4aae9cd5f1317e33c20d7396b9ec6d2">alertsWidget</a>-><a class="code" href="classAlertsWidget.html#47acfcb914513177b6ee32f72bff8be2">loadSettings</a>(); <a name="l00185"></a>00185 <span class="comment">//----------------------------------------------</span> <a name="l00186"></a>00186 } <a name="l00187"></a>00187 <span class="comment">//==============================================</span> <a name="l00188"></a><a class="code" href="classConfigurationWidget.html#c4b9c1e691cac88117a6308cf6cabfb9">00188</a> <span class="keywordtype">void</span> <a class="code" href="classConfigurationWidget.html#c4b9c1e691cac88117a6308cf6cabfb9" title="updates shown settings dialogue based on newly selected group">ConfigurationWidget::updateDialogue</a>( <a class="code" href="classQIconViewItem.html">QIconViewItem</a>* selection) <a name="l00189"></a>00189 { <a name="l00190"></a>00190 <span class="comment">//hide current selection</span> <a name="l00191"></a>00191 <a class="code" href="classConfigurationWidget.html#f24bc3c85ef858f5ef16b2bec48bc1ad">currentSettingsWidget</a>->hide(); <a name="l00192"></a>00192 <a name="l00193"></a>00193 <span class="comment">//set current and show</span> <a name="l00194"></a>00194 <a class="code" href="classConfigurationWidget.html#f24bc3c85ef858f5ef16b2bec48bc1ad">currentSettingsWidget</a> = ((<a class="code" href="classGroupIcon.html" title="Displays group icon and text, also contains pointer to widget for setting group settings...">GroupIcon</a>*)selection)->getSettingsWidget(); <a name="l00195"></a>00195 <a class="code" href="classConfigurationWidget.html#f24bc3c85ef858f5ef16b2bec48bc1ad">currentSettingsWidget</a>->show(); <a name="l00196"></a>00196 } <a name="l00197"></a>00197 <span class="comment">//==============================================</span> <a name="l00198"></a><a class="code" href="classConfigurationWidget.html#84905f741c60c11c08b9b796a7d50f76">00198</a> <span class="keywordtype">void</span> <a class="code" href="classConfigurationWidget.html#84905f741c60c11c08b9b796a7d50f76" title="repaints a group icon if move is moved over it">ConfigurationWidget::repaintGroup</a>( <a class="code" href="classQIconViewItem.html">QIconViewItem</a>* pseudoSelection) <a name="l00199"></a>00199 { <a name="l00200"></a>00200 <span class="comment">//if old pseudo selection unselect it</span> <a name="l00201"></a>00201 <a class="code" href="classConfigurationWidget.html#2362ebc5177bafc9f19b4cbf58ea3bb9" title="clears any pseudo selections">clearPseudoSelection</a>(); <a name="l00202"></a>00202 <a name="l00203"></a>00203 <span class="comment">//paint new selection</span> <a name="l00204"></a>00204 <a class="code" href="classConfigurationWidget.html#22db8b0bfab6285f5cf237c372f9dc5e">currentPseudoSelection</a> = (<a class="code" href="classGroupIcon.html" title="Displays group icon and text, also contains pointer to widget for setting group settings...">GroupIcon</a>*)pseudoSelection; <a name="l00205"></a>00205 <a class="code" href="classConfigurationWidget.html#22db8b0bfab6285f5cf237c372f9dc5e">currentPseudoSelection</a>-><a class="code" href="classGroupIcon.html#24fc604d6371cacd345e34ddb126d4b3">setMousedOver</a>(<span class="keyword">true</span>); <a name="l00206"></a>00206 <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>->repaintItem(<a class="code" href="classConfigurationWidget.html#22db8b0bfab6285f5cf237c372f9dc5e">currentPseudoSelection</a>); <a name="l00207"></a>00207 } <a name="l00208"></a>00208 <span class="comment">//==============================================</span> <a name="l00209"></a><a class="code" href="classConfigurationWidget.html#2362ebc5177bafc9f19b4cbf58ea3bb9">00209</a> <span class="keywordtype">void</span> <a class="code" href="classConfigurationWidget.html#2362ebc5177bafc9f19b4cbf58ea3bb9" title="clears any pseudo selections">ConfigurationWidget::clearPseudoSelection</a>() <a name="l00210"></a>00210 { <a name="l00211"></a>00211 <span class="comment">//if old pseudo selection unselect it</span> <a name="l00212"></a>00212 <span class="keywordflow">if</span>(<a class="code" href="classConfigurationWidget.html#22db8b0bfab6285f5cf237c372f9dc5e">currentPseudoSelection</a> != NULL) <a name="l00213"></a>00213 { <a name="l00214"></a>00214 <a class="code" href="classConfigurationWidget.html#22db8b0bfab6285f5cf237c372f9dc5e">currentPseudoSelection</a>-><a class="code" href="classGroupIcon.html#24fc604d6371cacd345e34ddb126d4b3">setMousedOver</a>(<span class="keyword">false</span>); <a name="l00215"></a>00215 <a class="code" href="classConfigurationWidget.html#e9cca06f071c6d9a8c33d17bbae8e35c" title="list of subalbums">groups</a>->repaintItem(<a class="code" href="classConfigurationWidget.html#22db8b0bfab6285f5cf237c372f9dc5e">currentPseudoSelection</a>); <a name="l00216"></a>00216 <a class="code" href="classConfigurationWidget.html#22db8b0bfab6285f5cf237c372f9dc5e">currentPseudoSelection</a> = NULL; <a name="l00217"></a>00217 } <a name="l00218"></a>00218 } <a name="l00219"></a>00219 <span class="comment">//==============================================</span> <a name="l00220"></a><a class="code" href="classConfigurationWidget.html#2a379c54f2dad1fd00b2aa1b76c80fc2">00220</a> <span class="keywordtype">void</span> <a class="code" href="classConfigurationWidget.html#2a379c54f2dad1fd00b2aa1b76c80fc2">ConfigurationWidget::saveSettings</a>() <a name="l00221"></a>00221 { <a name="l00222"></a>00222 <a class="code" href="classConfigurationWidget.html#fa10d0855148a2302419d3224769f039">layoutWidget</a>-><a class="code" href="classLayoutSettingsWidget.html#00855b33fa79399753bd0e78e727d68b">saveSettings</a>(); <a name="l00223"></a>00223 <a class="code" href="classConfigurationWidget.html#4a92da0a6e1d43373d13019d84ff9252" title="settings widgets">loadingSavingWidget</a>-><a class="code" href="classLoadingSavingWidget.html#9b4ecf1e74d294798ca8b5ddbbff4b6a">saveSettings</a>(); <a name="l00224"></a>00224 <a class="code" href="classConfigurationWidget.html#b4aae9cd5f1317e33c20d7396b9ec6d2">alertsWidget</a>-><a class="code" href="classAlertsWidget.html#45776947bd80b290342ae1796b8da4ae">saveSettings</a>(); <a name="l00225"></a>00225 close(); <a name="l00226"></a>00226 } <a name="l00227"></a>00227 <span class="comment">//==============================================</span> <a name="l00228"></a><a class="code" href="classConfigurationWidget.html#1ee83fcc463f70cb5fae68ba6f0b4638">00228</a> <span class="keywordtype">void</span> <a class="code" href="classConfigurationWidget.html#1ee83fcc463f70cb5fae68ba6f0b4638">ConfigurationWidget::closeEvent</a>( QCloseEvent* e) <a name="l00229"></a>00229 { <a name="l00230"></a>00230 <a class="code" href="classConfigurationWidget.html#1ee83fcc463f70cb5fae68ba6f0b4638">QWidget::closeEvent</a>( e ); <a name="l00231"></a>00231 emit <a class="code" href="classConfigurationWidget.html#8c12990f6deb441d7149665bbdcc0e14">closed</a>(); <a name="l00232"></a>00232 } <a name="l00233"></a>00233 <span class="comment">//==============================================</span> <a name="l00234"></a><a class="code" href="classConfigurationWidget.html#21f0bf797bf4d1835ed6bc185373cce2">00234</a> <span class="keywordtype">void</span> <a class="code" href="classConfigurationWidget.html#21f0bf797bf4d1835ed6bc185373cce2">ConfigurationWidget::reject</a>() <a name="l00235"></a>00235 { <a name="l00236"></a>00236 <a class="code" href="classConfigurationWidget.html#21f0bf797bf4d1835ed6bc185373cce2">QDialog::reject</a>(); <a name="l00237"></a>00237 emit <a class="code" href="classConfigurationWidget.html#8c12990f6deb441d7149665bbdcc0e14">closed</a>(); <a name="l00238"></a>00238 } <a name="l00239"></a>00239 <span class="comment">//==============================================</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 23 02:34:25 2009 for AlbumShaper by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> </body> </html>