Open configuration dialogs
426820
function() {
            var that = this;

            return dialogs.fields("Edit", [
                {
                    "title": {
                        'label': "Title",
                        'type': "text"
                    },
                    "condition": {
                        'label': "Condition",
                        'type': "text"
                    }
                },
                allAlerts[this.get("type")].config
            ], _.extend({}, this.get("configuration"), {
                'title': this.get("title"),
                'condition': this.get("condition")
            }))
            .then(function(data) {
                that.set("title", data.title);
                that.set("condition", data.condition);
                that.set("configuration", _.omit(data, "title", "condition"));
                return that.edit();
            });
        }
681515
protected void openNewDialog() {

        final Window window = CmsBasicDialog.prepareWindow(DialogWidth.wide);
        CmsBasicDialog dialog = new CmsNewElementDialog(m_cms, m_stateBean.getPath(), window, this);
        window.setContent(dialog);
        window.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_ADD_ELEMENT_0));
        A_CmsUI.get().addWindow(window);
    }
910308
protected void openDialog() {

        CmsCreateModelPageDialog dialog = new CmsCreateModelPageDialog(
            CmsSitemapView.getInstance().getController(),
            m_isModelGroup);
        dialog.center();
    }
1330259
def show():
    
    if not is_configured():
        raise JutException('No configurations available, please run: `jut config add`')

    info('Available jut configurations:')
    index = 0
    for configuration in _CONFIG.sections():
        username = _CONFIG.get(configuration, 'username')
        app_url = _CONFIG.get(configuration, 'app_url')

        if app_url != defaults.APP_URL:
            if _CONFIG.has_option(configuration, 'default'):
                info(' %d: %s@%s (default)', index + 1, username, app_url)
            else:
                info(' %d: %s@%s', index + 1, username, app_url)

        else:
            if _CONFIG.has_option(configuration, 'default'):
                info(' %d: %s (default)' % (index + 1, username))
            else:
                info(' %d: %s' % (index + 1, username))

        index += 1
996658
def config(config, skip_defaults):
    

    configurator = ClickConfigurator(
        vodka.plugin,
        skip_defaults=skip_defaults
    )

    configurator.configure(vodka.config.instance, vodka.config.InstanceHandler)

    try:
        dst = munge_config.parse_url(config)
    except ValueError:
        config = os.path.join(config, "config.yaml")
        dst = munge_config.parse_url(config)

    config_dir = os.path.dirname(config)
    if not os.path.exists(config_dir) and config_dir:
        os.makedirs(config_dir)

    dst.cls().dumpu(vodka.config.instance, dst.url.path)

    if configurator.action_required:
        click.echo("")
        click.echo("not all required values could be set by this script, please manually edit the config and set the following values")
        click.echo("")
        for item in configurator.action_required:
            click.echo("- %s" % item)
        click.echo("")

    click.echo("Config written to %s" % dst.url.path)
233442
def show(config):
    """"""
    with open(config, 'r'):
        main.show(yaml.load(open(config)))
528959
function openDialog(files, config, handleInsert) {
  uploadcare.openDialog(files, config).done(({ promise }) =>
    promise().then(({ cdnUrl, count }) => {
      if (config.multiple) {
        const urls = Array.from({ length: count }, (val, idx) => `${cdnUrl}nth/${idx}/`);
        handleInsert(urls);
      } else {
        handleInsert(cdnUrl);
      }
    }),
  );
}
1021908
def load_config(self):
    """"""
    config = dict([(key, value) for key, value in iteritems(self.options)
                   if key in self.cfg.settings and value is not None])
    for key, value in iteritems(config):
      self.cfg.set(key.lower(), value)
1302528
def _on_open(self, sender, *args, **kwargs):
        
        self.get_config()
        self.get_version()

        self.on_open()
361271
def load_from_conf(self):
        """"""
        for checkbox, (option, default) in list(self.checkboxes.items()):
            checkbox.setChecked(self.get_option(option, default))
            # QAbstractButton works differently for PySide and PyQt
            if not API == 'pyside':
                checkbox.clicked.connect(lambda _foo, opt=option:
                                         self.has_been_modified(opt))
            else:
                checkbox.clicked.connect(lambda opt=option:
                                         self.has_been_modified(opt))
        for radiobutton, (option, default) in list(self.radiobuttons.items()):
            radiobutton.setChecked(self.get_option(option, default))
            radiobutton.toggled.connect(lambda _foo, opt=option:
                                        self.has_been_modified(opt))
            if radiobutton.restart_required:
                self.restart_options[option] = radiobutton.label_text
        for lineedit, (option, default) in list(self.lineedits.items()):
            lineedit.setText(self.get_option(option, default))
            lineedit.textChanged.connect(lambda _foo, opt=option:
                                         self.has_been_modified(opt))
            if lineedit.restart_required:
                self.restart_options[option] = lineedit.label_text
        for textedit, (option, default) in list(self.textedits.items()):
            textedit.setPlainText(self.get_option(option, default))
            textedit.textChanged.connect(lambda opt=option:
                                         self.has_been_modified(opt))
            if textedit.restart_required:
                self.restart_options[option] = textedit.label_text
        for spinbox, (option, default) in list(self.spinboxes.items()):
            spinbox.setValue(self.get_option(option, default))
            spinbox.valueChanged.connect(lambda _foo, opt=option:
                                         self.has_been_modified(opt))
        for combobox, (option, default) in list(self.comboboxes.items()):
            value = self.get_option(option, default)
            for index in range(combobox.count()):
                data = from_qvariant(combobox.itemData(index), to_text_string)
                # For PyQt API v2, it is necessary to convert `data` to
                # unicode in case the original type was not a string, like an
                # integer for example (see qtpy.compat.from_qvariant):
                if to_text_string(data) == to_text_string(value):
                    break
            else:
                if combobox.count() == 0:
                    index = None
            if index:
                combobox.setCurrentIndex(index)
            combobox.currentIndexChanged.connect(lambda _foo, opt=option:
                                                 self.has_been_modified(opt))
            if combobox.restart_required:
                self.restart_options[option] = combobox.label_text

        for (fontbox, sizebox), option in list(self.fontboxes.items()):
            font = self.get_font(option)
            fontbox.setCurrentFont(font)
            sizebox.setValue(font.pointSize())
            if option is None:
                property = 'plugin_font'
            else:
                property = option
            fontbox.currentIndexChanged.connect(lambda _foo, opt=property:
                                                self.has_been_modified(opt))
            sizebox.valueChanged.connect(lambda _foo, opt=property:
                                         self.has_been_modified(opt))
        for clayout, (option, default) in list(self.coloredits.items()):
            property = to_qvariant(option)
            edit = clayout.lineedit
            btn = clayout.colorbtn
            edit.setText(self.get_option(option, default))
            # QAbstractButton works differently for PySide and PyQt
            if not API == 'pyside':
                btn.clicked.connect(lambda _foo, opt=option:
                                    self.has_been_modified(opt))
            else:
                btn.clicked.connect(lambda opt=option:
                                    self.has_been_modified(opt))
            edit.textChanged.connect(lambda _foo, opt=option:
                                     self.has_been_modified(opt))
        for (clayout, cb_bold, cb_italic
             ), (option, default) in list(self.scedits.items()):
            edit = clayout.lineedit
            btn = clayout.colorbtn
            color, bold, italic = self.get_option(option, default)
            edit.setText(color)
            cb_bold.setChecked(bold)
            cb_italic.setChecked(italic)
            edit.textChanged.connect(lambda _foo, opt=option:
                                     self.has_been_modified(opt))
            # QAbstractButton works differently for PySide and PyQt
            if not API == 'pyside':
                btn.clicked.connect(lambda _foo, opt=option:
                                    self.has_been_modified(opt))
                cb_bold.clicked.connect(lambda _foo, opt=option:
                                        self.has_been_modified(opt))
                cb_italic.clicked.connect(lambda _foo, opt=option:
                                          self.has_been_modified(opt))
            else:
                btn.clicked.connect(lambda opt=option:
                                    self.has_been_modified(opt))
                cb_bold.clicked.connect(lambda opt=option:
                                        self.has_been_modified(opt))
                cb_italic.clicked.connect(lambda opt=option:
                                          self.has_been_modified(opt))
744359
def _configure(configuration_details):
    """"""
    path = Path(configuration_details.path).expanduser()
    with path.open('a') as shell_config:
        shell_config.write(u'\n')
        shell_config.write(configuration_details.content)
        shell_config.write(u'\n')
323923
def _load_configuration():
    """"""
    config = configparser.RawConfigParser()
    module_dir = os.path.dirname(sys.modules[__name__].__file__)
    if 'APPDATA' in os.environ:  # Windows
        os_config_path = os.environ['APPDATA']
    elif 'XDG_CONFIG_HOME' in os.environ:  # Modern Linux
        os_config_path = os.environ['XDG_CONFIG_HOME']
    elif 'HOME' in os.environ:  # Legacy Linux
        os_config_path = os.path.join(os.environ['HOME'], '.config')
    else:
        os_config_path = None
    locations = [os.path.join(module_dir, 'praw.ini'), 'praw.ini']
    if os_config_path is not None:
        locations.insert(1, os.path.join(os_config_path, 'praw.ini'))
    if not config.read(locations):
        raise Exception('Could not find config file in any of: {0}'
                        .format(locations))
    return config
1162043
function open(config) {
  return R.compose(
    Bluebird.resolve
  , Nano
  , makeUrl
  , R.path(PATH)
  , R.when(isInvalidConfiguration, throwInvalidConfig)
  )(config)
}
149672
def _on_import_config(self, *args):
        
        def handle_import(dialog_text, path_name):
            chooser = Gtk.FileChooserDialog(dialog_text, None,
                                            Gtk.FileChooserAction.SAVE,
                                            (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
                                             Gtk.STOCK_OPEN, Gtk.ResponseType.ACCEPT))
            chooser.set_current_folder(path_name)
            response = chooser.run()
            if response == Gtk.ResponseType.ACCEPT:
                # get_filename() returns the whole file path inclusively the filename
                config_file = chooser.get_filename()
                config_path = dirname(config_file)
                self._last_path = config_path
                config_dict = yaml_configuration.config.load_dict_from_yaml(config_file)
                config_type = config_dict.get("TYPE")
                if config_type == "SM_CONFIG":
                    del config_dict["TYPE"]
                    self.core_config_model.update_config(config_dict, config_file)
                    logger.info("Imported Core Config from {0}".format(config_file))
                elif config_type == "GUI_CONFIG":
                    del config_dict["TYPE"]
                    self.gui_config_model.update_config(config_dict, config_file)
                    logger.info("Imported GUI Config from {0}".format(config_file))
                else:
                    logger.error("{0} is not a valid config file".format(config_file))
            elif response == Gtk.ResponseType.CANCEL:
                logger.info("Import of configuration cancelled")
            chooser.destroy()

        handle_import("Import Config Config from", self._last_path)

        self.check_for_preliminary_config()
        self.update_path_labels()
1299272
def create_shortcuts(self):
        """"""
        # --- Configurable shortcuts
        inspect = config_shortcut(self.inspect_current_object, context='Editor',
                                  name='Inspect current object', parent=self)
        set_breakpoint = config_shortcut(self.set_or_clear_breakpoint,
                                         context='Editor', name='Breakpoint',
                                         parent=self)
        set_cond_breakpoint = config_shortcut(
                                    self.set_or_edit_conditional_breakpoint,
                                    context='Editor',
                                    name='Conditional breakpoint',
                                    parent=self)
        gotoline = config_shortcut(self.go_to_line, context='Editor',
                                   name='Go to line', parent=self)
        tab = config_shortcut(lambda: self.tab_navigation_mru(forward=False),
                              context='Editor',
                              name='Go to previous file', parent=self)
        tabshift = config_shortcut(self.tab_navigation_mru, context='Editor',
                                   name='Go to next file', parent=self)
        prevtab = config_shortcut(lambda: self.tabs.tab_navigate(-1),
                                  context='Editor',
                                  name='Cycle to previous file', parent=self)
        nexttab = config_shortcut(lambda: self.tabs.tab_navigate(1),
                                  context='Editor',
                                  name='Cycle to next file', parent=self)
        run_selection = config_shortcut(self.run_selection, context='Editor',
                                        name='Run selection', parent=self)
        new_file = config_shortcut(lambda : self.sig_new_file[()].emit(),
                                   context='Editor', name='New file',
                                   parent=self)
        open_file = config_shortcut(lambda : self.plugin_load[()].emit(),
                                    context='Editor', name='Open file',
                                    parent=self)
        save_file = config_shortcut(self.save, context='Editor',
                                    name='Save file', parent=self)
        save_all = config_shortcut(self.save_all, context='Editor',
                                   name='Save all', parent=self)
        save_as = config_shortcut(lambda : self.sig_save_as.emit(),
                                  context='Editor', name='Save As',
                                  parent=self)
        close_all = config_shortcut(self.close_all_files, context='Editor',
                                    name='Close all', parent=self)
        prev_edit_pos = config_shortcut(lambda : self.sig_prev_edit_pos.emit(),
                                        context="Editor",
                                        name="Last edit location",
                                        parent=self)
        prev_cursor = config_shortcut(lambda : self.sig_prev_cursor.emit(),
                                      context="Editor",
                                      name="Previous cursor position",
                                      parent=self)
        next_cursor = config_shortcut(lambda : self.sig_next_cursor.emit(),
                                      context="Editor",
                                      name="Next cursor position",
                                      parent=self)
        zoom_in_1 = config_shortcut(lambda : self.zoom_in.emit(),
                                      context="Editor",
                                      name="zoom in 1",
                                      parent=self)
        zoom_in_2 = config_shortcut(lambda : self.zoom_in.emit(),
                                      context="Editor",
                                      name="zoom in 2",
                                      parent=self)
        zoom_out = config_shortcut(lambda : self.zoom_out.emit(),
                                      context="Editor",
                                      name="zoom out",
                                      parent=self)
        zoom_reset = config_shortcut(lambda: self.zoom_reset.emit(),
                                      context="Editor",
                                      name="zoom reset",
                                      parent=self)
        close_file_1 = config_shortcut(self.close_file,
                                      context="Editor",
                                      name="close file 1",
                                      parent=self)
        close_file_2 = config_shortcut(self.close_file,
                                      context="Editor",
                                      name="close file 2",
                                      parent=self)
        run_cell = config_shortcut(self.run_cell,
                                      context="Editor",
                                      name="run cell",
                                      parent=self)
        run_cell_and_advance = config_shortcut(self.run_cell_and_advance,
                                      context="Editor",
                                      name="run cell and advance",
                                      parent=self)
        go_to_next_cell = config_shortcut(self.advance_cell,
                                          context="Editor",
                                          name="go to next cell",
                                          parent=self)
        go_to_previous_cell = config_shortcut(lambda: self.advance_cell(reverse=True),
                                              context="Editor",
                                              name="go to previous cell",
                                              parent=self)
        re_run_last_cell = config_shortcut(self.re_run_last_cell,
                                      context="Editor",
                                      name="re-run last cell",
                                      parent=self)
        prev_warning = config_shortcut(lambda: self.sig_prev_warning.emit(),
                                       context="Editor",
                                       name="Previous warning",
                                       parent=self)
        next_warning = config_shortcut(lambda: self.sig_next_warning.emit(),
                                       context="Editor",
                                       name="Next warning",
                                       parent=self)
        split_vertically = config_shortcut(lambda: self.sig_split_vertically.emit(),
                                           context="Editor",
                                           name="split vertically",
                                           parent=self)
        split_horizontally = config_shortcut(lambda: self.sig_split_horizontally.emit(),
                                             context="Editor",
                                             name="split horizontally",
                                             parent=self)
        close_split = config_shortcut(self.close_split,
                                      context="Editor",
                                      name="close split panel",
                                      parent=self)

        # Return configurable ones
        return [inspect, set_breakpoint, set_cond_breakpoint, gotoline, tab,
                tabshift, run_selection, new_file, open_file, save_file,
                save_all, save_as, close_all, prev_edit_pos, prev_cursor,
                next_cursor, zoom_in_1, zoom_in_2, zoom_out, zoom_reset,
                close_file_1, close_file_2, run_cell, run_cell_and_advance,
                go_to_next_cell, go_to_previous_cell, re_run_last_cell,
                prev_warning, next_warning, split_vertically,
                split_horizontally, close_split,
                prevtab, nexttab]
1083104
def openParametersDialog(params, title=None):
    '''
    
    '''
    QApplication.setOverrideCursor(QCursor(Qt.ArrowCursor))
    dlg = ParametersDialog(params, title)
    dlg.exec_()
    QApplication.restoreOverrideCursor()
    return dlg.values
203454
def open_file_dialog(self):
        
        dialog = QtWidgets.QFileDialog
        sender = self.sender()
        if sender == self.btn_open_source:
            textbox = self.source_path
        elif sender == self.btn_open_target:
            textbox = self.target_path
        folder = dialog.getExistingDirectory(self, 'Select a file:', textbox.text(), options = QtWidgets.QFileDialog.ShowDirsOnly)
        if str(folder) != '':
            textbox.setText(folder)
            # load elements from file and display in tree
            if sender == self.btn_open_source:
                self.reset_avaliable(folder)