зеркало из https://github.com/mozilla/gecko-dev.git
Bug 707711 - No way to delete bookmarks r=mfinkle
This commit is contained in:
Родитель
bd523ce797
Коммит
76ecedadb8
|
@ -72,6 +72,7 @@ import android.widget.ExpandableListView;
|
|||
import android.widget.ImageButton;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -431,6 +432,11 @@ public class AwesomeBar extends Activity implements GeckoEventListener {
|
|||
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.awesomebar_contextmenu, menu);
|
||||
|
||||
if (view != (ListView)findViewById(R.id.bookmarks_list)) {
|
||||
MenuItem removeBookmarkItem = menu.findItem(R.id.remove_bookmark);
|
||||
removeBookmarkItem.setVisible(false);
|
||||
}
|
||||
|
||||
menu.setHeaderTitle(title);
|
||||
}
|
||||
|
@ -464,6 +470,12 @@ public class AwesomeBar extends Activity implements GeckoEventListener {
|
|||
GeckoApp.mAppContext.loadUrl(url, AwesomeBar.Type.ADD);
|
||||
break;
|
||||
}
|
||||
case R.id.remove_bookmark: {
|
||||
ContentResolver resolver = Tabs.getInstance().getContentResolver();
|
||||
BrowserDB.removeBookmark(resolver, url);
|
||||
Toast.makeText(this, R.string.bookmark_removed, Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
}
|
||||
case R.id.add_to_launcher: {
|
||||
Bitmap bitmap = null;
|
||||
if (b != null)
|
||||
|
|
|
@ -76,6 +76,7 @@
|
|||
<!ENTITY save_as_pdf "Save as PDF">
|
||||
|
||||
<!ENTITY contextmenu_open_new_tab "Open in New Tab">
|
||||
<!ENTITY contextmenu_remove_bookmark "Remove">
|
||||
<!ENTITY contextmenu_add_to_launcher "Add to Home Screen">
|
||||
<!ENTITY contextmenu_share "Share">
|
||||
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
<item android:id="@+id/share"
|
||||
android:title="@string/contextmenu_share"/>
|
||||
|
||||
<item android:id="@+id/remove_bookmark"
|
||||
android:title="@string/contextmenu_remove_bookmark"/>
|
||||
|
||||
<item android:id="@+id/add_to_launcher"
|
||||
android:title="@string/contextmenu_add_to_launcher"/>
|
||||
|
||||
|
|
|
@ -84,6 +84,7 @@
|
|||
<string name="site_settings_no_settings">&site_settings_no_settings;</string>
|
||||
|
||||
<string name="contextmenu_open_new_tab">&contextmenu_open_new_tab;</string>
|
||||
<string name="contextmenu_remove_bookmark">&contextmenu_remove_bookmark;</string>
|
||||
<string name="contextmenu_add_to_launcher">&contextmenu_add_to_launcher;</string>
|
||||
<string name="contextmenu_share">&contextmenu_share;</string>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче