Differential D12229 Diff 32204 src/org/kde/kdeconnect/Plugins/RunCommandPlugin/AddCommandDialog.java
Changeset View
Changeset View
Standalone View
Standalone View
src/org/kde/kdeconnect/Plugins/RunCommandPlugin/AddCommandDialog.java
Show All 29 Lines | 24 | public Dialog onCreateDialog(Bundle savedInstanceState) { | |||
---|---|---|---|---|---|
30 | 30 | | |||
31 | View view = inflater.inflate(R.layout.addcommanddialog, null); | 31 | View view = inflater.inflate(R.layout.addcommanddialog, null); | ||
32 | 32 | | |||
33 | nameField = (EditText) view.findViewById(R.id.addcommand_name); | 33 | nameField = (EditText) view.findViewById(R.id.addcommand_name); | ||
34 | commandField = (EditText) view.findViewById(R.id.addcommand_command); | 34 | commandField = (EditText) view.findViewById(R.id.addcommand_command); | ||
35 | 35 | | |||
36 | builder.setView(view); | 36 | builder.setView(view); | ||
37 | 37 | | |||
38 | builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { | 38 | builder.setPositiveButton(R.string.ok, (dialog, id) -> { | ||
39 | public void onClick(DialogInterface dialog, int id) { | | |||
40 | 39 | | |||
41 | if (getActivity() instanceof RunCommandActivity) { | 40 | if (getActivity() instanceof RunCommandActivity) { | ||
42 | 41 | | |||
43 | String name = nameField.getText().toString(); | 42 | String name = nameField.getText().toString(); | ||
44 | String command = commandField.getText().toString(); | 43 | String command = commandField.getText().toString(); | ||
45 | 44 | | |||
46 | ((RunCommandActivity) getActivity()).dialogResult(name, command); | 45 | ((RunCommandActivity) getActivity()).dialogResult(name, command); | ||
47 | } | 46 | } | ||
48 | } | | |||
49 | }); | 47 | }); | ||
50 | builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { | 48 | builder.setNegativeButton(R.string.cancel, (dialog, id) -> { | ||
51 | public void onClick(DialogInterface dialog, int id) { | | |||
52 | } | | |||
53 | }); | 49 | }); | ||
54 | 50 | | |||
55 | return builder.create(); | 51 | return builder.create(); | ||
56 | } | 52 | } | ||
57 | } | 53 | } |