Attached is the initial revision of the alarm clock plugin. If you'd like to try it out, apply the patch against the latest CVS and build/install. Once you enable the plugin, you can configure the alarm times via Tools->Alarm Clock. If you have any problems/questions/comments, please let me know. Regards, Jon Oberheide -- Jon Oberheide <jon oberheide org> GnuPG Key: 1024D/F47C17FE Fingerprint: B716 DA66 8173 6EDD 28F6 F184 5842 1C89 F47C 17FE
diff -urN rhythmbox.cvs/configure.ac rhythmbox/configure.ac --- rhythmbox.cvs/configure.ac 2006-08-11 01:32:53.000000000 -0400 +++ rhythmbox/configure.ac 2006-08-11 19:47:05.000000000 -0400 @@ -966,6 +966,7 @@ plugins/artdisplay/Makefile plugins/artdisplay/artdisplay/Makefile plugins/generic-player/Makefile +plugins/alarmclock/Makefile plugins/rb/Makefile bindings/Makefile bindings/python/Makefile diff -urN rhythmbox.cvs/plugins/Makefile.am rhythmbox/plugins/Makefile.am --- rhythmbox.cvs/plugins/Makefile.am 2006-08-10 11:12:24.000000000 -0400 +++ rhythmbox/plugins/Makefile.am 2006-08-11 17:52:19.000000000 -0400 @@ -18,6 +18,7 @@ sample-python \ artdisplay \ lyrics \ + alarmclock \ rb endif diff -urN rhythmbox.cvs/plugins/alarmclock/.cvsignore rhythmbox/plugins/alarmclock/.cvsignore --- rhythmbox.cvs/plugins/alarmclock/.cvsignore 1969-12-31 19:00:00.000000000 -0500 +++ rhythmbox/plugins/alarmclock/.cvsignore 2006-08-11 17:51:03.000000000 -0400 @@ -0,0 +1,4 @@ +Makefile +Makefile.in +*.pyc +*.rb-plugin diff -urN rhythmbox.cvs/plugins/alarmclock/Makefile.am rhythmbox/plugins/alarmclock/Makefile.am --- rhythmbox.cvs/plugins/alarmclock/Makefile.am 1969-12-31 19:00:00.000000000 -0500 +++ rhythmbox/plugins/alarmclock/Makefile.am 2006-08-14 23:25:22.000000000 -0400 @@ -0,0 +1,14 @@ +# Python Alarm Clock Plugin +plugindir = $(PLUGINDIR)/alarmclock +plugin_PYTHON = alarmclock.py + +plugin_in_files = alarmclock.rb-plugin.desktop.in +%.rb-plugin: %.rb-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache + +gen_files = $(plugin_in_files:.rb-plugin.desktop.in=.rb-plugin) +plugin_DATA = $(gen_files) alarmclock.glade + +EXTRA_DIST = $(plugin_in_files) alarmclock.glade + +CLEANFILES = $(gen_files) +DISTCLEANFILES = $(gen_files) diff -urN rhythmbox.cvs/plugins/alarmclock/TODO rhythmbox/plugins/alarmclock/TODO --- rhythmbox.cvs/plugins/alarmclock/TODO 1969-12-31 19:00:00.000000000 -0500 +++ rhythmbox/plugins/alarmclock/TODO 2006-08-15 01:48:35.000000000 -0400 @@ -0,0 +1,3 @@ +- volume fading +- visual indicator notifying that alarm is set / showing the alarm time +- choosing what playlist you want to play diff -urN rhythmbox.cvs/plugins/alarmclock/alarmclock.glade rhythmbox/plugins/alarmclock/alarmclock.glade --- rhythmbox.cvs/plugins/alarmclock/alarmclock.glade 1969-12-31 19:00:00.000000000 -0500 +++ rhythmbox/plugins/alarmclock/alarmclock.glade 2006-08-15 00:58:08.000000000 -0400 @@ -0,0 +1,897 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkDialog" id="dialog"> + <property name="title" translatable="yes">Alarm Clock</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_CENTER_ALWAYS</property> + <property name="modal">False</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + <property name="has_separator">True</property> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="cancel_button"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-6</property> + <signal name="clicked" handler="hide_dialog" last_modification_time="Tue, 15 Aug 2006 04:57:58 GMT"/> + </widget> + </child> + + <child> + <widget class="GtkButton" id="ok_button"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-ok</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-5</property> + <signal name="clicked" handler="save_config" last_modification_time="Tue, 15 Aug 2006 04:57:42 GMT"/> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkTable" id="table1"> + <property name="visible">True</property> + <property name="n_rows">8</property> + <property name="n_columns">2</property> + <property name="homogeneous">True</property> + <property name="row_spacing">2</property> + <property name="column_spacing">0</property> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">Day</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="check_sunday"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Sunday</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="check_tuesday"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Tuesday</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="check_monday"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Monday</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="check_wednesday"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Wednesday</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="check_friday"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Friday</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="check_thursday"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Thursday</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="check_saturday"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Saturday</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="label" translatable="yes">Time</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkSpinButton" id="spin_sunday_hour"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 23 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="label" translatable="yes"> : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="spin_sunday_minute"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 59 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkSpinButton" id="spin_monday_hour"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 23 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes"> : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="spin_monday_minute"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 59 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkSpinButton" id="spin_tuesday_hour"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 23 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes"> : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="spin_tuesday_minute"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 59 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox4"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkSpinButton" id="spin_wednesday_hour"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 23 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="label" translatable="yes"> : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="spin_wednesday_minute"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 59 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox5"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkSpinButton" id="spin_thursday_hour"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 23 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="label" translatable="yes"> : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="spin_thursday_minute"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 59 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox6"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkSpinButton" id="spin_friday_hour"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 23 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="label" translatable="yes"> : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="spin_friday_minute"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 59 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox7"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkSpinButton" id="spin_saturday_hour"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 23 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label10"> + <property name="visible">True</property> + <property name="label" translatable="yes"> : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="spin_saturday_minute"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">0 0 59 1 1 1</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Set Daily Alarms</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">5</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> diff -urN rhythmbox.cvs/plugins/alarmclock/alarmclock.py rhythmbox/plugins/alarmclock/alarmclock.py --- rhythmbox.cvs/plugins/alarmclock/alarmclock.py 1969-12-31 19:00:00.000000000 -0500 +++ rhythmbox/plugins/alarmclock/alarmclock.py 2006-08-15 01:42:41.000000000 -0400 @@ -0,0 +1,126 @@ +# alarmclock.py +# +# Copyright (C) 2006 - Jon Oberheide <jon oberheide 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, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + +import string, sys, time, user, pickle +import pygtk, gobject, gtk, gtk.glade +import rhythmdb, rb + +ui_str = """ +<ui> + <menubar name="MenuBar"> + <menu name="ToolsMenu" action="Tools"> + <placeholder name="ToolsOps_5"> + <menuitem name="AlarmClock" action="AlarmClock"/> + </placeholder> + </menu> + </menubar> +</ui> +""" + +class AlarmClockPlugin(rb.Plugin): + def __init__(self): + rb.Plugin.__init__(self) + self.alarm = {} + self.timeout_id = None + self.gladefile = sys.path[0] + "/alarmclock.glade" + self.configfile = user.home + "/.alarmclock.rb-plugin" + self.days = [ 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday' ] + + def activate(self, shell): + data = {} + manager = shell.get_player().get_property('ui-manager') + + action = gtk.Action('AlarmClock', _('_Alarm Clock'), + _("Configure alarm clock"), + 'gnome-mime-text-x-python'); + action.connect('activate', self.show_dialog, shell) + + data['action_group'] = gtk.ActionGroup('AlarmClockPluginActions') + data['action_group'].add_action(action) + manager.insert_action_group(data['action_group'], 0) + data['ui_id'] = manager.add_ui_from_string(ui_str) + manager.ensure_update() + + shell.set_data('AlarmClockPluginInfo', data) + + self.timeout_id = gobject.timeout_add(50000, self.check_alarm, shell) + + def deactivate(self, shell): + data = shell.get_data('AlarmClockPluginInfo') + + manager = shell.get_player().get_property('ui-manager') + manager.remove_ui(data['ui_id']) + manager.remove_action_group(data['action_group']) + manager.ensure_update() + + shell.set_data('AlarmClockPluginInfo', None) + + gobject.source_remove(self.timeout_id) + + def check_alarm(self, shell): + t = time.localtime() + alarm = self.alarm[self.days[t.tm_wday]] + if (alarm.set == True and + alarm.hour == t.tm_hour and + alarm.minute == t.tm_min): + self.activate_alarm(shell) + return True + + def activate_alarm(self, shell): + player = shell.get_player() + if player.get_playing() == False: + player.playpause() + + def show_dialog(self, action, shell): + self.glade = gtk.glade.XML(self.gladefile) + dic = { "hide_dialog" : self.hide_dialog, + "save_config" : self.save_config } + self.glade.signal_autoconnect(dic) + self.dialog = self.glade.get_widget("dialog") + self.load_config() + self.dialog.show_all() + self.dialog.grab_focus() + + def hide_dialog(self, *args): + self.dialog.destroy() + self.dialog = None + + def load_config(self): + try: + self.alarm = pickle.load(open(self.configfile)) + except: + for day in self.days: + self.alarm[day] = Alarm() + self.alarm[day].set = False + self.alarm[day].hour = 0 + self.alarm[day].minute = 0 + for day in self.days: + self.glade.get_widget("check_" + day).set_active(self.alarm[day].set) + self.glade.get_widget("spin_" + day + "_hour").set_value(self.alarm[day].hour) + self.glade.get_widget("spin_" + day + "_minute").set_value(self.alarm[day].minute) + + def save_config(self, widget, data=None): + for day in self.days: + self.alarm[day].set = self.glade.get_widget("check_" + day).get_active() + self.alarm[day].hour = self.glade.get_widget("spin_" + day + "_hour").get_value_as_int() + self.alarm[day].minute = self.glade.get_widget("spin_" + day + "_minute").get_value_as_int() + pickle.dump(self.alarm, open(self.configfile, "w")) + self.hide_dialog() + +class Alarm: + pass diff -urN rhythmbox.cvs/plugins/alarmclock/alarmclock.rb-plugin.desktop.in rhythmbox/plugins/alarmclock/alarmclock.rb-plugin.desktop.in --- rhythmbox.cvs/plugins/alarmclock/alarmclock.rb-plugin.desktop.in 1969-12-31 19:00:00.000000000 -0500 +++ rhythmbox/plugins/alarmclock/alarmclock.rb-plugin.desktop.in 2006-08-15 00:20:31.000000000 -0400 @@ -0,0 +1,9 @@ +[RB Plugin] +Loader=python +Module=alarmclock +IAge=1 +_Name=Alarm Clock +_Description=Alarm clock functionality +Authors=Jon Oberheide <jon oberheide org> +Copyright=Copyright © 2006 Jon Oberheide +Website=http://www.rhythmbox.org
Attachment:
signature.asc
Description: This is a digitally signed message part