~ubuntu-branches/ubuntu/quantal/texworks/quantal

« back to all changes in this revision

Viewing changes to src/ScriptManager.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA
  • Date: 2011-04-04 13:42:12 UTC
  • mfrom: (4.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110404134212-vifjuxlyai7y7gyu
Tags: 0.4.0-2
* Added english manual.
* Updated Build-Depends; removed sharutils and replaced python2.6-dev with
  python-dev
* Removed obsolete debian/patch-print and debian/document-print.png.enc
* Added texworks-help-en package which included manual for texworks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
        This is part of TeXworks, an environment for working with TeX documents
3
 
        Copyright (C) 2007-2010  Jonathan Kew & Stefan Löffler
 
3
        Copyright (C) 2007-2011  Jonathan Kew, Stefan Löffler
4
4
 
5
5
        This program is free software; you can redistribute it and/or modify
6
6
        it under the terms of the GNU General Public License as published by
195
195
        addDetailsRow(rows, tr("Shortcut: "), s->getKeySequence().toString());
196
196
        addDetailsRow(rows, tr("File: "), QFileInfo(s->getFilename()).fileName());
197
197
        
198
 
        const TWScriptLanguageInterface * sli = s->getScriptLanguageInterface();
199
 
        QString url = sli->scriptLanguageURL();
200
 
        QString str = sli->scriptLanguageName();
201
 
        if (!url.isEmpty())
202
 
                str = "<a href=\"" + url + "\">" + str + "</a>";
203
 
        addDetailsRow(rows, tr("Language: "), str);
 
198
        const TWScriptLanguageInterface * sli = qobject_cast<TWScriptLanguageInterface*>(s->getScriptLanguagePlugin());
 
199
        if(sli) {
 
200
                QString url = sli->scriptLanguageURL();
 
201
                QString str = sli->scriptLanguageName();
 
202
                if (!url.isEmpty())
 
203
                        str = "<a href=\"" + url + "\">" + str + "</a>";
 
204
                addDetailsRow(rows, tr("Language: "), str);
 
205
        }
204
206
 
205
207
        if (s->getType() == TWScript::ScriptHook)
206
208
                addDetailsRow(rows, tr("Hook: "), s->getHook());