Looks fine to me. I just would change the logic from:

bool
CanvasView::close_view()
{
        if(get_instance()->get_visible_canvases()==1)
                close_instance();
        else
                hide();
        return false;
}


to

bool
CanvasView::close_view()
{
        if(get_instance()->get_visible_canvases()>1)
                hide();
        else
                close_instance();
        return false;
}

It is not likely that it could happen but it would be sure if
get_visible_canvases() returns zero for some reason.

Cheers!


2014-01-26 Yu Chen <jco...@gmail.com>

> Hello,
>
> We currently provide two menu items to close a file:
> 1) File->Close Window, it connects to CanvasView::close_view()
> 2) File->Close Document, it connects to CanvasView::close_instance()
>
>
> If I remembered correctly, I asked befre and Calors answered, it is a
> (unsupported now) feature came from Gnome, So I am planing to remove
> the first one, including the menu item and the action defination, but
> the function, CanvasView::close_view() will be still there.
>
>
>
> bool
> CanvasView::close_view()
> {
>         if(get_instance()->get_visible_canvases()==1)
>                 close_instance();
>         else
>                 hide();
>         return false;
> }
>
> bool
> CanvasView::close_instance()
> {
> #ifdef SINGLE_THREADED
>         if (get_work_area()->get_updating())
>         {
>                 get_work_area()->stop_updating(true); // stop and mark as
> cancelled
>
>                 // give the workarea chances to stop updating
>                 Glib::signal_timeout().connect(
>                         sigc::mem_fun(*this, &CanvasView::close_instance),
>                         250);
>         }
>         else
> #endif
>                 Glib::signal_timeout().connect(
>                         sigc::bind(sigc::ptr_fun(_close_instance),
>
>  (etl::handle<Instance>)get_instance()),
>                         250);
>         return false;
> }
>
>
> --
> ~ yu
>
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> Synfig-devl mailing list
> Synfig-devl@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/synfig-devl
>



-- 
Carlos
http://synfig.org
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to