[Xfce4-commits] <orage:master> 4.9.6.0 Fixed bug 9024 Removing Elements Does Not Reduce Window Size
Juha
noreply at xfce.org
Wed Feb 13 14:00:01 CET 2013
Updating branch refs/heads/master
to 7edbd569e0fcbdb69ed3ea12ef57971b25a60237 (commit)
from bd4d460ed7ecf50362696ac9b723ad880a1d52cd (commit)
commit 7edbd569e0fcbdb69ed3ea12ef57971b25a60237
Author: Juha <juha at xfce.org>
Date: Wed Feb 13 14:54:02 2013 +0200
4.9.6.0 Fixed bug 9024 Removing Elements Does Not Reduce Window Size
Fixed parameters so that that removing both event and todo box also
causes the space they take to vanish.
Also fixed a bug where adding todo box after start did not actually
add it.
Also added code to save main calendar window size and location always
when ending Orage (unless killed).
Also changed parameter order a little to be more consistent.
configure.in.in | 2 +-
src/main.c | 3 +-
src/mainbox.c | 13 ++++++++
src/mainbox.h | 1 +
src/parameters.c | 87 ++++++++++++++++++++++++++++-------------------------
src/tray_icon.c | 6 ++--
6 files changed, 66 insertions(+), 46 deletions(-)
diff --git a/configure.in.in b/configure.in.in
index 95683c4..459d305 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -9,7 +9,7 @@ dnl Written for Xfce by Juha Kautto <juha at xfce.org>
dnl
dnl Version information
-m4_define([orage_version], [4.9.5.0-git])
+m4_define([orage_version], [4.9.6.0-git])
m4_define([gtk_minimum_version], [2.14.0])
m4_define([xfce_minimum_version], [4.8.0])
diff --git a/src/main.c b/src/main.c
index d2e87ad..1c17d5a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,6 +1,6 @@
/* Orage - Calendar and alarm handler
*
- * Copyright (c) 2005-2011 Juha Kautto (juha at xfce.org)
+ * Copyright (c) 2005-2013 Juha Kautto (juha at xfce.org)
* Copyright (c) 2003-2006 Mickael Graf (korbinus at xfce.org)
*
* This program is free software; you can redistribute it and/or modify
@@ -234,6 +234,7 @@ static gboolean keep_tidy(void)
calendar file smaller and faster */
xfical_archive();
#endif
+ write_parameters();
return(TRUE);
}
diff --git a/src/mainbox.c b/src/mainbox.c
index ca82d5b..c63ec68 100644
--- a/src/mainbox.c
+++ b/src/mainbox.c
@@ -792,6 +792,19 @@ void build_mainbox_event_box(void)
xfical_file_close(TRUE);
}
+void build_mainbox_todo_box(void)
+{
+#undef P_N
+#define P_N "build_mainbox_todo_box: "
+#ifdef ORAGE_DEBUG
+ orage_message(-100, P_N);
+#endif
+ if (!xfical_file_open(TRUE))
+ return;
+ build_mainbox_todo_info();
+ xfical_file_close(TRUE);
+}
+
/**********************************************************************
* This routine is called from ical-code xfical_alarm_build_list_internal
* and ical files are already open at that time. So make sure ical files
diff --git a/src/mainbox.h b/src/mainbox.h
index 56fbbbe..e69fbed 100644
--- a/src/mainbox.h
+++ b/src/mainbox.h
@@ -66,6 +66,7 @@ void build_mainWin();
gboolean orage_mark_appointments();
void build_mainbox_info();
void build_mainbox_event_box();
+void build_mainbox_todo_box();
void mCalendar_month_changed_cb(GtkCalendar *calendar, gpointer user_data);
#endif /* !__MAINBOX_H__ */
diff --git a/src/parameters.c b/src/parameters.c
index a4e5cc6..6c30ffd 100644
--- a/src/parameters.c
+++ b/src/parameters.c
@@ -193,21 +193,21 @@ static void weeks_changed(GtkWidget *dialog, gpointer user_data)
set_calendar();
}
-static void set_todos(void)
-{
- if (g_par.show_todos)
- gtk_widget_show_all(((CalWin *)g_par.xfcal)->mTodo_vbox);
- else
- gtk_widget_hide_all(((CalWin *)g_par.xfcal)->mTodo_vbox);
-}
-
static void todos_changed(GtkWidget *dialog, gpointer user_data)
{
Itf *itf = (Itf *)user_data;
g_par.show_todos = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
itf->show_todos_checkbutton));
- set_todos();
+ if (g_par.show_todos)
+ build_mainbox_todo_box();
+ else {
+ gtk_widget_hide_all(((CalWin *)g_par.xfcal)->mTodo_vbox);
+ /* hide the whole area if also event box does not exist */
+ if (!g_par.show_event_days)
+ gtk_window_resize(GTK_WINDOW(((CalWin *)g_par.xfcal)->mWindow)
+ , g_par.size_x, 1);
+ }
}
static void show_events_spin_changed(GtkSpinButton *sb, gpointer user_data)
@@ -215,8 +215,13 @@ static void show_events_spin_changed(GtkSpinButton *sb, gpointer user_data)
g_par.show_event_days = gtk_spin_button_get_value(sb);
if (g_par.show_event_days)
build_mainbox_event_box();
- else
+ else {
gtk_widget_hide_all(((CalWin *)g_par.xfcal)->mEvent_vbox);
+ /* hide the whole area if also todo box does not exist */
+ if (!g_par.show_todos)
+ gtk_window_resize(GTK_WINDOW(((CalWin *)g_par.xfcal)->mWindow)
+ , g_par.size_x, 1);
+ }
}
static void set_stick(void)
@@ -616,6 +621,37 @@ static void create_parameter_dialog_calendar_setup_tab(Itf *dialog)
g_signal_connect(G_OBJECT(dialog->show_weeks_checkbutton), "toggled"
, G_CALLBACK(weeks_changed), dialog);
+ /***** calendar info boxes (under the calendar) *****/
+ vbox = gtk_vbox_new(FALSE, 0);
+ dialog->info_frame =
+ orage_create_framebox_with_content(_("Calendar info boxes"), vbox);
+ gtk_box_pack_start(GTK_BOX(dialog->calendar_vbox), dialog->info_frame
+ , FALSE, FALSE, 5);
+
+ dialog->show_todos_checkbutton = gtk_check_button_new_with_mnemonic(
+ _("Show todo list"));
+ gtk_box_pack_start(GTK_BOX(vbox)
+ , dialog->show_todos_checkbutton, FALSE, FALSE, 0);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
+ dialog->show_todos_checkbutton), g_par.show_todos);
+
+ hbox = gtk_hbox_new(FALSE, 0);
+ label = gtk_label_new(_("Number of days to show in event window"));
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
+ dialog->show_events_spin = gtk_spin_button_new_with_range(0, 31, 1);
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->show_events_spin)
+ , g_par.show_event_days);
+ gtk_widget_set_tooltip_text(dialog->show_events_spin
+ , _("0 = do not show event list at all"));
+ gtk_box_pack_start(GTK_BOX(hbox)
+ , dialog->show_events_spin, FALSE, FALSE, 5);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+ g_signal_connect(G_OBJECT(dialog->show_todos_checkbutton), "toggled"
+ , G_CALLBACK(todos_changed), dialog);
+ g_signal_connect(G_OBJECT(dialog->show_events_spin), "value-changed"
+ , G_CALLBACK(show_events_spin_changed), dialog);
+
/***** Where calendar appears = exists = is visible *****/
table = create_table(3, 2);
dialog->appearance_frame =
@@ -667,37 +703,6 @@ static void create_parameter_dialog_calendar_setup_tab(Itf *dialog)
g_signal_connect(G_OBJECT(dialog->show_systray_checkbutton), "toggled"
, G_CALLBACK(systray_changed), dialog);
- /***** calendar info boxes (under the calendar) *****/
- vbox = gtk_vbox_new(FALSE, 0);
- dialog->info_frame =
- orage_create_framebox_with_content(_("Calendar info boxes"), vbox);
- gtk_box_pack_start(GTK_BOX(dialog->calendar_vbox), dialog->info_frame
- , FALSE, FALSE, 5);
-
- dialog->show_todos_checkbutton = gtk_check_button_new_with_mnemonic(
- _("Show todo list"));
- gtk_box_pack_start(GTK_BOX(vbox)
- , dialog->show_todos_checkbutton, FALSE, FALSE, 0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
- dialog->show_todos_checkbutton), g_par.show_todos);
-
- hbox = gtk_hbox_new(FALSE, 0);
- label = gtk_label_new(_("Number of days to show in event window"));
- gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
- dialog->show_events_spin = gtk_spin_button_new_with_range(0, 31, 1);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->show_events_spin)
- , g_par.show_event_days);
- gtk_widget_set_tooltip_text(dialog->show_events_spin
- , _("0 = do not show event list at all"));
- gtk_box_pack_start(GTK_BOX(hbox)
- , dialog->show_events_spin, FALSE, FALSE, 5);
- gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-
- g_signal_connect(G_OBJECT(dialog->show_todos_checkbutton), "toggled"
- , G_CALLBACK(todos_changed), dialog);
- g_signal_connect(G_OBJECT(dialog->show_events_spin), "value-changed"
- , G_CALLBACK(show_events_spin_changed), dialog);
-
/***** how to show when started (show/hide/minimize) *****/
dialog->visibility_radiobutton_group = NULL;
hbox = gtk_hbox_new(TRUE, 0);
diff --git a/src/tray_icon.c b/src/tray_icon.c
index 01cda8e..1c932e9 100644
--- a/src/tray_icon.c
+++ b/src/tray_icon.c
@@ -1,6 +1,6 @@
/* Orage - Calendar and alarm handler
*
- * Copyright (c) 2006-2011 Juha Kautto (juha at xfce.org)
+ * Copyright (c) 2006-2013 Juha Kautto (juha at xfce.org)
* Copyright (c) 2004-2006 Mickael Graf (korbinus at xfce.org)
*
* This program is free software; you can redistribute it and/or modify
@@ -91,8 +91,8 @@ static void on_globaltime_activate(GtkMenuItem *menuitem, gpointer user_data)
, error->message);
}
-static gboolean button_press_cb(GtkStatusIcon *status_icon, GdkEventButton *event
- , gpointer user_data)
+static gboolean button_press_cb(GtkStatusIcon *status_icon
+ , GdkEventButton *event, gpointer user_data)
{
GdkAtom atom;
GdkEventClient gev;
More information about the Xfce4-commits
mailing list