[Xfce4-commits] <xfce4-session:master> Remove Xfce4-tips.

Nick Schermer noreply at xfce.org
Fri Feb 18 18:20:02 CET 2011


Updating branch refs/heads/master
         to 64bc14b65c1253ca041d645dba03715e5a27a36f (commit)
       from b81d5e52ca6a797f85431dd3e610f6ef9d784aea (commit)

commit 64bc14b65c1253ca041d645dba03715e5a27a36f
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Feb 18 18:13:30 2011 +0100

    Remove Xfce4-tips.
    
    We could return it if there is a replacement that looks
    nice and is translatable, but the true is that probably
    nobody cares about the (outdated) tips...

 Makefile.am                                |    1 -
 configure.in.in                            |    8 -
 po/POTFILES.in                             |    2 -
 xfce4-tips/Makefile.am                     |   37 ---
 xfce4-tips/data/Makefile.am                |    5 -
 xfce4-tips/data/tips                       |  121 ---------
 xfce4-tips/data/tips.dat                   |  Bin 264 -> 0 bytes
 xfce4-tips/main.c                          |  368 ----------------------------
 xfce4-tips/xfce4-tips-autostart.desktop.in |    9 -
 9 files changed, 0 insertions(+), 551 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 59f1896..2401d3a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,6 @@ SUBDIRS =								\
 	settings							\
 	xfce4-session							\
 	xfce4-session-logout						\
-	xfce4-tips							\
 	xfsm-shutdown-helper						\
 	$(panel_plugin_dir)
 
diff --git a/configure.in.in b/configure.in.in
index 23ca657..aba2b1e 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -275,8 +275,6 @@ po/Makefile.in
 settings/Makefile
 xfce4-session/Makefile
 xfce4-session-logout/Makefile
-xfce4-tips/Makefile
-xfce4-tips/data/Makefile
 xfsm-shutdown-helper/Makefile
 ])
 
@@ -320,12 +318,6 @@ else
 echo " * Panel plugin:                   no"
 fi
 echo
-echo "Gnome compatibility:"
-if test x"$GNOME_FOUND" = x"yes"; then
-echo " * Assistive technologies support: yes"
-else
-echo " * Assistive technologies support: no"
-fi
 if test x"$GNOME_KEYRING_FOUND" = x"yes"; then
 echo " * Gnome Keyring support:          yes"
 else
diff --git a/po/POTFILES.in b/po/POTFILES.in
index f675268..8353c52 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -22,7 +22,6 @@ xfce4-session/xfsm-manager.c
 xfce4-session/xfsm-shutdown-helper.c
 xfce4-session/xfsm-splash-screen.c
 xfce4-session/xfsm-startup.c
-xfce4-tips/main.c
 xfce4-session-logout/main.c
 xfce4-session-logout/xfce4-session-logout.desktop.in
 
@@ -31,4 +30,3 @@ xfce4-session-logout/xfce4-session-logout.desktop.in
 panel-plugin/xfsm-logout-plugin.desktop.in
 settings/xfce-session-settings.desktop.in
 settings/xfce4-session-settings.glade
-xfce4-tips/xfce4-tips-autostart.desktop.in
diff --git a/xfce4-tips/Makefile.am b/xfce4-tips/Makefile.am
deleted file mode 100644
index bc22c19..0000000
--- a/xfce4-tips/Makefile.am
+++ /dev/null
@@ -1,37 +0,0 @@
-# $Id$
-
-INCLUDES =								\
-	-DG_LOG_DOMAIN=\"xfce4-tips\"					\
-	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"				\
-	-DTIPSDIR=\"$(datadir)/xfce4/tips\"				\
-	-I$(top_srcdir)
-
-SUBDIRS =								\
-	data
-
-bin_PROGRAMS =								\
-	xfce4-tips
-
-xfce4_tips_SOURCES =							\
-	main.c
-
-xfce4_tips_CFLAGS =							\
-	@LIBXFCE4UI_CFLAGS@                                             \
-	@XFCONF_CFLAGS@
-
-xfce4_tips_LDADD =							\
-	@LIBXFCE4UI_LIBS@                                               \
-	@XFCONF_LIBS@
-
-desktopdir = $(sysconfdir)/xdg/autostart
-desktop_in_files = xfce4-tips-autostart.desktop.in
-desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
- at INTLTOOL_DESKTOP_RULE@
-
-EXTRA_DIST =								\
-	$(desktop_in_files)
-
-DISTCLEANFILES =							\
-	$(desktop_DATA)
-
-# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/xfce4-tips/data/Makefile.am b/xfce4-tips/data/Makefile.am
deleted file mode 100644
index e43b1e7..0000000
--- a/xfce4-tips/data/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-tipsdir = $(datadir)/xfce4/tips
-
-tips_DATA =	tips
-
-EXTRA_DIST = $(tips_DATA)
diff --git a/xfce4-tips/data/tips b/xfce4-tips/data/tips
deleted file mode 100644
index b189a02..0000000
--- a/xfce4-tips/data/tips
+++ /dev/null
@@ -1,121 +0,0 @@
-There is a volume changer plugin for the panel available. Its name is 
-xfce4-mixer.
-%
-Numerous plugins are available for the Xfce panel from the Xfce Goodies 
-Project page : http://goodies.xfce.org
-%
-You can move windows between workspaces by simply dragging them in the 
-pager applet.
-%
-You don't want new or maximized windows to cover a particular area 
-of the screen? Just use the "Workspaces" component in the 
-Xfce Settings Manager to customize the desktop margins.
-%
-You can use some keyboard shortcuts to start applications. To do this, 
-you can use the Command Shortcuts section of the keyboard shortcuts 
-editor available in the window manager settings dialog.
-%
-There is a hidden option that allows the panel, and apps such as 
-Gkrellm, to be included when you switch the focus from a window to 
-others using the Alt+Tab shortcut. Just edit your 
-$HOME/.config/xfce4/xfwm4/xfwm4rc (or create an new one) and add this 
-line:
-
-cycle_minimum=false
-%
-You can disable the the ability to move and resize windows using the 
-Alt button + mouse click shortcut. Just edit your 
-$HOME/.config/xfce4/xfwm4/xfwm4rc (or create an new one) and add this 
-line:
-
-easy_click=false
-%
-You can change the mouse menu that appears when you click the desktop 
-background by using the graphical menu  editor available from the Menu 
-tab of the Desktop settings dialog.
-%
-The background settings dialog allows you to create a list of background
- images that will be randomly used when xfdesktop starts.
-%
-There is a notification area available for the panel. 
-You can find it in the items dialog of the panel.
-%
-You can start xfrun4 (the application launcher dialog) with the Alt+F2 
-keyboard shortcut.
-%
-To learn more about Xfce 4, you can visit the Xfce official website : 
-www.xfce.org
-%
-Just run xfhelp4 to open Xfce 4's manual in your Web browser.
-%
-The xflock4 script is used by the panel to lock the screen using 
-xscreensaver if available and falling back to xlock.
-
-Just click on the "Lock the screen" system button of the panel, or use 
-the Control+Alt+Delete keyboard shortcut to execute xflock4.
-%
-The xfterm4 script is a convenient terminal script that uses the 
-$TERMCMD environmental variable as terminal command if available and 
-falls back to using xterm.
-
-Especially useful in the panel where you can drag file or directories 
-to it that will be viewed by the appropriate console application (less 
-for text files, lynx for html).
-%
-The "xfmountdev4 /dev/mountpoint" command will mount the given 
-mountpoint and open Thunar in that location. When you close the Thunar 
-window the filesystem will be unmounted.
-%
-You can use the Alt+F10 keyboard shortcut to stick or unstick a window.
-%
-In the window manager settings dialog, you can select what must be the 
-behaviour of the window manager when you double-click on the title bar 
-of a window.
-%
-You can use keyboard shortcuts to move a window to another workspace :
-
-Alt + Control + End will move a window to the next workspace
-Alt + Control + Home will move a window to the previous workspace
-Alt + Control + Keypad-Number will move the current window to 
-corresponding workspace
-%
-The Thunar file manager can be driven with the keyboard.
-Have a look at Xfce 4 manual to learn more about its commands.
-%
-Select the "Always on top" option in the Xfce Panel settings dialog if 
-your want the panel to always stay above all other windows, and keep its
-area uncovered by maximized applications. Selecting this option will 
-make the panel use real transparency, if you are running X.org server 
-with the xfwm4 compositor enabled.
-%
-Xfce 4 panel offers an autohide feature.
-Use it to free some space on your desktop !
-%
-If you want to delete multiple files in the File manager in one step, 
-you have to press CTRL while doing right click on the last file. This 
-will select the last file and bring up the popup without unselecting 
-anything previous. You can also use the Delete key, main menu entry or 
-toolbar button to delete all without unselecting.
-%
-You can switch the workspaces by using the mouse
-    - and clicking on the pager
-    - using the mouse wheel on the pager or on the desktop background
-    - moving the mouse over the workspace edge (if this is activated)
-or the keyboard with
-    - Alt + Control + Left or Right to step one workspace left or right
-    - Control + F<Number> to jump to the workspace
-%
-There are some shortcuts to alter your window size or position:
-    - Alt + Control + Shift + Cursor moves the window around
-    - Alt + Shift + Cursor alters the size of the window
-%
-xfce4-appfinder is an application finder, which allows you to search, 
-launch and find information about applications installed on your system.
-%
-There is an "Always on top" option available in the window titlebar 
-menu. Select this option if you want a window to always appear above all
- other windows.
-%
-If you click on an entry of the taskbar with the right button of your 
-mouse, an action menu similar to the window titlebar menu will appear.
-%
diff --git a/xfce4-tips/data/tips.dat b/xfce4-tips/data/tips.dat
deleted file mode 100644
index b0e47f2..0000000
Binary files a/xfce4-tips/data/tips.dat and /dev/null differ
diff --git a/xfce4-tips/main.c b/xfce4-tips/main.c
deleted file mode 100644
index bfd9e1b..0000000
--- a/xfce4-tips/main.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2003-2006 Benedikt Meurer <benny at xfce.org>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#include <stdio.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <libxfce4ui/libxfce4ui.h>
-#include <xfconf/xfconf.h>
-
-
-
-#define OPTION_TIPS 0
-#define OPTION_FORTUNES 1
-
-
-
-static const gchar *titles[] = {
-  N_("Tips and Tricks"),
-  N_("Fortunes")
-};
-
-
-
-static GtkWidget *dlg = NULL;
-static guint      option = OPTION_TIPS;
-static gchar     *fortune_cmd = NULL;
-static GPtrArray *tips = NULL;
-
-
-static void
-read_tips_from_file (void)
-{
-  gchar *data;
-  gchar *entry;
-  gsize len;
-  guint i, j;
-  GError *error = NULL;
-
-  /* read the whole file */
-  g_file_get_contents (TIPSDIR "/tips", &data, &len, &error);
-
-  tips = g_ptr_array_new ();
-  if (error != NULL)
-    {
-      g_ptr_array_add (tips, g_strdup_printf (_("Could not load tips database (%s)."),
-        error->message));
-      g_free (data);
-      g_error_free (error);
-      return;
-    }
-
-  entry = g_malloc (len + 1);
-  i = j = 0;
-  while (data[i])
-    {
-      if (data[i] == '%')
-        {
-          /* add a new tip */
-          entry[j] = '\0';
-          j = 0;
-          if (entry[0])
-            g_ptr_array_add (tips, g_strdup(entry));
-          /* skip the following line break character(s) */
-          if (data[i] == '\r' && (i + 1) < len && data[i + 1] == '\n')
-          i += 2;
-          else
-          i += 1;
-        }
-      else
-        entry[j++] = data[i];
-
-      i++;
-    }
-  g_free (data);
-  g_free (entry);
-}
-
-
-static void
-free_tip (gpointer data, gpointer user_data)
-{
-  g_free (data);
-}
-
-
-static gboolean
-autostart_enabled (void)
-{
-  gboolean enabled = FALSE;
-  XfceRc  *rc;
-
-  rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, "autostart/xfce4-tips-autostart.desktop", TRUE);
-  if (G_LIKELY (rc != NULL))
-    {
-      xfce_rc_set_group (rc, "Desktop Entry");
-      enabled = !xfce_rc_read_bool_entry (rc, "Hidden", TRUE);
-      xfce_rc_close (rc);
-    }
-
-  return enabled;
-}
-
-
-
-static void
-autostart_toggled (GtkToggleButton *button)
-{
-  gboolean active = gtk_toggle_button_get_active (button);
-  XfceRc  *rc;
-
-  rc = xfce_rc_config_open (XFCE_RESOURCE_CONFIG, "autostart/xfce4-tips-autostart.desktop", FALSE);
-  if (G_LIKELY (rc != NULL))
-    {
-      xfce_rc_set_group (rc, "Desktop Entry");
-      xfce_rc_write_bool_entry (rc, "Hidden", !active);
-      xfce_rc_close (rc);
-    }
-}
-
-
-
-static void
-item_cb (GtkComboBox *combobox, XfconfChannel *channel)
-{
-  gint active_item = gtk_combo_box_get_active (combobox);
-
-  if (active_item >=0)
-    {
-      option = active_item;
-      xfconf_channel_set_bool (channel, "/fortunes", option == 1);
-    }
-
-  gtk_window_set_title (GTK_WINDOW (dlg), _(titles[option]));
-}
-
-
-
-static gchar*
-run_fortune (void)
-{
-  GError *error = NULL;
-  gchar *out = NULL;
-  gchar *err = NULL;
-  gchar *buffer = NULL;
-
-  if (fortune_cmd != NULL && g_spawn_command_line_sync (fortune_cmd, &out, &err, NULL, &error))
-    {
-      if (out != NULL && *out != '\0')
-        {
-          /* check output for valid UTF-8 */
-          if (g_utf8_validate (out, -1, NULL))
-            buffer = out;
-          else
-            {
-              /* we got something else than UTF-8, try to convert it from the user's locale */
-              buffer = g_locale_to_utf8 (out, -1, NULL, NULL, NULL);
-              if (buffer == NULL)
-              {
-                /* converting it from the user's locale failed too, we give up */
-                buffer = g_strdup_printf (_("Invalid output of fortune."));
-              }
-            }
-          }
-      else
-        buffer = g_strdup_printf (_("Executing fortune failed (%s)"), err);
-
-      if (buffer != out)
-        g_free (out);
-      g_free(err);
-    }
-  else
-    {
-      buffer = g_strdup_printf (_("Executing fortune failed (%s)"), error->message);
-      g_error_free (error);
-    }
-
-  return buffer;
-}
-
-
-
-static void
-next_cb(GtkWidget *widget, GtkTextBuffer *textbuf)
-{
-  gchar *buffer = NULL;
-  GtkTextIter start;
-  GtkTextIter end;
-
-  /* clear the text buffer */
-  gtk_text_buffer_get_bounds (textbuf, &start, &end);
-  gtk_text_buffer_delete (textbuf, &start, &end);
-
-  switch (option)
-    {
-      case OPTION_TIPS:
-        {
-          if (! tips || tips->len == 0)
-            buffer = _("Error while loading tips.");
-          else
-            /* no need to check or convert the encoding of our own tips file as it is already UTF-8 */
-            buffer = g_ptr_array_index (tips, g_random_int_range(0, tips->len));
-          break;
-        }
-      case OPTION_FORTUNES:
-        {
-          buffer = run_fortune ();
-          break;
-        }
-    }
-
-  /* add the text to the buffer */
-  gtk_text_buffer_get_end_iter (textbuf, &end);
-  gtk_text_buffer_insert (textbuf, &end, buffer, -1);
-
-  if (option == OPTION_FORTUNES)
-    g_free (buffer);
-}
-
-
-
-int
-main (int argc, char **argv)
-{
-  GError    *error = NULL;
-  GtkWidget *sw;
-  GtkWidget *view;
-  GtkWidget *vbox2;
-  GtkWidget *check;
-  GtkWidget *combobox;
-  GtkWidget *next;
-  GtkWidget *close_btn;
-  GtkWidget *action_area;
-  XfconfChannel *channel;
-
-  xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
-
-  gtk_init (&argc, &argv);
-
-  if (G_UNLIKELY (!xfconf_init (&error))) {
-    xfce_dialog_show_error (NULL, error, _("Unable to contact settings server"));
-    g_error_free (error);
-  }
-
-  channel = xfconf_channel_get ("xfce4-tips");
-
-  /* test for fortune */
-  fortune_cmd = g_find_program_in_path ("fortune");
-
-  read_tips_from_file ();
-
-  /* fake a SM client id, so the session manager does not restart us */
-  gdk_set_sm_client_id ("FAKED CLIENTID");
-
-  dlg = xfce_titled_dialog_new_with_buttons (_("Tips and Tricks"), NULL,
-                                             GTK_DIALOG_NO_SEPARATOR,
-                                             NULL);
-  gtk_window_set_icon_name (GTK_WINDOW (dlg), "xfce4-logo");
-  gtk_window_set_default_size (GTK_WINDOW (dlg), 600, 400);
-  gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER);
-  gtk_window_stick (GTK_WINDOW (dlg));
-
-  action_area = gtk_dialog_get_action_area (GTK_DIALOG (dlg));
-  gtk_button_box_set_layout (GTK_BUTTON_BOX (action_area), GTK_BUTTONBOX_EDGE);
-
-  vbox2 = gtk_vbox_new (FALSE, 6);
-  gtk_container_set_border_width (GTK_CONTAINER (vbox2), 6);
-  gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), vbox2, TRUE, TRUE, 0);
-  gtk_widget_show (vbox2);
-
-  sw = gtk_scrolled_window_new (NULL, NULL);
-  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
-                                  GTK_POLICY_NEVER,
-                                  GTK_POLICY_AUTOMATIC);
-  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
-  gtk_widget_show (sw);
-  gtk_box_pack_start (GTK_BOX (vbox2), sw, TRUE, TRUE, 0);
-
-  view = gtk_text_view_new ();
-  gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
-  gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
-  gtk_widget_show (view);
-  gtk_container_add (GTK_CONTAINER (sw), view);
-
-  check = gtk_check_button_new_with_mnemonic (_("Display tips on _startup"));
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), autostart_enabled ());
-  g_signal_connect (G_OBJECT (check), "toggled", G_CALLBACK (autostart_toggled), NULL);
-  gtk_box_pack_start (GTK_BOX (vbox2), check, FALSE, FALSE, 0);
-  gtk_widget_show (check);
-
-  if (fortune_cmd != NULL)
-    {
-      gboolean fortunes = xfconf_channel_get_bool (channel, "/fortunes", FALSE);
-
-      combobox = gtk_combo_box_new_text ();
-      gtk_widget_show (combobox);
-
-      gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), titles[OPTION_TIPS]);
-      gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), titles[OPTION_FORTUNES]);
-
-      g_signal_connect (combobox, "changed", G_CALLBACK (item_cb), channel);
-      g_signal_connect (combobox, "changed", G_CALLBACK (next_cb), gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)));
-
-      gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), fortunes ? 1 : 0);
-
-      gtk_box_pack_start (GTK_BOX (action_area), combobox, FALSE, FALSE, 0);
-    }
-
-  next = gtk_button_new_with_label (_("Next"));
-  gtk_dialog_add_action_widget (GTK_DIALOG (dlg), next, GTK_RESPONSE_NONE);
-  gtk_widget_show (next);
-
-  close_btn = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
-  gtk_dialog_add_action_widget (GTK_DIALOG (dlg), close_btn, GTK_RESPONSE_DELETE_EVENT);
-  gtk_widget_show (close_btn);
-
-  g_signal_connect (dlg, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
-  g_signal_connect (dlg, "destroy-event", G_CALLBACK (gtk_main_quit), NULL);
-  g_signal_connect (close_btn, "clicked", G_CALLBACK (gtk_main_quit), NULL);
-  g_signal_connect (next, "clicked", G_CALLBACK (next_cb), gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)));
-
-  next_cb (next, gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)));
-
-  gtk_widget_show (dlg);
-
-  gtk_main ();
-
-  /* cleanup */
-  g_free (fortune_cmd);
-  if (tips != NULL)
-    {
-      g_ptr_array_foreach (tips, free_tip, NULL);
-      g_ptr_array_free (tips, TRUE);
-    }
-
-  xfconf_shutdown ();
-
-  return EXIT_SUCCESS;
-}
diff --git a/xfce4-tips/xfce4-tips-autostart.desktop.in b/xfce4-tips/xfce4-tips-autostart.desktop.in
deleted file mode 100644
index 6328bd6..0000000
--- a/xfce4-tips/xfce4-tips-autostart.desktop.in
+++ /dev/null
@@ -1,9 +0,0 @@
-[Desktop Entry]
-_Name=xfce4-tips
-_Comment=Tips and tricks
-Exec=xfce4-tips
-Icon=xfce4-logo
-Terminal=false
-Type=Application
-OnlyShowIn=XFCE;
-Hidden=false



More information about the Xfce4-commits mailing list