File: | capplet/main.c |
Warning: | line 86, column 3 This statement is never executed |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- |
2 | * main.c |
3 | * Copyright (C) 1999 Free Software Foundation, Inc. |
4 | * Copyright (C) 2008 Lucas Rocha. |
5 | * |
6 | * This program is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public License as |
8 | * published by the Free Software Foundation; either version 2 of the |
9 | * License, or (at your option) any later version. |
10 | * |
11 | * This program is distributed in the hope that it will be useful, but |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | * Lesser General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU General Public License |
17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
19 | * 02110-1301, USA. |
20 | */ |
21 | |
22 | #include <config.h> |
23 | |
24 | #include <unistd.h> |
25 | #include <stdlib.h> |
26 | |
27 | #include <glib/gi18n.h> |
28 | #include <ctk/ctk.h> |
29 | |
30 | #include "csm-properties-dialog.h" |
31 | |
32 | static gboolean show_version = FALSE(0); |
33 | |
34 | static GOptionEntry options[] = { |
35 | {"version", 0, 0, G_OPTION_ARG_NONE, &show_version, N_("Version of this application")("Version of this application"), NULL((void*)0)}, |
36 | {NULL((void*)0), 0, 0, 0, NULL((void*)0), NULL((void*)0), NULL((void*)0)} |
37 | }; |
38 | |
39 | static void dialog_response(CsmPropertiesDialog* dialog, guint response_id, gpointer data) |
40 | { |
41 | GError* error; |
42 | |
43 | if (response_id == CTK_RESPONSE_HELP) |
44 | { |
45 | error = NULL((void*)0); |
46 | ctk_show_uri_on_window (CTK_WINDOW (dialog)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((dialog)), ((ctk_window_get_type ())))))), "help:cafe-user-guide/gosstartsession-2", |
47 | ctk_get_current_event_time (), &error); |
48 | |
49 | if (error != NULL((void*)0)) |
50 | { |
51 | CtkWidget* d = ctk_message_dialog_new(CTK_WINDOW(dialog)((((CtkWindow*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((dialog)), ((ctk_window_get_type ())))))), CTK_DIALOG_MODAL | CTK_DIALOG_DESTROY_WITH_PARENT, CTK_MESSAGE_ERROR, CTK_BUTTONS_CLOSE, "%s", _("Could not display help document")gettext ("Could not display help document")); |
52 | ctk_message_dialog_format_secondary_text(CTK_MESSAGE_DIALOG(d)((((CtkMessageDialog*) (void *) g_type_check_instance_cast (( GTypeInstance*) ((d)), ((ctk_message_dialog_get_type ())))))), "%s", error->message); |
53 | g_error_free(error); |
54 | |
55 | ctk_dialog_run(CTK_DIALOG (d)((((CtkDialog*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((d)), ((ctk_dialog_get_type ()))))))); |
56 | ctk_widget_destroy(d); |
57 | } |
58 | } |
59 | else |
60 | { |
61 | ctk_widget_destroy(CTK_WIDGET (dialog)((((CtkWidget*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((dialog)), ((ctk_widget_get_type ()))))))); |
62 | ctk_main_quit(); |
63 | } |
64 | } |
65 | |
66 | int main(int argc, char* argv[]) |
67 | { |
68 | GError* error; |
69 | CtkWidget* dialog; |
70 | |
71 | bindtextdomain(GETTEXT_PACKAGE"cafe-session-manager", LOCALE_DIR"/usr/share/locale"); |
72 | bind_textdomain_codeset(GETTEXT_PACKAGE"cafe-session-manager", "UTF-8"); |
73 | textdomain(GETTEXT_PACKAGE"cafe-session-manager"); |
74 | |
75 | error = NULL((void*)0); |
76 | |
77 | if (!ctk_init_with_args(&argc, &argv, " - CAFE Session Properties", options, GETTEXT_PACKAGE"cafe-session-manager", &error)) |
78 | { |
79 | g_warning("Unable to start: %s", error->message); |
80 | g_error_free(error); |
81 | return 1; |
82 | } |
83 | |
84 | if (show_version) |
85 | { |
86 | g_print("%s %s\n", argv[0], VERSION"1.25.0"); |
This statement is never executed | |
87 | return 0; |
88 | } |
89 | |
90 | dialog = csm_properties_dialog_new(); |
91 | g_signal_connect(dialog, "response", G_CALLBACK(dialog_response), NULL)g_signal_connect_data ((dialog), ("response"), (((GCallback) ( dialog_response))), (((void*)0)), ((void*)0), (GConnectFlags) 0); |
92 | ctk_widget_show(dialog); |
93 | |
94 | ctk_main(); |
95 | |
96 | return 0; |
97 | } |