Fixed 'Open with...' behaviour in Gnome.
This commit is contained in:
parent
e01e25560f
commit
cab393815f
|
@ -41,7 +41,7 @@ bool MyServerConnection::OnPoke(
|
|||
return false;
|
||||
if (item == (wxString)IPC_NO_FILE) { ; }
|
||||
else if (frame->isOpen(item)) { frame->activateTab(item); }
|
||||
else { frame->openFile(item); }
|
||||
else { frame->openFile((wxString&)item); }
|
||||
frame->Raise();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1085,7 +1085,7 @@ void MyFrame::handleCommandLine()
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Usage: xmlcopyeditor [-ws --version --help] [<file>] [<file2>]" << std::endl;
|
||||
std::cout << "Usage: xmlcopyeditor [--version --help -ws] [<file>] [<file2>]" << std::endl << "Options -w (import Microsoft Word document) and -s (open Spelling and style check) are provided for integration with Microsoft Office and only available on Windows" << std::endl;
|
||||
}
|
||||
exit(0);
|
||||
default:
|
||||
|
@ -2717,8 +2717,18 @@ void MyFrame::OnOpen(wxCommandEvent& event)
|
|||
break;
|
||||
}
|
||||
|
||||
bool MyFrame::openFile(const wxString& fileName, bool largeFile)
|
||||
bool MyFrame::openFile(wxString& fileName, bool largeFile)
|
||||
{
|
||||
#ifndef __WXMSW__
|
||||
// truncate string up to file:/ portion added by GNOME
|
||||
wxString filePrefix = _T("file:");
|
||||
int index = fileName.Find(filePrefix.c_str());
|
||||
if (index != -1)
|
||||
{
|
||||
fileName = fileName.Mid((size_t)index + filePrefix.Length());
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!wxFileName::FileExists(fileName))
|
||||
{
|
||||
wxString message;
|
||||
|
|
|
@ -305,7 +305,7 @@ class MyFrame : public wxFrame
|
|||
void messagePane(const wxString& s, int iconType = CONST_INFO);
|
||||
|
||||
// public to allow IPC access
|
||||
bool openFile(const wxString& fileName, bool largeFile = false);
|
||||
bool openFile(wxString& fileName, bool largeFile = false);
|
||||
bool isOpen(const wxString& fileName);
|
||||
void activateTab(const wxString& fileName);
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue