def __import_files(self):
     '''Import listed files with settings defined in the dialog.
     '''
     imported_files = []
     string_columns = []
     for i in range(self.grid_column.rowCount()):
         item = self.grid_column.itemAtPosition(i, 0)
         if not item.isEmpty():
             combo_widget = self.grid_column.itemAtPosition(i, 1).widget()
             # combo_widget = combo_item
             cur_index = combo_widget.currentIndex()
             cur_text = combo_widget.currentText()
             adc = int(re.sub(r"ADC ([0-9]+).*", r"\1", cur_text))
             # + 1 since actual column, not index
             column_index = adc * 2 + cur_index % 2 + 1  
             string_columns.append("${0}".format(column_index))
     string_column = ",".join(string_columns)
     
     self.__remove_temp_file()
     root = self.treeWidget.invisibleRootItem()
     root_child_count = root.childCount()
     timing = dict()
     for coinc_key in self.__added_timings.keys():
         coinc_timing = self.__added_timings[coinc_key]
         if coinc_timing.is_not_trigger:
             timing[coinc_timing.adc] = (coinc_timing.low.value(),
                                         coinc_timing.high.value())
     start_time = clock()
     progress_bar = QtGui.QProgressBar()
     self.statusbar.addWidget(progress_bar, 1)
     progress_bar.show()
     QtCore.QCoreApplication.processEvents(QtCore.QEventLoop.AllEvents)
     # Mac requires event processing to show progress bar and its
     # process.
     
     filename_list = []
     for i in range(root_child_count):
         progress_bar.setValue(i / root_child_count)
         QtCore.QCoreApplication.processEvents(QtCore.QEventLoop.AllEvents)
         # Mac requires event processing to show progress bar and its
         # process.
         item = root.child(i)
         filename_list.append(item.filename)
         output_file = "{0}.{1}".format(
            join(self.project.directory, item.name),
            "asc")
         n = 2
         while True:  # Allow import of same named files.
             if not isfile(output_file):
                 break
             output_file = "{0}-{2}.{1}".format(
                join(self.project.directory, item.name),
                "asc", n)
             n += 1
         imported_files.append(output_file)
         coinc(item.file,
               output_file,
               skip_lines=self.spin_skiplines.value(),
               tablesize=10,
               trigger=self.spin_adctrigger.value(),
               adc_count=self.spin_adccount.value(),
               timing=timing,
               columns=string_column,
               nevents=self.spin_eventcount.value())
     
     filenames = ", ".join(filename_list)
     self.statusbar.removeWidget(progress_bar)
     progress_bar.hide()
     elapsed = clock() - start_time
     log = "Imported measurements to project: {0}".format(filenames)
     log_var = "Variables used: {0} {1} {2} {3} {4}".format(
         "Skip lines: " + str(self.spin_skiplines.value()),
         "ADC trigger: " + str(self.spin_adctrigger.value()),
         "ADC count: " + str(self.spin_adccount.value()),
         "Timing: " + str(timing),
         "Event count: " + str(self.spin_eventcount.value()))
     log_elapsed = "Importing finished {0} seconds".format(int(elapsed))
     logging.getLogger('project').info(log)
     logging.getLogger('project').info(log_var)
     logging.getLogger('project').info(log_elapsed)
     self.imported = True
     self.parent.load_project_measurements(imported_files)
     self.close()