rem: Log(NOTICE, "-d -- download all movies from the camcorder"); Log(NOTICE, "-f -- clear camera's movie partition (erase all movies)"); Log(NOTICE, "-h -- print this help info");
add: Log(NOTICE, " -d, --download   Download all movies from the camcorder"); Log(NOTICE, " -f, --format     Clear camera's movie partition (erase all movies)"); Log(NOTICE, " -h, --help       Print this help info");
context: int main (int argc, char *argv[]) {  /* GtkWidget is the storage type for widgets */    GtkWidget * vbox1, *hbox2, *hbox3, *hbox4, *hbox5, *hbox1, *hbox_progressbar, *hbox_tree, *hbox_label;  GtkWidget* window;  GtkWidget* s_w;  GtkTreeViewColumn *col;  GtkCellRenderer *renderer;  GtkObject* hadjustment, *vadjustment;  //GError* error = NULL;  //camcorder_files_size = 0;  Log(DEBUGGING, "Starting threading...");  g_thread_init(NULL);  gdk_threads_init();  Log(DEBUGGING, "Threading started");  root_directory = NULL;  set_bitrate(0);  /* This is called in all GTK applications. Arguments are parsed   * from the command line and are returned to the application. */  Log(DEBUGGING, "Starting gtk...");  gtk_init (&argc, &argv);  toggle_camera_lcd_screen_is_on = TRUE;   // Handle the command line args  process_args(argc,argv);    if (do_help) {    Log(NOTICE, "flags:");    Log(NOTICE, "-d -- download all movies from the camcorder");    Log(NOTICE, "-f -- clear camera's movie partition (erase all movies)");    Log(NOTICE, "-h -- print this help info");    Log(NOTICE, "Flags may be combined to get a combined effect");    exit(0);  } else if (do_download || do_format) {    int ret=0;        if (open_camcorder(NULL,NULL,NULL)) {      if (unlock_camcorder(NULL,NULL,NULL)) {        if (do_download) {	  DownloadAllMovies(".");	  ret=1;	}        if (do_format && !format_camcorder(NULL,NULL,NULL)) ret=1;      }      else ret=1;      close_camcorder(NULL,NULL,NULL);    }    else ret=1;        exit(ret);  }      /* create a new window */  main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);  window = main_window;  gtk_window_set_title (GTK_WINDOW (window), "Ops for linux");  Log(DEBUGGING, "main window created");    /* When the window is given the "delete_event" signal (this is given     * by the window manager, usually by the "close" option, or on the     * titlebar), we ask it to call the delete_event () function     * as defined above. The data passed to the callback     * function is NULL and is ignored in the callback function. */  gtk_signal_connect (GTK_OBJECT (window), "delete_event",GTK_SIGNAL_FUNC(delete_event), NULL);    /* Here we connect the "destroy" event to a signal handler.       * This event occurs when we call gtk_widget_destroy() on the window,     * or if we return FALSE in the "delete_event" callback. */  gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (destroy), NULL);  vbox1 = gtk_vbox_new (FALSE, 0);  hbox2 = gtk_hbox_new (FALSE, 0);  hbox3 = gtk_hbox_new (FALSE, 0);  hbox4 = gtk_hbox_new (FALSE, 0);  hbox5 = gtk_hbox_new (FALSE, 0);  hbox1 = gtk_hbox_new (FALSE, 0);  hbox_tree = gtk_hbox_new(FALSE,0);  hbox_label = gtk_hbox_new(FALSE, 0);  hbox_progressbar = gtk_hbox_new (FALSE, 0);      gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0);  gtk_box_pack_start (GTK_BOX (vbox1), hbox2, TRUE, TRUE, 0);  gtk_box_pack_start (GTK_BOX (vbox1), hbox3, TRUE, TRUE, 0);  gtk_box_pack_start (GTK_BOX (vbox1), hbox4, TRUE, TRUE, 0);  gtk_box_pack_start (GTK_BOX (vbox1), hbox5, TRUE, TRUE, 0);  gtk_box_pack_start (GTK_BOX (vbox1), hbox_tree, TRUE, TRUE, 0);  gtk_box_pack_start (GTK_BOX (vbox1), hbox_label, TRUE, TRUE, 0);  gtk_box_pack_start (GTK_BOX (vbox1), hbox_progressbar, TRUE, TRUE, 0);  gtk_container_add (GTK_CONTAINER (window), vbox1);    hadjustment = gtk_adjustment_new(0,-1,1,.1,.5,1);  vadjustment = gtk_adjustment_new(0,-1,1,.1,.5,1);    m_directory_tree = gtk_tree_view_new();  //  m_directory_model = NULL;  gtk_widget_set_size_request (m_directory_tree,			       300,			       300);  s_w = gtk_scrolled_window_new(GTK_ADJUSTMENT(hadjustment), 				GTK_ADJUSTMENT(vadjustment));  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(s_w),				  GTK_POLICY_AUTOMATIC,				  GTK_POLICY_AUTOMATIC);  //  gtk_container_set_height (GTK_TREE_VIEW (m_directory_tree), 300);  //ICON COLUMN  col = gtk_tree_view_column_new();  gtk_tree_view_append_column(GTK_TREE_VIEW(m_directory_tree), col);  renderer = gtk_cell_renderer_pixbuf_new();  gtk_tree_view_column_pack_start(col, renderer, FALSE);  gtk_tree_view_column_add_attribute(col, renderer, "pixbuf", COL_ICON);  //COLUMN 1  col = gtk_tree_view_column_new();  gtk_tree_view_column_set_title(col, "filename");  gtk_tree_view_append_column(GTK_TREE_VIEW(m_directory_tree), col);  renderer = gtk_cell_renderer_text_new();  gtk_tree_view_column_pack_start(col, renderer, TRUE);  gtk_tree_view_column_add_attribute(col, renderer, "text", COL_FILENAME);  //COLUMN 2  col = gtk_tree_view_column_new();  gtk_tree_view_append_column(GTK_TREE_VIEW(m_directory_tree), col);  renderer = gtk_cell_renderer_text_new();  gtk_tree_view_column_pack_start(col, renderer, TRUE);    //  gtk_tree_view_column_add_attribute(col, renderer, "text", COL_POINTER);  /*if (!g_thread_create(watch_progress_bar, NULL, FALSE, &error)) {    Log(error->message);    //go without if error    }*/    load_file_icons();  information_label = gtk_label_new("");  bitrate_label = gtk_label_new("");  m_ctl_progress = gtk_progress_bar_new();  create_and_display_button_short(open_camcorder, "Open Camcorder", hbox1);  create_and_display_button_short(unlock_camcorder, "Unlock", hbox1);  create_and_display_button_short(close_camcorder, "Close Camcorder", hbox1);  create_and_display_button_short(download_all_movies, "Download All Movies", hbox2);  create_and_display_button_short(download_last_movie, "Download Last Movie", hbox2);  create_and_display_button_short(update_directory_listing, "Update Directory Listing", hbox5);  create_and_display_button_short(download_file, "Download file", hbox2);  create_and_display_button_short(upload_file, "Upload file", hbox2);  create_and_display_button_short(delete_file, "Delete File", hbox2);  create_and_display_button_short(format_camcorder, "Format Storage", hbox2);  create_and_display_button_short(send_monitor_command, "Send Monitor Command", hbox3);  create_and_display_button_short(change_camera_settings, "Camera settings", hbox4);  create_and_display_button_short(toggle_camera_lcd_screen, "Toggle camera lcd screen", hbox3);  create_and_display_button_short(download_memory, "Download memory", hbox3);  create_and_display_button_short(powerdown_camcorder, "Powerdown camcorder", hbox3);  create_and_display_button_short(download_flash,"Download flash", hbox3);  create_and_display_button_short(enable_mass_storage, "Enable Mass Storage", hbox4);  create_and_display_button_short(get_clock, "Get Clock value", hbox4);  create_and_display_button_short(set_clock, "Set Clock value", hbox4);  create_and_display_button_short(capture_video, "Capture Video", hbox3);  //  debug_buttons();#ifndef DEBUG    EnableControls(FALSE);  EnableOpenButton();#endif  gtk_signal_connect (GTK_OBJECT (m_directory_tree), "cursor-changed", /* "row-activated",*/		      GTK_SIGNAL_FUNC(reset_label), NULL);  gtk_box_pack_start (GTK_BOX (hbox_tree), s_w, TRUE, TRUE, 0);  gtk_box_pack_start (GTK_BOX (hbox_label), information_label, TRUE, TRUE, 0);  gtk_box_pack_start (GTK_BOX (hbox_label), bitrate_label, TRUE, TRUE, 0);  gtk_box_pack_start (GTK_BOX (hbox_progressbar), m_ctl_progress, TRUE, TRUE, 0);    gtk_container_add (GTK_CONTAINER (s_w), GTK_WIDGET(m_directory_tree));  gtk_widget_show_all (window);  gtk_timeout_add(REFRESH_DATA_MS,(GtkFunction)watch_progress_bar, NULL);  #ifndef DEBUG  //open camcorder by default  open_camcorder(NULL,NULL,NULL);  //unlock by default (as of sep 28, no camcorder is permanently unlocked)  unlock_camcorder(NULL,NULL,NULL);#endif  gdk_threads_enter();  gtk_main ();  gdk_threads_leave();  return 0;}