[Xfce4-commits] r27259 - in squeeze/trunk: libsqueeze src
Author: peter Date: 2008-07-11 23:36:22 + (Fri, 11 Jul 2008) New Revision: 27259 Modified: squeeze/trunk/libsqueeze/libsqueeze.c squeeze/trunk/libsqueeze/libsqueeze.h squeeze/trunk/src/main_window.c squeeze/trunk/src/tool_bar.c Log: delete works now too Modified: squeeze/trunk/libsqueeze/libsqueeze.c === --- squeeze/trunk/libsqueeze/libsqueeze.c 2008-07-11 21:36:31 UTC (rev 27258) +++ squeeze/trunk/libsqueeze/libsqueeze.c 2008-07-11 23:36:22 UTC (rev 27259) @@ -140,3 +140,30 @@ { return NULL; } + +const gchar ** +lsq_iter_list_to_strv(GSList *list) +{ + guint i; + + const gchar **strv; + + if(!list) +return NULL; + + strv = g_new(const gchar *, g_slist_length(list)+1); + + i = 0; + + while(list) + { +g_debug(list->data); +strv[i++] = lsq_archive_iter_get_filename(list->data); +list = g_slist_next(list); + } + + strv[i] = NULL; + + return strv; +} + Modified: squeeze/trunk/libsqueeze/libsqueeze.h === --- squeeze/trunk/libsqueeze/libsqueeze.h 2008-07-11 21:36:31 UTC (rev 27258) +++ squeeze/trunk/libsqueeze/libsqueeze.h 2008-07-11 23:36:22 UTC (rev 27259) @@ -80,6 +80,9 @@ gboolean lsq_is_supported(const gchar *filename); +const gchar ** +lsq_iter_list_to_strv(GSList *list); + G_END_DECLS #endif /* __LIBSQUEEZE_H__ */ Modified: squeeze/trunk/src/main_window.c === --- squeeze/trunk/src/main_window.c 2008-07-11 21:36:31 UTC (rev 27258) +++ squeeze/trunk/src/main_window.c 2008-07-11 23:36:22 UTC (rev 27259) @@ -806,6 +806,8 @@ LSQArchive *lp_archive = NULL; + const gchar **strv; + GSList *filenames = sq_notebook_get_selected_items(SQ_NOTEBOOK(window->notebook)); sq_notebook_get_active_archive(SQ_NOTEBOOK(window->notebook), &lp_archive); @@ -821,8 +823,10 @@ lsq_iter_slist_free(filenames); filenames = NULL; } - if(!lsq_archive_operate(lp_archive, LSQ_COMMAND_TYPE_EXTRACT, NULL, extract_archive_path)) +strv = lsq_iter_list_to_strv(filenames); + if(!lsq_archive_operate(lp_archive, LSQ_COMMAND_TYPE_EXTRACT, strv, extract_archive_path)) { + g_free(strv); GtkWidget *warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_WARNING, @@ -834,6 +838,8 @@ gtk_widget_destroy(warning_dialog); } } +else + g_free(strv); g_free(extract_archive_path); extract_archive_path = NULL; } @@ -869,8 +875,10 @@ filenames = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog)); if(filenames) { - if(!lsq_archive_operate(lp_archive, LSQ_COMMAND_TYPE_ADD, NULL, NULL)) + const gchar **strv = lsq_iter_list_to_strv(filenames); + if(!lsq_archive_operate(lp_archive, LSQ_COMMAND_TYPE_ADD, strv, NULL)) { +g_free(strv); GtkWidget *warning_dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_WARNING, @@ -879,6 +887,8 @@ gtk_dialog_run (GTK_DIALOG (warning_dialog) ); gtk_widget_destroy(warning_dialog); } + else +g_free(strv); } } gtk_widget_destroy (dialog); @@ -911,8 +921,10 @@ filenames = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog)); if(filenames) { - if(!lsq_archive_operate(lp_archive, LSQ_COMMAND_TYPE_ADD, NULL, NULL)) + const gchar **strv = lsq_iter_list_to_strv(filenames); + if(!lsq_archive_operate(lp_archive, LSQ_COMMAND_TYPE_ADD, strv, NULL))
[Xfce4-commits] r27258 - xfce4-settings/branches/multiple_pointers
Author: nick Date: 2008-07-11 21:36:31 + (Fri, 11 Jul 2008) New Revision: 27258 Modified: xfce4-settings/branches/multiple_pointers/daemon.c xfce4-settings/branches/multiple_pointers/main.c xfce4-settings/branches/multiple_pointers/mouse_dialog.glade Log: * Fix some dialog stuff. * Implement toggle button to reverse the scroll wheel direction. Modified: xfce4-settings/branches/multiple_pointers/daemon.c === --- xfce4-settings/branches/multiple_pointers/daemon.c 2008-07-11 19:12:26 UTC (rev 27257) +++ xfce4-settings/branches/multiple_pointers/daemon.c 2008-07-11 21:36:31 UTC (rev 27258) @@ -45,16 +45,52 @@ static void +mouse_daemon_change_button_mapping_swap (guchar *buttonmap, + gshortnum_buttons, + gint id_1, + gint id_2, + gboolean reverse) +{ +guint n; +gint id_a; +gint id_b; + +/* figure out the position of the id_1 and id_2 buttons in the map */ +for (n = 0, id_a = id_b = -1; n < num_buttons; n++) +{ +if (buttonmap[n] == id_1) +id_a = n; +else if (buttonmap[n] == id_2) +id_b = n; +} + +/* only change the map when id_a and id_b where found */ +if (G_LIKELY (id_a != -1 && id_b != -1)) +{ +/* check if we need to change the buttonmap */ +if ((!reverse && (id_a < id_b)) || (reverse && (id_a > id_b))) +{ +/* swap the buttons in the button map */ +buttonmap[id_a] = id_2; +buttonmap[id_b] = id_1; +} +} +} + + + +static void mouse_daemon_change_button_mapping (XDeviceInfo *device_info, XDevice *device, Display *xdisplay, -gboolean right_handed) +gint right_handed, +gint reverse_scrolling) { XAnyClassPtr ptr; gshortnum_buttons; guchar *buttonmap; -gint id_1, id_3; gint n; +gint right_button; /* get the device classes */ ptr = device_info->inputclassinfo; @@ -84,30 +120,24 @@ /* get the button mapping */ XGetDeviceButtonMapping (xdisplay, device, buttonmap, num_buttons); -/* figure out the position of the first and second/third button in the map */ -for (n = 0, id_1 = id_3 = -1; n < num_buttons; n++) +if (right_handed != -1) { -if (buttonmap[n] == 1) -id_1 = n; -else if (buttonmap[n] == (num_buttons < 3 ? 2 : 3)) -id_3 = n; +/* get the right button number */ +right_button = num_buttons < 3 ? 2 : 3; + +/* check the buttons and swap them if needed */ +mouse_daemon_change_button_mapping_swap (buttonmap, num_buttons, 1, right_button, !!right_handed); } -/* only change the map when id_1 and id_3 where found */ -if (G_LIKELY (id_1 != -1 && id_3 != -1)) +if (reverse_scrolling != -1 && num_buttons >= 5) { -/* check if we need to change the buttonmap */ -if ((!right_handed && (id_1 < id_3)) || (right_handed && (id_1 > id_3))) -{ -/* swap the left and right button */ -buttonmap[id_1] = (num_buttons < 3 ? 2 : 3); -buttonmap[id_3] = 1; - -/* set the new button mapping */ -XSetDeviceButtonMapping (xdisplay, device, buttonmap, num_buttons); -} +/* check the buttons and swap them if needed */ +mouse_daemon_change_button_mapping_swap (buttonmap, num_buttons, 4, 5, !reverse_scrolling); } +/* set the new button mapping */ +XSetDeviceButtonMapping (xdisplay, device, buttonmap, num_buttons); + /* cleanup */ g_free (buttonmap); } @@ -236,6 +266,7 @@ gchar *threshold_str; gchar *acceleration_str; gchar *device_name; +gchar *reverse_scrolling_str; /* get the x display */ xdisplay = gdk_x11_display_get_xdisplay (gdk_display_get_default ()); @@ -264,20 +295,23 @@ /* check if we have a property for this device, else continue */ if (xfconf_channel_has_property (channel, righthanded_str)) { -/* restore the button mapping */ -mouse_daemon_change_button_mapping (device_info, device, xdisplay, - xfconf_channel_get_bool (channel, righthanded_str, TRUE)); - /* create property names */ +reverse_scrollin
[Xfce4-commits] r27257 - in xfce4-settings/trunk: . dialogs/mouse-settings
Author: nick Date: 2008-07-11 19:12:26 + (Fri, 11 Jul 2008) New Revision: 27257 Modified: xfce4-settings/trunk/ChangeLog xfce4-settings/trunk/dialogs/mouse-settings/mouse-dialog.glade Log: * dialogs/mouse-settings/mouse-dialog.glade: Add some tooltips so people have a clue what the sliders actually do. Modified: xfce4-settings/trunk/ChangeLog === --- xfce4-settings/trunk/ChangeLog 2008-07-11 19:05:55 UTC (rev 27256) +++ xfce4-settings/trunk/ChangeLog 2008-07-11 19:12:26 UTC (rev 27257) @@ -1,5 +1,10 @@ 2008-07-11 Nick Schermer <[EMAIL PROTECTED]> + * dialogs/mouse-settings/mouse-dialog.glade: Add some tooltips + so people have a clue what the sliders actually do. + +2008-07-11 Nick Schermer <[EMAIL PROTECTED]> + * dialogs/appearance-settings/main.c: Some code cleanups and plug a stupid leak. * dialogs/appearance-settings/appearance-dialog.glade: Redesign Modified: xfce4-settings/trunk/dialogs/mouse-settings/mouse-dialog.glade === --- xfce4-settings/trunk/dialogs/mouse-settings/mouse-dialog.glade 2008-07-11 19:05:55 UTC (rev 27256) +++ xfce4-settings/trunk/dialogs/mouse-settings/mouse-dialog.glade 2008-07-11 19:12:26 UTC (rev 27257) @@ -1,6 +1,6 @@ - + @@ -132,6 +132,7 @@ True True +The pointer will go 'acceleration' times as fast when it travels more than 'threshold' pixels in a short time 1 1 30 1 5 0 0 False @@ -190,6 +191,7 @@ True True +The number of pixels the pointer has to moved in a short time before the acceleration starts 1 1 20 1 5 0 0 0 @@ -281,6 +283,7 @@ True True +The number of pixels the pointer can move before dragging 1 1 50 1 5 0 0 False @@ -370,6 +373,7 @@ True True +The maximum time allowed between two clicks for them to be considered a double click 100 100 2000 10 100 0 0 False ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] r27254 - xfce4-settings/trunk
Author: jannis Date: 2008-07-11 10:07:13 + (Fri, 11 Jul 2008) New Revision: 27254 Added: xfce4-settings/trunk/TODO Modified: xfce4-settings/trunk/ChangeLog Log: * TODO: Add TODO file and fill it with the stuff that's still missing in the keyboard settings. Modified: xfce4-settings/trunk/ChangeLog === --- xfce4-settings/trunk/ChangeLog 2008-07-10 21:52:53 UTC (rev 27253) +++ xfce4-settings/trunk/ChangeLog 2008-07-11 10:07:13 UTC (rev 27254) @@ -1,3 +1,8 @@ +2008-07-11 Jannis Pohlmann <[EMAIL PROTECTED]> + + * TODO: Add TODO file and fill it with the stuff that's still + missing in the keyboard settings. + 2008-07-10 Nick Schermer <[EMAIL PROTECTED]> * dialogs/appearance-settings/images.h, Added: xfce4-settings/trunk/TODO === --- xfce4-settings/trunk/TODO (rev 0) +++ xfce4-settings/trunk/TODO 2008-07-11 10:07:13 UTC (rev 27254) @@ -0,0 +1,6 @@ +Keyboard settings (Jannis) + + + * Implement 'Add' button in the keyboard shortcuts dialog + * Add shortcut execution code to xfce4-settings-helper + (* Maybe add support for keyboard themes again) ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits