00001 #ifdef HAVE_CONFIG_H
00002 # include <config.h>
00003 #endif
00004
00005 #include <sys/types.h>
00006 #include <sys/stat.h>
00007 #include <unistd.h>
00008 #include <string.h>
00009 #include <stdio.h>
00010
00011 #include <bonobo.h>
00012 #include <gnome.h>
00013
00014 #include "callbacks.h"
00015 #include "interface.h"
00016 #include "support.h"
00017
00018 #include "interface_il.h"
00019
00020 #define STATUS_BAR_MESSAGE_LENGTH 25
00021 #define NUMBER_OF_STATUS_BARS 03
00022
00023 #define GLADE_HOOKUP_OBJECT(component,widget,name) \
00024 g_object_set_data_full (G_OBJECT (component), name, \
00025 gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
00026
00027 #define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
00028 g_object_set_data (G_OBJECT (component), name, widget)
00029
00030 static void on_about1_activate(GtkMenuItem *menuitem, gpointer user_data);
00031
00032 static GnomeUIInfo file1_menu_uiinfo[] =
00033 {
00034 {
00035 GNOME_APP_UI_ITEM, N_("E_xit"),
00036 NULL,
00037 (gpointer) on_exit1_activate, NULL, NULL,
00038 GNOME_APP_PIXMAP_STOCK, "gtk-quit",
00039 0, (GdkModifierType) 0, NULL
00040 },
00041 GNOMEUIINFO_END
00042 };
00043
00044 static GnomeUIInfo view_menu_uiinfo[] =
00045 {
00046 {
00047 GNOME_APP_UI_TOGGLEITEM, N_("Morse _Statistics"),
00048 NULL,
00049 (gpointer) on_statistics_activate, NULL, NULL,
00050 GNOME_APP_PIXMAP_NONE, NULL,
00051 0, (GdkModifierType) 0, NULL
00052 },
00053 GNOMEUIINFO_END
00054 };
00055
00056 static GnomeUIInfo icons_only_uiinfo[] =
00057 {
00058 {
00059 GNOME_APP_UI_ITEM, N_("_Icons Only"),
00060 NULL,
00061 (gpointer) on_icons_and_or_text_activate, (gpointer)"a", NULL,
00062 GNOME_APP_PIXMAP_NONE, NULL,
00063 0, (GdkModifierType) 0, NULL
00064 },
00065 {
00066 GNOME_APP_UI_ITEM, N_("_Text Only"),
00067 NULL,
00068 (gpointer) on_icons_and_or_text_activate, (gpointer)"b", NULL,
00069 GNOME_APP_PIXMAP_NONE, NULL,
00070 0, (GdkModifierType) 0, NULL
00071 },
00072 {
00073 GNOME_APP_UI_ITEM, N_("I_cons & Text"),
00074 NULL,
00075 (gpointer) on_icons_and_or_text_activate, (gpointer)"c", NULL,
00076 GNOME_APP_PIXMAP_NONE, NULL,
00077 0, (GdkModifierType) 0, NULL
00078 },
00079 GNOMEUIINFO_END
00080 };
00081
00082 static GnomeUIInfo toolbar_menu_uiinfo[] =
00083 {
00084 {
00085 GNOME_APP_UI_RADIOITEMS, NULL, NULL, icons_only_uiinfo,
00086 NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, 0,
00087 (GdkModifierType) 0, NULL
00088 },
00089 GNOMEUIINFO_END
00090 };
00091
00092 static GnomeUIInfo settings_menu_uiinfo[] =
00093 {
00094 {
00095 GNOME_APP_UI_ITEM, N_("_Preferences"),
00096 NULL,
00097 (gpointer) on_preferences_activate, NULL, NULL,
00098 GNOME_APP_PIXMAP_STOCK, "gtk-preferences",
00099 0, (GdkModifierType) 0, NULL
00100 },
00101 GNOMEUIINFO_SEPARATOR,
00102 {
00103 GNOME_APP_UI_SUBTREE, N_("_Toolbar"),
00104 NULL,
00105 toolbar_menu_uiinfo, NULL, NULL,
00106 GNOME_APP_PIXMAP_NONE, NULL,
00107 0, (GdkModifierType) 0, NULL
00108 },
00109 GNOMEUIINFO_END
00110 };
00111
00112 static GnomeUIInfo bw25_hz_uiinfo[] =
00113 {
00114 {
00115 GNOME_APP_UI_ITEM, N_("25 Hz"),
00116 NULL,
00117 (gpointer) on_filter_bw_activate, (gpointer)"a", NULL,
00118 GNOME_APP_PIXMAP_NONE, NULL,
00119 0, (GdkModifierType) 0, NULL
00120 },
00121 {
00122 GNOME_APP_UI_ITEM, N_("50 Hz"),
00123 NULL,
00124 (gpointer) on_filter_bw_activate, (gpointer)"b", NULL,
00125 GNOME_APP_PIXMAP_NONE, NULL,
00126 0, (GdkModifierType) 0, NULL
00127 },
00128 {
00129 GNOME_APP_UI_ITEM, N_("100 Hz"),
00130 NULL,
00131 (gpointer) on_filter_bw_activate, (gpointer)"c", NULL,
00132 GNOME_APP_PIXMAP_NONE, NULL,
00133 0, (GdkModifierType) 0, NULL
00134 },
00135 {
00136 GNOME_APP_UI_ITEM, N_("150 Hz"),
00137 NULL,
00138 (gpointer) on_filter_bw_activate, (gpointer)"d", NULL,
00139 GNOME_APP_PIXMAP_NONE, NULL,
00140 0, (GdkModifierType) 0, NULL
00141 },
00142 {
00143 GNOME_APP_UI_ITEM, N_("200 Hz"),
00144 NULL,
00145 (gpointer) on_filter_bw_activate, (gpointer)"e", NULL,
00146 GNOME_APP_PIXMAP_NONE, NULL,
00147 0, (GdkModifierType) 0, NULL
00148 },
00149 {
00150 GNOME_APP_UI_ITEM, N_("250 Hz"),
00151 NULL,
00152 (gpointer) on_filter_bw_activate, (gpointer)"f", NULL,
00153 GNOME_APP_PIXMAP_NONE, NULL,
00154 0, (GdkModifierType) 0, NULL
00155 },
00156 {
00157 GNOME_APP_UI_ITEM, N_("500 Hz"),
00158 NULL,
00159 (gpointer) on_filter_bw_activate, (gpointer)"g", NULL,
00160 GNOME_APP_PIXMAP_NONE, NULL,
00161 0, (GdkModifierType) 0, NULL
00162 },
00163 {
00164 GNOME_APP_UI_ITEM, N_("1000 Hz"),
00165 NULL,
00166 (gpointer) on_filter_bw_activate, (gpointer)"h", NULL,
00167 GNOME_APP_PIXMAP_NONE, NULL,
00168 0, (GdkModifierType) 0, NULL
00169 },
00170 GNOMEUIINFO_END
00171 };
00172
00173 static GnomeUIInfo fir_bw_menu_uiinfo[] =
00174 {
00175 {
00176 GNOME_APP_UI_RADIOITEMS, NULL, NULL, bw25_hz_uiinfo,
00177 NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, 0,
00178 (GdkModifierType) 0, NULL
00179 },
00180 GNOMEUIINFO_END
00181 };
00182
00183 static GnomeUIInfo help1_menu_uiinfo[] =
00184 {
00185 {
00186 GNOME_APP_UI_ITEM, N_("_About"),
00187 NULL,
00188 (gpointer) on_about1_activate, NULL, NULL,
00189 GNOME_APP_PIXMAP_STOCK, "gnome-stock-about",
00190 0, (GdkModifierType) 0, NULL
00191 },
00192 GNOMEUIINFO_END
00193 };
00194
00195 static GnomeUIInfo menubar1_uiinfo[] =
00196 {
00197 {
00198 GNOME_APP_UI_SUBTREE, N_("_File"),
00199 NULL,
00200 file1_menu_uiinfo, NULL, NULL,
00201 GNOME_APP_PIXMAP_NONE, NULL,
00202 0, (GdkModifierType) 0, NULL
00203 },
00204 GNOMEUIINFO_MENU_VIEW_TREE (view_menu_uiinfo),
00205 {
00206 GNOME_APP_UI_SUBTREE, N_("_Settings"),
00207 N_("Morse and Audio Settings"),
00208 settings_menu_uiinfo, NULL, NULL,
00209 GNOME_APP_PIXMAP_NONE, NULL,
00210 0, (GdkModifierType) 0, NULL
00211 },
00212 GNOMEUIINFO_SEPARATOR,
00213 {
00214 GNOME_APP_UI_SUBTREE, N_("Filter BW"),
00215 N_("Front End Filter Bandwidth"),
00216 fir_bw_menu_uiinfo, NULL, NULL,
00217 GNOME_APP_PIXMAP_NONE, NULL,
00218 0, (GdkModifierType) 0, NULL
00219 },
00220 GNOMEUIINFO_SEPARATOR,
00221 {
00222 GNOME_APP_UI_SUBTREE, N_("_Help"),
00223 NULL,
00224 help1_menu_uiinfo, NULL, NULL,
00225 GNOME_APP_PIXMAP_NONE, NULL,
00226 0, (GdkModifierType) 0, NULL
00227 },
00228 GNOMEUIINFO_END
00229 };
00230
00231 GtkWidget*
00232 create_MainWindow (void)
00233 {
00234 GtkWidget *MainWindow;
00235 GtkWidget *vbox1;
00236 GtkWidget *menubar1;
00237 GtkWidget *toolbar1;
00238 GtkIconSize tmp_toolbar_icon_size;
00239 GtkWidget *tmp_image;
00240 GtkWidget *startbutton;
00241 GtkWidget *stop_button;
00242 GtkWidget *separatortoolitem1;
00243 GtkWidget *clear_txt_button;
00244 GtkWidget *scope_fft_button;
00245 GtkWidget *agc_apply_btn;
00246 GtkWidget *enable_fir_button;
00247 GtkWidget *separatortoolitem2;
00248 GtkWidget *exit_button;
00249 GtkWidget *vpaned1;
00250 GtkWidget *scrolledwindow1;
00251 GtkWidget *decoded_text;
00252 GtkWidget *scope;
00253 GtkWidget *hscale1;
00254 GtkWidget *label1;
00255 GtkWidget *hbox1;
00256 GtkWidget *samples_statusbar;
00257 GtkWidget *ffts_statusbar;
00258 GtkWidget *wpm_statusbar;
00259 GtkAccelGroup *accel_group;
00260 GtkTooltips *tooltips;
00261
00262
00263 GtkObject *adjustment;
00264
00265 tooltips = gtk_tooltips_new ();
00266
00267 accel_group = gtk_accel_group_new ();
00268
00269 MainWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
00270 gtk_window_set_title (GTK_WINDOW (MainWindow), _("morse2txt"));
00271
00272 gtk_window_set_default_size (GTK_WINDOW (MainWindow), main_gui.width, main_gui.height);
00273
00274 vbox1 = gtk_vbox_new (FALSE, 0);
00275 gtk_widget_show (vbox1);
00276 gtk_container_add (GTK_CONTAINER (MainWindow), vbox1);
00277
00278 menubar1 = gtk_menu_bar_new ();
00279 gtk_widget_show (menubar1);
00280 gtk_box_pack_start (GTK_BOX (vbox1), menubar1, FALSE, FALSE, 0);
00281 gnome_app_fill_menu (GTK_MENU_SHELL (menubar1), menubar1_uiinfo,
00282 NULL, FALSE, 0);
00283
00285 if(main_gui.toolbar_style < 3) {
00286 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (icons_only_uiinfo[main_gui.toolbar_style].widget), TRUE);
00287 }
00288
00289 toolbar1 = gtk_toolbar_new ();
00290 gtk_widget_show (toolbar1);
00291 gtk_box_pack_start (GTK_BOX (vbox1), toolbar1, FALSE, FALSE, 0);
00292
00293 gtk_toolbar_set_style (GTK_TOOLBAR (toolbar1), main_gui.toolbar_style);
00294 tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1));
00295
00296 tmp_image = gtk_image_new_from_stock ("gtk-execute", tmp_toolbar_icon_size);
00297 gtk_widget_show (tmp_image);
00298 startbutton = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Start"));
00299 gtk_widget_show (startbutton);
00300 gtk_container_add (GTK_CONTAINER (toolbar1), startbutton);
00301 gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (startbutton), tooltips, _("Start Decoding"), NULL);
00302
00303 tmp_image = gtk_image_new_from_stock ("gnome-stock-not", tmp_toolbar_icon_size);
00304 gtk_widget_show (tmp_image);
00305 stop_button = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Stop"));
00306 gtk_widget_show (stop_button);
00307 gtk_container_add (GTK_CONTAINER (toolbar1), stop_button);
00308 gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (stop_button), tooltips, _("Stop Decoding"), NULL);
00309
00310 separatortoolitem1 = (GtkWidget*) gtk_separator_tool_item_new ();
00311 gtk_widget_show (separatortoolitem1);
00312 gtk_container_add (GTK_CONTAINER (toolbar1), separatortoolitem1);
00313
00314 tmp_image = gtk_image_new_from_stock ("gtk-clear", tmp_toolbar_icon_size);
00315 gtk_widget_show (tmp_image);
00316 clear_txt_button = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Clear Text"));
00317 gtk_widget_show (clear_txt_button);
00318 gtk_container_add (GTK_CONTAINER (toolbar1), clear_txt_button);
00319 gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (clear_txt_button), tooltips, _("Erase All Text"), NULL);
00320
00321 tmp_image = gtk_image_new_from_stock ("gtk-convert", tmp_toolbar_icon_size);
00322 gtk_widget_show (tmp_image);
00323 scope_fft_button = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Scope/FFT"));
00324 gtk_widget_show (scope_fft_button);
00325 gtk_container_add (GTK_CONTAINER (toolbar1), scope_fft_button);
00326 gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (scope_fft_button), tooltips, _("FFT or Audio Display"), NULL);
00327
00328 agc_apply_btn = (GtkWidget*) gtk_toggle_tool_button_new ();
00329 gtk_tool_button_set_label (GTK_TOOL_BUTTON (agc_apply_btn), _("AGC"));
00330 tmp_image = gtk_image_new_from_stock ("gtk-apply", tmp_toolbar_icon_size);
00331 gtk_widget_show (tmp_image);
00332 gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (agc_apply_btn), tmp_image);
00333 gtk_widget_show (agc_apply_btn);
00334 gtk_container_add (GTK_CONTAINER (toolbar1), agc_apply_btn);
00335 gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (agc_apply_btn), tooltips, _("Automatic Gain Control"), NULL);
00336
00337 enable_fir_button = (GtkWidget*) gtk_toggle_tool_button_new ();
00338 gtk_tool_button_set_label (GTK_TOOL_BUTTON (enable_fir_button), _("Filter"));
00339 tmp_image = gtk_image_new_from_stock ("gtk-apply", tmp_toolbar_icon_size);
00340 gtk_widget_show (tmp_image);
00341 gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (enable_fir_button), tmp_image);
00342 gtk_widget_show (enable_fir_button);
00343 gtk_container_add (GTK_CONTAINER (toolbar1), enable_fir_button);
00344 gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (enable_fir_button), tooltips, _("Frontend FIR Filter"), NULL);
00345
00346 separatortoolitem2 = (GtkWidget*) gtk_separator_tool_item_new ();
00347 gtk_widget_show (separatortoolitem2);
00348 gtk_container_add (GTK_CONTAINER (toolbar1), separatortoolitem2);
00349
00350 tmp_image = gtk_image_new_from_stock ("gtk-quit", tmp_toolbar_icon_size);
00351 gtk_widget_show (tmp_image);
00352 exit_button = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Exit"));
00353 gtk_widget_show (exit_button);
00354 gtk_container_add (GTK_CONTAINER (toolbar1), exit_button);
00355 gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (exit_button), tooltips, _("Exit Application"), NULL);
00356
00357 vpaned1 = gtk_vpaned_new ();
00358 gtk_widget_show (vpaned1);
00359 gtk_box_pack_start (GTK_BOX (vbox1), vpaned1, TRUE, TRUE, 0);
00360 gtk_container_set_border_width (GTK_CONTAINER (vpaned1), 10);
00361 GTK_WIDGET_UNSET_FLAGS (vpaned1, GTK_CAN_FOCUS);
00362
00363 gtk_paned_set_position (GTK_PANED (vpaned1), main_gui.pane_position);
00364
00365 scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
00366 gtk_widget_show (scrolledwindow1);
00367 gtk_paned_pack1 (GTK_PANED (vpaned1), scrolledwindow1, FALSE, TRUE);
00368 GTK_WIDGET_UNSET_FLAGS (scrolledwindow1, GTK_CAN_FOCUS);
00369 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
00370 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_SHADOW_IN);
00371
00372 decoded_text = gtk_text_view_new ();
00373 gtk_widget_show (decoded_text);
00374 gtk_container_add (GTK_CONTAINER (scrolledwindow1), decoded_text);
00375 gtk_tooltips_set_tip (tooltips, decoded_text, _("Decoded Morse"), NULL);
00376 gtk_text_view_set_editable (GTK_TEXT_VIEW (decoded_text), FALSE);
00377 gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (decoded_text), GTK_WRAP_CHAR);
00378
00379 scope = gtk_curve_new ();
00380 gtk_widget_show (scope);
00381 gtk_paned_pack2 (GTK_PANED (vpaned1), scope, FALSE, TRUE);
00382
00383 gtk_curve_set_range (GTK_CURVE (scope), 0, get_fft_data_size(), 0, get_fft_graph_top());
00384
00385
00386 adjustment = gtk_adjustment_new(0, 0, (get_fft_data_size() - 1), 1, 0, 0);
00387 hscale1 = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
00388 gtk_widget_show (hscale1);
00389 gtk_box_pack_start (GTK_BOX (vbox1), hscale1, FALSE, TRUE, 0);
00390 GTK_WIDGET_UNSET_FLAGS (hscale1, GTK_CAN_FOCUS);
00391 gtk_scale_set_digits (GTK_SCALE (hscale1), 0);
00392
00393 label1 = gtk_label_new (_("Frequency to Decode"));
00394 gtk_widget_show (label1);
00395 gtk_box_pack_start (GTK_BOX (vbox1), label1, FALSE, TRUE, 0);
00396 gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_CENTER);
00397
00398 hbox1 = gtk_hbox_new (FALSE, 0);
00399 gtk_widget_show (hbox1);
00400 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
00401
00402 samples_statusbar = gtk_statusbar_new ();
00403 gtk_widget_show (samples_statusbar);
00404 gtk_box_pack_start (GTK_BOX (hbox1), samples_statusbar, TRUE, TRUE, 0);
00405 gtk_container_set_border_width (GTK_CONTAINER (samples_statusbar), 2);
00406 gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (samples_statusbar), FALSE);
00407
00408 ffts_statusbar = gtk_statusbar_new ();
00409 gtk_widget_show (ffts_statusbar);
00410 gtk_box_pack_start (GTK_BOX (hbox1), ffts_statusbar, TRUE, TRUE, 0);
00411 gtk_container_set_border_width (GTK_CONTAINER (ffts_statusbar), 2);
00412 gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (ffts_statusbar), FALSE);
00413
00414 wpm_statusbar = gtk_statusbar_new ();
00415 gtk_widget_show (wpm_statusbar);
00416 gtk_box_pack_start (GTK_BOX (hbox1), wpm_statusbar, TRUE, TRUE, 0);
00417 gtk_container_set_border_width (GTK_CONTAINER (wpm_statusbar), 2);
00418 gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (wpm_statusbar), FALSE);
00419
00420 g_signal_connect ((gpointer) MainWindow, "delete_event",
00421 G_CALLBACK (on_MainWindow_delete_event),
00422 NULL);
00423 g_signal_connect ((gpointer) startbutton, "clicked",
00424 G_CALLBACK (on_startbutton_clicked),
00425 NULL);
00426 g_signal_connect ((gpointer) stop_button, "clicked",
00427 G_CALLBACK (on_stop_button_clicked),
00428 NULL);
00429 g_signal_connect ((gpointer) clear_txt_button, "clicked",
00430 G_CALLBACK (on_clear_txt_button_clicked),
00431 NULL);
00432 g_signal_connect ((gpointer) scope_fft_button, "clicked",
00433 G_CALLBACK (on_scope_fft_button_clicked),
00434 NULL);
00435 g_signal_connect ((gpointer) agc_apply_btn, "toggled",
00436 G_CALLBACK (on_agc_apply_btn_toggled),
00437 NULL);
00438 g_signal_connect ((gpointer) enable_fir_button, "toggled",
00439 G_CALLBACK (on_enable_fir_button_toggled),
00440 NULL);
00441 g_signal_connect ((gpointer) exit_button, "clicked",
00442 G_CALLBACK (on_exit_button_clicked),
00443 NULL);
00444 g_signal_connect ((gpointer) adjustment, "value_changed",
00445 G_CALLBACK (on_adjustment_release_event),
00446 NULL);
00447
00448
00449 GLADE_HOOKUP_OBJECT_NO_REF (MainWindow, MainWindow, "MainWindow");
00450 GLADE_HOOKUP_OBJECT (MainWindow, vbox1, "vbox1");
00451 GLADE_HOOKUP_OBJECT (MainWindow, menubar1, "menubar1");
00452 GLADE_HOOKUP_OBJECT (MainWindow, menubar1_uiinfo[0].widget, "file1");
00453 GLADE_HOOKUP_OBJECT (MainWindow, file1_menu_uiinfo[0].widget, "exit1");
00454 GLADE_HOOKUP_OBJECT (MainWindow, menubar1_uiinfo[1].widget, "view");
00455 GLADE_HOOKUP_OBJECT (MainWindow, view_menu_uiinfo[0].widget, "statistics");
00456 GLADE_HOOKUP_OBJECT (MainWindow, menubar1_uiinfo[2].widget, "settings");
00457 GLADE_HOOKUP_OBJECT (MainWindow, settings_menu_uiinfo[0].widget, "preferences");
00458 GLADE_HOOKUP_OBJECT (MainWindow, settings_menu_uiinfo[1].widget, "separator1");
00459 GLADE_HOOKUP_OBJECT (MainWindow, settings_menu_uiinfo[2].widget, "toolbar");
00460 GLADE_HOOKUP_OBJECT (MainWindow, icons_only_uiinfo[0].widget, "icons_only");
00461 GLADE_HOOKUP_OBJECT (MainWindow, icons_only_uiinfo[1].widget, "text_only");
00462 GLADE_HOOKUP_OBJECT (MainWindow, icons_only_uiinfo[2].widget, "icons_and_text");
00463 GLADE_HOOKUP_OBJECT (MainWindow, menubar1_uiinfo[3].widget, "separator2");
00464 GLADE_HOOKUP_OBJECT (MainWindow, menubar1_uiinfo[4].widget, "fir_bw");
00465 GLADE_HOOKUP_OBJECT (MainWindow, bw25_hz_uiinfo[0].widget, "bw25_hz");
00466 GLADE_HOOKUP_OBJECT (MainWindow, bw25_hz_uiinfo[1].widget, "bw50_hz");
00467 GLADE_HOOKUP_OBJECT (MainWindow, bw25_hz_uiinfo[2].widget, "bw100_hz");
00468 GLADE_HOOKUP_OBJECT (MainWindow, bw25_hz_uiinfo[3].widget, "bw150_hz");
00469 GLADE_HOOKUP_OBJECT (MainWindow, bw25_hz_uiinfo[4].widget, "bw200_hz");
00470 GLADE_HOOKUP_OBJECT (MainWindow, bw25_hz_uiinfo[5].widget, "bw250_hz");
00471 GLADE_HOOKUP_OBJECT (MainWindow, bw25_hz_uiinfo[6].widget, "bw500_hz");
00472 GLADE_HOOKUP_OBJECT (MainWindow, bw25_hz_uiinfo[7].widget, "bw1000_hz");
00473 GLADE_HOOKUP_OBJECT (MainWindow, menubar1_uiinfo[5].widget, "separator3");
00474 GLADE_HOOKUP_OBJECT (MainWindow, menubar1_uiinfo[6].widget, "help1");
00475 GLADE_HOOKUP_OBJECT (MainWindow, help1_menu_uiinfo[0].widget, "about1");
00476 GLADE_HOOKUP_OBJECT (MainWindow, toolbar1, "toolbar1");
00477 GLADE_HOOKUP_OBJECT (MainWindow, startbutton, "startbutton");
00478 GLADE_HOOKUP_OBJECT (MainWindow, stop_button, "stop_button");
00479 GLADE_HOOKUP_OBJECT (MainWindow, separatortoolitem1, "separatortoolitem1");
00480 GLADE_HOOKUP_OBJECT (MainWindow, clear_txt_button, "clear_txt_button");
00481 GLADE_HOOKUP_OBJECT (MainWindow, scope_fft_button, "scope_fft_button");
00482 GLADE_HOOKUP_OBJECT (MainWindow, agc_apply_btn, "agc_apply_btn");
00483 GLADE_HOOKUP_OBJECT (MainWindow, enable_fir_button, "enable_fir_button");
00484 GLADE_HOOKUP_OBJECT (MainWindow, separatortoolitem2, "separatortoolitem2");
00485 GLADE_HOOKUP_OBJECT (MainWindow, exit_button, "exit_button");
00486 GLADE_HOOKUP_OBJECT (MainWindow, vpaned1, "vpaned1");
00487 GLADE_HOOKUP_OBJECT (MainWindow, scrolledwindow1, "scrolledwindow1");
00488 GLADE_HOOKUP_OBJECT (MainWindow, decoded_text, "decoded_text");
00489 GLADE_HOOKUP_OBJECT (MainWindow, scope, "scope");
00490 GLADE_HOOKUP_OBJECT (MainWindow, hscale1, "hscale1");
00491 GLADE_HOOKUP_OBJECT (MainWindow, label1, "label1");
00492 GLADE_HOOKUP_OBJECT (MainWindow, hbox1, "hbox1");
00493 GLADE_HOOKUP_OBJECT (MainWindow, samples_statusbar, "samples_statusbar");
00494 GLADE_HOOKUP_OBJECT (MainWindow, ffts_statusbar, "ffts_statusbar");
00495 GLADE_HOOKUP_OBJECT (MainWindow, wpm_statusbar, "wpm_statusbar");
00496 GLADE_HOOKUP_OBJECT_NO_REF (MainWindow, tooltips, "tooltips");
00497
00498 gtk_window_add_accel_group (GTK_WINDOW (MainWindow), accel_group);
00499
00500
00501 main_gui.decoded_text_v = decoded_text;
00502 main_gui.samples_statusbar_v = samples_statusbar;
00503 main_gui.ffts_statusbar_v = ffts_statusbar;
00504 main_gui.wpm_statusbar_v = wpm_statusbar;
00505 main_gui.scope_v = scope;
00506 main_gui.hscale1_v = hscale1;
00507 main_gui.adjustment_frequency_v = adjustment;
00508 main_gui.label1_v = label1;
00509 main_gui.toolbar1_v = toolbar1;
00510 main_gui.main_window_v = MainWindow;
00511
00512 return MainWindow;
00513 }
00514
00515 GtkWidget*
00516 create_morse_about (void)
00517 {
00518 const gchar *authors[] = {"Ken Prox, ka8cln <kprox@users.sourceforge.net>", NULL };
00519 const gchar *documenters[] = { NULL };
00520
00521 gchar *translators = _("translator_credits");
00522 GtkWidget *morse_about;
00523
00524 if (!strcmp (translators, "translator_credits"))
00525 translators = NULL;
00526 morse_about = gnome_about_new (PACKAGE, VERSION,
00527 "",
00528 "",
00529 authors,
00530 documenters,
00531 translators,
00532 NULL);
00533 gtk_container_set_border_width (GTK_CONTAINER (morse_about), 5);
00534 gtk_window_set_type_hint (GTK_WINDOW (morse_about), GDK_WINDOW_TYPE_HINT_DIALOG);
00535
00536
00537 GLADE_HOOKUP_OBJECT_NO_REF (morse_about, morse_about, "morse_about");
00538
00539 return morse_about;
00540 }
00541
00542 static void
00543 on_about1_activate (GtkMenuItem *menuitem,
00544 gpointer user_data)
00545 {
00546 static GtkWidget* about = NULL;
00547
00548 if (about) {
00549 if (about->window == NULL)
00550 return;
00551
00552 gdk_window_show (about->window);
00553 gdk_window_raise (about->window);
00554 return;
00555 }
00556
00557 about = create_morse_about ();
00558
00559 gtk_signal_connect (GTK_OBJECT (about),
00560 "destroy",
00561 GTK_SIGNAL_FUNC (gtk_widget_destroyed),
00562 &about);
00563
00564 gtk_widget_show (about);
00565 }
00566