[gnome-games] [same-gnome-clutter] Add initial settings ui
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-games] [same-gnome-clutter] Add initial settings ui
- Date: Thu, 16 Jul 2009 22:33:52 +0000 (UTC)
commit 354bc407e401e13b170256c605428bae87ff8219
Author: Tim Horton <hortont424 gmail com>
Date: Sun Jul 12 19:48:22 2009 -0400
[same-gnome-clutter] Add initial settings ui
configure.in | 2 +-
same-gnome-clutter/Makefile.am | 22 +-
same-gnome-clutter/data/settings.ui | 280 +++++++++++++++++++++
same-gnome-clutter/src/{about.js => About.js} | 0
same-gnome-clutter/src/{board.js => Board.js} | 12 +-
same-gnome-clutter/src/{light.js => Light.js} | 0
same-gnome-clutter/src/{path.js.in => Path.js.in} | 0
same-gnome-clutter/src/{score.js => Score.js} | 2 +-
same-gnome-clutter/src/ThemeLoader.js | 4 +-
same-gnome-clutter/src/main.js | 12 +-
10 files changed, 308 insertions(+), 26 deletions(-)
---
diff --git a/configure.in b/configure.in
index 821821b..cc8ed9a 100644
--- a/configure.in
+++ b/configure.in
@@ -1256,7 +1256,7 @@ same-gnome-clutter/data/themes/tango/Makefile
same-gnome-clutter/same-gnome-clutter
same-gnome-clutter/same-gnome-clutter.desktop.in
same-gnome-clutter/same-gnome-clutter-c.desktop.in
-same-gnome-clutter/src/path.js
+same-gnome-clutter/src/Path.js
lightsoff/Makefile
lightsoff/help/Makefile
lightsoff/src/lightsoff
diff --git a/same-gnome-clutter/Makefile.am b/same-gnome-clutter/Makefile.am
index 3abc1c3..4db137a 100644
--- a/same-gnome-clutter/Makefile.am
+++ b/same-gnome-clutter/Makefile.am
@@ -3,13 +3,14 @@ SUBDIRS = data/themes
samedir=$(pkgdatadir)/same-gnome-clutter
same_DATA = \
- src/about.js \
- src/board.js \
- src/light.js \
+ src/About.js \
+ src/Board.js \
+ src/Light.js \
src/main.js \
data/same-gnome.ui \
- src/score.js \
- src/path.js \
+ data/settings.ui \
+ src/Score.js \
+ src/Path.js \
src/ThemeLoader.js
same_gnome_clutter_c_SOURCES = same.c
@@ -27,12 +28,13 @@ desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop)
CLEANFILES = $(desktop_DATA)
EXTRA_DIST = \
- src/about.js \
- src/board.js \
- src/light.js \
+ src/About.js \
+ src/Board.js \
+ src/Light.js \
src/main.js \
data/same-gnome.ui \
- src/score.js \
- src/path.js.in \
+ data/settings.ui \
+ src/Score.js \
+ src/Path.js.in \
src/ThemeLoader.js.in
diff --git a/same-gnome-clutter/data/settings.ui b/same-gnome-clutter/data/settings.ui
new file mode 100644
index 0000000..b4d9f07
--- /dev/null
+++ b/same-gnome-clutter/data/settings.ui
@@ -0,0 +1,280 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy project-wide -->
+ <object class="GtkDialog" id="dialog1">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Lights Off</property>
+ <property name="type_hint">normal</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkFrame" id="frame3">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Number of rows:</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Number of columns:</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkSpinButton" id="spinbutton1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinbutton2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="ypad">5</property>
+ <property name="label" translatable="yes"><b>Setup</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Theme:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="theme-selector1">
+ <property name="visible">True</property>
+ <property name="model">liststore1</property>
+ </object>
+ <packing>
+ <property name="padding">8</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="ypad">5</property>
+ <property name="label" translatable="yes"><b>Appearance</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkVBox" id="vbox5">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton1">
+ <property name="label" translatable="yes">Zealous Animation</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton2">
+ <property name="label" translatable="yes">Fly score increment (words!)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="ypad">5</property>
+ <property name="label" translatable="yes"><b>Operation</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="reset-button">
+ <property name="label">gtk-revert-to-saved</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="close-button">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">reset-button</action-widget>
+ <action-widget response="0">close-button</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkListStore" id="liststore1">
+ <columns>
+ <!-- column-name str -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
+</interface>
diff --git a/same-gnome-clutter/src/about.js b/same-gnome-clutter/src/About.js
similarity index 100%
rename from same-gnome-clutter/src/about.js
rename to same-gnome-clutter/src/About.js
diff --git a/same-gnome-clutter/src/board.js b/same-gnome-clutter/src/Board.js
similarity index 96%
rename from same-gnome-clutter/src/board.js
rename to same-gnome-clutter/src/Board.js
index 4086e99..4dda59d 100644
--- a/same-gnome-clutter/src/board.js
+++ b/same-gnome-clutter/src/Board.js
@@ -1,9 +1,9 @@
Clutter = imports.gi.Clutter;
GLib = imports.gi.GLib;
-light = imports.light;
-score = imports.score;
+Light = imports.Light;
+Score = imports.Score;
main = imports.main;
-settings = imports.settings;
+Settings = imports.Settings;
Board = new GType({
parent: Clutter.Group.type,
@@ -100,7 +100,7 @@ Board = new GType({
if(main.fly_score)
{
- var score_text = new score.Score();
+ var score_text = new Score.Score();
score_text.animate_score(points_awarded);
}
@@ -113,7 +113,7 @@ Board = new GType({
if(self.has_won())
main.current_score += 1000;
- final_score = new score.Score();
+ final_score = new Score.Score();
final_score.animate_final_score(main.current_score);
print("Done with: " + main.current_score + " points!");
@@ -278,7 +278,7 @@ Board = new GType({
lights[x] = [];
for(var y = 0; y < main.tiles_h; y++)
{
- var li = new light.Light();
+ var li = new Light.Light();
li.set_light_x(x);
li.set_light_y(y);
diff --git a/same-gnome-clutter/src/light.js b/same-gnome-clutter/src/Light.js
similarity index 100%
rename from same-gnome-clutter/src/light.js
rename to same-gnome-clutter/src/Light.js
diff --git a/same-gnome-clutter/src/path.js.in b/same-gnome-clutter/src/Path.js.in
similarity index 100%
rename from same-gnome-clutter/src/path.js.in
rename to same-gnome-clutter/src/Path.js.in
diff --git a/same-gnome-clutter/src/score.js b/same-gnome-clutter/src/Score.js
similarity index 98%
rename from same-gnome-clutter/src/score.js
rename to same-gnome-clutter/src/Score.js
index 38b53fa..3983d16 100644
--- a/same-gnome-clutter/src/score.js
+++ b/same-gnome-clutter/src/Score.js
@@ -1,7 +1,7 @@
Clutter = imports.gi.Clutter;
Pango = imports.gi.Pango;
main = imports.main;
-settings = imports.settings;
+Settings = imports.Settings;
Score = new GType({
parent: Clutter.Group.type,
diff --git a/same-gnome-clutter/src/Settings.js b/same-gnome-clutter/src/Settings.js
new file mode 100644
index 0000000..e69de29
diff --git a/same-gnome-clutter/src/ThemeLoader.js b/same-gnome-clutter/src/ThemeLoader.js
index cae4caa..c30d5d2 100644
--- a/same-gnome-clutter/src/ThemeLoader.js
+++ b/same-gnome-clutter/src/ThemeLoader.js
@@ -3,7 +3,7 @@ Gio = imports.gi.Gio;
function load_svg(theme, file)
{
- var tx = new Clutter.Texture({filename: imports.path.file_prefix + "themes/"
+ var tx = new Clutter.Texture({filename: imports.Path.file_prefix + "themes/"
+ theme + "/" + file});
tx.filter_quality = Clutter.TextureQuality.HIGH;
tx.hide();
@@ -25,7 +25,7 @@ function load_themes()
{
themes = {};
- file = Gio.file_new_for_path(imports.path.file_prefix + "/themes");
+ file = Gio.file_new_for_path(imports.Path.file_prefix + "/themes");
enumerator = file.enumerate_children("standard::name");
while((child = enumerator.next_file()))
diff --git a/same-gnome-clutter/src/main.js b/same-gnome-clutter/src/main.js
index b5f3df7..cf9f33f 100755
--- a/same-gnome-clutter/src/main.js
+++ b/same-gnome-clutter/src/main.js
@@ -30,10 +30,10 @@ GnomeGamesSupport.stock_init();
GConf.init(Seed.argv);
-light = imports.light;
-board = imports.board;
-score = imports.score;
-about = imports.about;
+Light = imports.Light;
+Board = imports.Board;
+Score = imports.Score;
+About = imports.About;
handlers = {
show_settings: function(selector, ud)
@@ -55,7 +55,7 @@ handlers = {
};
b = new Gtk.Builder();
-b.add_from_file(imports.path.file_prefix + "/same-gnome.ui");
+b.add_from_file(imports.Path.file_prefix + "/same-gnome.ui");
b.connect_signals(handlers);
var window = b.get_object("game_window");
@@ -80,7 +80,7 @@ stage.show_all();
theme = ThemeLoader.load_themes().Tango;
ThemeLoader.load_theme(stage, theme);
-var board = new board.Board();
+var board = new Board.Board();
stage.add_actor(board);
board.show();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]