14 #include <qradiobutton.h> 15 #include <qlineedit.h> 16 #include <qapplication.h> 18 #include <q3buttongroup.h> 19 #include <qcombobox.h> 20 #include <qpushbutton.h> 22 #include <qlineedit.h> 24 #include <q3filedialog.h> 26 #include <Q3GridLayout> 31 #include "../../clickableLabel.h" 32 #include "../../window.h" 33 #include "../../titleWidget.h" 34 #include "../../statusWidget.h" 35 #include "../../../config.h" 36 #include "../../../configuration/configuration.h" 37 #include "../../../backend/album.h" 38 #include "../../../backend/tools/imageTools.h" 39 #include "../../../backend/manipulations/mosaic.h" 42 #define MAX_FILES 1000 54 QLabel* tileSizeLabel =
new QLabel( tr(
"Tile size:"),
this );
55 tileSizes =
new QComboBox( tileSizeOptions );
64 tileWidth =
new QSpinBox( 1, 500, 1, tileSizeOptions );
66 tileHeight =
new QSpinBox( 1, 500, 1, tileSizeOptions );
79 Q3GridLayout* tileSizeGrid =
new Q3GridLayout( tileSizeOptions, 1, 6, 0 );
80 tileSizeGrid->addWidget(
tileSizes, 1, 0 );
82 tileSizeGrid->addWidget(
tileWidth, 1, 2 );
83 tileSizeGrid->addWidget(
tileSizeX, 1, 3 );
85 tileSizeGrid->setColStretch( 5, 1 );
91 QLabel* tileTypeLabel =
new QLabel( tr(
"Base tiles on:"),
this );
103 QString path = config->
getString(
"loadSave",
"addPhotoDir" );
105 if(!testPath.exists())
108 path = config->
getString(
"loadSave",
"addPhotoDir" );
124 Q3ButtonGroup* typeGroup =
new Q3ButtonGroup( tileTypeOptions );
130 Q3GridLayout* tileTypeGrid =
new Q3GridLayout( tileTypeOptions, 3, 3, 0 );
137 tileTypeGrid->setColSpacing(1, 300);
138 tileTypeGrid->setColStretch(1, 1);
144 QPushButton* applyButton =
new QPushButton( tr(
"Apply"), buttonsFrame );
145 applyButton->setDefault(
true);
146 applyButton->setFocus();
147 connect( applyButton, SIGNAL(clicked()), SLOT(accept()) );
149 QPushButton* cancelButton =
new QPushButton( tr(
"Cancel"), buttonsFrame );
150 connect( cancelButton, SIGNAL(clicked()), SLOT(reject()) );
152 Q3GridLayout* buttonsGrid =
new Q3GridLayout( buttonsFrame, 1, 2, 0 );
153 buttonsGrid->addWidget( applyButton, 0, 0 );
154 buttonsGrid->addWidget( cancelButton, 0, 1 );
158 Q3GridLayout* mainGrid =
new Q3GridLayout(
this, 5, 2, 0 );
160 mainGrid->setRowStretch( 0, 1 );
161 mainGrid->addWidget( tileSizeLabel, 1,0, Qt::AlignRight | Qt::AlignVCenter );
162 mainGrid->addWidget( tileSizeOptions, 1,1 );
163 mainGrid->addWidget( tileTypeLabel, 2,0, Qt::AlignRight | Qt::AlignVCenter );
164 mainGrid->addWidget( tileTypeOptions, 2,1 );
165 mainGrid->setRowStretch( 3, 1 );
166 mainGrid->addMultiCellWidget( buttonsFrame, 4,4, 0,1, Qt::AlignHCenter );
171 setCaption( tr(
"Mosaic Options") );
193 if(
tileSizes->currentItem() == 0 )
return QSize( 20, 20 );
194 else if(
tileSizes->currentItem() == 1 )
return QSize( 40, 40 );
195 else if(
tileSizes->currentItem() == 2 )
return QSize( 65, 65 );
196 else if(
tileSizes->currentItem() == 3 )
return QSize( 100, 100 );
197 else if(
tileSizes->currentItem() == 4 )
return QSize( 150, 150 );
206 Album* albm = ((
Window*)qApp->mainWidget())->getTitle()->getAlbum();
226 tmpDir.setPath( path );
229 tmpDir.setFilter( QDir::Files | QDir::Readable );
230 tmpDir.setNameFilter(
"*.gif;*.jpg;*.jpeg;*.png;*.xpm;*.GIF;*.JPG;*.JPEG;*.PNG;*.XPM" );
231 QStringList images = tmpDir.entryList();
232 QStringList::iterator it;
234 for(it = images.begin(); it != images.end(); it++ )
238 if( imageRes.width() <= 0 || imageRes.height() <= 0 )
continue;
241 files.append( tmpDir.absFilePath( *it ) );
250 tmpDir.setFilter( QDir::Dirs | QDir::Readable | QDir::NoSymLinks );
251 tmpDir.setNameFilter(
"*" );
252 QStringList directores = tmpDir.entryList();
253 for(it = directores.begin(); it != directores.end(); it++ )
256 if( dir.compare(
"." ) == 0 || dir.compare(
".." ) == 0 )
continue;
277 if( !customSelected )
279 tileSizePreview->setText( QString(
"(%1 x %2)").arg( tileSize.width() ).arg( tileSize.height() ) );
295 QString dirName = Q3FileDialog::getExistingDirectory(
locationVal->text(),
this, NULL, tr(
"Images directory") );
297 if(!dirName.isNull())
Top level widget, encapsulates the title widget, the layout widget, and the toolbar widget...
QStringList determineFilesList()
QString getString(QString group, QString key)
Fetch string setting.
void resetSetting(QString group, QString key)
Resets a setting to it's default value.
void setPixmap(const QPixmap &p)
void updateImagesFromOptions()
QSize determineTileSize()
MosaicOptionsDialog(QWidget *parent=0)
Constructs layout.
QRadioButton * tileType_imagesFrom
QStringList getThumbnailFilenames()
Returns a list of the most up to date thumbnail filesnames.
QRadioButton * tileType_solidColors
void appendImagesInPath(QStringList &files, QString path, int depth)
void setEnabled(bool val)
QRadioButton * tileType_albumPhotos
MosaicOptions * getOptions()
returns a populate options object
Configuration object manages all user-specific application settings.
An album contains Subalbums.
void updateTileSizePreview()
ClickableLabel * browseButton