summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/ShowConfigFragment.java
blob: 13c65df8f2f8ac85446ef65b81aa8f607eb7b239 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package de.blinkt.openvpn;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;


public class ShowConfigFragment extends Fragment {
	public android.view.View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 
	{
		String profileUUID = getArguments().getString(getActivity().getPackageName() + ".profileUUID");
		VpnProfile vp = ProfileManager.get(profileUUID);
		View v=inflater.inflate(R.layout.viewconfig, container,false);
		TextView cv = (TextView) v.findViewById(R.id.configview);
		
		int check=vp.checkProfile();
		if(check!=R.string.no_error_found) {
			cv.setText(check);
		}
		else { 
			String cfg=vp.getConfigFile(getActivity().getCacheDir());
			cv.setText(cfg);
		}
		return v;
	};
}