Bug 823559 - Remove unpinall from topsites menus. r=mfinkle a=nonlibxul

This commit is contained in:
Wes Johnston 2013-01-22 09:34:19 -08:00
parent e54de96374
commit 6c5e39e688
5 changed files with 1 additions and 36 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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>

View File

@ -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>