Example #1
0
static void
init_ui_elements(unsigned int max_x, unsigned int max_y)
{
  ssize_t title_len;

  title_len = asprintf(&title, "/* %s-%s */", PKGNAME, VERSION);
  assert( title_len > 0 );
  pw_input  = init_input((unsigned int)(max_x / 2)-PASSWD_XRELPOS,
                         (unsigned int)(max_y / 2)-PASSWD_YRELPOS,
                         PASSWD_WIDTH, "PASSWORD: "******"[%c]");
  higher    = init_statusbar(0, max_x, A_BOLD | COLOR_PAIR(3),
                             higher_statusbar_update);
  lower     = init_statusbar(max_y - 1, max_x, COLOR_PAIR(3),
                             lower_statusbar_update);
  netinfo   = init_statusbar(2, max_x, COLOR_PAIR(2),
                             netinfo_statusbar_update);
  uninfo    = init_statusbar(1, max_x, COLOR_PAIR(2),
                             uninfo_statusbar_update);
  busywnd   = init_txtwindow_centered(INFOWND_WIDTH, INFOWND_HEIGHT,
                             busywnd_update);
  errwnd    = init_txtwindow_centered(INFOWND_WIDTH, INFOWND_HEIGHT,
                             NULL);

  register_input(NULL, pw_input, passwd_input_cb);
  register_statusbar(higher);
  register_statusbar(lower);
  register_statusbar(netinfo);
  register_statusbar(uninfo);
  register_anic_default(heartbeat);
  register_txtwindow(busywnd);
  register_txtwindow(errwnd);
  activate_input(pw_input);
  set_statusbar_text(higher, title, title_len);
}
Example #2
0
static void
fsearch_application_window_constructed (GObject *object)
{
    FsearchApplicationWindow *self = (FsearchApplicationWindow *)object;
    g_assert (FSEARCH_WINDOW_IS_WINDOW (self));

    G_OBJECT_CLASS (fsearch_application_window_parent_class)->constructed (object);

    self->search = NULL;
    self->search = db_search_new (fsearch_application_get_thread_pool (FSEARCH_APPLICATION_DEFAULT));
    g_mutex_init (&self->mutex);
    fsearch_window_apply_config (self);
    fsearch_window_actions_init (self);
    init_statusbar (self);
}
Example #3
0
File: main.c Project: LADI/ladish
int main(int argc, char** argv)
{
  #if ENABLE_NLS
    bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
    textdomain (GETTEXT_PACKAGE);
  #endif

  gtk_init(&argc, &argv);

  if (!dbus_init())
  {
    return 1;
  }

  if (!conf_proxy_init())
  {
    return 1;
  }

  if (!canvas_init())
  {
    log_error("Canvas initialization failed.");
    return 1;
  }

  if (!init_gtk_builder())
  {
    return 1;
  }

  g_main_win = get_gtk_builder_widget("main_win");

  init_dialogs();

  if (!create_studio_lists())
  {
    return 1;
  }

  init_statusbar();
  init_jack_widgets();

  create_room_dialog_init();

  world_tree_init();
  view_init();

  init_actions_and_accelerators();

  if (!menu_init())
  {
    return 1;
  }

  buffer_size_clear();

  if (!toolbar_init())
  {
    return 1;
  }

  if (!conf_register(LADISH_CONF_KEY_DAEMON_NOTIFY, NULL, NULL))
  {
    return 1;
  }

  if (!conf_register(LADISH_CONF_KEY_DAEMON_SHELL, NULL, NULL))
  {
    return 1;
  }

  if (!conf_register(LADISH_CONF_KEY_DAEMON_TERMINAL, NULL, NULL))
  {
    return 1;
  }

  if (!conf_register(LADISH_CONF_KEY_DAEMON_STUDIO_AUTOSTART, NULL, NULL))
  {
    return 1;
  }

  if (!conf_register(LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY, NULL, NULL))
  {
    return 1;
  }

  if (!conf_register(LADISH_CONF_KEY_JACK_CONF_TOOL, NULL, NULL))
  {
    return 1;
  }

  if (!init_jack())
  {
    return 1;
  }

  if (!a2j_proxy_init())
  {
    return 1;
  }

  if (!control_proxy_init())
  {
    return 1;
  }

  if (!studio_proxy_init())
  {
    return 1;
  }

  set_studio_callbacks();
  set_room_callbacks();

  g_signal_connect(G_OBJECT(g_main_win), "destroy", G_CALLBACK(gtk_main_quit), NULL);
  g_signal_connect(G_OBJECT(get_gtk_builder_widget("menu_item_quit")), "activate", G_CALLBACK(gtk_main_quit), NULL);
  g_signal_connect(G_OBJECT(get_gtk_builder_widget("menu_item_view_arrange")), "activate", G_CALLBACK(arrange), NULL);
  g_signal_connect(G_OBJECT(get_gtk_builder_widget("menu_item_help_about")), "activate", G_CALLBACK(show_about), NULL);

  gtk_widget_show(g_main_win);

  gtk_main();

  studio_proxy_uninit();
  control_proxy_uninit();
  a2j_proxy_uninit();
  uninit_jack();
  menu_uninit();
  create_room_dialog_uninit();
  destroy_studio_lists();
  uninit_gtk_builder();

  conf_proxy_uninit();
  dbus_uninit();

  return 0;
}