View Issue Details

IDProjectCategoryView StatusLast Update
0009330ScribusScripterpublic2016-05-19 23:02
Reporterrobertsoakes Assigned Tocbradney  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformUbuntu 10.04OSLinuxOS Version10.04
Product Version1.3.8 
Target Version1.5.3Fixed in Version1.5.3.svn 
Summary0009330: Active Startup Script not visible in Preferences and fails silently in GUI & CLI
DescriptionWhen enabling a startup script in the Scripter preference dialog, the path to the script is not being stored. On startup, provides warning:

User startup-script enabled, but unable to find script.
Steps To Reproduce1.) Create simple script and save as sample.py
2.) Go to preference dialog and enable scripts and then choose sample.py with the file dialog.
3.) Press "Ok" and restart Scribus.

The error appears when starting from the command line. Fails silently when starting from the GUI.
Additional InformationUpdate:
1) File -> Preferences -> Scripter does not show the current startup script instead it shows an empty "Startup Script" field even if a startup script is set.
2) that Scribus with the GUI silently fails if the startup script is not found
3) as stated in # 2, the console tells us nothing either
4) attribute key="startupscript" in prefs150.xml is indeed populated.
Tags#pending, patch
PatchYes

Relationships

related to 0013039 closedpsmedley Error at startup prevents using script 
has duplicate 0010365 closed Startup Script not "sticking" 

Activities

Kunda

2014-07-08 13:34

updater   ~0032586

Last edited: 2014-07-08 13:35

This, to me, seems a mixture of UI and Scripter. Can confirm this does happen.

Kunda

2015-04-28 23:18

updater   ~0034980

BTW, can this function be used to exploit a system ?

Kunda

2016-01-15 20:22

updater   ~0038182

William, do you mind offering any feedback on the reason this bug occurs ?

william

2016-01-17 19:22

updater   ~0038220

I tried the current SVN, and it seems to write the full path in attribute key="startupscript" in $HOME/.scribus/prefs150.xml
I added some debug code and verified that it is saving and reading the full name with the path.
I noticed that File -> Preferences -> Scripter shows an empty "Startup Script" field even if a startup script is set.

Kunda

2016-01-18 03:01

updater   ~0038231

Thanks william!

william

2016-01-18 04:56

updater   ~0038233

Can you still make it happen? Maybe I wasn't doing the same thing.
I think that something is not right that File -> Preferences -> Scripter does not show the current startup script and that Scribus with the GUI silently fails if the startup script is not found.

Kunda

2016-01-18 19:47

updater   ~0038258

William, I confirm:
1) File -> Preferences -> Scripter does not show the current startup script instead it shows an empty "Startup Script" field even if a startup script is set.
2) that Scribus with the GUI silently fails if the startup script is not found
3) The console tells us nothing either
4) attribute key="startupscript" in prefs150.xml is indeed populated.

Kunda

2016-01-19 12:17

updater   ~0038265

renamed issues

Kunda

2016-01-19 12:51

updater  

startup-script-missing-prefs.png (171,384 bytes)   
startup-script-missing-prefs.png (171,384 bytes)   

jurajF

2016-03-30 15:31

reporter  

0001-Startup-script-in-preferences.patch (2,014 bytes)   
From 445037f3474a075b69cab7f7af1e4e38211c6994 Mon Sep 17 00:00:00 2001
From: Juraj Fedel <wtxnh-scribus@yahoo.com.au>
Date: Wed, 30 Mar 2016 17:26:32 +0200
Subject: [PATCH] Startup script in preferences

Remove one of two identical signal connection.
Show selected startup script in Preferences.
Show warning when selected statrup script is not found.
---
 scribus/plugins/scriptplugin/prefs_scripter.cpp | 4 +---
 scribus/plugins/scriptplugin/scriptercore.cpp   | 3 ++-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/scribus/plugins/scriptplugin/prefs_scripter.cpp b/scribus/plugins/scriptplugin/prefs_scripter.cpp
index 3284ebc..2e3d743 100644
--- a/scribus/plugins/scriptplugin/prefs_scripter.cpp
+++ b/scribus/plugins/scriptplugin/prefs_scripter.cpp
@@ -30,9 +30,7 @@ Prefs_Scripter::Prefs_Scripter(QWidget* parent)
 	extensionScriptsChk->setChecked(scripterCore->extensionsEnabled());
 	// The startup script box should be disabled  if ext scripts are off
 	startupScriptEdit->setEnabled(extensionScriptsChk->isChecked());
-	connect(extensionScriptsChk, SIGNAL(toggled(bool)),
-			startupScriptEdit, SLOT(setEnabled(bool)));
-
+	startupScriptEdit->setText(scripterCore->startupScript());
 	// signals and slots connections
 	connect(extensionScriptsChk, SIGNAL(toggled(bool)), startupScriptEdit, SLOT(setEnabled(bool)));
 	// colors
diff --git a/scribus/plugins/scriptplugin/scriptercore.cpp b/scribus/plugins/scriptplugin/scriptercore.cpp
index 90a0cdc..605d95d 100644
--- a/scribus/plugins/scriptplugin/scriptercore.cpp
+++ b/scribus/plugins/scriptplugin/scriptercore.cpp
@@ -574,7 +574,8 @@ void ScripterCore::runStartupScript()
 			this->slotRunScriptFile(this->m_startupScript, true);
 		}
 		else
-			qDebug("Startup script enabled, but couln't find script %s.", m_startupScript.toLatin1().constData());
+			ScMessageBox::warning(ScCore->primaryMainWindow(), tr("Startup Script error"),
+					      tr("Could not find script: %1.").arg( m_startupScript));
 	}
 }
 
-- 
2.1.4

jurajF

2016-03-30 15:32

reporter   ~0039540

Provided patch should fix the problem with preferences not showing selected script, and with GUI not showing warning when script is not shown.

Kunda

2016-05-16 17:46

updater   ~0041138

william, can you confirm the patch works? I'm having an issue ATM building from source.

william

2016-05-17 01:14

updater   ~0041147

Kunda, the patch works for me.

Also, in prefs_scripter.cpp, adding the line

connect(extensionScriptsChk, SIGNAL(toggled(bool)), startupScriptChangeButton, SLOT(setEnabled(bool)));

will gray out the "Change..." button when "Enable Extension Scripts" is unchecked. Since the text box is grayed out, I think that the button to set the text box should be grayed out also.

william

2016-05-17 01:15

updater  

scribus15-change-button.patch (655 bytes)   
--- scribus15-change-button/scribus/plugins/scriptplugin/prefs_scripter.cpp-	2016-05-17 03:09:13.893384801 +0200
+++ scribus15-change-button/scribus/plugins/scriptplugin/prefs_scripter.cpp	2016-05-17 03:03:41.760530681 +0200
@@ -41,6 +41,7 @@
 	connect(signButton, SIGNAL(clicked()), this, SLOT(setColor()));
 	connect(stringButton, SIGNAL(clicked()), this, SLOT(setColor()));
 	connect(numberButton, SIGNAL(clicked()), this, SLOT(setColor()));
+	connect(extensionScriptsChk, SIGNAL(toggled(bool)), startupScriptChangeButton, SLOT(setEnabled(bool)));
 	connect(startupScriptChangeButton, SIGNAL(clicked()), this, SLOT(changeStartupScript()));
 }
 

Kunda

2016-05-17 01:56

updater   ~0041150

Thanks William!
Punting this to craig.

Kunda

2016-05-19 23:02

updater   ~0041237

patch applied in r21342
Thanks everyone!

Issue History

Date Modified Username Field Change
2010-08-24 19:29 robertsoakes New Issue
2014-06-24 22:53 FirasH Relationship added has duplicate 0010365
2014-07-08 13:34 Kunda Note Added: 0032586
2014-07-08 13:34 Kunda Status new => feedback
2014-07-08 13:34 Kunda Target Version => 1.5.1
2014-07-08 13:35 Kunda Note Edited: 0032586
2015-04-28 23:17 Kunda Relationship added related to 0013039
2015-04-28 23:18 Kunda Note Added: 0034980
2016-01-15 20:22 Kunda Note Added: 0038182
2016-01-17 19:22 william Note Added: 0038220
2016-01-18 03:01 Kunda Note Added: 0038231
2016-01-18 04:56 william Note Added: 0038233
2016-01-18 19:47 Kunda Note Added: 0038258
2016-01-18 20:30 Kunda Status feedback => confirmed
2016-01-18 20:31 Kunda Patch => No
2016-01-18 20:31 Kunda Additional Information Updated
2016-01-19 12:17 Kunda Note Added: 0038265
2016-01-19 12:17 Kunda Summary Scribus Unable to Find Startup Script => Active Startup Script not visible in Preferences and fails silently in GUI & CLI
2016-01-19 12:48 Kunda File Added: startup-script-missing-prefs.png
2016-01-19 12:51 Kunda File Deleted: startup-script-missing-prefs.png
2016-01-19 12:51 Kunda File Added: startup-script-missing-prefs.png
2016-01-23 17:17 cbradney Target Version 1.5.1 => 1.5.3
2016-03-30 15:31 jurajF File Added: 0001-Startup-script-in-preferences.patch
2016-03-30 15:32 jurajF Note Added: 0039540
2016-03-30 15:33 Kunda Patch No => Yes
2016-05-16 17:44 Kunda Tag Attached: patch
2016-05-16 17:46 Kunda Note Added: 0041138
2016-05-16 17:46 Kunda Tag Attached: #pending
2016-05-17 01:14 william Note Added: 0041147
2016-05-17 01:15 william File Added: scribus15-change-button.patch
2016-05-17 01:56 Kunda Assigned To => cbradney
2016-05-17 01:56 Kunda Status confirmed => assigned
2016-05-17 01:56 Kunda Note Added: 0041150
2016-05-19 21:16 cbradney Status assigned => resolved
2016-05-19 21:16 cbradney Fixed in Version => 1.5.3.svn
2016-05-19 21:16 cbradney Resolution open => fixed
2016-05-19 23:02 Kunda Note Added: 0041237
2016-05-19 23:02 Kunda Status resolved => closed