pub unsafe fn generate_ids(&self, app_ui: &Rc<AppUI>, pack_file_contents_ui: &Rc<PackFileContentsUI>) {

        // Get the current selection. As we need his visual order, we get it directly from the table/filter, NOT FROM THE MODEL.
        let indexes = self.table_view_primary.selection_model().selection().indexes();
        let mut indexes_sorted = (0..indexes.count_0a()).map(|x| indexes.at(x)).collect::<Vec<Ref<QModelIndex>>>();
        sort_indexes_visually(&mut indexes_sorted, &self.get_mut_ptr_table_view_primary());

        // Get the initial value of the dialog.
        let initial_value = if let Some(first) = indexes_sorted.first() {
            if first.is_valid() {
                if let Ok(data) = self.table_filter.map_to_source(*first).data_0a().to_string().to_std_string().parse::<i32>() {
                    data
                } else { 0 }
            } else { 0 }
        } else { 0 };

        if let Some(value) = self.create_generate_ids_dialog(initial_value) {
            let mut real_cells = vec![];
            let mut values = vec![];

            for (id, index) in indexes_sorted.iter().enumerate() {
                if index.is_valid() {
                    real_cells.push(self.table_filter.map_to_source(*index));
                    values.push((value + id as i32).to_string());
                }
            }

            let mut realer_cells = vec![];
            for index in (0..real_cells.len()).rev() {
                realer_cells.push((real_cells.pop().unwrap(), &*values[index]));
            }
            realer_cells.reverse();

            self.set_data_on_cells(&realer_cells, 0, &[], app_ui, pack_file_contents_ui);
        }
    }
/// This function fills the currently provided cells with a set of ids.
This function fills the currently provided cells with a set of ids.
This function fills the currently provided cells with a set of ids .
pub unsafe fn generate_ids(&self, app_ui: &Rc<AppUI>, pack_file_contents_ui: &Rc<PackFileContentsUI>) {
        // Get the current selection. As we need his visual order, we get it directly from the table/filter, NOT FROM THE MODEL.
        let indexes = self.table_view_primary.selection_model().selection().indexes();
        let mut indexes_sorted = (0..indexes.count_0a()).map(|x| indexes.at(x)).collect::<Vec<Ref<QModelIndex>>>();
        sort_indexes_visually(&mut indexes_sorted, &self.get_mut_ptr_table_view_primary());
        // Get the initial value of the dialog.
        let initial_value = if let Some(first) = indexes_sorted.first() {
            if first.is_valid() {
                if let Ok(data) = self.table_filter.map_to_source(*first).data_0a().to_string().to_std_string().parse::<i32>() {
                    data
                } else { 0 }
            } else { 0 }
        } else { 0 };
        if let Some(value) = self.create_generate_ids_dialog(initial_value) {
            let mut real_cells = vec![];
            let mut values = vec![];
            for (id, index) in indexes_sorted.iter().enumerate() {
                if index.is_valid() {
                    real_cells.push(self.table_filter.map_to_source(*index));
                    values.push((value + id as i32).to_string());
                }
            }
            let mut realer_cells = vec![];
            for index in (0..real_cells.len()).rev() {
                realer_cells.push((real_cells.pop().unwrap(), &*values[index]));
            }
            realer_cells.reverse();
            self.set_data_on_cells(&realer_cells, 0, &[], app_ui, pack_file_contents_ui);
        }
    }
pub unsafe fn generate_ids ( & self , app_ui : & Rc < AppUI > , pack_file_contents_ui : & Rc < PackFileContentsUI > ) { // Get the current selection. As we need his visual order, we get it directly from the table/filter, NOT FROM THE MODEL. let indexes = self . table_view_primary . selection_model ( ) . selection ( ) . indexes ( ) ; let mut indexes_sorted = ( 0 .. indexes . count_0a ( ) ) . map ( | x | indexes . at ( x ) ) . collect :: < Vec < Ref < QModelIndex > > > ( ) ; sort_indexes_visually ( & mut indexes_sorted , & self . get_mut_ptr_table_view_primary ( ) ) ; // Get the initial value of the dialog. let initial_value = if let Some ( first ) = indexes_sorted . first ( ) { if first . is_valid ( ) { if let Ok ( data ) = self . table_filter . map_to_source ( * first ) . data_0a ( ) . to_string ( ) . to_std_string ( ) . parse :: < i32 > ( ) { data } else { 0 } } else { 0 } } else { 0 } ; if let Some ( value ) = self . create_generate_ids_dialog ( initial_value ) { let mut real_cells = vec ! [ ] ; let mut values = vec ! [ ] ; for ( id , index ) in indexes_sorted . iter ( ) . enumerate ( ) { if index . is_valid ( ) { real_cells . push ( self . table_filter . map_to_source ( * index ) ) ; values . push ( ( value + id as i32 ) . to_string ( ) ) ; } } let mut realer_cells = vec ! [ ] ; for index in ( 0 .. real_cells . len ( ) ) . rev ( ) { realer_cells . push ( ( real_cells . pop ( ) . unwrap ( ) , & * values [ index ] ) ) ; } realer_cells . reverse ( ) ; self . set_data_on_cells ( & realer_cells , 0 , & [ ] , app_ui , pack_file_contents_ui ) ; } }
This function fills the currently provided cells with a set of ids.
This function fills the currently provided cells with a set of ids .
&self
app_ui
&Rc<AppUI>
pack_file_contents_ui
&Rc<PackFileContentsUI>
&self
app_ui
&Rc<AppUI>
pack_file_contents_ui
&Rc<PackFileContentsUI>