def __init__(self): super(Connect, self).__init__() uic.loadUi('src/windows/connect.ui', self) from setlang import SetConnectWindowLang SetConnectWindowLang(self) self.pushButton.clicked.connect(self.ConnectConfig) self.pushButton.clicked.connect(self.closewin) self.pushButton_2.clicked.connect(self.openlogsdir) self.checkBox.stateChanged.connect(self.Settings) self.toolButton.clicked.connect(self.About) self.lineEdit_3.setEchoMode(QLineEdit.Password) # Спрятать пароль ### self.lineEdit.setText(config.ip) self.lineEdit_2.setText(str(config.prt)) self.lineEdit_3.setText(config.pswd) ### if settings.logs == "True": self.checkBox.setChecked(True) else: self.checkBox.setChecked(False) self.aboutwin = about.About() # Окно о приложении
def run(self): """ The main menu """ logging.debugv("menu/__init__.py->run(self)", []) if not self.c.getSensorID() == "Unknown": if self.c.getLock() == "Enabled": lock.Lock(self.d).run() title = "\\ZbStart\\n\\ZB" subtitle = "What do you want to do today?" title += subtitle choice = self.d.menu(title, choices=[ ("Configure", "Configure this sensor"), ("Manage", "Start/stop sensor functions"), ("Status", "View the status of this sensor"), ("Log", "View the logfile of this sensor"), #("Update", "Update the sensor scripts"), #("Console", "Open a management console"), ("About", "Learn more about the SURFids sensor"), ("Shutdown", "Shutdown the machine"), ("Lock", "Lock the sensor menu"), ], nocancel=1, width=60, colors=1) #cancel if choice[0] == 1: return elif choice[1] == "Configure": config.Config(self.d).run() elif choice[1] == "Manage": manage.Manage(self.d).run() elif choice[1] == "Status": status.Status(self.d).run() elif choice[1] == "Log": log.Log(self.d).run() elif choice[1] == "Console": console.Console(self.d).run() elif choice[1] == "About": about.About(self.d).run() elif choice[1] == "Shutdown": manage.Manage(self.d).shutdown() elif choice[1] == "Lock": lock.Lock(self.d).run() self.run()
def _show_about(self): if not self.about_open: self.about_window = tk.Tk() self.about_window.protocol('WM_DELETE_WINDOW', self._safe_close_about) self.about_window.title('About vClient') self.about_window.geometry('370x120+50+50') self.about_window.resizable(False, False) try: self.about_window.iconbitmap('logo.ico') except: pass self.about = about.About(self.about_window) self.about.pack(fill=tk.BOTH, expand=1) self.about_open = True self.about_window.mainloop()
def __init__(self): QtCore.QObject.__init__(self) elements = utils.loadUi(self._MAIN_WINDOW_UI) self.window = elements["MainWindow"] # Binding Window's custom event handlers self.window.closeEvent = self.closeEvent self.centralWidget = elements["centralWidget"] # Menus self.menuFile = elements["menuFile"] elements["actionQuit"].triggered.connect(self.window.close) self._actionQuit = elements["actionQuit"] self.menuEdit = elements["menuEdit"] self._actionDevices = elements["actionDevices"] self.menuView = elements["menuView"] # Tool bars self.toolBarMain = elements["toolBarMain"] self.toolBarSwitch = elements["toolBarSwitch"] self.toolBarView = elements["toolBarView"] # Dialogs self.about = about.About() elements["actionAbout"].triggered.connect(self.about.run) self.devices = devices.DevicesDialog() elements["actionDevices"].triggered.connect(self.devices.run) self.settings = settings.SettingsDialog() elements["actionSettings"].triggered.connect(self.settings.run) # Views self._viewGroup = QtGui.QActionGroup(self.window) self._views = view.all(self) for i, obj in enumerate(self._views): self._viewGroup.addAction(obj.action) self.menuView.addAction(obj.action) self.toolBarSwitch.addAction(obj.action) obj.action.setShortcut("ALT+%d" % (i+1)) # Uniform width of ToolBar buttons self._buttonWidth = QtGui.QFontMetrics(self.window.font()).width( 'a' * self._TOOLBAR_BUTTON_LETTERS) for toolBar in (self.toolBarMain, self.toolBarSwitch): for action in toolBar.actions(): if action.isSeparator(): continue toolBar.widgetForAction(action).setFixedWidth(self._buttonWidth) # Settings self._loadState()
def openAbout(self): self.another = about.About() self.another.show()
def on_menuitem_about_activate(self, widget): about.About()
def on_AboutMenuBar_activate(self, *args): """ Callback function called when AboutMenuBar is activated. Loads the about window. """ self.about = about.About() self.about.show()
def openAbout(self): self.about = about.About()
def about_us(self): about.About()
def show_about(event): about.About()
def on_btnAbout_clicked(self): ab = about.About(self) ab.show()
def on_action_About(self): aboutDialog = about.About(parent=self) aboutDialog.show()
def about(self, event=None): '''When user clicks about sub-menu in Help menu''' about.About(self.master)
def __init__(self): super(MainWindow, self).__init__() self.setupUi(self) if QtGui.QIcon.hasThemeIcon('usbmaker'): self.setWindowIcon(QtGui.QIcon.fromTheme('usbmaker')) self.about_window = about.About() # Here we set up the gui elements that aren't modified # elsewhere in the code. self.pushButton_close.clicked.connect(self.close) self.pushButton_about.clicked.connect(self.show_about_window) self.comboBox_partscheme.insertItem( 0, 'MBR partition scheme for BIOS or UEFI') self.comboBox_partscheme.insertItem(1, 'MBR partition scheme for UEFI') self.comboBox_partscheme.insertItem( 2, 'GPT partition scheme for BIOS or UEFI') self.comboBox_partscheme.insertItem(3, 'GPT partition scheme for UEFI') self.comboBox_filesystem.insertItem(0, 'FAT32') self.comboBox_filesystem.insertItem(1, 'FAT16') self.comboBox_filesystem.insertItem(2, 'NTFS') self.comboBox_filesystem.insertItem(3, 'UDF') self.comboBox_filesystem.insertItem(4, 'exFAT') self.comboBox_filesystem.insertItem(5, 'ext4') self.comboBox_filesystem.insertItem(6, 'Btrfs') self.comboBox_bootmethod.insertItem(0, 'ISO Image') self.comboBox_bootmethod.insertItem(1, 'DD Image') self.comboBox_checkbadblocks.insertItem(0, '1 Pass') self.comboBox_checkbadblocks.insertItem(1, '2 Passes') self.comboBox_checkbadblocks.insertItem(2, '3 Passes') self.comboBox_checkbadblocks.insertItem(3, '4 Passes') # Check for dependencies and their locations self.dependencies = {} self.update_dependencies() self.syslinux = ['', '', ''] self.syslinux_modules = ['', '', ''] self.grldr = '' self.find_dependencies() # Locate the user's home directory. if not os.getenv('PKEXEC_UID') is None: try: self.homedir = uid_info.get_home_from_uid( os.getenv('PKEXEC_UID')) except uid_info.UserNotFoundError: self.homedir = os.path.expanduser('~') elif not os.getenv('KDESU_USER') is None: try: self.homedir = uid_info.get_home_from_username( os.getenv('KDESU_USER')) except uid_info.UserNotFoundError: self.homedir = os.path.expanduser('~') elif not os.getenv('SUDO_UID') is None: try: self.homedir = uid_info.get_home_from_uid( os.getenv('SUDO_UID')) except uid_info.UserNotFoundError: self.homedir = os.path.expanduser('~') else: self.homedir = os.path.expanduser('~') # The badblocks message box is initialized here. self.messageBox_badblocks = QtWidgets.QMessageBox() self.messageBox_badblocks.setStandardButtons( QtWidgets.QMessageBox.Close) # self.device_id_list is initialized here. self.device_id_list = [] # Here self.filename is initialized and the file dialog button # is set to activate the get_file_name function when clicked. self.filename = '' self.pushButton_filedialog.clicked.connect(self.get_file_name) # Changes to these parts of the gui trigger the update_gui function # to update the gui according to the selected options. self.comboBox_filesystem.currentIndexChanged.connect(self.update_gui) self.comboBox_partscheme.currentIndexChanged.connect(self.update_gui) self.comboBox_bootmethod.currentIndexChanged.connect(self.update_gui) self.comboBox_clustersize.currentIndexChanged.connect(self.update_gui) self.checkBox_bootmethod.stateChanged.connect(self.update_gui) self.checkBox_checkbadblocks.stateChanged.connect(self.update_gui) # update_gui is called to finish the initialization of the gui. self.update_gui() # The available usb devices are detected here. self.refresh_device_list() # The refresh button is connected to the refresh_device_list function. self.pushButton_refresh.clicked.connect(self.refresh_device_list) # The worker object is moved to a separate thread. self.worker = WorkerObject(self) self.thread = QtCore.QThread() self.worker.moveToThread(self.thread) # The signals emitted in the start_* functions are connected to the # corresponding functions from the worker object. self.signal_format.connect(self.worker.format) self.signal_dd.connect(self.worker.make_bootable_dd) self.signal_iso.connect(self.worker.make_bootable_iso) # The start button is connected to the start function. self.pushButton_start.clicked.connect(self.start)
def __init__(self): self.interface = gtk.Builder() self.interface.add_from_file(UI_DIR + "/sltv.ui") self.main_window = self.interface.get_object("window1") self.main_window.show_all() self.about = about.About(self) self.sltv = Sltv() self.sltv.connect("stopped", self.stopped) self.sltv.connect("playing", self.playing) self.sltv.connect("error", self.error) self.sltv.connect("pipeline-ready", self.on_pipeline_ready) self.preview_frame = self.interface.get_object("preview_frame") self.preview_box = self.interface.get_object("preview_vbox") self.preview = preview.PreviewUI(self, self.sltv) self.preview_box.pack_start(self.preview.get_widget(), False, False) self.preview_area = PreviewArea() self.preview_frame.add(self.preview_area) self.preview_area.show() self.box = self.interface.get_object("paned") self.settings = settings.SettingsUI(self, self.sltv) self.box.add(self.settings.get_widget()) self.play_button = self.interface.get_object("play_button") self.stop_button = self.interface.get_object("stop_button") self.settings_dialog = gtk.Dialog('Settings', self.main_window) self.settings_dialog.set_default_size(400, 400) self.encoders = self.sltv.encoders self.videoconverters = self.sltv.videoconverters self.encoders_ui = encoders.Encoders(self, self.encoders, self.videoconverters) self.metadata_ui = metadata.MetadataUI(self.sltv, self.settings_dialog) self.hbuttonbox = self.interface.get_object("hbuttonbox1") self.volume = volume.VolumeUI(self, self.sltv) self.volume_button = self.volume.get_widget() self.volume_button.show() self.hbuttonbox.pack_start(self.volume_button) self.sltv.vus = [] meter = fvumeter.FVUMeter() meter.only_draw_peak = True self.sltv.vus.append(meter) meter = fvumeter.FVUMeter() self.sltv.vus.append(meter) self.sltv.vus[0].show() self.sltv.vus[1].show() self.vumeter_box = self.interface.get_object("vumeter_box") if self.vumeter_box: self.vumeter_box.add(self.sltv.vus[0]) self.vumeter_box.add(self.sltv.vus[1]) # pip pip_box = self.interface.get_object("pip_box") self.pip_selector = pip_widget.PIPSelector() self.pip_selector.connect("changed", self.on_pip_changed) pip_box.add(self.pip_selector) pip_box.show_all() # sources self.sources = self.sltv.sources self.audioconvs = self.sltv.audioconvs self.sources_ui = sources.Sources(self, self.sources, self.audioconvs) self.video_source_box = self.interface.get_object("video_source_box") self.sources_view = sources_view.SourcesView(self.sltv, self.sources) self.sources_view.show_all() self.video_source_box.pack_start(self.sources_view, False, False) # audio combobox self.audio_sources_combobox = self.interface.get_object( "audio_sources_combobox") self.audio_sources_combobox.set_model( sources.AudioModel(self.sources).model) cell = gtk.CellRendererText() self.audio_sources_combobox.pack_start(cell, True) self.audio_sources_combobox.add_attribute(cell, "text", 0) self.audio_sources_combobox.connect("changed", self.on_select_audio_source) self.audio_sources_combobox.set_active(0) # outputs self.outputs = self.sltv.outputs self.outputs_ui = outputs.Outputs(self, self.outputs, self.encoders) self.outputs_box = self.interface.get_object("outputs_box") self.outputs_view = outputs_view.OutputsView(self.sltv, self.outputs) self.outputs_view.show_all() self.outputs_box.pack_start(self.outputs_view, False, False) # settings dialog self.settings_dialog.set_has_separator(False) self.settings_dialog.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE) self.settings_dialog.connect('delete-event', self.hide_settings) self.settings_dialog.connect('response', self.hide_settings) vbox = self.settings_dialog.get_content_area() vbox.set_border_width(12) notebook = gtk.Notebook() self.settings_notebook = notebook vbox.add(notebook) vbox = gtk.VBox() vbox.set_border_width(12) vbox.pack_start(self.sources_ui.get_widget()) notebook.append_page(vbox, gtk.Label('Sources')) vbox = gtk.VBox() vbox.set_border_width(12) vbox.pack_start(self.encoders_ui.get_widget()) notebook.append_page(vbox, gtk.Label('Encoders')) vbox = gtk.VBox() vbox.set_border_width(12) vbox.pack_start(self.outputs_ui.get_widget()) notebook.append_page(vbox, gtk.Label('Outputs')) vbox = gtk.VBox() vbox.set_border_width(12) vbox.pack_start(self.metadata_ui.get_widget()) notebook.append_page(vbox, gtk.Label('Metadata')) #menu self.settings_menuitem = self.interface.get_object("settings_menuitem") self.quit_menuitem = self.interface.get_object("quit_menuitem") self.about_menu = self.interface.get_object("about_menu") self.play_button.connect("clicked", self.on_play_press) self.stop_button.connect("clicked", self.on_stop_press) self.main_window.connect("delete_event", self.on_window_closed) self.settings_menuitem.connect("activate", self.show_settings) self.quit_menuitem.connect("activate", gtk.main_quit) self.about_menu.connect("activate", self.show_about)
def OnAboutButton(self, event): about.About(self)