Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
manuvarkey committed May 24, 2018
1 parent 87f5ff6 commit 48e1adf
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
Binary file modified cmbautomiser/ods_templates/dev.xlsx
Binary file not shown.
2 changes: 0 additions & 2 deletions cmbautomiser/view/bill.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,6 @@ def __init__(self, parent, data_object, bill_data, this_bill=None):
for row, bill in enumerate(self.bills):
if row != self.this_bill:
self.liststore_previous_bill.append([row + 1, bill.get_text()])
else:
break # do not add entries beyond

# Connect toggled signal of measurement view to callback
self.measurements_view.renderer_toggle.connect("toggled", self.onToggleCellRendererToggle)
Expand Down
11 changes: 9 additions & 2 deletions cmbautomiser/view/cellrenderercustomtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def do_remove_widget(self):
pass

def do_start_editing(self, event):
self.editor.grab_focus()
self.show_all()
GLib.timeout_add(50, self.editor.grab_focus)

def copy_clipboard(self):
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
Expand All @@ -143,6 +144,7 @@ def on_key_press_event(self, widget, event):
keyname = Gdk.keyval_name(event.get_keyval()[1])

accel_masks = (Gdk.ModifierType.CONTROL_MASK | \
Gdk.ModifierType.SHIFT_MASK | \
Gdk.ModifierType.MOD1_MASK)
enter_keynames = ('Return', 'KP_Enter')
cancel_keynames = ('Escape',)
Expand All @@ -158,6 +160,12 @@ def on_key_press_event(self, widget, event):
self.props.editing_canceled = True
self.editing_done()
return True
elif keyname in ('c','C') and (mask & Gdk.ModifierType.CONTROL_MASK):
self.copy_clipboard()
return True
elif keyname in ('v','V') and (mask & Gdk.ModifierType.CONTROL_MASK):
self.paste_clipboard()
return True
# Finish editing on tab
elif keyname in tab_keynames:
self.editing_done()
Expand Down Expand Up @@ -200,7 +208,6 @@ def do_start_editing(self, event, tree, path, background_area, cell_area, flags)
editable.connect('editing-done', self.editing_done, tree, path)
editable.set_text(text)
editable.set_size_request(cell_area.width-5, cell_area.height-5)
editable.show_all()
return editable

def editing_done(self, editable, tree, path):
Expand Down
10 changes: 5 additions & 5 deletions cmbautomiser/view/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def select_func(tree, path, col):
else:
path = tmodel.get_path(titer)
prev_column = columns[-1]
GLib.idle_add(select_func, treeview, path, prev_column)
GLib.timeout_add(50, select_func, treeview, path, prev_column)
return
else:
if colnum + 1 < len(columns):
Expand All @@ -119,7 +119,7 @@ def select_func(tree, path, col):
titer = tmodel.get_iter_first()
path = tmodel.get_path(titer)
next_column = columns[0]
GLib.idle_add(select_func, treeview, path, next_column)
GLib.timeout_add(50, select_func, treeview, path, next_column)
return
elif keyname in [Gdk.KEY_Return, Gdk.KEY_KP_Enter]:
if shift_pressed == 1:
Expand All @@ -128,23 +128,23 @@ def select_func(tree, path, col):
else:
rownum = 0
path = [rownum]
GLib.idle_add(select_func, treeview, path, col)
GLib.timeout_add(50, select_func, treeview, path, col)
return
else:
if rownum + 1 < len(rows):
rownum += 1
else:
rownum = len(rows) - 1
path = [rownum]
GLib.idle_add(select_func, treeview, path, col)
GLib.timeout_add(50, select_func, treeview, path, col)
return
elif keyname in [Gdk.KEY_Alt_L , Gdk.KEY_Alt_R , Gdk.KEY_Escape]: # unselect all
self.tree.get_selection().unselect_all()

def on_wrap_column_resized(self, column, pspec, cell):
""" Automatically adjust wrapwidth to column width"""

width = column.get_width() - 5
width = column.get_width()
oldwidth = cell.props.wrap_width

if width > 0 and width != oldwidth:
Expand Down
4 changes: 2 additions & 2 deletions installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# These three must be integers
!define VERSIONMAJOR 3
!define VERSIONMINOR 3
!define VERSIONBUILD 1
!define VERSIONBUILD 2
# These will be displayed by the "Click here for support information" link in "Add/Remove Programs"
# It is possible to use "mailto:" links in here to open the email client
!define HELPURL "mailto:manuvarkey@gmail.com" # "Support Information" link
Expand All @@ -28,7 +28,7 @@ LicenseData "license.txt"
# This will be in the installer/uninstaller's title bar
Name "${APPNAME}"
Icon "cmbautomiser.ico"
outFile "cmbautomiser-win32-3-3-1.exe"
outFile "cmbautomiser-win32-3-3-2.exe"

!include LogicLib.nsh

Expand Down

0 comments on commit 48e1adf

Please sign in to comment.