Пример #1
0
static GtkWidget *
eh_prefs_get_frame(PurplePlugin *plugin)
{
	GtkSizeGroup *sg = NULL;
	GtkWidget *vbox = NULL, *frame = NULL, *option = NULL;

	sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
	vbox = gtk_vbox_new(TRUE, PIDGIN_HIG_BOX_SPACE);

	/* heading for the more general options */
	frame = pidgin_make_frame(vbox, _("Display Options"));

	/* the integer pref for the number of logs to display */
	pidgin_prefs_labeled_spin_button(frame, _("Maximum number of conversations:"),
			PREF_NUMBER_PATH, 0, 255, NULL);

	/* the integer pref for maximum number of bytes to read back */
	pidgin_prefs_labeled_spin_button(frame, _("Maximum number of bytes:"),
			PREF_BYTES_PATH, 0, 1024*1024, NULL);

	/* the boolean preferences */
	option = pidgin_prefs_checkbox(_("Show dates with text"), PREF_DATES_PATH, frame);
	option = pidgin_prefs_checkbox(_("Show logs for IMs"), PREF_IM_PATH, frame);
	option = pidgin_prefs_checkbox(_("Show logs for chats"), PREF_CHAT_PATH, frame);

	/* heading for the age limit options */
	frame = pidgin_make_frame(vbox, _("Age Limit for Logs (0 to disable):"));

	/* the integer preferences for time limiting */
	option = pidgin_prefs_labeled_spin_button(frame, "Days:", PREF_DAYS_PATH, 0, 255, sg);
	option = pidgin_prefs_labeled_spin_button(frame, "Hours:", PREF_HOURS_PATH, 0, 255, sg);
	option = pidgin_prefs_labeled_spin_button(frame, "Minutes:", PREF_MINS_PATH, 0, 255, sg);

	gtk_widget_show_all(vbox);

	return vbox;
}
Пример #2
0
GtkWidget *ap_prefs_labeled_spin_button (struct widget *w, 
  GtkWidget *page, const gchar *title, const char *key, int min, 
  int max, GtkSizeGroup *sg) 
{
  GtkWidget *result; 
  const gchar *pref;

  pref = get_const_pref (w, key);
  result = pidgin_prefs_labeled_spin_button (page, title, pref,
    min, max, sg);
  purple_prefs_connect_callback (ap_get_plugin_handle (), pref,
    pref_callback, w);

  return result;
}
Пример #3
0
static GtkWidget *
purplerc_make_misc_vbox(void)
{
	/* Note: Intentionally not using the size group argument to the
	 * pidgin_prefs_labeled_* functions they only add the text label to
	 * the size group not the whole thing, which isn't what I want. */
	GtkWidget *vbox = NULL, *hbox = NULL, *check = NULL, *widget = NULL;
	GtkSizeGroup *labelsg = NULL;
	gsize i;

	vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
	labelsg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);

	gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BORDER);

	hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

	check = pidgin_prefs_checkbox(_("GTK+ Text Shortcut Theme"),
	                              "/plugins/gtk/purplerc/set/gtk-key-theme-name",
	                              hbox);
	gtk_size_group_add_widget(labelsg, check);

	widget = pidgin_prefs_labeled_entry(hbox, "",
	                                    "/plugins/gtk/purplerc/gtk-key-theme-name",
	                                    NULL);
	gtk_widget_set_sensitive(widget,
	                         purple_prefs_get_bool("/plugins/gtk/purplerc/set/gtk-key-theme-name"));
	g_signal_connect(G_OBJECT(check), "toggled",
	                 G_CALLBACK(pidgin_toggle_sensitive), widget);

	for (i = 0; i < G_N_ELEMENTS(widget_size_prefs); i++) {
		hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
		gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

		check = pidgin_prefs_checkbox(_(widget_size_names[i]),
		                              widget_size_prefs_set[i], hbox);
		gtk_size_group_add_widget(labelsg, check);

		widget_size_widgets[i] = pidgin_prefs_labeled_spin_button(hbox, "", widget_size_prefs[i], 0, 50, NULL);
		gtk_widget_set_sensitive(widget_size_widgets[i],
		                         purple_prefs_get_bool(widget_size_prefs_set[i]));
		g_signal_connect(G_OBJECT(check), "toggled",
		                 G_CALLBACK(pidgin_toggle_sensitive),
		                 widget_size_widgets[i]);
	}

	hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

	pidgin_prefs_checkbox(_("Disable Typing Notification Text"),
		"/plugins/gtk/purplerc/set/disable-typing-notification", hbox);

	/* Widget boolean stuff */
	/*
	for (i = 0; i < G_N_ELEMENTS(widget_bool_prefs); i++) {
		hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
		gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

		check = pidgin_prefs_checkbox(_(widget_bool_names[i]),
		                              widget_bool_prefs_set[i], hbox);
		gtk_size_group_add_widget(labelsg, check);

		widget_bool_widgets[i] = pidgin_prefs_checkbox("", widget_bool_prefs[i], hbox);

		gtk_widget_set_sensitive(widget_bool_widgets[i],
		                         purple_prefs_get_bool(widget_bool_prefs_set[i]));
		g_signal_connect(G_OBJECT(check), "toggled",
		                 G_CALLBACK(pidgin_toggle_sensitive),
		                 widget_bool_widgets[i]);
	}
	*/

	g_object_unref(labelsg);

	return vbox;
}
Пример #4
0
static GtkWidget *get_behavior_page () {
  GtkWidget *page;
  GtkWidget *label;
  GtkWidget *frame, *vbox, *hbox;
  GtkWidget *button, *select, *menu;
  GtkSizeGroup *sg;
  gchar *markup;

  /* Make the box */
  page = gtk_vbox_new (FALSE, 8);
  gtk_container_set_border_width (GTK_CONTAINER (page), 12);

  /*---------- Update frequency ----------*/
  frame = pidgin_make_frame (page, _("Update frequency"));
  vbox = gtk_vbox_new (FALSE, 0);
  gtk_container_add (GTK_CONTAINER (frame), vbox);

  pidgin_prefs_labeled_spin_button (vbox,
    _("Minimum number of seconds between updates"),
    "/plugins/gtk/autoprofile/delay_update",
    15, 1000, NULL);

  label = gtk_label_new ("");
  markup = g_markup_printf_escaped ("<span style=\"italic\">%s</span>", 
    _("WARNING: Using values below 60 seconds may increase the frequency\n"
      "of rate limiting errors"));
  gtk_label_set_markup (GTK_LABEL (label), markup);
  g_free (markup);
  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);

  /*----------- Auto-away stuff ------------*/
  frame = pidgin_make_frame(page, _("Auto-away"));

  button = pidgin_prefs_checkbox(_("Change status when idle"),
    "/plugins/gtk/autoprofile/away_when_idle", frame);

  sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
  select = pidgin_prefs_labeled_spin_button(frame,
    _("Minutes before changing status:"), "/core/away/mins_before_away",
    1, 24 * 60, sg);
  g_signal_connect(G_OBJECT(button), "clicked",
    G_CALLBACK(pidgin_toggle_sensitive), select);

  hbox = gtk_hbox_new(FALSE, 0);
  gtk_container_add(GTK_CONTAINER(frame), hbox);

  label = gtk_label_new_with_mnemonic(_("Change status to:"));
  gtk_size_group_add_widget(sg, label);
  gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
  g_signal_connect(G_OBJECT(button), "clicked",
    G_CALLBACK(pidgin_toggle_sensitive), label);
  gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);

  /* TODO: Show something useful if we don't have any saved statuses. */
  menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), 
    G_CALLBACK(set_idle_away));
  gtk_box_pack_start(GTK_BOX(frame), menu, FALSE, FALSE, 0);
  g_signal_connect(G_OBJECT(button), "clicked",
    G_CALLBACK(pidgin_toggle_sensitive), menu);
  gtk_label_set_mnemonic_widget(GTK_LABEL(label), menu);

  if (!purple_prefs_get_bool("/plugins/gtk/autoprofile/away_when_idle")) {
    gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE);
    gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
    gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE);
  }

  return page;
}