Bug 832559 - Remove unpin all options from menus. r=mfinkle

This commit is contained in:
Wes Johnston 2013-01-22 10:37:22 -08:00
Родитель 88e69171fe
Коммит 2c64c83b35
5 изменённых файлов: 1 добавлений и 36 удалений

Просмотреть файл

@ -192,7 +192,6 @@ public class AboutHomeContent extends ScrollView
// If nothing is pinned at all, hide both clear items
TopSitesCursorWrapper cursor = (TopSitesCursorWrapper)mTopSitesAdapter.getCursor();
if (!cursor.hasPinnedSites()) {
menu.findItem(R.id.abouthome_topsites_unpinall).setVisible(false);
menu.findItem(R.id.abouthome_topsites_unpin).setVisible(false);
} else {
PinnedSite site = cursor.getPinnedSite(info.position);
@ -944,32 +943,6 @@ public class AboutHomeContent extends ScrollView
holder.thumbnailView.setScaleType(ImageView.ScaleType.FIT_CENTER);
}
public void unpinAllSites() {
final ContentResolver resolver = mActivity.getContentResolver();
// Clear the view quickly to make things appear responsive
for (int i = 0; i < mTopSitesGrid.getChildCount(); i++) {
View v = mTopSitesGrid.getChildAt(i);
TopSitesViewHolder holder = (TopSitesViewHolder) v.getTag();
clearThumbnail(holder);
holder.setPinned(false);
}
(new GeckoAsyncTask<Void, Void, Void>(GeckoApp.mAppContext, GeckoAppShell.getHandler()) {
@Override
public Void doInBackground(Void... params) {
ContentResolver resolver = mActivity.getContentResolver();
BrowserDB.unpinAllSites(resolver);
return null;
}
@Override
public void onPostExecute(Void v) {
update(EnumSet.of(UpdateFlags.TOP_SITES));
}
}).execute();
}
public void unpinSite() {
final int position = mTopSitesGrid.getSelectedPosition();
View v = mTopSitesGrid.getChildAt(position);

Просмотреть файл

@ -1040,10 +1040,6 @@ abstract public class BrowserApp extends GeckoApp
mAboutHomeContent.unpinSite();
return true;
case R.id.abouthome_topsites_unpinall:
mAboutHomeContent.unpinAllSites();
return true;
case R.id.abouthome_topsites_pin:
mAboutHomeContent.pinSite();
return true;

Просмотреть файл

@ -203,7 +203,7 @@ size. -->
<!ENTITY abouthome_topsites_edit "Edit">
<!ENTITY abouthome_topsites_pin "Pin Site">
<!ENTITY abouthome_topsites_unpin "Unpin Site">
<!ENTITY abouthome_topsites_unpinall "Unpin All">
<!-- Localization note (abouthome_about_sync3, abouthome_about_apps2): The
chevron (ex: "»"; unicode= U+00BB) is used as an arrow to show that
clicking this text in the promotions box will perform some action. Note

Просмотреть файл

@ -14,7 +14,4 @@
<item android:id="@+id/abouthome_topsites_unpin"
android:title="@string/abouthome_topsites_unpin"/>
<item android:id="@+id/abouthome_topsites_unpinall"
android:title="@string/abouthome_topsites_unpinall"/>
</menu>

Просмотреть файл

@ -205,7 +205,6 @@
<string name="abouthome_topsites_edit">&abouthome_topsites_edit;</string>
<string name="abouthome_topsites_pin">&abouthome_topsites_pin;</string>
<string name="abouthome_topsites_unpin">&abouthome_topsites_unpin;</string>
<string name="abouthome_topsites_unpinall">&abouthome_topsites_unpinall;</string>
<string name="filepicker_title">&filepicker_title;</string>
<string name="filepicker_audio_title">&filepicker_audio_title;</string>