empresabase.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Tomeu Borras Riera                              *
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 "empresabase.h"
00022 #include "funcaux.h"
00023 
00024 #include "abreempresaview.h"
00025 #include "paisview.h"
00026 
00027 
00029 
00032 void EmpresaBase::setListVentanas(listventanas *doc) {
00033     _depura("EmpresaBase::setListVentanas", 0);
00034     m_listventanas = doc;
00035     _depura("END EmpresaBase::setListVentanas", 0);
00036 }
00037 
00038 
00040 
00043 QWorkspace2 *EmpresaBase::pWorkspace() {
00044     _depura("EmpresaBase::pWorkspace", 0);
00045     _depura("END EmpresaBase::pWorkspace", 0);
00046     return m_pWorkspace;
00047 }
00048 
00049 
00051 
00054 void EmpresaBase::setWorkspace(QWorkspace2 *qw) {
00055     _depura("EmpresaBase::setWorkspace", 0);
00056     m_pWorkspace = qw;
00057     _depura("END EmpresaBase::setWorkspace", 0);
00058 }
00059 
00060 
00062 
00065 void EmpresaBase::setProgressBar(QProgressBar *pb) {
00066     _depura("EmpresaBase::setProgressBar", 0);
00067     m_progressbar = pb;
00068     _depura("END EmpresaBase::setProgressBar", 0);
00069 }
00070 
00071 
00073 
00079 int EmpresaBase::meteWindow(QString nom, QObject *obj, bool compdup) {
00080     _depura("EmpresaBase::meteWindow", 0);
00081     _depura("END EmpresaBase::meteWindow", 0);
00082     return m_listventanas->meteWindow(nom, obj, compdup);
00083 }
00084 
00085 
00087 
00092 int EmpresaBase::seleccionaWindow(QString nom, QObject *obj) {
00093     _depura("EmpresaBase::seleccionaWindow", 0);
00094     _depura("END EmpresaBase::seleccionaWindow", 0);
00095     return m_listventanas->seleccionaWindow(nom, obj);
00096 }
00097 
00098 
00100 
00103 int EmpresaBase::deSeleccionaWindow() {
00104     _depura("EmpresaBase::deSeleccionaWindow", 0);
00105     _depura("END EmpresaBase::deSeleccionaWindow", 0);
00106     return m_listventanas->deSeleccionaWindow();
00107 }
00108 
00109 
00111 
00114 void EmpresaBase::sacaWindow(QObject *nom) {
00115     _depura("EmpresaBase::sacaWindow", 0);
00116     m_listventanas->sacaWindow(nom);
00117     _depura("END EmpresaBase::sacaWindow", 0);
00118 }
00119 
00120 
00122 
00124 EmpresaBase::EmpresaBase() {
00125     _depura("EmpresaBase::EmpresaBase", 0);
00126     _depura("END EmpresaBase::EmpresaBase", 0);
00127 }
00128 
00129 
00131 
00133 EmpresaBase::~EmpresaBase() {
00134     _depura("EmpresaBase::~EmpresaBase", 0);
00136     m_listventanas->vaciar();
00138     _depura("END EmpresaBase::~EmpresaBase", 0);
00139 }
00140 
00141 
00144 
00148 void EmpresaBase::init(QString bd, QString tipo) {
00149     _depura("EmpresaBase::init", 0);
00150     if (bd == "") {
00151         bd = searchCompany(tipo);
00152     } // end if
00155     m_progressbar->setVisible(TRUE);
00156 
00157     inicializa(bd);
00158     _depura("END EmpresaBase::init", 0);
00159 }
00160 
00161 
00165 
00169 QString EmpresaBase::searchCompany(QString tipo) {
00171     _depura("EmpresaBase::searchCompany", 0);
00172     abreempresaview *nuevae = new abreempresaview(0, tipo);
00173     nuevae->exec();
00174     _depura("Vamos a cambiar la empresa", 0);
00175     QString bd = nuevae->nomDB();
00176     _depura("Empresa cambiada a " + bd, 0);
00177     delete nuevae;
00179     if (bd == "") {
00180         exit(1);
00181     } // end if
00182     _depura("END EmpresaBase::searchCompany", 0);
00183     return bd;
00184 }
00185 
00186 
00188 
00191 void EmpresaBase::s_indexadorCambiaEstado(bool visible) {
00192     _depura("EmpresaBase::s_indexadorCambiaEstado", 0);
00193     m_listventanas->cambiaVisible(visible);
00194     _depura("END EmpresaBase::s_indexadorCambiaEstado", 0);
00195 }
00196 
00197 
00199 
00201 void EmpresaBase::muestraPaises() {
00202     _depura("EmpresaBase::muestrapaises", 0);
00203     PaisView *pais = new PaisView(this, 0);
00204     m_pWorkspace->addWindow(pais);
00205     pais->show();
00206     _depura("END EmpresaBase::muestrapaises", 0);
00207 }
00208 

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