From 48c7aa2eabc6da5022709d77aef1196e2f77cb4a Mon Sep 17 00:00:00 2001
From: introt
Date: Thu, 27 May 2021 19:59:59 +0300
Subject: [PATCH 1/6] Add TRANSMIGRATED_BOX to markdown & rst export
---
zim/formats/markdown.py | 1 +
zim/formats/rst.py | 1 +
2 files changed, 2 insertions(+)
diff --git a/zim/formats/markdown.py b/zim/formats/markdown.py
index e9f92b1bb..c4ada1e99 100644
--- a/zim/formats/markdown.py
+++ b/zim/formats/markdown.py
@@ -40,6 +40,7 @@ class Dumper(TextDumper):
XCHECKED_BOX: '* \u2612',
CHECKED_BOX: '* \u2611',
MIGRATED_BOX: '* \u25B7',
+ TRANSMIGRATED_BOX: '* \u25C1',
BULLET: '*',
}
diff --git a/zim/formats/rst.py b/zim/formats/rst.py
index f367e719e..ac7d5ecb8 100644
--- a/zim/formats/rst.py
+++ b/zim/formats/rst.py
@@ -28,6 +28,7 @@ class Dumper(TextDumper):
XCHECKED_BOX: '- \u2612',
CHECKED_BOX: '- \u2611',
MIGRATED_BOX: '- \u25B7',
+ TRANSMIGRATED_BOX: '- \u25C1',
BULLET: '-',
}
From ad36b5d7e53f6a1ec2413dc9131fc1e56c6d2960 Mon Sep 17 00:00:00 2001
From: introt
Date: Thu, 27 May 2021 20:16:46 +0300
Subject: [PATCH 2/6] Run tests/data/formats/update.sh
---
tests/data/formats/export.html | 1 +
tests/data/formats/export.markdown | 1 +
tests/data/formats/export.rst | 1 +
tests/data/formats/export.tex | 1 +
tests/data/formats/parsetree.xml | 2 +-
tests/data/formats/plain.txt | 1 +
tests/data/formats/wiki.txt | 1 +
7 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/tests/data/formats/export.html b/tests/data/formats/export.html
index cfbaa57b7..3dbe61e3b 100644
--- a/tests/data/formats/export.html
+++ b/tests/data/formats/export.html
@@ -155,6 +155,7 @@ head 4
- Migrated checkbox
+- Transmigrated checkbox
diff --git a/tests/data/formats/export.markdown b/tests/data/formats/export.markdown
index d9d966c1a..625a0c7dd 100644
--- a/tests/data/formats/export.markdown
+++ b/tests/data/formats/export.markdown
@@ -95,6 +95,7 @@ TODO list:
* ▷ Migrated checkbox
+* ◁ Transmigrated checkbox
A numbered list:
diff --git a/tests/data/formats/export.rst b/tests/data/formats/export.rst
index b04401ba3..9f3610e06 100644
--- a/tests/data/formats/export.rst
+++ b/tests/data/formats/export.rst
@@ -113,6 +113,7 @@ TODO list:
- ☒ baz
- ▷ Migrated checkbox
+- ◁ Transmigrated checkbox
A numbered list:
1. foo
diff --git a/tests/data/formats/export.tex b/tests/data/formats/export.tex
index 62bf71fb9..41a7227b0 100644
--- a/tests/data/formats/export.tex
+++ b/tests/data/formats/export.tex
@@ -170,6 +170,7 @@ \subsubsection{head 4}
\begin{itemize}
\item[\RIGHTarrow] Migrated checkbox
+\item[\LEFTarrow] Transmigrated checkbox
\end{itemize}
diff --git a/tests/data/formats/parsetree.xml b/tests/data/formats/parsetree.xml
index 379a286c7..26ef5146b 100644
--- a/tests/data/formats/parsetree.xml
+++ b/tests/data/formats/parsetree.xml
@@ -68,7 +68,7 @@ and also strike through
TODO list:
-
+- Migrated checkbox
- Transmigrated checkbox
A numbered list:
- foo
- bar
- sub list
- here
- hmmm
diff --git a/tests/data/formats/plain.txt b/tests/data/formats/plain.txt
index b56cc6be5..3c0a62b49 100644
--- a/tests/data/formats/plain.txt
+++ b/tests/data/formats/plain.txt
@@ -86,6 +86,7 @@ TODO list:
[x] baz
[>] Migrated checkbox
+[<] Transmigrated checkbox
A numbered list:
1. foo
diff --git a/tests/data/formats/wiki.txt b/tests/data/formats/wiki.txt
index 5965ec10b..4ac239d06 100644
--- a/tests/data/formats/wiki.txt
+++ b/tests/data/formats/wiki.txt
@@ -86,6 +86,7 @@ TODO list:
[x] baz
[>] Migrated checkbox
+[<] Transmigrated checkbox
A numbered list:
1. foo
From b6ef682e14f266d874f7f92d0f888bcfc7af3484 Mon Sep 17 00:00:00 2001
From: introt
Date: Thu, 27 May 2021 20:56:48 +0300
Subject: [PATCH 3/6] Backarrow touches
---
zim/gui/pageview/__init__.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/zim/gui/pageview/__init__.py b/zim/gui/pageview/__init__.py
index 2304721e9..d6e318d0a 100644
--- a/zim/gui/pageview/__init__.py
+++ b/zim/gui/pageview/__init__.py
@@ -2411,6 +2411,7 @@ def get_bullet(self, line):
CHECKED_BOX
XCHECKED_BOX
MIGRATED_BOX
+ TRANSMIGRATED_BOX
or a numbered list bullet (test with L{is_numbered_bullet_re})
'''
iter = self.get_iter_at_line(line)
@@ -2926,7 +2927,8 @@ def toggle_checkbox(self, line, checkbox_type=None, recursive=False):
@param line: the line number
@param checkbox_type: the checkbox type that we want to toggle:
- one of C{CHECKED_BOX}, C{XCHECKED_BOX}, C{MIGRATED_BOX}.
+ one of C{CHECKED_BOX}, C{XCHECKED_BOX}, C{MIGRATED_BOX},
+ C{TRANSMIGRATED_BOX}.
If C{checkbox_type} is given, it toggles between this type and
unchecked. Otherwise it rotates through unchecked, checked
and xchecked.
@@ -3400,6 +3402,7 @@ def set_bullet(self, row, bullet):
UNCHECKED_BOX
XCHECKED_BOX
MIGRATED_BOX
+ TRANSMIGRATED_BOX
'''
assert bullet in BULLETS
with self.buffer.user_action:
@@ -3408,7 +3411,7 @@ def set_bullet(self, row, bullet):
pass
elif bullet == UNCHECKED_BOX:
self._checkbox_unchecked(row)
- else: # CHECKED_BOX, XCHECKED_BOX, MIGRATED_BOX
+ else: # CHECKED_BOX, XCHECKED_BOX, MIGRATED_BOX, TRANSMIGRATED_BOX
self._checkbox_checked(row, bullet)
def _checkbox_unchecked(self, row):
@@ -6162,11 +6165,13 @@ def do_mark_set(self, buffer, iter, mark):
self.actiongroup.get_action('toggle_checkbox').set_sensitive(True)
self.actiongroup.get_action('xtoggle_checkbox').set_sensitive(True)
self.actiongroup.get_action('migrate_checkbox').set_sensitive(True)
+ self.actiongroup.get_action('transmigrate_checkbox').set_sensitive(True)
else:
self.actiongroup.get_action('uncheck_checkbox').set_sensitive(False)
self.actiongroup.get_action('toggle_checkbox').set_sensitive(False)
self.actiongroup.get_action('xtoggle_checkbox').set_sensitive(False)
self.actiongroup.get_action('migrate_checkbox').set_sensitive(False)
+ self.actiongroup.get_action('transmigrate_checkbox').set_sensitive(False)
if buffer.get_link_tag(iter):
self.actiongroup.get_action('remove_link').set_sensitive(True)
@@ -6476,8 +6481,8 @@ def _checkbox_do_populate_popup(self, menu, buffer, iter):
menu.prepend(Gtk.SeparatorMenuItem())
for bullet, label in (
- (MIGRATED_BOX, _('Check Checkbox \'>\'')), # T: popup menu menuitem
(TRANSMIGRATED_BOX, _('Check Checkbox \'<\'')), # T: popup menu menuitem
+ (MIGRATED_BOX, _('Check Checkbox \'>\'')), # T: popup menu menuitem
(XCHECKED_BOX, _('Check Checkbox \'X\'')), # T: popup menu menuitem
(CHECKED_BOX, _('Check Checkbox \'V\'')), # T: popup menu menuitem
(UNCHECKED_BOX, _('Un-check Checkbox')), # T: popup menu menuitem
From c0fa4a1676a7449f0bbfccd18ea7afc44008821a Mon Sep 17 00:00:00 2001
From: introt
Date: Thu, 27 May 2021 21:20:56 +0300
Subject: [PATCH 4/6] Add test for transmigrate_checkbox
---
tests/pageview.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/pageview.py b/tests/pageview.py
index 0f4106ee9..c077b85eb 100644
--- a/tests/pageview.py
+++ b/tests/pageview.py
@@ -2930,6 +2930,11 @@ def testMigrateCheckBox(self):
pageview.migrate_checkbox()
self.assertEqual(pageview.page.dump('wiki'), ['[>] my task\n'])
+ def testTransmigrateCheckBox(self):
+ pageview = setUpPageView(self.setUpNotebook(), '[*] my task\n')
+ pageview.transmigrate_checkbox()
+ self.assertEqual(pageview.page.dump('wiki'), ['[<] my task\n'])
+
def testEditObjectForLink(self):
pageview = setUpPageView(self.setUpNotebook(), '[[link]]\n')
From 737984f617fb206e2a06a7977426d576ad50b437 Mon Sep 17 00:00:00 2001
From: introt
Date: Thu, 27 May 2021 21:24:00 +0300
Subject: [PATCH 5/6] Add transmigrated_box to style.conf
---
data/style.conf | 3 +++
1 file changed, 3 insertions(+)
diff --git a/data/style.conf b/data/style.conf
index 329045e52..1215134f8 100644
--- a/data/style.conf
+++ b/data/style.conf
@@ -89,4 +89,7 @@ foreground=#4e9a06
[Tag migrated-checkbox]
#foreground = grey
+[Tag transmigrated-checkbox]
+#foreground = grey
+
# vim: syntax=desktop
From 99ac228fff66bc9196eb38d240896c9bcf3a7d24 Mon Sep 17 00:00:00 2001
From: introt
Date: Thu, 27 May 2021 21:24:47 +0300
Subject: [PATCH 6/6] Add transmigrated-checkbox to menubar
---
data/menubar.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/data/menubar.xml b/data/menubar.xml
index d0f06c7aa..633961f17 100644
--- a/data/menubar.xml
+++ b/data/menubar.xml
@@ -39,6 +39,7 @@
+