[Goodies-commits] r5887 - in xfce4-notes-plugin/trunk: . panel-plugin

Mike Massonnet mmassonnet at xfce.org
Sat Nov 1 10:50:30 CET 2008


Author: mmassonnet
Date: 2008-11-01 09:50:30 +0000 (Sat, 01 Nov 2008)
New Revision: 5887

Modified:
   xfce4-notes-plugin/trunk/ChangeLog
   xfce4-notes-plugin/trunk/panel-plugin/notes.c
   xfce4-notes-plugin/trunk/panel-plugin/notes.h
Log:
Hide tabs option

Modified: xfce4-notes-plugin/trunk/ChangeLog
===================================================================
--- xfce4-notes-plugin/trunk/ChangeLog	2008-10-31 15:18:17 UTC (rev 5886)
+++ xfce4-notes-plugin/trunk/ChangeLog	2008-11-01 09:50:30 UTC (rev 5887)
@@ -1,3 +1,9 @@
+2008-11-01  Mike Massonnet <mmassonnet at xfce.org>
+
+Hide tabs option
+	* panel-plugin/notes.[ch]:
+	  - New window option "Hide tabs".
+
 2008-10-19  Mike Massonnet <mmassonnet at xfce.org>
 
 Scroll to last cursor position on undo/redo

Modified: xfce4-notes-plugin/trunk/panel-plugin/notes.c
===================================================================
--- xfce4-notes-plugin/trunk/panel-plugin/notes.c	2008-10-31 15:18:17 UTC (rev 5886)
+++ xfce4-notes-plugin/trunk/panel-plugin/notes.c	2008-11-01 09:50:30 UTC (rev 5887)
@@ -63,6 +63,8 @@
 
 static void             notes_window_set_sos_last_state (NotesWindow *notes_window);
 
+static void             notes_window_set_tabs           (NotesWindow *notes_window);
+
 static void             notes_window_set_statusbar      (NotesWindow *notes_window);
 
 static void             notes_window_set_above          (NotesWindow *notes_window);
@@ -500,6 +502,7 @@
   gboolean              above = FALSE;
   ShowOnStartup         show_on_startup = LAST_STATE;
   gboolean              show_statusbar = FALSE;
+  gboolean              show_tabs = TRUE;
   gboolean              sticky = TRUE;
   gboolean              visible = TRUE;
   gint                  transparency = 10;
@@ -540,6 +543,7 @@
   above =           xfconf_channel_get_bool (notes_plugin->xfconf_channel, "/new_window/always_on_top", above);
   show_on_startup = xfconf_channel_get_bool (notes_plugin->xfconf_channel, "/new_window/show_on_startup", show_on_startup);
   show_statusbar =  xfconf_channel_get_bool (notes_plugin->xfconf_channel, "/new_window/show_resize_grip", show_statusbar);
+  show_tabs =       xfconf_channel_get_bool (notes_plugin->xfconf_channel, "/new_window/show_tabs", show_tabs);
   sticky =          xfconf_channel_get_bool (notes_plugin->xfconf_channel, "/new_window/sticky", sticky);
   visible =         xfconf_channel_get_bool (notes_plugin->xfconf_channel, "/new_window/visible", visible);
   transparency =    xfconf_channel_get_int  (notes_plugin->xfconf_channel, "/new_window/transparency", transparency);
@@ -558,6 +562,7 @@
   notes_window->above           = xfce_rc_read_bool_entry (rc, "Above", above);
   notes_window->show_on_startup = xfce_rc_read_int_entry (rc, "ShowOnStartup", show_on_startup);
   notes_window->show_statusbar  = xfce_rc_read_bool_entry (rc, "ShowStatusbar", show_statusbar);
+  notes_window->show_tabs       = xfce_rc_read_bool_entry (rc, "ShowTabs", show_tabs);
   notes_window->sticky          = xfce_rc_read_bool_entry (rc, "Sticky", sticky);
   notes_window->visible         = xfce_rc_read_bool_entry (rc, "Visible", visible);
   notes_window->transparency    = xfce_rc_read_int_entry (rc, "Transparency", transparency);
@@ -571,6 +576,7 @@
        "\nabove: %d"
        "\nshow_on_startup: %d"
        "\nshow_statusbar: %d"
+       "\nshow_tabs: %d"
        "\nsticky: %d"
        "\nvisible: %d"
        "\ntransparency: %d",
@@ -579,6 +585,7 @@
        notes_window->above,
        notes_window->show_on_startup,
        notes_window->show_statusbar,
+       notes_window->show_tabs,
        notes_window->sticky,
        notes_window->visible,
        notes_window->transparency);
@@ -598,6 +605,8 @@
 
   notes_window_set_transparency (notes_window, notes_window->transparency);
   gtk_notebook_set_current_page (GTK_NOTEBOOK (notes_window->notebook), 0);
+  gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notes_window->notebook), notes_window->show_tabs);
+  gtk_notebook_set_show_border (GTK_NOTEBOOK (notes_window->notebook), FALSE);
 }
 
 void
@@ -627,12 +636,14 @@
   TRACE ("\nabove: %d"
          "\nshow_on_startup: %d"
          "\nshow_statusbar: %d"
+         "\nshow_tabs: %d"
          "\nsticky: %d"
          "\nvisible: %d"
          "\ntransparency: %d",
          notes_window->above,
          notes_window->show_on_startup,
          notes_window->show_statusbar,
+         notes_window->show_tabs,
          notes_window->sticky,
          notes_window->visible,
          notes_window->transparency);
@@ -642,18 +653,13 @@
   xfce_rc_write_int_entry (rc, "Width", notes_window->w);
   xfce_rc_write_int_entry (rc, "Height", notes_window->h);
 
-  xfce_rc_write_bool_entry (rc, "Above",
-                            notes_window->above);
-  xfce_rc_write_int_entry  (rc, "ShowOnStartup",
-                            notes_window->show_on_startup);
-  xfce_rc_write_bool_entry (rc, "ShowStatusbar",
-                            notes_window->show_statusbar);
-  xfce_rc_write_bool_entry (rc, "Sticky",
-                            notes_window->sticky);
-  xfce_rc_write_bool_entry (rc, "Visible",
-                            GTK_WIDGET_VISIBLE (notes_window->window));
-  xfce_rc_write_int_entry  (rc, "Opacity",
-                            notes_window->transparency);
+  xfce_rc_write_bool_entry (rc, "Above", notes_window->above);
+  xfce_rc_write_int_entry  (rc, "ShowOnStartup", notes_window->show_on_startup);
+  xfce_rc_write_bool_entry (rc, "ShowStatusbar", notes_window->show_statusbar);
+  xfce_rc_write_bool_entry (rc, "ShowTabs", notes_window->show_tabs);
+  xfce_rc_write_bool_entry (rc, "Sticky", notes_window->sticky);
+  xfce_rc_write_bool_entry (rc, "Visible", GTK_WIDGET_VISIBLE (notes_window->window));
+  xfce_rc_write_int_entry  (rc, "Opacity", notes_window->transparency);
   if (NULL != notes_window->font)
     xfce_rc_write_entry (rc, "Font", notes_window->font);
 
@@ -870,11 +876,13 @@
   GtkWidget *mi_show_statusbar  = gtk_check_menu_item_new_with_label (_("Resize grip"));
   GtkWidget *mi_above           = gtk_check_menu_item_new_with_label (_("Always on top"));
   GtkWidget *mi_sticky          = gtk_check_menu_item_new_with_label (_("Sticky window"));
+  GtkWidget *mi_hide_tabs       = gtk_check_menu_item_new_with_label (_("Hide tabs"));
   GtkWidget *mi_show_on_startup = gtk_menu_item_new_with_label (_("Show on startup"));
 
   gtk_menu_shell_append (GTK_MENU_SHELL (notes_window->menu_options), mi_show_statusbar);
   gtk_menu_shell_append (GTK_MENU_SHELL (notes_window->menu_options), mi_above);
   gtk_menu_shell_append (GTK_MENU_SHELL (notes_window->menu_options), mi_sticky);
+  gtk_menu_shell_append (GTK_MENU_SHELL (notes_window->menu_options), mi_hide_tabs);
   gtk_menu_shell_append (GTK_MENU_SHELL (notes_window->menu_options), mi_show_on_startup);
   gtk_menu_item_set_submenu (GTK_MENU_ITEM (notes_window->mi_options), notes_window->menu_options);
 
@@ -900,6 +908,8 @@
                                   (notes_window->show_on_startup == NEVER));
   gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi_sos_last_state),
                                   (notes_window->show_on_startup == LAST_STATE));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi_hide_tabs),
+                                  !notes_window->show_tabs);
   gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi_show_statusbar),
                                   notes_window->show_statusbar);
   gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi_above),
@@ -907,6 +917,19 @@
   gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi_sticky),
                                   notes_window->sticky);
 
+#if 0
+  /* NOTE options menu is not a persistent menu */
+  /* Accel group */
+  gtk_menu_set_accel_group (GTK_MENU (notes_window->menu_options),
+                            notes_window->accel_group);
+  gtk_widget_add_accelerator (mi_hide_tabs,
+                              "activate",
+                              notes_window->accel_group,
+                              GDK_F12,
+                              0,
+                              GTK_ACCEL_MASK);
+#endif
+
   /* Signals */
   g_signal_connect_swapped (mi_sos_always,
                             "activate",
@@ -920,6 +943,10 @@
                             "activate",
                             G_CALLBACK (notes_window_set_sos_last_state),
                             notes_window);
+  g_signal_connect_swapped (mi_hide_tabs,
+                            "activate",
+                            G_CALLBACK (notes_window_set_tabs),
+                            notes_window);
   g_signal_connect_swapped (mi_show_statusbar,
                             "activate",
                             G_CALLBACK (notes_window_set_statusbar),
@@ -1019,6 +1046,13 @@
 }
 
 static void
+notes_window_set_tabs (NotesWindow *notes_window)
+{
+  notes_window->show_tabs = !notes_window->show_tabs;
+  gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notes_window->notebook), notes_window->show_tabs);
+}
+
+static void
 notes_window_set_statusbar (NotesWindow *notes_window)
 {
   if (!GTK_WIDGET_VISIBLE (notes_window->notebook))

Modified: xfce4-notes-plugin/trunk/panel-plugin/notes.h
===================================================================
--- xfce4-notes-plugin/trunk/panel-plugin/notes.h	2008-10-31 15:18:17 UTC (rev 5886)
+++ xfce4-notes-plugin/trunk/panel-plugin/notes.h	2008-11-01 09:50:30 UTC (rev 5887)
@@ -81,6 +81,7 @@
   gint                  x, y, w, h;
   ShowOnStartup         show_on_startup;
   gboolean              show_statusbar;
+  gboolean              show_tabs;
   gboolean              above;
   gboolean              sticky;
   gboolean              visible;




More information about the Goodies-commits mailing list