Skip to content

Commit

Permalink
UI cleanup and tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomato committed Jul 25, 2012
1 parent bf57aef commit 525ee52
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/BackgroundSubtract.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class BackgroundSubtract(TransformPlugin):
view = View(
VGroup(
Item('active'),
Item('capture_background'),
Item('capture_background', show_label=False),
label='Background Subtract',
show_border=True))

Expand Down
6 changes: 0 additions & 6 deletions src/MainHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ def action_save(self, info):
def action_choose_camera(self, info):
info.object.cameras_dialog.edit_traits()

def action_configure_camera(self, info):
info.object.camera.edit_traits()

def action_take_video(self, info):
win = info.object
if win.acquisition_thread is not None \
Expand All @@ -68,9 +65,6 @@ def action_take_photo(self, info):
win.camera.query_frame()
win.processing_queue.put(win.camera.frame, block=False)

def action_find_resolution(self, info):
pass

def closed(self, info, is_ok):
win = info.object
# Shut down the threads
Expand Down
35 changes: 10 additions & 25 deletions src/MainWindow.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/usr/bin/env python
# coding: utf8

import sys
import Queue as queue # in Python 3: import queue
from traits.api import (HasTraits, Instance, DelegatesTo, Button, Str, List,
Range)
from traitsui.api import (View, HSplit, Tabbed, HGroup, VGroup, Item, MenuBar,
from traitsui.api import (View, HSplit, Tabbed, VGroup, Item, MenuBar,
ToolBar, Action, Menu, EnumEditor, ListEditor, Group)
from pyface.api import error
from chaco.api import gray, pink, jet
Expand Down Expand Up @@ -33,7 +34,6 @@ class MainWindow(HasTraits):
camera = Instance(Camera)
id_string = DelegatesTo('camera')
resolution = DelegatesTo('camera')
frame_rate = DelegatesTo('camera')
status = Str()
screen = Instance(CameraImage, args=())
cmap = DelegatesTo('screen')
Expand Down Expand Up @@ -67,16 +67,6 @@ class MainWindow(HasTraits):
name='Choose &Camera...',
tooltip='Choose from a number of camera plugins',
action='action_choose_camera')
configure_camera = Action(
name='Con&figure Camera...',
tooltip='Open a dialog box to configure the camera. '
'There may be no parameters available to configure.',
image=find_icon('properties'),
action='action_configure_camera')
find_resolution_action = Action(
name='Find Resolution',
tooltip='Look for the best resolution for the webcam',
action='action_find_resolution')
take_video = Action(
name='Take &Video',
style='toggle',
Expand All @@ -97,14 +87,12 @@ class MainWindow(HasTraits):
Tabbed(
VGroup(
Item('id_string', style='readonly', label='Camera'),
HGroup(
Item('resolution'),
Item('find_resolution', show_label=False)),
Group(
Item('camera', show_label=False,
style='custom'),
label='Camera properties',
show_border=True),
Item('resolution', style='readonly',
format_str=u'%i \N{multiplication sign} %i'),
Group(
Item('camera', show_label=False, style='custom'),
label='Camera properties',
show_border=True),
label='Camera'),
VGroup(
Item('cmap', label='Color scale',
Expand All @@ -129,8 +117,7 @@ class MainWindow(HasTraits):
label='Transform'),
VGroup(Item('display_plugins', show_label=False,
editor=ListEditor(style='custom', mutable=False)),
label='Math'),
VGroup(label='Cross-section')),
label='Math')),
Item('screen', show_label=False, width=640, height=480,
style='custom')),
Item('status', style='readonly', show_label=False)),
Expand All @@ -140,9 +127,7 @@ class MainWindow(HasTraits):
Menu('|', save, '_', quit, name='&File'),
Menu(name='&Edit'),
Menu(name='&View'),
Menu('|',
choose_camera, configure_camera, find_resolution_action, '_',
take_photo, take_video,
Menu('|', choose_camera, '_', take_photo, take_video,
name='&Camera'),
Menu(name='&Math'),
Menu(about, name='&Help')),
Expand Down

0 comments on commit 525ee52

Please sign in to comment.