Only in pyzim-maemo/: build_win32.py Only in pyzim-maemo/: .bzrignore diff -ur -x .bzr maemo/data/manual/About.txt pyzim-maemo/data/manual/About.txt --- maemo/data/manual/About.txt 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/data/manual/About.txt 2010-05-16 22:56:56.302653431 +0200 @@ -1,7 +1,5 @@ Content-Type: text/x-zim-wiki Wiki-Format: zim 0.4 -Content-Type: text/x-zim-wiki -Wiki-Format: zim 0.4 ====== About Zim ====== diff -ur -x .bzr maemo/data/manual/Bugs.txt pyzim-maemo/data/manual/Bugs.txt --- maemo/data/manual/Bugs.txt 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/data/manual/Bugs.txt 2010-05-11 17:47:25.264734000 +0200 @@ -7,5 +7,6 @@ Bugs can be reported in the bug tracker at http://bugs.launchpad.net/zim. Please see the [[FAQ]] before filing a bug report. -Please, report bugs under maemo devices in the garage page at http://zim.garage -.maemo.org + + +Bugs specific for maemo devices can be reported in the tracker on the maemo garage page at http://zim.garage.maemo.org diff -ur -x .bzr maemo/data/manual/Help/Check_Boxes.txt pyzim-maemo/data/manual/Help/Check_Boxes.txt --- maemo/data/manual/Help/Check_Boxes.txt 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/data/manual/Help/Check_Boxes.txt 2010-05-11 17:47:25.264734000 +0200 @@ -14,7 +14,7 @@ As you can see in this example checkboxes can have 3 states: [ ] open, [*] checked as 'OK' and [x] checked as 'NOK'. States can be toggle by clicking the checkbox with either the left mouse button or using the keyboard with '''' and '''' respectively. -To start a checkbox list type on an empty line '''[]or'''/'''()or''', this will automatically insert an open checkbox. Similarly you can type checked checkboxes using '''[*]''' or '''(*)''' and '''[x]''' or '''(x)''' respectively, followed by '''''' or ''''''. Lines that start with a checkbox behave like bullet list items, so you can indent by typing '''' after the checkbox and when you press '''' the new line will start with an empty checkbox automatically. +To start a checkbox list type on an empty line '''[]''' or '''()''', this will automatically insert an open checkbox. Similarly you can type checked checkboxes using '''[*]''' or '''(*)''' and '''[x]''' or '''(x)''' respectively, followed by '''''' or ''''''. Lines that start with a checkbox behave like bullet list items, so you can indent by typing '''' after the checkbox and when you press '''' the new line will start with an empty checkbox automatically. There is an option in the [[Preferences]] to have checkbox lists behave recursively. This means that the state of items with a sublist reflects the state of all child items. Checking the parent will check all child items, and checking the last child item will check the parent item automatically. Only in pyzim-maemo/data/manual/Help: Custom_Tools.txt Only in pyzim-maemo/data/manual/Help: Export diff -ur -x .bzr maemo/data/manual/Help/Notebooks.txt pyzim-maemo/data/manual/Help/Notebooks.txt --- maemo/data/manual/Help/Notebooks.txt 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/data/manual/Help/Notebooks.txt 2010-05-11 17:47:25.264734000 +0200 @@ -9,7 +9,7 @@ See [[Usage]] for more tips on how to use notebooks for specific tasks. -**When you run zim for the first time** you will get asked for a new folder to store the notebook. This will now become the defaul notebook, everytime you start zim this notebook is opened directly. If you whish to use more than one notebook you can create additional notebooks from the the "Open notebook" dialog (see the "//File//->//Open Another Notebook//" menu item). +**When you run zim for the first time** you will get asked for a new folder to store the notebook. This will now become the default notebook, everytime you start zim this notebook is opened directly. If you whish to use more than one notebook you can create additional notebooks from the the "Open notebook" dialog (see the "//File//->//Open Another Notebook//" menu item). ===== Open Notebook Dialog ===== The "Open notebook" dialog allows you to select from multiple notebooks, or to add new notebooks. When you **add** a notebook you will be asked for the folder to store the notebook. This can either be an new (empty) folder or an existing notebook folder. diff -ur -x .bzr maemo/data/manual/Help/Searching.txt pyzim-maemo/data/manual/Help/Searching.txt --- maemo/data/manual/Help/Searching.txt 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/data/manual/Help/Searching.txt 2010-05-16 22:57:17.650703391 +0200 @@ -1,7 +1,5 @@ Content-Type: text/x-zim-wiki Wiki-Format: zim 0.4 -Content-Type: text/x-zim-wiki -Wiki-Format: zim 0.4 ====== Searching ====== diff -ur -x .bzr maemo/data/manual/Plugins/Insert_Screenshot.txt pyzim-maemo/data/manual/Plugins/Insert_Screenshot.txt --- maemo/data/manual/Plugins/Insert_Screenshot.txt 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/data/manual/Plugins/Insert_Screenshot.txt 2010-05-11 17:47:25.264734000 +0200 @@ -3,6 +3,8 @@ ====== Insert Screenshot ====== -This plugin adds a dialog that allows you to aquire a screenshot of the desktop or of a particular window and directly insert the image into the current zim page. This plugin is based on the "scrot" applications to take the actual screenshots. +This plugin adds a dialog that allows you to aquire a screenshot of the desktop or of a particular window and directly insert the image into the current zim page. -**Dependencies:** This plugin requires the "scrot" (or "screenshot-tool" in maemo devices) application to be installed. In specific the "scrot" command should be available in the system path. +**Dependencies:** This plugin requires the "scrot" application to be installed. In specific the "scrot" command should be available in the system path. + +On maemo devices "screenshot-tool" will be used as an alternative. Only in pyzim-maemo/data/manual: .zim Only in maemo/data: preferences.conf Only in pyzim-maemo/data/templates: latex Only in pyzim-maemo/: debian Only in pyzim-maemo/HACKING/Ideas: Transclusion.txt Only in pyzim-maemo/HACKING: Release_checklist.txt Only in pyzim-maemo/HACKING: .zim Only in pyzim-maemo/: maemo Only in pyzim-maemo/: MANIFEST.in Only in maemo/: PKG-INFO Only in pyzim-maemo/po: he.po Only in pyzim-maemo/po: ja.po Only in pyzim-maemo/po: ru.po Only in pyzim-maemo/po: sv.po Only in pyzim-maemo/po: tr.po diff -ur -x .bzr maemo/setup.py pyzim-maemo/setup.py --- maemo/setup.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/setup.py 2010-05-15 20:33:47.879329364 +0200 @@ -28,6 +28,15 @@ sys.exit(1) +# Get environment parameter for building for maemo +# We don't use auto-detection here because we want to be able to +# cross-compile a maemo package on another platform +build_target = os.environ.get('ZIM_BUILD_TARGET') or 'default' +assert build_target in ('default', 'maemo'), 'Unknown value for ZIM_BUILD_TARGET: %s' % build_target +if build_target == 'maemo': + print 'Building for Maemo...' + + # Helper routines def collect_packages(): @@ -82,6 +91,16 @@ files = [os.path.join(dir, f) for f in files] data_files.append((target, files)) + if build_target == 'maemo': + # Remove default .desktop files and replace with our set + prefix = os.path.join('share', 'zim', 'applications') + for i in reversed(range(len(data_files))): + if data_files[i][0].startswith(prefix): + data_files.pop(i) + + files = [f for f in os.listdir('maemo/applications') if f.endswith('.desktop')] + data_files.append((prefix, files)) + # .po files -> PREFIX/share/locale/.. for pofile in [f for f in os.listdir('po') if f.endswith('.po')]: pofile = os.path.join('po', pofile) @@ -211,6 +230,10 @@ if version_info == (2, 5): dependencies.append('simplejson') +if build_target == 'maemo': + scripts = ['zim.py', 'maemo/modest-mailto.sh'] +else: + scripts = ['zim.py'] setup( # wire overload commands @@ -230,7 +253,7 @@ author_email = 'pardus@cpan.org', license = 'GPL', url = __url__, - scripts = ['zim.py'], + scripts = scripts, packages = collect_packages(), data_files = collect_data_files(), requires = dependencies Only in pyzim-maemo/tests: async.py Only in pyzim-maemo/: website Only in pyzim-maemo/xdg: hildon Only in pyzim-maemo/zim: async.py diff -ur -x .bzr maemo/zim/config.py pyzim-maemo/zim/config.py --- maemo/zim/config.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/zim/config.py 2010-05-11 17:47:25.264734000 +0200 @@ -27,6 +27,28 @@ logger = logging.getLogger('zim.config') +if os.name == 'nt': + # Windows specific environment variables + # os.environ does not support setdefault() ... + if not 'USER' in os.environ or not os.environ['USER']: + os.environ['USER'] = os.environ['USERNAME'] + + if not 'HOME' in os.environ or not os.environ['HOME']: + if 'USERPROFILE' in os.environ: + os.environ['HOME'] = os.environ['USERPROFILE'] + elif 'HOMEDRIVE' in os.environ and 'HOMEPATH' in os.environ: + home = os.environ['HOMEDRIVE'] + os.environ['HOMEPATH'] + os.environ['HOME'] = home + +assert zim.fs.isdir(os.environ['HOME']), \ + 'ERROR: environment variable $HOME not set correctly' + +if not 'USER' in os.environ or not os.environ['USER']: + # E.g. Maemo doesn't define $USER + os.environ['USER'] = os.path.basename(os.environ['HOME']) + logger.info('Environment variable $USER was not set') + + ZIM_DATA_DIR = None XDG_DATA_HOME = None XDG_DATA_DIRS = None Only in pyzim-maemo/zim/formats: latex.py Only in pyzim-maemo/zim/gui: customtools.py diff -ur -x .bzr maemo/zim/gui/imagegeneratordialog.py pyzim-maemo/zim/gui/imagegeneratordialog.py --- maemo/zim/gui/imagegeneratordialog.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/zim/gui/imagegeneratordialog.py 2010-05-16 22:31:12.460771774 +0200 @@ -6,8 +6,8 @@ import logging from zim.fs import * -from zim.gui.widgets import Dialog, ImageView, Button, QuestionDialog, scrolled_text_view -from zim.gui import maemo +from zim.gui.widgets import ui_environment, \ + Dialog, ImageView, Button, QuestionDialog, scrolled_text_view logger = logging.getLogger('zim.gui') @@ -22,11 +22,11 @@ # TODO: use uistate to remember pane position def __init__(self, ui, title, generator, image=None, **opt): - if maemo: - WSIZE=(600,480) + if ui_environment['platform'] == 'maemo': + defaultsize = (600,480) # FIXME why is a larger size needed ?? else: - WSIZE=(450,300) - Dialog.__init__(self, ui, title, defaultwindowsize=WSIZE, **opt) + defaultsize = (450,300) + Dialog.__init__(self, ui, title, defaultwindowsize=defaultsize, **opt) self.generator = generator self.imagefile = None self.logfile = None diff -ur -x .bzr maemo/zim/gui/__init__.py pyzim-maemo/zim/gui/__init__.py --- maemo/zim/gui/__init__.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/zim/gui/__init__.py 2010-05-16 22:43:17.796519824 +0200 @@ -28,13 +28,6 @@ import logging import gobject import gtk -try: - import hildon - gtkWindow=hildon.Window - maemo=True -except: - gtkWindow=gtk.Window - maemo=False import zim from zim import NotebookInterface, NotebookLookupError @@ -51,8 +44,10 @@ from zim.gui.pathbar import NamespacePathBar, RecentPathBar, HistoryPathBar from zim.gui.pageindex import PageIndex from zim.gui.pageview import PageView -from zim.gui.widgets import Button, MenuButton, \ - Dialog, ErrorDialog, QuestionDialog, FileDialog, ProgressBarDialog +from zim.gui.widgets import ui_environment, \ + Button, MenuButton, \ + Window, Dialog, \ + ErrorDialog, QuestionDialog, FileDialog, ProgressBarDialog from zim.gui.clipboard import Clipboard from zim.gui.applications import get_application, CustomToolManager @@ -160,27 +155,28 @@ TOOLBAR_ICONS_SMALL = 'small' TOOLBAR_ICONS_TINY = 'tiny' -if maemo: - ui_preferences = ( - # key, type, category, label, default - ('tearoff_menus', 'bool', None, None, False), - # T: Option in the preferences dialog not shown. - # Maemo can't have tearoff_menus - ('toggle_on_ctrlspace', 'bool', None, None, True), - # T: Option in the preferences dialog not shown. - # There is no ALT key on maemo devices - ) -else: - ui_preferences = ( + +ui_preferences = ( # key, type, category, label, default ('tearoff_menus', 'bool', 'Interface', _('Add \'tearoff\' strips to the menus'), False), # T: Option in the preferences dialog ('toggle_on_ctrlspace', 'bool', 'Interface', _('Use to switch to the side pane\n(If disabled you can still use )'), False), # T: Option in the preferences dialog # default value is False because this is mapped to switch between - # char sets in cerain international key mappings + # char sets in certain international key mappings ) +if ui_environment['platform'] == 'maemo': + # Maemo specific settngs + ui_preferences = ( + # key, type, category, label, default + ('tearoff_menus', 'bool', None, None, False), + # Maemo can't have tearoff_menus + ('toggle_on_ctrlspace', 'bool', None, None, True), + # There is no ALT key on maemo devices + ) + + # Load custom application icons as stock def load_zim_stock_icons(): @@ -313,13 +309,13 @@ 'file_browser': ['xdg-open', 'startfile'], 'web_browser': ['xdg-open', 'startfile'] } - if maemo: + if ui_environment['platform'] == 'maemo': apps = { - 'email_client': ['modest', 'startfile'], - 'file_browser': ['hildon-mime-summon', 'startfile'], - 'web_browser': ['webbrowser', 'webbrowser'] + 'email_client': ['modest'], + 'file_browser': ['hildon-mime-summon'], + 'web_browser': ['webbrowser'] } - + for type in apps.keys(): prefs = self.preferences['GtkInterface'] if type in prefs and prefs[type] \ @@ -351,25 +347,34 @@ self.mainwindow, 'do_set_toolbar_size') self.add_ui(data_file('menubar.xml').read(), self) + if ui_environment['platform'] == 'maemo': + # Hardware fullscreen key is F6 in Nxxx devices + group = gtk.AccelGroup() + group.connect_group( + gtk.gdk.keyval_from_name('Left'), 0, gtk.ACCEL_VISIBLE, + lambda o: self.mainwindow.toggle_fullscreen() ) + self.mainwindow.add_accel_group(group) + self.load_plugins() self._custom_tool_ui_id = None self._custom_tool_actiongroup = None self.load_custom_tools() - self.uimanager.ensure_update() - # prevent flashing when the toolbar is after showing the window - # and do this before connecting signal below for accelmap - if maemo: + if ui_environment['platform'] == 'maemo': # Move the menu to the hildon menu - menu=gtk.Menu() + menu = gtk.Menu() for child in self.mainwindow.menubar.get_children(): child.reparent(menu) self.mainwindow.set_menu(menu) - # Hardware fullscreen key is F6 in Nxxx devices - self.mainwindow.connect('key-press-event', - lambda o, event: event.keyval == gtk.keysyms.F6 - and self.mainwindow.toggle_fullscreen()) + self.mainwindow.menubar.hide() + # FIXME need to check the effect of this hack when plugins + # load menu items, e.g. when they are enabled from the + # preferences menu. + + self.uimanager.ensure_update() + # prevent flashing when the toolbar is after showing the window + # and do this before connecting signal below for accelmap accelmap = config_file('accelmap').file logger.debug('Accelmap: %s', accelmap.path) @@ -1308,7 +1313,7 @@ gobject.type_register(GtkInterface) -class MainWindow(gtkWindow): +class MainWindow(Window): '''Main window of the application, showing the page index in the side pane and a pageview with the current page. Alse includes the menubar, toolbar, statusbar etc. @@ -1316,7 +1321,7 @@ def __init__(self, ui, fullscreen=False, geometry=None): '''Constructor''' - gtkWindow.__init__(self) + Window.__init__(self) self._fullscreen = False self.ui = ui @@ -1377,9 +1382,6 @@ 'toggle-overwrite', self.do_textview_toggle_overwrite) vbox2.add(self.pageview) - # maemo window menu requires this approach because it is a popup dialog - self.pageindex.treeview.connect('focus-in-event', lambda sender, e, me: me.pageview.disable_actiongroup(), self) - # create statusbar hbox = gtk.HBox(spacing=0) vbox.pack_start(hbox, False, True, False) @@ -1461,14 +1463,14 @@ space = gtk.gdk.unicode_to_keyval(ord(' ')) group = gtk.AccelGroup() + group.connect_group( # + space, gtk.gdk.MOD1_MASK, gtk.ACCEL_VISIBLE, + self.do_switch_focus) + if self.ui.preferences['GtkInterface']['toggle_on_ctrlspace']: group.connect_group( # space, gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE, self.do_switch_focus) - else: - group.connect_group( # - space, gtk.gdk.MOD1_MASK, gtk.ACCEL_VISIBLE, - self.do_switch_focus) self.add_accel_group(group) self._switch_focus_accelgroup = group @@ -1738,7 +1740,8 @@ self.uistate.setdefault('show_menubar', True) self.uistate.setdefault('show_menubar_fullscreen', True) self.uistate.setdefault('show_toolbar', True) - if maemo: + if ui_environment['platform'] == 'maemo': + # FIXME - why is this needed ?? self.uistate.setdefault('show_toolbar_fullscreen', True) else: self.uistate.setdefault('show_toolbar_fullscreen', False) @@ -1857,11 +1860,11 @@ MenuButton.popup_menu(self, event) -class PageWindow(gtkWindow): +class PageWindow(Window): '''Secondairy window, showing a single page''' def __init__(self, ui, page): - gtkWindow.__init__(self) + Window.__init__(self) self.ui = ui self.set_title(page.name + ' - Zim') diff -ur -x .bzr maemo/zim/gui/notebookdialog.py pyzim-maemo/zim/gui/notebookdialog.py --- maemo/zim/gui/notebookdialog.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/zim/gui/notebookdialog.py 2010-05-16 22:47:07.143604861 +0200 @@ -17,8 +17,7 @@ from zim.fs import * from zim.notebook import get_notebook_list, init_notebook from zim.config import data_file -from zim.gui.widgets import Dialog, IconButton -from zim.gui import maemo +from zim.gui.widgets import ui_environment, Dialog, IconButton logger = logging.getLogger('zim.gui.notebookdialog') @@ -351,8 +350,8 @@ self.vbox.pack_start(label, False) if name is None and folder is None: name = 'Notes' - if maemo: - folder = '~/MyDocs/Notes' + if ui_environment['platform'] == 'maemo': + folder = '~/MyDocs/Notes' # FIXME is 'MyDocs' an official folder on maemo ? else: folder = '~/Notes' self.add_fields(( diff -ur -x .bzr maemo/zim/gui/pageview.py pyzim-maemo/zim/gui/pageview.py --- maemo/zim/gui/pageview.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/zim/gui/pageview.py 2010-05-16 22:45:22.155699692 +0200 @@ -25,13 +25,13 @@ from zim.formats import get_format, \ ParseTree, TreeBuilder, ParseTreeBuilder, \ BULLET, CHECKED_BOX, UNCHECKED_BOX, XCHECKED_BOX -from zim.gui.widgets import Dialog, FileDialog, ErrorDialog, \ - Button, IconButton, BrowserTreeView, InputEntry, \ +from zim.gui.widgets import ui_environment, \ + Dialog, FileDialog, ErrorDialog, \ + Button, IconButton, MenuButton, BrowserTreeView, InputEntry, \ rotate_pixbuf from zim.gui.applications import OpenWithMenu from zim.gui.clipboard import Clipboard, \ PARSETREE_ACCEPT_TARGETS, parsetree_from_selectiondata -from zim.gui import maemo logger = logging.getLogger('zim.gui.pageview') @@ -58,10 +58,11 @@ KEYVALS_LEFT_TAB = map(gtk.gdk.keyval_from_name, ('ISO_Left_Tab',)) # Maemo hildon input method keyboard doesn't emit keypress events except for TAB, ENTER and BACKSPACE +# FIXME this comment makes a statement without a conclusion #~ CHARS_END_OF_WORD = (' ', ')', '>', '.', '!', '?') -CHARS_END_OF_WORD = ('\t',' ', ')', '>') +CHARS_END_OF_WORD = ('\t', ' ', ')', '>') KEYVALS_END_OF_WORD = map( - gtk.gdk.unicode_to_keyval, map(ord, CHARS_END_OF_WORD[1:])) + KEYVALS_TAB + gtk.gdk.unicode_to_keyval, map(ord, CHARS_END_OF_WORD)) + KEYVALS_TAB KEYVALS_ASTERISK = ( gtk.gdk.unicode_to_keyval(ord('*')), gtk.gdk.keyval_from_name('KP_Multiply')) @@ -123,38 +124,7 @@ ('toggle_format_strike', 'gtk-strikethrough', _('_Strike'), '', _('Strike')), ) -if maemo: - ui_preferences = ( - # key, type, category, label, default - ('follow_on_enter', 'bool', None, - None, True), - # T: option in preferences dialog not shown - # There is no ALT key on maemo devices - ('read_only_cursor', 'bool', 'Interface', - _('Show the cursor also for pages that can not be edited'), False), - # T: option in preferences dialog - ('autolink_camelcase', 'bool', 'Editing', - _('Automatically turn "CamelCase" words into links'), True), - # T: option in preferences dialog - ('autolink_files', 'bool', 'Editing', - _('Automatically turn file paths into links'), True), - # T: option in preferences dialog - ('autoselect', 'bool', 'Editing', - _('Automatically select the current word when you apply formatting'), True), - # T: option in preferences dialog - ('unindent_on_backspace', 'bool', None, - None, True), - # T: option in preferences dialog not shown - # There is no hardware TAB key on maemo devices - ('recursive_indentlist', 'bool', 'Editing', - _('(Un-)Indenting a list item also change any sub-items'), True), - # T: option in preferences dialog - ('recursive_checklist', 'bool', 'Editing', - _('Checking a checkbox also change any sub-items'), False), - # T: option in preferences dialog - ) -else: - ui_preferences = ( +ui_preferences = ( # key, type, category, label, default ('follow_on_enter', 'bool', 'Interface', _('Use the key to follow links\n(If disabled you can still use )'), True), @@ -182,6 +152,21 @@ # T: option in preferences dialog ) +if ui_environment['platform'] == 'maemo': + # Manipulate preferences with Maemo specific settings + ui_preferences = list(ui_preferences) + for i in range(len(ui_preferences)): + if ui_preferences[i][0] == 'follow_on_enter': + ui_preferences[i] = \ + ('follow_on_enter', 'bool', None, None, True), + # There is no ALT key on maemo devices + elif ui_preferences[i][0] == 'unindent_on_backspace': + ui_preferences[i] = \ + ('unindent_on_backspace', 'bool', None, None, True), + # There is no hardware TAB key on maemo devices + ui_preferences = tuple(ui_preferences) + + _is_zim_tag = lambda tag: hasattr(tag, 'zim_type') _is_indent_tag = lambda tag: _is_zim_tag(tag) and tag.zim_type == 'indent' _is_not_indent_tag = lambda tag: _is_zim_tag(tag) and tag.zim_type != 'indent' @@ -221,12 +206,13 @@ twoletter_re = re.compile(r'[%(letters)s]{2}' % _classes) del _classes +# E.g. Maemo devices have no hardware [] keys, +# so allow () to be used for the same purpose autoformat_bullets = { '*': BULLET, '[]': UNCHECKED_BOX, '[*]': CHECKED_BOX, '[x]': XCHECKED_BOX, - # Maemo devices have no hardware [] keys, allow () to be used for the same purpose '()': UNCHECKED_BOX, '(*)': CHECKED_BOX, '(x)': XCHECKED_BOX, @@ -1383,7 +1369,13 @@ self.smart_remove_tags(_is_link_tag, start, end) self.set_editmode_from_cursor() - def toggle_checkbox(self, iter, checkbox_type = None): + def toggle_checkbox(self, iter, checkbox_type=None): + '''Toggles checkbox at iter. If checkbox_type is given, it + toggles between this type and unchecked. Otherwise it rotates + through unchecked, checked and xchecked. + ''' + # and specify checkbox_type + # but left mouse click does not bullet = self.get_bullet_at_iter(iter) if bullet in (UNCHECKED_BOX, CHECKED_BOX, XCHECKED_BOX): if checkbox_type: @@ -1392,7 +1384,8 @@ else: icon = bullet_types[checkbox_type] else: - next = (list(CHECKBOXES).index(bullet) + 1) % len(CHECKBOXES) + i = CHECKBOXES.index(bullet) + next = (i + 1) % len(CHECKBOXES) icon = bullet_types[CHECKBOXES[next]] else: return False @@ -2389,7 +2382,8 @@ buffer.apply_tag(tag, start, end) return True - if (char == ' ' or char == chr(9)) and start.starts_line() and word in autoformat_bullets: + if (char == ' ' or char == '\t') and start.starts_line() \ + and word in autoformat_bullets: # format bullet and checkboxes end.forward_char() # also overwrite the space triggering the action mark = buffer.create_mark(None, end) @@ -2863,7 +2857,6 @@ ## Create search box self.find_bar = FindBar(textview=self.view) - self.find_bar.connect('focus-in-event', lambda sender, e, me: me.disable_actiongroup(), self) self.pack_end(self.find_bar, False) self.find_bar.hide() @@ -2890,13 +2883,6 @@ #~ action.connect('activate', lambda o, *a: logger.warn(o.get_name())) action.connect('activate', self.do_toggle_format_action) - - # HACK, this makes sure we do not hijack keybindings like - # ^C and ^V while we are not focus (e.g. paste in find bar) - # Under maemo the menu gets the focus, so we can't just use the - # focus-out event, and must wire the focus-in event of the affected widgets - self.view.connect('focus-in-event', lambda sender, e, me: me.enable_actiongroup(), self) - # Extra keybinding for undo - default is Z (see HIG) def do_undo(*a): if not self.readonly: @@ -2915,14 +2901,6 @@ self.ui.connect('open-notebook', self.on_open_notebook) self.ui.connect_object('readonly-changed', PageView.set_readonly, self) - def enable_actiongroup(self): - for action in self.actiongroup.list_actions(): - action.set_sensitive(action.zim_readonly or not self.readonly) - - def disable_actiongroup(self): - for action in self.actiongroup.list_actions(): - action.set_sensitive(False) - def grab_focus(self): self.view.grab_focus() @@ -2978,6 +2956,22 @@ TextBuffer.tag_styles[tag] = attrib def on_open_notebook(self, ui, notebook): + # HACK, this makes sure we do not hijack keybindings like + # ^C and ^V while we are not focus (e.g. paste in find bar) + # Put it here to ensure mainwindow is initialized. + def set_actiongroup_sensitive(window, widget): + #~ print '!! FOCUS SET:', widget + # Immitate logic in self.set_readonly() + sensitive = widget is self.view + if sensitive: + for action in self.actiongroup.list_actions(): + action.set_sensitive( + action.zim_readonly or not self.readonly) + else: + for action in self.actiongroup.list_actions(): + action.set_sensitive(False) + window = self.get_toplevel() + window.connect('set-focus', set_actiongroup_sensitive) def assert_not_modified(page, *a): if page == self.page \ @@ -3881,9 +3875,9 @@ return True -class FindWidget(gtk.Widget): +class FindWidget(object): '''Base class for FindBar and FindAndReplaceDialog''' - + def __init__(self, textview): self.textview = textview @@ -3892,49 +3886,39 @@ 'changed', self.__class__.on_find_entry_changed, self) self.find_entry.connect_object( 'activate', self.__class__.on_find_entry_activate, self) - self.find_entry.connect('focus-in-event', self.__emit_focus_in_event) - + self.next_button = Button(_('_Next'), gtk.STOCK_GO_FORWARD) # T: button in find bar and find & replace dialog self.next_button.connect_object( 'clicked', self.__class__.find_next, self) - self.next_button.connect('focus-in-event', self.__emit_focus_in_event) self.next_button.set_sensitive(False) self.previous_button = Button(_('_Previous'), gtk.STOCK_GO_BACK) # T: button in find bar and find & replace dialog self.previous_button.connect_object( 'clicked', self.__class__.find_previous, self) - self.previous_button.connect('focus-in-event', self.__emit_focus_in_event) self.previous_button.set_sensitive(False) self.case_option_checkbox = gtk.CheckButton(_('Match _case')) # T: checkbox option in find bar and find & replace dialog self.case_option_checkbox.connect_object( 'toggled', self.__class__.on_find_entry_changed, self) - self.case_option_checkbox.connect('focus-in-event', self.__emit_focus_in_event) self.word_option_checkbox = gtk.CheckButton(_('Whole _word')) # T: checkbox option in find bar and find & replace dialog self.word_option_checkbox.connect_object( 'toggled', self.__class__.on_find_entry_changed, self) - self.word_option_checkbox.connect('focus-in-event', self.__emit_focus_in_event) self.regex_option_checkbox = gtk.CheckButton(_('_Regular expression')) # T: checkbox option in find bar and find & replace dialog self.regex_option_checkbox.connect_object( 'toggled', self.__class__.on_find_entry_changed, self) - self.regex_option_checkbox.connect('focus-in-event', self.__emit_focus_in_event) self.highlight_checkbox = gtk.CheckButton(_('_Highlight')) # T: checkbox option in find bar and find & replace dialog self.highlight_checkbox.connect_object( 'toggled', self.__class__.on_highlight_toggled, self) - self.highlight_checkbox.connect('focus-in-event', self.__emit_focus_in_event) - def __emit_focus_in_event(self, o, e): - self.emit('focus-in-event', e) - @property def _flags(self): flags = 0 @@ -4018,24 +4002,26 @@ self.pack_start(self.find_entry, False) self.pack_start(self.previous_button, False) self.pack_start(self.next_button, False) - if maemo: - # Nxx0 devices have not enough space for so many widgets, so let's put options in a menu button. - options_button = gtk.MenuToolButton(None,None) - options_menu = gtk.Menu() - item1 = gtk.CheckMenuItem(self.case_option_checkbox.get_label()) - item1.connect('toggled', lambda sender, me: me.case_option_checkbox.set_active(sender.get_active()),self) - item1.show() - options_menu.append(item1) - item2 = gtk.CheckMenuItem(self.highlight_checkbox.get_label()) - item2.connect('toggled', lambda sender, me: me.highlight_checkbox.set_active(sender.get_active()),self) - item2.show() - options_menu.append(item2) - options_menu.show() - options_button.set_menu(options_menu) - self.pack_start(options_button, False) - # HACK: remove button - b = options_button.get_children()[0] - b.remove(b.get_children()[0]) + if ui_environment['smallscreen']: + # E.g. Maemo Nxx0 devices have not enough space for so many + # widgets, so let's put options in a menu button. + # FIXME need to rewrite this hack to integrate nicely with + # the FindWidget base class + # FIXME ideally behavior would switch on the fly based on + # actual screensize - can we detect when these widgets + # fit or not ? (And re-draw when the screensize changes ?) + # Alternatively we can always put options in this menu + menu = gtk.Menu() + item = gtk.CheckMenuItem(self.case_option_checkbox.get_label()) + item.connect('toggled', + lambda sender, me: me.case_option_checkbox.set_active(sender.get_active()), self) + menu.append(item) + item = gtk.CheckMenuItem(self.highlight_checkbox.get_label()) + item.connect('toggled', + lambda sender, me: me.highlight_checkbox.set_active(sender.get_active()),self) + menu.append(item) + button = MenuButton(_('_Options'), menu) # T: Options button + self.pack_start(button, False) else: self.pack_start(self.case_option_checkbox, False) self.pack_start(self.highlight_checkbox, False) Only in pyzim-maemo/zim/gui: pageview.py.~1~ diff -ur -x .bzr maemo/zim/gui/preferencesdialog.py pyzim-maemo/zim/gui/preferencesdialog.py --- maemo/zim/gui/preferencesdialog.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/zim/gui/preferencesdialog.py 2010-05-16 22:33:55.394698567 +0200 @@ -9,9 +9,8 @@ import zim.plugins from zim.gui.applications import \ get_application, get_helper_applications, CustomCommandDialog -from zim.gui.widgets import Dialog, Button, BrowserTreeView +from zim.gui.widgets import Dialog, Button, BrowserTreeView, scrolled_text_view from zim.gui.pageview import PageView -from zim.gui import maemo logger = logging.getLogger('zim.gui.preferencesdialog') @@ -27,8 +26,9 @@ Dialog.__init__(self, ui, _('Preferences')) # T: Dialog title gtknotebook = gtk.Notebook() self.vbox.add(gtknotebook) - if maemo: - self.resize(800,480) + #~ if maemo: + #~ self.resize(800,480) + # Dynamic tabs for category, preferences in ui.preferences_register.items(): table = gtk.Table() @@ -175,20 +175,11 @@ self.add(vbox) # Textview with scrollbars to show plugins info. Required by small screen devices - textview = gtk.TextView() + swindow, textview = scrolled_text_view() textview.set_cursor_visible(False) - textview.set_editable(False) - bold_tag = gtk.TextTag('bold') - bold_tag.set_property('weight', pango.WEIGHT_BOLD) - red_tag = gtk.TextTag('red') - red_tag.set_property('foreground', '#FF0000') - self.plugin_info_textbuffer = textview.get_buffer() - self.plugin_info_textbuffer.get_tag_table().add(bold_tag) - self.plugin_info_textbuffer.get_tag_table().add(red_tag) - swindow = gtk.ScrolledWindow() - swindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) - swindow.add(textview) - + self.textbuffer = textview.get_buffer() + self.textbuffer.create_tag('bold', weight=pango.WEIGHT_BOLD) + self.textbuffer.create_tag('red', foreground='#FF0000') vbox.pack_start(swindow, True) hbox = gtk.HBox(spacing=5) @@ -210,28 +201,50 @@ active = treeview.get_model()[path][0] klass = treeview.get_model()[path][3] self._klass = klass + # Insert plugin info into textview with proper formatting - self.plugin_info_textbuffer.delete(self.plugin_info_textbuffer.get_start_iter(), self.plugin_info_textbuffer.get_end_iter()) - self.plugin_info_textbuffer.insert_with_tags_by_name(self.plugin_info_textbuffer.get_end_iter(), _('Name'), 'bold') - self.plugin_info_textbuffer.insert(self.plugin_info_textbuffer.get_end_iter(), '\n'+klass.plugin_info['name'].strip() + '\n\n') - self.plugin_info_textbuffer.insert_with_tags_by_name(self.plugin_info_textbuffer.get_end_iter(), _('Description'), 'bold') - self.plugin_info_textbuffer.insert(self.plugin_info_textbuffer.get_end_iter(), '\n'+klass.plugin_info['description'].strip() + '\n\n') - self.plugin_info_textbuffer.insert_with_tags_by_name(self.plugin_info_textbuffer.get_end_iter(), _('Dependencies'), 'bold') - + self.textbuffer.delete(*self.textbuffer.get_bounds()) # clear + self.textbuffer.insert_with_tags_by_name( + self.textbuffer.get_end_iter(), + _('Name') + '\n', 'bold') # T: Heading in plugins tab of preferences dialog + self.textbuffer.insert( + self.textbuffer.get_end_iter(), + klass.plugin_info['name'].strip() + '\n\n') + self.textbuffer.insert_with_tags_by_name( + self.textbuffer.get_end_iter(), + _('Description') + '\n', 'bold') # T: Heading in plugins tab of preferences dialog + self.textbuffer.insert( + self.textbuffer.get_end_iter(), + klass.plugin_info['description'].strip() + '\n\n') + self.textbuffer.insert_with_tags_by_name( + self.textbuffer.get_end_iter(), + _('Dependencies') + '\n', 'bold') # T: Heading in plugins tab of preferences dialog + #construct dependency list, missing dependencies are marked red dependencies = klass.check_dependencies() if not(dependencies): - self.plugin_info_textbuffer.insert(self.plugin_info_textbuffer.get_end_iter(), '\n'+_('No dependencies')) + self.textbuffer.insert( + self.textbuffer.get_end_iter(), + _('No dependencies') + '\n') # T: label in plugin info in preferences dialog else: for dependency in dependencies: text, ok = dependency if ok: - self.plugin_info_textbuffer.insert(self.plugin_info_textbuffer.get_end_iter(),u'\n\u2022 ' + text + ' - ' + _('OK')) # T: dependency is OK + self.textbuffer.insert( + self.textbuffer.get_end_iter(), + u'\u2022 ' + text + ' - ' + _('OK') + '\n') # T: dependency is OK else: - self.plugin_info_textbuffer.insert_with_tags_by_name(self.plugin_info_textbuffer.get_end_iter(), u'\n\u2022 ' + text +' - ' + _('Failed'), 'red') # T: dependency failed - - self.plugin_info_textbuffer.insert_with_tags_by_name(self.plugin_info_textbuffer.get_end_iter(), '\n\n' + _('Author'), 'bold') - self.plugin_info_textbuffer.insert(self.plugin_info_textbuffer.get_end_iter(), '\n'+klass.plugin_info['author'].strip()) + self.textbuffer.insert_with_tags_by_name( + self.textbuffer.get_end_iter(), + u'\u2022 ' + text +' - ' + _('Failed') + '\n', 'red') # T: dependency failed + + self.textbuffer.insert_with_tags_by_name( + self.textbuffer.get_end_iter(), + '\n' + _('Author') + '\n', 'bold') # T: Heading in plugins tab of preferences dialog + self.textbuffer.insert( + self.textbuffer.get_end_iter(), + klass.plugin_info['author'].strip()) + self.configure_button.set_sensitive(active and bool(klass.plugin_preferences)) self.plugin_help_button.set_sensitive('help' in klass.plugin_info) diff -ur -x .bzr maemo/zim/gui/widgets.py pyzim-maemo/zim/gui/widgets.py --- maemo/zim/gui/widgets.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/zim/gui/widgets.py 2010-05-16 22:42:15.062653650 +0200 @@ -14,7 +14,6 @@ import logging import sys -from zim.gui import maemo from zim.fs import * import zim.errors import zim.config @@ -35,6 +34,27 @@ gtk.gdk.unicode_to_keyval(ord('/')), gtk.gdk.keyval_from_name('KP_Divide')) +# UI Environment config. Would properly belong in zim.gui.__init__ +# but defined here to avoid unnecessary dependencies on zim.gui +ui_environment = { + 'platform': None, # platform name to trigger platform specific optimizations + 'maxscreensize': None, # max screensize _if_ fixed by the platform + 'smallscreen': False, # trigger optimizations for small screens +} + + +# Check for Maemo environment +try: + import hildon + Window = hildon.Window + ui_environment['platform'] = 'maemo' + ui_environment['maxscreensize'] = (800, 480) + ui_environment['smallscreen'] = True +except ImportError: + Window = gtk.Window + + + def _encode_xml(text): return text.replace('>', '>').replace('<', '<') @@ -269,14 +289,23 @@ self.label = gtk.Label() self.label.set_markup_with_mnemonic(label) else: - assert isinstance(label, gtk.Widget) + assert isinstance(label, gtk.Label) self.label = label + self.menu = menu self.button = gtk.ToggleButton() if status_bar_style: self.button.set_name('zim-statusbar-menubutton') self.button.set_relief(gtk.RELIEF_NONE) - self.button.add(self.label) + widget = self.label + else: + arrow = gtk.Arrow(gtk.ARROW_UP, gtk.SHADOW_NONE) + widget = gtk.HBox(spacing=3) + widget.pack_start(self.label, False) + widget.pack_start(arrow, False) + + + self.button.add(widget) # We need to wrap stuff in an eventbox in order to get the gdk.Window # which we need to get coordinates when positioning the menu self.eventbox = gtk.EventBox() @@ -586,24 +615,21 @@ title=format_title(title), flags=gtk.DIALOG_NO_SEPARATOR, ) - if not(maemo): + if not ui_environment['smallscreen']: self.set_border_width(10) self.vbox.set_spacing(5) + assert isinstance(defaultwindowsize, tuple) if hasattr(ui, 'uistate') and isinstance(ui.uistate, zim.config.ConfigDict): - assert isinstance(defaultwindowsize, tuple) key = self.__class__.__name__ self.uistate = ui.uistate[key] #~ print '>>', self.uistate self.uistate.setdefault('windowsize', defaultwindowsize, check=self.uistate.is_coord) - if not(maemo): - w, h = self.uistate['windowsize'] - else: - w, h = defaultwindowsize + w, h = self.uistate['windowsize'] self.set_default_size(w, h) else: self.uistate = { # used in tests/debug - 'windowsize': (-1, -1) + 'windowsize': defaultwindowsize } self._no_ok_action = False @@ -861,7 +887,7 @@ else: self.destroyed = True - if not(maemo): + if ui_environment['platform'] != 'maemo': w, h = self.get_size() self.uistate['windowsize'] = (w, h) self.save_uistate() @@ -1000,14 +1026,15 @@ elif action == gtk.FILE_CHOOSER_ACTION_SAVE: button = (None, gtk.STOCK_SAVE) # else Ok will do - Dialog.__init__(self, ui, title, + + if ui_environment['platform'] == 'maemo': + defaultsize = (800, 480) + else: + defaultsize = (500, 400) + + Dialog.__init__(self, ui, title, defaultwindowsize=defaultsize, buttons=buttons, button=button, help_text=help_text, help=help) - if self.uistate['windowsize'] == (-1, -1) and not(maemo): - self.uistate['windowsize'] = (500, 400) - self.set_default_size(500, 400) - elif maemo: - self.uistate['windowsize'] = (800, 480) - self.set_default_size(800, 480) + self.filechooser = gtk.FileChooserWidget(action=action) self.filechooser.set_do_overwrite_confirmation(True) self.filechooser.connect('file-activated', lambda o: self.response_ok()) diff -ur -x .bzr maemo/zim/__init__.py pyzim-maemo/zim/__init__.py --- maemo/zim/__init__.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/zim/__init__.py 2010-05-11 17:47:25.264734000 +0200 @@ -19,7 +19,6 @@ ''' import os -import os.path import sys import gettext import gobject @@ -32,26 +31,8 @@ from zim.errors import Error from zim.config import data_dir, config_file, log_basedirs, ZIM_DATA_DIR -logger = logging.getLogger('zim') -if os.name == 'nt': - # Windows specific environment variables - # os.environ does not support setdefault() ... - if not 'USER' in os.environ or not os.environ['USER']: - os.environ['USER'] = os.environ['USERNAME'] - - if not 'HOME' in os.environ or not os.environ['HOME']: - if 'USERPROFILE' in os.environ: - os.environ['HOME'] = os.environ['USERPROFILE'] - elif 'HOMEDRIVE' in os.environ and 'HOMEPATH' in os.environ: - home = os.environ['HOMEDRIVE'] + os.environ['HOMEPATH'] - os.environ['HOME'] = home - -assert zim.fs.isdir(os.environ['HOME']), 'ERROR: environment variable $HOME not set correctly' -if not(os.environ.has_key('USER')): - #Maemo doesn't define $USER - os.environ['USER'] = os.path.basename(os.environ['HOME']) - logger.info('Environment variable $USER not set') +logger = logging.getLogger('zim') if ZIM_DATA_DIR: # We are running from a source dir - use the locale data included there diff -ur -x .bzr maemo/zim/plugins/calendar.py pyzim-maemo/zim/plugins/calendar.py --- maemo/zim/plugins/calendar.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/zim/plugins/calendar.py 2010-05-16 23:02:23.346971415 +0200 @@ -9,8 +9,7 @@ from datetime import date as dateclass from zim.plugins import PluginClass -from zim.gui import maemo, Dialog -from zim.gui.widgets import Button +from zim.gui.widgets import Dialog, Button from zim.notebook import Path @@ -60,7 +59,7 @@ date_path_re = re.compile(r'^(.*:)?\d{4}:\d{2}:\d{2}$') - + class CalendarPlugin(PluginClass): plugin_info = { @@ -270,23 +269,17 @@ class CalendarDialog(Dialog): def __init__(self, plugin): - Dialog.__init__(self, plugin.ui, _('Calendar'), buttons=None) # T: dialog title + Dialog.__init__(self, plugin.ui, _('Calendar'), buttons=gtk.BUTTONS_CLOSE) # T: dialog title self.set_resizable(False) self.plugin = plugin self.calendar_widget = CalendarPluginWidget(plugin) self.vbox.add(self.calendar_widget) - hbox = gtk.HBox() - self.vbox.add(hbox) button = Button(_('_Today'), gtk.STOCK_JUMP_TO) # T: button label button.connect('clicked', self.do_today ) - hbox.pack_end(button, False) - button = Button(stock=gtk.STOCK_CLOSE) # T: button label - button.connect('clicked', - lambda o: self.destroy()) - hbox.pack_start(button, False) - + self.action_area.add(button) + self.action_area.reorder_child(button, 0) + def do_today(self, event): self.calendar_widget.select_date(dateclass.today()) - if maemo: self.destroy() diff -ur -x .bzr maemo/zim/plugins/linkmap/gui.py pyzim-maemo/zim/plugins/linkmap/gui.py --- maemo/zim/plugins/linkmap/gui.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/zim/plugins/linkmap/gui.py 2010-05-16 22:49:11.726708783 +0200 @@ -5,8 +5,7 @@ import gtk from zim._lib import xdot -from zim.gui.widgets import Dialog, IconButton -from zim.gui import maemo +from zim.gui.widgets import ui_environment, Dialog, IconButton from zim.plugins.linkmap import LinkMap @@ -44,11 +43,12 @@ class LinkMapDialog(Dialog): def __init__(self, ui, linkmap): - Dialog.__init__(self, ui, 'LinkMap', buttons=gtk.BUTTONS_CLOSE) - if maemo: - self.resize(800,480) + if ui_environment['platform'] == 'maemo': + defaultsize = (800, 480) # FIXME why do we need a larger size here ? else: - self.set_default_size(400, 400) + defaultsize = (400, 400) + Dialog.__init__(self, ui, 'LinkMap', + defaultwindowsize=defaultsize, buttons=gtk.BUTTONS_CLOSE) self.linkmap = linkmap hbox = gtk.HBox(spacing=5) diff -ur -x .bzr maemo/zim/plugins/linkmap/__init__.py pyzim-maemo/zim/plugins/linkmap/__init__.py --- maemo/zim/plugins/linkmap/__init__.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/zim/plugins/linkmap/__init__.py 2010-05-11 17:47:25.264734000 +0200 @@ -39,6 +39,7 @@ def disconnect(self): pass + class LinkMap(object): def __init__(self, notebook, path, depth=2): Only in pyzim-maemo/zim/plugins: screenshot.py Only in maemo/zim/plugins: scrot.py diff -ur -x .bzr maemo/zim/plugins/tasklist.py pyzim-maemo/zim/plugins/tasklist.py --- maemo/zim/plugins/tasklist.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/zim/plugins/tasklist.py 2010-05-16 22:52:16.014917831 +0200 @@ -8,11 +8,11 @@ import re import datetime -from zim.gui import maemo from zim.parsing import parse_date from zim.plugins import PluginClass from zim.notebook import Path -from zim.gui.widgets import Dialog, Button, IconButton, \ +from zim.gui.widgets import ui_environment, \ + Dialog, Button, IconButton, \ BrowserTreeView, SingleClickTreeView, \ gtk_get_style from zim.formats import UNCHECKED_BOX, CHECKED_BOX, XCHECKED_BOX @@ -83,11 +83,15 @@ class TaskListDialog(Dialog): def __init__(self, plugin): + if ui_environment['platform'] == 'maemo': + defaultsize = (800,480) + else: + defaultsize = (-1, -1) + Dialog.__init__(self, plugin.ui, _('Task List'), # T: dialog title + defaultwindowsize=defaultsize, buttons=gtk.BUTTONS_CLOSE, help=':Plugins:Task List') self.plugin = plugin - if maemo: - self.resize(800,480) hbox = gtk.HBox(spacing=5) self.vbox.pack_start(hbox, False) self.hpane = gtk.HPaned() @@ -243,11 +247,13 @@ column = gtk.TreeViewColumn(name, cell_renderer, text=i) column.set_resizable(True) column.set_sort_column_id(i) - if i == self.TASK_COL: + if i == self.TASK_COL: column.set_expand(True) - if maemo: + if ui_environment['platform'] == 'maemo': column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) column.set_fixed_width(250) + # FIXME probably should also limit the size of this + # column on other platforms ... self.append_column(column) # Add some rendering for the Prio column diff -ur -x .bzr maemo/zim/_version.py pyzim-maemo/zim/_version.py --- maemo/zim/_version.py 2010-05-17 21:49:15.287312000 +0200 +++ pyzim-maemo/zim/_version.py 2010-05-15 20:36:04.868807183 +0200 @@ -4,12 +4,12 @@ So don't edit it. :) """ -version_info = {'branch_nick': u'pyzim-trunk', - 'build_date': '2010-03-24 23:22:04 +0100', +version_info = {'branch_nick': u'pyzim-maemo', + 'build_date': '2010-05-15 20:36:04 +0200', 'clean': None, - 'date': '2010-03-24 23:06:16 +0100', - 'revision_id': 'pardus@cpan.org-20100324220616-xvlz2gtfiy0hx5to', - 'revno': 221} + 'date': '2010-03-30 22:01:46 +0200', + 'revision_id': 'pardus@cpan.org-20100330200146-m65cw6fd3knpppmv', + 'revno': 225} revisions = {}