[gcalctool/gcalctool-newui2] ...
- From: Robert Ancell <rancell src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gcalctool/gcalctool-newui2] ...
- Date: Fri, 11 Sep 2009 02:22:07 +0000 (UTC)
commit 7b0b6df4d6a2affc621d1a03db99a9810b41a43d
Author: Robert Ancell <robert ancell gmail com>
Date: Fri Sep 11 12:21:55 2009 +1000
...
configure.in | 14 +++++-------
src/gtk.c | 59 +---------------------------------------------------------
2 files changed, 7 insertions(+), 66 deletions(-)
---
diff --git a/configure.in b/configure.in
index b37f9c2..106e382 100644
--- a/configure.in
+++ b/configure.in
@@ -18,14 +18,12 @@ dnl ###########################################################################
dnl Dependencies
dnl ###########################################################################
+GTK_REQUIRED=2.17.5
+GCONF_REQUIRED=1.1.9
+
PKG_CHECK_MODULES(PACKAGE, [
- gtk+-2.0 >= 2.17.5
- gobject-2.0
- gdk-x11-2.0
- glib-2.0
- gconf-2.0 >= 1.1.9
- atk >= 1.5
- gdk-pixbuf-2.0
+ gtk+-2.0 >= $GTK_REQUIRED
+ gconf-2.0 >= $GCONF_REQUIRED
gmodule-export-2.0
])
@@ -49,7 +47,7 @@ if [[ "$HAVE_YACC" = "no" ]]; then
fi
dnl ###########################################################################
-dnl scrollkeeper checks
+dnl Scrollkeeper checks
dnl ###########################################################################
AC_PATH_PROG(SCROLLKEEPER_CONFIG, scrollkeeper-config,no)
diff --git a/src/gtk.c b/src/gtk.c
index 506500e..120bb16 100644
--- a/src/gtk.c
+++ b/src/gtk.c
@@ -27,7 +27,6 @@
#include <assert.h>
#include <gtk/gtk.h>
-#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
#include <limits.h>
@@ -110,20 +109,6 @@ static char *titles[] = {
N_("Calculator - Programming")
};
-/* Window titles dependant on mode and hostname */
-static char *hostname_titles[] = {
- /* Translators: The window title when in basic mode. %s is replaced with the hostname. */
- N_("Calculator [%s]"),
- /* Translators: The window title when in advanced mode. %s is replaced with the hostname. */
- N_("Calculator [%s] - Advanced"),
- /* Translators: The window title when in financial mode. %s is replaced with the hostname. */
- N_("Calculator [%s] - Financial"),
- /* Translators: The window title when in scientific mode. %s is replaced with the hostname. */
- N_("Calculator [%s] - Scientific"),
- /* Translators: The window title when in programming mode. %s is replaced with the hostname. */
- N_("Calculator [%s] - Programming")
-};
-
/* The names of each field in the dialogs for the financial functions */
static char *finc_dialog_fields[][5] = {
{"ctrm_pint", "ctrm_fv", "ctrm_pv", NULL, NULL},
@@ -337,40 +322,6 @@ ui_set_undo_enabled(gboolean undo, gboolean redo)
}
-static char *
-make_hostname()
-{
- Display *dpy = GDK_DISPLAY();
- char client_hostname[MAXLINE] = "";
- char hostname[MAXHOSTNAMELEN];
- char *display = DisplayString(dpy);
- char *scanner = display;
-
- gethostname(hostname, MAXHOSTNAMELEN);
-
- while (*scanner)
- scanner++;
-
- while (*scanner != ':')
- scanner--;
-
- *scanner = '\0';
-
- if (strcmp(display, hostname) &&
- strcmp(display, "localhost") &&
- strcmp(display, "unix") &&
- strcmp(display, ""))
- SNPRINTF(client_hostname, MAXLINE, " [%s] ", hostname);
-
- *scanner = ':';
-
- if (client_hostname[0] == '\0')
- return NULL;
- else
- return strdup(client_hostname);
-}
-
-
gchar *
ui_get_display(void)
{
@@ -438,7 +389,6 @@ do_finc(char* dialog)
void
ui_set_mode(ModeType mode)
{
- char *hostname, title[MAXLINE];
GtkWidget *menu;
X.mode = mode;
@@ -453,14 +403,7 @@ ui_set_mode(ModeType mode)
g_object_set(G_OBJECT(X.prog_panel), "visible", mode == PROGRAMMING, NULL);
g_object_set(G_OBJECT(X.bit_panel), "visible", mode == PROGRAMMING, NULL);
- /* Set the title */
- if((hostname = make_hostname())) {
- SNPRINTF(title, MAXLINE, gettext(hostname_titles[mode]), hostname);
- g_free(hostname);
- } else {
- SNPRINTF(title, MAXLINE, "%s", gettext(titles[mode]));
- }
- gtk_window_set_title(GTK_WINDOW(X.main_window), title);
+ gtk_window_set_title(GTK_WINDOW(X.main_window), gettext(titles[mode]));
/* Update the menu */
switch (mode) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]