Gladeui.Project¶
- Subclasses:
None
Methods¶
- Inherited:
GObject.Object (37), Gtk.TreeDragSource (3), Gtk.TreeModel (28)
- Structs:
Virtual Methods¶
- Inherited:
GObject.Object (7), Gtk.TreeDragSource (3), Gtk.TreeModel (19)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
The current item to add to the project |
||
r/w |
Path to use as the custom CSS provider for this project. |
||
r |
Whether project has a selection |
||
r/w |
License for this project, it will be added as a document level comment. |
||
r |
Whether project has been modified since it was last saved |
||
r |
The filesystem path of the project |
||
r |
The currently effective |
||
r |
Whether project is read-only |
||
r/w |
Path to load images and resources in Glade’s runtime |
||
r/w |
The project’s template widget, if any |
||
r/w |
The project translation domain |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when a widget is added to a project. |
|
Emitted when a gladeproject's state changes via a |
|
Emitted when a project is closing (a good time to clean up any associated resources). |
|
Emitted while project is loading. |
|
Emitted when gladeproject parsing starts. |
|
Emitted when gladeproject parsing has finished. |
|
Emitted when a widget is removed from a project. |
|
Emitted when gladeproject selection list changes. |
|
Emitted when gladeproject target versions change. |
|
Emitted when gwidget's name changes. |
|
Emitted when the visibility of a widget changed |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gladeui.Project(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod load(path)¶
- Parameters:
path (
str
) – the path of the project to load- Returns:
a new
Gladeui.Project
for the opened project on success,None
on failure- Return type:
Opens a project at the given path.
- classmethod new()¶
- Returns:
a new
Gladeui.Project
- Return type:
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
) –
- add_object(object)¶
- Parameters:
object (
GObject.Object
) – theGObject.Object
to add
Adds an object to the project.
- autosave()¶
- Raises:
- Returns:
- Return type:
Saves an autosave snapshot of self to it’s currently set path
If the project was never saved, nothing is done and
True
is returned.
- available_widget_name(widget, name)¶
- Parameters:
widget (
Gladeui.Widget
) – theGladeui.Widget
intended to receive a new namename (
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.
- backup(path)¶
- Parameters:
path (
str
) – location to save glade file- Raises:
- Returns:
- Return type:
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
True
is 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
- command_cut()¶
- command_delete()¶
- command_paste(placeholder)¶
- Parameters:
placeholder (
Gladeui.Placeholder
) –
- copy_selection()¶
- get_add_item()¶
- Returns:
- Return type:
- get_css_provider_path()¶
- Returns:
the CSS path of the custom provider used for self
- Return type:
- get_modified()¶
-
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:
- get_pointer_mode()¶
- Return type:
- get_readonly()¶
-
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:
- Return type:
- 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,
None
if the widget does not exist- Return type:
Searches under ancestor in self looking for a
Gladeui.Widget
named name.
- has_object(object)¶
- Parameters:
object (
GObject.Object
) – theGObject.Object
to search- Returns:
whether this object is in this project.
- Return type:
- is_selected(object)¶
- Parameters:
object (
GObject.Object
) – aGObject.Object
- Returns:
whether object is in self selection
- Return type:
- new_widget_name(widget, base_name)¶
- Parameters:
widget (
Gladeui.Widget
) – theGladeui.Widget
intended to receive a new name, orNone
base_name (
str
) – base name of the widget to create
- Returns:
a string containing the new name,
None
if 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.
- next_redo_item()¶
- Returns:
the
Gladeui.Command
- Return type:
Gets the next redo item on self's command stack.
- next_undo_item()¶
- Returns:
the
Gladeui.Command
- Return type:
Gets the next undo item on self's command stack.
- preview(gwidget)¶
- Parameters:
gwidget (
Gladeui.Widget
) – aGladeui.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
) – theGladeui.Command
Pushes a newly created
Gladeui.Command
onto projects stack.
- queue_selection_changed()¶
- redo()¶
Redoes a
Gladeui.Command
in this project.
- redo_items()¶
- Returns:
A newly created menu
- Return type:
Creates a menu of the undo items in the project stack
- remove_object(object)¶
- Parameters:
object (
GObject.Object
) – theGObject.Object
to remove
Removes object from self.
Note that when removing the
GObject.Object
from the project we don’t change ->project in the associatedGladeui.Widget
; this way UNDO can work.
- required_libs()¶
- 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:
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:
- Returns:
- Return type:
Saves self to the given path.
- save_verify(path, flags)¶
- Parameters:
path (
str
) – location to save glade fileflags (
Gladeui.VerifyFlags
) – theGladeui.VerifyFlags
to warn about
- Raises:
- Returns:
- Return type:
Saves self to the given path.
- selection_add(object, emit_signal)¶
- Parameters:
object (
GObject.Object
) – aGObject.Object
in selfemit_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
, callsGladeui.Project.selection_changed
().
- 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
, callsGladeui.Project.selection_changed
().
- selection_get()¶
- Returns:
a
GLib.List
containing theGtk.Widget
items currently selected in self- Return type:
- selection_remove(object, emit_signal)¶
- Parameters:
object (
GObject.Object
) – aGObject.Object
in selfemit_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
, callsGladeui.Project.selection_changed
().
- selection_set(object, emit_signal)¶
- Parameters:
object (
GObject.Object
) – aGObject.Object
in selfemit_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
, callsGladeui.Project.selection_changed
().
- set_add_item(adaptor)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor
) – aGladeui.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.Widget
to set a name onname (
str
) – the name to set.
Sets name on widget in self, if name is not available then a new name will be used.
- toplevels()¶
- Returns:
a
GLib.List
containing theGtk.Widget
toplevel items in self- Return type:
- undo()¶
Undoes a
Gladeui.Command
in this project.
- undo_items()¶
- Returns:
A newly created menu
- Return type:
Creates a menu of the undo items in the project stack
- verify(saving, flags)¶
- Parameters:
saving (
bool
) –flags (
Gladeui.VerifyFlags
) –
- Return type:
- verify_widget_adaptor(adaptor, mask)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor
) – theGladeui.WidgetAdaptor
to verifymask (
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.
- widget_changed(gwidget)¶
- Parameters:
gwidget (
Gladeui.Widget
) –
- widget_visibility_changed(widget, visible)¶
- Parameters:
widget (
Gladeui.Widget
) – The widget which visibility changedvisible (
bool
) – widget visibility value
Emits
Gladeui.Project
::widget-visibility-changed
signal
- do_add_object(object) virtual¶
- Parameters:
object (
Gladeui.Widget
) – theGObject.Object
to add
Adds an object to the project.
- do_changed(command, forward) virtual¶
- Parameters:
command (
Gladeui.Command
) –forward (
bool
) –
- do_close() virtual¶
- do_next_redo_item() virtual¶
- Returns:
the
Gladeui.Command
- Return type:
Gets the next redo item on project's command stack.
- do_next_undo_item() virtual¶
- Returns:
the
Gladeui.Command
- Return type:
Gets the next undo item on project's command stack.
- do_parse_finished() virtual¶
- do_push_undo(cmd) virtual¶
- Parameters:
cmd (
Gladeui.Command
) – theGladeui.Command
Pushes a newly created
Gladeui.Command
onto projects stack.
- do_redo() virtual¶
Redoes a
Gladeui.Command
in this project.
- do_remove_object(object) virtual¶
- Parameters:
object (
Gladeui.Widget
) – theGObject.Object
to remove
Removes object from project.
Note that when removing the
GObject.Object
from the project we don’t change ->project in the associatedGladeui.Widget
; this way UNDO can work.
- do_selection_changed() virtual¶
Causes project to emit a “selection_changed” signal.
- do_undo() virtual¶
Undoes a
Gladeui.Command
in this project.
- do_widget_name_changed(widget) virtual¶
- Parameters:
widget (
Gladeui.Widget
) –
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 signalgladewidget (
Gladeui.Widget
) – theGladeui.Widget
signal (
Gladeui.Signal
) – theGladeui.Signal
that was activated
- Gladeui.Project.signals.add_signal_handler(project, gladewidget, signal)¶
- Signal Name:
add-signal-handler
- Flags:
- Parameters:
project (
Gladeui.Project
) – The object which received the signalgladewidget (
Gladeui.Widget
) – theGladeui.Widget
signal (
Gladeui.Signal
) – theGladeui.Signal
that was added to gladewidget.
- Gladeui.Project.signals.add_widget(project, arg1)¶
- Signal Name:
add-widget
- Flags:
- Parameters:
project (
Gladeui.Project
) – The object which received the signalarg1 (
Gladeui.Widget
) – theGladeui.Widget
that was added to gladeproject.
Emitted when a widget is added to a 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 signalgladewidget (
Gladeui.Widget
) – theGladeui.Widget
old_signal (
Gladeui.Signal
) – the oldGladeui.Signal
that changednew_signal (
Gladeui.Signal
) – the newGladeui.Signal
- Gladeui.Project.signals.changed(project, arg1, arg2)¶
- Signal Name:
changed
- Flags:
- Parameters:
project (
Gladeui.Project
) – The object which received the signalarg1 (
Gladeui.Command
) – theGladeui.Command
that was executedarg2 (
bool
) – whether the command was executed or undone.
Emitted when a gladeproject's state changes via a
Gladeui.Command
.
- Gladeui.Project.signals.close(project)¶
- Signal Name:
close
- Flags:
- 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 signalobjects_total (
int
) – the total amount of objects to loadobjects_loaded (
int
) – the current amount of loaded objects
Emitted while project is loading.
- Gladeui.Project.signals.parse_began(project)¶
- Signal Name:
parse-began
- Flags:
- 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:
- 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 signalgladewidget (
Gladeui.Widget
) – theGladeui.Widget
signal (
Gladeui.Signal
) – theGladeui.Signal
that was removed from gladewidget.
- Gladeui.Project.signals.remove_widget(project, arg1)¶
- Signal Name:
remove-widget
- Flags:
- Parameters:
project (
Gladeui.Project
) – The object which received the signalarg1 (
Gladeui.Widget
) – theGladeui.Widget
that was removed from gladeproject.
Emitted when a widget is removed from a project.
- Gladeui.Project.signals.selection_changed(project)¶
- Signal Name:
selection-changed
- Flags:
- 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:
- 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 signalarg1 (
Gladeui.Widget
) – theGladeui.Widget
who’s name changed.
Emitted when gwidget's name changes.
- Gladeui.Project.signals.widget_visibility_changed(project, widget, visible)¶
- Signal Name:
widget-visibility-changed
- Flags:
- Parameters:
project (
Gladeui.Project
) – The object which received the signalwidget (
Gladeui.Widget
) – the widget that its visibility changedvisible (
bool
) – the current visibility of the widget
Emitted when the visibility of a widget changed
Property Details¶
- Gladeui.Project.props.add_item¶
- Name:
add-item
- Type:
- Default Value:
- Flags:
The current item to add to the project
- Gladeui.Project.props.css_provider_path¶
-
Path to use as the custom CSS provider for this project.
- Gladeui.Project.props.has_selection¶
-
Whether project has a selection
- Gladeui.Project.props.license¶
-
License for this project, it will be added as a document level comment.
- Gladeui.Project.props.modified¶
-
Whether project has been modified since it was last saved
- Gladeui.Project.props.path¶
-
The filesystem path of the project
- Gladeui.Project.props.pointer_mode¶
- Name:
pointer-mode
- Type:
- Default Value:
- Flags:
The currently effective
Gladeui.PointerMode
- Gladeui.Project.props.read_only¶
-
Whether project is read-only
- Gladeui.Project.props.resource_path¶
-
Path to load images and resources in Glade’s runtime
- Gladeui.Project.props.template¶
- Name:
template
- Type:
- Default Value:
- Flags:
The project’s template widget, if any