...
 
Commits (62)
guidelines for gedit Source code repository
==================== ======================
gedit source code is maintained using the git version control system gedit source code is maintained using the git version control system
and is available at the following location: and is available at the following location:
...@@ -14,6 +14,28 @@ A Web Interface is available at: ...@@ -14,6 +14,28 @@ A Web Interface is available at:
http://git.gnome.org/cgit/gedit http://git.gnome.org/cgit/gedit
Building from git
=================
When building from a git checkout you will need to run the
autogen.sh script which takes care of running automake, autoconf,
etc and then run "configure" for you. You can pass options like
--prefix to autogen.sh and they will be forwarded to the configure
script.
Note that you cannot run gedit from its build directory: you need
to install it with "make install". For this reason it is highly
recommended that you install in a separate prefix instead of
overwriting your system binaries. Note however that when running
gedit from a custom prefix you will need to set many environment
variables accordingly, for instance PATH and XDG_DATA_DIR.
The JHBuild tool can take care of all this for you.
Commit guidelines
=================
Please don't commit directly to the git repository unless Please don't commit directly to the git repository unless
you have been given the green light to commit freely to gedit. you have been given the green light to commit freely to gedit.
When in doubt assume you haven't ;-). When in doubt assume you haven't ;-).
......
===========
gedit 3.2.6
===========
New Features and Fixes
======================
- Avoid crash with GTK+-3.3.* (Paolo Borelli)
- External Tools plugin bugfixes (Ignacio Casal Quintero)
- Misc bugfixes
===========
gedit 3.2.5
===========
New Features and Fixes
======================
- Misc bugfixes
===========
gedit 3.2.4
===========
New Features and Fixes
======================
- Misc bugfixes
===========
gedit 3.2.3
===========
New Features and Fixes
======================
- Fix crash when dropping file in gedit with snippets plugin active (Paolo Borelli)
- Misc bugfixes
New and updated translations
============================
- de (Mario Blättermann)
- my (phonemyintkhaing)
=========== ===========
gedit 3.2.2 gedit 3.2.2
=========== ===========
......
General Information General Information
=================== ===================
This is version 3.2.2 of gedit. gedit is a small and lightweight UTF-8 text This is version 3.2.6 of gedit. gedit is a small and lightweight UTF-8 text
editor for the GNOME environment. editor for the GNOME environment.
gedit is part of GNOME and uses the latest GTK+ and GNOME libraries. gedit is part of GNOME and uses the latest GTK+ and GNOME libraries.
......
...@@ -4,7 +4,7 @@ AC_PREREQ(2.63.2) ...@@ -4,7 +4,7 @@ AC_PREREQ(2.63.2)
m4_define(gedit_major_version, 3) m4_define(gedit_major_version, 3)
m4_define(gedit_minor_version, 2) m4_define(gedit_minor_version, 2)
m4_define(gedit_micro_version, 2) m4_define(gedit_micro_version, 6)
m4_define(gedit_version, gedit_major_version.gedit_minor_version.gedit_micro_version) m4_define(gedit_version, gedit_major_version.gedit_minor_version.gedit_micro_version)
AC_INIT([gedit],[gedit_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gedit],[gedit],[http://projects.gnome.org/gedit/]) AC_INIT([gedit],[gedit_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gedit],[gedit],[http://projects.gnome.org/gedit/])
...@@ -134,10 +134,10 @@ AC_SUBST(DEFAULT_PRINT_FONT) ...@@ -134,10 +134,10 @@ AC_SUBST(DEFAULT_PRINT_FONT)
if test "$os_osx" = "yes"; then if test "$os_osx" = "yes"; then
AC_DEFINE([OS_OSX],[1],[Defined if os is Mac OSX]) AC_DEFINE([OS_OSX],[1],[Defined if os is Mac OSX])
PKG_CHECK_MODULES(IGE_MAC, ige-mac-integration) PKG_CHECK_MODULES(GTK_MAC, gtk-mac-integration)
AC_SUBST(IGE_MAC_CFLAGS) AC_SUBST(GTK_MAC_CFLAGS)
AC_SUBST(IGE_MAC_LIBS) AC_SUBST(GTK_MAC_LIBS)
fi fi
dnl =============================================================== dnl ===============================================================
...@@ -174,7 +174,7 @@ dnl ================================================================ ...@@ -174,7 +174,7 @@ dnl ================================================================
dnl Use gvfs metadata or the old xml file store. dnl Use gvfs metadata or the old xml file store.
dnl ================================================================ dnl ================================================================
if test "x$os_osx" != "xno" || test "x$os_win32" != "xno"; then if test "x$os_win32" != "xno"; then
gvfs_metadata_default="no" gvfs_metadata_default="no"
else else
gvfs_metadata_default="yes" gvfs_metadata_default="yes"
......
...@@ -26,16 +26,28 @@ gsettings_SCHEMAS = org.gnome.gedit.gschema.xml ...@@ -26,16 +26,28 @@ gsettings_SCHEMAS = org.gnome.gedit.gschema.xml
@GSETTINGS_RULES@ @GSETTINGS_RULES@
if OS_OSX
gsettingsschema_DATA = gedit-osx.gschema.override
endif
convertdir = $(datadir)/GConf/gsettings convertdir = $(datadir)/GConf/gsettings
convert_DATA = gedit.convert convert_DATA = gedit.convert
if OS_OSX
geditdatadir = $(datadir)/gedit
geditdata_DATA = osx.accels osx.css
endif
EXTRA_DIST = \ EXTRA_DIST = \
$(desktop_in_files) \ $(desktop_in_files) \
$(service_in_files) \ $(service_in_files) \
$(man_MANS) \ $(man_MANS) \
gedit.pc.in \ gedit.pc.in \
org.gnome.gedit.gschema.xml.in.in \ org.gnome.gedit.gschema.xml.in.in \
gedit.convert gedit.convert \
osx.accels \
osx.css \
gedit-osx.gschema.override
CLEANFILES = \ CLEANFILES = \
$(desktop_DATA) \ $(desktop_DATA) \
......
[org.gnome.desktop.interface]
monospace-font-name = 'Monaco 12'
[org.gnome.gedit.preferences.editor]
editor-font = 'Monaco 12'
\ No newline at end of file
(gtk_accel_path "<Actions>/GeditWindowActions/EditCut" "<primary>x")
(gtk_accel_path "<Actions>/GeditWindowActions/DocumentsNextDocument" "<primary><alt>page_down")
(gtk_accel_path "<Actions>/GeditBookmarksPluginActions/ToggleBookmark" "<primary><alt>b")
(gtk_accel_path "<Actions>/GeditWindowActions/SearchFindPrevious" "<shift><primary>g")
(gtk_accel_path "<Actions>/GeditWindowPanelsActions/ViewSidePanel" "F9")
(gtk_accel_path "<Actions>/GeditWindowActions/DocumentsPreviousTabGroup" "<shift><primary><alt>page_up")
(gtk_accel_path "<Actions>/GeditWindowActions/FilePrint" "<primary>p")
(gtk_accel_path "<Actions>/GeditCommanderPluginActions/CommanderModeAction" "<primary>period")
(gtk_accel_path "<Actions>/GeditWindowAlwaysSensitiveActions/HelpContents" "f1")
(gtk_accel_path "<Actions>/GeditBookmarksPluginActions/NextBookmark" "<primary>b")
(gtk_accel_path "<Actions>/GeditWindowActions/EditRedo" "<shift><primary>z")
(gtk_accel_path "<Actions>/GeditTextSizePluginActions/IncreaseFontSizeAction" "<primary>plus")
(gtk_accel_path "<Actions>/FileBrowserWidgetBookmarkActionGroup/BookmarkOpen" "<primary>o")
(gtk_accel_path "<Actions>/GeditSpellPluginActions/CheckSpell" "<shift>f7")
(gtk_accel_path "<Actions>/GeditTextSizePluginActions/ResetFontSizeAction" "<primary>0")
(gtk_accel_path "<Actions>/GeditWindowActions/FileCloseAll" "<shift><primary>w")
(gtk_accel_path "<Actions>/GeditWindowActions/SearchFind" "<primary>f")
(gtk_accel_path "<Actions>/GeditWindowActions/FileSave" "<primary>s")
(gtk_accel_path "<Actions>/GeditQuitWindowActions/FileQuit" "<primary>q")
(gtk_accel_path "<Actions>/GeditWindowAlwaysSensitiveActions/FileOpen" "<primary>o")
(gtk_accel_path "<Actions>/GeditWindowActions/SearchGoToLine" "<primary>i")
(gtk_accel_path "<Actions>/GeditWindowActions/SearchReplace" "<primary><alt>f")
(gtk_accel_path "<Actions>/GeditBookmarksPluginActions/PreviousBookmark" "<shift><primary>b")
(gtk_accel_path "<Actions>/GeditWindowActions/FileSaveAs" "<shift><primary>s")
(gtk_accel_path "<Actions>/GeditWindowActions/SearchClearHighlight" "<shift><primary>k")
(gtk_accel_path "<Actions>/GeditWindowActions/FilePrintPreview" "<shift><primary>p")
(gtk_accel_path "<Actions>/GeditWindowActions/EditUndo" "<primary>z")
(gtk_accel_path "<Actions>/GeditTextSizePluginActions/DecreaseFontSizeAction" "<primary>minus")
(gtk_accel_path "<Actions>/GeditCloseWindowActions/FileClose" "<primary>w")
(gtk_accel_path "<Actions>/GeditWindowActions/EditPaste" "<primary>v")
(gtk_accel_path "<Actions>/GeditWindowActions/FileSaveAll" "<shift><primary>l")
(gtk_accel_path "<Actions>/FileBrowserWidgetSingleMostSelectionActionGroup/FileNew" "<primary>n")
(gtk_accel_path "<Actions>/FileBrowserWidgetSensitiveActionGroup/DirectoryOpen" "<primary>o")
(gtk_accel_path "<Actions>/GeditWindowActions/SearchFindNext" "<primary>g")
(gtk_accel_path "<Actions>/GeditWindowPanelsActions/ViewBottomPanel" "<primary>f9")
(gtk_accel_path "<Actions>/GeditWindowActions/DocumentsNextTabGroup" "<shift><primary><alt>page_down")
(gtk_accel_path "<Actions>/GeditWindowAlwaysSensitiveActions/ViewFullscreen" "f11")
(gtk_accel_path "<Actions>/GeditWindowActions/EditCopy" "<primary>c")
(gtk_accel_path "<Actions>/GeditWindowAlwaysSensitiveActions/FileNew" "<primary>n")
(gtk_accel_path "<Actions>/GeditWindowActions/DocumentsPreviousDocument" "<primary><alt>page_up")
(gtk_accel_path "<Actions>/GeditWindowActions/DocumentsNewTabGroup" "<primary><alt>n")
(gtk_accel_path "<Actions>/GeditWindowActions/EditSelectAll" "<primary>a")
(gtk_accel_path "<Actions>/FileBrowserWidgetFileSelectionActionGroup/FileOpen" "<primary>o")
(gtk_accel_path "<Actions>/GeditWindowAlwaysSensitiveActions/EditPreferences" "<primary>comma")
@binding-set gtk-osx-editable {
bind "<primary>c" { "copy-clipboard" () };
bind "<primary>x" { "cut-clipboard" () };
bind "<primary>v" { "paste-clipboard" () };
unbind "<control>c";
unbind "<control>x";
unbind "<control>v";
bind "<primary>Left" { "move-cursor" (display-line-ends, -1, 0) };
bind "<primary>KP_Left" { "move-cursor" (display-line-ends, -1, 0) };
bind "<primary><shift>Left" { "move-cursor" (display-line-ends, -1, 1) };
bind "<primary><shift>KP_Left" { "move-cursor" (display-line-ends, -1, 1) };
bind "<primary>Right" { "move-cursor" (display-line-ends, 1, 0) };
bind "<primary>KP_Right" { "move-cursor" (display-line-ends, 1, 0) };
bind "<primary><shift>Right" { "move-cursor" (display-line-ends, 1, 1) };
bind "<primary><shift>KP_Right" { "move-cursor" (display-line-ends, 1, 1) };
unbind "<control>Left";
unbind "<control>KP_Left";
unbind "<control><shift>Left";
unbind "<control><shift>KP_Left";
unbind "<control>Right";
unbind "<control>KP_Right";
unbind "<control><shift>Right";
unbind "<control><shift>KP_Right";
bind "<alt>Right" { "move-cursor" (words, 1, 0) };
bind "<alt>KP_Right" { "move-cursor" (words, 1, 0) };
bind "<alt>Left" { "move-cursor" (words, -1, 0) };
bind "<alt>KP_Left" { "move-cursor" (words, -1, 0) };
bind "<shift><alt>Right" { "move-cursor" (words, 1, 1) };
bind "<shift><alt>KP_Right" { "move-cursor" (words, 1, 1) };
bind "<shift><alt>Left" { "move-cursor" (words, -1, 1) };
bind "<shift><alt>KP_Left" { "move-cursor" (words, -1, 1) };
bind "<alt>delete" { "delete-from-cursor" (word-ends, 1) };
bind "<alt>KP_delete" { "delete-from-cursor" (word-ends, 1) };
bind "<alt>backspace" { "delete-from-cursor" (word-ends, -1) };
bind "<primary>Down" { "move-cursor" (buffer-ends, 1, 0) };
bind "<primary><shift>Down" { "move-cursor" (buffer-ends, 1, 1) };
bind "<primary>KP_Down" { "move-cursor" (buffer-ends, 1, 0) };
bind "<primary><shift>KP_Down" { "move-cursor" (buffer-ends, 1, 1) };
bind "<primary>Up" { "move-cursor" (buffer-ends, -1, 0) };
bind "<primary><shift>Up" { "move-cursor" (buffer-ends, -1, 1) };
bind "<primary>KP_Up" { "move-cursor" (buffer-ends, -1, 0) };
bind "<primary><shift>KP_Up" { "move-cursor" (buffer-ends, -1, 1) };
unbind "<control>Down";
unbind "<control>KP_Down";
unbind "<control><shift>Down";
unbind "<control><shift>KP_Down";
unbind "<control>Up";
unbind "<control>KP_Up";
unbind "<control><shift>Up";
unbind "<control><shift>KP_Up";
}
@binding-set gtk-osx-text-entry {
bind "<primary>a" {
"move-cursor" (buffer-ends, -1, 0)
"move-cursor" (buffer-ends, 1, 1)
};
unbind "<control>a";
}
@binding-set gtk-osx-text-view {
bind "<primary>a" { "select-all" (1) };
unbind "<control>a";
}
@binding-set gtk-osx-tree-view {
bind "<primary>s" { "start-interactive-search" () };
unbind "<control>s";
}
@binding-set gtk-osx-source-view {
bind "<primary>z" { "undo" () };
unbind "<control>z";
bind "<primary><shift>z" { "redo" () };
unbind "<control><shift>z";
}
@binding-set gedit-osx-view {
bind "<primary>d" { "delete-from-cursor" (GTK_DELETE_PARAGRAPHS, 1) };
unbind "<control>d";
}
GtkEntry {
gtk-key-bindings: gtk-osx-editable, gtk-osx-text-entry;
}
GtkTextView {
gtk-key-bindings: gtk-osx-editable, gtk-osx-text-view;
}
GtkSourceView {
gtk-key-bindings: gtk-osx-editable, gtk-osx-text-view, gtk-osx-source-view;
}
GeditView {
gtk-key-bindings: gtk-osx-editable, gtk-osx-text-view, gtk-osx-source-view, gedit-osx-view;
}
GtkTreeView {
gtk-key-bindings: gtk-osx-tree-view;
}
GtkNotebook
{
padding: 0;
}
GtkNotebook tab
{
padding: 4 2 2 2;
}
GtkWidget
{
font-family: "Lucida Grande";
}
GtkEntry
{
font-family: "Helvetica";
}
\ No newline at end of file
...@@ -12,7 +12,7 @@ INCLUDES = \ ...@@ -12,7 +12,7 @@ INCLUDES = \
-I$(srcdir) \ -I$(srcdir) \
-I$(srcdir)/smclient \ -I$(srcdir)/smclient \
$(GEDIT_CFLAGS) \ $(GEDIT_CFLAGS) \
$(IGE_MAC_CFLAGS) \ $(GTK_MAC_CFLAGS) \
$(WARN_CFLAGS) \ $(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) \
$(INTROSPECTION_CFLAGS) \ $(INTROSPECTION_CFLAGS) \
...@@ -26,7 +26,7 @@ gedit_LDADD = \ ...@@ -26,7 +26,7 @@ gedit_LDADD = \
libgedit.la \ libgedit.la \
libgedit-private.la \ libgedit-private.la \
$(GEDIT_LIBS) \ $(GEDIT_LIBS) \
$(IGE_MAC_LIBS) \ $(GTK_MAC_LIBS) \
$(EGG_SMCLIENT_LIBS) \ $(EGG_SMCLIENT_LIBS) \
$(INTROSPECTION_LIBS) $(INTROSPECTION_LIBS)
...@@ -44,23 +44,19 @@ libgedit_la_LIBADD = \ ...@@ -44,23 +44,19 @@ libgedit_la_LIBADD = \
theatrics/libtheatrics.la theatrics/libtheatrics.la
# GEDIT_LIBS must be the last to ensure correct order on some platforms # GEDIT_LIBS must be the last to ensure correct order on some platforms
libgedit_la_LIBADD += $(GEDIT_LIBS) libgedit_la_LIBADD += $(GEDIT_LIBS) $(GTK_MAC_LIBS)
# Mac OSX convenience library and ldflags # Mac OSX convenience library and ldflags
if OS_OSX if OS_OSX
gedit_LDFLAGS += -framework Carbon
noinst_LTLIBRARIES += libosx.la noinst_LTLIBRARIES += libosx.la
libosx_la_LDFLAGS = -framework Carbon -framework ApplicationServices -framework Cocoa libosx_la_LDFLAGS = -framework Cocoa
libosx_la_LIBADD = -lobjc libosx_la_LIBADD = -lobjc
libosx_la_CFLAGS = -xobjective-c libosx_la_CFLAGS = -xobjective-c
libosx_la_SOURCES = \ libosx_la_SOURCES = \
gedit-app-osx.c \ gedit-app-osx.c \
gedit-app-osx.h \ gedit-app-osx.h
gedit-osx-delegate.m \
gedit-osx-delegate.h
libgedit_la_LIBADD += libosx.la libgedit_la_LIBADD += libosx.la
endif endif
......
...@@ -486,21 +486,25 @@ style_scheme_changed (GtkWidget *treeview, ...@@ -486,21 +486,25 @@ style_scheme_changed (GtkWidget *treeview,
GeditPreferencesDialog *dlg) GeditPreferencesDialog *dlg)
{ {
GtkTreePath *path; GtkTreePath *path;
GtkTreeIter iter;
gchar *id;
gtk_tree_view_get_cursor (GTK_TREE_VIEW (dlg->priv->schemes_treeview), &path, NULL); gtk_tree_view_get_cursor (GTK_TREE_VIEW (dlg->priv->schemes_treeview), &path, NULL);
gtk_tree_model_get_iter (GTK_TREE_MODEL (dlg->priv->schemes_treeview_model), if (path != NULL)
&iter, path); {
gtk_tree_path_free (path); GtkTreeIter iter;
gtk_tree_model_get (GTK_TREE_MODEL (dlg->priv->schemes_treeview_model), gchar *id;
&iter, ID_COLUMN, &id, -1);
g_settings_set_string (dlg->priv->editor, GEDIT_SETTINGS_SCHEME, id); gtk_tree_model_get_iter (GTK_TREE_MODEL (dlg->priv->schemes_treeview_model),
&iter, path);
gtk_tree_path_free (path);
gtk_tree_model_get (GTK_TREE_MODEL (dlg->priv->schemes_treeview_model),
&iter, ID_COLUMN, &id, -1);
set_buttons_sensisitivity_according_to_scheme (dlg, id); g_settings_set_string (dlg->priv->editor, GEDIT_SETTINGS_SCHEME, id);
g_free (id); set_buttons_sensisitivity_according_to_scheme (dlg, id);
g_free (id);
}
} }
static const gchar * static const gchar *
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 3.0 -->
<object class="GtkDialog" id="dialog"> <object class="GtkDialog" id="dialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="title" translatable="yes">Replace</property> <property name="title" translatable="yes">Replace</property>
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<child> <child>
<object class="GtkButton" id="close_button"> <object class="GtkButton" id="close_button">
<property name="label">gtk-close</property> <property name="label">gtk-close</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
<child> <child>
<object class="GtkButton" id="replace_all_button"> <object class="GtkButton" id="replace_all_button">
<property name="label" translatable="yes">Replace All</property> <property name="label" translatable="yes">Replace All</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
...@@ -51,6 +53,7 @@ ...@@ -51,6 +53,7 @@
<child> <child>
<object class="GtkButton" id="replace_button"> <object class="GtkButton" id="replace_button">
<property name="label" translatable="yes">Replace</property> <property name="label" translatable="yes">Replace</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
...@@ -67,6 +70,7 @@ ...@@ -67,6 +70,7 @@
<child> <child>
<object class="GtkButton" id="find_next_button"> <object class="GtkButton" id="find_next_button">
<property name="label">gtk-find</property> <property name="label">gtk-find</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
...@@ -101,8 +105,6 @@ ...@@ -101,8 +105,6 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="row_spacing">12</property> <property name="row_spacing">12</property>
<property name="column_spacing">12</property> <property name="column_spacing">12</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<child> <child>
<object class="GtkLabel" id="search_label"> <object class="GtkLabel" id="search_label">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -155,6 +157,7 @@ ...@@ -155,6 +157,7 @@
<child> <child>
<object class="GtkCheckButton" id="match_case_checkbutton"> <object class="GtkCheckButton" id="match_case_checkbutton">
<property name="label" translatable="yes">_Match case</property> <property name="label" translatable="yes">_Match case</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
...@@ -172,6 +175,7 @@ ...@@ -172,6 +175,7 @@
<child> <child>
<object class="GtkCheckButton" id="entire_word_checkbutton"> <object class="GtkCheckButton" id="entire_word_checkbutton">
<property name="label" translatable="yes">Match _entire word only</property> <property name="label" translatable="yes">Match _entire word only</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
...@@ -189,6 +193,7 @@ ...@@ -189,6 +193,7 @@
<child> <child>
<object class="GtkCheckButton" id="search_backwards_checkbutton"> <object class="GtkCheckButton" id="search_backwards_checkbutton">
<property name="label" translatable="yes">Search _backwards</property> <property name="label" translatable="yes">Search _backwards</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
...@@ -206,6 +211,7 @@ ...@@ -206,6 +211,7 @@
<child> <child>
<object class="GtkCheckButton" id="wrap_around_checkbutton"> <object class="GtkCheckButton" id="wrap_around_checkbutton">
<property name="label" translatable="yes">_Wrap around</property> <property name="label" translatable="yes">_Wrap around</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
......
...@@ -21,11 +21,15 @@ ...@@ -21,11 +21,15 @@
*/ */
#include "gedit-app-osx.h" #include "gedit-app-osx.h"
#include <gedit/gedit-dirs.h>
#include <gedit/gedit-debug.h>
#include <gdk/gdkquartz.h> #include <gdk/gdkquartz.h>
#include <Carbon/Carbon.h> #include <gtkosxapplication.h>
#include <string.h>
#include <glib/gi18n.h>
#import "gedit-osx-delegate.h" #include "gedit-commands.h"
#include <AvailabilityMacros.h>
G_DEFINE_TYPE (GeditAppOSX, gedit_app_osx, GEDIT_TYPE_APP) G_DEFINE_TYPE (GeditAppOSX, gedit_app_osx, GEDIT_TYPE_APP)
...@@ -36,7 +40,8 @@ gedit_app_osx_finalize (GObject *object) ...@@ -36,7 +40,8 @@ gedit_app_osx_finalize (GObject *object)
} }
static gboolean static gboolean
gedit_app_osx_last_window_destroyed_impl (GeditApp *app) gedit_app_osx_last_window_destroyed_impl (GeditApp *app,
GeditWindow *window)
{ {
if (!GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), "gedit-is-quitting-all"))) if (!GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), "gedit-is-quitting-all")))
{ {
...@@ -45,10 +50,10 @@ gedit_app_osx_last_window_destroyed_impl (GeditApp *app) ...@@ -45,10 +50,10 @@ gedit_app_osx_last_window_destroyed_impl (GeditApp *app)
return FALSE; return FALSE;
} }
return GEDIT_APP_CLASS (gedit_app_osx_parent_class)->last_window_destroyed (app); return GEDIT_APP_CLASS (gedit_app_osx_parent_class)->last_window_destroyed (app, window);
} }
static gboolean gboolean
gedit_app_osx_show_url (GeditAppOSX *app, gedit_app_osx_show_url (GeditAppOSX *app,
const gchar *url) const gchar *url)
{ {
...@@ -63,7 +68,7 @@ gedit_app_osx_show_help_impl (GeditApp *app, ...@@ -63,7 +68,7 @@ gedit_app_osx_show_help_impl (GeditApp *app,
{ {
gboolean ret = FALSE; gboolean ret = FALSE;
if (name == NULL || strcmp (name, "gedit.xml") == NULL || strcmp (name, "gedit") == 0) if (name == NULL || g_strcmp0 (name, "gedit.xml") == 0 || g_strcmp0 (name, "gedit") == 0)
{ {
gchar *link; gchar *link;
...@@ -77,7 +82,7 @@ gedit_app_osx_show_help_impl (GeditApp *app, ...@@ -77,7 +82,7 @@ gedit_app_osx_show_help_impl (GeditApp *app,
link = g_strdup ("http://library.gnome.org/users/gedit/stable/"); link = g_strdup ("http://library.gnome.org/users/gedit/stable/");
} }
ret = gedit_osx_show_url (link); ret = gedit_app_osx_show_url (GEDIT_APP_OSX (app), link);
g_free (link); g_free (link);
} }
...@@ -91,16 +96,19 @@ gedit_app_osx_set_window_title_impl (GeditApp *app, ...@@ -91,16 +96,19 @@ gedit_app_osx_set_window_title_impl (GeditApp *app,
{ {
NSWindow *native; NSWindow *native;
GeditDocument *document; GeditDocument *document;
GdkWindow *wnd;
g_return_if_fail (GEDIT_IS_WINDOW (window)); g_return_if_fail (GEDIT_IS_WINDOW (window));
if (GTK_WIDGET (window)->window == NULL) wnd = gtk_widget_get_window (GTK_WIDGET (window));
if (wnd == NULL)
{ {
return; return;
} }
native = gdk_quartz_window_get_nswindow (GTK_WIDGET (window)->window); native = gdk_quartz_window_get_nswindow (wnd);
document = gedit_app_get_active_document (app); document = gedit_window_get_active_document (window);
if (document) if (document)
{ {
...@@ -108,14 +116,36 @@ gedit_app_osx_set_window_title_impl (GeditApp *app, ...@@ -108,14 +116,36 @@ gedit_app_osx_set_window_title_impl (GeditApp *app,
if (gedit_document_is_untitled (document)) if (gedit_document_is_untitled (document))
{ {
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
[native setRepresentedURL:nil]; [native setRepresentedURL:nil];
#else
[native setRepresentedFilename:@""];
#endif
} }
else else
{ {
const gchar *uri = gedit_document_get_uri (document); GFile *location;
gchar *uri;
location = gedit_document_get_location (document);
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
uri = g_file_get_uri (location);
g_object_unref (location);
NSURL *nsurl = [NSURL URLWithString:[NSString stringWithUTF8String:uri]]; NSURL *nsurl = [NSURL URLWithString:[NSString stringWithUTF8String:uri]];
[native setRepresentedURL:nsurl]; [native setRepresentedURL:nsurl];
g_free (uri);
#else
if (g_file_has_uri_scheme (location, "file"))
{
uri = g_file_get_path (location);
[native setRepresentedFilename:[NSString stringWithUTF8String:uri]];
g_free (uri);
}
#endif
} }
ismodified = !gedit_document_is_untouched (document); ismodified = !gedit_document_is_untouched (document);
...@@ -123,11 +153,198 @@ gedit_app_osx_set_window_title_impl (GeditApp *app, ...@@ -123,11 +153,198 @@ gedit_app_osx_set_window_title_impl (GeditApp *app,
} }
else else
{ {
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
[native setRepresentedURL:nil]; [native setRepresentedURL:nil];
#else
[native setRepresentedFilename:@""];
#endif
[native setDocumentEdited:false]; [native setDocumentEdited:false];
} }
GEDIT_APP (gedit_app_osx_parent_class)->set_window_title (app, window, title); GEDIT_APP_CLASS (gedit_app_osx_parent_class)->set_window_title (app, window, title);
}
static void
gedit_app_osx_quit_impl (GeditApp *app)
{
GtkOSXApplication *osxapp;
osxapp = g_object_new (GTK_TYPE_OSX_APPLICATION, NULL);
gtk_osxapplication_cleanup (osxapp);
GEDIT_APP_CLASS (gedit_app_osx_parent_class)->quit (app);
}
static void
load_accels (void)
{
gchar *filename;
filename = g_build_filename (gedit_dirs_get_gedit_data_dir (),
"osx.accels",
NULL);
if (filename != NULL)
{
gedit_debug_message (DEBUG_APP, "Loading accels from %s\n", filename);
gtk_accel_map_load (filename);
g_free (filename);
}
}
static void
load_keybindings (void)
{
gchar *filename;
filename = g_build_filename (gedit_dirs_get_gedit_data_dir (),
"osx.css",
NULL);
if (filename != NULL)
{
GtkCssProvider *provider;
GError *error = NULL;
gedit_debug_message (DEBUG_APP, "Loading keybindings from %s\n", filename);
provider = gtk_css_provider_new ();
if (!gtk_css_provider_load_from_path (provider,
filename,
&error))
{
g_warning ("Failed to load osx keybindings from `%s':\n%s",
filename,
error->message);
g_error_free (error);
}
else
{
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_SETTINGS);
}
g_object_unref (provider);
g_free (filename);
}
}
static void
gedit_app_osx_constructed (GObject *object)
{
/* First load the osx specific accel overrides */
load_accels ();
load_keybindings ();
if (G_OBJECT_CLASS (gedit_app_osx_parent_class)->constructed)
{
/* Then chain up to load the user specific accels */
G_OBJECT_CLASS (gedit_app_osx_parent_class)->constructed (object);
}
}
static GtkMenuItem *
ui_manager_menu_item (GtkUIManager *uimanager,
const gchar *path)
{
return GTK_MENU_ITEM (gtk_ui_manager_get_widget (uimanager, path));
}
static void
setup_mac_menu (GeditWindow *window)
{
GtkAction *action;
GtkOSXApplication *osxapp;
GtkUIManager *manager;
GtkWidget *menu;
manager = gedit_window_get_ui_manager (window);
/* Hide the menu bar */
menu = gtk_ui_manager_get_widget (manager, "/MenuBar");
gtk_widget_hide (menu);
osxapp = g_object_new (GTK_TYPE_OSX_APPLICATION, NULL);
action = gtk_ui_manager_get_action (manager, "/ui/MenuBar/HelpMenu/HelpAboutMenu");
gtk_action_set_label (action, _("About gedit"));
gtk_widget_hide (GTK_WIDGET (ui_manager_menu_item (manager,
"/ui/MenuBar/FileMenu/FileQuitMenu")));
gtk_osxapplication_set_menu_bar (osxapp,
GTK_MENU_SHELL (menu));
gtk_osxapplication_set_help_menu (osxapp,
ui_manager_menu_item (manager,
"/ui/MenuBar/HelpMenu"));
gtk_osxapplication_set_window_menu (osxapp, NULL);
gtk_osxapplication_insert_app_menu_item (osxapp,
GTK_WIDGET (ui_manager_menu_item (manager,
"/ui/MenuBar/HelpMenu/HelpAboutMenu")),
0);
gtk_osxapplication_insert_app_menu_item (osxapp,
g_object_ref (gtk_separator_menu_item_new ()),
1);
gtk_osxapplication_insert_app_menu_item (osxapp,
GTK_WIDGET (ui_manager_menu_item (manager,
"/ui/MenuBar/EditMenu/EditPreferencesMenu")),
2);
/* We remove the accel group of the uimanager from the window */
gtk_window_remove_accel_group (GTK_WINDOW (window),
gtk_ui_manager_get_accel_group (manager));
}
static GeditWindow *
gedit_app_osx_create_window_impl (GeditApp *app)
{
GeditWindow *window;
window = GEDIT_APP_CLASS (gedit_app_osx_parent_class)->create_window (app);
setup_mac_menu (window);
return window;
}
static gboolean
gedit_app_osx_process_window_event_impl (GeditApp *app,
GeditWindow *window,
GdkEvent *event)
{
NSEvent *nsevent;
/* For OS X we will propagate the event to NSApp, which handles some OS X
* specific keybindings and the accelerators for the menu
*/
nsevent = gdk_quartz_event_get_nsevent (event);
[NSApp sendEvent:nsevent];
/* It does not really matter what we return here since it's the last thing
* in the chain. Also we can't get from sendEvent whether the event was
* actually handled by NSApp anyway
*/
return TRUE;
}
static void
gedit_app_osx_ready_impl (GeditApp *app)
{
GtkOSXApplication *osxapp;
osxapp = g_object_new (GTK_TYPE_OSX_APPLICATION, NULL);
gtk_osxapplication_ready (osxapp);
GEDIT_APP_CLASS (gedit_app_osx_parent_class)->ready (app);
} }
static void static void
...@@ -137,32 +354,107 @@ gedit_app_osx_class_init (GeditAppOSXClass *klass) ...@@ -137,32 +354,107 @@ gedit_app_osx_class_init (GeditAppOSXClass *klass)
GeditAppClass *app_class = GEDIT_APP_CLASS (klass); GeditAppClass *app_class = GEDIT_APP_CLASS (klass);
object_class->finalize = gedit_app_osx_finalize; object_class->finalize = gedit_app_osx_finalize;
object_class->constructed = gedit_app_osx_constructed;
app_class->last_window_destroyed = gedit_app_osx_last_window_destroyed_impl; app_class->last_window_destroyed = gedit_app_osx_last_window_destroyed_impl;
app_class->show_help = gedit_app_show_help_impl; app_class->show_help = gedit_app_osx_show_help_impl;
app_class->set_window_title = gedit_app_osx_set_window_title_impl;
app_class->quit = gedit_app_osx_quit_impl;
app_class->create_window = gedit_app_osx_create_window_impl;
app_class->process_window_event = gedit_app_osx_process_window_event_impl;
app_class->ready = gedit_app_osx_ready_impl;
} }
static void static void
destroy_delegate (GeditOSXDelegate *delegate) on_osx_will_terminate (GtkOSXApplication *osxapp,
GeditAppOSX *app)
{ {
[delegate dealloc]; _gedit_app_quit (GEDIT_APP (app));
} }
static void static gboolean
gedit_app_osx_init (GeditAppOSX *self) on_osx_block_termination (GtkOSXApplication *osxapp,
GeditAppOSX *app)
{ {
GeditOSXDelegate *delegate = [[GeditOSXDelegate alloc] init]; GtkUIManager *manager;
GtkAction *action;
GeditWindow *window;
window = gedit_app_get_active_window (GEDIT_APP (app));
// Synthesize quit-all
manager = gedit_window_get_ui_manager (window);
action = gtk_ui_manager_get_action (manager,
"/ui/MenuBar/FileMenu/FileQuitMenu");
_gedit_cmd_file_quit (action, window);
return TRUE;
}
static gboolean
on_osx_open_files (GtkOSXApplication *osxapp,
gchar const **paths,
GeditAppOSX *app)
{
GSList *locations = NULL;
while (paths && *paths)
{
locations = g_slist_prepend (locations,
g_file_new_for_path (*paths));
++paths;
}
locations = g_slist_reverse (locations);
if (locations != NULL)
{
GSList *files;
GeditWindow *window;
window = gedit_app_get_active_window (GEDIT_APP (app));
g_object_set_data_full (G_OBJECT (app), files = gedit_commands_load_locations (window,
"GeditOSXDelegate", locations,
delegate, NULL,
(GDestroyNotify)destroy_delegate); 0,
0);
ige_mac_menu_set_global_key_handler_enabled (FALSE); g_slist_free_full (locations, g_object_unref);
}
return TRUE;
}
static void
gedit_app_osx_init (GeditAppOSX *app)
{
GtkOSXApplication *osxapp;
/* This is a singleton */
osxapp = g_object_new (GTK_TYPE_OSX_APPLICATION, NULL);
/* manually set name and icon */ /* manually set name and icon */
g_set_application_name ("gedit"); g_set_application_name ("gedit");
gtk_window_set_default_icon_name ("accessories-text-editor"); gtk_window_set_default_icon_name ("accessories-text-editor");
g_signal_connect (osxapp,
"NSApplicationWillTerminate",
G_CALLBACK (on_osx_will_terminate),
app);
g_signal_connect (osxapp,
"NSApplicationBlockTermination",
G_CALLBACK (on_osx_block_termination),
app);
g_signal_connect (osxapp,
"NSApplicationOpenFiles",
G_CALLBACK (on_osx_open_files),
app);
gtk_osxapplication_set_use_quartz_accelerators (osxapp, FALSE);
} }
/* ex:set ts=8 noet: */ /* ex:set ts=8 noet: */
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#define __GEDIT_APP_OSX_H__ #define __GEDIT_APP_OSX_H__
#include "gedit-app.h" #include "gedit-app.h"
#include <ige-mac-integration.h>
G_BEGIN_DECLS G_BEGIN_DECLS
...@@ -51,14 +50,14 @@ struct _GeditAppOSXClass ...@@ -51,14 +50,14 @@ struct _GeditAppOSXClass
}; };
GType gedit_app_osx_get_type (void) G_GNUC_CONST; GType gedit_app_osx_get_type (void) G_GNUC_CONST;
void gedit_app_osx_set_window_title (GeditAppOSX *app, void gedit_app_osx_set_window_title (GeditAppOSX *app,
GeditWindow *window, GeditWindow *window,
const gchar *title, const gchar *title,
GeditDocument *document); GeditDocument *document);
gboolean gedit_app_osx_show_url (GeditAppOSX *app,
const gchar *url); gboolean gedit_app_osx_show_url (GeditAppOSX *app,
gboolean gedit_app_osx_show_help (GeditAppOSX *app, const gchar *url);
const gchar *link_id);
G_END_DECLS G_END_DECLS
......
...@@ -175,7 +175,8 @@ gedit_app_constructor (GType gtype, ...@@ -175,7 +175,8 @@ gedit_app_constructor (GType gtype,
} }
static gboolean static gboolean
gedit_app_last_window_destroyed_impl (GeditApp *app) gedit_app_last_window_destroyed_impl (GeditApp *app,
GeditWindow *window)
{ {
return TRUE; return TRUE;
} }
...@@ -260,34 +261,6 @@ gedit_app_set_window_title_impl (GeditApp *app, ...@@ -260,34 +261,6 @@ gedit_app_set_window_title_impl (GeditApp *app,
gtk_window_set_title (GTK_WINDOW (window), title); gtk_window_set_title (GTK_WINDOW (window), title);
} }
static void
gedit_app_class_init (GeditAppClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gedit_app_finalize;
object_class->dispose = gedit_app_dispose;
object_class->get_property = gedit_app_get_property;
object_class->constructor = gedit_app_constructor;
klass->last_window_destroyed = gedit_app_last_window_destroyed_impl;
klass->show_help = gedit_app_show_help_impl;
klass->help_link_id = gedit_app_help_link_id_impl;
klass->set_window_title = gedit_app_set_window_title_impl;
g_object_class_install_property (object_class,
PROP_LOCKDOWN,
g_param_spec_flags ("lockdown",
"Lockdown",
"The lockdown mask",
GEDIT_TYPE_LOCKDOWN_MASK,
0,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_type_class_add_private (object_class, sizeof (GeditAppPrivate));
}
static gboolean static gboolean
ensure_user_config_dir (void) ensure_user_config_dir (void)
{ {
...@@ -312,22 +285,6 @@ ensure_user_config_dir (void) ...@@ -312,22 +285,6 @@ ensure_user_config_dir (void)
return ret; return ret;
} }
static void
load_accels (void)
{
gchar *filename;
filename = g_build_filename (gedit_dirs_get_user_config_dir (),
"accels",
NULL);
if (filename != NULL)
{
gedit_debug_message (DEBUG_APP, "Loading keybindings from %s\n", filename);
gtk_accel_map_load (filename);
g_free (filename);
}
}
static void static void
save_accels (void) save_accels (void)
{ {
...@@ -362,37 +319,6 @@ get_page_setup_file (void) ...@@ -362,37 +319,6 @@ get_page_setup_file (void)
return setup; return setup;
} }
static void
load_page_setup (GeditApp *app)
{
gchar *filename;
GError *error = NULL;
g_return_if_fail (app->priv->page_setup == NULL);
filename = get_page_setup_file ();
app->priv->page_setup = gtk_page_setup_new_from_file (filename,
&error);
if (error)
{
/* Ignore file not found error */
if (error->domain != G_FILE_ERROR ||
error->code != G_FILE_ERROR_NOENT)
{
g_warning ("%s", error->message);
}
g_error_free (error);
}
g_free (filename);
/* fall back to default settings */
if (app->priv->page_setup == NULL)
app->priv->page_setup = gtk_page_setup_new ();
}
static void static void
save_page_setup (GeditApp *app) save_page_setup (GeditApp *app)
{ {
...@@ -435,17 +361,239 @@ get_print_settings_file (void) ...@@ -435,17 +361,239 @@ get_print_settings_file (void)
} }
static void static void
load_print_settings (GeditApp *app) save_print_settings (GeditApp *app)
{ {
gchar *filename; gchar *filename;
GError *error = NULL; GError *error = NULL;
g_return_if_fail (app->priv->print_settings == NULL); if (app->priv->print_settings == NULL)
return;
filename = get_print_settings_file (); filename = get_print_settings_file ();
app->priv->print_settings = gtk_print_settings_new_from_file (filename, gtk_print_settings_to_file (app->priv->print_settings,
&error); filename,
&error);
if (error)
{
g_warning ("%s", error->message);
g_error_free (error);
}
g_free (filename);
}
static void
gedit_app_quit_impl (GeditApp *app)
{
gedit_debug_message (DEBUG_APP, "Quitting\n");
/* Last window is gone... save some settings and exit */
ensure_user_config_dir ();
save_accels ();
save_page_setup (app);
save_print_settings (app);
gtk_main_quit ();
}
static void
load_accels (void)
{
gchar *filename;
filename = g_build_filename (gedit_dirs_get_user_config_dir (),
"accels",
NULL);
if (filename != NULL)
{
gedit_debug_message (DEBUG_APP, "Loading keybindings from %s\n", filename);
gtk_accel_map_load (filename);
g_free (filename);
}
}
static void
gedit_app_constructed (GObject *object)
{
load_accels ();
}
static void
set_active_window (GeditApp *app,
GeditWindow *window)
{
app->priv->active_window = window;
}
static gboolean
window_focus_in_event (GeditWindow *window,
GdkEventFocus *event,
GeditApp *app)
{
/* updates active_view and active_child when a new toplevel receives focus */
g_return_val_if_fail (GEDIT_IS_WINDOW (window), FALSE);
set_active_window (app, window);
return FALSE;
}
static gboolean
window_delete_event (GeditWindow *window,
GdkEvent *event,
GeditApp *app)
{
GeditWindowState ws;
ws = gedit_window_get_state (window);
if (ws &
(GEDIT_WINDOW_STATE_SAVING |
GEDIT_WINDOW_STATE_PRINTING |
GEDIT_WINDOW_STATE_SAVING_SESSION))
{
return TRUE;
}
_gedit_cmd_file_quit (NULL, window);
/* Do not destroy the window */
return TRUE;
}
void
_gedit_app_quit (GeditApp *app)
{
GEDIT_APP_GET_CLASS (app)->quit (app);
}
static void
window_destroy (GeditWindow *window,
GeditApp *app)
{
app->priv->windows = g_list_remove (app->priv->windows,
window);
if (window == app->priv->active_window)
{
set_active_window (app, app->priv->windows != NULL ? app->priv->windows->data : NULL);
}
/* CHECK: I don't think we have to disconnect this function, since windows
is being destroyed */
/*
g_signal_handlers_disconnect_by_func (window,
G_CALLBACK (window_focus_in_event),
app);
g_signal_handlers_disconnect_by_func (window,
G_CALLBACK (window_destroy),
app);
*/
if (app->priv->windows == NULL)
{
if (!GEDIT_APP_GET_CLASS (app)->last_window_destroyed (app, window))
{
return;
}
_gedit_app_quit (app);
}
}
static GeditWindow *
gedit_app_create_window_impl (GeditApp *app)
{
GeditWindow *window;
gboolean isfirst;
/*
* We need to be careful here, there is a race condition:
* when another gedit is launched it checks active_window,
* so we must do our best to ensure that active_window
* is never NULL when at least a window exists.
*/
isfirst = (app->priv->windows == NULL);
window = g_object_new (GEDIT_TYPE_WINDOW, NULL);
if (isfirst)
{
set_active_window (app, window);
}
app->priv->windows = g_list_prepend (app->priv->windows,
window);
gedit_debug_message (DEBUG_APP, "Window created");
g_signal_connect (window,
"focus_in_event",
G_CALLBACK (window_focus_in_event),
app);
g_signal_connect (window,
"delete_event",
G_CALLBACK (window_delete_event),
app);
g_signal_connect (window,
"destroy",
G_CALLBACK (window_destroy),
app);
return window;
}
static void
gedit_app_ready_impl (GeditApp *app)
{
}
static void
gedit_app_class_init (GeditAppClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gedit_app_finalize;
object_class->dispose = gedit_app_dispose;
object_class->get_property = gedit_app_get_property;
object_class->constructor = gedit_app_constructor;
object_class->constructed = gedit_app_constructed;
klass->last_window_destroyed = gedit_app_last_window_destroyed_impl;
klass->show_help = gedit_app_show_help_impl;
klass->help_link_id = gedit_app_help_link_id_impl;
klass->set_window_title = gedit_app_set_window_title_impl;
klass->quit = gedit_app_quit_impl;
klass->create_window = gedit_app_create_window_impl;
klass->ready = gedit_app_ready_impl;
g_object_class_install_property (object_class,
PROP_LOCKDOWN,
g_param_spec_flags ("lockdown",
"Lockdown",
"The lockdown mask",
GEDIT_TYPE_LOCKDOWN_MASK,
0,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_type_class_add_private (object_class, sizeof (GeditAppPrivate));
}
static void
load_page_setup (GeditApp *app)
{
gchar *filename;
GError *error = NULL;
g_return_if_fail (app->priv->page_setup == NULL);
filename = get_page_setup_file ();
app->priv->page_setup = gtk_page_setup_new_from_file (filename,
&error);
if (error) if (error)
{ {
/* Ignore file not found error */ /* Ignore file not found error */
...@@ -461,31 +609,39 @@ load_print_settings (GeditApp *app) ...@@ -461,31 +609,39 @@ load_print_settings (GeditApp *app)
g_free (filename); g_free (filename);
/* fall back to default settings */ /* fall back to default settings */
if (app->priv->print_settings == NULL) if (app->priv->page_setup == NULL)
app->priv->print_settings = gtk_print_settings_new (); app->priv->page_setup = gtk_page_setup_new ();
} }
static void static void
save_print_settings (GeditApp *app)