#include <layoutWidget.h>
Inheritance diagram for LayoutWidget:
Definition at line 35 of file layoutWidget.h.
Public Slots | |
void | setEditTabEnabled (bool val) |
void | editSelectedPhoto () |
Edits first select photo. | |
void | organize () |
Select organize tab. | |
void | photoStateChangedEvent () |
handle the changing state of selected/shown photos | |
void | refreshSelectedCollectionIconName () |
updates the selected collection icon name | |
void | updateSubalbumImage (QPixmap *val) |
Updates the current subalbums image. | |
Signals | |
void | collectionSelected (Subalbum *) |
Public Member Functions | |
LayoutWidget (QWidget *parent=0, const char *name=0) | |
Creates empty layout. | |
SubalbumWidget * | getSubalbum () |
Returns a pointer to the subalbum. | |
SubalbumsWidget * | getSubalbums () |
Returns a pointer to the subalbums. | |
Window * | getWindow () |
Returns a pointer to the window. | |
void | refresh () |
Refreshes layout. | |
void | revertPhotos () |
Reverts all selected photos in organize mode, or currently shown photo if in editing mode. | |
Private Slots | |
void | tabChanged (QWidget *widget) |
handle tab shown changed signal | |
void | showCollection (Subalbum *collection) |
Private Attributes | |
Window * | window |
Window pointer. | |
QGridLayout * | grid |
Grid items placed in. | |
SubalbumsWidget * | subalbums |
List of subalbums. | |
QTabWidget * | tabbedArea |
Tab widget containing organize and edit widgets. | |
SubalbumWidget * | subalbum |
Collection organize widget. | |
EditingInterface * | editingInterface |
Editing interface. |
|
Creates empty layout.
Definition at line 30 of file layoutWidget.cpp. References collectionSelected(), editingInterface, grid, photoStateChangedEvent(), showCollection(), subalbum, subalbums, tabbedArea, tabChanged(), and window. 00030 : QWidget(parent,name) 00031 { 00032 window = (Window*)parent; 00033 subalbums = new SubalbumsWidget( this, "subalbums" ); 00034 connect( subalbums, SIGNAL( collectionSelected(Subalbum*)), 00035 this, SLOT( showCollection( Subalbum* )) ); 00036 00037 subalbum = new SubalbumWidget( NULL, this, "subalbum" ); 00038 editingInterface = new EditingInterface( this, "editingInterface" ); 00039 00040 tabbedArea = new QTabWidget( this, "tabbedArea" ); 00041 tabbedArea->addTab(subalbum, tr("Organize") ); 00042 tabbedArea->addTab(editingInterface, tr("Edit") ); 00043 00044 //by default no photo has been edited 00045 tabbedArea->setTabEnabled(editingInterface, false); 00046 00047 //catch changing tab selection in order to 00048 //initialize editing interface if it was selected 00049 connect( tabbedArea, SIGNAL( currentChanged(QWidget*) ), 00050 this, SLOT( tabChanged(QWidget*) ) ); 00051 00052 //catch selectedPhotoStateChanged signal in order to 00053 //enable/disable Photos and Tools menu items 00054 connect( subalbum, SIGNAL( selectedPhotoStateChanged() ), 00055 this, SLOT( photoStateChangedEvent() ) ); 00056 00057 //catch photo modified signal in order to 00058 //enable/disable Photos and Tools menu items 00059 connect( editingInterface, SIGNAL( photoModified() ), 00060 this, SLOT( photoStateChangedEvent() ) ); 00061 00062 //place the subalbums list and tabbed area in grid 00063 grid = new QGridLayout( this, 1, 2, 0 ); 00064 00065 grid->addWidget( subalbums, 0, 0 ); 00066 grid->setColSpacing( 0, subalbums->sizeHint().width() ); 00067 00068 grid->addWidget( tabbedArea, 0, 1 ); 00069 grid->setColStretch( 1, 1 ); 00070 }
|
|
Referenced by LayoutWidget(), and showCollection(). |
|
Edits first select photo.
Definition at line 151 of file layoutWidget.cpp. References editingInterface, and tabbedArea. 00152 { 00153 tabbedArea->showPage( editingInterface ); 00154 }
|
|
Returns a pointer to the subalbum.
Definition at line 94 of file layoutWidget.cpp. Referenced by TitleWidget::dropEvent(), TitleWidget::exportLargeImages(), TitleWidget::exportSmallWebGallery(), TitleWidget::loadAlbum(), TitleWidget::newAlbum(), TitleWidget::removeSelectedPhotoDesc(), TitleWidget::saveAlbum(), TitleWidget::saveAsAlbum(), TitleWidget::setAlbumImage(), and TitleWidget::setSubalbumImage(). 00095 {
00096 return subalbum;
00097 }
|
|
Returns a pointer to the subalbums.
Definition at line 99 of file layoutWidget.cpp. Referenced by SubalbumWidget::addImageAction(), TitleWidget::exportLargeImages(), TitleWidget::exportSmallWebGallery(), TitleWidget::loadAlbum(), SubalbumWidget::removeImageAction(), SubalbumWidget::rotate270ImageAction(), SubalbumWidget::rotate90ImageAction(), TitleWidget::saveAlbum(), TitleWidget::saveAsAlbum(), TitleWidget::setSubalbumImage(), TitleWidget::storeAnnotations(), and TitleWidget::unsetSubalbumImage(). 00100 {
00101 return subalbums;
00102 }
|
|
|
Select organize tab.
Definition at line 156 of file layoutWidget.cpp. References tabbedArea. Referenced by EditingInterface::returnAction(), and showCollection(). 00157 { 00158 tabbedArea->setCurrentPage( 0 ); 00159 }
|
|
handle the changing state of selected/shown photos
Definition at line 174 of file layoutWidget.cpp. References SubalbumWidget::anyPhotosSelected(), SubalbumWidget::anySelectedPhotosRevertable(), EditingInterface::currentPhotoRevertable(), editingInterface, Window::getTitle(), subalbum, tabbedArea, TitleWidget::updateMenus(), and window. Referenced by LayoutWidget(), and tabChanged(). 00175 { 00176 //determine if: 00177 //1.) any photos are selected - false if in editing mode 00178 //2.) if any revertable photos are selected/shown 00179 bool anySelected = false; 00180 bool anyRevertable = false; 00181 00182 if( tabbedArea->currentPage() == subalbum ) 00183 { 00184 anySelected = subalbum->anyPhotosSelected(); 00185 anyRevertable = anySelected && subalbum->anySelectedPhotosRevertable(); 00186 } 00187 else 00188 { 00189 //none selected in editing mode 00190 anySelected = false; 00191 anyRevertable = editingInterface->currentPhotoRevertable(); 00192 } 00193 00194 //update menus 00195 window->getTitle()->updateMenus(anySelected, anyRevertable); 00196 }
|
|
Refreshes layout.
Definition at line 109 of file layoutWidget.cpp. References SubalbumsWidget::refreshCollectionsList(), and subalbums. Referenced by Window::refresh(), and Window::Window(). 00110 { 00111 subalbums->refreshCollectionsList(); 00112 }
|
|
updates the selected collection icon name
Definition at line 84 of file layoutWidget.cpp. References SubalbumsWidget::refreshSelectedCollectionName(), and subalbums. 00085 { 00086 subalbums->refreshSelectedCollectionName(); 00087 }
|
|
Reverts all selected photos in organize mode, or currently shown photo if in editing mode.
Definition at line 166 of file layoutWidget.cpp. References editingInterface, EditingInterface::revertCurrentPhoto(), SubalbumWidget::revertSelectedPhotos(), subalbum, and tabbedArea. Referenced by TitleWidget::revertPhotos(). 00167 { 00168 if( tabbedArea->currentPage() == subalbum ) 00169 subalbum->revertSelectedPhotos(); 00170 else if( tabbedArea->currentPage() == editingInterface ) 00171 editingInterface->revertCurrentPhoto(); 00172 }
|
|
Definition at line 161 of file layoutWidget.cpp. References editingInterface, and tabbedArea. Referenced by SubalbumWidget::updateButtons(). 00162 { 00163 tabbedArea->setTabEnabled(editingInterface, val); 00164 }
|
|
Definition at line 72 of file layoutWidget.cpp. References collectionSelected(), organize(), SubalbumWidget::setSubalbum(), and subalbum. Referenced by LayoutWidget(). 00073 { 00074 //ensure currently in organize mode 00075 organize(); 00076 00077 //load collection 00078 subalbum->setSubalbum(collection); 00079 00080 //pass signal on so title area can update as well 00081 emit collectionSelected( collection ); 00082 }
|
|
handle tab shown changed signal get current collection and photo pointers Definition at line 114 of file layoutWidget.cpp. References editingInterface, SubalbumWidget::getFirstSelectedPhoto(), EditingInterface::getPhoto(), SubalbumWidget::getSubalbum(), photoStateChangedEvent(), SubalbumWidget::refreshAllPhotos(), EditingInterface::setFocus(), EditingInterface::setPhoto(), SubalbumWidget::setSelectedPhoto(), and subalbum. Referenced by LayoutWidget(). 00115 { 00116 //orignize tab seleced 00117 if(widget != editingInterface) 00118 { 00119 //refresh all thumbnails since any could have changed 00120 subalbum->refreshAllPhotos(); 00121 00122 //handle the selected/shown photo state having been changed 00123 photoStateChangedEvent(); 00124 00125 //find and select the last shown photo in the 00126 //editing interface, unselect all other items 00127 subalbum->setSelectedPhoto( editingInterface->getPhoto() ); 00128 00129 return; 00130 } 00131 //edit tab selected - init editor 00132 else 00133 { 00135 Subalbum* collection = subalbum->getSubalbum(); 00136 Photo* photo = subalbum->getFirstSelectedPhoto(); 00137 00138 //bail if either pointer is null (sanity check) 00139 if(collection == NULL || photo == NULL) 00140 return; 00141 00142 //init editing interface for current collection:photo 00143 editingInterface->setPhoto( collection, photo); 00144 editingInterface->setFocus(); 00145 00146 //handle the selected/shown photo state having been changed 00147 photoStateChangedEvent(); 00148 } 00149 }
|
|
Updates the current subalbums image.
Definition at line 89 of file layoutWidget.cpp. References subalbums, and SubalbumsWidget::updatedSelectedCollectionImage(). 00090 { 00091 subalbums->updatedSelectedCollectionImage(val); 00092 }
|
|
Editing interface.
Definition at line 76 of file layoutWidget.h. Referenced by editSelectedPhoto(), LayoutWidget(), photoStateChangedEvent(), revertPhotos(), setEditTabEnabled(), and tabChanged(). |
|
Grid items placed in.
Definition at line 64 of file layoutWidget.h. Referenced by LayoutWidget(). |
|
Collection organize widget.
Definition at line 73 of file layoutWidget.h. Referenced by LayoutWidget(), photoStateChangedEvent(), revertPhotos(), showCollection(), and tabChanged(). |
|
List of subalbums.
Definition at line 67 of file layoutWidget.h. Referenced by LayoutWidget(), refresh(), refreshSelectedCollectionIconName(), and updateSubalbumImage(). |
|
Tab widget containing organize and edit widgets.
Definition at line 70 of file layoutWidget.h. Referenced by editSelectedPhoto(), LayoutWidget(), organize(), photoStateChangedEvent(), revertPhotos(), and setEditTabEnabled(). |
|
Window pointer.
Definition at line 61 of file layoutWidget.h. Referenced by LayoutWidget(), and photoStateChangedEvent(). |