Skip to content

Commit 84c4765

Browse files
committed
Inkscape extension: avoid showing the dialog when more than one object is selected.
1 parent 72781d6 commit 84c4765

File tree

1 file changed

+8
-2
lines changed
  • platform-windows/inkscape-extension

1 file changed

+8
-2
lines changed

platform-windows/inkscape-extension/scada.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@
451451
aboutframe.option_add("*Font", default_font)
452452
abouttext = tk.Text(aboutframe, wrap=tk.WORD, borderwidth=2)
453453

454-
abouttext.insert(tk.END,"\nSCADA Animation GUI Editor eXtension. Based on ECAVA/IntegraXor SCADA system.")
454+
abouttext.insert(tk.END,"\nSCADA Animation Editor extension for JSON-SCADA. Based on ECAVA/IntegraXor extension.")
455455
#endregion
456456

457457
animations = [ 'ttr":"bar"','ttr":"clone"','ttr":"color"','ttr":"opac"',\
@@ -463,16 +463,22 @@
463463

464464
class SAGEX(inkex.EffectExtension):
465465
def effect(self):
466+
if len(self.options.ids) > 1:
467+
# messagebox.showinfo("Error","Select just one element then open the SCADA extension. Hit ESC when done.")
468+
on_closing()
469+
return
470+
466471
if len(self.options.ids) == 0:
467472
# object_id_label.configure(state=tk.DISABLED)
468473
# object_id_entry.configure(state=tk.DISABLED)
469-
message = ' "Usage: Please select the desired element(s) then open SAGEX for SCADA animation".'
474+
message = 'Select just one element then open the SCADA extension. Hit ESC when done."'
470475
object_id_entry.delete(0,'end')
471476
object_id_entry.insert(0,message)
472477
object_id_entry.configure(fg='red')
473478

474479
for t in range(len(tabControl.tabs())):
475480
tabControl.tab(t,state=tk.DISABLED)
481+
return
476482

477483
for node in self.svg.selected:
478484
attr_id = node.attrib['id']

0 commit comments

Comments
 (0)