00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "state.h"
00018 #include "readonlyformbase.h"
00019 #include <qglobal.h>
00020 #include <qlabel.h>
00021 #include <qsqlquery.h>
00022 #include <qlayout.h>
00023
00024 State::State(LitUrl u, QObject *receiver, QString slot, QWidget *parent, const char *name):
00025 ReadOnlyFormBase(u, receiver, slot, parent, name) {
00026 stateform=new StateForm(this, "stateform");
00027 QHBoxLayout *l=new QHBoxLayout(this);
00028 l->addWidget(stateform);
00029 Q_ASSERT(stateform);
00030 setData();
00031 }
00032
00033 bool State::setData() {
00034 QSqlQuery query("select count(*) from publication");
00035 query.first();
00036 stateform->publications->setText(query.value(0).toString()+" publications");
00037
00038 query.exec("select count(*) from part");
00039 query.first();
00040 stateform->parts->setText(query.value(0).toString()+" parts");
00041
00042 query.exec("select count(*) from author");
00043 query.first();
00044 stateform->authors->setText(query.value(0).toString()+" authors");
00045
00046 query.exec("select count(*) from partdata");
00047 query.first();
00048 stateform->files->setText(query.value(0).toString()+" files");
00049
00050 query.exec("select count(*) from note");
00051 query.first();
00052 stateform->notes->setText(query.value(0).toString()+" notes");
00053
00054 query.exec("select count(*) from link");
00055 query.first();
00056 stateform->links->setText(query.value(0).toString()+" links");
00057
00058 query.exec("select count(*) from publisher");
00059 query.first();
00060 stateform->publishers->setText(query.value(0).toString()+" publishers");
00061
00062 query.exec("select count(*) from journal");
00063 query.first();
00064 stateform->journals->setText(query.value(0).toString()+" journals");
00065
00066 setValid(true);
00067 return true;
00068 }
00069
00070 State::~State() {
00071 }