Exemple #1
0
void
search_box_session_load (SearchBox* search_box, AnjutaSession* session)
{
	g_return_if_fail (search_box != NULL && SEARCH_IS_BOX(search_box));

	search_box->priv->case_sensitive = anjuta_session_get_int (session, "Search Box", "Case Sensitive") ? TRUE : FALSE;
	search_box->priv->regex_mode = anjuta_session_get_int (session, "Search Box", "Regular Expression") ? TRUE : FALSE;
	search_box->priv->highlight_all = anjuta_session_get_int (session, "Search Box", "Highlight Match") ? TRUE : FALSE;
}
Exemple #2
0
static void
on_session_load (AnjutaShell *shell, AnjutaSessionPhase phase,
				 AnjutaSession *session, AnjutaApp *app)
{
	/* We load layout at last so that all plugins would have loaded by now */
	if (phase == ANJUTA_SESSION_PHASE_LAST)
	{
		gchar *geometry;
		gchar *layout_file;
		
		/* Restore geometry */
		geometry = anjuta_session_get_string (session, "Anjuta", "Geometry");
		anjuta_app_set_geometry (app, geometry);
		
		/* Restore window state */
		if (anjuta_session_get_int (session, "Anjuta", "Fullscreen"))
		{
			/* bug #304495 */
			AnjutaUI* ui = anjuta_shell_get_ui(shell, NULL);
			GtkAction* action = anjuta_ui_get_action (ui, "ActionGroupToggleView",
								   "ActionViewFullscreen");
			gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
								  TRUE);					   

			gtk_window_fullscreen (GTK_WINDOW (shell));
			
		}
		else if (anjuta_session_get_int (session, "Anjuta", "Maximized"))
		{
			gtk_window_maximize (GTK_WINDOW (shell));
		}
		
		/* Restore layout */
		layout_file = g_build_filename (anjuta_session_get_session_directory (session),
										"dock-layout.xml", NULL);
		anjuta_app_layout_load (app, layout_file, NULL);
		g_free (layout_file);
	}
}
Exemple #3
0
static void on_session_load (AnjutaShell *shell, AnjutaSessionPhase phase, AnjutaSession *session, DmaStart *self)
{
	gint stop_at_beginning;

	if (phase != ANJUTA_SESSION_PHASE_NORMAL)
		return;

	/* Initialize source_dirs */
 	if (self->source_dirs != NULL)
	{		
 		g_list_foreach (self->source_dirs, (GFunc)g_free, NULL);
 		g_list_free (self->source_dirs);
 	}
 	self->source_dirs = anjuta_session_get_string_list (session, "Debugger", "Source directories");

	stop_at_beginning = anjuta_session_get_int (session, "Debugger", "Stop at beginning");
	if (stop_at_beginning == 0)
		self->stop_at_beginning = TRUE;	/* Default value */
	else
		self->stop_at_beginning = stop_at_beginning - 1;
	
	g_free (self->remote_debugger);
	self->remote_debugger = anjuta_session_get_string (session, "Debugger", "Remote target");
}
Exemple #4
0
static void
on_session_load (AnjutaShell *shell, AnjutaSessionPhase phase,
				 AnjutaSession *session, AnjutaWindow *win)
{
	if (phase == ANJUTA_SESSION_PHASE_START)
	{
		AnjutaApplication *app;

		app = ANJUTA_APPLICATION (gtk_window_get_application (GTK_WINDOW (win)));
		if (app != NULL)
		{
			if (anjuta_application_get_no_session (app))
			{
				/* Clear session */
				anjuta_session_clear (session);
			}
			else if (anjuta_application_get_no_files (app))
			{
				/* Clear files from session */
				anjuta_session_set_string_list (session, "File Loader",
				                                "Files", NULL);
			}
			if (anjuta_application_get_geometry (app))
			{
				/* Set new geometry */
				anjuta_session_set_string (session, "Anjuta", "Geometry",
				                           anjuta_application_get_geometry (app));
			}
		}
	}

	/* We load layout at last so that all plugins would have loaded by now */
	if (phase == ANJUTA_SESSION_PHASE_LAST)
	{
		gchar *geometry;
		gchar *layout_file;

		/* Restore geometry */
		geometry = anjuta_session_get_string (session, "Anjuta", "Geometry");
		anjuta_window_set_geometry (win, geometry);
		g_free (geometry);

		/* Restore window state */
		if (anjuta_session_get_int (session, "Anjuta", "Fullscreen"))
		{
			/* bug #304495 */
			AnjutaUI* ui = anjuta_shell_get_ui(shell, NULL);
			GtkAction* action = anjuta_ui_get_action (ui, "ActionGroupToggleView",
								   "ActionViewFullscreen");
			gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
								  TRUE);

			gtk_window_fullscreen (GTK_WINDOW (shell));

		}
		else if (anjuta_session_get_int (session, "Anjuta", "Maximized"))
		{
			gtk_window_maximize (GTK_WINDOW (shell));
		}
		else
		{
			gtk_window_unmaximize (GTK_WINDOW (shell));
		}
		gtk_widget_show (GTK_WIDGET (win));

		/* Restore layout */
		layout_file = g_build_filename (anjuta_session_get_session_directory (session),
										"dock-layout.xml", NULL);
		anjuta_window_layout_load (win, layout_file, NULL);
		g_free (layout_file);
	}
}