diff options
| author | Bastian Wissler | 2008-09-25 20:21:34 +0200 |
|---|---|---|
| committer | Bastian Wissler | 2008-09-25 20:21:34 +0200 |
| commit | 2f5dedf40316fc2b29b950dfc18208c8fbee3c72 (patch) | |
| tree | 3dbc0301881a9ced173509c3cecb4fd2fa5854fe | |
| parent | vmchooser-src-changes (diff) | |
| download | vmchooser-2f5dedf40316fc2b29b950dfc18208c8fbee3c72.tar.gz vmchooser-2f5dedf40316fc2b29b950dfc18208c8fbee3c72.tar.xz vmchooser-2f5dedf40316fc2b29b950dfc18208c8fbee3c72.zip | |
vmchooser extension:
* changed sorting of linux session
-> now they are sorted alphabetically
git-svn-id: http://svn.openslx.org/svn/openslx/openslx-src-tools/vmchooser/trunk@2246 95ad53e4-c205-0410-b2fa-d234c58c8868
| -rw-r--r-- | vmchooser/SWindow.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/vmchooser/SWindow.cxx b/vmchooser/SWindow.cxx index 247231e..e3e7fd1 100644 --- a/vmchooser/SWindow.cxx +++ b/vmchooser/SWindow.cxx @@ -2,6 +2,7 @@ #include "inc/SWindow.h" #include <iostream> +#include <map> #include <img/gnome_32.xpm> #include <img/kde_32.xpm> @@ -111,16 +112,20 @@ void SWindow::set_lin_entries(DataEntry** ent, char* slxgroup) { this->lin_ent = ent; lin_entgroup = (ItemGroup*) sel.add_group("LINUX DESKTOP", &sel); - + map<string, DataEntry*> mapEntry; 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() , lin_entgroup, (void*)ent[i] ); + { + mapEntry.insert(make_pair(ent[i]->short_description, ent[i])); + } + 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(ent[i])); + xpmImage* xpm = new xpmImage(get_symbol(it->second)); ((Widget*) w)->image(xpm); - w->tooltip(ent[i]->description.c_str()); - w->callback(&runImage, (void*)ent[i]); + w->tooltip(it->second->description.c_str()); + w->callback(&runImage, (void*)it->second); } } lin_entgroup->end(); |
