/* gtkcutlass-passphrasewindow - handle the passphrase entry window and * associated callbacks. * * 23/08/2004 - Finland (some hotel near the airport) */ #include gint audiothreshhold = 1000; GtkAdjustment *adjust; void run_threshhold_dialog ( void ) { GtkWidget * dialog; GtkWidget *Main; GtkWidget *scale; GtkWidget *hbox; extern gui_status *currentstatus; Main = glade_xml_get_widget ( currentstatus->MainWinXML, "GTKCutlassMainWin" ); dialog = gtk_message_dialog_new ( GTK_WINDOW( Main ), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK, "Adujust Audio threshhold" ); adjust = GTK_ADJUSTMENT( gtk_adjustment_new( 1000.0, 0.0, 3000.0, 1.0, 100.0, 500.0 ) ); scale = gtk_hscale_new ( adjust ); // scale = gtk_hscale_new_with_range(0,3000,1); // gtk_entry_set_visibility ( GTK_ENTRY( scale ), FALSE ); gtk_widget_show ( scale ); g_signal_connect ( scale, "value_changed", G_CALLBACK( on_slider_changed ), dialog ); hbox = gtk_hbox_new ( FALSE, 0 ); gtk_widget_show ( hbox ); gtk_box_pack_start ( GTK_BOX( hbox ), GTK_WIDGET( scale ), TRUE, TRUE, 4 ); gtk_box_pack_start ( GTK_BOX( GTK_DIALOG( dialog ) ->vbox ), hbox, FALSE, TRUE, 4 ); gtk_dialog_run ( GTK_DIALOG( dialog ) ); gtk_widget_destroy ( dialog ); } void on_audiothreshhold_cancel_button_activate ( GtkWidget *widget, gpointer user_data ) { gtk_widget_destroy ( gtk_widget_get_toplevel( widget ) ); } void on_slider_changed( GtkWidget *widget, gpointer user_data ) { extern user_info * userstuff; if ( cutlass_audio_set_threshold ( userstuff->cutlass_info, gtk_adjustment_get_value( adjust ) ) == -1 ) g_warning ( "couldn't set audio_threshhold" ); }