Merge pull request #695 from vkbo/projsettings_update
Project Settings update
This commit is contained in:
+83
-57
@@ -1,74 +1,75 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS><TS version="2.0" language="en_US" sourcelanguage="en_GB">
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="en_US" sourcelanguage="en_GB">
|
||||||
<context>
|
<context>
|
||||||
<name>Common</name>
|
<name>Common</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="270"/>
|
<location filename="../nw/common.py" line="240"/>
|
||||||
<source>in the future</source>
|
<source>in the future</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="274"/>
|
<location filename="../nw/common.py" line="244"/>
|
||||||
<source>just now</source>
|
<source>just now</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="278"/>
|
<location filename="../nw/common.py" line="248"/>
|
||||||
<source>a minute ago</source>
|
<source>a minute ago</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="282"/>
|
<location filename="../nw/common.py" line="252"/>
|
||||||
<source>{0} minutes ago</source>
|
<source>{0} minutes ago</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="286"/>
|
<location filename="../nw/common.py" line="256"/>
|
||||||
<source>an hour ago</source>
|
<source>an hour ago</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="290"/>
|
<location filename="../nw/common.py" line="260"/>
|
||||||
<source>{0} hours ago</source>
|
<source>{0} hours ago</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="294"/>
|
<location filename="../nw/common.py" line="264"/>
|
||||||
<source>a day ago</source>
|
<source>a day ago</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="298"/>
|
<location filename="../nw/common.py" line="268"/>
|
||||||
<source>{0} days ago</source>
|
<source>{0} days ago</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="302"/>
|
<location filename="../nw/common.py" line="272"/>
|
||||||
<source>a week ago</source>
|
<source>a week ago</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="306"/>
|
<location filename="../nw/common.py" line="276"/>
|
||||||
<source>{0} weeks ago</source>
|
<source>{0} weeks ago</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="310"/>
|
<location filename="../nw/common.py" line="280"/>
|
||||||
<source>a month ago</source>
|
<source>a month ago</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="314"/>
|
<location filename="../nw/common.py" line="284"/>
|
||||||
<source>{0} months ago</source>
|
<source>{0} months ago</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="318"/>
|
<location filename="../nw/common.py" line="288"/>
|
||||||
<source>a year ago</source>
|
<source>a year ago</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="322"/>
|
<location filename="../nw/common.py" line="292"/>
|
||||||
<source>{0} years ago</source>
|
<source>{0} years ago</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -3537,57 +3538,57 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>GuiProjectEditMain</name>
|
<name>GuiProjectEditMain</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="169"/>
|
<location filename="../nw/gui/projsettings.py" line="173"/>
|
||||||
<source>Project Settings</source>
|
<source>Project Settings</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="178"/>
|
<location filename="../nw/gui/projsettings.py" line="182"/>
|
||||||
<source>Working title</source>
|
<source>Working title</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="178"/>
|
<location filename="../nw/gui/projsettings.py" line="182"/>
|
||||||
<source>Should be set only once.</source>
|
<source>Should be set only once.</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="188"/>
|
<location filename="../nw/gui/projsettings.py" line="192"/>
|
||||||
<source>Novel title</source>
|
<source>Novel title</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="188"/>
|
<location filename="../nw/gui/projsettings.py" line="192"/>
|
||||||
<source>Change whenever you want!</source>
|
<source>Change whenever you want!</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="198"/>
|
<location filename="../nw/gui/projsettings.py" line="202"/>
|
||||||
<source>Author(s)</source>
|
<source>Author(s)</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="198"/>
|
<location filename="../nw/gui/projsettings.py" line="202"/>
|
||||||
<source>One name per line.</source>
|
<source>One name per line.</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="207"/>
|
<location filename="../nw/gui/projsettings.py" line="211"/>
|
||||||
<source>Default</source>
|
<source>Default</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="214"/>
|
<location filename="../nw/gui/projsettings.py" line="218"/>
|
||||||
<source>Spell check language</source>
|
<source>Spell check language</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="228"/>
|
<location filename="../nw/gui/projsettings.py" line="232"/>
|
||||||
<source>Overrides main preferences.</source>
|
<source>Overrides main preferences.</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="228"/>
|
<location filename="../nw/gui/projsettings.py" line="232"/>
|
||||||
<source>No backup on close</source>
|
<source>No backup on close</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -3595,91 +3596,116 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>GuiProjectEditReplace</name>
|
<name>GuiProjectEditReplace</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="455"/>
|
<location filename="../nw/gui/projsettings.py" line="508"/>
|
||||||
<source>Keyword</source>
|
<source>Keyword</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="455"/>
|
<location filename="../nw/gui/projsettings.py" line="508"/>
|
||||||
<source>Replace With</source>
|
<source>Replace With</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="475"/>
|
<location filename="../nw/gui/projsettings.py" line="547"/>
|
||||||
<source>Save entry</source>
|
<source>Save entry</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="476"/>
|
<location filename="../nw/gui/projsettings.py" line="527"/>
|
||||||
<source>Add new entry</source>
|
<source>Add new entry</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="477"/>
|
<location filename="../nw/gui/projsettings.py" line="531"/>
|
||||||
<source>Delete selected entry</source>
|
<source>Delete selected entry</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="494"/>
|
<location filename="../nw/gui/projsettings.py" line="502"/>
|
||||||
<source>Text Replace List for Preview and Export</source>
|
<source>Text Replace List for Preview and Export</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="538"/>
|
||||||
|
<source>Select item to edit</source>
|
||||||
|
<translation></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>GuiProjectEditStatus</name>
|
<name>GuiProjectEditStatus</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="274"/>
|
<location filename="../nw/gui/projsettings.py" line="313"/>
|
||||||
<source>New</source>
|
|
||||||
<translation></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../nw/gui/projsettings.py" line="275"/>
|
|
||||||
<source>Delete</source>
|
|
||||||
<translation></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../nw/gui/projsettings.py" line="276"/>
|
|
||||||
<source>Save</source>
|
<source>Save</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="279"/>
|
<location filename="../nw/gui/projsettings.py" line="309"/>
|
||||||
<source>Colour</source>
|
<source>Colour</source>
|
||||||
<translation>Color</translation>
|
<translation>Color</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="290"/>
|
<location filename="../nw/gui/projsettings.py" line="255"/>
|
||||||
<source>Name</source>
|
|
||||||
<translation></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../nw/gui/projsettings.py" line="300"/>
|
|
||||||
<source>Novel File Status Levels</source>
|
<source>Novel File Status Levels</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="302"/>
|
<location filename="../nw/gui/projsettings.py" line="259"/>
|
||||||
<source>Note File Importance Levels</source>
|
<source>Note File Importance Levels</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="327"/>
|
<location filename="../nw/gui/projsettings.py" line="366"/>
|
||||||
<source>Select Colour</source>
|
<source>Select Colour</source>
|
||||||
<translation>Select Color</translation>
|
<translation>Select Color</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="341"/>
|
<location filename="../nw/gui/projsettings.py" line="380"/>
|
||||||
<source>New Item</source>
|
<source>New Item</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="357"/>
|
<location filename="../nw/gui/projsettings.py" line="277"/>
|
||||||
<source>Cannot delete status item that is in use.</source>
|
<source>Label</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="389"/>
|
<location filename="../nw/gui/projsettings.py" line="277"/>
|
||||||
<source>{0} [{1}]</source>
|
<source>Usage</source>
|
||||||
|
<translation></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="292"/>
|
||||||
|
<source>Add new entry</source>
|
||||||
|
<translation></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="296"/>
|
||||||
|
<source>Delete selected entry</source>
|
||||||
|
<translation></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="305"/>
|
||||||
|
<source>Select item to edit</source>
|
||||||
|
<translation></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="397"/>
|
||||||
|
<source>Cannot delete a status item that is in use.</source>
|
||||||
|
<translation></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="479"/>
|
||||||
|
<source>Not in use</source>
|
||||||
|
<translation></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="481"/>
|
||||||
|
<source>Used once</source>
|
||||||
|
<translation></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="483"/>
|
||||||
|
<source>Used by {0} items</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
|||||||
+85
-59
@@ -1,74 +1,75 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE TS><TS version="2.0" language="nb_NO" sourcelanguage="en_GB">
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="nb_NO" sourcelanguage="en_GB">
|
||||||
<context>
|
<context>
|
||||||
<name>Common</name>
|
<name>Common</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="274"/>
|
<location filename="../nw/common.py" line="244"/>
|
||||||
<source>just now</source>
|
<source>just now</source>
|
||||||
<translation>nå nettopp</translation>
|
<translation>nå nettopp</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="278"/>
|
<location filename="../nw/common.py" line="248"/>
|
||||||
<source>a minute ago</source>
|
<source>a minute ago</source>
|
||||||
<translation>for et minutt siden</translation>
|
<translation>for et minutt siden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="286"/>
|
<location filename="../nw/common.py" line="256"/>
|
||||||
<source>an hour ago</source>
|
<source>an hour ago</source>
|
||||||
<translation>for en time siden</translation>
|
<translation>for en time siden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="294"/>
|
<location filename="../nw/common.py" line="264"/>
|
||||||
<source>a day ago</source>
|
<source>a day ago</source>
|
||||||
<translation>for en dag siden</translation>
|
<translation>for en dag siden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="302"/>
|
<location filename="../nw/common.py" line="272"/>
|
||||||
<source>a week ago</source>
|
<source>a week ago</source>
|
||||||
<translation>for en uke siden</translation>
|
<translation>for en uke siden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="310"/>
|
<location filename="../nw/common.py" line="280"/>
|
||||||
<source>a month ago</source>
|
<source>a month ago</source>
|
||||||
<translation>for en måned siden</translation>
|
<translation>for en måned siden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="318"/>
|
<location filename="../nw/common.py" line="288"/>
|
||||||
<source>a year ago</source>
|
<source>a year ago</source>
|
||||||
<translation>for et år siden</translation>
|
<translation>for et år siden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="282"/>
|
<location filename="../nw/common.py" line="252"/>
|
||||||
<source>{0} minutes ago</source>
|
<source>{0} minutes ago</source>
|
||||||
<translation>for {0} minutter siden</translation>
|
<translation>for {0} minutter siden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="290"/>
|
<location filename="../nw/common.py" line="260"/>
|
||||||
<source>{0} hours ago</source>
|
<source>{0} hours ago</source>
|
||||||
<translation>for {0} timer siden</translation>
|
<translation>for {0} timer siden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="298"/>
|
<location filename="../nw/common.py" line="268"/>
|
||||||
<source>{0} days ago</source>
|
<source>{0} days ago</source>
|
||||||
<translation>for {0} dager siden</translation>
|
<translation>for {0} dager siden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="306"/>
|
<location filename="../nw/common.py" line="276"/>
|
||||||
<source>{0} weeks ago</source>
|
<source>{0} weeks ago</source>
|
||||||
<translation>for {0} uker siden</translation>
|
<translation>for {0} uker siden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="314"/>
|
<location filename="../nw/common.py" line="284"/>
|
||||||
<source>{0} months ago</source>
|
<source>{0} months ago</source>
|
||||||
<translation>for {0} måneder siden</translation>
|
<translation>for {0} måneder siden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="322"/>
|
<location filename="../nw/common.py" line="292"/>
|
||||||
<source>{0} years ago</source>
|
<source>{0} years ago</source>
|
||||||
<translation>for {0} år siden</translation>
|
<translation>for {0} år siden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/common.py" line="270"/>
|
<location filename="../nw/common.py" line="240"/>
|
||||||
<source>in the future</source>
|
<source>in the future</source>
|
||||||
<translation>i fremtiden</translation>
|
<translation>i fremtiden</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -3537,57 +3538,57 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>GuiProjectEditMain</name>
|
<name>GuiProjectEditMain</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="169"/>
|
<location filename="../nw/gui/projsettings.py" line="173"/>
|
||||||
<source>Project Settings</source>
|
<source>Project Settings</source>
|
||||||
<translation>Prosjektinnstillinger</translation>
|
<translation>Prosjektinnstillinger</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="178"/>
|
<location filename="../nw/gui/projsettings.py" line="182"/>
|
||||||
<source>Working title</source>
|
<source>Working title</source>
|
||||||
<translation>Arbeidstittel</translation>
|
<translation>Arbeidstittel</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="178"/>
|
<location filename="../nw/gui/projsettings.py" line="182"/>
|
||||||
<source>Should be set only once.</source>
|
<source>Should be set only once.</source>
|
||||||
<translation>Bør bare settes én gang.</translation>
|
<translation>Bør bare settes én gang.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="188"/>
|
<location filename="../nw/gui/projsettings.py" line="192"/>
|
||||||
<source>Novel title</source>
|
<source>Novel title</source>
|
||||||
<translation>Bokens tittel</translation>
|
<translation>Bokens tittel</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="188"/>
|
<location filename="../nw/gui/projsettings.py" line="192"/>
|
||||||
<source>Change whenever you want!</source>
|
<source>Change whenever you want!</source>
|
||||||
<translation>Kan endres når som helst!</translation>
|
<translation>Kan endres når som helst!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="198"/>
|
<location filename="../nw/gui/projsettings.py" line="202"/>
|
||||||
<source>Author(s)</source>
|
<source>Author(s)</source>
|
||||||
<translation>Forfatter(e)</translation>
|
<translation>Forfatter(e)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="198"/>
|
<location filename="../nw/gui/projsettings.py" line="202"/>
|
||||||
<source>One name per line.</source>
|
<source>One name per line.</source>
|
||||||
<translation>Ett navn per linje.</translation>
|
<translation>Ett navn per linje.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="207"/>
|
<location filename="../nw/gui/projsettings.py" line="211"/>
|
||||||
<source>Default</source>
|
<source>Default</source>
|
||||||
<translation>Ingen valg</translation>
|
<translation>Ingen valg</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="214"/>
|
<location filename="../nw/gui/projsettings.py" line="218"/>
|
||||||
<source>Spell check language</source>
|
<source>Spell check language</source>
|
||||||
<translation>Språk for stavekontroll</translation>
|
<translation>Språk for stavekontroll</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="228"/>
|
<location filename="../nw/gui/projsettings.py" line="232"/>
|
||||||
<source>Overrides main preferences.</source>
|
<source>Overrides main preferences.</source>
|
||||||
<translation>Overstyrer valg i innstillinger.</translation>
|
<translation>Overstyrer valg i innstillinger.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="228"/>
|
<location filename="../nw/gui/projsettings.py" line="232"/>
|
||||||
<source>No backup on close</source>
|
<source>No backup on close</source>
|
||||||
<translation>Slå av sikkerhetskopi</translation>
|
<translation>Slå av sikkerhetskopi</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -3595,92 +3596,117 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>GuiProjectEditReplace</name>
|
<name>GuiProjectEditReplace</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="455"/>
|
<location filename="../nw/gui/projsettings.py" line="508"/>
|
||||||
<source>Keyword</source>
|
<source>Keyword</source>
|
||||||
<translation>Kodeord</translation>
|
<translation>Kodeord</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="455"/>
|
<location filename="../nw/gui/projsettings.py" line="508"/>
|
||||||
<source>Replace With</source>
|
<source>Replace With</source>
|
||||||
<translation>Erstatt med</translation>
|
<translation>Erstatt med</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="475"/>
|
<location filename="../nw/gui/projsettings.py" line="547"/>
|
||||||
<source>Save entry</source>
|
<source>Save entry</source>
|
||||||
<translation>Lagre tekst</translation>
|
<translation>Lagre tekst</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="476"/>
|
<location filename="../nw/gui/projsettings.py" line="527"/>
|
||||||
<source>Add new entry</source>
|
<source>Add new entry</source>
|
||||||
<translation>Legg til ny</translation>
|
<translation>Legg til ny</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="477"/>
|
<location filename="../nw/gui/projsettings.py" line="531"/>
|
||||||
<source>Delete selected entry</source>
|
<source>Delete selected entry</source>
|
||||||
<translation>Slett valgte element</translation>
|
<translation>Slett valgte element</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="494"/>
|
<location filename="../nw/gui/projsettings.py" line="502"/>
|
||||||
<source>Text Replace List for Preview and Export</source>
|
<source>Text Replace List for Preview and Export</source>
|
||||||
<translation>Erstatningsliste for forhåndsvisning og eksport</translation>
|
<translation>Erstatningsliste for forhåndsvisning og eksport</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="538"/>
|
||||||
|
<source>Select item to edit</source>
|
||||||
|
<translation>Velg enhet å redigere</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>GuiProjectEditStatus</name>
|
<name>GuiProjectEditStatus</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="274"/>
|
<location filename="../nw/gui/projsettings.py" line="313"/>
|
||||||
<source>New</source>
|
|
||||||
<translation>Ny</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../nw/gui/projsettings.py" line="275"/>
|
|
||||||
<source>Delete</source>
|
|
||||||
<translation>Slett</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../nw/gui/projsettings.py" line="276"/>
|
|
||||||
<source>Save</source>
|
<source>Save</source>
|
||||||
<translation>Lagre</translation>
|
<translation>Lagre</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="279"/>
|
<location filename="../nw/gui/projsettings.py" line="309"/>
|
||||||
<source>Colour</source>
|
<source>Colour</source>
|
||||||
<translation>Farge</translation>
|
<translation>Farge</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="290"/>
|
<location filename="../nw/gui/projsettings.py" line="255"/>
|
||||||
<source>Name</source>
|
|
||||||
<translation>Navn</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../nw/gui/projsettings.py" line="300"/>
|
|
||||||
<source>Novel File Status Levels</source>
|
<source>Novel File Status Levels</source>
|
||||||
<translation>Statusnivåer i roman-filer</translation>
|
<translation>Statusnivåer i roman-filer</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="302"/>
|
<location filename="../nw/gui/projsettings.py" line="259"/>
|
||||||
<source>Note File Importance Levels</source>
|
<source>Note File Importance Levels</source>
|
||||||
<translation>Viktighetsnivåer i notatfiler</translation>
|
<translation>Viktighetsnivåer i notatfiler</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="327"/>
|
<location filename="../nw/gui/projsettings.py" line="366"/>
|
||||||
<source>Select Colour</source>
|
<source>Select Colour</source>
|
||||||
<translation>Velg farge</translation>
|
<translation>Velg farge</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="341"/>
|
<location filename="../nw/gui/projsettings.py" line="380"/>
|
||||||
<source>New Item</source>
|
<source>New Item</source>
|
||||||
<translation>Legg til</translation>
|
<translation>Legg til</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="357"/>
|
<location filename="../nw/gui/projsettings.py" line="277"/>
|
||||||
<source>Cannot delete status item that is in use.</source>
|
<source>Label</source>
|
||||||
<translation>Kan ikke slette statusnivåer som er i bruk.</translation>
|
<translation>Navn</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../nw/gui/projsettings.py" line="389"/>
|
<location filename="../nw/gui/projsettings.py" line="277"/>
|
||||||
<source>{0} [{1}]</source>
|
<source>Usage</source>
|
||||||
<translation></translation>
|
<translation>Bruk</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="292"/>
|
||||||
|
<source>Add new entry</source>
|
||||||
|
<translation>Legg til ny</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="296"/>
|
||||||
|
<source>Delete selected entry</source>
|
||||||
|
<translation>Slett valgte element</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="305"/>
|
||||||
|
<source>Select item to edit</source>
|
||||||
|
<translation>Velg enhet å redigere</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="397"/>
|
||||||
|
<source>Cannot delete a status item that is in use.</source>
|
||||||
|
<translation>Kan ikke slette status som er i bruk.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="479"/>
|
||||||
|
<source>Not in use</source>
|
||||||
|
<translation>Ikke i bruk</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="481"/>
|
||||||
|
<source>Used once</source>
|
||||||
|
<translation>Brukt ett sted</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../nw/gui/projsettings.py" line="483"/>
|
||||||
|
<source>Used by {0} items</source>
|
||||||
|
<translation>Brukt {0} steder</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
|
|||||||
@@ -150,36 +150,6 @@ def hexToInt(value, default=0):
|
|||||||
return default
|
return default
|
||||||
return default
|
return default
|
||||||
|
|
||||||
def colRange(rgbStart, rgbEnd, nStep):
|
|
||||||
"""Generate a range of colours from one RGB value to another.
|
|
||||||
"""
|
|
||||||
if len(rgbStart) != 3 and len(rgbEnd) != 3 and nStep < 1:
|
|
||||||
logger.error("Cannot create colour range from given parameters")
|
|
||||||
return None
|
|
||||||
|
|
||||||
if nStep == 1:
|
|
||||||
return rgbStart
|
|
||||||
elif nStep == 2:
|
|
||||||
return [rgbStart, rgbEnd]
|
|
||||||
|
|
||||||
dC = [0, 0, 0]
|
|
||||||
for c in range(3):
|
|
||||||
cA = rgbStart[c]
|
|
||||||
cB = rgbEnd[c]
|
|
||||||
dC[c] = (cB-cA)/(nStep-1)
|
|
||||||
|
|
||||||
retCol = [rgbStart]
|
|
||||||
for n in range(nStep):
|
|
||||||
if n > 0 and n < nStep:
|
|
||||||
retCol.append([
|
|
||||||
int(retCol[n-1][0] + dC[0]),
|
|
||||||
int(retCol[n-1][1] + dC[1]),
|
|
||||||
int(retCol[n-1][2] + dC[2]),
|
|
||||||
])
|
|
||||||
retCol[-1] = rgbEnd
|
|
||||||
|
|
||||||
return retCol
|
|
||||||
|
|
||||||
def formatInt(theInt):
|
def formatInt(theInt):
|
||||||
"""Formats an integer with k, M, G etc.
|
"""Formats an integer with k, M, G etc.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ class OptionState():
|
|||||||
"winWidth",
|
"winWidth",
|
||||||
"winHeight",
|
"winHeight",
|
||||||
"replaceColW",
|
"replaceColW",
|
||||||
|
"statusColW",
|
||||||
|
"importColW",
|
||||||
},
|
},
|
||||||
"GuiProjectDetails": {
|
"GuiProjectDetails": {
|
||||||
"winWidth",
|
"winWidth",
|
||||||
|
|||||||
+166
-83
@@ -31,8 +31,8 @@ from PyQt5.QtCore import Qt, QLocale
|
|||||||
from PyQt5.QtGui import QIcon, QPixmap, QColor, QBrush
|
from PyQt5.QtGui import QIcon, QPixmap, QColor, QBrush
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QHBoxLayout, QVBoxLayout, QLineEdit, QPlainTextEdit, QLabel, QWidget,
|
QHBoxLayout, QVBoxLayout, QLineEdit, QPlainTextEdit, QLabel, QWidget,
|
||||||
QDialogButtonBox, QListWidget, QPushButton, QListWidgetItem, QColorDialog,
|
QDialogButtonBox, QPushButton, QColorDialog, QTreeWidget, QTreeWidgetItem,
|
||||||
QAbstractItemView, QTreeWidget, QTreeWidgetItem, QComboBox
|
QComboBox
|
||||||
)
|
)
|
||||||
|
|
||||||
from nw.constants import nwAlert
|
from nw.constants import nwAlert
|
||||||
@@ -143,10 +143,14 @@ class GuiProjectSettings(PagedDialog):
|
|||||||
winWidth = self.mainConf.rpxInt(self.width())
|
winWidth = self.mainConf.rpxInt(self.width())
|
||||||
winHeight = self.mainConf.rpxInt(self.height())
|
winHeight = self.mainConf.rpxInt(self.height())
|
||||||
replaceColW = self.mainConf.rpxInt(self.tabReplace.listBox.columnWidth(0))
|
replaceColW = self.mainConf.rpxInt(self.tabReplace.listBox.columnWidth(0))
|
||||||
|
statusColW = self.mainConf.rpxInt(self.tabStatus.listBox.columnWidth(0))
|
||||||
|
importColW = self.mainConf.rpxInt(self.tabImport.listBox.columnWidth(0))
|
||||||
|
|
||||||
self.optState.setValue("GuiProjectSettings", "winWidth", winWidth)
|
self.optState.setValue("GuiProjectSettings", "winWidth", winWidth)
|
||||||
self.optState.setValue("GuiProjectSettings", "winHeight", winHeight)
|
self.optState.setValue("GuiProjectSettings", "winHeight", winHeight)
|
||||||
self.optState.setValue("GuiProjectSettings", "replaceColW", replaceColW)
|
self.optState.setValue("GuiProjectSettings", "replaceColW", replaceColW)
|
||||||
|
self.optState.setValue("GuiProjectSettings", "statusColW", statusColW)
|
||||||
|
self.optState.setValue("GuiProjectSettings", "importColW", importColW)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -169,7 +173,7 @@ class GuiProjectEditMain(QWidget):
|
|||||||
self.mainForm.addGroupLabel(self.tr("Project Settings"))
|
self.mainForm.addGroupLabel(self.tr("Project Settings"))
|
||||||
|
|
||||||
xW = self.mainConf.pxInt(250)
|
xW = self.mainConf.pxInt(250)
|
||||||
xH = self.mainConf.pxInt(80)
|
xH = round(4.8*self.theParent.theTheme.fontPixelSize)
|
||||||
|
|
||||||
self.editName = QLineEdit()
|
self.editName = QLineEdit()
|
||||||
self.editName.setMaxLength(200)
|
self.editName.setMaxLength(200)
|
||||||
@@ -192,7 +196,7 @@ class GuiProjectEditMain(QWidget):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.editAuthors = QPlainTextEdit()
|
self.editAuthors = QPlainTextEdit()
|
||||||
self.editAuthors.setMinimumHeight(xH)
|
self.editAuthors.setMaximumHeight(xH)
|
||||||
self.editAuthors.setMaximumWidth(xW)
|
self.editAuthors.setMaximumWidth(xW)
|
||||||
self.editAuthors.setPlainText("\n".join(self.theProject.bookAuthors))
|
self.editAuthors.setPlainText("\n".join(self.theProject.bookAuthors))
|
||||||
self.mainForm.addRow(
|
self.mainForm.addRow(
|
||||||
@@ -237,17 +241,30 @@ class GuiProjectEditMain(QWidget):
|
|||||||
|
|
||||||
class GuiProjectEditStatus(QWidget):
|
class GuiProjectEditStatus(QWidget):
|
||||||
|
|
||||||
|
COL_LABEL = 0
|
||||||
|
COL_USAGE = 1
|
||||||
|
|
||||||
def __init__(self, theParent, theProject, isStatus):
|
def __init__(self, theParent, theProject, isStatus):
|
||||||
QWidget.__init__(self, theParent)
|
QWidget.__init__(self, theParent)
|
||||||
|
|
||||||
self.mainConf = nw.CONFIG
|
self.mainConf = nw.CONFIG
|
||||||
self.theParent = theParent
|
self.theParent = theParent
|
||||||
self.theProject = theProject
|
self.theProject = theProject
|
||||||
|
self.optState = theProject.optState
|
||||||
self.theTheme = theParent.theTheme
|
self.theTheme = theParent.theTheme
|
||||||
|
|
||||||
if isStatus:
|
if isStatus:
|
||||||
self.theStatus = self.theProject.statusItems
|
self.theStatus = self.theProject.statusItems
|
||||||
|
pageLabel = self.tr("Novel File Status Levels")
|
||||||
|
colSetting = "statusColW"
|
||||||
else:
|
else:
|
||||||
self.theStatus = self.theProject.importItems
|
self.theStatus = self.theProject.importItems
|
||||||
|
pageLabel = self.tr("Note File Importance Levels")
|
||||||
|
colSetting = "importColW"
|
||||||
|
|
||||||
|
wCol0 = self.mainConf.pxInt(
|
||||||
|
self.optState.getInt("GuiProjectSettings", colSetting, 130)
|
||||||
|
)
|
||||||
|
|
||||||
self.colData = []
|
self.colData = []
|
||||||
self.colCounts = []
|
self.colCounts = []
|
||||||
@@ -256,64 +273,89 @@ class GuiProjectEditStatus(QWidget):
|
|||||||
|
|
||||||
self.iPx = self.theTheme.baseIconSize
|
self.iPx = self.theTheme.baseIconSize
|
||||||
|
|
||||||
self.outerBox = QVBoxLayout()
|
# The List
|
||||||
self.mainBox = QHBoxLayout()
|
# ========
|
||||||
self.mainForm = QVBoxLayout()
|
|
||||||
|
|
||||||
self.listBox = QListWidget()
|
self.listBox = QTreeWidget()
|
||||||
self.listBox.setDragDropMode(QAbstractItemView.InternalMove)
|
self.listBox.setHeaderLabels([
|
||||||
|
self.tr("Label"),
|
||||||
|
self.tr("Usage"),
|
||||||
|
])
|
||||||
self.listBox.itemSelectionChanged.connect(self._selectedItem)
|
self.listBox.itemSelectionChanged.connect(self._selectedItem)
|
||||||
self.listBox.model().rowsMoved.connect(self._rowsMoved)
|
self.listBox.setColumnWidth(self.COL_LABEL, wCol0)
|
||||||
|
self.listBox.setIndentation(0)
|
||||||
|
|
||||||
for iName, iCol, nUse in self.theStatus:
|
for iName, iCol, nUse in self.theStatus:
|
||||||
self._addItem(iName, iCol, iName, nUse)
|
self._addItem(iName, iCol, iName, nUse)
|
||||||
|
|
||||||
|
# List Controls
|
||||||
|
# =============
|
||||||
|
|
||||||
|
self.addButton = QPushButton(self.theTheme.getIcon("add"), "")
|
||||||
|
self.addButton.setToolTip(self.tr("Add new entry"))
|
||||||
|
self.addButton.clicked.connect(self._newItem)
|
||||||
|
|
||||||
|
self.delButton = QPushButton(self.theTheme.getIcon("remove"), "")
|
||||||
|
self.delButton.setToolTip(self.tr("Delete selected entry"))
|
||||||
|
self.delButton.clicked.connect(self._delItem)
|
||||||
|
|
||||||
|
# Edit Form
|
||||||
|
# =========
|
||||||
|
|
||||||
self.editName = QLineEdit()
|
self.editName = QLineEdit()
|
||||||
self.editName.setMaxLength(40)
|
self.editName.setMaxLength(40)
|
||||||
self.editName.setEnabled(False)
|
self.editName.setEnabled(False)
|
||||||
self.newButton = QPushButton(self.tr("New"))
|
self.editName.setPlaceholderText(self.tr("Select item to edit"))
|
||||||
self.delButton = QPushButton(self.tr("Delete"))
|
|
||||||
self.saveButton = QPushButton(self.tr("Save"))
|
|
||||||
self.colPixmap = QPixmap(self.iPx, self.iPx)
|
|
||||||
self.colPixmap.fill(QColor(120, 120, 120))
|
|
||||||
self.colButton = QPushButton(QIcon(self.colPixmap), self.tr("Colour"))
|
|
||||||
self.colButton.setIconSize(self.colPixmap.rect().size())
|
|
||||||
|
|
||||||
self.newButton.clicked.connect(self._newItem)
|
self.colPixmap = QPixmap(self.iPx, self.iPx)
|
||||||
self.delButton.clicked.connect(self._delItem)
|
self.colPixmap.fill(QColor(120, 120, 120))
|
||||||
self.saveButton.clicked.connect(self._saveItem)
|
self.colButton = QPushButton(QIcon(self.colPixmap), self.tr("Colour"))
|
||||||
|
self.colButton.setIconSize(self.colPixmap.rect().size())
|
||||||
self.colButton.clicked.connect(self._selectColour)
|
self.colButton.clicked.connect(self._selectColour)
|
||||||
|
|
||||||
self.mainForm.addWidget(self.newButton)
|
self.saveButton = QPushButton(self.tr("Save"))
|
||||||
self.mainForm.addWidget(self.delButton)
|
self.saveButton.clicked.connect(self._saveItem)
|
||||||
self.mainForm.addStretch(1)
|
|
||||||
self.mainForm.addWidget(QLabel("<b>%s</b>" % self.tr("Name")))
|
|
||||||
self.mainForm.addWidget(self.editName)
|
|
||||||
self.mainForm.addWidget(self.colButton)
|
|
||||||
self.mainForm.addStretch(1)
|
|
||||||
self.mainForm.addWidget(self.saveButton)
|
|
||||||
|
|
||||||
|
# Assemble
|
||||||
|
# ========
|
||||||
|
|
||||||
|
self.listControls = QVBoxLayout()
|
||||||
|
self.listControls.addWidget(self.addButton)
|
||||||
|
self.listControls.addWidget(self.delButton)
|
||||||
|
self.listControls.addStretch(1)
|
||||||
|
|
||||||
|
self.editBox = QHBoxLayout()
|
||||||
|
self.editBox.addWidget(self.editName)
|
||||||
|
self.editBox.addWidget(self.colButton)
|
||||||
|
self.editBox.addWidget(self.saveButton)
|
||||||
|
|
||||||
|
self.mainBox = QVBoxLayout()
|
||||||
self.mainBox.addWidget(self.listBox)
|
self.mainBox.addWidget(self.listBox)
|
||||||
self.mainBox.addLayout(self.mainForm)
|
self.mainBox.addLayout(self.editBox)
|
||||||
|
|
||||||
if isStatus:
|
self.innerBox = QHBoxLayout()
|
||||||
self.outerBox.addWidget(QLabel("<b>%s</b>" % self.tr("Novel File Status Levels")))
|
self.innerBox.addLayout(self.mainBox)
|
||||||
else:
|
self.innerBox.addLayout(self.listControls)
|
||||||
self.outerBox.addWidget(QLabel("<b>%s</b>" % self.tr("Note File Importance Levels")))
|
|
||||||
self.outerBox.addLayout(self.mainBox)
|
self.outerBox = QVBoxLayout()
|
||||||
|
self.outerBox.addWidget(QLabel("<b>%s</b>" % pageLabel))
|
||||||
|
self.outerBox.addLayout(self.innerBox)
|
||||||
|
|
||||||
self.setLayout(self.outerBox)
|
self.setLayout(self.outerBox)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def getNewList(self):
|
def getNewList(self):
|
||||||
|
"""Return list of entries.
|
||||||
|
"""
|
||||||
if self.colChanged:
|
if self.colChanged:
|
||||||
newList = []
|
newList = []
|
||||||
for n in range(self.listBox.count()):
|
for n in range(self.listBox.topLevelItemCount()):
|
||||||
nItem = self.listBox.item(n)
|
nItem = self.listBox.topLevelItem(n)
|
||||||
nIdx = nItem.data(Qt.UserRole)
|
nIdx = nItem.data(self.COL_LABEL, Qt.UserRole)
|
||||||
newList.append(self.colData[nIdx])
|
newList.append(self.colData[nIdx])
|
||||||
return newList
|
return newList
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
##
|
##
|
||||||
@@ -339,7 +381,8 @@ class GuiProjectEditStatus(QWidget):
|
|||||||
"""Create a new status item.
|
"""Create a new status item.
|
||||||
"""
|
"""
|
||||||
newItem = self._addItem(self.tr("New Item"), (0, 0, 0), None, 0)
|
newItem = self._addItem(self.tr("New Item"), (0, 0, 0), None, 0)
|
||||||
newItem.setBackground(QBrush(QColor(0, 255, 0, 80)))
|
newItem.setBackground(self.COL_LABEL, QBrush(QColor(0, 255, 0, 70)))
|
||||||
|
newItem.setBackground(self.COL_USAGE, QBrush(QColor(0, 255, 0, 70)))
|
||||||
self.colChanged = True
|
self.colChanged = True
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -348,14 +391,14 @@ class GuiProjectEditStatus(QWidget):
|
|||||||
"""
|
"""
|
||||||
selItem = self._getSelectedItem()
|
selItem = self._getSelectedItem()
|
||||||
if selItem is not None:
|
if selItem is not None:
|
||||||
iRow = self.listBox.row(selItem)
|
iRow = self.listBox.indexOfTopLevelItem(selItem)
|
||||||
selIdx = selItem.data(Qt.UserRole)
|
selIdx = selItem.data(self.COL_LABEL, Qt.UserRole)
|
||||||
if self.colCounts[selIdx] == 0:
|
if self.colCounts[selIdx] == 0:
|
||||||
self.listBox.takeItem(iRow)
|
self.listBox.takeTopLevelItem(iRow)
|
||||||
self.colChanged = True
|
self.colChanged = True
|
||||||
else:
|
else:
|
||||||
self.theParent.makeAlert(
|
self.theParent.makeAlert(
|
||||||
self.tr("Cannot delete status item that is in use."), nwAlert.ERROR
|
self.tr("Cannot delete a status item that is in use."), nwAlert.ERROR
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -364,7 +407,7 @@ class GuiProjectEditStatus(QWidget):
|
|||||||
"""
|
"""
|
||||||
selItem = self._getSelectedItem()
|
selItem = self._getSelectedItem()
|
||||||
if selItem is not None:
|
if selItem is not None:
|
||||||
selIdx = selItem.data(Qt.UserRole)
|
selIdx = selItem.data(self.COL_LABEL, Qt.UserRole)
|
||||||
self.colData[selIdx] = (
|
self.colData[selIdx] = (
|
||||||
self.editName.text().strip(),
|
self.editName.text().strip(),
|
||||||
self.selColour.red(),
|
self.selColour.red(),
|
||||||
@@ -372,12 +415,12 @@ class GuiProjectEditStatus(QWidget):
|
|||||||
self.selColour.blue(),
|
self.selColour.blue(),
|
||||||
self.colData[selIdx][4]
|
self.colData[selIdx][4]
|
||||||
)
|
)
|
||||||
selItem.setText(self.tr("{0} [{1}]").format(
|
selItem.setText(self.COL_LABEL, self.colData[selIdx][0])
|
||||||
self.colData[selIdx][0], self.colCounts[selIdx])
|
selItem.setText(self.COL_USAGE, self._usageString(self.colCounts[selIdx]))
|
||||||
)
|
selItem.setIcon(self.COL_LABEL, self.colButton.icon())
|
||||||
selItem.setIcon(self.colButton.icon())
|
|
||||||
self.editName.setEnabled(False)
|
self.editName.setEnabled(False)
|
||||||
self.colChanged = True
|
self.colChanged = True
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def _addItem(self, iName, iCol, oName, nUse):
|
def _addItem(self, iName, iCol, oName, nUse):
|
||||||
@@ -385,11 +428,12 @@ class GuiProjectEditStatus(QWidget):
|
|||||||
"""
|
"""
|
||||||
newIcon = QPixmap(self.iPx, self.iPx)
|
newIcon = QPixmap(self.iPx, self.iPx)
|
||||||
newIcon.fill(QColor(*iCol))
|
newIcon.fill(QColor(*iCol))
|
||||||
newItem = QListWidgetItem()
|
newItem = QTreeWidgetItem()
|
||||||
newItem.setText(self.tr("{0} [{1}]").format(iName, nUse))
|
newItem.setText(self.COL_LABEL, iName)
|
||||||
newItem.setIcon(QIcon(newIcon))
|
newItem.setText(self.COL_USAGE, self._usageString(nUse))
|
||||||
newItem.setData(Qt.UserRole, len(self.colData))
|
newItem.setIcon(self.COL_LABEL, QIcon(newIcon))
|
||||||
self.listBox.addItem(newItem)
|
newItem.setData(self.COL_LABEL, Qt.UserRole, len(self.colData))
|
||||||
|
self.listBox.addTopLevelItem(newItem)
|
||||||
self.colData.append((iName, iCol[0], iCol[1], iCol[2], oName))
|
self.colData.append((iName, iCol[0], iCol[1], iCol[2], oName))
|
||||||
self.colCounts.append(nUse)
|
self.colCounts.append(nUse)
|
||||||
return newItem
|
return newItem
|
||||||
@@ -400,7 +444,7 @@ class GuiProjectEditStatus(QWidget):
|
|||||||
"""
|
"""
|
||||||
selItem = self._getSelectedItem()
|
selItem = self._getSelectedItem()
|
||||||
if selItem is not None:
|
if selItem is not None:
|
||||||
selIdx = selItem.data(Qt.UserRole)
|
selIdx = selItem.data(self.COL_LABEL, Qt.UserRole)
|
||||||
selVal = self.colData[selIdx]
|
selVal = self.colData[selIdx]
|
||||||
self.selColour = QColor(selVal[1], selVal[2], selVal[3])
|
self.selColour = QColor(selVal[1], selVal[2], selVal[3])
|
||||||
newIcon = QPixmap(self.iPx, self.iPx)
|
newIcon = QPixmap(self.iPx, self.iPx)
|
||||||
@@ -410,6 +454,7 @@ class GuiProjectEditStatus(QWidget):
|
|||||||
self.editName.setEnabled(True)
|
self.editName.setEnabled(True)
|
||||||
self.editName.selectAll()
|
self.editName.selectAll()
|
||||||
self.editName.setFocus()
|
self.editName.setFocus()
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
##
|
##
|
||||||
@@ -425,16 +470,28 @@ class GuiProjectEditStatus(QWidget):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def _rowsMoved(self):
|
def _rowsMoved(self):
|
||||||
"""A row has been moved, so sett the changed flag.
|
"""A row has been moved, so set the changed flag.
|
||||||
"""
|
"""
|
||||||
logger.verbose("A drag move event occurred")
|
|
||||||
self.colChanged = True
|
self.colChanged = True
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def _usageString(self, nUse):
|
||||||
|
"""Generate usage string.
|
||||||
|
"""
|
||||||
|
if nUse == 0:
|
||||||
|
return self.tr("Not in use")
|
||||||
|
elif nUse == 1:
|
||||||
|
return self.tr("Used once")
|
||||||
|
else:
|
||||||
|
return self.tr("Used by {0} items").format(nUse)
|
||||||
|
|
||||||
# END Class GuiProjectEditStatus
|
# END Class GuiProjectEditStatus
|
||||||
|
|
||||||
class GuiProjectEditReplace(QWidget):
|
class GuiProjectEditReplace(QWidget):
|
||||||
|
|
||||||
|
COL_KEY = 0
|
||||||
|
COL_REPL = 1
|
||||||
|
|
||||||
def __init__(self, theParent, theProject):
|
def __init__(self, theParent, theProject):
|
||||||
QWidget.__init__(self, theParent)
|
QWidget.__init__(self, theParent)
|
||||||
|
|
||||||
@@ -445,57 +502,82 @@ class GuiProjectEditReplace(QWidget):
|
|||||||
self.optState = theProject.optState
|
self.optState = theProject.optState
|
||||||
self.arChanged = False
|
self.arChanged = False
|
||||||
|
|
||||||
self.outerBox = QVBoxLayout()
|
|
||||||
self.bottomBox = QHBoxLayout()
|
|
||||||
|
|
||||||
wCol0 = self.mainConf.pxInt(
|
wCol0 = self.mainConf.pxInt(
|
||||||
self.optState.getInt("GuiProjectSettings", "replaceColW", 100)
|
self.optState.getInt("GuiProjectSettings", "replaceColW", 130)
|
||||||
)
|
)
|
||||||
|
pageLabel = self.tr("Text Replace List for Preview and Export")
|
||||||
|
|
||||||
|
# List Box
|
||||||
|
# ========
|
||||||
|
|
||||||
self.listBox = QTreeWidget()
|
self.listBox = QTreeWidget()
|
||||||
self.listBox.setHeaderLabels([
|
self.listBox.setHeaderLabels([
|
||||||
self.tr("Keyword"),
|
self.tr("Keyword"),
|
||||||
self.tr("Replace With"),
|
self.tr("Replace With"),
|
||||||
])
|
])
|
||||||
self.listBox.itemSelectionChanged.connect(self._selectedItem)
|
self.listBox.itemSelectionChanged.connect(self._selectedItem)
|
||||||
self.listBox.setColumnWidth(0, wCol0)
|
self.listBox.setColumnWidth(self.COL_KEY, wCol0)
|
||||||
self.listBox.setIndentation(0)
|
self.listBox.setIndentation(0)
|
||||||
|
|
||||||
for aKey, aVal in self.theProject.autoReplace.items():
|
for aKey, aVal in self.theProject.autoReplace.items():
|
||||||
newItem = QTreeWidgetItem(["<%s>" % aKey, aVal])
|
newItem = QTreeWidgetItem(["<%s>" % aKey, aVal])
|
||||||
self.listBox.addTopLevelItem(newItem)
|
self.listBox.addTopLevelItem(newItem)
|
||||||
|
|
||||||
self.listBox.sortByColumn(0, Qt.AscendingOrder)
|
self.listBox.sortByColumn(self.COL_KEY, Qt.AscendingOrder)
|
||||||
self.listBox.setSortingEnabled(True)
|
self.listBox.setSortingEnabled(True)
|
||||||
|
|
||||||
self.editKey = QLineEdit()
|
# List Controls
|
||||||
self.editValue = QLineEdit()
|
# =============
|
||||||
self.saveButton = QPushButton(self.theTheme.getIcon("done"), "")
|
|
||||||
self.addButton = QPushButton(self.theTheme.getIcon("add"), "")
|
|
||||||
self.delButton = QPushButton(self.theTheme.getIcon("remove"), "")
|
|
||||||
self.saveButton.setToolTip(self.tr("Save entry"))
|
|
||||||
self.addButton.setToolTip(self.tr("Add new entry"))
|
|
||||||
self.delButton.setToolTip(self.tr("Delete selected entry"))
|
|
||||||
|
|
||||||
|
self.addButton = QPushButton(self.theTheme.getIcon("add"), "")
|
||||||
|
self.addButton.setToolTip(self.tr("Add new entry"))
|
||||||
|
self.addButton.clicked.connect(self._addEntry)
|
||||||
|
|
||||||
|
self.delButton = QPushButton(self.theTheme.getIcon("remove"), "")
|
||||||
|
self.delButton.setToolTip(self.tr("Delete selected entry"))
|
||||||
|
self.delButton.clicked.connect(self._delEntry)
|
||||||
|
|
||||||
|
# Edit Form
|
||||||
|
# =========
|
||||||
|
|
||||||
|
self.editKey = QLineEdit()
|
||||||
|
self.editKey.setPlaceholderText(self.tr("Select item to edit"))
|
||||||
self.editKey.setEnabled(False)
|
self.editKey.setEnabled(False)
|
||||||
self.editKey.setMaxLength(40)
|
self.editKey.setMaxLength(40)
|
||||||
|
|
||||||
|
self.editValue = QLineEdit()
|
||||||
self.editValue.setEnabled(False)
|
self.editValue.setEnabled(False)
|
||||||
self.editValue.setMaxLength(80)
|
self.editValue.setMaxLength(80)
|
||||||
|
|
||||||
|
self.saveButton = QPushButton("Save")
|
||||||
|
self.saveButton.setToolTip(self.tr("Save entry"))
|
||||||
self.saveButton.clicked.connect(self._saveEntry)
|
self.saveButton.clicked.connect(self._saveEntry)
|
||||||
self.addButton.clicked.connect(self._addEntry)
|
|
||||||
self.delButton.clicked.connect(self._delEntry)
|
|
||||||
|
|
||||||
self.bottomBox.addWidget(self.editKey, 2)
|
# Assemble
|
||||||
self.bottomBox.addWidget(self.editValue, 3)
|
# ========
|
||||||
self.bottomBox.addWidget(self.saveButton)
|
|
||||||
self.bottomBox.addWidget(self.addButton)
|
self.listControls = QVBoxLayout()
|
||||||
self.bottomBox.addWidget(self.delButton)
|
self.listControls.addWidget(self.addButton)
|
||||||
|
self.listControls.addWidget(self.delButton)
|
||||||
|
self.listControls.addStretch(1)
|
||||||
|
|
||||||
|
self.editBox = QHBoxLayout()
|
||||||
|
self.editBox.addWidget(self.editKey, 4)
|
||||||
|
self.editBox.addWidget(self.editValue, 5)
|
||||||
|
self.editBox.addWidget(self.saveButton, 0)
|
||||||
|
|
||||||
|
self.mainBox = QVBoxLayout()
|
||||||
|
self.mainBox.addWidget(self.listBox)
|
||||||
|
self.mainBox.addLayout(self.editBox)
|
||||||
|
|
||||||
|
self.innerBox = QHBoxLayout()
|
||||||
|
self.innerBox.addLayout(self.mainBox)
|
||||||
|
self.innerBox.addLayout(self.listControls)
|
||||||
|
|
||||||
|
self.outerBox = QVBoxLayout()
|
||||||
|
self.outerBox.addWidget(QLabel("<b>%s</b>" % pageLabel))
|
||||||
|
self.outerBox.addLayout(self.innerBox)
|
||||||
|
|
||||||
self.outerBox.addWidget(
|
|
||||||
QLabel("<b>%s</b>" % self.tr("Text Replace List for Preview and Export"))
|
|
||||||
)
|
|
||||||
self.outerBox.addWidget(self.listBox)
|
|
||||||
self.outerBox.addLayout(self.bottomBox)
|
|
||||||
self.setLayout(self.outerBox)
|
self.setLayout(self.outerBox)
|
||||||
|
|
||||||
return
|
return
|
||||||
@@ -510,6 +592,7 @@ class GuiProjectEditReplace(QWidget):
|
|||||||
aVal = tItem.text(1)
|
aVal = tItem.text(1)
|
||||||
if len(aKey) > 0:
|
if len(aKey) > 0:
|
||||||
newList[aKey] = aVal
|
newList[aKey] = aVal
|
||||||
|
|
||||||
return newList
|
return newList
|
||||||
|
|
||||||
##
|
##
|
||||||
@@ -545,8 +628,8 @@ class GuiProjectEditReplace(QWidget):
|
|||||||
saveKey = self._stripNotAllowed(newKey)
|
saveKey = self._stripNotAllowed(newKey)
|
||||||
|
|
||||||
if len(saveKey) > 0 and len(newVal) > 0:
|
if len(saveKey) > 0 and len(newVal) > 0:
|
||||||
selItem.setText(0, "<%s>" % saveKey)
|
selItem.setText(self.COL_KEY, "<%s>" % saveKey)
|
||||||
selItem.setText(1, newVal)
|
selItem.setText(self.COL_REPL, newVal)
|
||||||
self.editKey.clear()
|
self.editKey.clear()
|
||||||
self.editValue.clear()
|
self.editValue.clear()
|
||||||
self.editKey.setEnabled(False)
|
self.editKey.setEnabled(False)
|
||||||
|
|||||||
@@ -24,12 +24,11 @@ import time
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from nw.common import (
|
from nw.common import (
|
||||||
checkString, checkBool, checkInt, colRange, formatInt, transferCase,
|
checkString, checkBool, checkInt, formatInt, transferCase,
|
||||||
fuzzyTime, checkHandle, formatTimeStamp, formatTime, hexToInt,
|
fuzzyTime, checkHandle, formatTimeStamp, formatTime, hexToInt,
|
||||||
makeFileNameSafe, isHandle, isTitleTag, isItemClass, isItemType,
|
makeFileNameSafe, isHandle, isTitleTag, isItemClass, isItemType,
|
||||||
isItemLayout, numberToRoman
|
isItemLayout, numberToRoman
|
||||||
)
|
)
|
||||||
from tools import cmpList
|
|
||||||
|
|
||||||
@pytest.mark.base
|
@pytest.mark.base
|
||||||
def testBaseCommon_CheckString():
|
def testBaseCommon_CheckString():
|
||||||
@@ -191,34 +190,6 @@ def testBaseCommon_HexToInt():
|
|||||||
|
|
||||||
# END Test testBaseCommon_HexToInt
|
# END Test testBaseCommon_HexToInt
|
||||||
|
|
||||||
@pytest.mark.base
|
|
||||||
def testBaseCommon_ColRange():
|
|
||||||
"""Test the colRange function.
|
|
||||||
"""
|
|
||||||
assert colRange([0, 0], [0, 0], 0) is None
|
|
||||||
assert cmpList(
|
|
||||||
colRange([200, 50, 0], [50, 200, 0], 1),
|
|
||||||
[200, 50, 0]
|
|
||||||
)
|
|
||||||
assert cmpList(
|
|
||||||
colRange([200, 50, 0], [50, 200, 0], 2),
|
|
||||||
[[200, 50, 0], [50, 200, 0]]
|
|
||||||
)
|
|
||||||
assert cmpList(
|
|
||||||
colRange([200, 50, 0], [50, 200, 0], 3),
|
|
||||||
[[200, 50, 0], [125, 125, 0], [50, 200, 0]]
|
|
||||||
)
|
|
||||||
assert cmpList(
|
|
||||||
colRange([200, 50, 0], [50, 200, 0], 4),
|
|
||||||
[[200, 50, 0], [150, 100, 0], [100, 150, 0], [50, 200, 0]]
|
|
||||||
)
|
|
||||||
assert cmpList(
|
|
||||||
colRange([200, 50, 0], [50, 200, 0], 5),
|
|
||||||
[[200, 50, 0], [162, 87, 0], [124, 124, 0], [86, 161, 0], [50, 200, 0]]
|
|
||||||
)
|
|
||||||
|
|
||||||
# END Test testBaseCommon_ColRange
|
|
||||||
|
|
||||||
@pytest.mark.base
|
@pytest.mark.base
|
||||||
def testBaseCommon_FormatTimeStamp():
|
def testBaseCommon_FormatTimeStamp():
|
||||||
"""Test the formatTimeStamp function.
|
"""Test the formatTimeStamp function.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ from tools import cmpFiles, getGuiItem
|
|||||||
from PyQt5.QtGui import QColor
|
from PyQt5.QtGui import QColor
|
||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QDialog, QAction, QMessageBox, QColorDialog, QListWidgetItem
|
QDialog, QAction, QMessageBox, QColorDialog, QTreeWidgetItem
|
||||||
)
|
)
|
||||||
|
|
||||||
from nw.gui import GuiProjectSettings
|
from nw.gui import GuiProjectSettings
|
||||||
@@ -110,7 +110,7 @@ def testGuiProjSettings_Dialog(qtbot, monkeypatch, nwGUI, fncDir, fncProj, outDi
|
|||||||
|
|
||||||
assert projEdit.tabStatus.colChanged is False
|
assert projEdit.tabStatus.colChanged is False
|
||||||
assert projEdit.tabStatus.getNewList() is None
|
assert projEdit.tabStatus.getNewList() is None
|
||||||
assert projEdit.tabStatus.listBox.count() == 4
|
assert projEdit.tabStatus.listBox.topLevelItemCount() == 4
|
||||||
|
|
||||||
# Fake drag'n'drop should change changed status
|
# Fake drag'n'drop should change changed status
|
||||||
projEdit.tabStatus._rowsMoved()
|
projEdit.tabStatus._rowsMoved()
|
||||||
@@ -119,30 +119,32 @@ def testGuiProjSettings_Dialog(qtbot, monkeypatch, nwGUI, fncDir, fncProj, outDi
|
|||||||
|
|
||||||
projEdit.tabStatus.listBox.clearSelection()
|
projEdit.tabStatus.listBox.clearSelection()
|
||||||
assert projEdit.tabStatus._getSelectedItem() is None
|
assert projEdit.tabStatus._getSelectedItem() is None
|
||||||
projEdit.tabStatus.listBox.item(0).setSelected(True)
|
projEdit.tabStatus.listBox.topLevelItem(0).setSelected(True)
|
||||||
assert isinstance(projEdit.tabStatus._getSelectedItem(), QListWidgetItem)
|
assert isinstance(projEdit.tabStatus._getSelectedItem(), QTreeWidgetItem)
|
||||||
|
|
||||||
# Can't delete the first item (it's in use)
|
# Can't delete the first item (it's in use)
|
||||||
projEdit.tabStatus.listBox.item(0).setSelected(True)
|
projEdit.tabStatus.listBox.clearSelection()
|
||||||
|
projEdit.tabStatus.listBox.topLevelItem(0).setSelected(True)
|
||||||
qtbot.mouseClick(projEdit.tabStatus.delButton, Qt.LeftButton)
|
qtbot.mouseClick(projEdit.tabStatus.delButton, Qt.LeftButton)
|
||||||
assert projEdit.tabStatus.listBox.count() == 4
|
assert projEdit.tabStatus.listBox.topLevelItemCount() == 4
|
||||||
|
|
||||||
# Can delete the third item
|
# Can delete the third item
|
||||||
projEdit.tabStatus.listBox.item(2).setSelected(True)
|
projEdit.tabStatus.listBox.clearSelection()
|
||||||
|
projEdit.tabStatus.listBox.topLevelItem(2).setSelected(True)
|
||||||
qtbot.mouseClick(projEdit.tabStatus.delButton, Qt.LeftButton)
|
qtbot.mouseClick(projEdit.tabStatus.delButton, Qt.LeftButton)
|
||||||
assert projEdit.tabStatus.listBox.count() == 3
|
assert projEdit.tabStatus.listBox.topLevelItemCount() == 3
|
||||||
|
|
||||||
# Add a new item
|
# Add a new item
|
||||||
monkeypatch.setattr(QColorDialog, "getColor", lambda *args: QColor(20, 30, 40))
|
monkeypatch.setattr(QColorDialog, "getColor", lambda *args: QColor(20, 30, 40))
|
||||||
qtbot.mouseClick(projEdit.tabStatus.newButton, Qt.LeftButton)
|
qtbot.mouseClick(projEdit.tabStatus.addButton, Qt.LeftButton)
|
||||||
projEdit.tabStatus.listBox.item(3).setSelected(True)
|
projEdit.tabStatus.listBox.topLevelItem(3).setSelected(True)
|
||||||
for n in range(8):
|
for n in range(8):
|
||||||
qtbot.keyClick(projEdit.tabStatus.editName, Qt.Key_Backspace, delay=typeDelay)
|
qtbot.keyClick(projEdit.tabStatus.editName, Qt.Key_Backspace, delay=typeDelay)
|
||||||
for c in "Final":
|
for c in "Final":
|
||||||
qtbot.keyClick(projEdit.tabStatus.editName, c, delay=typeDelay)
|
qtbot.keyClick(projEdit.tabStatus.editName, c, delay=typeDelay)
|
||||||
qtbot.mouseClick(projEdit.tabStatus.colButton, Qt.LeftButton)
|
qtbot.mouseClick(projEdit.tabStatus.colButton, Qt.LeftButton)
|
||||||
qtbot.mouseClick(projEdit.tabStatus.saveButton, Qt.LeftButton)
|
qtbot.mouseClick(projEdit.tabStatus.saveButton, Qt.LeftButton)
|
||||||
assert projEdit.tabStatus.listBox.count() == 4
|
assert projEdit.tabStatus.listBox.topLevelItemCount() == 4
|
||||||
qtbot.wait(stepDelay)
|
qtbot.wait(stepDelay)
|
||||||
|
|
||||||
assert projEdit.tabStatus.colChanged is True
|
assert projEdit.tabStatus.colChanged is True
|
||||||
@@ -157,10 +159,12 @@ def testGuiProjSettings_Dialog(qtbot, monkeypatch, nwGUI, fncDir, fncProj, outDi
|
|||||||
# ==============
|
# ==============
|
||||||
|
|
||||||
projEdit._tabBox.setCurrentWidget(projEdit.tabImport)
|
projEdit._tabBox.setCurrentWidget(projEdit.tabImport)
|
||||||
projEdit.tabImport.listBox.item(3).setSelected(True)
|
projEdit.tabStatus.listBox.clearSelection()
|
||||||
|
projEdit.tabImport.listBox.topLevelItem(3).setSelected(True)
|
||||||
qtbot.mouseClick(projEdit.tabImport.delButton, Qt.LeftButton)
|
qtbot.mouseClick(projEdit.tabImport.delButton, Qt.LeftButton)
|
||||||
qtbot.mouseClick(projEdit.tabImport.newButton, Qt.LeftButton)
|
qtbot.mouseClick(projEdit.tabImport.addButton, Qt.LeftButton)
|
||||||
projEdit.tabImport.listBox.item(3).setSelected(True)
|
projEdit.tabStatus.listBox.clearSelection()
|
||||||
|
projEdit.tabImport.listBox.topLevelItem(3).setSelected(True)
|
||||||
for n in range(8):
|
for n in range(8):
|
||||||
qtbot.keyClick(projEdit.tabImport.editName, Qt.Key_Backspace, delay=typeDelay)
|
qtbot.keyClick(projEdit.tabImport.editName, Qt.Key_Backspace, delay=typeDelay)
|
||||||
for c in "Final":
|
for c in "Final":
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from itertools import chain
|
|
||||||
|
|
||||||
from PyQt5.QtWidgets import qApp
|
from PyQt5.QtWidgets import qApp
|
||||||
|
|
||||||
def cmpFiles(fileOne, fileTwo, ignoreLines=None):
|
def cmpFiles(fileOne, fileTwo, ignoreLines=None):
|
||||||
@@ -72,18 +70,6 @@ def cmpFiles(fileOne, fileTwo, ignoreLines=None):
|
|||||||
|
|
||||||
return not diffFound
|
return not diffFound
|
||||||
|
|
||||||
def cmpList(listOne, listTwo):
|
|
||||||
"""Compare two iterable objects.
|
|
||||||
"""
|
|
||||||
flatOne = list(chain.from_iterable([listOne]))
|
|
||||||
flatTwo = list(chain.from_iterable([listTwo]))
|
|
||||||
if len(flatOne) != len(flatTwo):
|
|
||||||
return False
|
|
||||||
for i in range(len(flatOne)):
|
|
||||||
if flatOne[i] != flatTwo[i]:
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
def getGuiItem(theName):
|
def getGuiItem(theName):
|
||||||
"""Returns a QtWidget based on its objectName.
|
"""Returns a QtWidget based on its objectName.
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user