[telegnome] Clean up most uses of deprecated GNOME APIs. There are still a few
- From: Colin Watson <cjwatson src gnome org>
- To: svn-commits-list gnome org
- Subject: [telegnome] Clean up most uses of deprecated GNOME APIs. There are still a few
- Date: Tue, 28 Apr 2009 15:55:59 -0400 (EDT)
commit 34f57abc2ef0e72ded19c3b7d65da29f8ce8be67
Author: Colin Watson <cjwatson debian org>
Date: Tue Apr 28 20:55:39 2009 +0100
Clean up most uses of deprecated GNOME APIs. There are still a few
difficult ones left.
* src/channel.c: Include <glib.h> and <libgnome/libgnome.h> rather
than <gnome.h>.
* src/channel.h: Include <glib.h> rather than <gnome.h>.
* src/gui.c: Include <gdk/gdkkeysyms.h>, <gtk/gtk.h>,
<libgnome/libgnome.h>, and <libgnomeui/libgnomeui.h> rather than
<gnome.h>.
* src/gui.h: Include <gtk/gtk.h> and <libgnomeui/libgnomeui.h>
rather than <gnome.h>.
* src/http.c: Remove unnecessary <gnome.h> inclusion.
* src/main.c: Include <gtk/gtk.h>, <libgnome/libgnome.h>, and
<libgnomeui/libgnomeui.h> rather than <gnome.h>. Remove unnecessary
<glib.h> inclusion.
* src/pixpack.h: Include <gtk/gtk.h> rather than <gtk/gtkwidget.h>.
Remove unnecessary <gdk/gdk.h> inclusion.
* src/prefs.c: Include <gtk/gtk.h>, <libgnome/libgnome.h>,
<libgnomeui/libgnomeui.h>, and "main.h".
* src/prefs.h: Include <gtk/gtk.h> rather than <gnome.h>.
* src/view.c: Include <libgnome/libgnome.h>.
* src/view.h: Include <gtk/gtk.h> rather than <gnome.h> and
<libgnomecanvas/gnome-canvas.h>.
* src/channel.c (channel_new_from_config, channel_save_to_config):
Use g_string_printf rather than g_string_sprintf.
* src/gui.c (new_gui, new_toolbar, create_channel_menu, new_entry):
Convert from GTK+ signals to GLib signals.
* src/prefs.c (fill_channel_list): Use GDestroyNotify rather than
GtkDestroyNotify.
* src/gui.c (gui_restore_session, cb_toggle_paging, gui_pager_timer,
refresh_timer): Convert from GtkProgress to GtkProgressBar.
* src/gui.h (struct _Gui): Adjust type of progress element.
* src/gui.c (create_channel_menu): Use gtk_menu_shell_append rather
than gtk_menu_append.
(refresh_channel_menu): Use gtk_menu_shell_insert rather than
gtk_menu_bar_insert.
* src/pixpack.c (pixpack_get_type, pixpack_class_init): Convert from
GtkType to GType.
* src/pixpack.h (PIXPACK, PIXPACK_CLASS, IS_PIXPACK,
IS_PIXPACK_CLASS): Likewise.
(pixpack_get_type): Update prototype.
* src/prefs.c (set_tooltip): Remove (gtk_widget_set_tooltip_text is
sufficient now).
(construct_misc_page): Convert from GtkTooltips to GtkTooltip.
* src/prefs.h (set_tooltip): Remove prototype.
* src/prefs.c: Use gtk_entry_new/gtk_entry_set_max_length rather
than gtk_entry_new_with_max_length.
* src/prefs.h (TELEGNOME_CANVAS_WIDTH, TELEGNOME_CANVAS_HEIGHT):
Remove.
---
ChangeLog | 60 +++++++++++++++++++++++++++++++++++++++++++++++
src/channel.c | 8 ++++--
src/channel.h | 2 +-
src/gui.c | 72 ++++++++++++++++++++++++++++----------------------------
src/gui.h | 5 ++-
src/http.c | 1 -
src/main.c | 6 +++-
src/pixpack.c | 25 +++++++++++--------
src/pixpack.h | 23 ++++-------------
src/prefs.c | 20 +++++++--------
src/prefs.h | 5 +---
src/view.c | 2 +
src/view.h | 3 +-
13 files changed, 142 insertions(+), 90 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d77c964..beabf98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,65 @@
2009-04-28 Colin Watson <cjwatson debian org>
+ Clean up most uses of deprecated GNOME APIs. There are still a few
+ difficult ones left.
+
+ * src/channel.c: Include <glib.h> and <libgnome/libgnome.h> rather
+ than <gnome.h>.
+ * src/channel.h: Include <glib.h> rather than <gnome.h>.
+ * src/gui.c: Include <gdk/gdkkeysyms.h>, <gtk/gtk.h>,
+ <libgnome/libgnome.h>, and <libgnomeui/libgnomeui.h> rather than
+ <gnome.h>.
+ * src/gui.h: Include <gtk/gtk.h> and <libgnomeui/libgnomeui.h>
+ rather than <gnome.h>.
+ * src/http.c: Remove unnecessary <gnome.h> inclusion.
+ * src/main.c: Include <gtk/gtk.h>, <libgnome/libgnome.h>, and
+ <libgnomeui/libgnomeui.h> rather than <gnome.h>. Remove unnecessary
+ <glib.h> inclusion.
+ * src/pixpack.h: Include <gtk/gtk.h> rather than <gtk/gtkwidget.h>.
+ Remove unnecessary <gdk/gdk.h> inclusion.
+ * src/prefs.c: Include <gtk/gtk.h>, <libgnome/libgnome.h>,
+ <libgnomeui/libgnomeui.h>, and "main.h".
+ * src/prefs.h: Include <gtk/gtk.h> rather than <gnome.h>.
+ * src/view.c: Include <libgnome/libgnome.h>.
+ * src/view.h: Include <gtk/gtk.h> rather than <gnome.h> and
+ <libgnomecanvas/gnome-canvas.h>.
+
+ * src/channel.c (channel_new_from_config, channel_save_to_config):
+ Use g_string_printf rather than g_string_sprintf.
+
+ * src/gui.c (new_gui, new_toolbar, create_channel_menu, new_entry):
+ Convert from GTK+ signals to GLib signals.
+ * src/prefs.c (fill_channel_list): Use GDestroyNotify rather than
+ GtkDestroyNotify.
+
+ * src/gui.c (gui_restore_session, cb_toggle_paging, gui_pager_timer,
+ refresh_timer): Convert from GtkProgress to GtkProgressBar.
+ * src/gui.h (struct _Gui): Adjust type of progress element.
+
+ * src/gui.c (create_channel_menu): Use gtk_menu_shell_append rather
+ than gtk_menu_append.
+ (refresh_channel_menu): Use gtk_menu_shell_insert rather than
+ gtk_menu_bar_insert.
+
+ * src/pixpack.c (pixpack_get_type, pixpack_class_init): Convert from
+ GtkType to GType.
+ * src/pixpack.h (PIXPACK, PIXPACK_CLASS, IS_PIXPACK,
+ IS_PIXPACK_CLASS): Likewise.
+ (pixpack_get_type): Update prototype.
+
+ * src/prefs.c (set_tooltip): Remove (gtk_widget_set_tooltip_text is
+ sufficient now).
+ (construct_misc_page): Convert from GtkTooltips to GtkTooltip.
+ * src/prefs.h (set_tooltip): Remove prototype.
+
+ * src/prefs.c: Use gtk_entry_new/gtk_entry_set_max_length rather
+ than gtk_entry_new_with_max_length.
+
+ * src/prefs.h (TELEGNOME_CANVAS_WIDTH, TELEGNOME_CANVAS_HEIGHT):
+ Remove.
+
+2009-04-28 Colin Watson <cjwatson debian org>
+
* Makefile.am (EXTRA_DIST): config.rpath no longer appears to exist,
so don't distribute it.
* configure.ac (ALL_LINGUAS): Remove; moved to ...
diff --git a/src/channel.c b/src/channel.c
index 4cf193e..e8ac4dd 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -24,7 +24,9 @@
**
*/
-#include <gnome.h>
+#include <glib.h>
+#include <libgnome/libgnome.h>
+
#include "channel.h"
Channel *
@@ -51,7 +53,7 @@ channel_new_from_config(int id)
t = g_malloc(sizeof(Channel));
prefix = g_string_new(NULL);
- g_string_sprintf(prefix, "/telegnome/Channel%d/", id);
+ g_string_printf(prefix, "/telegnome/Channel%d/", id);
gnome_config_push_prefix(prefix->str);
t->id = id;
@@ -73,7 +75,7 @@ void channel_save_to_config(Channel *channel)
g_assert(channel != NULL);
prefix = g_string_new("a");
- g_string_sprintf(prefix, "/telegnome/Channel%d/", channel->id);
+ g_string_printf(prefix, "/telegnome/Channel%d/", channel->id);
gnome_config_push_prefix(prefix->str);
gnome_config_set_string("name", channel->name->str);
diff --git a/src/channel.h b/src/channel.h
index 2b26fd2..87a36de 100644
--- a/src/channel.h
+++ b/src/channel.h
@@ -27,7 +27,7 @@
#ifndef _CHANNEL_H_
#define _CHANNEL_H_
-#include <gnome.h>
+#include <glib.h>
typedef struct _Channel {
gint id;
diff --git a/src/gui.c b/src/gui.c
index d7658ae..5bc9d18 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -23,7 +23,10 @@
**
*/
-#include <gnome.h>
+#include <gdk/gdkkeysyms.h>
+#include <gtk/gtk.h>
+#include <libgnome/libgnome.h>
+#include <libgnomeui/libgnomeui.h>
#include "gui.h"
#include "main.h"
@@ -72,9 +75,9 @@ new_gui (gchar* startpage)
toolbar= new_toolbar();
/* attach a keyboard event */
- gtk_signal_connect ( GTK_OBJECT (app),
- "key_press_event",
- GTK_SIGNAL_FUNC (cb_keypress), NULL);
+ g_signal_connect (G_OBJECT (app),
+ "key_press_event",
+ G_CALLBACK (cb_keypress), NULL);
/* attach the menu */
gnome_app_create_menus(GNOME_APP(app), menubar);
@@ -100,16 +103,16 @@ new_gui (gchar* startpage)
gui.statusbar= statusbar;
gui.app= app;
- gtk_signal_connect (GTK_OBJECT (app), "delete_event",
- GTK_SIGNAL_FUNC (cb_quit),
- NULL);
+ g_signal_connect (G_OBJECT (app), "delete_event",
+ G_CALLBACK (cb_quit),
+ NULL);
gui.client = gnome_master_client();
- gtk_signal_connect (GTK_OBJECT (gui.client), "save_yourself",
- GTK_SIGNAL_FUNC (save_yourself),
- NULL); /* fixme? */
- gtk_signal_connect (GTK_OBJECT (gui.client), "die",
- GTK_SIGNAL_FUNC (die), NULL);
+ g_signal_connect (G_OBJECT (gui.client), "save_yourself",
+ G_CALLBACK (save_yourself),
+ NULL); /* fixme? */
+ g_signal_connect (G_OBJECT (gui.client), "die",
+ G_CALLBACK (die), NULL);
gtk_widget_show_all(app);
@@ -214,8 +217,8 @@ gui_restore_session(void)
gui.default_server = gnome_config_get_int_with_default("/telegnome/Default/server=0", NULL);
gui.page_msecs = gnome_config_get_int_with_default("/telegnome/Paging/interval=" DEFAULT_INTERVAL, NULL);
- gui.progress = GTK_WIDGET(gnome_appbar_get_progress(GNOME_APPBAR(gui.statusbar)));
- gtk_progress_configure(GTK_PROGRESS(gui.progress), 0, 0, gui.page_msecs);
+ gui.progress = gnome_appbar_get_progress(GNOME_APPBAR(gui.statusbar));
+ gtk_progress_bar_set_fraction(gui.progress, 0.0);
/* the zoom button */
/* FIXME */ /*
@@ -260,7 +263,7 @@ new_toolbar ()
/* add the entry */
entry= new_entry();
- set_tooltip(entry, _("Page number"));
+ gtk_widget_set_tooltip_text(entry, _("Page number"));
gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 5);
gtk_toolbar_append_widget (GTK_TOOLBAR(toolbar), hbox, "", "");
@@ -269,33 +272,33 @@ new_toolbar ()
GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
NULL, _("Go To Page"),
- NULL, icon, GTK_SIGNAL_FUNC(cb_goto_page), NULL);
+ NULL, icon, G_CALLBACK(cb_goto_page), NULL);
icon = gtk_image_new_from_stock(GTK_STOCK_GO_BACK,
GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
NULL, _("Get Previous Page"),
- NULL, icon, GTK_SIGNAL_FUNC(cb_prev_page), NULL);
+ NULL, icon, G_CALLBACK(cb_prev_page), NULL);
icon = gtk_image_new_from_stock(GTK_STOCK_GO_FORWARD,
GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
NULL, _("Get Next Page"),
- NULL, icon, GTK_SIGNAL_FUNC(cb_next_page), NULL);
+ NULL, icon, G_CALLBACK(cb_next_page), NULL);
icon = gtk_image_new_from_stock(GTK_STOCK_HOME,
GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
NULL, _("Go to the home page"),
- NULL, icon, GTK_SIGNAL_FUNC(cb_home), NULL);
+ NULL, icon, G_CALLBACK(cb_home), NULL);
icon = gtk_image_new_from_stock(GTK_STOCK_MEDIA_PLAY,
GTK_ICON_SIZE_LARGE_TOOLBAR);
w = gtk_toggle_button_new();
gui.pagebutton = w;
gtk_container_add(GTK_CONTAINER(w), icon);
- gtk_signal_connect(GTK_OBJECT(w), "clicked",
- GTK_SIGNAL_FUNC(cb_toggle_paging), NULL);
+ g_signal_connect(G_OBJECT(w), "clicked",
+ G_CALLBACK(cb_toggle_paging), NULL);
gtk_toolbar_append_widget(GTK_TOOLBAR(toolbar), w, _("Toggles auto-paging"), NULL);
/* FIXME */ /*
@@ -373,9 +376,9 @@ create_channel_menu()
item = gtk_menu_item_new_with_label(channel->name->str);
- gtk_signal_connect(GTK_OBJECT(item), "activate",
- GTK_SIGNAL_FUNC(gui_channel_select), (gpointer)channel);
- gtk_menu_append(GTK_MENU(menu), item);
+ g_signal_connect(G_OBJECT(item), "activate",
+ G_CALLBACK(gui_channel_select), (gpointer)channel);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
gtk_widget_show(item);
}
@@ -411,7 +414,7 @@ void refresh_channel_menu()
gui.channel_menu = create_channel_menu();
/* and add it to the menu bar */
- gtk_menu_bar_insert(GTK_MENU_BAR(GNOME_APP(gui.app)->menubar), gui.channel_menu, 2);
+ gtk_menu_shell_insert(GTK_MENU_SHELL(GNOME_APP(gui.app)->menubar), gui.channel_menu, 2);
}
/*******************************
@@ -431,8 +434,8 @@ new_entry ()
/*gtk_entry_set_text(GTK_ENTRY(entry), startpage);*/
- gtk_signal_connect(GTK_OBJECT(entry), "activate",
- GTK_SIGNAL_FUNC(cb_goto_page),NULL);
+ g_signal_connect(G_OBJECT(entry), "activate",
+ G_CALLBACK(cb_goto_page),NULL);
/* save entry for later ref */
gui.entry= entry;
@@ -700,13 +703,12 @@ void
cb_toggle_paging(GtkWidget *w, gpointer data)
{
gui.page_msecs = gnome_config_get_int_with_default("/telegnome/Paging/interval=" DEFAULT_INTERVAL, NULL);
- gtk_progress_configure(GTK_PROGRESS(gui.progress), 0, 0, gui.page_msecs);
+ gtk_progress_bar_set_fraction(gui.progress, 0.0);
if (gui.page_status==TRUE) {
if (gui.page_timer != -1) gtk_timeout_remove(gui.page_timer);
gui.page_timer = -1;
gui.page_status = FALSE;
gui.page_progress = 0;
- gtk_progress_set_value(GTK_PROGRESS(gui.progress), 0);
} else {
gui.page_progress = 0;
gui.page_status = TRUE;
@@ -718,11 +720,11 @@ gint
gui_pager_timer(gpointer g)
{
gui.page_progress += gui.page_msecs/100;
- gtk_progress_set_value(GTK_PROGRESS(gui.progress), gui.page_progress);
+ gtk_progress_bar_set_fraction(gui.progress, gui.page_progress / (gdouble)gui.page_msecs);
if (gui.page_progress >= gui.page_msecs) {
gui.page_progress = 0;
- gtk_progress_set_value(GTK_PROGRESS(gui.progress), 0);
+ gtk_progress_bar_set_fraction(gui.progress, 0.0);
cb_next_page(NULL, NULL);
}
return 1;
@@ -761,14 +763,12 @@ gui_channel_select(GtkWidget *w, gpointer data)
void refresh_timer()
{
- gfloat perc = gtk_progress_get_current_percentage( GTK_PROGRESS(gui.progress) );
+ gdouble perc = gtk_progress_bar_get_fraction(gui.progress);
gui.page_msecs = gnome_config_get_int_with_default("/telegnome/Paging/interval=" DEFAULT_INTERVAL, NULL);
- gui.progress = GTK_WIDGET(gnome_appbar_get_progress(GNOME_APPBAR(gui.statusbar)));
- gtk_progress_configure(GTK_PROGRESS(gui.progress), 0, 0, gui.page_msecs);
+ gui.progress = gnome_appbar_get_progress(GNOME_APPBAR(gui.statusbar));
+ gtk_progress_bar_set_fraction(gui.progress, perc);
- gtk_progress_set_percentage( GTK_PROGRESS(gui.progress), perc);
-
if (gui.page_status == TRUE) {
gtk_timeout_remove(gui.page_timer);
gui.page_timer = gtk_timeout_add(gui.page_msecs/100, gui_pager_timer, NULL);
diff --git a/src/gui.h b/src/gui.h
index 3f600d5..8d63928 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -30,7 +30,8 @@
#include <config.h>
#endif /* HAVE_CONFIG_H */
-#include <gnome.h>
+#include <gtk/gtk.h>
+#include <libgnomeui/libgnomeui.h>
#include "view.h"
#define TG_MAX_CHANNELS 100
@@ -71,7 +72,7 @@ typedef struct _Gui {
/* for session management */
GnomeClient *client;
- GtkWidget *progress;
+ GtkProgressBar *progress;
GtkWidget *zoomlabel;
gint zoom_factor;
diff --git a/src/http.c b/src/http.c
index 452e359..2789975 100644
--- a/src/http.c
+++ b/src/http.c
@@ -22,7 +22,6 @@
#include <string.h>
-#include <gnome.h>
#include <libgnomevfs/gnome-vfs.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "http.h"
diff --git a/src/main.c b/src/main.c
index ede766e..26efcca 100644
--- a/src/main.c
+++ b/src/main.c
@@ -30,8 +30,10 @@
#include <stdio.h>
#include <string.h>
-#include <gnome.h>
-#include <glib.h>
+#include <gtk/gtk.h>
+#include <libgnome/libgnome.h>
+#include <libgnomeui/libgnomeui.h>
+
#include "main.h"
#include "http.h"
#include "gui.h"
diff --git a/src/pixpack.c b/src/pixpack.c
index b733798..5e4749b 100644
--- a/src/pixpack.c
+++ b/src/pixpack.c
@@ -48,22 +48,25 @@ static void pixpack_size_request (GtkWidget *widget,
static GtkWidgetClass *parent_class = NULL;
-GtkType
+GType
pixpack_get_type(void)
{
- static GtkType pixpack_type = 0;
+ static GType pixpack_type = 0;
if (!pixpack_type) {
- static const GtkTypeInfo pixpack_info = {
- "PixPack",
- sizeof (PixPack),
+ static const GTypeInfo pixpack_info = {
sizeof (PixPackClass),
- (GtkClassInitFunc) pixpack_class_init,
- (GtkObjectInitFunc) pixpack_init,
- NULL, NULL,
- (GtkClassInitFunc) NULL,
+ NULL,
+ NULL,
+ (GClassInitFunc) pixpack_class_init,
+ NULL,
+ NULL,
+ sizeof (PixPack),
+ 0,
+ (GInstanceInitFunc) pixpack_init,
};
- pixpack_type = gtk_type_unique(gtk_widget_get_type(), &pixpack_info);
+ pixpack_type = g_type_register_static(GTK_TYPE_WIDGET, "PixPack",
+ &pixpack_info, 0);
}
return pixpack_type;
}
@@ -75,7 +78,7 @@ pixpack_class_init(PixPackClass *klass)
GtkObjectClass *object_class = (GtkObjectClass*) klass;
GtkWidgetClass *widget_class = (GtkWidgetClass*) klass;
- parent_class = gtk_type_class(gtk_widget_get_type());
+ parent_class = g_type_class_peek_parent(klass);
object_class->destroy = pixpack_destroy;
diff --git a/src/pixpack.h b/src/pixpack.h
index 64c090c..fc1c6ee 100644
--- a/src/pixpack.h
+++ b/src/pixpack.h
@@ -25,9 +25,8 @@
#ifndef _PIXPACK_H_
#define _PIXPACK_H_
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gdk/gdk.h>
#ifdef __cplusplus
extern "C" {
@@ -35,10 +34,10 @@ extern "C" {
#define TYPE_PIXPACK (pixpack_get_type ())
-#define PIXPACK(obj) (GTK_CHECK_CAST ((obj), TYPE_PIXPACK, PixPack))
-#define PIXPACK_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_PIXPACK, PixPackClass))
-#define IS_PIXPACK(obj) (GTK_CHECK_TYPE ((obj), TYPE_PIXPACK ))
-#define IS_PIXPACK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_PIXPACK))
+#define PIXPACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PIXPACK, PixPack))
+#define PIXPACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PIXPACK, PixPackClass))
+#define IS_PIXPACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PIXPACK ))
+#define IS_PIXPACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PIXPACK))
typedef struct _PixPack PixPack;
@@ -57,7 +56,7 @@ struct _PixPackClass {
};
-GtkType pixpack_get_type ( void );
+GType pixpack_get_type ( void );
void pixpack_load_image ( PixPack* pixpack, GdkPixbuf* pixbuf );
GtkWidget* pixpack_new ( void );
void pixpack_set_autosize ( PixPack* pixpack, gboolean value );
@@ -68,13 +67,3 @@ void pixpack_set_autosize ( PixPack* pixpack, gboolean value );
#endif /* __cplusplus */
#endif /* _PIXPACK_H_ */
-
-
-
-
-
-
-
-
-
-
diff --git a/src/prefs.c b/src/prefs.c
index bfb6f60..915f829 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -22,8 +22,13 @@
**
*/
+#include <gtk/gtk.h>
+#include <libgnome/libgnome.h>
+#include <libgnomeui/libgnomeui.h>
+
#include "prefs.h"
#include "channel.h"
+#include "main.h"
/* not a good idea to have a 'misc' page, but i cant come up with a better name */
GtkWidget *construct_misc_page();
@@ -47,14 +52,6 @@ void prefs_channel_list_click_cb( GtkWidget *clist, gint row, gint column,
void fill_channel_list();
void prefs_channels_renum();
-void
-set_tooltip(GtkWidget* w, const gchar* tip)
-{
- GtkTooltips* t = gtk_tooltips_new();
- gtk_tooltips_set_tip (t, w, tip, NULL);
-}
-
-
typedef struct _PrefsWindow {
GnomePropertyBox *box;
@@ -146,7 +143,7 @@ fill_channel_list()
newrow = gtk_clist_append(GTK_CLIST(prefs_window->channel_list), info);
gtk_clist_set_row_data_full(GTK_CLIST(prefs_window->channel_list), newrow,
channel,
- (GtkDestroyNotify)(channel_free));
+ (GDestroyNotify)(channel_free));
}
gtk_clist_thaw(GTK_CLIST(prefs_window->channel_list));
}
@@ -164,7 +161,7 @@ construct_misc_page()
gtk_table_set_col_spacings(GTK_TABLE(table), 5);
label = gtk_label_new(_("Paging interval"));
- set_tooltip(label, _("Specifies the interval for the auto-pager, in milliseconds."));
+ gtk_widget_set_tooltip_text(label, _("Specifies the interval for the auto-pager, in milliseconds."));
adj = GTK_ADJUSTMENT(gtk_adjustment_new(8000.0, 1000.0, 60000.0, 1000.0, 10.0, 0.0));
entry = gtk_spin_button_new(adj, 0.5, 0);
@@ -175,7 +172,8 @@ construct_misc_page()
gtk_spin_button_set_value(GTK_SPIN_BUTTON(entry),
gnome_config_get_int_with_default("/telegnome/Paging/interval=" DEFAULT_INTERVAL,NULL));
proxy_label = gtk_label_new(_("Proxy server"));
- proxy_entry = gtk_entry_new_with_max_length(100);
+ proxy_entry = gtk_entry_new();
+ gtk_entry_set_max_length(GTK_ENTRY(proxy_entry), 100);
gtk_entry_set_text(GTK_ENTRY(proxy_entry),
gnome_config_get_string_with_default("/telegnome/Proxy/http_proxy=" "",NULL));
diff --git a/src/prefs.h b/src/prefs.h
index 0f8e7a1..ef45a96 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -25,20 +25,17 @@
#ifndef __PREFS_H__
#define __PREFS_H__
-#include <gnome.h>
+#include <gtk/gtk.h>
/* some defaults */
#define DEFAULT_SUB_PAGE_URL "http://teletekst.nos.nl/cgi-bin/tt/nos/gif/%d-%d"
#define DEFAULT_PAGE_URL "http://teletekst.nos.nl/cgi-bin/tt/nos/gif/%d/"
#define DEFAULT_INTERVAL "12000"
-#define TELEGNOME_CANVAS_WIDTH 369
-#define TELEGNOME_CANVAS_HEIGHT 275
#define TELEGNOME_LOGO "telegnome/telegnome-logo.png"
#define TELEGNOME_NOTFOUND "telegnome/telegnome-logo.png"
void prefs_show(void);
-void set_tooltip(GtkWidget* w, const gchar* tip);
void set_close_cb( void (*c)() );
#endif /* __PREFS_H__ */
diff --git a/src/view.c b/src/view.c
index 45622a1..b49328a 100644
--- a/src/view.c
+++ b/src/view.c
@@ -24,6 +24,8 @@
**
*/
+#include <libgnome/libgnome.h>
+
#include "view.h"
#include "prefs.h"
#include "main.h"
diff --git a/src/view.h b/src/view.h
index b5d795b..445d7b0 100644
--- a/src/view.h
+++ b/src/view.h
@@ -27,8 +27,7 @@
#ifndef _VIEW_H_
#define _VIEW_H_
-#include <gnome.h>
-#include <libgnomecanvas/gnome-canvas.h>
+#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "channel.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]