diff options
| author | Arne Schwabe <arne@rfc2549.org> | 2012-06-20 22:27:31 +0200 | 
|---|---|---|
| committer | Arne Schwabe <arne@rfc2549.org> | 2012-06-20 22:27:31 +0200 | 
| commit | 351503e91e5afcc6c29b5ec2fc1f44f255b72acf (patch) | |
| tree | 8f5ca8588baf0533af4026a04a41826e0d01b803 /src | |
| parent | 3f07371155f442f3dfd6b705143d60e173bfdc48 (diff) | |
Make important message have a ticker message, fix status line in log window
Diffstat (limited to 'src')
| -rw-r--r-- | src/de/blinkt/openvpn/LogWindow.java | 5 | ||||
| -rw-r--r-- | src/de/blinkt/openvpn/OpenVpnService.java | 10 | 
2 files changed, 11 insertions, 4 deletions
| diff --git a/src/de/blinkt/openvpn/LogWindow.java b/src/de/blinkt/openvpn/LogWindow.java index 8fadf3ad..ae5277cd 100644 --- a/src/de/blinkt/openvpn/LogWindow.java +++ b/src/de/blinkt/openvpn/LogWindow.java @@ -276,7 +276,10 @@ public class LogWindow extends ListActivity implements StateListener  {  			@Override  			public void run() { -				mSpeedView.setText(status + " " + logmessage); +				String prefix=status+ ":"; +				if (status.equals("BYTECOUNT") || status.equals("NOPROCESS") ) +					prefix=""; +				mSpeedView.setText(prefix + logmessage);  			}  		}); diff --git a/src/de/blinkt/openvpn/OpenVpnService.java b/src/de/blinkt/openvpn/OpenVpnService.java index a0d7503d..fd0b4f2a 100644 --- a/src/de/blinkt/openvpn/OpenVpnService.java +++ b/src/de/blinkt/openvpn/OpenVpnService.java @@ -76,7 +76,7 @@ public class OpenVpnService extends VpnService implements StateListener {  		mNotificationManager.cancel(OPENVPN_STATUS);  	} -	private void showNotification(String msg) { +	private void showNotification(String msg, String tickerText) {  		String ns = Context.NOTIFICATION_SERVICE;  		NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); @@ -93,6 +93,9 @@ public class OpenVpnService extends VpnService implements StateListener {  		nbuilder.setContentIntent(getLogPendingIntent());  		nbuilder.setSmallIcon(icon);  		nbuilder.setWhen(when); +		 +		if(tickerText!=null) +			nbuilder.setTicker(tickerText);  		mNotification = nbuilder.getNotification(); @@ -395,11 +398,12 @@ public class OpenVpnService extends VpnService implements StateListener {  		if("BYTECOUNT".equals(state)) {  			if(mDisplayBytecount) { -				showNotification(logmessage); +				showNotification(logmessage,null);  			}  		} else {  			// Other notifications are shown -			showNotification(state +" " + logmessage); +			String ticker = state.toLowerCase(); +			showNotification(state +" " + logmessage,ticker);  		}  	} | 
