Beispiel #1
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;

}		
Beispiel #2
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) );
}
Beispiel #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;

}		
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;
}
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 );
}
Beispiel #6
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));
}
Beispiel #7
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) );
}
Beispiel #8
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) );
}
static void __verboser(const char *stuff, int opos, int replacelast, int complete)
{
	char *s2[2];
	struct timeval tv;
	int ms;
	s2[0] = (char *)stuff;
	s2[1] = NULL;
	gtk_clist_freeze(GTK_CLIST(verb));
	if (replacelast) 
		gtk_clist_remove(GTK_CLIST(verb), GTK_CLIST(verb)->rows - 1);
	gtk_clist_append(GTK_CLIST(verb), s2);
	if (!ast_tvzero(last)) {
		gdk_threads_leave();
		gettimeofday(&tv, NULL);
		if (cleanupid > -1)
			gtk_timeout_remove(cleanupid);
		ms = ast_tvdiff_ms(tv, last);
		if (ms < 100) {
			/* We just got a message within 100ms, so just schedule an update
			   in the near future */
			cleanupid = gtk_timeout_add(200, cleanup, NULL);
		} else {
			cleanup(&cleanupid);
		}
		last = tv;
	} else {
		gettimeofday(&last, NULL);
	}
}
Beispiel #10
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);
}
Beispiel #11
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 );
}
Beispiel #12
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);
     }
}
Beispiel #14
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 );
}
Beispiel #15
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) );
}
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);
}
Beispiel #17
0
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;
}
Beispiel #18
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);
}
Beispiel #19
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));
}
Beispiel #20
0
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);
}
Beispiel #21
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) );
}
Beispiel #22
0
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));
}
Beispiel #23
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));
      }
   }
}
Beispiel #24
0
/* 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( );
}
Beispiel #25
0
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));
}
Beispiel #26
0
/** Does the equivalent of what refresh_selected used to do;
 *  looks at each file in a site and rebuilds the tree accordingly.
 */
void rebuild_node_files(GtkCTreeNode * site_node)
{
    /* Get rid of all the files first */
    while (GTK_CTREE_ROW(site_node)->children) {
	gtk_ctree_remove_node(GTK_CTREE(the_tree),
		     GTK_CTREE_NODE(GTK_CTREE_ROW(site_node)->children));
    }
    NE_DEBUG(DEBUG_GNOME, "Removed all children, freezing CTree...\n");
    gtk_clist_freeze(GTK_CLIST(the_tree));
    populate_site_node(site_node, selected_site);
    gtk_clist_thaw(GTK_CLIST(the_tree));
    NE_DEBUG(DEBUG_GNOME, "Repopulation complete, CTree thawed.\n");
}
Beispiel #27
0
/* 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) );
	}
}
Beispiel #28
0
/*
 *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));

}
Beispiel #29
0
void
update_list(void)
{
  GList *pt;
  struct logentry *le;
  char tmp[8][128];
  gchar *pp[8];
  int  ontime,h,m,s,i;
  int lc;

  gtk_clist_freeze(GTK_CLIST(loglist));
  gtk_clist_clear(GTK_CLIST(loglist));

  for(i=0;i<8;i++)
    pp[i]=tmp[i];

  for(lc=0,pt=log;pt!=NULL;pt=g_list_next(pt),lc++) {
    le=(struct logentry *)(pt->data);
    strcpy(tmp[0],ctime(&(le->start)));
    strcpy(tmp[1],ctime(&(le->end)));
    ontime=(int)(le->end - le->start);
    h=ontime/3600;
    ontime-=3600*h;
    m=ontime/60;
    ontime-=60*m;
    s=ontime;
    sprintf(tmp[2],"%.4d:%.2d:%.2d",h,m,s);
    switch(le->status) {
    case 0:
      strcpy(tmp[3],"OK");
      break;
    case 1:
      strcpy(tmp[3],"Error");
      break;
    default:
      strcpy(tmp[3],"Crash");
    }
    strcpy(tmp[4],le->shortname);
    strcpy(tmp[5],le->longname);
    strcpy(tmp[6],le->phone);
    strcpy(tmp[7],le->user);

    gtk_clist_append(GTK_CLIST(loglist),pp);
    gtk_clist_set_pixtext(GTK_CLIST(loglist),lc,3,
			  tmp[3],6,
			  iconmap[le->status%3],
			  maskmap[le->status%3]);
  }

  gtk_clist_thaw(GTK_CLIST(loglist));
}
Beispiel #30
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);
}