diff --git a/po/messages.pot b/po/messages.pot index f7a5660..b6be0e1 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 1.2.1+gfc5ff73.main\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2021-11-24 21:33-0300\n" +"POT-Creation-Date: 2021-11-30 10:34-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/tabstack.c b/tabstack.c index 5737d68..48d514e 100644 --- a/tabstack.c +++ b/tabstack.c @@ -3,30 +3,9 @@ struct tabstack *prev = NULL; struct tabstack *top = NULL; -/*int main() -{ - int n, ch; - do - { - printf("\n\nStack Menu\n1. Push \n2. Pop\n3. Display\n0. Exit"); - printf("\nEnter Choice 0-3? : "); - scanf("%d", &ch); - switch (ch) - { - case 1: - printf("\nEnter number "); - scanf("%d", &n); - push(n); - break; - case 2: - pop(); - break; - case 3: - display(); - break; - } - }while (ch != 0); -}*/ +/* + * This is the structure that controls the list of last visited tabs + */ /* * Stacks the given tab widget visited by the user @@ -36,11 +15,10 @@ void tabstack_push(GtkWidget *item) struct tabstack *nptr = malloc(sizeof(struct tabstack)); nptr->data = item; - printf("Pushed gtkWidget: 0x%" PRIXPTR "\n", (uintptr_t)nptr->data); + //printf("Pushed gtkWidget: 0x%" PRIXPTR "\n", (uintptr_t)nptr->data); nptr->prev = top; prev = top; nptr->next = top; - //nptr->isRemoved = FALSE; top = nptr; } @@ -65,16 +43,8 @@ gint tabstack_pop(GtkNotebook *notebook) } else { - /*if (temp->data != NULL) //isRemoved) - { - tabtogo = gtk_notebook_page_num(notebook, temp->data); - top = top->next; - return tabtogo; - }*/ - while (temp != NULL) { - //printf("Stack item is NULL!!!\n"); if (temp->data == NULL) { prev = top; @@ -84,40 +54,14 @@ gint tabstack_pop(GtkNotebook *notebook) else break; } - //printf("Almost done in POP!\n"); - printf("Planing to focus gtkWidget: 0x%" PRIXPTR "\n", (uintptr_t)temp->data); + //printf("Planing to focus gtkWidget: 0x%" PRIXPTR "\n", (uintptr_t)temp->data); tabtogo = gtk_notebook_page_num(notebook, temp->data); - printf("TAB TO GO: %d\n", tabtogo); - //top = top->next; + //printf("TAB TO GO: %d\n", tabtogo); } return tabtogo; } -/* - * Marks given itemToRemove item with a "isRemoved" = TRUE on the stack - */ -void tabstack_remove(GtkWidget *itemToRemove) -{ - struct tabstack *temp, *bkpTop; - bkpTop = top; - temp = top; - - while (temp != NULL) - { - if (temp->data == itemToRemove) - { - //printf("Tentando remover GtkWidget: 0x%" PRIXPTR "\n", (uintptr_t)itemToRemove); - //printf("Data eh: 0x%" PRIXPTR "\n", (uintptr_t)temp->data); - //temp->isRemoved = TRUE; - } - - temp = temp->next; - } - - top = bkpTop; -} - void notebookPage_removed(GtkNotebook* self, GtkWidget* child, guint page_num, gpointer user_data) { @@ -125,8 +69,6 @@ notebookPage_removed(GtkNotebook* self, GtkWidget* child, guint page_num, gpoint (void)page_num; (void)user_data; - //tabstack_remove(child); - if (g_bkp_current_page == -1) //User was in the tab that was closed!!! { gint tabToGo = tabstack_pop(self); diff --git a/tabstack.h b/tabstack.h index 4e39596..b97343f 100644 --- a/tabstack.h +++ b/tabstack.h @@ -12,13 +12,10 @@ struct tabstack GtkWidget *data; struct tabstack *prev; struct tabstack *next; - //gboolean isRemoved; }; -//void display(); void tabstack_push(GtkWidget *); gint tabstack_pop(); -void tabstack_remove(GtkWidget *); void notebookPage_removed(GtkNotebook* self, GtkWidget* child, guint page_num, gpointer user_data);