@@ -30,6 +30,8 @@ module gtk_app |
| 30 | 30 | clear_previous_breadcrumb_path |
| 31 | 31 | use treemap_renderer, only: register_progress_callback, scan_directory, set_redraw_widget, & |
| 32 | 32 | register_scan_completion_callback |
| 33 | + use tab_manager, only: tab_state, init_tab_manager, create_tab, get_active_tab, & |
| 34 | + switch_to_tab, num_tabs, active_tab_index |
| 33 | 35 | implicit none |
| 34 | 36 | private |
| 35 | 37 | |
@@ -175,6 +177,11 @@ contains |
| 175 | 177 | type(c_ptr) :: drawing_area, main_box, toolbar, open_dir_btn, scan_btn, cancel_scan_btn, back_btn, forward_btn, up_btn, open_finder_btn, copy_path_btn, info_btn, toggle_dotfiles_btn, toggle_ext_btn, toggle_render_btn, delete_btn, status_bar, breadcrumb_widget |
| 176 | 178 | character(len=512) :: scan_path |
| 177 | 179 | integer(c_int) :: idle_id |
| 180 | + integer :: first_tab_index |
| 181 | + |
| 182 | + ! Initialize tab manager |
| 183 | + call init_tab_manager() |
| 184 | + print *, "Tab manager initialized" |
| 178 | 185 | |
| 179 | 186 | ! Create main window |
| 180 | 187 | main_window_ptr = gtk_application_window_new(app) |
@@ -205,6 +212,14 @@ contains |
| 205 | 212 | print *, "Click the folder icon to select a different directory" |
| 206 | 213 | end if |
| 207 | 214 | |
| 215 | + ! Create first tab with initial scan path |
| 216 | + first_tab_index = create_tab(scan_path) |
| 217 | + if (first_tab_index < 0) then |
| 218 | + print *, "ERROR: Failed to create initial tab" |
| 219 | + return |
| 220 | + end if |
| 221 | + print *, "Created initial tab ", first_tab_index, " for: ", trim(scan_path) |
| 222 | + |
| 208 | 223 | ! Create main vertical box (toolbar + treemap) |
| 209 | 224 | main_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0_c_int) |
| 210 | 225 | |