示例#1
0
static GtkWidget*
get_grid (MuMsg *msg)
{
	GtkWidget *grid;
	int row;

	row = 0;
	grid = gtk_grid_new (); /* 5 2 */

	gtk_grid_insert_column (GTK_GRID(grid), 0);
	gtk_grid_insert_column (GTK_GRID(grid), 1);

	if (add_row (grid, row, "From", mu_msg_get_from (msg), TRUE))
		++row;
	if (add_row (grid, row, "To", mu_msg_get_to (msg), FALSE))
		++row;
	if (add_row (grid, row, "Cc", mu_msg_get_cc (msg), FALSE))
		++row;
	if (add_row (grid, row, "Subject", mu_msg_get_subject (msg), TRUE))
		++row;
	if (add_row (grid, row, "Date", mu_date_str_s
			  ("%c", mu_msg_get_date (msg)),TRUE))
		++row;

	return grid;
}
示例#2
0
void tbrowse::reload_file_table(twindow& window, int cursel)
{
	tlistbox* list = find_widget<tlistbox>(&window, "default", false, true);
	list->clear();

	int size = int(dirs_in_current_dir_.size() + files_in_current_dir_.size());
	for (std::set<tfile>::const_iterator it = dirs_in_current_dir_.begin(); it != dirs_in_current_dir_.end(); ++ it) {
		const tfile& file = *it;
		add_row(window, *list, file.name, true);

	}
	for (std::set<tfile>::const_iterator it = files_in_current_dir_.begin(); it != files_in_current_dir_.end(); ++ it) {
		const tfile& file = *it;
		add_row(window, *list, file.name, false);
	}
	if (size) {
		if (cursel >= size) {
			cursel = size - 1;
		}
		list->select_row(cursel);
	}

	item_selected(window, *list, twidget::drag_none);

	// window.invalidate_layout();
	list->invalidate_layout(true);
}
Gtk::Widget *WebDavSyncServiceAddin::create_preferences_control(EventHandler requiredPrefChanged)
{
  Gtk::Table *table = new Gtk::Table(3, 2, false);
  table->set_row_spacings(5);
  table->set_col_spacings(10);

  // Read settings out of gconf
  Glib::ustring url, username, password;
  get_config_settings(url, username, password);

  m_url_entry = new Gtk::Entry();
  m_url_entry->set_text(url);
  m_url_entry->signal_changed().connect(requiredPrefChanged);
  add_row(table, m_url_entry, _("_URL:"), 0);

  m_username_entry = new Gtk::Entry();
  m_username_entry->set_text(username);
  m_username_entry->signal_changed().connect(requiredPrefChanged);
  add_row(table, m_username_entry, _("User_name:"), 1);

  m_password_entry = new Gtk::Entry();
  m_password_entry->set_text(password);
  m_password_entry->set_visibility(false);
  m_password_entry->signal_changed().connect(requiredPrefChanged);
  add_row(table, m_password_entry, _("_Password:"), 2);

  table->set_hexpand(true);
  table->set_vexpand(false);
  table->show_all();
  return table;
}
示例#4
0
MainView::MainView(QWidget* parent) : QWidget(parent) {
    QVBoxLayout* vbox = new QVBoxLayout(this);
    QHBoxLayout* hbox = new QHBoxLayout();

    actions_label = new QLabel("Actions: ", this);

    done_button = new QPushButton("Done", this);
    delete_button = new QPushButton("Delete", this);

    hbox->addWidget(actions_label, 0, Qt::AlignLeft);
    hbox->addWidget(done_button, 0, Qt::AlignLeft);
    hbox->addWidget(delete_button, 1, Qt::AlignLeft);

    QStringList headers;
    headers << "ID" << "Project" << "Priority" << "Age" << "Description";

    table = new QTableWidget(this);
    table->setColumnCount(5);
    table->horizontalHeader()->setStretchLastSection(true);
    table->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    table->setHorizontalHeaderLabels(headers);

    add_row(table, "2", "appart", "H", "1mo", "Caca1");
    add_row(table, "1", "books", "M", "1d", "Caca2");
    add_row(table, "3", "appart", "L", "1w", "Caca3");
    
    vbox->addLayout(hbox);
    vbox->addWidget(table);
}
示例#5
0
GtkWidget *
get_table (MuMsg *msg)
{
	GtkWidget *table;
	int row;
	
	row = 0;

	table = gtk_table_new (5, 2, FALSE);
	
	if (add_row (table, row, "From", mu_msg_get_from (msg), TRUE))
		++row;
	if (add_row (table, row, "To", mu_msg_get_to (msg), FALSE))
		++row;
	if (add_row (table, row, "Cc", mu_msg_get_cc (msg), FALSE))
		++row;
	if (add_row (table, row, "Subject", mu_msg_get_subject (msg), TRUE))
		++row;
	if (add_row (table, row, "Date", mu_date_str_s
			  ("%c", mu_msg_get_date (msg)),TRUE))
		++row;

	gtk_table_resize (GTK_TABLE(table), row, 2);

	return table;
}
static void
add_table_rows (GnomeTwoPasswordDialog *password_dialog)
{
	int row;
	GtkWidget *table;
	int offset;

	if (password_dialog->details->anon_support_on) {
		offset = 12;
	}
	else {
		offset = 0;
	}

	gtk_alignment_set_padding (GTK_ALIGNMENT (password_dialog->details->table_alignment),
				   0, 0, offset, 0);

	table = password_dialog->details->table;
	/* This will not kill the entries, since they are ref:ed */
	gtk_container_foreach (GTK_CONTAINER (table),
			       (GtkCallback)remove_child, table);
	
	row = 0;
	if (password_dialog->details->show_username)
		add_row (table, row++, _("_Username:"******"_Domain:"), password_dialog->details->domain_entry);
	if (password_dialog->details->show_password)
		add_row (table, row++, _("_Password:"), password_dialog->details->password_entry);
	if (password_dialog->details->show_password_secondary)
		add_row (table, row++, password_dialog->details->secondary_password_label, 
			 password_dialog->details->password_entry_secondary);

	gtk_widget_show_all (table);
}
示例#7
0
文件: dmdcc.c 项目: Dmilo/freewpc
void
gen_two_line (void)
{
	init_effect ("two_line");
	push_row_area ();
		add_row (16);
			alloc_label ("SPECIAL");
		add_row (16);
			alloc_label ("WHEN LIT");
	pop_area ();
	current_effect->duration = 2000;
	finish_effect ();
}
static void
add_trash_temp (CcPrivacyPanel *self)
{
  GtkWidget *w;
  GtkWidget *dialog;

  w = get_on_off_label2 (self->priv->privacy_settings, REMOVE_OLD_TRASH_FILES, REMOVE_OLD_TEMP_FILES);
  add_row (self, _("Purge Trash & Temporary Files"), "trash_dialog", w);

  dialog = self->priv->trash_dialog;
  g_signal_connect (dialog, "delete-event",
                    G_CALLBACK (gtk_widget_hide_on_delete), NULL);

  w = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "purge_trash_switch"));
  g_settings_bind (self->priv->privacy_settings, REMOVE_OLD_TRASH_FILES,
                   w, "active",
                   G_SETTINGS_BIND_DEFAULT);

  w = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "purge_temp_switch"));
  g_settings_bind (self->priv->privacy_settings, REMOVE_OLD_TEMP_FILES,
                   w, "active",
                   G_SETTINGS_BIND_DEFAULT);

  w = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "purge_after_combo"));

  set_purge_after_value_for_combo (GTK_COMBO_BOX (w), self);
  g_signal_connect (w, "changed",
                    G_CALLBACK (purge_after_combo_changed_cb), self);

  w = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "empty_trash_button"));
  g_signal_connect_swapped (w, "clicked", G_CALLBACK (empty_trash), self);

  w = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "purge_temp_button"));
  g_signal_connect_swapped (w, "clicked", G_CALLBACK (purge_temp), self);
}
filter_expr_editor::filter_expr_editor(QWidget* parent): QDialog(parent)
{
  setWindowTitle(tr("Filter expression editor"));
  QVBoxLayout* top_layout = new QVBoxLayout(this);
  QGridLayout* gl = new QGridLayout;
  top_layout->addLayout(gl);
  
  int row=0;
  int col=0;
  gl->addWidget(new QLabel(tr("Negate")), row, col++);
  gl->addWidget(new QLabel(tr("Argument")), row, col++);
  gl->addWidget(new QLabel(tr("Operator")), row, col++);
  gl->addWidget(new QLabel(tr("Operand")), row, col++);

  add_row(gl, ++row);

  QHBoxLayout* btns = new QHBoxLayout;
  top_layout->addLayout(btns);
  top_layout->addStretch(1);
  QPushButton* b1 = new QPushButton(tr("OK"));
  connect(b1, SIGNAL(clicked()), this, SLOT(accept()));
  QPushButton* b2 = new QPushButton(tr("Cancel"));
  connect(b2, SIGNAL(clicked()), this, SLOT(reject()));
  btns->addStretch(1);
  btns->addWidget(b1);
  btns->addWidget(b2);    
  btns->addStretch(1);

}
示例#10
0
 void Graph::set_row_style(int row, const char* color, const char* line, const char* marker)
 {
   if(!rows.size()) add_row(NULL);
   rows[row].color  = color;
   rows[row].line   = line;
   rows[row].marker = marker;
 }
示例#11
0
文件: list.cpp 项目: Wedge009/wesnoth
void list_view::append_rows(const std::vector<string_map>& items)
{
	for(const string_map & item : items)
	{
		add_row(item);
	}
}
示例#12
0
void
RemoteHandler::
getFileList(){

	string f_list;
	
	DIR* dirp = opendir(curr_dir.c_str());
	struct dirent *dp;	
    while ((dp = readdir(dirp)) != NULL){	
		struct stat buf;
		lstat(dp->d_name, &buf);
		string fname(dp->d_name);
		if (fname != ".")
			add_row(fname, &buf, f_list);	
	}
	f_list += "\n";
	//cout << f_list;
	int cmd_fd = c_node.command_fd;
	IOStream* ioStream;
	try{
		ioStream->writen(cmd_fd, f_list.c_str(), f_list.length());
	}
	catch(IOStream::IOException){
		cerr << "IOException! Get File List Error!\n" << flush;
		return;
	}
	return;
}
示例#13
0
文件: containers.cpp 项目: uwssg/APS
void array_2d<T>::set(int ir, int ic, T val){
    
    if(ir<0){
        printf("tried to set to negative row\n");
	die(ir,ic);
    }
    
    if(ic<0 || ic>=cols){
        printf("dying from set\n");
        die(ir,ic);
    }
    
    if(cols<=0){
        printf("\nYou cannot use set(int,int) on a 2d array if cols are zero\n");
        die(ir,ic);
    }
    
    if(data==NULL){ 
        printf("dying from set\n");
        die(ir,ic);
    }
    
    int i;
    array_1d<T> vector;
    if(ir>=rows){
        for(i=0;i<cols;i++)vector.set(i,0);
	while(rows<=ir)add_row(vector);
	
    }

    data[ir].set(ic,val);
    
    
    
}
示例#14
0
文件: graph.cpp 项目: regmi/hermes2d
void Graph::add_values(int row, double x, double y)
{
  if (!rows.size()) add_row(NULL);
  if (row < 0 || row >= rows.size()) error("Invalid row number.");
  Values xy = { x, y };
  rows[row].data.push_back(xy);
}
示例#15
0
文件: list.cpp 项目: Wedge009/wesnoth
void list_view::add_row(const string_map& item, const int index)
{
	std::map<std::string, string_map> data;

	data.insert(std::make_pair("", item));
	add_row(data, index);
}
示例#16
0
文件: containers.cpp 项目: uwssg/APS
void array_2d<T>::set_row(int dex, array_1d<T> &in){

    if(dex<0){
        printf("tried to set to negative row\n");
	die(dex,0);
    }
    
    if(data==NULL && row_room>0){
        printf("dying from set_row\n");
        die(0,0);
    }
    
    if(data==NULL && rows>0){
         printf("dying from set_row\n");
        die(1,0);
    }
    
    if(data==NULL && cols>0){
         printf("dying from set_row\n");
        die(2,0);
    }
    
    if(row_room<rows){   
        printf("dying from set_row\n");
        die(3,0);
    }
    
    if((cols<=0 || row_room<=0) && data!=NULL){
         printf("dying from set_row\n");
        die(4,0);
    }
    
    if(cols>0 && cols!=in.get_dim()){
         printf("dying from set_row\n");
        printf("columns do not match\n");
        die(-2,0);
    }
    
    if(dex<0){
         printf("dying from set_row\n");
        die(dex,0);
    }
    
    int i;
    if(dex>=rows){
        for(i=rows;i<dex+1;i++)add_row(in);
    }
    else{
        for(i=0;i<cols;i++){
	    try{
	        data[dex].set(i,in.get_data(i));
	    }
	    catch(int ifail){
	        die(dex,cols);
	    }
	}
    }
    
}
示例#17
0
 void Graph::add_values(double x, double y)
 {
   int row = 0;
   if(!rows.size()) add_row(NULL);
   if(fabs(x) < 1e-12 ) return;  // this is to avoid problems with plotting in log-log scale
   // (sometimes the CPU time was zero and plotting crashed)
   Values xy = { x, y };
   rows[row].data.push_back(xy);
 }
static void
add_row_other (GtkWidget   *chooser,
               const gchar *type,
               const gchar *id)
{
  CcInputChooserPrivate *priv = GET_PRIVATE (chooser);
  LocaleInfo *info = g_hash_table_lookup (priv->locales, "");
  add_row (chooser, info, type, id);
}
示例#19
0
 void Graph::add_values(int row, double x, double y)
 {
   if(!rows.size()) add_row(NULL);
   if(fabs(x) < 1e-12) return;  // this is to avoid problems with plotting in log-log scale
   // (sometimes the CPU time was zero and plotting crashed)
   if(row < 0 || row >= (int)rows.size()) throw Hermes::Exceptions::Exception("Invalid row number.");
   Values xy = { x, y };
   rows[row].data.push_back(xy);
 }
示例#20
0
文件: graph.cpp 项目: LeiDai/hermes
 void Graph::add_values(double x, double y)
 {
   int row = 0;
   if (!rows.size()) add_row(nullptr);
   // this is to avoid problems with plotting in log-log scale
   if (fabs(x) < Hermes::HermesSqrtEpsilon) return;
   // (sometimes the CPU time was zero and plotting crashed)
   Values xy = { x, y };
   rows[row].data.push_back(xy);
 }
示例#21
0
文件: window.cpp 项目: ftk/XXLDDRace
window::window(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::window)
{
    ui->setupUi(this);

    friends_table = new table_model(this);

    ui->tableView->setModel(friends_table);
    ui->tableView->verticalHeader()->hide();
    ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);

    connect(ui->add, SIGNAL(clicked()), this, SLOT(add_row()));
    connect(ui->remove, SIGNAL(clicked()), this, SLOT(remove_rows()));
    connect(ui->close, SIGNAL(clicked()), this, SLOT(apply_settings()));

    manager = new QNetworkAccessManager(this);

    connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(readyRead(QNetworkReply*)));

    // define tray icon

    QAction * quit_action = new QAction(tr("&Quit"), this);
    connect(quit_action, SIGNAL(triggered()), qApp, SLOT(quit()));
    QAction * settings_action = new QAction(tr("&Settings"), this);
    connect(settings_action, SIGNAL(triggered()), this, SLOT(show()));

    QMenu * tray_menu = new QMenu(this);
    tray_menu->addAction(settings_action);
    tray_menu->addSeparator();
    tray_menu->addAction(quit_action);

    tray_icon = new QSystemTrayIcon(this);
    tray_icon->setContextMenu(tray_menu);

    connect(tray_icon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
    connect(tray_icon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));


    QIcon icon(":/images/teeworlds_1.png");
    tray_icon->setIcon(icon);
    setWindowIcon(icon);

    tray_icon->setToolTip("Teeworlds Notifier");

    tray_icon->show();

    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(mainloop()));
    //timer->start(update_interval * 1000);

    need_correction = 2;
    mainloop();
}
static void
add_grid_rows (VpnPasswordDialog *dialog)
{
	VpnPasswordDialogPrivate *priv = VPN_PASSWORD_DIALOG_GET_PRIVATE (dialog);
	int row;
	int offset = 0;

       gtk_alignment_set_padding (GTK_ALIGNMENT (priv->grid_alignment), 0, 0, offset, 0);

	/* This will not kill the entries, since they are ref:ed */
       gtk_container_foreach (GTK_CONTAINER (priv->grid), (GtkCallback) remove_child, priv->grid);
	
	row = 0;
	if (priv->show_password)
               add_row (priv->grid, row++, priv->primary_password_label, priv->password_entry);
	if (priv->show_password_secondary)
               add_row (priv->grid, row++, priv->secondary_password_label,  priv->password_entry_secondary);

       gtk_grid_attach (GTK_GRID (priv->grid), priv->show_passwords_checkbox, 1, row, 1, 1);

       gtk_widget_show_all (priv->grid);
}
示例#23
0
文件: containers.cpp 项目: uwssg/APS
void asymm_array_2d<T>::set(int ir, int ic, T val){
    
    array_1d<T> empty;
    int i;
 
    while(rows<=ir){
        add_row(empty);
    }
    
    
    data[ir].set(ic,val);

}
static void
add_location (CcPrivacyPanel *self)
{
  CcPrivacyPanelPrivate *priv = self->priv;
  GtkWidget *w;
  GtkWidget *dialog;

  priv->location_label = gtk_label_new ("");
  update_location_label (self);

  add_row (self,
           _("Location Services"),
           "location_dialog",
           priv->location_label);

  dialog = priv->location_dialog;
  g_signal_connect (dialog, "delete-event",
                    G_CALLBACK (gtk_widget_hide_on_delete), NULL);

  w = GTK_WIDGET (gtk_builder_get_object (priv->builder, "location_services_switch"));
  g_settings_bind (priv->location_settings, LOCATION_ENABLED,
                   w, "active",
                   G_SETTINGS_BIND_DEFAULT);

  priv->location_app_switches = g_hash_table_new_full (g_str_hash,
                                                       g_str_equal,
                                                       g_free,
                                                       g_object_unref);

  g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
                            G_DBUS_PROXY_FLAGS_NONE,
                            NULL,
                            "org.freedesktop.GeoClue2",
                            "/org/freedesktop/GeoClue2/Manager",
                            "org.freedesktop.GeoClue2.Manager",
                            priv->cancellable,
                            on_gclue_manager_ready,
                            self);

  g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
                            G_DBUS_PROXY_FLAGS_NONE,
                            NULL,
                            "org.freedesktop.impl.portal.PermissionStore",
                            "/org/freedesktop/impl/portal/PermissionStore",
                            "org.freedesktop.impl.portal.PermissionStore",
                            priv->cancellable,
                            on_perm_store_ready,
                            self);
}
示例#25
0
int main() {

	int nl,nc,npares;
	int i,j;
	int cindex, lindex;

	char* readline = NULL;
	char* finalWord = NULL;
	char* strtokRes = NULL;

	BOARD board;

	readline=rl_gets("Numero de Linhas e de Colunas> ");
	sscanf(readline,"%d %d",&nl,&nc);
	board = board_init(nl,nc);


	for(i = 0; i<nl; i++){
		readline=rl_gets("Linha> ");
		add_row(readline,i,board);
	}


	readline=rl_gets("Numero de Pares> ");
	sscanf(readline,"%d",&npares);

	finalWord = (char*) malloc(sizeof(char)*npares+1);

	readline=rl_gets("Coordenadas> ");

	strtokRes = strtok(readline," ");
	lindex = cindex = 0;
	for(i = 0,j=0;strtokRes && i<(npares*2);i++){
		if(i%2==1){
			cindex = atoi(strtokRes);
			finalWord[j]=board->board[lindex-1][cindex-1];
			j++;
		}
		else{
			lindex = atoi(strtokRes);
		}

		strtokRes=strtok(NULL," ");
	}
	finalWord[j]='\0';
	printf("%s\n",finalWord);
	return 0;
}
示例#26
0
文件: containers.cpp 项目: uwssg/APS
void asymm_array_2d<T>::set_row(int ir, const array_1d<T> &vv){
    
    int i;
    array_1d<T> empty;
    
    while(rows<=ir){
        add_row(empty);
    }
    
    data[ir].reset();
    for(i=0;i<vv.get_dim();i++){
        data[ir].set(i,vv.get_data(i));
    }
    

}
static void
add_abrt (CcPrivacyPanel *self)
{
  GtkWidget *w;
  GtkWidget *dialog;
  char *os_name, *url, *msg;

  w = get_abrt_label (self->priv->privacy_settings, REPORT_TECHNICAL_PROBLEMS);
  self->priv->abrt_row = add_row (self, _("Problem Reporting"), "abrt_dialog", w);
  gtk_widget_hide (self->priv->abrt_row);

  dialog = self->priv->abrt_dialog;
  g_signal_connect (dialog, "delete-event",
                    G_CALLBACK (gtk_widget_hide_on_delete), NULL);

  w = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "abrt_switch"));
  g_settings_bind (self->priv->privacy_settings, REPORT_TECHNICAL_PROBLEMS,
                   w, "active",
                   G_SETTINGS_BIND_DEFAULT);

  os_name = get_os_name ();
  /* translators: '%s' is the distributor's name, such as 'Fedora' */
  msg = g_strdup_printf (_("Sending reports of technical problems helps us improve %s. Reports are sent anonymously and are scrubbed of personal data."),
                         os_name);
  g_free (os_name);
  gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (self->priv->builder, "abrt_explanation_label")), msg);
  g_free (msg);

  url = get_privacy_policy_url ();
  if (!url)
    {
      g_debug ("Not watching for ABRT appearing, /etc/os-release lacks a privacy policy URL");
      return;
    }
  msg = g_strdup_printf ("<a href=\"%s\">%s</a>", url, _("Privacy Policy"));
  g_free (url);
  gtk_label_set_markup (GTK_LABEL (gtk_builder_get_object (self->priv->builder, "abrt_policy_linklabel")), msg);
  g_free (msg);

  self->priv->abrt_watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
                                                "org.freedesktop.problems.daemon",
                                                G_BUS_NAME_WATCHER_FLAGS_NONE,
                                                abrt_appeared_cb,
                                                abrt_vanished_cb,
                                                self,
                                                NULL);
}
示例#28
0
int		calc_connexes(t_graphe* graphe, t_ch_ch_int** conx)
{
  t_ch_ch_int	*ttmp;
  int		*visite;
  int		*names;
  int		count;

  count = 0;
  visite = get_visite(graphe->taille);
  names = get_numbers(graphe);
  *conx = xmalloc(sizeof(**conx));
  for (ttmp = graphe->graphe; ttmp != NULL; ttmp = ttmp->next)
    if (visite[get_index(ttmp->number, names, graphe->taille)] != 1)
      count += add_row(connex_of(graphe, ttmp->name, &visite, names), conx, compare_ens);
  free(names);
  free(visite);
  return (count);
}
示例#29
0
static int
update_model (GtkListStore * store, const char *xpath, const char *query,
	      MugMsgListView * self)
{
	MuMsgIter *iter;
	int count;

	iter = run_query (xpath, query, self);
	if (!iter) {
		g_warning ("error: running query failed\n");
		return -1;
	}

	for (count = 0; !mu_msg_iter_is_done (iter);
	     mu_msg_iter_next (iter), ++count)
		add_row (store, mu_msg_iter_get_msg_floating(iter)); /* don't unref */

	mu_msg_iter_destroy (iter);

	return count;
}
示例#30
0
static void
write_row_strings (char **strings, size_t len)
{
  if (!csv) {
    /* Text mode.  Because we want the columns to line up, we can't
     * output directly, but instead need to save up the rows and
     * output them at the end.
     */
    add_row (strings, len);
  }
  else {                    /* CSV mode: output it directly, quoted */
    size_t i;

    for (i = 0; i < len; ++i) {
      if (i > 0)
        putchar (',');
      if (strings[i] != NULL)
        write_csv_field (strings[i]);
    }
    putchar ('\n');
  }
}