Commit 8b2c6a2c authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/actions/dock-actions.c app/actions/view-actions.c

2005-11-24  Michael Natterer  <mitch@gimp.org>

	* app/actions/dock-actions.c
	* app/actions/view-actions.c
	* app/actions/window-actions.c
	* app/actions/window-commands.[ch]
	* menus/dockable-menu.xml.in
	* menus/image-menu.xml.in: added "Open Display" dialog for
	debugging purposes.
parent 56c2ae40
2005-11-24 Michael Natterer <mitch@gimp.org>
* app/actions/dock-actions.c
* app/actions/view-actions.c
* app/actions/window-actions.c
* app/actions/window-commands.[ch]
* menus/dockable-menu.xml.in
* menus/image-menu.xml.in: added "Open Display" dialog for
debugging purposes.
2005-11-23 Michael Natterer <mitch@gimp.org>
* libgimpmodule/gimpmodule.c: print error messages unconditionally
......
......@@ -46,7 +46,12 @@ static GimpActionEntry dock_actions[] =
{ "dock-close", GTK_STOCK_CLOSE,
N_("Close Dock"), "<control>W", NULL,
G_CALLBACK (window_close_cmd_callback),
GIMP_HELP_DOCK_CLOSE }
GIMP_HELP_DOCK_CLOSE },
{ "dock-open-display", NULL,
N_("_Open Display..."), NULL, NULL,
G_CALLBACK (window_open_display_cmd_callback),
NULL }
};
static GimpToggleActionEntry dock_toggle_actions[] =
......
......@@ -105,7 +105,12 @@ static GimpActionEntry view_actions[] =
N_("Shrink _Wrap"), "<control>E",
N_("Shrink wrap"),
G_CALLBACK (view_shrink_wrap_cmd_callback),
GIMP_HELP_VIEW_SHRINK_WRAP }
GIMP_HELP_VIEW_SHRINK_WRAP },
{ "view-open-display", NULL,
N_("_Open Display..."), NULL, NULL,
G_CALLBACK (window_open_display_cmd_callback),
NULL }
};
static GimpToggleActionEntry view_toggle_actions[] =
......
......@@ -100,6 +100,10 @@ window_actions_update (GimpActionGroup *group,
show_menu = (gdk_display_get_n_screens (display) > 1);
#ifdef GIMP_UNSTABLE
show_menu = TRUE;
#endif
if (! show_menu)
{
GdkDisplayManager *manager = gdk_display_manager_get ();
......
......@@ -18,12 +18,17 @@
#include "config.h"
#include <string.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "widgets/gimpmessagebox.h"
#include "widgets/gimpmessagedialog.h"
#include "actions.h"
#include "window-commands.h"
......@@ -52,6 +57,74 @@ window_close_cmd_callback (GtkAction *action,
}
}
void
window_open_display_cmd_callback (GtkAction *action,
gpointer data)
{
GtkWidget *widget;
GtkWidget *dialog;
GtkWidget *entry;
return_if_no_widget (widget, data);
dialog = gimp_message_dialog_new ("Open Display", GIMP_STOCK_WILBER_EEK,
widget, GTK_DIALOG_MODAL,
NULL, NULL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
"Experimental multi-display stuff!\n"
"Click OK and have fun crashing GIMP...");
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
"Please enter the name of the new display:");
entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
gtk_container_add (GTK_CONTAINER (GIMP_MESSAGE_DIALOG (dialog)->box), entry);
gtk_widget_grab_focus (entry);
gtk_widget_show_all (dialog);
while (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
{
gchar *screen_name;
screen_name = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
if (strcmp (screen_name, ""))
{
GdkDisplay *display;
gtk_widget_set_sensitive (dialog, FALSE);
display = gdk_display_open (screen_name);
if (! display)
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
"Can't open display '%s'. "
"Please try another one:",
screen_name);
g_free (screen_name);
gtk_widget_set_sensitive (dialog, TRUE);
if (display)
break;
}
gtk_widget_grab_focus (entry);
}
gtk_widget_destroy (dialog);
}
void
window_move_to_screen_cmd_callback (GtkAction *action,
GtkAction *current,
......
......@@ -22,6 +22,8 @@
void window_close_cmd_callback (GtkAction *action,
gpointer data);
void window_open_display_cmd_callback (GtkAction *action,
gpointer data);
void window_move_to_screen_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data);
......
......@@ -34,6 +34,9 @@
<menuitem action="dock-show-image-menu" />
<menuitem action="dock-auto-follow-active" />
<separator />
<menu action="dock-move-to-screen-menu" name="Move to Screen" />
<menu action="dock-move-to-screen-menu" name="Move to Screen">
<menuitem action="dock-open-display" />
<separator />
</menu>
</popup>
</ui>
......@@ -238,7 +238,10 @@
<separator />
<menuitem action="view-shrink-wrap" />
<menuitem action="view-fullscreen" />
<menu action="view-move-to-screen-menu" name="Move to Screen" />
<menu action="view-move-to-screen-menu" name="Move to Screen">
<menuitem action="view-open-display" />
<separator />
</menu>
<separator />
<menuitem action="view-navigation-window" />
<menuitem action="view-display-filters" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment