Clone in a terminal:
Commit 878ff9c
Johan Mattsson - 2013-09-20T11:50:14+00:00
878ff9c634d1e37616607566173f15bd6f18cffdjohan.mattsson.m@gmail.com

translations on android

Changed files (7)

Diff

diff --git a/birdfont/Main.vala b/birdfont/Main.valaindex 08d8fe3..9c05689 100644--- a/birdfont/Main.vala+++ b/birdfont/Main.vala@@ -17,8 +17,6 @@  using BirdFont; -const string GETTEXT_PACKAGE = "birdfont"; - void parse_gtk_rc () { 	File f = FontDisplay.find_file ("layout", "birdfont.rc"); 	Gtk.rc_parse ((!) f.get_path ());@@ -85,3 +83,4 @@ public static int main (string[] arg) { 	return 0; } +diff --git a/libbirdfont/BirdFont.vala b/libbirdfont/BirdFont.valaindex 7540ad4..02ee706 100644--- a/libbirdfont/BirdFont.vala+++ b/libbirdfont/BirdFont.vala@@ -12,7 +12,7 @@     Lesser General Public License for more details. */ using BirdFont;-const string GETTEXT_PACKAGE = "birdfont"; +public const string GETTEXT_PACKAGE = "birdfont";   namespace BirdFont { 	@@ -289,7 +289,7 @@ public class BirdFont { 			} 		} -		printd ("fatal");+		printd ("init fatal warnings"); 		if (fatal_wanings) { 			LogLevelFlags levels = LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL | LogLevelFlags.LEVEL_WARNING; 			Log.set_handler (null, levels, fatal_warning);@@ -483,14 +483,9 @@ void printd (string s) { #endif } -#if ANDROID-string t_ (string t) {-	return t;-}-#else+/** Translate string */ string t_ (string t) { 	return _(t); }-#endif  }diff --git a/libbirdfont/GlyphBackgroundImage.vala b/libbirdfont/GlyphBackgroundImage.valaindex d7d3f1f..5444349 100644--- a/libbirdfont/GlyphBackgroundImage.vala+++ b/libbirdfont/GlyphBackgroundImage.vala@@ -110,10 +110,8 @@ public class GlyphBackgroundImage { 		} 		 		if (background_image == null) {-#if !ANDROID // FIXME 			background_image = new ImageSurface.from_png (path); 			original_image = new ImageSurface.from_png (path);-#endif 		} 		 		return (!) background_image;diff --git a/libbirdfont/Icons.vala b/libbirdfont/Icons.valaindex 58ba405..71e95e5 100644--- a/libbirdfont/Icons.vala+++ b/libbirdfont/Icons.vala@@ -19,9 +19,6 @@ using Cairo; public class Icons { 	 	public static ImageSurface? get_icon (string? name) {-#if ANDROID // FIXME:-		return null;-#else 		ImageSurface? img = null; 		File f; 		@@ -40,7 +37,6 @@ public class Icons { 		img = new ImageSurface.from_png ((!)f.get_path ()); 		 		return img;-#endif 	}  	public static File find_icon (string name) {diff --git a/libbirdfont/MainWindow.vala b/libbirdfont/MainWindow.valaindex 2e121b6..7c654fa 100644--- a/libbirdfont/MainWindow.vala+++ b/libbirdfont/MainWindow.vala@@ -47,6 +47,7 @@ public class MainWindow { 	} 	
 	public static void open_recent_files_tab () {
+		// FIXME: do not idle 
 		IdleSource idle = new IdleSource ();
 		tabs.add_unique_tab (file_tab);
 		idle.set_callback (() => {			
diff --git a/libbirdfont/SearchPaths.vala b/libbirdfont/SearchPaths.valaindex 970e23c..65c2f5a 100644--- a/libbirdfont/SearchPaths.vala+++ b/libbirdfont/SearchPaths.vala@@ -17,10 +17,21 @@ namespace BirdFont { /** Look for files in default folders on different operating systems. */ public class SearchPaths { 	+	private static string resources_folder = "";+	 	public static File find_file (string? dir, string name) { 		File f; 		string d = (dir == null) ? "" : (!) dir; +		printd ("Looking for: ");+		printd (resources_folder + "/" + d + "/" + name);++		f = get_file (resources_folder + "/" + d + "/", name);+		if (likely (f.query_exists ())) return f;+		+		f = get_file (resources_folder + "/", name + "/");+		if (likely (f.query_exists ())) return f;+ 		f = get_file (BirdFont.exec_path + "/" + d + "/", name); 		if (likely (f.query_exists ())) return f; 		@@ -59,9 +70,6 @@ public class SearchPaths {  		f = get_file (@"$PREFIX/share/birdfont/" + d + "/", name); 		if (likely (f.query_exists ())) return f;--		f = get_file ("/usr/share/birdfont/" + d + "/", name);-		if (likely (f.query_exists ())) return f; 				 		warning (@"Did not find file $name in $d"); 			@@ -153,6 +161,10 @@ public class SearchPaths { 		File f = File.new_for_path (file); 		return f.query_exists (); 	}++	public static void set_resources_folder (string res) {+		resources_folder = res;+	} }  }diff --git a/libbirdfont/TabBar.vala b/libbirdfont/TabBar.valaindex 3269b1b..b5a1441 100644--- a/libbirdfont/TabBar.vala+++ b/libbirdfont/TabBar.vala@@ -51,7 +51,7 @@ public class TabBar : GLib.Object { 	ImageSurface to_previous_tab; 			 	public TabBar () {-		// tabs = new List<Tab> ();+		tabs = new List<Tab> (); 		 		tab1_left = Icons.get_icon ("tab1_left.png"); 		tab1_right = Icons.get_icon ("tab1_right.png");@@ -68,7 +68,7 @@ public class TabBar : GLib.Object { 		to_previous_tab = (!) Icons.get_icon ("previous_tab.png"); 		 		if (is_null (next_tab)) {-			warning ("Next tab is null");+			warning ("Tab icon is null"); 		} 	} 	

Contact

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