aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--data/ui/epiphany-ui.xml68
-rw-r--r--src/ephy-window.c36
3 files changed, 66 insertions, 48 deletions
diff --git a/ChangeLog b/ChangeLog
index c0c09e96d..6f1f64997 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-10-09 Jean-François Rameau <jframeau@cvs.gnome.org>
+
+ * data/ui/epiphany-ui.xml:
+ * src/ephy-window.c: (show_embed_popup),
+ (update_image_actions_visibility):
+
+ Eliminate the *Popup/*ImagePopup popup variants.
+ Add image context to all popups it can show up.
+ Display image context dynamically.
+
2005-10-09 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-shell.c:
diff --git a/data/ui/epiphany-ui.xml b/data/ui/epiphany-ui.xml
index 7eb2693d8..b7c3b4a1a 100644
--- a/data/ui/epiphany-ui.xml
+++ b/data/ui/epiphany-ui.xml
@@ -102,6 +102,11 @@
<menuitem name="EditCutIP" action="EditCut"/>
<menuitem name="EditCopyIP" action="EditCopy"/>
<menuitem name="EditPasteIP" action="EditPaste"/>
+ <separator />
+ <menuitem name="OpenImageIP" action="OpenImage"/>
+ <menuitem name="SaveImageAsIP" action="SaveImageAs"/>
+ <menuitem name="SetImageAsBackgroundIP" action="SetImageAsBackground"/>
+ <menuitem name="CopyImageLocationIP" action="CopyImageLocation"/>
</popup>
<popup name="EphyDocumentPopup" action="PopupAction">
@@ -113,6 +118,11 @@
<separator name="DPSep2"/>
<menuitem name="SavePageAsDP" action="FileSaveAs"/>
<menuitem name="BookmarkPageDP" action="ContextBookmarkPage"/>
+ <separator />
+ <menuitem name="OpenImageDP" action="OpenImage"/>
+ <menuitem name="SaveImageAsDP" action="SaveImageAs"/>
+ <menuitem name="SetImageAsBackgroundDP" action="SetImageAsBackground"/>
+ <menuitem name="CopyImageLocationDP" action="CopyImageLocation"/>
</popup>
<popup name="EphyFullscreenDocumentPopup" action="PopupAction">
@@ -126,6 +136,11 @@
<menuitem name="BookmarkPageFSDP" action="ContextBookmarkPage"/>
<separator />
<menuitem name="ViewToolbarFSDP" action="ViewToolbar"/>
+ <separator />
+ <menuitem name="OpenImageFSDP" action="OpenImage"/>
+ <menuitem name="SaveImageAsFSDP" action="SaveImageAs"/>
+ <menuitem name="SetImageAsBackgroundFSDP" action="SetImageAsBackground"/>
+ <menuitem name="CopyImageLocationFSDP" action="CopyImageLocation"/>
</popup>
<popup name="EphyFramedDocumentPopup" action="PopupAction">
@@ -139,6 +154,11 @@
<menuitem name="BookmarkPageFDP" action="ContextBookmarkPage"/>
<separator />
<menuitem name="OpenFrameFDP" action="OpenFrame"/>
+ <separator />
+ <menuitem name="OpenImageFDP" action="OpenImage"/>
+ <menuitem name="SaveImageAsFDP" action="SaveImageAs"/>
+ <menuitem name="SetImageAsBackgroundFDP" action="SetImageAsBackground"/>
+ <menuitem name="CopyImageLocationFDP" action="CopyImageLocation"/>
</popup>
<popup name="EphyFullscreenFramedDocumentPopup" action="PopupAction">
@@ -154,6 +174,11 @@
<menuitem name="OpenFrameFSFDP" action="OpenFrame"/>
<separator />
<menuitem name="ViewToolbarFSFDP" action="ViewToolbar"/>
+ <separator />
+ <menuitem name="OpenImageFSFDP" action="OpenImage"/>
+ <menuitem name="SaveImageAsFSFDP" action="SaveImageAs"/>
+ <menuitem name="SetImageAsBackgroundFSFDP" action="SetImageAsBackground"/>
+ <menuitem name="CopyImageLocationFSFDP" action="CopyImageLocation"/>
</popup>
<popup name="EphyLinkPopup" action="PopupAction">
@@ -167,29 +192,11 @@
<menuitem name="DownloadLinkAsLP" action="DownloadLinkAs"/>
<menuitem name="BookmarkLinkLP" action="BookmarkLink"/>
<menuitem name="CopyLinkAddressLP" action="CopyLinkAddress"/>
-</popup>
-
-<popup name="EphyImagePopup" action="PopupAction">
- <menuitem name="OpenImageIP" action="OpenImage"/>
- <menuitem name="SaveImageAsIP" action="SaveImageAs"/>
- <menuitem name="SetImageAsBackgroundIP" action="SetImageAsBackground"/>
- <menuitem name="CopyImageLocationIP" action="CopyImageLocation"/>
-</popup>
-
-<popup name="EphyImageLinkPopup" action="PopupAction">
- <menuitem name="OpenLinkILP" action="OpenLink"/>
- <menuitem name="OpenLinkInNewWindowILP" action="OpenLinkInNewWindow"/>
- <menuitem name="OpenLinkInNewTabILP" action="OpenLinkInNewTab"/>
- <separator name="ILPSep1"/>
- <menuitem name="DownloadLinkILP" action="DownloadLink"/>
- <menuitem name="DownloadLinkAsILP" action="DownloadLinkAs"/>
- <menuitem name="BookmarkLinkILP" action="BookmarkLink"/>
- <menuitem name="CopyLinkAddressILP" action="CopyLinkAddress"/>
- <separator name="ILPSep2"/>
- <menuitem name="OpenImageILP" action="OpenImage"/>
- <menuitem name="SaveImageAsILP" action="SaveImageAs"/>
- <menuitem name="SetImageAsBackgroundILP" action="SetImageAsBackground"/>
- <menuitem name="CopyImageLocationILP" action="CopyImageLocation"/>
+ <separator />
+ <menuitem name="OpenImageLP" action="OpenImage"/>
+ <menuitem name="SaveImageAsLP" action="SaveImageAs"/>
+ <menuitem name="SetImageAsBackgroundLP" action="SetImageAsBackground"/>
+ <menuitem name="CopyImageLocationLP" action="CopyImageLocation"/>
</popup>
<popup name="EphyEmailLinkPopup" action="PopupAction">
@@ -197,16 +204,11 @@
<menuitem name="CopyEmailAddressItem" action="CopyEmailAddress"/>
<separator name="ELPSep0"/>
<menuitem name="EditCopyELP" action="EditCopy"/>
-</popup>
-
-<popup name="EphyImageEmailLinkPopup" action="PopupAction">
- <menuitem name="SendEmailItem" action="SendEmail"/>
- <menuitem name="CopyEmailAddressItem" action="CopyEmailAddress"/>
- <separator name="IELPSep1"/>
- <menuitem name="OpenImageIELP" action="OpenImage"/>
- <menuitem name="SaveImageAsIELP" action="SaveImageAs"/>
- <menuitem name="SetImageAsBackgroundIELP" action="SetImageAsBackground"/>
- <menuitem name="CopyImageLocationIELP" action="CopyImageLocation"/>
+ <separator />
+ <menuitem name="OpenImageELP" action="OpenImage"/>
+ <menuitem name="SaveImageAsELP" action="SaveImageAs"/>
+ <menuitem name="SetImageAsBackgroundELP" action="SetImageAsBackground"/>
+ <menuitem name="CopyImageLocationELP" action="CopyImageLocation"/>
</popup>
<popup name="EphyNotebookPopup" action="NotebookPopupAction">
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 3dfdb4c39..c1d2fa02e 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -853,6 +853,24 @@ ephy_window_delete_event (GtkWidget *widget,
}
static void
+update_image_actions_visibility (EphyWindow *window, gboolean show)
+{
+ GtkAction *action;
+ GtkActionGroup *action_group;
+
+ action_group = window->priv->popups_action_group;
+
+ action = gtk_action_group_get_action (action_group, "OpenImage");
+ gtk_action_set_visible (action, show);
+ action = gtk_action_group_get_action (action_group, "SaveImageAs");
+ gtk_action_set_visible (action, show);
+ action = gtk_action_group_get_action (action_group, "SetImageAsBackground");
+ gtk_action_set_visible (action, show);
+ action = gtk_action_group_get_action (action_group, "CopyImageLocation");
+ gtk_action_set_visible (action, show);
+}
+
+static void
update_edit_actions_sensitivity (EphyWindow *window, gboolean hide)
{
GtkWidget *widget = gtk_window_get_focus (GTK_WINDOW (window));
@@ -1775,30 +1793,16 @@ show_embed_popup (EphyWindow *window,
LOG ("show_embed_popup context %x", context);
- if ((context & EPHY_EMBED_CONTEXT_EMAIL_LINK) &&
- (context & EPHY_EMBED_CONTEXT_IMAGE))
- {
- popup = "/EphyImageEmailLinkPopup";
- }
- else if (context & EPHY_EMBED_CONTEXT_EMAIL_LINK)
+ if (context & EPHY_EMBED_CONTEXT_EMAIL_LINK)
{
popup = "/EphyEmailLinkPopup";
update_edit_actions_sensitivity (window, TRUE);
}
- else if ((context & EPHY_EMBED_CONTEXT_LINK) &&
- (context & EPHY_EMBED_CONTEXT_IMAGE))
- {
- popup = "/EphyImageLinkPopup";
- }
else if (context & EPHY_EMBED_CONTEXT_LINK)
{
popup = "/EphyLinkPopup";
update_edit_actions_sensitivity (window, TRUE);
}
- else if (context & EPHY_EMBED_CONTEXT_IMAGE)
- {
- popup = "/EphyImagePopup";
- }
else if (context & EPHY_EMBED_CONTEXT_INPUT)
{
popup = "/EphyInputPopup";
@@ -1830,6 +1834,8 @@ show_embed_popup (EphyWindow *window,
action = gtk_action_group_get_action (action_group, "OpenLinkInNewTab");
ephy_action_change_sensitivity_flags (action, SENS_FLAG_CONTEXT, !can_open_in_new);
+ update_image_actions_visibility (window, context & EPHY_EMBED_CONTEXT_IMAGE);
+
_ephy_window_set_context_event (window, event);
g_signal_connect (widget, "deactivate",