<!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"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>AlbumShaper: loadingSavingWidget.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.6.2 --> <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>loadingSavingWidget.cpp</h1><a href="loadingSavingWidget_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 <qlayout.h></span> <a name="l00013"></a>00013 <span class="preprocessor">#include <qlabel.h></span> <a name="l00014"></a>00014 <span class="preprocessor">#include <qfont.h></span> <a name="l00015"></a>00015 <span class="preprocessor">#include <qframe.h></span> <a name="l00016"></a>00016 <span class="preprocessor">#include <qcheckbox.h></span> <a name="l00017"></a>00017 <span class="preprocessor">#include <qvgroupbox.h></span> <a name="l00018"></a>00018 <span class="preprocessor">#include <qlineedit.h></span> <a name="l00019"></a>00019 <span class="preprocessor">#include <qpushbutton.h></span> <a name="l00020"></a>00020 <span class="preprocessor">#include <qtooltip.h></span> <a name="l00021"></a>00021 <span class="preprocessor">#include <qcombobox.h></span> <a name="l00022"></a>00022 <span class="preprocessor">#include <qstringlist.h></span> <a name="l00023"></a>00023 <span class="preprocessor">#include <qdir.h></span> <a name="l00024"></a>00024 <span class="preprocessor">#include <qfiledialog.h></span> <a name="l00025"></a>00025 <span class="preprocessor">#include <qslider.h></span> <a name="l00026"></a>00026 <span class="preprocessor">#include <qvalidator.h></span> <a name="l00027"></a>00027 <a name="l00028"></a>00028 <span class="comment">//Projectwide includes</span> <a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="loadingSavingWidget_8h.html">loadingSavingWidget.h</a>"</span> <a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="configuration_8h.html">configuration.h</a>"</span> <a name="l00031"></a>00031 <span class="preprocessor">#include "../config.h"</span> <a name="l00032"></a>00032 <a name="l00033"></a>00033 <span class="comment">//PLATFORM_SPECIFIC_CODE</span> <a name="l00034"></a>00034 <span class="preprocessor">#if defined(Q_OS_WIN)</span> <a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#include <stdlib.h></span> <a name="l00036"></a>00036 <span class="preprocessor">#endif</span> <a name="l00037"></a>00037 <span class="preprocessor"></span> <a name="l00038"></a>00038 <span class="comment">//==============================================</span> <a name="l00039"></a><a class="code" href="classLoadingSavingWidget.html#a98c32ce7839913cb572fb3db70206d6b">00039</a> <a class="code" href="classLoadingSavingWidget.html#a98c32ce7839913cb572fb3db70206d6b">LoadingSavingWidget::LoadingSavingWidget</a>( <a class="code" href="classConfiguration.html" title="Configuration object manages all user-specific application settings.">Configuration</a>* config, <a name="l00040"></a>00040 <a class="code" href="classQWidget.html">QWidget</a>* parent, <a name="l00041"></a>00041 <span class="keyword">const</span> <span class="keywordtype">char</span>* name ) : <a class="code" href="classQWidget.html">QWidget</a>( parent, name) <a name="l00042"></a>00042 { <a name="l00043"></a>00043 this->config = config; <a name="l00044"></a>00044 <a name="l00045"></a>00045 <a class="code" href="classLoadingSavingWidget.html#a65317e7951079e40c7843dff9752cde1">categoryLabel</a> = <span class="keyword">new</span> <a class="code" href="classQLabel.html">QLabel</a>( tr(<span class="stringliteral">"Loading + Saving:"</span>), <span class="keyword">this</span>); <a name="l00046"></a>00046 QFont labelFont = <a class="code" href="classLoadingSavingWidget.html#a65317e7951079e40c7843dff9752cde1">categoryLabel</a>->font(); <a name="l00047"></a>00047 labelFont.setWeight(QFont::Bold); <a name="l00048"></a>00048 <a class="code" href="classLoadingSavingWidget.html#a65317e7951079e40c7843dff9752cde1">categoryLabel</a>->setFont( labelFont ); <a name="l00049"></a>00049 <a name="l00050"></a>00050 <a class="code" href="classLoadingSavingWidget.html#a785074d5dd657640ae1ff653df5ad95a">horizontalLine</a> = <span class="keyword">new</span> <a class="code" href="classQFrame.html">QFrame</a>(<span class="keyword">this</span>); <a name="l00051"></a>00051 <a class="code" href="classLoadingSavingWidget.html#a785074d5dd657640ae1ff653df5ad95a">horizontalLine</a>->setLineWidth(2); <a name="l00052"></a>00052 <a class="code" href="classLoadingSavingWidget.html#a785074d5dd657640ae1ff653df5ad95a">horizontalLine</a>->setMidLineWidth(1); <a name="l00053"></a>00053 <a class="code" href="classLoadingSavingWidget.html#a785074d5dd657640ae1ff653df5ad95a">horizontalLine</a>->setFrameStyle( QFrame::HLine | QFrame::Raised ); <a name="l00054"></a>00054 <span class="comment">//----------------</span> <a name="l00055"></a>00055 <span class="comment">//Default new album theme</span> <a name="l00056"></a>00056 <a class="code" href="classLoadingSavingWidget.html#ae45293f632464af1b85848e03dd36bd0">defaultToThisThemeFrame</a> = <span class="keyword">new</span> <a class="code" href="classQFrame.html">QFrame</a>( <span class="keyword">this</span> ); <a name="l00057"></a>00057 <a class="code" href="classLoadingSavingWidget.html#a4c5d89914215a9d4b4ca68d6b31af0f5">defaultToThisThemeOnNew</a> = <span class="keyword">new</span> <a class="code" href="classQLabel.html">QLabel</a>( tr(<span class="stringliteral">"Default new album theme:"</span>), <a class="code" href="classLoadingSavingWidget.html#ae45293f632464af1b85848e03dd36bd0">defaultToThisThemeFrame</a>); <a name="l00058"></a>00058 <a class="code" href="classLoadingSavingWidget.html#a28b8ccc19c91bb37fbca63c201c77243">defaultToThisTheme</a> = <span class="keyword">new</span> QComboBox( <a class="code" href="classLoadingSavingWidget.html#ae45293f632464af1b85848e03dd36bd0">defaultToThisThemeFrame</a> ); <a name="l00059"></a>00059 <a name="l00060"></a>00060 <a class="code" href="classLoadingSavingWidget.html#a28b8ccc19c91bb37fbca63c201c77243">defaultToThisTheme</a>->insertItem( tr(<span class="stringliteral">"Last Used"</span>) ); <a name="l00061"></a>00061 QDir localDir( <a class="code" href="config_8cpp.html#aee0cb822aa7f2b785c390ae0099e22a9">THEMES_PATH</a> ); <a name="l00062"></a>00062 QStringList list = localDir.entryList( QDir::Dirs ); <a name="l00063"></a>00063 QStringList::Iterator file; <a name="l00064"></a>00064 <span class="keywordflow">for</span> ( file = list.begin(); file != list.end(); ++file ) <a name="l00065"></a>00065 { <a name="l00066"></a>00066 <span class="keywordflow">if</span>(localDir.exists( QString(*file) + <span class="stringliteral">"/theme.xsl"</span> )) <a name="l00067"></a>00067 <a class="code" href="classLoadingSavingWidget.html#a28b8ccc19c91bb37fbca63c201c77243">defaultToThisTheme</a>->insertItem( *file ); <a name="l00068"></a>00068 } <a name="l00069"></a>00069 <a name="l00070"></a>00070 <a class="code" href="classLoadingSavingWidget.html#a717434a0285b8389a2a102dacbf20ea8">defaultToThisThemeGrid</a> = <span class="keyword">new</span> QGridLayout(<a class="code" href="classLoadingSavingWidget.html#ae45293f632464af1b85848e03dd36bd0">defaultToThisThemeFrame</a>, 1, 4, 0); <a name="l00071"></a>00071 <a class="code" href="classLoadingSavingWidget.html#a717434a0285b8389a2a102dacbf20ea8">defaultToThisThemeGrid</a>->addWidget(<a class="code" href="classLoadingSavingWidget.html#a4c5d89914215a9d4b4ca68d6b31af0f5">defaultToThisThemeOnNew</a>, 0, 0); <a name="l00072"></a>00072 <a class="code" href="classLoadingSavingWidget.html#a717434a0285b8389a2a102dacbf20ea8">defaultToThisThemeGrid</a>->setColSpacing(1, 8); <a name="l00073"></a>00073 <a class="code" href="classLoadingSavingWidget.html#a717434a0285b8389a2a102dacbf20ea8">defaultToThisThemeGrid</a>->addWidget(<a class="code" href="classLoadingSavingWidget.html#a28b8ccc19c91bb37fbca63c201c77243">defaultToThisTheme</a>, 0, 2); <a name="l00074"></a>00074 <a class="code" href="classLoadingSavingWidget.html#a717434a0285b8389a2a102dacbf20ea8">defaultToThisThemeGrid</a>->setColSpacing(3, 8); <a name="l00075"></a>00075 <a class="code" href="classLoadingSavingWidget.html#a717434a0285b8389a2a102dacbf20ea8">defaultToThisThemeGrid</a>->setColStretch(3, 1); <a name="l00076"></a>00076 <span class="comment">//----------------</span> <a name="l00077"></a>00077 <span class="comment">//Temp directory</span> <a name="l00078"></a>00078 <a class="code" href="classLoadingSavingWidget.html#a18e09dbe205eb4900e152922e3357c22" title="Temporary Image directory.">tempImageDirectoryFrame</a> = <span class="keyword">new</span> <a class="code" href="classQFrame.html">QFrame</a>( <span class="keyword">this</span> ); <a name="l00079"></a>00079 <a class="code" href="classLoadingSavingWidget.html#abb0d08b0c62af651768beb71201113c6">tempImageDirectory</a> = <span class="keyword">new</span> <a class="code" href="classQLabel.html">QLabel</a>( tr(<span class="stringliteral">"Temporary image directory:"</span>), <a class="code" href="classLoadingSavingWidget.html#a18e09dbe205eb4900e152922e3357c22" title="Temporary Image directory.">tempImageDirectoryFrame</a>); <a name="l00080"></a>00080 <a class="code" href="classLoadingSavingWidget.html#a84f70d9a9741fd9aaf480cfeafd20476">tempImageDirectoryVal</a> = <span class="keyword">new</span> QLineEdit( <a class="code" href="classLoadingSavingWidget.html#a18e09dbe205eb4900e152922e3357c22" title="Temporary Image directory.">tempImageDirectoryFrame</a> ); <a name="l00081"></a>00081 <a class="code" href="classLoadingSavingWidget.html#a84f70d9a9741fd9aaf480cfeafd20476">tempImageDirectoryVal</a>->setText( <span class="stringliteral">"/home"</span> ); <a name="l00082"></a>00082 <a class="code" href="classLoadingSavingWidget.html#ad34a0db782e3a9f944c57b9797bf26d0">browseButton</a> = <span class="keyword">new</span> QPushButton( <a class="code" href="classLoadingSavingWidget.html#a18e09dbe205eb4900e152922e3357c22" title="Temporary Image directory.">tempImageDirectoryFrame</a> ); <a name="l00083"></a>00083 <a class="code" href="classLoadingSavingWidget.html#ad34a0db782e3a9f944c57b9797bf26d0">browseButton</a>->setPixmap( QPixmap(QString(<a class="code" href="config_8cpp.html#a59e02362a9a29a755712dc830a3eb513">IMAGE_PATH</a>)+<span class="stringliteral">"buttonIcons/browse.png"</span>) ); <a name="l00084"></a>00084 <a class="code" href="classLoadingSavingWidget.html#ad34a0db782e3a9f944c57b9797bf26d0">browseButton</a>->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum ); <a name="l00085"></a>00085 QToolTip::add( <a class="code" href="classLoadingSavingWidget.html#ad34a0db782e3a9f944c57b9797bf26d0">browseButton</a>, tr(<span class="stringliteral">"Browse to temporary image directory"</span>) ); <a name="l00086"></a>00086 connect( <a class="code" href="classLoadingSavingWidget.html#ad34a0db782e3a9f944c57b9797bf26d0">browseButton</a>, SIGNAL(clicked()), SLOT(<a class="code" href="classLoadingSavingWidget.html#a15ce2d54898cc82ce07deb64e0f2f5cc">browse</a>()) ); <a name="l00087"></a>00087 <a name="l00088"></a>00088 <a class="code" href="classLoadingSavingWidget.html#acf4891b3df111c676905737ec00f2e04">tempImageDirectoryGrid</a> = <span class="keyword">new</span> QGridLayout(<a class="code" href="classLoadingSavingWidget.html#a18e09dbe205eb4900e152922e3357c22" title="Temporary Image directory.">tempImageDirectoryFrame</a>, 1, 5, 0); <a name="l00089"></a>00089 <a class="code" href="classLoadingSavingWidget.html#acf4891b3df111c676905737ec00f2e04">tempImageDirectoryGrid</a>->addWidget(<a class="code" href="classLoadingSavingWidget.html#abb0d08b0c62af651768beb71201113c6">tempImageDirectory</a>, 0, 0); <a name="l00090"></a>00090 <a class="code" href="classLoadingSavingWidget.html#acf4891b3df111c676905737ec00f2e04">tempImageDirectoryGrid</a>->setColSpacing(1, 8); <a name="l00091"></a>00091 <a class="code" href="classLoadingSavingWidget.html#acf4891b3df111c676905737ec00f2e04">tempImageDirectoryGrid</a>->addWidget(<a class="code" href="classLoadingSavingWidget.html#a84f70d9a9741fd9aaf480cfeafd20476">tempImageDirectoryVal</a>, 0, 2); <a name="l00092"></a>00092 <a class="code" href="classLoadingSavingWidget.html#acf4891b3df111c676905737ec00f2e04">tempImageDirectoryGrid</a>->setColStretch(2, 1); <a name="l00093"></a>00093 <a class="code" href="classLoadingSavingWidget.html#acf4891b3df111c676905737ec00f2e04">tempImageDirectoryGrid</a>->setColSpacing(3, 8); <a name="l00094"></a>00094 <a class="code" href="classLoadingSavingWidget.html#acf4891b3df111c676905737ec00f2e04">tempImageDirectoryGrid</a>->addWidget(<a class="code" href="classLoadingSavingWidget.html#ad34a0db782e3a9f944c57b9797bf26d0">browseButton</a>, 0, 4); <a name="l00095"></a>00095 <span class="comment">//----------------</span> <a name="l00096"></a>00096 <span class="comment">//Check photo mods since last load?</span> <a name="l00097"></a>00097 <a class="code" href="classLoadingSavingWidget.html#a09c1a767b34091ca7a3070aaab9bddce" title="Check for photo modifications on load.">checkPhotoMods</a> = <span class="keyword">new</span> QCheckBox( tr(<span class="stringliteral">"Check for photo modifications"</span>), <span class="keyword">this</span> ); <a name="l00098"></a>00098 <span class="comment">//----------------</span> <a name="l00099"></a>00099 <span class="comment">//Setup larger boxes in overall grid</span> <a name="l00100"></a>00100 <a class="code" href="classLoadingSavingWidget.html#aa6a8f529ead735c50373592343d5b552">mainGrid</a> = <span class="keyword">new</span> QGridLayout( <span class="keyword">this</span>, 6, 1, 0); <a name="l00101"></a>00101 <a class="code" href="classLoadingSavingWidget.html#aa6a8f529ead735c50373592343d5b552">mainGrid</a>->setSpacing( <a class="code" href="config_8h.html#a07d364596a27705c900f07340515d5db">WIDGET_SPACING</a> ); <a name="l00102"></a>00102 <a name="l00103"></a>00103 <a class="code" href="classLoadingSavingWidget.html#aa6a8f529ead735c50373592343d5b552">mainGrid</a>->addWidget( <a class="code" href="classLoadingSavingWidget.html#a65317e7951079e40c7843dff9752cde1">categoryLabel</a>, 0, 0, Qt::AlignLeft ); <a name="l00104"></a>00104 <a class="code" href="classLoadingSavingWidget.html#aa6a8f529ead735c50373592343d5b552">mainGrid</a>->addWidget( <a class="code" href="classLoadingSavingWidget.html#a785074d5dd657640ae1ff653df5ad95a">horizontalLine</a>, 1, 0 ); <a name="l00105"></a>00105 <a class="code" href="classLoadingSavingWidget.html#aa6a8f529ead735c50373592343d5b552">mainGrid</a>->addWidget( <a class="code" href="classLoadingSavingWidget.html#ae45293f632464af1b85848e03dd36bd0">defaultToThisThemeFrame</a>, 2, 0 ); <a name="l00106"></a>00106 <a class="code" href="classLoadingSavingWidget.html#aa6a8f529ead735c50373592343d5b552">mainGrid</a>->addWidget( <a class="code" href="classLoadingSavingWidget.html#a18e09dbe205eb4900e152922e3357c22" title="Temporary Image directory.">tempImageDirectoryFrame</a>, 3, 0 ); <a name="l00107"></a>00107 <a class="code" href="classLoadingSavingWidget.html#aa6a8f529ead735c50373592343d5b552">mainGrid</a>->addWidget( <a class="code" href="classLoadingSavingWidget.html#a09c1a767b34091ca7a3070aaab9bddce" title="Check for photo modifications on load.">checkPhotoMods</a>, 4, 0 ); <a name="l00108"></a>00108 <a class="code" href="classLoadingSavingWidget.html#aa6a8f529ead735c50373592343d5b552">mainGrid</a>->setRowStretch( 5, 1 ); <a name="l00109"></a>00109 <span class="comment">//----------------</span> <a name="l00110"></a>00110 } <a name="l00111"></a>00111 <span class="comment">//==============================================</span> <a name="l00112"></a><a class="code" href="classLoadingSavingWidget.html#a15ce2d54898cc82ce07deb64e0f2f5cc">00112</a> <span class="keywordtype">void</span> <a class="code" href="classLoadingSavingWidget.html#a15ce2d54898cc82ce07deb64e0f2f5cc">LoadingSavingWidget::browse</a>() <a name="l00113"></a>00113 { <a name="l00114"></a>00114 QString dirName = QFileDialog::getExistingDirectory( <a class="code" href="classLoadingSavingWidget.html#a84f70d9a9741fd9aaf480cfeafd20476">tempImageDirectoryVal</a>->text(), <a name="l00115"></a>00115 <span class="keyword">this</span>, NULL, <span class="stringliteral">"Temporary Image Directory"</span>); <a name="l00116"></a>00116 <span class="keywordflow">if</span>(!dirName.isNull()) <a name="l00117"></a>00117 <a class="code" href="classLoadingSavingWidget.html#a84f70d9a9741fd9aaf480cfeafd20476">tempImageDirectoryVal</a>->setText( dirName ); <a name="l00118"></a>00118 } <a name="l00119"></a>00119 <span class="comment">//==============================================</span> <a name="l00120"></a><a class="code" href="classLoadingSavingWidget.html#ae20b24bc2f6f042012e2e9616c6032f3">00120</a> <span class="keywordtype">void</span> <a class="code" href="classLoadingSavingWidget.html#ae20b24bc2f6f042012e2e9616c6032f3">LoadingSavingWidget::setDefaults</a>(<a class="code" href="classConfiguration.html" title="Configuration object manages all user-specific application settings.">Configuration</a>* config) <a name="l00121"></a>00121 { <a name="l00122"></a>00122 config-><a class="code" href="classConfiguration.html#a9dd8bba47dda7f0964567656f9514852" title="Set bool setting.">setBool</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"disableCheckPhotoMods"</span>, <span class="keyword">true</span> ); <a name="l00123"></a>00123 config-><a class="code" href="classConfiguration.html#acc6935858bf26f6d44c78401fc93d975" title="Sets a setting value, if group does not exist it is created, if setting does not...">setString</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"defaultTheme"</span>, <span class="stringliteral">"Last Used"</span> ); <a name="l00124"></a>00124 config-><a class="code" href="classConfiguration.html#acc6935858bf26f6d44c78401fc93d975" title="Sets a setting value, if group does not exist it is created, if setting does not...">setString</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"lastUsedTheme"</span>, <span class="stringliteral">"Slick"</span> ); <a name="l00125"></a>00125 <span class="comment">//-------</span> <a name="l00126"></a>00126 <span class="comment">//set default loading/saving albums, add photo, and temp image directories</span> <a name="l00127"></a>00127 config-><a class="code" href="classConfiguration.html#acc6935858bf26f6d44c78401fc93d975" title="Sets a setting value, if group does not exist it is created, if setting does not...">setString</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"tempImageDirectory"</span>, <a class="code" href="config_8cpp.html#a8e603096352908a187b5364096a8d581">TEMP_DIR</a> ); <a name="l00128"></a>00128 <a name="l00129"></a>00129 <span class="comment">//PLATFORM_SPECIFIC_CODE</span> <a name="l00130"></a>00130 <a name="l00131"></a>00131 <span class="comment">//Mac OS X</span> <a name="l00132"></a>00132 <span class="preprocessor"> #if defined(Q_OS_MACX)</span> <a name="l00133"></a>00133 <span class="preprocessor"></span> config-><a class="code" href="classConfiguration.html#acc6935858bf26f6d44c78401fc93d975" title="Sets a setting value, if group does not exist it is created, if setting does not...">setString</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"loadSaveDir"</span>, QDir::homeDirPath() + QString(<span class="stringliteral">"/Pictures"</span>) ); <a name="l00134"></a>00134 <a name="l00135"></a>00135 <span class="comment">//Windows</span> <a name="l00136"></a>00136 <span class="preprocessor"> #elif defined(Q_OS_WIN)</span> <a name="l00137"></a>00137 <span class="preprocessor"></span> config-><a class="code" href="classConfiguration.html#acc6935858bf26f6d44c78401fc93d975" title="Sets a setting value, if group does not exist it is created, if setting does not...">setString</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"loadSaveDir"</span>, <a name="l00138"></a>00138 QDir::convertSeparators( getenv(<span class="stringliteral">"USERPROFILE"</span>) + <a name="l00139"></a>00139 QString(<span class="stringliteral">"/My Documents/My Pictures"</span>) )); <a name="l00140"></a>00140 <a name="l00141"></a>00141 <span class="comment">//Unix/Linux/BSD</span> <a name="l00142"></a>00142 <span class="preprocessor"> #else</span> <a name="l00143"></a>00143 <span class="preprocessor"></span> config-><a class="code" href="classConfiguration.html#acc6935858bf26f6d44c78401fc93d975" title="Sets a setting value, if group does not exist it is created, if setting does not...">setString</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"loadSaveDir"</span>, QDir::homeDirPath() ); <a name="l00144"></a>00144 <span class="preprocessor"> #endif</span> <a name="l00145"></a>00145 <span class="preprocessor"></span> <a name="l00146"></a>00146 config-><a class="code" href="classConfiguration.html#acc6935858bf26f6d44c78401fc93d975" title="Sets a setting value, if group does not exist it is created, if setting does not...">setString</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"addPhotoDir"</span>, config-><a class="code" href="classConfiguration.html#af39a96d2cd773570ef1aecf502a3cc90" title="Fetch string setting.">getString</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"loadSaveDir"</span>) ); <a name="l00147"></a>00147 <span class="comment">//-------</span> <a name="l00148"></a>00148 config-><a class="code" href="classConfiguration.html#a9dd8bba47dda7f0964567656f9514852" title="Set bool setting.">setBool</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"useDefaultImageSizes"</span>, <span class="keyword">true</span> ); <a name="l00149"></a>00149 config-><a class="code" href="classConfiguration.html#a735d3e91a3a767567371e8ccd940b6e3" title="Set int setting.">setInt</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"thumbWidth"</span>, 200 ); <a name="l00150"></a>00150 config-><a class="code" href="classConfiguration.html#a735d3e91a3a767567371e8ccd940b6e3" title="Set int setting.">setInt</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"thumbHeight"</span>, 150 ); <a name="l00151"></a>00151 config-><a class="code" href="classConfiguration.html#a735d3e91a3a767567371e8ccd940b6e3" title="Set int setting.">setInt</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"slideshowWidth"</span>, 600 ); <a name="l00152"></a>00152 config-><a class="code" href="classConfiguration.html#a735d3e91a3a767567371e8ccd940b6e3" title="Set int setting.">setInt</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"slideshowHeight"</span>, 400 ); <a name="l00153"></a>00153 config-><a class="code" href="classConfiguration.html#a735d3e91a3a767567371e8ccd940b6e3" title="Set int setting.">setInt</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"albumWidth"</span>, 500 ); <a name="l00154"></a>00154 config-><a class="code" href="classConfiguration.html#a735d3e91a3a767567371e8ccd940b6e3" title="Set int setting.">setInt</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"albumHeight"</span>, 320 ); <a name="l00155"></a>00155 config-><a class="code" href="classConfiguration.html#a735d3e91a3a767567371e8ccd940b6e3" title="Set int setting.">setInt</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"subalbumWidth"</span>, 200 ); <a name="l00156"></a>00156 config-><a class="code" href="classConfiguration.html#a735d3e91a3a767567371e8ccd940b6e3" title="Set int setting.">setInt</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"subalbumHeight"</span>, 150 ); <a name="l00157"></a>00157 } <a name="l00158"></a>00158 <span class="comment">//==============================================</span> <a name="l00159"></a><a class="code" href="classLoadingSavingWidget.html#a13c734fed532ec6291c2b6efab8f27bd">00159</a> <span class="keywordtype">void</span> <a class="code" href="classLoadingSavingWidget.html#a13c734fed532ec6291c2b6efab8f27bd">LoadingSavingWidget::loadSettings</a>() <a name="l00160"></a>00160 { <a name="l00161"></a>00161 <a class="code" href="classLoadingSavingWidget.html#a09c1a767b34091ca7a3070aaab9bddce" title="Check for photo modifications on load.">checkPhotoMods</a>->setChecked( ! <a class="code" href="classLoadingSavingWidget.html#af3b9b2c80c6cf89d48f85fe109fa65d2" title="Backend config object pointer.">config</a>-><a class="code" href="classConfiguration.html#a0d92de22ace3b90de4d73b6b32468a42" title="Fetch bool setting.">getBool</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"disableCheckPhotoMods"</span> )); <a name="l00162"></a>00162 <a class="code" href="classLoadingSavingWidget.html#a84f70d9a9741fd9aaf480cfeafd20476">tempImageDirectoryVal</a>->setText( <a class="code" href="classLoadingSavingWidget.html#af3b9b2c80c6cf89d48f85fe109fa65d2" title="Backend config object pointer.">config</a>-><a class="code" href="classConfiguration.html#af39a96d2cd773570ef1aecf502a3cc90" title="Fetch string setting.">getString</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"tempImageDirectory"</span> ) ); <a name="l00163"></a>00163 <a class="code" href="classLoadingSavingWidget.html#a84f70d9a9741fd9aaf480cfeafd20476">tempImageDirectoryVal</a>->setCursorPosition(0); <a name="l00164"></a>00164 <a name="l00165"></a>00165 <span class="keywordtype">int</span> i; <a name="l00166"></a>00166 <span class="keywordtype">bool</span> defaultTFound = <span class="keyword">false</span>; <a name="l00167"></a>00167 QString defaultT = <a class="code" href="classLoadingSavingWidget.html#af3b9b2c80c6cf89d48f85fe109fa65d2" title="Backend config object pointer.">config</a>-><a class="code" href="classConfiguration.html#af39a96d2cd773570ef1aecf502a3cc90" title="Fetch string setting.">getString</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"defaultTheme"</span> ); <a name="l00168"></a>00168 <span class="keywordflow">for</span>(i=1; i<<a class="code" href="classLoadingSavingWidget.html#a28b8ccc19c91bb37fbca63c201c77243">defaultToThisTheme</a>->count(); i++) <a name="l00169"></a>00169 { <a name="l00170"></a>00170 <a class="code" href="classLoadingSavingWidget.html#a28b8ccc19c91bb37fbca63c201c77243">defaultToThisTheme</a>->setCurrentItem(i); <a name="l00171"></a>00171 <span class="keywordflow">if</span>(<a class="code" href="classLoadingSavingWidget.html#a28b8ccc19c91bb37fbca63c201c77243">defaultToThisTheme</a>->currentText().compare( defaultT ) == 0) <a name="l00172"></a>00172 { <a name="l00173"></a>00173 defaultTFound = <span class="keyword">true</span>; <a name="l00174"></a>00174 <span class="keywordflow">break</span>; <a name="l00175"></a>00175 } <a name="l00176"></a>00176 } <a name="l00177"></a>00177 <a name="l00178"></a>00178 <span class="keywordflow">if</span>(!defaultTFound) <a name="l00179"></a>00179 <a class="code" href="classLoadingSavingWidget.html#a28b8ccc19c91bb37fbca63c201c77243">defaultToThisTheme</a>->setCurrentItem(0); <a name="l00180"></a>00180 } <a name="l00181"></a>00181 <span class="comment">//==============================================</span> <a name="l00182"></a><a class="code" href="classLoadingSavingWidget.html#a9b4ecf1e74d294798ca8b5ddbbff4b6a">00182</a> <span class="keywordtype">void</span> <a class="code" href="classLoadingSavingWidget.html#a9b4ecf1e74d294798ca8b5ddbbff4b6a">LoadingSavingWidget::saveSettings</a>() <a name="l00183"></a>00183 { <a name="l00184"></a>00184 <a class="code" href="classLoadingSavingWidget.html#af3b9b2c80c6cf89d48f85fe109fa65d2" title="Backend config object pointer.">config</a>-><a class="code" href="classConfiguration.html#a9dd8bba47dda7f0964567656f9514852" title="Set bool setting.">setBool</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"disableCheckPhotoMods"</span>, !<a class="code" href="classLoadingSavingWidget.html#a09c1a767b34091ca7a3070aaab9bddce" title="Check for photo modifications on load.">checkPhotoMods</a>->isChecked() ); <a name="l00185"></a>00185 <a class="code" href="classLoadingSavingWidget.html#af3b9b2c80c6cf89d48f85fe109fa65d2" title="Backend config object pointer.">config</a>-><a class="code" href="classConfiguration.html#acc6935858bf26f6d44c78401fc93d975" title="Sets a setting value, if group does not exist it is created, if setting does not...">setString</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"tempImageDirectory"</span>, <a name="l00186"></a>00186 QDir::convertSeparators( QDir::cleanDirPath( <a class="code" href="classLoadingSavingWidget.html#a84f70d9a9741fd9aaf480cfeafd20476">tempImageDirectoryVal</a>->text() ) ) ); <a name="l00187"></a>00187 <a class="code" href="classLoadingSavingWidget.html#af3b9b2c80c6cf89d48f85fe109fa65d2" title="Backend config object pointer.">config</a>-><a class="code" href="classConfiguration.html#acc6935858bf26f6d44c78401fc93d975" title="Sets a setting value, if group does not exist it is created, if setting does not...">setString</a>( <span class="stringliteral">"loadSave"</span>, <span class="stringliteral">"defaultTheme"</span>, <a class="code" href="classLoadingSavingWidget.html#a28b8ccc19c91bb37fbca63c201c77243">defaultToThisTheme</a>->currentText() ); <a name="l00188"></a>00188 } <a name="l00189"></a>00189 <span class="comment">//==============================================</span> </pre></div></div> <hr size="1"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> </body> </html>