AlbumShaper 1.0a3
WelcomeWindow Class Reference

#include <welcomeWindow.h>

Inheritance diagram for WelcomeWindow:
Collaboration diagram for WelcomeWindow:

Public Member Functions

 WelcomeWindow (QWidget *parent=0, const char *name=0)
 

Private Slots

void itemClicked (Q3IconViewItem *item)
 

Private Attributes

Q3GridLayout * grid
 
QLabelsideImage
 
QLabelwelcomeTitle
 
QLabelwelcomeMessage
 
Itemsitems
 
Itemhelp
 
Itemupdates
 
Itemupcoming
 
QPushButton * closeButton
 Close button.
 

Detailed Description

Definition at line 30 of file welcomeWindow.h.

Constructor & Destructor Documentation

◆ WelcomeWindow()

WelcomeWindow::WelcomeWindow ( QWidget * parent = 0,
const char * name = 0 )

Definition at line 33 of file welcomeWindow.cpp.

34 :
35 QDialog(parent,name)
36{
37 //--------------------------------------------------------------
38 //set window title
39 setCaption( tr("Welcome to Album Shaper"));
40 //--
41 sideImage = new QLabel( this );
42 sideImage->setPixmap( QPixmap( QString(IMAGE_PATH) + "miscImages/welcome.png" ) );
43 sideImage->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
44 //--
45 Q3Frame* itemsFrame = new Q3Frame(this);
46
47 welcomeTitle = new QLabel( QString(tr("Welcome to Album Shaper %1")).arg(ALBUMSHAPER_VERSION), itemsFrame );
48 QFont textFont = welcomeTitle->font();
49 textFont.setWeight(QFont::Bold);
50 textFont.setPointSize( textFont.pointSize() + 2 );
51 welcomeTitle->setFont( textFont );
52 //--
53 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 );
54 welcomeMessage->setAlignment( Qt::AlignLeft | Qt::TextWordWrap | Qt::TextWrapAnywhere );
55 //--
56 items = new Items(itemsFrame);
57 items->setItemTextPos( Q3IconView::Right );
58 items->setMaxItemWidth(500);
59 items->setFrameShape ( Q3Frame::NoFrame );
60 items->setSelectionMode( Q3IconView::NoSelection ) ;
61
62 items->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
63
64 items->setSpacing( WIDGET_SPACING );
65
66 connect( items, SIGNAL(clicked(Q3IconViewItem*)), this, SLOT(itemClicked(Q3IconViewItem*)) );
67
68 help = new Item( items, QPixmap(QString(IMAGE_PATH)+"welcomeImages/handbook.png"),
69 tr("Read short tutorials which cover all of the program's ins and outs.") );
70 updates = new Item( items, QPixmap(QString(IMAGE_PATH)+"welcomeImages/updates.png"),
71 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.") );
72 upcoming = new Item( items, QPixmap(QString(IMAGE_PATH)+"welcomeImages/upcoming.png"),
73 tr("Take advantage of the power of open source development! Read about ongoing improvements and communicate with developers working on the project.") );
74
75 //set text rects of icons
76 int maxWidth = 0;
77 Q3IconViewItem *item;
78 for( item = items->firstItem(); item != NULL; item = item->nextItem() )
79 {
80 if(item->textRect().width() > maxWidth)
81 maxWidth = item->textRect().width();
82 }
83 for( item = items->firstItem(); item != NULL; item = item->nextItem() )
84 {
85 ((Item*)item)->setTextWidth( maxWidth );
86 }
87
88
89 //--
90 closeButton = new QPushButton(
91 //PLATFORM_SPECIFIC_CODE
92 #ifndef Q_OS_MACX
93 QPixmap(QString(IMAGE_PATH)+"buttonIcons/button_ok.png"),
94 #endif
95 tr("Close"),
96 itemsFrame );
97 closeButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
98 closeButton->setDefault(true);
99 connect( closeButton, SIGNAL(clicked()), SLOT(close()) );
100 //--
101 setPaletteBackgroundColor( Qt::white );
102 closeButton->setEraseColor( Qt::white );
103 //--
104 Q3GridLayout* grid = new Q3GridLayout( this, 1, 2, 0);
105 grid->addWidget( sideImage, 0, 0 );
106 grid->addWidget( itemsFrame, 0, 1 );
107
108 Q3GridLayout* itemsGrid = new Q3GridLayout( itemsFrame, 4, 3, 0 );
109
110 itemsGrid->addMultiCellWidget( welcomeTitle, 0, 0, 0, 2 );
111 itemsGrid->addMultiCellWidget( welcomeMessage, 1, 1, 0, 2 );
112 itemsGrid->addMultiCellWidget( items, 2, 2, 0, 2 );
113 itemsGrid->addWidget( closeButton, 3, 1 );
114
115 itemsGrid->setRowStretch( 2, 1 );
116 itemsGrid->setColStretch( 0, 1 );
117 itemsGrid->setColStretch( 2, 1 );
118
119 itemsGrid->setMargin(WIDGET_SPACING);
120 itemsGrid->setSpacing(WIDGET_SPACING);
121 //--
122 this->show();
123 setFixedSize(size());
124 //-------------------------------
125}
Definition item.h:28
Definition items.h:26
QLabel * sideImage
void itemClicked(Q3IconViewItem *item)
QPushButton * closeButton
Close button.
QLabel * welcomeTitle
Q3GridLayout * grid
QLabel * welcomeMessage
QString IMAGE_PATH
Definition config.cpp:18
#define WIDGET_SPACING
Definition config.h:31
#define ALBUMSHAPER_VERSION
Definition config.h:21

References ALBUMSHAPER_VERSION, closeButton, grid, help, IMAGE_PATH, itemClicked(), items, sideImage, upcoming, updates, welcomeMessage, welcomeTitle, and WIDGET_SPACING.

Member Function Documentation

◆ itemClicked

void WelcomeWindow::itemClicked ( Q3IconViewItem * item)
privateslot

Definition at line 127 of file welcomeWindow.cpp.

128{
129 if(item == NULL)
130 return;
131
132 TitleWidget* tw = ((Window*)qApp->mainWidget())->getTitle();
133
134 //help
135 if(item == help)
136 {
137 tw->help();
138 return;
139 }
140 //updates
141 else if(item == updates)
142 {
144 return;
145 }
146 //upcoming
147 else if(item == upcoming)
148 {
150 return;
151 }
152}
Widget which displays album name, description, representative image, and album shaper logo.
Definition titleWidget.h:57
void aboutProgram(int mode=ABOUT)
Pops up about dialog.
void help()
Pops up HelpWindow.
Top level widget, encapsulates the title widget, the layout widget, and the toolbar widget.
Definition window.h:40
#define UPDATES
Definition titleWidget.h:45
#define UPCOMING
Definition titleWidget.h:46

References TitleWidget::aboutProgram(), TitleWidget::help(), help, UPCOMING, upcoming, UPDATES, and updates.

Referenced by WelcomeWindow().

Member Data Documentation

◆ closeButton

QPushButton* WelcomeWindow::closeButton
private

Close button.

Definition at line 51 of file welcomeWindow.h.

Referenced by WelcomeWindow().

◆ grid

Q3GridLayout* WelcomeWindow::grid
private

Definition at line 41 of file welcomeWindow.h.

Referenced by WelcomeWindow().

◆ help

Item* WelcomeWindow::help
private

Definition at line 48 of file welcomeWindow.h.

Referenced by itemClicked(), and WelcomeWindow().

◆ items

Items* WelcomeWindow::items
private

Definition at line 47 of file welcomeWindow.h.

Referenced by WelcomeWindow().

◆ sideImage

QLabel* WelcomeWindow::sideImage
private

Definition at line 43 of file welcomeWindow.h.

Referenced by WelcomeWindow().

◆ upcoming

Item * WelcomeWindow::upcoming
private

Definition at line 48 of file welcomeWindow.h.

Referenced by itemClicked(), and WelcomeWindow().

◆ updates

Item * WelcomeWindow::updates
private

Definition at line 48 of file welcomeWindow.h.

Referenced by itemClicked(), and WelcomeWindow().

◆ welcomeMessage

QLabel* WelcomeWindow::welcomeMessage
private

Definition at line 45 of file welcomeWindow.h.

Referenced by WelcomeWindow().

◆ welcomeTitle

QLabel* WelcomeWindow::welcomeTitle
private

Definition at line 44 of file welcomeWindow.h.

Referenced by WelcomeWindow().


The documentation for this class was generated from the following files: