[Terminal] Add Close method to the DBus API
authorIra W. Snyder <devel@irasnyder.com>
Sun, 20 Jan 2008 04:04:34 +0000 (20:04 -0800)
committerIra W. Snyder <devel@irasnyder.com>
Sun, 20 Jan 2008 04:04:34 +0000 (20:04 -0800)
This method allows the user to close a terminal over DBus. This gives
TildaTerminal the same feature as TildaWindow.

tilda-terminal.c
tilda-terminal.h
tilda-terminal.xml

index 12c08af..14567da 100644 (file)
@@ -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,
index 81815f0..5d59a50 100644 (file)
@@ -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 */
 
index 0818981..1d91c54 100644 (file)
                <arg type="s" name="command" direction="in" />
        </method>
 
+       <method name="Close">
+               <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="tilda_terminal_close" />
+       </method>
+
        </interface>
 </node>