importexportbulmafactview.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2003 by Tomeu Borras                                    *
00003  *   tborras@conetxia.com                                                  *
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  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #include <QCheckBox>
00022 #include <QLineEdit>
00023 #include <QFile>
00024 #include <QToolButton>
00025 #include <QFileDialog>
00026 #include <QProgressBar>
00027 #include <QTextBrowser>
00028 
00029 #include "importexportbulmafactview.h"
00030 #include "pgimportfiles.h"
00031 #include "busquedafecha.h"
00032 
00033 
00035 
00039 void ImportExportBulmafactView::alerta(int a, int b) {
00040     _depura("ImportExportBulmafactView::alerta", 0);
00041     m_progressbar->setRange(a, b);
00042     _depura("END ImportExportBulmafactView::alerta", 0);
00043 }
00044 
00045 
00047 
00050 void ImportExportBulmafactView::mensajeria(QString mensaje) {
00051     _depura("ImportExportBulmafactView::mensajeria", 0);
00052     fprintf(stderr, "MENSAJE:\n\n\n%s\n\n\n", mensaje.toAscii().constData());
00053     mensajein += mensaje + "<BR>";
00054     m_mensajes->setText("<HTML><BODY BGCOLOR='#CCCCCC'>" + QString(mensajein.toLatin1()) + "</BODY></HTML>");
00055     m_mensajes->ensureCursorVisible();
00056     _depura("END ImportExportBulmafactView::mensajeria", 0);
00057 }
00058 
00059 
00061 
00066 ImportExportBulmafactView::ImportExportBulmafactView(postgresiface2 *con, QWidget *parent, Qt::WFlags f = 0)
00067         : QDialog(parent, f), pgimportfiles(con) {
00068     _depura("ImportExportBulmafactView::ImportExportBulmafactView", 0);
00069     setupUi(this);
00070 
00072     QObject::connect(pushButton33, SIGNAL(clicked()), this, SLOT(botonImportar()));
00073     QObject::connect(pushButton33_2, SIGNAL(clicked()), this, SLOT(botonExportar()));
00074     QObject::connect(pushButtonF_X, SIGNAL(clicked()), this, SLOT(close()));
00075     QObject::connect(toolButton1_5, SIGNAL(clicked()), this, SLOT(botonBuscarXML()));
00076 
00077     conexionbase = con;
00078     inicializaMensajeria();
00079     _depura("END ImportExportBulmafactView::ImportExportBulmafactView", 0);
00080 }
00081 
00082 
00084 
00086 void ImportExportBulmafactView::botonBuscarXML() {
00087     _depura("ImportExportBulmafactView::botonBuscarXML", 0);
00088     m_XML->setText(QFileDialog::getSaveFileName(this, tr("Guardar archivo"), confpr->valor(CONF_DIR_USER), tr("Contaplus (*.xml)")));
00089     _depura("END ImportExportBulmafactView::botonBuscarXML", 0);
00090 }
00091 
00092 
00094 
00096 void ImportExportBulmafactView::botonImportar() {
00097     _depura("ImportExportBulmafactView::botonImportar", 0);
00098     inicializaMensajeria();
00099     QString finicial = m_fechainicial->text();
00100     QString ffinal = m_fechafinal->text();
00101     QFile filexml(m_XML->text());
00102     filexml.open(QIODevice::ReadOnly);
00103     XML2BulmaFact(filexml);
00104     filexml.close();
00105     m_mensajes->setText("");
00106     _depura("END ImportExportBulmafactView::botonImportar", 0);
00107 }
00108 
00109 
00111 
00112 
00113 
00114 
00115 
00116 
00117 
00118 
00120 void ImportExportBulmafactView::botonExportar() {
00121     _depura("ImportExportBulmafactView::botonExportar", 0);
00123     inicializaMensajeria();
00124     QString finicial = m_fechainicial->text();
00125     QString ffinal = m_fechafinal->text();
00126 
00127     setFInicial(finicial);
00128     setFFinal(ffinal);
00129     if (m_test->isChecked() ) {
00130         setModoTest();
00131     } // end if
00132     if (m_XML->text() != "") {
00133         QFile filexml (m_XML->text());
00134         filexml.open(QIODevice::WriteOnly);
00135         bulmafact2XML(filexml);
00136         filexml.close();
00137     } // end if
00138     m_mensajes->setText("");
00139     _depura("END ImportExportBulmafactView::botonExportar", 0);
00140 }
00141 

Generated on Sat Dec 15 00:01:15 2007 for BulmaGes by  doxygen 1.5.1