Tepl.File

g GObject.Object GObject.Object Tepl.File Tepl.File GObject.Object->Tepl.File

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

chooser_set_modal (chooser, modal)

class

chooser_set_parent (chooser, parent)

class

chooser_show (chooser)

class

new ()

add_uri_to_recent_manager ()

get_full_name ()

get_location ()

get_newline_type ()

get_short_name ()

set_location (location)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

full-name

str

r

location

Gio.File

r/w/c

newline-type

Tepl.NewlineType

r

short-name

str

r

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Tepl.File(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Tepl.FileClass

classmethod chooser_set_modal(chooser, modal)
Parameters:

Calls either Gtk.NativeDialog.set_modal() or Gtk.Window.set_modal() depending on the chooser type.

New in version 5.0.

classmethod chooser_set_parent(chooser, parent)
Parameters:

Sets or unsets a parent Gtk.Window for the chooser dialog. It calls the right functions depending on the type of chooser.

New in version 5.0.

classmethod chooser_show(chooser)
Parameters:

chooser (Gtk.FileChooser) – a Gtk.FileChooser.

Calls Gtk.NativeDialog.show() or Gtk.Window.present() depending on the type of chooser.

New in version 5.0.

classmethod new()
Returns:

a new Tepl.File object.

Return type:

Tepl.File

New in version 1.0.

add_uri_to_recent_manager()

If the Tepl.File :location isn’t None, adds its URI to the default Gtk.RecentManager with Gtk.RecentManager.add_item().

New in version 4.0.

get_full_name()
Returns:

the value of the Tepl.File :full-name property. Free with GLib.free().

Return type:

str

New in version 6.4.

get_location()
Returns:

the value of the Tepl.File :location property.

Return type:

Gio.File

New in version 1.0.

get_newline_type()
Returns:

the value of the Tepl.File :newline-type property.

Return type:

Tepl.NewlineType

New in version 1.0.

get_short_name()
Returns:

the value of the Tepl.File :short-name property. Free with GLib.free().

Return type:

str

New in version 5.0.

set_location(location)
Parameters:

location (Gio.File or None) – the new Gio.File, or None.

Sets the Tepl.File :location property.

New in version 1.0.

Property Details

Tepl.File.props.full_name
Name:

full-name

Type:

str

Default Value:

None

Flags:

READABLE

Convenience property for the full name of a Tepl.File.

When the Tepl.File :location is None, this property has the same value as the Tepl.File :short-name.

When the Tepl.File :location is not None, this property contains the full path to the location. It uses:

Tepl.File.props.location
Name:

location

Type:

Gio.File

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The location.

New in version 1.0.

Tepl.File.props.newline_type
Name:

newline-type

Type:

Tepl.NewlineType

Default Value:

Tepl.NewlineType.LF

Flags:

READABLE

The line ending type.

New in version 1.0.

Tepl.File.props.short_name
Name:

short-name

Type:

str

Default Value:

None

Flags:

READABLE

The file short name.

When the Tepl.File :location is None, this property contains by default “Untitled File N” (translated), with N the Nth untitled file of the application, starting at 1. When an untitled file is closed (when the Tepl.File is freed) or its Tepl.File :location is set, its untitled number is released and can be used by a later file.

See tepl_file_set_untitled_file_callback() to customize the string. Other examples: “Unsaved” instead of “Untitled”, or “Document” instead of “File”.

When the Tepl.File :location is not None, this property contains the display-name (see Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME). However, requesting the display-name can take some time (for example for a remote file with a slow network connection). When the Tepl.File :location property is set, the display-name is fetched asynchronously. When the display-name is available, this property is notified. In the meantime – after the Tepl.File :location is set but before receiving the display-name – a fallback implementation is used that does no blocking I/O (but it may return a different result compared to the real display-name).

New in version 1.0.