gpredict-svn Mailing List for Gpredict (Page 16)
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
You can subscribe to this list here.
2008 |
Jan
(24) |
Feb
|
Mar
(6) |
Apr
(14) |
May
(9) |
Jun
|
Jul
|
Aug
(25) |
Sep
(60) |
Oct
(26) |
Nov
|
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
|
Feb
(2) |
Mar
(22) |
Apr
(61) |
May
(57) |
Jun
|
Jul
(3) |
Aug
(83) |
Sep
(35) |
Oct
(50) |
Nov
(28) |
Dec
(34) |
2010 |
Jan
(29) |
Feb
(15) |
Mar
(2) |
Apr
|
May
(6) |
Jun
(2) |
Jul
(24) |
Aug
(2) |
Sep
(9) |
Oct
(43) |
Nov
(22) |
Dec
(6) |
2011 |
Jan
(24) |
Feb
(22) |
Mar
(31) |
Apr
(13) |
May
(10) |
Jun
(10) |
Jul
(43) |
Aug
(12) |
Sep
(18) |
Oct
(33) |
Nov
(18) |
Dec
(4) |
From: <cs...@us...> - 2010-01-17 21:32:05
|
Revision: 591 http://gpredict.svn.sourceforge.net/gpredict/?rev=591&view=rev Author: csete Date: 2010-01-17 21:31:58 +0000 (Sun, 17 Jan 2010) Log Message: ----------- Applied patch 2930342 from Charles Suprin AA1VS. Modified Paths: -------------- trunk/src/gtk-polar-view.c Modified: trunk/src/gtk-polar-view.c =================================================================== --- trunk/src/gtk-polar-view.c 2010-01-17 21:26:17 UTC (rev 590) +++ trunk/src/gtk-polar-view.c 2010-01-17 21:31:58 UTC (rev 591) @@ -1009,7 +1009,13 @@ if (obj->showtrack) { - + if (obj->pass == NULL) { + sat_log_log (SAT_LOG_LEVEL_BUG, + _("%s:%d: Failed to get satellite pass."), + __FILE__, __LINE__); + return; + } + /* create points */ num = g_slist_length (obj->pass->details); @@ -1139,6 +1145,13 @@ return; } + if (obj->pass == NULL) { + sat_log_log (SAT_LOG_LEVEL_BUG, + _("%s:%d: Failed to get satellite pass."), + __FILE__, __LINE__); + return; + } + root = goo_canvas_get_root_item_model (GOO_CANVAS (pv->canvas)); /* add sky track */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-17 21:26:23
|
Revision: 590 http://gpredict.svn.sourceforge.net/gpredict/?rev=590&view=rev Author: csete Date: 2010-01-17 21:26:17 +0000 (Sun, 17 Jan 2010) Log Message: ----------- Enable Print button in single pass dialog. Modified Paths: -------------- trunk/src/sat-pass-dialogs.c Modified: trunk/src/sat-pass-dialogs.c =================================================================== --- trunk/src/sat-pass-dialogs.c 2010-01-17 21:24:03 UTC (rev 589) +++ trunk/src/sat-pass-dialogs.c 2010-01-17 21:26:17 UTC (rev 590) @@ -46,6 +46,7 @@ #include "gtk-polar-plot.h" #include "gtk-azel-plot.h" #include "save-pass.h" +#include "print-pass.h" @@ -546,6 +547,11 @@ sat_log_log (SAT_LOG_LEVEL_ERROR, _("%s: PRINT not implemented"), __FUNCTION__); + + pass_t *pass = (pass_t *) g_object_get_data (G_OBJECT (dialog), "pass"); + qth_t *qth = (qth_t *) g_object_get_data (G_OBJECT (dialog), "qth"); + + print_pass (pass, qth, GTK_WINDOW (dialog)); break; case RESPONSE_SAVE: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-17 21:24:13
|
Revision: 589 http://gpredict.svn.sourceforge.net/gpredict/?rev=589&view=rev Author: csete Date: 2010-01-17 21:24:03 +0000 (Sun, 17 Jan 2010) Log Message: ----------- Addided files print functions (not complete). Modified Paths: -------------- trunk/src/Makefile.am Added Paths: ----------- trunk/src/print-pass.c trunk/src/print-pass.h Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2010-01-12 18:32:19 UTC (rev 588) +++ trunk/src/Makefile.am 2010-01-17 21:24:03 UTC (rev 589) @@ -70,6 +70,7 @@ pass-popup-menu.c pass-popup-menu.h \ pass-to-txt.c pass-to-txt.h \ predict-tools.c predict-tools.h \ + print-pass.c print-pass.h \ qth-data.c qth-data.h \ qth-editor.c qth-editor.h \ radio-conf.c radio-conf.h \ Added: trunk/src/print-pass.c =================================================================== --- trunk/src/print-pass.c (rev 0) +++ trunk/src/print-pass.c 2010-01-17 21:24:03 UTC (rev 589) @@ -0,0 +1,310 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2009 Alexandru Csete, OZ9AEC. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/gpredict/ + More details can be found at the project home page: + + http://gpredict.oz9aec.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ +*/ +#include <gtk/gtk.h> +#include "sgpsdp/sgp4sdp4.h" +#include "predict-tools.h" +#include "gtk-sat-data.h" +#include "sat-cfg.h" +#include "sat-log.h" +#include "pass-to-txt.h" +#include "print-pass.h" +#ifdef HAVE_CONFIG_H +# include <build-config.h> +#endif + + +/* In points */ +#define HEADER_HEIGHT (10*72/25.4) +#define HEADER_GAP (3*72/25.4) + +typedef struct +{ + //gchar *filename; + gdouble font_size; + + gint lines_per_page; + + gchar *pgheader; + gchar **lines; + gint num_lines; + gint num_pages; + gint fields; +} PrintData; + + + +static void begin_print (GtkPrintOperation *operation, + GtkPrintContext *context, + gpointer user_data); +static void draw_page (GtkPrintOperation *operation, + GtkPrintContext *context, + gint page_nr, + gpointer user_data); +static void end_print (GtkPrintOperation *operation, + GtkPrintContext *context, + gpointer user_data); + + +/** \brief Print a satellite pass. + * \param pass Pointer to the pass_t data + * \param qth Pointer to the qth_t structure + * \param parent Transient parent of the dialog, or NULL + * + * This function prints a satellite pass to the printer (or a file) using the + * Gtk+ printing API. The function takes the user configuration into account + * and only prints the selected columns. The font size will be adjusted so that + * one row can fit on one line. The function will also try to reduce the number + * of rows so that the whole pass can fit on one page: + * + * +-------------------------+ + * | header | + * |------------+------------| + * | | | + * | | | + * | polar | az/el | + * | | | + * |------------+------------| + * | | + * | Table with data | + * | | + * | - - - - - - - - - - - | + * | - - - - - - - - - - - | + * | - - - - - - - - - - - | + * | - - - - - - - - - - - | + * | - - - - - - - - - - - | + * | - - - - - - - - - - - | + * | - - - - - - - - - - - | + * | | + * +-------------------------+ + * + */ +void print_pass (pass_t *pass, qth_t *qth, GtkWindow *parent) +{ + gchar *text,*header,*buff; + + GtkPrintOperation *operation; + PrintData *data; + GError *error = NULL; + + + /* TODO check pass and qth */ + + + operation = gtk_print_operation_new (); + data = g_new0 (PrintData, 1); + data->font_size = 12.0; // FIXME + + /* page header */ + data->pgheader = g_strdup_printf (_("Pass details for %s (orbit %d)"), pass->satname, pass->orbit); + + /* convert data to printable strings; we use existing pass_to_txt functions */ + data->fields = sat_cfg_get_int (SAT_CFG_INT_PRED_SINGLE_COL); + header = pass_to_txt_tblheader (pass, qth, data->fields); + text = pass_to_txt_tblcontents (pass, qth, data->fields); + buff = g_strconcat (header, text, NULL); + data->lines = g_strsplit (buff, "\n", 0); + g_free (text); + g_free (header); + g_free (buff); + + g_signal_connect (G_OBJECT (operation), "begin-print", G_CALLBACK (begin_print), data); + g_signal_connect (G_OBJECT (operation), "draw-page", G_CALLBACK (draw_page), data); + g_signal_connect (G_OBJECT (operation), "end-print", G_CALLBACK (end_print), data); + + gtk_print_operation_set_use_full_page (operation, FALSE); + gtk_print_operation_set_unit (operation, GTK_UNIT_POINTS); + + gtk_print_operation_run (operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, + parent, &error); + + g_object_unref (operation); + + + if (error) { + sat_log_log (SAT_LOG_LEVEL_ERROR, + "%s: %s", __FUNCTION__, error->message); + + GtkWidget *dialog; + + dialog = gtk_message_dialog_new (parent, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + "%s", error->message); + g_error_free (error); + + g_signal_connect (dialog, "response", + G_CALLBACK (gtk_widget_destroy), NULL); + + gtk_widget_show (dialog); + } + + +} + + +/** \brief Print passes + * \param passes A GSList containing pointers to pass_t data. + * + * Create a summary page, then for each pass_t call print_pass() + */ +void print_passes (GSList *passes) +{ + sat_log_log (SAT_LOG_LEVEL_BUG, _("%s: Not implemented!"), __FUNCTION__); +} + + + + + + + +static void +begin_print (GtkPrintOperation *operation, + GtkPrintContext *context, + gpointer user_data) +{ + PrintData *data = (PrintData *)user_data; + //char *contents; + int i; + double height; + + height = gtk_print_context_get_height (context) - HEADER_HEIGHT - HEADER_GAP; + + data->lines_per_page = floor (height / data->font_size); + + //g_file_get_contents (data->filename, &contents, NULL, NULL); + + //data->lines = g_strsplit (contents, "\n", 0); + //g_free (contents); + + i = 0; + while (data->lines[i] != NULL) + i++; + + data->num_lines = i; + data->num_pages = (data->num_lines - 1) / data->lines_per_page + 1; + + gtk_print_operation_set_n_pages (operation, data->num_pages); +} + + + +static void +draw_page (GtkPrintOperation *operation, + GtkPrintContext *context, + gint page_nr, + gpointer user_data) +{ + PrintData *data = (PrintData *)user_data; + cairo_t *cr; + PangoLayout *layout; + gint text_width, text_height; + gdouble width; + gint line, i; + PangoFontDescription *desc; + gchar *page_str; + + + + cr = gtk_print_context_get_cairo_context (context); + + width = gtk_print_context_get_width (context); + + cairo_rectangle (cr, 0, 0, width, HEADER_HEIGHT); + + cairo_set_source_rgb (cr, 0.8, 0.8, 0.8); + cairo_fill_preserve (cr); + + cairo_set_source_rgb (cr, 0, 0, 0); + cairo_set_line_width (cr, 1); + cairo_stroke (cr); + + + layout = gtk_print_context_create_pango_layout (context); + + desc = pango_font_description_from_string ("sans 14"); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + pango_layout_set_text (layout, data->pgheader, -1); + pango_layout_get_pixel_size (layout, &text_width, &text_height); + + if (text_width > width) { + pango_layout_set_width (layout, width); + pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_START); + pango_layout_get_pixel_size (layout, &text_width, &text_height); + } + + cairo_move_to (cr, (width - text_width) / 2, (HEADER_HEIGHT - text_height) / 2); + pango_cairo_show_layout (cr, layout); + + page_str = g_strdup_printf ("%d/%d", page_nr + 1, data->num_pages); + pango_layout_set_text (layout, page_str, -1); + g_free (page_str); + + pango_layout_set_width (layout, -1); + pango_layout_get_pixel_size (layout, &text_width, &text_height); + cairo_move_to (cr, width - text_width - 4, (HEADER_HEIGHT - text_height) / 2); + pango_cairo_show_layout (cr, layout); + + g_object_unref (layout); + + layout = gtk_print_context_create_pango_layout (context); + + desc = pango_font_description_from_string ("monospace"); + pango_font_description_set_size (desc, data->font_size * PANGO_SCALE); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + cairo_move_to (cr, 0, HEADER_HEIGHT + HEADER_GAP); + line = page_nr * data->lines_per_page; + for (i = 0; i < data->lines_per_page && line < data->num_lines; i++) { + pango_layout_set_text (layout, data->lines[line], -1); + pango_cairo_show_layout (cr, layout); + cairo_rel_move_to (cr, 0, data->font_size); + line++; + } + + g_object_unref (layout); +} + + +/** + * + */ +static void end_print (GtkPrintOperation *operation, + GtkPrintContext *context, + gpointer user_data) +{ + PrintData *data = (PrintData *)user_data; + + g_free (data->pgheader); + g_strfreev (data->lines); + g_free (data); +} Added: trunk/src/print-pass.h =================================================================== --- trunk/src/print-pass.h (rev 0) +++ trunk/src/print-pass.h 2010-01-17 21:24:03 UTC (rev 589) @@ -0,0 +1,41 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + Gpredict: Real-time satellite tracking and orbit prediction program + + Copyright (C) 2001-2009 Alexandru Csete, OZ9AEC. + + Authors: Alexandru Csete <oz...@gm...> + + Comments, questions and bugreports should be submitted via + http://sourceforge.net/projects/gpredict/ + More details can be found at the project home page: + + http://gpredict.oz9aec.net/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, visit http://www.fsf.org/ +*/ +#ifndef SAVE_PASS_H +#define SAVE_PASS_H 1 + +#include <gtk/gtk.h> +#include "sat-pass-dialogs.h" +#include "predict-tools.h" +#include "gtk-sat-data.h" + + +void print_pass (pass_t *pass, qth_t *qth, GtkWindow *parent); +void print_passes (GSList *passes); + + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-12 18:32:26
|
Revision: 588 http://gpredict.svn.sourceforge.net/gpredict/?rev=588&view=rev Author: csete Date: 2010-01-12 18:32:19 +0000 (Tue, 12 Jan 2010) Log Message: ----------- Updated. Modified Paths: -------------- trunk/ChangeLog trunk/NEWS Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-01-11 22:37:19 UTC (rev 587) +++ trunk/ChangeLog 2010-01-12 18:32:19 UTC (rev 588) @@ -1,3 +1,13 @@ +2010-01-11 Alexandru Csete <oz9aec at gmail.com> + + * src/gtk-rot-knob.c: + Applied patch 2929816: Fixes Bound Checking in gtk-rot-knob.c + Thanks Charles Suprin AA1VS. + + * src/gtk-sat-module-popup.c: + Change menu item to "Exit full screen" and someminor cleaning. + + 2010-01-05 Alexandru Csete <oz9aec at gmail.com> * src/gtk-sat-map-c: Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2010-01-11 22:37:19 UTC (rev 587) +++ trunk/NEWS 2010-01-12 18:32:19 UTC (rev 588) @@ -17,6 +17,7 @@ - Applied patch 2881367: Updated Flags to Locks (thanks to Charles Suprin AA1VS). - Applied patch 2893617: Patches for fixing Windows build (thanks to Valentin Yakovenkov). - Applied patch 2916646: Minor fixes to documentation (thanks to Paul Schulz). +- Applied patch 2929816: Fixes Bound Checking in gtk-rot-knob.c (Thanks to Charles Suprin AA1VS). - Slightly improved UI for the single-satellite view. - Command line options for cleaning user's TLE and transponder data, see --help for list. - Satellite Map: Added shadow to satellite marker and label to enhance visual appearance This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-11 22:37:26
|
Revision: 587 http://gpredict.svn.sourceforge.net/gpredict/?rev=587&view=rev Author: csete Date: 2010-01-11 22:37:19 +0000 (Mon, 11 Jan 2010) Log Message: ----------- Change menu item to 'Exit full screen' and someminor cleaning. Modified Paths: -------------- trunk/src/gtk-sat-module-popup.c Modified: trunk/src/gtk-sat-module-popup.c =================================================================== --- trunk/src/gtk-sat-module-popup.c 2010-01-11 22:35:18 UTC (rev 586) +++ trunk/src/gtk-sat-module-popup.c 2010-01-11 22:37:19 UTC (rev 587) @@ -75,8 +75,7 @@ * parent. * */ -void - gtk_sat_module_popup (GtkSatModule *module) +void gtk_sat_module_popup (GtkSatModule *module) { GtkWidget *menu; GtkWidget *menuitem; @@ -121,7 +120,7 @@ if (module->state == GTK_SAT_MOD_STATE_FULLSCREEN) { - menuitem = gtk_image_menu_item_new_with_label (_("Leave fullscreen")); + menuitem = gtk_image_menu_item_new_with_label (_("Exit full screen")); image = gtk_image_new_from_stock (GTK_STOCK_LEAVE_FULLSCREEN, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); @@ -130,7 +129,7 @@ G_CALLBACK (screen_state_cb), module); } else { - menuitem = gtk_image_menu_item_new_with_label (_("Fullscreen")); + menuitem = gtk_image_menu_item_new_with_label (_("Full screen")); image = gtk_image_new_from_stock (GTK_STOCK_FULLSCREEN, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); @@ -243,8 +242,7 @@ * wrapper for gtk_sat_module_config_cb * */ -static void - config_cb (GtkWidget *menuitem, gpointer data) +static void config_cb (GtkWidget *menuitem, gpointer data) { GtkSatModule *module = GTK_SAT_MODULE (data); @@ -279,8 +277,7 @@ * possibility to override this in the dialog window. * */ -static void - clone_cb (GtkWidget *menuitem, gpointer data) +static void clone_cb (GtkWidget *menuitem, gpointer data) { GtkWidget *dialog; GtkWidget *entry; @@ -466,8 +463,7 @@ * The text of the menu item will be changed corresponding to the * action that has been performed. */ -static void - docking_state_cb (GtkWidget *menuitem, gpointer data) +static void docking_state_cb (GtkWidget *menuitem, gpointer data) { GtkWidget *module = GTK_WIDGET (data); gint w,h; @@ -637,8 +633,7 @@ * This function is intended to toggle between FULLSCREEN * and WINDOW state. */ -static void - screen_state_cb (GtkWidget *menuitem, gpointer data) +static void screen_state_cb (GtkWidget *menuitem, gpointer data) { GtkWidget *module = GTK_WIDGET (data); gint w,h; @@ -758,8 +753,7 @@ * in that it will make the predictions with the satellites * tracked in the current module. */ -static void - sky_at_glance_cb (GtkWidget *menuitem, gpointer data) +static void sky_at_glance_cb (GtkWidget *menuitem, gpointer data) { GtkSatModule *module = GTK_SAT_MODULE (data); GtkWidget *skg; @@ -801,8 +795,7 @@ } /** \brief Open time manager. */ -static void - tmgr_cb (GtkWidget *menuitem, gpointer data) +static void tmgr_cb (GtkWidget *menuitem, gpointer data) { GtkSatModule *module = GTK_SAT_MODULE (data); @@ -813,8 +806,7 @@ * \param menuitem The menuitem that was selected. * \param data Pointer the GtkSatModule. */ -static void - rigctrl_cb (GtkWidget *menuitem, gpointer data) +static void rigctrl_cb (GtkWidget *menuitem, gpointer data) { GtkSatModule *module = GTK_SAT_MODULE (data); gchar *buff; @@ -872,8 +864,7 @@ * * This function is called automatically when the window is destroyed. */ -static void - destroy_rigctrl (GtkWidget *window, gpointer data) +static void destroy_rigctrl (GtkWidget *window, gpointer data) { GtkSatModule *module = GTK_SAT_MODULE (data); @@ -886,8 +877,7 @@ * \param menuitem The menuitem that was selected. * \param data Pointer the GtkSatModule. */ -static void - rotctrl_cb (GtkWidget *menuitem, gpointer data) +static void rotctrl_cb (GtkWidget *menuitem, gpointer data) { GtkSatModule *module = GTK_SAT_MODULE (data); gchar *buff; @@ -944,8 +934,7 @@ * * This function is called automatically when the window is destroyed. */ -static void - destroy_rotctrl (GtkWidget *window, gpointer data) +static void destroy_rotctrl (GtkWidget *window, gpointer data) { GtkSatModule *module = GTK_SAT_MODULE (data); @@ -954,8 +943,7 @@ } /* ensure that deleted top-level windows are destroyed */ -static gint - window_delete (GtkWidget *widget, +static gint window_delete (GtkWidget *widget, GdkEvent *event, gpointer data) { @@ -970,8 +958,7 @@ * item in the GtkSatModule popup menu. It is simply a wrapper * for gtk_sat_module_close_cb, which will close the current module. */ -static void - close_cb (GtkWidget *menuitem, gpointer data) +static void close_cb (GtkWidget *menuitem, gpointer data) { gtk_sat_module_close_cb (menuitem, data); } @@ -983,8 +970,7 @@ * with gtk_sat_module_close_cb, which will close the current module, * whereafter the module file will be deleted from the disk. */ -static void - delete_cb (GtkWidget *menuitem, gpointer data) +static void delete_cb (GtkWidget *menuitem, gpointer data) { gchar *file; GtkWidget *dialog; @@ -1040,8 +1026,7 @@ * The primary purpose of this function is to check whether the char length * of the name is greater than zero, if yes enable the OK button of the dialog. */ -static void - name_changed (GtkWidget *widget, gpointer data) +static void name_changed (GtkWidget *widget, gpointer data) { const gchar *text; gchar *entry, *end, *j; @@ -1111,8 +1096,7 @@ * \note The logic in the code has been borrowed from gaim/pidgin http://pidgin.im/ * */ -gboolean - module_window_config_cb (GtkWidget *widget, GdkEventConfigure *event, gpointer data) +gboolean module_window_config_cb (GtkWidget *widget, GdkEventConfigure *event, gpointer data) { gint x, y; GtkSatModule *module = GTK_SAT_MODULE (data); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-11 22:35:24
|
Revision: 586 http://gpredict.svn.sourceforge.net/gpredict/?rev=586&view=rev Author: csete Date: 2010-01-11 22:35:18 +0000 (Mon, 11 Jan 2010) Log Message: ----------- Applied patch 2929816: Fixes Bound Checking in gtk-rot-knob.c. Thanks to Thanks Charles Suprin AA1VS. Modified Paths: -------------- trunk/src/gtk-rot-knob.c Modified: trunk/src/gtk-rot-knob.c =================================================================== --- trunk/src/gtk-rot-knob.c 2010-01-07 11:25:44 UTC (rev 585) +++ trunk/src/gtk-rot-knob.c 2010-01-11 22:35:18 UTC (rev 586) @@ -453,12 +453,20 @@ GtkRotKnob *knob = GTK_ROT_KNOB (data); gdouble delta = GPOINTER_TO_INT(g_object_get_data (G_OBJECT (button), "delta")) / 100.0; - if ((delta > 0.0) && ((knob->value + delta) <= knob->max)) { + if ((delta > 0.0) && ((knob->value + delta) <= knob->max+.005)) { knob->value += delta; + if (knob->value>knob->max){ + knob->value=knob->max; + } } - else if ((delta < 0.0) && ((knob->value + delta) >= knob->min)) { + else if ((delta < 0.0) && ((knob->value + delta) >= knob->min-.005)) { knob->value += delta; - } + if (knob->value<knob->min){ + knob->value=knob->min; + } + } else { + g_print("Val: %.2f %.2f %.10f\n",knob->value,delta,knob->value+delta); + } gtk_rot_knob_update (knob); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-07 11:25:52
|
Revision: 585 http://gpredict.svn.sourceforge.net/gpredict/?rev=585&view=rev Author: csete Date: 2010-01-07 11:25:44 +0000 (Thu, 07 Jan 2010) Log Message: ----------- Fixed X coordinate of satellite label when satellite is close to the right edge of the map. Modified Paths: -------------- trunk/src/gtk-sat-map.c Modified: trunk/src/gtk-sat-map.c =================================================================== --- trunk/src/gtk-sat-map.c 2010-01-07 10:43:56 UTC (rev 584) +++ trunk/src/gtk-sat-map.c 2010-01-07 11:25:44 UTC (rev 585) @@ -1842,12 +1842,12 @@ NULL); } else if ((satmap->width - x ) < 50) { g_object_set (obj->label, - "x", (gdouble) (x+3), + "x", (gdouble) (x-3), "y", (gdouble) (y), "anchor", GTK_ANCHOR_EAST, NULL); g_object_set (obj->shadowl, - "x", (gdouble) (x+3+1), + "x", (gdouble) (x-3+1), "y", (gdouble) (y+1), "anchor", GTK_ANCHOR_EAST, NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-07 10:44:02
|
Revision: 584 http://gpredict.svn.sourceforge.net/gpredict/?rev=584&view=rev Author: csete Date: 2010-01-07 10:43:56 +0000 (Thu, 07 Jan 2010) Log Message: ----------- Added missing cross references to new chapter about custom layouts. Modified Paths: -------------- trunk/doc/um/gpredict-user-manual.odt Modified: trunk/doc/um/gpredict-user-manual.odt =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-07 10:38:35
|
Revision: 583 http://gpredict.svn.sourceforge.net/gpredict/?rev=583&view=rev Author: csete Date: 2010-01-07 10:38:28 +0000 (Thu, 07 Jan 2010) Log Message: ----------- Updated date of issue. Modified Paths: -------------- trunk/doc/um/gpredict-user-manual.odt Modified: trunk/doc/um/gpredict-user-manual.odt =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-07 10:34:22
|
Revision: 582 http://gpredict.svn.sourceforge.net/gpredict/?rev=582&view=rev Author: csete Date: 2010-01-07 10:34:16 +0000 (Thu, 07 Jan 2010) Log Message: ----------- Added description of shadow parameter. Modified Paths: -------------- trunk/doc/um/gpredict-user-manual.odt Modified: trunk/doc/um/gpredict-user-manual.odt =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fi...@us...> - 2010-01-05 18:30:06
|
Revision: 581 http://gpredict.svn.sourceforge.net/gpredict/?rev=581&view=rev Author: fillods Date: 2010-01-05 18:30:00 +0000 (Tue, 05 Jan 2010) Log Message: ----------- Past update Modified Paths: -------------- trunk/ChangeLog Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-01-05 16:40:35 UTC (rev 580) +++ trunk/ChangeLog 2010-01-05 18:30:00 UTC (rev 581) @@ -45,6 +45,16 @@ Added TLE and transponder data for XW-1 / HO-68. +2009-12-24 Stephane Fillod <fillods at users.sf.net> + + * src/gtk-rig-ctrl.c: + * src/gtk-rot-ctrl.c: + Clean hangup with rigctld/rotctld. + + * po/fr.po: + Misc update. + + 2009-12-21 Alexandru Csete <oz9aec at gmail.com> * doc/man/gpredict.1.in: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-05 16:40:41
|
Revision: 580 http://gpredict.svn.sourceforge.net/gpredict/?rev=580&view=rev Author: csete Date: 2010-01-05 16:40:35 +0000 (Tue, 05 Jan 2010) Log Message: ----------- Changed default ground track colour and number. Modified Paths: -------------- trunk/src/sat-cfg.c Modified: trunk/src/sat-cfg.c =================================================================== --- trunk/src/sat-cfg.c 2010-01-05 16:34:32 UTC (rev 579) +++ trunk/src/sat-cfg.c 2010-01-05 16:40:35 UTC (rev 580) @@ -160,8 +160,8 @@ { "MODULES", "MAP_COV_AREA_COLOUR", 0xFFFFFF1F}, { "MODULES", "MAP_GRID_COLOUR", 0x7F7F7FC8}, { "MODULES", "MAP_TICK_COLOUR", 0x7F7F7FC8}, - { "MODULES", "MAP_TRACK_COLOUR", 0x00FFFFFF}, - { "MODULES", "MAP_TRACK_NUM", 1}, + { "MODULES", "MAP_TRACK_COLOUR", 0xFF1200BB}, + { "MODULES", "MAP_TRACK_NUM", 3}, { "MODULES", "MAP_SHADOW_ALPHA", 0xDD}, { "MODULES", "POLAR_REFRESH", 3}, { "MODULES", "POLAR_CHART_ORIENT", POLAR_VIEW_NESW}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-05 16:34:47
|
Revision: 579 http://gpredict.svn.sourceforge.net/gpredict/?rev=579&view=rev Author: csete Date: 2010-01-05 16:34:32 +0000 (Tue, 05 Jan 2010) Log Message: ----------- Added shadow to satellite marker and label to enhance visual appearance over light background map regions. Modified Paths: -------------- trunk/ChangeLog trunk/NEWS trunk/src/config-keys.h trunk/src/gtk-sat-map.c trunk/src/gtk-sat-map.h trunk/src/gtk-sat-selector.c trunk/src/sat-cfg.c trunk/src/sat-cfg.h trunk/src/sat-pref-map-view.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-01-05 14:04:39 UTC (rev 578) +++ trunk/ChangeLog 2010-01-05 16:34:32 UTC (rev 579) @@ -1,9 +1,16 @@ 2010-01-05 Alexandru Csete <oz9aec at gmail.com> * src/gtk-sat-map-c: - Leave 3px room between satellite label and amrker. + Added shadow under satellite markers and labels to improve visual + appearance on light background (e.g. South Pole). Added missing 3px room + between satellite label and marker. + * src/config-keys.h: + * src/sat-cfg.[ch]: + * src/sat-pref-map-view.c: + Added config parameter for shadow transparency on the GtkSatMap. + 2010-01-04 Alexandru Csete <oz9aec at gmail.com> * src/main.c: Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2010-01-05 14:04:39 UTC (rev 578) +++ trunk/NEWS 2010-01-05 16:34:32 UTC (rev 579) @@ -19,6 +19,8 @@ - Applied patch 2916646: Minor fixes to documentation (thanks to Paul Schulz). - Slightly improved UI for the single-satellite view. - Command line options for cleaning user's TLE and transponder data, see --help for list. +- Satellite Map: Added shadow to satellite marker and label to enhance visual appearance + over light background map regions. Changes in version 1.1 (5 Oct 2009) Modified: trunk/src/config-keys.h =================================================================== --- trunk/src/config-keys.h 2010-01-05 14:04:39 UTC (rev 578) +++ trunk/src/config-keys.h 2010-01-05 16:34:32 UTC (rev 579) @@ -102,6 +102,7 @@ #define MOD_CFG_MAP_TRACK_COL "TRACK_COLOUR" #define MOD_CFG_MAP_TRACK_NUM "TRACK_NUMBER" #define MOD_CFG_MAP_KEEP_RATIO "KEEP_RATIO" +#define MOD_CFG_MAP_SHADOW_ALPHA "SHADOW_ALPHA" /* polar view specific */ #define MOD_CFG_POLAR_SECTION "POLAR" Modified: trunk/src/gtk-sat-map.c =================================================================== --- trunk/src/gtk-sat-map.c 2010-01-05 14:04:39 UTC (rev 578) +++ trunk/src/gtk-sat-map.c 2010-01-05 16:34:32 UTC (rev 579) @@ -1633,7 +1633,7 @@ sat_t *sat = SAT(value); GooCanvasItemModel *root; gint *catnum; - guint32 col,covcol; + guint32 col,covcol,shadowcol; gfloat x,y; /* get satellite and SSP */ @@ -1664,16 +1664,27 @@ SAT_CFG_INT_MAP_SAT_COL); /* area coverage colour */ - /* if ((obj->showcov) && (sat->otype != ORBIT_TYPE_DECAYED)) { */ covcol = mod_cfg_get_int (satmap->cfgdata, MOD_CFG_MAP_SECTION, MOD_CFG_MAP_SAT_COV_COL, SAT_CFG_INT_MAP_SAT_COV_COL); - /* } */ - /* else { */ - /* covcol = 0x00000000; */ - /* } */ + /* shadow colour (only alpha channel) */ + shadowcol = mod_cfg_get_int (satmap->cfgdata, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SHADOW_ALPHA, + SAT_CFG_INT_MAP_SHADOW_ALPHA); + + + /* create satellite marker and label + shadows. We create shadows first */ + obj->shadowm = goo_canvas_rect_model_new (root, + x - MARKER_SIZE_HALF + 1, + y - MARKER_SIZE_HALF + 1, + 2 * MARKER_SIZE_HALF, + 2 * MARKER_SIZE_HALF, + "fill-color-rgba", 0x00, + "stroke-color-rgba", shadowcol, + NULL); obj->marker = goo_canvas_rect_model_new (root, x - MARKER_SIZE_HALF, y - MARKER_SIZE_HALF, @@ -1683,6 +1694,14 @@ "stroke-color-rgba", col, NULL); + obj->shadowl = goo_canvas_text_model_new (root, sat->nickname, + x+1, + y+3, + -1, + GTK_ANCHOR_NORTH, + "font", "Sans 8", + "fill-color-rgba", shadowcol, + NULL); obj->label = goo_canvas_text_model_new (root, sat->nickname, x, y+2, @@ -1692,6 +1711,7 @@ "fill-color-rgba", col, NULL); + g_object_set_data (G_OBJECT (obj->marker), "catnum", GINT_TO_POINTER (*catnum)); g_object_set_data (G_OBJECT (obj->label), "catnum", GINT_TO_POINTER (*catnum)); @@ -1803,6 +1823,10 @@ "x", (gdouble) (x - MARKER_SIZE_HALF), "y", (gdouble) (y - MARKER_SIZE_HALF), NULL); + g_object_set (obj->shadowm, + "x", (gdouble) (x - MARKER_SIZE_HALF + 1), + "y", (gdouble) (y - MARKER_SIZE_HALF + 1), + NULL); /* update sat label */ if (x < 50) { @@ -1811,24 +1835,44 @@ "y", (gdouble) (y), "anchor", GTK_ANCHOR_WEST, NULL); + g_object_set (obj->shadowl, + "x", (gdouble) (x+3+1), + "y", (gdouble) (y+1), + "anchor", GTK_ANCHOR_WEST, + NULL); } else if ((satmap->width - x ) < 50) { g_object_set (obj->label, "x", (gdouble) (x+3), "y", (gdouble) (y), "anchor", GTK_ANCHOR_EAST, NULL); + g_object_set (obj->shadowl, + "x", (gdouble) (x+3+1), + "y", (gdouble) (y+1), + "anchor", GTK_ANCHOR_EAST, + NULL); } else if ((satmap->height - y) < 25) { g_object_set (obj->label, "x", (gdouble) (x), "y", (gdouble) (y-2), "anchor", GTK_ANCHOR_SOUTH, NULL); + g_object_set (obj->shadowl, + "x", (gdouble) (x+1), + "y", (gdouble) (y-2+1), + "anchor", GTK_ANCHOR_SOUTH, + NULL); } else { g_object_set (obj->label, "x", (gdouble) (x), "y", (gdouble) (y+2), "anchor", GTK_ANCHOR_NORTH, NULL); + g_object_set (obj->shadowl, + "x", (gdouble) (x+1), + "y", (gdouble) (y+2+1), + "anchor", GTK_ANCHOR_NORTH, + NULL); } /* initialize points for footprint */ Modified: trunk/src/gtk-sat-map.h =================================================================== --- trunk/src/gtk-sat-map.h 2010-01-05 14:04:39 UTC (rev 578) +++ trunk/src/gtk-sat-map.h 2010-01-05 16:34:32 UTC (rev 579) @@ -91,7 +91,9 @@ /* graphical elements */ GooCanvasItemModel *marker; /*!< A small rectangle showing sat pos. */ + GooCanvasItemModel *shadowm; /*!< Shadow under satellite marker. */ GooCanvasItemModel *label; /*!< Satellite name. */ + GooCanvasItemModel *shadowl; /*!< Shadow under satellite name */ GooCanvasItemModel *range1; /*!< First part of the range circle. */ GooCanvasItemModel *range2; /*!< Second part of the range circle. */ Modified: trunk/src/gtk-sat-selector.c =================================================================== --- trunk/src/gtk-sat-selector.c 2010-01-05 14:04:39 UTC (rev 578) +++ trunk/src/gtk-sat-selector.c 2010-01-05 16:34:32 UTC (rev 579) @@ -294,7 +294,7 @@ gtk_tree_view_set_search_entry (GTK_TREE_VIEW (GTK_SAT_SELECTOR (widget)->tree), GTK_ENTRY (GTK_SAT_SELECTOR (widget)->search)); gtk_table_attach (GTK_TABLE (table), GTK_SAT_SELECTOR (widget)->search, 1, 4, 0, 1, - GTK_FILL, GTK_SHRINK, 0, 0); + GTK_SHRINK, GTK_SHRINK, 0, 0); /* Group selector */ gtk_table_attach (GTK_TABLE (table), gtk_label_new (_("Group")), 0, 1, 1, 2, Modified: trunk/src/sat-cfg.c =================================================================== --- trunk/src/sat-cfg.c 2010-01-05 14:04:39 UTC (rev 578) +++ trunk/src/sat-cfg.c 2010-01-05 16:34:32 UTC (rev 579) @@ -162,6 +162,7 @@ { "MODULES", "MAP_TICK_COLOUR", 0x7F7F7FC8}, { "MODULES", "MAP_TRACK_COLOUR", 0x00FFFFFF}, { "MODULES", "MAP_TRACK_NUM", 1}, + { "MODULES", "MAP_SHADOW_ALPHA", 0xDD}, { "MODULES", "POLAR_REFRESH", 3}, { "MODULES", "POLAR_CHART_ORIENT", POLAR_VIEW_NESW}, { "MODULES", "POLAR_BGD_COLOUR", 0xFFFFFFFF}, Modified: trunk/src/sat-cfg.h =================================================================== --- trunk/src/sat-cfg.h 2010-01-05 14:04:39 UTC (rev 578) +++ trunk/src/sat-cfg.h 2010-01-05 16:34:32 UTC (rev 579) @@ -84,6 +84,7 @@ SAT_CFG_INT_MAP_TICK_COL, /*!< Tick labels colour. */ SAT_CFG_INT_MAP_TRACK_COL, /*!< Ground Track colour. */ SAT_CFG_INT_MAP_TRACK_NUM, /*!< Number of orbits to show ground track for */ + SAT_CFG_INT_MAP_SHADOW_ALPHA, /*!< Tranparency of shadow under satellite marker. */ SAT_CFG_INT_POLAR_REFRESH, /*!< Polar refresh rate (cycle). */ SAT_CFG_INT_POLAR_ORIENTATION, /*!< Orientation of the polar charts. */ SAT_CFG_INT_POLAR_BGD_COL, /*!< Polar view, background colour. */ Modified: trunk/src/sat-pref-map-view.c =================================================================== --- trunk/src/sat-pref-map-view.c 2010-01-05 14:04:39 UTC (rev 578) +++ trunk/src/sat-pref-map-view.c 2010-01-05 16:34:32 UTC (rev 579) @@ -11,7 +11,7 @@ More details can be found at the project home page: http://gpredict.oz9aec.net/ - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -51,6 +51,7 @@ static GtkWidget *qthc,*gridc,*tickc; static GtkWidget *satc,*ssatc,*trackc; static GtkWidget *covc,*infofg,*infobg; +static GtkWidget *shadow; /* ground track orbit number selector */ static GtkWidget *orbit; @@ -74,7 +75,10 @@ static void select_map_cb (GtkWidget *button, gpointer data); static void update_map_icon (void); +static gboolean shadow_changed (GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data); + + /** \brief Create and initialise widgets for the map preferences tab. * * The widgets must be preloaded with values from config. If a config value @@ -83,109 +87,108 @@ */ GtkWidget *sat_pref_map_view_create (GKeyFile *cfg) { - GtkWidget *vbox; + GtkWidget *vbox; - /* create vertical box */ - vbox = gtk_vbox_new (FALSE, 2); // !!! - gtk_container_set_border_width (GTK_CONTAINER (vbox), 20); + /* create vertical box */ + vbox = gtk_vbox_new (FALSE, 2); // !!! + gtk_container_set_border_width (GTK_CONTAINER (vbox), 20); - /* create the components */ - create_map_selector (cfg, GTK_BOX (vbox)); - gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, TRUE, 10); - create_bool_selectors (cfg, GTK_BOX (vbox)); - gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, TRUE, 10); - create_colour_selectors (cfg, GTK_BOX (vbox)); - gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, TRUE, 10); - create_orbit_selector (cfg, GTK_BOX (vbox)); - gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, TRUE, 10); - create_reset_button (cfg, GTK_BOX (vbox)); + /* create the components */ + create_map_selector (cfg, GTK_BOX (vbox)); + gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, TRUE, 10); + create_bool_selectors (cfg, GTK_BOX (vbox)); + gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, TRUE, 10); + create_colour_selectors (cfg, GTK_BOX (vbox)); + gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, TRUE, 10); + create_orbit_selector (cfg, GTK_BOX (vbox)); + gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, TRUE, 10); + create_reset_button (cfg, GTK_BOX (vbox)); - reset = FALSE; - dirty = FALSE; + reset = FALSE; + dirty = FALSE; - return vbox; + return vbox; } /** \brief Create map selector widget. */ -static void -create_map_selector (GKeyFile *cfg, GtkBox *vbox) +static void create_map_selector (GKeyFile *cfg, GtkBox *vbox) { - GtkWidget *button; - GtkWidget *label; - GtkWidget *table; - gchar *mapfile; - GdkPixbuf *obuf,*sbuf; - GtkTooltips *tips; + GtkWidget *button; + GtkWidget *label; + GtkWidget *table; + gchar *mapfile; + GdkPixbuf *obuf,*sbuf; + GtkTooltips *tips; - /* create header */ - label = gtk_label_new (NULL); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_label_set_markup (GTK_LABEL (label), - _("<b>Background Map:</b>")); - gtk_box_pack_start (vbox, label, FALSE, TRUE, 0); + /* create header */ + label = gtk_label_new (NULL); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_label_set_markup (GTK_LABEL (label), + _("<b>Background Map:</b>")); + gtk_box_pack_start (vbox, label, FALSE, TRUE, 0); - /* create a table to pu the map preview and select button in. + /* create a table to pu the map preview and select button in. using a simple hbox won't do it because the button would have the same height as the map preview */ - table = gtk_table_new (3, 2, TRUE); - gtk_box_pack_start (vbox, table, FALSE, FALSE, 0); + table = gtk_table_new (3, 2, TRUE); + gtk_box_pack_start (vbox, table, FALSE, FALSE, 0); - /* load map file into a pixbuf */ - if (cfg != NULL) { - mapf = mod_cfg_get_str (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_FILE, - SAT_CFG_STR_MAP_FILE); - } - else { - mapf = sat_cfg_get_str (SAT_CFG_STR_MAP_FILE); - } - if (g_path_is_absolute (mapf)) { + /* load map file into a pixbuf */ + if (cfg != NULL) { + mapf = mod_cfg_get_str (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_FILE, + SAT_CFG_STR_MAP_FILE); + } + else { + mapf = sat_cfg_get_str (SAT_CFG_STR_MAP_FILE); + } + if (g_path_is_absolute (mapf)) { /* map is user specific, ie. in USER_CONF_DIR/maps/ */ - mapfile = g_strdup (mapf); - } - else { - /* build complete path */ - mapfile = map_file_name (mapf); - } - obuf = gdk_pixbuf_new_from_file (mapfile, NULL); - g_free (mapfile); + mapfile = g_strdup (mapf); + } + else { + /* build complete path */ + mapfile = map_file_name (mapf); + } + obuf = gdk_pixbuf_new_from_file (mapfile, NULL); + g_free (mapfile); - if (obuf != NULL) { + if (obuf != NULL) { - /* scale the pixbuf */ - sbuf = gdk_pixbuf_scale_simple (obuf, 100, 50, GDK_INTERP_HYPER); - g_object_unref (obuf); + /* scale the pixbuf */ + sbuf = gdk_pixbuf_scale_simple (obuf, 100, 50, GDK_INTERP_HYPER); + g_object_unref (obuf); - /* create a GtkImage from the pixbuf */ - thumb = gtk_image_new_from_pixbuf (sbuf); - g_object_unref (sbuf); - } - else { - thumb = gtk_image_new_from_stock (GTK_STOCK_MISSING_IMAGE, - GTK_ICON_SIZE_LARGE_TOOLBAR); - } + /* create a GtkImage from the pixbuf */ + thumb = gtk_image_new_from_pixbuf (sbuf); + g_object_unref (sbuf); + } + else { + thumb = gtk_image_new_from_stock (GTK_STOCK_MISSING_IMAGE, + GTK_ICON_SIZE_LARGE_TOOLBAR); + } - gtk_table_attach (GTK_TABLE (table), thumb, 0, 1, 0, 3, - GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE (table), thumb, 0, 1, 0, 3, + GTK_FILL, GTK_FILL, 0, 0); - /* select button */ - button = gtk_button_new_with_label (_("Select map")); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, button, - _("Click to select a map"), NULL); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (select_map_cb), NULL); - gtk_table_attach (GTK_TABLE (table), button, 1, 2, 1, 2, - GTK_FILL, GTK_FILL, 10, 0); + /* select button */ + button = gtk_button_new_with_label (_("Select map")); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, button, + _("Click to select a map"), NULL); + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (select_map_cb), NULL); + gtk_table_attach (GTK_TABLE (table), button, 1, 2, 1, 2, + GTK_FILL, GTK_FILL, 10, 0); - + } @@ -198,105 +201,104 @@ * the satellites, should be drawn on the polar view. Choices are QTH info, next * event, cursor coordinates, and extra tick marks. */ -static void -create_bool_selectors (GKeyFile *cfg, GtkBox *vbox) +static void create_bool_selectors (GKeyFile *cfg, GtkBox *vbox) { - GtkWidget *label; - GtkTooltips *tips; - GtkWidget *hbox; + GtkWidget *label; + GtkTooltips *tips; + GtkWidget *hbox; - /* create header */ - label = gtk_label_new (NULL); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_label_set_markup (GTK_LABEL (label), - _("<b>Extra Contents:</b>")); - gtk_box_pack_start (vbox, label, FALSE, TRUE, 0); + /* create header */ + label = gtk_label_new (NULL); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_label_set_markup (GTK_LABEL (label), + _("<b>Extra Contents:</b>")); + gtk_box_pack_start (vbox, label, FALSE, TRUE, 0); - /* horizontal box to contain the radio buttons */ - hbox = gtk_hbox_new (TRUE, 10); - gtk_box_pack_start (vbox, hbox, FALSE, TRUE, 0); + /* horizontal box to contain the radio buttons */ + hbox = gtk_hbox_new (TRUE, 10); + gtk_box_pack_start (vbox, hbox, FALSE, TRUE, 0); - /* QTH info */ - qth = gtk_check_button_new_with_label (_("QTH Info")); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, qth, - _("Show location information on the map"), - NULL); - if (cfg != NULL) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (qth), - mod_cfg_get_bool (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_SHOW_QTH_INFO, - SAT_CFG_BOOL_MAP_SHOW_QTH_INFO)); - } - else { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (qth), - sat_cfg_get_bool (SAT_CFG_BOOL_MAP_SHOW_QTH_INFO)); - } - g_signal_connect (qth, "toggled", G_CALLBACK (content_changed), NULL); - gtk_box_pack_start (GTK_BOX (hbox), qth, FALSE, TRUE, 0); + /* QTH info */ + qth = gtk_check_button_new_with_label (_("QTH Info")); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, qth, + _("Show location information on the map"), + NULL); + if (cfg != NULL) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (qth), + mod_cfg_get_bool (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SHOW_QTH_INFO, + SAT_CFG_BOOL_MAP_SHOW_QTH_INFO)); + } + else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (qth), + sat_cfg_get_bool (SAT_CFG_BOOL_MAP_SHOW_QTH_INFO)); + } + g_signal_connect (qth, "toggled", G_CALLBACK (content_changed), NULL); + gtk_box_pack_start (GTK_BOX (hbox), qth, FALSE, TRUE, 0); - /* Next Event */ - next = gtk_check_button_new_with_label (_("Next Event")); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, next, - _("Show which satellite comes up next and at what time"), - NULL); - if (cfg != NULL) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (next), - mod_cfg_get_bool (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_SHOW_NEXT_EVENT, - SAT_CFG_BOOL_MAP_SHOW_NEXT_EV)); - } - else { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (next), - sat_cfg_get_bool (SAT_CFG_BOOL_MAP_SHOW_NEXT_EV)); - } - g_signal_connect (next, "toggled", G_CALLBACK (content_changed), NULL); - gtk_box_pack_start (GTK_BOX (hbox), next, FALSE, TRUE, 0); + /* Next Event */ + next = gtk_check_button_new_with_label (_("Next Event")); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, next, + _("Show which satellite comes up next and at what time"), + NULL); + if (cfg != NULL) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (next), + mod_cfg_get_bool (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SHOW_NEXT_EVENT, + SAT_CFG_BOOL_MAP_SHOW_NEXT_EV)); + } + else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (next), + sat_cfg_get_bool (SAT_CFG_BOOL_MAP_SHOW_NEXT_EV)); + } + g_signal_connect (next, "toggled", G_CALLBACK (content_changed), NULL); + gtk_box_pack_start (GTK_BOX (hbox), next, FALSE, TRUE, 0); - /* Cursor position */ - curs = gtk_check_button_new_with_label (_("Cursor Position")); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, curs, - _("Show the latitude and longitude of the mouse pointer"), - NULL); - if (cfg != NULL) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (curs), - mod_cfg_get_bool (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_SHOW_CURS_TRACK, - SAT_CFG_BOOL_MAP_SHOW_CURS_TRACK)); - } - else { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (curs), - sat_cfg_get_bool (SAT_CFG_BOOL_MAP_SHOW_CURS_TRACK)); - } - g_signal_connect (curs, "toggled", G_CALLBACK (content_changed), NULL); - gtk_box_pack_start (GTK_BOX (hbox), curs, FALSE, TRUE, 0); + /* Cursor position */ + curs = gtk_check_button_new_with_label (_("Cursor Position")); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, curs, + _("Show the latitude and longitude of the mouse pointer"), + NULL); + if (cfg != NULL) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (curs), + mod_cfg_get_bool (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SHOW_CURS_TRACK, + SAT_CFG_BOOL_MAP_SHOW_CURS_TRACK)); + } + else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (curs), + sat_cfg_get_bool (SAT_CFG_BOOL_MAP_SHOW_CURS_TRACK)); + } + g_signal_connect (curs, "toggled", G_CALLBACK (content_changed), NULL); + gtk_box_pack_start (GTK_BOX (hbox), curs, FALSE, TRUE, 0); - /* Grid */ - grid = gtk_check_button_new_with_label (_("Grid Lines")); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, grid, - _("Show horizontal and vertical grid lines"), - NULL); - if (cfg != NULL) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (grid), - mod_cfg_get_bool (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_SHOW_GRID, - SAT_CFG_BOOL_MAP_SHOW_GRID)); - } - else { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (grid), - sat_cfg_get_bool (SAT_CFG_BOOL_MAP_SHOW_GRID)); - } - g_signal_connect (grid, "toggled", G_CALLBACK (content_changed), NULL); - gtk_box_pack_start (GTK_BOX (hbox), grid, FALSE, TRUE, 0); + /* Grid */ + grid = gtk_check_button_new_with_label (_("Grid Lines")); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, grid, + _("Show horizontal and vertical grid lines"), + NULL); + if (cfg != NULL) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (grid), + mod_cfg_get_bool (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SHOW_GRID, + SAT_CFG_BOOL_MAP_SHOW_GRID)); + } + else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (grid), + sat_cfg_get_bool (SAT_CFG_BOOL_MAP_SHOW_GRID)); + } + g_signal_connect (grid, "toggled", G_CALLBACK (content_changed), NULL); + gtk_box_pack_start (GTK_BOX (hbox), grid, FALSE, TRUE, 0); } @@ -308,276 +310,310 @@ * This function creates the widgets for selecting colours for the plot background, * axes, tick labels, satellites, track, and info text. */ -static void -create_colour_selectors (GKeyFile *cfg, GtkBox *vbox) +static void create_colour_selectors (GKeyFile *cfg, GtkBox *vbox) { - GtkWidget *label; - GtkTooltips *tips; - GtkWidget *table; - guint rgba; /* RRGGBBAA encoded colour */ - guint16 alpha; /* alpha channel 16 bits */ - GdkColor col; /* GdkColor colour representation */ + GtkWidget *label; + GtkTooltips *tips; + GtkWidget *table; + guint rgba; /* RRGGBBAA encoded colour */ + guint16 alpha; /* alpha channel 16 bits */ + GdkColor col; /* GdkColor colour representation */ - /* create header */ - label = gtk_label_new (NULL); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_label_set_markup (GTK_LABEL (label), - _("<b>Colours:</b>")); - gtk_box_pack_start (vbox, label, FALSE, TRUE, 0); + /* create header */ + label = gtk_label_new (NULL); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_label_set_markup (GTK_LABEL (label), _("<b>Colours:</b>")); + gtk_box_pack_start (vbox, label, FALSE, TRUE, 0); - /* horizontal box to contain the radio buttons */ - table = gtk_table_new (3, 6, TRUE); - gtk_table_set_col_spacings (GTK_TABLE (table), 10); - gtk_table_set_row_spacings (GTK_TABLE (table), 3); - gtk_box_pack_start (vbox, table, FALSE, TRUE, 0); + /* container */ + table = gtk_table_new (4, 6, TRUE); + gtk_table_set_col_spacings (GTK_TABLE (table), 10); + gtk_table_set_row_spacings (GTK_TABLE (table), 3); + gtk_box_pack_start (vbox, table, FALSE, TRUE, 0); - /* background */ - label = gtk_label_new (_("Ground Station:")); - gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, - GTK_FILL, GTK_FILL, 0, 0); - qthc = gtk_color_button_new (); - gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (qthc), TRUE); - gtk_table_attach (GTK_TABLE (table), qthc, 1, 2, 0, 1, - GTK_FILL , GTK_FILL, 0, 0); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, qthc, - _("Click to select a colour"), - NULL); - if (cfg != NULL) { - rgba = mod_cfg_get_int (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_QTH_COL, - SAT_CFG_INT_MAP_QTH_COL); - } - else { - rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_QTH_COL); - } - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (qthc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (qthc), alpha); - g_signal_connect (qthc, "color-set", G_CALLBACK (colour_changed), NULL); + /* background */ + label = gtk_label_new (_("Ground Station:")); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, + GTK_FILL, GTK_FILL, 0, 0); + qthc = gtk_color_button_new (); + gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (qthc), TRUE); + gtk_table_attach (GTK_TABLE (table), qthc, 1, 2, 0, 1, + GTK_FILL , GTK_FILL, 0, 0); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, qthc, + _("Click to select a colour"), + NULL); + if (cfg != NULL) { + rgba = mod_cfg_get_int (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_QTH_COL, + SAT_CFG_INT_MAP_QTH_COL); + } + else { + rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_QTH_COL); + } + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (qthc), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (qthc), alpha); + g_signal_connect (qthc, "color-set", G_CALLBACK (colour_changed), NULL); - /* Grid in case it is enabled */ - label = gtk_label_new (_("Grid:")); - gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, 2, 3, 0, 1, - GTK_FILL, GTK_FILL, 0, 0); - gridc = gtk_color_button_new (); - gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (gridc), TRUE); - gtk_table_attach (GTK_TABLE (table), gridc, 3, 4, 0, 1, - GTK_FILL , GTK_FILL, 0, 0); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, gridc, - _("Click to select the grid colour"), - NULL); - if (cfg != NULL) { - rgba = mod_cfg_get_int (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_GRID_COL, - SAT_CFG_INT_MAP_GRID_COL); - } - else { - rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_GRID_COL); - } - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (gridc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (gridc), alpha); - g_signal_connect (gridc, "color-set", G_CALLBACK (colour_changed), NULL); + /* Grid in case it is enabled */ + label = gtk_label_new (_("Grid:")); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 0, 1, + GTK_FILL, GTK_FILL, 0, 0); + gridc = gtk_color_button_new (); + gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (gridc), TRUE); + gtk_table_attach (GTK_TABLE (table), gridc, 3, 4, 0, 1, + GTK_FILL , GTK_FILL, 0, 0); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, gridc, + _("Click to select the grid colour"), + NULL); + if (cfg != NULL) { + rgba = mod_cfg_get_int (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_GRID_COL, + SAT_CFG_INT_MAP_GRID_COL); + } + else { + rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_GRID_COL); + } + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (gridc), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (gridc), alpha); + g_signal_connect (gridc, "color-set", G_CALLBACK (colour_changed), NULL); - /* tick labels */ - label = gtk_label_new (_("Tick Labels:")); - gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, 4, 5, 0, 1, - GTK_FILL, GTK_FILL, 0, 0); - tickc = gtk_color_button_new (); - gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (tickc), TRUE); - gtk_table_attach (GTK_TABLE (table), tickc, 5, 6, 0, 1, - GTK_FILL , GTK_FILL, 0, 0); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, tickc, - _("Click to select the colour for tick labels"), - NULL); - if (cfg != NULL) { - rgba = mod_cfg_get_int (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_TICK_COL, - SAT_CFG_INT_MAP_TICK_COL); - } - else { - rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_TICK_COL); - } - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (tickc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (tickc), alpha); - g_signal_connect (tickc, "color-set", G_CALLBACK (colour_changed), NULL); + /* tick labels */ + label = gtk_label_new (_("Tick Labels:")); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 4, 5, 0, 1, + GTK_FILL, GTK_FILL, 0, 0); + tickc = gtk_color_button_new (); + gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (tickc), TRUE); + gtk_table_attach (GTK_TABLE (table), tickc, 5, 6, 0, 1, + GTK_FILL , GTK_FILL, 0, 0); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, tickc, + _("Click to select the colour for tick labels"), + NULL); + if (cfg != NULL) { + rgba = mod_cfg_get_int (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_TICK_COL, + SAT_CFG_INT_MAP_TICK_COL); + } + else { + rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_TICK_COL); + } + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (tickc), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (tickc), alpha); + g_signal_connect (tickc, "color-set", G_CALLBACK (colour_changed), NULL); - /* satellite */ - label = gtk_label_new (_("Satellite:")); - gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, - GTK_FILL, GTK_FILL, 0, 0); - satc = gtk_color_button_new (); - gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (satc), TRUE); - gtk_table_attach (GTK_TABLE (table), satc, 1, 2, 1, 2, - GTK_FILL , GTK_FILL, 0, 0); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, satc, - _("Click to select satellite colour"), - NULL); - if (cfg != NULL) { - rgba = mod_cfg_get_int (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_SAT_COL, - SAT_CFG_INT_MAP_SAT_COL); - } - else { - rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_SAT_COL); - } - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (satc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (satc), alpha); - g_signal_connect (satc, "color-set", G_CALLBACK (colour_changed), NULL); + /* satellite */ + label = gtk_label_new (_("Satellite:")); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + GTK_FILL, GTK_FILL, 0, 0); + satc = gtk_color_button_new (); + gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (satc), TRUE); + gtk_table_attach (GTK_TABLE (table), satc, 1, 2, 1, 2, + GTK_FILL , GTK_FILL, 0, 0); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, satc, + _("Click to select satellite colour"), + NULL); + if (cfg != NULL) { + rgba = mod_cfg_get_int (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SAT_COL, + SAT_CFG_INT_MAP_SAT_COL); + } + else { + rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_SAT_COL); + } + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (satc), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (satc), alpha); + g_signal_connect (satc, "color-set", G_CALLBACK (colour_changed), NULL); - /* selected satellite */ - label = gtk_label_new (_("Selected Sat.:")); - gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, 2, 3, 1, 2, - GTK_FILL, GTK_FILL, 0, 0); - ssatc = gtk_color_button_new (); - gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (ssatc), TRUE); - gtk_table_attach (GTK_TABLE (table), ssatc, 3, 4, 1, 2, - GTK_FILL , GTK_FILL, 0, 0); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, ssatc, - _("Click to select colour for selected satellites"), - NULL); - if (cfg != NULL) { - rgba = mod_cfg_get_int (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_SAT_SEL_COL, - SAT_CFG_INT_MAP_SAT_SEL_COL); - } - else { - rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_SAT_SEL_COL); - } - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (ssatc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (ssatc), alpha); - g_signal_connect (ssatc, "color-set", G_CALLBACK (colour_changed), NULL); + /* selected satellite */ + label = gtk_label_new (_("Selected Sat.:")); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 1, 2, + GTK_FILL, GTK_FILL, 0, 0); + ssatc = gtk_color_button_new (); + gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (ssatc), TRUE); + gtk_table_attach (GTK_TABLE (table), ssatc, 3, 4, 1, 2, + GTK_FILL , GTK_FILL, 0, 0); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, ssatc, + _("Click to select colour for selected satellites"), + NULL); + if (cfg != NULL) { + rgba = mod_cfg_get_int (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SAT_SEL_COL, + SAT_CFG_INT_MAP_SAT_SEL_COL); + } + else { + rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_SAT_SEL_COL); + } + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (ssatc), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (ssatc), alpha); + g_signal_connect (ssatc, "color-set", G_CALLBACK (colour_changed), NULL); - /* tack */ - label = gtk_label_new (_("Ground Track:")); - gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, 4, 5, 1, 2, - GTK_FILL, GTK_FILL, 0, 0); - trackc = gtk_color_button_new (); - gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (trackc), TRUE); - gtk_table_attach (GTK_TABLE (table), trackc, 5, 6, 1, 2, - GTK_FILL , GTK_FILL, 0, 0); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, trackc, - _("Click to select ground track colour"), - NULL); - if (cfg != NULL) { - rgba = mod_cfg_get_int (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_TRACK_COL, - SAT_CFG_INT_MAP_TRACK_COL); - } - else { - rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_TRACK_COL); - } - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (trackc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (trackc), alpha); - g_signal_connect (trackc, "color-set", G_CALLBACK (colour_changed), NULL); + /* tack */ + label = gtk_label_new (_("Ground Track:")); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 4, 5, 1, 2, + GTK_FILL, GTK_FILL, 0, 0); + trackc = gtk_color_button_new (); + gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (trackc), TRUE); + gtk_table_attach (GTK_TABLE (table), trackc, 5, 6, 1, 2, + GTK_FILL , GTK_FILL, 0, 0); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, trackc, + _("Click to select ground track colour"), + NULL); + if (cfg != NULL) { + rgba = mod_cfg_get_int (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_TRACK_COL, + SAT_CFG_INT_MAP_TRACK_COL); + } + else { + rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_TRACK_COL); + } + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (trackc), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (trackc), alpha); + g_signal_connect (trackc, "color-set", G_CALLBACK (colour_changed), NULL); - /* coverage */ - label = gtk_label_new (_("Area Coverage:")); - gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, - GTK_FILL, GTK_FILL, 0, 0); - covc = gtk_color_button_new (); - gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (covc), TRUE); - gtk_table_attach (GTK_TABLE (table), covc, 1, 2, 2, 3, - GTK_FILL , GTK_FILL, 0, 0); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, covc, - _("Colour for coverage Area (make it transparent)"), - NULL); - if (cfg != NULL) { - rgba = mod_cfg_get_int (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_SAT_COV_COL, - SAT_CFG_INT_MAP_SAT_COV_COL); - } - else { - rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_SAT_COV_COL); - } - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (covc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (covc), alpha); - g_signal_connect (covc, "color-set", G_CALLBACK (colour_changed), NULL); + /* coverage */ + label = gtk_label_new (_("Area Coverage:")); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, + GTK_FILL, GTK_FILL, 0, 0); + covc = gtk_color_button_new (); + gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (covc), TRUE); + gtk_table_attach (GTK_TABLE (table), covc, 1, 2, 2, 3, + GTK_FILL , GTK_FILL, 0, 0); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, covc, + _("Colour for coverage Area (make it transparent)"), + NULL); + if (cfg != NULL) { + rgba = mod_cfg_get_int (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SAT_COV_COL, + SAT_CFG_INT_MAP_SAT_COV_COL); + } + else { + rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_SAT_COV_COL); + } + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (covc), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (covc), alpha); + g_signal_connect (covc, "color-set", G_CALLBACK (colour_changed), NULL); - /* Info foreground */ - label = gtk_label_new (_("Info Text FG:")); - gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, 2, 3, 2, 3, - GTK_FILL, GTK_FILL, 0, 0); - infofg = gtk_color_button_new (); - gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (infofg), TRUE); - gtk_table_attach (GTK_TABLE (table), infofg, 3, 4, 2, 3, - GTK_FILL , GTK_FILL, 0, 0); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, infofg, - _("Click to select info text foreground colour"), - NULL); - if (cfg != NULL) { - rgba = mod_cfg_get_int (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_INFO_COL, - SAT_CFG_INT_MAP_INFO_COL); - } - else { - rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_INFO_COL); - } - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (infofg), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (infofg), alpha); - g_signal_connect (infofg, "color-set", G_CALLBACK (colour_changed), NULL); + /* Info foreground */ + label = gtk_label_new (_("Info Text FG:")); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 2, 3, + GTK_FILL, GTK_FILL, 0, 0); + infofg = gtk_color_button_new (); + gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (infofg), TRUE); + gtk_table_attach (GTK_TABLE (table), infofg, 3, 4, 2, 3, + GTK_FILL , GTK_FILL, 0, 0); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, infofg, + _("Click to select info text foreground colour"), + NULL); + if (cfg != NULL) { + rgba = mod_cfg_get_int (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_INFO_COL, + SAT_CFG_INT_MAP_INFO_COL); + } + else { + rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_INFO_COL); + } + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (infofg), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (infofg), alpha); + g_signal_connect (infofg, "color-set", G_CALLBACK (colour_changed), NULL); - /* Info background */ - label = gtk_label_new (_("Info Text BG:")); - gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, 4, 5, 2, 3, - GTK_FILL, GTK_FILL, 0, 0); - infobg = gtk_color_button_new (); - gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (infobg), TRUE); - gtk_table_attach (GTK_TABLE (table), infobg, 5, 6, 2, 3, - GTK_FILL , GTK_FILL, 0, 0); - tips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tips, infobg, - _("Click to select info text background colour"), - NULL); - if (cfg != NULL) { - rgba = mod_cfg_get_int (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_INFO_BGD_COL, - SAT_CFG_INT_MAP_INFO_BGD_COL); - } - else { - rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_INFO_BGD_COL); - } - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (infobg), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (infobg), alpha); - g_signal_connect (infobg, "color-set", G_CALLBACK (colour_changed), NULL); + /* Info background */ + label = gtk_label_new (_("Info Text BG:")); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 4, 5, 2, 3, + GTK_FILL, GTK_FILL, 0, 0); + infobg = gtk_color_button_new (); + gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (infobg), TRUE); + gtk_table_attach (GTK_TABLE (table), infobg, 5, 6, 2, 3, + GTK_FILL , GTK_FILL, 0, 0); + tips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tips, infobg, + _("Click to select info text background colour"), + NULL); + if (cfg != NULL) { + rgba = mod_cfg_get_int (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_INFO_BGD_COL, + SAT_CFG_INT_MAP_INFO_BGD_COL); + } + else { + rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_INFO_BGD_COL); + } + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (infobg), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (infobg), alpha); + g_signal_connect (infobg, "color-set", G_CALLBACK (colour_changed), NULL); + /* Shadow */ + label = gtk_label_new (_("Shadow:")); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, + GTK_FILL, GTK_FILL, 0, 0); + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), _("<i>Transparent</i>")); + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 1, 2, 3, 4, + GTK_FILL, GTK_FILL, 0, 0); + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), _("<i>Strong</i>")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 5, 6, 3, 4, + GTK_FILL, GTK_FILL, 0, 0); + shadow = gtk_hscale_new_with_range (0, 255, 1); + gtk_scale_set_draw_value (GTK_SCALE (shadow), FALSE); + if (cfg != NULL) { + rgba = mod_cfg_get_int (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_SHADOW_ALPHA, + SAT_CFG_INT_MAP_SHADOW_ALPHA); + } + else { + rgba = sat_cfg_get_int (SAT_CFG_INT_MAP_SHADOW_ALPHA); + } + gtk_range_set_value (GTK_RANGE (shadow), rgba); + gtk_widget_set_tooltip_text (shadow, + _("Specifies how strong the shadow under the satellite marker should be. "\ + "The shadow improves the visibility of the satellites where the colour of "\ + "the background is light, e.g. the South Pole.\n\n"\ + "Transparent corresponds to no shadow.")); + gtk_table_attach (GTK_TABLE (table), shadow, 2, 5, 3, 4, + GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0); + g_signal_connect (shadow, "value-changed", G_CALLBACK (shadow_changed), NULL); + } @@ -589,40 +625,39 @@ * the satellite ground track for. * */ -static void -create_orbit_selector (GKeyFile *cfg, GtkBox *vbox) +static void create_orbit_selector (GKeyFile *cfg, GtkBox *vbox) { - GtkWidget *label; - GtkWidget *hbox; - gint onum; + GtkWidget *label; + GtkWidget *hbox; + gint onum; - hbox = gtk_hbox_new (FALSE, 10); - gtk_box_pack_start (vbox, hbox, FALSE, TRUE, 0); + hbox = gtk_hbox_new (FALSE, 10); + gtk_box_pack_start (vbox, hbox, FALSE, TRUE, 0); - label = gtk_label_new (_("Display ground track for")); - gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + label = gtk_label_new (_("Display ground track for")); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); - orbit = gtk_spin_button_new_with_range (1, 10, 1); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON (orbit), 0); - gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (orbit), TRUE); + orbit = gtk_spin_button_new_with_range (1, 10, 1); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON (orbit), 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (orbit), TRUE); - if (cfg != NULL) { - onum = mod_cfg_get_int (cfg, - MOD_CFG_MAP_SECTION, - MOD_CFG_MAP_TRACK_NUM, - SAT_CFG_INT_MAP_TRACK_NUM); - } - else { - onum = sat_cfg_get_int (SAT_CFG_INT_MAP_TRACK_NUM); - } - gtk_spin_button_set_value (GTK_SPIN_BUTTON (orbit), onum); - g_signal_connect (G_OBJECT (orbit), "value-changed", - G_CALLBACK (orbit_changed), NULL); + if (cfg != NULL) { + onum = mod_cfg_get_int (cfg, + MOD_CFG_MAP_SECTION, + MOD_CFG_MAP_TRACK_NUM, + SAT_CFG_INT_MAP_TRACK_NUM); + } + else { + onum = sat_cfg_get_int (SAT_CFG_INT_MAP_TRACK_NUM); + } + gtk_spin_button_set_value (GTK_SPIN_BUTTON (orbit), onum); + g_signal_connect (G_OBJECT (orbit), "value-changed", + G_CALLBACK (orbit_changed), NULL); - gtk_box_pack_start (GTK_BOX (hbox), orbit, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), orbit, FALSE, FALSE, 0); - label = gtk_label_new (_("orbit(s)")); - gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + label = gtk_label_new (_("orbit(s)")); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); } @@ -633,35 +668,34 @@ * * This function creates and sets up the RESET button. */ -static void -create_reset_button (GKeyFile *cfg, GtkBox *vbox) +static void create_reset_button (GKeyFile *cfg, GtkBox *vbox) { - GtkWidget *button; - GtkWidget *butbox; - GtkTooltips *tips; + GtkWidget *button; + GtkWidget *butbox; + GtkTooltips *tips; - button = gtk_button_new_with_label (_("Reset")); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (reset_cb), cfg); + button = gtk_button_new_with_label (_("Reset")); + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (reset_cb), cfg); - tips = gtk_tooltips_new (); - if (cfg == NULL) { - gtk_tooltips_set_tip (tips, button, - _("Reset settings to the default values."), - NULL); - } - else { - gtk_tooltips_set_tip (tips, button, - _("Reset module settings to the global values."), - NULL); - } + tips = gtk_tooltips_new (); + if (cfg == NULL) { + gtk_tooltips_set_tip (tips, button, + _("Reset settings to the default values."), + NULL); + } + else { + gtk_tooltips_set_tip (tips, button, + _("Reset module settings to the global values."), + NULL); + } - butbox = gtk_hbutton_box_new (); - gtk_button_box_set_layout (GTK_BUTTON_BOX (butbox), GTK_BUTTONBOX_END); - gtk_box_pack_end (GTK_BOX (butbox), button, FALSE, TRUE, 10); + butbox = gtk_hbutton_box_new (); + gtk_button_box_set_layout (GTK_BUTTON_BOX (butbox), GTK_BUTTONBOX_END); + gtk_box_pack_end (GTK_BOX (butbox), button, FALSE, TRUE, 10); - gtk_box_pack_end (vbox, butbox, FALSE, TRUE, 0); + gtk_box_pack_end (vbox, butbox, FALSE, TRUE, 0); } @@ -674,10 +708,9 @@ * We don't need to do anything but set the dirty flag since the values can * always be obtained from the global widgets. */ -static void -content_changed (GtkToggleButton *but, gpointer data) +static void content_changed (GtkToggleButton *but, gpointer data) { - dirty = TRUE; + dirty = TRUE; } @@ -688,20 +721,28 @@ * We don't need to do anything but set the dirty flag since the values can * always be obtained from the global widgets. */ -static void -colour_changed (GtkWidget *but, gpointer data) +static void colour_changed (GtkWidget *but, gpointer data) { - dirty = TRUE; + dirty = TRUE; } -static void -orbit_changed (GtkWidget *spin, gpointer data) +static void orbit_changed (GtkWidget *spin, gpointer data) { - dirty = TRUE; + dirty = TRUE; } +static gboolean shadow_changed (GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data) +{ + dirty = TRUE; + /* prevent other signal handlers from being executed */ + return TRUE; +} + + + + /** \brief Managge RESET button signals. * \param button The RESET button. * \param cfg Pointer to the module configuration or NULL in global mode. @@ -711,427 +752,443 @@ * in "local" mode (when cfg != NULL) the function will reset the module settings to * the global settings. This is done by removing the corresponding key from the GKeyFile. */ -static void -reset_cb (GtkWidget *button, gpointer cfg) +static void reset_cb (GtkWidget *button, gpointer cfg) { - GdkColor col; - guint16 alpha; - guint rgba; + GdkColor col; + guint16 alpha; + guint rgba; - if (cfg == NULL) { - /* global mode, get defaults */ + if (cfg == NULL) { + /* global mode, get defaults */ - /* background map */ - g_free (mapf); - mapf = sat_cfg_get_str_def (SAT_CFG_STR_MAP_FILE); - update_map_icon (); + /* background map */ + g_free (mapf); + mapf = sat_cfg_get_str_def (SAT_CFG_STR_MAP_FILE); + update_map_icon (); - /* extra contents */ - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (qth), - sat_cfg_get_bool_def (SAT_CFG_BOOL_MAP_SHOW_QTH_INFO)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (next), - sat_cfg_get_bool_def (SAT_CFG_BOOL_MAP_SHOW_NEXT_EV)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (curs), - sat_cfg_get_bool_def (SAT_CFG_BOOL_MAP_SHOW_CURS_TRACK)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (grid), - sat_cfg_get_bool_def (SAT_CFG_BOOL_MAP_SHOW_GRID)); + /* extra contents */ + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (qth), + sat_cfg_get_bool_def (SAT_CFG_BOOL_MAP_SHOW_QTH_INFO)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (next), + sat_cfg_get_bool_def (SAT_CFG_BOOL_MAP_SHOW_NEXT_EV)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (curs), + sat_cfg_get_bool_def (SAT_CFG_BOOL_MAP_SHOW_CURS_TRACK)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (grid), + sat_cfg_get_bool_def (SAT_CFG_BOOL_MAP_SHOW_GRID)); - /* colours */ - rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_QTH_COL); - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (qthc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (qthc), alpha); + /* colours */ + rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_QTH_COL); + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (qthc), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (qthc), alpha); - rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_GRID_COL); - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (gridc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (gridc), alpha); + rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_GRID_COL); + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (gridc), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (gridc), alpha); - rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_TICK_COL); - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (tickc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (tickc), alpha); - - rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_SAT_COL); - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (satc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (satc), alpha); + rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_TICK_COL); + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (tickc), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (tickc), alpha); - rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_SAT_SEL_COL); - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (ssatc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (ssatc), alpha); + rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_SAT_COL); + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (satc), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (satc), alpha); - rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_TRACK_COL); - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (trackc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (trackc), alpha); + rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_SAT_SEL_COL); + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (ssatc), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (ssatc), alpha); - rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_SAT_COV_COL); - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (covc), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (covc), alpha); + rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_TRACK_COL); + rgba2gdk (rgba, &col, &alpha); + gtk_color_button_set_color (GTK_COLOR_BUTTON (trackc), &col); + gtk_color_button_set_alpha (GTK_COLOR_BUTTON (trackc), alpha); - rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_INFO_COL); - rgba2gdk (rgba, &col, &alpha); - gtk_color_button_set_color (GTK_COLOR_BUTTON (infofg), &col); - gtk_color_button_set_alpha (GTK_COLOR_BUTTON (infofg), alpha); + rgba = sat_cfg_get_int_def (SAT_CFG_INT_MAP_SA... [truncated message content] |
From: <cs...@us...> - 2010-01-05 14:04:45
|
Revision: 578 http://gpredict.svn.sourceforge.net/gpredict/?rev=578&view=rev Author: csete Date: 2010-01-05 14:04:39 +0000 (Tue, 05 Jan 2010) Log Message: ----------- Leave 3px room between satellite label and marker. Modified Paths: -------------- trunk/ChangeLog trunk/src/gtk-sat-map.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-01-05 11:24:59 UTC (rev 577) +++ trunk/ChangeLog 2010-01-05 14:04:39 UTC (rev 578) @@ -1,3 +1,9 @@ +2010-01-05 Alexandru Csete <oz9aec at gmail.com> + + * src/gtk-sat-map-c: + Leave 3px room between satellite label and amrker. + + 2010-01-04 Alexandru Csete <oz9aec at gmail.com> * src/main.c: Modified: trunk/src/gtk-sat-map.c =================================================================== --- trunk/src/gtk-sat-map.c 2010-01-05 11:24:59 UTC (rev 577) +++ trunk/src/gtk-sat-map.c 2010-01-05 14:04:39 UTC (rev 578) @@ -1813,7 +1813,7 @@ NULL); } else if ((satmap->width - x ) < 50) { g_object_set (obj->label, - "x", (gdouble) (x), + "x", (gdouble) (x+3), "y", (gdouble) (y), "anchor", GTK_ANCHOR_EAST, NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-05 11:25:06
|
Revision: 577 http://gpredict.svn.sourceforge.net/gpredict/?rev=577&view=rev Author: csete Date: 2010-01-05 11:24:59 +0000 (Tue, 05 Jan 2010) Log Message: ----------- Updated translations. Modified Paths: -------------- trunk/po/en_GB.po trunk/po/en_US.po trunk/po/fr.po trunk/po/gpredict.pot Modified: trunk/po/en_GB.po =================================================================== --- trunk/po/en_GB.po 2010-01-05 01:15:29 UTC (rev 576) +++ trunk/po/en_GB.po 2010-01-05 11:24:59 UTC (rev 577) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: gpredict\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-26 23:58+0100\n" +"POT-Creation-Date: 2010-01-05 12:24+0100\n" "PO-Revision-Date: 2009-08-05 00:53+0100\n" "Last-Translator: Michael Stephenson <mic...@go...>\n" "Language-Team: British English\n" @@ -68,7 +68,7 @@ #. window title #. icon file name #. create window title and file name for window icon -#: ../src/about.c:97 ../src/main.c:221 ../src/sat-log-browser.c:462 +#: ../src/about.c:97 ../src/main.c:249 ../src/sat-log-browser.c:462 #: ../src/sat-log.c:58 msgid "GPREDICT" msgstr "GPREDICT" @@ -1144,7 +1144,7 @@ msgid "%s: Satellite #%d removed from list." msgstr "%s: Satellite #%d removed from list." -#: ../src/gtk-sat-list.c:952 ../src/sat-pass-dialogs.c:702 +#: ../src/gtk-sat-list.c:952 ../src/sat-pass-dialogs.c:698 #: ../src/sat-pref-qth.c:769 #, c-format msgid "%s:%d: Invalid column: %d" @@ -1160,8 +1160,8 @@ msgid "%s:%d Failed to get data for %d." msgstr "%s:%d Failed to get data for %d." -#: ../src/gtk-sat-list.c:1307 ../src/sat-pass-dialogs.c:1421 -#: ../src/sat-pass-dialogs.c:1470 +#: ../src/gtk-sat-list.c:1307 ../src/sat-pass-dialogs.c:1399 +#: ../src/sat-pass-dialogs.c:1448 #, c-format msgid "%s:%d: There is no selection; skip popup." msgstr "%s:%d: There is no selection; skip popup." @@ -1791,6 +1791,11 @@ msgid "%s:%s: Failed to read %s" msgstr "%s:%d: Failed to read %s" +#: ../src/gtk-sat-selector.c:772 +#, fuzzy, c-format +msgid "%s: Error getting %dth satellite" +msgstr "%s: Error reading %s: %s" + #: ../src/gtk-sat-tree.c:232 ../src/mod-cfg.c:630 msgid "Epoch" msgstr "Epoch" @@ -2087,11 +2092,23 @@ msgid "%s: No selection found!" msgstr "%s: No selection found!" -#: ../src/main.c:64 +#: ../src/main.c:75 msgid "just to have a pot" msgstr "just to have a pot" -#: ../src/main.c:120 +#: ../src/main.c:129 +msgid "" +"Gpredict is a graphical real-time satellite tracking and orbit prediction " +"program.\n" +"Gpredict does not require any command line options for nominal operation." +msgstr "" + +#: ../src/main.c:135 +#, c-format +msgid "Option parsing failed: %s\n" +msgstr "" + +#: ../src/main.c:158 #, fuzzy, c-format msgid "" "%s: User config check failed (code %d). This is fatal.\n" @@ -2102,22 +2119,22 @@ "A possible solution would be to remove the .gpredict2 data dir\n" "in your home directory" -#: ../src/main.c:468 +#: ../src/main.c:505 #, c-format msgid "%s: Time threshold has been passed." msgstr "%s: Time threshold has been passed." -#: ../src/main.c:476 +#: ../src/main.c:513 #, c-format msgid "%s: Starting new update thread." msgstr "%s: Starting new update thread." -#: ../src/main.c:484 +#: ../src/main.c:521 #, c-format msgid "%s: Failed to create TLE update thread (%s)" msgstr "%s: Failed to create TLE update thread (%s)" -#: ../src/main.c:494 +#: ../src/main.c:531 msgid "" "Your TLE files are getting out of date.\n" "You can update them by selecting\n" @@ -2129,11 +2146,31 @@ "<b>Edit -> Update TLE</b>\n" "in the menubar." -#: ../src/main.c:525 +#: ../src/main.c:562 #, c-format msgid "%s: Could not find TLE monitoring task (ID = %d)" msgstr "%s: Could not find TLE monitoring task (ID = %d)" +#: ../src/main.c:607 +#, fuzzy, c-format +msgid "%s: Cleaning TLE data in %s" +msgstr "%s: Running TLE update from %s" + +#: ../src/main.c:616 ../src/main.c:657 +#, fuzzy, c-format +msgid "%s: Failed to delete %s" +msgstr "%s:%d: Failed to delete %s." + +#: ../src/main.c:620 ../src/main.c:661 +#, fuzzy, c-format +msgid "%s: Removed %s" +msgstr "%s:%d: Removed %s" + +#: ../src/main.c:648 +#, fuzzy, c-format +msgid "%s: Cleaning transponder data in %s" +msgstr "%s: Creating ground track for %s" + #. create a new file chooser dialogue in "open file" mode #: ../src/map-selector.c:76 msgid "Select Map" @@ -3553,31 +3590,31 @@ msgid "Visibility during pass" msgstr "Visibility during pass" -#: ../src/sat-pass-dialogs.c:458 +#: ../src/sat-pass-dialogs.c:457 msgid "Data" msgstr "Data" -#: ../src/sat-pass-dialogs.c:469 +#: ../src/sat-pass-dialogs.c:468 msgid "Polar" msgstr "Polar" -#: ../src/sat-pass-dialogs.c:480 +#: ../src/sat-pass-dialogs.c:479 msgid "Az/El" msgstr "Az/El" #. create dialog -#: ../src/sat-pass-dialogs.c:486 +#: ../src/sat-pass-dialogs.c:485 #, c-format msgid "Pass details for %s (orbit %d)" msgstr "Pass details for %s (orbit %d)" -#: ../src/sat-pass-dialogs.c:549 ../src/sat-pass-dialogs.c:1161 +#: ../src/sat-pass-dialogs.c:547 ../src/sat-pass-dialogs.c:1146 #, c-format msgid "%s: PRINT not implemented" msgstr "%s: PRINT not implemented" #. create dialog -#: ../src/sat-pass-dialogs.c:1100 +#: ../src/sat-pass-dialogs.c:1086 #, c-format msgid "Upcoming passes for %s" msgstr "Upcoming passes for %s" @@ -5151,74 +5188,74 @@ msgstr "Eclipsed" #. create the dialog -#: ../src/save-pass.c:114 +#: ../src/save-pass.c:113 msgid "Save Pass Details" msgstr "Save Pass Details" #. directory chooser -#: ../src/save-pass.c:132 ../src/save-pass.c:296 +#: ../src/save-pass.c:131 ../src/save-pass.c:294 msgid "Save in folder:" msgstr "Save in folder:" -#: ../src/save-pass.c:136 ../src/save-pass.c:300 +#: ../src/save-pass.c:135 ../src/save-pass.c:298 msgid "Select a folder" msgstr "Select a folder" #. file name -#: ../src/save-pass.c:150 ../src/save-pass.c:314 +#: ../src/save-pass.c:149 ../src/save-pass.c:312 msgid "Save using file name:" msgstr "Save using file name:" #. file format -#: ../src/save-pass.c:169 ../src/save-pass.c:333 +#: ../src/save-pass.c:168 ../src/save-pass.c:331 msgid "Save as:" msgstr "Save as:" -#: ../src/save-pass.c:174 ../src/save-pass.c:338 +#: ../src/save-pass.c:173 ../src/save-pass.c:336 msgid "Plain text (*.txt)" msgstr "Plain text (*.txt)" #. file contents -#: ../src/save-pass.c:184 ../src/save-pass.c:348 +#: ../src/save-pass.c:183 ../src/save-pass.c:346 msgid "File contents:" msgstr "File contents:" -#: ../src/save-pass.c:189 +#: ../src/save-pass.c:188 msgid "Info+header+data" msgstr "Info+header+data" -#: ../src/save-pass.c:190 +#: ../src/save-pass.c:189 msgid "Header + data" msgstr "Header + data" -#: ../src/save-pass.c:191 +#: ../src/save-pass.c:190 msgid "Data only" msgstr "Data only" #. create the dialog -#: ../src/save-pass.c:278 +#: ../src/save-pass.c:276 msgid "Save Passes" msgstr "Save Passes" -#: ../src/save-pass.c:353 +#: ../src/save-pass.c:351 msgid "Complete report" msgstr "Complete report" -#: ../src/save-pass.c:354 +#: ../src/save-pass.c:352 msgid "Summary" msgstr "Summary" -#: ../src/save-pass.c:542 ../src/save-pass.c:644 +#: ../src/save-pass.c:538 ../src/save-pass.c:639 #, c-format msgid "%s: Invalid file format: %d" msgstr "%s: Invalid file format: %d" -#: ../src/save-pass.c:667 +#: ../src/save-pass.c:661 #, c-format msgid "%s: Could not create file %s (%s)" msgstr "%s: Could not create file %s (%s)" -#: ../src/save-pass.c:676 +#: ../src/save-pass.c:670 #, c-format msgid "" "Could not create file %s\n" @@ -5229,12 +5266,12 @@ "\n" "%s" -#: ../src/save-pass.c:691 +#: ../src/save-pass.c:685 #, c-format msgid "%s: An error occurred while saving data to %s (%s)" msgstr "%s: An error occurred while saving data to %s (%s)" -#: ../src/save-pass.c:699 +#: ../src/save-pass.c:693 #, c-format msgid "" "An error occurred while saving data to %s\n" @@ -5245,7 +5282,7 @@ "\n" "%s" -#: ../src/save-pass.c:707 +#: ../src/save-pass.c:701 #, c-format msgid "%s: Written %d characters to %s" msgstr "%s: Written %d characters to %s" Modified: trunk/po/en_US.po =================================================================== --- trunk/po/en_US.po 2010-01-05 01:15:29 UTC (rev 576) +++ trunk/po/en_US.po 2010-01-05 11:24:59 UTC (rev 577) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: gpredict\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-26 23:58+0100\n" +"POT-Creation-Date: 2010-01-05 12:24+0100\n" "PO-Revision-Date: 2009-08-05 00:53+0100\n" "Last-Translator: Michael Stephenson <mic...@go...>\n" "Language-Team: US English\n" @@ -68,7 +68,7 @@ #. window title #. icon file name #. create window title and file name for window icon -#: ../src/about.c:97 ../src/main.c:221 ../src/sat-log-browser.c:462 +#: ../src/about.c:97 ../src/main.c:249 ../src/sat-log-browser.c:462 #: ../src/sat-log.c:58 msgid "GPREDICT" msgstr "GPREDICT" @@ -1144,7 +1144,7 @@ msgid "%s: Satellite #%d removed from list." msgstr "%s: Satellite #%d removed from list." -#: ../src/gtk-sat-list.c:952 ../src/sat-pass-dialogs.c:702 +#: ../src/gtk-sat-list.c:952 ../src/sat-pass-dialogs.c:698 #: ../src/sat-pref-qth.c:769 #, c-format msgid "%s:%d: Invalid column: %d" @@ -1160,8 +1160,8 @@ msgid "%s:%d Failed to get data for %d." msgstr "%s:%d Failed to get data for %d." -#: ../src/gtk-sat-list.c:1307 ../src/sat-pass-dialogs.c:1421 -#: ../src/sat-pass-dialogs.c:1470 +#: ../src/gtk-sat-list.c:1307 ../src/sat-pass-dialogs.c:1399 +#: ../src/sat-pass-dialogs.c:1448 #, c-format msgid "%s:%d: There is no selection; skip popup." msgstr "%s:%d: There is no selection; skip popup." @@ -1791,6 +1791,11 @@ msgid "%s:%s: Failed to read %s" msgstr "%s:%d: Failed to read %s" +#: ../src/gtk-sat-selector.c:772 +#, fuzzy, c-format +msgid "%s: Error getting %dth satellite" +msgstr "%s: Error reading %s: %s" + #: ../src/gtk-sat-tree.c:232 ../src/mod-cfg.c:630 msgid "Epoch" msgstr "Epoch" @@ -2087,11 +2092,23 @@ msgid "%s: No selection found!" msgstr "%s: No selection found!" -#: ../src/main.c:64 +#: ../src/main.c:75 msgid "just to have a pot" msgstr "just to have a pot" -#: ../src/main.c:120 +#: ../src/main.c:129 +msgid "" +"Gpredict is a graphical real-time satellite tracking and orbit prediction " +"program.\n" +"Gpredict does not require any command line options for nominal operation." +msgstr "" + +#: ../src/main.c:135 +#, c-format +msgid "Option parsing failed: %s\n" +msgstr "" + +#: ../src/main.c:158 #, fuzzy, c-format msgid "" "%s: User config check failed (code %d). This is fatal.\n" @@ -2102,22 +2119,22 @@ "A possible solution would be to remove the .gpredict2 data dir\n" "in your home directory" -#: ../src/main.c:468 +#: ../src/main.c:505 #, c-format msgid "%s: Time threshold has been passed." msgstr "%s: Time threshold has been passed." -#: ../src/main.c:476 +#: ../src/main.c:513 #, c-format msgid "%s: Starting new update thread." msgstr "%s: Starting new update thread." -#: ../src/main.c:484 +#: ../src/main.c:521 #, c-format msgid "%s: Failed to create TLE update thread (%s)" msgstr "%s: Failed to create TLE update thread (%s)" -#: ../src/main.c:494 +#: ../src/main.c:531 msgid "" "Your TLE files are getting out of date.\n" "You can update them by selecting\n" @@ -2129,11 +2146,31 @@ "<b>Edit -> Update TLE</b>\n" "in the menubar." -#: ../src/main.c:525 +#: ../src/main.c:562 #, c-format msgid "%s: Could not find TLE monitoring task (ID = %d)" msgstr "%s: Could not find TLE monitoring task (ID = %d)" +#: ../src/main.c:607 +#, fuzzy, c-format +msgid "%s: Cleaning TLE data in %s" +msgstr "%s: Running TLE update from %s" + +#: ../src/main.c:616 ../src/main.c:657 +#, fuzzy, c-format +msgid "%s: Failed to delete %s" +msgstr "%s:%d: Failed to delete %s." + +#: ../src/main.c:620 ../src/main.c:661 +#, fuzzy, c-format +msgid "%s: Removed %s" +msgstr "%s:%d: Removed %s" + +#: ../src/main.c:648 +#, fuzzy, c-format +msgid "%s: Cleaning transponder data in %s" +msgstr "%s: Creating ground track for %s" + #. create a new file chooser dialogue in "open file" mode #: ../src/map-selector.c:76 msgid "Select Map" @@ -3553,31 +3590,31 @@ msgid "Visibility during pass" msgstr "Visibility during pass" -#: ../src/sat-pass-dialogs.c:458 +#: ../src/sat-pass-dialogs.c:457 msgid "Data" msgstr "Data" -#: ../src/sat-pass-dialogs.c:469 +#: ../src/sat-pass-dialogs.c:468 msgid "Polar" msgstr "Polar" -#: ../src/sat-pass-dialogs.c:480 +#: ../src/sat-pass-dialogs.c:479 msgid "Az/El" msgstr "Az/El" #. create dialog -#: ../src/sat-pass-dialogs.c:486 +#: ../src/sat-pass-dialogs.c:485 #, c-format msgid "Pass details for %s (orbit %d)" msgstr "Pass details for %s (orbit %d)" -#: ../src/sat-pass-dialogs.c:549 ../src/sat-pass-dialogs.c:1161 +#: ../src/sat-pass-dialogs.c:547 ../src/sat-pass-dialogs.c:1146 #, c-format msgid "%s: PRINT not implemented" msgstr "%s: PRINT not implemented" #. create dialog -#: ../src/sat-pass-dialogs.c:1100 +#: ../src/sat-pass-dialogs.c:1086 #, c-format msgid "Upcoming passes for %s" msgstr "Upcoming passes for %s" @@ -5151,74 +5188,74 @@ msgstr "Eclipsed" #. create the dialog -#: ../src/save-pass.c:114 +#: ../src/save-pass.c:113 msgid "Save Pass Details" msgstr "Save Pass Details" #. directory chooser -#: ../src/save-pass.c:132 ../src/save-pass.c:296 +#: ../src/save-pass.c:131 ../src/save-pass.c:294 msgid "Save in folder:" msgstr "Save in folder:" -#: ../src/save-pass.c:136 ../src/save-pass.c:300 +#: ../src/save-pass.c:135 ../src/save-pass.c:298 msgid "Select a folder" msgstr "Select a folder" #. file name -#: ../src/save-pass.c:150 ../src/save-pass.c:314 +#: ../src/save-pass.c:149 ../src/save-pass.c:312 msgid "Save using file name:" msgstr "Save using file name:" #. file format -#: ../src/save-pass.c:169 ../src/save-pass.c:333 +#: ../src/save-pass.c:168 ../src/save-pass.c:331 msgid "Save as:" msgstr "Save as:" -#: ../src/save-pass.c:174 ../src/save-pass.c:338 +#: ../src/save-pass.c:173 ../src/save-pass.c:336 msgid "Plain text (*.txt)" msgstr "Plain text (*.txt)" #. file contents -#: ../src/save-pass.c:184 ../src/save-pass.c:348 +#: ../src/save-pass.c:183 ../src/save-pass.c:346 msgid "File contents:" msgstr "File contents:" -#: ../src/save-pass.c:189 +#: ../src/save-pass.c:188 msgid "Info+header+data" msgstr "Info+header+data" -#: ../src/save-pass.c:190 +#: ../src/save-pass.c:189 msgid "Header + data" msgstr "Header + data" -#: ../src/save-pass.c:191 +#: ../src/save-pass.c:190 msgid "Data only" msgstr "Data only" #. create the dialog -#: ../src/save-pass.c:278 +#: ../src/save-pass.c:276 msgid "Save Passes" msgstr "Save Passes" -#: ../src/save-pass.c:353 +#: ../src/save-pass.c:351 msgid "Complete report" msgstr "Complete report" -#: ../src/save-pass.c:354 +#: ../src/save-pass.c:352 msgid "Summary" msgstr "Summary" -#: ../src/save-pass.c:542 ../src/save-pass.c:644 +#: ../src/save-pass.c:538 ../src/save-pass.c:639 #, c-format msgid "%s: Invalid file format: %d" msgstr "%s: Invalid file format: %d" -#: ../src/save-pass.c:667 +#: ../src/save-pass.c:661 #, c-format msgid "%s: Could not create file %s (%s)" msgstr "%s: Could not create file %s (%s)" -#: ../src/save-pass.c:676 +#: ../src/save-pass.c:670 #, c-format msgid "" "Could not create file %s\n" @@ -5229,12 +5266,12 @@ "\n" "%s" -#: ../src/save-pass.c:691 +#: ../src/save-pass.c:685 #, c-format msgid "%s: An error occurred while saving data to %s (%s)" msgstr "%s: An error occurred while saving data to %s (%s)" -#: ../src/save-pass.c:699 +#: ../src/save-pass.c:693 #, c-format msgid "" "An error occurred while saving data to %s\n" @@ -5245,7 +5282,7 @@ "\n" "%s" -#: ../src/save-pass.c:707 +#: ../src/save-pass.c:701 #, c-format msgid "%s: Written %d characters to %s" msgstr "%s: Written %d characters to %s" Modified: trunk/po/fr.po =================================================================== --- trunk/po/fr.po 2010-01-05 01:15:29 UTC (rev 576) +++ trunk/po/fr.po 2010-01-05 11:24:59 UTC (rev 577) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: gpredict\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-26 23:58+0100\n" +"POT-Creation-Date: 2010-01-05 12:24+0100\n" "PO-Revision-Date: 2009-03-19 23:06+0200\n" "Last-Translator: Stéphane Fillod <fi...@us...>\n" "Language-Team: French <deb...@li...>\n" @@ -46,7 +46,7 @@ #. window title #. icon file name #. create window title and file name for window icon -#: ../src/about.c:97 ../src/main.c:221 ../src/sat-log-browser.c:462 +#: ../src/about.c:97 ../src/main.c:249 ../src/sat-log-browser.c:462 #: ../src/sat-log.c:58 msgid "GPREDICT" msgstr "GPREDICT" @@ -1078,7 +1078,7 @@ msgid "%s: Satellite #%d removed from list." msgstr "" -#: ../src/gtk-sat-list.c:952 ../src/sat-pass-dialogs.c:702 +#: ../src/gtk-sat-list.c:952 ../src/sat-pass-dialogs.c:698 #: ../src/sat-pref-qth.c:769 #, c-format msgid "%s:%d: Invalid column: %d" @@ -1094,8 +1094,8 @@ msgid "%s:%d Failed to get data for %d." msgstr "" -#: ../src/gtk-sat-list.c:1307 ../src/sat-pass-dialogs.c:1421 -#: ../src/sat-pass-dialogs.c:1470 +#: ../src/gtk-sat-list.c:1307 ../src/sat-pass-dialogs.c:1399 +#: ../src/sat-pass-dialogs.c:1448 #, c-format msgid "%s:%d: There is no selection; skip popup." msgstr "" @@ -1703,6 +1703,11 @@ msgid "%s:%s: Failed to read %s" msgstr "" +#: ../src/gtk-sat-selector.c:772 +#, c-format +msgid "%s: Error getting %dth satellite" +msgstr "" + #: ../src/gtk-sat-tree.c:232 ../src/mod-cfg.c:630 msgid "Epoch" msgstr "" @@ -1998,34 +2003,46 @@ msgid "%s: No selection found!" msgstr "" -#: ../src/main.c:64 +#: ../src/main.c:75 msgid "just to have a pot" msgstr "" -#: ../src/main.c:120 +#: ../src/main.c:129 +msgid "" +"Gpredict is a graphical real-time satellite tracking and orbit prediction " +"program.\n" +"Gpredict does not require any command line options for nominal operation." +msgstr "" + +#: ../src/main.c:135 #, c-format +msgid "Option parsing failed: %s\n" +msgstr "" + +#: ../src/main.c:158 +#, c-format msgid "" "%s: User config check failed (code %d). This is fatal.\n" "A possible solution would be to remove the .config/Gpredict data dir\n" "in your home directory" msgstr "" -#: ../src/main.c:468 +#: ../src/main.c:505 #, c-format msgid "%s: Time threshold has been passed." msgstr "" -#: ../src/main.c:476 +#: ../src/main.c:513 #, c-format msgid "%s: Starting new update thread." msgstr "" -#: ../src/main.c:484 +#: ../src/main.c:521 #, c-format msgid "%s: Failed to create TLE update thread (%s)" msgstr "" -#: ../src/main.c:494 +#: ../src/main.c:531 msgid "" "Your TLE files are getting out of date.\n" "You can update them by selecting\n" @@ -2033,11 +2050,31 @@ "in the menubar." msgstr "" -#: ../src/main.c:525 +#: ../src/main.c:562 #, c-format msgid "%s: Could not find TLE monitoring task (ID = %d)" msgstr "" +#: ../src/main.c:607 +#, c-format +msgid "%s: Cleaning TLE data in %s" +msgstr "" + +#: ../src/main.c:616 ../src/main.c:657 +#, c-format +msgid "%s: Failed to delete %s" +msgstr "" + +#: ../src/main.c:620 ../src/main.c:661 +#, c-format +msgid "%s: Removed %s" +msgstr "" + +#: ../src/main.c:648 +#, c-format +msgid "%s: Cleaning transponder data in %s" +msgstr "" + #. create a new file chooser dialogue in "open file" mode #: ../src/map-selector.c:76 msgid "Select Map" @@ -3431,31 +3468,31 @@ msgid "Visibility during pass" msgstr "" -#: ../src/sat-pass-dialogs.c:458 +#: ../src/sat-pass-dialogs.c:457 msgid "Data" msgstr "Données" -#: ../src/sat-pass-dialogs.c:469 +#: ../src/sat-pass-dialogs.c:468 msgid "Polar" msgstr "Polaire" -#: ../src/sat-pass-dialogs.c:480 +#: ../src/sat-pass-dialogs.c:479 msgid "Az/El" msgstr "Az/El" #. create dialog -#: ../src/sat-pass-dialogs.c:486 +#: ../src/sat-pass-dialogs.c:485 #, c-format msgid "Pass details for %s (orbit %d)" msgstr "Détails du passage pour %s (orbite %d)" -#: ../src/sat-pass-dialogs.c:549 ../src/sat-pass-dialogs.c:1161 +#: ../src/sat-pass-dialogs.c:547 ../src/sat-pass-dialogs.c:1146 #, c-format msgid "%s: PRINT not implemented" msgstr "" #. create dialog -#: ../src/sat-pass-dialogs.c:1100 +#: ../src/sat-pass-dialogs.c:1086 #, c-format msgid "Upcoming passes for %s" msgstr "Prochains passages pour %s" @@ -4894,74 +4931,74 @@ msgstr "" #. create the dialog -#: ../src/save-pass.c:114 +#: ../src/save-pass.c:113 msgid "Save Pass Details" msgstr "" #. directory chooser -#: ../src/save-pass.c:132 ../src/save-pass.c:296 +#: ../src/save-pass.c:131 ../src/save-pass.c:294 msgid "Save in folder:" msgstr "" -#: ../src/save-pass.c:136 ../src/save-pass.c:300 +#: ../src/save-pass.c:135 ../src/save-pass.c:298 msgid "Select a folder" msgstr "" #. file name -#: ../src/save-pass.c:150 ../src/save-pass.c:314 +#: ../src/save-pass.c:149 ../src/save-pass.c:312 msgid "Save using file name:" msgstr "" #. file format -#: ../src/save-pass.c:169 ../src/save-pass.c:333 +#: ../src/save-pass.c:168 ../src/save-pass.c:331 msgid "Save as:" msgstr "" -#: ../src/save-pass.c:174 ../src/save-pass.c:338 +#: ../src/save-pass.c:173 ../src/save-pass.c:336 msgid "Plain text (*.txt)" msgstr "" #. file contents -#: ../src/save-pass.c:184 ../src/save-pass.c:348 +#: ../src/save-pass.c:183 ../src/save-pass.c:346 msgid "File contents:" msgstr "" -#: ../src/save-pass.c:189 +#: ../src/save-pass.c:188 msgid "Info+header+data" msgstr "" -#: ../src/save-pass.c:190 +#: ../src/save-pass.c:189 msgid "Header + data" msgstr "" -#: ../src/save-pass.c:191 +#: ../src/save-pass.c:190 msgid "Data only" msgstr "Données seules" #. create the dialog -#: ../src/save-pass.c:278 +#: ../src/save-pass.c:276 msgid "Save Passes" msgstr "" -#: ../src/save-pass.c:353 +#: ../src/save-pass.c:351 msgid "Complete report" msgstr "" -#: ../src/save-pass.c:354 +#: ../src/save-pass.c:352 msgid "Summary" msgstr "" -#: ../src/save-pass.c:542 ../src/save-pass.c:644 +#: ../src/save-pass.c:538 ../src/save-pass.c:639 #, c-format msgid "%s: Invalid file format: %d" msgstr "" -#: ../src/save-pass.c:667 +#: ../src/save-pass.c:661 #, c-format msgid "%s: Could not create file %s (%s)" msgstr "" -#: ../src/save-pass.c:676 +#: ../src/save-pass.c:670 #, c-format msgid "" "Could not create file %s\n" @@ -4969,12 +5006,12 @@ "%s" msgstr "" -#: ../src/save-pass.c:691 +#: ../src/save-pass.c:685 #, c-format msgid "%s: An error occurred while saving data to %s (%s)" msgstr "" -#: ../src/save-pass.c:699 +#: ../src/save-pass.c:693 #, c-format msgid "" "An error occurred while saving data to %s\n" @@ -4982,7 +5019,7 @@ "%s" msgstr "" -#: ../src/save-pass.c:707 +#: ../src/save-pass.c:701 #, c-format msgid "%s: Written %d characters to %s" msgstr "" Modified: trunk/po/gpredict.pot =================================================================== --- trunk/po/gpredict.pot 2010-01-05 01:15:29 UTC (rev 576) +++ trunk/po/gpredict.pot 2010-01-05 11:24:59 UTC (rev 577) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-26 23:58+0100\n" +"POT-Creation-Date: 2010-01-05 12:24+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL...@li...>\n" @@ -46,7 +46,7 @@ #. window title #. icon file name #. create window title and file name for window icon -#: ../src/about.c:97 ../src/main.c:221 ../src/sat-log-browser.c:462 +#: ../src/about.c:97 ../src/main.c:249 ../src/sat-log-browser.c:462 #: ../src/sat-log.c:58 msgid "GPREDICT" msgstr "" @@ -1070,7 +1070,7 @@ msgid "%s: Satellite #%d removed from list." msgstr "" -#: ../src/gtk-sat-list.c:952 ../src/sat-pass-dialogs.c:702 +#: ../src/gtk-sat-list.c:952 ../src/sat-pass-dialogs.c:698 #: ../src/sat-pref-qth.c:769 #, c-format msgid "%s:%d: Invalid column: %d" @@ -1086,8 +1086,8 @@ msgid "%s:%d Failed to get data for %d." msgstr "" -#: ../src/gtk-sat-list.c:1307 ../src/sat-pass-dialogs.c:1421 -#: ../src/sat-pass-dialogs.c:1470 +#: ../src/gtk-sat-list.c:1307 ../src/sat-pass-dialogs.c:1399 +#: ../src/sat-pass-dialogs.c:1448 #, c-format msgid "%s:%d: There is no selection; skip popup." msgstr "" @@ -1692,6 +1692,11 @@ msgid "%s:%s: Failed to read %s" msgstr "" +#: ../src/gtk-sat-selector.c:772 +#, c-format +msgid "%s: Error getting %dth satellite" +msgstr "" + #: ../src/gtk-sat-tree.c:232 ../src/mod-cfg.c:630 msgid "Epoch" msgstr "" @@ -1987,34 +1992,46 @@ msgid "%s: No selection found!" msgstr "" -#: ../src/main.c:64 +#: ../src/main.c:75 msgid "just to have a pot" msgstr "" -#: ../src/main.c:120 +#: ../src/main.c:129 +msgid "" +"Gpredict is a graphical real-time satellite tracking and orbit prediction " +"program.\n" +"Gpredict does not require any command line options for nominal operation." +msgstr "" + +#: ../src/main.c:135 #, c-format +msgid "Option parsing failed: %s\n" +msgstr "" + +#: ../src/main.c:158 +#, c-format msgid "" "%s: User config check failed (code %d). This is fatal.\n" "A possible solution would be to remove the .config/Gpredict data dir\n" "in your home directory" msgstr "" -#: ../src/main.c:468 +#: ../src/main.c:505 #, c-format msgid "%s: Time threshold has been passed." msgstr "" -#: ../src/main.c:476 +#: ../src/main.c:513 #, c-format msgid "%s: Starting new update thread." msgstr "" -#: ../src/main.c:484 +#: ../src/main.c:521 #, c-format msgid "%s: Failed to create TLE update thread (%s)" msgstr "" -#: ../src/main.c:494 +#: ../src/main.c:531 msgid "" "Your TLE files are getting out of date.\n" "You can update them by selecting\n" @@ -2022,11 +2039,31 @@ "in the menubar." msgstr "" -#: ../src/main.c:525 +#: ../src/main.c:562 #, c-format msgid "%s: Could not find TLE monitoring task (ID = %d)" msgstr "" +#: ../src/main.c:607 +#, c-format +msgid "%s: Cleaning TLE data in %s" +msgstr "" + +#: ../src/main.c:616 ../src/main.c:657 +#, c-format +msgid "%s: Failed to delete %s" +msgstr "" + +#: ../src/main.c:620 ../src/main.c:661 +#, c-format +msgid "%s: Removed %s" +msgstr "" + +#: ../src/main.c:648 +#, c-format +msgid "%s: Cleaning transponder data in %s" +msgstr "" + #. create a new file chooser dialogue in "open file" mode #: ../src/map-selector.c:76 msgid "Select Map" @@ -3405,31 +3442,31 @@ msgid "Visibility during pass" msgstr "" -#: ../src/sat-pass-dialogs.c:458 +#: ../src/sat-pass-dialogs.c:457 msgid "Data" msgstr "" -#: ../src/sat-pass-dialogs.c:469 +#: ../src/sat-pass-dialogs.c:468 msgid "Polar" msgstr "" -#: ../src/sat-pass-dialogs.c:480 +#: ../src/sat-pass-dialogs.c:479 msgid "Az/El" msgstr "" #. create dialog -#: ../src/sat-pass-dialogs.c:486 +#: ../src/sat-pass-dialogs.c:485 #, c-format msgid "Pass details for %s (orbit %d)" msgstr "" -#: ../src/sat-pass-dialogs.c:549 ../src/sat-pass-dialogs.c:1161 +#: ../src/sat-pass-dialogs.c:547 ../src/sat-pass-dialogs.c:1146 #, c-format msgid "%s: PRINT not implemented" msgstr "" #. create dialog -#: ../src/sat-pass-dialogs.c:1100 +#: ../src/sat-pass-dialogs.c:1086 #, c-format msgid "Upcoming passes for %s" msgstr "" @@ -4867,74 +4904,74 @@ msgstr "" #. create the dialog -#: ../src/save-pass.c:114 +#: ../src/save-pass.c:113 msgid "Save Pass Details" msgstr "" #. directory chooser -#: ../src/save-pass.c:132 ../src/save-pass.c:296 +#: ../src/save-pass.c:131 ../src/save-pass.c:294 msgid "Save in folder:" msgstr "" -#: ../src/save-pass.c:136 ../src/save-pass.c:300 +#: ../src/save-pass.c:135 ../src/save-pass.c:298 msgid "Select a folder" msgstr "" #. file name -#: ../src/save-pass.c:150 ../src/save-pass.c:314 +#: ../src/save-pass.c:149 ../src/save-pass.c:312 msgid "Save using file name:" msgstr "" #. file format -#: ../src/save-pass.c:169 ../src/save-pass.c:333 +#: ../src/save-pass.c:168 ../src/save-pass.c:331 msgid "Save as:" msgstr "" -#: ../src/save-pass.c:174 ../src/save-pass.c:338 +#: ../src/save-pass.c:173 ../src/save-pass.c:336 msgid "Plain text (*.txt)" msgstr "" #. file contents -#: ../src/save-pass.c:184 ../src/save-pass.c:348 +#: ../src/save-pass.c:183 ../src/save-pass.c:346 msgid "File contents:" msgstr "" -#: ../src/save-pass.c:189 +#: ../src/save-pass.c:188 msgid "Info+header+data" msgstr "" -#: ../src/save-pass.c:190 +#: ../src/save-pass.c:189 msgid "Header + data" msgstr "" -#: ../src/save-pass.c:191 +#: ../src/save-pass.c:190 msgid "Data only" msgstr "" #. create the dialog -#: ../src/save-pass.c:278 +#: ../src/save-pass.c:276 msgid "Save Passes" msgstr "" -#: ../src/save-pass.c:353 +#: ../src/save-pass.c:351 msgid "Complete report" msgstr "" -#: ../src/save-pass.c:354 +#: ../src/save-pass.c:352 msgid "Summary" msgstr "" -#: ../src/save-pass.c:542 ../src/save-pass.c:644 +#: ../src/save-pass.c:538 ../src/save-pass.c:639 #, c-format msgid "%s: Invalid file format: %d" msgstr "" -#: ../src/save-pass.c:667 +#: ../src/save-pass.c:661 #, c-format msgid "%s: Could not create file %s (%s)" msgstr "" -#: ../src/save-pass.c:676 +#: ../src/save-pass.c:670 #, c-format msgid "" "Could not create file %s\n" @@ -4942,12 +4979,12 @@ "%s" msgstr "" -#: ../src/save-pass.c:691 +#: ../src/save-pass.c:685 #, c-format msgid "%s: An error occurred while saving data to %s (%s)" msgstr "" -#: ../src/save-pass.c:699 +#: ../src/save-pass.c:693 #, c-format msgid "" "An error occurred while saving data to %s\n" @@ -4955,7 +4992,7 @@ "%s" msgstr "" -#: ../src/save-pass.c:707 +#: ../src/save-pass.c:701 #, c-format msgid "%s: Written %d characters to %s" msgstr "" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-05 01:15:36
|
Revision: 576 http://gpredict.svn.sourceforge.net/gpredict/?rev=576&view=rev Author: csete Date: 2010-01-05 01:15:29 +0000 (Tue, 05 Jan 2010) Log Message: ----------- Implemented command line options. Modified Paths: -------------- trunk/src/main.c Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2010-01-04 17:17:17 UTC (rev 575) +++ trunk/src/main.c 2010-01-05 01:15:29 UTC (rev 576) @@ -29,15 +29,12 @@ * \ingroup main * \bief Main program file. * - * Add some more text. - * - * \bug Change to glib getopt in 2.6 - * */ #include <stdlib.h> #include <signal.h> #include <gtk/gtk.h> #include <glib/gi18n.h> +#include <glib/gstdio.h> #ifdef HAVE_CONFIG_H # include <build-config.h> #endif @@ -97,6 +94,8 @@ static gboolean tle_mon_task (gpointer data); static void tle_mon_stop (void); static gpointer update_tle_thread (gpointer data); +static void clean_tle (void); +static void clean_trsp (void); #ifdef G_OS_WIN32 static void InitWinSock2(void); @@ -143,6 +142,13 @@ if (!g_thread_supported ()) g_thread_init (NULL); + /* check command line options */ + if (cleantle) + clean_tle (); + + if (cleantrsp) + clean_trsp (); + /* check that user settings are ok */ error = first_time_check_run (); @@ -578,3 +584,85 @@ return NULL; } + + +/** \brief Clean TLE data. + * + * This function removes all .sat files from the user's configuration directory. + * The function is called when gpreidict is executed with the --clean-tle + * command line option. + */ +static void clean_tle (void) +{ + GDir *targetdir; + gchar *targetdirname,*path; + const gchar *filename; + + + /* Get trsp directory */ + targetdirname = get_satdata_dir (); + targetdir = g_dir_open (targetdirname, 0, NULL); + + sat_log_log (SAT_LOG_LEVEL_MSG, + _("%s: Cleaning TLE data in %s"), __FUNCTION__, targetdirname); + + + while ((filename = g_dir_read_name (targetdir))) { + if (g_strrstr (filename, ".sat")) { + /* remove .sat file */ + path = sat_file_name (filename); + if G_UNLIKELY(g_unlink (path)) { + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Failed to delete %s"), __FUNCTION__, filename); + } + else { + sat_log_log (SAT_LOG_LEVEL_MSG, + _("%s: Removed %s"), __FUNCTION__, filename); + } + g_free (path); + } + } + g_free (targetdirname); + +} + + +/** \brief Clean transponder data. + * + * This function removes all .trsp files from the user's configuration directory. + * The function is called when gpredict is executed with the --clean-trsp + * command line option. + */ +static void clean_trsp (void) +{ + GDir *targetdir; + gchar *targetdirname,*path; + const gchar *filename; + + + /* Get trsp directory */ + targetdirname = get_trsp_dir (); + targetdir = g_dir_open (targetdirname, 0, NULL); + + sat_log_log (SAT_LOG_LEVEL_MSG, + _("%s: Cleaning transponder data in %s"), __FUNCTION__, targetdirname); + + + while ((filename = g_dir_read_name (targetdir))) { + if (g_strrstr (filename, ".trsp")) { + /* remove .trsp file */ + path = trsp_file_name (filename); + if G_UNLIKELY(g_unlink (path)) { + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Failed to delete %s"), __FUNCTION__, filename); + } + else { + sat_log_log (SAT_LOG_LEVEL_MSG, + _("%s: Removed %s"), __FUNCTION__, filename); + } + g_free (path); + } + } + g_free (targetdirname); + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-04 17:17:29
|
Revision: 575 http://gpredict.svn.sourceforge.net/gpredict/?rev=575&view=rev Author: csete Date: 2010-01-04 17:17:17 +0000 (Mon, 04 Jan 2010) Log Message: ----------- Updated. Modified Paths: -------------- trunk/ChangeLog trunk/NEWS Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-01-04 17:16:11 UTC (rev 574) +++ trunk/ChangeLog 2010-01-04 17:17:17 UTC (rev 575) @@ -1,3 +1,9 @@ +2010-01-04 Alexandru Csete <oz9aec at gmail.com> + + * src/main.c: + Added command line options for cleaning TLE and transponder data. + + 2010-01-02 Alexandru Csete <oz9aec at gmail.com> * src/gtk-sat-selector.[ch]: Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2010-01-04 17:16:11 UTC (rev 574) +++ trunk/NEWS 2010-01-04 17:17:17 UTC (rev 575) @@ -18,6 +18,7 @@ - Applied patch 2893617: Patches for fixing Windows build (thanks to Valentin Yakovenkov). - Applied patch 2916646: Minor fixes to documentation (thanks to Paul Schulz). - Slightly improved UI for the single-satellite view. +- Command line options for cleaning user's TLE and transponder data, see --help for list. Changes in version 1.1 (5 Oct 2009) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-04 17:16:17
|
Revision: 574 http://gpredict.svn.sourceforge.net/gpredict/?rev=574&view=rev Author: csete Date: 2010-01-04 17:16:11 +0000 (Mon, 04 Jan 2010) Log Message: ----------- Added summary. Modified Paths: -------------- trunk/src/main.c Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2010-01-04 16:14:12 UTC (rev 573) +++ trunk/src/main.c 2010-01-04 17:16:11 UTC (rev 574) @@ -59,6 +59,22 @@ GtkWidget *app; +/** \brief Command line flag for cleaning TLE data. */ +static gboolean cleantle = FALSE; + +/** \brief Command line flag for cleaning TRSP data */ +static gboolean cleantrsp = FALSE; + +/** \brief Command line options. */ +static GOptionEntry entries[] = +{ + { "clean-tle", 0, 0, G_OPTION_ARG_NONE, &cleantle, "Clean the TLE data in user's configuration directory", NULL }, + { "clean-trsp", 0, 0, G_OPTION_ARG_NONE, &cleantrsp, "Clean the transponder data in user's configuration directory", NULL }, + { NULL } +}; + + + const gchar *dummy = N_("just to have a pot"); @@ -90,8 +106,11 @@ int main (int argc, char *argv[]) { + GError *err = NULL; + GOptionContext *context; guint error = 0; + #ifdef G_OS_WIN32 printf ("Starting gpredict. This may take some time...\n"); #endif @@ -105,11 +124,24 @@ gtk_set_locale (); gtk_init (&argc, &argv); + context = g_option_context_new (""); + g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); + g_option_context_set_summary (context, + _("Gpredict is a graphical real-time satellite tracking "\ + "and orbit prediction program.\n"\ + "Gpredict does not require any command line options for "\ + "nominal operation.")); + g_option_context_add_group (context, gtk_get_option_group (TRUE)); + if (!g_option_context_parse (context, &argc, &argv, &err)) { + g_print (_("Option parsing failed: %s\n"), err->message); + } + + /* start logger first, so that we can catch error messages if any */ sat_log_init (); - if (!g_thread_supported ()) - g_thread_init (NULL); + if (!g_thread_supported ()) + g_thread_init (NULL); /* check that user settings are ok */ error = first_time_check_run (); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-04 16:14:26
|
Revision: 573 http://gpredict.svn.sourceforge.net/gpredict/?rev=573&view=rev Author: csete Date: 2010-01-04 16:14:12 +0000 (Mon, 04 Jan 2010) Log Message: ----------- Don't include getopt.h Modified Paths: -------------- trunk/src/main.c Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2010-01-02 23:51:53 UTC (rev 572) +++ trunk/src/main.c 2010-01-04 16:14:12 UTC (rev 573) @@ -41,9 +41,6 @@ #ifdef HAVE_CONFIG_H # include <build-config.h> #endif -#ifdef HAVE_GETOPT_H -# include <getopt.h> -#endif #include "sat-log.h" #include "first-time.h" #include "compat.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-02 23:52:08
|
Revision: 572 http://gpredict.svn.sourceforge.net/gpredict/?rev=572&view=rev Author: csete Date: 2010-01-02 23:51:53 +0000 (Sat, 02 Jan 2010) Log Message: ----------- Updated. Modified Paths: -------------- trunk/ChangeLog trunk/src/main.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-01-02 22:59:47 UTC (rev 571) +++ trunk/ChangeLog 2010-01-02 23:51:53 UTC (rev 572) @@ -1,3 +1,9 @@ +2010-01-02 Alexandru Csete <oz9aec at gmail.com> + + * src/gtk-sat-selector.[ch]: + Added utility function to retrieve newest EPOCH of satellites in database. + + 2009-12-26 Alexandru Csete <oz9aec at gmail.com> * src/sat-pref-layout.c: Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2010-01-02 22:59:47 UTC (rev 571) +++ trunk/src/main.c 2010-01-02 23:51:53 UTC (rev 572) @@ -51,6 +51,7 @@ #include "mod-mgr.h" #include "tle-update.h" #include "sat-cfg.h" +#include "gtk-sat-selector.h" #include "sat-debugger.h" #ifdef WIN32 @@ -410,6 +411,7 @@ static gboolean tle_mon_task (gpointer data) { + GtkWidget *selector; glong last,now,thrld; GTimeVal tval; GtkWidget *dialog; @@ -422,7 +424,15 @@ /* get time of last update */ last = sat_cfg_get_int (SAT_CFG_INT_TLE_LAST_UPDATE); + /*if (last == 0) { + selector = gtk_sat_selector_new (0); + last = (glong) gtk_sat_selector_get_latest_epoch (GTK_SAT_SELECTOR (selector)); + gtk_widget_destroy (selector); + } + g_print ("LAST: %ld\n", last); */ + + /* get current time */ g_get_current_time (&tval); now = tval.tv_sec; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-02 22:59:57
|
Revision: 571 http://gpredict.svn.sourceforge.net/gpredict/?rev=571&view=rev Author: csete Date: 2010-01-02 22:59:47 +0000 (Sat, 02 Jan 2010) Log Message: ----------- Added utility function to retrieve newest EPOCH of satellites in database. Modified Paths: -------------- trunk/src/gtk-sat-selector.c trunk/src/gtk-sat-selector.h Modified: trunk/src/gtk-sat-selector.c =================================================================== --- trunk/src/gtk-sat-selector.c 2010-01-02 22:04:42 UTC (rev 570) +++ trunk/src/gtk-sat-selector.c 2010-01-02 22:59:47 UTC (rev 571) @@ -734,3 +734,44 @@ } } + + + +/** \brief Get the latest EPOCH of the satellites that are loaded into the GtkSatSelector. + * \param selector Pointer to the GtkSatSelector widget. + * \return The latest EPOCH or 0.0 in case an error occurs. + */ +gdouble gtk_sat_selector_get_latest_epoch (GtkSatSelector *selector) +{ + GtkTreeModel *model; + GtkTreeIter iter; + gdouble epoch = 0.0; + gdouble thisepoch; + gint i,n; + + + g_return_val_if_fail (selector != 0 && IS_GTK_SAT_SELECTOR (selector), 0.0); + + + /* get the tree model that contains all satellites */ + model = GTK_TREE_MODEL (g_slist_nth_data (selector->models, 0)); + n = gtk_tree_model_iter_n_children (model,NULL); + + /* loop over each satellite in the model and store the newest EPOCH */ + for (i = 0; i < n; i++) { + if G_LIKELY(gtk_tree_model_iter_nth_child (model, &iter, NULL, i)) { + gtk_tree_model_get (model, &iter, + GTK_SAT_SELECTOR_COL_EPOCH, &thisepoch, + -1); + if (thisepoch > epoch) + epoch = thisepoch; + + } + else { + sat_log_log (SAT_LOG_LEVEL_ERROR, + _("%s: Error getting %dth satellite"), __FUNCTION__, i); + } + } + + return epoch; +} Modified: trunk/src/gtk-sat-selector.h =================================================================== --- trunk/src/gtk-sat-selector.h 2010-01-02 22:04:42 UTC (rev 570) +++ trunk/src/gtk-sat-selector.h 2010-01-02 22:59:47 UTC (rev 571) @@ -103,6 +103,7 @@ GtkWidget *gtk_sat_selector_new (guint flags); guint32 gtk_sat_selector_get_flags (GtkSatSelector *selector); void gtk_sat_selector_get_selected (GtkSatSelector *selector, gint *catnum, gchar **satname, gdouble *epoch); +gdouble gtk_sat_selector_get_latest_epoch (GtkSatSelector *selector); #ifdef __cplusplus } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-02 22:04:53
|
Revision: 570 http://gpredict.svn.sourceforge.net/gpredict/?rev=570&view=rev Author: csete Date: 2010-01-02 22:04:42 +0000 (Sat, 02 Jan 2010) Log Message: ----------- Cleaned some obsolete code. Added missing WIN32 conditional. Modified Paths: -------------- trunk/src/main.c Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2010-01-02 17:57:34 UTC (rev 569) +++ trunk/src/main.c 2010-01-02 22:04:42 UTC (rev 570) @@ -84,10 +84,12 @@ static void tle_mon_stop (void); static gpointer update_tle_thread (gpointer data); -static void test_ui (void); -static void InitWinSock2(void); -static void CloseWinSock2(void); +#ifdef G_OS_WIN32 + static void InitWinSock2(void); + static void CloseWinSock2(void); +#endif + int main (int argc, char *argv[]) { guint error = 0; @@ -139,7 +141,6 @@ /* launch TLE monitoring task; 10 min interval */ tle_mon_id = g_timeout_add (600000, tle_mon_task, NULL); - //test_ui (); #ifdef WIN32 // Initializing Windozze Sockets @@ -193,15 +194,6 @@ } #endif -static void test_ui (void) -{ - gchar *fnam; - - fnam = g_strconcat (g_get_home_dir(), G_DIR_SEPARATOR_S, - "test.ui", NULL); - - g_free (fnam); -} /** \brief Create main application window. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2010-01-02 17:57:41
|
Revision: 569 http://gpredict.svn.sourceforge.net/gpredict/?rev=569&view=rev Author: csete Date: 2010-01-02 17:57:34 +0000 (Sat, 02 Jan 2010) Log Message: ----------- Fixed indentation. Modified Paths: -------------- trunk/src/main.c Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2009-12-30 20:29:36 UTC (rev 568) +++ trunk/src/main.c 2010-01-02 17:57:34 UTC (rev 569) @@ -143,14 +143,14 @@ #ifdef WIN32 // Initializing Windozze Sockets - InitWinSock2(); + InitWinSock2(); #endif gtk_main (); #ifdef WIN32 - // Cleanup Windozze Sockets - CloseWinSock2(); + // Cleanup Windozze Sockets + CloseWinSock2(); #endif return 0; } @@ -159,37 +159,37 @@ /* This code was given from MSDN */ static void InitWinSock2(void) { - WORD wVersionRequested; - WSADATA wsaData; - int err; - - wVersionRequested = MAKEWORD( 2, 2 ); - - err = WSAStartup( wVersionRequested, &wsaData ); - if ( err != 0 ) { - /* Tell the user that we could not find a usable */ - /* WinSock DLL. */ - return; - } - - /* Confirm that the WinSock DLL supports 2.2.*/ - /* Note that if the DLL supports versions later */ - /* than 2.2 in addition to 2.2, it will still return */ - /* 2.2 in wVersion since that is the version we */ - /* requested. */ - - if ( LOBYTE( wsaData.wVersion ) != 2 || - HIBYTE( wsaData.wVersion ) != 2 ) { - /* Tell the user that we could not find a usable */ - /* WinSock DLL. */ - WSACleanup( ); - return; - } + WORD wVersionRequested; + WSADATA wsaData; + int err; + + wVersionRequested = MAKEWORD( 2, 2 ); + + err = WSAStartup( wVersionRequested, &wsaData ); + if ( err != 0 ) { + /* Tell the user that we could not find a usable */ + /* WinSock DLL. */ + return; + } + + /* Confirm that the WinSock DLL supports 2.2.*/ + /* Note that if the DLL supports versions later */ + /* than 2.2 in addition to 2.2, it will still return */ + /* 2.2 in wVersion since that is the version we */ + /* requested. */ + + if ( LOBYTE( wsaData.wVersion ) != 2 || + HIBYTE( wsaData.wVersion ) != 2 ) { + /* Tell the user that we could not find a usable */ + /* WinSock DLL. */ + WSACleanup( ); + return; + } } static void CloseWinSock2(void) { - WSACleanup(); + WSACleanup(); } #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2009-12-30 20:29:45
|
Revision: 568 http://gpredict.svn.sourceforge.net/gpredict/?rev=568&view=rev Author: csete Date: 2009-12-30 20:29:36 +0000 (Wed, 30 Dec 2009) Log Message: ----------- Fixed a bug in the predefined layouts table. Modified Paths: -------------- trunk/src/sat-pref-layout.c Modified: trunk/src/sat-pref-layout.c =================================================================== --- trunk/src/sat-pref-layout.c 2009-12-30 18:45:18 UTC (rev 567) +++ trunk/src/sat-pref-layout.c 2009-12-30 20:29:36 UTC (rev 568) @@ -75,7 +75,7 @@ gchar *predef_layout[PREDEF_NUM][3] = { { "1;0;2;0;1;2;0;1;1;2;3;1;2;1;2", N_("World map, polar and single sat"), "gpredict-layout-00.png" }, { "1;0;2;0;1", N_("World map"), "gpredict-layout-01.png" }, - { "1;0;2;0;1", N_("Table"), "gpredict-layout-02.png" }, + { "0;0;2;0;1", N_("Table"), "gpredict-layout-02.png" }, { "1;0;2;0;2;0;0;2;2;3", N_("World map and table"), "gpredict-layout-03.png" }, { "2;0;1;0;1;3;1;2;0;1", N_("Polar and single sat"), "gpredict-layout-04.png" }, { "2;0;1;0;1;4;1;2;0;1", N_("Polar and upcoming passes"), "gpredict-layout-05.png" }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cs...@us...> - 2009-12-30 18:45:26
|
Revision: 567 http://gpredict.svn.sourceforge.net/gpredict/?rev=567&view=rev Author: csete Date: 2009-12-30 18:45:18 +0000 (Wed, 30 Dec 2009) Log Message: ----------- Include SO-67 and HO-68 in default Amateur module. Modified Paths: -------------- trunk/data/Amateur.mod Modified: trunk/data/Amateur.mod =================================================================== --- trunk/data/Amateur.mod 2009-12-30 16:59:51 UTC (rev 566) +++ trunk/data/Amateur.mod 2009-12-30 18:45:18 UTC (rev 567) @@ -1,2 +1,2 @@ [GLOBAL] -SATELLITES=28650;28375;27607;25544;24278;22825 +SATELLITES=28375;27607;25544;24278;22825;35870;36122; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |