gnome-terminal r2637 - trunk/src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-terminal r2637 - trunk/src
- Date: Thu, 29 May 2008 19:40:47 +0000 (UTC)
Author: chpe
Date: Thu May 29 19:40:46 2008
New Revision: 2637
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2637&view=rev
Log:
Move the load_glade_file utility function to profile-editor.c, since the only remaining caller is there.
Modified:
trunk/src/profile-editor.c
trunk/src/terminal-profile.h
trunk/src/terminal-util.c
trunk/src/terminal-util.h
Modified: trunk/src/profile-editor.c
==============================================================================
--- trunk/src/profile-editor.c (original)
+++ trunk/src/profile-editor.c Thu May 29 19:40:46 2008
@@ -3,6 +3,7 @@
/*
* Copyright  2002 Havoc Pennington
* Copyright  2002 Mathias Hasselmann
+ * Copyright  2008 Christian Persch
*
* This file is part of gnome-terminal.
*
@@ -914,6 +915,50 @@
G_CALLBACK (update_image_preview), NULL);
}
+static GladeXML*
+load_glade_file (const char *filename,
+ const char *widget_root,
+ GtkWindow *error_dialog_parent)
+{
+ char *path;
+ GladeXML *xml;
+
+ xml = NULL;
+ path = g_strconcat ("./", filename, NULL);
+
+ if (g_file_test (path,
+ G_FILE_TEST_EXISTS))
+ {
+ /* Try current dir, for debugging */
+ xml = glade_xml_new (path,
+ widget_root,
+ GETTEXT_PACKAGE);
+ }
+
+ if (xml == NULL)
+ {
+ g_free (path);
+
+ path = g_build_filename (TERM_GLADE_DIR, filename, NULL);
+
+ xml = glade_xml_new (path,
+ widget_root,
+ GETTEXT_PACKAGE);
+ }
+
+ if (xml == NULL)
+ {
+ static GtkWidget *no_glade_dialog = NULL;
+
+ terminal_util_show_error_dialog (error_dialog_parent, &no_glade_dialog,
+ _("The file \"%s\" is missing. This indicates that the application is installed incorrectly."), path);
+ }
+
+ g_free (path);
+
+ return xml;
+}
+
void
terminal_profile_edit (TerminalProfile *profile,
GtkWindow *transient_parent)
@@ -932,9 +977,9 @@
gint i;
GtkSizeGroup *size_group;
- xml = terminal_util_load_glade_file (TERM_GLADE_FILE,
- "profile-editor-dialog",
- transient_parent);
+ xml = load_glade_file (TERM_GLADE_FILE,
+ "profile-editor-dialog",
+ transient_parent);
if (xml == NULL)
return;
Modified: trunk/src/terminal-profile.h
==============================================================================
--- trunk/src/terminal-profile.h (original)
+++ trunk/src/terminal-profile.h Thu May 29 19:40:46 2008
@@ -70,9 +70,7 @@
typedef enum
{
- /* this has to be kept in sync with the option menu in the
- * glade file
- */
+ /* this has to be kept in sync with the option menu in the profile editor UI file */
TERMINAL_TITLE_REPLACE,
TERMINAL_TITLE_BEFORE,
TERMINAL_TITLE_AFTER,
Modified: trunk/src/terminal-util.c
==============================================================================
--- trunk/src/terminal-util.c (original)
+++ trunk/src/terminal-util.c Thu May 29 19:40:46 2008
@@ -161,50 +161,6 @@
atk_object_set_name (obj, name);
}
-GladeXML*
-terminal_util_load_glade_file (const char *filename,
- const char *widget_root,
- GtkWindow *error_dialog_parent)
-{
- char *path;
- GladeXML *xml;
-
- xml = NULL;
- path = g_strconcat ("./", filename, NULL);
-
- if (g_file_test (path,
- G_FILE_TEST_EXISTS))
- {
- /* Try current dir, for debugging */
- xml = glade_xml_new (path,
- widget_root,
- GETTEXT_PACKAGE);
- }
-
- if (xml == NULL)
- {
- g_free (path);
-
- path = g_build_filename (TERM_GLADE_DIR, filename, NULL);
-
- xml = glade_xml_new (path,
- widget_root,
- GETTEXT_PACKAGE);
- }
-
- if (xml == NULL)
- {
- static GtkWidget *no_glade_dialog = NULL;
-
- terminal_util_show_error_dialog (error_dialog_parent, &no_glade_dialog,
- _("The file \"%s\" is missing. This indicates that the application is installed incorrectly."), path);
- }
-
- g_free (path);
-
- return xml;
-}
-
void
terminal_util_open_url (GtkWidget *parent,
const char *orig_url,
Modified: trunk/src/terminal-util.h
==============================================================================
--- trunk/src/terminal-util.h (original)
+++ trunk/src/terminal-util.h Thu May 29 19:40:46 2008
@@ -22,7 +22,6 @@
#include <gtk/gtk.h>
#include <gconf/gconf-client.h>
-#include <glade/glade.h>
#include "terminal-screen.h"
@@ -39,9 +38,6 @@
void terminal_util_set_atk_name_description (GtkWidget *widget,
const char *name,
const char *desc);
-GladeXML* terminal_util_load_glade_file (const char *filename,
- const char *widget_root,
- GtkWindow *error_dialog_parent);
void terminal_util_open_url (GtkWidget *parent,
const char *orig_url,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]