#include "level2.h"
#include "../aweather-location.h"
-static void _gtk_bin_set_child(GtkBin *bin, GtkWidget *new)
+static void aweather_bin_set_child(GtkBin *bin, GtkWidget *new)
{
GtkWidget *old = gtk_bin_get_child(bin);
if (old)
g_warning("RadarSite: update_end - %s", site->message);
const char *fmt = "http://forecast.weather.gov/product.php?site=NWS&product=FTM&format=TXT&issuedby=%s";
char *uri = g_strdup_printf(fmt, site->city->code+1);
- GtkWidget *box = gtk_vbox_new(TRUE, 0);
+ GtkWidget *box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
GtkWidget *msg = gtk_label_new(site->message);
GtkWidget *btn = gtk_link_button_new_with_label(uri, "View Radar Status");
+ gtk_box_set_homogeneous(GTK_BOX(box), TRUE);
gtk_box_pack_start(GTK_BOX(box), msg, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(box), btn, TRUE, TRUE, 0);
- _gtk_bin_set_child(GTK_BIN(site->config), box);
+ aweather_bin_set_child(GTK_BIN(site->config), box);
g_free(uri);
} else {
- _gtk_bin_set_child(GTK_BIN(site->config),
+ aweather_bin_set_child(GTK_BIN(site->config),
aweather_level2_get_config(site->level2));
}
site->status = STATUS_LOADED;
/* Add a progress bar */
GtkWidget *progress = gtk_progress_bar_new();
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress), "Loading...");
- _gtk_bin_set_child(GTK_BIN(site->config), progress);
+ aweather_bin_set_child(GTK_BIN(site->config), progress);
/* Remove old volume */
g_debug("RadarSite: update - remove - %s", site->city->code);
/* Check error status */
if (conus->message) {
g_warning("Conus: update_end - %s", conus->message);
- _gtk_bin_set_child(GTK_BIN(conus->config), gtk_label_new(conus->message));
+ aweather_bin_set_child(GTK_BIN(conus->config), gtk_label_new(conus->message));
goto out;
}
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(conus->path, &error);
if (!pixbuf || error) {
g_warning("Conus: update_end - error loading pixbuf: %s", conus->path);
- _gtk_bin_set_child(GTK_BIN(conus->config), gtk_label_new("Error loading pixbuf"));
+ aweather_bin_set_child(GTK_BIN(conus->config), gtk_label_new("Error loading pixbuf"));
g_remove(conus->path);
goto out;
}
/* Update GUI */
gchar *label = g_path_get_basename(conus->path);
- _gtk_bin_set_child(GTK_BIN(conus->config), gtk_label_new(label));
+ aweather_bin_set_child(GTK_BIN(conus->config), gtk_label_new(label));
grits_viewer_queue_draw(conus->viewer);
g_free(label);
/* Add a progress bar */
GtkWidget *progress = gtk_progress_bar_new();
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress), "Loading...");
- _gtk_bin_set_child(GTK_BIN(conus->config), progress);
+ aweather_bin_set_child(GTK_BIN(conus->config), progress);
g_thread_new("conus-update-thread", _conus_update_thread, conus);
}
}
static void _update_hidden(GtkNotebook *notebook,
- GtkNotebookPage *page, guint page_num, gpointer viewer)
+ GtkWidget *page, guint page_num, gpointer viewer)
{
g_debug("GritsPluginRadar: _update_hidden - 0..%d = %d",
gtk_notebook_get_n_pages(notebook), page_num);