Пример #1
0
 def __init__(self, parent=None):
     super(OpenDialog, self).__init__(parent)
     self.ui = uic.loadUi(get_ui_file('open_dialog.ui'), self)
     # Read the last-used lists
     self.settings = self.parent().settings
     self.settings.beginGroup('last_used')
     try:
         count = self.settings.beginReadArray('data_files')
         try:
             for i in range(count):
                 self.settings.setArrayIndex(i)
                 self.ui.data_file_combo.addItem(
                     self.settings.value('path'))
         finally:
             self.settings.endArray()
         self.ui.data_file_combo.setEditText(
             self.settings.value('data_file', ''))
         count = self.settings.beginReadArray('channel_files')
         try:
             for i in range(count):
                 self.settings.setArrayIndex(i)
                 self.ui.channel_file_combo.addItem(
                     self.settings.value('path'))
         finally:
             self.settings.endArray()
         self.ui.channel_file_combo.setEditText(
             self.settings.value('channel_file', ''))
     finally:
         self.settings.endGroup()
     # Connect up signals
     self.ui.data_file_combo.editTextChanged.connect(self.data_file_changed)
     self.ui.data_file_button.clicked.connect(self.data_file_select)
     self.ui.channel_file_button.clicked.connect(self.channel_file_select)
     self.data_file_changed()
Пример #2
0
 def __init__(self, parent=None):
     super(OpenDialog, self).__init__(parent)
     self.ui = uic.loadUi(get_ui_file('open_dialog.ui'), self)
     # Read the last-used lists
     self.settings = self.parent().settings
     self.settings.beginGroup('last_used')
     try:
         count = self.settings.beginReadArray('data_files')
         try:
             for i in range(count):
                 self.settings.setArrayIndex(i)
                 self.ui.data_file_combo.addItem(
                     self.settings.value('path'))
         finally:
             self.settings.endArray()
         self.ui.data_file_combo.setEditText(
             self.settings.value('data_file', ''))
         count = self.settings.beginReadArray('channel_files')
         try:
             for i in range(count):
                 self.settings.setArrayIndex(i)
                 self.ui.channel_file_combo.addItem(
                     self.settings.value('path'))
         finally:
             self.settings.endArray()
         self.ui.channel_file_combo.setEditText(
             self.settings.value('channel_file', ''))
     finally:
         self.settings.endGroup()
     # Connect up signals
     self.ui.data_file_combo.editTextChanged.connect(self.data_file_changed)
     self.ui.data_file_button.clicked.connect(self.data_file_select)
     self.ui.channel_file_button.clicked.connect(self.channel_file_select)
     self.data_file_changed()
Пример #3
0
 def __init__(self, parent=None):
     super(MainWindow, self).__init__(parent)
     self.ui = uic.loadUi(get_ui_file('main_window.ui'), self)
     # Read configuration
     self.settings = QtCore.QSettings()
     self.settings.beginGroup('main_window')
     try:
         self.resize(self.settings.value('size', QtCore.QSize(640, 480)))
         self.move(self.settings.value('position', QtCore.QPoint(100, 100)))
     finally:
         self.settings.endGroup()
     # Configure status bar elements
     self.ui.x_label = QtGui.QLabel('')
     self.statusBar().addWidget(self.ui.x_label)
     self.ui.y_label = QtGui.QLabel('')
     self.statusBar().addWidget(self.ui.y_label)
     self.ui.value_label = QtGui.QLabel('')
     self.ui.red_label = self.ui.value_label
     self.statusBar().addWidget(self.ui.value_label)
     self.ui.green_label = QtGui.QLabel('')
     self.statusBar().addWidget(self.ui.green_label)
     self.ui.blue_label = QtGui.QLabel('')
     self.statusBar().addWidget(self.ui.blue_label)
     # Connect up signals to methods
     self.ui.mdi_area.subWindowActivated.connect(self.window_changed)
     self.ui.quit_action.setIcon(get_icon('application-exit'))
     self.ui.about_action.triggered.connect(self.about)
     self.ui.about_action.setIcon(get_icon('help-about'))
     self.ui.about_qt_action.triggered.connect(self.about_qt)
     self.ui.about_qt_action.setIcon(get_icon('help-about'))
     self.ui.open_action.setIcon(get_icon('document-open'))
     self.ui.open_action.triggered.connect(self.open_file)
     self.ui.close_action.setIcon(get_icon('window-close'))
     self.ui.close_action.triggered.connect(self.close_file)
     self.ui.export_image_action.setIcon(get_icon('image-x-generic'))
     self.ui.export_image_action.triggered.connect(self.export_image)
     self.ui.export_channel_action.setIcon(get_icon('text-x-generic'))
     self.ui.export_channel_action.triggered.connect(self.export_channel)
     self.ui.export_document_action.setIcon(get_icon('x-office-document'))
     self.ui.export_document_action.triggered.connect(self.export_document)
     self.ui.print_action.setIcon(get_icon('document-print'))
     self.ui.print_action.triggered.connect(self.print_file)
     self.ui.zoom_in_action.setIcon(get_icon('zoom-in'))
     self.ui.zoom_in_action.triggered.connect(self.zoom_in)
     self.ui.zoom_out_action.setIcon(get_icon('zoom-out'))
     self.ui.zoom_out_action.triggered.connect(self.zoom_out)
     self.ui.reset_zoom_action.setIcon(get_icon('zoom-original'))
     self.ui.reset_zoom_action.triggered.connect(self.reset_zoom)
     self.ui.reset_axes_action.setIcon(get_icon('reset-axes'))
     self.ui.reset_axes_action.triggered.connect(self.reset_axes)
     self.ui.home_axes_action.setIcon(get_icon('home-axes'))
     self.ui.home_axes_action.triggered.connect(self.home_axes)
     self.ui.zoom_mode_action.setIcon(get_icon('zoom-mode'))
     self.ui.zoom_mode_action.triggered.connect(self.zoom_mode)
     self.ui.pan_mode_action.setIcon(get_icon('pan-mode'))
     self.ui.pan_mode_action.triggered.connect(self.pan_mode)
     self.ui.status_bar_action.triggered.connect(self.toggle_status)
     self.ui.view_menu.aboutToShow.connect(self.update_status)
Пример #4
0
 def __init__(self, parent=None):
     super(ProgressDialog, self).__init__(parent)
     self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
     self.ui = uic.loadUi(get_ui_file('progress_dialog.ui'), self)
     self.cancelled = False
Пример #5
0
 def _load_interface(self, ui_file):
     "Called by __init__ to load the Qt interface file"
     self.ui = None
     self.ui = uic.loadUi(get_ui_file(ui_file), self)
Пример #6
0
 def __init__(self, parent=None):
     super(MainWindow, self).__init__(parent)
     self.ui = uic.loadUi(get_ui_file('main_window.ui'), self)
     # Read configuration
     self.settings = QtCore.QSettings()
     self.settings.beginGroup('main_window')
     try:
         self.resize(
             self.settings.value(
                 'size', QtCore.QSize(640, 480)))
         self.move(
             self.settings.value(
                 'position', QtCore.QPoint(100, 100)))
     finally:
         self.settings.endGroup()
     # Configure status bar elements
     self.ui.x_label = QtGui.QLabel('')
     self.statusBar().addWidget(self.ui.x_label)
     self.ui.y_label = QtGui.QLabel('')
     self.statusBar().addWidget(self.ui.y_label)
     self.ui.value_label = QtGui.QLabel('')
     self.ui.red_label = self.ui.value_label
     self.statusBar().addWidget(self.ui.value_label)
     self.ui.green_label = QtGui.QLabel('')
     self.statusBar().addWidget(self.ui.green_label)
     self.ui.blue_label = QtGui.QLabel('')
     self.statusBar().addWidget(self.ui.blue_label)
     # Connect up signals to methods
     self.ui.mdi_area.subWindowActivated.connect(self.window_changed)
     self.ui.quit_action.setIcon(get_icon('application-exit'))
     self.ui.about_action.triggered.connect(self.about)
     self.ui.about_action.setIcon(get_icon('help-about'))
     self.ui.about_qt_action.triggered.connect(self.about_qt)
     self.ui.about_qt_action.setIcon(get_icon('help-about'))
     self.ui.open_action.setIcon(get_icon('document-open'))
     self.ui.open_action.triggered.connect(self.open_file)
     self.ui.close_action.setIcon(get_icon('window-close'))
     self.ui.close_action.triggered.connect(self.close_file)
     self.ui.export_image_action.setIcon(get_icon('image-x-generic'))
     self.ui.export_image_action.triggered.connect(self.export_image)
     self.ui.export_channel_action.setIcon(get_icon('text-x-generic'))
     self.ui.export_channel_action.triggered.connect(self.export_channel)
     self.ui.export_document_action.setIcon(get_icon('x-office-document'))
     self.ui.export_document_action.triggered.connect(self.export_document)
     self.ui.print_action.setIcon(get_icon('document-print'))
     self.ui.print_action.triggered.connect(self.print_file)
     self.ui.zoom_in_action.setIcon(get_icon('zoom-in'))
     self.ui.zoom_in_action.triggered.connect(self.zoom_in)
     self.ui.zoom_out_action.setIcon(get_icon('zoom-out'))
     self.ui.zoom_out_action.triggered.connect(self.zoom_out)
     self.ui.reset_zoom_action.setIcon(get_icon('zoom-original'))
     self.ui.reset_zoom_action.triggered.connect(self.reset_zoom)
     self.ui.reset_axes_action.setIcon(get_icon('reset-axes'))
     self.ui.reset_axes_action.triggered.connect(self.reset_axes)
     self.ui.home_axes_action.setIcon(get_icon('home-axes'))
     self.ui.home_axes_action.triggered.connect(self.home_axes)
     self.ui.zoom_mode_action.setIcon(get_icon('zoom-mode'))
     self.ui.zoom_mode_action.triggered.connect(self.zoom_mode)
     self.ui.pan_mode_action.setIcon(get_icon('pan-mode'))
     self.ui.pan_mode_action.triggered.connect(self.pan_mode)
     self.ui.status_bar_action.triggered.connect(self.toggle_status)
     self.ui.view_menu.aboutToShow.connect(self.update_status)
Пример #7
0
 def __init__(self, parent=None):
     super(ProgressDialog, self).__init__(parent)
     self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
     self.ui = uic.loadUi(get_ui_file('progress_dialog.ui'), self)
     self.cancelled = False