mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
add and implement reset menuitem
This commit is contained in:
parent
4b48c1a0e6
commit
a18470e4a2
3 changed files with 17 additions and 6 deletions
|
@ -10,6 +10,9 @@
|
||||||
<item android:id="@+id/list_item_copy"
|
<item android:id="@+id/list_item_copy"
|
||||||
android:title="@string/list_item_copy"
|
android:title="@string/list_item_copy"
|
||||||
/>
|
/>
|
||||||
|
<item android:id="@+id/list_item_reset"
|
||||||
|
android:title="@string/list_item_reset"
|
||||||
|
/>
|
||||||
<item android:id="@+id/list_item_new_from"
|
<item android:id="@+id/list_item_new_from"
|
||||||
android:title="@string/list_item_new_from"
|
android:title="@string/list_item_new_from"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
<string name="list_item_hide">Hide</string>
|
<string name="list_item_hide">Hide</string>
|
||||||
<string name="list_item_delete">Delete</string>
|
<string name="list_item_delete">Delete</string>
|
||||||
<string name="list_item_copy">Copy</string>
|
<string name="list_item_copy">Copy</string>
|
||||||
|
<string name="list_item_reset">Reset</string>
|
||||||
|
|
||||||
<string name="list_item_new_from">New from</string>
|
<string name="list_item_new_from">New from</string>
|
||||||
<string name="list_item_move_up">Move up</string>
|
<string name="list_item_move_up">Move up</string>
|
||||||
<string name="list_item_move_down">Move down</string>
|
<string name="list_item_move_down">Move down</string>
|
||||||
|
|
|
@ -108,7 +108,8 @@ public class GamesList extends ListActivity implements View.OnClickListener {
|
||||||
|
|
||||||
String path = fileList()[info.position];
|
String path = fileList()[info.position];
|
||||||
|
|
||||||
switch (item.getItemId()) {
|
int id = item.getItemId();
|
||||||
|
switch ( id ) {
|
||||||
// case R.id.list_item_open:
|
// case R.id.list_item_open:
|
||||||
// doOpen( info.position );
|
// doOpen( info.position );
|
||||||
// handled = true;
|
// handled = true;
|
||||||
|
@ -122,16 +123,21 @@ public class GamesList extends ListActivity implements View.OnClickListener {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.list_item_copy:
|
case R.id.list_item_reset:
|
||||||
stream = Utils.savedGame( this, path );
|
|
||||||
Utils.saveGame( this, stream );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case R.id.list_item_new_from:
|
case R.id.list_item_new_from:
|
||||||
stream = Utils.savedGame( this, path );
|
stream = Utils.savedGame( this, path );
|
||||||
CurGameInfo gi = new CurGameInfo( this );
|
CurGameInfo gi = new CurGameInfo( this );
|
||||||
XwJNI.gi_from_stream( gi, stream );
|
XwJNI.gi_from_stream( gi, stream );
|
||||||
stream = XwJNI.gi_to_stream( gi );
|
stream = XwJNI.gi_to_stream( gi );
|
||||||
|
if ( R.id.list_item_reset == id ) {
|
||||||
|
Utils.saveGame( this, stream, path );
|
||||||
|
} else {
|
||||||
|
Utils.saveGame( this, stream );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.list_item_copy:
|
||||||
|
stream = Utils.savedGame( this, path );
|
||||||
Utils.saveGame( this, stream );
|
Utils.saveGame( this, stream );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue