~ubuntu-branches/ubuntu/oneiric/gnome-games/oneiric

« back to all changes in this revision

Viewing changes to .pc/01_lpi.patch/gnotravex/gnotravex.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2011-07-21 04:22:50 UTC
  • mfrom: (1.1.93)
  • Revision ID: package-import@ubuntu.com-20110721042250-far722bxogjk1rhi
Tags: 1:3.1.3-0ubuntu1
* New upstream release
  - Aisleriot was split out of gnome-games into its own module.
  - Gnotravex was ported to GSettings.
  - Sudoku was ported to PyGObject/GTK3 by John Stowers.
* debian/aisleriot*: Dropped
* debian/control
  - Drop aisleriot package
  - Recommend aisleriot
  - Disable lightsoff & swell-foop as they're not ready yet
  - Re-enable gnome-sudoku
  - Use python-gobject instead of python-gtk2
  - Don't use python-launchpad-integration as it doesn't work with pygi yet
  - Switch to dh_python2 (LP: #788514)
  - Drop old pre-Lucid conflicts with gnome-cards-data & gnome-games-data
  - Drop obsolete build-depends: check, dpkg-dev, guile-1.8, lsb-release,
    rarian-compat, & scrollkeeper
  - Use ${gir:Depends}
* debian/copyright: Drop aisleriot & blackjack entries
* debian/glchess.install: Drop gnome-gnuchess
* debian/gnome-games-common.install: Drop aisleriot entries
* debian/gnome-sudoku.install: Install gconf schema
* debian/gnotravex.install: Install GSettings schema
* debian/rules
  - Clean up configure flags
  - Switch to dh_python2
* debian/watch: Watch for .bz2
* debian/patches/01_lpi.patch: Refreshed
* debian/patches/02_desktop-path.patch: Removed aisleriot references
* debian/patches/03_add-appinstall-keywords.patch
  - Add keywords to make searching for the games easier in Software Center

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <gtk/gtk.h>
29
29
#include <gdk-pixbuf/gdk-pixbuf.h>
30
30
#include <libgames-support/games-clock.h>
31
 
#include <libgames-support/games-conf.h>
32
 
#include <libgames-support/games-gtk-compat.h>
33
31
#include <libgames-support/games-help.h>
34
32
#include <libgames-support/games-scores.h>
35
33
#include <libgames-support/games-scores-dialog.h>
36
34
#include <libgames-support/games-runtime.h>
 
35
#include <libgames-support/games-settings.h>
37
36
#include <libgames-support/games-stock.h>
38
37
#include <libgames-support/games-pause-action.h>
39
38
#include <libgames-support/games-fullscreen-action.h>
55
54
#define SHORT_COUNT 5
56
55
#define DELAY 10
57
56
 
58
 
#define KEY_GRID_SIZE     "grid_size"
59
 
#define KEY_CLICK_MOVE    "click_to_move"
 
57
#define KEY_GRID_SIZE     "grid-size"
 
58
#define KEY_CLICK_MOVE    "click-to-move"
60
59
 
61
60
#define DEFAULT_WIDTH 320
62
61
#define DEFAULT_HEIGHT 240
96
95
  PLAYING,
97
96
} GameState;
98
97
 
 
98
static GSettings *settings;
99
99
static GtkWidget *window = NULL;
100
100
static GtkWidget *statusbar = NULL;
101
101
static GtkWidget *space = NULL;
999
999
  gtk_window_set_title (GTK_WINDOW (window), _(APPNAME_LONG));
1000
1000
 
1001
1001
  gtk_window_set_default_size (GTK_WINDOW (window), DEFAULT_WIDTH, DEFAULT_HEIGHT);
1002
 
  games_conf_add_window (GTK_WINDOW (window), NULL);
 
1002
  games_settings_bind_window_state ("/org/gnome/gnotravex/", GTK_WINDOW (window));
1003
1003
  gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
1004
1004
 
1005
1005
  gtk_widget_realize (window);
1398
1398
{
1399
1399
  GtkWidget *status_bar, *time_label, *time_box;
1400
1400
 
1401
 
  time_box = gtk_hbox_new (FALSE, 0);
 
1401
  time_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
1402
1402
  time_label = gtk_label_new (_("Time:"));
1403
1403
  gtk_box_pack_start (GTK_BOX (time_box), time_label, FALSE, FALSE, 0);
1404
1404
  time_label = gtk_label_new (" ");
1637
1637
  size = newsize;
1638
1638
  update_tile_size (width, height);
1639
1639
  games_scores_set_category (highscores, scorecats[size - 2].key);
1640
 
  games_conf_set_integer (NULL, KEY_GRID_SIZE, size);
 
1640
  g_settings_set_int (settings, KEY_GRID_SIZE, size);
1641
1641
  gtk_action_activate (new_game_action);
1642
1642
}
1643
1643
 
1645
1645
clickmove_toggle_cb(GtkToggleAction * togglebutton, gpointer data)
1646
1646
{
1647
1647
  click_to_move = gtk_toggle_action_get_active (togglebutton);
1648
 
  games_conf_set_boolean (NULL, KEY_CLICK_MOVE, click_to_move);
 
1648
  g_settings_set_boolean (settings, KEY_CLICK_MOVE, click_to_move);
1649
1649
}
1650
1650
 
1651
1651
static void
1774
1774
main (int argc, char **argv)
1775
1775
{
1776
1776
  GOptionContext *context;
1777
 
  GtkWidget *vbox;
 
1777
  GtkWidget *grid;
1778
1778
  GtkWidget *menubar;
1779
1779
  GtkUIManager *ui_manager;
1780
1780
  GtkAccelGroup *accel_group;
1810
1810
 
1811
1811
  g_set_application_name (_(APPNAME_LONG));
1812
1812
 
1813
 
  games_conf_initialise (APPNAME);
 
1813
  settings = g_settings_new ("org.gnome.gnotravex");
1814
1814
 
1815
1815
  highscores = games_scores_new ("gnotravex",
1816
1816
                                 scorecats, G_N_ELEMENTS (scorecats),
1831
1831
#endif /* WITH_SMCLIENT */
1832
1832
 
1833
1833
  if (size == -1)
1834
 
    size = games_conf_get_integer (NULL, KEY_GRID_SIZE, NULL);
 
1834
    size = g_settings_get_int (settings, KEY_GRID_SIZE);
1835
1835
  if (size < 2 || size > 6)
1836
1836
    size = 3;
1837
1837
  games_scores_set_category (highscores, scorecats[size - 2].key);
1838
1838
 
1839
 
  click_to_move = games_conf_get_boolean (NULL, KEY_CLICK_MOVE, NULL);
 
1839
  click_to_move = g_settings_get_boolean (settings, KEY_CLICK_MOVE);
1840
1840
 
1841
1841
  load_background ();
1842
1842
  create_window ();
1843
1843
 
1844
1844
  space = gtk_drawing_area_new ();
 
1845
  gtk_widget_set_hexpand (space, TRUE);
 
1846
  gtk_widget_set_vexpand (space, TRUE);
1845
1847
  gtk_widget_set_events (space,
1846
1848
                         GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK
1847
1849
                         | GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK);
1853
1855
 
1854
1856
  menubar = create_menu (ui_manager);
1855
1857
 
1856
 
  vbox = gtk_vbox_new (FALSE, 0);
1857
 
  gtk_container_add (GTK_CONTAINER (window), vbox);
 
1858
  grid = gtk_grid_new ();
 
1859
  gtk_container_add (GTK_CONTAINER (window), grid);
1858
1860
 
1859
 
  gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, FALSE, 0);
1860
 
  gtk_box_pack_start (GTK_BOX (vbox), space, TRUE, TRUE, 0);
1861
 
  gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, FALSE, 0);
 
1861
  gtk_grid_attach (GTK_GRID (grid), menubar, 0, 0, 1, 1);
 
1862
  gtk_grid_attach (GTK_GRID (grid), space, 0, 1, 1, 1);
 
1863
  gtk_grid_attach (GTK_GRID (grid), statusbar, 0, 2, 1, 1);
1862
1864
 
1863
1865
  accel_group = gtk_ui_manager_get_accel_group (ui_manager);
1864
1866
  gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
1892
1894
 
1893
1895
  gtk_main ();
1894
1896
 
1895
 
  games_conf_shutdown ();
 
1897
  g_settings_sync();
1896
1898
 
1897
1899
  games_runtime_shutdown ();
1898
1900