summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cb60570)
raw | patch | inline | side by side (parent: cb60570)
author | mfloryan <mfloryan@users.sourceforge.net> | |
Wed, 9 Apr 2008 09:51:44 +0000 (09:51 +0000) | ||
committer | mfloryan <mfloryan@users.sourceforge.net> | |
Wed, 9 Apr 2008 09:51:44 +0000 (09:51 +0000) |
21 files changed:
diff --git a/share/extensions/inkscape_help_askaquestion.inx b/share/extensions/inkscape_help_askaquestion.inx
index df1194dcce4ccac44128358a0078ca911c90a073..455ced8cdb7f83d52b78bc22e4ff5ac2146db350 100644 (file)
<inkscape-extension>
<_name>Ask Us a Question</_name>
<id>org.inkscape.help.askaquestion</id>
- <dependency type="executable" location="extensions">webbrowser_askaquestion.py</dependency>
+ <dependency type="executable" location="extensions">launch_webbrowser.py</dependency>
+ <param name="url" gui-hidden="1" type="string">http://answers.launchpad.net/inkscape/+addquestion</param>
<effect needs-document="no">
<object-type>all</object-type>
<effects-menu hidden="yes"/>
</effect>
<script>
- <command reldir="extensions" interpreter="python">webbrowser_askaquestion.py</command>
+ <command reldir="extensions" interpreter="python">launch_webbrowser.py</command>
</script>
</inkscape-extension>
diff --git a/share/extensions/inkscape_help_commandline.inx b/share/extensions/inkscape_help_commandline.inx
index 23771f857403ea5d22adf43e14ddbc93104d1611..c3b30bcb3be6f397f00128939b627ded631b54a3 100644 (file)
<inkscape-extension>
<_name>Command Line Options</_name>
<id>org.inkscape.help.commandline</id>
- <dependency type="executable" location="extensions">webbrowser_commandline.py</dependency>
+ <dependency type="executable" location="extensions">launch_webbrowser.py</dependency>
+ <param name="url" gui-hidden="1" type="string">http://inkscape.org/doc/inkscape-man.html</param>
<effect needs-document="no">
<object-type>all</object-type>
<effects-menu hidden="yes"/>
</effect>
<script>
- <command reldir="extensions" interpreter="python">webbrowser_commandline.py</command>
+ <command reldir="extensions" interpreter="python">launch_webbrowser.py</command>
</script>
</inkscape-extension>
index dae3700a6fc18aae2b664a502309090df9ba8578..3eb4827a819de13b63b4a3cd9ade112b547ab7bf 100644 (file)
<inkscape-extension>
<_name>FAQ</_name>
<id>org.inkscape.help.faq</id>
- <dependency type="executable" location="extensions">webbrowser_faq.py</dependency>
+ <dependency type="executable" location="extensions">launch_webbrowser.py</dependency>
+ <param name="url" gui-hidden="1" type="string">http://wiki.inkscape.org/wiki/index.php/FAQ</param>
<effect needs-document="no">
<object-type>all</object-type>
<effects-menu hidden="yes"/>
</effect>
<script>
- <command reldir="extensions" interpreter="python">webbrowser_faq.py</command>
+ <command reldir="extensions" interpreter="python">launch_webbrowser.py</command>
</script>
</inkscape-extension>
index 774649ad8f66ec9ed0e3fb3ec078e9770dd32f38..4e1e2159166f6168330ac3526c0f3d14385b6cdf 100644 (file)
<inkscape-extension>
<_name>Keys and Mouse Reference</_name>
<id>org.inkscape.help.keys</id>
- <dependency type="executable" location="extensions">webbrowser_keys.py</dependency>
+ <dependency type="executable" location="extensions">launch_webbrowser.py</dependency>
+ <param name="url" gui-hidden="1" type="string">http://inkscape.org/doc/keys046.html</param>
<effect needs-document="no">
<object-type>all</object-type>
<effects-menu hidden="yes"/>
</effect>
<script>
- <command reldir="extensions" interpreter="python">webbrowser_keys.py</command>
+ <command reldir="extensions" interpreter="python">launch_webbrowser.py</command>
</script>
</inkscape-extension>
index 1224f48c937524a156fbdcc806ac68d00ea45252..3faacc25067216e23d5289a46863f8a8b7010764 100644 (file)
<inkscape-extension>
<_name>Inkscape Manual</_name>
<id>org.inkscape.help.manual</id>
- <dependency type="executable" location="extensions">webbrowser_manual.py</dependency>
+ <dependency type="executable" location="extensions">launch_webbrowser.py</dependency>
+ <param name="url" gui-hidden="1" type="string">http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.php</param>
<effect needs-document="no">
<object-type>all</object-type>
<effects-menu hidden="yes"/>
</effect>
<script>
- <command reldir="extensions" interpreter="python">webbrowser_manual.py</command>
+ <command reldir="extensions" interpreter="python">launch_webbrowser.py</command>
</script>
</inkscape-extension>
diff --git a/share/extensions/inkscape_help_relnotes.inx b/share/extensions/inkscape_help_relnotes.inx
index c01f5b35c287948e9ba0ba10c702e550a3450ee7..6988b6c125a53e5652796032e54c695b4c1c5952 100644 (file)
<inkscape-extension>
<_name>New in This Version</_name>
<id>org.inkscape.help.relnotes</id>
- <dependency type="executable" location="extensions">webbrowser_relnotes.py</dependency>
+ <dependency type="executable" location="extensions">launch_webbrowser.py</dependency>
+ <param name="url" gui-hidden="1" type="string">http://wiki.inkscape.org/wiki/index.php/ReleaseNotes046</param>
<effect needs-document="no">
<object-type>all</object-type>
<effects-menu hidden="yes"/>
</effect>
<script>
- <command reldir="extensions" interpreter="python">webbrowser_relnotes.py</command>
+ <command reldir="extensions" interpreter="python">launch_webbrowser.py</command>
</script>
</inkscape-extension>
diff --git a/share/extensions/inkscape_help_reportabug.inx b/share/extensions/inkscape_help_reportabug.inx
index 4bd4387b9a61663f5a087731186b8a07ac24a19e..e52202ce69a018807e033ca0472c269406acc25d 100644 (file)
<inkscape-extension>
<_name>Report a Bug</_name>
<id>org.inkscape.help.reportabug</id>
- <dependency type="executable" location="extensions">webbrowser_reportabug.py</dependency>
+ <dependency type="executable" location="extensions">launch_webbrowser.py</dependency>
+ <param name="url" gui-hidden="1" type="string">http://inkscape.org/report_bugs.php</param>
<effect needs-document="no">
<object-type>all</object-type>
<effects-menu hidden="yes"/>
</effect>
<script>
- <command reldir="extensions" interpreter="python">webbrowser_reportabug.py</command>
+ <command reldir="extensions" interpreter="python">launch_webbrowser.py</command>
</script>
</inkscape-extension>
diff --git a/share/extensions/inkscape_help_svgspec.inx b/share/extensions/inkscape_help_svgspec.inx
index 2757c69da79096a6d04b64c485d905b6bde89a04..d78f4c377b250236b090f14a0069a5bd30ed7f9b 100644 (file)
<inkscape-extension>
<_name>SVG 1.1 Specification</_name>
<id>org.inkscape.help.svgspec</id>
- <dependency type="executable" location="extensions">webbrowser_svgspec.py</dependency>
+ <dependency type="executable" location="extensions">launch_webbrowser.py</dependency>
+ <param name="url" gui-hidden="1" type="string">http://www.w3.org/TR/SVG11/</param>
<effect needs-document="no">
<object-type>all</object-type>
<effects-menu hidden="yes"/>
</effect>
<script>
- <command reldir="extensions" interpreter="python">webbrowser_svgspec.py</command>
+ <command reldir="extensions" interpreter="python">launch_webbrowser.py</command>
</script>
</inkscape-extension>
diff --git a/share/extensions/launch_webbrowser.py b/share/extensions/launch_webbrowser.py
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env python \r
+import webbrowser, threading\r
+from optparse import OptionParser\r
+\r
+class VisitWebSiteWithoutLockingInkscape(threading.Thread):\r
+ def __init__(self):\r
+ threading.Thread.__init__ (self)\r
+ parser = OptionParser()\r
+ parser.add_option("-u", "--url", action="store", type="string", \r
+ default="http://www.inkscape.org/", \r
+ dest="url", help="The URL to open in web browser")\r
+ (self.options, args) = parser.parse_args() \r
+\r
+ def run(self): \r
+ webbrowser.open(self.options.url)\r
+ \r
+vwswli = VisitWebSiteWithoutLockingInkscape()\r
+vwswli.start()
\ No newline at end of file
diff --git a/share/extensions/webbrowser_askaquestion.py b/share/extensions/webbrowser_askaquestion.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-import webbrowser, threading
-url = "http://answers.launchpad.net/inkscape/+addquestion"
-
-class VisitWebSiteWithoutLockingInkscape(threading.Thread):
- def __init__(self, url):
- self.url = url
- threading.Thread.__init__ (self)
-
- def run(self):
- webbrowser.open(self.url)
-
-vwswli = VisitWebSiteWithoutLockingInkscape(url)
-vwswli.start()
diff --git a/share/extensions/webbrowser_commandline.py b/share/extensions/webbrowser_commandline.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-import webbrowser, threading
-url = "http://inkscape.org/doc/inkscape-man.html"
-
-class VisitWebSiteWithoutLockingInkscape(threading.Thread):
- def __init__(self, url):
- self.url = url
- threading.Thread.__init__ (self)
-
- def run(self):
- webbrowser.open(self.url)
-
-vwswli = VisitWebSiteWithoutLockingInkscape(url)
-vwswli.start()
diff --git a/share/extensions/webbrowser_faq.py b/share/extensions/webbrowser_faq.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-import webbrowser, threading
-url = "http://wiki.inkscape.org/wiki/index.php/FAQ"
-
-class VisitWebSiteWithoutLockingInkscape(threading.Thread):
- def __init__(self, url):
- self.url = url
- threading.Thread.__init__ (self)
-
- def run(self):
- webbrowser.open(self.url)
-
-vwswli = VisitWebSiteWithoutLockingInkscape(url)
-vwswli.start()
diff --git a/share/extensions/webbrowser_keys.py b/share/extensions/webbrowser_keys.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-import webbrowser, threading
-url = "http://inkscape.org/doc/keys046.html"
-
-class VisitWebSiteWithoutLockingInkscape(threading.Thread):
- def __init__(self, url):
- self.url = url
- threading.Thread.__init__ (self)
-
- def run(self):
- webbrowser.open(self.url)
-
-vwswli = VisitWebSiteWithoutLockingInkscape(url)
-vwswli.start()
diff --git a/share/extensions/webbrowser_manual.py b/share/extensions/webbrowser_manual.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-import webbrowser, threading
-url = "http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.php"
-
-class VisitWebSiteWithoutLockingInkscape(threading.Thread):
- def __init__(self, url):
- self.url = url
- threading.Thread.__init__ (self)
-
- def run(self):
- webbrowser.open(self.url)
-
-vwswli = VisitWebSiteWithoutLockingInkscape(url)
-vwswli.start()
diff --git a/share/extensions/webbrowser_relnotes.py b/share/extensions/webbrowser_relnotes.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-import webbrowser, threading
-url = "http://wiki.inkscape.org/wiki/index.php/ReleaseNotes046"
-
-class VisitWebSiteWithoutLockingInkscape(threading.Thread):
- def __init__(self, url):
- self.url = url
- threading.Thread.__init__ (self)
-
- def run(self):
- webbrowser.open(self.url)
-
-vwswli = VisitWebSiteWithoutLockingInkscape(url)
-vwswli.start()
diff --git a/share/extensions/webbrowser_reportabug.py b/share/extensions/webbrowser_reportabug.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python
-import webbrowser, threading
-url = "http://inkscape.org/report_bugs.php"
-
-class VisitWebSiteWithoutLockingInkscape(threading.Thread):
- def __init__(self, url):
- self.url = url
- threading.Thread.__init__ (self)
-
- def run(self):
- webbrowser.open(self.url)
-
-vwswli = VisitWebSiteWithoutLockingInkscape(url)
-vwswli.start()
-
diff --git a/share/extensions/webbrowser_svgspec.py b/share/extensions/webbrowser_svgspec.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python
-import webbrowser, threading
-url = "http://www.w3.org/TR/SVG11/"
-
-class VisitWebSiteWithoutLockingInkscape(threading.Thread):
- def __init__(self, url):
- self.url = url
- threading.Thread.__init__ (self)
-
- def run(self):
- webbrowser.open(self.url)
-
-vwswli = VisitWebSiteWithoutLockingInkscape(url)
-vwswli.start()
-
index a4ae7de9b8fecfc43d82fea87a88020a1e22347f..1229749f5339d73acb616da57b36ce6a688d018f 100644 (file)
function to get each widget. Then, each of those is placed into
a Gtk::VBox, which is then returned to the calling function.
- If there are no parameters, this function just returns NULL.
+ If there are no visible parameters, this function just returns NULL.
+ If all parameters are gui_visible = false NULL is returned as well.
*/
Gtk::Widget *
Extension::autogui (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal)
{
- if (g_slist_length(parameters) == 0) return NULL;
+ if (param_visible_count() == 0) return NULL;
AutoGUI * agui = Gtk::manage(new AutoGUI());
+ //go through the list of parameters to see if there are any non-hidden ones
for (GSList * list = parameters; list != NULL; list = g_slist_next(list)) {
Parameter * param = reinterpret_cast<Parameter *>(list->data);
+ if (param->get_gui_hidden()) continue; //Ignore hidden parameters
Gtk::Widget * widg = param->get_widget(doc, node, changeSignal);
gchar const * tip = param->get_tooltip();
agui->addWidget(widg, tip);
- }
-
+ }
+
agui->show();
return agui;
};
Gtk::VBox * retval = Gtk::manage(new Gtk::VBox());
if (_help == NULL) {
- Gtk::Label * content = Gtk::manage(new Gtk::Label("Currently there is no help available for this Extension. Please look on the Inkscape website or ask on the mailing lists if you have questions regarding this extension."));
+ Gtk::Label * content = Gtk::manage(new Gtk::Label(_("Currently there is no help available for this Extension. Please look on the Inkscape website or ask on the mailing lists if you have questions regarding this extension.")));
retval->pack_start(*content, true, true, 5);
content->set_line_wrap(true);
content->show();
return retval;
}
+unsigned int Extension::param_visible_count ( )
+{
+ unsigned int _visible_count = 0;
+ for (GSList * list = parameters; list != NULL; list = g_slist_next(list)) {
+ Parameter * param = reinterpret_cast<Parameter *>(list->data);
+ if (!param->get_gui_hidden()) _visible_count++;
+ }
+ return _visible_count;
+}
+
} /* namespace Extension */
} /* namespace Inkscape */
index 4af65dc92fb5b5f7fea833a1ce859ab159ace026..6cdb1f44c1b7ca531c8713ef7c37fc10b9349ef0 100644 (file)
the appropriate function in code so that it'll work in the
future.
*/
- unsigned int param_visible_count ( ) { return param_count(); };
+ unsigned int param_visible_count ( );
public:
/** An error class for when a parameter is called on a type it is not */
index b395f6f1d648c97f8099dca97b51e5ecbe555c03..cededca516c13fe2abb8b4e9d310dcdae090d687 100644 (file)
*/
static interpreter_t const interpreterTab[] = {
{"perl", "perl-interpreter", "perl" },
-#ifdef _WIN32
+#ifdef WIN32
{"python", "python-interpreter", "pythonw" },
#else
{"python", "python-interpreter", "python" },
return interpName;
}
-#ifdef _WIN32
+#ifdef WIN32
// 2. Windows. Try looking relative to inkscape.exe
RegistryTool rt;
Script::load(Inkscape::Extension::Extension *module)
{
if (module->loaded())
- return TRUE;
+ return true;
helper_extension = "";
if (interpretstr != NULL) {
Glib::ustring interpString =
resolveInterpreterExecutable(interpretstr);
+ //g_message("Found: %s and %s",interpString.c_str(),interpretstr);
command.insert(command.end(), interpretstr);
}
Glib::ustring tmp = "\"";
child_repr = sp_repr_next(child_repr);
}
- //g_return_val_if_fail(command.length() > 0, FALSE);
+ //g_return_val_if_fail(command.length() > 0, false);
return true;
}
/* I've got the command */
bool existance = check_existance(command_text);
if (!existance)
- return FALSE;
+ return false;
}
}
if (!strcmp(child_repr->name(), "helper_extension")) {
gchar const *helper = sp_repr_children(child_repr)->content();
if (Inkscape::Extension::db.get(helper) == NULL) {
- return FALSE;
+ return false;
}
}
Inkscape::Extension::save(
Inkscape::Extension::db.get(SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE),
- view->doc(), _filename.c_str(), FALSE, FALSE, FALSE);
+ view->doc(), _filename.c_str(), false, false, false);
return;
}
if (helper_extension.size() == 0) {
Inkscape::Extension::save(
Inkscape::Extension::db.get(SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE),
- doc, tempfilename_in.c_str(), FALSE, FALSE, FALSE);
+ doc, tempfilename_in.c_str(), false, false, false);
} else {
Inkscape::Extension::save(
Inkscape::Extension::db.get(helper_extension.c_str()),
- doc, tempfilename_in.c_str(), FALSE, FALSE, FALSE);
+ doc, tempfilename_in.c_str(), false, false, false);
}
for (std::list<std::string>::const_iterator i = in_command.begin();
i != in_command.end(); i++) {
std::string param_str = *i;
- //std::cout << "params " << param_str << std::endl;
do {
- //std::cout << "param " << param_str << std::endl;
+ //g_message("param: %s", param_str.c_str());
size_t first_space = param_str.find_first_of(' ');
size_t first_quote = param_str.find_first_of('"');
//std::cout << "first space " << first_space << std::endl;
for (std::list<std::string>::const_iterator i = in_params.begin();
i != in_params.end(); i++) {
- argv.push_back(*i);
+ //g_message("Script parameter: %s",(*i)g.c_str());
+ argv.push_back(*i);
}
if (!(filein.empty())) {
index ca3a2a0d4603210745bfcf4b73eae1a51d715211..1aeafbd7cf4bc37988974f79c2f9f4cf405409d5 100644 (file)
gchar * _text;
/** \brief Whether the GUI is visible */
bool _gui_hidden;
- /** \brief A tip for the GUI if there is one */
- gchar * _gui_tip;
+ /** \brief A tip for the GUI if there is one */
+ gchar * _gui_tip;
/* **** funcs **** */
const gchar * desc,
const Parameter::_scope_t scope,
bool gui_hidden,
- const gchar * gui_tip,
+ const gchar * gui_tip,
Inkscape::Extension::Extension * ext);
Parameter (const gchar * name,
const gchar * guitext,
static Parameter * make (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext);
virtual Gtk::Widget * get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal);
+
gchar const * get_tooltip (void) { return _desc; }
+ /** \brief Indicates if the GUI for this parameter is hidden or not */
+ bool get_gui_hidden () { return _gui_hidden; }
+
virtual void string (std::list <std::string> &list);
virtual void string (std::string &string);
};