Commit 9221ef76 authored by Vincent Untz's avatar Vincent Untz Committed by Vincent Untz
Browse files

Move the calendar popup code in a new file. Implement saving of the state

2007-05-21  Vincent Untz  <vuntz@gnome.org>

	Move the calendar popup code in a new file.
	Implement saving of the state of appointment expanders in gconf.

	* Makefile.am: add new files, generate clock-typebuiltins.[ch]
	* calendar-window.[ch]: new GtkWindow-derived widget, that implements
	the calendar popup. Based on code from clock.c (which has been of
	course removed)
	* clock.h: new, with stuff from clock.c needed by CalendarWindow
	* clock.schemas.in: add new gconf keys for the state of expanders
	* clock.c: (destroy_clock): remove now unneeded code
	(create_calendar): simplify, now only creates a CalendarWindow
	(update_popup): updated
	(format_changed): update CalendarWindow
	(gmt_time_changed): update CalendarWindow
	(show_week_changed): update CalendarWindow
	(fill_clock_applet): updated

svn path=/trunk/; revision=10402
parent c5238a00
2007-05-21 Vincent Untz <vuntz@gnome.org>
Move the calendar popup code in a new file.
Implement saving of the state of appointment expanders in gconf.
* Makefile.am: add new files, generate clock-typebuiltins.[ch]
* calendar-window.[ch]: new GtkWindow-derived widget, that implements
the calendar popup. Based on code from clock.c (which has been of
course removed)
* clock.h: new, with stuff from clock.c needed by CalendarWindow
* clock.schemas.in: add new gconf keys for the state of expanders
* clock.c: (destroy_clock): remove now unneeded code
(create_calendar): simplify, now only creates a CalendarWindow
(update_popup): updated
(format_changed): update CalendarWindow
(gmt_time_changed): update CalendarWindow
(show_week_changed): update CalendarWindow
(fill_clock_applet): updated
2007-05-20 Vincent Untz <vuntz@gnome.org>
Have separate treeviews for appointments, birthdays and weather.
......
......@@ -27,12 +27,51 @@ CALENDAR_SOURCES = \
# icon_unknown_16.png
endif
CLOCK_SOURCES = clock.c $(CALENDAR_SOURCES)
CLOCK_SOURCES = \
calendar-window.c \
calendar-window.h \
clock.c \
clock.h \
$(BUILT_SOURCES) \
$(CALENDAR_SOURCES)
CLOCK_LDADD = \
../../libpanel-applet/libpanel-applet-2.la \
$(CLOCK_LIBS)
BUILT_SOURCES = \
clock-typebuiltins.c \
clock-typebuiltins.h
clock_enum_headers = \
$(top_srcdir)/applets/clock/clock.h
clock-typebuiltins.c: @REBUILD@ $(clock_enum_headers)
glib-mkenums --fhead "#include <glib-object.h>\n" \
--fhead "#include \"clock-typebuiltins.h\"\n\n" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--fprod "\n#include \"@filename@\"\n" \
--vhead "static const GEnumValue _@enum_name@_values[] = {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n};\n\n" \
--vtail "GType\n@enum_name@_get_type (void)\n{\n" \
--vtail " static GType type = 0;\n\n" \
--vtail " if (!type)\n" \
--vtail " type = g_enum_register_static (\"@EnumName@\", _@enum_name@_values);\n\n" \
--vtail " return type;\n}\n\n" \
$(clock_enum_headers) > $@
clock-typebuiltins.h: @REBUILD@ $(clock_enum_headers)
glib-mkenums --fhead "#ifndef __CLOCK_TYPEBUILTINS_H__\n" \
--fhead "#define __CLOCK_TYPEBUILTINS_H__ 1\n\n" \
--fhead "G_BEGIN_DECLS\n\n" \
--ftail "G_END_DECLS\n\n" \
--ftail "#endif /* __CLOCK_TYPEBUILTINS_H__ */\n" \
--fprod "\n/* --- @filename@ --- */" \
--eprod "#define CLOCK_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n" \
--eprod "GType @enum_name@_get_type (void);\n" \
$(clock_enum_headers) > $@
if CLOCK_INPROCESS
APPLET_TYPE = shlib
APPLET_LOCATION = $(pkglibdir)/libclock-applet.so
......@@ -43,6 +82,7 @@ libclock_applet_la_SOURCES = $(CLOCK_SOURCES)
libclock_applet_la_LIBADD = $(CLOCK_LDADD)
libclock_applet_la_LDFLAGS = -module -avoid-version
libclock_applet_la_CFLAGS =
$(libclock_applet_la_OBJECTS): $(BUILT_SOURCES)
else
APPLET_TYPE = exe
APPLET_LOCATION = $(libexecdir)/clock-applet
......@@ -51,6 +91,7 @@ libexec_PROGRAMS = clock-applet
clock_applet_SOURCES = $(CLOCK_SOURCES)
clock_applet_LDADD = $(CLOCK_LDADD)
clock_applet_CFLAGS =
$(clock_applet_OBJECTS): $(BUILT_SOURCES)
endif
uidir = $(datadir)/gnome-2.0/ui
......@@ -95,4 +136,8 @@ EXTRA_DIST = \
clockbitmapsdir = $(datadir)/gnome-panel/pixmaps/clock
clockbitmaps_DATA = $(CLOCK_BITMAPS)
CLEANFILES = $(server_in_files) $(server_DATA) $(schemas_DATA)
CLEANFILES = \
$(BUILT_SOURCES) \
$(server_in_files) \
$(server_DATA) \
$(schemas_DATA)
This diff is collapsed.
/*
* calendar-window.h: toplevel window containing a calendar and
* tasks/appointments
*
* Copyright (C) 2007 Vincent Untz <vuntz@gnome.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Authors:
* Vincent Untz <vuntz@gnome.org>
*
* Most of the original code comes from clock.c
*/
#ifndef CALENDAR_WINDOW_H
#define CALENDAR_WINDOW_H
#include <gtk/gtk.h>
#include "clock.h"
G_BEGIN_DECLS
#define CALENDAR_TYPE_WINDOW (calendar_window_get_type ())
#define CALENDAR_WINDOW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CALENDAR_TYPE_WINDOW, CalendarWindow))
#define CALENDAR_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CALENDAR_TYPE_WINDOW, CalendarWindowClass))
#define CALENDAR_IS_WINDOW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CALENDAR_TYPE_WINDOW))
#define CALENDAR_IS_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CALENDAR_TYPE_WINDOW))
#define CALENDAR_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CALENDAR_TYPE_WINDOW, CalendarWindowClass))
typedef struct _CalendarWindow CalendarWindow;
typedef struct _CalendarWindowClass CalendarWindowClass;
typedef struct _CalendarWindowPrivate CalendarWindowPrivate;
struct _CalendarWindow {
GtkWindow parent_instance;
CalendarWindowPrivate *priv;
};
struct _CalendarWindowClass {
GtkWindowClass parent_class;
};
GType calendar_window_get_type (void) G_GNUC_CONST;
GtkWidget *calendar_window_new (time_t *static_current_time,
const char *prefs_dir,
gboolean invert_order);
void calendar_window_refresh (CalendarWindow *calwin);
gboolean calendar_window_get_invert_order (CalendarWindow *calwin);
void calendar_window_set_invert_order (CalendarWindow *calwin,
gboolean invert_order);
gboolean calendar_window_get_utc_time (CalendarWindow *calwin);
void calendar_window_set_utc_time (CalendarWindow *calwin,
gboolean utc_time);
gboolean calendar_window_get_show_weeks (CalendarWindow *calwin);
void calendar_window_set_show_weeks (CalendarWindow *calwin,
gboolean show_weeks);
ClockFormat calendar_window_get_time_format (CalendarWindow *calwin);
void calendar_window_set_time_format (CalendarWindow *calwin,
ClockFormat time_format);
G_END_DECLS
#endif /* CALENDAR_WINDOW_H */
This diff is collapsed.
/*
* clock.h
*
* Copyright (C) 2007 Vincent Untz <vuntz@gnome.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Authors:
* Vincent Untz <vuntz@gnome.org>
*
* Most of the original code comes from clock.c
*/
#ifndef CLOCK_H
#define CLOCK_H
G_BEGIN_DECLS
#define CLOCK_ICON "gnome-panel-clock"
/* Needs to match the indices in the combo of the prefs dialog */
typedef enum {
CLOCK_FORMAT_INVALID = 0,
CLOCK_FORMAT_12,
CLOCK_FORMAT_24,
CLOCK_FORMAT_UNIX,
CLOCK_FORMAT_INTERNET,
CLOCK_FORMAT_CUSTOM
} ClockFormat;
ClockFormat clock_locale_format (void);
G_END_DECLS
#endif /* CLOCK_H */
......@@ -130,6 +130,59 @@
</locale>
</schema>
<schema>
<key>/schemas/apps/clock_applet/prefs/expand_appointments</key>
<owner>clock-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Expand list of appointments</short>
<long>
If true, expand the list of appointments in the calendar window.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/clock_applet/prefs/expand_birthdays</key>
<owner>clock-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Expand list of birthdays</short>
<long>
If true, expand the list of birthdays in the calendar window.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/clock_applet/prefs/expand_tasks</key>
<owner>clock-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Expand list of tasks</short>
<long>
If true, expand the list of tasks in the calendar window.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/clock_applet/prefs/expand_weather</key>
<owner>clock-applet</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Expand list of weather information</short>
<long>
If true, expand the list of weather information in the calendar
window.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/clock_applet/prefs/hour_format</key>
<owner>clock-applet</owner>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment