~taylorp36/ubuntu/wily/aisleriot/bug-1490189

« back to all changes in this revision

Viewing changes to src/sol.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2011-09-26 12:54:22 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: package-import@ubuntu.com-20110926125422-fhnx2xyc0qcpgyh2
Tags: 1:3.2.0-0ubuntu1
* New upstream stable release.
  - Distribute a copy of the LGPL
  - Update card theme install info for Debian, Ubuntu & OpenSUSE
  - Build help with yelp-tools instead of gnome-doc-utils
  - Fix game restart
  - Translation updates
* debian/control: Build-depends on yelp-tools
* debian/copyright: Fixed a few lintian warnings
* 03_update_theme_install_data.patch: Dropped, applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
#include <gtk/gtk.h>
30
30
 
31
 
#ifdef HAVE_CLUTTER
32
 
#include <cogl/cogl.h>
33
 
#include <clutter/clutter.h>
34
 
#include <clutter-gtk/clutter-gtk.h>
35
 
#endif
36
 
 
37
31
#include "ar-debug.h"
38
32
#include "ar-stock.h"
39
33
#include "ar-runtime.h"
58
52
typedef struct {
59
53
  AisleriotWindow *window;
60
54
  char *variation;
61
 
  guint seed;
 
55
  gint seed; /* unused */
62
56
  gboolean freecell;
63
57
} AppData;
64
58
 
72
66
  AisleriotGame *game;
73
67
  char *argv[5];
74
68
  const char *game_name;
75
 
  char *seed;
76
69
  int argc = 0;
77
70
 
78
71
  game = aisleriot_window_get_game (data->window);
79
72
 
80
73
  game_name = aisleriot_game_get_game_file (game);
81
 
  seed = g_strdup_printf ("%u", aisleriot_game_get_seed (game));
82
74
 
83
75
  argv[argc++] = g_get_prgname ();
84
76
 
89
81
    argv[argc++] = (char *) game_name;
90
82
  }
91
83
 
92
 
  argv[argc++] = (char *) "--seed";
93
 
  argv[argc++] = seed;
94
 
 
95
84
  /* FIXMEchpe: save game state too? */
96
85
 
97
86
  egg_sm_client_set_restart_command (client, argc, (const char **) argv);
98
 
 
99
 
  g_free (seed);
100
87
}
101
88
 
102
89
static void
116
103
  const GOptionEntry aisleriot_options[] = {
117
104
    { "variation", 'v', 0, G_OPTION_ARG_STRING, &data->variation,
118
105
      N_("Select the game type to play"), N_("NAME") },
119
 
    { "seed", 's', 0, G_OPTION_ARG_STRING, &data->seed,
120
 
      N_("Select the game number"), N_("NUMBER") },
121
106
    { "freecell", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &data->freecell,
122
107
      NULL, NULL },
 
108
 
 
109
    /* Ignored option, for backward compat with saved session */
 
110
    { "seed", 's', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &data->seed,
 
111
      NULL, NULL },
 
112
 
123
113
    { NULL }
124
114
  };
125
115
 
152
142
  g_option_context_add_group (option_context, egg_sm_client_get_option_group ());
153
143
#endif /* WITH_SMCLIENT */
154
144
 
155
 
#ifdef HAVE_CLUTTER
156
 
  g_option_context_add_group (option_context, cogl_get_option_group ());
157
 
  g_option_context_add_group (option_context, clutter_get_option_group_without_init ());
158
 
  g_option_context_add_group (option_context, gtk_clutter_get_option_group ());
159
 
#endif /* HAVE_CLUTTER */
160
 
 
161
145
  retval = g_option_context_parse (option_context, &argc, &argv, &error);
162
146
  g_option_context_free (option_context);
163
147
 
207
191
#endif /* WITH_SMCLIENT */
208
192
 
209
193
  if (data.freecell) {
210
 
    aisleriot_window_set_game (data.window, FREECELL_VARIATION, data.seed);
 
194
    aisleriot_window_set_game (data.window, FREECELL_VARIATION, NULL);
211
195
  } else {
212
 
    aisleriot_window_set_game (data.window, data.variation, data.seed);
 
196
    aisleriot_window_set_game (data.window, data.variation, NULL);
213
197
  }
214
198
 
215
199
  gtk_window_present (GTK_WINDOW (data.window));