Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

infowin.cpp

Go to the documentation of this file.
00001 #include "infowin.h"
00002 #include "version.h"
00003 #include <stdio.h>
00004 #include <qmultilineedit.h>
00005 #include <qlayout.h>
00006 #include <qpushbutton.h>
00007 #include "names.h"
00008 
00009 void infowin::setAbout(const QString& _s)
00010 {
00011   char vstr[128];
00012   sprintf(vstr, PROGNAME " v%u.%u%c (%s) - A small e-text reader\n%s %s", MAJOR, BKMKTYPE, MINOR, RELEASE_TYPE, __DATE__, __TIME__);
00013     //    l = new QLabel(vstr, this);
00014   QString c = vstr;
00015   c += _s;
00016   aboutbox->setText(c);
00017 }
00018 
00019 infowin::infowin( QWidget *parent, const char *name, WFlags f) :
00020     QWidget(parent, name, f)
00021 {
00022   QVBoxLayout* vl = new QVBoxLayout(this);
00023   aboutbox = new QMultiLineEdit(this);
00024   aboutbox->setReadOnly(true);
00025     aboutbox->setWordWrap(QMultiLineEdit::WidgetWidth);
00026   //grid->addWidget(l, 5, 0);
00027   vl->addWidget(aboutbox);
00028     QGridLayout* grid = new QGridLayout(vl, 10, 2);
00029     QLabel* l;
00030     l = new QLabel("Compressed file size", this);
00031     grid->addWidget(l, 0, 0);
00032     fileSize = new QLabel("0", this);
00033     fileSize->setAlignment( AlignVCenter | AlignRight );
00034     grid->addWidget(fileSize, 0, 1);
00035     l = new QLabel("Original text size", this);
00036     grid->addWidget(l, 1, 0);
00037     textSize = new QLabel("0", this);
00038     textSize->setAlignment( AlignVCenter | AlignRight );
00039     grid->addWidget(textSize, 1, 1);
00040     l = new QLabel("Compression Ratio", this);
00041     grid->addWidget(l, 2, 0);
00042     ratio = new QLabel("0", this);
00043     grid->addWidget(ratio, 2, 1);
00044     ratio->setAlignment( AlignVCenter | AlignRight );
00045     l = new QLabel("Current location", this);
00046     grid->addWidget(l, 3, 0);
00047     location = new QLabel("0", this);
00048     location->setAlignment( AlignVCenter | AlignRight );
00049     grid->addWidget(location, 3, 1);
00050     l = new QLabel("Per centage read (file)", this);
00051     grid->addWidget(l, 4, 0);
00052     read = new QLabel("0", this);
00053     read->setAlignment( AlignVCenter | AlignRight );
00054     grid->addWidget(read, 4, 1);
00055 
00056     l = new QLabel("Document Size", this);
00057     grid->addWidget(l, 5, 0);
00058     docSize = new QLabel("0", this);
00059     docSize->setAlignment( AlignVCenter | AlignRight );
00060     grid->addWidget(docSize, 5, 1);
00061 
00062     l = new QLabel("Document Location", this);
00063     grid->addWidget(l, 6, 0);
00064     docLocation = new QLabel("0", this);
00065     docLocation->setAlignment( AlignVCenter | AlignRight );
00066     grid->addWidget(docLocation, 6, 1);
00067 
00068     l = new QLabel("Per centage read (doc)", this);
00069     grid->addWidget(l, 7, 0);
00070     docread = new QLabel("0", this);
00071     docread->setAlignment( AlignVCenter | AlignRight );
00072     grid->addWidget(docread, 7, 1);
00073 
00074 
00075     l = new QLabel("Zoom", this);
00076     grid->addWidget(l, 8, 0);
00077     zoom = new QLabel("0", this);
00078     zoom->setAlignment( AlignVCenter | AlignRight );
00079     grid->addWidget(zoom, 8, 1);
00080     QPushButton* exitbutton = new QPushButton("Cancel", this);
00081     connect( exitbutton, SIGNAL( clicked() ), this, SLOT( infoClose() ) );
00082     grid->addWidget(exitbutton, 9, 1);
00083 }

Generated on Sat Nov 5 16:16:55 2005 for OPIE by  doxygen 1.4.2