Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv31916/src/gui

Modified Files:
        wxIconManager.cpp wxMApp.cpp wxMDialogs.cpp wxMFrame.cpp 
        wxMessageView.cpp 
Log Message:
changed "make install" under Unix to be more consistent with FSSTD and common sense:
1. binary is now installed in $prefix/bin
2. $prefix/share/mahogany (and not Mahogany) contains only arch-independent files
3. modules are now in $prefix/lib/mahogany/modules
4. code has been updated accordingly and tweaked to ensure that everything
   works both after and before the installation
5. some preliminary/untested code for Mac OS X bundle directory detection added


Index: wxIconManager.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxIconManager.cpp,v
retrieving revision 1.105
retrieving revision 1.106
diff -b -u -2 -r1.105 -r1.106
--- wxIconManager.cpp   6 Nov 2003 01:13:36 -0000       1.105
+++ wxIconManager.cpp   12 Jan 2004 17:48:29 -0000      1.106
@@ -62,5 +62,4 @@
 
 extern const MOption MP_CONVERTPROGRAM;
-extern const MOption MP_CONVERTPROGRAM_D;
 extern const MOption MP_ICONPATH;
 extern const MOption MP_TMPGFXFORMAT;
@@ -422,6 +421,20 @@
    m_iconList = new IconDataList;
 
-   m_GlobalDir << mApplication->GetDataDir() << DIR_SEPARATOR << _T("icons");
-   m_LocalDir << mApplication->GetLocalDir() << DIR_SEPARATOR << _T("icons");
+   const String localDir(mApplication->GetLocalDir());
+
+   m_GlobalDir = mApplication->GetDataDir();
+
+   // look in the source directory if there is no global one
+#ifdef M_TOP_SOURCEDIR
+   if ( m_GlobalDir == localDir )
+   {
+      m_GlobalDir.clear();
+      m_GlobalDir << M_TOP_SOURCEDIR << DIR_SEPARATOR << _T("src");
+   }
+#endif // defined(M_TOP_SOURCEDIR)
+
+   m_GlobalDir << DIR_SEPARATOR << _T("icons");
+
+   m_LocalDir << localDir << DIR_SEPARATOR << _T("icons");
 
    if(sub_dir == _T("default") || sub_dir == _("default"))
@@ -551,5 +564,10 @@
    if(m_GlobalDir.Length())
    {
-      PathFinder pf(READ_APPCONFIG(MP_ICONPATH), false /* non-recursive */);
+      PathFinder pf(READ_APPCONFIG(MP_ICONPATH));
+
+#ifdef M_TOP_SOURCEDIR
+      pf.AddPaths(String(M_TOP_SOURCEDIR) + _T("/src/icons"));
+#endif // M_TOP_SOURCEDIR
+
       pf.AddPaths(m_GlobalDir, false);
       if(ms_IconPath.Length() > 0)

Index: wxMApp.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMApp.cpp,v
retrieving revision 1.283
retrieving revision 1.284
diff -b -u -2 -r1.283 -r1.284
--- wxMApp.cpp  10 Jan 2004 18:49:23 -0000      1.283
+++ wxMApp.cpp  12 Jan 2004 17:48:29 -0000      1.284
@@ -1251,5 +1251,5 @@
 
       // set AFM path
-      PathFinder pf(mApplication->GetGlobalDir() + _T("/afm"), false);
+      PathFinder pf(mApplication->GetDataDir() + _T("/afm"), false);
       pf.AddPaths(READ_APPCONFIG_TEXT(MP_AFMPATH), false);
       pf.AddPaths(mApplication->GetLocalDir(), true);
@@ -1355,5 +1355,5 @@
 wxString wxMApp::GetHelpDir()
 {
-   wxString helpdir = mApplication->GetGlobalDir();
+   wxString helpdir = mApplication->GetDataDir();
    if ( !helpdir.empty() )
       helpdir += wxFILE_SEP_PATH;

Index: wxMDialogs.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMDialogs.cpp,v
retrieving revision 1.411
retrieving revision 1.412
diff -b -u -2 -r1.411 -r1.412
--- wxMDialogs.cpp      10 Jan 2004 18:49:23 -0000      1.411
+++ wxMDialogs.cpp      12 Jan 2004 17:48:29 -0000      1.412
@@ -1253,6 +1253,6 @@
    String dir, filename;
 
-   // Tips files are in @prefix@/share/Mahogany/doc/Tips/
-   dir = mApplication->GetGlobalDir();
+   // Tips files are in $prefix/share/mahogany/doc/Tips/
+   dir = mApplication->GetDataDir();
    if ( !dir )
    {

Index: wxMFrame.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMFrame.cpp,v
retrieving revision 1.168
retrieving revision 1.169
diff -b -u -2 -r1.168 -r1.169
--- wxMFrame.cpp        10 Jan 2004 18:49:23 -0000      1.168
+++ wxMFrame.cpp        12 Jan 2004 17:48:29 -0000      1.169
@@ -579,5 +579,5 @@
       case WXMENU_FILE_RUN_PYSCRIPT:
          {
-            wxString path = mApplication->GetGlobalDir();
+            wxString path = mApplication->GetDataDir();
             if ( !path.empty() )
                path += DIR_SEPARATOR;

Index: wxMessageView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMessageView.cpp,v
retrieving revision 1.299
retrieving revision 1.300
diff -b -u -2 -r1.299 -r1.300
--- wxMessageView.cpp   18 Dec 2003 20:39:05 -0000      1.299
+++ wxMessageView.cpp   12 Jan 2004 17:48:29 -0000      1.300
@@ -252,8 +252,9 @@
 
    // we also need to update the viewers menu to indicate the currently
-   // selected one
-   if ( viewerNew )
+   // selected one (if we do have a viewer, i.e. are not using the dummy one)
+   const String& nameViewer = GetProfileValues().msgViewer;
+   if ( viewerNew && !nameViewer.empty() )
    {
-      int n = m_namesViewers.Index(GetProfileValues().msgViewer);
+      int n = m_namesViewers.Index(nameViewer);
       CHECK_RET( n != wxNOT_FOUND, _T("non existing viewer selected?") );
 



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to