mirror of
https://github.com/gmbrax/Pilgrim.git
synced 2026-11-10 17:40:18 +00:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6dc2c01325 | ||
|
|
860fee2d19 | ||
|
|
fce47db0f8 | ||
|
|
6ab35e680d | ||
|
|
63db2517f3 | ||
|
|
de0e415ee2 | ||
|
|
f42d15048c | ||
|
|
40104db405 | ||
|
|
d13750f725 | ||
|
|
0b9b3c8cf0 |
@@ -25,7 +25,7 @@ structured and accessible format.
|
||||
To install the application you must issue the command:
|
||||
|
||||
```bash
|
||||
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple Pilgrim
|
||||
pip install pilgrim
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -42,7 +42,7 @@ class EditEntryScreen(Screen):
|
||||
self.is_new_entry = False
|
||||
self.has_unsaved_changes = False
|
||||
self.new_entry_content = ""
|
||||
self.new_entry_title = ""
|
||||
self.new_entry_title = "New Entry"
|
||||
self.next_entry_id = 1
|
||||
self._updating_display = False
|
||||
self._original_content = ""
|
||||
@@ -906,22 +906,11 @@ class EditEntryScreen(Screen):
|
||||
self.notify("Empty entry cannot be saved")
|
||||
return
|
||||
# Passe a lista de fotos para o método de criação
|
||||
if self.new_entry_title == "":
|
||||
self.app.push_screen(RenameEntryModal(current_name=""), lambda result: self._handle_save_after_rename(result,content,
|
||||
photos_to_link))
|
||||
else:
|
||||
self.call_later(self._async_create_entry, content, photos_to_link)
|
||||
self.call_later(self._async_create_entry, content, photos_to_link)
|
||||
else:
|
||||
# Passe a lista de fotos para o método de atualização
|
||||
self.call_later(self._async_update_entry, content, photos_to_link)
|
||||
|
||||
def _handle_save_after_rename(self, result: str | None, content: str, photos_to_link: List[Photo]) -> None:
|
||||
if result is None:
|
||||
self.notify("Save cancelled")
|
||||
return
|
||||
self.new_entry_title = result
|
||||
self.call_later(self._async_create_entry, content, photos_to_link)
|
||||
|
||||
async def _async_create_entry(self, content: str, photos_to_link: List[Photo]):
|
||||
"""Creates a new entry and links the referenced photos."""
|
||||
try:
|
||||
@@ -948,7 +937,7 @@ class EditEntryScreen(Screen):
|
||||
self.is_new_entry = False
|
||||
self.has_unsaved_changes = False
|
||||
self._original_content = new_entry.text
|
||||
self.new_entry_title = ""
|
||||
self.new_entry_title = "New Entry"
|
||||
self.next_entry_id = max(entry.id for entry in self.entries) + 1
|
||||
|
||||
self._update_entry_display()
|
||||
|
||||
Reference in New Issue
Block a user