<!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: layoutWidget.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>layoutWidget.cpp</h1><a href="layoutWidget_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 <qlabel.h></span> <a name="l00015"></a>00015 <span class="preprocessor">#include <qiconview.h></span> <a name="l00016"></a>00016 <span class="preprocessor">#include <qtabwidget.h></span> <a name="l00017"></a>00017 <a name="l00018"></a>00018 <span class="comment">//Projectwide includes</span> <a name="l00019"></a>00019 <span class="preprocessor">#include "<a class="code" href="layoutWidget_8h.html">layoutWidget.h</a>"</span> <a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="titleWidget_8h.html">titleWidget.h</a>"</span> <a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="window_8h.html">window.h</a>"</span> <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="subalbumsWidget_8h.html">subalbumsWidget.h</a>"</span> <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="subalbumWidget_8h.html">subalbumWidget.h</a>"</span> <a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="editingInterface_8h.html">editing/editingInterface.h</a>"</span> <a name="l00025"></a>00025 <span class="preprocessor">#include "../backend/subalbum.h"</span> <a name="l00026"></a>00026 <span class="preprocessor">#include "../backend/photo.h"</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="classLayoutWidget.html#b1b53bc0ad9b07b82e0a8666443069bc">00030</a> <a class="code" href="classLayoutWidget.html#b1b53bc0ad9b07b82e0a8666443069bc" title="Creates empty layout.">LayoutWidget::LayoutWidget</a>(<a class="code" href="classQWidget.html">QWidget</a> *parent, <span class="keyword">const</span> <span class="keywordtype">char</span>* name ) : <a class="code" href="classQWidget.html">QWidget</a>(parent,name) <a name="l00031"></a>00031 { <a name="l00032"></a>00032 <a class="code" href="classLayoutWidget.html#a743a6e95be2ccdcbe01a4a54cf7c786" title="Window pointer.">window</a> = (<a class="code" href="classWindow.html" title="Top level widget, encapsulates the title widget, the layout widget, and the toolbar...">Window</a>*)parent; <a name="l00033"></a>00033 <a class="code" href="classLayoutWidget.html#4781bcbe27f1323a93b675ef33b1de12" title="List of subalbums.">subalbums</a> = <span class="keyword">new</span> <a class="code" href="classSubalbumsWidget.html" title="Columnview of all subalbums in album.">SubalbumsWidget</a>( <span class="keyword">this</span>, <span class="stringliteral">"subalbums"</span> ); <a name="l00034"></a>00034 connect( <a class="code" href="classLayoutWidget.html#4781bcbe27f1323a93b675ef33b1de12" title="List of subalbums.">subalbums</a>, SIGNAL( <a class="code" href="classLayoutWidget.html#5b23593fe0fc0adac3ade2d3c40ff9c6">collectionSelected</a>(<a class="code" href="classSubalbum.html" title="A subalbum contains photos.">Subalbum</a>*)), <a name="l00035"></a>00035 <span class="keyword">this</span>, SLOT( <a class="code" href="classLayoutWidget.html#8f120e8eda82a5bd77f19ad15d42462a">showCollection</a>( <a class="code" href="classSubalbum.html" title="A subalbum contains photos.">Subalbum</a>* )) ); <a name="l00036"></a>00036 <a name="l00037"></a>00037 <a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a> = <span class="keyword">new</span> <a class="code" href="classSubalbumWidget.html" title="Displays subalbum layout.">SubalbumWidget</a>( NULL, <span class="keyword">this</span>, <span class="stringliteral">"subalbum"</span> ); <a name="l00038"></a>00038 <a class="code" href="classLayoutWidget.html#880e0576ad0aab401183130141e9c87b" title="Editing interface.">editingInterface</a> = <span class="keyword">new</span> <a class="code" href="classEditingInterface.html" title="Interface for editing photo.">EditingInterface</a>( <span class="keyword">this</span>, <span class="stringliteral">"editingInterface"</span> ); <a name="l00039"></a>00039 <a name="l00040"></a>00040 <a class="code" href="classLayoutWidget.html#ed706c6cc72ade4c3c5d3f615df297ba" title="Tab widget containing organize and edit widgets.">tabbedArea</a> = <span class="keyword">new</span> QTabWidget( <span class="keyword">this</span>, <span class="stringliteral">"tabbedArea"</span> ); <a name="l00041"></a>00041 <a class="code" href="classLayoutWidget.html#ed706c6cc72ade4c3c5d3f615df297ba" title="Tab widget containing organize and edit widgets.">tabbedArea</a>->addTab(<a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a>, tr(<span class="stringliteral">"Organize"</span>) ); <a name="l00042"></a>00042 <a class="code" href="classLayoutWidget.html#ed706c6cc72ade4c3c5d3f615df297ba" title="Tab widget containing organize and edit widgets.">tabbedArea</a>->addTab(<a class="code" href="classLayoutWidget.html#880e0576ad0aab401183130141e9c87b" title="Editing interface.">editingInterface</a>, tr(<span class="stringliteral">"Edit"</span>) ); <a name="l00043"></a>00043 <a name="l00044"></a>00044 <span class="comment">//by default no photo has been edited</span> <a name="l00045"></a>00045 <a class="code" href="classLayoutWidget.html#ed706c6cc72ade4c3c5d3f615df297ba" title="Tab widget containing organize and edit widgets.">tabbedArea</a>->setTabEnabled(<a class="code" href="classLayoutWidget.html#880e0576ad0aab401183130141e9c87b" title="Editing interface.">editingInterface</a>, <span class="keyword">false</span>); <a name="l00046"></a>00046 <a name="l00047"></a>00047 <span class="comment">//catch changing tab selection in order to</span> <a name="l00048"></a>00048 <span class="comment">//initialize editing interface if it was selected</span> <a name="l00049"></a>00049 connect( <a class="code" href="classLayoutWidget.html#ed706c6cc72ade4c3c5d3f615df297ba" title="Tab widget containing organize and edit widgets.">tabbedArea</a>, SIGNAL( currentChanged(<a class="code" href="classQWidget.html">QWidget</a>*) ), <a name="l00050"></a>00050 <span class="keyword">this</span>, SLOT( <a class="code" href="classLayoutWidget.html#ce924be1bc2d68e7b1780f9913bb651f" title="handle tab shown changed signal">tabChanged</a>(<a class="code" href="classQWidget.html">QWidget</a>*) ) ); <a name="l00051"></a>00051 <a name="l00052"></a>00052 <span class="comment">//catch selectedPhotoStateChanged signal in order to</span> <a name="l00053"></a>00053 <span class="comment">//enable/disable Photos and Tools menu items</span> <a name="l00054"></a>00054 connect( <a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a>, SIGNAL( selectedPhotoStateChanged() ), <a name="l00055"></a>00055 <span class="keyword">this</span>, SLOT( <a class="code" href="classLayoutWidget.html#5036fe09341a10d2eeac514f888dcb3d" title="handle the changing state of selected/shown photos">photoStateChangedEvent</a>() ) ); <a name="l00056"></a>00056 <a name="l00057"></a>00057 <span class="comment">//catch photo modified signal in order to </span> <a name="l00058"></a>00058 <span class="comment">//enable/disable Photos and Tools menu items</span> <a name="l00059"></a>00059 connect( <a class="code" href="classLayoutWidget.html#880e0576ad0aab401183130141e9c87b" title="Editing interface.">editingInterface</a>, SIGNAL( photoModified() ), <a name="l00060"></a>00060 <span class="keyword">this</span>, SLOT( <a class="code" href="classLayoutWidget.html#5036fe09341a10d2eeac514f888dcb3d" title="handle the changing state of selected/shown photos">photoStateChangedEvent</a>() ) ); <a name="l00061"></a>00061 <a name="l00062"></a>00062 <span class="comment">//place the subalbums list and tabbed area in grid</span> <a name="l00063"></a>00063 <a class="code" href="classLayoutWidget.html#29642b0ea418acfc65d19c40d29adf5c" title="Grid items placed in.">grid</a> = <span class="keyword">new</span> QGridLayout( <span class="keyword">this</span>, 1, 2, 0 ); <a name="l00064"></a>00064 <a name="l00065"></a>00065 <a class="code" href="classLayoutWidget.html#29642b0ea418acfc65d19c40d29adf5c" title="Grid items placed in.">grid</a>->addWidget( <a class="code" href="classLayoutWidget.html#4781bcbe27f1323a93b675ef33b1de12" title="List of subalbums.">subalbums</a>, 0, 0 ); <a name="l00066"></a>00066 <a class="code" href="classLayoutWidget.html#29642b0ea418acfc65d19c40d29adf5c" title="Grid items placed in.">grid</a>->setColSpacing( 0, <a class="code" href="classLayoutWidget.html#4781bcbe27f1323a93b675ef33b1de12" title="List of subalbums.">subalbums</a>->sizeHint().width() ); <a name="l00067"></a>00067 <a name="l00068"></a>00068 <a class="code" href="classLayoutWidget.html#29642b0ea418acfc65d19c40d29adf5c" title="Grid items placed in.">grid</a>->addWidget( <a class="code" href="classLayoutWidget.html#ed706c6cc72ade4c3c5d3f615df297ba" title="Tab widget containing organize and edit widgets.">tabbedArea</a>, 0, 1 ); <a name="l00069"></a>00069 <a class="code" href="classLayoutWidget.html#29642b0ea418acfc65d19c40d29adf5c" title="Grid items placed in.">grid</a>->setColStretch( 1, 1 ); <a name="l00070"></a>00070 } <a name="l00071"></a>00071 <span class="comment">//==============================================</span> <a name="l00072"></a><a class="code" href="classLayoutWidget.html#8f120e8eda82a5bd77f19ad15d42462a">00072</a> <span class="keywordtype">void</span> <a class="code" href="classLayoutWidget.html#8f120e8eda82a5bd77f19ad15d42462a">LayoutWidget::showCollection</a>(<a class="code" href="classSubalbum.html" title="A subalbum contains photos.">Subalbum</a>* collection) <a name="l00073"></a>00073 { <a name="l00074"></a>00074 <span class="comment">//ensure currently in organize mode</span> <a name="l00075"></a>00075 <a class="code" href="classLayoutWidget.html#d31964351b72e66e6a576a0be929a937" title="Select organize tab.">organize</a>(); <a name="l00076"></a>00076 <a name="l00077"></a>00077 <span class="comment">//load collection</span> <a name="l00078"></a>00078 <a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a>-><a class="code" href="classSubalbumWidget.html#1ab4edd806312f51d5fc421ca2f69770" title="Resets the subalbum this subalbum widget is displaying.">setSubalbum</a>(collection); <a name="l00079"></a>00079 <a name="l00080"></a>00080 <span class="comment">//pass signal on so title area can update as well</span> <a name="l00081"></a>00081 emit <a class="code" href="classLayoutWidget.html#5b23593fe0fc0adac3ade2d3c40ff9c6">collectionSelected</a>( collection ); <a name="l00082"></a>00082 } <a name="l00083"></a>00083 <span class="comment">//==============================================</span> <a name="l00084"></a><a class="code" href="classLayoutWidget.html#aa7572255c02082d5e6eaf7ad87ec3b3">00084</a> <span class="keywordtype">void</span> <a class="code" href="classLayoutWidget.html#aa7572255c02082d5e6eaf7ad87ec3b3" title="updates the selected collection icon name">LayoutWidget::refreshSelectedCollectionIconName</a>() <a name="l00085"></a>00085 { <a name="l00086"></a>00086 <a class="code" href="classLayoutWidget.html#4781bcbe27f1323a93b675ef33b1de12" title="List of subalbums.">subalbums</a>-><a class="code" href="classSubalbumsWidget.html#d903413dbf56a0bc4c40bc0110be934e">refreshSelectedCollectionName</a>(); <a name="l00087"></a>00087 } <a name="l00088"></a>00088 <span class="comment">//==============================================</span> <a name="l00089"></a><a class="code" href="classLayoutWidget.html#61624e646e544e746c6a14d2e8db833d">00089</a> <span class="keywordtype">void</span> <a class="code" href="classLayoutWidget.html#61624e646e544e746c6a14d2e8db833d" title="Updates the current subalbums image.">LayoutWidget::updateSubalbumImage</a>( QPixmap* val) <a name="l00090"></a>00090 { <a name="l00091"></a>00091 <a class="code" href="classLayoutWidget.html#4781bcbe27f1323a93b675ef33b1de12" title="List of subalbums.">subalbums</a>-><a class="code" href="classSubalbumsWidget.html#12febd6c41636d26a80b7b6fdea4d081">updatedSelectedCollectionImage</a>(val); <a name="l00092"></a>00092 } <a name="l00093"></a>00093 <span class="comment">//==============================================</span> <a name="l00094"></a><a class="code" href="classLayoutWidget.html#5255327976cceb4c6150936683c08714">00094</a> <a class="code" href="classSubalbumWidget.html" title="Displays subalbum layout.">SubalbumWidget</a>* <a class="code" href="classLayoutWidget.html#5255327976cceb4c6150936683c08714" title="Returns a pointer to the subalbum.">LayoutWidget::getSubalbum</a>() <a name="l00095"></a>00095 { <a name="l00096"></a>00096 <span class="keywordflow">return</span> <a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a>; <a name="l00097"></a>00097 } <a name="l00098"></a>00098 <span class="comment">//==============================================</span> <a name="l00099"></a><a class="code" href="classLayoutWidget.html#e8f37ccb7560209b1dba692aebad6648">00099</a> <a class="code" href="classSubalbumsWidget.html" title="Columnview of all subalbums in album.">SubalbumsWidget</a>* <a class="code" href="classLayoutWidget.html#e8f37ccb7560209b1dba692aebad6648" title="Returns a pointer to the subalbums.">LayoutWidget::getSubalbums</a>() <a name="l00100"></a>00100 { <a name="l00101"></a>00101 <span class="keywordflow">return</span> <a class="code" href="classLayoutWidget.html#4781bcbe27f1323a93b675ef33b1de12" title="List of subalbums.">subalbums</a>; <a name="l00102"></a>00102 } <a name="l00103"></a>00103 <span class="comment">//==============================================</span> <a name="l00104"></a><a class="code" href="classLayoutWidget.html#def61c20f8268bc631dab83afc252be2">00104</a> <a class="code" href="classWindow.html" title="Top level widget, encapsulates the title widget, the layout widget, and the toolbar...">Window</a>* <a class="code" href="classLayoutWidget.html#def61c20f8268bc631dab83afc252be2" title="Returns a pointer to the window.">LayoutWidget::getWindow</a>() <a name="l00105"></a>00105 { <a name="l00106"></a>00106 <span class="keywordflow">return</span> <a class="code" href="classLayoutWidget.html#a743a6e95be2ccdcbe01a4a54cf7c786" title="Window pointer.">window</a>; <a name="l00107"></a>00107 } <a name="l00108"></a>00108 <span class="comment">//==============================================</span> <a name="l00109"></a><a class="code" href="classLayoutWidget.html#675b2bae5415c2ca668edb460d9f908e">00109</a> <span class="keywordtype">void</span> <a class="code" href="classLayoutWidget.html#675b2bae5415c2ca668edb460d9f908e" title="Refreshes layout.">LayoutWidget::refresh</a>() <a name="l00110"></a>00110 { <a name="l00111"></a>00111 <a class="code" href="classLayoutWidget.html#4781bcbe27f1323a93b675ef33b1de12" title="List of subalbums.">subalbums</a>-><a class="code" href="classSubalbumsWidget.html#f70e74f80dbeb87dc7df7c838e1a702e" title="Refreshes list of collections, selecting first by default.">refreshCollectionsList</a>(); <a name="l00112"></a>00112 } <a name="l00113"></a>00113 <span class="comment">//==============================================</span> <a name="l00114"></a><a class="code" href="classLayoutWidget.html#ce924be1bc2d68e7b1780f9913bb651f">00114</a> <span class="keywordtype">void</span> <a class="code" href="classLayoutWidget.html#ce924be1bc2d68e7b1780f9913bb651f" title="handle tab shown changed signal">LayoutWidget::tabChanged</a>( <a class="code" href="classQWidget.html">QWidget</a>* widget) <a name="l00115"></a>00115 { <a name="l00116"></a>00116 <span class="comment">//orignize tab seleced</span> <a name="l00117"></a>00117 <span class="keywordflow">if</span>(widget != <a class="code" href="classLayoutWidget.html#880e0576ad0aab401183130141e9c87b" title="Editing interface.">editingInterface</a>) <a name="l00118"></a>00118 { <a name="l00119"></a>00119 <span class="comment">//refresh all thumbnails since any could have changed</span> <a name="l00120"></a>00120 <a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a>-><a class="code" href="classSubalbumWidget.html#4adf83eb17583a370a196f17ae4a1183" title="refreshes all photos, selections are preserved">refreshAllPhotos</a>(); <a name="l00121"></a>00121 <a name="l00122"></a>00122 <span class="comment">//handle the selected/shown photo state having been changed</span> <a name="l00123"></a>00123 <a class="code" href="classLayoutWidget.html#5036fe09341a10d2eeac514f888dcb3d" title="handle the changing state of selected/shown photos">photoStateChangedEvent</a>(); <a name="l00124"></a>00124 <a name="l00125"></a>00125 <span class="comment">//find and select the last shown photo in the</span> <a name="l00126"></a>00126 <span class="comment">//editing interface, unselect all other items</span> <a name="l00127"></a>00127 <a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a>-><a class="code" href="classSubalbumWidget.html#5f140f7534fcefa7311b60b1ab1b7d58" title="Sets the selected photo to selection and ensures it is visible.">setSelectedPhoto</a>( <a class="code" href="classLayoutWidget.html#880e0576ad0aab401183130141e9c87b" title="Editing interface.">editingInterface</a>-><a class="code" href="classEditingInterface.html#dda3154b044e4613351592dc9d2e2645" title="Returns a pointer to the currently selected photo.">getPhoto</a>() ); <a name="l00128"></a>00128 <a name="l00129"></a>00129 <span class="keywordflow">return</span>; <a name="l00130"></a>00130 } <a name="l00131"></a>00131 <span class="comment">//edit tab selected - init editor</span> <a name="l00132"></a>00132 <span class="keywordflow">else</span> <a name="l00133"></a>00133 { <a name="l00135"></a>00135 <a class="code" href="classSubalbum.html" title="A subalbum contains photos.">Subalbum</a>* collection = <a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a>-><a class="code" href="classSubalbumWidget.html#c02ec35e2bcb4e2e76b545e316bb9333" title="returns a pointer to the backend subalbum">getSubalbum</a>(); <a name="l00136"></a>00136 <a class="code" href="classPhoto.html" title="A photo consists of a full size image, a smaller slide show image, a very small thumbnail...">Photo</a>* photo = <a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a>-><a class="code" href="classSubalbumWidget.html#c610ac88f0b949748c30028e9cdd4635" title="Returns first selected photo.">getFirstSelectedPhoto</a>(); <a name="l00137"></a>00137 <a name="l00138"></a>00138 <span class="comment">//bail if either pointer is null (sanity check)</span> <a name="l00139"></a>00139 <span class="keywordflow">if</span>(collection == NULL || photo == NULL) <a name="l00140"></a>00140 <span class="keywordflow">return</span>; <a name="l00141"></a>00141 <a name="l00142"></a>00142 <span class="comment">//init editing interface for current collection:photo</span> <a name="l00143"></a>00143 <a class="code" href="classLayoutWidget.html#880e0576ad0aab401183130141e9c87b" title="Editing interface.">editingInterface</a>-><a class="code" href="classEditingInterface.html#65a44f99011c590cc41406fc7f09c983" title="Sets the photo pointer and constructs scaled qimage&#39;s for painting.">setPhoto</a>( collection, photo); <a name="l00144"></a>00144 <a class="code" href="classLayoutWidget.html#880e0576ad0aab401183130141e9c87b" title="Editing interface.">editingInterface</a>-><a class="code" href="classEditingInterface.html#602c05c7f27c9074fa580f927dcdc24c">setFocus</a>(); <a name="l00145"></a>00145 <a name="l00146"></a>00146 <span class="comment">//handle the selected/shown photo state having been changed</span> <a name="l00147"></a>00147 <a class="code" href="classLayoutWidget.html#5036fe09341a10d2eeac514f888dcb3d" title="handle the changing state of selected/shown photos">photoStateChangedEvent</a>(); <a name="l00148"></a>00148 } <a name="l00149"></a>00149 } <a name="l00150"></a>00150 <span class="comment">//==============================================</span> <a name="l00151"></a><a class="code" href="classLayoutWidget.html#c00f5ce55a249168160ce9f8992a17b3">00151</a> <span class="keywordtype">void</span> <a class="code" href="classLayoutWidget.html#c00f5ce55a249168160ce9f8992a17b3" title="Edits first select photo.">LayoutWidget::editSelectedPhoto</a>() <a name="l00152"></a>00152 { <a name="l00153"></a>00153 <a class="code" href="classLayoutWidget.html#ed706c6cc72ade4c3c5d3f615df297ba" title="Tab widget containing organize and edit widgets.">tabbedArea</a>->showPage( <a class="code" href="classLayoutWidget.html#880e0576ad0aab401183130141e9c87b" title="Editing interface.">editingInterface</a> ); <a name="l00154"></a>00154 } <a name="l00155"></a>00155 <span class="comment">//==============================================</span> <a name="l00156"></a><a class="code" href="classLayoutWidget.html#d31964351b72e66e6a576a0be929a937">00156</a> <span class="keywordtype">void</span> <a class="code" href="classLayoutWidget.html#d31964351b72e66e6a576a0be929a937" title="Select organize tab.">LayoutWidget::organize</a>() <a name="l00157"></a>00157 { <a name="l00158"></a>00158 <a class="code" href="classLayoutWidget.html#ed706c6cc72ade4c3c5d3f615df297ba" title="Tab widget containing organize and edit widgets.">tabbedArea</a>->setCurrentPage( 0 ); <a name="l00159"></a>00159 } <a name="l00160"></a>00160 <span class="comment">//==============================================</span> <a name="l00161"></a><a class="code" href="classLayoutWidget.html#a85d8b2eabe91ae161a823e8065a41a3">00161</a> <span class="keywordtype">void</span> <a class="code" href="classLayoutWidget.html#a85d8b2eabe91ae161a823e8065a41a3">LayoutWidget::setEditTabEnabled</a>(<span class="keywordtype">bool</span> val) <a name="l00162"></a>00162 { <a name="l00163"></a>00163 <a class="code" href="classLayoutWidget.html#ed706c6cc72ade4c3c5d3f615df297ba" title="Tab widget containing organize and edit widgets.">tabbedArea</a>->setTabEnabled(<a class="code" href="classLayoutWidget.html#880e0576ad0aab401183130141e9c87b" title="Editing interface.">editingInterface</a>, val); <a name="l00164"></a>00164 } <a name="l00165"></a>00165 <span class="comment">//==============================================</span> <a name="l00166"></a><a class="code" href="classLayoutWidget.html#354b0dfb17383495dbb952f9f7eabeea">00166</a> <span class="keywordtype">void</span> <a class="code" href="classLayoutWidget.html#354b0dfb17383495dbb952f9f7eabeea" title="Reverts all selected photos in organize mode, or currently shown photo if in editing...">LayoutWidget::revertPhotos</a>() <a name="l00167"></a>00167 { <a name="l00168"></a>00168 <span class="keywordflow">if</span>( <a class="code" href="classLayoutWidget.html#ed706c6cc72ade4c3c5d3f615df297ba" title="Tab widget containing organize and edit widgets.">tabbedArea</a>->currentPage() == <a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a> ) <a name="l00169"></a>00169 <a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a>-><a class="code" href="classSubalbumWidget.html#d8593d9016ed6b8639f51d751620e0e1" title="Revert selected photos to their original form.">revertSelectedPhotos</a>(); <a name="l00170"></a>00170 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( <a class="code" href="classLayoutWidget.html#ed706c6cc72ade4c3c5d3f615df297ba" title="Tab widget containing organize and edit widgets.">tabbedArea</a>->currentPage() == <a class="code" href="classLayoutWidget.html#880e0576ad0aab401183130141e9c87b" title="Editing interface.">editingInterface</a> ) <a name="l00171"></a>00171 <a class="code" href="classLayoutWidget.html#880e0576ad0aab401183130141e9c87b" title="Editing interface.">editingInterface</a>-><a class="code" href="classEditingInterface.html#e61328cde050bcfde287bdc869cc596b" title="reverts current photo and updates display">revertCurrentPhoto</a>(); <a name="l00172"></a>00172 } <a name="l00173"></a>00173 <span class="comment">//==============================================</span> <a name="l00174"></a><a class="code" href="classLayoutWidget.html#5036fe09341a10d2eeac514f888dcb3d">00174</a> <span class="keywordtype">void</span> <a class="code" href="classLayoutWidget.html#5036fe09341a10d2eeac514f888dcb3d" title="handle the changing state of selected/shown photos">LayoutWidget::photoStateChangedEvent</a>() <a name="l00175"></a>00175 { <a name="l00176"></a>00176 <span class="comment">//determine if:</span> <a name="l00177"></a>00177 <span class="comment">//1.) any photos are selected - false if in editing mode</span> <a name="l00178"></a>00178 <span class="comment">//2.) if any revertable photos are selected/shown</span> <a name="l00179"></a>00179 <span class="keywordtype">bool</span> anySelected = <span class="keyword">false</span>; <a name="l00180"></a>00180 <span class="keywordtype">bool</span> anyRevertable = <span class="keyword">false</span>; <a name="l00181"></a>00181 <a name="l00182"></a>00182 <span class="keywordflow">if</span>( <a class="code" href="classLayoutWidget.html#ed706c6cc72ade4c3c5d3f615df297ba" title="Tab widget containing organize and edit widgets.">tabbedArea</a>->currentPage() == <a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a> ) <a name="l00183"></a>00183 { <a name="l00184"></a>00184 anySelected = <a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a>-><a class="code" href="classSubalbumWidget.html#6838d0b74aadb6cced433b6151d0cf04" title="Returns true if any phtos are selected.">anyPhotosSelected</a>(); <a name="l00185"></a>00185 anyRevertable = anySelected && <a class="code" href="classLayoutWidget.html#af96ebf66a7088fb6f659630ae210eb4" title="Collection organize widget.">subalbum</a>-><a class="code" href="classSubalbumWidget.html#f66535c26047abbe2d2b75d4941617e1" title="Returns true if any selected photos are revertable.">anySelectedPhotosRevertable</a>(); <a name="l00186"></a>00186 } <a name="l00187"></a>00187 <span class="keywordflow">else</span> <a name="l00188"></a>00188 { <a name="l00189"></a>00189 <span class="comment">//none selected in editing mode</span> <a name="l00190"></a>00190 anySelected = <span class="keyword">false</span>; <a name="l00191"></a>00191 anyRevertable = <a class="code" href="classLayoutWidget.html#880e0576ad0aab401183130141e9c87b" title="Editing interface.">editingInterface</a>-><a class="code" href="classEditingInterface.html#454d777dfb81132fca4c3d1147f8f95f">currentPhotoRevertable</a>(); <a name="l00192"></a>00192 } <a name="l00193"></a>00193 <a name="l00194"></a>00194 <span class="comment">//update menus</span> <a name="l00195"></a>00195 <a class="code" href="classLayoutWidget.html#a743a6e95be2ccdcbe01a4a54cf7c786" title="Window pointer.">window</a>-><a class="code" href="classWindow.html#04266b8ffe0013bee23b57701e1e6b61" title="returns a pointer to the title widget">getTitle</a>()-><a class="code" href="classTitleWidget.html#857e73e3c89bcb5091bba375255649a9" title="update begin presentation menu entry - disabled when no photos in album">updateMenus</a>(anySelected, anyRevertable); <a name="l00196"></a>00196 } <a name="l00197"></a>00197 <span class="comment">//==============================================</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 23 02:34:26 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>