Difference between revisions of "GEPS 004: My Gramps and Gadgets"

From Gramps
Jump to: navigation, search
(Details)
(Details)
Line 25: Line 25:
 
You can add new gadgets 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.
 
You can add new gadgets 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.
  
There are currently 10 proof-of-concept gadgets:
+
=== Gadgets ===
  
# Family Gadget
+
There are currently 8 proof-of-concept gadgets:
# Event Gadget
+
 
 +
# Welcome Gadget
 
# Top Surnames Gadget
 
# Top Surnames Gadget
# Stats Gadget
+
# TODO Gadget
# Log Gadget
+
# Statistics Gadget  
# Shell Gadget
 
 
# Python Gadget
 
# Python Gadget
# TODO Gadget
+
# News Gadget
# Welcome Gadget
+
# Session Log Gadget
 +
# Calendar Gadget
 +
 
 +
This section will describe each gadget and its proposed functionality
 +
 
 +
==== Welcome Gadget ====
 +
 
 +
[[Image:Welcomegadget.png]]
 +
 
 +
The welcome gadget gives an introductory message to new users, and some basic instructions.
 +
 
 +
TODO: add links to parts of manual, links to bring up windows.
 +
 
 +
==== Top Surnames Gadget ====
 +
 
 +
[[Image:Topgadget.png]]
 +
 
 +
The top surnames gadget shows the top 10 (by default) used surnames. Double-click a surname to run the Same Surnames Quick Report.
 +
 
 +
Change the number of names displayed by editing this section in ~/.gramps/gadgets.ini
 +
 
 +
==== TODO Gadget ====
 +
 
 +
[[Image:Todogadget.png]]
 +
 
 +
The TODO gadget is a free form text file. This is persistent between sessions. Open more than one to save different info. Change the title of the gadget  by editing the section name in ~/.gramps/gadgets.ini
 +
 
 +
==== Statistics Gadget ====
 +
 
 +
[[Image:Statgadget.png]]
 +
 
 +
The Statistics gadget runs a copy of the code from the Statistics report.
 +
 
 +
==== Python Gadget ====
 +
 
 +
[[Image:Pythongadget.png]]
 +
 
 +
The Python gadget brings up a Python Shell for interpreting python expressions. self, uistate and dbstate are in the environment for interactive testing and exploring.
 +
 
 +
==== News Gadget ====
 +
 
 +
[[Image:Newsgadget.png]]
 +
 
 +
The News gadget reads the wiki news page. TODO: add links and formatting.
 +
 
 +
==== Session Log Gadget ====
 +
 
 +
[[Image:Loggadget.png]]
 +
 
 +
The session log keeps track of people visited in this session. By default, it only shows each entry once. Change by editing this section in ~/.gramps/gadgets.ini. Click a name to change the active person; double-click to bring up the edit page for that person.
 +
 
 +
==== Calendar Gadget ====
 +
 
 +
[[Image:Calendargadget.png]]
 +
 
 +
The Calendar gadget 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/DefaultGadgets.py
 
These are all defined in src/plugins/DefaultGadgets.py

Revision as of 16:57, 30 December 2007

Proposed changes for enhancing GRAMPS by adding a new GUI API that allows data to be displayed on the screen, with graphical objects such as tables, buttons, text entry, links, etc. This would effectively be able to turn a user plugin into an interface for moving, say, the active person in the main window, or, possibly, for user-defined data entry.

Motivation

Allows users to add to the GRAMPS interface. A new page, currently called "My Gramps", would be created that allows for customized "gadgets" 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

A prototype is now available for exploration and testing. To activate the prototype, add the following line to your .gramps/keys.ini file in the interface section:

data-views= MyGrampsView,PersonView,RelationshipView,FamilyListView,PedigreeView,EventView,SourceView,PlaceView,MediaView,RepositoryView,NoteView

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 gadgets.ini is looked for in the user's .gramps subdirectory. If it is not found, a set of gadgets are created, currently a Message Gadget with a welcome message and a Stats Gadget.

Mygramps.png

You can drag the Properties button (top left) of each gadget to move it around the screen. Clicking the Properties will (currently) detach the gadget 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 gadget, when you start gramps again, it will open automatically.

Detached.png

You can add new gadgets 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

There are currently 8 proof-of-concept gadgets:

  1. Welcome Gadget
  2. Top Surnames Gadget
  3. TODO Gadget
  4. Statistics Gadget
  5. Python Gadget
  6. News Gadget
  7. Session Log Gadget
  8. Calendar Gadget

This section will describe each gadget and its proposed functionality

Welcome Gadget

Welcomegadget.png

The welcome gadget gives an introductory message to new users, and some basic instructions.

TODO: add links to parts of manual, links to bring up windows.

Top Surnames Gadget

Topgadget.png

The top surnames gadget shows the top 10 (by default) used surnames. Double-click a surname to run the Same Surnames Quick Report.

Change the number of names displayed by editing this section in ~/.gramps/gadgets.ini

TODO Gadget

Todogadget.png

The TODO gadget is a free form text file. This is persistent between sessions. Open more than one to save different info. Change the title of the gadget by editing the section name in ~/.gramps/gadgets.ini

Statistics Gadget

Statgadget.png

The Statistics gadget runs a copy of the code from the Statistics report.

Python Gadget

Pythongadget.png

The Python gadget brings up a Python Shell for interpreting python expressions. self, uistate and dbstate are in the environment for interactive testing and exploring.

News Gadget

Newsgadget.png

The News gadget reads the wiki news page. TODO: add links and formatting.

Session Log Gadget

Loggadget.png

The session log keeps track of people visited in this session. By default, it only shows each entry once. Change by editing this section in ~/.gramps/gadgets.ini. Click a name to change the active person; double-click to bring up the edit page for that person.

Calendar Gadget

Calendargadget.png

The Calendar gadget 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/DefaultGadgets.py

The simplest gadget:

from DataViews import register

def init(gui):
    gui.set_text("Hello world!")

register(type="gadget",             # case in-senstitive keyword "gadget"
         name="Hello World Gadget", # gadget name, unique among gadgets
         height = 20,               # default size
         content = init,            # function/class; takes guigadget
         title="Sample Gadget",     # default title, user changeable
         )

Using the Gadget class, however, provides more functionality. It has a number of method possibilities:

  1. init- run once, on construction
  2. active_changed- run when active-changed is triggered
  3. db_changed- run when db-changed is triggered
  4. main- run once per db change, main process (a generator-must use yield at least once. yield True means true that there is more; yield False means all done)

There are methods for saving/loading data, and interacting with the gui. More details to come...

Discussion

This type of proposal is discussed on these threads:

http://www.nabble.com/A-ScreenDoc-idea-t847639.html

http://www.nabble.com/Re:-Interactive-Quick-Reports-(was-Notes-in-V3.0)-p12735768.html

http://www.nabble.com/QuickReports-and-TextBufDoc--tf4537797.html

http://www.nabble.com/Report-Interface-tf4559738.html

There is also a Feature Request to remind us:

http://bugs.gramps-project.org/view.php?id=1291