[Xfce4-commits] r26458 - in xfcalendar/trunk: . src
Juha Kautto
juha at xfce.org
Tue Dec 11 22:58:58 CET 2007
Author: juha
Date: 2007-12-11 21:58:58 +0000 (Tue, 11 Dec 2007)
New Revision: 26458
Modified:
xfcalendar/trunk/NEWS
xfcalendar/trunk/TODO
xfcalendar/trunk/configure.in.in
xfcalendar/trunk/src/event-list.c
xfcalendar/trunk/src/ical-code.c
xfcalendar/trunk/src/ical-code.h
xfcalendar/trunk/src/interface.c
xfcalendar/trunk/src/interface.h
xfcalendar/trunk/src/main.c
xfcalendar/trunk/src/parameters.c
xfcalendar/trunk/src/parameters.h
Log:
made archiving a compile time option
Modified: xfcalendar/trunk/NEWS
===================================================================
--- xfcalendar/trunk/NEWS 2007-12-11 19:30:45 UTC (rev 26457)
+++ xfcalendar/trunk/NEWS 2007-12-11 21:58:58 UTC (rev 26458)
@@ -1,13 +1,3 @@
-20071002:
----------
- * Orage version 4.5.9.7 released
- * Day view added.
-
-20070519:
----------
- * Orage version 4.5.9.5 released
- * libnotify support added.
-
20070104:
---------
* Orage version 4.5.9 released
Modified: xfcalendar/trunk/TODO
===================================================================
--- xfcalendar/trunk/TODO 2007-12-11 19:30:45 UTC (rev 26457)
+++ xfcalendar/trunk/TODO 2007-12-11 21:58:58 UTC (rev 26458)
@@ -40,10 +40,10 @@
*** DONE 4.5 ***
10) more alarm possibilities (like libnotify BUG 2831 and email)
-*** DONE 4.5 ***
+*** Partly DONE 4.5 ***
11) Day, Week, Month view
-*** DONE 4.5 for day and week view ***
+*** Partly DONE 4.5 ***
12) Exclude possiblity in repeating rule
Modified: xfcalendar/trunk/configure.in.in
===================================================================
--- xfcalendar/trunk/configure.in.in 2007-12-11 19:30:45 UTC (rev 26457)
+++ xfcalendar/trunk/configure.in.in 2007-12-11 21:58:58 UTC (rev 26458)
@@ -9,7 +9,7 @@
dnl
dnl Version information
-m4_define([orage_version], [4.5.11.2-svn])
+m4_define([orage_version], [4.5.11.3-svn])
m4_define([gtk_minimum_version], [2.6.0])
m4_define([xfce_minimum_version], [4.4.0])
@@ -194,6 +194,20 @@
[notify_minimum_version], [libnotify],
[LIBNOTIFY support])
+dnl ************************************************
+dnl *** Optional support for automatic archiving ***
+dnl ************************************************
+have_archive="no"
+AC_ARG_ENABLE([archive],
+AC_HELP_STRING([--enable-archive], [use automatic archiving (defaut=yes)])
+AC_HELP_STRING([--disable-archive], [don't use automatic archiving]),
+ [], [enable_archive=yes])
+if test x"$enable_archive" = x"yes"; then
+ AC_DEFINE([HAVE_ARCHIVE], [1], [Define to enable archiving])
+ have_archive="yes"
+fi
+
+
dnl Check for debugging support
dnl BM_DEBUG_SUPPORT()
XDT_FEATURE_DEBUG
@@ -240,4 +254,5 @@
else
echo "* LIBNOTIFY support: no"
fi
+echo "* Automatic archiving: $have_archive"
echo
Modified: xfcalendar/trunk/src/event-list.c
===================================================================
--- xfcalendar/trunk/src/event-list.c 2007-12-11 19:30:45 UTC (rev 26457)
+++ xfcalendar/trunk/src/event-list.c 2007-12-11 21:58:58 UTC (rev 26458)
@@ -90,29 +90,59 @@
{ "STRING", 0, DRAG_TARGET_STRING }
};
+static void start_appt_win(char *mode, el_win *el
+ , GtkTreeModel *model, GtkTreeIter *iter, GtkTreePath *path)
+{
+ gchar *uid = NULL, *flags = NULL;
+ appt_win *apptw;
+
+ if (gtk_tree_model_get_iter(model, iter, path)) {
+ gtk_tree_model_get(model, iter, COL_UID, &uid, -1);
+#ifdef HAVE_ARCHIVE
+ gtk_tree_model_get(model, iter, COL_FLAGS, &flags, -1);
+ if (flags && flags[3] == 'A') {
+ xfical_unarchive_uid(uid);
+ /* note that file id changes after archive */
+ uid[0]='O';
+ refresh_el_win(el);
+ }
+ g_free(flags);
+#endif
+ apptw = create_appt_win(mode, uid, el);
+ g_free(uid);
+ }
+}
+
static void editEvent(GtkTreeView *view, GtkTreePath *path
, GtkTreeViewColumn *col, gpointer user_data)
{
el_win *el = (el_win *)user_data;
- appt_win *apptw;
GtkTreeModel *model;
GtkTreeIter iter;
+ /*
gchar *uid = NULL, *flags = NULL;
+ appt_win *apptw;
+ */
model = gtk_tree_view_get_model(view);
+ start_appt_win("UPDATE", el, model, &iter, path);
+ /*
if (gtk_tree_model_get_iter(model, &iter, path)) {
- gtk_tree_model_get(model, &iter
- , COL_UID, &uid, COL_FLAGS, &flags, -1);
+ gtk_tree_model_get(model, &iter, COL_UID, &uid, -1);
+#ifdef HAVE_ARCHIVE
+ gtk_tree_model_get(model, &iter, COL_FLAGS, &flags, -1);
if (flags && flags[3] == 'A') {
xfical_unarchive_uid(uid);
- /* note that file id changes after archive */
+ / * note that file id changes after archive * /
uid[0]='O';
refresh_el_win(el);
}
+#endif
apptw = create_appt_win("UPDATE", uid, el);
g_free(uid);
g_free(flags);
}
+*/
}
static gint sortEvent_comp(GtkTreeModel *model
@@ -420,12 +450,14 @@
searh_rows(el, search_string, file_type);
}
+#ifdef HAVE_ARCHIVE
/* finally process always archive file also */
if (xfical_archive_open()) {
strcpy(file_type, "A00.");
searh_rows(el, search_string, file_type);
xfical_archive_close();
}
+#endif
xfical_file_close(TRUE);
g_free(search_string);
}
@@ -477,6 +509,7 @@
app_rows(el, a_day, par, ical_type, file_type);
}
+#ifdef HAVE_ARCHIVE
/* finally process archive file for JOURNAL only */
if (ical_type == XFICAL_TYPE_JOURNAL) {
if (xfical_archive_open()) {
@@ -485,6 +518,7 @@
xfical_archive_close();
}
}
+#endif
xfical_file_close(TRUE);
}
@@ -661,8 +695,10 @@
GtkTreeIter iter;
GList *list;
gint list_len;
+ /*
gchar *uid = NULL, *flags = NULL;
appt_win *apptw;
+ */
sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(el->TreeView));
list = gtk_tree_selection_get_selected_rows(sel, &model);
@@ -671,18 +707,23 @@
if (list_len > 1)
g_warning("Copy: too many rows selected\n");
path = (GtkTreePath *)g_list_nth_data(list, 0);
+ start_appt_win("COPY", el, model, &iter, path);
+ /*
if (gtk_tree_model_get_iter(model, &iter, path)) {
gtk_tree_model_get(model, &iter, COL_UID, &uid, -1);
+#ifdef HAVE_ARCHIVE
gtk_tree_model_get(model, &iter, COL_FLAGS, &flags, -1);
if (flags && flags[3] == 'A') {
xfical_unarchive_uid(uid);
- /* note that file id changes after archive */
+ / * note that file id changes after archive * /
uid[0]='O';
refresh_el_win(el);
}
+#endif
apptw = create_appt_win("COPY", uid, el);
g_free(uid);
}
+ */
}
else
g_warning("Copy: No row selected\n");
Modified: xfcalendar/trunk/src/ical-code.c
===================================================================
--- xfcalendar/trunk/src/ical-code.c 2007-12-11 19:30:45 UTC (rev 26457)
+++ xfcalendar/trunk/src/ical-code.c 2007-12-11 21:58:58 UTC (rev 26458)
@@ -84,10 +84,12 @@
char **city; /* pointer to timezone location name strings */
} xfical_timezone_array;
-static icalset *fical = NULL,
- *afical = NULL;
-static icalcomponent *ical = NULL,
- *aical = NULL;
+static icalset *fical = NULL;
+static icalcomponent *ical = NULL;
+#ifdef HAVE_ARCHIVE
+static icalset *afical = NULL;
+static icalcomponent *aical = NULL;
+#endif
static gboolean file_modified = FALSE; /* has any ical file been changed */
static guint file_close_timer = 0; /* delayed file close timer */
@@ -716,6 +718,7 @@
return(ok);
}
+#ifdef HAVE_ARCHIVE
gboolean xfical_archive_open(void)
{
#undef P_N
@@ -731,6 +734,7 @@
return(xfical_internal_file_open(&aical, &afical, g_par.archive_file
, FALSE));
}
+#endif
gboolean xfical_file_check(gchar *file_name)
{
@@ -833,6 +837,7 @@
delayed_file_close(NULL);
}
+#ifdef HAVE_ARCHIVE
void xfical_archive_close(void)
{
#undef P_N
@@ -848,6 +853,7 @@
icalset_free(afical);
afical = NULL;
}
+#endif
static struct icaltimetype ical_get_current_local_time()
{
@@ -2484,9 +2490,11 @@
if (uid[0] == 'O') {
return(appt_get_any(ical_uid, ical, file_type));
}
+#ifdef HAVE_ARCHIVE
else if (uid[0] == 'A') {
return(appt_get_any(ical_uid, aical, file_type));
}
+#endif
else if (uid[0] == 'F') {
sscanf(uid, "F%02d", &i);
if (i < g_par.foreign_count && f_ical[i].ical != NULL)
@@ -3205,10 +3213,12 @@
return(xfical_appt_get_next_on_day_internal(a_day, first
, days, type, ical, file_type));
}
+#ifdef HAVE_ARCHIVE
else if (file_type[0] == 'A') {
return(xfical_appt_get_next_on_day_internal(a_day, first
, days, type, aical, file_type));
}
+#endif
else if (file_type[0] == 'F') {
sscanf(file_type, "F%02d", &i);
if (i < g_par.foreign_count && f_ical[i].ical != NULL)
@@ -3359,6 +3369,7 @@
}
}
+#ifdef HAVE_ARCHIVE
void xfical_icalcomponent_archive_normal(icalcomponent *e)
{
#undef P_N
@@ -3737,6 +3748,7 @@
return(TRUE);
}
+#endif
static gboolean add_event(icalcomponent *c)
{
@@ -4307,10 +4319,12 @@
return(xfical_appt_get_next_with_string_internal(str, first
, g_par.orage_file , ical, file_type));
}
+#ifdef HAVE_ARCHIVE
else if (file_type[0] == 'A') {
return(xfical_appt_get_next_with_string_internal(str, first
, g_par.archive_file, aical, file_type));
}
+#endif
else if (file_type[0] == 'F') {
sscanf(file_type, "F%02d", &i);
if (i < g_par.foreign_count && f_ical[i].ical != NULL)
Modified: xfcalendar/trunk/src/ical-code.h
===================================================================
--- xfcalendar/trunk/src/ical-code.h 2007-12-11 19:30:45 UTC (rev 26457)
+++ xfcalendar/trunk/src/ical-code.h 2007-12-11 21:58:58 UTC (rev 26458)
@@ -122,8 +122,6 @@
gboolean xfical_file_open(gboolean foreign);
void xfical_file_close(gboolean foreign);
void xfical_file_close_force(void);
-gboolean xfical_archive_open(void);
-void xfical_archive_close(void);
xfical_appt *xfical_appt_alloc();
char *xfical_appt_add(xfical_appt *app);
@@ -143,9 +141,13 @@
gboolean xfical_duration(char *alarm_stime, int *days, int *hours, int *mins);
int xfical_compare_times(xfical_appt *appt);
+#ifdef HAVE_ARCHIVE
+gboolean xfical_archive_open(void);
+void xfical_archive_close(void);
gboolean xfical_archive(void);
gboolean xfical_unarchive(void);
gboolean xfical_unarchive_uid(char *uid);
+#endif
gboolean xfical_import_file(char *file_name);
gboolean xfical_export_file(char *file_name, int type, char *uids);
Modified: xfcalendar/trunk/src/interface.c
===================================================================
--- xfcalendar/trunk/src/interface.c 2007-12-11 19:30:45 UTC (rev 26457)
+++ xfcalendar/trunk/src/interface.c 2007-12-11 21:58:58 UTC (rev 26458)
@@ -214,6 +214,7 @@
}
}
+#ifdef HAVE_ARCHIVE
void static archive_file_entry_changed(GtkWidget *dialog, gpointer user_data)
{
intf_win *intf_w = (intf_win *)user_data;
@@ -279,6 +280,7 @@
g_free(s);
}
}
+#endif
static GtkWidget *orage_file_chooser(GtkWidget *parent_window
, gboolean save, gchar *cur_file, gchar *cur_folder, gchar *def_name)
@@ -353,6 +355,7 @@
gtk_widget_destroy(f_chooser);
}
+#ifdef HAVE_ARCHIVE
static void archive_file_open_button_clicked(GtkButton *button
, gpointer user_data)
{
@@ -378,6 +381,7 @@
}
gtk_widget_destroy(f_chooser);
}
+#endif
void exp_open_button_clicked(GtkButton *button, gpointer user_data)
{
@@ -441,6 +445,7 @@
gtk_widget_destroy(f_chooser);
}
+#ifdef HAVE_ARCHIVE
void on_archive_button_clicked_cb(GtkButton *button, gpointer user_data)
{
xfical_archive();
@@ -450,6 +455,7 @@
{
xfical_unarchive();
}
+#endif
gboolean orage_import_file(gchar *entry_filename)
{
@@ -1051,13 +1057,19 @@
g_signal_connect((gpointer)intf_w->iea_exp_add_id_rb, "clicked"
, G_CALLBACK(exp_add_id_rb_clicked), intf_w);
+#ifdef HAVE_ARCHIVE
gtk_tooltips_set_tip(intf_w->tooltips, intf_w->iea_exp_add_all_rb
- , _("Note that only main file appointments are read.\nArchived events are not exported."), NULL);
+ , _("Note that only main file appointments are read.\nArchived and Foreign events are not exported."), NULL);
+#else
+ gtk_tooltips_set_tip(intf_w->tooltips, intf_w->iea_exp_add_all_rb
+ , _("Note that only main file appointments are read.\nForeign events are not exported."), NULL);
+#endif
gtk_tooltips_set_tip(intf_w->tooltips, intf_w->iea_exp_add_id_rb
, _("You can easily drag these from event-list window."), NULL);
gtk_tooltips_set_tip(intf_w->tooltips, intf_w->iea_exp_id_entry
, _("Orage appointment UIDs separated by commas."), NULL);
+#ifdef HAVE_ARCHIVE
/***** archive *****/
vbox = gtk_vbox_new(FALSE, 0);
intf_w->iea_arc_frame = xfce_create_framebox_with_content(
@@ -1093,6 +1105,7 @@
, G_CALLBACK(on_unarchive_button_clicked_cb), intf_w);
gtk_tooltips_set_tip(intf_w->tooltips, intf_w->iea_arc_button2
, _("Return all archived events into main orage file and remove arch file.\nThis is usefull for example when doing export and moving orage\nappointments to another system."), NULL);
+#endif
}
void create_orage_file_tab(intf_win *intf_w)
@@ -1169,6 +1182,7 @@
g_signal_connect(G_OBJECT(intf_w->orage_file_save_button), "clicked"
, G_CALLBACK(orage_file_save_button_clicked), intf_w);
+#ifdef HAVE_ARCHIVE
/***** archive file *****/
vbox = gtk_vbox_new(FALSE, 0);
intf_w->archive_file_frame = xfce_create_framebox_with_content(
@@ -1225,6 +1239,7 @@
, G_CALLBACK(archive_file_entry_changed), intf_w);
g_signal_connect(G_OBJECT(intf_w->archive_file_save_button), "clicked"
, G_CALLBACK(archive_file_save_button_clicked), intf_w);
+#endif
}
static void create_foreign_file_tab(intf_win *intf_w)
Modified: xfcalendar/trunk/src/interface.h
===================================================================
--- xfcalendar/trunk/src/interface.h 2007-12-11 19:30:45 UTC (rev 26457)
+++ xfcalendar/trunk/src/interface.h 2007-12-11 21:58:58 UTC (rev 26458)
@@ -50,10 +50,12 @@
GtkWidget *iea_exp_add_all_rb;
GtkWidget *iea_exp_add_id_rb;
GtkWidget *iea_exp_id_entry;
+#ifdef HAVE_ARCHIVE
/* archive */
GtkWidget *iea_arc_frame;
GtkWidget *iea_arc_button1;
GtkWidget *iea_arc_button2;
+#endif
/* Orage files tab */
GtkWidget *fil_notebook_page;
Modified: xfcalendar/trunk/src/main.c
===================================================================
--- xfcalendar/trunk/src/main.c 2007-12-11 19:30:45 UTC (rev 26457)
+++ xfcalendar/trunk/src/main.c 2007-12-11 21:58:58 UTC (rev 26458)
@@ -172,9 +172,11 @@
gboolean keep_tidy(void)
{
+#ifdef HAVE_ARCHIVE
/* move old appointment to other file to keep the active
calendar file smaller and faster */
xfical_archive();
+#endif
return TRUE;
}
Modified: xfcalendar/trunk/src/parameters.c
===================================================================
--- xfcalendar/trunk/src/parameters.c 2007-12-11 19:30:45 UTC (rev 26457)
+++ xfcalendar/trunk/src/parameters.c 2007-12-11 21:58:58 UTC (rev 26458)
@@ -58,8 +58,10 @@
GtkWidget *timezone_frame;
GtkWidget *timezone_button;
/* Archive period */
+#ifdef HAVE_ARCHIVE
GtkWidget *archive_threshold_frame;
GtkWidget *archive_threshold_spin;
+#endif
/* Choose the sound application for reminders */
GtkWidget *sound_application_frame;
GtkWidget *sound_application_entry;
@@ -330,11 +332,13 @@
xfical_set_local_timezone();
}
+#ifdef HAVE_ARCHIVE
static void archive_threshold_spin_changed(GtkSpinButton *sb
, gpointer user_data)
{
g_par.archive_limit = gtk_spin_button_get_value(sb);
}
+#endif
static void always_today_changed(GtkWidget *dialog, gpointer user_data)
{
@@ -409,6 +413,7 @@
g_signal_connect(G_OBJECT(dialog->timezone_button), "clicked"
, G_CALLBACK(timezone_button_clicked), dialog);
+#ifdef HAVE_ARCHIVE
/* Choose archiving threshold */
hbox = gtk_hbox_new(FALSE, 0);
dialog->archive_threshold_frame =
@@ -426,6 +431,7 @@
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
g_signal_connect(G_OBJECT(dialog->archive_threshold_spin), "value-changed"
, G_CALLBACK(archive_threshold_spin_changed), dialog);
+#endif
/* Choose a sound application for reminders */
hbox = gtk_hbox_new(FALSE, 0);
@@ -769,8 +775,10 @@
return;
}
xfce_rc_write_entry(rc, "Timezone", g_par.local_timezone);
+#ifdef HAVE_ARCHIVE
xfce_rc_write_int_entry(rc, "Archive limit", g_par.archive_limit);
xfce_rc_write_entry(rc, "Archive file", g_par.archive_file);
+#endif
xfce_rc_write_entry(rc, "Orage file", g_par.orage_file);
xfce_rc_write_entry(rc, "Sound application", g_par.sound_application);
gtk_window_get_position(GTK_WINDOW(g_par.xfcal->mWindow)
@@ -835,9 +843,11 @@
}
g_par.local_timezone =
g_strdup(xfce_rc_read_entry(rc, "Timezone", "floating"));
+#ifdef HAVE_ARCHIVE
g_par.archive_limit = xfce_rc_read_int_entry(rc, "Archive limit", 0);
g_par.archive_file = g_strdup(xfce_rc_read_entry(rc, "Archive file"
, orage_resource_file_location(ORAGE_DIR ARCFILE)));
+#endif
g_par.orage_file = g_strdup(xfce_rc_read_entry(rc, "Orage file"
, orage_resource_file_location(ORAGE_DIR APPFILE)));
g_par.sound_application =
Modified: xfcalendar/trunk/src/parameters.h
===================================================================
--- xfcalendar/trunk/src/parameters.h 2007-12-11 19:30:45 UTC (rev 26457)
+++ xfcalendar/trunk/src/parameters.h 2007-12-11 21:58:58 UTC (rev 26458)
@@ -60,9 +60,11 @@
char *local_timezone;
gboolean local_timezone_utc;
+#ifdef HAVE_ARCHIVE
/* archiving */
int archive_limit;
char *archive_file;
+#endif
/* foreign files */
int foreign_count;
More information about the Xfce4-commits
mailing list