diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-11-26 02:35:58 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-11-26 02:37:13 +0800 |
commit | 20efbd7c8bc742d580bc0779b05c1af96787deee (patch) | |
tree | 6ffe0f715fd6fa60f33c8e5ff1c7420abff87009 /shell/e-shell-window.c | |
parent | 7a086cbcd0592e4c133c5761c65fa291b6d05d04 (diff) | |
download | gsoc2013-evolution-20efbd7c8bc742d580bc0779b05c1af96787deee.tar.gz gsoc2013-evolution-20efbd7c8bc742d580bc0779b05c1af96787deee.tar.zst gsoc2013-evolution-20efbd7c8bc742d580bc0779b05c1af96787deee.zip |
Add a --geometry command-line option.
Applies the user's window geometry string to the first main window.
Suggested in bug #529565.
Diffstat (limited to 'shell/e-shell-window.c')
-rw-r--r-- | shell/e-shell-window.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index a6ac5706e2..737d9dc4a4 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -29,6 +29,7 @@ enum { PROP_0, PROP_ACTIVE_VIEW, + PROP_GEOMETRY, PROP_SAFE_MODE, PROP_SHELL, PROP_UI_MANAGER @@ -142,6 +143,15 @@ shell_window_update_close_action_cb (EShellWindow *shell_window) } static void +shell_window_set_geometry (EShellWindow *shell_window, + const gchar *geometry) +{ + g_return_if_fail (shell_window->priv->geometry == NULL); + + shell_window->priv->geometry = g_strdup (geometry); +} + +static void shell_window_set_shell (EShellWindow *shell_window, EShell *shell) { @@ -189,6 +199,12 @@ shell_window_set_property (GObject *object, g_value_get_string (value)); return; + case PROP_GEOMETRY: + shell_window_set_geometry ( + E_SHELL_WINDOW (object), + g_value_get_string (value)); + return; + case PROP_SAFE_MODE: e_shell_window_set_safe_mode ( E_SHELL_WINDOW (object), @@ -295,6 +311,22 @@ shell_window_class_init (EShellWindowClass *class) G_PARAM_READWRITE)); /** + * EShellWindow:geometry + * + * User-specified initial window geometry string. + **/ + g_object_class_install_property ( + object_class, + PROP_GEOMETRY, + g_param_spec_string ( + "geometry", + _("Geometry"), + _("Initial window geometry string"), + NULL, + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY)); + + /** * EShellWindow:safe-mode * * Whether the shell window is in safe mode. @@ -380,6 +412,7 @@ e_shell_window_get_type (void) * e_shell_window_new: * @shell: an #EShell * @safe_mode: whether to initialize the window to "safe mode" + * @geometry: initial window geometry string, or %NULL * * Returns a new #EShellWindow. * @@ -397,11 +430,13 @@ e_shell_window_get_type (void) **/ GtkWidget * e_shell_window_new (EShell *shell, - gboolean safe_mode) + gboolean safe_mode, + const gchar *geometry) { return g_object_new ( E_TYPE_SHELL_WINDOW, - "shell", shell, "safe-mode", safe_mode, NULL); + "shell", shell, "geometry", geometry, + "safe-mode", safe_mode, NULL); } /** |