277 Commits

Author SHA1 Message Date
Colomban Wendling
2559cda954 prefs: Remove some global state in keybinding-related code
Use gtk_dialog_run() to run the key input dialog, which is modal anyway.
This avoids having to pass the label and the iter around for the dialog
response callback to have them, as they now only are used directly in the
function setting them in the first place.
2014-08-10 15:47:18 +02:00
Colomban Wendling
852f326650 prefs: Pack keybinding-related globals together and avoid much direct access
This however doesn't get rid of any of the global data itself, it only pack it
in a struct and passes pointer to this struct around instead of accessing the
global whenever possible.
2014-08-10 15:46:44 +02:00
Matthew Brush
4efcbab332 Include what you use
This is a mega-commit - because most of it had to be done in one go
otherwise some commits would fail to compile - that attempts to fix a
few problems with Geany's includes as well as various other related
cleanups. After this change it's easier to use includes and there's
little worry about which order things are included in or who includes
what.

Overview of changes:

* Include config.h at the start of each source file if HAVE_CONFIG_H
  is defined (and never in headers).
* Go through each source file and make the includes section generally
  like this:
  - Always config.h first as above
  - Then if the file has a header with the same name, include that
  - Then include in alphabetical order each other internal/geany header.
  - Then include standard headers
  - Then include non-standard system headers
  - Then include GLib/GTK+ related stuff
* Doing as above makes it easier to find implicit header include
  dependencies and it exposed quite a few weird problems with includes
  or forward declarations, fix those.
* Make geany.h contain not much besides some defines.
  - Add a little header file "app.h" for GeanyApp and move it there
  - Move "app" global to new "app.h" file
  - Move "ignore_callback" global to "callbacks.h"
  - Move "geany_object" global to "geanyobject.h"
* Add an include in "geany.h" for "app.h" since GeanyApp used to be
  defined there and some plugins included this header to access
  GeanyApp.
* Include "gtkcompat.h" everywhere instead of gtk/gtk.h so that
  everywhere sees the same definitions (not a problem in practice AFAIK
  so this could be changed back if better that way.
* Remove forward declarations from previous commits as some people
  apparently consider this bad style, despite that it reduces inter-
  header dependencies.

TODO:
* As always, to test on win32
* As always, to test with not Autotools
* Test plugins better, both builtin and geany-plugins, likely API/ABI bump
* Test with various defines/flags that may change what is included
* win32.[ch] not really touched since I couldn't test
2014-05-21 15:37:19 -07:00
Matthew Brush
23d9cad7dc Start to make it easier to compile the core in isolation
This is for work on making the files scannable by GObject-Introspection
but is still useful otherwise (even fixes a FIXME in the comments). I
made this by using a simple GNU Make file and trying to compile the
sources each on their own without all the build system infrastructure.

* Add keybindingsprivate.h file to hold private GeanyKeyGroup structure
and remove it from the GEANY_PRIVATE guard in keybindings.h.
* Move private members that were guarded by GEANY_PRIVATE from
GeanyFiletypes to GeanyFiletypesPrivate and remove guarded build.h
include.
* Move private members that were guarded by GEANY_PRIVATE from
GeanyProject to GeanyProjectPrivate.
2014-05-21 12:17:59 -07:00
Colomban Wendling
8c5e198cf1 Unify encoding combo boxes
Make all encoding combo box display a list with encodings grouped by
categories into sub-menus, making it easier to find the appropriate
encoding than in a big single-level list.

This is what was used in the Open dialog, but not in the Preferences
dialog or the Find in Files dialog.  This also makes the encoding
combo boxes behave more like the encoding menus.
2014-04-15 15:51:49 +02:00
Colomban Wendling
7c6f48e4f5 Workaround a slowness in multi-column combo boxes under GTK3
Always set the combo boxes' wrap-width after their models are fully
filled to work around dramatic slowness described in GTK bug
https://bugzilla.gnome.org/show_bug.cgi?id=722388
2014-01-18 03:13:05 +01:00
Colomban Wendling
4aff511b01 Remove unnecessary allocation for VTE color settings 2013-12-05 20:16:54 +01:00
Colomban Wendling
8980970630 Unify color parsing
Change utils_parse_color() to use gdk_color_parse() and follow its
syntax, additionally supporting our "0x" prefix as a synonym for the
"#" prefix;  and use this everywhere.

Also add utils_color_to_bgr() and utils_parse_color_to_bgr() to provide
conversion to the 24 bits BGR format used by Scintilla.
2013-12-04 15:31:17 +01:00
Colomban Wendling
1590007862 Remove an unnecessary allocation 2013-12-04 14:59:05 +01:00
Colomban Wendling
8afff838c1 Improve scrolling to display a plugin's keybindings
When scrolling the keybinding list to display a particular row, which
is used to display a particular plugin's keybindings, consistently
scroll so the row is on the top left.  This makes it easier to see the
row in question since it's always at the same location, and it shows
more child keybindings.
2013-06-01 20:07:12 +02:00
Colomban Wendling
d3b88fb5b1 Fix a leak searching for the keybinding group row 2013-06-01 01:56:31 +02:00
Pavel Roschin
169a2f4957 Keybindings for plugins 2013-05-25 16:49:06 -07:00
Matthew Brush
adfc0985db Merge branch 'krofna/master' 2013-01-06 19:11:17 -08:00
Colomban Wendling
bd02c009a1 Use the Geany icon from the theme everywhere 2013-01-01 19:10:04 +01:00
Mislav Blažević
15fddad323 Implement terminal background image 2012-12-18 12:19:53 +01:00
Colomban Wendling
64a47b9cb6 Allow to switch message window orientation to place it on the right 2012-10-01 21:38:56 +02:00
Colomban Wendling
4d16735380 Don't access GtkDialog fields directly 2012-09-13 16:34:18 +02:00
Colomban Wendling
d80bc7ce56 Update FSF address
Closes #3557875.
2012-08-24 19:25:57 +02:00
Colomban Wendling
1c2c455b1d Update copyright information 2012-06-18 01:15:04 +02:00
Nick Treleaven
c7b3a09f05 Update bold flag after editing shortcut 2012-04-04 13:43:43 +01:00
Nick Treleaven
9e418d7aaf Show overridden keybindings in bold for prefs dialog tree 2012-04-04 13:43:39 +01:00
Nick Treleaven
b287553e4a Use 'SETPTR' instead of 'setptr'
This makes it clearer we're using a macro.
2012-01-25 16:26:16 +00:00
Colomban Wendling
9031335971 Set prefs' encoding combo boxes "wrap with" in the Glade file directly 2012-01-20 19:31:57 +01:00
Colomban Wendling
7f16b9a4fb Fix content of encodings and EOL style prefs ComboBoxes (oops)
I broke them in ca922e0ddc8022283ec3c1f49aaa15ab7c5ba213

Now the two encoding combo boxes shares the same data, which is
built only once.
2012-01-20 19:28:35 +01:00
Colomban Wendling
0aea05d10d Fix various integer signedness and minor styling issues
Most noteworthy change is that all build commands IDs and groups are
now unsigned everywhere negative values aren't explicitly handled with
a special meaning.  This should not change anything in behavior, only
makes clear the index won't underflow.
2011-12-18 00:32:22 +01:00
Matthew Brush
088b0bc362 Merge branch 'master' into gtkbuilder
Conflicts:
	geany.glade
	src/Makefile.am
	src/callbacks.c
2011-12-05 20:52:00 -08:00
Colomban Wendling
c252b1f376 Fix finding duplicated keybindings
When checking whether a keybinding is already in use before updating
it in the preferences, check against the keybindings the user may have
updated, not the ones that are currently applied.

This fixes changing action A from key K to key L and action B from key
L to key K, which led to conflicts back and forth since when setting B
to K the check found A as a duplicate even after having changed it.
2011-11-23 00:51:46 +01:00
Colomban Wendling
c73ee49758 Fix a few things, most of them reported by clang's static analyzer 2011-11-15 19:40:29 +01:00
Matthew Brush
0a16ec7520 Merge branch 'master' into gtkbuilder
Conflicts:
	src/interface.c
	src/vte.c
2011-11-06 23:44:24 -08:00
Matthew Brush
72e856947e Rework GtkBuilder code to behave more like old Glade 2 code
* Put back ui_hookup_widget and ui_lookup_widget functions
* Put back lookup_widget code in stash.c
* Emulate old create_*() functions from interface.[ch].
* Hookup all the GtkBuilder widget's to their top widgets like Glade 2
  generated code would've done.
* Misc changes to accomodate the above.
2011-10-19 00:44:35 -07:00
Nick Treleaven
cf88abfe4d Speed up & simplify stash tree display/update
Store a pointer to the stash pref for each row, so display/update is just
O(n) instead of O(n^2) time.

This changes the order prefs are updated in, but this doesn't matter.
2011-10-17 18:03:56 +01:00
Matthew Brush
af093c2ddf Remove interface.c/h files and put code into ui_utils.c/h. 2011-10-10 15:20:15 -07:00
Matthew Brush
cfedadae27 Remove lingering Glade 2 create_*() functions.
Add interface.h includes in prefs.c, project.c, stash.c and ui_utils.c.
2011-10-10 13:56:37 -07:00
Colomban Wendling
d06e9f4575 Remove $Id$ and $Date$ SVN keywords 2011-10-09 22:57:35 +02:00
Nick Treleaven
abefcc3375 Support visual reordering of keybinding groups without breaking the
plugin ABI.
Reorder Project group to follow main menu order.
Move Focus, Notebook tab groups last as they don't have 
corresponding menu items.
Use keybindings_get_core_group() for fixed group IDs instead of 
indexing keybinding_groups.
Make keybindings_lookup_item() only work with a GEANY_KEY_GROUP_ 
ID, not an index into keybinding_groups.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5990 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-10-03 14:57:02 +00:00
Nick Treleaven
6aeefe91c3 Use various_treeview global to tidy code a little.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5943 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-09-21 16:03:11 +00:00
Nick Treleaven
4d3959ac2f Fix making various prefs tree sync with data values when showing
the prefs dialog (patch by Dimitar Zhekov, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5942 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-09-21 15:50:36 +00:00
Colomban Wendling
ddb4ad5fa5 Fix some whitespace style errors
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5886 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-08-06 18:34:14 +00:00
Colomban Wendling
44e5687e0b Allow editing of formerly hidden preferences in the preferences dialog
Patch by Dimitar Zhekov, thanks! (closes P#3313315)

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5871 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-07-28 17:59:22 +00:00
Colomban Wendling
acc1ad557c Enable GTK printing support unconditionally
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5841 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-06-13 20:42:31 +00:00
Colomban Wendling
fdc80371c8 Fix preferences help button when activated with the keyboard
Don't hack around to trigger the help when the help button is clicked
on, simply handle the HELP dialog response. This makes the button
correctly show help rather than close the dialog when activated using
the keyboard.

This also drops _button_press_event() need and hack, making the button
correctly respond visually to mouse clicks.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5820 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-05-27 21:00:41 +00:00
Nick Treleaven
d7277f17bc Remove Preferences label warning about restarting after editing
template data - this is no longer necessary.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5743 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-04-26 16:39:41 +00:00
Colomban Wendling
4ffcfbba6c Don't allow editing keybinding column of group rows
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5681 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-04-03 15:54:28 +00:00
Colomban Wendling
a009c2b48e Fix loading and updating menu accelerators for custom commands
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5679 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-04-03 15:53:48 +00:00
Enrico Tröger
6ac2623208 Update copyright information.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5528 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-01-19 19:39:09 +00:00
Nick Treleaven
ff6354d833 Remove unnecessary 'global' from long line editor pref field names.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5432 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-11-23 17:36:29 +00:00
Nick Treleaven
c25d9856fe Add 'Ensure consistent line endings' file saving pref (patch by
Manuel Bua, thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5321 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-10-25 16:24:55 +00:00
Nick Treleaven
b231d9a903 Rename wrong function argument name.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5318 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-10-22 12:27:11 +00:00
Nick Treleaven
558126a0c8 Fix not changing edited keybindings when cancelling the Preferences
dialog.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5317 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-10-22 12:20:37 +00:00
Nick Treleaven
23b5f0a753 Refactor shared code with kb_cell_edited_cb().
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5316 ea778897-0a13-0410-b9d1-a72fbfd435f5
2010-10-21 16:40:31 +00:00