GSoC 2009- "Search and Replace" by Meetanshu

Search and Replace
Meetanshu Gupta : meetanshu.gupta@gmail.com

Rationale

Text comprises a substantial part of most of the Scribus Documents. 'Search and Replace' is one the most fundamental and widely used text manipulation program. The current implementation lacks many features while having a non modular coding implementation.

Reimplementing it in with new features will increase both the usage and popularity of 'Scribus'.

Motivation Scribus leads the Open Source 'Desktop Publishing' softwares with one but many features. However the commercial softwares seem to be getting ahead in features like 'Search and Replace'. Being vastly used this feature has to be improved. Having a long programming experience in C and desire to write something from basic to as far, as he can, is a 'Developer's Dream'. I want to fulfill mine.

Overview After discussing with the scribus developers, these goals are to be met - 1)Rewriting the source code to make it more modular like separate GUI from the search logic. 2)Support for Regular Expressions in the search using Qregex. 3)Search and replace for multiple documents 4)Better User Interface separating Basic Search and Advanced Search.

Implementation

Essential 1.The new 'Search and Replace' will have two 'Search and Replace'.First, would search in a particular text region. Second, will prompt user to search whole document or parts of it, that will appear as a checkbox list.It will first look the whole ScribusDoc to find individual parts and then invoke the first 'Search and Replace' on all of them or the checked items. 2.The new 'Search and Replace' will have to modes. One, to do basic 'Search and Replace' just using text based matching. Second the full fledged as we have of today. The second one can be invoked from the first after clicking an 'Advanced Search' Button or can be directly invoked. 3.It will support Regular Expressions that means we can find all words starting containing a particular string or character at a particular location. 4.The code will be divided in two components, the GUI and the actual code logic. This would allow 'Search and Replace' to be extended easily later on. As any feature would need a corresponding addition in the UI part and a separate code backend. Change in one can be done independently of the other.

Optional If time is left, I would also like to implement the following ideas :- 5.To make the 'Search and Replace' dialog more informative, proper windows would be prompted like 'Match not Found' in the center unlike 'Search Complete'. 6.Depending on the 'textbox' support by Qt, we can have a real-time search, that is searching and highlighting as user is typing. This would need a mechanism from textbox to send the characters as soon as they are being typed in textbox rather than only after 'Return' key is hit. 7.To have 'Search and replace' automatically take input from some portion highlighted by user when it is invoked(From the buglist). 8.To have 'Warp Around' feature. That is if user wants, he can enable it so that when end of document is reached, search starts from the beginning again. This would be just for search. 9.To shift the 'Search and replace' Dialog to side when user is having a look at the searched documents.

TimeLine :

May 23   – June 10   :   Basic 'Search and Replace' without Regular Expressions June 10  – June 23   :   Basic 'Search and Replace' with Regular Expressions June 23  - July 6    :   Advanced 'Search and Replace' July 6   – July 21   :   global 'Search and replace' July 21  - August 10 :   Exploiting bugs and patching them,Additional Ideas Implementation,If we are for some reasons not on schedule August 10 - August 17 : Documenting the source code, Writing about ideas that can be implemented

Deliverables : 1.A new 'Search and Replace Dialog', rather two ;) with all the features mentioned under the 'Essential' portion of “Implementation”. 2.Documentation of the work done.  3.Some/all features from the “Optional portion” of “Implementation”

BIO: I am a final year Undergraduate student in Computer Engineering from Malaviya National Institute of Technology, Jaipur, India. I have been programming in C since Class 6th and C++ since Class 11th. I have worked on Qt2 to create an UI for a C++ project 'Department Management Software'.I have done many projects in C, C++ for academics, competitions and at college level. My interests include Coding (C/C++/Java/C#), Algorithms , Network Programming. Past summer I did two moths intern at Microsoft IDC,Hyderabad India and got some hands on experience on real world projects. Since then I have taken interest in reading and understanding the codebase (Scribus, Vim,  Open office), learning debugging techniques and amicably working in teams.