summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBastian Wissler2008-10-08 23:10:38 +0200
committerBastian Wissler2008-10-08 23:10:38 +0200
commit813b5f28d09257f94234e20c5926ae572932b892 (patch)
tree63d420871614fb924caaedc1eb9fc1300da536e0
parentvmchooser bugfix: (diff)
downloadvmchooser-813b5f28d09257f94234e20c5926ae572932b892.tar.gz
vmchooser-813b5f28d09257f94234e20c5926ae572932b892.tar.xz
vmchooser-813b5f28d09257f94234e20c5926ae572932b892.zip
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
-rw-r--r--vmchooser/Makefile6
-rw-r--r--vmchooser/SWindow.cxx38
-rw-r--r--vmchooser/inc/anyoption.h2
-rw-r--r--vmchooser/main.cxx30
-rw-r--r--vmchooser/readLinSess.cxx1
-rw-r--r--vmchooser/readXmlDir.cxx1
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<string, DataEntry*>::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 <iostream>
#include <fstream>
#include <stdlib.h>
-#include <string>
+#include <cstring>
#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 <fstream>
#include <iostream>
+#include <cstring>
#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 <boost/regex.hpp>
+#include <cstring>
#include <vector>
#include <iostream>