diff --git a/ChangeLog b/ChangeLog index 05a2d7b..6d51a40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Version 1.5 (2010/03/20): + * Renamed project to pidgin-birthday-reminder + * Added tabs in the preferences window + * iCalendar files are forced to have the .ics extension now + * Added spanish translation (many thanks to Christoph Miebach) + Version 1.4 (2010/03/03): * Added iCalendar export * Added french translation (many thanks to Pierre Etchemaïté) diff --git a/VERSION b/VERSION index f7bfa52..c239c60 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5-0beta1 +1.5 diff --git a/config.h.mingw b/config.h.mingw index 7e2f5f9..2d23691 100644 --- a/config.h.mingw +++ b/config.h.mingw @@ -66,7 +66,7 @@ #define PACKAGE_NAME "pidgin-birthday-reminder" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "pidgin-birthday-reminder 1.5-0beta1" +#define PACKAGE_STRING "pidgin-birthday-reminder 1.5" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "pidgin-birthday-reminder" @@ -75,7 +75,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.5-0beta1" +#define PACKAGE_VERSION "1.5" /* Define the plugin author to be used */ #define PLUGIN_AUTHOR "Konrad Gräfe " @@ -87,7 +87,7 @@ #define PLUGIN_STATIC_NAME "birthday-reminder" /* Define the plugin version to be used */ -#define PLUGIN_VERSION "1.5-0beta1" +#define PLUGIN_VERSION "1.5" /* Define the plugin website to be used */ #define PLUGIN_WEBSITE "http://freakazoid.teamblind.de/2009/02/14/pidgin-birthday-reminder/" @@ -96,4 +96,4 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "1.5-0beta1" +#define VERSION "1.5" diff --git a/configure b/configure index bba654f..505d773 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for pidgin-birthday-reminder 1.5-0beta1. +# Generated by GNU Autoconf 2.64 for pidgin-birthday-reminder 1.5. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software @@ -695,8 +695,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='pidgin-birthday-reminder' PACKAGE_TARNAME='pidgin-birthday-reminder' -PACKAGE_VERSION='1.5-0beta1' -PACKAGE_STRING='pidgin-birthday-reminder 1.5-0beta1' +PACKAGE_VERSION='1.5' +PACKAGE_STRING='pidgin-birthday-reminder 1.5' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1456,7 +1456,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures pidgin-birthday-reminder 1.5-0beta1 to adapt to many kinds of systems. +\`configure' configures pidgin-birthday-reminder 1.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1527,7 +1527,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pidgin-birthday-reminder 1.5-0beta1:";; + short | recursive ) echo "Configuration of pidgin-birthday-reminder 1.5:";; esac cat <<\_ACEOF @@ -1631,7 +1631,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pidgin-birthday-reminder configure 1.5-0beta1 +pidgin-birthday-reminder configure 1.5 generated by GNU Autoconf 2.64 Copyright (C) 2009 Free Software Foundation, Inc. @@ -1996,7 +1996,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pidgin-birthday-reminder $as_me 1.5-0beta1, which was +It was created by pidgin-birthday-reminder $as_me 1.5, which was generated by GNU Autoconf 2.64. Invocation command line was $ $0 $@ @@ -2804,7 +2804,7 @@ fi # Define the identity of the package. PACKAGE='pidgin-birthday-reminder' - VERSION='1.5-0beta1' + VERSION='1.5' cat >>confdefs.h <<_ACEOF @@ -2851,7 +2851,7 @@ ac_config_headers="$ac_config_headers config.h" cat >>confdefs.h <<_ACEOF -#define PLUGIN_VERSION "1.5-0beta1" +#define PLUGIN_VERSION "1.5" _ACEOF @@ -12455,7 +12455,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by pidgin-birthday-reminder $as_me 1.5-0beta1, which was +This file was extended by pidgin-birthday-reminder $as_me 1.5, which was generated by GNU Autoconf 2.64. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12519,7 +12519,7 @@ Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -pidgin-birthday-reminder config.status 1.5-0beta1 +pidgin-birthday-reminder config.status 1.5 configured by $0, generated by GNU Autoconf 2.64, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.in b/configure.in index 8ad474d..627c40b 100644 --- a/configure.in +++ b/configure.in @@ -2,13 +2,13 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT(pidgin-birthday-reminder, 1.5-0beta1) +AC_INIT(pidgin-birthday-reminder, 1.5) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src/birthday_reminder.c]) AC_CONFIG_HEADER([config.h]) AC_CONFIG_MACRO_DIR([m4]) -AC_DEFINE_UNQUOTED(PLUGIN_VERSION, ["1.5-0beta1"], [Define the plugin version to be used]) +AC_DEFINE_UNQUOTED(PLUGIN_VERSION, ["1.5"], [Define the plugin version to be used]) AC_DEFINE_UNQUOTED(PLUGIN_WEBSITE, ["http://freakazoid.teamblind.de/2009/02/14/pidgin-birthday-reminder/"], [Define the plugin website to be used]) diff --git a/po/de.gmo b/po/de.gmo index 13aac77..f1c8282 100644 Binary files a/po/de.gmo and b/po/de.gmo differ diff --git a/po/es.gmo b/po/es.gmo index 73c260c..c7000be 100644 Binary files a/po/es.gmo and b/po/es.gmo differ diff --git a/po/fr.gmo b/po/fr.gmo index 3cf1dab..ecd2f3a 100644 Binary files a/po/fr.gmo and b/po/fr.gmo differ diff --git a/po/ru.gmo b/po/ru.gmo index 6758482..96af9b3 100644 Binary files a/po/ru.gmo and b/po/ru.gmo differ diff --git a/src/functions.c b/src/functions.c index 597cd85..865487c 100644 --- a/src/functions.c +++ b/src/functions.c @@ -21,6 +21,8 @@ #include "internal.h" +#include + void g_date_set_today(GDate *date) { #if !GLIB_CHECK_VERSION(2,10,0) @@ -77,3 +79,19 @@ gboolean node_account_connected(PurpleBlistNode *node) { return purple_account_is_connected(acc); } + +gboolean has_file_extension(const char *filename, const char *ext) { + int len, extlen; + + if (filename == NULL || *filename == '\0' || ext == NULL) + return 0; + + extlen = strlen(ext); + len = strlen(filename) - extlen; + + if (len < 0) + return 0; + + return (strncasecmp(filename + len, ext, extlen) == 0); +} + diff --git a/src/functions.h b/src/functions.h index 43de44d..d7c1e6f 100644 --- a/src/functions.h +++ b/src/functions.h @@ -31,4 +31,6 @@ void write_im(PurpleBlistNode *node); gboolean node_account_connected(PurpleBlistNode *node); +gboolean has_file_extension(const char *filename, const char *ext); + #endif diff --git a/src/plugin_actions.c b/src/plugin_actions.c index 1048989..73b75f7 100644 --- a/src/plugin_actions.c +++ b/src/plugin_actions.c @@ -29,6 +29,7 @@ #include "check.h" #include "birthday_list.h" #include "icsexport.h" +#include "functions.h" static void check_birthdays_plugin_action_cb(PurplePluginAction *action) { check_birthdays(NULL, NULL); @@ -42,6 +43,7 @@ static void birthday_list_show_cb(PurplePluginAction *action) { static void export_birthdays_cb(PurplePluginAction *action) { GtkWidget *dialog; GtkFileFilter *filter; + gchar *path, *tmp; dialog = gtk_file_chooser_dialog_new(_("Save birthday list as..."), NULL, @@ -60,7 +62,15 @@ static void export_birthdays_cb(PurplePluginAction *action) { gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter); if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { - icsexport(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog))); + path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); + if(!has_file_extension(path, "ics")) { + tmp = path; + path = g_strdup_printf("%s.ics", tmp); + g_free(tmp); + } + + icsexport(path); + g_free(path); } gtk_widget_destroy(dialog); diff --git a/src/prefs.c b/src/prefs.c index 8f77756..cf90b61 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -27,6 +27,7 @@ #include "birthday_reminder.h" #include "icsexport.h" +#include "functions.h" extern PurplePlugin *plugin; @@ -67,7 +68,7 @@ static void export_filechooser_cb(GtkWidget *widget, gpointer data) { GtkEntry *entry; GtkWidget *dialog; GtkFileFilter *filter; - gchar *new_path; + gchar *new_path, *tmp; entry = (GtkEntry *) data; @@ -89,6 +90,11 @@ static void export_filechooser_cb(GtkWidget *widget, gpointer data) { if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { new_path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); + if(!has_file_extension(new_path, "ics")) { + tmp = new_path; + new_path = g_strdup_printf("%s.ics", tmp); + g_free(tmp); + } gtk_entry_set_text(entry, new_path); g_free(new_path); }