[M-git] Mahogany sources repository. branch master updated. v0.67-703-g2eb4d6d

"Nerijus Bali??nas" <[email protected]> Fri, 28 Aug 2015 12:26:51 +0000
Newsgroups gmane.mail.mahogany.cvs
Message-ID <[email protected]>
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Mahogany sources repository.".

The branch, master has been updated
       via  2eb4d6d2f531f88a0e1c29d7e1da47c67b0ef8ca (commit)
      from  05975b8d259c391a9939cb00f273aad3a60b3db0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2eb4d6d2f531f88a0e1c29d7e1da47c67b0ef8ca
Author: Nerijus Baliunas <[email protected]>
Date:   Fri Aug 28 15:25:44 2015 +0300

    Removed "Browser is Netscape" and "Open in new window" and added "Open in another browser" instead

diff --git a/CHANGES b/CHANGES
index 720bb7e..4805c3a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -9,6 +9,8 @@
 Release 0.68 'Cynthia' September xx, 2010
 -----------------------------------------
 
+2015-08-28 NB: Removed "Browser is Netscape" and "Open in new window" and
+                  added "Open in another browser" instead
 2012-07-28 VZ: Optionally use popup notifications for new mail reporting.
 2012-07-21 VZ: Make it possible to set base mailbox path in the GUI.
 2011-12-26 VZ: Allow to create and configure new folders in "Quick filter".
diff --git a/doc/tech/config.txt b/doc/tech/config.txt
index 329bed3..cf7c484 100644
--- a/doc/tech/config.txt
+++ b/doc/tech/config.txt
@@ -22,9 +22,8 @@ MP_BBDB_GENERATEUNIQUENAMES	BbdbGenerateUniqueNames	0L
 MP_BBDB_IGNOREANONYMOUS	BbdbIgnoreAnonymous	0L
 MP_BBDB_SAVEONEXIT	BbdbSaveOnExit	M_ACTION_PROMPT
 MP_BEACONHOST	BeaconHost	""
-MP_BROWSER	Browser	"netscape" (Unix) or "" (elsewhere)
-MP_BROWSER_ISNS	BrowserIsNetscape	1 (Unix) or 0 (elsewhere)
-MP_BROWSER_INNW	BrowserInNewWindow	1
+MP_BROWSER	Browser	"firefox" (Unix) or "" (elsewhere)
+MP_BROWSER_OTHER	BrowserOther	"google-chrome" (Unix) or "" (elsewhere)
 MP_CHARSET	CharSet	"ISO-8859-1"
 MP_CONFIRM_SEND	ConfigSend	0l
 MP_COMPOSETEMPLATEPATH_GLOBAL	CompooseTemplatePath"
diff --git a/include/ClickURL.h b/include/ClickURL.h
index 00986f3..a593edf 100644
--- a/include/ClickURL.h
+++ b/include/ClickURL.h
@@ -23,8 +23,8 @@ class Profile;
 /// options for OpenInBrowser() (these are bit masks)
 enum
 {
-   URLOpen_Default    = 0,
-   URLOpen_New_Window = 1
+   URLOpen_Default = 0,
+   URLOpen_Other   = 1
 };
 
 // ----------------------------------------------------------------------------
diff --git a/include/Moptions.h b/include/Moptions.h
index 167968b..1248f1b 100644
--- a/include/Moptions.h
+++ b/include/Moptions.h
@@ -357,8 +357,7 @@ extern const MOption MP_MSGS_REMOVE_LIST_PREFIX_BREAKING;
 extern const MOption MP_MSGS_SEARCH_CRIT;
 extern const MOption MP_MSGS_SEARCH_ARG;
 extern const MOption MP_BROWSER;
-extern const MOption MP_BROWSER_ISNS;
-extern const MOption MP_BROWSER_INNW;
+extern const MOption MP_BROWSER_OTHER;
 extern const MOption MP_EXTERNALEDITOR;
 extern const MOption MP_ALWAYS_USE_EXTERNALEDITOR;
 extern const MOption MP_PGP_COMMAND;
@@ -1119,10 +1118,8 @@ extern const MOption MP_OPTION_ORIGIN_INHERITED;
 #define MP_MSGS_SEARCH_ARG_NAME    "SearchArgument"
 /// open URLs with
 #define   MP_BROWSER_NAME         "Browser"
-/// Browser is netscape variant
-#define   MP_BROWSER_ISNS_NAME    "BrowserIsNetscape"
-/// Open netscape in new window
-#define   MP_BROWSER_INNW_NAME    "BrowserInNewWindow"
+/// another browser
+#define   MP_BROWSER_OTHER_NAME    "BrowserOther"
 /// external editor to use for message composition (use %s for filename)
 #define MP_EXTERNALEDITOR_NAME    "ExternalEditor"
 /// start external editor automatically?
@@ -2101,13 +2098,11 @@ extern const MOption MP_OPTION_ORIGIN_INHERITED;
 #define MP_MSGS_SEARCH_ARG_DEFVAL   ""
 /// open URLs with
 #ifdef  OS_UNIX
-#  define   MP_BROWSER_DEFVAL         "netscape"
-#  define   MP_BROWSER_ISNS_DEFVAL    1
-#  define   MP_BROWSER_INNW_DEFVAL    1
+#  define   MP_BROWSER_DEFVAL         "firefox"
+#  define   MP_BROWSER_OTHER_DEFVAL   "google-chrome"
 #else  // under Windows, we know better...
 #  define   MP_BROWSER_DEFVAL         ""
-#  define   MP_BROWSER_ISNS_DEFVAL    0L
-#  define   MP_BROWSER_INNW_DEFVAL    1L
+#  define   MP_BROWSER_OTHER_DEFVAL   ""
 #endif // Unix/Win
 
 /// external editor to use for message composition (use %s for filename)
diff --git a/src/classes/Moptions.cpp b/src/classes/Moptions.cpp
index fca46ae..3e0d725 100644
--- a/src/classes/Moptions.cpp
+++ b/src/classes/Moptions.cpp
@@ -415,8 +415,7 @@ const MOption MP_MSGS_REMOVE_LIST_PREFIX_BREAKING;
 const MOption MP_MSGS_SEARCH_CRIT;
 const MOption MP_MSGS_SEARCH_ARG;
 const MOption MP_BROWSER;
-const MOption MP_BROWSER_ISNS;
-const MOption MP_BROWSER_INNW;
+const MOption MP_BROWSER_OTHER;
 const MOption MP_EXTERNALEDITOR;
 const MOption MP_ALWAYS_USE_EXTERNALEDITOR;
 const MOption MP_PGP_COMMAND;
@@ -838,8 +837,7 @@ static const MOptionData MOptions[] =
     DEFINE_OPTION(MP_MSGS_SEARCH_CRIT),
     DEFINE_OPTION(MP_MSGS_SEARCH_ARG),
     DEFINE_OPTION(MP_BROWSER),
-    DEFINE_OPTION(MP_BROWSER_ISNS),
-    DEFINE_OPTION(MP_BROWSER_INNW),
+    DEFINE_OPTION(MP_BROWSER_OTHER),
     DEFINE_OPTION(MP_EXTERNALEDITOR),
     DEFINE_OPTION(MP_ALWAYS_USE_EXTERNALEDITOR),
     DEFINE_OPTION(MP_PGP_COMMAND),
diff --git a/src/gui/ClickURL.cpp b/src/gui/ClickURL.cpp
index 0a02003..f1d9622 100644
--- a/src/gui/ClickURL.cpp
+++ b/src/gui/ClickURL.cpp
@@ -65,7 +65,7 @@ enum
 {
    WXMENU_URL_BEGIN,
    WXMENU_URL_OPEN,
-   WXMENU_URL_OPEN_NEW,
+   WXMENU_URL_OPEN_OTHER,
    WXMENU_URL_COMPOSE,
    WXMENU_URL_REPLYTO,
    WXMENU_URL_FORWARDTO,
@@ -107,8 +107,7 @@ private:
 
 extern const MOption MP_AUTOCOLLECT_ADB;
 extern const MOption MP_BROWSER;
-extern const MOption MP_BROWSER_INNW;
-extern const MOption MP_BROWSER_ISNS;
+extern const MOption MP_BROWSER_OTHER;
 extern const MOption MP_WHITE_LIST;
 
 // ============================================================================
@@ -157,7 +156,7 @@ UrlPopup::UrlPopup(const ClickableURL *clickableURL)
    else // !mailto
    {
       Append(WXMENU_URL_OPEN, _("&Open"));
-      Append(WXMENU_URL_OPEN_NEW, _("Open in &new window"));
+      Append(WXMENU_URL_OPEN_OTHER, _("Open in &another browser"));
    }
 
    AppendSeparator();
@@ -171,11 +170,11 @@ UrlPopup::OnCommandEvent(wxCommandEvent &event)
    switch ( id )
    {
       case WXMENU_URL_OPEN:
-      case WXMENU_URL_OPEN_NEW:
+      case WXMENU_URL_OPEN_OTHER:
          m_clickableURL->OpenInBrowser
                         (
                            id == WXMENU_URL_OPEN ? URLOpen_Default
-                                                 : URLOpen_New_Window
+                                                 : URLOpen_Other
                         );
          break;
 
@@ -382,7 +381,7 @@ String ClickableURL::GetLabel() const
 
 void ClickableURL::OpenInBrowser(int options) const
 {
-   bool inNewWindow = (options & URLOpen_New_Window) != 0;
+   bool anotherBrowser = (options & URLOpen_Other) != 0;
 
    wxFrame *frame = m_msgView->GetParentFrame();
    wxLogStatus(frame, _("Opening URL '%s'..."), m_url.c_str());
@@ -394,12 +393,13 @@ void ClickableURL::OpenInBrowser(int options) const
 
    bool bOk = false;
 
-   String browser = READ_CONFIG(GetProfile(), MP_BROWSER);
+   String browser = READ_CONFIG(GetProfile(), anotherBrowser ? MP_BROWSER_OTHER : MP_BROWSER);
    if ( browser.empty() )
    {
 #ifdef OS_WIN
       // ShellExecute() always opens in the same window,
       // so do it manually for new window
+#if 0
       if ( inNewWindow )
       {
          wxRegKey key(wxRegKey::HKCR, m_url.BeforeFirst(':') + "\\shell\\open");
@@ -435,6 +435,7 @@ void ClickableURL::OpenInBrowser(int options) const
             }
          }
       }
+#endif
 
       if ( !command.empty() )
       {
@@ -476,36 +477,6 @@ void ClickableURL::OpenInBrowser(int options) const
    }
    else // browser setting non empty, use it
    {
-#ifdef OS_UNIX
-      if ( READ_CONFIG(GetProfile(), MP_BROWSER_ISNS) ) // try re-loading first
-      {
-         wxString lockfile;
-         wxGetHomeDir(&lockfile);
-         if ( !wxEndsWithPathSeparator(lockfile) )
-            lockfile += DIR_SEPARATOR;
-         lockfile << _T(".netscape") << DIR_SEPARATOR << _T("lock");
-         struct stat statbuf;
-
-         // cannot use wxFileExists here, because it's a link pointing to a
-         // non-existing location!
-         if ( lstat(lockfile.mb_str(), &statbuf) == 0 )
-         {
-            command << browser << _T(" -remote openURL(") << m_url;
-            if ( inNewWindow )
-            {
-               command << _T(",new-window)");
-            }
-            else
-            {
-               command << _T(")");
-            }
-            wxString errmsg;
-            errmsg.Printf(_("Could not launch browser: '%s' failed."),
-                          command.c_str());
-            bOk = m_msgView->LaunchProcess(command, errmsg);
-         }
-      }
-#endif // Unix
       // either not Netscape or Netscape isn't running or we have non-UNIX
       if ( !bOk )
       {
@@ -562,9 +533,7 @@ void ClickableURL::OnLeftClick() const
    }
    else // non mailto URL
    {
-      OpenInBrowser(READ_CONFIG_BOOL(GetProfile(), MP_BROWSER_INNW)
-                     ? URLOpen_New_Window
-                     : URLOpen_Default);
+      OpenInBrowser(URLOpen_Default);
    }
 }
 
diff --git a/src/gui/wxOptionsDlg.cpp b/src/gui/wxOptionsDlg.cpp
index 0bef43f..29c9319 100644
--- a/src/gui/wxOptionsDlg.cpp
+++ b/src/gui/wxOptionsDlg.cpp
@@ -534,10 +534,7 @@ enum ConfigFields
    ConfigField_HelpersSkip0,
    ConfigField_HelpersHelpBrowser,
    ConfigField_Browser,
-#ifndef OS_WIN    // we don't care about browser kind under Windows
-   ConfigField_BrowserIsNetscape,
-#endif // !Win
-   ConfigField_BrowserInNewWindow,
+   ConfigField_BrowserOther,
 
 #ifdef OS_UNIX
    ConfigField_HelpersSkip1,
@@ -1808,19 +1805,7 @@ const wxOptionsPage::FieldInfo wxOptionsPageStandard::ms_aFields[] =
                   "Leave it empty to use the system default browser."),
                                                   Field_Message, -1                      },
    { gettext_noop("Open &URLs with"),             Field_File,    -1                      },
-      // we don't care if it is Netscape or not under Windows
-#ifndef OS_WIN
-   { gettext_noop("URL &browser is Netscape"),    Field_Bool,    -1                      },
-#endif // OS_UNIX
-   { gettext_noop("Open browser in new &window"), Field_Bool,
-      // under Unix we can only implement this with Netscape, under Windows it
-      // also works with IE (and presumably others too)
-#ifdef OS_WIN
-                  -1
-#else // Unix
-                  ConfigField_BrowserIsNetscape
-#endif // Win/Unix
-   },
+   { gettext_noop("Another browser"),             Field_File,    -1                      },
 #ifdef OS_UNIX
    { "",                                           Field_Message, -1 },
    { gettext_noop("The following program will be used to view the online help system:"),     Field_Message, -1                      },
@@ -2350,10 +2335,7 @@ const ConfigValueDefault wxOptionsPageStandard::ms_aConfigDefaults[] =
    CONFIG_NONE(),
    CONFIG_NONE(),
    CONFIG_ENTRY(MP_BROWSER),
-#ifndef OS_WIN
-   CONFIG_ENTRY(MP_BROWSER_ISNS),
-#endif // OS_WIN
-   CONFIG_ENTRY(MP_BROWSER_INNW),
+   CONFIG_ENTRY(MP_BROWSER_OTHER),
 
 #ifdef OS_UNIX
    CONFIG_NONE(),

-----------------------------------------------------------------------

Summary of changes:
 CHANGES                  |    2 +
 doc/tech/config.txt      |    5 +--
 include/ClickURL.h       |    4 +-
 include/Moptions.h       |   17 +++++----------
 src/classes/Moptions.cpp |    6 +---
 src/gui/ClickURL.cpp     |   51 +++++++++-------------------------------------
 src/gui/wxOptionsDlg.cpp |   24 ++-------------------
 7 files changed, 27 insertions(+), 82 deletions(-)


hooks/post-receive
-- 
Mahogany sources repository.

------------------------------------------------------------------------------