~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/plugins/defaultmimehandler/defaultmimehandler.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3
3
 * http://www.gnu.org/licenses/gpl-3.0.html
4
4
 *
5
 
 * $Revision: 4909 $
6
 
 * $Id: defaultmimehandler.cpp 4909 2008-02-27 13:15:26Z mortenmacfly $
7
 
 * $HeadURL: svn://svn.berlios.de/codeblocks/tags/8.02/src/plugins/defaultmimehandler/defaultmimehandler.cpp $
 
5
 * $Revision: 5642 $
 
6
 * $Id: defaultmimehandler.cpp 5642 2009-06-11 07:59:17Z mortenmacfly $
 
7
 * $HeadURL: svn+ssh://jenslody@svn.berlios.de/svnroot/repos/codeblocks/trunk/src/plugins/defaultmimehandler/defaultmimehandler.cpp $
8
8
 */
9
9
 
10
10
#include "sdk.h"
181
181
    {
182
182
        // not yet supported. ask the user how to open it.
183
183
        wxString choices[3] = {_("Select an external program to open it"),
184
 
                               _("Open it with the associated application (windows only)"),
 
184
                               _("Open it with the associated application"),
185
185
                               _("Open it inside the Code::Blocks editor")};
186
186
        wxSingleChoiceDialog dlg(Manager::Get()->GetAppWindow(),
187
187
                                _("Code::Blocks does not yet know how to open this kind of file.\n"
266
266
 
267
267
wxString DefaultMimeHandler::ChooseExternalProgram()
268
268
{
269
 
    wxFileDialog* dlg = new wxFileDialog(0,
270
 
                            _("Select program"),
271
 
                            wxEmptyString,
272
 
                            wxEmptyString,
273
 
                            FileFilters::GetFilterAll(),
274
 
                            wxOPEN | compatibility::wxHideReadonly);
275
 
    PlaceWindow(dlg);
276
 
    if (dlg->ShowModal() == wxID_OK)
277
 
        return dlg->GetPath();
 
269
    wxFileDialog dlg(0,
 
270
                     _("Select program"),
 
271
                                        wxEmptyString,
 
272
                                        wxEmptyString,
 
273
                                        FileFilters::GetFilterAll(),
 
274
                                        wxFD_OPEN | compatibility::wxHideReadonly);
 
275
    PlaceWindow(&dlg);
 
276
    if (dlg.ShowModal() == wxID_OK)
 
277
        return dlg.GetPath();
278
278
    return wxEmptyString;
279
279
}
280
280
 
300
300
        #ifdef __WXMSW__
301
301
        ShellExecute(0, wxString(_T("open")).c_str(), filename.c_str(), 0, 0, SW_SHOW);
302
302
        #endif
 
303
        #ifdef __WXGTK__
 
304
        wxExecute(wxString::Format(_T("xdg-open %s"), filename.c_str()));
 
305
        #endif
 
306
        #ifdef __WXMAC__
 
307
        wxExecute(wxString::Format(_T("open %s"), filename.c_str()));
 
308
        #endif
303
309
        return 0;
304
310
    }
305
311
    else