From 4bb7d27b5468630efaa703e7240a86eb134423e9 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 19 May 2011 05:54:09 -0400
Subject: [PATCH] - Removed focus_on_new_message option, added newmail_notify plugin

---
 CHANGELOG                             |    1 +
 program/steps/mail/check_recent.inc   |    2 --
 program/steps/settings/func.inc       |   10 ----------
 config/main.inc.php.dist              |    3 ---
 program/js/app.js                     |   10 ----------
 program/steps/settings/save_prefs.inc |    1 -
 6 files changed, 1 insertions(+), 26 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index e3afea7..39d5867 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Removed option focus_on_new_message, added newmail_notifier plugin
 - Added general rcube_cache class with Memcache and APC support
 - Improved caching performance by skipping writes of unchanged data
 - Option enable_caching replaced by imap_cache and messages_cache options
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist
index f63a181..29af284 100644
--- a/config/main.inc.php.dist
+++ b/config/main.inc.php.dist
@@ -607,9 +607,6 @@
 // Set to -1 if messages in preview pane should not be marked as read
 $rcmail_config['preview_pane_mark_read'] = 0;
 
-// focus new window if new message arrives
-$rcmail_config['focus_on_new_message'] = true;
-
 // Clear Trash on logout
 $rcmail_config['logout_purge'] = false;
 
diff --git a/program/js/app.js b/program/js/app.js
index fa643c2..a114c80 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -5017,16 +5017,6 @@
     }
   };
 
-  // notifies that a new message(s) has hit the mailbox
-  this.new_message_focus = function()
-  {
-    // focus main window
-    if (this.env.framed && window.parent)
-      window.parent.focus();
-    else
-      window.focus();
-  };
-
   this.toggle_prefer_html = function(checkbox)
   {
     var elem;
diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc
index c636e45..469fa48 100644
--- a/program/steps/mail/check_recent.inc
+++ b/program/steps/mail/check_recent.inc
@@ -71,8 +71,6 @@
         $OUTPUT->set_env('current_page', $all_count ? $IMAP->list_page : 1);
 
         if ($status & 1) {
-            if ($RCMAIL->config->get('focus_on_new_message', true))
-                $OUTPUT->command('new_message_focus');
             // trigger plugin hook
             $RCMAIL->plugins->exec_hook('new_messages', array('mailbox' => $mbox_name));
         }
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 6d3919f..b204d9b 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -349,16 +349,6 @@
       );
     }
 
-    if (!isset($no_override['focus_on_new_message'])) {
-      $field_id = 'rcmfd_focus_on_new_message';
-      $input_focus_on_new_message = new html_checkbox(array('name' => '_focus_on_new_message', 'id' => $field_id, 'value' => 1));
-
-      $blocks['new_message']['options']['focus_on_new_message'] = array(
-        'title' => html::label($field_id, Q(rcube_label('focusonnewmessage'))),
-        'content' => $input_focus_on_new_message->show($config['focus_on_new_message']?1:0),
-      );
-    }
-
     if (!isset($no_override['keep_alive'])) {
       $field_id = 'rcmfd_keep_alive';
       $select_keep_alive = new html_select(array('name' => '_keep_alive', 'id' => $field_id));
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index 92e2d8b..42ad0b9 100644
--- a/program/steps/settings/save_prefs.inc
+++ b/program/steps/settings/save_prefs.inc
@@ -39,7 +39,6 @@
   break;
   case 'mailbox':
     $a_user_prefs = array(
-      'focus_on_new_message' => isset($_POST['_focus_on_new_message']) ? TRUE : FALSE,
       'preview_pane'         => isset($_POST['_preview_pane']) ? TRUE : FALSE,
       'preview_pane_mark_read' => isset($_POST['_preview_pane_mark_read']) ? intval($_POST['_preview_pane_mark_read']) : $CONFIG['preview_pane_mark_read'],
       'autoexpand_threads'   => isset($_POST['_autoexpand_threads']) ? intval($_POST['_autoexpand_threads']) : 0,

--
Gitblit v1.9.1