Sadly, the official coding time for Google Summer of Code has come to an end. 😦 It was wonderful working with my mentor Jigar. So I have coded three features for Calligra Sheets.
1. View Splitter –
-> I have pushed the code in sheets-vs-mrupanjana.
The feature enables a particular sheet view to be split into two portions vertically. The
cursors are not synchronized. Different input data can be given in the two portions. We often do not need to work with lots of columns, so the sheet view is at times more than optimum. It can easily be split and we can continue our work on both the portions.
2. Highlighting changes in a cell –
-> Code is pushed in sheets-hc-mrupanjana
This is a really interesting one and is absent in other similar applications. The user begins a session, feeds some data in the sheet, makes some changes in the cells where already there has data. The cells which have undergone changes are highlighted with dark blue colour. This enhances readability and the user will be aware of the changes made in the present session.
3. Autocorrection of function name –
-> Code has been pushed in sheets-fName-mrupanjana
Often user forgets the exact function name for calculating cos of an angle, absolute value of a number and guesses the function names. The user makes a guess and inputs a function name which is supposedly wrong. As he or she presses enter, it gets automatically corrected.If the user does not want the change in name, he or she can escape to the next cell using tab.
I have coded the storage and the implementation of all the three features. Hope to see them merged soon. 🙂
So, Here I am with my next post that speaks about the third feature of my project. It is about correcting the spelling of a function name. Suppose a user wants to calculate absolute value of a number. For that he needs to write ABS(a), but instead he mistypes and writes ABB(a).
So, my function will help the user to find the mistake in spelling of the input function name.
1. When the user presses enter, ABB will get converted to ABS
2. S will be highlighted to show that, that particular character was mistyped.
3. Incase the user does not want to change the input function name inspite of knowing that the computer may not accept it, he needs to press tab and move to the next cell . Such a situation may occur when the user gives function name not relevant to the present processing but maybe somewhat similar to the function names known by the compiler.
The feature comes very handy. Often we forget the actual function names and we keep on guessing. The highlighting of the corrected function name characters makes the feature strong.
Ahh! after alot of pushing and pulling from Git, I started working on my next feature. It is the way, you warn people, “Harry no more remains the same”. My feature tells you that the stuff in the cell has changed. And no it will warn you as soon as you do it in a particular session. So basically an expert typing hand finishes feeding data, finds out errors in the document and makes few changes, the corresponding cell data is coloured.
It is wonderful. The past data is saved and is compared with the newly entered one. If they are different, the new one is coloured. I find this feature so small, cute and interesting.
I was searching for ways to implement View-Split in sheets. The task turned out to be slightly tricky. Splitting the view is a very handy feature. The split portions contain the same document . They have different scroll and vertical bars. Here dufferent means they do not synchronise.
1. Canvas is the QWidget for sheets. So I make a Canvas object.
2. The method CanvasWidget::paint() helps to paint the canvas with data. I need to paint the canvas object with the data from the same document.
3. And here comes the option to utilise the classic QSplitter class of Qt. It splits the document. It always takes QWidget. And hence the canvas object is passed as parameters. The QSplitter object can be populated with its orientation (vertical or horizontal) too.
The feature can be improved in many good ways. Hope to do that soon.
First, I must tell you how I started involving myself in KDE. One fine day, when I was lost with tonnes of programmes in geeksforgeeks and trying to figure out what I would do with a matrix multiplication and knapsack code in future, I pinged my senior on Facebook. He asked one simple question, “How much would you rate yourself in C++ and Java? ” I straightway said 9. He started fumbling and said, “Then close your coding tabs and start contributing in KDE.” I half agreed , half happy that I can really glimpse into real world codes as I started looking through the codes online. Now a time gap. I am now doing Qt, struggling with my proposal and yes, for sure with my mac os x computer.
Wherever you are stuck, ask google to lift you and people to motivate you . The online code for Calligra is grand. (http://api.kde.org/bundled-apps-api/calligra-apidocs/sheets/html/classCalligra_1_1Sheets_1_1Currency.html) .Best part which as a novice I felt is that the classname and the member function names give you all the notion about what is there inside them. Okay, there are tonnes of classes, subclasses, header files. Now, the saviour is the line number mentioned in the documentation. I enjoyed it, picking up parts related to my project and understanding them. Anything must be done by digesting what is really happening.
Okay! this post was to rawly introduce you about what I have done to clear the hurdles that a new comer faces when he or she is doing open source. In my later posts, I will give further details about the classes I read, the work they do, how I am implementing the features. Keep reading. 😀