## PhoshSystemModalDialog

PhoshSystemModalDialog — A modal system dialog

## Functions

GtkWidget * | phosh_system_modal_dialog_new ()
void | phosh_system_modal_dialog_set_content ()
void | phosh_system_modal_dialog_add_button ()
void | phosh_system_modal_dialog_set_title ()
void | phosh_system_modal_dialog_remove_button ()
GList * | phosh_system_modal_dialog_get_buttons ()

## Properties

char * | title | Read / Write

## Signals

void | dialog-canceled | Run Last

## Types and Values

#define | PHOSH_TYPE_SYSTEM_MODAL_DIALOG
struct | PhoshSystemModalDialogClass
| PhoshSystemModalDialog

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkWindow
                            ╰── PhoshLayerSurface
                                ╰── PhoshSystemModal
                                    ╰── PhoshSystemModalDialog
                                        ├── PhoshAppAuthPrompt
                                        ├── PhoshEndSessionDialog
                                        ├── PhoshGtkMountPrompt
                                        ├── PhoshNetworkAuthPrompt
                                        ├── PhoshPolkitAuthPrompt
                                        ├── PhoshRunCommandDialog
                                        ╰── PhoshSystemPrompt

## Implemented Interfaces

PhoshSystemModalDialog implements AtkImplementorIface and GtkBuildable.

## Description

The PhoshSystemModalDialog is used as a base class for system modal dialogs such as PhoshSystemPrompt or PhoshNetworkAuthPrompt. It consists of a title at the top, a content widget below that and button are at the bottom. The content widget can be set via ``phosh_system_modal_dialog_set_content()`` and buttons to the button area added via ``phosh_system_modal_dialog_add_button()``.

### CSS Style classes

A system modal dialog uses several style classes for consistent layout: ".phosh-system-modal-dialog" for the whole dialog area, ".phosh-system-modal-dialog-title" for the dialog title, ".phosh-system-modal-dialog-content" for the content area and ".phosh-system-modal-dialog-buttons" for the button area.

### PhoshSystemModalDialog as GtkBuildable

The content widget and buttons can be specified using type <phosh-dialog-content> and <phosh-dialog-button> type attributes:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23

    <object class="PhoshSystemModalDialog"/>
      <child type="phosh-dialog-content">
        <object class="GtkBox">
          <property name="visible">True</property>
          <property name="orientation">vertical</property>
          <child>
            ...
          </child>
        </object>
      </child>
      <child type="phosh-dialog-button">
        <object class="GtkButton">
          <property name="label">Ok</property>
          ...
        </object>
      </child>
      <child type="phosh-dialog-button">
        <object class="GtkButton">
          <property name="label">Cancel</property>
          ...
        </object>
      </child>
    </object>

## Functions

### phosh_system_modal_dialog_new ()

    GtkWidget *
    phosh_system_modal_dialog_new (void);

Create a new system-modal dialog.

#### Returns

A new system modal dialog

### phosh_system_modal_dialog_set_content ()

    void
    phosh_system_modal_dialog_set_content (PhoshSystemModalDialog *self,
                                           GtkWidget *content);

Adds the given widget as the dialog's content area. It is a programming error to set the content more than once.

#### Parameters

self | The PhoshSystemModalDialog |
content | The widget for the dialog's content area |

### phosh_system_modal_dialog_add_button ()

    void
    phosh_system_modal_dialog_add_button (PhoshSystemModalDialog *self,
                                          GtkWidget *button,
                                          gint position);

Adds the given button to the dialog's content area at the given position. If the posiion is `-1` the button is appended at the end.

#### Parameters

self | The PhoshSystemModalDialog |
button | The button for the dialog's button area |
position | The buttons position in the box or -1 |

### phosh_system_modal_dialog_set_title ()

    void
    phosh_system_modal_dialog_set_title (PhoshSystemModalDialog *self,
                                         const gchar *title);

### phosh_system_modal_dialog_remove_button ()

    void
    phosh_system_modal_dialog_remove_button
                                   (PhoshSystemModalDialog *self,
                                    GtkWidget *button);

### phosh_system_modal_dialog_get_buttons ()

    GList *
    phosh_system_modal_dialog_get_buttons (PhoshSystemModalDialog *self);

## Types and Values

### PHOSH_TYPE_SYSTEM_MODAL_DIALOG

    #define PHOSH_TYPE_SYSTEM_MODAL_DIALOG (phosh_system_modal_dialog_get_type ())

### struct PhoshSystemModalDialogClass

    struct PhoshSystemModalDialogClass {
      PhoshSystemModalClass parent_class;
    };

#### Members

### PhoshSystemModalDialog

    typedef struct _PhoshSystemModalDialog PhoshSystemModalDialog;

## Property Details

### The `“title”` property

      “title”                    char *

The dialogs title.

Owner: PhoshSystemModalDialog

Flags: Read / Write

Default value: NULL

## Signal Details

### The `“dialog-canceled”` signal

    void
    user_function (PhoshSystemModalDialog *phoshsystemmodaldialog,
                   gpointer                user_data)

The ::dialog-done signal is emitted when the dialog was canceled and should be hidden or destroyed.

#### Parameters

user_data | user data set when the signal handler was connected. |

Flags: Run Last