[gedit] Remove open location dialog
- From: Paolo Borelli <pborelli src gnome org>
- To: svn-commits-list gnome org
- Subject: [gedit] Remove open location dialog
- Date: Sun, 17 May 2009 10:25:09 -0400 (EDT)
commit 26c2dfbd90b2f973f8540b15be4da38216e3a70b
Author: Paolo Borelli <porelli gnome org>
Date: Sun May 17 16:25:54 2009 +0200
Remove open location dialog
Remove the open location dialog: it's obsolete and no one uses it,
besides these days you can open uris by the usual file chooser.
---
gedit/dialogs/Makefile.am | 5 -
gedit/dialogs/gedit-open-location-dialog.c | 259 ------------------------
gedit/dialogs/gedit-open-location-dialog.glade | 182 -----------------
gedit/dialogs/gedit-open-location-dialog.h | 97 ---------
gedit/dialogs/gedit-open-location-dialog.ui | 169 ---------------
gedit/gedit-commands-file.c | 95 +---------
gedit/gedit-ui.h | 2 -
gedit/gedit-ui.xml | 1 -
gedit/gedit-window.c | 5 -
9 files changed, 1 insertions(+), 814 deletions(-)
diff --git a/gedit/dialogs/Makefile.am b/gedit/dialogs/Makefile.am
index 9c792fa..c076257 100644
--- a/gedit/dialogs/Makefile.am
+++ b/gedit/dialogs/Makefile.am
@@ -18,19 +18,14 @@ libdialogs_la_SOURCES = \
gedit-close-confirmation-dialog.h \
gedit-encodings-dialog.c \
gedit-encodings-dialog.h \
- gedit-open-location-dialog.c \
- gedit-open-location-dialog.h \
gedit-search-dialog.h \
gedit-search-dialog.c
ui_DATA = \
gedit-encodings-dialog.ui \
- gedit-open-location-dialog.ui \
gedit-preferences-dialog.ui \
gedit-search-dialog.ui
-
EXTRA_DIST = $(ui_DATA)
-
-include $(top_srcdir)/git.mk
diff --git a/gedit/dialogs/gedit-open-location-dialog.c b/gedit/dialogs/gedit-open-location-dialog.c
deleted file mode 100644
index f0786cb..0000000
--- a/gedit/dialogs/gedit-open-location-dialog.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * gedit-open-location-dialog.c
- * This file is part of gedit
- *
- * Copyright (C) 2001-2005 Paolo Maggi
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the gedit Team, 2001-2005. See the AUTHORS file for a
- * list of people on the gedit Team.
- * See the ChangeLog files for a list of changes.
- *
- * $Id$
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib/gi18n.h>
-#include <gio/gio.h>
-#include <gtk/gtk.h>
-
-#include "gedit-open-location-dialog.h"
-#include "gedit-history-entry.h"
-#include "gedit-encodings-option-menu.h"
-#include "gedit-utils.h"
-#include "gedit-help.h"
-#include "gedit-dirs.h"
-
-#define GEDIT_OPEN_LOCATION_DIALOG_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), \
- GEDIT_TYPE_OPEN_LOCATION_DIALOG, \
- GeditOpenLocationDialogPrivate))
-
-struct _GeditOpenLocationDialogPrivate
-{
- GtkWidget *uri_entry;
- GtkWidget *uri_text_entry;
- GtkWidget *encoding_menu;
-};
-
-G_DEFINE_TYPE(GeditOpenLocationDialog, gedit_open_location_dialog, GTK_TYPE_DIALOG)
-
-static void
-gedit_open_location_dialog_class_init (GeditOpenLocationDialogClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- g_type_class_add_private (object_class, sizeof (GeditOpenLocationDialogPrivate));
-}
-
-static void
-entry_changed (GtkComboBox *combo,
- GeditOpenLocationDialog *dlg)
-{
- const gchar *str;
-
- str = gtk_entry_get_text (GTK_ENTRY (dlg->priv->uri_text_entry));
- g_return_if_fail (str != NULL);
-
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dlg),
- GTK_RESPONSE_OK,
- (str[0] != '\0'));
-}
-
-static void
-response_handler (GeditOpenLocationDialog *dlg,
- gint response_id,
- gpointer data)
-{
- const gchar *text;
-
- switch (response_id)
- {
- case GTK_RESPONSE_HELP:
- gedit_help_display (GTK_WINDOW (dlg),
- NULL,
- NULL);
-
- g_signal_stop_emission_by_name (dlg, "response");
- break;
-
- case GTK_RESPONSE_OK:
- text = gtk_entry_get_text
- (GTK_ENTRY (dlg->priv->uri_text_entry));
- if (*text != '\0')
- {
- gedit_history_entry_prepend_text
- (GEDIT_HISTORY_ENTRY (dlg->priv->uri_entry),
- text);
- }
- break;
- }
-}
-
-static void
-gedit_open_location_dialog_init (GeditOpenLocationDialog *dlg)
-{
- GtkWidget *content;
- GtkWidget *vbox;
- GtkWidget *location_label;
- GtkWidget *encoding_label;
- GtkWidget *encoding_hbox;
- GtkWidget *error_widget;
- gboolean ret;
- gchar *file;
- gchar *root_objects[] = {
- "open_uri_dialog_content",
- NULL
- };
-
- dlg->priv = GEDIT_OPEN_LOCATION_DIALOG_GET_PRIVATE (dlg);
-
- gtk_dialog_add_buttons (GTK_DIALOG (dlg),
- GTK_STOCK_CANCEL,
- GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN,
- GTK_RESPONSE_OK,
- GTK_STOCK_HELP,
- GTK_RESPONSE_HELP,
- NULL);
-
- gtk_window_set_title (GTK_WINDOW (dlg), _("Open Location"));
- gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
- gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE);
- gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), TRUE);
-
- /* HIG defaults */
- gtk_container_set_border_width (GTK_CONTAINER (dlg), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dlg)->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dlg)->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dlg)->action_area), 6);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dlg),
- GTK_RESPONSE_OK);
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dlg),
- GTK_RESPONSE_OK, FALSE);
-
- g_signal_connect (G_OBJECT (dlg),
- "response",
- G_CALLBACK (response_handler),
- NULL);
-
- file = gedit_dirs_get_ui_file ("gedit-open-location-dialog.ui");
- ret = gedit_utils_get_ui_objects (file,
- root_objects,
- &error_widget,
- "open_uri_dialog_content", &content,
- "main_vbox", &vbox,
- "location_label", &location_label,
- "encoding_label", &encoding_label,
- "encoding_hbox", &encoding_hbox,
- NULL);
- g_free (file);
-
- if (!ret)
- {
- gtk_widget_show (error_widget);
-
- gtk_box_pack_start_defaults (GTK_BOX (GTK_DIALOG (dlg)->vbox),
- error_widget);
- gtk_container_set_border_width (GTK_CONTAINER (error_widget), 5);
-
- return;
- }
-
- dlg->priv->uri_entry = gedit_history_entry_new ("gedit2_uri_list", FALSE);
- dlg->priv->uri_text_entry = gedit_history_entry_get_entry (GEDIT_HISTORY_ENTRY (dlg->priv->uri_entry));
- gtk_entry_set_activates_default (GTK_ENTRY (dlg->priv->uri_text_entry), TRUE);
- gtk_widget_show (dlg->priv->uri_entry);
- gtk_box_pack_start (GTK_BOX (vbox),
- dlg->priv->uri_entry,
- FALSE,
- FALSE,
- 0);
-
- gtk_label_set_mnemonic_widget (GTK_LABEL (location_label),
- dlg->priv->uri_entry);
-
- dlg->priv->encoding_menu = gedit_encodings_option_menu_new (FALSE);
-
- gtk_label_set_mnemonic_widget (GTK_LABEL (encoding_label),
- dlg->priv->encoding_menu);
-
- gtk_box_pack_end (GTK_BOX (encoding_hbox),
- dlg->priv->encoding_menu,
- TRUE,
- TRUE,
- 0);
-
- gtk_widget_show (dlg->priv->encoding_menu);
-
- g_signal_connect (dlg->priv->uri_entry,
- "changed",
- G_CALLBACK (entry_changed),
- dlg);
-
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox),
- content, FALSE, FALSE, 0);
- g_object_unref (content);
- gtk_container_set_border_width (GTK_CONTAINER (content), 5);
-}
-
-GtkWidget *
-gedit_open_location_dialog_new (GtkWindow *parent)
-{
- GtkWidget *dlg;
-
- dlg = GTK_WIDGET (g_object_new (GEDIT_TYPE_OPEN_LOCATION_DIALOG, NULL));
-
- if (parent != NULL)
- gtk_window_set_transient_for (GTK_WINDOW (dlg),
- parent);
-
- return dlg;
-}
-
-GFile *
-gedit_open_location_dialog_get_location (GeditOpenLocationDialog *dlg)
-{
- const gchar *str;
- GFile *location;
-
- g_return_val_if_fail (GEDIT_IS_OPEN_LOCATION_DIALOG (dlg), NULL);
-
- str = gtk_entry_get_text (GTK_ENTRY (dlg->priv->uri_text_entry));
- g_return_val_if_fail (str != NULL, NULL);
-
- if (str[0] == '\0')
- return NULL;
-
- location = g_file_new_for_commandline_arg (str);
-
- return location;
-}
-
-const GeditEncoding *
-gedit_open_location_dialog_get_encoding (GeditOpenLocationDialog *dlg)
-{
- g_return_val_if_fail (GEDIT_IS_OPEN_LOCATION_DIALOG (dlg), NULL);
-
- return gedit_encodings_option_menu_get_selected_encoding (
- GEDIT_ENCODINGS_OPTION_MENU (dlg->priv->encoding_menu));
-}
diff --git a/gedit/dialogs/gedit-open-location-dialog.glade b/gedit/dialogs/gedit-open-location-dialog.glade
deleted file mode 100644
index 1344533..0000000
--- a/gedit/dialogs/gedit-open-location-dialog.glade
+++ /dev/null
@@ -1,182 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="open_uri_dialog">
- <property name="title" translatable="yes">Open Location</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">False</property>
- <property name="destroy_with_parent">True</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="cancel_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="open_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-open</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="help_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-help</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-11</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="open_uri_dialog_content">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkVBox" id="main_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="location_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Enter the _location (URI) of the file you would like to open:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="encoding_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="encoding_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Ch_aracter coding:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/gedit/dialogs/gedit-open-location-dialog.h b/gedit/dialogs/gedit-open-location-dialog.h
deleted file mode 100644
index 689a2bb..0000000
--- a/gedit/dialogs/gedit-open-location-dialog.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * gedit-open-location-dialog.h
- * This file is part of gedit
- *
- * Copyright (C) 2001-2005 Paolo Maggi
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the gedit Team, 2001-2005. See the AUTHORS file for a
- * list of people on the gedit Team.
- * See the ChangeLog files for a list of changes.
- *
- * $Id$
- */
-
-#ifndef __GEDIT_OPEN_LOCATION_DIALOG_H__
-#define __GEDIT_OPEN_LOCATION_DIALOG_H__
-
-#include <gio/gio.h>
-#include <gtk/gtk.h>
-#include <gedit/gedit-encodings.h>
-
-G_BEGIN_DECLS
-
-/*
- * Type checking and casting macros
- */
-#define GEDIT_TYPE_OPEN_LOCATION_DIALOG (gedit_open_location_dialog_get_type())
-#define GEDIT_OPEN_LOCATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_OPEN_LOCATION_DIALOG, GeditOpenLocationDialog))
-#define GEDIT_OPEN_LOCATION_DIALOG_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GEDIT_TYPE_OPEN_LOCATION_DIALOG, GeditOpenLocationDialog const))
-#define GEDIT_OPEN_LOCATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GEDIT_TYPE_OPEN_LOCATION_DIALOG, GeditOpenLocationDialogClass))
-#define GEDIT_IS_OPEN_LOCATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GEDIT_TYPE_OPEN_LOCATION_DIALOG))
-#define GEDIT_IS_OPEN_LOCATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_OPEN_LOCATION_DIALOG))
-#define GEDIT_OPEN_LOCATION_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GEDIT_TYPE_OPEN_LOCATION_DIALOG, GeditOpenLocationDialogClass))
-
-/* Private structure type */
-typedef struct _GeditOpenLocationDialogPrivate GeditOpenLocationDialogPrivate;
-
-/*
- * Main object structure
- */
-typedef struct _GeditOpenLocationDialog GeditOpenLocationDialog;
-
-struct _GeditOpenLocationDialog
-{
- GtkDialog dialog;
-
- /*< private > */
- GeditOpenLocationDialogPrivate *priv;
-};
-
-/*
- * Class definition
- */
-typedef struct _GeditOpenLocationDialogClass GeditOpenLocationDialogClass;
-
-struct _GeditOpenLocationDialogClass
-{
- GtkDialogClass parent_class;
-};
-
-/*
- * Public methods
- */
-GType gedit_open_location_dialog_get_type (void) G_GNUC_CONST;
-
-GtkWidget *gedit_open_location_dialog_new (GtkWindow *parent);
-
-GFile *gedit_open_location_dialog_get_location (GeditOpenLocationDialog *dlg);
-
-const GeditEncoding *gedit_open_location_dialog_get_encoding (GeditOpenLocationDialog *dlg);
-
-/*
- * The widget automatically runs the help viewer when the Help button is pressed,
- * so there is no need to catch the GTK_RESPONSE_HELP response.
- *
- * GTK_RESPONSE_OK response is emitted when the "Open" button is pressed.
- */
-
-G_END_DECLS
-
-#endif /* __GEDIT_OPEN_LOCATION_DIALOG_H__ */
diff --git a/gedit/dialogs/gedit-open-location-dialog.ui b/gedit/dialogs/gedit-open-location-dialog.ui
deleted file mode 100644
index 11efa60..0000000
--- a/gedit/dialogs/gedit-open-location-dialog.ui
+++ /dev/null
@@ -1,169 +0,0 @@
-<?xml version="1.0"?>
-<!--*- mode: xml -*-->
-<interface>
- <object class="GtkDialog" id="open_uri_dialog">
- <property name="title" translatable="yes">Open Location</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">False</property>
- <property name="destroy_with_parent">True</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
- <child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <child>
- <object class="GtkButton" id="cancel_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="open_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-open</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="help_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-help</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="open_uri_dialog_content">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkVBox" id="main_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="location_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Enter the _location (URI) of the file you would like to open:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="encoding_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="encoding_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Ch_aracter coding:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="-6">cancel_button</action-widget>
- <action-widget response="-5">open_button</action-widget>
- <action-widget response="-11">help_button</action-widget>
- </action-widgets>
- </object>
-</interface>
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index 55c3160..647858a 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -46,14 +46,12 @@
#include "gedit-statusbar.h"
#include "gedit-debug.h"
#include "gedit-utils.h"
-#include "dialogs/gedit-close-confirmation-dialog.h"
-#include "dialogs/gedit-open-location-dialog.h"
#include "gedit-file-chooser-dialog.h"
+#include "dialogs/gedit-close-confirmation-dialog.h"
/* Defined constants */
#define GEDIT_OPEN_DIALOG_KEY "gedit-open-dialog-key"
-#define GEDIT_OPEN_LOCATION_DIALOG_KEY "gedit-open-location-dialog-key"
#define GEDIT_TAB_TO_SAVE_AS "gedit-tab-to-save-as"
#define GEDIT_LIST_OF_TABS_TO_SAVE_AS "gedit-list-of-tabs-to-save-as"
#define GEDIT_IS_CLOSING_ALL "gedit-is-closing-all"
@@ -498,97 +496,6 @@ _gedit_cmd_file_open (GtkAction *action,
gtk_widget_show (open_dialog);
}
-static void
-open_location_dialog_destroyed (GeditWindow *window,
- gpointer data)
-{
- gedit_debug (DEBUG_COMMANDS);
-
- g_object_set_data (G_OBJECT (window),
- GEDIT_OPEN_LOCATION_DIALOG_KEY,
- NULL);
-}
-
-static void
-open_location_dialog_response_cb (GeditOpenLocationDialog *dlg,
- gint response_id,
- GeditWindow *window)
-{
- GFile *location;
- const GeditEncoding *encoding;
- GSList *uris = NULL;
-
- gedit_debug (DEBUG_COMMANDS);
-
- if (response_id != GTK_RESPONSE_OK)
- {
- gtk_widget_destroy (GTK_WIDGET (dlg));
-
- return;
- }
-
- location = gedit_open_location_dialog_get_location (dlg);
- encoding = gedit_open_location_dialog_get_encoding (dlg);
-
- if (location != NULL)
- {
- uris = g_slist_prepend (uris, g_file_get_uri (location));
-
- g_object_unref (location);
- }
-
- gtk_widget_destroy (GTK_WIDGET (dlg));
-
- if (uris != NULL)
- {
- gedit_commands_load_uris (window,
- uris,
- encoding,
- 0);
-
- g_slist_foreach (uris, (GFunc) g_free, NULL);
- g_slist_free (uris);
- }
-}
-
-void
-_gedit_cmd_file_open_uri (GtkAction *action,
- GeditWindow *window)
-{
- GtkWidget *dlg;
- gpointer data;
-
- gedit_debug (DEBUG_COMMANDS);
-
- data = g_object_get_data (G_OBJECT (window), GEDIT_OPEN_LOCATION_DIALOG_KEY);
-
- if (data != NULL)
- {
- g_return_if_fail (GEDIT_IS_OPEN_LOCATION_DIALOG (data));
-
- gtk_window_present (GTK_WINDOW (data));
-
- return;
- }
-
- dlg = gedit_open_location_dialog_new (GTK_WINDOW (window));
-
- g_object_set_data (G_OBJECT (window),
- GEDIT_OPEN_LOCATION_DIALOG_KEY,
- dlg);
-
- g_object_weak_ref (G_OBJECT (dlg),
- (GWeakNotify) open_location_dialog_destroyed,
- window);
-
- g_signal_connect (dlg,
- "response",
- G_CALLBACK (open_location_dialog_response_cb),
- window);
-
- gtk_widget_show (dlg);
-}
-
/* File saving */
static void file_save_as (GeditTab *tab, GeditWindow *window);
diff --git a/gedit/gedit-ui.h b/gedit/gedit-ui.h
index d215525..5a6f77e 100644
--- a/gedit/gedit-ui.h
+++ b/gedit/gedit-ui.h
@@ -57,8 +57,6 @@ static const GtkActionEntry gedit_always_sensitive_menu_entries[] =
N_("Create a new document"), G_CALLBACK (_gedit_cmd_file_new) },
{ "FileOpen", GTK_STOCK_OPEN, N_("_Open..."), "<control>O",
N_("Open a file"), G_CALLBACK (_gedit_cmd_file_open) },
- { "FileOpenURI", NULL, N_("Open _Location..."), "<control>L",
- N_("Open a file from a specified location"), G_CALLBACK (_gedit_cmd_file_open_uri) },
/* Edit menu */
{ "EditPreferences", GTK_STOCK_PREFERENCES, N_("Pr_eferences"), NULL,
diff --git a/gedit/gedit-ui.xml b/gedit/gedit-ui.xml
index df8f945..9d28db9 100644
--- a/gedit/gedit-ui.xml
+++ b/gedit/gedit-ui.xml
@@ -33,7 +33,6 @@
<menuitem name="FileNewMenu" action="FileNew"/>
<placeholder name="FileOps_1"/>
<menuitem name="FileOpenMenu" action="FileOpen"/>
- <menuitem name="FileOpenURIMenu" action="FileOpenURI"/>
<placeholder name="FileOps_2"/>
<separator/>
<menuitem name="FileSaveMenu" action="FileSave"/>
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 7351976..b23449c 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -2458,11 +2458,6 @@ set_sensitivity_according_to_window_state (GeditWindow *window)
gtk_action_set_sensitive (action,
!(window->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION));
- action = gtk_action_group_get_action (window->priv->always_sensitive_action_group,
- "FileOpenURI");
- gtk_action_set_sensitive (action,
- !(window->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION));
-
gtk_action_group_set_sensitive (window->priv->recents_action_group,
!(window->priv->state & GEDIT_WINDOW_STATE_SAVING_SESSION));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]