Main Page   Compound List   File List   Compound Members   File Members  

areYouSureWidget.cpp

Go to the documentation of this file.
00001 //==============================================
00002 //  copyright            : (C) 2003 by Will Stokes
00003 //==============================================
00004 //  This program is free software; you can redistribute it 
00005 //  and/or modify it under the terms of the GNU General 
00006 //  Public License as published by the Free Software 
00007 //  Foundation; either version 2 of the License, or  
00008 //  (at your option) any later version.         
00009 //
00010 //  As a special exception, Will Stokes gives permission to 
00011 //  link this program with Qt non-commercial edition, and 
00012 //  distribute the resulting executable, without including the 
00013 //  source code for the Qt non-commercial edition in the 
00014 //  source distribution. 
00015 //==============================================
00016 
00017 //Systemwide includes
00018 #include <qdialog.h>
00019 #include <qlayout.h>
00020 #include <qlabel.h>
00021 #include <qfont.h>
00022 #include <qpushbutton.h>
00023 #include <qpixmap.h>
00024 
00025 //Projectwide includes
00026 #include "areYouSureWidget.h"
00027 #include "../config.h"
00028 
00029 //==============================================
00030 AreYouSureWidget::AreYouSureWidget( QWidget* parent,
00031                                     const char* name ) : 
00032                                    QDialog(parent, name, true )
00033 {
00034   message = new QLabel( this );
00035   message->setText( "Are you sure?" );
00036   message->setFont( QFont( "Times", 12, QFont::Bold ) );
00037 
00038   yes = new QPushButton( this );
00039   yes->setText( "Yes" );
00040   connect( yes, SIGNAL(clicked()), SLOT(accept()) );
00041 
00042   no = new QPushButton( this );
00043   no->setText( "No" );
00044   connect( no, SIGNAL(clicked()), SLOT(reject()) );
00045         
00046   //create new grid and add widgets
00047   grid = new QGridLayout( this, 2, 2, 0);
00048   grid->addMultiCellWidget(message, 0, 0, 0, 1 );
00049   grid->addWidget( yes, 1, 0 );
00050   grid->addWidget( no, 1, 1 );
00051 
00052   //set the background of the widget to be white
00053   setPaletteBackgroundColor( QColor(255, 255, 255) );
00054 
00055   //create and set application icon
00056   applicationIcon = new QPixmap(QString(IMAGE_PATH)+"albumShaperIcon.png");
00057   setIcon( *applicationIcon );
00058   setCaption( "Are you Sure?");
00059 }
00060 //==============================================
00061 AreYouSureWidget::~AreYouSureWidget()
00062 {
00063   delete message;
00064   delete yes;
00065   delete no;
00066   delete grid;
00067 }
00068 //==============================================

Generated on Thu Apr 10 00:06:40 2003 for AlbumShaper by doxygen1.2.18