Show
Ignore:
Timestamp:
01/08/09 22:42:50 (3 years ago)
Author:
ath
Message:

Some initial improvements to FmGui's Marlin widget.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/fm_gui/src/marlin-window-menu.c

    r268 r279  
    7878}; 
    7979 
    80 /* Command callback functions */ 
    81 /*static void 
    82 file_new (GtkAction *action, 
    83           gpointer data) 
    84 { 
    85         marlin_open_window (NULL, NULL, NULL, NULL); 
    86 }*/ 
    87  
    88 /*static void 
    89 file_new_dialog (GtkAction *action, 
    90                  gpointer data) 
    91 { 
    92         int rate, channels; 
    93  
    94         if (marlin_new_sample_dialog_run (MARLIN_BASE_WINDOW (data), 
    95                                           _("Create a new sample"), 
    96                                           _("Create Sample"),  
    97                                           &rate, &channels)) { 
    98                 marlin_open_window (NULL, NULL, NULL, NULL); 
    99         } 
    100 }*/ 
    101  
    102 /*static void 
    103 file_open (GtkAction *action, 
    104            gpointer data) 
    105 { 
    106         marlin_window_open (MARLIN_WINDOW (data)); 
    107 }*/ 
    108  
    109 /*static void 
    110 file_open_recent (GtkAction     *action, 
    111                   GtkRecentInfo *info, 
    112                   MarlinWindow  *window) 
    113 { 
    114         marlin_open_window (gtk_recent_info_get_uri (info), NULL, NULL, NULL); 
    115 }*/ 
    116  
    117 /*static void 
    118 file_save (GtkAction *action, 
    119            gpointer data) 
    120 { 
    121         MarlinWindow *window; 
    122  
    123         window = MARLIN_WINDOW (data); 
    124  
    125         marlin_window_save_sample (window); 
    126 }*/ 
    127  
    128 /*static void 
    129 file_save_as (GtkAction *action, 
    130               gpointer data) 
    131 { 
    132         marlin_window_save_sample_as (MARLIN_WINDOW (data)); 
    133 }*/ 
    134  
    135 /*static void 
    136 file_properties (GtkAction *action, 
    137                  gpointer data) 
    138 { 
    139         marlin_window_show_properties (MARLIN_WINDOW (data)); 
    140 }*/ 
    141  
    14280static void 
    14381file_close (GtkAction *action, 
     
    14785} 
    14886 
    149 /*static void G_GNUC_UNUSED 
    150 file_quit (GtkAction *action, 
    151            gpointer data) 
    152 { 
    153         marlin_quit (); 
    154 }*/ 
    15587 
    15688static void 
     
    16092        marlin_display_help (NULL); 
    16193} 
     94 
    16295 
    16396static void 
     
    296229 
    297230static void 
    298 media_record (GtkAction *action, 
    299               gpointer data) 
    300 { 
    301         /*static GtkWidget *dialog = NULL; 
    302  
    303         if (dialog == NULL) { 
    304                 dialog = marlin_record_new (GTK_WINDOW (data)); 
    305                 g_signal_connect (G_OBJECT (dialog), "destroy", 
    306                                   G_CALLBACK (gtk_widget_destroyed), &dialog); 
    307         } else { 
    308                 gdk_window_raise (dialog->window); 
    309                 gdk_window_show (dialog->window); 
    310         }*/ 
    311 } 
    312  
    313 static void 
    314231edit_history (GtkAction *action, 
    315232              gpointer data) 
     
    354271        marlin_window_mix (MARLIN_WINDOW (data)); 
    355272} 
    356  
    357 /*static void 
    358 edit_xfade (GtkAction *action, 
    359             gpointer data) 
    360 { 
    361         MarlinWindow *window = (MarlinWindow *) data; 
    362         MarlinSample *sample; 
    363         MarlinSampleSelection *selection; 
    364         MarlinCoverage coverage; 
    365  
    366         sample = marlin_base_window_get_sample (MARLIN_BASE_WINDOW (data)); 
    367         g_object_get (G_OBJECT (sample), 
    368                       "selection", &selection, 
    369                       NULL); 
    370  
    371         marlin_sample_selection_get (selection, &coverage, NULL, NULL); 
    372         g_object_unref (selection); 
    373  
    374         if (coverage == MARLIN_COVERAGE_NONE) { 
    375                 marlin_window_xfade (window); 
    376         } else { 
    377                 marlin_window_xfade_selection (window); 
    378         } 
    379 }*/ 
    380  
    381 /*static void 
    382 edit_paste_new (GtkAction *action, 
    383                 gpointer data) 
    384 { 
    385         MarlinProgram *program = marlin_program_get_default (); 
    386         MarlinSample *sample, *copy; 
    387         GError *error = NULL; 
    388  
    389         sample = MARLIN_SAMPLE (marlin_program_get_clipboard (program)); 
    390  
    391         // Copy sample  
    392         copy = marlin_sample_new_from_sample (sample, &error); 
    393         if (copy == NULL) { 
    394                 g_warning ("marlin_sample_new_from_sample failed"); 
    395                 return; 
    396         } 
    397  
    398         // Dirty the copy  
    399         g_object_set (G_OBJECT (copy), 
    400                       "dirty", TRUE, 
    401                       NULL); 
    402          
    403         marlin_open_window_with_sample (copy); 
    404 }*/ 
    405273 
    406274static void 
     
    631499}*/ 
    632500 
    633 /*static void 
    634 toolbar_editor_destroy_cb (GtkWidget *tbe, 
    635                            Toolbar *t) 
    636 { 
    637         egg_editable_toolbar_set_edit_mode (EGG_EDITABLE_TOOLBAR (t), FALSE); 
    638 }*/ 
    639  
    640 /*static void 
    641 toolbar_editor_response_cb (GtkDialog *dialog, 
    642                             gint response_id, 
    643                             gpointer data) 
    644 { 
    645         EphyToolbarsModel *model; 
    646         int position; 
    647  
    648         switch (response_id) { 
    649         case GTK_RESPONSE_CLOSE: 
    650                 gtk_widget_destroy (GTK_WIDGET (dialog)); 
    651                 break; 
    652  
    653         case RESPONSE_ADD_TOOLBAR: 
    654                 model = marlin_get_toolbars_model (); 
    655                 position = egg_toolbars_model_add_toolbar (EGG_TOOLBARS_MODEL (model), 
    656                                                            -1, "UserCreated"); 
    657                 egg_toolbars_model_set_flags (EGG_TOOLBARS_MODEL (model),  
    658                                               EGG_TB_MODEL_ICONS_ONLY,  
    659                                               position); 
    660                 break; 
    661  
    662         case GTK_RESPONSE_HELP: 
    663                 break; 
    664         } 
    665 }*/ 
    666  
    667 /*static void 
    668 edit_toolbars (GtkAction *action, 
    669                gpointer data) 
    670 { 
    671         GtkWidget *editor, *dialog; 
    672         EphyToolbarsModel *model; 
    673         Toolbar *toolbar; 
    674         GtkUIManager *ui_manager = marlin_window_get_menu_merge (MARLIN_WINDOW (data));; 
    675         char *xml; 
    676  
    677         toolbar = marlin_window_get_toolbar (MARLIN_WINDOW (data)); 
    678         model = marlin_get_toolbars_model (); 
    679  
    680         dialog = gtk_dialog_new (); 
    681         gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); 
    682         gtk_window_set_title (GTK_WINDOW (dialog), _("Toolbar Editor")); 
    683         gtk_window_set_transient_for (GTK_WINDOW (dialog), 
    684                                       GTK_WINDOW (data)); 
    685  
    686         editor = egg_toolbar_editor_new (ui_manager, EGG_TOOLBARS_MODEL (model)); 
    687  
    688         xml = marlin_file ("toolbars.xml"); 
    689         egg_toolbar_editor_load_actions (EGG_TOOLBAR_EDITOR (editor), xml); 
    690         g_free (xml); 
    691         gtk_container_set_border_width (GTK_CONTAINER (editor), 6); 
    692         gtk_box_set_spacing (GTK_BOX (editor), 6); 
    693         gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), editor); 
    694         g_signal_connect (editor, "destroy", 
    695                           G_CALLBACK (toolbar_editor_destroy_cb), toolbar); 
    696         gtk_widget_show (editor); 
    697  
    698         gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2); 
    699         gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); 
    700         gtk_dialog_add_button (GTK_DIALOG (dialog), 
    701                                _("Add a New Toolbar"), 
    702                                RESPONSE_ADD_TOOLBAR); 
    703         gtk_dialog_add_button (GTK_DIALOG (dialog), 
    704                                GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); 
    705         gtk_dialog_add_button (GTK_DIALOG (dialog), 
    706                                GTK_STOCK_HELP, GTK_RESPONSE_HELP); 
    707  
    708         g_signal_connect (G_OBJECT (dialog), "response", 
    709                           G_CALLBACK (toolbar_editor_response_cb), NULL); 
    710         gtk_widget_show (dialog); 
    711                                           
    712         egg_editable_toolbar_set_edit_mode (EGG_EDITABLE_TOOLBAR (toolbar), TRUE); 
    713 }*/ 
    714  
    715 /*static void 
    716 process_mute (GtkAction *action, 
    717               gpointer data) 
    718 { 
    719         marlin_window_clear (MARLIN_WINDOW (data)); 
    720 }*/ 
    721  
    722 /*static void 
    723 process_invert (GtkAction *action, 
    724                 gpointer data) 
    725 { 
    726         marlin_window_invert (MARLIN_WINDOW (data)); 
    727 }*/ 
    728  
    729 /*static void 
    730 process_swap_channels (GtkAction *action, 
    731                        gpointer data) 
    732 { 
    733         MarlinSample *sample; 
    734         MarlinUndoManager *undo; 
    735         MarlinUndoContext *ctxt; 
    736  
    737         g_object_get (G_OBJECT (data), 
    738                       "sample", &sample, 
    739                       NULL); 
    740         g_object_get (G_OBJECT (sample), 
    741                       "undo-manager", &undo, 
    742                       NULL); 
    743          
    744         ctxt = marlin_undo_manager_context_begin (undo, _("Swap Channels")); 
    745  
    746         marlin_sample_swap_channels (sample, NULL, ctxt, NULL); 
    747         marlin_undo_manager_context_end (undo, ctxt); 
    748         g_object_unref (G_OBJECT (undo)); 
    749         g_object_unref (G_OBJECT (sample)); 
    750 }*/ 
    751  
    752 /*static void 
    753 process_adjust_volume (GtkAction *action, 
    754                        gpointer data) 
    755 { 
    756         marlin_window_adjust_volume (MARLIN_WINDOW (data)); 
    757 }*/ 
    758  
    759 /*static void 
    760 process_insert_silence (GtkAction *action, 
    761                         gpointer data) 
    762 { 
    763         marlin_window_insert_silence (MARLIN_WINDOW (data)); 
    764 }*/ 
    765  
    766 /*static void 
    767 process_change_channels (GtkAction *action, 
    768                          gpointer data) 
    769 { 
    770         marlin_window_change_channels (MARLIN_WINDOW (data)); 
    771 }*/ 
    772  
    773 /*static void 
    774 process_split_sample (GtkAction *action, 
    775                       gpointer data) 
    776 { 
    777         marlin_window_split_sample (MARLIN_WINDOW (data)); 
    778 }*/ 
    779  
    780 /*static void 
    781 process_reverse_sample (GtkAction *action, 
    782                         MarlinWindow *window) 
    783 { 
    784         marlin_window_reverse_sample (window); 
    785 }*/ 
    786501 
    787502static void 
     
    821536}*/ 
    822537 
    823 /*static void 
    824 view_clipboard_info (GtkAction *action, 
    825                      gpointer data) 
    826 { 
    827         static MarlinClipboardInfo *info = NULL; 
    828  
    829         if (info == NULL) { 
    830                 info = marlin_clipboard_info_new (GTK_WINDOW (data)); 
    831  
    832                 g_signal_connect (G_OBJECT (info->dialog), "destroy", 
    833                                   G_CALLBACK (destroy_info_cb), &info); 
    834                 gtk_widget_show (info->dialog); 
    835         } else { 
    836                 gtk_window_present (GTK_WINDOW (info->dialog)); 
    837         } 
    838 }*/ 
    839  
    840538static void 
    841539view_centre (GtkAction *action, 
     
    865563        marlin_window_show_equalizers (MARLIN_WINDOW (data), 
    866564                                       gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))); 
    867 }*/ 
    868  
    869 /*static void 
    870 view_new (GtkAction *action, 
    871           MarlinWindow *window) 
    872 { 
    873         MarlinSample *sample; 
    874  
    875         g_object_get (G_OBJECT (window), 
    876                       "sample", &sample, 
    877                       NULL); 
    878  
    879         marlin_open_window_with_sample (sample); 
    880         g_object_unref (G_OBJECT (sample));  
    881 }*/ 
    882  
    883 /* FIXME: All these displays should use the same gconf key, 
    884    and one place sets it and they all pay attention to it. */ 
    885 /*static void 
    886 scale_action_changed (GtkAction *action,  
    887                       GtkRadioAction *current, 
    888                       MarlinWindow *window) 
    889 { 
    890         MarlinScale scale; 
    891  
    892         scale = gtk_radio_action_get_current_value (current); 
    893         marlin_window_set_level_display (window, scale); 
    894         marlin_window_set_meters_display (window, scale); 
    895565}*/ 
    896566