当前位置: 首页>>代码示例>>Python>>正文


Python mforms.newCheckBox函数代码示例

本文整理汇总了Python中mforms.newCheckBox函数的典型用法代码示例。如果您正苦于以下问题:Python newCheckBox函数的具体用法?Python newCheckBox怎么用?Python newCheckBox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了newCheckBox函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, main):
        WizardPage.__init__(self, main, "Target Creation Options")

        self.main.add_wizard_page(self, "ObjectMigration", "Target Creation Options")

        label = mforms.newLabel("Select options for the creation of the migrated schema in the target\nMySQL server and click [Next >] to execute.")
        self.content.add(label, False, True)

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Schema Creation")
        self.content.add(panel, False, True)

        box = mforms.newBox(False)
        panel.add(box)
        box.set_padding(12)

        self._create_db = mforms.newCheckBox()
        self._create_db.set_text("Create schema in target RDBMS")
        box.add(self._create_db, False, True)

        # spacer
        box.add(mforms.newLabel(""), False, True)

        self._create_script = mforms.newCheckBox()
        self._create_script.set_text("Create a SQL script file")
        self._create_script.add_clicked_callback(self._toggle_sql_script)
        box.add(self._create_script, False, True)
        self._file_hbox = mforms.newBox(True)
        self._file_hbox.set_spacing(4)
        self._file_hbox.add(mforms.newLabel("Script File:"), False, True)
        self._create_script_file = mforms.newTextEntry()
        self._create_script_file.set_value(os.path.join(os.path.expanduser('~'), 'migration_script.sql'))
        self._file_hbox.add(self._create_script_file, True, True)
        button = mforms.newButton()
        button.set_text("Browse...")
        button.add_clicked_callback(self._browse_files)
        self._file_hbox.add(button, False, True)
        box.add(self._file_hbox, False, True)

        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Options")
        self.content.add(panel, False, True)

        box = mforms.newBox(False)
        panel.add(box)
        box.set_padding(12)
        box.set_spacing(8)

        self._keep_schema = mforms.newCheckBox()
        self._keep_schema.set_text("Keep schemas if they already exist. Objects that already exist will not be recreated or updated.")
        box.add(self._keep_schema, False, True)

        self._create_db.set_active(True)
        self._toggle_sql_script()
        self._check_file_duplicate = True
开发者ID:alMysql,项目名称:mysql-workbench,代码行数:55,代码来源:migration_schema_creation.py

示例2: create_options

 def create_options(self, box, options):
     optlist = []
     for option in options:
         cont = None
         if option.paramType == "boolean":
             opt = mforms.newCheckBox()
             opt.set_active(self.defaultValue == "1")
             box.add(opt, False, True)
             getter = opt.get_string_value
         elif option.paramType == "string":
             hbox = mforms.newBox(True)
             hbox.set_spacing(8)
             hbox.add(mforms.newLabel(option.caption), False, True)
             opt = mforms.newTextEntry()
             opt.set_value(option.defaultValue)
             hbox.add(opt, True, True)
             l = mforms.newLabel(option.description)
             l.set_style(mforms.SmallHelpTextStyle)
             hbox.add(l, False, True)
             box.add(hbox, False, True)
             cont = hbox
             getter = opt.get_string_value
         else:
             grt.send_error("MigrationWizard", "migrationOption() for source has an invalid parameter of type %s (%s)" % (option.paramType, option.name))
             continue
         optlist.append((cont or opt, option.name, getter))
     return optlist
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:27,代码来源:migration_object_migration.py

示例3: _add_script_checkbox_option

    def _add_script_checkbox_option(self, box, name, caption, path_caption, browser_caption):
        check = mforms.newCheckBox()
        check.set_text(caption)
        box.add(check, False, True)
        vbox = mforms.newBox(False)
        vbox.set_spacing(4)
        file_box = mforms.newBox(True)
        file_box.set_spacing(4)
        file_box.add(mforms.newLabel(path_caption), False, True)
        file_entry = mforms.newTextEntry()
        file_entry.add_changed_callback(lambda self=self, option=name: setattr(self, name+"_check_duplicate", True))
        file_box.add(file_entry, True, True)
        check.add_clicked_callback(lambda box=vbox, check=check: box.set_enabled(check.get_active()))
        button = mforms.newButton()
        button.set_text("Browse...")
        button.add_clicked_callback(lambda option=name, title=browser_caption: self._browse_files(option, title))
        file_box.add(button, False, True)
        vbox.add(file_box, False, True)
        label = mforms.newLabel("You should edit this file to add the source and target server passwords before running it.")
        label.set_style(mforms.SmallHelpTextStyle)
        vbox.add(label, False, True)
        vbox.set_enabled(False)
        box.add(vbox, False, True)

        setattr(self, name+"_check_duplicate", False)
        setattr(self, name+"_checkbox", check)
        setattr(self, name+"_entry", file_entry)
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:27,代码来源:migration_data_transfer.py

示例4: create_ui

    def create_ui(self):
        # Main layout structure
        self.server_instance_box = mforms.newBox(False)
        self.server_instance_box.set_spacing(8)
        instance_label = mforms.newLabel('Target RDBMS Connection Parameters')
        instance_label.set_style(mforms.BoldStyle)
        self.server_instance_box.add(instance_label, False, True)

        # TODO: Enable the export to script option in future versions:
#        self.just_script_choice = mforms.newCheckBox()
#        self.just_script_choice.set_text('Do not use a live instance (SQL script output)')
#        self.just_script_choice.set_tooltip('Check this if you just want an output script to execute it later')
#        self.just_script_choice.add_clicked_callback(self.just_script_toggled)
#        self.server_instance_box.add(self.just_script_choice, False)

        # Add the view that corresponds to the selected RDBMS:
        self.panel = grt.classes.ui_db_ConnectPanel()
        self.panel.initialize(grt.root.wb.rdbmsMgmt)
        view = mforms.fromgrt(self.panel.view)
        self.server_instance_box.add(view, True, True)

        box = mforms.newBox(True)
        self._store_connection_check = mforms.newCheckBox()
        self._store_connection_check.set_text("Store connection for future usage as ")
        self._store_connection_check.add_clicked_callback(self._toggle_store_connection)
        box.add(self._store_connection_check, False, False)
        self._store_connection_entry = mforms.newTextEntry()
        box.add(self._store_connection_entry, True, True)
        self._store_connection_entry.set_enabled(False)

        self.server_instance_box.add(box, False, False)
        self.content.add(self.server_instance_box, True, True)

        self.advanced_button.set_text("Test Connection")
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:34,代码来源:migration_source_selection.py

示例5: column_selected

    def column_selected(self):
        column = self.selected_column()
        if column:
            self.column_details.set_enabled(True)
            for c in self.flag_checkboxes:
                self.column_details.remove(c)
            self.flag_checkboxes = []

            if column.simpleType:
                for flag in column.simpleType.flags:
                    check = mforms.newCheckBox()
                    check.set_text(flag)
                    check.set_active(flag in column.flags)
                    self.column_details.add(check, False, True)
                    self.flag_checkboxes.append(check)
                    check.add_clicked_callback(lambda check=check, flag=flag:self.flag_checked(check, flag))
        
                if column.simpleType.group.name != "string" and not column.simpleType.name.lower().endswith("text"):
                    self.charset.set_selected(0)
                    self.charset.set_enabled(False)
                else:
                    self.charset.set_enabled(True)

            if not column.collationName:
                self.charset.set_selected(0)
            else:
                self.charset.set_value(column.collationName)
        else:
            self.charset.set_selected(0)
            self.column_details.set_enabled(False)
            for c in self.flag_checkboxes:
                self.column_details.remove(c)
            self.flag_checkboxes = []
开发者ID:pk-codebox-evo,项目名称:mysql-workbench,代码行数:33,代码来源:table_templates.py

示例6: addCheckbox

 def addCheckbox(self, l, m , k):
   curBox=self.createBaseInput(l)
   input=mforms.newCheckBox()
   if m.has_key(k):
       input.set_active(m[k])
   curBox.add(input,False,True)        
   input.add_clicked_callback(lambda:self.changeBoolValue(input,m,k))
开发者ID:dashiad,项目名称:Siviglia,代码行数:7,代码来源:test3.py

示例7: create_ui

    def create_ui(self):
        self.suspend_layout()
        self.set_spacing(16)
        
        label = mforms.newLabel("Table Data Export allows you to easily export data into csv, json datafiles.\n")
        label.set_style(mforms.BoldInfoCaptionStyle)

        self.content.add(label, False, False)

        entry_box = mforms.newBox(True)
        entry_box.set_spacing(5)

        entry_box.add(mforms.newLabel("File Path:"), False, True)

        self.exportfile_path = mforms.newTextEntry()
        self.exportfile_path.add_changed_callback(lambda entry=self.exportfile_path: self.entry_changed(entry))
        entry_box.add(self.exportfile_path, True, True)
        if last_location != None:
            self.exportfile_path.set_value(last_location)
            self.confirm_file_overwrite = True
            self.get_module(True)

        browse_btn = mforms.newButton()
        browse_btn.set_text("Browse...")
        browse_btn.add_clicked_callback(self.browse)
        entry_box.add(browse_btn, False, False)
        self.content.add(entry_box, False, True)
        
        radio_box = mforms.newBox(True)
        radio_box.set_spacing(8)
        for format in self.main.formats:
            fradio = mforms.newRadioButton(1)
            fradio.set_text(format.title)
            fradio.set_active(bool(self.active_module and self.active_module.name == format.name))
            fradio.add_clicked_callback(lambda f = format: self.output_type_changed(f))
            radio_box.add(fradio, False, False)
            self.radio_opts.append({'radio':fradio, 'name': format.name})
        self.content.add(radio_box, False, False)

        self.optpanel = mforms.newPanel(mforms.TitledBoxPanel)
        self.optpanel.set_title("Options:")

        self.content.add(self.optpanel, False, True)
        self.optpanel.show(False)
        
        self.export_local_box = mforms.newBox(False)
        self.export_local_cb = mforms.newCheckBox()
        self.export_local_cb.set_text("Export to local machine")
        self.export_local_cb.set_active(True)
        self.export_local_box.add(self.export_local_cb, False, True)
        l = mforms.newLabel("""If checked rows will be exported on the location that started Workbench.\nIf not checked, rows will be exported on the server.\nIf server and computer that started Workbench are different machines, import of that file can be done manual way only.""")
        l.set_style(mforms.SmallHelpTextStyle)
        self.export_local_box.add(l, False, True)
        
        self.content.add(self.export_local_box, False, True)
        self.resume_layout()
        
        self.load_module_options()
开发者ID:Roguelazer,项目名称:mysql-workbench,代码行数:58,代码来源:sqlide_power_export_wizard.py

示例8: __init__

    def __init__(self, owner):
        WizardPage.__init__(self, owner, "Options")
        
        self.generate_files = newCheckBox()
        self.generate_files.set_text("Generate new certificates and self-signed keys");
        self.generate_files.set_active(not self.check_all_files_availability())
        self.generate_files.set_enabled(self.check_all_files_availability())

        self.update_connection = newCheckBox()
        self.update_connection.set_text("Update the connection");
        self.update_connection.set_active(True)

        self.use_default_parameters = newCheckBox()
        self.use_default_parameters.set_text("Use default parameters");
        self.use_default_parameters.set_active(False)
        
        self.clear_button = newButton()
        self.clear_button.set_text("Clear")
        self.clear_button.add_clicked_callback(self.clear_button_clicked)
        self.clear_button.set_enabled(os.path.isdir(self.main.results_path))
开发者ID:alMysql,项目名称:mysql-workbench,代码行数:20,代码来源:wb_utils_grt.py

示例9: add_check_entry_row

 def add_check_entry_row(table, row, label, name):
     check = mforms.newCheckBox()
     check.set_text(label)
     table.add(check, 0, 1, row, row+1, mforms.HFillFlag)
     entry = mforms.newTextEntry()
     entry.add_changed_callback(self.save_changes)
     table.add(entry, 1, 2, row, row+1, mforms.HFillFlag|mforms.HExpandFlag) 
     setattr(self, name+"_check", check)
     setattr(self, name+"_entry", entry)
     entry.set_enabled(False)
     def callback(entry, check):
         if not check.get_active():
             entry.set_value("-2")
         entry.set_enabled(check.get_active())
         self.save_changes()
     check.add_clicked_callback(lambda: callback(entry, check))
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:16,代码来源:datatype_mapping_editor.py

示例10: create_ui

    def create_ui(self):
        self.content.set_padding(20)

        self.content.add(mforms.newLabel('Select the schemas to copy to the destination server and click [Start Copy >] to start the process.'), False, True)

        self.catalog_schemata = [ full_name.partition('.')[-1]
                                    for full_name in self.main.plan.migrationSource.schemaNames if full_name not in SYSTEM_SCHEMAS ]
        self.schema_selector = DatabaseSchemaSelector(self.catalog_schemata, tree_checked_callback=self.update_next_button)
        self.content.add(self.schema_selector, True, True)
  
        self.innodb_switch = mforms.newCheckBox()
        self.innodb_switch.set_text('Migrate MyISAM tables to InnoDB')
        self.innodb_switch.set_active(True)
        self.content.add_end(self.innodb_switch, False)

        self.content.add_end(mforms.newLabel(''), False)
        
        self.next_button.set_text('Start Copy >')
        self.next_button.set_enabled(False)
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:19,代码来源:db_copy_schema_selection.py

示例11: create_ui

    def create_ui(self):
        self.content.set_padding(20)

        self.content.add(mforms.newLabel('Select the schemas to copy to the destination server and click [Start Copy >] to start the process.'), False, True)

        match_str = r"\%s\.\%s" % (self.main.plan.migrationSource._db_module.quoteIdentifier('(.+)\\'), self.main.plan.migrationSource._db_module.quoteIdentifier('(.+)\\'))

        self.catalog_schemata = [ schema_name for catalog_name, schema_name in (re.match(match_str, full_name).groups()
                                            for full_name in [x for x in self.main.plan.migrationSource.schemaNames if x not in SYSTEM_SCHEMAS])]

        self.schema_selector = DatabaseSchemaSelector(self.catalog_schemata, tree_checked_callback=self.update_next_button)
        self.content.add(self.schema_selector, True, True)
  
        self.innodb_switch = mforms.newCheckBox()
        self.innodb_switch.set_text('Migrate MyISAM tables to InnoDB')
        self.innodb_switch.set_active(True)
        self.content.add_end(self.innodb_switch, False)

        self.content.add_end(mforms.newLabel(''), False)
        
        self.next_button.set_text('Start Copy >')
        self.next_button.set_enabled(False)
开发者ID:Roguelazer,项目名称:mysql-workbench,代码行数:22,代码来源:db_copy_schema_selection.py

示例12: options_schema_box

  def options_schema_box(self):
    tBox = PropelForm.spaced_box(True)

    self.widgets['export_FK_name'] = mforms.newCheckBox()
    self.widgets['export_FK_name'].set_text('export all FK name')
    self.widgets['export_FK_name'].set_active(self.db.cache['export_FK_name'])
    self.widgets['export_FK_name'].add_clicked_callback(lambda: self.refresh_text_editor_schema_box())
    tBox.add(self.widgets['export_FK_name'], False, True)

    self.widgets['export_add_ai_on_pk'] = mforms.newCheckBox()
    self.widgets['export_add_ai_on_pk'].set_text('add AI to PK')
    self.widgets['export_add_ai_on_pk'].set_active(self.db.cache['export_add_ai_on_pk'])
    self.widgets['export_add_ai_on_pk'].add_clicked_callback(lambda: self.refresh_text_editor_schema_box())
    tBox.add(self.widgets['export_add_ai_on_pk'], False, True)

    self.widgets['export_index'] = mforms.newCheckBox()
    self.widgets['export_index'].set_text('export all indexes')
    self.widgets['export_index'].set_active(self.db.cache['export_index'])
    self.widgets['export_index'].add_clicked_callback(lambda: self.refresh_text_editor_schema_box())
    tBox.add(self.widgets['export_index'], False, True)

    self.widgets['export_index_name'] = mforms.newCheckBox()
    self.widgets['export_index_name'].set_text('export all indexe\'s name')
    self.widgets['export_index_name'].set_active(self.db.cache['export_index_name'])
    self.widgets['export_index_name'].add_clicked_callback(lambda: self.refresh_text_editor_schema_box())
    tBox.add(self.widgets['export_index_name'], False, True)

    self.widgets['export_unique'] = mforms.newCheckBox()
    self.widgets['export_unique'].set_text('export all uniques')
    self.widgets['export_unique'].set_active(self.db.cache['export_unique'])
    self.widgets['export_unique'].add_clicked_callback(lambda: self.refresh_text_editor_schema_box())
    tBox.add(self.widgets['export_unique'], False, True)

    self.widgets['export_unique_name'] = mforms.newCheckBox()
    self.widgets['export_unique_name'].set_text('export all unique\'s name')
    self.widgets['export_unique_name'].set_active(self.db.cache['export_unique_name'])
    self.widgets['export_unique_name'].add_clicked_callback(lambda: self.refresh_text_editor_schema_box())
    tBox.add(self.widgets['export_unique_name'], False, True)

    self.add(tBox, False, True)
开发者ID:mazenovi,项目名称:PropelUtilityDev,代码行数:40,代码来源:PropelTabExport.py

示例13: create_ui


#.........这里部分代码省略.........
        self.killq_button = newButton()
        self.killq_button.set_text("Kill Query(s)")
        box.add_end(self.killq_button, False, True)
        self.killq_button.add_clicked_callback(weakcb(self, "kill_query"))
        
        refresh_label = newLabel("Refresh Rate:")
        box.add(refresh_label, False, True)

        self._menu = mforms.newContextMenu()
        self._menu.add_will_show_callback(self.menu_will_show)
        self.connection_list.set_context_menu(self._menu)

        
        self.refresh_values = [0.5, 1, 2, 3, 4, 5, 10, 15, 30]
        self.refresh_values_size = len(self.refresh_values)
        
        self.refresh_selector = newSelector()
        self.refresh_selector.set_size(100,-1)
        
        for s in self.refresh_values:
            self.refresh_selector.add_item(str(s) + " seconds")
        
        self.refresh_selector.add_item("Don't Refresh")
        
        refresh_rate_index = grt.root.wb.options.options.get('Administrator:refresh_connections_rate_index', 9)
        self.refresh_selector.set_selected(refresh_rate_index)
        self.update_refresh_rate()
        self.refresh_selector.add_changed_callback(weakcb(self, "update_refresh_rate"))
        box.add(self.refresh_selector, False, True)

        self.check_box = newBox(True)
        self.check_box.set_spacing(12)

        self.hide_sleep_connections = newCheckBox()
        self.hide_sleep_connections.set_text('Hide sleeping connections')
        self.hide_sleep_connections.add_clicked_callback(self.refresh)
        self.hide_sleep_connections.set_tooltip('Remove connections in the Sleeping state from the connection list.')
        self.check_box.add(self.hide_sleep_connections, False, True)

        self.mdl_locks_page = None
        self._showing_extras = False
        if self.new_processlist():
            self.hide_background_threads = newCheckBox()
            self.hide_background_threads.set_active(True)
            self.hide_background_threads.set_text('Hide background threads')
            self.hide_background_threads.set_tooltip('Remove background threads (internal server threads) from the connection list.')
            self.hide_background_threads.add_clicked_callback(self.refresh)
            self.check_box.add(self.hide_background_threads, False, True)
            
            self.truncate_info = newCheckBox()
            self.truncate_info.set_active(True)
            self.truncate_info.set_text('Don\'t load full thread info')
            self.truncate_info.set_tooltip('Toggle whether to load the entire query information for all connections or just the first 255 characters.\nEnabling this can have a large impact in busy servers or server executing large INSERTs.')
            self.truncate_info.add_clicked_callback(self.refresh)
            self.check_box.add(self.truncate_info, False, True)

            # tab with some extra info, only available if PS exists
            self.extra_info_tab = mforms.newTabView(mforms.TabViewSystemStandard)
            self.extra_info_tab.set_size(350, -1)
            self.extra_info_tab.add_tab_changed_callback(self.extra_tab_changed)

            self.connection_details_scrollarea = mforms.newScrollPanel()
            self.connection_details = ConnectionDetailsPanel(self)
            self.connection_details_scrollarea.add(self.connection_details)
            self.details_page = self.extra_info_tab.add_page(self.connection_details_scrollarea, "Details")
开发者ID:Roguelazer,项目名称:mysql-workbench,代码行数:66,代码来源:wb_admin_connections.py

示例14: create_ui

    def create_ui(self):
        self.suspend_layout()

        if not self.server_profile.admin_enabled:
            self.add(no_remote_admin_warning_label(self.server_profile), False, True)
            self.resume_layout()
            return

        self.main_view.ui_profile.apply_style(self, 'page')
        self.set_padding(8) # TODO check padding

        # Top layout structure.
        content = newBox(False)
        self.add(content, True, True)

        # A spacer at the bottom of the page.
        spacer = newBox(True)
        spacer.set_size(-1, 40)
        self.add(spacer, False, True)

        # Left pane (start/stop).
        heading = newLabel("Database Server Status")
        heading.set_style(mforms.BoldStyle)
        content.add(heading, False, True)

        left_pane = newBox(False)
        left_pane.set_spacing(8)

        self.long_status_msg = newLabel("The database server is stopped")
        self.long_status_msg.set_style(mforms.SmallStyle)
        left_pane.add(self.long_status_msg, False, True)

        status_message_part = newLabel("The database server instance is ")
        self.short_status_msg = newLabel("...")
        self.short_status_msg.set_color("#DD0000")

        self.start_stop_btn = newButton()
        self.start_stop_btn.set_text("Start server")
        self.start_stop_btn.add_clicked_callback(self.start_stop_clicked)

        start_stop_hbox = newBox(True)
        start_stop_hbox.add(status_message_part, False, True)
        start_stop_hbox.add(self.short_status_msg, False, True)
        start_stop_hbox.add(newLabel("  "), False, False)
        start_stop_hbox.add(self.start_stop_btn, False, False)
        left_pane.add(start_stop_hbox, False, False)

        left_pane.add(self.long_status_msg, False, False)
        left_pane.add(start_stop_hbox, False, False)

        description = newLabel("If you stop the server, you and your applications will not be able to use the Database and all current connections will be closed")
        description.set_style(mforms.SmallStyle)
        left_pane.add(description, False, False)

        separator = newImageBox()
        separator.set_image("options-horizontal-separator.png")
        left_pane.add(separator, False, True)

        auto_start_checkbox = newCheckBox()
        auto_start_checkbox.set_text("Automatically Start Database Server on Startup")
        auto_start_checkbox.set_active(True)

        description = newLabel("You may select to have the Database server start automatically whenever the computer starts up.")
        description.set_style(mforms.SmallStyle)
        description.set_wrap_text(True)

        content.add(left_pane, False, True)

        # Right pane (log).
        heading = newLabel("Startup Message Log")
        heading.set_style(mforms.BoldStyle)
        content.add(heading, False, True)

        right_pane = newBox(False)    
        right_pane.set_spacing(8)

        self.startup_msgs_log = newTextBox(mforms.BothScrollBars)
        self.startup_msgs_log.set_read_only(True)
        right_pane.add(self.startup_msgs_log, True, True)

        button_box = newBox(True)
        self.refresh_button = newButton()
        self.refresh_button.set_text("Refresh Status")
        self.refresh_button.add_clicked_callback(lambda:self.refresh(2))
        button_box.add(self.refresh_button, False, False)

        self.copy_to_clipboard_button = newButton()
        self.copy_to_clipboard_button.set_size(150, -1)
        self.copy_to_clipboard_button.set_text("Copy to Clipboard")
        self.copy_to_clipboard_button.add_clicked_callback(self.copy_to_clipboard)
        button_box.add_end(self.copy_to_clipboard_button, False, False)

        self.clear_messages_button = newButton()
        self.clear_messages_button.set_size(150, -1)
        self.clear_messages_button.set_text("Clear Messages")
        self.clear_messages_button.add_clicked_callback(self.clear_messages)
        button_box.add_end(self.clear_messages_button, False, False)
        right_pane.add(button_box, False, True)

        content.add(right_pane, True, True)
#.........这里部分代码省略.........
开发者ID:Arrjaan,项目名称:Cliff,代码行数:101,代码来源:wb_admin_configuration_startup.py

示例15: create_ui

    def create_ui(self):
        dprint_ex(4, "Enter")
        self.suspend_layout()

        self.heading = make_panel_header("title_connections.png", self.instance_info.name, "Client Connections")
        self.add(self.heading, False, False)

        self.warning = not_running_warning_label()
        self.add(self.warning, False, True)

        self.connection_list = newTreeNodeView(mforms.TreeDefault|mforms.TreeFlatList|mforms.TreeAltRowColors)
        self.connection_list.add_column(mforms.LongIntegerColumnType, "Id", 50, False)
        self.connection_list.add_column(mforms.StringColumnType, "User", 80, False)
        self.connection_list.add_column(mforms.StringColumnType, "Host", 120, False)
        self.connection_list.add_column(mforms.StringColumnType, "DB", 100, False)
        self.connection_list.add_column(mforms.StringColumnType, "Command", 80, False)
        self.connection_list.add_column(mforms.LongIntegerColumnType, "Time", 60, False)
        self.connection_list.add_column(mforms.StringColumnType, "State", 80, False)
        self.info_column = self.connection_list.add_column(mforms.StringColumnType, "Info", 300, False)
        self.connection_list.end_columns()
        self.connection_list.set_allow_sorting(True)
        
        self.connection_list.add_changed_callback(weakcb(self, "connection_selected"))
        
        #self.set_padding(8)
        self.add(self.connection_list, True, True)
        
        self.button_box = box = newBox(True)
        
        box.set_spacing(12)
        
        refresh_button = newButton()
        refresh_button.set_text("Refresh")
        box.add_end(refresh_button, False, True)
        refresh_button.add_clicked_callback(weakcb(self, "refresh"))

        self.kill_button = newButton()
        self.kill_button.set_text("Kill Connection")
        box.add_end(self.kill_button, False, True)
        self.kill_button.add_clicked_callback(weakcb(self, "kill_connection"))
        
        self.killq_button = newButton()
        self.killq_button.set_text("Kill Query")
        box.add_end(self.killq_button, False, True)
        self.killq_button.add_clicked_callback(weakcb(self, "kill_query"))
        
        refresh_label = newLabel("Refresh Rate:")
        box.add(refresh_label, False, True)

        self._menu = mforms.newContextMenu()
        self._menu.add_item_with_title("Copy Info", self.copy_selected, "copy_selected")
        self._menu.add_item_with_title("Show in Editor", self.edit_selected, "edit_selected")
        self.connection_list.set_context_menu(self._menu)

        
        self.refresh_values = [0.5, 1, 2, 3, 4, 5, 10, 15, 30]
        self.refresh_values_size = len(self.refresh_values)
        
        self.refresh_selector = newSelector()
        self.refresh_selector.set_size(100,-1)
        
        for s in self.refresh_values:
            self.refresh_selector.add_item(str(s) + " seconds")
        
        self.refresh_selector.add_item("Don't Refresh")
        
        refresh_rate_index = grt.root.wb.options.options.get('Administrator:refresh_connections_rate_index', 9)
        self.refresh_selector.set_selected(refresh_rate_index)
        self.update_refresh_rate()
        self.refresh_selector.add_changed_callback(weakcb(self, "update_refresh_rate"))
        box.add(self.refresh_selector, False, True)

        self.hide_sleep_connections = newCheckBox()
        self.hide_sleep_connections.set_text('Hide sleeping connections')
        self.hide_sleep_connections.add_clicked_callback(self.refresh)
        box.add(self.hide_sleep_connections, False, True)
        
        self.add(box, False, True)
        
        self.resume_layout()
        
        self.connection_selected()
        dprint_ex(4, "Leave")
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:83,代码来源:wb_admin_connections.py


注:本文中的mforms.newCheckBox函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。