AlbumShaper
1.0a3
|
#include <welcomeWindow.h>
Public Member Functions | |
WelcomeWindow (QWidget *parent=0, const char *name=0) | |
Private Slots | |
void | itemClicked (QIconViewItem *item) |
Private Attributes | |
QGridLayout * | grid |
QLabel * | sideImage |
QLabel * | welcomeTitle |
QLabel * | welcomeMessage |
Items * | items |
Item * | help |
Item * | updates |
Item * | upcoming |
QPushButton * | closeButton |
Close button. |
Definition at line 26 of file welcomeWindow.h.
WelcomeWindow::WelcomeWindow | ( | QWidget * | parent = 0 , |
const char * | name = 0 |
||
) |
Definition at line 30 of file welcomeWindow.cpp.
References ALBUMSHAPER_VERSION, closeButton, grid, help, IMAGE_PATH, itemClicked(), items, sideImage, upcoming, updates, welcomeMessage, welcomeTitle, and WIDGET_SPACING.
: QDialog(parent,name) { //-------------------------------------------------------------- //set window title setCaption( tr("Welcome to Album Shaper")); //-- sideImage = new QLabel( this ); sideImage->setPixmap( QPixmap( QString(IMAGE_PATH) + "miscImages/welcome.png" ) ); sideImage->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); //-- QFrame* itemsFrame = new QFrame(this); welcomeTitle = new QLabel( QString(tr("Welcome to Album Shaper %1")).arg(ALBUMSHAPER_VERSION), itemsFrame ); QFont textFont = welcomeTitle->font(); textFont.setWeight(QFont::Bold); textFont.setPointSize( textFont.pointSize() + 2 ); welcomeTitle->setFont( textFont ); //-- welcomeMessage = new QLabel( QString(tr("It appears you are a new Album Shaper user! Before you begin creating photo albums, you may want to explore the following features of this program:" ) ), itemsFrame ); welcomeMessage->setAlignment( Qt::AlignLeft | Qt::WordBreak | Qt::BreakAnywhere ); //-- items = new Items(itemsFrame); items->setItemTextPos( QIconView::Right ); items->setMaxItemWidth(500); items->setFrameShape ( QFrame::NoFrame ); items->setSelectionMode( QIconView::NoSelection ) ; items->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); items->setSpacing( WIDGET_SPACING ); connect( items, SIGNAL(clicked(QIconViewItem*)), this, SLOT(itemClicked(QIconViewItem*)) ); help = new Item( items, QPixmap(QString(IMAGE_PATH)+"welcomeImages/handbook.png"), tr("Read short tutorials which cover all of the program's ins and outs.") ); updates = new Item( items, QPixmap(QString(IMAGE_PATH)+"welcomeImages/updates.png"), tr("Keep up to date. If a new version of Album Shaper is available you'll see a pulsing light bulb appear in the bottom right corner of the application.") ); upcoming = new Item( items, QPixmap(QString(IMAGE_PATH)+"welcomeImages/upcoming.png"), tr("Take advantage of the power of open source development! Read about ongoing improvements and communicate with developers working on the project.") ); //set text rects of icons int maxWidth = 0; QIconViewItem *item; for( item = items->firstItem(); item != NULL; item = item->nextItem() ) { if(item->textRect().width() > maxWidth) maxWidth = item->textRect().width(); } for( item = items->firstItem(); item != NULL; item = item->nextItem() ) { ((Item*)item)->setTextWidth( maxWidth ); } //-- closeButton = new QPushButton( //PLATFORM_SPECIFIC_CODE #ifndef Q_OS_MACX QPixmap(QString(IMAGE_PATH)+"buttonIcons/button_ok.png"), #endif tr("Close"), itemsFrame ); closeButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); closeButton->setDefault(true); connect( closeButton, SIGNAL(clicked()), SLOT(close()) ); //-- setPaletteBackgroundColor( white ); closeButton->setEraseColor( white ); //-- QGridLayout* grid = new QGridLayout( this, 1, 2, 0); grid->addWidget( sideImage, 0, 0 ); grid->addWidget( itemsFrame, 0, 1 ); QGridLayout* itemsGrid = new QGridLayout( itemsFrame, 4, 3, 0 ); itemsGrid->addMultiCellWidget( welcomeTitle, 0, 0, 0, 2 ); itemsGrid->addMultiCellWidget( welcomeMessage, 1, 1, 0, 2 ); itemsGrid->addMultiCellWidget( items, 2, 2, 0, 2 ); itemsGrid->addWidget( closeButton, 3, 1 ); itemsGrid->setRowStretch( 2, 1 ); itemsGrid->setColStretch( 0, 1 ); itemsGrid->setColStretch( 2, 1 ); itemsGrid->setMargin(WIDGET_SPACING); itemsGrid->setSpacing(WIDGET_SPACING); //-- this->show(); setFixedSize(size()); //------------------------------- }
void WelcomeWindow::itemClicked | ( | QIconViewItem * | item | ) | [private, slot] |
Definition at line 124 of file welcomeWindow.cpp.
References TitleWidget::aboutProgram(), help, TitleWidget::help(), UPCOMING, upcoming, UPDATES, and updates.
Referenced by WelcomeWindow().
{ if(item == NULL) return; TitleWidget* tw = ((Window*)qApp->mainWidget())->getTitle(); //help if(item == help) { tw->help(); return; } //updates else if(item == updates) { tw->aboutProgram(UPDATES); return; } //upcoming else if(item == upcoming) { tw->aboutProgram(UPCOMING); return; } }
QPushButton* WelcomeWindow::closeButton [private] |
QGridLayout* WelcomeWindow::grid [private] |
Definition at line 37 of file welcomeWindow.h.
Referenced by WelcomeWindow().
Item* WelcomeWindow::help [private] |
Definition at line 44 of file welcomeWindow.h.
Referenced by itemClicked(), and WelcomeWindow().
Items* WelcomeWindow::items [private] |
Definition at line 43 of file welcomeWindow.h.
Referenced by WelcomeWindow().
QLabel* WelcomeWindow::sideImage [private] |
Definition at line 39 of file welcomeWindow.h.
Referenced by WelcomeWindow().
Item * WelcomeWindow::upcoming [private] |
Definition at line 44 of file welcomeWindow.h.
Referenced by itemClicked(), and WelcomeWindow().
Item * WelcomeWindow::updates [private] |
Definition at line 44 of file welcomeWindow.h.
Referenced by itemClicked(), and WelcomeWindow().
QLabel* WelcomeWindow::welcomeMessage [private] |
Definition at line 41 of file welcomeWindow.h.
Referenced by WelcomeWindow().
QLabel* WelcomeWindow::welcomeTitle [private] |
Definition at line 40 of file welcomeWindow.h.
Referenced by WelcomeWindow().