#include <layoutWidget.h>
Definition at line 40 of file layoutWidget.h.
Public Member Functions | |
| LayoutWidget (QWidget *parent=0, const char *name=0) | |
| Creates empty layout. | |
| void | updateSubalbum (Subalbum *salbum, bool oldExists) |
| Removes current subalbum widget. | |
| void | updateSubalbumName (const QString &val) |
| Updates current subalbums name. | |
| void | updateSubalbumImage (QPixmap *val) |
| Updates the current subalbums image. | |
| 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 | editPhoto (Photo *photo) |
| Brings up edit dialog for specified photo. | |
| void | stopEdit (bool oldExists) |
| Tears down the edit dialog and returns to the layout for the selected subalbum. | |
Private Attributes | |
| Window * | window |
| Window pointer. | |
| QGridLayout * | grid |
| Grid items placed in. | |
| SubalbumWidget * | subalbum |
| Particular subalbum layout. | |
| SubalbumsWidget * | subalbums |
| List of subalbums. | |
| PhotoEditWidget * | photoEdit |
| Photo editing widget. | |
|
||||||||||||
|
Creates empty layout.
Definition at line 34 of file layoutWidget.cpp. References grid, photoEdit, subalbum, subalbums, and window.
00035 : QWidget(parent,name)
00036 {
00037 window = (Window*)parent;
00038
00039 subalbums = new SubalbumsWidget( this, "subalbums" );
00040 subalbum = NULL;
00041
00042 //place the subalbums list and subalbum view in grid
00043 grid = new QGridLayout( this, 1, 2, 0 );
00044 grid->addWidget( subalbums, 0, 0 );
00045
00046 //create a photo edit widget, when need the current subalbum can be
00047 //removed from the grid and the photo edit widget can be inserted, then
00048 //exchanged again when edting concludes.
00049 photoEdit = new PhotoEditWidget( this, "photo edit" );
00050 grid->addWidget( photoEdit, 0, 1 );
00051 photoEdit->hide();
00052
00053 grid->setColStretch( 1, 1 );
00054
00055 grid->addColSpacing(0, 100 );
00056
00057 //set the background of the widget to be white
00058 setPaletteBackgroundColor( QColor(255, 255, 255) );
00059 }
|
|
|
Brings up edit dialog for specified photo.
Definition at line 129 of file layoutWidget.cpp. References photoEdit, PhotoEditWidget::setPhoto(), and subalbum. Referenced by SubalbumWidget::editAction().
00130 {
00131 //never edit null photos, this should never happen but it's a sanity check anyways
00132 if(photo == NULL)
00133 return;
00134
00135 //if a subalbum exists hide it
00136 if(subalbum != NULL)
00137 subalbum->hide();
00138
00139 //set the photo pointer for the photo edit widget
00140 photoEdit->setPhoto(photo);
00141
00142 //unhide the photo edit widget
00143 photoEdit->show();
00144 }
|
|
|
Returns a pointer to the subalbum.
Definition at line 109 of file layoutWidget.cpp. References subalbum. Referenced by TitleWidget::loadAlbum(), TitleWidget::saveAlbum(), and TitleWidget::setImageAction().
00110 {
00111 return subalbum;
00112 }
|
|
|
Returns a pointer to the subalbums.
Definition at line 114 of file layoutWidget.cpp. References subalbums. Referenced by SubalbumWidget::addImageAction(), SubalbumWidget::flipHorizontallyImageAction(), SubalbumWidget::flipVerticallyImageAction(), TitleWidget::loadAlbum(), SubalbumWidget::removeImageAction(), SubalbumWidget::rotate270ImageAction(), SubalbumWidget::rotate90ImageAction(), and TitleWidget::saveAlbum().
00115 {
00116 return subalbums;
00117 }
|
|
|
Returns a pointer to the window.
Definition at line 119 of file layoutWidget.cpp. References window. Referenced by SubalbumWidget::addImageAction(), SubalbumsWidget::createAction(), SubalbumsWidget::deleteAction(), SubalbumWidget::flipHorizontallyImageAction(), SubalbumWidget::flipVerticallyImageAction(), SubalbumsWidget::refresh(), SubalbumWidget::removeImageAction(), SubalbumsWidget::reorder(), SubalbumWidget::rotate270ImageAction(), SubalbumWidget::rotate90ImageAction(), SubalbumWidget::updateButtons(), and SubalbumsWidget::updateSubalbumLayout().
00120 {
00121 return window;
00122 }
|
|
|
Refreshes layout.
Definition at line 124 of file layoutWidget.cpp. References SubalbumsWidget::refresh(), and subalbums. Referenced by Window::refresh().
|
|
|
Tears down the edit dialog and returns to the layout for the selected subalbum.
Definition at line 146 of file layoutWidget.cpp. References photoEdit, SubalbumWidget::refreshSelectedPhotos(), and subalbum. Referenced by PhotoEditWidget::returnFromEdit(), and SubalbumsWidget::updateSubalbumLayout().
00147 {
00148 //hide edit window, show subalbum window
00149 //refresh thumbnail and text for selected image
00150 photoEdit->hide();
00151 if(subalbum != NULL)
00152 {
00153 subalbum->show();
00154 if(oldExists)
00155 subalbum->refreshSelectedPhotos();
00156 }
00157 }
|
|
||||||||||||
|
Removes current subalbum widget. Creates new widget using new subalbum pointer Definition at line 61 of file layoutWidget.cpp. References SubalbumWidget::getSubalbum(), grid, SubalbumWidget::refreshPhotos(), SubalbumWidget::setSubalbum(), subalbum, and SubalbumWidget::syncPhotos(). Referenced by SubalbumsWidget::updateSubalbumLayout().
00062 {
00063 //if new selection is same as old selection do nothing
00064 if(subalbum != NULL && salbum == subalbum->getSubalbum())
00065 return;
00066
00067 //if a subalbum previously displayed update it
00068 if(subalbum != NULL)
00069 {
00070 //sync up old data
00071 if(oldExists)
00072 subalbum->syncPhotos();
00073
00074 //if new subalbum exists update subalbum
00075 if(salbum != NULL)
00076 {
00077 subalbum->setSubalbum(salbum);
00078 }
00079 //else just destroy old subalbum view
00080 else
00081 {
00082 delete subalbum;
00083 subalbum = NULL;
00084 }
00085 }
00086 //else create a new subalbum widget and populate it
00087 else if(salbum != NULL)
00088 {
00089 //create new subalbum widget
00090 subalbum = new SubalbumWidget( salbum, this, "subalbum" );
00091
00092 //insert into layout
00093 grid->addWidget( subalbum, 0, 1 );
00094 subalbum->show();
00095 subalbum->refreshPhotos();
00096 }
00097 }
|
|
|
Updates the current subalbums image.
Definition at line 104 of file layoutWidget.cpp. References subalbums, and SubalbumsWidget::updateSubalbumThumbnail(). Referenced by SubalbumWidget::setImageAction().
00105 {
00106 subalbums->updateSubalbumThumbnail(val);
00107 }
|
|
|
Updates current subalbums name.
Definition at line 99 of file layoutWidget.cpp. References subalbums, and SubalbumsWidget::updateSubalbumName(). Referenced by SubalbumWidget::updateName().
00100 {
00101 subalbums->updateSubalbumName(val);
00102 }
|
|
|
Grid items placed in.
Definition at line 79 of file layoutWidget.h. Referenced by LayoutWidget(), and updateSubalbum(). |
|
|
Photo editing widget.
Definition at line 88 of file layoutWidget.h. Referenced by editPhoto(), LayoutWidget(), and stopEdit(). |
|
|
Particular subalbum layout.
Definition at line 82 of file layoutWidget.h. Referenced by editPhoto(), getSubalbum(), LayoutWidget(), stopEdit(), and updateSubalbum(). |
|
|
List of subalbums.
Definition at line 85 of file layoutWidget.h. Referenced by getSubalbums(), LayoutWidget(), refresh(), updateSubalbumImage(), and updateSubalbumName(). |
|
|
Window pointer.
Definition at line 76 of file layoutWidget.h. Referenced by getWindow(), and LayoutWidget(). |
1.3.1