Clone in a terminal:
Commit 64090a8
Johan Mattsson - 2013-07-12T11:04:53+00:00
64090a8876fc821f9f8bcb4660a4ac0ae08282c9johan.mattsson.m@gmail.com

Merge branch 'master' of gitorious.org:birdfont/birdfont

Changed files (11)

Diff

diff --git a/NEWS b/NEWSindex 70d7530..b05bd37 100644--- a/NEWS+++ b/NEWS@@ -1,3 +1,10 @@+birdfont (0.22) stable;++  * Bugfixes for changes to make BirdFont run on Mac OS X+  * Preview is removed on Mac OS X++ -- Johan Mattsson <johan.mattsson.m@gmail.com>  Sun Jul  6 21:28:000 CEST 2013+ birdfont (0.21) stable;    * Bugfixesdiff --git a/birdfont/GtkWindow.vala b/birdfont/GtkWindow.valaindex a407f61..f3e087c 100644--- a/birdfont/GtkWindow.vala+++ b/birdfont/GtkWindow.vala@@ -46,7 +46,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { 	bool scrollbar_supress_signal = false; 	 	/** Text input and callbacks to libbirdfont. */-	TextListener text_listener = new TextListener ();+	TextListener text_listener = new TextListener ("", "", ""); 	Label text_input_label; 	Entry text_entry; 	HBox text_box;@@ -274,6 +274,10 @@ public class GtkWindow : Gtk.Window, NativeWindow { 		hide_text_input (); 	} +	public void spawn (string command) {+		Process.spawn_command_line_async (command);+	}+ 	public void set_scrollbar_size (double size) { 		scrollbar.adjustment.page_size = size; 	}@@ -430,11 +434,13 @@ public class GtkWindow : Gtk.Window, NativeWindow { 		export_item.activate.connect (() => { ExportTool.export_all (); }); 		export_item.add_accelerator ("activate", accel_group, 'E', Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE); -		Gtk.MenuItem preview_item = new Gtk.MenuItem.with_mnemonic(_("_Preview"));-		file_menu.append (preview_item);-		preview_item.activate.connect (() => { MenuTab.preview (); });-		preview_item.add_accelerator ("activate", accel_group, 'P', Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE);-+		if (!BirdFont.mac) {+			Gtk.MenuItem preview_item = new Gtk.MenuItem.with_mnemonic(_("_Preview"));+			file_menu.append (preview_item);+			preview_item.activate.connect (() => { MenuTab.preview (); });+			preview_item.add_accelerator ("activate", accel_group, 'P', Gdk.ModifierType.CONTROL_MASK, Gtk.AccelFlags.VISIBLE);+		}+		 		Gtk.MenuItem description_item = new Gtk.MenuItem.with_mnemonic(_("Name and _description")); 		file_menu.append (description_item); 		description_item.activate.connect (() => { MenuTab.show_description (); });@@ -752,21 +758,18 @@ public class GtkWindow : Gtk.Window, NativeWindow { 	} 	 	public void hide_text_input () {-		text_listener = new TextListener ();+		text_listener = new TextListener ("", "", ""); 		text_box.hide (); 	} 	-	public void set_text_listener (string label, TextListener listener, string default_text, string button_label) {+	public void set_text_listener (TextListener listener) { 		text_listener = listener;-		text_input_label.set_text ("   " + label);-		submit_text_button.set_label (button_label);+		text_input_label.set_text ("   " + listener.label);+		submit_text_button.set_label (listener.button_label); 		text_box.show ();-		text_entry.set_text (default_text);-		listener.signal_submit.connect (() => {-			hide_text_input ();-		});+		text_entry.set_text (listener.default_text); 		text_entry.activate.connect (() => {-			listener.signal_submit (text_entry.text);+			listener.set_text (text_entry.text); 			hide_text_input (); 		}); 		text_entry.grab_focus ();diff --git a/birdfont_install b/birdfont_installnew file mode 100755index 0000000..e832519--- /dev/null+++ b/birdfont_install@@ -0,0 +1,78 @@+#!/usr/bin/python +import os+import subprocess+import glob+from optparse import OptionParser+from scripts import config+from scripts import version++def install (file, dir):+	f = dest + prefix + dir + '/'+	s = file.rfind ('/')+	if s > -1:+		f += file[s + 1:]+	else:+		f += file+	print ("install: " + f)+	subprocess.check_output ('install -d ' + dest + prefix + dir, shell=True)+	subprocess.check_output ('install ' + file + ' ' + dest + prefix + dir + '/', shell=True)+	installed.write (f + "\n")++if not os.path.exists ("build/configured"):+	print ("Project is not configured")+	exit (1)++if not os.path.exists ("build/installed"):+        print ("Project is not built")+        exit (1)++parser = OptionParser()+parser.add_option ("-d", "--dest", dest="dest", help="install to this directory", metavar="DEST")+parser.add_option ("-m", "--bsd-manpages", dest="nogzip", help="don't gzip manpages")++(options, args) = parser.parse_args()++if not options.dest:+	options.dest = ""++if not options.nogzip:+    bsd_manpages = True+else:+    bsd_manpages = False+	+prefix = config.PREFIX+dest = options.dest++# create uninstall file+installed = open ('build/installed', 'w')+installed.write ('build/installed\n')++# install it:+for file in os.listdir('./layout'):+	install ('layout/' + file, '/share/birdfont/layout')++for file in os.listdir('./icons'):+	install ('icons/' + file, '/share/birdfont/icons')++install ('resources/linux/birdfont.desktop', '/share/applications')+install ('resources/linux/birdfont.png', '/share/icons/hicolor/48x48/apps')++install ('build/bin/birdfont', '/bin')+install ('build/bin/birdfont-export', '/bin')+install ('build/libbirdfont.so.' +  version.SO_VERSION, '/lib')+install ('build/libbirdfont.so', '/lib')++if not bsd_manpages:+    install ('build/birdfont.1.gz', '/share/man/man1')+    install ('build/birdfont-export.1.gz', '/share/man/man1')+else:+    install ('resources/linux/birdfont.1', '/man/man1')+    install ('resources/linux/birdfont-export.1', '/man/man1')+++# translations+for lang_dir in glob.glob('build/locale/*'):+	lc = lang_dir.replace ('build/locale/', "")+	install ('build/locale/' + lc + '/LC_MESSAGES/birdfont.mo', '/share/locale/' + lc + '/LC_MESSAGES' );++installed.close ()diff --git a/install b/installdeleted file mode 100755index e832519..0000000--- a/install+++ /dev/null@@ -1,78 +0,0 @@-#!/usr/bin/python -import os-import subprocess-import glob-from optparse import OptionParser-from scripts import config-from scripts import version--def install (file, dir):-	f = dest + prefix + dir + '/'-	s = file.rfind ('/')-	if s > -1:-		f += file[s + 1:]-	else:-		f += file-	print ("install: " + f)-	subprocess.check_output ('install -d ' + dest + prefix + dir, shell=True)-	subprocess.check_output ('install ' + file + ' ' + dest + prefix + dir + '/', shell=True)-	installed.write (f + "\n")--if not os.path.exists ("build/configured"):-	print ("Project is not configured")-	exit (1)--if not os.path.exists ("build/installed"):-        print ("Project is not built")-        exit (1)--parser = OptionParser()-parser.add_option ("-d", "--dest", dest="dest", help="install to this directory", metavar="DEST")-parser.add_option ("-m", "--bsd-manpages", dest="nogzip", help="don't gzip manpages")--(options, args) = parser.parse_args()--if not options.dest:-	options.dest = ""--if not options.nogzip:-    bsd_manpages = True-else:-    bsd_manpages = False-	-prefix = config.PREFIX-dest = options.dest--# create uninstall file-installed = open ('build/installed', 'w')-installed.write ('build/installed\n')--# install it:-for file in os.listdir('./layout'):-	install ('layout/' + file, '/share/birdfont/layout')--for file in os.listdir('./icons'):-	install ('icons/' + file, '/share/birdfont/icons')--install ('resources/linux/birdfont.desktop', '/share/applications')-install ('resources/linux/birdfont.png', '/share/icons/hicolor/48x48/apps')--install ('build/bin/birdfont', '/bin')-install ('build/bin/birdfont-export', '/bin')-install ('build/libbirdfont.so.' +  version.SO_VERSION, '/lib')-install ('build/libbirdfont.so', '/lib')--if not bsd_manpages:-    install ('build/birdfont.1.gz', '/share/man/man1')-    install ('build/birdfont-export.1.gz', '/share/man/man1')-else:-    install ('resources/linux/birdfont.1', '/man/man1')-    install ('resources/linux/birdfont-export.1', '/man/man1')---# translations-for lang_dir in glob.glob('build/locale/*'):-	lc = lang_dir.replace ('build/locale/', "")-	install ('build/locale/' + lc + '/LC_MESSAGES/birdfont.mo', '/share/locale/' + lc + '/LC_MESSAGES' );--installed.close ()diff --git a/libbirdfont/ExportTool.vala b/libbirdfont/ExportTool.valaindex b903667..8398d55 100644--- a/libbirdfont/ExportTool.vala+++ b/libbirdfont/ExportTool.vala@@ -160,6 +160,7 @@ public class ExportTool : GLib.Object {  	public static void export_all () { 		bool f;+		Preview preview;  		f = export_ttf_font (); 		if (!f) {@@ -170,6 +171,10 @@ public class ExportTool : GLib.Object { 		if (!f) { 			warning ("Failed to export svg font"); 		}+		+		// create html file+		preview = new Preview ();+		preview.get_html_file (); 	}  	public static void generate_html_document (string html_file, Font font) {@@ -483,8 +488,9 @@ os.put_string ( 			foreach (string s in spawn_args) { 				c += s + " "; 			}--			Process.spawn_command_line_async (c);+			+			print (@"Running: $(c)\n");+			MainWindow.native_window.spawn (c); 		} catch (SpawnError e) { 			warning (e.message); 		}diff --git a/libbirdfont/MainWindow.vala b/libbirdfont/MainWindow.valaindex 4d7c4f0..e0b1a36 100644--- a/libbirdfont/MainWindow.vala+++ b/libbirdfont/MainWindow.vala@@ -102,12 +102,12 @@ public class MainWindow { 	}
 	
 	public static void update_glyph_sequence () {
-		TextListener listener = new TextListener ();
+		TextListener listener = new TextListener (_("Glyph sequence"), Preferences.get ("glyph_sequence"), _("Close"));
 		listener.signal_text_input.connect ((text) => {
 			Preferences.set ("glyph_sequence", text);
 			get_glyph_canvas ().redraw ();
 		});
-		native_window.set_text_listener (_("Glyph sequence"), listener, Preferences.get ("glyph_sequence"), _("Close"));
+		native_window.set_text_listener (listener);
 	}
 	
 	public static MainWindow get_singleton () {
diff --git a/libbirdfont/NativeWindow.vala b/libbirdfont/NativeWindow.valaindex 20744c3..324a208 100644--- a/libbirdfont/NativeWindow.vala+++ b/libbirdfont/NativeWindow.vala@@ -37,8 +37,10 @@ public interface NativeWindow : GLib.Object { 	public abstract void set_scrollbar_size (double size); 	public abstract void set_scrollbar_position (double position); 	+	public abstract void spawn (string command);+	 	/** Request text input from the UI. */-	public abstract void set_text_listener (string label, TextListener listener, string default_text, string button_label);+	public abstract void set_text_listener (TextListener listener); 	 	/** Remove the text listener and hode the text area. */ 	public abstract void hide_text_input ();diff --git a/libbirdfont/OverView.vala b/libbirdfont/OverView.valaindex d3f2ba9..bbb2d10 100644--- a/libbirdfont/OverView.vala+++ b/libbirdfont/OverView.vala@@ -334,6 +334,11 @@ public class OverView : FontDisplay { 			cr.move_to (x, caption_y); 			cr.show_text (character_string); 			+			cr.show_text ("Q");+			+			cr.move_to (0, 0);+			cr.show_text ("X");+			 			x += nail_width; 			index++; 			i++;diff --git a/libbirdfont/TextListener.vala b/libbirdfont/TextListener.valaindex 404953d..a9b71c3 100644--- a/libbirdfont/TextListener.vala+++ b/libbirdfont/TextListener.vala@@ -18,8 +18,31 @@ namespace BirdFont {  public class TextListener : GLib.Object {++	public string label;+	public string default_text;+	public string button_label;+ 	public signal void signal_text_input (string text); 	public signal void signal_submit (string text);	++	private string text;++	public TextListener (string label, string default_text, string button_label) {+		this.label = label;+		this.default_text = default_text;+		this.button_label = button_label;+	}+	+	public void set_text (string t) {+		text = t;+		signal_text_input  (text);+	}++	public void submit () {+		signal_text_input  (text);+		signal_submit  (text);+	} }  }diff --git a/scripts/export.sh b/scripts/export.shindex f8dc8a9..990f47e 100755--- a/scripts/export.sh+++ b/scripts/export.sh@@ -23,7 +23,7 @@ cd export  git clone --no-hardlinks --local $rep -version=$(cat ../../scripts/version.py | grep "VERSION = '" | sed -e "s:VERSION = '::" | sed "s:'.*::g")+version=$(cat ../../scripts/version.py | grep "VERSION = '" | grep -v "SO_VERSION" | sed -e "s:VERSION = '::" | sed "s:'.*::g")  mv birdfont birdfont-$version diff --git a/scripts/macport_build.py b/scripts/macport_build.pyindex 6bc40e9..9a6c60d 100755--- a/scripts/macport_build.py+++ b/scripts/macport_build.py@@ -26,14 +26,14 @@ from run import run  import configfile -def build(prefix, cc, cflags, ldflags):+def build(prefix, cc, cflags, ldflags, valac): 	compile_translations () 	 	#libbirdfont 	run("mkdir -p build/libbirdfont") 	run("mkdir -p build/bin") -	run("""valac \+	run(valac + """\ 		-C \ 		--basedir build/libbirdfont/ \ 		--enable-experimental-non-null \@@ -78,7 +78,7 @@ def build(prefix, cc, cflags, ldflags): 	# birdfont 	run("mkdir -p build/birdfont") 	-	run("""valac \+	run(valac + """\ 		-C \ 		--enable-experimental-non-null \ 		--enable-experimental \@@ -120,7 +120,7 @@ def build(prefix, cc, cflags, ldflags): 	# birdfont-export 	run("mkdir -p build/birdfont-export") 	-	run("""valac \+	run(valac + """ \ 		-C \ 		--enable-experimental-non-null \ 		--enable-experimental \@@ -186,6 +186,7 @@ parser.add_option("-d", "--dest", dest="dest", help="install to this directory", parser.add_option("-c", "--cc", dest="cc", help="select the C compiler", metavar="CC") parser.add_option("-f", "--cflags", dest="cflags", help="set compiler flags", metavar="CFLAGS") parser.add_option("-l", "--ldflags", dest="ldflags", help="set linker flags", metavar="LDFLAGS")+parser.add_option("-v", "--valac", dest="valac", help="select vala compiler", metavar="VALAC")  (options, args) = parser.parse_args() @@ -197,9 +198,11 @@ if not options.cflags: 	options.cflags = "" if not options.ldflags: 	options.ldflags = ""+if not options.valac:+	options.valac = "valac"  build_app (options.prefix)	-build (options.prefix, options.cc, options.cflags, options.ldflags)+build (options.prefix, options.cc, options.cflags, options.ldflags, options.valac)   

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112