Kaydet (Commit) fc3a74e7 authored tarafından Nick Treleaven's avatar Nick Treleaven

Add 'Enable plugin support' Prefs checkbox.

Minor edit of load VTE option text.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1805 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 6883934f
......@@ -3,6 +3,10 @@
* src/msgwindow.c:
Apply patch from Jon Senior to fix parsing Apache Ant compiler
error messages (thanks).
* src/interface.c, src/prefs.c, src/keyfile.c, src/main.c, src/main.h,
geany.glade:
Add 'Enable plugin support' Prefs checkbox.
Minor edit of load VTE option text.
2007-08-16 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
......
......@@ -3097,10 +3097,10 @@
</child>
<child>
<widget class="GtkCheckButton" id="check_save_win_pos">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Saves the window position and geometry and restores it at the start</property>
<property name="label" translatable="yes">Save window position and geometry</property>
<widget class="GtkCheckButton" id="check_vte">
<property name="tooltip" translatable="yes">Whether the virtual terminal emulation (VTE) should be loaded at startup. Disable it if you do not need it.</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Load virtual terminal support</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">False</property>
......@@ -3116,10 +3116,29 @@
</child>
<child>
<widget class="GtkCheckButton" id="check_vte">
<property name="tooltip" translatable="yes">Whether the virtual terminal emulation(VTE) should be loaded at startup. Disable it if you do not need it.</property>
<widget class="GtkCheckButton" id="check_plugins">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Load virtual terminal emulation at startup</property>
<property name="label" translatable="yes">Enable plugin support</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="check_save_win_pos">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Saves the window position and geometry and restores it at the start</property>
<property name="label" translatable="yes">Save window position and geometry</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">False</property>
......@@ -3404,7 +3423,7 @@
<child>
<widget class="GtkEntry" id="startup_path_entry">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Path to start when opening or saving files. Must be an absolute path. Leave blank to use the current working directory.</property>
<property name="tooltip" translatable="yes">Path to start in when opening or saving files. Must be an absolute path. Leave blank to use the current working directory.</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
......
......@@ -2401,8 +2401,9 @@ create_prefs_dialog (void)
GtkWidget *alignment13;
GtkWidget *vbox4;
GtkWidget *check_load_session;
GtkWidget *check_save_win_pos;
GtkWidget *check_vte;
GtkWidget *check_plugins;
GtkWidget *check_save_win_pos;
GtkWidget *check_ask_for_quit;
GtkWidget *label162;
GtkWidget *frame19;
......@@ -2698,6 +2699,15 @@ create_prefs_dialog (void)
gtk_tooltips_set_tip (tooltips, check_load_session, _("Opens at startup the files from the last session"), NULL);
gtk_button_set_focus_on_click (GTK_BUTTON (check_load_session), FALSE);
check_vte = gtk_check_button_new_with_mnemonic (_("Load virtual terminal support"));
gtk_box_pack_start (GTK_BOX (vbox4), check_vte, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, check_vte, _("Whether the virtual terminal emulation (VTE) should be loaded at startup. Disable it if you do not need it."), NULL);
gtk_button_set_focus_on_click (GTK_BUTTON (check_vte), FALSE);
check_plugins = gtk_check_button_new_with_mnemonic (_("Enable plugin support"));
gtk_widget_show (check_plugins);
gtk_box_pack_start (GTK_BOX (vbox4), check_plugins, FALSE, FALSE, 0);
check_save_win_pos = gtk_check_button_new_with_mnemonic (_("Save window position and geometry"));
gtk_widget_show (check_save_win_pos);
gtk_box_pack_start (GTK_BOX (vbox4), check_save_win_pos, FALSE, FALSE, 0);
......@@ -2705,11 +2715,6 @@ create_prefs_dialog (void)
gtk_tooltips_set_tip (tooltips, check_save_win_pos, _("Saves the window position and geometry and restores it at the start"), NULL);
gtk_button_set_focus_on_click (GTK_BUTTON (check_save_win_pos), FALSE);
check_vte = gtk_check_button_new_with_mnemonic (_("Load virtual terminal emulation at startup"));
gtk_box_pack_start (GTK_BOX (vbox4), check_vte, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, check_vte, _("Whether the virtual terminal emulation(VTE) should be loaded at startup. Disable it if you do not need it."), NULL);
gtk_button_set_focus_on_click (GTK_BUTTON (check_vte), FALSE);
check_ask_for_quit = gtk_check_button_new_with_mnemonic (_("Confirm exit"));
gtk_widget_show (check_ask_for_quit);
gtk_box_pack_start (GTK_BOX (vbox4), check_ask_for_quit, FALSE, FALSE, 0);
......@@ -2800,7 +2805,7 @@ create_prefs_dialog (void)
gtk_table_attach (GTK_TABLE (table11), startup_path_entry, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_tooltips_set_tip (tooltips, startup_path_entry, _("Path to start when opening or saving files. Must be an absolute path. Leave blank to use the current working directory."), NULL);
gtk_tooltips_set_tip (tooltips, startup_path_entry, _("Path to start in when opening or saving files. Must be an absolute path. Leave blank to use the current working directory."), NULL);
gtk_entry_set_invisible_char (GTK_ENTRY (startup_path_entry), 8226);
startup_path_button = gtk_button_new ();
......@@ -4131,8 +4136,9 @@ create_prefs_dialog (void)
GLADE_HOOKUP_OBJECT (prefs_dialog, alignment13, "alignment13");
GLADE_HOOKUP_OBJECT (prefs_dialog, vbox4, "vbox4");
GLADE_HOOKUP_OBJECT (prefs_dialog, check_load_session, "check_load_session");
GLADE_HOOKUP_OBJECT (prefs_dialog, check_save_win_pos, "check_save_win_pos");
GLADE_HOOKUP_OBJECT (prefs_dialog, check_vte, "check_vte");
GLADE_HOOKUP_OBJECT (prefs_dialog, check_plugins, "check_plugins");
GLADE_HOOKUP_OBJECT (prefs_dialog, check_save_win_pos, "check_save_win_pos");
GLADE_HOOKUP_OBJECT (prefs_dialog, check_ask_for_quit, "check_ask_for_quit");
GLADE_HOOKUP_OBJECT (prefs_dialog, label162, "label162");
GLADE_HOOKUP_OBJECT (prefs_dialog, frame19, "frame19");
......
......@@ -289,8 +289,12 @@ void configuration_save()
g_key_file_set_string(config, "tools", "print_cmd", app->tools_print_cmd ? app->tools_print_cmd : "");
g_key_file_set_string(config, "tools", "grep_cmd", app->tools_grep_cmd ? app->tools_grep_cmd : "");
// search
g_key_file_set_string(config, "search", "fif_extra_options", search_prefs.fif_extra_options ? search_prefs.fif_extra_options : "");
// startup
g_key_file_set_boolean(config, "startup", "load_plugins", main_prefs.load_plugins);
project_save_prefs(config); // save project filename, etc.
save_recent_files(config);
save_session_files(config);
......@@ -571,8 +575,12 @@ gboolean configuration_load()
app->tools_grep_cmd = utils_get_setting_string(config, "tools", "grep_cmd", tmp_string);
g_free(tmp_string);
// search
search_prefs.fif_extra_options = utils_get_setting_string(config, "search", "fif_extra_options", "");
// startup
main_prefs.load_plugins = utils_get_setting_boolean(config, "startup", "load_plugins", TRUE);
project_load_prefs(config);
load_file_lists(config);
......
......@@ -84,7 +84,11 @@ MyApp *app;
CommandLineOptions cl_options; // fields initialised in parse_command_line_options
MainPrefs main_prefs;
static gboolean want_plugins;
// command-line options
static gboolean debug_mode = FALSE;
static gboolean ignore_global_tags = FALSE;
static gboolean no_msgwin = FALSE;
......@@ -588,6 +592,19 @@ static void load_project_file()
}
static void load_settings()
{
configuration_load();
// let cmdline options overwrite configuration settings
#ifdef HAVE_VTE
vte_info.have_vte = (no_vte) ? FALSE : vte_info.load_vte;
#endif
if (no_msgwin) app->msgwindow_visible = FALSE;
want_plugins = main_prefs.load_plugins && !no_plugins;
}
gint main(gint argc, gchar **argv)
{
gint idx;
......@@ -646,12 +663,7 @@ gint main(gint argc, gchar **argv)
gtk_window_set_default_size(GTK_WINDOW(app->window), GEANY_WINDOW_DEFAULT_WIDTH, GEANY_WINDOW_DEFAULT_HEIGHT);
encodings_init();
configuration_load();
// do this here to let cmdline options overwrite configuration settings
#ifdef HAVE_VTE
vte_info.have_vte = (no_vte) ? FALSE : vte_info.load_vte;
#endif
if (no_msgwin) app->msgwindow_visible = FALSE;
load_settings();
msgwin_init();
search_init();
......@@ -704,7 +716,7 @@ gint main(gint argc, gchar **argv)
#ifdef HAVE_PLUGINS
// load any enabled plugins before we open any documents
if (! no_plugins)
if (want_plugins)
plugins_init();
#endif
......@@ -782,7 +794,7 @@ void main_quit()
#endif
#ifdef HAVE_PLUGINS
if (! no_plugins)
if (want_plugins)
plugins_free();
#endif
navqueue_free();
......
......@@ -35,6 +35,14 @@ typedef struct
extern CommandLineOptions cl_options;
typedef struct
{
gboolean load_plugins;
} MainPrefs;
extern MainPrefs main_prefs;
gchar *get_argv_filename(const gchar *filename);
void main_quit();
......
......@@ -45,6 +45,7 @@
#include "encodings.h"
#include "project.h"
#include "editor.h"
#include "main.h"
#ifdef HAVE_VTE
# include "vte.h"
......@@ -84,12 +85,20 @@ void prefs_init_dialog(void)
widget = lookup_widget(app->prefs_dialog, "spin_mru");
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), app->mru_length);
// startup
widget = lookup_widget(app->prefs_dialog, "check_load_session");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_main_load_session);
widget = lookup_widget(app->prefs_dialog, "check_save_win_pos");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_main_save_winpos);
widget = lookup_widget(app->prefs_dialog, "check_plugins");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), main_prefs.load_plugins);
widget = lookup_widget(app->prefs_dialog, "check_ask_for_quit");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_main_confirm_exit);
// behaviour
widget = lookup_widget(app->prefs_dialog, "check_beep");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->beep_on_errors);
......@@ -102,9 +111,6 @@ void prefs_init_dialog(void)
widget = lookup_widget(app->prefs_dialog, "check_auto_focus");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->auto_focus);
widget = lookup_widget(app->prefs_dialog, "check_ask_for_quit");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_main_confirm_exit);
widget = lookup_widget(app->prefs_dialog, "check_ask_suppress_search_dialogs");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_main_suppress_search_dialogs);
......@@ -404,6 +410,10 @@ void prefs_init_dialog(void)
}
gtk_tree_view_expand_all(GTK_TREE_VIEW(tree));
#ifndef HAVE_PLUGINS
gtk_widget_set_sensitive(lookup_widget(app->prefs_dialog, "check_plugins"), FALSE);
#endif
#ifdef HAVE_VTE
// make VTE switch visible only when VTE is compiled in, it is hidden by default
widget = lookup_widget(app->prefs_dialog, "check_vte");
......@@ -464,18 +474,23 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
widget = lookup_widget(app->prefs_dialog, "spin_mru");
app->mru_length = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
// startup
widget = lookup_widget(app->prefs_dialog, "check_load_session");
app->pref_main_load_session = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_save_win_pos");
app->pref_main_save_winpos = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_beep");
app->beep_on_errors = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_plugins");
main_prefs.load_plugins = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_ask_for_quit");
app->pref_main_confirm_exit = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
// behaviour
widget = lookup_widget(app->prefs_dialog, "check_beep");
app->beep_on_errors = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_ask_suppress_search_dialogs");
app->pref_main_suppress_search_dialogs = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
......@@ -1123,14 +1138,14 @@ void prefs_show_dialog(void)
vte_append_preferences_tab();
#endif
ui_setup_open_button_callback(lookup_widget(app->prefs_dialog, "startup_path_button"), NULL,
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_ENTRY(lookup_widget(app->prefs_dialog, "startup_path_entry")));
g_signal_connect((gpointer) app->prefs_dialog, "response",
G_CALLBACK(on_prefs_button_clicked), NULL);
g_signal_connect((gpointer) app->prefs_dialog, "delete_event",
G_CALLBACK(gtk_widget_hide_on_delete), NULL);
ui_setup_open_button_callback(lookup_widget(app->prefs_dialog, "startup_path_button"), NULL,
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_ENTRY(lookup_widget(app->prefs_dialog, "startup_path_entry")));
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "tagbar_font"),
"font-set", G_CALLBACK(on_prefs_font_choosed), GINT_TO_POINTER(1));
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "msgwin_font"),
......
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