Esempio n. 1
0
void
logview_app_initialize (LogviewApp *app, char **log_files)
{
  LogviewAppPrivate *priv;

  g_assert (LOGVIEW_IS_APP (app));

  priv = app->priv;

  /* open regular logs and add each log passed as a parameter */

  if (log_files == NULL) {
    char *active_log;
    gchar **logs;

    active_log = logview_prefs_get_active_logfile (priv->prefs);
    logs = logview_prefs_get_stored_logfiles (priv->prefs);

    if (!logs) {
      logview_app_first_time_initialize (app);
    } else {
      logview_manager_add_logs_from_names (priv->manager,
                                           logs, active_log);

      g_free (active_log);
      g_strfreev (logs);
    }
  } else {
    logview_manager_add_logs_from_names (priv->manager, log_files, NULL);
  }

  gtk_widget_show (GTK_WIDGET (priv->window));
}
Esempio n. 2
0
static void
logview_app_activate (GApplication *application)
{
  LogviewApp *app = LOGVIEW_APP (application);
  char *active_log;
  gchar **logs;

  G_APPLICATION_CLASS (logview_app_parent_class)->activate (application);

  logs = logview_prefs_get_stored_logfiles (app->priv->prefs);

  if (!logs || !logs[0]) {
    logview_app_first_time_initialize (app);
  } else {
    active_log = logview_prefs_get_active_logfile (app->priv->prefs);
    logview_manager_add_logs_from_names (app->priv->manager, logs, active_log);
    g_free (active_log);
  }

  g_strfreev (logs);

  gtk_widget_show (app->priv->window);
}