[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : luke
Repository : xara
Revision : 1074
Date : Tue May 16 12:38:51 BST 2006
Changed paths:
M /Trunk/XaraLX/Kernel/main2.cpp
M /Trunk/XaraLX/Kernel/menuops.cpp
M /Trunk/XaraLX/wxOil/camelot.cpp
M /Trunk/XaraLX/wxOil/camelot.h
M /Trunk/XaraLX/wxOil/menucmds.cpp
Start enabling help. Doesn't work on my machine, but this is a MIME configuration issue so should work on more standard distros
Diff:
Index: Trunk/XaraLX/Kernel/menuops.cpp
===================================================================
--- Trunk/XaraLX/Kernel/menuops.cpp (revision 1073)
+++ Trunk/XaraLX/Kernel/menuops.cpp (revision 1074)
@@ -1437,8 +1437,6 @@
void HelpOps::Do(OpDescriptor* WhichOp)
{
-PORTNOTETRACE("other","HelpOps::Do - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
if ((WhichOp->Token) == String(OPTOKEN_HELPUSING))
HelpUsingAction();
else if ((WhichOp->Token) == String(OPTOKEN_HELPINDEX))
@@ -1484,7 +1482,7 @@
else if ((WhichOp->Token) == String(OPTOKEN_HELPSPEC))
HelpSpecAction();
#endif
-#endif
+
End();
}
@@ -1507,8 +1505,6 @@
OpState HelpOps::GetState(String_256* UIDescription, OpDescriptor* OpDesc)
{
- PORTNOTETRACE("other","HelpOps::GetState - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
//Webster_Ranbir_12 \96
#ifdef INC_WEB_MENU_ITEMS
if (OpDesc->Token == String(OPTOKEN_WEBLINK))
@@ -1529,7 +1525,6 @@
}
else
#endif //INC_WEB_MENU_ITEMS
-#endif
return OpState(FALSE, FALSE);
}
@@ -1556,8 +1551,6 @@
BOOL HelpOps::Init()
{
-PORTNOTETRACE("other","HelpOps::Init - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
REGOP(HELP,USING,HelpOps)
/* OpDescriptor* UsingOp = new OpDescriptor(
0,
@@ -1702,8 +1695,6 @@
REGOP(HELP,SPEC,HelpOps)
#endif
-#endif
-
return TRUE;
}
Index: Trunk/XaraLX/Kernel/main2.cpp
===================================================================
--- Trunk/XaraLX/Kernel/main2.cpp (revision 1073)
+++ Trunk/XaraLX/Kernel/main2.cpp (revision 1074)
@@ -363,7 +363,6 @@
CXFTreeDlg::Init() && // The Xar format debug tree dialog
#endif //XAR_TREE_DIALOG
- HelpOps::Init() && // Register Help Operations
OpWhatsThis::Init() && // Register the "What's This?" help mode Operation
WindowOps::Init() && // Register Window Operations
ViewOps::Init() && // Register View Operations
@@ -376,6 +375,7 @@
#endif //webster
#endif
+ HelpOps::Init() && // Register Help Operations
OpMenuImport::Init() && // Register import operations
OpMenuExport::Init() && // Register export operations
Index: Trunk/XaraLX/wxOil/menucmds.cpp
===================================================================
--- Trunk/XaraLX/wxOil/menucmds.cpp (revision 1073)
+++ Trunk/XaraLX/wxOil/menucmds.cpp (revision 1074)
@@ -817,14 +817,7 @@
void HelpIndexAction()
{
-PORTNOTETRACE("other", "HelpIndexAction does nothing");
-#if !defined(EXCLUDE_FROM_XARALX)
-#if (_MFC_VER >= 0x250)
- GetMainFrame()->OnHelpIndex();
-#else
- ((CCamApp*) AfxGetApp())->OnHelpIndex();
-#endif
-#endif
+ AfxGetApp().OnHelpIndex();
}
Index: Trunk/XaraLX/wxOil/camelot.h
===================================================================
--- Trunk/XaraLX/wxOil/camelot.h (revision 1073)
+++ Trunk/XaraLX/wxOil/camelot.h (revision 1074)
@@ -138,6 +138,8 @@
void OnIdle ( wxIdleEvent &event );
void OnTimer ( wxTimerEvent &event );
+ void OnHelpIndex();
+
void GiveActiveCanvasFocus();
int FilterEvent( wxEvent& event );
Index: Trunk/XaraLX/wxOil/camelot.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camelot.cpp (revision 1073)
+++ Trunk/XaraLX/wxOil/camelot.cpp (revision 1074)
@@ -1227,6 +1227,52 @@
;
}
+/*******************************************************************************************/
+
+void CCamApp::OnHelpIndex()
+{
+ // Get the locale id
+ wxString strLocale( setlocale( LC_MESSAGES, NULL ), wxConvUTF8 );
+ int ordSep = strLocale.Find( _T('_' ) );
+ if( -1 != ordSep )
+ strLocale = strLocale.Left( ordSep );
+ TRACEUSER( "jlh92", _T("Locale = %s
"), PCTSTR(strLocale) );
+
+ // Locale C is considered a synonym for en
+ if( strLocale == _T("C") )
+ strLocale = _T("en");
+
+ // Check the help dir exists, if not bomb out
+ PSTR pszDataPath = br_find_data_dir( "/usr/share" );
+ wxString strHelpPath( pszDataPath, wxConvUTF8 );
+ free( pszDataPath );
+ strHelpPath += _T("/xaralx/doc/");
+ TRACEUSER( "jlh92", _T("Using filter discovery directory \"%s\"
"), PCTSTR(strHelpPath + strLocale) );
+ if( wxDir::Exists( strHelpPath + strLocale ) )
+ strHelpPath += strLocale + _T("/");
+ else
+ if( wxDir::Exists( strHelpPath + _T("en") ) )
+ strHelpPath += strLocale + _T("en/");
+ else
+ {
+ // We'll try default location under debug to make life easier
+#if defined(_DEBUG)
+ strHelpPath = _T("/usr/share/xaralx/doc/en/");
+ TRACEUSER( "jlh92", _T("Try = \"%s\"
"), PCTSTR(strHelpPath) );
+ if( !wxDir::Exists( strHelpPath ) )
+#endif
+ return;
+ }
+
+ TRACEUSER( "jlh92", _T("Final directory = \"%s\"
"), PCTSTR(strHelpPath) );
+
+ // Build the complete URL and launch browser
+ wxString strUrl( _T("file://") );
+ strUrl += strHelpPath;
+ strUrl += _T("xaralx.htm");
+ wxLaunchDefaultBrowser( strUrl );
+}
+
/***************************************************************************************************************************/
Xara