Removed MooEditor sessions stuff

This commit is contained in:
Yevgen Muntyan 2006-06-14 12:51:52 -05:00
parent b577c2f49b
commit a233294aaa
3 changed files with 0 additions and 118 deletions

View File

@ -2100,89 +2100,3 @@ apply_prefs (MooEditor *editor)
return FALSE;
}
MooEditSession *
moo_editor_get_session (MooEditor *editor)
{
MooEditSession *session;
GSList *windows;
g_return_val_if_fail (MOO_IS_EDITOR (editor), NULL);
session = _moo_edit_session_new ();
windows = moo_editor_list_windows (editor);
while (windows)
{
_moo_edit_session_add_window (session, windows->data);
windows = g_slist_delete_link (windows, windows);
}
return session;
}
gboolean
moo_editor_load_session (MooEditor *editor,
MooEditSession *session,
gboolean ask_confirm)
{
MooEditWindow *window;
g_return_val_if_fail (MOO_IS_EDITOR (editor), FALSE);
g_return_val_if_fail (session != NULL, FALSE);
if (!moo_editor_clear (editor, ask_confirm))
return FALSE;
window = moo_editor_get_active_window (editor);
_moo_edit_session_load (session, editor, window);
return TRUE;
}
/* XXX ask in each window, then close */
gboolean
moo_editor_clear (MooEditor *editor,
gboolean ask_confirm)
{
GSList *windows;
MooEditWindow *active;
g_return_val_if_fail (MOO_IS_EDITOR (editor), FALSE);
active = moo_editor_get_active_window (editor);
windows = moo_editor_list_windows (editor);
if (!windows)
return TRUE;
windows = g_slist_remove (windows, active);
while (windows)
{
if (!moo_editor_close_window (editor, windows->data, ask_confirm))
{
g_slist_free (windows);
return FALSE;
}
windows = g_slist_delete_link (windows, windows);
}
if (active)
{
GSList *docs = moo_edit_window_list_docs (active);
if (!moo_editor_close_docs (editor, docs, ask_confirm))
{
g_slist_free (docs);
return FALSE;
}
}
return TRUE;
}

View File

@ -139,13 +139,6 @@ gboolean moo_editor_save_copy (MooEditor *editor,
const char *encoding,
GError **error);
MooEditSession *moo_editor_get_session (MooEditor *editor);
gboolean moo_editor_load_session (MooEditor *editor,
MooEditSession *session,
gboolean ask_confirm);
gboolean moo_editor_clear (MooEditor *editor,
gboolean ask_confirm);
#ifdef MOOEDIT_COMPILATION
void _moo_edit_window_insert_doc (MooEditWindow *window,
MooEdit *doc,

View File

@ -278,28 +278,3 @@
(c-name "moo_edit_prefs_page_new")
(return-type "GtkWidget*")
)
(define-method get_session
(of-object "MooEditor")
(c-name "moo_editor_get_session")
(return-type "MooEditSession*")
)
(define-method load_session
(of-object "MooEditor")
(c-name "moo_editor_load_session")
(return-type "gboolean")
(parameters
'("MooEditSession*" "session")
'("gboolean" "ask_confirm" (null-ok) (default "TRUE"))
)
)
(define-method clear
(of-object "MooEditor")
(c-name "moo_editor_clear")
(return-type "gboolean")
(parameters
'("gboolean" "ask_confirm" (null-ok) (default "TRUE"))
)
)