? capplet.patch ? PiDebug.log ? plhead.patch ? gnome-pilot.patch ? g-p-build.patch ? g-p-capplet-settings.patch ? g-p-pdialog-close.patch ? gpilotd/PiDebug.log ? gpilotd/temp.txt Index: configure.in =================================================================== RCS file: /cvs/gnome/gnome-pilot/configure.in,v retrieving revision 1.144 diff -u -r1.144 configure.in --- configure.in 2001/12/03 11:47:34 1.144 +++ configure.in 2002/01/29 16:14:01 @@ -94,6 +94,7 @@ AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR(Test for GLIB failed.),[glib gmodule]) +AC_PILOT_LINK PILOT_LINK_CHECK(0.9.5) AC_SUBST(PILOT_LINK_VERSION) Index: capplet/gnome-pilot-cdialog.c =================================================================== RCS file: /cvs/gnome/gnome-pilot/capplet/gnome-pilot-cdialog.c,v retrieving revision 1.4 diff -u -r1.4 gnome-pilot-cdialog.c --- capplet/gnome-pilot-cdialog.c 2001/03/01 23:39:07 1.4 +++ capplet/gnome-pilot-cdialog.c 2002/01/29 16:14:01 @@ -46,6 +46,7 @@ GtkWidget *settings_frame; GtkWidget *sync_actions; + GtkWidget *sync_one_actions; GtkWidget *options_frame;; }; @@ -156,6 +157,7 @@ priv->settings_frame = GW ("settings_frame"); priv->sync_actions = GW ("sync_actions_menu"); + priv->sync_one_actions = GW ("sync_one_actions_menu"); priv->options_frame = GW ("options_frame"); @@ -196,7 +198,9 @@ if (priv->state) { fill_conduit_sync_type_menu (GTK_OPTION_MENU (priv->sync_actions), priv->state); - + if (priv->state->default_sync_type != GnomePilotConduitSyncTypeCustom) + fill_conduit_first_sync_type_menu (GTK_OPTION_MENU (priv->sync_one_actions), priv->state); + if (!priv->state->has_settings) { gtk_widget_hide (priv->options_frame); @@ -228,6 +232,20 @@ return GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (menu_item), "sync_type")); } +GnomePilotConduitSyncType +gnome_pilot_cdialog_first_sync_type (GnomePilotCDialog *gpcd) +{ + GnomePilotCDialogPrivate *priv; + GtkWidget *menu, *menu_item; + + priv = gpcd->priv; + + menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->sync_one_actions)); + menu_item = gtk_menu_get_active (GTK_MENU (menu)); + + return GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (menu_item), "sync_type")); +} + gboolean gnome_pilot_cdialog_run_and_close (GnomePilotCDialog *gpcd) { @@ -252,6 +270,7 @@ disable = (gnome_pilot_cdialog_sync_type (gpcd) == GnomePilotConduitSyncTypeNotSet); + gtk_widget_set_sensitive (priv->sync_one_actions, !disable); gtk_widget_set_sensitive (priv->options_frame, !disable); } Index: capplet/gnome-pilot-conduitcap.c =================================================================== RCS file: /cvs/gnome/gnome-pilot/capplet/gnome-pilot-conduitcap.c,v retrieving revision 1.6 diff -u -r1.6 gnome-pilot-conduitcap.c --- capplet/gnome-pilot-conduitcap.c 2001/04/25 03:24:17 1.6 +++ capplet/gnome-pilot-conduitcap.c 2002/01/29 16:14:01 @@ -571,6 +571,7 @@ if (gnome_pilot_cdialog_run_and_close (GNOME_PILOT_CDIALOG (state->settings_widget2))) { /* pressed ok */ state->sync_type = gnome_pilot_cdialog_sync_type (GNOME_PILOT_CDIALOG (state->settings_widget2)); + state->first_sync_type = gnome_pilot_cdialog_first_sync_type (GNOME_PILOT_CDIALOG (state->settings_widget2)); state->enabled = (state->sync_type != GnomePilotConduitSyncTypeNotSet); state->changed=TRUE; @@ -675,8 +676,10 @@ else gnome_pilot_conduit_config_enable_with_first_sync (state->config, state->sync_type, - state->sync_type, + state->first_sync_type, TRUE); + if (state->first_sync_type == GnomePilotConduitSyncTypeNotSet) + gnome_pilot_conduit_config_remove_first_sync (state->config); } if (state->changed && !state->enabled) @@ -716,6 +719,7 @@ state->enabled = state->orig_enabled; state->sync_type = state->orig_sync_type; + state->first_sync_type = state->orig_first_sync_type; } if (state->changed && !state->orig_enabled) { Index: capplet/gpilotd-capplet-strings.c =================================================================== RCS file: /cvs/gnome/gnome-pilot/capplet/gpilotd-capplet-strings.c,v retrieving revision 1.11 diff -u -r1.11 gpilotd-capplet-strings.c --- capplet/gpilotd-capplet-strings.c 2001/05/08 16:23:08 1.11 +++ capplet/gpilotd-capplet-strings.c 2002/01/29 16:14:01 @@ -28,16 +28,13 @@ gchar *s = N_("Name"); gchar *s = N_("Port"); gchar *s = N_("Speed"); -gchar *s = N_("/dev/pilot\n" - "/dev/ttyS0\n" - "/dev/ttyS1\n" - "/dev/ttyS2\n" - "/dev/ttyS3\n" - "/dev/ttyqe\n" - ""); gchar *s = N_("/dev/pilot"); -gchar *s = N_("\n" - ""); +gchar *s = N_("/dev/ttyS0"); +gchar *s = N_("/dev/ttyS1"); +gchar *s = N_("/dev/ttyS2"); +gchar *s = N_("/dev/ttyS3"); +gchar *s = N_("/dev/ttyqe"); +gchar *s = N_("/dev/pilot"); gchar *s = N_("Type"); gchar *s = N_("Serial"); gchar *s = N_("Handspring USB"); @@ -56,12 +53,8 @@ gchar *s = N_("Pilot Name"); gchar *s = N_("Local basedir"); gchar *s = N_("Sync Action"); -gchar *s = N_("\n" - ""); gchar *s = N_("Choose Device"); gchar *s = N_("Choose Device"); -gchar *s = N_("\n" - ""); gchar *s = N_("Gnome Pilot Settings"); gchar *s = N_("Welcome to gnome-pilot!"); gchar *s = N_("You seem to be running gnome-pilot for the first time.\n" @@ -75,15 +68,12 @@ gchar *s = N_("Name"); gchar *s = N_("Port"); gchar *s = N_("Speed"); -gchar *s = N_("/dev/pilot\n" - "/dev/ttyS0\n" - "/dev/ttyS1\n" - "/dev/ttyS2\n" - "/dev/ttyS3\n" - ""); gchar *s = N_("/dev/pilot"); -gchar *s = N_("\n" - ""); +gchar *s = N_("/dev/ttyS0"); +gchar *s = N_("/dev/ttyS1"); +gchar *s = N_("/dev/ttyS2"); +gchar *s = N_("/dev/ttyS3"); +gchar *s = N_("/dev/pilot"); gchar *s = N_("Serial"); gchar *s = N_("Handspring USB"); gchar *s = N_("IrDA"); @@ -105,9 +95,7 @@ gchar *s = N_("Local basedir"); gchar *s = N_("Set the root directory for all pilot files to be stored."); gchar *s = N_("Sync Action"); -gchar *s = N_("Default conduit action for Synchronization. In most cases you don't want to change this setting, but individual conduits instead."); -gchar *s = N_("\n" - ""); +gchar *s = N_("Default conduit action for Synhronization. In most cases you dont want to change this setting, but individual conduits instead."); gchar *s = N_("Success"); gchar *s = N_("Congratulations, you have succesfully configured gnome-pilot!\n" "\n" @@ -121,8 +109,6 @@ gchar *s = N_("User Name:"); gchar *s = N_("\n" ""); -gchar *s = N_("\n" - ""); gchar *s = N_("Conduit"); gchar *s = N_("Sync Action"); gchar *s = N_("Enable"); @@ -130,7 +116,9 @@ gchar *s = N_("Settings..."); gchar *s = N_("Conduit Description"); gchar *s = N_("Conduit Settings"); -gchar *s = N_("Conduit Action"); -gchar *s = N_("Disabled\n" - ""); +gchar *s = N_("Conduit Actions"); +gchar *s = N_("Disabled"); +gchar *s = N_("Action:"); +gchar *s = N_("One Time Action:"); +gchar *s = N_("None"); gchar *s = N_("Conduit Settings"); Index: capplet/gpilotd-capplet.glade =================================================================== RCS file: /cvs/gnome/gnome-pilot/capplet/gpilotd-capplet.glade,v retrieving revision 1.9 diff -u -r1.9 gpilotd-capplet.glade --- capplet/gpilotd-capplet.glade 2001/03/12 21:19:55 1.9 +++ capplet/gpilotd-capplet.glade 2002/01/29 16:14:02 @@ -144,6 +144,7 @@ True True + GTK_RELIEF_NORMAL @@ -152,6 +153,7 @@ True True + GTK_RELIEF_NORMAL @@ -160,6 +162,7 @@ True True + GTK_RELIEF_NORMAL @@ -282,6 +285,7 @@ True True + GTK_RELIEF_NORMAL @@ -290,6 +294,7 @@ True True + GTK_RELIEF_NORMAL @@ -298,6 +303,7 @@ True True + GTK_RELIEF_NORMAL @@ -1044,6 +1050,7 @@ Get User Name and ID from existing pilot that was used before. True + GTK_RELIEF_NORMAL 0 False @@ -1057,6 +1064,7 @@ Set User Name and ID to a new pilot. True + GTK_RELIEF_NORMAL 0 False @@ -2395,6 +2403,7 @@ True True + GTK_RELIEF_NORMAL @@ -2403,6 +2412,7 @@ True True + GTK_RELIEF_NORMAL @@ -2411,6 +2421,7 @@ True True + GTK_RELIEF_NORMAL @@ -2516,7 +2527,7 @@ GtkFrame settings_frame 4 - + 0 GTK_SHADOW_ETCHED_IN @@ -2526,13 +2537,112 @@ - GtkOptionMenu - sync_actions_menu - 5 - True - Disabled + GtkTable + table12 + 4 + 2 + 2 + True + 0 + 4 + + + GtkOptionMenu + sync_actions_menu + True + Disabled - 0 + 0 + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label150 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label151 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkOptionMenu + sync_one_actions_menu + True + None + + 0 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + Index: capplet/pilot.c =================================================================== RCS file: /cvs/gnome/gnome-pilot/capplet/pilot.c,v retrieving revision 1.22 diff -u -r1.22 pilot.c --- capplet/pilot.c 2001/09/17 04:34:17 1.22 +++ capplet/pilot.c 2002/01/29 16:14:02 @@ -351,8 +351,14 @@ conduit_state->name = g_strdup ((gchar*)conduits->data); conduit_state->pilot = pilot; - conduit_state->management = gnome_pilot_conduit_management_new (conduit_state->name, GNOME_PILOT_CONDUIT_MGMT_NAME); - conduit_state->config = gnome_pilot_conduit_config_new (conduit_state->management, pilot->pilot_id); + conduit_state->management = + gnome_pilot_conduit_management_new (conduit_state->name, + GNOME_PILOT_CONDUIT_MGMT_NAME); + conduit_state->config = + gnome_pilot_conduit_config_new (conduit_state->management, + pilot->pilot_id); + gnome_pilot_conduit_config_load_config (conduit_state->config); + conduit_state->description = g_strdup ((gchar*) gnome_pilot_conduit_management_get_attribute (conduit_state->management, "description", NULL)); conduit_state->icon = g_strdup ((gchar*)gnome_pilot_conduit_management_get_attribute (conduit_state->management, "icon", NULL)); if (conduit_state->icon == NULL || g_file_test (conduit_state->icon, G_FILE_TEST_ISFILE)==FALSE) { @@ -377,9 +383,11 @@ conduit_state->orig_sync_type = conduit_state->sync_type; else conduit_state->orig_sync_type = GnomePilotConduitSyncTypeNotSet; + conduit_state->first_sync_type = conduit_state->config->first_sync_type; + conduit_state->orig_first_sync_type = conduit_state->first_sync_type; conduit_states = g_list_append (conduit_states, conduit_state); conduits = conduits->next; - + buf = (gchar*) gnome_pilot_conduit_management_get_attribute (conduit_state->management, "valid-synctypes", NULL); if (buf != NULL) { gchar **sync_types = g_strsplit (buf, " ", 0); Index: capplet/pilot.h =================================================================== RCS file: /cvs/gnome/gnome-pilot/capplet/pilot.h,v retrieving revision 1.8 diff -u -r1.8 pilot.h --- capplet/pilot.h 2001/04/25 03:24:17 1.8 +++ capplet/pilot.h 2002/01/29 16:14:02 @@ -42,6 +42,8 @@ gboolean enabled; GnomePilotConduitSyncType sync_type; GnomePilotConduitSyncType orig_sync_type; + GnomePilotConduitSyncType first_sync_type; + GnomePilotConduitSyncType orig_first_sync_type; GnomePilotConduitSyncType default_sync_type; GnomePilotConduitManagement *management; GnomePilotConduitConfig *config; Index: capplet/util.c =================================================================== RCS file: /cvs/gnome/gnome-pilot/capplet/util.c,v retrieving revision 1.7 diff -u -r1.7 util.c --- capplet/util.c 2001/12/03 11:00:27 1.7 +++ capplet/util.c 2002/01/29 16:14:02 @@ -24,8 +24,10 @@ #include #include +#include #include #include +#include #include "util.h" static const guint speedList[] = {9600, 19200, 38400, 57600, 115200, 0}; @@ -33,8 +35,8 @@ static const char *synctypes[] = {_("Use conduit settings"), _("Synchronize"), - _("Copy from pilot"), - _("Copy to pilot"), + _("Pilot Replaces Desktop"), + _("Desktop Replace Pilot"), _("Merge from pilot"), _("Merge to pilot"), NULL}; @@ -108,7 +110,6 @@ menu = GTK_MENU (gtk_menu_new ()); - /* Add the disabled item first. */ menu_item = gtk_menu_item_new_with_label(_("Disabled")); gtk_widget_show(menu_item); gtk_object_set_data (GTK_OBJECT (menu_item), "sync_type", GINT_TO_POINTER (GnomePilotConduitSyncTypeNotSet)); @@ -135,6 +136,37 @@ } } + + gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), GTK_WIDGET (menu)); + gtk_option_menu_set_history (GTK_OPTION_MENU (option_menu), current); +} + +void +fill_conduit_first_sync_type_menu (GtkOptionMenu *option_menu, ConduitState *state) +{ + GtkWidget *menu_item; + GtkMenu *menu; + GList *tmp; + int index, current=0; + + menu = GTK_MENU (gtk_menu_new ()); + + menu_item = gtk_menu_item_new_with_label(_("None")); + gtk_widget_show(menu_item); + gtk_object_set_data (GTK_OBJECT (menu_item), "sync_type", GINT_TO_POINTER (GnomePilotConduitSyncTypeNotSet)); + gtk_menu_append (menu, menu_item); + + tmp = state->valid_synctypes; + for (index = 0; tmp != NULL; tmp = tmp->next, index++) { + gint value = GPOINTER_TO_INT (tmp->data); + + menu_item = gtk_menu_item_new_with_label (sync_type_to_str (value)); + gtk_widget_show (menu_item); + gtk_object_set_data (GTK_OBJECT (menu_item), "sync_type", GINT_TO_POINTER (value)); + gtk_menu_append (menu,menu_item); + if (value == state->first_sync_type) + current = index + 1; + } gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), GTK_WIDGET (menu)); gtk_option_menu_set_history (GTK_OPTION_MENU (option_menu), current); Index: capplet/util.h =================================================================== RCS file: /cvs/gnome/gnome-pilot/capplet/util.h,v retrieving revision 1.3 diff -u -r1.3 util.h --- capplet/util.h 2001/05/02 03:23:53 1.3 +++ capplet/util.h 2002/01/29 16:14:02 @@ -30,6 +30,7 @@ void fill_speed_menu (GtkOptionMenu *optionMenu, guint default_speed); void fill_synctype_menu (GtkOptionMenu *optionMenu, GnomePilotConduitSyncType type); void fill_conduit_sync_type_menu (GtkOptionMenu *option_menu, ConduitState *state); +void fill_conduit_first_sync_type_menu (GtkOptionMenu *option_menu, ConduitState *state); void show_popup_menu (GtkCList *list, GdkEventButton *event, GtkMenu *menu); /* Filtering callbacks */ Index: gpilotd/gpilotd.c =================================================================== RCS file: /cvs/gnome/gnome-pilot/gpilotd/gpilotd.c,v retrieving revision 1.125 diff -u -r1.125 gpilotd.c --- gpilotd/gpilotd.c 2001/12/03 11:00:31 1.125 +++ gpilotd/gpilotd.c 2002/01/29 16:14:02 @@ -46,6 +46,7 @@ #include #include #include +#include #include @@ -118,20 +119,20 @@ pilot_connect (GPilotDevice *device,int *error) { struct pi_sockaddr addr; - int sd; + int sd, listen_sd; int ret; if (device->type != PILOT_DEVICE_NETWORK) { pilot_set_baud_rate (device); } - if (!(sd = pi_socket (PI_AF_SLP, PI_SOCK_STREAM, PI_PF_PADP))) { + if (!(listen_sd = pi_socket (PI_AF_PILOT, PI_SOCK_STREAM, PI_PF_DLP))) { g_warning ("pi_socket: %s",strerror (errno)); if (error) *error = 1; return -1; } - addr.pi_family = PI_AF_SLP; + addr.pi_family = PI_AF_PILOT; /* Most important for networking @@ -145,29 +146,38 @@ strcpy (addr.pi_device,device->port); - ret = pi_bind (sd, (struct sockaddr*)&addr, sizeof (addr)); + ret = pi_bind (listen_sd, (struct sockaddr*)&addr, sizeof (addr)); if (ret == -1) { g_warning (_("Unable to bind to pilot")); - if (error) *error = 1; + if (error) + *error = 1; + pi_close(listen_sd); return 0; } - ret = pi_listen (sd,1); + ret = pi_listen (listen_sd, 1); if (ret != 0) { g_warning ("pi_listen: %s", strerror (errno)); - if (error) *error = 2; + if (error) + *error = 2; + pi_close(listen_sd); return 0; } - sd = pi_accept_to (sd, NULL,0, device->timeout); + sd = pi_accept_to (listen_sd, NULL,0, device->timeout); if (sd == -1) { g_warning ("pi_accept_to: %s", strerror (errno)); g_warning ("pi_accept_to: timeout was %d secs", device->timeout); - if (error) *error = 2; + if (error) + *error = 2; + pi_close(listen_sd); return 0; } - if (error) *error = 0; + if (error) + *error = 0; + pi_close(listen_sd); + return sd; } @@ -634,7 +644,6 @@ } } pilot_disconnect (pfd); - close (pfd); } else { if (connect_error==1) return FALSE; /* remove this device */ else return TRUE; @@ -830,6 +839,10 @@ if (line[0] == 'S') { if (!strncmp (line + 4, "Product=Handspring Visor", 24)) { + visor_exists = TRUE; + break; + } else if (!strncmp (line + 4, "Product=Palm Handheld", + 21)) { visor_exists = TRUE; break; } Index: utils/make-password.c =================================================================== RCS file: /cvs/gnome/gnome-pilot/utils/make-password.c,v retrieving revision 1.4 diff -u -r1.4 make-password.c --- utils/make-password.c 2000/02/27 12:04:00 1.4 +++ utils/make-password.c 2002/01/29 16:14:02 @@ -34,16 +34,16 @@ char salt[3]; if (argc < 2) { - fprintf(stderr,"usage:%s %s\n",argv[0],TTYPrompt); + fprintf(stderr,"usage:%s\n",argv[0]); exit(2); } - if (!(sd = pi_socket(PI_AF_SLP, PI_SOCK_STREAM, PI_PF_PADP))) { + if (!(sd = pi_socket(PI_AF_PILOT, PI_SOCK_STREAM, PI_PF_PADP))) { perror("pi_socket"); exit(1); } - addr.pi_family = PI_AF_SLP; - strcpy(addr.pi_device,argv[1]); + addr.pi_family = PI_AF_PILOT; +// strcpy(addr.pi_device,argv[1]); ret = pi_bind(sd, (struct sockaddr*)&addr, sizeof(addr)); if(ret == -1) {