54
51
const OptionEntry[] options = {
55
{ "wide", 'w', 0, OptionArg.NONE, ref wide, N_("Start in wide mode"),
52
{ "wide", 'w', 0, OptionArg.NONE, null, N_("Start in wide mode"),
57
{ "device", 'd', 0, OptionArg.FILENAME, ref device,
54
{ "device", 'd', 0, OptionArg.FILENAME, null,
58
55
N_("Device to use as a camera"), N_("DEVICE") },
59
{ "version", 'v', 0, OptionArg.NONE, ref version,
56
{ "version", 'v', 0, OptionArg.NONE, null,
60
57
N_("Output version information and exit"), null },
61
{ "fullscreen", 'f', 0, OptionArg.NONE, ref fullscreen,
58
{ "fullscreen", 'f', 0, OptionArg.NONE, null,
62
59
N_("Start in fullscreen mode"), null },
66
63
public Application ()
68
GLib.Object (application_id: "org.gnome.Cheese");
65
GLib.Object (application_id: "org.gnome.Cheese",
66
flags: ApplicationFlags.HANDLES_COMMAND_LINE);
68
this.add_main_option_entries (options);
112
112
Environment.set_application_name (_("Cheese"));
113
113
Window.set_default_icon_name ("cheese");
115
Gtk.IconTheme.get_default ().append_search_path (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "icons"));
117
115
// Create the menus.
118
var menu = new GLib.Menu ();
119
var section = new GLib.Menu ();
120
menu.append_section (null, section);
121
var item = new GLib.MenuItem (_("_Shoot"), "app.shoot");
122
item.set_attribute ("accel", "s", "space");
123
section.append_item (item);
124
section = new GLib.Menu ();
125
menu.append_section (_("Mode:"), section);
126
section.append (_("_Photo"), "app.mode::photo");
127
section.append (_("_Video"), "app.mode::video");
128
section.append (_("_Burst"), "app.mode::burst");
129
section = new GLib.Menu ();
130
menu.append_section (null, section);
131
item = new GLib.MenuItem (_("_Fullscreen"), "app.fullscreen");
132
item.set_attribute ("accel", "s", "F11");
133
section.append_item (item);
134
section = new GLib.Menu ();
135
menu.append_section (null, section);
136
section.append (_("_Effects"), "app.effects");
137
section = new GLib.Menu ();
138
menu.append_section (null, section);
139
section.append (_("P_references"), "app.preferences");
140
section = new GLib.Menu ();
141
menu.append_section (null, section);
142
item = new GLib.MenuItem (_("_Help"), "app.help");
143
item.set_attribute ("accel", "s", "F1");
144
section.append_item (item);
145
section.append (_("_About"), "app.about");
146
item = new GLib.MenuItem (_("_Quit"), "app.quit");
147
item.set_attribute ("accel", "s", "<Primary>q");
148
section.append_item (item);
116
var builder = new Gtk.Builder.from_resource ("/org/gnome/Cheese/cheese-appmenu.ui");
117
var appmenu = builder.get_object ("appmenu") as GLib.MenuModel;
118
this.set_app_menu (appmenu);
120
this.add_accelerator ("space", "app.shoot", null);
151
122
// FIXME: Push these into the main window initialization.
152
123
main_window.setup_ui ();
185
* Overridden method of GApplication, to handle the arguments locally.
187
* @param arguments the command-line arguments
188
* @param exit_status the exit status to return to the OS
189
* @return true if the arguments were successfully processed, false
192
protected override bool local_command_line ([CCode (array_null_terminated = true, array_length = false)]
193
ref unowned string[] argv,
203
warning ("Unable to register application: %s", e.message);
208
// Workaround until bug 642885 is solved.
209
unowned string[] arguments = argv;
210
var n_args = arguments.length;
221
var context = new OptionContext (_("- Take photos and videos from your webcam"));
222
context.set_translation_domain (Config.GETTEXT_PACKAGE);
223
context.set_help_enabled (true);
224
context.add_main_entries (options, null);
225
context.parse (ref arguments);
227
catch (OptionError e)
229
warning ("%s", e.message);
230
stdout.printf (_("Run '%s --help' to see a full list of available command line options."),
232
stdout.printf ("\n");
239
stdout.printf ("%s %s\n", Config.PACKAGE_NAME,
240
Config.PACKAGE_VERSION);
247
settings.set_string ("camera", device);
252
activate_action ("fullscreen", null);
257
activate_action ("wide-mode", null);
264
return base.local_command_line (ref arguments, out exit_status);
155
protected override int command_line (ApplicationCommandLine cl)
157
var opts = cl.get_options_dict ();
159
if (opts.lookup ("device", "^ay", out device, null))
161
settings.set_string ("camera", device);
164
if (opts.contains ("fullscreen"))
166
activate_action ("fullscreen", null);
169
if (opts.contains ("wide"))
171
activate_action ("wide-mode", null);
179
protected override int handle_local_options (VariantDict opts)
181
if (opts.contains ("version"))
183
stdout.printf ("%s %s\n", Config.PACKAGE_NAME,
184
Config.PACKAGE_VERSION);
606
530
"artists", artists,
607
531
"authors", authors,
608
532
"comments", _("Take photos and videos with your webcam, with fun graphical effects"),
609
"copyright", "Copyright © 2007 - 2010 daniel g. siegel <dgsiegel@gnome.org>",
533
"copyright", "Copyright © 2011 - 2014 David King <amigadave@amigadave.com>\nCopyright © 2007 - 2011 daniel g. siegel <dgsiegel@gnome.org>",
610
534
"documenters", documenters,
611
535
"license-type", Gtk.License.GPL_2_0,
612
536
"logo-icon-name", Config.PACKAGE_TARNAME,