Zim

Merge lp:~johannes-reinhardt/zim/fixes into lp:~jaap.karssenberg/zim/pyzim

Proposed by Johannes Reinhardt
Status: Merged
Merged at revision: not available
Proposed branch: lp:~johannes-reinhardt/zim/fixes
Merge into: lp:~jaap.karssenberg/zim/pyzim
Diff against target: 209 lines (+76/-24)
6 files modified
data/manual/FAQ.txt (+16/-0)
data/manual/Plugins.txt (+1/-0)
data/manual/Plugins/Dropwindow.txt (+20/-0)
data/manual/Plugins/Version_Control.txt (+7/-2)
zim/gui/__init__.py (+19/-15)
zim/gui/widgets.py (+13/-7)
To merge this branch: bzr merge lp:~johannes-reinhardt/zim/fixes
Reviewer Review Type Date Requested Status
Jaap Karssenberg Approve
Review via email: mp+24064@code.launchpad.net

Description of the change

Documentation (FAQ, Dropwindow plugin)
Bugfixes (https://launchpad.net/bugs/562103,https://launchpad.net/bugs/513712)
improved attachment dialog

To post a comment you must log in.
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Merged with minor changes. Thanks for committing these fixes !

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Flagged as approved since merge already happened...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/manual/FAQ.txt'
2--- data/manual/FAQ.txt 2010-01-19 18:41:47 +0000
3+++ data/manual/FAQ.txt 2010-04-24 13:30:35 +0000
4@@ -24,6 +24,9 @@
5 === I would like zim to hide in the system tray. ===
6 There is a [[Plugins:Tray Icon|Tray Icon plugin]] which can be enabled from the Preferences dialog.
7
8+=== I would like to start zim hidden in the system tray. ===
9+See http://www.zim-wiki.org/wiki/doku.php?id=how_to_start_zim_as_icon_in_the_system_tray
10+
11 === Can I make zim appear with a global keybinding? ===
12 By default zim will only run a single instance of each notebook. Trying to open the same notebook again will just pop the corresponding window to the foreground. So you can set a default notebook (see [[Help:Notebooks|Notebooks]]) and just make a global key binding run the command "''zim''".
13
14@@ -41,3 +44,16 @@
15
16 === Does it run on OS X? ===
17 Yes it does. You can install the dependencies usign [[http://www.macports.org/|Mac Ports]].
18+
19+=== I want to move/backup/syncronize a zim notebook. Which files do I need to take care of? ===
20+The visible files in the notebook folder contain all data of notes and attachments.
21+
22+=== What is the hidden .zim folder in my notebook folder? ===
23+The hidden .zim folder contains only caches and GUI state. It doesn't contain any information that can not be recreated on the fly.
24+
25+=== I switched from the perl version to the python version and miss my favorite feature. ===
26+Some features of the perl version of zim are not yet implemented in the python version.
27+
28+=== I have a useful trick or tip. How can I share it with other users? ===
29+You can have a look at the [[http://www.zim-wiki.org/wiki/doku.php|zim documentation wiki]]. It has a section dedicated to [[http://www.zim-wiki.org/wiki/doku.php?id=tips_and_tricks|tricks and tips]]. Or write a mail to the mailing list, see the [[https://launchpad.net/~zim-wiki|team page]] on launchpad
30+
31
32=== modified file 'data/manual/Plugins.txt'
33--- data/manual/Plugins.txt 2010-03-05 22:39:48 +0000
34+++ data/manual/Plugins.txt 2010-04-24 13:30:35 +0000
35@@ -7,6 +7,7 @@
36
37 * [[+Calendar|Calendar]]
38 * [[+Diagram Editor|Diagram Editor]]
39+* [[Plugins:Dropwindow|Dropwindow]]
40 * [[+Equation Editor|Equation Editor]]
41 * [[+Insert Screenshot|Insert Screenshot]]
42 * [[+Link Map|Link Map]]
43
44=== added file 'data/manual/Plugins/Dropwindow.txt'
45--- data/manual/Plugins/Dropwindow.txt 1970-01-01 00:00:00 +0000
46+++ data/manual/Plugins/Dropwindow.txt 2010-04-24 13:30:35 +0000
47@@ -0,0 +1,20 @@
48+Content-Type: text/x-zim-wiki
49+Wiki-Format: zim 0.4
50+Creation-Date: 2010-04-24T13:49:51.331910
51+
52+====== Dropwindow ======
53+Created Samstag 24 April 2010
54+
55+The Dropwindow plugin offers a small dialog for inserting notes into a notebook. It is invoked from the commandline and can therefore easily be bound to keyboard short cuts or used in scripts.
56+
57+**Commandline: **''zim'' --plugin dropwindow [OPTIONS]
58+
59+**Options:**
60+* notebook=URI Select the notebook in the dialog
61+* namespace=STRING Fill in the namespace in the dialog
62+* basename=STRING Fill in the page name in the dialog
63+* text=TEXT Provide the text directly
64+* input=stdin Provide the text on stdin
65+* input=clipboard Take the text from the clipboard
66+
67+**Dependencies:** This plugin has no additional dependencies.
68
69=== modified file 'data/manual/Plugins/Version_Control.txt'
70--- data/manual/Plugins/Version_Control.txt 2010-03-16 21:04:23 +0000
71+++ data/manual/Plugins/Version_Control.txt 2010-04-24 13:30:35 +0000
72@@ -9,14 +9,14 @@
73 **Dependencies:** This plugin requires one of the supported version control systems to be installed. Currently only Bazaar is supported, so this application is required. In specific the "bzr" command should be available in the system path.
74
75 ===== Introduction =====
76-If you want to keep track of your changes or if you want to collaborate on a Zim Wiki with as a team, Version Control is the best way to go. Zim integrates very well with existing Version Control Software because all relevant data is stored in plain text files.
77+If you want to keep track of your changes or if you want to collaborate on a Zim Wiki as a team, Version Control is the best way to go. Zim integrates very well with existing Version Control Software because all relevant data is stored in plain text files.
78
79 ===== Usage =====
80 To save the current state of the Notebook, choose ''File -> Save Version...'' from the Main Menu and confirm that you want to enable Version Control. In the next window add a comment describing the changes (probably something like "yeah, first version" at this point) and confirm by clicking Save.
81 You can browse the complete history of saved versions by selecting ''File -> Versions...'' from the Main Menu. You can view and restore previous versions of your Notebook and view all your changes between two versions in the window that open.
82
83 ===== Sharing =====
84-TODO here should be documented how to share the newly created repository with your colaborators...
85+TODO here should be documented how to share the newly created repository with your collaborators...
86
87 ===== Details =====
88 Technically speaking a local repository is created when enabling Version Control -- a [[http://bazaar.canonical.com/en/|Bazaar]] repository to be precise. Every time you save a version, another revision is checked in. Zim just uses the Bazaar application, so you can always view and export your history using standard Bazaar tools.
89@@ -36,3 +36,8 @@
90 * anything you manually put into or below the root folder you do not want to be in your repository
91
92 The files in the .zim folder are caches of the index and some client configuration (window sizes, scroll position etc.) and some of it is in binary format, so you do not need or want it in your repository.
93+
94+If you want for some reason stop using version control and throw away all history, you can do the following:
95+* disable the version control plugin
96+* quit zim
97+* remove the .bzr folder and .bzrignore file from your notebook
98
99=== modified file 'zim/gui/__init__.py'
100--- zim/gui/__init__.py 2010-04-17 20:09:38 +0000
101+++ zim/gui/__init__.py 2010-04-24 13:30:35 +0000
102@@ -2252,7 +2252,9 @@
103 class AttachFileDialog(FileDialog):
104
105 def __init__(self, ui, path=None):
106- FileDialog.__init__(self, ui, _('Attach File')) # T: Dialog title
107+ FileDialog.__init__(self, ui, _('Attach File'),multiple=True) # T: Dialog title
108+ self.uistate.setdefault('last_attachment_folder','~')
109+ self.filechooser.set_current_folder(self.uistate['last_attachment_folder'])
110 if path is None:
111 self.path = self.ui.get_path_context()
112 else:
113@@ -2272,24 +2274,26 @@
114 self.filechooser.set_extra_widget(checkbox)
115
116 def do_response_ok(self):
117- file = self.get_file()
118- if file is None:
119+ files = self.get_file()
120+ if len(files) == 0:
121 return False
122
123 checkbox = self.filechooser.get_extra_widget()
124 self.uistate['insert_attached_images'] = checkbox.get_active()
125+ self.uistate['last_attachment_folder'] = self.filechooser.get_current_folder()
126 # Similar code in zim.gui.InsertImageDialog
127
128- file.copyto(self.dir)
129- file = self.dir.file(file.basename)
130- pageview = self.ui.mainwindow.pageview
131- if self.uistate['insert_attached_images'] and file.isimage():
132- try:
133- pageview.insert_image(file, interactive=False)
134- except:
135- logger.exception('Could not insert image')
136- pageview.insert_links([file]) # image type not supported?
137- else:
138- pageview.insert_links([file])
139+ for file in files:
140+ file.copyto(self.dir)
141+ file = self.dir.file(file.basename)
142+ pageview = self.ui.mainwindow.pageview
143+ if self.uistate['insert_attached_images'] and file.isimage():
144+ try:
145+ pageview.insert_image(file, interactive=False)
146+ except:
147+ logger.exception('Could not insert image')
148+ pageview.insert_links([file]) # image type not supported?
149+ else:
150+ pageview.insert_links([file])
151+
152 return True
153-
154
155=== modified file 'zim/gui/widgets.py'
156--- zim/gui/widgets.py 2010-04-17 20:09:38 +0000
157+++ zim/gui/widgets.py 2010-04-24 13:30:35 +0000
158@@ -1022,7 +1022,7 @@
159
160 def __init__(self, ui, title, action=gtk.FILE_CHOOSER_ACTION_OPEN,
161 buttons=gtk.BUTTONS_OK_CANCEL, button=None,
162- help_text=None, fields=None, help=None
163+ help_text=None, fields=None, help=None, multiple=False
164 ):
165 if button is None:
166 if action == gtk.FILE_CHOOSER_ACTION_OPEN:
167@@ -1037,6 +1037,7 @@
168 self.set_default_size(500, 400)
169 self.filechooser = gtk.FileChooserWidget(action=action)
170 self.filechooser.set_do_overwrite_confirmation(True)
171+ self.filechooser.set_select_multiple(multiple)
172 self.filechooser.connect('file-activated', lambda o: self.response_ok())
173 self.vbox.add(self.filechooser)
174 # FIXME hook to expander to resize window
175@@ -1049,11 +1050,16 @@
176
177 def get_file(self):
178 '''Wrapper for filechooser.get_filename().
179- Returns a File object or None.
180+ Returns a File object or None (if multiple=False)
181+ or a list of File objects (if multiple=True).
182 '''
183- path = self.filechooser.get_filename()
184- if path is None: return None
185- else: return File(path)
186+ if self.filechooser.get_select_multiple():
187+ path = self.filechooser.get_filenames()
188+ return map(lambda x: File(x),path)
189+ else:
190+ path = self.filechooser.get_filename()
191+ if path is None: return None
192+ else: return File(path)
193
194 def get_dir(self):
195 '''Wrapper for filechooser.get_filename().
196@@ -1352,11 +1358,11 @@
197 pixbuf = self._pixbuf
198 else:
199 pixbuf = self._pixbuf.scale_simple(
200- wimg, himg, gtk.gdk.INTERP_HYPER)
201+ wimg, himg, gtk.gdk.INTERP_NEAREST)
202 else:
203 # Generate checkboard background while scaling
204 pixbuf = self._pixbuf.composite_color_simple(
205- wimg, himg, gtk.gdk.INTERP_HYPER,
206+ wimg, himg, gtk.gdk.INTERP_NEAREST,
207 255, 16, self._lightgrey.pixel, self._darkgrey.pixel )
208
209 # And align the image in the layout