Module p.u.r.hig

Part of pida.utils.rat

No module docstring
Line # Kind Name Docs
44 Class WidgetCostumizer The WidgetCostumizer is a class template for defining chaining of asseblies
104 Class SetupScrolledWindow Undocumented
114 Class SetupLabel Usage::
144 Function _dialog_decorator Undocumented
152 Class SetupDialog Undocumented
175 Class SetupAlert Undocumented
247 Class _SetupRadioChoiceList Undocumented
265 Class SetupListAlertTemplate Undocumented
305 Class _SetupMultipleChoiceList Undocumented
363 Class _SetupListAlert Undocumented
389 Class _SetupSingleChoiceList Undocumented
417 Class RunDialog This is a terminal costumizer because it swaps the gtk.Dialog recieved by
427 Function hig_alert Undocumented
448 Class _OneStrategy Undocumented
457 Class _BaseStrategy Undocumented
463 Class _MultipleStrategy Undocumented
473 Class _RadioStrategy Undocumented
493 Class _SingleListStrategy Undocumented
507 Function choice @param items: the items you want to choose from
589 Function _humanize_seconds Turns a number of seconds into to a human readable string, example
632 Class _TimeUpdater Undocumented
656 Function save_changes Shows up a Save changes dialog to a certain list of documents and returns
740 Function error Undocumented
750 Function warning Undocumented
759 Function ok_cancel Undocumented
771 Function info Undocumented
780 Function listing @param list_title: A label will be placed above the list of items describing
808 Class HigProgress HigProgress returns a window that contains a number of properties to
def _dialog_decorator(func):
Undocumented
def hig_alert(primary_text, secondary_text, parent=None, flags=0, buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK), run=True, _setup_alert=SetupAlert, **kwargs):
Undocumented
def choice(primary_text, secondary_text, parent=None, allow_cancel=True, **kwargs):
@param items: the items you want to choose from
@param list_title: the title of the list. Optional.
@param allow_cancel: If the user can cancel/close the dialog.
@param min_select: The minimum number of elements to be selected.
@param max_select: The maximum number of elements to be selected.
    -1 Means no limit.

@param dialog_callback: This is a callback function that is going to be
    called when the dialog is created. The argument is the dialog object.
@param one_item_text: when specified and if the number of `items` is one
    this text will be the primary text. This string must contain a '%s'
    which will be replaced by the item value.
    Optional.
def _humanize_seconds(elapsed_seconds, use_hours=True, use_days=True):
Turns a number of seconds into to a human readable string, example 125 seconds is: '2 minutes and 5 seconds'.

@param elapsed_seconds: number of seconds you want to humanize @param use_hours: wether or not to render the hours(if hours > 0) @param use_days: wether or not to render the days(if days > 0)

def save_changes(files, last_save=None, parent=None, **kwargs):
Shows up a Save changes dialog to a certain list of documents and returns
a tuple with two values, the first is a list of files that are to be saved
the second is the value of the response, which can be one of:
  - gtk.RESPONSE_OK - the user wants to save
  - gtk.RESPONSE_CANCEL - the user canceled the dialog
  - gtk.RESPONSE_CLOSE - the user wants to close without saving
  - gtk.RESPONSE_DELETE_EVENT - the user closed the window

So if you want to check if the user canceled just check if the response is
equal to gtk.RESPONSE_CANCEL or gtk.RESPONSE_DELETE_EVENT

When the `elapsed_time` argument is not `None` it should be a list of the
elapsed time since each was modified. It must be in the same order of
the `files` argument.

This function also accepts every argument that a hig_alert function accepts,
which means it accepts `title`, etc. Note that this function overrides
the `run` argument and sets it to True, because it's not possible for a user
to know which files were saved since the dialog changes is structure
depending on the arguments.

Simple usage example::
    files_to_save, response = save_changes(["foo.bar"], title="Rat Demo")

@param files: a list of filenames to be saved
@param last_save: when you only want to save one file you can optionally
    send the date of when the user saved the file most recently.
    
@type last_save: datetime.datetime
@param parent: the window that will be parent of this window.
@param primary_text: optional, see hig_alert.
@param secondary_text: optional, see hig_alert.
@param one_item_text: optional, see choice_alert.
@param list_title: optional, see choice_alert.
@param kwargs: the remaining keyword arguments are the same as used on the function
    hig_alert.
@return: a tuple with a list of entries the user chose to save and a gtk.RESPONSE_*
    from the dialog
def error(primary_text, secondary_text, **kwargs):
Undocumented
def warning(primary_text, secondary_text, **kwargs):
Undocumented
def ok_cancel(primary_text, secondary_text, ok_button=gtk.STOCK_OK, **kwargs):
Undocumented
def info(primary_text, secondary_text, **kwargs):
Undocumented
def listing(primary_text, secondary_text, parent=None, items=(), **kwargs):
@param list_title: A label will be placed above the list of items describing
    what's the content of the list. Optional.

Every other argument that L{hig_alert} function does.

Example::
    listing(
        "Listing cool stuff",
        "To select more of that stuff eat alot of cheese!",
        items=["foo", "bar"] * 10, # Some random 20 elements
        title="Rat Demo",
        list_title="Your cool stuff:"
    )
API Documentation for PIDA, generated by pydoctor.