diff options
author | Edd Dumbill <edd@usefulinc.com> | 2005-01-15 19:20:07 +0000 |
---|---|---|
committer | Edd Dumbill <edd@src.gnome.org> | 2005-01-15 19:20:07 +0000 |
commit | e42040ffc8bd68d4d9dd30a00407c00f6ac01d47 (patch) | |
tree | e4cae2aa1d55c42220dabffd55b7131c4cddff8c | |
parent | ee299d4c896a5ed7113de2c0bb93df41087c747c (diff) | |
download | gnome-bluetooth-e42040ffc8bd68d4d9dd30a00407c00f6ac01d47.tar.gz |
patch from Tuomas Salo. Use new timestamp parameter on OBEX PUT to
2005-01-15 Edd Dumbill <edd@usefulinc.com>
* obex/gnome-obex-server.c: patch from Tuomas Salo. Use new
timestamp parameter on OBEX PUT to preserve timestamp.
Add get_display_notifications() to look for the gconf key
/apps/gnome-obex-server/receive_notification, controlling whether
dialog is shown when files received.
Move /system/bluetooth/obex-savedir to
/apps/gnome-obex-server/savedir.
* data/Makefile.am, data/gnome-obex-server.schemas.in: create schemas
for gconf keys.
* src/fileaction.gob: replace 'Save' button with 'Close'
* configure.in: require libbtctl 0.5.0 or better
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | NEWS | 27 | ||||
-rw-r--r-- | configure.in | 6 | ||||
-rw-r--r-- | data/Makefile.am | 17 | ||||
-rw-r--r-- | data/gnome-obex-server.schemas.in | 35 | ||||
-rw-r--r-- | obex/gnome-obex-server.c | 53 | ||||
-rw-r--r-- | po/POTFILES.in | 1 | ||||
-rw-r--r-- | src/fileactiondialog.gob | 6 | ||||
-rw-r--r-- | src/gnomebt-fileactiondialog-test.c | 4 |
9 files changed, 146 insertions, 18 deletions
@@ -1,7 +1,22 @@ +2005-01-15 Edd Dumbill <edd@usefulinc.com> + + * obex/gnome-obex-server.c: patch from Tuomas Salo. Use new + timestamp parameter on OBEX PUT to preserve timestamp. + Add get_display_notifications() to look for the gconf key + /apps/gnome-obex-server/receive_notification, controlling whether + dialog is shown when files received. + Move /system/bluetooth/obex-savedir to + /apps/gnome-obex-server/savedir. + * data/Makefile.am, data/gnome-obex-server.schemas.in: create schemas + for gconf keys. + * src/fileaction.gob: replace 'Save' button with 'Close' + * configure.in: require libbtctl 0.5.0 or better + 2005-01-07 Edd Dumbill <edd@usefulinc.com> * obex/gnome-obex-server.c: Change translator_credits to translator-credits. Regenerate pot file. + * po/*.po: update all po files for translator-credits. 2004-11-06 Amanpreet Singh Alam<aalam@redhat.com> @@ -1,3 +1,30 @@ +gnome-bluetooth 0.6.0 +===================== + + * gnome-obex-server: Now preserves timestamps of reserved files (Tumoas + Salo). + + * Updated translations: + cs: Miloslav Trmac + de: Hendrik Brandt + en_CA: Adam Weinberger + en_GB: David Lodge + es: Francisco Javier F. Serrador + fr: Raphaƫl Tournoy + hu: Gabor Kelemen + ja: Takeshi AIHANA + nb: Kjartan Maraas + nl: Reinout van Schouwen + no: Kjartan Maraas + pa: Amanpreet Singh Alam + pt_BR: Raphael Higino + pt: Duarte Loreto + ru: Leonid Kanter + sq: Laurent Dhima + sv: Christian Rose + uk: Maxim Dziumanenko + zh_CN: Funda Wang + gnome-bluetooth 0.5.1 ===================== diff --git a/configure.in b/configure.in index e9d9208c..5ef5ce7f 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.52) -AC_INIT(gnome-bluetooth, 0.5.1) +AC_INIT(gnome-bluetooth, 0.6.0) AC_CONFIG_SRCDIR(src/controller.gob) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) @@ -35,6 +35,7 @@ AC_SUBST(DLOPEN) AC_SUBST(DLPREOPEN) AM_PATH_ORBIT2([], [], [ORBit-2.0 required]) +AC_PATH_PROG(GCONFTOOL, gconftool-2, no) AM_GCONF_SOURCE_2 GOB2_HOOK(2.0.0,[],[AC_MSG_ERROR([Cannot find GOB-2, install from http://www.5z.com/jirka/gob.html])]) @@ -42,7 +43,7 @@ GOB2_HOOK(2.0.0,[],[AC_MSG_ERROR([Cannot find GOB-2, install from http://www.5z. AC_PATH_PROG(PKG_CONFIG, pkg-config, no) AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal, no) PKG_CHECK_MODULES(GNOME_BLUETOOTH, libglade-2.0 gobject-2.0 libgnomeui-2.0 >= 1.110.0 gconf-2.0 libbtctl >= 0.4) -PKG_CHECK_MODULES(GNOME_BLUETOOTH_PYTHON, libglade-2.0 gobject-2.0 libgnomeui-2.0 >= 1.110.0 gconf-2.0 pygtk-2.0 libbtctl >= 0.4.1) +PKG_CHECK_MODULES(GNOME_BLUETOOTH_PYTHON, libglade-2.0 gobject-2.0 libgnomeui-2.0 >= 1.110.0 gconf-2.0 pygtk-2.0 libbtctl >= 0.5.0) AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)]) DEFSDIR=`pkg-config --variable=defsdir pygtk-2.0` @@ -119,6 +120,7 @@ AC_CONFIG_SUBDIRS(libegg) AC_OUTPUT([ Makefile gnome-bluetooth.pc +data/Makefile src/Makefile po/Makefile.in obex/Makefile diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 00000000..bccbede9 --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,17 @@ +schema_in_files = gnome-obex-server.schemas.in +schemadir = $(GCONF_SCHEMA_FILE_DIR) +schema_DATA = $(schema_in_files:.schemas.in=.schemas) + +@INTLTOOL_SCHEMAS_RULE@ + +EXTRA_DIST = \ + $(schema_in_files) \ + $(schema_DATA) + +DISTCLEANFILES = \ + $(schema_DATA) + +if GCONF_SCHEMAS_INSTALL +install-data-local: + GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$(schema_DATA) +endif diff --git a/data/gnome-obex-server.schemas.in b/data/gnome-obex-server.schemas.in new file mode 100644 index 00000000..b9bf6312 --- /dev/null +++ b/data/gnome-obex-server.schemas.in @@ -0,0 +1,35 @@ +<gconfschemafile> + <schemalist> + + <schema> + <key>/schemas/apps/gnome-obex-server/savedir</key> + <applyto>/apps/gnome-obex-server/savedir</applyto> + <owner>gnome-obex-server</owner> + <type>string</type> + <default></default> + <locale name="C"> + <short>Directory to save received files</short> + <long>Incoming files are saved automatically into + this directory. If display-notification is set + then the user gets chance to open or delete them. + </long> + </locale> + </schema> + + <schema> + <key>/schemas/apps/gnome-obex-server/receive_notification</key> + <applyto>/apps/gnome-obex-server/receive_notification</applyto> + <owner>gnome-obex-server</owner> + <type>bool</type> + <default>true</default> + <locale name="C"> + <short>Display dialog when file received</short> + <long>Received files are automatically saved. If this + option is set, then the user is prompted with a dialog + which allows them to view or delete the received + file.</long> + </locale> + </schema> + + </schemalist> +</gconfschemafile> diff --git a/obex/gnome-obex-server.c b/obex/gnome-obex-server.c index 41038595..2f0284b7 100644 --- a/obex/gnome-obex-server.c +++ b/obex/gnome-obex-server.c @@ -28,6 +28,9 @@ #include <stdarg.h> #include <fcntl.h> +#include <sys/types.h> +#include <utime.h> + #include <sys/socket.h> #include <arpa/inet.h> #include <netdb.h> @@ -65,6 +68,7 @@ typedef struct _appinfo { static gboolean allowed_to_put (MyApp *app, const gchar *bdaddr); static gboolean tray_destroy_cb (GtkObject *obj, MyApp *app); static const gchar * get_save_dir (); +static int get_display_notifications (); static MyApp *app; static gint spincount = 0; @@ -108,15 +112,29 @@ get_save_dir () if (client) { dir = gconf_client_get_string (client, - "/system/bluetooth/obex-savedir", NULL); + "/apps/gnome-obex-server/savedir", NULL); g_object_unref (client); } - if (dir == NULL) { - dir = g_get_home_dir(); + if (dir == NULL || strlen (dir) == 0) { + dir = g_get_home_dir (); } return dir; } +static gboolean +get_display_notifications () +{ + gboolean yesno = TRUE; + GConfClient *client = gconf_client_get_default(); + + if (client) { + yesno = gconf_client_get_bool (client, + "/apps/gnome-obex-server/receive_notification", NULL); + g_object_unref (client); + } + return yesno; +} + /* static gboolean prefs_activated(GtkMenuItem *item, gpointer data) @@ -202,10 +220,11 @@ file_action_response (GtkDialog *dialog, gint arg, gpointer user_data) static void put_callback (BtctlObex *bo, gchar * bdaddr, gchar *fname, - gpointer body, guint len, MyApp *app) + gpointer body, guint len, guint timestamp, MyApp *app) { int fd; gchar *targetname = NULL; + struct utimbuf utim; GnomebtFileActionDialog *dlg; if (! app->decision) { @@ -223,14 +242,26 @@ put_callback (BtctlObex *bo, gchar * bdaddr, gchar *fname, if (fd >= 0) { write (fd, body, len); close (fd); + + if(timestamp) { + utim.actime = utim.modtime = (time_t) timestamp; + utime(targetname, &utim); + } + btctl_obex_set_response (bo, TRUE); - dlg = gnomebt_fileactiondialog_new ( - gnomebt_controller_get_device_preferred_name (app->btctl, bdaddr), - targetname ); - g_signal_connect (G_OBJECT (dlg), "response", - G_CALLBACK (file_action_response), dlg); - g_signal_connect_swapped (G_OBJECT (dlg), - "response", G_CALLBACK (gtk_widget_destroy), dlg); + + /* if notify, then display this dialog */ + + if (get_display_notifications ()) { + dlg = gnomebt_fileactiondialog_new ( + gnomebt_controller_get_device_preferred_name + (app->btctl, bdaddr), + targetname); + g_signal_connect (G_OBJECT (dlg), "response", + G_CALLBACK (file_action_response), dlg); + g_signal_connect_swapped (G_OBJECT (dlg), + "response", G_CALLBACK (gtk_widget_destroy), dlg); + } } else { g_warning ("Couldn't save file."); btctl_obex_set_response (bo, FALSE); diff --git a/po/POTFILES.in b/po/POTFILES.in index 56b79619..90978919 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,5 +1,6 @@ # List of source files containing translatable strings. # Please keep this file sorted alphabetically. +data/gnome-obex-server.schemas.in libegg/libegg/iconlist/eggiconlist.c libegg/libegg/tray/eggstatusicon.c libegg/libegg/tray/eggtrayicon.c diff --git a/src/fileactiondialog.gob b/src/fileactiondialog.gob index fccced87..0854e44b 100644 --- a/src/fileactiondialog.gob +++ b/src/fileactiondialog.gob @@ -32,7 +32,7 @@ requires 2.0.0 #include <libgnomevfs/gnome-vfs-utils.h> #include <gnome.h> -#define GNOMEBT_FILEACTION_SAVE 0x01 +#define GNOMEBT_FILEACTION_CLOSE 0x01 #define GNOMEBT_FILEACTION_OPEN 0x02 #define GNOMEBT_FILEACTION_DELETE 0x03 %} @@ -122,10 +122,10 @@ class Gnomebt:FileActionDialog from Gtk:Dialog { GTK_DIALOG(self), GTK_STOCK_DELETE, GNOMEBT_FILEACTION_DELETE)); self->_priv->savebutton = GTK_WIDGET (gtk_dialog_add_button ( - GTK_DIALOG(self), GTK_STOCK_SAVE, GNOMEBT_FILEACTION_SAVE)); + GTK_DIALOG(self), GTK_STOCK_CLOSE, GNOMEBT_FILEACTION_CLOSE)); gtk_dialog_set_default_response (GTK_DIALOG(self), - GNOMEBT_FILEACTION_SAVE); + GNOMEBT_FILEACTION_CLOSE); gtk_window_set_title (GTK_WINDOW(self), _("Bluetooth Transfer Received")); diff --git a/src/gnomebt-fileactiondialog-test.c b/src/gnomebt-fileactiondialog-test.c index 86f2056f..aea8530c 100644 --- a/src/gnomebt-fileactiondialog-test.c +++ b/src/gnomebt-fileactiondialog-test.c @@ -28,8 +28,8 @@ int main(int argc, char **argv) case GNOMEBT_FILEACTION_DELETE: g_message ("user said delete"); break; - case GNOMEBT_FILEACTION_SAVE: - g_message ("user said save"); + case GNOMEBT_FILEACTION_CLOSE: + g_message ("user said do nothing"); break; case GNOMEBT_FILEACTION_OPEN: g_message ("user said open"); |