fortrangoingonforty/sniffly / bc1b344

Browse files

initialize tab manager and create first default tab

Authored by espadonne
SHA
bc1b34406e716cfa57b2aa2ce8474ebe3ae7cc8a
Parents
01fbe81
Tree
7d85a43

1 changed file

StatusFile+-
M src/gui/gtk_app.f90 15 0
src/gui/gtk_app.f90modified
@@ -30,6 +30,8 @@ module gtk_app
3030
                                 clear_previous_breadcrumb_path
3131
   use treemap_renderer, only: register_progress_callback, scan_directory, set_redraw_widget, &
3232
                                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
3335
   implicit none
3436
   private
3537
 
@@ -175,6 +177,11 @@ contains
175177
     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
176178
     character(len=512) :: scan_path
177179
     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"
178185
 
179186
     ! Create main window
180187
     main_window_ptr = gtk_application_window_new(app)
@@ -205,6 +212,14 @@ contains
205212
       print *, "Click the folder icon to select a different directory"
206213
     end if
207214
 
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
+
208223
     ! Create main vertical box (toolbar + treemap)
209224
     main_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0_c_int)
210225