From 813b5f28d09257f94234e20c5926ae572932b892 Mon Sep 17 00:00:00 2001 From: Bastian Wissler Date: Wed, 8 Oct 2008 21:10:38 +0000 Subject: vmchooser: * fixed plugin option slx group / * now it should be set using slxos-plugin... git-svn-id: http://svn.openslx.org/svn/openslx/openslx-src-tools/vmchooser/trunk@2273 95ad53e4-c205-0410-b2fa-d234c58c8868 --- vmchooser/Makefile | 6 +++++- vmchooser/SWindow.cxx | 38 ++++++++++++++++++-------------------- vmchooser/inc/anyoption.h | 2 +- vmchooser/main.cxx | 30 +++++++++++++++++------------- vmchooser/readLinSess.cxx | 1 + vmchooser/readXmlDir.cxx | 1 + 6 files changed, 43 insertions(+), 35 deletions(-) diff --git a/vmchooser/Makefile b/vmchooser/Makefile index 19aa6ba..e1ce821 100644 --- a/vmchooser/Makefile +++ b/vmchooser/Makefile @@ -5,7 +5,8 @@ DEPS := ${SRCS:.cxx=.dep} XDEPS := $(wildcard ${DEPS}) CC = g++ -CCFLAGS = -O2 -Wall -I/usr/include -I../fltk-2/include/ -I. `xml2-config --cflags` #-ggdb #-Werror +DEBUG_CCFLAGS = -O0 -Wall -I/usr/include -I../fltk-2/include/ -I. `xml2-config --cflags` -ggdb #-ggdb #-Werror +CCFLAGS = -O2 -Wall -I/usr/include -I../fltk-2/include/ -I. `xml2-config --cflags` LDFLAGS = -L../fltk-2/lib/ -L/usr/lib LIBS = -lpng ../fltk-2/lib/libfltk2_images.a -ljpeg -lz -lXi -lXinerama -lpthread -lm -lXext -lsupc++ -lXrender -lfontconfig -lxml2 -lXft -lXdmcp -lXau -ldl -lz -lfreetype -lX11 ../fltk-2/lib/libfltk2.a /usr/lib/libboost_regex.a @@ -20,6 +21,9 @@ ${TARGET}: ${OBJS} ${CC} ${LDFLAGS} -o $@ $^ ${LIBS} strip $@ +debug: ${OBJS} + ${CC} ${LDFLAGS} -o vmchooserdbg $^ ${LIBS} + ${OBJS}: %.o: %.cxx %.dep ${CC} ${CCFLAGS} -o $@ -c $< diff --git a/vmchooser/SWindow.cxx b/vmchooser/SWindow.cxx index bef9760..40b0402 100644 --- a/vmchooser/SWindow.cxx +++ b/vmchooser/SWindow.cxx @@ -109,7 +109,7 @@ void SWindow::cb_select() /********************************************************** * Put entries in a Linux-Session Group into Browser *********************************************************/ -void SWindow::set_lin_entries(DataEntry** ent, char* slxgroup) +void SWindow::set_lin_entries(DataEntry** ent) { this->lin_ent = ent; lin_entgroup = (ItemGroup*) sel.add_group("LINUX DESKTOP", &sel); @@ -120,15 +120,14 @@ void SWindow::set_lin_entries(DataEntry** ent, char* slxgroup) } map::iterator it= mapEntry.begin(); for(;it!=mapEntry.end(); it++) { - if( it->second->pools.empty() || it->second->pools.find(slxgroup) != string::npos) { - Item* w= (Item*)sel.add_leaf(it->second->short_description.c_str() , lin_entgroup, (void*)it->second ); - - xpmImage* xpm = new xpmImage(get_symbol(it->second)); - ((Widget*) w)->image(xpm); - w->tooltip(it->second->description.c_str()); - w->callback(&runImage, (void*)it->second); - } - } + Item* w= (Item*)sel.add_leaf(it->second->short_description.c_str() , lin_entgroup, (void*)it->second ); + + xpmImage* xpm = new xpmImage(get_symbol(it->second)); + ((Widget*) w)->image(xpm); + w->tooltip(it->second->description.c_str()); + w->callback(&runImage, (void*)it->second); + + } lin_entgroup->end(); } @@ -136,23 +135,22 @@ void SWindow::set_lin_entries(DataEntry** ent, char* slxgroup) /********************************************************** * Put entries in a VMWARE-Session Group into Browser *********************************************************/ -void SWindow::set_entries(DataEntry** ent, char* slxgroup) +void SWindow::set_entries(DataEntry** ent) { this->ent = ent; sort_entries(); entgroup = (ItemGroup*)sel.add_group("VMWARE SESSIONS", &sel); for (int i=0; ent[i] != NULL; i++) - { - if(ent[i]->pools.empty() || ent[i]->pools.find(slxgroup) != string::npos) { - Item* w= (Item*)sel.add_leaf(ent[i]->short_description.c_str(), entgroup, (void*)ent[i] ); + { + Item* w= (Item*)sel.add_leaf(ent[i]->short_description.c_str(), entgroup, (void*)ent[i] ); - xpmImage* xpm = new xpmImage(get_symbol(ent[i])); - ((Widget*) w)->image(xpm); - w->tooltip(ent[i]->description.c_str()); - w->callback(&runImage, (void*)ent[i]); - } - } + xpmImage* xpm = new xpmImage(get_symbol(ent[i])); + ((Widget*) w)->image(xpm); + w->tooltip(ent[i]->description.c_str()); + w->callback(&runImage, (void*)ent[i]); + + } entgroup->end(); } diff --git a/vmchooser/inc/anyoption.h b/vmchooser/inc/anyoption.h index 3f7a5de..13a4a18 100644 --- a/vmchooser/inc/anyoption.h +++ b/vmchooser/inc/anyoption.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #define COMMON_OPT 1 #define COMMAND_OPT 2 diff --git a/vmchooser/main.cxx b/vmchooser/main.cxx index 3d6ff45..e941d53 100644 --- a/vmchooser/main.cxx +++ b/vmchooser/main.cxx @@ -25,7 +25,7 @@ using namespace fltk; int main(int argc, char** argv) { AnyOption* opt = new AnyOption(); char* xmlpath = NULL; - char* slxgroup = NULL; + //char* slxgroup = NULL; char* lsesspath = NULL; int width=0, height=0; @@ -67,16 +67,20 @@ int main(int argc, char** argv) { xmlpath = (char *) "/var/lib/vmware/vmconfigs/"; } - /** SLX GROUP */ - if(opt->getValue('g')!=NULL) { - slxgroup = opt->getValue('g'); - } - if(opt->getValue("group")!= NULL) { - slxgroup = opt->getValue("group"); - } - if (slxgroup == NULL) { - slxgroup = (char *) "default"; - } + /** SLX GROUP - OBSOLETE */ + /** NOW THE SLX GROUP SHOULD BE SET THROUGH THE PLUGIN OPTIONS */ + //if(opt->getValue('g')!=NULL) { + // slxgroup = opt->getValue('g'); + //} + // + //if(opt->getValue("group")!= NULL) { + // slxgroup = opt->getValue("group"); + //} + //if (slxgroup == NULL) { + // // there should be a generic way to handle these groups + // slxgroup = (char *) "default"; + //} + /** OBSOLETE */ /** LINUX SESSION PATH */ if(opt->getValue('l')!=NULL) { @@ -130,10 +134,10 @@ int main(int argc, char** argv) { SWindow& win = *SWindow::getInstance(width, height); if(lsessions[0] != NULL) { - win.set_lin_entries(lsessions, slxgroup); + win.set_lin_entries(lsessions); } if (sessions[0] != NULL) { - win.set_entries(sessions, slxgroup); + win.set_entries(sessions); } //cout << win.pname << endl; diff --git a/vmchooser/readLinSess.cxx b/vmchooser/readLinSess.cxx index eeec4e1..5591797 100644 --- a/vmchooser/readLinSess.cxx +++ b/vmchooser/readLinSess.cxx @@ -13,6 +13,7 @@ #include #include +#include #include "inc/DataEntry.h" #include "inc/functions.h" diff --git a/vmchooser/readXmlDir.cxx b/vmchooser/readXmlDir.cxx index f53a475..989032e 100644 --- a/vmchooser/readXmlDir.cxx +++ b/vmchooser/readXmlDir.cxx @@ -14,6 +14,7 @@ #include +#include #include #include -- cgit v1.2.3-55-g7522