[gtranslator] Close all tabs on create_tab



commit 95127883539b728b55ecfecdcde0286d95fb93c1
Author: Daniel GarcĂ­a Moreno <dani danigm net>
Date:   Mon Mar 21 08:28:43 2022 +0100

    Close all tabs on create_tab

 src/gtr-window.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/src/gtr-window.c b/src/gtr-window.c
index 91ccecee..3ecbdc7a 100644
--- a/src/gtr-window.c
+++ b/src/gtr-window.c
@@ -528,6 +528,16 @@ gtr_window_create_tab (GtrWindow * window, GtrPo * po)
   GtrWindowPrivate *priv = gtr_window_get_instance_private(window);
   GtrTab *tab;
 
+  // Remove all tabs when creating a new one,
+  // this way we only have one tab. This is a workaround
+  // to remove the tab functionality without change all
+  // the code
+  GList *tabs, *l;
+  tabs = gtr_window_get_all_tabs (window);
+  for (l = tabs; l != NULL; l = g_list_next (l))
+    _gtr_window_close_tab (window, l->data);
+  g_list_free (tabs);
+
   tab = gtr_tab_new (po, GTK_WINDOW (window));
   gtk_widget_show (GTK_WIDGET (tab));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]