[seed] Rough sketch of a port of the browser, could probably be reorganized a bit



commit fd0b7e567850c6399d804b8c5317ddecf2ddacd9
Author: Robert Carr <racarr mireia (none)>
Date:   Tue Apr 14 23:03:19 2009 -0400

    Rough sketch of a port of the browser, could probably be reorganized a bit
---
 examples/browser/BrowserToolbar.js |    4 +++-
 examples/browser/BrowserView.js    |    4 +++-
 examples/browser/TabbedBrowser.js  |    2 +-
 examples/browser/main.js           |    9 +++++----
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/examples/browser/BrowserToolbar.js b/examples/browser/BrowserToolbar.js
index 51a26ad..b35f711 100644
--- a/examples/browser/BrowserToolbar.js
+++ b/examples/browser/BrowserToolbar.js
@@ -1,5 +1,7 @@
 Gtk = imports.gi.Gtk;
 
+BrowserSettings = imports.BrowserSettings;
+
 BrowserToolbar = new GType({
     parent: Gtk.HBox.type,
     name: "BrowserToolbar",
@@ -50,7 +52,7 @@ BrowserToolbar = new GType({
 
         this.set_progress = function (progress)
         {
-            if(have_progress_bar)
+            if(BrowserSettings.have_progress_bar)
                 url_bar.set_progress_fraction(progress);
         };
 
diff --git a/examples/browser/BrowserView.js b/examples/browser/BrowserView.js
index c7b3d9b..2150725 100644
--- a/examples/browser/BrowserView.js
+++ b/examples/browser/BrowserView.js
@@ -1,6 +1,8 @@
 Gtk = imports.gi.Gtk;
 WebKit = imports.gi.WebKit;
 
+TabbedBrowser = imports.TabbedBrowser;
+
 BrowserView = new GType({
     parent: WebKit.WebView.type,
     name: "BrowserView",
@@ -40,7 +42,7 @@ BrowserView = new GType({
 
         var show_new_tab = function (new_web_view)
         {
-            browser.new_tab("", new_web_view);
+            TabbedBrowser.browser.new_tab("", new_web_view);
 
             return false;
         };
diff --git a/examples/browser/TabbedBrowser.js b/examples/browser/TabbedBrowser.js
index 6e3724a..16342ee 100644
--- a/examples/browser/TabbedBrowser.js
+++ b/examples/browser/TabbedBrowser.js
@@ -47,7 +47,7 @@ TabbedBrowser = new GType({
             this.append_page(new_tab, tab_title);
             this.set_tab_reorderable(new_tab, true);
 
-            if(select_new_tabs)
+            if(BrowserSettings.select_new_tabs)
                 this.page = this.page_num(new_tab);
         };
 
diff --git a/examples/browser/main.js b/examples/browser/main.js
index 00ef319..2af838d 100755
--- a/examples/browser/main.js
+++ b/examples/browser/main.js
@@ -6,6 +6,7 @@ WebKit = imports.gi.WebKit;
 Gtk.init(null, null);
 
 TabbedBrowser = imports.TabbedBrowser;
+BrowserSettings = imports.BrowserSettings;
 //Seed.include("BrowserStatusbar.js");
 //Seed.include("BrowserTab.js");
 //Seed.include("TabbedBrowser.js");
@@ -13,19 +14,19 @@ TabbedBrowser = imports.TabbedBrowser;
 
 // Test for Gtk >= 2.16 (otherwise don't have a progress bar)
 
-have_progress_bar = false;
+BrowserSettings.have_progress_bar = false;
 
 if(Gtk.Entry.prototype.set_progress_fraction)
 {
-	have_progress_bar = true;
+	BrowserSettings.have_progress_bar = true;
 }
 
 window = new Gtk.Window({title: "Browser"});
 window.resize(800, 600);
 window.signal.hide.connect(function () { Gtk.main_quit(); });
 
-browser = new TabbedBrowser.TabbedBrowser();
-window.add(browser);
+TabbedBrowser.browser = new TabbedBrowser.TabbedBrowser();
+window.add(TabbedBrowser.browser);
 window.show_all();
 
 Gtk.main();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]