Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix document focus after chat/shout window for scapp/qt

  • Loading branch information...
commit cf81cbcf583e0c6ccfa325b703e5b41e941f0b58 1 parent 172189c
Patrick Borgeat authored January 22, 2012
11  MandelClock.sc
@@ -696,12 +696,19 @@ MandelClock {
696 696
 		}
697 697
 	}
698 698
 	
  699
+	pr_sendWindow {|title, func|
  700
+		StringInputDialog.new(title, "Send", {|string| 
  701
+			func.value(string);
  702
+			platform.focusCurrentDocument;
  703
+		});		
  704
+	}
  705
+	
699 706
 	chatWindow {
700  
-		StringInputDialog.new("MandelClock Chat", "Send", {|string| this.chat(string);});
  707
+		this.pr_sendWindow("MandelClock Chat",  {|string| this.chat(string);});
701 708
 	}
702 709
 	
703 710
 	shoutWindow {
704  
-		StringInputDialog.new("MandelClock Shout", "Send", {|string| this.shout(string);});
  711
+		this.pr_sendWindow("MandelClock Shout", {|string| this.shout(string);});
705 712
 	}
706 713
 	
707 714
 	metro {|pan=0.0, quant=4|
10  MandelPlatform.sc
@@ -26,6 +26,10 @@ MandelPlatform : MandelModule {
26 26
 	displayNotification {|title, message|
27 27
 		"This should have been implemented by the platform".postln;
28 28
 	}
  29
+	
  30
+	focusCurrentDocument {
  31
+		// don't know if this can apply to other platforms
  32
+	}
29 33
 }
30 34
 
31 35
 MandelPlatformLinux : MandelPlatform {
@@ -43,4 +47,10 @@ MandelPlatformOSX : MandelPlatform {
43 47
 	displayNotification {|title, message|
44 48
 		("osascript '" ++ mc.classPath("mcNotify.scpt") ++ "' '" ++ title ++ "' '" ++ message ++ "'").unixCmd(postOutput:false);
45 49
 	}
  50
+	
  51
+	focusCurrentDocument {
  52
+		(thisProcess.platform.ideName == "scapp").if { // might make sense for other ides, but can't try
  53
+			Document.current.front;
  54
+		};	
  55
+	}
46 56
 }
2  StringInputDialog.sc
@@ -114,8 +114,8 @@ StringInputDialog {
114 114
 	}
115 115
 	
116 116
 	doAction {
  117
+		window.close;
117 118
 		function.value(txt.string);
118  
-		window.close;	
119 119
 	}
120 120
 	
121 121
 	close {

0 notes on commit cf81cbc

Please sign in to comment.
Something went wrong with that request. Please try again.