4597 Commits

Author SHA1 Message Date
Nick Treleaven
d4acd1e061 *View->Change Font* should respect native dialog setting (Windows, #1059) 2014-08-02 16:29:08 +02:00
Nick Treleaven
e1988964c1 Fix Windows build 2014-08-01 12:05:30 +01:00
Nick Treleaven
01b3103eaf Remove unread variable 2014-08-01 11:54:05 +01:00
Colomban Wendling
b65f49902f Fix closing the documents when quitting
When quitting we avoid doing some unnecessary actions, and used to
simply destroy the Scintilla widget (and thus the notebook page)
instead of the elaborate UI updates.

Unfortunately, when the infobars landed they changed what is packed as
a notebook page, and now destroying the Scintilla widget alone is not
enough to close the page.  Fix this by properly removing the whole page
no matter what it contains.

This issue was visible when quitting Geany with a project open.
2014-07-26 15:03:49 +02:00
Colomban Wendling
0682a25585 Fix crash when quitting with an infobar visible
When the infobar gets closed/destroyed it tries to focus the possibly
destroyed document, leading to a crash.
2014-07-26 13:36:19 +02:00
Colomban Wendling
a87655480f Merge most of PR#298 2014-07-11 18:06:59 +02:00
Colomban Wendling
487b8aea0b Custom commands dialog: Make sure the selected item is always visible
Always bring back the selected item after an user action, so the user
can see what she's doing.
2014-07-06 00:06:16 +02:00
Colomban Wendling
47e9e6c000 Ask whether to overwrite the project file when creating a new project 2014-07-04 17:54:07 +02:00
Colomban Wendling
7f7f66978b Add tooltips to explain the purpose of the New Project dialog fields 2014-07-04 17:53:24 +02:00
Colomban Wendling
11b50493fc Use ui_button_new_with_image() to build image buttons 2014-07-04 17:50:37 +02:00
Thomas Martitz
db90411b0e main: Refactor quit functions
Move quit-related functions to main.c and make them static. main_quit() now
does all the heavy work and can be called from signal handlers.
2014-07-03 22:33:26 +02:00
Thomas Martitz
ffcec43d01 document.c: Immediately mark as changed when document is externally deleted
Before infobar it didn't matter because the dialog was modal and interaction
with the doc was impossible. Now that you can interact it the doc should
be marked changed immediately.
2014-06-29 11:38:02 +02:00
Thomas Martitz
0f7db113e7 document.c: Restore lost document_set_text_changed(doc, TRUE) call
It got lost by accident in 5117940.
2014-06-29 11:38:02 +02:00
Thomas Martitz
c8970e2331 info bars: Show additional save button for the "reload file?" info bar
This allows overwriting the file right from the info bar.
2014-06-29 11:38:02 +02:00
Thomas Martitz
4b8f42cd9e info bars: Explicitely move focus back to the editor when closing
This does not seem to happen automatically, at least on GTK3.
2014-06-29 11:37:47 +02:00
Thomas Martitz
ab42662309 Fix racy glib assertion failure
Use g_signal_connect_object() to establish automatic and race-free signal
disconnection instead of the hand-crafted mechanism.
2014-06-29 11:29:07 +02:00
Colomban Wendling
35a212dffc Merge branch 'callbacks-cleanup' 2014-06-27 22:32:38 +02:00
Colomban Wendling
3ce25db632 Remove line number zoom hack as it is no longer necessary
Since cbf9813632d7ee921ffa1fda0d1f69128b2bc755 we have a proper
solution for maintaining line number consistent with the editor zoom,
so drop the old hack.

This also allows to remove the now useless third argument of
sci_set_line_numbers().
2014-06-27 22:23:48 +02:00
Colomban Wendling
cccc6ea0df Remove some dead code 2014-06-26 20:04:15 +02:00
Colomban Wendling
6c80488037 Make sure the current document is still the same after Save All
Save All updates the sidebar and title bar with the document that was
the current one when the action was triggered, but the action could
have changed the focused document if an non-file-backed file required
saving.  So, make sure current document is the same after the action.
2014-06-26 20:00:24 +02:00
Colomban Wendling
0d03fad7bf Move date insert callbacks to the UI code where they belong 2014-06-26 18:36:51 +02:00
Colomban Wendling
a51bc3d654 Move include insert callbacks to the UI code where they belong 2014-06-26 18:36:49 +02:00
Colomban Wendling
00ec175d63 Callbacks: get rid of the ugly insert_callback_from_menu global 2014-06-26 18:28:48 +02:00
Thomas Martitz
721769e682 Fix build warning about missing return value. 2014-06-24 23:07:08 +02:00
Colomban Wendling
cc2f1879a8 Add printf attribute to document_show_message() for better safety
Add G_GNUC_PRINTF attribute to document_show_message() so some
compilers can check the format arguments match the format string.
2014-06-24 18:30:54 +02:00
Colomban Wendling
9bf647c5c3 Move on_clone1_activate() to callbacks.c 2014-06-24 18:26:44 +02:00
Colomban Wendling
0b32227bf0 Don't manually connect handlers Glade can connect for us
Don't bother manually connecting handlers that Glade can connect for us
just as well.
2014-06-24 18:15:46 +02:00
Colomban Wendling
ab3b7ce496 Use the appropriate prototype for the window's delete-event callback 2014-06-24 18:11:34 +02:00
Colomban Wendling
2113537e93 Add two missing Glade-only prototypes 2014-06-24 18:07:29 +02:00
Colomban Wendling
a398b087da Remove redundant toolbar-specific callbacks 2014-06-24 18:04:11 +02:00
Colomban Wendling
517bf5f960 Move Glade-only callbacks out of callbacks.h
There is no need to expose the Glade-only callbacks in the header as
nobody uses them directly anyway;  and not having them makes the header
a little less bloated.
2014-06-24 17:53:55 +02:00
Colomban Wendling
3b1fbc16e5 Normalize callbacks prototypes 2014-06-24 16:53:07 +02:00
Colomban Wendling
220545d988 Don't export callbacks not used from Glade 2014-06-24 16:44:10 +02:00
Colomban Wendling
69a44997ad Remove prototypes of non-existing callbacks 2014-06-24 16:43:11 +02:00
Colomban Wendling
d6382e443f VTE: avoid exporting callbacks that are only used internally 2014-06-24 15:04:37 +02:00
Colomban Wendling
2490df9b45 Avoid passing non-literals to string formatting functions
Having a string literal allows the compiler to check the arguments
match the format, so avoid passing non-literal whenever possible.
2014-06-24 15:02:31 +02:00
Thomas Martitz
135b60d25e callbacks: Refactor on_reload_as_activate() as document_reload_prompt()
The callback wasn't used from glade but is useful for some other places so
it's worth moving into document.c. This also fixes a bug where reload via sidebar
always reloads the current document instead of the actually clicked one.
2014-06-24 15:01:42 +02:00
Colomban Wendling
d6c980f2fc Printing: properly claim ownership of the printing Scintilla widget
This avoids a GObject warning about unref-ing a floating object on
print termination.
2014-06-23 18:38:59 +02:00
Colomban Wendling
ec7071062c Fix GTK frame clock warnings with our about dialog
We used to set the widget's style in a style-set handler, and despite
guarding ourselves from recursive invocations, the GTK frame clock
introduced by GTK 3.8 didn't like it very much.

So, replace the manual color modification by a simpler global widget
state modification, making the code simpler and smaller, yet achieving
the same result (or so I hope and see).
2014-06-21 18:35:17 +02:00
Colomban Wendling
c79c983364 Fix build with GLib < 2.32
Second part of #1047.
2014-06-04 14:31:12 +02:00
Colomban Wendling
ea6ebaf48f Fix build with GTK < 2.24
Part of #1047.
2014-06-04 14:16:39 +02:00
Colomban Wendling
147167cfa5 infobars: Use wrap labels to avoid cropped infobars
Since the infobar is backed in a GtkPaned that allows "shrink", if the
content is too wide, it's far end will just get cropped.  Also, wrap
labels are nicer to display possibly long texts as it flows naturally.
2014-05-28 18:01:23 +02:00
Colomban Wendling
d6e9e40ccc Fix a few missing/extra includes 2014-05-27 20:25:04 +02:00
Colomban Wendling
7a4b524661 Avoid code duplication in document_get_current() 2014-05-27 18:00:56 +02:00
Colomban Wendling
46f01bff59 Properly mirror document_get_from_page() in document_get_notebook_page()
Now document_get_from_page() supports arbitrary nesting inside the
notebook page, update document_get_notebook_page() to support it also,
by searching up for the direct notebook child rather than assuming it
is the ScintillaWidget's direct parent.
2014-05-27 17:55:00 +02:00
Colomban Wendling
d399957471 Fix an inverted check 2014-05-27 16:02:59 +02:00
Colomban Wendling
e9795732b6 Merge PR#113 2014-05-26 16:45:25 +02:00
Colomban Wendling
2b9ecc2e4f Remove unused variables and avoid variable shadowing 2014-05-26 16:24:24 +02:00
Colomban Wendling
6e58ef3755 Don't use the notebook page widget for tab popup
Directly use the GeanyDocument rather than pass the notebook page
widget and get the document from that.  This makes the code more future
proof and less weird.
2014-05-26 16:21:16 +02:00
Thomas Marititz
54724ee2ad notebook: Fix crash on tab close
Since infobars notebook_tab_close_clicked_cb() wants a GeanyDocument as userdata.
show_tab_bar_popup_menu() on the other hand wants the actual GtkNotebook child.
2014-05-26 11:43:57 +02:00