Gladeui.Project¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37), Gtk.TreeDragSource (3), Gtk.TreeModel (27) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
Virtual Methods¶
| Inherited: | GObject.Object (7), Gtk.TreeDragSource (3), Gtk.TreeModel (19) | 
|---|
| do_add_object(object) | |
| do_changed(command, forward) | |
| do_close() | |
| do_next_redo_item() | |
| do_next_undo_item() | |
| do_parse_finished() | |
| do_push_undo(cmd) | |
| do_redo() | |
| do_remove_object(object) | |
| do_selection_changed() | |
| do_undo() | |
| do_widget_name_changed(widget) | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| add-item | Gladeui.WidgetAdaptor | r | The current item to add to the project | 
| css-provider-path | str | r/w | Path to use as the custom CSS provider for this project. | 
| has-selection | bool | r | Whether project has a selection | 
| license | str | r/w | License for this project, it will be added as a document level comment. | 
| modified | bool | r | Whether project has been modified since it was last saved | 
| path | str | r | The filesystem path of the project | 
| pointer-mode | Gladeui.PointerMode | r | The currently effective Gladeui.PointerMode | 
| read-only | bool | r | Whether project is read-only | 
| resource-path | str | r/w | Path to load images and resources in Glade’s runtime | 
| template | Gladeui.Widget | r/w | The project’s template widget, if any | 
| translation-domain | str | r/w | The project translation domain | 
Signals¶
| Inherited: | GObject.Object (1), Gtk.TreeModel (5) | 
|---|
| Name | Short Description | 
|---|---|
| activate-signal-handler | |
| add-signal-handler | |
| add-widget | Emitted when a widget is added to a project. | 
| change-signal-handler | |
| changed | Emitted when a gladeproject’s state changes via a Gladeui.Command. | 
| close | Emitted when a project is closing (a good time to clean up any associated resources). | 
| load-progress | Emitted while project is loading. | 
| parse-began | Emitted when gladeproject parsing starts. | 
| parse-finished | Emitted when gladeproject parsing has finished. | 
| remove-signal-handler | |
| remove-widget | Emitted when a widget is removed from a project. | 
| selection-changed | Emitted when gladeproject selection list changes. | 
| targets-changed | Emitted when gladeproject target versions change. | 
| widget-name-changed | Emitted when gwidget’s name changes. | 
| widget-visibility-changed | Emitted when the visibility of a widget changed | 
Fields¶
| Inherited: | GObject.Object (1), Gtk.TreeModel (5) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| parent_instance | GObject.Object | r | 
Class Details¶
- 
class Gladeui.Project(**kwargs)¶
- Bases: - GObject.Object,- Gtk.TreeDragSource,- Gtk.TreeModel- Abstract: - No - Structure: - Gladeui.ProjectClass- 
classmethod load(path)¶
- Parameters: - path ( - str) – the path of the project to load- Returns: - a new - Gladeui.Projectfor the opened project on success,- Noneon failure- Return type: - Gladeui.Projector- None- Opens a project at the given path. 
 - 
classmethod new()¶
- Returns: - a new - Gladeui.Project- Return type: - Gladeui.Project- Creates a new - Gladeui.Project.
 - 
classmethod verify_property(property)¶
- Parameters: - property ( - Gladeui.Property) –
 - 
classmethod verify_signal(widget, signal)¶
- Parameters: - widget (Gladeui.Widget) –
- signal (Gladeui.Signal) –
 
- widget (
 - 
add_object(object)¶
- Parameters: - object ( - GObject.Object) – the- GObject.Objectto add- Adds an object to the project. 
 - 
autosave()¶
- Raises: - GLib.Error- Returns: - Trueon success,- Falseon failure- Return type: - bool- Saves an autosave snapshot of self to it’s currently set path - If the project was never saved, nothing is done and - Trueis returned.
 - 
available_widget_name(widget, name)¶
- Parameters: - widget (Gladeui.Widget) – theGladeui.Widgetintended to receive a new name
- name (str) – base name of the widget to create
 - Returns: - whether the name is available or not. - Return type: - Checks whether name is an appropriate name for widget. 
- widget (
 - 
backup(path)¶
- Parameters: - path ( - str) – location to save glade file- Raises: - GLib.Error- Returns: - Trueon success,- Falseon failure- Return type: - bool- Backup the last file which self has saved to or was loaded from. - If path is not the same as the current project path, then the current project path will be backed up under the new location. - If this the first save, and no persisted file exists, then - Trueis returned and no backup is made.
 - 
cancel_load()¶
 - 
check_reordered(parent, old_order)¶
- Parameters: - parent (Gladeui.Widget) – the parentGladeui.Widget
- old_order ([GObject.Object]) – the old order to compare with
 
- parent (
 - 
command_cut()¶
 - 
command_delete()¶
 - 
command_paste(placeholder)¶
- Parameters: - placeholder ( - Gladeui.Placeholder) –
 - 
copy_selection()¶
 - 
get_add_item()¶
- Returns: - a - Gladeui.WidgetAdaptor- Return type: - Gladeui.WidgetAdaptor
 - 
get_modified()¶
- Returns: - Trueif the project has been modified since it was last saved- Return type: - bool- Get’s whether the project has been modified since it was last saved. 
 - 
get_objects()¶
- Returns: - List of all objects in this project - Return type: - [ - GObject.Object]
 - 
get_pointer_mode()¶
- Return type: - Gladeui.PointerMode
 - 
get_readonly()¶
- Returns: - Trueif project is read only- Return type: - bool- Gets whether the project is read only or not 
 - 
get_target_version(catalog, major, minor)¶
- Parameters: - Fetches the target version of the self for catalog. 
 - 
get_template()¶
- Returns: - a - Gladeui.Widget- Return type: - Gladeui.Widget
 - 
get_widget_by_name(name)¶
- Parameters: - name ( - str) – The user visible name of the widget we are looking for- Returns: - a pointer to the widget, - Noneif the widget does not exist- Return type: - Gladeui.Widgetor- None- Searches under ancestor in self looking for a - Gladeui.Widgetnamed name.
 - 
has_object(object)¶
- Parameters: - object ( - GObject.Object) – the- GObject.Objectto search- Returns: - whether this object is in this project. - Return type: - bool
 - 
is_selected(object)¶
- Parameters: - object ( - GObject.Object) – a- GObject.Object- Returns: - whether object is in self selection - Return type: - bool
 - 
new_widget_name(widget, base_name)¶
- Parameters: - widget (Gladeui.Widget) – theGladeui.Widgetintended to receive a new name, orNone
- base_name (str) – base name of the widget to create
 - Returns: - a string containing the new name, - Noneif there is not enough memory for this string- Return type: - Creates a new name for a widget that doesn’t collide with any of the names already in self. This name will start with base_name. - Note the widget parameter is ignored and preserved only for historical reasons. 
- widget (
 - 
next_redo_item()¶
- Returns: - the - Gladeui.Command- Return type: - Gladeui.Command- Gets the next redo item on self’s command stack. 
 - 
next_undo_item()¶
- Returns: - the - Gladeui.Command- Return type: - Gladeui.Command- Gets the next undo item on self’s command stack. 
 - 
preview(gwidget)¶
- Parameters: - gwidget ( - Gladeui.Widget) – a- Gladeui.Widget- Creates and displays a preview window holding a snapshot of gwidget’s toplevel window in self. Note that the preview window is only a snapshot of the current state of the project, there is no limit on how many preview snapshots can be taken. 
 - 
properties()¶
- Runs a document properties dialog for self. 
 - 
push_progress()¶
 - 
push_undo(cmd)¶
- Parameters: - cmd ( - Gladeui.Command) – the- Gladeui.Command- Pushes a newly created - Gladeui.Commandonto projects stack.
 - 
queue_selection_changed()¶
 - 
redo()¶
- Redoes a - Gladeui.Commandin this project.
 - 
redo_items()¶
- Returns: - A newly created menu - Return type: - Gtk.Widget- Creates a menu of the undo items in the project stack 
 - 
remove_object(object)¶
- Parameters: - object ( - GObject.Object) – the- GObject.Objectto remove- Removes object from self. - Note that when removing the - GObject.Objectfrom the project we don’t change ->project in the associated- Gladeui.Widget; this way UNDO can work.
 - 
required_libs()¶
- Returns: - a - GLib.Listof allocated strings which are the names of the required catalogs for this project- Return type: - [ - str]
 - 
reset_path()¶
 - 
resource_fullpath(resource)¶
- Parameters: - resource ( - str) – The resource basename- Returns: - A newly allocated string holding the full path to the resource. - Return type: - str- Project resource strings are always relative, this function transforms a path relative to project to a full path. 
 - 
save(path)¶
- Parameters: - path ( - str) – location to save glade file- Raises: - GLib.Error- Returns: - Trueon success,- Falseon failure- Return type: - bool- Saves self to the given path. 
 - 
save_verify(path, flags)¶
- Parameters: - path (str) – location to save glade file
- flags (Gladeui.VerifyFlags) – theGladeui.VerifyFlagsto warn about
 - Raises: - Returns: - Return type: - Saves self to the given path. 
- path (
 - 
selection_add(object, emit_signal)¶
- Parameters: - object (GObject.Object) – aGObject.Objectin self
- emit_signal (bool) – whether or not to emit a signal indicating a selection change
 - Adds object to the selection chain of self - If emit_signal is - True, calls- Gladeui.Project.selection_changed().
- object (
 - 
selection_changed()¶
- Causes self to emit a “selection_changed” signal. 
 - 
selection_clear(emit_signal)¶
- Parameters: - emit_signal ( - bool) – whether or not to emit a signal indication a selection change- Clears self’s selection chain - If emit_signal is - True, calls- Gladeui.Project.selection_changed().
 - 
selection_get()¶
- Returns: - a - GLib.Listcontaining the- Gtk.Widgetitems currently selected in self- Return type: - [ - Gtk.Widget]
 - 
selection_remove(object, emit_signal)¶
- Parameters: - object (GObject.Object) – aGObject.Objectin self
- emit_signal (bool) – whether or not to emit a signal indicating a selection change
 - Removes object from the selection chain of self - If emit_signal is - True, calls- Gladeui.Project.selection_changed().
- object (
 - 
selection_set(object, emit_signal)¶
- Parameters: - object (GObject.Object) – aGObject.Objectin self
- emit_signal (bool) – whether or not to emit a signal indicating a selection change
 - Set the selection in self to object - If emit_signal is - True, calls- Gladeui.Project.selection_changed().
- object (
 - 
set_add_item(adaptor)¶
- Parameters: - adaptor ( - Gladeui.WidgetAdaptor) – a- Gladeui.WidgetAdaptor
 - 
set_css_provider_path(path)¶
- Parameters: - path ( - str) – a CSS file path- Set the custom CSS provider path to use in self 
 - 
set_pointer_mode(mode)¶
- Parameters: - mode ( - Gladeui.PointerMode) –
 - 
set_template(widget)¶
- Parameters: - widget ( - Gladeui.Widget) –
 - 
set_translation_domain(domain)¶
- Parameters: - domain ( - str) – the translation domain- Set the project translation domain. 
 - 
set_widget_name(widget, name)¶
- Parameters: - widget (Gladeui.Widget) – theGladeui.Widgetto set a name on
- name (str) – the name to set.
 - Sets name on widget in self, if name is not available then a new name will be used. 
- widget (
 - 
toplevels()¶
- Returns: - a - GLib.Listcontaining the- Gtk.Widgettoplevel items in self- Return type: - [ - Gtk.Widget]
 - 
undo()¶
- Undoes a - Gladeui.Commandin this project.
 - 
undo_items()¶
- Returns: - A newly created menu - Return type: - Gtk.Widget- Creates a menu of the undo items in the project stack 
 - 
verify(saving, flags)¶
- Parameters: - saving (bool) –
- flags (Gladeui.VerifyFlags) –
 - Return type: 
- saving (
 - 
verify_widget_adaptor(adaptor, mask)¶
- Parameters: - adaptor (Gladeui.WidgetAdaptor) – theGladeui.WidgetAdaptorto verify
- mask (Gladeui.SupportMask) – a return location for aGladeui.SupportMask
 - Returns: - A newly allocated string - Return type: - Checks the supported state of this widget adaptor and generates a string to show in the UI describing why. 
- adaptor (
 - 
widget_changed(gwidget)¶
- Parameters: - gwidget ( - Gladeui.Widget) –
 - 
widget_visibility_changed(widget, visible)¶
- Parameters: - widget (Gladeui.Widget) – The widget which visibility changed
- visible (bool) – widget visibility value
 - Emits - Gladeui.Project- ::widget-visibility-changedsignal
- widget (
 - 
do_add_object(object) virtual¶
- Parameters: - object ( - Gladeui.Widget) – the- GObject.Objectto add- Adds an object to the project. 
 - 
do_changed(command, forward) virtual¶
- Parameters: - command (Gladeui.Command) –
- forward (bool) –
 
- command (
 - 
do_close() virtual¶
 - 
do_next_redo_item() virtual¶
- Returns: - the - Gladeui.Command- Return type: - Gladeui.Command- Gets the next redo item on project’s command stack. 
 - 
do_next_undo_item() virtual¶
- Returns: - the - Gladeui.Command- Return type: - Gladeui.Command- Gets the next undo item on project’s command stack. 
 - 
do_parse_finished() virtual¶
 - 
do_push_undo(cmd) virtual¶
- Parameters: - cmd ( - Gladeui.Command) – the- Gladeui.Command- Pushes a newly created - Gladeui.Commandonto projects stack.
 - 
do_redo() virtual¶
- Redoes a - Gladeui.Commandin this project.
 - 
do_remove_object(object) virtual¶
- Parameters: - object ( - Gladeui.Widget) – the- GObject.Objectto remove- Removes object from project. - Note that when removing the - GObject.Objectfrom the project we don’t change ->project in the associated- Gladeui.Widget; this way UNDO can work.
 - 
do_selection_changed() virtual¶
- Causes project to emit a “selection_changed” signal. 
 - 
do_undo() virtual¶
- Undoes a - Gladeui.Commandin this project.
 - 
do_widget_name_changed(widget) virtual¶
- Parameters: - widget ( - Gladeui.Widget) –
 
- 
classmethod 
Signal Details¶
- 
Gladeui.Project.signals.activate_signal_handler(project, gladewidget, signal)¶
- Signal Name: - activate-signal-handler- Flags: - Parameters: - project (Gladeui.Project) – The object which received the signal
- gladewidget (Gladeui.Widget) – theGladeui.Widget
- signal (Gladeui.Signal) – theGladeui.Signalthat was activated
 
- project (
- 
Gladeui.Project.signals.add_signal_handler(project, gladewidget, signal)¶
- Signal Name: - add-signal-handler- Flags: - Parameters: - project (Gladeui.Project) – The object which received the signal
- gladewidget (Gladeui.Widget) – theGladeui.Widget
- signal (Gladeui.Signal) – theGladeui.Signalthat was added to gladewidget.
 
- project (
- 
Gladeui.Project.signals.add_widget(project, arg1)¶
- Signal Name: - add-widget- Flags: - Parameters: - project (Gladeui.Project) – The object which received the signal
- arg1 (Gladeui.Widget) – theGladeui.Widgetthat was added to gladeproject.
 - Emitted when a widget is added to a project. 
- project (
- 
Gladeui.Project.signals.change_signal_handler(project, gladewidget, old_signal, new_signal)¶
- Signal Name: - change-signal-handler- Flags: - Parameters: - project (Gladeui.Project) – The object which received the signal
- gladewidget (Gladeui.Widget) – theGladeui.Widget
- old_signal (Gladeui.Signal) – the oldGladeui.Signalthat changed
- new_signal (Gladeui.Signal) – the newGladeui.Signal
 
- project (
- 
Gladeui.Project.signals.changed(project, arg1, arg2)¶
- Signal Name: - changed- Flags: - Parameters: - project (Gladeui.Project) – The object which received the signal
- arg1 (Gladeui.Command) – theGladeui.Commandthat was executed
- arg2 (bool) – whether the command was executed or undone.
 - Emitted when a gladeproject’s state changes via a - Gladeui.Command.
- project (
- 
Gladeui.Project.signals.close(project)¶
- Signal Name: - close- Flags: - RUN_LAST- Parameters: - project ( - Gladeui.Project) – The object which received the signal- Emitted when a project is closing (a good time to clean up any associated resources). 
- 
Gladeui.Project.signals.load_progress(project, objects_total, objects_loaded)¶
- Signal Name: - load-progress- Flags: - Parameters: - project (Gladeui.Project) – The object which received the signal
- objects_total (int) – the total amount of objects to load
- objects_loaded (int) – the current amount of loaded objects
 - Emitted while project is loading. 
- project (
- 
Gladeui.Project.signals.parse_began(project)¶
- Signal Name: - parse-began- Flags: - RUN_FIRST- Parameters: - project ( - Gladeui.Project) – The object which received the signal- Emitted when gladeproject parsing starts. 
- 
Gladeui.Project.signals.parse_finished(project)¶
- Signal Name: - parse-finished- Flags: - RUN_FIRST- Parameters: - project ( - Gladeui.Project) – The object which received the signal- Emitted when gladeproject parsing has finished. 
- 
Gladeui.Project.signals.remove_signal_handler(project, gladewidget, signal)¶
- Signal Name: - remove-signal-handler- Flags: - Parameters: - project (Gladeui.Project) – The object which received the signal
- gladewidget (Gladeui.Widget) – theGladeui.Widget
- signal (Gladeui.Signal) – theGladeui.Signalthat was removed from gladewidget.
 
- project (
- 
Gladeui.Project.signals.remove_widget(project, arg1)¶
- Signal Name: - remove-widget- Flags: - Parameters: - project (Gladeui.Project) – The object which received the signal
- arg1 (Gladeui.Widget) – theGladeui.Widgetthat was removed from gladeproject.
 - Emitted when a widget is removed from a project. 
- project (
- 
Gladeui.Project.signals.selection_changed(project)¶
- Signal Name: - selection-changed- Flags: - RUN_LAST- Parameters: - project ( - Gladeui.Project) – The object which received the signal- Emitted when gladeproject selection list changes. 
- 
Gladeui.Project.signals.targets_changed(project)¶
- Signal Name: - targets-changed- Flags: - RUN_FIRST- Parameters: - project ( - Gladeui.Project) – The object which received the signal- Emitted when gladeproject target versions change. 
- 
Gladeui.Project.signals.widget_name_changed(project, arg1)¶
- Signal Name: - widget-name-changed- Flags: - Parameters: - project (Gladeui.Project) – The object which received the signal
- arg1 (Gladeui.Widget) – theGladeui.Widgetwho’s name changed.
 - Emitted when gwidget’s name changes. 
- project (
- 
Gladeui.Project.signals.widget_visibility_changed(project, widget, visible)¶
- Signal Name: - widget-visibility-changed- Flags: - Parameters: - project (Gladeui.Project) – The object which received the signal
- widget (Gladeui.Widget) – the widget that its visibility changed
- visible (bool) – the current visibility of the widget
 - Emitted when the visibility of a widget changed 
- project (
Property Details¶
- 
Gladeui.Project.props.add_item¶
- Name: - add-item- Type: - Gladeui.WidgetAdaptor- Default Value: - None- Flags: - READABLE- The current item to add to the project 
- 
Gladeui.Project.props.css_provider_path¶
- Name: - css-provider-path- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE- Path to use as the custom CSS provider for this project. 
- 
Gladeui.Project.props.has_selection¶
- Name: - has-selection- Type: - bool- Default Value: - False- Flags: - READABLE- Whether project has a selection 
- 
Gladeui.Project.props.license¶
- Name: - license- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE- License for this project, it will be added as a document level comment. 
- 
Gladeui.Project.props.modified¶
- Name: - modified- Type: - bool- Default Value: - False- Flags: - READABLE- Whether project has been modified since it was last saved 
- 
Gladeui.Project.props.path¶
- Name: - path- Type: - str- Default Value: - None- Flags: - READABLE- The filesystem path of the project 
- 
Gladeui.Project.props.pointer_mode¶
- Name: - pointer-mode- Type: - Gladeui.PointerMode- Default Value: - Gladeui.PointerMode.SELECT- Flags: - READABLE- The currently effective - Gladeui.PointerMode
- 
Gladeui.Project.props.read_only¶
- Name: - read-only- Type: - bool- Default Value: - False- Flags: - READABLE- Whether project is read-only 
- 
Gladeui.Project.props.resource_path¶
- Name: - resource-path- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE- Path to load images and resources in Glade’s runtime 
- 
Gladeui.Project.props.template¶
- Name: - template- Type: - Gladeui.Widget- Default Value: - None- Flags: - READABLE,- WRITABLE- The project’s template widget, if any