From 4583ff32f9ae60c5d2847534e77df2e2a7025aaf Mon Sep 17 00:00:00 2001 From: "Ira W. Snyder" Date: Sat, 19 Jan 2008 20:04:34 -0800 Subject: [PATCH] [Terminal] Add Close method to the DBus API This method allows the user to close a terminal over DBus. This gives TildaTerminal the same feature as TildaWindow. --- tilda-terminal.c | 13 +++++++++++++ tilda-terminal.h | 1 + tilda-terminal.xml | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/tilda-terminal.c b/tilda-terminal.c index 12c08af..14567da 100644 --- a/tilda-terminal.c +++ b/tilda-terminal.c @@ -34,6 +34,19 @@ tilda_terminal_run_command (TildaTerminal *self, gchar *command, GError **error) 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, diff --git a/tilda-terminal.h b/tilda-terminal.h index 81815f0..5d59a50 100644 --- a/tilda-terminal.h +++ b/tilda-terminal.h @@ -81,6 +81,7 @@ GType tilda_terminal_get_type (void); /* API */ gboolean tilda_terminal_run_command (TildaTerminal *self, gchar *command, GError **error); +gboolean tilda_terminal_close (TildaTerminal *self, GError **error); #endif /* TILDA_TERMINAL_H */ diff --git a/tilda-terminal.xml b/tilda-terminal.xml index 0818981..1d91c54 100644 --- a/tilda-terminal.xml +++ b/tilda-terminal.xml @@ -10,6 +10,10 @@ + + + + -- 2.25.1