debug_enter ();
debug_assert (TILDA_IS_TERMINAL(tt));
+ TildaWindow *parent_window = TILDA_WINDOW(tt->parent_window);
gchar *object_path;
// Register this object with DBus
object_path = g_strdup_printf ("/net/sourceforge/Tilda/Window%d/Terminal%d",
- tt->window_number, tt->number);
+ parent_window->number, tt->number);
dbus_g_connection_register_g_object (dbus_connection, object_path, G_OBJECT(tt));
g_free (object_path);
}
+gboolean
+tilda_terminal_run_command (TildaTerminal *self, gchar *command, GError **error)
+{
+ debug_enter ();
+ debug_assert (TILDA_IS_TERMINAL(self));
+
+ vte_terminal_feed_child (VTE_TERMINAL(self->vte_term), command, -1);
+ vte_terminal_feed_child (VTE_TERMINAL(self->vte_term), "\n", -1);
+
+ return TRUE;
+}
+
+gboolean
+tilda_terminal_close (TildaTerminal *self, GError **error)
+{
+ debug_enter ();
+ debug_assert (TILDA_IS_TERMINAL(self));
+
+ TildaWindow *parent_window = TILDA_WINDOW(self->parent_window);
+
+ tilda_window_remove_terminal (parent_window, self->number);
+
+ return TRUE;
+}
+
/**
* Start the current tt->shell in the given TildaTerminal
* NOTE: this will kill whatever is running in the terminal,
switch (self->exit_action)
{
case EXIT_TERMINAL:
- tilda_window_remove_term (TILDA_WINDOW(self->parent_window), self->number);
+ tilda_window_remove_terminal (TILDA_WINDOW(self->parent_window), self->number);
break;
case RESTART_COMMAND:
vte_terminal_feed (VTE_TERMINAL(self->vte_term), "\r\n\r\n", 4);
enum tilda_terminal_properties {
TILDA_TERMINAL_NUMBER = 1,
- TILDA_TERMINAL_WINDOW_NUMBER,
- TILDA_TERMINAL_TW,
+ TILDA_TERMINAL_PARENT_WINDOW,
/* All non-constructor-only properties */
TILDA_TERMINAL_BACKGROUND_IMAGE,
debug_printf ("terminal number: %d\n", self->number);
break;
- case TILDA_TERMINAL_WINDOW_NUMBER:
- self->window_number = g_value_get_int (value);
- debug_printf ("terminal parent window number: %d\n", self->window_number);
- break;
-
- case TILDA_TERMINAL_TW:
+ case TILDA_TERMINAL_PARENT_WINDOW:
self->parent_window = g_value_get_pointer (value);
debug_printf ("terminal parent window: 0x%x\n", self->parent_window);
break;
g_value_set_int (value, self->number);
break;
- case TILDA_TERMINAL_WINDOW_NUMBER:
- g_value_set_int (value, self->window_number);
- break;
-
- case TILDA_TERMINAL_TW:
+ case TILDA_TERMINAL_PARENT_WINDOW:
g_value_set_pointer (value, self->parent_window);
break;
construct_properties);
/* Do other stuff here. The object is ready to go now, and all
- * ctor properties have been set.
- *
- * TODO: This is the place to do DBus-init */
+ * ctor properties have been set. */
self = TILDA_TERMINAL(obj);
/* Pack into the hbox */
* Here, complete object destruction.
* You might not need to do much...
*/
-
- // TODO: g_free() any primitives here
g_free (self->background_image);
g_free (self->shell);
g_free (self->font);
/* Install all of the properties */
pspec = g_param_spec_int ("number",
- "Terminal number",
- "Set terminal's number",
+ _("Terminal number"),
+ NULL,
0, // min value
INT_MAX, // max value
0, // def value
TILDA_TERMINAL_NUMBER,
pspec);
- pspec = g_param_spec_int ("window-number",
- "Number of the window to which this terminal belongs",
- "Set the number of the parent window",
- 0,
- INT_MAX,
- 0x0000beef,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
-
- g_object_class_install_property (gobject_class,
- TILDA_TERMINAL_WINDOW_NUMBER,
- pspec);
-
pspec = g_param_spec_pointer ("parent-window",
- "Pointer to terminal's parent TildaWindow",
- "Set the pointer to the terminal's parent TildaWindow",
+ _("Pointer to terminal's parent TildaWindow"),
+ NULL,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
- TILDA_TERMINAL_TW,
+ TILDA_TERMINAL_PARENT_WINDOW,
pspec);
pspec = g_param_spec_string ("background-image",
- "Terminal's background image",
- "Get/Set terminal's background image",
+ _("Terminal's background image"),
+ NULL,
NULL,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_string ("shell",
- "Terminal's shell",
- "Get/Set terminal's shell",
+ _("Terminal's shell"),
+ NULL,
NULL,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_string ("font",
- "Terminal's font",
- "Get/Set terminal's font",
+ _("Terminal's font"),
+ NULL,
NULL,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_string ("title",
- "Terminal's title",
- "Get/Set terminal's title",
+ _("Terminal's title"),
+ NULL,
NULL,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_string ("working-directory",
- "Terminal's initial working directory",
- "Get/Set terminal's initial working directory",
+ _("Terminal's initial working directory"),
+ NULL,
NULL,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_string ("web-browser",
- "Terminal's web browser command",
+ _("Terminal's web browser command"),
NULL,
NULL,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_int ("scrollback-lines",
- "Terminal's scrollback amount (lines)",
- "Get/Set terminal's scrollback amount",
+ _("Terminal's scrollback amount (lines)"),
+ NULL,
0,
INT_MAX, // TODO: artificially limit this?
1000,
pspec);
pspec = g_param_spec_int ("transparency-percent",
- "Terminal's transparency (percent)",
- "Get/Set terminal's transparency",
+ _("Terminal's transparency (percent)"),
+ NULL,
0,
100,
0,
pspec);
pspec = g_param_spec_int ("backspace-binding",
- "Terminal's backspace binding",
- "Get/Set terminal's backspace key binding",
+ _("Terminal's backspace binding"),
+ NULL,
VTE_ERASE_AUTO,
VTE_ERASE_DELETE_SEQUENCE,
VTE_ERASE_AUTO,
pspec);
pspec = g_param_spec_int ("delete-binding",
- "Terminal's delete binding",
- "Get/Set terminal's delete key binding",
+ _("Terminal's delete binding"),
+ NULL,
VTE_ERASE_AUTO,
VTE_ERASE_DELETE_SEQUENCE,
VTE_ERASE_AUTO,
pspec);
pspec = g_param_spec_int ("dynamic-title",
- "Terminal's dynamic title generation method",
- "Get/Set terminal's dynamic title generation method",
+ _("Terminal's dynamic title generation method"),
+ NULL,
0,
INT_MAX,
0,
pspec);
pspec = g_param_spec_int ("exit-action",
- "Terminal's action upon child exit",
- "Get/Set terminal's action upon child exit",
+ _("Terminal's action upon child exit"),
+ NULL,
0,
INT_MAX,
0,
pspec);
pspec = g_param_spec_int ("scrollbar-position",
- "Terminal's scrollbar position",
+ _("Terminal's scrollbar position"),
NULL,
0,
INT_MAX,
pspec);
pspec = g_param_spec_boolean ("scroll-background",
- "Controls terminal's scrolling behavior",
- "Get/Set terminal's scrolling behavior",
+ _("Controls terminal's scrolling behavior"),
+ NULL,
FALSE,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_boolean ("scroll-on-output",
- "Controls terminal's scrolling behavior on output",
- "Get/Set terminal's scrolling behavior on output",
+ _("Controls terminal's scrolling behavior on output"),
+ NULL,
FALSE,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_boolean ("scroll-on-keystroke",
- "Controls the terminal's scrolling behavior on keystroke",
+ _("Controls the terminal's scrolling behavior on keystroke"),
NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
pspec);
pspec = g_param_spec_boolean ("antialiased",
- "Attempt to antialias fonts",
+ _("Attempt to antialias fonts"),
NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
pspec);
pspec = g_param_spec_boolean ("allow-bold-text",
- "Allow bold text",
+ _("Allow bold text"),
NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
pspec);
pspec = g_param_spec_boolean ("cursor-blinks",
- NULL, NULL, FALSE, G_PARAM_READWRITE);
+ _("Enable cursor blinking"),
+ NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
TILDA_TERMINAL_CURSOR_BLINKS,
pspec);
pspec = g_param_spec_boolean ("audible-bell",
- NULL, NULL, FALSE, G_PARAM_READWRITE);
+ _("Enable the audible bell"),
+ NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
TILDA_TERMINAL_AUDIBLE_BELL,
pspec);
pspec = g_param_spec_boolean ("visible-bell",
- NULL, NULL, FALSE, G_PARAM_READWRITE);
+ _("Enable the visible bell"),
+ NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
TILDA_TERMINAL_VISIBLE_BELL,
pspec);
pspec = g_param_spec_boolean ("double-buffered",
- NULL, NULL, FALSE, G_PARAM_READWRITE);
+ _("Double buffer the terminal"),
+ NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
TILDA_TERMINAL_DOUBLE_BUFFERED,
pspec);
pspec = g_param_spec_boolean ("mouse-autohide",
- NULL, NULL, FALSE, G_PARAM_READWRITE);
+ _("Hide the mouse cursor while typing"),
+ NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
TILDA_TERMINAL_MOUSE_AUTOHIDE,