regivaqtoolbutton.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Arturo Martin Llado                             *
00003  *   amartin@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 <QWidget>
00022 #include "regivaqtoolbutton.h"
00023 #include "funcaux.h"
00024 
00025 
00026 #include <stdio.h>
00027 #include <stdlib.h>
00028 
00029 #include <QFile>
00030 #include <QTextStream>
00031 
00032 
00033 #include <QString>
00034 #include <QFileDialog>
00035 #include <QMap>
00036 #include <QList>
00037 #include "fixed.h"
00038 
00039 
00040 #include "asiento1view.h"
00041 #include "empresa.h"
00042 #include "dbrecord.h"
00043 #include "registroivaview.h"
00044 
00045 
00047 
00051 RegIVAQToolButton::RegIVAQToolButton(Asiento1View *as , QWidget *parent) : QToolButton(parent) {
00052     _depura("RegIVAQToolButton::RegIVAQToolButton", 0);
00053     m_asiento1View = as;
00054     setBoton();
00055     _depura("END RegIVAQToolButton::RegIVAQToolButton", 0);
00056 }
00057 
00058 
00060 
00062 RegIVAQToolButton::~RegIVAQToolButton() {
00063     _depura("RegIVAQToolButton::~RegIVAQToolButton", 0);
00064     _depura("END RegIVAQToolButton::~RegIVAQToolButton", 0);
00065 }
00066 
00067 
00069 
00071 void RegIVAQToolButton::setBoton() {
00072     _depura("RegIVAQToolButton::setBoton", 0);
00073     connect(this, SIGNAL(clicked()), this, SLOT(click()));
00074     setObjectName(QString::fromUtf8("exporta"));
00075     setStatusTip(tr("Registro de IVA"));
00076     setToolTip(tr("Registro de IVA"));
00077     setMinimumSize(QSize(32, 32));
00078     setIcon(QIcon(QString::fromUtf8(":/BulmaCont32x32/images/png/i_iva.xpm")));
00079     setIconSize(QSize(32, 32));
00080     _depura("END RegIVAQToolButton::setBoton", 0);
00081 }
00082 
00083 
00085 
00087 void RegIVAQToolButton::click() {
00088     _depura("ImpQToolButton::click", 0);
00089     ListLinAsiento1View *las = m_asiento1View->mui_list;
00090     las->guardar();
00091     try {
00092         int idborrador = las->DBvalue("idborrador").toInt();
00093         RegistroIvaView *nuevae = new RegistroIvaView((Empresa *) las->empresaBase(), 0);
00094         nuevae->inicializa1(idborrador);
00095         ((Empresa *)las->empresaBase())->pWorkspace()->addWindow(nuevae);
00096         nuevae->show();
00097     } catch (...) {
00098         mensajeInfo("Debe seleccionar un apunte");
00099     } // end try
00100 
00101     _depura("END ImpQToolButton::click", 0);
00102 }
00103 
00104 

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