plugincuadrante.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 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 <QMenu>
00022 #include <QAction>
00023 #include <QObject>
00024 #include <QMessageBox>
00025 #include <QInputDialog>
00026 #include <QStringList>
00027 #include <QTranslator>
00028 #include <QTextCodec>
00029 #include <QLocale>
00030 
00031 #include <stdio.h>
00032 
00033 #include "plugincuadrante.h"
00034 #include "company.h"
00035 #include "funcaux.h"
00036 #include "facturaview.h"
00037 #include "presupuestoview.h"
00038 #include "pedidoclienteview.h"
00039 #include "albaranclienteview.h"
00040 #include "pedidoproveedorview.h"
00041 #include "cuadranteview.h"
00042 
00043 
00045 
00047 myplugin4::myplugin4() {
00048     _depura("myplugin4::myplugin4", 0);
00049     _depura("END myplugin4::myplugin4", 0);
00050 }
00051 
00052 
00054 
00056 myplugin4::~myplugin4() {
00057     _depura("myplugin4::~myplugin4", 0);
00058     _depura("END myplugin4::~myplugin4", 0);
00059 }
00060 
00061 
00063 
00065 void myplugin4::elslot() {
00066     _depura("myplugin4::elslot", 0);
00067     CuadranteView *cuad = new CuadranteView((Company *)empresaBase(), 0);
00068     empresaBase()->pWorkspace()->addWindow(cuad);
00069     cuad->show();
00070     _depura("END myplugin4::elslot", 0);
00071 }
00072 
00073 
00075 
00078 void myplugin4::inicializa(Bulmafact *bges) {
00079     _depura("myplugin4::inicializa", 0);
00081     setEmpresaBase(bges->getcompany());
00082     m_bulmafact = bges;
00083     QMenu *pPluginMenu;
00085     pPluginMenu = bges->menuBar()->findChild<QMenu *>("Herramientas");
00086 
00088     if (!pPluginMenu) {
00089         pPluginMenu = new QMenu("&Herramientas", bges->menuBar());
00090         pPluginMenu->setObjectName(QString::fromUtf8("Herramientas"));
00091     } // end if
00092 
00093     QAction *accion = new QAction("&Cuadrantes", 0);
00094     accion->setStatusTip("Permite realizar Plannings Laborales");
00095     accion->setWhatsThis("Podra destinar los trabajadores a distintos almacenes");
00096     connect(accion, SIGNAL(activated()), this, SLOT(elslot()));
00097     pPluginMenu->addAction(accion);
00099     bges->menuBar()->insertMenu(bges->menuVentana->menuAction(), pPluginMenu);
00100     _depura("END myplugin4::inicializa", 0);
00101 }
00102 
00103 
00105 
00108 void entryPoint(Bulmafact *bges) {
00109     _depura("entryPoint", 0);
00111     QTranslator *traductor = new QTranslator(0);
00112     if (confpr->valor(CONF_TRADUCCION) == "locales") {
00113         traductor->load(QString("plugincuadrante_") + QLocale::system().name(),
00114                         confpr->valor(CONF_DIR_TRADUCCION).toAscii().constData());
00115     } else {
00116         QString archivo = "plugincuadrante_" + confpr->valor(CONF_TRADUCCION);
00117         traductor->load(archivo, confpr->valor(CONF_DIR_TRADUCCION).toAscii().constData());
00118     } // end if
00119     theApp->installTranslator(traductor);
00120 
00121     myplugin4 *plug = new myplugin4();
00122     plug->inicializa(bges);
00123     _depura("END entryPoint", 0);
00124 }
00125 
00126 
00128 
00132 int AlmacenView_AlmacenView(AlmacenView *alm) {
00133     _depura("esxtoy en la clase almacen", 0);
00134 
00135     alm->addDBCampo("aperturaalmacen", DBCampo::DBvarchar, DBCampo::DBNothing,  "Apertura Mañana");
00136     alm->addDBCampo("cierrealmacen", DBCampo::DBvarchar, DBCampo::DBNothing, "Cierre Mañana");
00137     alm->addDBCampo("apertura1almacen", DBCampo::DBvarchar, DBCampo::DBNothing,  "Apertura Tarde");
00138     alm->addDBCampo("cierre1almacen", DBCampo::DBvarchar, DBCampo::DBNothing, "Cierre Tarde");
00139 
00140 
00141 // ---------------
00143     QHBoxLayout *hboxLayout160 = new QHBoxLayout();
00144     hboxLayout160->setSpacing(2);
00145     hboxLayout160->setMargin(0);
00146     hboxLayout160->setObjectName(QString::fromUtf8("hboxLayout16"));
00147 
00149     QLabel *textLabel2_9_26 = new QLabel(alm->mui_frameplugin);
00150     textLabel2_9_26->setObjectName(QString::fromUtf8("textLabel2_9_2"));
00151     textLabel2_9_26->setText("Apertura Mañanas");
00152     hboxLayout160->addWidget(textLabel2_9_26);
00153 
00154     QLineEdit *horain = new QLineEdit(alm);
00155     horain->setObjectName("mui_aperturaalmacen");
00156     hboxLayout160->addWidget(horain);
00157 
00159     QLabel *textLabel2_9_27 = new QLabel(alm->mui_frameplugin);
00160     textLabel2_9_27->setText("Cierre Mañanas");
00161     hboxLayout160->addWidget(textLabel2_9_27);
00162 
00163     QLineEdit *horafin = new QLineEdit(alm);
00164     horafin->setObjectName("mui_cierrealmacen");
00165 
00166     hboxLayout160->addWidget(horafin);
00167 
00168 
00169 // ---------------
00170 
00171 // ---------------
00173     QHBoxLayout *hboxLayout170 = new QHBoxLayout();
00174     hboxLayout170->setSpacing(2);
00175     hboxLayout170->setMargin(0);
00176     hboxLayout170->setObjectName(QString::fromUtf8("hboxLayout17"));
00177 
00179     QLabel *textLabel2_9_28 = new QLabel(alm->mui_frameplugin);
00180     textLabel2_9_28->setText("Apertura Tardes");
00181     hboxLayout170->addWidget(textLabel2_9_28);
00182 
00183     QLineEdit *horaint = new QLineEdit(alm);
00184     horaint->setObjectName("mui_apertura1almacen");
00185     hboxLayout170->addWidget(horaint);
00186 
00188     QLabel *textLabel2_9_29 = new QLabel(alm->mui_frameplugin);
00189     textLabel2_9_29->setText("Cierre Tardes");
00190     hboxLayout170->addWidget(textLabel2_9_29);
00191 
00192     QLineEdit *horafint = new QLineEdit(alm);
00193     horafint->setObjectName("mui_cierre1almacen");
00194 
00195     hboxLayout170->addWidget(horafint);
00196 
00197 
00198 // ---------------
00199 
00200 
00202     QVBoxLayout *m_hboxLayout1 = alm->mui_frameplugin->findChild<QVBoxLayout *>("hboxLayout1");
00203     if (!m_hboxLayout1) {
00204         m_hboxLayout1 = new QVBoxLayout(alm->mui_frameplugin);
00205         m_hboxLayout1->setSpacing(0);
00206         m_hboxLayout1->setMargin(0);
00207         m_hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
00208     } // end if
00209 //       m_hboxLayout1->addWidget(horain);
00210     m_hboxLayout1->addLayout(hboxLayout160);
00211     m_hboxLayout1->addLayout(hboxLayout170);
00212     return 0;
00213 }
00214 
00215 
00217 
00221 int TrabajadorView_TrabajadorView(TrabajadorView *trab) {
00222     _depura("TrabajadorView_TrabajadorView", 0);
00223     SubForm2Bf *l = new SubForm2Bf(trab);
00224     l->setObjectName(QString::fromUtf8("m_ausencias"));
00225     l->setEmpresaBase( trab->empresaBase());
00226     l->setDBTableName("ausencia");
00227     l->setDBCampoId("idausencia");
00228     l->addSHeader("fechainausencia", DBCampo::DBvarchar, DBCampo::DBNothing , SHeader::DBNone, QApplication::translate("AlmacenView", "ID nom tipo Trabajo"));
00229     l->addSHeader("fechafinausencia", DBCampo::DBvarchar, DBCampo::DBNotNull, SHeader::DBNone , QApplication::translate("AlmacenView", "Numero de Cargos Necesarios"));
00230     l->addSHeader("motivoausencia", DBCampo::DBvarchar, DBCampo::DBNothing, SHeader::DBNone , QApplication::translate("AlmacenView", "Numero de Cargos Necesarios"));
00231     l->addSHeader("idausencia", DBCampo::DBint, DBCampo::DBPrimaryKey, SHeader::DBNoView | SHeader::DBNoWrite, QApplication::translate("AlmacenView", "ID almacen"));
00232     l->addSHeader("idtrabajador", DBCampo::DBint, DBCampo::DBNotNull, SHeader::DBNoView | SHeader::DBNoWrite, QApplication::translate("AlmacenView", "ID tipo Trabajo"));
00233     l->setinsercion(TRUE);
00234     l->setDelete(TRUE);
00235     l->setSortingEnabled(FALSE);
00236     trab->mui_tab->addTab(l, "Ausencias");
00237     trab->dialogChanges_setQObjectExcluido(l->mui_list);
00238 
00239     _depura("END TrabajadorView_TrabajadorView", 0);
00240     return 0;
00241 }
00242 
00243 
00245 
00249 int TrabajadorView_on_mui_lista_currentItemChanged_Post(TrabajadorView *trab)  {
00250     _depura("TrabajadorView_on_mui_lista_currentItemChanged_Post", 0);
00251     SubForm2Bf *l = trab->findChild<SubForm2Bf *>("m_ausencias");
00252     l->cargar("SELECT * FROM ausencia WHERE idtrabajador = " + trab->idtrabajador());
00253     _depura("END TrabajadorView_on_mui_lista_currentItemChanged_Post", 0);
00254     return 0;
00255 }
00256 
00257 
00259 
00263 int TrabajadorView_on_mui_guardar_clicked(TrabajadorView *trab) {
00264     SubForm2Bf *l = trab->findChild<SubForm2Bf *>("m_ausencias");
00265     l->setColumnValue("idtrabajador", trab->idtrabajador());
00266     l->guardar();
00267     return 0;
00268 }
00269 
00270 
00271 

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