mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
for better discoverability, always show the studylist menus when the feature's on and supply explantions when there's nothing to show
This commit is contained in:
parent
9dc94c97b2
commit
426b5b59b2
4 changed files with 29 additions and 11 deletions
|
@ -2211,7 +2211,7 @@
|
|||
<string name="gamel_menu_study">Studylist…</string>
|
||||
|
||||
<string name="slmenu_copy_all">Copy to clipboard</string>
|
||||
<string name="slmenu_clear_all">Clear all</string>
|
||||
<string name="slmenu_clear_all">Delete</string>
|
||||
<string name="confirm_studylist_clear">Are you sure you want to
|
||||
delete this list?\n\n(This action cannot be undone.)</string>
|
||||
<string name="paste_donef">%d word[s] copied</string>
|
||||
|
@ -2219,4 +2219,9 @@
|
|||
|
||||
<string name="study_langpick">Your words for:</string>
|
||||
|
||||
<string name="study_no_langf">You have not yet saved any words
|
||||
into a studylist for %s.</string>
|
||||
<string name="study_no_lists">You have not yet saved any words
|
||||
into a studylist.</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -804,7 +804,7 @@ public class BoardActivity extends XWActivity
|
|||
Utils.setItemVisible( menu, R.id.gamel_menu_checkmoves, false );
|
||||
}
|
||||
|
||||
boolean enable = 0 < DBUtils.studyListLangs( this ).length;
|
||||
boolean enable = XWPrefs.getStudyEnabled( this );
|
||||
Utils.setItemVisible( menu, R.id.games_menu_study, enable );
|
||||
|
||||
return true;
|
||||
|
@ -871,7 +871,7 @@ public class BoardActivity extends XWActivity
|
|||
cmd = JNICmd.CMD_TOGGLE_TRAY;
|
||||
break;
|
||||
case R.id.games_menu_study:
|
||||
StudyList.launch( this, m_gi.dictLang );
|
||||
StudyList.launchOrAlert( this, m_gi.dictLang, this );
|
||||
break;
|
||||
case R.id.board_menu_undo_current:
|
||||
cmd = JNICmd.CMD_UNDO_CUR;
|
||||
|
|
|
@ -717,8 +717,7 @@ public class GamesList extends XWExpandableListActivity
|
|||
enable = nothingSelected && Utils.isGooglePlayApp( this );
|
||||
Utils.setItemVisible( menu, R.id.games_menu_rateme, enable );
|
||||
|
||||
enable = nothingSelected &&
|
||||
0 < DBUtils.studyListLangs( this ).length;
|
||||
enable = nothingSelected && XWPrefs.getStudyEnabled( this );
|
||||
Utils.setItemVisible( menu, R.id.games_menu_study, enable );
|
||||
|
||||
m_menuPrepared = super.onPrepareOptionsMenu( menu );
|
||||
|
@ -790,7 +789,7 @@ public class GamesList extends XWExpandableListActivity
|
|||
break;
|
||||
|
||||
case R.id.games_menu_study:
|
||||
StudyList.launch( this, StudyList.NO_LANG );
|
||||
StudyList.launchOrAlert( this, StudyList.NO_LANG, this );
|
||||
break;
|
||||
|
||||
case R.id.games_menu_about:
|
||||
|
|
|
@ -195,13 +195,27 @@ public class StudyList extends XWListActivity
|
|||
}
|
||||
}
|
||||
|
||||
public static void launch( Context context, int lang )
|
||||
public static void launchOrAlert( Context context, int lang,
|
||||
DlgDelegate.HasDlgDelegate dlg )
|
||||
{
|
||||
Intent intent = new Intent( context, StudyList.class );
|
||||
if ( NO_LANG != lang ) {
|
||||
intent.putExtra( START_LANG, lang );
|
||||
String msg = null;
|
||||
if ( 0 == DBUtils.studyListLangs( context ).length ) {
|
||||
msg = context.getString( R.string.study_no_lists );
|
||||
} else if ( NO_LANG != lang &&
|
||||
0 == DBUtils.studyListWords( context, lang ).length ) {
|
||||
String langname = DictLangCache.getLangName( context, lang );
|
||||
msg = context.getString( R.string.study_no_langf, langname );
|
||||
} else {
|
||||
Intent intent = new Intent( context, StudyList.class );
|
||||
if ( NO_LANG != lang ) {
|
||||
intent.putExtra( START_LANG, lang );
|
||||
}
|
||||
context.startActivity( intent );
|
||||
}
|
||||
|
||||
if ( null != msg ) {
|
||||
dlg.showOKOnlyDialog( msg );
|
||||
}
|
||||
context.startActivity( intent );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue