Changes

Jump to: navigation, search

GEPS 004: My Gramps and Gadgets

103 bytes added, 03:20, 18 January 2008
no edit summary
== Motivation ==
Allows users to add to the GRAMPS interface. A new page, currently called "My Gramps", would be created that allows for customized "gadgetsgramplets" that perform various functions (other than tools and reports). This might include: interactive shells, TODO lists, logs, debugging tools, and various "folders" for organizing groups of people, families, or other objects.
== Details ==
This should be all on one line. You can change the order (and leave some pages out) as well with this key. (You can also add pages multiple times, but that isn't as useful as the active object on one page will change it on another).
On start up, the file gadgetsgramplets.ini is looked for in the user's .gramps subdirectory. If it is not found, a set of gadgets gramplets are created, currently a Welcome Message Gadget with a welcome message Gramplet and a Stats GadgetGramplet.
[[Image:Mygramps.png]]
You can drag the Properties button (top left) of each gadget gramplet to move it around the screen. Clicking the Properties will (currently) detach the gadget gramplet from My Gramps and place it in its own window. The window will stay open regardless of page (relationship, pedigree, etc). Closing the detached view will put it back onto My Gramps. If you quit Gramps with a open gadgetgramplet, when you start gramps again, it will open automatically.
[[Image:Detached.png]]
You can add new gadgets gramplets by right clicking on an open space on My Gramps. You can also change the number of columns by right-clicking an open area on the My Gramps page.
=== Gadgets Gramplets ===
What is a GRAMPS gadgetgramplet? A GRAMPS gadget gramplet is a view of data that either changes dynamically during the running of GRAMPS, or provides interactivity to your genealogical data. What is the difference between gadgetsgramplets, reports, quick views, and tools?
# Reports provide a static output format of your data, typically for printing
# Quick View provides a typically short, interactive listing derived from your data
# Tools provide a method of processing your data
# Gadgets Gramplets provide a dynamic view and interface to your data
There are currently 8 9 proof-of-concept gadgetsgramplets:
# Welcome GadgetGramplet# Top Surnames GadgetGramplet# Surname Cloud Gramplet# TODO GadgetGramplet# Statistics Gadget Gramplet # Python GadgetGramplet# News GadgetGramplet# Session Log GadgetGramplet# Calendar GadgetGramplet
This section will describe each gadget gramplet and its proposed functionality
==== Welcome Gadget Gramplet ====
[[Image:Welcomegadget.png]]
The welcome gadget gramplet gives an introductory message to new users, and some basic instructions.
TODO: add links to parts of manual, links to bring up windows.
Change the number of names displayed by editing this section in ~/.gramps/gramplets.ini
==== TODO Gadget Gramplet ====
[[Image:Todogadget.png]]
The TODO gadget gramplet is free form text. This is persistent between sessions. Open more than one to save different info. Change the title of the gadget gramplet by editing the section name in ~/.gramps/gadgetsgramplets.ini
==== Statistics Gadget Gramplet ====
[[Image:Statgadget.png]]
The Statistics gadget gramplet runs a copy of the code from the Statistics report.
==== Python Gadget Gramplet ====
[[Image:Pythongadget.png]]
The Python gadget gramplet brings up a Python Shell for interpreting python expressions. You can type most any (single line) Python expression. In addition, the environment has been populated with some useful variables, including '''self''' (this Python gadgetgramplet), '''Date''', '''uistate''' and '''dbstate'''. The '''Date''' entry is a date object constructor, and can be used for date arithmetic. For example, you might be interested in answering these questions:
What was the date 56 years ago:
1980-01-26
==== News Gadget Gramplet ====
[[Image:Newsgadget.png]]
The News gadget gramplet reads the wiki news page. TODO: add links and formatting.
==== Session Log Gadget Gramplet ====
[[Image:Loggadget.png]]
The session log keeps track of activity in this session. By default, it only shows each entry once. Change this behavior by editing this section in ~/.gramps/gadgetsgramplets.ini. Click a name to change the active person; double-click to bring up the edit page for that person.
==== Calendar Gadget Gramplet ====
[[Image:Calendargadget.png]]
The Calendar gadget gramplet shows a monthly calendar, with events marked (in bold day numbers). Double-click a day to run the "On This Day" Quick Report.
== Development ==
These are all defined in src/plugins/DefaultGadgetsDefaultGramplets.py
The simplest gadgetgramplet:
<pre>
gui.set_text("Hello world!")
register(type="gadgetgramplet", # case in-senstitive keyword "gadgetgramplet" name="Hello World GadgetGramplet", # gadget name, unique among gadgetsgramplets
height = 20, # default size
content = init, # function/class; takes guigadgetguigramplet title="Sample GadgetGramplet", # default title, user changeable
)
</pre>
Using the Gadget Gramplet class, however, provides more functionality. It has a number of method possibilities:
# init- run once, on construction

Navigation menu