<br><div id="origbody"><div style="background: #f2f2f2;">----- 原始邮件 -----<br>发件人:Christophe Fergeau <cfergeau@redhat.com><br>收件人:hongzhen_luo@sina.com<br>抄送人:spice-devel <spice-devel@lists.freedesktop.org><br>主题:Re: [Spice-devel] [help]there's an error during i compile spice-gtk code<br>日期:2015年09月28日 15点34分<br></div><br>On Mon, Sep 28, 2015 at 08:57:19AM +0800, hongzhen_luo@sina.com wrote:<br>> Dear Sir    Thanks for you help, I have successful compiled my code .       About the new interface spice_reget_usb_state(), it's for a bug  <br>>       :that's  when I activated the usb device widget to click the check<br>>  box for installing usb driver ,then closed(click X button) the device <br>> widget quickly and run the device widget again . <br>>        Normally ,the mark of checkbox should be remained ,but it's <br>> disappeared. So when you click again ,it will be popped up a message box<br>>  : "Operation not supported or unimplemented on this platform"         So I checked the source code and found in the function : device_added_cb()       if (spice_usb_device_manager_is_device_connected(priv->manager,                                                     device))        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE);       As,<br>>  you see ,the condition was whether the device was connected ,if true <br>> the checkbox was set checked ,maybe for some reasons ,such as network <br>> delay or others ,  the usb needs more long time to redirect at Linux <br>> ,however ,this interface(spice_usb_device_manager_is_device_connected)  just do judgement that it's whether has been connected ,probably<br>>  .So when I operated quickly at device widget  (click checkbox -close <br>> widget -run widget -click check box) the mark was disappeared .      So  i want to add a  condition to get the current usb state ,if(spice_usb_device_manager_is_device_connected ||state == SPICE_USB_DEVICE_STATE_INSTALLING) {then .............} so  i write a method to get the state .      I didn't test the result yet ..maybe it will be successful maybe not ..<br>Ah ok, thanks for  the details, it indeed looks like the handling of<br>this INSTALLING state is currently missing in device_added_cb().<br><p>Christophe</p><p><br></p><p>Dear Mr Christophe </p><p>         unfortunately, the test result was failed , when I added the contidion SPICE_USB_DEVICE_STATE_INSTALLING  , the USB device is always keeped  'check' state . In the usb-device-manager I just wrote a function() to call the static method 'spice_usb_device_get_state()' then obtain the return value to usb-device -widget .. but i don't know why it always keep installing state  or I used incorrect value to compare in my condition  ..Do you know how to modify this bug ? <br></p></div>