コード例 #1
0
ファイル: gui.py プロジェクト: yuntingcheng/TIME_Software
	def __init__(self):
	        super(SimpleExample1,self).__init__('CoolStuff')
                self._filename = ControlText('Filename')
                self._readcard = ControlText('Readout Card Number')
                self._frames = ControlText('Number of Frames')
                self._datamode = ControlText('Data Mode')
                self._button = ControlButton('Start Data Acquisition')
コード例 #2
0
    def __init__(self):
        super(SimpleExample1, self).__init__('my_variant_api')

        #init clinvar
        self._clinvariants = ControlTextArea('rsvariants', 'rs12315123')
        self._clinbutton = ControlButton('Press this button')
        self._clinresult = ControlTextArea('result')

        self._clinbutton.value = self.__clinbuttonAction
        #init flanking site
        self._flancchrom = ControlText('chrom')
        self._flancpos = ControlText('pos')
        self._flancthree = ControlText('expand_3prime', 300)
        self._flancfive = ControlText('expand_5prime', 300)
        self._flancassembly = ControlCombo('assembly')
        self._flancassembly.add_item('GRCh37')
        self._flancassembly.add_item('GRCh38')
        self._flancbutton = ControlButton('Press this button')
        self._flancresult = ControlTextArea('result')
        self._flancbutton.value = self.__flancbuttonAction

        self.formset = [{
            "Clinvar": ('_clinvariants', '_clinbutton', '_clinresult'),
            "Flanking Site": [('_flancchrom', '_flancpos', '_flancthree',
                               '_flancfive', '_flancassembly'), '_flancbutton',
                              '_flancresult']
        }]
コード例 #3
0
 def __init__(self):
     super(SimpleExample1, self).__init__('Simple Example 1')
     self._firstname = ControlText('First Name', 'Default value')
     self._middlename = ControlText('Middle name')
     self._lastname = ControlText('Last name')
     self._fullname = ControlText('Full name')
     self._button = ControlButton("press this button")
     self._button.value = self._buttonAction
コード例 #4
0
    def __init__(self):
        super(SimpleExample1, self).__init__('Simple example 1')

        #Definition of the forms fields
        self._firstname = ControlText('First name', 'Default value')
        self._middlename = ControlText('Middle name')
        self._lastname = ControlText('Lastname name')
        self._fullname = ControlText('Full name')
        self._button = ControlButton('Press this button')
 def __init__(self, isCreating):
     Client.__init__(self, '', '')
     BaseWidget.__init__(self, 'Client')
     self.__isCreating = isCreating
     self._idField = ControlText("Id")
     if not isCreating:
         self._idField.enabled = False
     self._nameField = ControlText("Name")
     self._buttonField = ControlButton('Add a new client')
     self._buttonField.value = self._updateAction
     self._label = ControlLabel("")
コード例 #6
0
ファイル: BasicWidget.py プロジェクト: mdavis60/RSGuide
    def __init__(self):
        super(PriceGuide, self).__init__('OSRS Price Guide')

        #Definition of the forms fields
        self._itemname = ControlText('Item Name', 'Iron Arrow')
        self._price = ControlText('Item Price')
        self._button = ControlButton('Look up Price')

        #Define the button action
        self._button.value = self.__buttonAction

        self._formset = [('_itemname', '_button'), '_price', ' ']
        self.price_finder = PriceLookup()
コード例 #7
0
    def __init__(self):

        super(VehTrajAnalytics, self).__init__('Vehicle Trajectory Analytics')

        #Definition of the forms fields
        self._firstname = ControlText('First name', 'Default value')
        self._middlename = ControlText('Middle name')
        self._lastname = ControlText('Lastname name')
        self._fullname = ControlText('Full name')
        self._button = ControlButton('Press this button')
        self._button2 = ControlButton('Press this button2')

        self._outputDir = ControlDir("Output Directory")
        self._inputFile = ControlFile("Input Trajectory File")

        self._load = ControlButton("Load")
        self._save = ControlButton("Save")

        self._vehicleId = ControlCombo("Vehicle id")
        self._time = ControlCombo("Time(sec)")
        self._positionX = ControlCombo("PositionX (feet)")
        self._positionY = ControlCombo("PositionY (feet)")

        # Instrumented vehicle trajectories
        self._radarRange = ControlCombo("Radar range (feet)")
        self._radarAngle = ControlCombo("Radar angle (degrees)")
        self._centerline = ControlFile("CenterlineFile")

        #all traffic stream
        self._lane = ControlCombo("Lane")
        self._vLength = ControlCombo("Vehicle Length")
        self._distanceAlong = ControlCombo("Distance Along Corridor")

        #Define the button action
        self._button.value = self.__buttonAction

        self.data = None
        self.outFolder = None

        self.formset = [[('_inputFile', '_load'), '_vehicleId', "_time",
                         '_positionX', "_positionY", "_distanceAlong"], "=", {
                             'All Vehicle Trajectories': ['_lane', '_vLength'],
                             'Instrumented Vehicle Trajectories':
                             ['_radarAngle', '_radarRange']
                         }, '=', ('_outputDir', '_save')]

        self._load.value = self.__loadAction
        self._save.value = self.__saveAction
コード例 #8
0
    def __init__(self, timeline=None):
        super(Graph2Event, self).__init__('Graph to event',
                                          parent_win=timeline)
        self.setContentsMargins(10, 10, 10, 10)
        self._timeline = timeline

        # Definition of the forms fields
        self._graphs_list = ControlList('Graphs list (try double click)')
        self._equation = ControlTextArea('Equation')
        self._eventname = ControlText('Event name', 'New event')
        self._rownumber = ControlNumber('Row number', 0, 0, 1000)
        self._mindiff = ControlNumber('Minimum of frames', 0, 0, 1000000)
        self._genevts_btn = ControlButton('Generate events')

        self._formset = [
            (['_graphs_list'], '||', [
                ('_eventname', '_rownumber', '_mindiff'),
                '_equation',
                '_genevts_btn',
            ]),
        ]

        self._graphs_list.cell_double_clicked_event = self.__cell_double_clicked_evt
        self._graphs_list.readonly = True
        self._graphs_list.select_entire_row = True
        self._genevts_btn.value = self.__generage_events_evt
コード例 #9
0
    def __init__(self, timelineWidget=None):
        super(GraphsProperties, self).__init__('Graphs properties')
        self.setContentsMargins(10, 10, 10, 10)
        self._timeline = timelineWidget

        # Definition of the forms fields
        self._graphs_list = ControlList('Graphs list')
        self._name = ControlText('Name')
        self._min_value = ControlNumber('Min')
        self._max_value = ControlNumber('Max')
        self._values_zoom = ControlSlider('Amplitude', 100, 60, 400)
        self._values_top = ControlNumber('Top position', 0, -1000, 1000)
        self._remove_graph_btn = ControlButton('Remove graph')

        self._formset = [
            (['_graphs_list', '_remove_graph_btn'], '||', [
                ' ', '_name', ('_min_value', '_max_value'),
                ('_values_top', ' '), '_values_zoom', ' '
            ]),
        ]

        self._graphs_list.itemSelectionChanged = self.__graphs_list_selection_changed

        self._loaded = False

        self._name.changed = self.__save_graphs_changes
        self._min_value.changed = self.__save_graphs_changes
        self._max_value.changed = self.__save_graphs_changes
        self._values_zoom.changed = self.__save_graphs_changes
        self._values_top.changed = self.__save_graphs_changes
コード例 #10
0
    def __init__(self, columns, parent=None):
        super(GenericCsvParserDialog, self).__init__('CSV Choose the columns',
                                                     parent_win=parent)

        self._filename = None
        self._columns = columns
        self._columns_indexes = []
        self._rownum = 0

        # Definition of the forms fields
        self._filename = ControlFile('CSV File')
        self._separator = ControlText('Separator', 'auto')
        self._startingrow = ControlNumber('Starting row', 0)

        for index, column in enumerate(columns):
            setattr(self, '_col_{0}'.format(index),
                    ControlNumber(column, index, -1, 1000))

        self._filePreview = ControlList('Preview')
        self._loadButton = ControlButton('Load')

        form_row = ['_separator'] + [
            '_col_{0}'.format(index) for index, column in enumerate(columns)
        ] + ['_loadButton']

        self._formset = [('_filename', '_startingrow'),
                         tuple(form_row), '_filePreview']
        self._separator.changed_event = self.__refreshPreview
        self._filename.changed_event = self.__refreshPreview
        self._startingrow.changed_event = self.__refreshPreview
        self._loadButton.value = self.load

        self._load_event = None
コード例 #11
0
    def __init__(self):
        super(SimpleExample1, self).__init__('Simple example 1')

        #Definition of the forms fields
        self._firstname = ControlText('Senetence', 'Default value')

        self._button = ControlButton('Press this button')
コード例 #12
0
 def __init__(self, isCreating):
     Movie.__init__(self, '', '', '', '')
     BaseWidget.__init__(self, 'Movie')
     self.__isCreating = isCreating
     self._idField = ControlText("Id")
     self._titleField = ControlText("Title")
     self._descriptionField = ControlTextArea("Description")
     self._genre = ControlCombo("Genre")
     for i in MOVIE_GENRE:
         self._genre += i
     self._buttonField = ControlButton('Add a new movie')
     self._buttonField.value = self._updateAction
     if not isCreating:
         self._idField.enabled = False
         self._buttonField.name = "Update movie"
     self._label = ControlLabel("")
コード例 #13
0
ファイル: BaseWindow.py プロジェクト: sunj1/my_pyforms
	def __init__(self):
		super(BaseWindow, self).__init__('Test')

		#Definition of the forms fields
		self._mdiArea 			= ControlMdiArea()

		self._textField 		= ControlText("Example")
		self._projectTree  		= ControlDockWidget('Project tree', side=ControlDockWidget.SIDE_RIGHT)
		self._details  			= ControlDockWidget('Details', 		side=ControlDockWidget.SIDE_RIGHT)
		self._addWindow 		= ControlButton('Add window')

		self._formset = [ '_addWindow','_textField', '_mdiArea']

		self._details.value = SimpleExample1()


		#self._mdiArea.showCloseButton = False
		self._addWindow.value = self.__addWindow

		self.mainmenu.append(
				{ 'File': [
						{'Save as': self.saveWindow},
						{'Open as': self.loadWindow},
						'-',
						{'Exit': self.__exit},
					]
				}
			)
コード例 #14
0
    def __init__(self, timeline=None):
        super(GraphsEventsGenerator,
              self).__init__('Apply a function to the graph values',
                             parent_win=timeline)
        self.setContentsMargins(10, 10, 10, 10)
        self._timeline = timeline

        # Definition of the forms fields
        self._graphs_list = ControlList('Graphs list (try double click)')
        self._equation = ControlTextArea('Equation')
        self._graphname = ControlText('Graph name')
        self._genevts_btn = ControlButton('Generate graph')

        self._formset = [
            (['_graphs_list'], '||', [
                '_graphname',
                '_equation',
                '_genevts_btn',
            ]),
        ]

        self._graphs_list.cell_double_clicked_event = self.__cell_double_clicked_evt
        self._graphs_list.readonly = True
        self._graphs_list.select_entire_row = True
        self._genevts_btn.value = self.__generage_events_evt
コード例 #15
0
    def __init__(self, axis):
        super().__init__("Aux Jog")

        assert isinstance(axis, ControlAxis)

        self._axis = axis

        self.label = axis.get_name()

        self._value_field = ControlText(label="Target",
                                        default=str(axis.get_value()))

        self._set_button = ControlButton(label="Go to target")
        self._set_button.value = self._update_value

        self._saved_point_field = ControlCombo(label="Saved Point")

        self._saved_point_button = ControlButton(label="Go to saved point")
        self._saved_point_button.value = self._update_saved_point

        self._current_field = ControlLabel(
            label="Current Value ({})".format(axis.get_units()))

        self.setFrameShape(QFrame.StyledPanel)
        self.setSizePolicy(
            QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed))

        self.set_margin(10)

        self.formset = [("info:{0} ({1}):".format(axis.get_name(),
                                                  axis.get_units()), '', '',
                         '_current_field'), ('_value_field', '_set_button'),
                        ('_saved_point_field', '_saved_point_button')]
コード例 #16
0
ファイル: views.py プロジェクト: dominic-dev/wol
    def __init__(self):
        super().__init__('Nieuwe oogstlijst')

        self._nameField = ControlText('Naam')
        self._button_continue= ControlButton('Begin')
        self._button_continue.value = self._continue

        self.formset = ['_nameField', '_button_continue']
コード例 #17
0
    def __init__(self):
        Person.__init__(self, '', '', '')
        BaseWidget.__init__(self, 'Person window')
        self.parent = None

        #Definition of the forms fields
        self._firstnameField = ControlText('First name')
        self._middlenameField = ControlText('Middle name')
        self._lastnameField = ControlText('Lastname name')
        self._fullnameField = ControlText('Full name')
        self._buttonField = ControlButton('Press this button')

        #Define the button action
        self._buttonField.value = self.buttonAction

        self._formset = [
            '_firstnameField', '_middlenameField', '_lastnameField',
            '_fullnameField', (' ', '_buttonField', ' '), ' '
        ]
コード例 #18
0
    def __init__(self, update_function):
        super().__init__("New Saved Point")

        self._update_function = update_function

        self._text = ControlText(label="Name")

        self._done_button = ControlButton(label="Done")

        self._done_button.value = self._done
コード例 #19
0
ファイル: pyforms_test.py プロジェクト: jbwincek/Llat
class SimpleExample6(BaseWidget):
    def __init__(self):
        super(SimpleExample6, self).__init__('Simple example 6')

        # Definition of the forms fields
        self._firstname = ControlText('First name', 'Default value')
        self._middlename = ControlText('Middle name')
        self._lastname = ControlText('Lastname name')
        self._fullname = ControlText('Full name')
        self._button = ControlButton('Press this button')

        self._formset = [{
            'Tab1': ['_firstname', '||', '_middlename', '||', '_lastname'],
            'Tab2': ['_fullname']
        },
            '=', (' ', '_button', ' ')]

        self._fullname.addPopupSubMenuOption('Path',
                                             {
                                                 'Delete': self.__dummyEvent,
                                                 'Edit': self.__dummyEvent,
                                                 'Interpolate': self.__dummyEvent
                                             })

        # Define the window main menu using the property main menu
        self.mainmenu = [
            {'File': [
                {'Open': self.__dummyEvent},
                '-',
                {'Save': self.__dummyEvent},
                {'Save as': self.__dummyEvent}
            ]
            },
            {'Edit': [
                {'Copy': self.__dummyEvent},
                {'Past': self.__dummyEvent}
            ]
            }
        ]

    def __dummyEvent(self):
        print("Menu option selected")
コード例 #20
0
    def __init__(self, timelineWidget=None, parent_win=None):
        super(GraphsProperties, self).__init__('Graphs properties',
                                               parent_win=parent_win)
        self.setContentsMargins(10, 10, 10, 10)
        self._mainwindow = parent_win
        self._timeline = timelineWidget

        #self.setMaximumWidth(300)

        # Definition of the forms fields
        self._graphs_list = ControlList('Graphs list')
        self._name = ControlText('Name')
        self._min_value = ControlNumber('Min', 0, -sys.float_info.max,
                                        sys.float_info.max)
        self._max_value = ControlNumber('Max', 0, -sys.float_info.max,
                                        sys.float_info.max)
        self._values_zoom = ControlSlider('Amplitude', 100, 60, 400)
        self._values_top = ControlNumber('Bottom', 0, -1000, 1000)
        self._remove_graph_btn = ControlButton('Remove graph')
        self._value = ControlLabel()

        self._graphs_list.readonly = True

        self._formset = [
            (['_graphs_list', '_remove_graph_btn'], '||', [
                ' ', '_name', ('_min_value', '_max_value', ' '),
                ('_values_top', ' '), '_values_zoom',
                'info:Choose one graph and move the mouse over \nthe timeline to visualize the coordenates.',
                '_value'
            ]),
        ]

        self._graphs_list.select_entire_row = True
        self._graphs_list.item_selection_changed_event = self.__graphs_list_selection_changed

        self._loaded = False
        self._current_selected_graph = None

        self._name.changed_event = self.__save_graphs_changes
        self._min_value.changed_event = self.__save_graphs_changes
        self._max_value.changed_event = self.__save_graphs_changes
        self._values_zoom.changed_event = self.__save_graphs_changes
        self._values_top.changed_event = self.__save_graphs_changes

        self._name.enabled = False
        self._min_value.enabled = False
        self._max_value.enabled = False
        self._values_zoom.enabled = False
        self._values_top.enabled = False
        self._remove_graph_btn.enabled = False

        self._remove_graph_btn.value = self.__remove_chart
コード例 #21
0
	def __init__(self):
		super(MySettingsApp,self).__init__('My settings')
		
		self._user_uid = ControlText('API password')
		self._new_uid_btn = ControlButton('New password')
		self._save_btn = ControlButton('Save')

		self._formset = [
			('_user_uid','_new_uid_btn'), 
			('_save_btn', ' ')]

		self._save_btn.value = self.__save_form
		self._new_uid_btn.value = self.__new_uid
コード例 #22
0
    def __init__(self, name, target):
        super(PopUpGetText, self).__init__('Add {}'.format(name))

        self.target = target

        self._text = ControlText('')

        self._add_button = ControlButton('Add')
        self._add_button.value = self.__add_action

        self._cancel_button = ControlButton('Cancel')
        self._cancel_button.value = self.__cancel_action

        self._formset = [('', '_text', ''),
                         ('', '_add_button', '_cancel_button', '')]
コード例 #23
0
    def __init__(self, done_function):
        super().__init__("New Axis")

        self._done_function = done_function

        self._axis_name = ControlText(label="Name")

        self._axis_hw_type = ControlCombo(label="HW Type", default=None)

        for class_type in ControlAxis.__subclasses__():
            self._axis_hw_type.add_item(class_type.__name__, class_type)

        self._done_button = ControlButton(label="Done")

        self._done_button.value = self._done
コード例 #24
0
    def __init__(self):
        super(CsvParserDialog, self).__init__('CSV Choose the columns')
        self._filename = None

        # Definition of the forms fields
        self._filename = ControlFile('CSV File')
        self._separator = ControlText('Separator', ';')
        self._frameCol = ControlNumber('Frame column', 0, 0, 100)
        self._xCol = ControlNumber('X column', 1, 0, 100)
        self._yCol = ControlNumber('Y column', 2, 0, 100)
        self._zCol = ControlNumber('Z column', 3, 0, 100)
        self._filePreview = ControlList('Preview')
        self._loadButton = ControlButton('Load')

        self._formset = ['_filename', ('_separator', '_frameCol', '_xCol', '_yCol', '_zCol', '_loadButton'), '_filePreview']
        self._separator.changed = self.__refreshPreview
        self._filename.changed  = self.__refreshPreview
コード例 #25
0
    def __init__(self):
        super(Interface, self).__init__('IR project')

        self._query = ControlText(label='Type your query and press "Enter"; for example:',
                                  defaultValue='Albert Einstein')

        self._query.key_pressed = self.__enter_pressed_event

        self._pages_result = ControlList('Found web-pages:')
        self._pages_result.readOnly = True
        self._pages_result.currentCellChanged = self.__page_selected
        self._pages_displayed = []

        self._papers_result = ControlList('Found papers (by author):')
        self._papers_result.readOnly = True
        self._papers_result.currentCellChanged = self.__paper_selected
        self._papers_displayed = []

        self.formset = ['_query', ('_pages_result', '_papers_result')]
コード例 #26
0
    def __init__(self):
        super(ChooseColumnsWindow, self).__init__('CSV Choose the columns')
        self._filename = None

        # Definition of the forms fields
        self._filename = ControlFile('File')
        self._separator = ControlText('Separator', ';')
        self._frameCol = ControlNumber('Frame column', 0, 0, 100)
        self._xCol = ControlNumber('X column', 1, 0, 100)
        self._yCol = ControlNumber('Y column', 2, 0, 100)
        self._showZ = ControlCheckBox('Import Z value')			# Not being used yet
        self._zCol = ControlNumber('Z column', 0, 0, 100)		# Not being used yet
        self._filePreview = ControlList('Preview')
        self._loadButton = ControlButton('Load')

        self._formset = ['_filename', ('_separator', '_frameCol', '_xCol', '_yCol', '_loadButton'), '_filePreview']
        self._separator.changed = self.__refreshPreview
        self._filename.changed = self.__refreshPreview

        self._zCol.hide()
        self._showZ.changed = self.__showZChanged
コード例 #27
0
    def __init__(self):
        super(MainApp, self).__init__('Simple example 1')
        self._movieWindow = ControlEmptyWidget()
        self._clientWindow = ControlEmptyWidget()
        self._rentalWindow = ControlEmptyWidget()
        self._rentalWindow.value = RentalListWindow(MainApp.rentalController)
        self._movieWindow.value = MovieListWindow(MainApp.movieController, MainApp.rentalController)
        self._clientWindow.value = ClientListWindow(MainApp.clientController, MainApp.rentalController)
        self._middlename = ControlText("sd")
        self._lateRentals = ControlEmptyWidget()
        self._lateRentals.value = StatsList("Late Rentals", MainApp.rentalController.lateRentals())
        self._mostRentedMoviesByDays = ControlEmptyWidget()
        self._mostRentedMoviesByDays.value = StatsList("Most rented movies by number of days",
                                                       MainApp.rentalController.mostRentedMoviesByDays())
        self._mostRentedMoviesByNumber = ControlEmptyWidget()
        self._mostRentedMoviesByNumber.value = StatsList("Most rented movies by number of times they were rented",
                                                         MainApp.rentalController.mostRentedMoviesByDays())
        self._allRentedMovies = ControlEmptyWidget()
        self._allRentedMovies.value = ControlList("Currently rented movies")
        self._allRentedMovies.value.value = [[x.id, x.title, x.description, x.genre] for x in
                                             MainApp.rentalController.allRentedMovies()]
        self._allRentedMovies.value.horizontalHeaders = ['Id', 'Title', 'Description', 'Genre']
        self._refresh = ControlButton("Refresh")
        self._refresh.value = self.refresh
        self._undo = ControlButton("Undo")
        self._undo.value = self._undoAction
        self._redo = ControlButton("Redo")
        self._redo.value = self._redoAction
        self._refreshMovies = ControlButton("Refresh")
        self._refreshMovies.value = self._refreshMoviesAction
        self.formset = [{
            'Movies': ['_movieWindow'],
            'Clients': ['_clientWindow'],
            'Rentals': ['_rentalWindow', '=', '_refreshMovies'],
            'Statistics': ["_lateRentals", "||", "_mostRentedMoviesByNumber", '||', '_mostRentedMoviesByDays', '||',
                           "_allRentedMovies", '=', '_refresh']

        },
            '=',
            ['_undo', '||', '_redo']]
 def __init__(self, clientController, rentalController):
     # Client.__init__(self, R)
     BaseWidget.__init__(self, 'Client')
     # Definition of the forms fields2
     self._clientList = ControlList('Clients',
                                    plusFunction=self.__addClientBtnAction,
                                    minusFunction=self.__removeClientBtnAction)
     self.__controller = clientController
     self._searchInput = ControlText("Search")
     self._searchButton = ControlButton("Go")
     self._formset = [
         ('_searchInput',
          ('_searchButton')),
         ("_clientList")
     ]
     self._searchButton.value = self.searchData
     self.__rentalController = rentalController
     data = [[x.id, x.name] for x in self.__controller.getAllClients()]
     self._clientList.value += data
     self._clientList.selectEntireRow = True
     self._clientList.readOnly = True
     self._clientList.horizontalHeaders = ['Id', 'Name']
     self._clientList.cellDoubleClicked = self.updateClientAction
コード例 #29
0
ファイル: TimelineDelta.py プロジェクト: splevine/pyforms
    def __init__(self, parent_win, label, begin, end):
        BaseWidget.__init__(self, 'Edit frame', parent_win=parent_win)

        if conf.PYFORMS_USE_QT5:
            self.layout().setContentsMargins(5, 5, 5, 5)
        else:
            self.layout().setMargin(5)

        self._label = ControlText('Label', default=label)
        self._begin = ControlNumber('Begin',
                                    default=begin,
                                    minimum=0,
                                    maximum=100000000000000)
        self._end = ControlNumber('End',
                                  default=end,
                                  minimum=0,
                                  maximum=100000000000000)

        self._applybtn = ControlButton('Apply')

        self.formset = ['_label', ('_begin', '_end'), '_applybtn']

        self._begin.changed_event = self.__begin_changed_event
        self._end.changed_event = self.__end_changed_event
    def __init__(self, movieController, rentalController):
        # MovieController.__init__(self, R)
        BaseWidget.__init__(self, 'Movie')
        # Definition of the forms fields2
        self._searchInput = ControlText("Search")
        self._searchButton = ControlButton("Go")
        self._formset = [
            ('_searchInput',
             ('_searchButton')),
            ("_movieList")
        ]

        self._movieList = ControlList('Movies',
                                      plusFunction=self.__addPersonBtnAction,
                                      minusFunction=self.__removeMovieBtnAction)
        self.__controller = movieController
        self.__rentalController = rentalController
        data = [[x.id, x.title, x.description, x.genre] for x in self.__controller.getAllMovies()]
        self._movieList.value += data
        self._movieList.selectEntireRow = True
        self._movieList.readOnly = True
        self._movieList.horizontalHeaders = ['Id', 'Title', 'Description', 'Genre']
        self._movieList.cellDoubleClicked = self.updateMovieAction
        self._searchButton.value = self.searchData
コード例 #31
0
    def __init__(self):
        super(GroupCheckerGui, self).__init__('Group Checker')

        self._group_name = ControlText('Group Name', CONFIG['group_name'])
        self._group_name.enabled = False
        self._allowed_tags = UnicodeControlList(
            'Allowed Tags',
            plusFunction=self.__add_tag_action,
            minusFunction=self.__remove_tag_action)
        self.allowed_tags = GuiList(
            CONFIG['white_filters']['SubstringFilter']['substrings'],
            self._allowed_tags)

        self._allowed_ids = ControlList('Allowed Ids',
                                        plusFunction=self.__add_id_action,
                                        minusFunction=self.__remove_id_action)
        self.allowed_ids = GuiList(
            CONFIG['white_filters']['SignerFilter']['ids'], self._allowed_ids)

        self._bad_posts = ControlCheckBoxList('Bad posts')
        self._bad_posts._form.listWidget.itemDoubleClicked.connect(
            self.__show_link_action)

        self._remove_button = ControlButton('Remove')
        self._remove_button.value = self.__remove_action

        self._show_button = ControlButton('Show bad posts')
        self._show_button.value = self.__show_bad_post_action

        self.pool = Pool(processes=1)
        self.bad_posts = []

        self._formset = [('', '_group_name', ''),
                         ('', '_allowed_tags', '_allowed_ids', ''), '',
                         ('', '_bad_posts', ''),
                         ('', '_remove_button', '_show_button', ''), '']