Gemeinsame Unterverzeichnisse: mousepad-git/mousepad/.deps und mousepad-my/mousepad/.deps.
Gemeinsame Unterverzeichnisse: mousepad-git/mousepad/.libs und mousepad-my/mousepad/.libs.
Binärdateien mousepad-git/mousepad/mousepad and mousepad-my/mousepad/mousepad sind verschieden.
diff -u mousepad-git/mousepad/mousepad-document.c mousepad-my/mousepad/mousepad-document.c
--- mousepad-git/mousepad/mousepad-document.c 2009-07-11 01:11:44.000000000 +0200
+++ mousepad-my/mousepad/mousepad-document.c 2009-07-12 00:12:04.000000000 +0200
@@ -97,6 +97,7 @@
/* settings */
guint word_wrap : 1;
+ guint statusbar : 1;
};
@@ -166,7 +167,7 @@
mousepad_document_init (MousepadDocument *document)
{
GtkTargetList *target_list;
- gboolean word_wrap, auto_indent, line_numbers, insert_spaces;
+ gboolean word_wrap, auto_indent, line_numbers, insert_spaces, view_statusbar;
gchar *font_name;
gint tab_size;
MousepadPreferences *preferences;
@@ -178,6 +179,7 @@
document->priv->utf8_filename = NULL;
document->priv->utf8_basename = NULL;
document->priv->label = NULL;
+ document->priv->statusbar = 0;
/* setup the scolled window */
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (document), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@@ -220,6 +222,7 @@
"view-font-name", &font_name,
"view-tab-size", &tab_size,
"view-insert-spaces", &insert_spaces,
+ "view-statusbar-visible", &view_statusbar,
NULL);
/* release the preferences */
@@ -228,11 +231,12 @@
/* set all the settings */
mousepad_document_set_word_wrap (document, word_wrap);
mousepad_document_set_font (document, font_name);
+ mousepad_document_set_statusbar(document,view_statusbar);
mousepad_view_set_line_numbers (document->textview, line_numbers);
mousepad_view_set_auto_indent (document->textview, auto_indent);
mousepad_view_set_tab_size (document->textview, tab_size);
mousepad_view_set_insert_spaces (document->textview, insert_spaces);
-
+
/* cleanup */
g_free (font_name);
@@ -452,6 +456,21 @@
void
+mousepad_document_set_statusbar (MousepadDocument *document,
+ gboolean statusbar)
+{
+ mousepad_return_if_fail (MOUSEPAD_IS_DOCUMENT (document));
+
+ /* store the setting */
+ document->priv->statusbar = statusbar;
+
+ /* hint_ we do not apply the setting here. We only apply the setting
+ when the document is actually activated */
+}
+
+
+
+void
mousepad_document_set_word_wrap (MousepadDocument *document,
gboolean word_wrap)
{
@@ -466,7 +485,6 @@
}
-
void
mousepad_document_set_font (MousepadDocument *document,
const gchar *font_name)
@@ -604,6 +622,14 @@
}
+gboolean
+mousepad_document_get_statusbar (MousepadDocument *document)
+{
+ mousepad_return_val_if_fail (MOUSEPAD_IS_DOCUMENT (document), FALSE);
+
+ return document->priv->statusbar;
+}
+
gboolean
mousepad_document_get_word_wrap (MousepadDocument *document)
diff -u mousepad-git/mousepad/mousepad-document.h mousepad-my/mousepad/mousepad-document.h
--- mousepad-git/mousepad/mousepad-document.h 2009-07-11 01:11:44.000000000 +0200
+++ mousepad-my/mousepad/mousepad-document.h 2009-07-11 23:13:37.000000000 +0200
@@ -74,6 +74,9 @@
void mousepad_document_set_word_wrap (MousepadDocument *document,
gboolean word_wrap);
+void mousepad_document_set_statusbar (MousepadDocument *document,
+ gboolean statusbar);
+
void mousepad_document_focus_textview (MousepadDocument *document);
void mousepad_document_send_signals (MousepadDocument *document);
@@ -86,6 +89,8 @@
gboolean mousepad_document_get_word_wrap (MousepadDocument *document);
+gboolean mousepad_document_get_statusbar (MousepadDocument *document);
+
G_END_DECLS
#endif /* !__MOUSEPAD_DOCUMENT_H__ */
Binärdateien mousepad-git/mousepad/mousepad-mousepad-application.o and mousepad-my/mousepad/mousepad-mousepad-application.o sind verschieden.
Binärdateien mousepad-git/mousepad/mousepad-mousepad-document.o and mousepad-my/mousepad/mousepad-mousepad-document.o sind verschieden.
Binärdateien mousepad-git/mousepad/mousepad-mousepad-encoding-dialog.o and mousepad-my/mousepad/mousepad-mousepad-encoding-dialog.o sind verschieden.
Binärdateien mousepad-git/mousepad/mousepad-mousepad-preferences.o and mousepad-my/mousepad/mousepad-mousepad-preferences.o sind verschieden.
Binärdateien mousepad-git/mousepad/mousepad-mousepad-print.o and mousepad-my/mousepad/mousepad-mousepad-print.o sind verschieden.
Binärdateien mousepad-git/mousepad/mousepad-mousepad-replace-dialog.o and mousepad-my/mousepad/mousepad-mousepad-replace-dialog.o sind verschieden.
Binärdateien mousepad-git/mousepad/mousepad-mousepad-search-bar.o and mousepad-my/mousepad/mousepad-mousepad-search-bar.o sind verschieden.
Binärdateien mousepad-git/mousepad/mousepad-mousepad-statusbar.o and mousepad-my/mousepad/mousepad-mousepad-statusbar.o sind verschieden.
Binärdateien mousepad-git/mousepad/mousepad-mousepad-window.o and mousepad-my/mousepad/mousepad-mousepad-window.o sind verschieden.
diff -u mousepad-git/mousepad/mousepad-preferences.c mousepad-my/mousepad/mousepad-preferences.c
--- mousepad-git/mousepad/mousepad-preferences.c 2009-07-11 01:11:44.000000000 +0200
+++ mousepad-my/mousepad/mousepad-preferences.c 2009-07-12 00:15:13.000000000 +0200
@@ -216,6 +216,14 @@
MOUSEPAD_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_WINDOW_STATUSBAR_VISIBLE,
+ g_param_spec_boolean ("view-statusbar-visible",
+ "ViewStatusbarVisible",
+ NULL,
+ TRUE,
+ MOUSEPAD_PARAM_READWRITE));
+
/**
* Window Preferences
**/
@@ -235,15 +243,6 @@
1, G_MAXINT, 640,
MOUSEPAD_PARAM_READWRITE));
- g_object_class_install_property (gobject_class,
- PROP_WINDOW_STATUSBAR_VISIBLE,
- g_param_spec_boolean ("window-statusbar-visible",
- "WindowStatusbarVisible",
- NULL,
- TRUE,
- MOUSEPAD_PARAM_READWRITE));
-
-
/**
* Hidden Preferences
**/
diff -u mousepad-git/mousepad/mousepad-window.c mousepad-my/mousepad/mousepad-window.c
--- mousepad-git/mousepad/mousepad-window.c 2009-07-11 01:11:44.000000000 +0200
+++ mousepad-my/mousepad/mousepad-window.c 2009-07-12 00:50:27.000000000 +0200
@@ -99,6 +99,9 @@
MousepadDocument *document);
static void mousepad_window_set_title (MousepadWindow *window);
+static void mousepad_window_show_statusbar (MousepadWindow *window,
+ gboolean show_statusbar);
+
/* notebook signals */
static void mousepad_window_notebook_switch_page (GtkNotebook *notebook,
GtkNotebookPage *page,
@@ -534,10 +537,8 @@
GtkWidget *separator;
GtkWidget *ebox;
GtkWidget *item;
- GtkAction *action;
gint width, height;
- gboolean statusbar_visible;
-
+
/* initialize stuff */
window->save_geometry_timer_id = 0;
window->update_recent_menu_id = 0;
@@ -576,7 +577,6 @@
g_object_get (G_OBJECT (window->preferences),
"window-width", &width,
"window-height", &height,
- "window-statusbar-visible", &statusbar_visible,
NULL);
/* set the default window size */
@@ -678,11 +678,7 @@
gtk_box_pack_start (GTK_BOX (window->box), window->notebook, TRUE, TRUE, PADDING);
gtk_widget_show (window->notebook);
- /* check if we should display the statusbar by default */
- action = gtk_action_group_get_action (window->action_group, "statusbar");
- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), statusbar_visible);
-
- /* allow drops in the window */
+ /* allow drops in the window */
gtk_drag_dest_set (GTK_WIDGET (window), GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, drop_targets, G_N_ELEMENTS (drop_targets), GDK_ACTION_COPY | GDK_ACTION_MOVE);
g_signal_connect (G_OBJECT (window), "drag-data-received", G_CALLBACK (mousepad_window_drag_data_received), window);
@@ -1282,6 +1278,44 @@
g_free (string);
}
+/**
+ * shows or hides the main window status bar
+ **/
+static void
+mousepad_window_show_statusbar (MousepadWindow *window,
+ gboolean show_statusbar)
+{
+
+ /* check if we should drop the statusbar */
+ if (!show_statusbar && window->statusbar != NULL)
+ {
+ /* destroy the statusbar */
+ gtk_widget_destroy (window->statusbar);
+ window->statusbar = NULL;
+ }
+ else if (show_statusbar && window->statusbar == NULL)
+ {
+ /* setup a new statusbar */
+ window->statusbar = mousepad_statusbar_new ();
+ gtk_box_pack_end (GTK_BOX (window->box), window->statusbar, FALSE, FALSE, 0);
+ gtk_widget_show (window->statusbar);
+
+ /* overwrite toggle signal */
+ g_signal_connect_swapped (G_OBJECT (window->statusbar), "enable-overwrite",
+ G_CALLBACK (mousepad_window_action_statusbar_overwrite), window);
+
+ /* update the statusbar items */
+ if (window->active)
+ {
+ /* debug check */
+ mousepad_return_if_fail (MOUSEPAD_IS_DOCUMENT (window->active));
+
+ /* ask document to resend the cursor status signals */
+ mousepad_document_send_signals (window->active);
+ }
+ }
+
+}
/**
@@ -1294,7 +1328,8 @@
MousepadWindow *window)
{
MousepadDocument *document;
-
+ gboolean show_statusbar;
+
mousepad_return_if_fail (MOUSEPAD_IS_WINDOW (window));
mousepad_return_if_fail (GTK_IS_NOTEBOOK (notebook));
@@ -1313,6 +1348,10 @@
/* update the menu actions */
mousepad_window_update_actions (window);
+ /* show the status bar if needed */
+ show_statusbar = mousepad_document_get_statusbar(window->active);
+ mousepad_window_show_statusbar(window,show_statusbar);
+
/* update the statusbar */
mousepad_document_send_signals (window->active);
}
@@ -1907,7 +1946,7 @@
/* add the action to the go menu */
gtk_ui_manager_add_ui (window->ui_manager, merge_id,
- "/main-menu/document-menu/tab-size-menu/placeholder-tab-items",
+ "/main-menu/view-menu/tab-size-menu/placeholder-tab-items",
name, name, GTK_UI_MANAGER_MENUITEM, FALSE);
/* cleanup */
@@ -1928,7 +1967,7 @@
/* add the action to the go menu */
gtk_ui_manager_add_ui (window->ui_manager, merge_id,
- "/main-menu/document-menu/tab-size-menu/placeholder-tab-items",
+ "/main-menu/view-menu/tab-size-menu/placeholder-tab-items",
"tab-size-other", "tab-size-other", GTK_UI_MANAGER_MENUITEM, FALSE);
/* unlock */
@@ -2111,6 +2150,10 @@
action = gtk_action_group_get_action (window->action_group, "auto-indent");
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), active);
+ active = mousepad_document_get_statusbar(document);
+ action = gtk_action_group_get_action (window->action_group, "statusbar");
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), active);
+
/* update the tabs size menu */
mousepad_window_menu_tab_sizes_update (window);
@@ -4117,37 +4160,14 @@
/* whether we show the statusbar */
show_statusbar = gtk_toggle_action_get_active (action);
- /* check if we should drop the statusbar */
- if (!show_statusbar && window->statusbar != NULL)
- {
- /* destroy the statusbar */
- gtk_widget_destroy (window->statusbar);
- window->statusbar = NULL;
- }
- else if (show_statusbar && window->statusbar == NULL)
- {
- /* setup a new statusbar */
- window->statusbar = mousepad_statusbar_new ();
- gtk_box_pack_end (GTK_BOX (window->box), window->statusbar, FALSE, FALSE, 0);
- gtk_widget_show (window->statusbar);
-
- /* overwrite toggle signal */
- g_signal_connect_swapped (G_OBJECT (window->statusbar), "enable-overwrite",
- G_CALLBACK (mousepad_window_action_statusbar_overwrite), window);
-
- /* update the statusbar items */
- if (window->active)
- {
- /* debug check */
- mousepad_return_if_fail (MOUSEPAD_IS_DOCUMENT (window->active));
-
- /* ask document to resend the cursor status signals */
- mousepad_document_send_signals (window->active);
- }
- }
+ /* now show or hide statusbar */
+ mousepad_window_show_statusbar(window,show_statusbar);
- /* remember the setting */
- g_object_set (G_OBJECT (window->preferences), "window-statusbar-visible", show_statusbar, NULL);
+ /* remember the setting for this tab */
+ mousepad_document_set_statusbar(window->active,show_statusbar);
+
+ /* remember the setting for every new tab*/
+ g_object_set (G_OBJECT (window->preferences), "view-statusbar-visible", show_statusbar, NULL);
}
diff -u mousepad-git/mousepad/mousepad-window-ui.h mousepad-my/mousepad/mousepad-window-ui.h
--- mousepad-git/mousepad/mousepad-window-ui.h 2009-07-11 01:21:37.000000000 +0200
+++ mousepad-my/mousepad/mousepad-window-ui.h 2009-07-12 00:27:11.000000000 +0200
@@ -25,35 +25,35 @@
"separator />