Remove legacy pre-filechooser code.
authorAlexander Koenig <alex@lisas.de>
Sat, 15 Feb 2014 15:45:44 +0000 (16:45 +0100)
committerAlexander Koenig <alex@lisas.de>
Sat, 15 Feb 2014 15:45:44 +0000 (16:45 +0100)
configure.ac
src/tX_mastergui.cc
src/tX_vttgui.cc
src/tX_vttgui.h

index 64e7d708363932692fa8d2b3666bdfaab712bed4..097486f3bebc539ba0d89973953babd46a9a6d3e 100644 (file)
@@ -21,7 +21,6 @@ AC_ARG_ENABLE(libxml2,                [  --disable-libxml2       use libxml even if verion
 AC_ARG_ENABLE(mad,             [  --disable-mad           disable mad for mp3 support (default=auto) ])
 AC_ARG_ENABLE(vorbis,          [  --disable-vorbis        disable libvorbis support (default=auto) ])
 AC_ARG_ENABLE(audiofile,       [  --disable-audiofile     disable audiofile support (default=auto) ])
-AC_ARG_ENABLE(filechooser,     [  --disable-filechooser   disable gtk+ 2.4 filechooser (default=auto) ])
 AC_ARG_ENABLE(startup,         [  --disable-startup       disable startup-notification (default=auto) ])
 AC_ARG_ENABLE(legacy,          [  --enable-legacy         enable support for old terminatorX files (default=no) ])
 AC_ARG_ENABLE(alsamidi,                [  --disable-alsamidi      disable support  ALSA MIDI in (default=auto) ])
@@ -122,7 +121,7 @@ fi
 
 AC_SEARCH_LIBS([dlclose], [dl])
 
-dnl GTK+ search. Enable FileChooser for gtk+>=2.4
+dnl Check for GTK
 
 AM_PATH_GTK_2_0(, [
        GTK2_CFLAGS="$GTK_CFLAGS"
@@ -133,16 +132,6 @@ AM_PATH_GTK_2_0(, [
 OPTION_GTK_VERSION="Version 2 - ($GTK2_VERSION)"
 vers=`echo $GTK2_VERSION | awk 'BEGIN {FS=".";} { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
 
-if test "$enable_filechooser" != "no"; then
-       AC_MSG_CHECKING([whether to use the FileChooser])
-       if test "$vers" -ge 2004000; then
-               AC_MSG_RESULT([yes])
-               AC_DEFINE_UNQUOTED([USE_FILECHOOSER], 1, [Use the new FileChooser.])
-       else
-               AC_MSG_RESULT([no])
-       fi
-fi
-
 if test "$gtk2" = "no"; then
        AC_MSG_ERROR([** couldn't find gtk+ > Version 2. Please upgrade (http://www.gtk.org). **])
 fi
index ed92fe7f1eaa55fc0318811d7ba449661d3711bf..c1d38b03de8ebb1abd2ccbeaa4ed40738b542f08 100644 (file)
@@ -116,14 +116,6 @@ extern void add_vtt(GtkWidget *ctrl, GtkWidget *audio, char *fn);
 extern void destroy_gui(vtt_class *vtt);
 extern void gui_show_frame(vtt_class *vtt, int show);
 
-#ifndef USE_FILECHOOSER
-GdkWindow *save_dialog_win=NULL;
-GdkWindow *load_dialog_win=NULL;
-
-GtkWidget *save_dialog=NULL;
-GtkWidget *load_dialog=NULL;
-#endif
-
 GdkWindow *rec_dialog_win=NULL;
 GtkWidget *rec_dialog=NULL;
 
@@ -294,16 +286,6 @@ GCallback new_tables() {
 }
 
 /* Loading saved setups */
-#ifndef USE_FILECHOOSER
-GCallback cancel_load_tables(GtkWidget *wid)
-{
-       gtk_widget_destroy(load_dialog);
-       load_dialog=NULL;
-       load_dialog_win=NULL;
-       return(0);
-}
-#endif
-
 void load_tt_part(char * buffer)
 {
        char wbuf[PATH_MAX];
@@ -378,27 +360,8 @@ void load_tt_part(char * buffer)
        gtk_window_set_title(GTK_WINDOW(main_window), wbuf);            
 }
 
-#ifndef USE_FILECHOOSER
-void do_load_tables(GtkWidget *wid)
-{
-       char buffer[PATH_MAX];
-       
-       strcpy(buffer, gtk_file_selection_get_filename(GTK_FILE_SELECTION(load_dialog)));
-       
-       gtk_widget_destroy(load_dialog);
-       
-       load_dialog=NULL;
-       load_dialog_win=NULL;
-
-       tX_cursor::set_cursor(tX_cursor::WAIT_CURSOR);
-       load_tt_part(buffer);
-       tX_cursor::reset_cursor();
-}
-#endif
-
 GCallback load_tables()
 {
-#ifdef USE_FILECHOOSER 
        GtkWidget * dialog = gtk_file_chooser_dialog_new ("Open Set File",
                GTK_WINDOW(main_window), GTK_FILE_CHOOSER_ACTION_OPEN,
                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,  
@@ -429,30 +392,6 @@ GCallback load_tables()
        }       
        
        gtk_widget_destroy(dialog);
-#else
-       if (load_dialog_win) {
-               gdk_window_raise(load_dialog_win);
-               return 0;
-       }
-
-       load_dialog=gtk_file_selection_new("Load Set"); 
-       
-       gtk_file_selection_show_fileop_buttons(GTK_FILE_SELECTION(load_dialog));
-       gtk_file_selection_complete(GTK_FILE_SELECTION(load_dialog), "*.tX");
-       
-       if (strlen(globals.tables_filename)) {
-               gtk_file_selection_set_filename(GTK_FILE_SELECTION(load_dialog), globals.tables_filename);
-       }
-       
-       gtk_widget_show(load_dialog);
-       
-       load_dialog_win=load_dialog->window;
-       
-       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(load_dialog)->ok_button), "clicked", G_CALLBACK(do_load_tables), NULL);
-       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(load_dialog)->cancel_button), "clicked", G_CALLBACK (cancel_load_tables), NULL);  
-       g_signal_connect (G_OBJECT(load_dialog), "delete-event", G_CALLBACK(cancel_load_tables), NULL); 
-       
-#endif
 
        return NULL;
 }
@@ -554,39 +493,6 @@ GCallback drop_set(GtkWidget *widget, GdkDragContext *context,
 }
 
 /* save tables */
-
-#ifndef USE_FILECHOOSER
-GCallback cancel_save_tables(GtkWidget *wid)
-{
-       gtk_widget_destroy(save_dialog);
-       save_dialog=NULL;
-       save_dialog_win=NULL;
-       return(0);
-}
-
-gboolean do_save_from_selection(GtkWidget *wid) {
-       char buffer[PATH_MAX];
-       
-       if (wid) {
-               strcpy(buffer, gtk_file_selection_get_filename(GTK_FILE_SELECTION(save_dialog)));
-               int len=strlen(buffer);
-               if (!len || (buffer[len-1]=='/')) {                     
-                       tx_note("Invalid filename for set file.", true);                        
-                       return FALSE;
-               }
-               gtk_widget_destroy(save_dialog);
-               save_dialog=NULL;
-               save_dialog_win=NULL;
-       } else {
-               strcpy(buffer, tx_mg_current_setname);
-       }       
-       
-       do_save_tables(buffer);
-       
-       return TRUE;
-}
-#endif
-
 void do_save_tables(char *buffer)
 {
        FILE *out;
@@ -629,7 +535,6 @@ void do_save_tables(char *buffer)
 
 GCallback save_tables_as()
 {
-#ifdef USE_FILECHOOSER
        GtkWidget * dialog = gtk_file_chooser_dialog_new ("Save Set",
                GTK_WINDOW(main_window), GTK_FILE_CHOOSER_ACTION_SAVE, 
                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, 
@@ -648,27 +553,7 @@ GCallback save_tables_as()
        }       
        
        gtk_widget_destroy(dialog);     
-#else
-       if (save_dialog_win) {
-               gtk_widget_destroy(save_dialog);
-               save_dialog=NULL;
-               save_dialog_win=NULL;
-       }
-       
-       save_dialog=gtk_file_selection_new("Save Set"); 
 
-       if (tx_mg_have_setname) {
-               gtk_file_selection_set_filename(GTK_FILE_SELECTION(save_dialog), tx_mg_current_setname);
-       }
-       
-       gtk_widget_show(save_dialog);
-       
-       save_dialog_win=save_dialog->window;
-       
-       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(save_dialog)->ok_button), "clicked", G_CALLBACK(do_save_from_selection), NULL);
-       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(save_dialog)->cancel_button), "clicked", G_CALLBACK (cancel_save_tables), NULL);  
-       g_signal_connect (G_OBJECT(save_dialog), "delete-event", G_CALLBACK(cancel_save_tables), NULL); 
-#endif
        return NULL;
 }
 
@@ -808,7 +693,6 @@ void do_rec(GtkWidget *wid)
 
 GCallback select_rec_file()
 {
-#ifdef USE_FILECHOOSER
        GtkWidget * dialog = gtk_file_chooser_dialog_new ("Record To Disk",
                GTK_WINDOW(main_window), GTK_FILE_CHOOSER_ACTION_SAVE, 
                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, 
@@ -832,28 +716,6 @@ GCallback select_rec_file()
        rec_dont_care = 0;
        
        gtk_widget_destroy(dialog);
-       
-#else  
-       if (rec_dialog_win) {
-               gdk_window_raise(rec_dialog_win);
-               return 0;
-       }
-       
-       rec_dialog=gtk_file_selection_new("Record To Disk");    
-       
-       if (strlen(globals.record_filename)) {
-               gtk_file_selection_set_filename(GTK_FILE_SELECTION(rec_dialog), globals.record_filename);
-       }
-       
-       gtk_widget_show(rec_dialog);
-       
-       rec_dialog_win=rec_dialog->window;
-       
-       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(rec_dialog)->ok_button), "clicked", G_CALLBACK(do_rec), NULL);
-       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(rec_dialog)->cancel_button), "clicked", G_CALLBACK (cancel_rec), NULL);   
-       g_signal_connect (G_OBJECT(rec_dialog), "delete-event", G_CALLBACK(cancel_rec), NULL);  
-       
-#endif
 
        return NULL;
 }
index 73e540f18214a4040bc123fccf8dc5d5d351a27d..d5eb9d87dde0e91c503fc8db5554a7b77abd4122 100644 (file)
@@ -99,7 +99,6 @@ void pitch_changed(GtkWidget *wid, vtt_class *vtt)
        vtt->sp_pitch.receive_gui_value(gtk_adjustment_get_value(GTK_ADJUSTMENT(wid)));
 }
 
-#ifdef USE_FILECHOOSER
 GCallback chooser_prelis(GtkWidget *w)
 {
        GtkFileChooser *fc=GTK_FILE_CHOOSER(gtk_widget_get_toplevel(w));
@@ -113,30 +112,6 @@ GCallback chooser_prelis(GtkWidget *w)
        }
        return NULL;
 }
-#else
-GCallback trigger_prelis(GtkWidget *w)
-{
-       GtkFileSelection *fs;
-
-       fs=GTK_FILE_SELECTION(gtk_widget_get_toplevel(w));
-       
-       prelis_start((char *) gtk_file_selection_get_filename(GTK_FILE_SELECTION(fs)));
-       return NULL;
-}
-
-void cancel_load_file(GtkWidget *wid, vtt_class *vtt)
-{
-       prelis_stop();
-       
-       vtt->gui.file_dialog=NULL;
-       if (vtt->gui.fs) gtk_widget_destroy(GTK_WIDGET(vtt->gui.fs));
-}
-
-int quit_load_file(GtkWidget *wid, vtt_class *vtt)
-{
-       return 1;
-}
-#endif
 
 char global_filename_buffer[PATH_MAX];
 
@@ -215,24 +190,6 @@ void load_part(char *newfile, vtt_class *vtt)
        }       
 }
 
-#ifndef USE_FILECHOOSER
-void do_load_file(GtkWidget *wid, vtt_class *vtt)
-{
-       char newfile[PATH_MAX];
-       
-       prelis_stop();
-
-       strcpy(newfile, gtk_file_selection_get_filename(GTK_FILE_SELECTION(vtt->gui.fs)));
-       gtk_widget_destroy(GTK_WIDGET(vtt->gui.fs));
-       vtt->gui.file_dialog=NULL;
-       
-       tX_cursor::set_cursor(tX_cursor::WAIT_CURSOR);
-       load_part(newfile, vtt);
-       strcpy(globals.current_path, newfile);
-       tX_cursor::reset_cursor();
-}
-#endif
-
 void drop_file(GtkWidget *widget, GdkDragContext *context,
                gint x, gint y, GtkSelectionData *selection_data,
                guint info, guint time, vtt_class *vtt)
@@ -265,8 +222,7 @@ void drop_file(GtkWidget *widget, GdkDragContext *context,
 }
 
 GCallback load_file(GtkWidget *wid, vtt_class *vtt)
-{      
-#ifdef USE_FILECHOOSER
+{
        const char *extensions[]={ "mp3", "wav", "ogg", "flac", "iff", "aiff", "voc", "au", "spx", NULL };
        char name_buf[512];
        sprintf(name_buf, "Select Audio File for %s", vtt->name);
@@ -315,31 +271,7 @@ GCallback load_file(GtkWidget *wid, vtt_class *vtt)
        
        prelis_stop();
        gtk_widget_destroy(dialog);     
-#else
-       char buffer[512];
-       
-       if (vtt->gui.file_dialog) {
-               gdk_window_raise(vtt->gui.file_dialog);
-               return(0);
-       }
-       
-       sprintf(buffer, "Select Audio File for %s", vtt->name);
-       vtt->gui.fs=gtk_file_selection_new(buffer);
-       
-       if (vtt->audiofile) {
-               gtk_file_selection_set_filename(GTK_FILE_SELECTION(vtt->gui.fs), vtt->filename);        
-       } else if (strlen(globals.current_path)>0 ) {
-               gtk_file_selection_set_filename(GTK_FILE_SELECTION(vtt->gui.fs),globals.current_path);
-       }
-       
-       gtk_widget_show(GTK_WIDGET(vtt->gui.fs));       
-       vtt->gui.file_dialog=vtt->gui.fs->window;
-       
-       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->ok_button), "clicked", G_CALLBACK(do_load_file), vtt);
-       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->cancel_button), "clicked", G_CALLBACK (cancel_load_file), vtt);     
-       g_signal_connect (G_OBJECT(vtt->gui.fs), "delete-event", G_CALLBACK(quit_load_file), vtt);      
-       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->file_list), "cursor_changed", G_CALLBACK(trigger_prelis), vtt->gui.fs);             
-#endif 
+
        return NULL;
 }
 
@@ -1162,9 +1094,6 @@ void build_vtt_gui(vtt_class *vtt)
        gtk_box_pack_start(GTK_BOX(tempbox2), g->flash, WID_FIX);
        gtk_widget_show(g->flash);              
 
-#ifndef USE_FILECHOOSER
-       g->file_dialog=NULL;
-#endif
        gui_connect_signals(vtt);
        
        g->audio_minimized_panel_bar_button=NULL;
index a91f293fa4ccae39d12837d3c6e3682a8e14d18d..937e8cb2fbb8d7a0c1a7c49657baa7374a1861e4 100644 (file)
@@ -98,11 +98,6 @@ struct vtt_gui
        GtkAdjustment *ec_pan;
        GtkAdjustment *ec_volume;
 
-#ifndef USE_FILECHOOSER        
-       GdkWindow *file_dialog;
-       GtkWidget *fs;
-#endif 
-       
        int32_t current_gui;
 
        /* Audio Box Widgets */