Main Page   Compound List   File List   Compound Members   File Members  

loadDialog.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 <qpixmap.h>
00019 #include <qlabel.h>
00020 #include <qfont.h>
00021 #include <qlistbox.h>
00022 #include <qlayout.h>
00023 #include <qapplication.h>
00024 
00025 //Projectwide includes
00026 #include "loadDialog.h"
00027 #include "../config.h"
00028 
00029 //==============================================
00030 LoadDialog::LoadDialog( QWidget *parent, const char* name ) :
00031                         QWidget(parent,name)
00032 
00033 {
00034   //create and set application icon
00035   applicationIcon = new QPixmap(QString(IMAGE_PATH)+"albumShaperIcon.png");
00036   setIcon( *applicationIcon );
00037   setCaption( "Loading...");
00038 
00039   //create widgts and place in window
00040   loading = new QLabel( this );
00041   loading->setText( "Loading..." );
00042   loading->setFont( QFont( "Time", 12, QFont::Bold ) );
00043   
00044   entries = new QListBox( this );
00045   entries->setSelectionMode( QListBox::NoSelection );
00046   
00047   //place all labels in grid layout
00048   grid = new QGridLayout( this, 2, 1, 0 );
00049   grid->addWidget( loading, 0, 0, Qt::AlignLeft);
00050   grid->addWidget( entries, 1, 0);
00051   
00052   //set the background of the widget to be white
00053   setPaletteBackgroundColor( QColor(255, 255, 255) );
00054 
00055   //set defaults
00056   lastMessageSubalbumPhoto = false;
00057   lastSubalbum = -1;
00058 }
00059 //==============================================
00060 void LoadDialog::printMessage( QString message )
00061 {
00062   entries->insertItem( message );
00063   entries->triggerUpdate( false );
00064   lastMessageSubalbumPhoto = false;
00065   lastSubalbum = -1;
00066   repaint();
00067   qApp->processEvents();
00068 }
00069 //==============================================
00070 void LoadDialog::printSubalbumPhoto( int subalbum, int photo )
00071 {
00072   if(lastMessageSubalbumPhoto && lastSubalbum == subalbum)
00073   {
00074     entries->changeItem( QString("Subalbum %1 photo %2").arg(subalbum).arg(photo), entries->count() -1 );
00075   }
00076   else
00077   {
00078     entries->insertItem( QString("Subalbum %1 photo %2").arg(subalbum).arg(photo) );
00079     lastMessageSubalbumPhoto = true;
00080     lastSubalbum = subalbum;
00081   }
00082 
00083   repaint();
00084   qApp->processEvents();
00085 }
00086 //==============================================
00087 

Generated on Tue Jun 10 23:41:20 2003 for AlbumShaper by doxygen 1.3.1