gnome-utils r8163 - trunk/logview
- From: cosimoc svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-utils r8163 - trunk/logview
- Date: Thu, 23 Oct 2008 18:00:58 +0000 (UTC)
Author: cosimoc
Date: Thu Oct 23 18:00:58 2008
New Revision: 8163
URL: http://svn.gnome.org/viewvc/gnome-utils?rev=8163&view=rev
Log:
2008-10-23 Cosimo Cecchi <cosimoc gnome org>
* logview.c:
(logview_help):
* main.c:
(create_option_context):
(main):
Remove libgnome usage; drop SM client code, as it doesn't
work (#547273).
Modified:
trunk/logview/ChangeLog
trunk/logview/logview.c
trunk/logview/main.c
Modified: trunk/logview/logview.c
==============================================================================
--- trunk/logview/logview.c (original)
+++ trunk/logview/logview.c Thu Oct 23 18:00:58 2008
@@ -765,13 +765,16 @@
static void
logview_help (GtkAction *action, GtkWidget *parent_window)
{
- GError *error = NULL;
- gnome_help_display_desktop_on_screen (NULL, "gnome-system-log", "gnome-system-log", NULL,
- gtk_widget_get_screen (GTK_WIDGET(parent_window)), &error);
- if (error) {
- error_dialog_show (GTK_WIDGET(parent_window), _("There was an error displaying help."), error->message);
- g_error_free (error);
- }
+ GError *error = NULL;
+
+ gtk_show_uri (gtk_widget_get_screen (parent_window),
+ "ghelp:gnome-system-log", gtk_get_current_event_time (),
+ &error);
+
+ if (error) {
+ error_dialog_show (parent_window, _("There was an error displaying help."), error->message);
+ g_error_free (error);
+ }
}
static gboolean
Modified: trunk/logview/main.c
==============================================================================
--- trunk/logview/main.c (original)
+++ trunk/logview/main.c Thu Oct 23 18:00:58 2008
@@ -24,8 +24,6 @@
#include <stdlib.h>
#include <string.h>
-#include <libgnomeui/gnome-client.h>
-#include <libgnomeui/gnome-ui-init.h>
#include <libgnomevfs/gnome-vfs.h>
#include <glib/gi18n.h>
@@ -40,7 +38,7 @@
static gboolean show_version = FALSE;
static GOptionContext *
-logview_init_options ()
+create_option_context ()
{
GOptionContext *context;
GOptionGroup *group;
@@ -59,7 +57,8 @@
context = g_option_context_new (_(" - Browse and monitor logs"));
g_option_context_add_group (context, group);
g_option_context_set_ignore_unknown_options (context, TRUE);
-
+ g_option_context_add_group (context, gtk_get_option_group (TRUE));
+
return context;
}
@@ -74,54 +73,10 @@
exit (0);
}
-static gboolean
-save_session_cb (GnomeClient *gnome_client,
- gint phase,
- GnomeRestartStyle save_style,
- gboolean shutdown,
- GnomeInteractStyle interact_style,
- gboolean fast,
- LogviewWindow *logview)
-{
- gchar **argv;
- gint numlogs;
- GSList *logs;
- Log *log;
- gint i = 0;
-
- g_assert (LOGVIEW_IS_WINDOW (logview));
- numlogs = logview_count_logs (logview);
-
- /* we must allocate enough space for the program name, the logs name
- * and a NULL pointer to end the list
- */
- argv = g_new0 (gchar *, numlogs + 2);
- argv[i++] = g_get_prgname();
-
- for (logs = logview->logs; logs != NULL; logs = logs->next) {
- Log *log = (Log *) logs->data;
-
- g_assert (log != NULL);
-
- argv[i++] = g_strdup (log->name);
- }
-
- argv[i] = NULL;
-
- gnome_client_set_clone_command (gnome_client, numlogs + 1, argv);
- gnome_client_set_restart_command (gnome_client, numlogs + 1, argv);
-
- g_strfreev (argv);
-
- return TRUE;
-}
-
int
main (int argc, char *argv[])
{
- GnomeClient *gnome_client;
- GError *error;
- GnomeProgram *program;
+ GError *error = NULL;
GOptionContext *context;
LogviewWindow *logview;
@@ -133,20 +88,25 @@
gnome_vfs_init ();
prefs_init ();
- context = logview_init_options ();
-
- program = gnome_program_init ("gnome-system-log", VERSION,
- LIBGNOMEUI_MODULE,
- argc, argv,
- GNOME_PARAM_APP_DATADIR, DATADIR,
- GNOME_PARAM_GOPTION_CONTEXT, context,
- NULL);
+ context = create_option_context ();
+
+ g_option_context_parse (context, &argc, &argv, &error);
+
+ if (error) {
+ g_critical ("Unable to parse arguments: %s", error->message);
+ g_error_free (error);
+ g_option_context_free (context);
+
+ exit (1);
+ }
+
+ g_option_context_free (context);
g_set_application_name (_("Log Viewer"));
if (show_version)
logview_show_version_and_quit ();
-
+
/* Open regular logs and add each log passed as a parameter */
logview = LOGVIEW_WINDOW (logview_window_new ());
if (!logview) {
@@ -184,12 +144,6 @@
error_dialog_queue (FALSE);
error_dialog_show_queued ();
- gnome_client = gnome_master_client ();
- if (gnome_client) {
- g_signal_connect (gnome_client, "save_yourself",
- G_CALLBACK (save_session_cb), logview);
- }
-
gtk_main ();
prefs_shutdown ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]