Changeset 18


Ignore:
Timestamp:
Jan 12, 2006, 6:56:00 PM (15 years ago)
Author:
root
Message:

Update 2005-12-19

Location:
trunk/gtk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/gtkcellrenderertorrent.c

    r11 r18  
    108108}
    109109
     110/* XXX need to do this better somehow */
     111void
     112gtk_cell_renderer_torrent_reset_style(GtkCellRendererTorrent *tor) {
     113  if(NULL != tor->priv->style) {
     114    gtk_style_detach(tor->priv->style);
     115    gtk_style_unref(tor->priv->style);
     116    tor->priv->style = NULL;
     117  }
     118}
     119
    110120static void
    111121finalize(GObject *object) {
  • trunk/gtk/gtkcellrenderertorrent.h

    r11 r18  
    6464GType            gtk_cell_renderer_torrent_get_type (void) G_GNUC_CONST;
    6565GtkCellRenderer* gtk_cell_renderer_torrent_new      (void);
     66void gtk_cell_renderer_torrent_reset_style(GtkCellRendererTorrent *);
    6667
    6768G_END_DECLS
  • trunk/gtk/main.c

    r17 r18  
    8181GtkWidget *
    8282makewind_list(struct cbdata *data);
     83static void
     84stylekludge(GObject *obj, GParamSpec *spec, gpointer gdata);
    8385void
    8486fixbuttons(GtkTreeSelection *sel, gpointer gdata);
     
    439441  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
    440442
     443  /* XXX this shouldn't be necessary */
     444  g_signal_connect(view, "notify", G_CALLBACK(stylekludge), progrend);
     445
    441446  gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), TRUE);
    442447  sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
     
    449454
    450455  return view;
     456}
     457
     458/* kludge to have the progress bars notice theme changes */
     459static void
     460stylekludge(GObject *obj, GParamSpec *spec, gpointer gdata) {
     461  if(0 == strcmp("style", spec->name)) {
     462    gtk_cell_renderer_torrent_reset_style(GTK_CELL_RENDERER_TORRENT(gdata));
     463    gtk_widget_queue_draw(GTK_WIDGET(obj));
     464  }
    451465}
    452466
  • trunk/gtk/prefs.c

    r17 r18  
    141141  int intval;
    142142  const char *strval;
    143   char *strnum;
     143  char *strnum, *errstr;
    144144  gboolean boolval;
    145145
     
    147147    /* check directory */
    148148    strval = gtk_entry_get_text(data->dir);
    149     if(!mkdir_p(strval, 0777)) {
     149    if('\0' != strval[0] &&!mkdir_p(strval, 0777)) {
    150150      errmsg(data->parent, "Failed to create directory %s:\n%s",
    151151             strval, strerror(errno));
    152152      return;
    153153    }
     154
     155    /* save dir pref */
     156    cf_setpref(PREF_DIR, gtk_entry_get_text(data->dir), NULL);
    154157
    155158    /* save port pref */
     
    167170    intval = gtk_spin_button_get_value_as_int(data->limit);
    168171    strnum = g_strdup_printf("%i", intval);
    169     cf_setpref(PREF_LIMIT, strnum, NULL);
    170     g_free(strnum);
    171 
    172     setlimit(data->tr);
    173 
    174172    /*
    175173      note that prefs aren't written to disk unless we pass a pointer
    176174      to an error string, so do this for the last call to cf_setpref()
    177175    */
    178     /* save dir pref */
    179     if(!cf_setpref(PREF_DIR, gtk_entry_get_text(data->dir), &strnum)) {
    180       errmsg(data->parent, "%s", strnum);
     176    if(!cf_setpref(PREF_LIMIT, strnum, &errstr)) {
     177      errmsg(data->parent, "%s", errstr);
    181178      g_free(strnum);
    182       return;
     179      g_free(errstr);
    183180    }
     181
     182    setlimit(data->tr);
    184183  }
    185184
Note: See TracChangeset for help on using the changeset viewer.