Commit 292309c1 authored by Naba Kumar's avatar Naba Kumar

Message-manager now restores the tabs which were shown on startup. The

	* src/message-manager-private.cc
	  src/message-manager-private.h
	  src/message-manager.cc:

	  Message-manager now restores the tabs which were shown on startup.
	  The terminal is now created on demand (as requested by Biswa)
	  and I have removed some debug messages.

	  Patch submitted by:
	  Johannes Schmid <johannes.schmid@gmx.de>
parent 53a676dd
2002-01-17 Naba Kumar <kh_naba@users.sourceforge.net>
* src/message-manager-private.cc
src/message-manager-private.h
src/message-manager.cc:
Message-manager now restores the tabs which were shown on startup.
The terminal is now created on demand (as requested by Biswa)
and I have removed some debug messages.
Patch submitted by:
Johannes Schmid <johannes.schmid@gmx.de>
2002-01-13 Stephane Demurget <demurgets@free.fr>
* src/anjuta_cbs.c: fixed the global shortcut handling to have a
......
......@@ -640,10 +640,14 @@ void anjuta_goto_symbol_definition(const char *symbol, TextEditor *te)
tag = global_proto;
else
return;
an_file_history_push(te->full_filename
, aneditor_command(te->editor_id, ANE_GET_LINENO, (long) NULL, (long) NULL));
anjuta_goto_file_line_mark(tag->atts.entry.file->work_object.file_name
, tag->atts.entry.line, TRUE);
/* Make sure te is not NULL */
if (te) {
an_file_history_push(te->full_filename
, aneditor_command(te->editor_id, ANE_GET_LINENO, (long) NULL, (long) NULL));
anjuta_goto_file_line_mark(tag->atts.entry.file->work_object.file_name
, tag->atts.entry.line, TRUE);
}
}
static void
......
......@@ -86,10 +86,9 @@ void MessageSubwindow::activate()
{
if (!m_is_shown)
{
disconnect_menuitem_signal(m_menuitem, this);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(m_menuitem), true);
connect_menuitem_signal(m_menuitem, this);
show();
set_check_item(true);
// reorder windows
vector<bool> win_is_shown;
......@@ -116,6 +115,13 @@ GtkWidget* MessageSubwindow::create_label() const
return label;
}
void MessageSubwindow::set_check_item(bool p_state)
{
disconnect_menuitem_signal(m_menuitem, this);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(m_menuitem), p_state);
connect_menuitem_signal(m_menuitem, this);
}
// MessageWindow:
AnjutaMessageWindow::AnjutaMessageWindow(AnjutaMessageManager* p_amm, int p_type_id, string p_type, string p_pixmap)
......@@ -264,7 +270,6 @@ AnjutaMessageWindow::show()
break;
}
}
m_is_shown = true;
}
}
......@@ -329,13 +334,16 @@ TerminalWindow::TerminalWindow(AnjutaMessageManager* p_amm, int p_type_id, strin
gtk_box_pack_start(GTK_BOX(m_hbox), m_scrollbar, FALSE, TRUE, 0);
gtk_widget_show (m_scrollbar);
zvterm_reinit_child(ZVT_TERM(m_terminal));
//zvterm_reinit_child(ZVT_TERM(m_terminal));
gtk_signal_connect(GTK_OBJECT(m_terminal), "button_press_event"
, GTK_SIGNAL_FUNC(TerminalWindow::zvterm_mouse_clicked), m_terminal);
gtk_signal_connect (GTK_OBJECT(m_terminal), "child_died"
, GTK_SIGNAL_FUNC (TerminalWindow::zvterm_reinit_child), NULL);
gtk_signal_connect (GTK_OBJECT (m_terminal),"destroy"
, GTK_SIGNAL_FUNC (TerminalWindow::zvterm_terminate), NULL);
gtk_signal_connect (GTK_OBJECT (m_terminal), "focus_in_event",
GTK_SIGNAL_FUNC (TerminalWindow::zvterm_focus_in), NULL);
}
void TerminalWindow::show()
......@@ -408,14 +416,23 @@ void TerminalWindow::zvterm_reinit_child(ZvtTerm* term)
}
execle (shell->str, name->str, NULL, environ);
default:
g_message("Terminal restarted");
break;
}
}
void TerminalWindow::zvterm_terminate(ZvtTerm* term)
{
g_message("Terminating terminal..");
gtk_signal_disconnect_by_func(GTK_OBJECT(term), GTK_SIGNAL_FUNC(TerminalWindow::zvterm_reinit_child), NULL);
zvt_term_closepty(term);
}
int TerminalWindow::zvterm_focus_in(ZvtTerm* term, GdkEventFocus* event)
{
static bool need_init = true;
if (need_init)
{
zvterm_reinit_child(term);
need_init = false;
}
return true;
}
......@@ -77,6 +77,9 @@ class MessageSubwindow
gint get_page_num() const;
const string& get_type() const;
int get_type_id() const;
/* No call this from the on_show_hide_tab callback */
void set_check_item(bool p_state);
protected:
AnjutaMessageManager* m_parent;
......@@ -140,6 +143,7 @@ class TerminalWindow : public MessageSubwindow
static gboolean zvterm_mouse_clicked(GtkWidget* widget, GdkEvent* event, gpointer user_data);
static void zvterm_reinit_child(ZvtTerm* term);
static void zvterm_terminate(ZvtTerm* term);
static int zvterm_focus_in(ZvtTerm* term, GdkEventFocus* event);
};
void connect_menuitem_signal(GtkWidget* item, MessageSubwindow* msg_win);
......
......@@ -506,6 +506,15 @@ anjuta_message_manager_save_yourself (AnjutaMessageManager * amm,
fprintf (stream, "messages.win.width=%d\n", amm->intern->width);
fprintf (stream, "messages.win.height=%d\n", amm->intern->height);
typedef vector < MessageSubwindow * >::iterator I;
for (I cur_win = amm->intern->msg_windows.begin ();
cur_win != amm->intern->msg_windows.end (); cur_win++)
{
fprintf(stream, "messages.show.%d=%d\n", (*cur_win)->get_type_id(),
(*cur_win)->is_shown());
}
return true;
}
......@@ -526,6 +535,21 @@ anjuta_message_manager_load_yourself (AnjutaMessageManager * amm,
amm->intern->height =
prop_get_int (props, "messages.win.height", 300);
typedef vector < MessageSubwindow * >::iterator I;
for (I cur_win = amm->intern->msg_windows.begin ();
cur_win != amm->intern->msg_windows.end (); cur_win++)
{
char* str = new char[sizeof("messages.tab.") + 3];
sprintf(str, "messages.show.%d", (*cur_win)->get_type_id());
int show = prop_get_int (props, str, 1);
if (!show)
{
(*cur_win)->hide();
(*cur_win)->set_check_item(false);
}
delete[] str;
}
anjuta_message_manager_update(amm);
amm_hide_docked ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment