Uncommited changes synced
[gitlive] / NewBranch.vala
index 46468e1..6203937 100644 (file)
@@ -22,6 +22,7 @@ public class NewBranch : Object
     public Xcls_btn_not_me btn_not_me;
     public Xcls_btn_closed btn_closed;
     public Xcls_scrolled_window scrolled_window;
+    public Xcls_view view;
 
         // my vars (def)
     public GitRepo? repo;
@@ -41,7 +42,7 @@ public class NewBranch : Object
 
         // set gobject values
         this.el.title = "Create a working branch ";
-        this.el.default_height = 200;
+        this.el.default_height = 500;
         this.el.default_width = 500;
         this.el.deletable = true;
         this.el.modal = true;
@@ -126,12 +127,15 @@ public class NewBranch : Object
          _this.prmodel.loadProjects(curproj == null ? "" : curproj.id);
         
        _this.dbmodel.loadTickets(curproj == null ? "": curproj.id, tid);
+    
        if (tid != "") {
                var name = RooTicket.singleton().usernameLocal();
                var ticket = RooTicket.singleton().getById(tid);
                _this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName()));
-       }
     
+    
+       }
+        _this.view.loadTicket(tid);
        this.el.run();
     
     }
@@ -472,6 +476,7 @@ public class NewBranch : Object
                
                        var dt = new  DateTime.now_local();
                        _this.name.el.set_text("wip_%s_%s".printf(name,dt.format("%Y_%b_%d")));
+                       _this.view.loadTicket("");              
                        return;
                }
                
@@ -479,7 +484,9 @@ public class NewBranch : Object
                var ticket = RooTicket.singleton().getById(ticket_id);
                
                _this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName()));
-               
+               _this.scrolled_window.el.show();
+                
+               _this.view.loadTicket(ticket.id);
                //GLib.debug (//"Selection: %s, %s\n", (string) val1, (string) val2);
             });
         }
@@ -853,7 +860,9 @@ public class NewBranch : Object
             // my vars (dec)
 
             // set gobject values
-            var child_0 = new Xcls_WebView21( _this );
+            this.el.height_request = 500;
+            this.el.vexpand = true;
+            var child_0 = new Xcls_view( _this );
             child_0.ref();
             this.el.add (  child_0.el  );
 
@@ -866,7 +875,7 @@ public class NewBranch : Object
 
         // user defined functions
     }
-    public class Xcls_WebView21 : Object
+    public class Xcls_view : Object
     {
         public WebKit.WebView el;
         private NewBranch  _this;
@@ -875,22 +884,31 @@ public class NewBranch : Object
             // my vars (def)
 
         // ctor
-        public Xcls_WebView21(NewBranch _owner )
+        public Xcls_view(NewBranch _owner )
         {
             _this = _owner;
+            _this.view = this;
             this.el = new WebKit.WebView();
 
             // my vars (dec)
 
-            // init method
-
-            {
-                        
-                
-                        // init method
+            // set gobject values
         }
 
         // user defined functions
+        public void loadTicket (string tid) {
+               int h,w;
+               _this.el.get_size(out w, out h);
+               
+               if (tid == "") {
+                       _this.scrolled_window.el.hide();
+                       _this.el.resize(w, 300);
+               } else {
+                       _this.scrolled_window.el.show();
+                       _this.el.resize(w, 800);
+               }
+                this.el.load_uri("http://www.google.com");
+        }
     }