Ejemplo n.º 1
0
void
on_menu_sidebar_visible_activate(GtkMenuItem *menuitem, gpointer unused_udata)
{
	(void) unused_udata;

	checkmenu_changed(gui, PROP_SIDEBAR_VISIBLE, menuitem);

	/*
	 * Gtk+ 2.x automagically moves the gutter when a child's
	 * visibility status changes.
	 */
#ifdef USE_GTK1
	{	
		GtkPaned *paned;
		gboolean sidebar;

		gui_prop_get_boolean_val(PROP_SIDEBAR_VISIBLE, &sidebar);
		paned = GTK_PANED(gui_main_window_lookup("hpaned_main"));
		if (sidebar) {
			paned_restore_position(paned, PROP_MAIN_DIVIDER_POS);
		} else {
			paned_save_position(paned, PROP_MAIN_DIVIDER_POS);
			gtk_paned_set_position(paned, 0);
		}
	}
#endif /* USE_GTK1 */
}
Ejemplo n.º 2
0
static gboolean
status_icon_enabled_changed(property_t prop)
{
	gboolean enabled;
	
    gui_prop_get_boolean_val(prop, &enabled);
	if (enabled) {
		status_icon_enable();
	} else {
		status_icon_disable();
	}
	return FALSE;
}
Ejemplo n.º 3
0
gboolean
on_progressbar_bws_gin_button_press_event(GtkWidget *unused_widget,
	GdkEventButton *unused_event, gpointer unused_udata)
{
    gboolean val;

	(void) unused_widget;
	(void) unused_event;
	(void) unused_udata;
    gui_prop_get_boolean_val(PROP_PROGRESSBAR_BWS_GIN_AVG, &val);
    gui_prop_set_boolean_val(PROP_PROGRESSBAR_BWS_GIN_AVG, !val);
	return TRUE;
}
Ejemplo n.º 4
0
/**
 * @return whether the entry for the upload `ul' should be removed
 * from the UI with respect to the configured behaviour.
 */
gboolean
upload_should_remove(time_t now, const upload_row_data_t *ul)
{
	property_t prop = 0;

	g_assert(NULL != ul);

	switch (ul->status) {
	case GTA_UL_COMPLETE:
		prop = PROP_AUTOCLEAR_COMPLETED_UPLOADS;
		break;
	case GTA_UL_CLOSED:
	case GTA_UL_ABORTED:
		prop = PROP_AUTOCLEAR_FAILED_UPLOADS;
		break;
	case GTA_UL_PUSH_RECEIVED:
	case GTA_UL_SENDING:
	case GTA_UL_HEADERS:
	case GTA_UL_WAITING:
	case GTA_UL_EXPECTING:
	case GTA_UL_QUEUED:
	case GTA_UL_QUEUE:
	case GTA_UL_QUEUE_WAITING:
		break;
	}

	if (0 != prop) {
		guint32 val;
		time_delta_t grace;

		gnet_prop_get_guint32_val(PROP_ENTRY_REMOVAL_TIMEOUT, &val);
		grace = val;

		if (delta_time(now, ul->last_update) > grace) {
			gboolean auto_remove;

			gui_prop_get_boolean_val(prop, &auto_remove);
			return auto_remove;
		}
	}

	return FALSE;
}
Ejemplo n.º 5
0
static void
quit(gboolean force)
{
	static gboolean quitting;
	gboolean confirm;

	/*
	 * Protect against multiple invocations, since we have many callbacks
	 * that can invoke this routine.  Once we decided to quit for good,
	 * any further invocation would fault on the GUI property access.
	 */

	if (quitting)
		return;

    gui_prop_get_boolean_val(PROP_CONFIRM_QUIT, &confirm);
    if (force || !confirm) {
		quitting = TRUE;
       	guc_gtk_gnutella_exit(0);
	} else {
        gtk_widget_show(gui_dlg_quit());
    	gdk_window_raise(gui_dlg_quit()->window);
	}
}