Ticket.bjs
[gitlive] / Ticket.vala
index 49a0191..e349e33 100644 (file)
@@ -27,6 +27,7 @@ public class Ticket : Object
     public Xcls_clmodel clmodel;
     public Xcls_developer_id developer_id;
     public Xcls_devmodel devmodel;
+    public Xcls_spinner spinner;
 
         // my vars (def)
     public GitRepo? repo;
@@ -51,6 +52,9 @@ public class Ticket : Object
         var child_0 = new Xcls_VBox2( _this );
         child_0.ref();
         this.el.get_content_area().add (  child_0.el  );
+        var child_1 = new Xcls_spinner( _this );
+        child_1.ref();
+        this.el.add (  child_1.el  );
 
         //listeners
         this.el.delete_event.connect( (self, event) => {
@@ -79,11 +83,12 @@ public class Ticket : Object
                        _this.summary.el.get_text() ,
                        _this.description.el.buffer.text 
                );
-               
+               this.el.hide();
+            this.running = false; 
                if (this.repo != null) {
                        NewBranch.singleton().show(this.repo, new Gee.ArrayList<GitMonitorQueue>(), tid);
                }
-                
+        
         
                 
         });
@@ -117,7 +122,7 @@ public class Ticket : Object
     
        RooProject? curproj = null;
         if (this.repo != null) {
-           curproj = RooTicket.singleton().getProjectByRepo(this.repo);
+           curproj = RooProject.getProjectByRepo(this.repo);
         }
        _this.prmodel.loadProjects(curproj == null ? "" : curproj.id);
         if (curproj != null) {
@@ -133,6 +138,9 @@ public class Ticket : Object
                _this.devmodel.loadDevelopers();        
                
         }
+               _this.summary.el.set_text("");
+               _this.description.el.buffer.text = ""; 
+        
      
        this.el.run();
     
@@ -422,8 +430,6 @@ public class Ticket : Object
         // user defined functions
         public void loadProjects (string id) {
         
-            var rt = RooTicket.singleton();
-            rt.loadProjects();
             
             _this.project_id.loading = true;
         
@@ -439,8 +445,8 @@ public class Ticket : Object
             if (id == "") {
                    _this.project_id.el.set_active_iter(iter);
             }
-            var projects = rt.projects;
-            foreach(var project in projects) {
+        
+            foreach(var project in RooProject.projects()) {
             
                 el.append(out iter);
                 
@@ -1249,4 +1255,29 @@ public class Ticket : Object
 
 
 
+    public class Xcls_spinner : Object
+    {
+        public Gtk.Spinner el;
+        private Ticket  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_spinner(Ticket _owner )
+        {
+            _this = _owner;
+            _this.spinner = this;
+            this.el = new Gtk.Spinner();
+
+            // my vars (dec)
+
+            // set gobject values
+            this.el.hexpand = true;
+            this.el.vexpand = true;
+        }
+
+        // user defined functions
+    }
+
 }