Kaydet (Commit) edc0ceaa authored tarafından Enrico Tröger's avatar Enrico Tröger

Add version to plugin info fields and two other fields for future use.

Add option to show/hide the small crosses on each file tab (closes #1757680).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1826 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst b7de9b3d
2007-08-25 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* geany.glade, plugins/classbuilder.c, plugins/demoplugin.c,
plugins/export.c, plugins/htmlchars.c, src/interface.c,
src/keyfile.c, src/notebook.c, src/plugindata.c, src/prefs.c,
src/prefs.h:
Add version to plugin info fields and two other fields for future
use.
Add option to show/hide the small crosses on each file tab
(closes #1757680).
2007-08-24 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/dialogs.c, src/callbacks.c:
......
This diff is collapsed.
......@@ -46,7 +46,7 @@ GeanyData *geany_data;
VERSION_CHECK(7)
PLUGIN_INFO(_("Class Builder"), _("Creates source files for new class types."))
PLUGIN_INFO(_("Class Builder"), _("Creates source files for new class types."), "0.1")
enum
......
......@@ -38,7 +38,7 @@ GeanyData *geany_data;
VERSION_CHECK(7)
/* All plugins must set name and description */
PLUGIN_INFO(_("Demo"), _("Example plugin."))
PLUGIN_INFO(_("Demo"), _("Example plugin."), "0.1")
/* Callback when the menu item is clicked */
......
......@@ -38,7 +38,7 @@ PluginFields *plugin_fields;
GeanyData *geany_data;
VERSION_CHECK(12)
PLUGIN_INFO(_("Export"), _("Exports the current file into different formats."))
PLUGIN_INFO(_("Export"), _("Exports the current file into different formats."), "0.1")
#define doc_array geany_data->doc_array
#define scintilla geany_data->sci
......@@ -78,10 +78,11 @@ PLUGIN_INFO(_("Export"), _("Exports the current file into different formats."))
\\usepackage[utf8x]{inputenc}\n\
\\usepackage[T1]{fontenc}\n\
\\usepackage{color}\n\
\\setlength{\\parindent}{0em}\n\
\\setlength{\\parskip}{2ex plus1ex minus0.5ex}\n\
{export_styles}\n\
\\begin{document}\
\n\
\\noindent\n\
\\ttfamily\n\
\\setlength{\\fboxrule}{0pt}\n\
\\setlength{\\fboxsep}{0pt}\n\
......
......@@ -42,7 +42,7 @@ GeanyData *geany_data;
VERSION_CHECK(7)
PLUGIN_INFO(_("HTML Characters"), _("Inserts HTML character entities like '&amp;'."))
PLUGIN_INFO(_("HTML Characters"), _("Inserts HTML character entities like '&amp;'."), "0.1")
enum
......
This diff is collapsed.
......@@ -181,6 +181,7 @@ static void save_dialog_prefs(GKeyFile *config)
g_key_file_set_boolean(config, PACKAGE, "show_linenumber_margin", editor_prefs.show_linenumber_margin);
g_key_file_set_boolean(config, PACKAGE, "line_breaking", editor_prefs.line_wrapping);
g_key_file_set_boolean(config, PACKAGE, "show_line_endings", editor_prefs.show_line_endings);
g_key_file_set_boolean(config, PACKAGE, "show_tab_cross", prefs.show_tab_cross);
g_key_file_set_boolean(config, PACKAGE, "brace_match_ltgt", editor_prefs.brace_match_ltgt);
g_key_file_set_boolean(config, PACKAGE, "auto_close_xml_tags", editor_prefs.auto_close_xml_tags);
g_key_file_set_boolean(config, PACKAGE, "auto_complete_constructs", editor_prefs.auto_complete_constructs);
......@@ -444,6 +445,7 @@ gboolean configuration_load()
ui_prefs.fullscreen = utils_get_setting_boolean(config, PACKAGE, "fullscreen", FALSE);
prefs.tab_order_ltr = utils_get_setting_boolean(config, PACKAGE, "tab_order_ltr", TRUE);
prefs.show_notebook_tabs = utils_get_setting_boolean(config, PACKAGE, "show_notebook_tabs", TRUE);
prefs.show_tab_cross = utils_get_setting_boolean(config, PACKAGE, "show_tab_cross", TRUE);
editor_prefs.brace_match_ltgt = utils_get_setting_boolean(config, PACKAGE, "brace_match_ltgt", FALSE);
prefs.switch_msgwin_pages = utils_get_setting_boolean(config, PACKAGE, "switch_msgwin_pages", FALSE);
prefs.auto_focus = utils_get_setting_boolean(config, PACKAGE, "auto_focus", FALSE);
......
......@@ -319,18 +319,28 @@ gint notebook_new_tab(gint doc_idx)
this->tab_label = gtk_label_new(title);
hbox = gtk_hbox_new(FALSE, 0);
but = gtk_button_new();
gtk_container_add(GTK_CONTAINER(but),
ui_new_image_from_inline(GEANY_IMAGE_SMALL_CROSS, FALSE));
gtk_container_set_border_width(GTK_CONTAINER(but), 0);
gtk_widget_set_size_request(but, 19, 18);
gtk_box_pack_start(GTK_BOX(hbox), this->tab_label, FALSE, FALSE, 0);
align = gtk_alignment_new(1.0, 0.0, 0.0, 0.0);
gtk_container_add(GTK_CONTAINER(align), but);
if (prefs.show_tab_cross)
{
but = gtk_button_new();
gtk_container_add(GTK_CONTAINER(but),
ui_new_image_from_inline(GEANY_IMAGE_SMALL_CROSS, FALSE));
gtk_container_set_border_width(GTK_CONTAINER(but), 0);
gtk_widget_set_size_request(but, 19, 18);
align = gtk_alignment_new(1.0, 0.0, 0.0, 0.0);
gtk_container_add(GTK_CONTAINER(align), but);
gtk_button_set_relief(GTK_BUTTON(but), GTK_RELIEF_NONE);
gtk_box_pack_start(GTK_BOX(hbox), align, TRUE, TRUE, 0);
g_signal_connect(G_OBJECT(but), "clicked",
G_CALLBACK(notebook_tab_close_clicked_cb), page);
}
else
gtk_widget_set_size_request(hbox, -1, 18); // keep the familiar tab height
gtk_button_set_relief(GTK_BUTTON(but), GTK_RELIEF_NONE);
gtk_box_pack_start(GTK_BOX(hbox), this->tab_label, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), align, TRUE, TRUE, 0);
gtk_widget_show_all(hbox);
this->tabmenu_label = gtk_label_new(title);
......@@ -345,10 +355,6 @@ gint notebook_new_tab(gint doc_idx)
tab_count_changed();
// signal for clicking the tab-close button
g_signal_connect(G_OBJECT(but), "clicked",
G_CALLBACK(notebook_tab_close_clicked_cb), page);
// This is where tab DnD is enabled for GTK 2.10 and higher
#if GTK_CHECK_VERSION(2, 10, 0)
if (gtk_check_version(2, 10, 0) == NULL) // null means version ok
......
......@@ -71,12 +71,12 @@
/* The API version should be incremented whenever any plugin data types below are
* modified. */
static const gint api_version = 14;
static const gint api_version = 15;
/* The ABI version should be incremented whenever existing fields in the plugin
* data types below have to be changed or reordered. It should stay the same if fields
* are only appended, as this doesn't affect existing fields. */
static const gint abi_version = 5;
static const gint abi_version = 6;
/* This performs runtime checks that try to ensure:
* 1. Geany ABI data types are compatible with this plugin.
......@@ -97,17 +97,21 @@ typedef struct PluginInfo
{
gchar *name; // name of plugin
gchar *description; // description of plugin
gchar *version; // version of plugin
gpointer reserved1; // reserved for later use
gpointer reserved2; // reserved for later use
}
PluginInfo;
/* Sets the plugin name and a brief description of what it is. */
#define PLUGIN_INFO(p_name, p_description) \
#define PLUGIN_INFO(p_name, p_description, p_version) \
PluginInfo *info() \
{ \
static PluginInfo p_info; \
\
p_info.name = (p_name); \
p_info.description = (p_description); \
p_info.version = (p_version); \
return &p_info; \
}
......
......@@ -165,6 +165,9 @@ void prefs_init_dialog(void)
on_show_notebook_tabs_toggled(GTK_TOGGLE_BUTTON(
lookup_widget(ui_widgets.prefs_dialog, "check_show_notebook_tabs")), NULL);
widget = lookup_widget(ui_widgets.prefs_dialog, "check_show_tab_cross");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), prefs.show_tab_cross);
widget = lookup_widget(ui_widgets.prefs_dialog, "combo_tab_editor");
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), prefs.tab_pos_editor);
......@@ -541,6 +544,9 @@ on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_data)
widget = lookup_widget(ui_widgets.prefs_dialog, "check_show_notebook_tabs");
prefs.show_notebook_tabs = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(ui_widgets.prefs_dialog, "check_show_tab_cross");
prefs.show_tab_cross = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(ui_widgets.prefs_dialog, "combo_tab_editor");
prefs.tab_pos_editor = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
......@@ -1085,6 +1091,7 @@ static void on_show_notebook_tabs_toggled(GtkToggleButton *togglebutton, gpointe
// tab placement only enabled when tabs are visible
gtk_widget_set_sensitive(lookup_widget(ui_widgets.prefs_dialog, "combo_tab_editor"), sens);
gtk_widget_set_sensitive(lookup_widget(ui_widgets.prefs_dialog, "check_show_tab_cross"), sens);
}
......
......@@ -74,6 +74,7 @@ typedef struct GeanyPrefs
gboolean strip_trailing_spaces;
gboolean replace_tabs;
gboolean tab_order_ltr;
gboolean show_tab_cross;
guint mru_length;
/* tools */
......
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