Exemple #1
0
/* Updates the scan-monitoring file list with the given values */
void
filelist_scan_monitor( int *node_counts, int64 *size_counts )
{
	const char *str;
	int64 size_total = 0;
	int node_total = 0;
	int i;

	gtk_clist_freeze( GTK_CLIST(file_clist_w) );
	for (i = 1; i <= NUM_NODE_TYPES; i++) {
		/* Column 2 */
		if (i < NUM_NODE_TYPES) {
			str = i64toa( node_counts[i] );
			node_total += node_counts[i];
		}
		else
			str = i64toa( node_total );
		gtk_clist_set_text( GTK_CLIST(file_clist_w), i - 1, 1, str );

		/* Column 3 */
		if (i < NUM_NODE_TYPES) {
			str = i64toa( size_counts[i] );
			size_total += size_counts[i];
		}
		else
			str = i64toa( size_total );
		gtk_clist_set_text( GTK_CLIST(file_clist_w), i - 1, 2, str );
	}
	gtk_clist_thaw( GTK_CLIST(file_clist_w) );
}
Exemple #2
0
static void
gensetup_update_clicked(GtkWidget* widget, TGENSETUP *gensetup_t)
{
  char *data[2];
  int i;

  if (gensetup_t)
    {
      data[0] = gtk_entry_get_text (GTK_ENTRY (gensetup_t->key_entry));
      if (STRLEN (data[0]))
	{
	  data[1] = gtk_entry_get_text (GTK_ENTRY (gensetup_t->value_entry));

	  if (GTK_CLIST (gensetup_t->key_list)->selection != NULL)
	    i = GPOINTER_TO_INT (GTK_CLIST (gensetup_t->key_list)->selection->
		data);
	  else
	    i = 0;

	  /* An update operation */
	  if (i < GTK_CLIST (gensetup_t->key_list)->rows)
	    {
	      gtk_clist_set_text (GTK_CLIST (gensetup_t->key_list), i, 0,
		  data[0]);
	      gtk_clist_set_text (GTK_CLIST (gensetup_t->key_list), i, 1,
		  data[1]);
	    }
	}

      gtk_entry_set_text (GTK_ENTRY (gensetup_t->key_entry), "");
      gtk_entry_set_text (GTK_ENTRY (gensetup_t->value_entry), "");
    }
}
Exemple #3
0
static void
key_dialog_set_data (GtkWidget * entry, int d)
{
	const char *text = gtk_entry_get_text (GTK_ENTRY (entry));
	int row = gtkutil_clist_selection (key_dialog_kb_clist);
	struct key_binding *kb;
	char *buf;
	int len = strlen (text);

	len++;

	if (row == -1)
		return;

	kb = gtk_clist_get_row_data (GTK_CLIST (key_dialog_kb_clist), row);
	if (d == 0)
	{									  /* using data1 */
		if (kb->data1)
			free (kb->data1);
		buf = (char *) malloc (len);
		memcpy (buf, text, len);
		kb->data1 = buf;
		gtk_clist_set_text (GTK_CLIST (key_dialog_kb_clist), row, 3, text);
	} else
	{
		if (kb->data2)
			free (kb->data2);
		buf = (char *) malloc (len);
		memcpy (buf, text, len);
		kb->data2 = buf;
		gtk_clist_set_text (GTK_CLIST (key_dialog_kb_clist), row, 4, text);
	}
}
Exemple #4
0
void
hcache_gui_update_display(void)
{
    hcache_stats_t stats[HCACHE_MAX];
    GtkCList *clist;
    gint n;

    guc_hcache_get_stats(stats);

    clist = GTK_CLIST(gui_main_window_lookup("clist_hcache"));
    gtk_clist_freeze(clist);

    for (n = 0; n < HCACHE_MAX; n ++) {
		if (n == HCACHE_NONE)
			continue;

        gtk_clist_set_text(clist, n,
            c_hcs_host_count, guint_to_str(stats[n].host_count));

        gtk_clist_set_text(clist, n,
            c_hcs_hits, guint_to_str(stats[n].hits));

        gtk_clist_set_text(clist, n,
            c_hcs_misses, guint_to_str(stats[n].misses));
    }

    gtk_clist_thaw(clist);
}
Exemple #5
0
static void OkSelectContactDialog(GtkWidget * widget, SelectContactData * data)
{
	GList *sel;
	PhonebookEntry *pbEntry;
	gchar *key;

	if ((sel = GTK_CLIST(data->clist)->selection) != NULL) {
		D_SpeedDial *d = (D_SpeedDial *) g_malloc(sizeof(D_SpeedDial));

		gtk_clist_freeze(GTK_CLIST(clist));

		pbEntry = gtk_clist_get_row_data(GTK_CLIST(data->clist),
						 GPOINTER_TO_INT(sel->data));

		gtk_clist_get_text(GTK_CLIST(clist), selectedKey, 0, &key);

		gtk_clist_set_text(GTK_CLIST(clist), selectedKey, 1, pbEntry->entry.name);
		gtk_clist_set_text(GTK_CLIST(clist), selectedKey, 2, pbEntry->entry.number);

		d->entry.number = *key - '0';
		d->entry.memory_type = pbEntry->entry.memory_type + 2;
		d->entry.location = pbEntry->entry.location;

		gtk_clist_set_row_data_full(GTK_CLIST(clist), selectedKey,
					    (gpointer) d, DestroyCListData);

		gtk_clist_sort(GTK_CLIST(clist));
		gtk_clist_thaw(GTK_CLIST(clist));
	}

	gtk_widget_destroy(GTK_WIDGET(data->clist));
	gtk_widget_destroy(GTK_WIDGET(data->clistScrolledWindow));
	gtk_widget_destroy(GTK_WIDGET(data->dialog));
}
Exemple #6
0
void update_advertised_service(advertised_service *a){
   GList *l;
   gint i;
   gchar *s_text[4];

   extern gchar *s_methods[];
   extern gchar *s_protocols[];
   extern GList *service;
   extern GtkWidget *advertised_service_clist;

   for(l=service,i=0;l;l=l->next,i++){
      if(l->data==a){
         s_text[0] = a->address;
         s_text[1] = a->port;
         s_text[2] = s_methods[a->method];
         s_text[3] = s_protocols[a->protocol];
         gtk_clist_freeze(GTK_CLIST(advertised_service_clist));
         gtk_clist_set_text(GTK_CLIST(advertised_service_clist),i,0,s_text[0]);
         gtk_clist_set_text(GTK_CLIST(advertised_service_clist),i,1,s_text[1]);
         gtk_clist_set_text(GTK_CLIST(advertised_service_clist),i,2,s_text[2]);
         gtk_clist_set_text(GTK_CLIST(advertised_service_clist),i,3,s_text[3]);
         gtk_clist_thaw(GTK_CLIST(advertised_service_clist));
      }
   }
}
void update_regHiLo()
{
	char txt[24];

	gtk_clist_freeze( GTK_CLIST(clRegHiLo) );
	
	if( gui_fantom_hi != hi ) {
		gui_fantom_hi = hi;
		sprintf( txt, "%.16llX", gui_fantom_hi );
		gtk_clist_set_text( GTK_CLIST(clRegHiLo), 0, 0, txt );
		gtk_clist_set_background( GTK_CLIST(clRegHiLo), 0, &color_modif);
	}
	else
		gtk_clist_set_background( GTK_CLIST(clRegHiLo), 0, &color_ident);

	if(gui_fantom_lo!=lo) {
		gui_fantom_lo=lo;
		sprintf(txt, "%.16llX", gui_fantom_lo );
		gtk_clist_set_text( GTK_CLIST(clRegHiLo), 1, 0, txt );
		gtk_clist_set_background( GTK_CLIST(clRegHiLo), 0, &color_modif);
	}
	else
		gtk_clist_set_background( GTK_CLIST(clRegHiLo), 1, &color_ident);

	gtk_clist_thaw( GTK_CLIST(clRegHiLo) );
}
Exemple #8
0
void close_and_add_station_editor(gpointer *userdata) {
  gint new_entry = (gint)userdata;
  gchar *f[3];
  gfloat freq;
  gchar fstr[32];

  f[0] = (gchar *) gtk_entry_get_text(GTK_ENTRY(gui_station_name_input));
  freq = gtk_spin_button_get_value_as_float(GTK_SPIN_BUTTON(gui_freq_input));
  sprintf(fstr, "%.2f", freq);
  f[1] = fstr;
  f[2] = "";

  if (new_entry) {
    gtk_clist_append(GTK_CLIST(gui_station_list), f);
    gui_station_count++;
  } else {
    assert(gui_station_selected != -1);
    gtk_clist_set_text(GTK_CLIST(gui_station_list),
		       gui_station_selected, 0,
		       f[0]);
    gtk_clist_set_text(GTK_CLIST(gui_station_list),
		       gui_station_selected, 1,
		       f[1]);
  }
  close_station_editor();
}
Exemple #9
0
void update_FGR()
{
    int i;
    char txt[24];

    gtk_clist_freeze( GTK_CLIST(clFGR) );
    for(i=0; i<32; i++) {
        if( gui_fantom_simple[i]!= *reg_cop1_simple[i] )
        {
            gui_fantom_simple[i] = *reg_cop1_simple[i];
            sprintf(txt, "%f", *reg_cop1_simple[i] );
            gtk_clist_set_text( GTK_CLIST(clFGR), i, 1, txt );
            gtk_clist_set_background( GTK_CLIST(clFGR), i, &color_modif);
        } else {
            gtk_clist_set_background( GTK_CLIST(clFGR), i, &color_ident);
        }
    }
    gtk_clist_thaw( GTK_CLIST(clFGR) );

    gtk_clist_freeze( GTK_CLIST(clFGR2) );
    for(i=0; i<32; i++) {
        if( gui_fantom_double[i]!=  *reg_cop1_double[i] )
        {
            gui_fantom_double[i] = *reg_cop1_double[i];
            sprintf(txt, "%f", *reg_cop1_double[i] );
            gtk_clist_set_text( GTK_CLIST(clFGR2), i, 1, txt );
            gtk_clist_set_background( GTK_CLIST(clFGR2), i, &color_modif);
        } else {
            gtk_clist_set_background( GTK_CLIST(clFGR2), i, &color_ident);
        }
    }
    gtk_clist_thaw( GTK_CLIST(clFGR2) );
}
Exemple #10
0
/**
 * Update all the nodes at the same time.
 *
 * @bug
 * FIXME: We should remember for every node when it was last
 *        updated and only refresh every node at most once every
 *        second. This information should be kept in a struct pointed
 *        to by the row user_data and should be automatically freed
 *        when removing the row (see upload stats code).
 */
void
nodes_gui_update_display(time_t now)
{
	GtkCList *clist;
	GList *l;
	gint row = 0;
    gnet_node_status_t status;

    clist = GTK_CLIST(gui_main_window_lookup("clist_nodes"));
    gtk_clist_freeze(clist);

	for (l = clist->row_list, row = 0; l; l = l->next, row++) {
		const struct nid *node_id = ((GtkCListRow *) l->data)->data;

        guc_node_get_status(node_id, &status);

        /*
         * Update additional info too if it has recorded changes.
         */
        if (remove_item(hs_node_info_changed, node_id)) {
            gnet_node_info_t info;

            guc_node_fill_info(node_id, &info);
            nodes_gui_update_node_info(&info, row);
            guc_node_clear_info(&info);
        }

        if (remove_item(hs_node_flags_changed, node_id)) {
            gnet_node_flags_t flags;

            guc_node_fill_flags(node_id, &flags);
            nodes_gui_update_node_flags(node_id, &flags, -1);
        }

		/*
		 * Don't update times if we've already disconnected.
		 */
		if (status.status == GTA_NODE_CONNECTED) {
	        gtk_clist_set_text(clist, row, c_gnet_connected,
        			short_uptime(delta_time(now, status.connect_date)));

			if (status.up_date)
				gtk_clist_set_text(clist, row, c_gnet_uptime,
					status.up_date ?
						short_uptime(delta_time(now, status.up_date)) : "...");
		}
        gtk_clist_set_text(clist, row, c_gnet_info,
			nodes_gui_common_status_str(&status));
    }
    gtk_clist_thaw(clist);
}
Exemple #11
0
static void pattern_clist_update_row (struct player_pattern *pp, int row) {

  pattern_clist_update_groups (row, pp->groups, ~pp->groups); /* update all */

  if (pp->error) {
    gtk_clist_set_pixtext (GTK_CLIST (pattern_clist), row, 3, 
                    mode_symbols[pp->mode], 2, error_pix.pix, error_pix.mask);
  }
  else {
    gtk_clist_set_text (GTK_CLIST (pattern_clist), row, 3, 
                                                      mode_symbols[pp->mode]);
  }

  gtk_clist_set_text (GTK_CLIST (pattern_clist), row, 4, pp->pattern);
}
Exemple #12
0
void update_regSI()
{
	char txt[24];

	gtk_clist_freeze( GTK_CLIST(clRegSI) );

	if( gui_fantom_reg_SI[0] != si_register.si_dram_addr ) {
		gui_fantom_reg_SI[0] = si_register.si_dram_addr;
		sprintf( txt, "%.16lX", si_register.si_dram_addr);
		gtk_clist_set_text( GTK_CLIST(clRegSI), 0, 0, txt );
		gtk_clist_set_background( GTK_CLIST(clRegSI), 0, &color_modif);
	} else {
		gtk_clist_set_background( GTK_CLIST(clRegSI), 0, &color_ident);
	}

	if( gui_fantom_reg_SI[1] != si_register.si_pif_addr_rd64b )
	{
		gui_fantom_reg_SI[1] = si_register.si_pif_addr_rd64b;
		sprintf( txt, "%.16lX", si_register.si_pif_addr_rd64b);
		gtk_clist_set_text( GTK_CLIST(clRegSI), 1, 0, txt );
		gtk_clist_set_background( GTK_CLIST(clRegSI), 1, &color_modif);
	} else {
		gtk_clist_set_background( GTK_CLIST(clRegSI), 1, &color_ident);
	}

	if( gui_fantom_reg_SI[2] != si_register.si_pif_addr_wr64b )
	{
		gui_fantom_reg_SI[2] = si_register.si_pif_addr_wr64b;
		sprintf( txt, "%.16lX", si_register.si_pif_addr_wr64b);
		gtk_clist_set_text( GTK_CLIST(clRegSI), 2, 0, txt );
		gtk_clist_set_background( GTK_CLIST(clRegSI), 2, &color_modif);
	} else {
		gtk_clist_set_background( GTK_CLIST(clRegSI), 2, &color_ident);
	}


	if( gui_fantom_reg_SI[3] != si_register.si_stats )
	{
		gui_fantom_reg_SI[3] = si_register.si_stats;
		sprintf( txt, "%.16lX", si_register.si_stats );
		gtk_clist_set_text( GTK_CLIST(clRegSI), 3, 0, txt );
		gtk_clist_set_background( GTK_CLIST(clRegSI), 3, &color_modif);
	} else {
		gtk_clist_set_background( GTK_CLIST(clRegSI), 3, &color_ident);
	}

	gtk_clist_thaw( GTK_CLIST(clRegSI) );
}
Exemple #13
0
extern void GTKPopMoveRecord( moverecord *pmr ) {

    GtkCList *pcl = GTK_CLIST( pwGameList );
    gamelistrow *pglr = NULL;
    
    gtk_clist_freeze( pcl );

    while( pcl->rows ) {
	pglr = gtk_clist_get_row_data( pcl, pcl->rows - 1 );
	
	if( pglr->apmr[ 0 ] != pmr && pglr->apmr[ 1 ] != pmr )
	    gtk_clist_remove( pcl, pcl->rows - 1);
	else
	    break;
    }

    if( pcl->rows ) {
	if( pglr->apmr[ 0 ] == pmr )
	    /* the left column matches; delete the row */
	    gtk_clist_remove( pcl, pcl->rows - 1 );
	else {
	    /* the right column matches; delete that column only */
	    gtk_clist_set_text( pcl, pcl->rows - 1, 2, NULL );
	    pglr->apmr[ 1 ] = NULL;
	}
    }
    
    gtk_clist_thaw( pcl );
}
Exemple #14
0
static void cb_clist_selection(GtkWidget      *clist,
                               gint           row,
                               gint           column,
                               GdkEventButton *event,
                               gpointer       data)
{
   char fname[1000];
   char *gtk_str;

   clist_row_selected = row;

   if (column == INST_SDCARD_COLUMN) {
      /* Toggle display of SDCARD pixmap */
      if (gtk_clist_get_text(GTK_CLIST(clist), row, column, NULL)) {
         GdkPixmap *pixmap;
         GdkBitmap *mask;
         get_pixmaps(clist, PIXMAP_SDCARD, &pixmap, &mask);
         gtk_clist_set_pixmap(GTK_CLIST(clist), row, column, pixmap, mask);
         
         gtk_clist_get_text(GTK_CLIST(clist), row, INST_FNAME_COLUMN, &gtk_str); 
         fname[0] = '\001';
         g_strlcpy(&fname[1], gtk_str, sizeof(fname)-1);
         install_modify_line(row, fname);

      } else {
         gtk_clist_set_text(GTK_CLIST(clist), row, column, "");
         gtk_clist_get_text(GTK_CLIST(clist), row, INST_FNAME_COLUMN, &gtk_str); 
         g_strlcpy(&fname[0], gtk_str, sizeof(fname));
         install_modify_line(row, fname);
      }
   }

   return;
}
Exemple #15
0
void update_GPR()
{
	int i;
	char txt[24];

	gtk_clist_freeze( GTK_CLIST(clGPR) );
	
	for(i=0; i<32; i++)
	{
		// Les "registres fantomes" evitent de raffraichir l'affichage de chaque
		// registre. Seules les modifications sont affichees a l'ecran.
		if(gui_fantom_gpr[i]!=reg[i])
		{
			gui_fantom_gpr[i] = reg[i];
			sprintf(txt, "%.16llX", reg[i]);
			gtk_clist_set_text( GTK_CLIST(clGPR), i, 0, txt );
			gtk_clist_set_background( GTK_CLIST(clGPR), i, &color_modif);
		}
		else
		{
			gtk_clist_set_background( GTK_CLIST(clGPR), i, &color_ident);
		}
	}
	gtk_clist_thaw( GTK_CLIST(clGPR) );
}
Exemple #16
0
/*********************************************************************************************************
 * callbacks
 */
static void
callback_okClicked( GtkWidget *widget, gpointer data )
{
	char crc_code[200];

	gtk_widget_hide( g_RomPropDialog.dialog );
	gtk_grab_remove( g_RomPropDialog.dialog );

	/* save properties */
	strcpy( g_RomEntry->info.cComments, gtk_entry_get_text( GTK_ENTRY(g_RomPropDialog.commentsEntry) ) );

	/* save cache and ini */
	rombrowser_writeCache();
	if( !g_RomEntry->iniEntry )
	{
		sprintf( crc_code, "%08X-%08X-C%02X", sl(g_RomEntry->info.iCRC1), sl(g_RomEntry->info.iCRC2), g_RomEntry->info.cCountry );
		g_RomEntry->iniEntry = ini_search_by_CRC( crc_code );
	}
	if( g_RomEntry->iniEntry )
	{
		strcpy( g_RomEntry->iniEntry->comments, g_RomEntry->info.cComments );
		ini_updateFile(1);
	}

	// update rombrowser
	gtk_clist_set_text( GTK_CLIST(g_MainWindow.romCList), gtk_clist_find_row_from_data( GTK_CLIST(g_MainWindow.romCList), g_RomEntry ),
											3, g_RomEntry->info.cComments );
}
Exemple #17
0
/* This replaces the file list widget with another one made specifically
 * to monitor the progress of an impending scan */
void
filelist_scan_monitor_init( void )
{
	char *col_titles[3];
	char *empty_row[3] = { NULL, NULL, NULL };
	GtkWidget *parent_w;
	Icon *icon;
	int i;

	col_titles[0] = _("Type");
	col_titles[1] = _("Found");
	col_titles[2] = _("Bytes");

	/* Replace current clist widget with a 3-column one */
	parent_w = file_clist_w->parent->parent;
	gtk_widget_destroy( file_clist_w->parent );
	file_clist_w = gui_clist_add( parent_w, 3, col_titles );

	/* Place icons and static text */
	for (i = 1; i <= NUM_NODE_TYPES; i++) {
		gtk_clist_append( GTK_CLIST(file_clist_w), empty_row );
		if (i < NUM_NODE_TYPES) {
			icon = &node_type_mini_icons[i];
			gtk_clist_set_pixtext( GTK_CLIST(file_clist_w), i - 1, 0, _(node_type_plural_names[i]), 2, icon->pixmap, icon->mask );
		}
		else
                        gtk_clist_set_text( GTK_CLIST(file_clist_w), i - 1, 0, _("TOTAL") );
		gtk_clist_set_selectable( GTK_CLIST(file_clist_w), i - 1, FALSE );
	}
}
Exemple #18
0
void change_minilist_entry(GtkWidget * entry, gpointer data)
{
    gchar *text;
    extern gboolean rcfile_saved;
    struct slist_gui *the_gui = (struct slist_gui *) data;
    struct fnlist *selected_data_struct;

    if (the_gui->chosen_row < 0)
	return;
    
    selected_data_struct = (struct fnlist *) gtk_clist_get_row_data(GTK_CLIST(the_gui->list),
								    the_gui->chosen_row);
    
    g_assert (selected_data_struct != NULL);
    g_assert (the_gui != NULL);
    
    text = strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
    if (! xsc_replace_string(&(selected_data_struct->pattern), text))
      return;

    gtk_clist_set_text(GTK_CLIST(the_gui->list), the_gui->chosen_row, 0, text);
    
    /* TODO: Find out how Joe allocates these things, and put in routines
     * to make sure any existing memory is always freed.
     */
    
    selected_data_struct->haspath = FALSE;
    if (*text == '/') {
	selected_data_struct->haspath = TRUE;
	/* Strip that leading slash. */
	selected_data_struct->pattern++;
    }
    gtk_widget_grab_focus(GTK_WIDGET(the_gui->entry));
    rcfile_saved = FALSE;
}
Exemple #19
0
static void
dbg_property_set_row(GtkCList *clist, gint row, property_t prop)
{
	gint i;

	g_assert(clist);
	g_assert(row != -1);

	for (i = 0; i < (gint) num_dbg_cols; i++) {
		const gchar *text;
		switch ((enum dbg_cols) i) {
		case dbg_col_saved:
			text = gnet_prop_is_saved(prop) ? _("Yes") : _("No");
			break;
		case dbg_col_type:
			text = gnet_prop_type_to_string(prop);
			break;
		case dbg_col_name:
			text = gnet_prop_name(prop);
			break;
		case dbg_col_value:
			text = gnet_prop_to_string(prop);
			break;
		default:
			g_assert_not_reached();
			text = "(null)";
		}
		gtk_clist_set_text(clist, row, i, text);
	}
   	gtk_clist_set_row_data(clist, row, GUINT_TO_POINTER(prop));
}
Exemple #20
0
/*
 * Modify a key given a list and a row
 */
void
airpcap_modify_key_in_list(GtkWidget *keylist, gint row, gchar* type, gchar* key, gchar* ssid)
{
    gchar*       new_row[3];

    new_row[0] = g_strdup(type);
    new_row[1] = g_strdup(key);
    new_row[2] = g_strdup(ssid);

    gtk_clist_set_text(GTK_CLIST(keylist),row,0,new_row[0]);
    gtk_clist_set_text(GTK_CLIST(keylist),row,1,new_row[1]);
    gtk_clist_set_text(GTK_CLIST(keylist),row,2,new_row[2]);

    g_free(new_row[0]);
    g_free(new_row[1]);
    g_free(new_row[2]);
}
static void
update_row (int               row,
	    XSettingsSetting *setting)
{
  char buffer[256];
  GtkStyle *style;
  const char *type;
  
  if (setting->type != XSETTINGS_TYPE_COLOR)
    gtk_clist_set_cell_style (GTK_CLIST (settings_clist),
			      row, VALUE, NULL);

  switch (setting->type)
    {
    case XSETTINGS_TYPE_INT:
      type = "INT";
      sprintf (buffer, "%d", setting->data.v_int);
      gtk_clist_set_text (GTK_CLIST (settings_clist), row, VALUE, buffer);      
      break;
    case XSETTINGS_TYPE_STRING:
      type = "STRING";
      gtk_clist_set_text (GTK_CLIST (settings_clist), row, VALUE, setting->data.v_string);
      break;
    case XSETTINGS_TYPE_COLOR:
      type = "COLOR";
      gtk_clist_set_text (GTK_CLIST (settings_clist), row, VALUE, "");
      style = gtk_style_copy (settings_clist->style);
      style->base[GTK_STATE_NORMAL].red = setting->data.v_color.red;
      style->base[GTK_STATE_NORMAL].green = setting->data.v_color.green;
      style->base[GTK_STATE_NORMAL].blue = setting->data.v_color.blue;
      style->bg[GTK_STATE_SELECTED].red = setting->data.v_color.red;
      style->bg[GTK_STATE_SELECTED].green = setting->data.v_color.green;
      style->bg[GTK_STATE_SELECTED].blue = setting->data.v_color.blue;
      gtk_clist_set_cell_style (GTK_CLIST (settings_clist),
				row, VALUE, style);
      gtk_style_unref (style);
      break;
    default:
      g_assert_not_reached ();
    }

  gtk_clist_set_text (GTK_CLIST (settings_clist), row, TYPE, type);

  sprintf (buffer, "%ld", setting->last_change_serial);
  gtk_clist_set_text (GTK_CLIST (settings_clist), row, SERIAL, buffer);
}
void
on_bt_dbupdate_clicked                 (GtkButton       *button,
                                        gpointer         user_data)
{
  GtkWidget *widget;
  char *sat, *mode, *uplink, *downlink, *beacon;

  if(selectedrow < 0)
    return;

  widget = lookup_widget( dialog_dbedit, "tx_dbsat" );
  sat=(char *)gtk_entry_get_text(GTK_ENTRY(widget));
  widget = lookup_widget( dialog_dbedit, "tx_dbmode" );
  mode=(char *)gtk_entry_get_text(GTK_ENTRY(widget));
  widget = lookup_widget( dialog_dbedit, "tx_dbuplink" );
  uplink=(char *)gtk_entry_get_text(GTK_ENTRY(widget));
  widget = lookup_widget( dialog_dbedit, "tx_dbdownlink" );
  downlink=(char *)gtk_entry_get_text(GTK_ENTRY(widget));
  widget = lookup_widget( dialog_dbedit, "tx_dbbeacon" );
  beacon=(char *)gtk_entry_get_text(GTK_ENTRY(widget));

  widget=lookup_widget( dialog_dbedit, "clist_satdb" );
  gtk_clist_set_text(GTK_CLIST(widget), selectedrow, 0, sat);
  gtk_clist_set_text(GTK_CLIST(widget), selectedrow, 1, mode);
  gtk_clist_set_text(GTK_CLIST(widget), selectedrow, 2, uplink);
  gtk_clist_set_text(GTK_CLIST(widget), selectedrow, 3, downlink);
  gtk_clist_set_text(GTK_CLIST(widget), selectedrow, 4, beacon);
  gtk_clist_unselect_row(GTK_CLIST(widget), selectedrow, 0);

  selectedrow=-1;

  widget = lookup_widget( dialog_dbedit, "tx_dbsat" );
  gtk_entry_set_text(GTK_ENTRY(widget), "");
  widget = lookup_widget( dialog_dbedit, "tx_dbmode" );
  gtk_entry_set_text(GTK_ENTRY(widget), "");
  widget = lookup_widget( dialog_dbedit, "tx_dbuplink" );
  gtk_entry_set_text(GTK_ENTRY(widget), "");
  widget = lookup_widget( dialog_dbedit, "tx_dbdownlink" );
  gtk_entry_set_text(GTK_ENTRY(widget), "");
  widget = lookup_widget( dialog_dbedit, "tx_dbbeacon" );
  gtk_entry_set_text(GTK_ENTRY(widget), "");

  save_sat_db();
}
Exemple #23
0
static void
editlist_gui_handle_cmd (GtkWidget * igad)
{
	int row;
	const char *reply;

	row = gtkutil_clist_selection (editlist_gui_list);
	if (row != -1)
	{
		reply = gtk_entry_get_text (GTK_ENTRY (igad));
		gtk_clist_set_text (GTK_CLIST (editlist_gui_list), row, 1, reply);
	}
}
Exemple #24
0
static void
editlist_gui_handle_name (GtkWidget * igad)
{
	int row;
	const char *ctcp;

	row = gtkutil_clist_selection (editlist_gui_list);
	if (row != -1)
	{
		ctcp = gtk_entry_get_text (GTK_ENTRY (igad));
		gtk_clist_set_text (GTK_CLIST (editlist_gui_list), row, 0, ctcp);
	}
}
gint gw_categories_edit_box_update_category ( GtkWindow *w) {
	GWCatalogPlugin *plugin = NULL;
	GWDBContext *context = gw_am_get_current_catalog_context ( );
	GWDBCategory *category = NULL;
	GtkCList *list = NULL;
	gchar *text_utf8 = NULL;
	gint result = -1;


#ifdef GW_DEBUG_GUI_COMPONENT
		g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
#endif

	if ( w != NULL && context != NULL ) {
		if ( (category = gw_categories_edit_box_get_category ( w)) != NULL ) {
			if ( (list = gtk_object_get_data ( GTK_OBJECT ( w), GW_REF_CATEGORIES_EDIT_BOX_CATEGORIES_LIST)) != NULL ) {
				if ( list->selection != NULL ) {
					plugin = (GWCatalogPlugin*)gw_db_context_get_plugin ( context);
					gw_db_category_set_name ( category, gw_categories_edit_box_get_category_name ( w));
					gw_db_category_set_description ( category, gw_categories_edit_box_get_category_description ( w));

					plugin->gw_db_category_update ( context, category);

					g_strdup_to_gtk_text ( gw_db_category_get_name ( category), text_utf8);
					gtk_clist_set_text ( list, (gint)(list->selection->data), 0, text_utf8);
					g_free ( text_utf8);
					g_strdup_to_gtk_text ( gw_db_category_get_description ( category), text_utf8);
					gtk_clist_set_text ( list, (gint)(list->selection->data), 1, text_utf8);
					g_free ( text_utf8);

					result = 0;
				}
			}
		}
	}

	return result;
}
Exemple #26
0
void update_back_end_server(advertised_service *a, back_end_server *be){
   GList *l;
   gint i;
   gchar *s_text[3];

   extern GtkWidget *back_end_server_clist;

   for(l=a->back_end_servers,i=0;l;l=l->next,i++){
      if(l->data==be){
         gchar s_weight[32];

         g_snprintf(s_weight, sizeof(s_weight), "%i", be->weight);
         s_text[0] = be->address;
         s_text[1] = be->port;
         s_text[2] = s_weight;
         gtk_clist_freeze(GTK_CLIST(back_end_server_clist));
         gtk_clist_set_text(GTK_CLIST(back_end_server_clist),i,0,s_text[0]);
         gtk_clist_set_text(GTK_CLIST(back_end_server_clist),i,1,s_text[1]);
         gtk_clist_set_text(GTK_CLIST(back_end_server_clist),i,2,s_text[2]);
         gtk_clist_thaw(GTK_CLIST(back_end_server_clist));
      }
   }
}
Exemple #27
0
void
on_rule_name_changed (GtkEditable * editable, gpointer UNUSED(user_data))
{
    rule *r;

    r = (rule *)
	gtk_clist_get_row_data (GTK_CLIST
	(lookup_widget (GTK_WIDGET (editable), "clist1")), rule_row_current);
    free (r->name);
    r->name = g_strdup (gtk_editable_get_chars (editable, 0, -1));
    gtk_clist_set_text (GTK_CLIST
	(lookup_widget (GTK_WIDGET (editable), "clist1")),
	rule_row_current, 0, r->name);
}
Exemple #28
0
void mmio_window_update( mmio_window_t mmio )
{
    int i,j, count = 0;
    GtkCList *page, *all_page;
    char data[10], bits[40];

    all_page = GTK_CLIST(gtk_object_get_data( GTK_OBJECT(mmio->window), "All" ));

    for( i=0; i < num_io_rgns; i++ ) {
        page = GTK_CLIST(gtk_object_get_data( GTK_OBJECT(mmio->window),
                io_rgn[i]->id ));
        for( j=0; io_rgn[i]->ports[j].id != NULL; j++ ) {
            if( *io_rgn[i]->ports[j].val !=
                *(uint32_t *)(io_rgn[i]->save_mem+io_rgn[i]->ports[j].offset)){
                int sz = io_rgn[i]->ports[j].width;
                /* Changed */
                printhex( data, sz, *io_rgn[i]->ports[j].val );
                printbits( bits, sz, *io_rgn[i]->ports[j].val );

                gtk_clist_set_text( page, j, 2, data );
                gtk_clist_set_text( page, j, 3, bits );
                gtk_clist_set_foreground( page, j, &gui_colour_changed );

                gtk_clist_set_text( all_page, count, 2, data );
                gtk_clist_set_text( all_page, count, 3, bits );
                gtk_clist_set_foreground( all_page, count, &gui_colour_changed );

            } else {
                gtk_clist_set_foreground( page, j, &gui_colour_normal );
                gtk_clist_set_foreground( all_page, count, &gui_colour_normal );
            }
            count++;
        }
        memcpy( io_rgn[i]->save_mem, io_rgn[i]->mem, LXDREAM_PAGE_SIZE );
    }
}
Exemple #29
0
/**
 * Called when a row of the upload stats should be updated
 */
void
upload_stats_gui_update_model(struct ul_stats *us)
{
	GtkCList *clist = clist_ul_stats();
	enum c_us i;
	int row;

	row = ul_stats_get_row(us);
	g_return_if_fail(row >= 0);

	for (i = 0; i < c_us_num; i++) {
		const char *text = NULL;
		char tmpstr[16];

		switch (i) {
		case c_us_filename:
		case c_us_size:
			/* Never updated, only initialized */
			continue;
		case c_us_attempts:
			text = uint64_to_string(us->attempts);
			break;
		case c_us_complete:
			text = uint64_to_string(us->complete);
			break;
		case c_us_norm:
			gm_snprintf(tmpstr, sizeof tmpstr, "%.3f", us->norm);
			text = tmpstr;
			break;
		case c_us_rtime:
			text = us->rtime ? timestamp_to_string(us->rtime) : "";
			break;
		case c_us_dtime:
			text = us->dtime ? timestamp_to_string(us->dtime) : "";
			break;
		case c_us_num:
			text = NULL;
			g_assert_not_reached();
		}
		gtk_clist_set_text(clist, row, i, text);
	}

	/* FIXME: use auto-sort? */
	if (0 == clist->freeze_count) {
		gtk_clist_sort(clist);
		clist_sync_rows(clist, on_clist_ul_stats_row_moved);
	}
}
Exemple #30
0
void update_ipvs_server(advertised_service *a, ipvs_server *ipvs){
   GList *l;
   gint i;
   gchar *s_text[3];

   extern GtkWidget *ipvs_server_clist;

   for(l=a->ipvs_servers,i=0;l;l=l->next,i++){
      if(l->data==ipvs){

         s_text[0] = ipvs->address;
         gtk_clist_freeze(GTK_CLIST(ipvs_server_clist));
         gtk_clist_set_text(GTK_CLIST(ipvs_server_clist),i,0,s_text[0]);
         gtk_clist_thaw(GTK_CLIST(ipvs_server_clist));
      }
   }
}