[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: get active view
From:       David Faure <faure () kde ! org>
Date:       2004-09-21 10:55:36
Message-ID: 200409211255.37074.faure () kde ! org
[Download RAW message or body]

On Tuesday 21 September 2004 12:42, Thorsten Zachmann wrote:
> You insert a new slide into kpresenter. At the moment all views go to the new 
> slide. I would like to go to the new slide only on the view with the focus. 
> The other view should stay on the slide which is currently selected.

Best solution: the code for going to the new slide should be in the view class,
not in the document class. Then the other views wouldn't be affected.
This is the cleanest solution, but I'm not sure how it works with the undo/redo problem.
You would still need an "active view" hack there.

> Also the view can be different if you undo the insert, select the other view 
> and redo the command.

Yeah, so indeed finding the "current view" sounds necessary, at least from 
within the command itself. You could cast the app's activeWindow to a KoMainWindow
and use rootView(), but this is far from clean (and breaks with embedded documents).
Might also break in koshell.

You could also simply set the current view somewhere while [un]executing commands
(e.g. in the command-history-derived class). I would find this cleaner.
In that case it would be simply about storing "this" from KoView code, no casts and
hierarchy navigation needed.

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic