[cheese] widemode: add command line option to startup in wide mode
- From: Filippo Argiolas <fargiolas src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [cheese] widemode: add command line option to startup in wide mode
- Date: Mon, 10 Aug 2009 18:52:11 +0000 (UTC)
commit ece4a7405a4dd6de7c4863b01a68449c23581502
Author: Filippo Argiolas <filippo argiolas gmail com>
Date: Mon Aug 10 18:23:04 2009 +0200
widemode: add command line option to startup in wide mode
src/cheese-window.c | 7 ++++++-
src/cheese-window.h | 2 +-
src/cheese.c | 16 +++++++++-------
3 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/src/cheese-window.c b/src/cheese-window.c
index 71388b8..810f82b 100644
--- a/src/cheese-window.c
+++ b/src/cheese-window.c
@@ -2142,7 +2142,7 @@ setup_camera (CheeseWindow *cheese_window)
}
void
-cheese_window_init (char *hal_dev_udi, CheeseDbus *dbus_server)
+cheese_window_init (char *hal_dev_udi, CheeseDbus *dbus_server, gboolean startup_in_wide_mode)
{
CheeseWindow *cheese_window;
@@ -2174,6 +2174,11 @@ cheese_window_init (char *hal_dev_udi, CheeseDbus *dbus_server)
cheese_window->webcam_mode = WEBCAM_MODE_PHOTO;
cheese_window->recording = FALSE;
+ if (startup_in_wide_mode) {
+ GtkAction *action = gtk_ui_manager_get_action (cheese_window->ui_manager, "/MainMenu/Cheese/WideMode");
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
+ }
+
/* handy trick to set default size of the drawing area while not
* limiting its minimum size, thanks Owen! -- slightly modified, see
* comment in toggle_wide_mode to understand how it works -- */
diff --git a/src/cheese-window.h b/src/cheese-window.h
index dba9276..3957270 100644
--- a/src/cheese-window.h
+++ b/src/cheese-window.h
@@ -24,7 +24,7 @@
#include "cheese-dbus.h"
-void cheese_window_init (char *hal_dev_udi, CheeseDbus *dbus_server);
+void cheese_window_init (char *hal_dev_udi, CheeseDbus *dbus_server, gboolean startup_in_wide_mode);
void cheese_window_bring_to_front (gpointer data);
#endif /* __CHEESE_WINDOW_H__ */
diff --git a/src/cheese.c b/src/cheese.c
index 0b5adcf..8a76979 100644
--- a/src/cheese.c
+++ b/src/cheese.c
@@ -36,6 +36,7 @@
struct _CheeseOptions
{
gboolean verbose;
+ gboolean wide_mode;
char *hal_device_id;
gboolean version;
} CheeseOptions;
@@ -158,12 +159,13 @@ main (int argc, char **argv)
GError *error = NULL;
GOptionEntry options[] = {
- {"verbose", 'v', 0, G_OPTION_ARG_NONE, &CheeseOptions.verbose,
- _("Be verbose"),
- NULL},
- {"hal-device", 'd', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &CheeseOptions.hal_device_id, NULL,
- NULL},
- {"version", 0, 0, G_OPTION_ARG_NONE, &CheeseOptions.version,
+ {"verbose", 'v', 0, G_OPTION_ARG_NONE, &CheeseOptions.verbose,
+ _("Be verbose"), NULL},
+ {"wide", 'w', 0, G_OPTION_ARG_NONE, &CheeseOptions.wide_mode,
+ _("Enable wide mode"), NULL},
+ {"hal-device", 'd', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &CheeseOptions.hal_device_id,
+ NULL, NULL},
+ {"version", 0, 0, G_OPTION_ARG_NONE, &CheeseOptions.version,
_("output version information and exit"), NULL},
{NULL}
};
@@ -217,7 +219,7 @@ main (int argc, char **argv)
APPNAME_DATA_DIR G_DIR_SEPARATOR_S "icons");
cheese_handle_files_from_before_224 ();
- cheese_window_init (CheeseOptions.hal_device_id, dbus_server);
+ cheese_window_init (CheeseOptions.hal_device_id, dbus_server, CheeseOptions.wide_mode);
gdk_threads_enter ();
gtk_main ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]