Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

generatebibtex.ui.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   generatebibtex.ui.h                                                                   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   Read the file COPYING for details.                                    *
00011  *                                                                         *
00012  *   copyright: (C) 2003 by Jan Mueller                                    *
00013  *   email: janmueller7@hotmail.com                                        *
00014  *                                                                         *
00015  ***************************************************************************/
00016 
00017 /****************************************************************************
00018 ** ui.h extension file, included from the uic-generated form implementation.
00019 **
00020 ** If you wish to add, delete or rename functions or slots use
00021 ** Qt Designer which will update this file, preserving your code. Create an
00022 ** init() function in place of a constructor, and a destroy() function in
00023 ** place of a destructor.
00024 *****************************************************************************/
00025 
00026 void GenerateBibTex::chooseFile() {
00027     QFileDialog* fd = new QFileDialog( this );
00028     if (fd->exec() == QDialog::Accepted)         
00029         filename->setText(fd->selectedFile());
00030 }
00031 
00032 void GenerateBibTex::setProjectNo(QString n) {
00033   project=n;
00034 }
00035 
00036 void GenerateBibTex::generateBibTex() {
00037     QFile f(filename->text());
00038     if(f.open(IO_WriteOnly)) {
00039       QTextStream s(&f);
00040       QSqlQuery q("select p.bibtex, p.title from part p, project_bibliography b where b.project_no="+project+" and tab_no=tabid('part') and p.no=b.id_no");
00041       progress->setTotalSteps(q.size());
00042       int i=0;
00043      while(q.next()) {
00044        i++;
00045        progress->setProgress(i);
00046        s<<q.value(0).toString()<<"\n";       
00047        log->append(q.value(1).toString()+"\n");
00048     }
00049     
00050     q.exec("select p.bibtex, p.title from publication p, project_bibliography b where b.project_no="+project+" and tab_no=tabid('publication') and b.id_no=p.no union select publ.bibtex, publ.title from publication publ, part, project_bibliography b where b.project_no="+project+" and b.tab_no=tabid('part') and part.no=b.id_no and publ.no=part.publication_no");
00051     progress->setTotalSteps(q.size());    
00052     i=0;
00053     while(q.next()) {
00054        i++;
00055        progress->setProgress(i);        
00056        s<<q.value(0).toString()<<"\n";
00057        log->append(q.value(1).toString()+"\n");
00058     }
00059     f.close();    
00060   }
00061 }

Generated on Sat Mar 27 19:20:39 2004 for Literature by doxygen 1.3.6-20040222