Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=devil505.git;a=commitdiff;h=80a132152c9f4cc94edddf4551c90f6e8ad9579f

commit 80a132152c9f4cc94edddf4551c90f6e8ad9579f
Author: Devil505 <devil505li...@gmail.com>
Date:   Sun Sep 12 10:45:24 2010 +0200

gnome-mount-0.8-4-i686
* added patch for notify-osd

diff --git a/source/gnome/gnome-mount/FrugalBuild 
b/source/gnome/gnome-mount/FrugalBuild
index 0426732..c051a05 100644
--- a/source/gnome/gnome-mount/FrugalBuild
+++ b/source/gnome/gnome-mount/FrugalBuild
@@ -3,7 +3,7 @@

pkgname=gnome-mount
pkgver=0.8
-pkgrel=3
+pkgrel=4
pkgdesc="Programs for mounting, unmounting and ejecting storage devices."
url="http://www.gnome.org";
depends=('gtk+2>=2.20.0-2' 'gnome-keyring>=2.30.0-2' 'hal>=0.5.9' 'libbonobo' 
'libnotify>=0.4.5-2' 'libglade')
@@ -11,13 +11,15 @@ makedepends=('perl-xml-parser' 'intltool' 
'nautilus>=2.30.0-2')
groups=('gnome' 'gnome-minimal')
archs=('i686' 'x86_64' 'ppc')
source=(http://hal.freedesktop.org/releases/$pkgname-$pkgver.tar.gz \
-       gnome-mount-0.6-default-mount-options.patch fstablock.diff)
+       gnome-mount-0.6-default-mount-options.patch fstablock.diff \
+       gnome-mount.flush-alert.patch)
up2date="Flasttar http://hal.freedesktop.org/releases/";
_F_gnome_schemas=('/etc/gconf/schemas/gnome-mount.schemas')
Finclude gnome-scriptlet
sha1sums=('846ba178cf9009f3e32c7f55f912b3ca6b9ecedb' \
-         'f5e2d09503c12b61f33f54969256189eee2111b4' \
-          '90248972a943b26d4ac9520faee99513dabbdb64')
+          'f5e2d09503c12b61f33f54969256189eee2111b4' \
+          '90248972a943b26d4ac9520faee99513dabbdb64' \
+          'd8ae23a8ed86d35806b5c7cf5a7d8decb4ff6980')
Fconfopts="$Fconfopts --enable-nautilus-extension"

subpkgs=('gnome-mount-nautilus')
diff --git a/source/gnome/gnome-mount/gnome-mount.flush-alert.patch 
b/source/gnome/gnome-mount/gnome-mount.flush-alert.patch
new file mode 100644
index 0000000..4f42528
--- /dev/null
+++ b/source/gnome/gnome-mount/gnome-mount.flush-alert.patch
@@ -0,0 +1,186 @@
+diff -ur gnome-mount-0.8.old/src/gnome-mount.c 
gnome-mount-0.8/src/gnome-mount.c
+--- gnome-mount-0.8.old/src/gnome-mount.c      2009-03-03 11:26:12.000000000 
+0100
++++ gnome-mount-0.8/src/gnome-mount.c  2009-03-03 12:32:25.000000000 +0100
+@@ -1583,16 +1583,111 @@
+
+ static guint unmount_cache_timeout_id = -1;
+
+-static NotifyNotification *unmount_note = NULL;
++static GtkWidget *unmount_flush_window = NULL;
++static GtkWidget *unmount_flush_label_top = NULL;
++static GtkWidget *unmount_flush_label_bottom = NULL;
++static GtkWidget *unmount_flush_progress = NULL;
+
+ static gboolean unmount_note_is_eject = FALSE;
+ static char *unmount_note_drive_name = NULL;
+
++static gboolean
++unmount_cache_progress_func (gpointer data)
++{
++      if (!GTK_WIDGET_VISIBLE (unmount_flush_progress))
++              return FALSE;
++
++      gtk_progress_bar_pulse (unmount_flush_progress);
++      g_main_context_iteration (NULL, FALSE);
++      return TRUE;
++}
++
++static void
++create_unmount_flush_window ()
++{
++      GtkWidget *vbox1, *vbox2;
++      GtkWidget *table1;
++      GtkWidget *icon;
++      gint win_width, win_height;
++
++      unmount_flush_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
++      gtk_window_set_title (GTK_WINDOW (unmount_flush_window), 
unmount_note_drive_name);
++      gtk_window_set_resizable (GTK_WINDOW (unmount_flush_window), FALSE);
++      gtk_window_set_focus_on_map (GTK_WINDOW (unmount_flush_window), FALSE);
++
++      /* make window appear in the lower right corner */
++      gtk_window_set_gravity (GTK_WINDOW (unmount_flush_window), 
GDK_GRAVITY_SOUTH_EAST);
++      gtk_window_move (GTK_WINDOW (unmount_flush_window),
++              gdk_screen_width(), gdk_screen_height());
++
++      vbox1 = gtk_vbox_new (FALSE, 0);
++      gtk_container_add (GTK_CONTAINER (unmount_flush_window), vbox1);
++
++      table1 = gtk_table_new (2, 3, FALSE);
++      gtk_box_pack_start (GTK_BOX (vbox1), table1, FALSE, FALSE, 0);
++      gtk_container_set_border_width (GTK_CONTAINER (table1), 12);
++
++      vbox2 = gtk_vbox_new (FALSE, 0);
++      gtk_table_attach (GTK_TABLE (table1), vbox2, 2, 3, 0, 1,
++                        (GtkAttachOptions) (GTK_FILL),
++                        (GtkAttachOptions) (GTK_FILL), 0, 0);
++
++      unmount_flush_label_top = gtk_label_new (_("Writing data to device"));
++      gtk_label_set_line_wrap (GTK_LABEL (unmount_flush_label_top), TRUE);
++      gtk_box_pack_start (GTK_BOX (vbox2), unmount_flush_label_top, FALSE, 
FALSE, 0);
++      gtk_misc_set_alignment (GTK_MISC (unmount_flush_label_top), 0, 0);
++
++      unmount_flush_progress = gtk_progress_bar_new ();
++      gtk_box_pack_start (GTK_BOX (vbox2), unmount_flush_progress, FALSE, 
FALSE, 6);
++
++      unmount_flush_label_bottom = gtk_label_new (_("To prevent data loss, 
wait until this has finished before disconnecting."));
++      gtk_table_attach (GTK_TABLE (table1), unmount_flush_label_bottom, 2, 3, 
1, 2,
++                        (GtkAttachOptions) (GTK_FILL),
++                        (GtkAttachOptions) (0), 0, 0);
++      gtk_label_set_line_wrap (GTK_LABEL (unmount_flush_label_bottom), TRUE);
++      gtk_misc_set_alignment (GTK_MISC (unmount_flush_label_bottom), 0, 0.5);
++      gtk_label_set_width_chars (GTK_LABEL (unmount_flush_label_bottom), 40);
++
++      icon = gtk_image_new_from_icon_name ("gnome-dev-harddisk", /* TODO: use 
appropriate icon */
++              GTK_ICON_SIZE_DIALOG);
++
++      gtk_table_attach (GTK_TABLE (table1), icon, 0, 1, 0, 1,
++                        (GtkAttachOptions) (0),
++                        (GtkAttachOptions) (0), 0, 0);
++      gtk_misc_set_alignment (GTK_MISC (icon), 0, 0.5);
++      gtk_misc_set_padding (GTK_MISC (icon), 12, 12);
++
++      gtk_widget_show_all (unmount_flush_window);
++      /* do not show a close button; gtk_window_set_deletable() doesn't work 
at least under compiz :-( */
++      gdk_window_set_functions (unmount_flush_window->window, 
GDK_FUNC_MOVE|GDK_FUNC_MINIMIZE);
++
++      /* prevent window from being auto-resized in 
finish_unmount_flush_window() */
++      gtk_window_get_size (GTK_WINDOW (unmount_flush_window), &win_width, 
&win_height);
++      gtk_widget_set_size_request (unmount_flush_window, win_width, 
win_height);
++      gtk_window_resize (GTK_WINDOW (unmount_flush_window), win_width, 
win_height);
++
++      /* timer for updating progress bar */
++      g_timeout_add (100, unmount_cache_progress_func, NULL);
++}
++
+ static void
+-unmount_note_close_func (NotifyNotification *note, gpointer user_data)
++finish_unmount_flush_window ()
+ {
+-       g_debug ("in unmount_note_close_func()");
+-       unmount_note = NULL;
++      gchar* message;
++      int delay;
++
++      message = g_strdup_printf (_("The device %s is now safe to remove."),
++                                 unmount_note_drive_name);
++      gtk_label_set_text(unmount_flush_label_top, message);
++      gtk_widget_hide (unmount_flush_label_bottom);
++      gtk_widget_hide (unmount_flush_progress);
++
++      /* wait 4 seconds, then hide the dialog */
++      for (delay = 40; delay; --delay) {
++              g_main_context_iteration (NULL, FALSE);
++              usleep(100000);
++      }
++      gtk_widget_hide(unmount_flush_window);
+ }
+
+ static gboolean
+@@ -1600,31 +1695,9 @@
+ {
+       char *drive_name = data;
+
+-#ifdef ENABLE_NOTIFY
+-      if (!opt_noui) {
+-              char *summary;
+-              char *message;
+-
+-              g_debug ("putting up Flushing Cache notification");
+-
+-              summary = _("Writing data to device");
+-              message = g_strdup_printf (_("There is data that needs to be 
written to the device %s before it can be removed. Please do not remove the 
media or disconnect the drive."), unmount_note_drive_name);
+-              unmount_note = notify_notification_new (summary,
+-                                                      message,
+-                                                      "gnome-dev-harddisk", 
/* TODO: use appropriate icon */
+-                                                      NULL);
+-              if (unmount_note == NULL) {
+-                      g_warning ("Cannot create note for unmount cache sync");
+-              } else {
+-                      notify_notification_set_timeout (unmount_note, 
NOTIFY_EXPIRES_NEVER);
+-                      g_signal_connect (unmount_note, "closed", G_CALLBACK 
(unmount_note_close_func), NULL);
+-                      notify_notification_show (unmount_note, NULL);
++      if (!opt_noui)
++              create_unmount_flush_window();
+
+-              }
+-              g_free (message);
+-      }
+-#endif
+-
+       return FALSE;
+ }
+
+@@ -1636,30 +1709,19 @@
+       g_strchug (unmount_note_drive_name);
+       g_debug ("Setting up 750ms timer for Flushing Cache dialog");
+       unmount_cache_timeout_id = g_timeout_add (750, 
unmount_cache_timeout_func, NULL);
+-      unmount_note = NULL;
+ }
+
+ static void
+ unmount_cache_timeout_cancel (gboolean was_success)
+ {
+       g_source_remove (unmount_cache_timeout_id);
+-      if (unmount_note != NULL) {
++      if (unmount_flush_window != NULL) {
+               if (was_success) {
+                       char *summary;
+                       char *message;
+
+                       g_debug ("Updating Flushing Cache notification");
+-
+-                      summary = _("Device is now safe to remove");
+-                      message = g_strdup_printf (_("The device %s is now safe 
to remove."),
+-                                                 unmount_note_drive_name);
+-                      notify_notification_update (unmount_note,
+-                                                  summary,
+-                                                  message,
+-                                                  "gnome-dev-harddisk"); /* 
TODO: use appropriate icon */
+-                      g_free (message);
+-                      notify_notification_set_timeout (unmount_note, 
NOTIFY_EXPIRES_DEFAULT);
+-                      notify_notification_show (unmount_note, NULL);
++                      finish_unmount_flush_window();
+               }
+       }
+ }
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to