[gedit/dbus2: 2/9] Added wait, background and standalone options to commandline



commit aa4a31b7d7fd7f3d4fcab6e664533826a24dd563
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Sun May 2 13:12:11 2010 +0200

    Added wait, background and standalone options to commandline

 gedit/gedit-command-line.c |   49 ++++++++++++++++++++++++++++++++++++++++++++
 gedit/gedit-command-line.h |    4 +++
 2 files changed, 53 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-command-line.c b/gedit/gedit-command-line.c
index d9d16f4..3ff12fb 100644
--- a/gedit/gedit-command-line.c
+++ b/gedit/gedit-command-line.c
@@ -46,6 +46,10 @@ struct _GeditCommandLinePrivate
 	gboolean new_document;
 	gchar **remaining_args;
 
+	gboolean wait;
+	gboolean background;
+	gboolean standalone;
+
 	/* This result from post-processing command line arguments */
 	gint line_position;
 	gint column_position;
@@ -259,6 +263,30 @@ gedit_command_line_parse (GeditCommandLine   *command_line,
 			NULL,
 			N_("[FILE...]")
 		},
+		
+		/* Wait for closing documents */
+		{
+			"wait", 'w', 0, G_OPTION_ARG_NONE,
+			&command_line->priv->wait,
+			N_("Open files and block process until files are closed"),
+			NULL
+		},
+
+		/* Run in the background */
+		{
+			"background", 'b', 0, G_OPTION_ARG_NONE,
+			&command_line->priv->background,
+			N_("Run gedit in the background"),
+			NULL
+		},
+		
+		/* Wait for closing documents */
+		{
+			"standalone", 's', 0, G_OPTION_ARG_NONE,
+			&command_line->priv->standalone,
+			N_("Run gedit in standalone mode"),
+			NULL
+		},
 
 		{NULL}
 	};
@@ -330,5 +358,26 @@ gedit_command_line_get_encoding (GeditCommandLine *command_line)
 	return command_line->priv->encoding;
 }
 
+gboolean
+gedit_command_line_get_wait (GeditCommandLine *command_line)
+{
+	g_return_val_if_fail (GEDIT_IS_COMMAND_LINE (command_line), FALSE);
+	return command_line->priv->wait;
+}
+
+gboolean
+gedit_command_line_get_background (GeditCommandLine *command_line)
+{
+	g_return_val_if_fail (GEDIT_IS_COMMAND_LINE (command_line), FALSE);
+	return command_line->priv->background;
+}
+
+gboolean
+gedit_command_line_get_standalone (GeditCommandLine *command_line)
+{
+	g_return_val_if_fail (GEDIT_IS_COMMAND_LINE (command_line), FALSE);
+	return command_line->priv->standalone;
+}
+
 
 /* ex:ts=8:noet: */
diff --git a/gedit/gedit-command-line.h b/gedit/gedit-command-line.h
index cb277fa..48b207a 100644
--- a/gedit/gedit-command-line.h
+++ b/gedit/gedit-command-line.h
@@ -63,6 +63,10 @@ gint gedit_command_line_get_column_position (GeditCommandLine *command_line);
 GSList *gedit_command_line_get_file_list (GeditCommandLine *command_line);
 const GeditEncoding *gedit_command_line_get_encoding (GeditCommandLine *command_line);
 
+gboolean gedit_command_line_get_wait (GeditCommandLine *command_line);
+gboolean gedit_command_line_get_background (GeditCommandLine *command_line);
+gboolean gedit_command_line_get_standalone (GeditCommandLine *command_line);
+
 G_END_DECLS
 
 #endif /* __GEDIT_COMMAND_LINE_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]