Sunday, September 2, 2012

[GSoC] Wrapping up the Cantor interface

This year's Summer of Code ended nearly two weeks ago (at least the coding part did), so considering my usual delay this seems to be a good time to write about what happened in Cantor.

My project for this summer was to rewrite Cantor's interface using the Qt Graphics View framework. The old interface was a heavily modified rich text document with a lot of glitches and bugs reaching from visual annoyances to crashes. I spent most of my time reproducing the features of the old interface without reproducing the bugs. But there was also some time to add some new features:
  • Basic editing features such as undo/redo and cut, copy, paste and drag&drop work properly. Of course that doesn't sound impressive, but I think that the lacking/buggy implementation of these features in the old interface was one of the biggest problems. And it wasn't always easy to implement them either, because the API of QGraphicsTextItem is very poor compared to the API of QTextEdit, so I often found myself working around it, trying to reproduce features that I knew were available in the underlying implementation. 
  • There is a nice search&replace widget that shows up on top of the status bar (similar to, and copied from inspired by, Kate's search).
  • Visual changes in the worksheet, such as the appearance of a large result (e.g. a multi-row matrix) are animated. This makes it much easier to understand what actually did change and where that put the cursor.
  • The entries can now be reordered by dragging them around, something I find quite convenient when I use Cantor to develop some idea.
  • The new implementation is much more flexible, because QGraphicsItems can contain virtually anything, so there is no limit for further features. I originally intended to implement input assistants, which were supposed to make it possible to enter complex objects like matrices in a more readable fashion. During the summer I decided to spend my time on things like the animations and drag&drop instead, but chances are that I'll come back to these assistants.  Another feature that could be implemented with the new worksheet are live-editable formulas. I always wanted these, but they would take more time than I'm likely to have in the near future.
  • There are a lot of other improvements hidden all over the interface: Zooming in and out works more smoothly, the cursor movement is much more sensible, and non-editable parts of the worksheet actually can't be modified, to name a few. 
All in all I think Cantor is much more fun to work with now, and I'm really happy everything worked out so well.
In the next weeks I'll still be around fixing bugs (so let me know if you find one), but I probably won't have time to implement new features anytime soon. I do intend to get back to it though, because I still have some ideas about what could be done.
Oh, and I'll be in Randa this month, so I should be doing something Cantor-related there as well :)

Tuesday, August 14, 2012

[GSoC] Soft pencils down date

GSoC 2012 is slowly coming to an end. The new Cantor interface is now merged into the master branch, and in the next days I will probably mostly do clean-up and documentation. Maybe I'll also have the time to write some new code as well, or maybe that will have to wait for GSoC do be over. Anyway, it's about time for me to post about the code I did write in the last month.
The majority of commits in the last month were bug fixes, and small UI improvements all over the place. But there are some new features as well: drag&drop for worksheet entries, improved text search, animated scrolls and those nice little icons that turn up when the mouse stays on an entry for some time, and that don't really have a name.

Cantor with those nameless icons

Maybe the image is not quite as convincing as it should be, but it is hard to capture some of the new features in an image. To those who are convinced enough to try out the new code (which, as I said, is now in the master branch): I would very much appreciate to hear about any problems you find. I try to test everything as good as possible but I spend most of my time writing the code, and I'm not trying to calculate anything, so I can only simulate real use.
To everybody else: Thank's for reading all this anyway :)

Friday, July 13, 2012

[GSoC] New features in Cantor interface

My last post on my GSoC project for Cantor was more than a month ago, so I figured I finally needed to write something new. Fortunately there are some changes to write about: First, everything the last post said didn't work does work now. That means printing and saving/loading works, all the entry types that the old interface knew are there, and richtext is supported. And in addition to that there are some new things like animated changes in the worksheet (which are supposed to not get in your way, and which you can turn off if you feel they do) and search/replace. The later is not quite done yet, but it is already usable. In the future it is supposed to be possible to limit the search to certain parts of the worksheet, like text entries or calculation results. All that is visible from this feature now is a big useless PushButton, but that will change soon :)

Of course there have also been some minor ui improvements (e.g. for copy/paste and drag&drop of (rich) text), and a couple of fixes for bugs and crashes. All in all I think the new interface is really superior to the old one now, which is of course the least I wanted the achieve in this project.

That's all from this rather short report. There is not much use in describing the changes in detail, but I want to encourage everybody to have a look at the new interface (the code can be found at the gsoc2012 branch) and to let me know if there are any problems. Thanks :)

Friday, June 8, 2012

[GSoC] Improvements in new Cantor interface - update

Apparently I messed up the image in my last post, so that nobody could see it in the correct size... Sorry for that. Here is a link that shows the new interface in all its high-resolution glory:

Thursday, June 7, 2012

[GSoC] Improvements in new Cantor interface

In my last post about the new Cantor interface I announced a new post once there were major improvements. Quite some time and several opportunities for such a post have passed now, so here is the belated update:

Cantor is quite usable with the new interface. A couple of things do not yet work, for example printing and saving/loading worksheets and using rich text in the text entries. But embedding LaTeX code works, and everything calculation-related should work as well (and this, after all, is what the program is for).
Also there are a lot of minor improvements over the old interface that make using it much more enjoyable, such as more sensible cursor movement and less ways to put the worksheet into unintended states (actually there is none that I am aware of).

But of course not everything is perfect (yet), and I would very much appreciate you to tell me of any bugs you find, or of important features you think are missing. You can find the code here.

Sunday, May 13, 2012

GSoC project for Cantor

Hi, this is my first post on the planet. I am Martin Küttler, a mathematics student from Germany. I am very late with this, but still: I was accepted for GSoC this year! I proposed to implement a new interface for Cantor, and I am looking forward to spend the summer on this task.

Cantor's current interface (henceforth known as 'the old interface' :) ) uses a KRichTextWidget, which brings several limitations. Some of these could be worked around with some efforts (and some have been), but that's not a real solution, as KRichTextWidget just is not suitable for the worksheet interface Cantor strives for. 
That's why I want to implement a new interface based on the Qt Graphics View Framework. When it's done it is supposed to provide a better user experience without all the quirks (and occasional crashes) of the old interface, and with decent search and undo/redo features. On top of that it should bring a lot of new possibilities for user interaction, that are not (easily) possible with a mere text-based approach. In the end of the summer I intend to implement an inline input assistant for a convenient matrix creation.

The code can be found at the gsoc2012 branch of Cantor. It is working already, but a lot of the old features are still missing, and there are new features bugs instead. I intend to address those issues in the next few weeks, and I will post here when there are major improvements. But the code can be tried out already, and if you do so please leave a comment to tell me what you think of it.

It looks like this is going to be an exciting summer for Cantor, as Filipe Saraiva also started implementing a Python backend for Cantor. I'm really looking forward to it!