Show
Ignore:
Timestamp:
08/06/08 19:52:38 (5 months ago)
Author:
mariodebian
Message:

tcosmonitor (0.2.16~rc3)

  • New class: TcosListView?.py:
    • Move some code from TcosActions?.py (code to work with list view mode)
  • New class: TcosMenus?.py:
    • Move some code from TcosActions?.py to generate menus and capture events
  • Delete deprecated and comented gtk.gdk.threads_*() calls
  • Update template and spanish translation
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tcosmonitor/TcosActions.py

    r931 r944  
    5353        print_debug ( "__init__()" ) 
    5454        self.main=main 
    55         self.model=self.main.init.model 
     55        #self.model=self.main.init.model 
    5656        #self.main.progressstop_args={} 
    5757 
     
    101101        print_debug ( "on_another_screenshot_button_click() __init__ ip=%s" %(ip) ) 
    102102        self.main.worker=shared.Workers(self.main, target=self.get_screenshot, args=[ip]) 
    103         self.main.worker.start()    
    104      
    105     def on_rightclickmenuone_click(self, menu, number): 
    106         print_debug ( "on_rightclickmenuone_click() => onehost_menuitems[%d]=%s" \ 
    107                         % (number, shared.onehost_menuitems[number][0]) ) 
    108         self.menu_event_one(number) 
     103        self.main.worker.start() 
    109104 
    110105    def on_allhostbutton_click(self, widget): 
     
    113108        self.main.allmenu.popup( None, None, None, event.button, event.time) 
    114109        return True 
    115  
    116     def on_rightclickmenuall_click(self, menu, number): 
    117         print_debug ( "on_rightclickmenuall_click() => allhost_menuitems[%d]=%s" \ 
    118                         % (number, shared.allhost_menuitems[number][0]) ) 
    119         self.menu_event_all(number) 
    120110 
    121111    def on_preferencesbutton_click(self,widget): 
     
    173163            if len(allclients) == 0: 
    174164                self.main.write_into_statusbar ( _("Not connected hosts found.") ) 
    175                 # clean treeview 
    176                 model=self.main.tabla.get_model() 
    177                 model.clear() 
     165                # clean icons and files 
     166                self.main.listview.clear() 
    178167                self.main.iconview.clear() 
    179168                self.main.classview.clear() 
     
    230219        return self.main.updating 
    231220 
    232  
    233     def on_hostlist_click(self, hostlist): 
    234         if self.main.worker_running: 
    235             return 
    236          
    237         self.main.progressbar.hide() 
    238         (model, iter) = hostlist.get_selected() 
    239         if not iter: 
    240             return 
    241         self.main.selected_host=model.get_value(iter,COL_HOST) 
    242         self.main.selected_ip=model.get_value(iter, COL_IP) 
    243          
    244         print_debug ( "on_hostlist_clic() selectedhost=%s selectedip=%s" \ 
    245             %(self.main.selected_host, self.main.selected_ip) ) 
    246              
    247         # call to read remote info 
    248         #self.main.localdata.newhost(self.main.selected_ip) 
    249         self.main.xmlrpc.newhost(self.main.selected_ip) 
    250         self.main.xmlrpc.ip=self.main.selected_ip 
    251         if not self.main.xmlrpc.isPortListening(self.main.selected_ip, self.main.xmlrpc.lastport): 
    252             print_debug ( "on_host_list_click() XMLRPC not running in %s" %(self.main.selected_ip) ) 
    253             self.main.write_into_statusbar ( _("Error connecting to tcosxmlrpc in %s") %(self.main.selected_ip) ) 
    254             return 
    255          
    256         print_debug ( "on_host_list_click() AUTH OK" ) 
    257          
    258         self.main.write_into_statusbar ( "" ) 
    259         print_debug ( "on_hostlist_click() callig worker to populate in Thread" ) 
    260          
    261         self.main.worker=shared.Workers( self.main,\ 
    262                      target=self.populate_datatxt, args=([self.main.selected_ip]) ).start() 
    263          
    264         return 
    265221         
    266222    def askwindow_close(self, widget, event): 
     
    514470         
    515471        # print into statusbar 
    516         #gtk.gdk.threads_enter() 
    517472        self.main.common.threads_enter("TcosActions:populate_datatxt show progressbar") 
    518473         
    519         if shared.disable_textview_on_update: self.main.tabla.set_sensitive(False) 
     474        if shared.disable_textview_on_update and self.main.iconview.isactive(): 
     475            self.main.tabla.set_sensitive(True) 
    520476         
    521477        #self.main.write_into_statusbar( _("Connecting with %s to retrieve some info..."  ) %(ip) ) 
     
    524480        #self.main.progressbutton.show() 
    525481        self.set_progressbar( _("Connecting with %s to retrieve some info..."  ) %(ip) , 0 ,show_percent=False) 
    526         #gtk.gdk.threads_leave() 
     482         
    527483        self.main.common.threads_leave("TcosActions:populate_datatxt show progressbar") 
    528484         
     
    758714                    try: 
    759715                        (key,value)=data.split('=') 
    760                     except: 
     716                    except Exception, err: 
     717                        print_debug("populate_datatxt() Exception spliting data=%s, err=%s"%(data,err)) 
    761718                        key=data 
    762719                        value="" 
     
    844801                    try: 
    845802                        value=float(value) 
    846                     except: 
     803                    except Exception, err: 
     804                        print_debug("populate_datatxt() Exception getting volume=%s, err=%s"%(value,err) ) 
    847805                        value=0.0 
    848806                     
     
    945903                self.datatxt.insert_block ( _("Sound server is not running"), image=shared.IMG_DIR + "info_sound_ko.png") 
    946904         
    947         #gtk.gdk.threads_enter() 
    948905        self.main.common.threads_enter("TcosActions:populate_datatxt end") 
    949906        self.datatxt.display() 
     
    951908        self.main.progressbar.hide() 
    952909         
    953         if shared.disable_textview_on_update: self.main.tabla.set_sensitive(True) 
    954          
    955         #gtk.gdk.threads_leave() 
     910        if shared.disable_textview_on_update and self.main.iconview.isactive(): 
     911            self.main.tabla.set_sensitive(True) 
     912         
    956913        self.main.common.threads_leave("TcosActions:populate_datatxt end") 
    957914         
     
    999956        print_debug ( "populate_hostlist() clear list and start progressbar!!!" ) 
    1000957         
    1001         #gtk.gdk.threads_enter() 
    1002958        self.main.common.threads_enter("TcosActions:populate_hostlist show progressbar") 
    1003959         
    1004         if shared.disable_textview_on_update: self.main.tabla.set_sensitive(False) 
     960        if shared.disable_textview_on_update and self.main.iconview.isactive(): 
     961            self.main.tabla.set_sensitive(True) 
    1005962 
    1006963        #disable refresh button 
     
    1009966        self.main.progressbutton.show() 
    1010967        self.set_progressbar( _("Searching info of hosts..."), 0) 
    1011         self.model.clear() 
     968        if self.main.listview.isenabled(): 
     969            self.main.listview.clear() 
    1012970        if self.main.iconview.isenabled(): 
    1013                 self.main.iconview.clear() 
     971            self.main.iconview.clear() 
    1014972        if self.main.classview.isenabled(): 
    1015                 self.main.classview.clear() 
    1016         #gtk.gdk.threads_leave() 
     973            self.main.classview.clear() 
    1017974        self.main.common.threads_leave("TcosActions:populate_hostlist show progressbar") 
    1018975         
     
    1036993                    print_debug ( "populate_hostlist() WORKER IS STOPPED" ) 
    1037994                    break 
    1038             except: 
     995            except Exception, err: 
     996                print_debug("populate_hostlist() can't read worker status, error=%s"%err) 
    1039997                pass 
    1040998            i += 1 
    1041             #gtk.gdk.threads_enter() 
    1042999            self.main.common.threads_enter("TcosActions:populate_hostlist show connecting") 
    10431000            self.main.progressbar.show() 
    1044             self.set_progressbar( _("Connecting to %s...") \ 
    1045                             %(host), float(i)/float(len(clients)) ) 
    1046             #gtk.gdk.threads_leave() 
     1001            self.set_progressbar( _("Connecting to %s...") %(host), float(i)/float(len(clients)) ) 
    10471002            self.main.common.threads_leave("TcosActions:populate_hostlist show connecting") 
    10481003             
     
    10511006            self.main.xmlrpc.newhost (host) 
    10521007             
    1053             ip=host 
    1054             standalone=False 
    1055             logged=False 
     1008            data={} 
     1009            data['host']=host 
     1010            data['ip']=host 
     1011            data['standalone']=False 
     1012            data['logged']=False 
    10561013            print_debug("populate_hostlist() => get username") 
    1057             username=self.main.localdata.GetUsername(ip) 
     1014            data['username']=self.main.localdata.GetUsername(data['ip']) 
    10581015             
    10591016            if shared.dont_show_users_in_group != None: 
    1060                 if self.main.xmlrpc.IsStandalone(ip): 
     1017                if self.main.xmlrpc.IsStandalone(data['ip']): 
    10611018                    groupexclude=self.main.xmlrpc.GetStandalone("get_exclude", shared.dont_show_users_in_group) 
    10621019                else: 
    1063                     groupexclude=self.main.localdata.isExclude(ip, shared.dont_show_users_in_group) 
     1020                    groupexclude=self.main.localdata.isExclude(data['ip'], shared.dont_show_users_in_group) 
    10641021             
    10651022                if groupexclude:  
    1066                     print_debug("Host %s excluded, blacklisted by group" %ip) 
     1023                    print_debug("Host %s excluded, blacklisted by group" %data['ip']) 
    10671024                    continue 
    10681025             
    10691026            print_debug("populate_hostlist() => get hostname") 
    1070             hostname=self.main.localdata.GetHostname(ip) 
    1071              
    1072             if username.startswith('error: tcos-last'): 
    1073                 username="---" 
     1027            data['hostname']=self.main.localdata.GetHostname(data['ip']) 
     1028             
     1029            if data['username'].startswith('error: tcos-last'): 
     1030                data['username']="---" 
    10741031             
    10751032            try: 
    10761033                print_debug("populate_hostlist() => get num process") 
    1077                 num_process=self.main.localdata.GetNumProcess(ip) 
    1078             except: 
    1079                 num_process="---" 
     1034                data['num_process']=self.main.localdata.GetNumProcess(data['ip']) 
     1035            except Exception, err: 
     1036                print_debug("populate_hostlist() Exception getting num process, error=%s"%err) 
     1037                data['num_process']="---" 
    10801038             
    10811039            print_debug("populate_hostlist() => get time logged") 
    1082             if self.main.xmlrpc.IsStandalone(ip): 
    1083                 time_logged=self.main.xmlrpc.GetStandalone("get_time") 
    1084                 standalone=True 
     1040            if self.main.xmlrpc.IsStandalone(data['ip']): 
     1041                data['time_logged']=self.main.xmlrpc.GetStandalone("get_time") 
     1042                data['standalone']=True 
    10851043            else: 
    1086                 time_logged=self.main.localdata.GetTimeLogged(ip) 
    1087                 standalone=False 
    1088              
    1089             if not time_logged or time_logged == "" or time_logged.startswith('error: tcos-last'): 
    1090                 time_logged="---" 
     1044                data['time_logged']=self.main.localdata.GetTimeLogged(data['ip']) 
     1045                data['standalone']=False 
     1046             
     1047            if not data['time_logged'] or data['time_logged'] == "" or data['time_logged'].startswith('error: tcos-last'): 
     1048                data['time_logged']="---" 
    10911049             
    10921050            print_debug("populate_hostlist() => get active connection") 
    1093             if self.main.localdata.IsActive(ip): 
     1051            if self.main.localdata.IsActive(data['ip']): 
     1052                data['active']=True 
    10941053                if self.main.xmlrpc.sslconnection: 
    1095                     image_active=active_ssl_image 
     1054                    data['image_active']=active_ssl_image 
    10961055                else: 
    1097                     image_active=active_image 
     1056                    data['image_active']=active_image 
    10981057            else: 
    1099                 image_active=inactive_image 
     1058                data['image_active']=inactive_image 
     1059                data['active']=False 
    11001060             
    11011061            print_debug("populate_hostlist() => get is logged") 
    1102             if self.main.localdata.IsLogged(ip): 
    1103                 image_logged=logged_image 
    1104                 logged=True 
     1062            if self.main.localdata.IsLogged(data['ip']): 
     1063                data['image_logged']=logged_image 
     1064                data['logged']=True 
    11051065            else: 
    1106                 image_logged=unlogged_image 
    1107                 logged=False 
     1066                data['image_logged']=unlogged_image 
     1067                data['logged']=False 
    11081068             
    11091069            print_debug("populate_hostlist() => get is blocked") 
    1110             if self.main.localdata.IsBlocked(host): 
    1111                 blocked_screen=True 
     1070            if self.main.localdata.IsBlocked(data['ip']): 
     1071                data['blocked_screen']=True 
    11121072            else: 
    1113                 blocked_screen=False 
     1073                data['blocked_screen']=False 
    11141074             
    11151075            print_debug("populate_hostlist() => get is blocked net") 
    1116             if self.main.localdata.IsBlockedNet(host,username): 
    1117                 blocked_net=True 
     1076            if self.main.localdata.IsBlockedNet(host,data['username']): 
     1077                data['blocked_net']=True 
    11181078            else: 
    1119                 blocked_net=False 
    1120                  
    1121             if blocked_screen and blocked_net: 
    1122                 image_blocked=locked_net_screen_image 
    1123             elif blocked_screen == False and blocked_net: 
    1124                 image_blocked=locked_net_image 
    1125             elif blocked_screen and blocked_net == False: 
    1126                 image_blocked=locked_image 
     1079                data['blocked_net']=False 
     1080                 
     1081            if data['blocked_screen'] and data['blocked_net']: 
     1082                data['image_blocked']=locked_net_screen_image 
     1083            elif data['blocked_screen'] == False and data['blocked_net']: 
     1084                data['image_blocked']=locked_net_image 
     1085            elif data['blocked_screen'] and data['blocked_net'] == False: 
     1086                data['image_blocked']=locked_image 
    11271087            else: 
    1128                 image_blocked=unlocked_image 
    1129              
    1130             data={'ip':ip, 'hostname':hostname, 'host':host,  
    1131                       'standalone':standalone, 'username':username, 
    1132                       'blocked_screen':blocked_screen, 'blocked_net': blocked_net, 
    1133                       'logged':logged, 'time_logged':time_logged} 
     1088                data['image_blocked']=unlocked_image 
     1089             
     1090             
     1091            if self.main.listview.isactive(): 
     1092                self.main.common.threads_enter("TcosActions:populate_hostlist LIST generate_icon") 
     1093                self.main.listview.generate_file(data) 
     1094                self.main.common.threads_leave("TcosActions:populate_hostlist LIST generate_icon") 
    11341095             
    11351096            if self.main.iconview.isactive(): 
     
    11371098                self.main.iconview.generate_icon(data) 
    11381099                self.main.common.threads_leave("TcosActions:populate_hostlist ICON generate_icon") 
    1139                  
     1100             
    11401101            if self.main.classview.isactive(): 
    11411102                self.main.common.threads_enter("TcosActions:populate_hostlist CLASS generate_icon") 
     
    11431104                self.main.common.threads_leave("TcosActions:populate_hostlist CLASS generate_icon") 
    11441105             
    1145             #gtk.gdk.threads_enter() 
    1146             self.main.common.threads_enter("TcosActions:populate_hostlist print data") 
    1147             self.iter = self.model.append (None) 
    1148             self.model.set_value (self.iter, COL_HOST, hostname ) 
    1149             self.model.set_value (self.iter, COL_IP, host ) 
    1150             self.model.set_value (self.iter, COL_USERNAME, username ) 
    1151             self.model.set_value (self.iter, COL_ACTIVE, image_active ) 
    1152             self.model.set_value (self.iter, COL_LOGGED, image_logged) 
    1153             self.model.set_value (self.iter, COL_BLOCKED, image_blocked) 
    1154             self.model.set_value (self.iter, COL_PROCESS, num_process ) 
    1155             self.model.set_value (self.iter, COL_TIME, time_logged) 
    1156             #gtk.gdk.threads_leave() 
    1157             self.main.common.threads_leave("TcosActions:populate_hostlist print data") 
    1158              
    1159             crono(start2, "populate_host_list(%s)" %(ip) ) 
    1160          
    1161         #gtk.gdk.threads_enter() 
     1106             
     1107            crono(start2, "populate_host_list(%s)" %(data['ip']) ) 
     1108         
    11621109        self.main.common.threads_enter("TcosActions:populate_hostlist END") 
    11631110        self.main.progressbar.hide() 
     
    11661113        self.main.progressbutton.set_sensitive(True) 
    11671114         
    1168         if shared.disable_textview_on_update: self.main.tabla.set_sensitive(True) 
    1169          
    1170         #gtk.gdk.threads_leave() 
     1115        if shared.disable_textview_on_update and self.main.iconview.isactive(): 
     1116            self.main.tabla.set_sensitive(True) 
     1117         
    11711118        self.main.common.threads_leave("TcosActions:populate_hostlist END") 
    11721119         
    11731120        try: 
    11741121            self.main.worker.set_finished() 
    1175         except: 
     1122        except Exception, err: 
     1123            print_debug("populate_hostlist() Exception setting worker status, err=%s" %err) 
    11761124            pass 
    11771125        crono(start1, "populate_host_list(ALL)" ) 
     
    12041152            self.main.selected_host=self.main.classview.get_host(self.main.selected_ip) 
    12051153        else: 
    1206             (model, iter) = self.main.tabla.get_selection().get_selected() 
    1207             if iter == None: 
    1208                 print_debug( "menu_event_one() not selected thin client !!!" ) 
    1209                 return 
    1210             self.main.selected_host=model.get_value(iter,COL_HOST) 
    1211             self.main.selected_ip=model.get_value(iter, COL_IP) 
     1154            self.main.selected_ip=self.main.listview.get_selected() 
     1155            self.main.selected_host=self.main.listview.get_host(self.main.selected_ip) 
     1156            #(model, iter) = self.main.tabla.get_selection().get_selected() 
     1157            #if iter == None: 
     1158            #    print_debug( "menu_event_one() not selected thin client !!!" ) 
     1159            #    return 
     1160            #self.main.selected_host=model.get_value(iter,COL_HOST) 
     1161            #self.main.selected_ip=model.get_value(iter, COL_IP) 
     1162         
     1163        if not self.main.selected_ip: 
     1164            # show a msg 
     1165            shared.error_msg ( _("Error: no IP!") ) 
     1166            return 
    12121167         
    12131168        if not self.doaction_onthisclient(action, self.main.selected_ip): 
     
    16771632                 
    16781633            if self.main.config.GetVar("selectedhosts") == 1: 
    1679                 allclients=[] 
    1680                 model=self.main.tabla.get_model() 
    1681                 rows = [] 
    1682                 model.foreach(lambda model, path, iter: rows.append(path)) 
    1683                 for host in rows: 
    1684                     iter=model.get_iter(host) 
    1685                     if model.get_value(iter, COL_SEL_ST): 
    1686                         allclients.append(model.get_value(iter, COL_IP)) 
     1634                #allclients=[] 
     1635                #model=self.main.tabla.get_model() 
     1636                #rows = [] 
     1637                #model.foreach(lambda model, path, iter: rows.append(path)) 
     1638                #for host in rows: 
     1639                #    iter=model.get_iter(host) 
     1640                #    if model.get_value(iter, COL_SEL_ST): 
     1641                #        allclients.append(model.get_value(iter, COL_IP)) 
     1642                allclients=self.main.listview.getmultiple() 
    16871643                if len(allclients) == 0: 
    16881644                    msg=_( _("No clients selected, do you want to select all?" ) ) 
     
    19511907        max_wait=5 
    19521908        wait=0 
    1953         #gtk.gdk.threads_enter() 
    19541909        self.main.common.threads_enter("TcosActions:start_vnc print status msg") 
    19551910        self.main.write_into_statusbar( _("Connecting with %s to start VNC support") %(host) ) 
    1956         #gtk.gdk.threads_leave() 
    19571911        self.main.common.threads_leave("TcosActions:start_vnc print status msg") 
    19581912             
     
    19821936            result=self.main.xmlrpc.vnc("startserver", ip) 
    19831937            if result.find("error") != -1: 
    1984                 #gtk.gdk.threads_enter() 
    19851938                self.main.common.threads_enter("TcosActions:start_vnc print error msg") 
    19861939                shared.error_msg ( _("Can't start VNC, error:\n%s") %(result) ) 
    1987                 #gtk.gdk.threads_leave() 
    19881940                self.main.common.threads_leave("TcosActions:start_vnc print error msg") 
    19891941                return 
    1990             #gtk.gdk.threads_enter() 
    19911942            self.main.common.threads_enter("TcosActions:start_vnc print waiting msg") 
    19921943            self.main.write_into_statusbar( _("Waiting for start of VNC server...") ) 
    1993             #gtk.gdk.threads_leave() 
    19941944            self.main.common.threads_leave("TcosActions:start_vnc print waiting msg") 
    19951945             
     
    20151965                print_debug ( "start_process() threading \"%s\"" %(cmd) ) 
    20161966                self.main.common.exe_cmd (cmd, verbose=0, background=True)             
    2017         except: 
    2018             #gtk.gdk.threads_enter() 
     1967        except Exception, err: 
     1968            print_debug("start_vnc() Exception, error=%s"%err) 
    20191969            self.main.common.threads_enter("TcosActions:start_vnc print x11vnc support msg") 
    20201970            shared.error_msg ( _("Can't start VNC, please add X11VNC support") ) 
    2021             #gtk.gdk.threads_leave() 
    20221971            self.main.common.threads_leave("TcosActions:start_vnc print x11vnc support msg") 
    20231972            return 
    20241973 
    2025         #gtk.gdk.threads_enter() 
    20261974        self.main.common.threads_enter("TcosActions:start_vnc clean status msg") 
    20271975        self.main.write_into_statusbar( "" ) 
    2028         #gtk.gdk.threads_leave() 
    20291976        self.main.common.threads_leave("TcosActions:start_vnc clean status msg") 
    20301977         
     
    20341981        # check if remote proc is running 
    20351982        if not self.main.xmlrpc.GetStatus("ivs"): 
    2036             #gtk.gdk.threads_enter() 
    20371983            self.main.common.threads_enter("TcosActions:start_ivs write connecting msg") 
    20381984            self.main.write_into_statusbar( "Connecting with %s to start iTALC support" %(ip) ) 
    2039             #gtk.gdk.threads_leave() 
    20401985            self.main.common.threads_leave("TcosActions:start_ivs write connecting msg") 
    20411986             
     
    20431988                self.main.xmlrpc.newhost(ip) 
    20441989                self.main.xmlrpc.Exe("startivs") 
    2045                 #gtk.gdk.threads_enter() 
    20461990                self.main.common.threads_enter("TcosActions:start_ivs write waiting msg") 
    20471991                self.main.write_into_statusbar( "Waiting for start of IVS server..." ) 
    2048                 #gtk.gdk.threads_leave() 
    20491992                self.main.common.threads_leave("TcosActions:start_ivs write waiting msg") 
    20501993                sleep(5) 
    2051             except: 
    2052                 #gtk.gdk.threads_enter() 
     1994            except Exception, err: 
     1995                print_debug("start_ivs() Exception, error=%s"%err) 
    20531996                self.main.common.threads_enter("TcosActions:start_ivs write error msg") 
    20541997                shared.error_msg ( _("Can't start IVS, please add iTALC support") ) 
    2055                 #gtk.gdk.threads_leave() 
    20561998                self.main.common.threads_leave("TcosActions:start_ivs write error msg") 
    20571999                return 
     
    20612003        self.main.common.exe_cmd (cmd, verbose=0, background=True) 
    20622004         
    2063         #gtk.gdk.threads_enter() 
    20642005        self.main.common.threads_enter("TcosActions:start_ivs END") 
    20652006        self.main.write_into_statusbar( "" ) 
    2066         #gtk.gdk.threads_leave() 
    20672007        self.main.common.threads_leave("TcosActions:start_ivs END") 
    20682008 
     
    21002040        if self.main.iconview.ismultiple(): 
    21012041            allclients=self.main.iconview.get_multiple() 
     2042        elif self.main.classview.ismultiple(): 
     2043            allclients=self.main.classview.get_multiple() 
    21022044        elif not self.main.iconview.isactive() and self.main.config.GetVar("selectedhosts") == 1: 
    2103             allclients=[] 
    2104             model=self.main.tabla.get_model() 
    2105             rows = [] 
    2106             model.foreach(lambda model, path, iter: rows.append(path)) 
    2107             for host in rows: 
    2108                 iter=model.get_iter(host) 
    2109                 if model.get_value(iter, COL_SEL_ST): 
    2110                     allclients.append(model.get_value(iter, COL_IP)) 
     2045            #allclients=[] 
     2046            #model=self.main.tabla.get_model() 
     2047            #rows = [] 
     2048            #model.foreach(lambda model, path, iter: rows.append(path)) 
     2049            #for host in rows: 
     2050            #    iter=model.get_iter(host) 
     2051            #    if model.get_value(iter, COL_SEL_ST): 
     2052            #        allclients.append(model.get_value(iter, COL_IP)) 
     2053            allclients=self.main.listview.getmultiple() 
    21112054            if len(allclients) == 0: 
    21122055                #msg=_( _("No clients selected, do you want to select all?" ) ) 
     
    27822725            mydict["action"]=action 
    27832726            mydict["ip"]=ip 
    2784             #gtk.gdk.threads_enter() 
    27852727            self.main.common.threads_enter("TcosActions::action_for_clients doing action") 
    27862728            self.set_progressbar( _("Doing action \"%(action)s\" in %(ip)s...") %mydict , percent ) 
    2787             #gtk.gdk.threads_leave() 
    27882729            self.main.common.threads_leave("TcosActions::action_for_clients doing action") 
    27892730             
     
    27942735                    self.main.xmlrpc.unlockscreen() 
    27952736                    # update icon 
    2796                     #gtk.gdk.threads_enter() 
    27972737                    self.main.common.threads_enter("TcosActions::action_for_clients unlockscreen") 
    27982738                    self.change_lockscreen(ip) 
    2799                     #gtk.gdk.threads_leave() 
    28002739                    self.main.common.threads_leave("TcosActions::action_for_clients unlockscreen") 
    28012740                elif action == "lockscreen": 
    28022741                    self.main.xmlrpc.lockscreen() 
    28032742                    # update icon 
    2804                     #gtk.gdk.threads_enter() 
    28052743                    self.main.common.threads_enter("TcosActions::action_for_clients lockscreen") 
    28062744                    self.change_lockscreen(ip) 
    2807                     #gtk.gdk.threads_leave() 
    28082745      &n