Add set-title-dialog.ui
parent
1001bacc67
commit
e516b0a2c8
|
@ -13,6 +13,7 @@ src/profile-editor.c
|
||||||
src/profile-manager.ui
|
src/profile-manager.ui
|
||||||
src/profile-new-dialog.ui
|
src/profile-new-dialog.ui
|
||||||
src/profile-preferences.ui
|
src/profile-preferences.ui
|
||||||
|
src/set-title-dialog.ui
|
||||||
src/skey-challenge.ui
|
src/skey-challenge.ui
|
||||||
src/skey-popup.c
|
src/skey-popup.c
|
||||||
src/terminal-accels.c
|
src/terminal-accels.c
|
||||||
|
|
|
@ -165,6 +165,7 @@ EXTRA_DIST = \
|
||||||
profile-manager.ui \
|
profile-manager.ui \
|
||||||
profile-new-dialog.ui \
|
profile-new-dialog.ui \
|
||||||
profile-preferences.ui \
|
profile-preferences.ui \
|
||||||
|
set-title-dialog.ui \
|
||||||
skey-challenge.ui \
|
skey-challenge.ui \
|
||||||
terminal.about \
|
terminal.about \
|
||||||
terminal.xml \
|
terminal.xml \
|
||||||
|
|
|
@ -0,0 +1,128 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.22.2 -->
|
||||||
|
<interface>
|
||||||
|
<requires lib="gtk+" version="3.20"/>
|
||||||
|
<object class="GtkImage" id="image1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="icon_name">process-stop</property>
|
||||||
|
</object>
|
||||||
|
<object class="GtkImage" id="image2">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="icon_name">gtk-ok</property>
|
||||||
|
</object>
|
||||||
|
<object class="GtkDialog" id="dialog">
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="border_width">5</property>
|
||||||
|
<property name="title" translatable="yes">Set Title</property>
|
||||||
|
<property name="role">mate-terminal-change-title</property>
|
||||||
|
<property name="modal">True</property>
|
||||||
|
<property name="destroy_with_parent">True</property>
|
||||||
|
<property name="type_hint">dialog</property>
|
||||||
|
<child type="titlebar">
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child internal-child="vbox">
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<child internal-child="action_area">
|
||||||
|
<object class="GtkButtonBox">
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="homogeneous">True</property>
|
||||||
|
<property name="layout_style">expand</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="button1">
|
||||||
|
<property name="label" translatable="yes">_Cancel</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="image">image1</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
<property name="always_show_image">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="button2">
|
||||||
|
<property name="label" translatable="yes">_OK</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="can_default">True</property>
|
||||||
|
<property name="has_default">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="image">image2</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
<property name="always_show_image">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<style>
|
||||||
|
<class name="linked"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="margin_left">12</property>
|
||||||
|
<property name="margin_right">12</property>
|
||||||
|
<property name="spacing">12</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">_Title:</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
<property name="mnemonic_widget">title_entry</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="title_entry">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="width_chars">30</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<action-widgets>
|
||||||
|
<action-widget response="-6">button1</action-widget>
|
||||||
|
<action-widget response="-5">button2</action-widget>
|
||||||
|
</action-widgets>
|
||||||
|
</object>
|
||||||
|
</interface>
|
|
@ -4224,53 +4224,29 @@ static void
|
||||||
terminal_set_title_callback (GtkAction *action,
|
terminal_set_title_callback (GtkAction *action,
|
||||||
TerminalWindow *window)
|
TerminalWindow *window)
|
||||||
{
|
{
|
||||||
|
GtkBuilder *builder;
|
||||||
TerminalWindowPrivate *priv = window->priv;
|
TerminalWindowPrivate *priv = window->priv;
|
||||||
GtkWidget *dialog, *message_area, *hbox, *label, *entry;
|
GtkWidget *dialog, *entry;
|
||||||
|
|
||||||
if (priv->active_screen == NULL)
|
if (priv->active_screen == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* FIXME: hook the screen up so this dialogue closes if the terminal screen closes */
|
builder = gtk_builder_new_from_resource (TERMINAL_RESOURCES_PATH_PREFIX G_DIR_SEPARATOR_S "ui/set-title-dialog.ui");
|
||||||
|
dialog = GTK_WIDGET (gtk_builder_get_object (builder, "dialog"));
|
||||||
|
entry = GTK_WIDGET (gtk_builder_get_object (builder, "title_entry"));
|
||||||
|
g_object_unref (builder);
|
||||||
|
|
||||||
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
|
gtk_widget_grab_focus (entry);
|
||||||
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
gtk_entry_set_text (GTK_ENTRY (entry), terminal_screen_get_raw_title (priv->active_screen));
|
||||||
GTK_MESSAGE_OTHER,
|
gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
|
||||||
GTK_BUTTONS_OK_CANCEL,
|
g_object_set_data (G_OBJECT (dialog), "title-entry", entry);
|
||||||
"%s", "");
|
|
||||||
|
|
||||||
gtk_window_set_title (GTK_WINDOW (dialog), _("Set Title"));
|
|
||||||
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
|
|
||||||
gtk_window_set_role (GTK_WINDOW (dialog), "mate-terminal-change-title");
|
|
||||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
|
|
||||||
/* Alternative button order was set automatically by GtkMessageDialog */
|
|
||||||
|
|
||||||
g_signal_connect (dialog, "response",
|
g_signal_connect (dialog, "response",
|
||||||
G_CALLBACK (terminal_set_title_dialog_response_cb), priv->active_screen);
|
G_CALLBACK (terminal_set_title_dialog_response_cb), priv->active_screen);
|
||||||
g_signal_connect (dialog, "delete-event",
|
g_signal_connect (dialog, "delete-event",
|
||||||
G_CALLBACK (terminal_util_dialog_response_on_delete), NULL);
|
G_CALLBACK (terminal_util_dialog_response_on_delete), NULL);
|
||||||
|
|
||||||
message_area = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (dialog));
|
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
|
||||||
gtk_container_foreach (GTK_CONTAINER (message_area), (GtkCallback) gtk_widget_hide, NULL);
|
|
||||||
|
|
||||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
|
|
||||||
gtk_box_pack_start (GTK_BOX (message_area), hbox, FALSE, FALSE, 0);
|
|
||||||
|
|
||||||
label = gtk_label_new_with_mnemonic (_("_Title:"));
|
|
||||||
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
|
|
||||||
gtk_label_set_yalign (GTK_LABEL (label), 0.5);
|
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
|
||||||
|
|
||||||
entry = gtk_entry_new ();
|
|
||||||
gtk_entry_set_width_chars (GTK_ENTRY (entry), 32);
|
|
||||||
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
|
|
||||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
|
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
|
|
||||||
gtk_widget_show_all (hbox);
|
|
||||||
|
|
||||||
gtk_widget_grab_focus (entry);
|
|
||||||
gtk_entry_set_text (GTK_ENTRY (entry), terminal_screen_get_raw_title (priv->active_screen));
|
|
||||||
gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
|
|
||||||
g_object_set_data (G_OBJECT (dialog), "title-entry", entry);
|
|
||||||
|
|
||||||
gtk_window_present (GTK_WINDOW (dialog));
|
gtk_window_present (GTK_WINDOW (dialog));
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
<file compressed="true" preprocess="xml-stripblanks">profile-manager.ui</file>
|
<file compressed="true" preprocess="xml-stripblanks">profile-manager.ui</file>
|
||||||
<file compressed="true" preprocess="xml-stripblanks">profile-new-dialog.ui</file>
|
<file compressed="true" preprocess="xml-stripblanks">profile-new-dialog.ui</file>
|
||||||
<file compressed="true" preprocess="xml-stripblanks">profile-preferences.ui</file>
|
<file compressed="true" preprocess="xml-stripblanks">profile-preferences.ui</file>
|
||||||
|
<file compressed="true" preprocess="xml-stripblanks">set-title-dialog.ui</file>
|
||||||
<file compressed="true" preprocess="xml-stripblanks">skey-challenge.ui</file>
|
<file compressed="true" preprocess="xml-stripblanks">skey-challenge.ui</file>
|
||||||
<file compressed="true" preprocess="xml-stripblanks">terminal.xml</file>
|
<file compressed="true" preprocess="xml-stripblanks">terminal.xml</file>
|
||||||
<file compressed="true">terminal.about</file>
|
<file compressed="true">terminal.about</file>
|
||||||
|
|
Loading…
Reference in New Issue