Comments (4)
I've gotten it to save my master document, very very crudely. Here's how I've done it, apologies for the inline code and no pull request, I'm not at my main machine so no SSH keys here
def populate_from_disk(self):
try: filehandle = open(self.pathname + '/workspace.pickle', 'rb')
except IOError: pass
else:
try: data = pickle.load(filehandle)
except EOFError:
return
else:
for item in sorted(data['open_documents'].values(), key=lambda val: val['last_activated']):
self.create_document_from_filename(item['filename'])
for item in data['recently_opened_documents'].values():
self.update_recently_opened_document(item['filename'], item['date'], notify=False)
self.add_change_code('update_recently_opened_documents', self.recently_opened_documents)
if data['master_document'] is not None:
document = LaTeXDocument(self.pathname)
document.set_filename(data['master_document'])
self.set_one_document_master(document)
def save_to_disk(self):
try: filehandle = open(self.pathname + '/workspace.pickle', 'wb')
except IOError: pass
else:
open_documents = dict()
for document in self.open_documents:
filename = document.get_filename()
if filename != None:
open_documents[filename] = {
'filename': filename,
'last_activated': document.get_last_activated()
}
data = {
'open_documents': open_documents,
'recently_opened_documents': self.recently_opened_documents
}
if self.master_document is not None:
data['master_document'] = self.master_document.filename
pickle.dump(data, filehandle)
In workspace/workspace.py. The only thing it doesn't do is apply the state when you open Seltzer again, which is... annoying
from setzer.
Thanks for the request. I can implement it myself, no problem.
I think just making the master document persistent has a downside: one can forget that they set it and Setzer will behave seemingly weirdly. But that might be worth it.
Also I think this calls for a more general solution: naming lists of files as "projects" and loading them all at once (including master state).
from setzer.
I was thinking the same thing. Being able to define a "project" would be the best solution I think. Sadly the Python code is beyond my knowledge (but it's very nice, and I can learn a lot from it so thanks!) so I doubt I'll be able to do much.
from setzer.
This is now fixed in the latest flathub update.
from setzer.
Related Issues (20)
- license on landing page vs license in a file HOT 1
- How to add editor color theme? HOT 2
- Flatpak install hangs HOT 1
- Bug: Latex commands in section/chapter titles cause the section/chapter to disappear from document structure navigator HOT 2
- Hours Long Flathub Installation HOT 1
- include \subfile{...} and \subimport{...} as document scope expanding commands similar to input{...} HOT 1
- Only one file showing in the document structure HOT 3
- feature request: allow bibtex item autocomplete when page numbers are used HOT 1
- Flatpak: runtime org.gnome.Platform branch 42 is end-of-life HOT 1
- Bug: PDF preview can't show differing aspect ratios HOT 1
- Bug: "Show Source" feature not working properly HOT 2
- Bibtex create new entry duplicates some fields HOT 1
- Removal of helper files preventing table of contents from being built HOT 1
- Move to `Gtk.FileChooserNative` HOT 6
- Cannot Compile on fresh Fedora Installation HOT 3
- Verify Setzer on Flathub HOT 2
- Debain 12 unable to locate libportal package HOT 3
- Incorrect dependency in the README? HOT 1
- Gtk4 HOT 1
- PDF Preview should persist between document elements HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from setzer.