SDL: fixed command-line editor dialog
This commit is contained in:
@@ -557,12 +557,10 @@ class SettingsMenuMisc extends SettingsMenu
|
|||||||
edit.setFocusableInTouchMode(true);
|
edit.setFocusableInTouchMode(true);
|
||||||
edit.setFocusable(true);
|
edit.setFocusable(true);
|
||||||
if (Globals.CommandLine.length() == 0)
|
if (Globals.CommandLine.length() == 0)
|
||||||
Globals.CommandLine = "SDL_app";
|
Globals.CommandLine = "App";
|
||||||
if (Globals.CommandLine.indexOf(" ") == -1)
|
edit.setText(Globals.CommandLine.replace(" ", "\n").replace(" ", " "));
|
||||||
Globals.CommandLine += " ";
|
|
||||||
edit.setText(Globals.CommandLine.substring(Globals.CommandLine.indexOf(" ")).replace(" ", "\n").replace(" ", " "));
|
|
||||||
edit.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
|
edit.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
|
||||||
edit.setMinLines(2);
|
edit.setMinLines(1);
|
||||||
//edit.setMaxLines(100);
|
//edit.setMaxLines(100);
|
||||||
builder.setView(edit);
|
builder.setView(edit);
|
||||||
|
|
||||||
@@ -570,17 +568,22 @@ class SettingsMenuMisc extends SettingsMenu
|
|||||||
{
|
{
|
||||||
public void onClick(DialogInterface dialog, int item)
|
public void onClick(DialogInterface dialog, int item)
|
||||||
{
|
{
|
||||||
Globals.CommandLine = "SDL_app";
|
Globals.CommandLine = "";
|
||||||
String args[] = edit.getText().toString().split("\n");
|
String args[] = edit.getText().toString().split("\n");
|
||||||
boolean firstArg = true;
|
if( args.length == 1 )
|
||||||
for( String arg: args )
|
|
||||||
{
|
{
|
||||||
Globals.CommandLine += " ";
|
Globals.CommandLine = args[0];
|
||||||
if( firstArg )
|
}
|
||||||
Globals.CommandLine += arg;
|
else
|
||||||
else
|
{
|
||||||
|
boolean firstArg = true;
|
||||||
|
for( String arg: args )
|
||||||
|
{
|
||||||
|
if( !firstArg )
|
||||||
|
Globals.CommandLine += " ";
|
||||||
Globals.CommandLine += arg.replace(" ", " ");
|
Globals.CommandLine += arg.replace(" ", " ");
|
||||||
firstArg = false;
|
firstArg = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
goBack(p);
|
goBack(p);
|
||||||
|
|||||||
Reference in New Issue
Block a user