00001 #include <stdio.h>
00002 #include "pluginonline.h"
00003 #include "empresa.h"
00004
00005 #include <q3popupmenu.h>
00006 #include <qaction.h>
00007 #include <qobject.h>
00008 #include <qmessagebox.h>
00009
00010
00011 myplugin:: myplugin() {}
00012 myplugin::~myplugin() {}
00013
00014
00015 void myplugin::elslot() {
00016 char *args[]={"http://www.iglues.org/documentacion.php","http://www.iglues.org/documentacion.php",NULL};
00017 int pid;
00018 int error;
00019 #ifndef WIN32
00020 if ((pid=fork()) < 0) {
00021 perror ("Fork failed");
00022 exit(errno);
00023 }
00024 if (!pid) {
00025 error = execvp(confpr->valor(CONF_NAVEGADOR).ascii(),args);
00026 }
00027 #endif
00028 }
00029
00030 void myplugin::soporte() {
00031 char *args[]={"http://www.iglues.org/soporte.php","http://www.iglues.org/soporte.php",NULL};
00032 int pid;
00033 int error;
00034 #ifndef WIN32
00035 if ((pid=fork()) < 0) {
00036 perror ("Fork failed");
00037 exit(errno);
00038 }
00039 if (!pid) {
00040 error = execvp(confpr->valor(CONF_NAVEGADOR).ascii(),args);
00041 }
00042 #endif
00043 }
00044
00045
00046 void myplugin::inicializa(Bulmages01 *bges) {
00047
00048
00049 QAction *planCuentas = new QAction("&Ayuda On-Line", 0);
00050 planCuentas->setStatusTip("Ayuda a traves de Internet");
00051 planCuentas->setWhatsThis("Ayuda a traves de Internet");
00052
00053
00054 QAction *eSoporte = new QAction( "&Soporte Profesional", 0);
00055 eSoporte->setStatusTip("Encontrar empresas que dan soporte al programa");
00056 eSoporte->setWhatsThis("Encontrar empresas que dan soporte al programa");
00057 bges->pAyudaMenu()->insertSeparator();
00058 planCuentas->addTo(bges->pAyudaMenu());
00059 eSoporte->addTo(bges->pAyudaMenu());
00060 connect(planCuentas, SIGNAL(activated()), this, SLOT(elslot()));
00061 connect(eSoporte, SIGNAL(activated()), this, SLOT(soporte()));
00062 }
00063
00064
00065 void entryPoint(Bulmages01 *bges) {
00066 fprintf(stderr,"Estoy dentro del plugin\n");
00067 myplugin *plug= new myplugin( );
00068 plug->inicializa(bges);
00069 }
00070
00071
00072
00073