Clone in a terminal:
Commit 36249c7
Johan Mattsson - 2012-09-12T17:03:13+00:00
36249c770cfd1cdd837d47e6a776f1488c5e442ajohan.mattsson.m@gmail.com

restructure some gtk callbacks

Changed files (5)

Diff

diff --git a/src/ExportTool.vala b/src/ExportTool.valaindex 6d5ee82..87222a5 100644--- a/src/ExportTool.vala+++ b/src/ExportTool.vala@@ -414,6 +414,7 @@ os.put_string ( 					export_thread.run (); 				} 			} catch (ThreadError e) {+				export_mutex.unlock (); 				warning (e.message); 				done = false; 			}			diff --git a/src/GtkInterface.vala b/src/GtkInterface.valaindex d7f6c41..296f480 100644--- a/src/GtkInterface.vala+++ b/src/GtkInterface.vala@@ -75,6 +75,12 @@ public class GtkWindow : Gtk.Window, NativeWindow { 			int i; 			FontDisplay fd = tab.get_display (); 			+			if (fd.get_name () == "Preview") {+				html_canvas.load_html_string ("", "");	+				Tool.yield ();+				ExportTool.export_all ();+			}+			 			MainWindow.glyph_canvas.set_current_glyph (fd); 			n = fd.is_html_canvas (); 			diff --git a/src/Main.vala b/src/Main.valaindex 0fb881d..e3c774c 100644--- a/src/Main.vala+++ b/src/Main.vala@@ -18,7 +18,5 @@ using Birdfont; 	 public static int main (string[] arg) {-	GtkWindow gtk_window = new GtkWindow ("Birdfont");-	gtk_window.show_all (); 	return run_gui (arg); }diff --git a/src/Preview.vala b/src/Preview.valaindex 49819c3..0345ef5 100644--- a/src/Preview.vala+++ b/src/Preview.vala@@ -33,38 +33,6 @@ class Preview : FontDisplay { 	}  	public override void selected_canvas () {-/*-		WebView w = MainWindow.get_webview ();-		string uri = get_uri ();-		File new_dest;--		// ExportTool.export_svg_font (); windows requires all fonts to be available-		ExportTool.export_all ();-		-		w.open (uri);-		w.reload_bypass_cache ();--		// this  hack forces webkit to reload the font and ignore cached data-		// it's only required on windows platform and in wine -		//-		// it would be nice to remove it.-		if (Supplement.win32) {-			TimeoutSource t1 = new TimeoutSource (300);-			t1.set_callback (() => {-				w.load_html_string ("<html><body>Loading ...</body></html>", uri);-				return false;-			});-			t1.attach (null);-			-			TimeoutSource t2 = new TimeoutSource (1000);-			t2.set_callback (() => {-				w.load_uri (get_uri ());-				w.reload_bypass_cache ();-				return false;-			});-			t2.attach (null);-		}-*/ 	}  	public override string get_uri () {diff --git a/src/TestCases.vala b/src/TestCases.valaindex 1bfae4b..29730a9 100644--- a/src/TestCases.vala+++ b/src/TestCases.vala@@ -98,7 +98,7 @@ class TestCases { 		MenuTab.preview ();  		// TODO: run this many times on big font-		for (int i = 0; i < 10; i++) {+		for (int i = 0; i < 100; i++) { 			MainWindow.get_tab_bar ().select_tab_name ("Menu"); 			Tool.yield (); 			

Contact

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