plugin_tc_articulos.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Tomeu Borras Riera                              *
00003  *   tborras@conetxia.com                                                  *
00004  *   Copyright (C) 2006 by Fco. Javier M. C.                               *
00005  *   fcojavmc@todo-redes.com                                               *
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00021  ***************************************************************************/
00022 
00023 #include <QMenu>
00024 #include <QAction>
00025 #include <QObject>
00026 #include <QMessageBox>
00027 
00028 #include <stdio.h>
00029 
00030 #include "plugin_tc_articulos.h"
00031 #include "company.h"
00032 #include "funcaux.h"
00033 
00034 
00036 
00038 plugin_tc_articulos::plugin_tc_articulos() {
00039     _depura("plugin_tc_articulos::plugin_tc_articulos", 0);
00040     _depura("END plugin_tc_articulos::plugin_tc_articulos", 0);
00041 }
00042 
00043 
00045 
00047 plugin_tc_articulos::~plugin_tc_articulos() {
00048     _depura("plugin_tc_articulos::~plugin_tc_articulos", 0);
00049     _depura("END plugin_tc_articulos::~plugin_tc_articulos", 0);
00050 }
00051 
00052 
00054 
00056 void plugin_tc_articulos::tallas() {
00057     _depura("plugin_tc_articulos::tallas", 0);
00058     fprintf(stderr, "Sa ha activado tallas\n");
00059     QMessageBox::warning(0,
00060                          "Titulo de la ventana",
00061                          "Mensaje.",
00062                          QMessageBox::Ok,
00063                          QMessageBox::Cancel);
00064     _depura("END plugin_tc_articulos::tallas", 0);
00065 }
00066 
00067 
00069 
00071 void plugin_tc_articulos::colores() {
00072     _depura("plugin_tc_articulos::colores", 0);
00073     fprintf(stderr, "Sa ha activado colores\n");
00074     QMessageBox::warning(0,
00075                          "Titulo de la ventana",
00076                          "Mensaje.",
00077                          QMessageBox::Ok,
00078                          QMessageBox::Cancel);
00079     _depura("END plugin_tc_articulos::colores", 0);
00080 }
00081 
00082 
00084 
00087 void plugin_tc_articulos::inicializa(Bulmafact *bges) {
00088     _depura("plugin_tc_articulos::inicializa", 0);
00089     QMenu *pPluginMenuTallasColores;
00091     pPluginMenuTallasColores = bges->menuBar()->findChild<QMenu *>("Tallas y colores");
00092 
00094     if (!pPluginMenuTallasColores) {
00095         pPluginMenuTallasColores = new QMenu("&Tallas y colores", bges->menuBar());
00096         pPluginMenuTallasColores->setObjectName(QString::fromUtf8("Tallas y colores"));
00097     } // end if
00099 
00100     QAction *acciontallas = new QAction("&Tallas", 0);
00101     acciontallas->setStatusTip("Tallas");
00102     acciontallas->setWhatsThis("Tallas");
00103     connect(acciontallas, SIGNAL(activated()), this, SLOT(tallas()));
00104     pPluginMenuTallasColores->addAction(acciontallas);
00105 
00106     QAction *accioncolores = new QAction("&Colores", 0);
00107     accioncolores->setStatusTip("Colores");
00108     accioncolores->setWhatsThis("Colores");
00109     connect(accioncolores, SIGNAL(activated()), this, SLOT(colores()));
00110     pPluginMenuTallasColores->addAction(accioncolores);
00111 
00113     bges->menuBar()->insertMenu(bges->menuVentana->menuAction(), pPluginMenuTallasColores);
00114     _depura("END plugin_tc_articulos::inicializa", 0);
00115 }
00116 
00117 
00119 
00122 void entryPoint(Bulmafact *bges) {
00123     _depura("Estoy dentro del plugin de tallas y colores", 0);
00124     plugin_tc_articulos *plug = new plugin_tc_articulos();
00125     plug->inicializa(bges);
00126 }
00127 

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