private void updateChronopicWin(bool state, string message)
    {
        Log.WriteLine("updateChronopicWin-1");

        //need to do this, if not it crashes because chronopicConnectionWin gets died by thread ending
        chronopicConnectionWin = ChronopicConnection.Show();

        Log.WriteLine("updateChronopicWin-2");
        if(state)
            chronopicConnectionWin.Connected(message);
        else
            chronopicConnectionWin.Disconnected(message);

        needUpdateChronopicWin = false;
    }
    protected bool PulseGTK()
    {
        if(needUpdateChronopicWin || ! thread.IsAlive) {
            fakeConnectionButton.Click();
            Log.Write("dying");
            return false;
        }
        //need to do this, if not it crashes because chronopicConnectionWin gets died by thread ending
        chronopicConnectionWin = ChronopicConnection.Show();
        chronopicConnectionWin.Pulse();

        Thread.Sleep (50);
        Log.Write(thread.ThreadState.ToString());
        return true;
    }
    void prepareChronopicConnection()
    {
        chronopicConnectionWin = ChronopicConnection.Show();
        chronopicConnectionWin.LabelFeedBackReset();

        //		chronopicConnectionWin.Button_cancel.Clicked += new EventHandler(on_chronopic_cancelled);

        fakeConnectionButton = new Gtk.Button();
        fakeConnectionButton.Clicked += new EventHandler(on_chronopic_detection_ended);

        needUpdateChronopicWin = false;
        thread = new Thread(new ThreadStart(waitChronopicStart));
        GLib.Idle.Add (new GLib.IdleHandler (PulseGTK));
        thread.Start();
    }
    public static ChronopicConnection Show()
    {
        if (ChronopicConnectionBox == null) {
            ChronopicConnectionBox = new ChronopicConnection();
        }
        ChronopicConnectionBox.chronopic_connection.Show ();

        ChronopicConnectionBox.initialize ();

        return ChronopicConnectionBox;
    }