Commits

troorl committed 65ee871

more improvenets to the conversation view

Comments (0)

Files changed (4)

src/reply_label.vala

 	private Image img;
 	private HBox hb;
 	private EventBoxTr ebox;
+	private Spinner? progress = null;
 	
 	public signal void clicked();
 	
 			
 			return true;
 		});
-		
-		hb.set_tooltip_text("Show conversation");
+	}
+	
+	public void set_tooltip(string text) {
+		hb.set_tooltip_text(text);
+	}
+	
+	public void start() {
+		progress = new Spinner();
+		progress.show();
+		progress.start();
+		hb.pack_start(progress, false, false, 0);
+	}
+	
+	public void stop() {
+		if(progress != null) {
+			hb.remove(progress);
+			//progress.expose();
+			progress = null;
+		}
 	}
 }
 	public ArrayList<Status>? conversation {get; set; default = null;}
 	
 	public signal void new_reply(Status status);
+	public signal void end_reply();
 }
 
 public class User : GLib.Object {

src/status_delegate.vala

 	private Label nick;
 	private Label date;
 	private WrapLabel content;
+	private ReplyLabel re_label;
+	private bool already_expanded = false;
 	private ConversationView? con_view = null;
 	private VBox vb_right;
 	
 				re_box.pack_start(re_img, false, false, 0);
 				re_box.pack_start(re_label, false, false, 4);*/
 				
-				ReplyLabel re_label = new ReplyLabel(status.reply.name);
-				re_label.clicked.connect(() => {
-					debug("ok");
-					stream.account.get_conversation(status);
-				});
+				re_label = new ReplyLabel(status.reply.name);
+				re_label.set_tooltip(_("Show conversation"));
+				
+				re_label.clicked.connect(re_label_clicked);
+				
 				vb_right.pack_start(re_label, false, false, 4);
 				
 				status.new_reply.connect(add_new_reply);
 				
+				status.end_reply.connect(end_reply);
+				
 			} else {
 				HBox spacer = new HBox(false, 0);
 				spacer.set_size_request(1, 4);
 		modify_bg(StateType.NORMAL, color);
 	}
 	
+	private void re_label_clicked() {
+		re_label.set_sensitive(false);
+		re_label.start();
+		
+		/*
+		if(already_expanded) {
+			if(con_view.visible) {
+				con_view.hide_all();
+				re_label.set_tooltip(tooltip_show);
+			} else {
+				con_view.show_all();
+				re_label.set_tooltip(tooltip_hide);
+			}
+			
+			return;
+		}*/
+		
+		stream.account.get_conversation(status);
+		
+		//already_expanded = true;
+	}
+	
 	private void add_new_reply(Status nstatus) { //new reply received
 		debug(nstatus.id);
 		
 		con_view.add_delegate(new StatusDelegate(nstatus, stream));
 	}
 	
+	private void end_reply() {
+		re_label.stop();
+		re_label.set_tooltip("");
+	}
+	
 	/** Any click makes it not fresh */
 	private bool on_click(Gdk.EventButton event) {
 		switch(event.button) {

src/twitter_recursive_reply.vala

 	private void get_reply(Status status) {
 		if(status.reply == null) {
 			debug("the end");
+			fstatus.end_reply();
 			return;
 		}