示例#1
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) );
}
示例#2
0
文件: main_menu.c 项目: xaizek/vide
static void
goto_bookmark (GtkWidget * menu_item, gchar *value)
{
	GList *tmp;
	gint i;
	gchar *file;

	for(tmp = cfg.bookmarks; tmp != NULL; tmp = tmp->next)
	{
		Bookmarks *bk = tmp->data;
		if(!strcmp(value, bk->mark))
		{
			change_dir(curr_view, bk->dir);
			gtk_clist_freeze(GTK_CLIST(curr_view->clist));
			for(i = 0; i < GTK_CLIST(curr_view->clist)->rows; i++)
			{
				gtk_clist_get_text(GTK_CLIST(curr_view->clist), i, 0, &file);

				if(!strcmp(bk->file, file))
				{
					focus_on_row(curr_view, i);
					gtk_clist_thaw(GTK_CLIST(curr_view->clist));
					return;
				}
			}
			focus_on_row(curr_view, 0);
			gtk_clist_thaw(GTK_CLIST(curr_view->clist));
			return;
		}
	}
	status_bar_message("Mark not found");
	return;
}
示例#3
0
static void rebuildLists()
{
	short 	i, c;
	gchar* 	txt[2];

	gUpdateFlag=TRUE;	
	
	gtk_clist_freeze(GTK_CLIST(gSrcList));
	gtk_clist_freeze(GTK_CLIST(gAppList));
	gtk_clist_freeze(GTK_CLIST(gDstList));
	
	gtk_clist_clear(GTK_CLIST(gSrcList));
	gtk_clist_clear(GTK_CLIST(gAppList));
	gtk_clist_clear(GTK_CLIST(gDstList));
	
	c = MidiCountAppls();
	for (i=1; i <= c; i++) {
		txt[0] = g_strdup_printf("%d", MidiGetIndAppl(i));
		txt[1] = MidiGetName(MidiGetIndAppl(i));
		gtk_clist_append(GTK_CLIST(gSrcList), txt);
		gtk_clist_append(GTK_CLIST(gAppList), txt);
		gtk_clist_append(GTK_CLIST(gDstList), txt);
	}
	
	gtk_clist_thaw(GTK_CLIST(gSrcList));
	gtk_clist_thaw(GTK_CLIST(gAppList));
	gtk_clist_thaw(GTK_CLIST(gDstList));

	gUpdateFlag=FALSE;

}		
示例#4
0
static void refreshLists()
{
	short r, i, c, a;
	
	r = row2ref(gCurRow);		// application number which lines are displayed
	if (r < 0) r = 0;
	
	gUpdateFlag=TRUE;
	
	gtk_clist_freeze(GTK_CLIST(gSrcList));
	gtk_clist_freeze(GTK_CLIST(gAppList));
	gtk_clist_freeze(GTK_CLIST(gDstList));
	
	gtk_clist_unselect_all(GTK_CLIST(gAppList));
	gtk_clist_unselect_all(GTK_CLIST(gSrcList));
	gtk_clist_unselect_all(GTK_CLIST(gDstList));
	
	for (i=0, c=MidiCountAppls(); i < c; i++) {
		a = row2ref(i);
		if (a == r)			gtk_clist_select_row (GTK_CLIST(gAppList), i, 0);
		if (MidiIsConnected(a, r))	gtk_clist_select_row (GTK_CLIST(gSrcList), i, 0);
		if (MidiIsConnected(r, a)) 	gtk_clist_select_row (GTK_CLIST(gDstList), i, 0);
	}
	
	gtk_clist_thaw(GTK_CLIST(gSrcList));
	gtk_clist_thaw(GTK_CLIST(gAppList));
	gtk_clist_thaw(GTK_CLIST(gDstList));
		
	gUpdateFlag=FALSE;

}		
gint gw_plugin_settings_quick_search_pane_load ( GtkWidget *pane)
{
    gint result = -1;
    GtkCList *list_visible = NULL;
    GtkCList *list_hidden = NULL;
    GtkCList *list = NULL;
    GWSettingsExplorerField **fields;
    gint i;


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

    if ( pane != NULL )
    {
        list_visible = GTK_CLIST ( gtk_object_get_data ( GTK_OBJECT ( pane), GW_PLUGIN_SETTINGS_QUICK_SEARCH_LIST_VISIBLE));
        list_hidden = GTK_CLIST ( gtk_object_get_data ( GTK_OBJECT ( pane), GW_PLUGIN_SETTINGS_QUICK_SEARCH_LIST_HIDDEN));

        if ( (list_visible != NULL) && (list_hidden != NULL) )
        {
            if ( (fields = gw_plugin_settings_search_get_all_fields ( )) != NULL )
            {
                gtk_object_set_data_full ( GTK_OBJECT ( pane), GW_PLUGIN_SETTINGS_QUICK_SEARCH_FIELDS_TABLE, fields, (GtkDestroyNotify) gw_settings_explorer_field_freev);

                gtk_clist_freeze ( list_visible);
                gtk_clist_freeze ( list_hidden);

                for ( i = 0; fields[i] != NULL; i++)
                {
#ifdef GW_DEBUG_PLUGIN_SETTINGS_COMPONENT
                    g_print ( "*** GW - %s (%d) :: %s() : adding the field %s to the list visible/hidden\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, fields[i]->name);
#endif

                    if ( fields[i]->visible == TRUE )
                    {
                        list = list_visible;
                    }
                    else
                    {
                        list = list_hidden;
                    }

                    gtk_clist_append ( list, &fields[i]->name);
                }

                gtk_clist_thaw ( list_visible);
                gtk_clist_thaw ( list_hidden);
            }

#ifdef GW_DEBUG_PLUGIN_SETTINGS_COMPONENT
            g_print ( "*** GW - %s (%d) :: %s() : all fields are loaded.\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);
#endif
        }

        result = 0;
    }

    return result;
}
示例#6
0
void DownloadUI::UpdateDownloadList(void)
{
    if (!m_List || !isVisible)
        return;

    gtk_clist_freeze(GTK_CLIST(m_List));
    gtk_clist_clear(GTK_CLIST(m_List));

    uint32 iLoop = downloadList.size();

    if (iLoop == 0) {
        gtk_clist_thaw(GTK_CLIST(m_List));
        return;
    }

    for (uint32 i = 0; i < iLoop; i++) {
        DownloadItem *dli = downloadList[i];
        char *iText[2];

        string displayString = dli->GetMetaData().Title();

        iText[0] = (char *)displayString.c_str();  
        iText[1] = (char *)StatusString(dli).c_str();

        int row = gtk_clist_append(GTK_CLIST(m_List), iText);
        gtk_clist_set_row_data(GTK_CLIST(m_List), row, (gpointer)dli);
    }

    gtk_clist_select_row(GTK_CLIST(m_List), m_currentindex, 0);
    SelChangeEvent(m_currentindex);
    gtk_clist_thaw(GTK_CLIST(m_List));
}
示例#7
0
static void imp_ldif_update_row( GtkCList *clist ) {
	Ldif_FieldRec *rec;
	gchar *text[ FIELDS_N_COLS ];
	gint row;

	if( impldif_dlg.rowIndSelect < 0 ) return;
	row = impldif_dlg.rowIndSelect;

	rec = gtk_clist_get_row_data( clist, row );
	text[ FIELD_COL_SELECT ] = "";
	text[ FIELD_COL_FIELD  ] = rec->tagName;
	text[ FIELD_COL_ATTRIB ] = rec->userName;

	gtk_clist_freeze( clist );
	gtk_clist_remove( clist, row );
	if( row == impldif_dlg.rowCount - 1 ) {
		gtk_clist_append( clist, text );
	}
	else {
		gtk_clist_insert( clist, row, text );
	}
	if( rec->selected )
		gtk_clist_set_pixmap( clist, row, FIELD_COL_SELECT, markxpm, markxpmmask );

	gtk_clist_set_row_data( clist, row, rec );
	gtk_clist_thaw( clist );
}
示例#8
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));
}
示例#9
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) );
}
示例#10
0
static void RefreshEventList( void )
{
	int i;
	char buf[128];

	// Clear events list
	gtk_clist_freeze( GTK_CLIST(g_pEventsList) );
	gtk_clist_clear( GTK_CLIST(g_pEventsList) );

	if( GetCurrentCam() ) {
		// Fill events list
		for( i = 0; i < GetCurrentCam()->GetCam()->numEvents(); i++ ) {
			char rowbuf[3][128], *row[3];
			// FIXME: sort by time?
			sprintf( rowbuf[0], "%li", GetCurrentCam()->GetCam()->getEvent(i)->getTime() );                 row[0] = rowbuf[0];
			strncpy( rowbuf[1], GetCurrentCam()->GetCam()->getEvent(i)->typeStr(), sizeof(rowbuf[0]) );     row[1] = rowbuf[1];
			strncpy( rowbuf[2], GetCurrentCam()->GetCam()->getEvent(i)->getParam(), sizeof(rowbuf[1]) );    row[2] = rowbuf[2];
			gtk_clist_append( GTK_CLIST(g_pEventsList), row );
		}

		// Total duration might have changed
		sprintf( buf, "%.2f", GetCurrentCam()->GetCam()->getTotalTime() );
		gtk_label_set_text( g_pCurrentTime, "0.00" );
		gtk_label_set_text( g_pTotalTime, buf );

		gtk_adjustment_set_value( g_pTimeLine, 0.f );
		g_pTimeLine->upper = ( GetCurrentCam()->GetCam()->getTotalTime() * 1000 );
	}

	gtk_clist_thaw( GTK_CLIST(g_pEventsList) );
}
示例#11
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);
}
示例#12
0
void ShowPlayList( void )
{
 if ( PlayList ) gtkActive( PlayList );
  else PlayList=create_PlayList();

 if ( old_path && *old_path )
  {
   char         * currentdir = strdup( old_path );
   char         * tpath,* pos;
   GtkCTreeNode * node,* nextnode;
   gboolean       leaf;
   tpath=strdup( "/" );
   pos=strtok( currentdir,"/" );
   node=gtk_ctree_find_by_row_data_custom( GTK_CTREE( CTDirTree ),NULL,"/",compare_func );
   do
    {
     char * tpathnew = g_strconcat( tpath,pos,"/",NULL );
     free( tpath ); tpath=tpathnew;
     nextnode=gtk_ctree_find_by_row_data_custom( GTK_CTREE( CTDirTree ),node,tpath,compare_func );
     if ( !nextnode ) break;
     node=nextnode;
     pos=strtok( NULL,"/" );
     gtk_ctree_get_node_info( GTK_CTREE( CTDirTree ),node,NULL,NULL,NULL,NULL,NULL,NULL,&leaf,NULL );
     if ( !leaf && pos ) gtk_ctree_expand( GTK_CTREE( CTDirTree ),node );
      else
       {
        DirNodeType * DirNode;
        gtk_ctree_select( GTK_CTREE( CTDirTree ),node );
	DirNode=gtk_ctree_node_get_row_data( GTK_CTREE( CTDirTree ),node );
	current_path=DirNode->path;
        scan_dir( DirNode->path );
        if ( CLFileSelected ) free( CLFileSelected ); CLFileSelected=calloc( 1,NrOfEntrys * sizeof( int ) );
	break;
       }
    } while( pos );
   free( tpath );
   free( currentdir );
  }
  else gtk_ctree_select( GTK_CTREE( CTDirTree ),parent );

 gtk_clist_freeze( GTK_CLIST( CLSelected ) );
 gtk_clist_clear( GTK_CLIST( CLSelected ) );
 if ( plList )
  {
   plItem * next = plList;
   while ( next || next->next )
    {
     char * text[1][3]; text[0][2]="";
     text[0][0]=next->name;
     text[0][1]=next->path;
     gtk_clist_append( GTK_CLIST( CLSelected ),text[0] );
     NrOfSelected++;
     if ( next->next ) next=next->next; else break;
    }
   CLListSelected=calloc( 1,NrOfSelected * sizeof( int ) );
  }
 gtk_clist_thaw( GTK_CLIST( CLSelected ) );

 gtk_widget_show( PlayList );
}
示例#13
0
static void
update_display( GtkCList *clist, libspectrum_word base )
{
    size_t i, j;

    gchar buffer[ 8 + 64 + 20 ];
    gchar *text[] = { &buffer[0], &buffer[ 8 ], &buffer[ 8 + 64 ] };
    char buffer2[ 8 ];

    gtk_clist_freeze( clist );
    gtk_clist_clear( clist );

    for( i = 0; i < 20; i++ ) {
        snprintf( text[0], 8, "%04X", base );

        text[1][0] = '\0';
        for( j = 0; j < 0x10; j++, base++ ) {

            libspectrum_byte b = readbyte_internal( base );

            snprintf( buffer2, 4, "%02X ", b );
            strncat( text[1], buffer2, 4 );

            text[2][j] = ( b >= 32 && b < 127 ) ? b : '.';
        }
        text[2][ 0x10 ] = '\0';

        gtk_clist_append( clist, text );
    }

    gtk_clist_thaw( clist );
}
static void server_browse_entry_expand(GqBrowserNode *e,
				       int error_context,
				       GQTreeWidget *ctree, GQTreeWidgetNode *node,
				       GqTab *tab)
{
     GList *suffixes = NULL, *next;
     GqBrowserNodeServer *entry;

     g_assert(GQ_IS_BROWSER_NODE_SERVER(e));
     entry = GQ_BROWSER_NODE_SERVER(e);

     if (!entry->once_expanded) {
/*	  printf("expanding %s\n", entry->server->name); */

	  gq_tree_remove_children (ctree, node);
	  entry->once_expanded = 1;

	  suffixes = get_suffixes(error_context, entry->server);

	  gtk_clist_freeze(GTK_CLIST(ctree));

	  for (next = suffixes ; next ; next = g_list_next(next) ) {
	       add_suffix(entry, ctree, node, next->data);
	       g_free(next->data);
	       next->data = NULL;
	  }

	  gtk_clist_thaw(GTK_CLIST(ctree));

	  g_list_free(suffixes);
     }
}
示例#15
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 );
}
示例#16
0
/**
 * Display the data gathered during the last time period.
 * Perhaps it would be better to have this done on a button click(?)
 */
static void
search_stats_gui_update_display(void)
{
    GtkWidget *clist_search_stats;
    GtkWidget *label_search_stats_count;

    clist_search_stats = gui_main_window_lookup("clist_search_stats");
    label_search_stats_count =
        gui_main_window_lookup("label_search_stats_count");

	stat_count = 0;
	gtk_clist_freeze(GTK_CLIST(clist_search_stats));

	gtk_clist_clear(GTK_CLIST(clist_search_stats));
	/* insert the hash table contents into the sorted clist */
	g_hash_table_foreach_remove(stat_hash, stats_hash_to_clist, NULL);
	gtk_clist_sort(GTK_CLIST(clist_search_stats));

	gtk_clist_thaw(GTK_CLIST(clist_search_stats));

	/* update the counter */
	gtk_label_printf(GTK_LABEL(label_search_stats_count),
		NG_("%u term counted", "%u terms counted", stat_count),
		stat_count);
}
static void
glade_keys_dialog_init (GladeKeysDialog       *dialog)
{
  GtkWidget *scrolled_win;
  int i, row;
  gchar *titles[1];

  gtk_window_set_title (GTK_WINDOW (dialog), _("Select Accelerator Key"));
  gtk_window_set_wmclass (GTK_WINDOW (dialog), "accelerator_key", "Glade");

  titles[0] = _("Keys");
  dialog->clist = gtk_clist_new_with_titles (1, titles);
  gtk_clist_column_titles_passive (GTK_CLIST (dialog->clist));
  gtk_widget_set_usize (dialog->clist, 200, 300);
  gtk_widget_show (dialog->clist);

  scrolled_win = gtk_scrolled_window_new (NULL, NULL);
  gtk_container_add (GTK_CONTAINER (scrolled_win), dialog->clist);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
				  GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), scrolled_win,
		      TRUE, TRUE, 0);
  gtk_widget_show (scrolled_win);

  /* Insert events & descriptions */
  gtk_clist_freeze (GTK_CLIST (dialog->clist));

  i = 0;
  while (GbKeys[i].name)
    {
      row = gtk_clist_append (GTK_CLIST (dialog->clist),
			      (gchar**) (&GbKeys[i].name));
      gtk_clist_set_row_data (GTK_CLIST (dialog->clist), row,
			      GINT_TO_POINTER (i));
      i++;
    }

  gtk_clist_thaw (GTK_CLIST (dialog->clist));

#ifdef USE_GNOME
  dialog->ok_button = gnome_stock_button (GNOME_STOCK_BUTTON_OK);
#else
  dialog->ok_button = gtk_button_new_with_label (_ ("OK"));
#endif
  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area),
		      dialog->ok_button, TRUE, TRUE, 0);
  GTK_WIDGET_SET_FLAGS (dialog->ok_button, GTK_CAN_DEFAULT);
  gtk_widget_grab_default (dialog->ok_button);
  gtk_widget_show (dialog->ok_button);

#ifdef USE_GNOME
  dialog->cancel_button = gnome_stock_button (GNOME_STOCK_BUTTON_CANCEL);
#else
  dialog->cancel_button = gtk_button_new_with_label (_("Cancel"));
#endif
  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area),
		      dialog->cancel_button, TRUE, TRUE, 0);
  GTK_WIDGET_SET_FLAGS (dialog->cancel_button, GTK_CAN_DEFAULT);
  gtk_widget_show (dialog->cancel_button);
}
示例#18
0
文件: menu-items.c 项目: GNOME/gftp
static void
update_window_listbox (gftp_window_data * wdata)
{
  GList * templist, * filelist;
  gftp_file * tempfle;
  int num;

  filelist = wdata->files;
  templist = gftp_gtk_get_list_selection (wdata);
  num = 0;
  while (templist != NULL)
    {
      templist = get_next_selection (templist, &filelist, &num);
      tempfle = filelist->data;
      tempfle->was_sel = 1;
    }

  gtk_clist_freeze (GTK_CLIST (wdata->listbox));
  gtk_clist_clear (GTK_CLIST (wdata->listbox));
  templist = wdata->files;
  while (templist != NULL)
    {
      tempfle = templist->data;
      add_file_listbox (wdata, tempfle);
      templist = templist->next;
    }
  gtk_clist_thaw (GTK_CLIST (wdata->listbox));
  update_window (wdata);
}
示例#19
0
文件: filelist.c 项目: Explorer09/fsv
/* 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) );
}
示例#20
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));
      }
   }
}
示例#21
0
文件: menu-items.c 项目: GNOME/gftp
void 
selectallfiles (gpointer data)
{
  gftp_window_data * wdata;
  gftp_file * tempfle;
  GList *templist;
  int i;

  wdata = data;
  wdata->show_selected = 0;
  gtk_clist_freeze (GTK_CLIST (wdata->listbox));
  i = 0;
  templist = wdata->files;
  while (templist != NULL)
    {
      tempfle = (gftp_file *) templist->data;
      if (tempfle->shown)
	{
	  if (S_ISDIR (tempfle->st_mode))
	    gtk_clist_unselect_row (GTK_CLIST (wdata->listbox), i, 0);
	  else
	    gtk_clist_select_row (GTK_CLIST (wdata->listbox), i, 0);
          i++;
	}
      templist = templist->next;
    }
  gtk_clist_thaw (GTK_CLIST (wdata->listbox));
}
示例#22
0
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) );
}
示例#23
0
文件: filelist.c 项目: Explorer09/fsv
/* Displays contents of a directory in the file list */
void
filelist_populate( GNode *dnode )
{
	GNode *node;
	GList *node_list = NULL, *node_llink;
	Icon *icon;
	int row, count = 0;
	char *empty_row[] = { NULL };
	char strbuf[64];

	g_assert( NODE_IS_DIR(dnode) );

        /* Get an alphabetized list of directory's immediate children */
	node = dnode->children;
	while (node != NULL) {
		G_LIST_PREPEND(node_list, node);
		node = node->next;
	}
	G_LIST_SORT(node_list, compare_node);

	/* Update file clist */
	gtk_clist_freeze( GTK_CLIST(file_clist_w) );
	gtk_clist_clear( GTK_CLIST(file_clist_w) );
	node_llink = node_list;
	while (node_llink != NULL) {
		node = (GNode *)node_llink->data;

		row = gtk_clist_append( GTK_CLIST(file_clist_w), empty_row );
		icon = &node_type_mini_icons[NODE_DESC(node)->type];
		gtk_clist_set_pixtext( GTK_CLIST(file_clist_w), row, 0, NODE_DESC(node)->name, 2, icon->pixmap, icon->mask );
		gtk_clist_set_row_data( GTK_CLIST(file_clist_w), row, node );

		++count;
		node_llink = node_llink->next;
	}
	gtk_clist_thaw( GTK_CLIST(file_clist_w) );

	g_list_free( node_list );

	/* Set node count message in the left statusbar */
	switch (count) {
		case 0:
		strcpy( strbuf, "" );
		break;

		case 1:
		strcpy( strbuf, _("1 node") );
		break;

		default:
		sprintf( strbuf, _("%d nodes"), count );
		break;
	}
	window_statusbar( SB_LEFT, strbuf );

	filelist_current_dnode = dnode;
	filelist_reset_access( );
}
示例#24
0
void
data_window_end(struct data_window *win)
{
#if 0
	if (win && win->treeview) {
		gtk_clist_thaw(GTK_CLIST(win->clist));
		gtk_clist_columns_autosize (GTK_CLIST(win->clist));
	}
#endif
}
static int cleanup(void *useless)
{
	gdk_threads_enter();
	gtk_clist_thaw(GTK_CLIST(verb));
	gtk_widget_queue_resize(verb->parent);
	gtk_clist_moveto(GTK_CLIST(verb), GTK_CLIST(verb)->rows - 1, 0, 0, 0);
	cleanupid = -1;
	gdk_threads_leave();
	return 0;
}
示例#26
0
文件: misc-gtk.c 项目: fangq/gftp
void
remove_files_window (gftp_window_data * wdata)
{
  wdata->show_selected = 0;
  gtk_clist_freeze (GTK_CLIST (wdata->listbox));
  gtk_clist_clear (GTK_CLIST (wdata->listbox));
  free_file_list (wdata->files);
  wdata->files = NULL;
  gtk_clist_thaw (GTK_CLIST (wdata->listbox));
}
示例#27
0
void
upload_stats_gui_thaw(void)
{
	GtkCList *clist = clist_ul_stats();

	g_return_if_fail(clist);
	gtk_clist_thaw(clist);
	if (0 == clist->freeze_count) {
		gtk_clist_sort(clist);
		clist_sync_rows(clist, on_clist_ul_stats_row_moved);
	}
}
示例#28
0
文件: dirtree.c 项目: Explorer09/fsv
/* Adds a new entry to the directory tree */
void
dirtree_entry_new( GNode *dnode )
{
	GtkCTreeNode *parent_ctnode = NULL;
	const char *name;
	boolean expanded;

	g_assert( NODE_IS_DIR(dnode) );

	parent_ctnode = DIR_NODE_DESC(dnode->parent)->ctnode;
	if (strlen( NODE_DESC(dnode)->name ) > 0)
		name = NODE_DESC(dnode)->name;
	else
		name = _("/. (root)");
	expanded = g_node_depth( dnode ) <= 2;

	DIR_NODE_DESC(dnode)->ctnode = gui_ctree_node_add( dir_ctree_w, parent_ctnode, dir_colexp_mini_icons, name, expanded, dnode );

	if (parent_ctnode == NULL) {
		/* First entry was just added. Keep directory tree frozen
		 * most of the time while scanning, otherwise it tends to
		 * flicker annoyingly */
		gtk_clist_freeze( GTK_CLIST(dir_ctree_w) );
	}
	else if (GTK_CTREE_ROW(parent_ctnode)->expanded) {
		/* Pre-update (allow ctree to register new row) */
		gtk_clist_thaw( GTK_CLIST(dir_ctree_w) );
		gui_update( );
		gtk_clist_freeze( GTK_CLIST(dir_ctree_w) );
		/* Select last row */
		gtk_ctree_select( GTK_CTREE(dir_ctree_w), DIR_NODE_DESC(dnode)->ctnode );
		/* Scroll directory tree down to last row */
		gui_clist_moveto_row( dir_ctree_w, -1, 0.0 );
		/* Post-update (allow ctree to perform select/scroll) */
		gtk_clist_thaw( GTK_CLIST(dir_ctree_w) );
		gui_update( );
		gtk_clist_freeze( GTK_CLIST(dir_ctree_w) );
	}
}
示例#29
0
文件: interface.c 项目: gabri94/olsrd
/*
 *Delete a node from the node list
 */
int
route_list_del(char *dest)
{
  int i = 0;
  char *ip;

  gtk_clist_freeze(GTK_CLIST(route_list));

  for (i = 0; i < route_list_size; i++) {
    gtk_clist_get_text(GTK_CLIST(route_list), i, 0, (gchar **) & ip);
    if (strcmp(dest, ip) == 0) {
      //printf("Found %d\n", i);
      gtk_clist_remove(GTK_CLIST(route_list), i);
      route_list_size--;
      gtk_clist_thaw(GTK_CLIST(route_list));
      return 1;
    }
  }

  gtk_clist_thaw(GTK_CLIST(route_list));
  return 0;
}
示例#30
0
文件: interface.c 项目: gabri94/olsrd
/*
 *Add a node to the node list
 */
void
route_list_add(char *dest, char *gw, char *metric, char *dev)
{
  gchar *tmp[4] = { dest, gw, dev, metric };
  route_list_size++;

  gtk_clist_freeze(GTK_CLIST(route_list));

  gtk_clist_append(GTK_CLIST(route_list), tmp);

  gtk_clist_thaw(GTK_CLIST(route_list));

}