gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r20314 - in gnunet-gtk: . contrib src src/gns


From: gnunet
Subject: [GNUnet-SVN] r20314 - in gnunet-gtk: . contrib src src/gns
Date: Tue, 6 Mar 2012 15:36:26 +0100

Author: grothoff
Date: 2012-03-06 15:36:26 +0100 (Tue, 06 Mar 2012)
New Revision: 20314

Added:
   gnunet-gtk/src/gns/
   gnunet-gtk/src/gns/Makefile.am
   gnunet-gtk/src/gns/gnunet-gns-gtk.c
   gnunet-gtk/src/gns/gnunet-gns-gtk_about.c
Modified:
   gnunet-gtk/configure.ac
   gnunet-gtk/contrib/Makefile.am
   gnunet-gtk/src/Makefile.am
Log:
-starting with gnunet-gns-gtk GUI

Modified: gnunet-gtk/configure.ac
===================================================================
--- gnunet-gtk/configure.ac     2012-03-06 14:20:33 UTC (rev 20313)
+++ gnunet-gtk/configure.ac     2012-03-06 14:36:26 UTC (rev 20314)
@@ -1,5 +1,5 @@
 # This file is part of GNUnet.
-# (C) 2001--2011 Christian Grothoff (and other contributing authors)
+# (C) 2001--2012 Christian Grothoff (and other contributing authors)
 #
 # GNUnet is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published
@@ -117,7 +117,7 @@
 
 AC_CHECK_HEADERS([errno.h stdio.h unistd.h locale.h sys/stat.h sys/types.h 
langinfo.h libintl.h unistd.h stddef.h argz.h sys/socket.h netinet/in.h 
stdarg.h])
 
-GNUNET_FS_APP="fs"
+GNUNET_FS_APP=""
 AC_ARG_ENABLE([fs-app],
    AS_HELP_STRING([--disable-fs-app],[Do not build gnunet-fs-gtk application]))
 AS_IF([test "x$enable_fs_app" != "xno"], [
@@ -125,6 +125,14 @@
 ])
 AC_SUBST(GNUNET_FS_APP)
 
+GNUNET_GNS_APP=""
+AC_ARG_ENABLE([gns-app],
+   AS_HELP_STRING([--disable-gns-app],[Do not build gnunet-gns-gtk 
application]))
+AS_IF([test "x$enable_gns_app" != "xno"], [
+  GNUNET_FS_APP="gns"
+])
+AC_SUBST(GNUNET_FS_APP)
+
 GNUNET_SETUP_APP=""
 AC_ARG_ENABLE([setup-app],
    AS_HELP_STRING([--disable-setup-app],[Do not build gnunet-setup 
application]))
@@ -392,6 +400,7 @@
 packagesrcdir=`cd $srcdir && pwd`
 AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [source dir])
 
+AC_SUBST(GNUNET_GNS_GTK_NAME, "GNUnet-GNS-GTK", [name of the program])
 AC_SUBST(GNUNET_FS_GTK_NAME, "GNUnet-FS-GTK", [name of the program])
 AC_SUBST(GNUNET_PEERINFO_GTK_NAME, "GNUnet-Peerinfo-GTK", [name of the 
program])
 AC_SUBST(GNUNET_STATISTICS_GTK_NAME, "GNUnet-Statistics-GTK", [name of the 
program])
@@ -421,6 +430,7 @@
 src/include/Makefile
 src/lib/Makefile
 src/fs/Makefile
+src/gns/Makefile
 src/peerinfo/Makefile
 src/setup/Makefile
 src/statistics/Makefile

Modified: gnunet-gtk/contrib/Makefile.am
===================================================================
--- gnunet-gtk/contrib/Makefile.am      2012-03-06 14:20:33 UTC (rev 20313)
+++ gnunet-gtk/contrib/Makefile.am      2012-03-06 14:36:26 UTC (rev 20314)
@@ -28,6 +28,8 @@
   gnunet_fs_gtk_search_tab.glade \
   gnunet_fs_gtk_select_pseudonym_dialog.glade \
   gnunet_fs_gtk_progress_dialog.glade \
+  gnunet_gns_gtk_about_window.glade \
+  gnunet_gns_gtk_main_window.glade \
   gnunet_gtk_status_bar_menu.glade \
   gnunet_peerinfo_gtk_about_window.glade \
   gnunet_peerinfo_gtk_main_window.glade \

Modified: gnunet-gtk/src/Makefile.am
===================================================================
--- gnunet-gtk/src/Makefile.am  2012-03-06 14:20:33 UTC (rev 20313)
+++ gnunet-gtk/src/Makefile.am  2012-03-06 14:36:26 UTC (rev 20314)
@@ -1 +1 @@
-SUBDIRS = . include lib $(GNUNET_FS_APP) $(GNUNET_SETUP_APP) 
$(GNUNET_PEERINFO_APP) statistics
+SUBDIRS = . include lib $(GNUNET_FS_APP) $(GNUNET_GNS_APP) $(GNUNET_SETUP_APP) 
$(GNUNET_PEERINFO_APP) statistics

Added: gnunet-gtk/src/gns/Makefile.am
===================================================================
--- gnunet-gtk/src/gns/Makefile.am                              (rev 0)
+++ gnunet-gtk/src/gns/Makefile.am      2012-03-06 14:36:26 UTC (rev 20314)
@@ -0,0 +1,22 @@
+SUBDIRS = .
+
+INCLUDES = \
+  -I$(top_srcdir)/ \
+  -I$(top_srcdir)/src/include \
+  @GTK_CFLAGS@ \
+  @GNUNET_CFLAGS@ \
+  @GLADE_CFLAGS@
+
+bin_PROGRAMS = gnunet-gns-gtk
+
+gnunet_gns_gtk_SOURCES = \
+  gnunet-gns-gtk.c \
+  gnunet-gns-gtk_about.c 
+gnunet_gns_gtk_LDADD = \
+  $(top_builddir)/src/lib/libgnunetgtk.la \
+  @GTK_LIBS@ \
+  @GLADE_LIBS@ @GNUNET_LIBS@ \
+  -lgnunetutil \
+  $(INTLLIBS) 
+gnunet_gns_gtk_LDFLAGS = \
+  -export-dynamic 

Added: gnunet-gtk/src/gns/gnunet-gns-gtk.c
===================================================================
--- gnunet-gtk/src/gns/gnunet-gns-gtk.c                         (rev 0)
+++ gnunet-gtk/src/gns/gnunet-gns-gtk.c 2012-03-06 14:36:26 UTC (rev 20314)
@@ -0,0 +1,141 @@
+/*
+     This file is part of GNUnet.
+     (C) 2012 Christian Grothoff (and other contributing authors)
+
+     GNUnet 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.
+
+     GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file src/gns/gnunet-gns-gtk.c
+ * @brief Main function of gnunet-gns-gtk
+ * @author Christian Grothoff
+ */
+#include "gnunet_gtk.h"
+
+/**
+ * Handle to our main loop.
+ */
+static struct GNUNET_GTK_MainLoop *ml;
+
+/**
+ * Should gnunet-gns-gtk start in tray mode?
+ */
+static int tray_only;
+
+
+/**
+ * Get cfg.
+ */
+static const struct GNUNET_CONFIGURATION_Handle *
+get_configuration ()
+{
+  return GNUNET_GTK_main_loop_get_configuration (ml);
+}
+
+
+/**
+ * Get an object from the main window.
+ *
+ * @param name name of the object
+ * @return NULL on error
+ */
+static GObject *
+get_object (const char *name)
+{
+  return GNUNET_GTK_main_loop_get_object (ml, name);
+}
+
+
+/**
+ * Task run on shutdown.
+ *
+ * @param cls unused
+ * @param tc scheduler context, unused
+ */
+static void
+shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+}
+
+
+/**
+ * Callback invoked if the application is supposed to exit.
+ */
+void
+GNUNET_GNS_GTK_quit_cb (GObject * object, gpointer user_data)
+{
+  GNUNET_GTK_tray_icon_destroy ();
+  GNUNET_GTK_main_loop_quit (ml);
+  GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
+}
+
+
+/**
+ * Actual main function run right after GNUnet's scheduler
+ * is initialized.  Initializes up GTK and Glade.
+ */
+static void
+run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+  GtkWidget *main_window;
+
+  ml = cls;
+
+  if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, NULL))
+  {
+    return;
+  }
+
+  GNUNET_GTK_set_icon_search_path ();
+  GNUNET_GTK_setup_nls ();
+  /* setup main window */
+  main_window = GTK_WIDGET (get_object ("GNUNET_GNS_GTK_main_window"));
+  gtk_window_maximize (GTK_WINDOW (main_window));
+  GNUNET_GTK_tray_icon_create (GTK_WINDOW (main_window),
+                               "gnunet-gtk" /* FIXME: different icon? */ ,
+                               "gnunet-gns-gtk");
+
+  /* make GUI visible */
+  if (!tray_only)
+  {
+    gtk_widget_show (main_window);
+    gtk_window_present (GTK_WINDOW (main_window));
+  }
+}
+
+
+int
+main (int argc, char *const *argv)
+{
+  static struct GNUNET_GETOPT_CommandLineOption options[] = {
+    {'t', "tray", NULL,
+     gettext_noop ("start in tray mode"), 0,
+     &GNUNET_GETOPT_set_one, &tray_only},
+    GNUNET_GETOPT_OPTION_END
+  };
+
+  if (GNUNET_OK !=
+      GNUNET_GTK_main_loop_start ("gnunet-gns-gtk",
+                                  "GTK GUI for editing our zone", argc,
+                                  argv, options,
+                                  "gnunet_gns_gtk_main_window.glade",
+                                  &run))
+    return 1;
+  return 0;
+}
+
+
+/* end of gnunet-gns-gtk.c */

Added: gnunet-gtk/src/gns/gnunet-gns-gtk_about.c
===================================================================
--- gnunet-gtk/src/gns/gnunet-gns-gtk_about.c                           (rev 0)
+++ gnunet-gtk/src/gns/gnunet-gns-gtk_about.c   2012-03-06 14:36:26 UTC (rev 
20314)
@@ -0,0 +1,42 @@
+/*
+     This file is part of GNUnet
+     (C) 2005, 2006, 2010 Christian Grothoff (and other contributing authors)
+
+     GNUnet 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.
+
+     GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file src/gns/gnunet-gns-gtk_about.c
+ * @author Christian Grothoff
+ * @author Igor Wronsky
+ *
+ * This file contains the about dialog.
+ */
+#include "gnunet_gtk.h"
+
+
+/**
+ * This displays an about window
+ */
+void
+GNUNET_GNS_GTK_about_imagemenuitem_activate_cb (GtkWidget * dummy,
+                                               gpointer data)
+{
+  GNUNET_GTK_display_about ("gnunet_gns_gtk_about_window.glade");
+}
+
+
+/* end of gnunet-gns-gtk_about.c */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]