Made document related submenus(filetype, encoding, line endings) radio buttons for better usability.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@668 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
d55bc577f7
commit
afa4c4104e
@ -1,3 +1,11 @@
|
||||
2006-08-03 Enrico Tröger <enrico.troeger@uvena.de>
|
||||
|
||||
* geany.glade, src/callbacks.c, src/filetypes.c, src/filetypes.h,
|
||||
src/encodings.c, src/encodings.h, src/interface.c, src/utils.c:
|
||||
Made document related submenus(filetype, encoding, line endings)
|
||||
radio buttons for better usability.
|
||||
|
||||
|
||||
2006-08-03 Nick Treleaven <nick.treleaven@btinternet.com>
|
||||
|
||||
* src/utils.c, src/utils.h, src/sci_cb.c:
|
||||
|
33
geany.glade
33
geany.glade
@ -57,7 +57,7 @@
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image987">
|
||||
<widget class="GtkImage" id="image1017">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-new</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -150,7 +150,7 @@
|
||||
<signal name="activate" handler="on_save_all1_activate" last_modification_time="Thu, 02 Jun 2005 14:15:30 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image988">
|
||||
<widget class="GtkImage" id="image1018">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-save</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -171,7 +171,7 @@
|
||||
<signal name="activate" handler="on_toolbutton23_clicked" last_modification_time="Mon, 24 Jul 2006 19:26:04 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image989">
|
||||
<widget class="GtkImage" id="image1019">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-revert-to-saved</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -191,7 +191,7 @@
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image990">
|
||||
<widget class="GtkImage" id="image1020">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-revert-to-saved</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -271,7 +271,7 @@
|
||||
<signal name="activate" handler="on_close_all1_activate" last_modification_time="Thu, 02 Jun 2005 14:15:30 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image991">
|
||||
<widget class="GtkImage" id="image1021">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-close</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -402,7 +402,7 @@
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image992">
|
||||
<widget class="GtkImage" id="image1022">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -434,7 +434,7 @@
|
||||
<property name="use_underline">True</property>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image993">
|
||||
<widget class="GtkImage" id="image1023">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -670,7 +670,7 @@
|
||||
<signal name="activate" handler="on_replace1_activate" last_modification_time="Sun, 23 Oct 2005 13:22:36 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image994">
|
||||
<widget class="GtkImage" id="image1024">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-find-and-replace</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -712,7 +712,7 @@
|
||||
<signal name="activate" handler="on_go_to_line1_activate" last_modification_time="Tue, 23 May 2006 17:10:49 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image995">
|
||||
<widget class="GtkImage" id="image1025">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-jump-to</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -747,7 +747,7 @@
|
||||
<signal name="activate" handler="on_change_font1_activate" last_modification_time="Fri, 22 Apr 2005 18:58:45 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image996">
|
||||
<widget class="GtkImage" id="image1026">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-select-font</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -769,7 +769,7 @@
|
||||
<signal name="activate" handler="on_show_color_chooser1_activate" last_modification_time="Wed, 22 Jun 2005 18:10:21 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image997">
|
||||
<widget class="GtkImage" id="image1027">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-select-color</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -996,28 +996,33 @@
|
||||
<widget class="GtkMenu" id="menu_line_endings1_menu">
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="crlf">
|
||||
<widget class="GtkRadioMenuItem" id="crlf">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Convert and set to _CR/LF (Win)</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">False</property>
|
||||
<signal name="activate" handler="on_crlf_activate" last_modification_time="Thu, 28 Apr 2005 16:27:24 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="lf">
|
||||
<widget class="GtkRadioMenuItem" id="lf">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Convert and set to _LF (Unix)</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="group">crlf</property>
|
||||
<signal name="activate" handler="on_lf_activate" last_modification_time="Thu, 28 Apr 2005 16:27:24 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="cr">
|
||||
<widget class="GtkRadioMenuItem" id="cr">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Convert and set to CR (_Mac)</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="group">crlf</property>
|
||||
<signal name="activate" handler="on_cr_activate" last_modification_time="Thu, 28 Apr 2005 16:27:24 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
@ -743,7 +743,7 @@ on_notebook1_switch_page (GtkNotebook *notebook,
|
||||
gtk_tree_model_foreach(GTK_TREE_MODEL(tv.store_openfiles), treeviews_find_node, GINT_TO_POINTER(idx));
|
||||
|
||||
document_set_text_changed(idx);
|
||||
utils_document_show_hide(idx); //update the document menu
|
||||
utils_document_show_hide(idx); // update the document menu
|
||||
utils_build_show_hide(idx);
|
||||
utils_update_statusbar(idx, -1);
|
||||
utils_set_window_title(idx);
|
||||
@ -1069,7 +1069,7 @@ on_crlf_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint idx = document_get_cur_idx();
|
||||
if (idx == -1 || ! doc_list[idx].is_valid) return;
|
||||
if (app->ignore_callback || idx == -1 || ! doc_list[idx].is_valid) return;
|
||||
sci_convert_eols(doc_list[idx].sci, SC_EOL_CRLF);
|
||||
sci_set_eol_mode(doc_list[idx].sci, SC_EOL_CRLF);
|
||||
}
|
||||
@ -1080,7 +1080,7 @@ on_lf_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint idx = document_get_cur_idx();
|
||||
if (idx == -1 || ! doc_list[idx].is_valid) return;
|
||||
if (app->ignore_callback || idx == -1 || ! doc_list[idx].is_valid) return;
|
||||
sci_convert_eols(doc_list[idx].sci, SC_EOL_LF);
|
||||
sci_set_eol_mode(doc_list[idx].sci, SC_EOL_LF);
|
||||
}
|
||||
@ -1091,7 +1091,7 @@ on_cr_activate (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint idx = document_get_cur_idx();
|
||||
if (idx == -1 || ! doc_list[idx].is_valid) return;
|
||||
if (app->ignore_callback || idx == -1 || ! doc_list[idx].is_valid) return;
|
||||
sci_convert_eols(doc_list[idx].sci, SC_EOL_CR);
|
||||
sci_set_eol_mode(doc_list[idx].sci, SC_EOL_CR);
|
||||
}
|
||||
@ -1189,7 +1189,7 @@ on_filetype_change (GtkMenuItem *menuitem,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint idx = document_get_cur_idx();
|
||||
if (idx < 0) return;
|
||||
if (app->ignore_callback || idx < 0 || ! doc_list[idx].is_valid) return;
|
||||
|
||||
document_set_filetype(idx, (filetype*)user_data);
|
||||
}
|
||||
@ -2593,7 +2593,7 @@ on_encoding_change (GtkMenuItem *menuitem,
|
||||
gint idx = document_get_cur_idx();
|
||||
guint i = GPOINTER_TO_INT(user_data);
|
||||
|
||||
if (idx < 0 || encodings[i].charset == NULL ||
|
||||
if (app->ignore_callback || idx < 0 || encodings[i].charset == NULL ||
|
||||
utils_strcmp(encodings[i].charset, doc_list[idx].encoding)) return;
|
||||
|
||||
g_free(doc_list[idx].encoding);
|
||||
|
@ -163,6 +163,26 @@ const gchar *encodings_get_charset(const GeanyEncoding* enc)
|
||||
return enc->charset;
|
||||
}
|
||||
|
||||
static GtkWidget *radio_items[GEANY_ENCODINGS_MAX];
|
||||
|
||||
|
||||
void encodings_select_radio_item(const gchar *charset)
|
||||
{
|
||||
gint i;
|
||||
g_return_if_fail(charset != NULL);
|
||||
|
||||
i = 0;
|
||||
while (i < GEANY_ENCODINGS_MAX)
|
||||
{
|
||||
if (utils_strcmp(charset, encodings[i].charset)) break;
|
||||
i++;
|
||||
}
|
||||
if (i == GEANY_ENCODINGS_MAX) i = GEANY_ENCODING_UTF_8; // fallback to UTF-8
|
||||
|
||||
// app->ignore_callback has to be set by the caller
|
||||
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(radio_items[i]), TRUE);
|
||||
}
|
||||
|
||||
|
||||
void encodings_init(void)
|
||||
{
|
||||
@ -170,6 +190,7 @@ void encodings_init(void)
|
||||
*menu_utf8, *menu_middleeast, *item_westeuro, *item_easteuro, *item_eastasian,
|
||||
*item_asian, *item_utf8, *item_middleeast;
|
||||
GCallback cb_func[2];
|
||||
GSList *group = NULL;
|
||||
gchar *label;
|
||||
guint i, j, k, order, group_size;
|
||||
|
||||
@ -219,7 +240,7 @@ void encodings_init(void)
|
||||
gtk_container_add(GTK_CONTAINER(menu[k]), item_utf8);
|
||||
gtk_widget_show_all(item_utf8);
|
||||
|
||||
/// TODO can it be optimized? ATM 3782 runs at line 239
|
||||
/// TODO can it be optimized? ATM 3782 runs at line "if (encodings[j].group ...)"
|
||||
for (i = 0; i < GEANY_ENCODING_GROUPS_MAX; i++)
|
||||
{
|
||||
order = 0;
|
||||
@ -241,7 +262,14 @@ void encodings_init(void)
|
||||
if (encodings[j].group == i && encodings[j].order == order)
|
||||
{
|
||||
label = encodings_to_string(&encodings[j]);
|
||||
item = gtk_menu_item_new_with_label(label);
|
||||
if (k == 0)
|
||||
{
|
||||
item = gtk_radio_menu_item_new_with_label(group, label);
|
||||
group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(item));
|
||||
radio_items[j] = item;
|
||||
}
|
||||
else
|
||||
item = gtk_menu_item_new_with_label(label);
|
||||
gtk_widget_show(item);
|
||||
gtk_container_add(GTK_CONTAINER(submenu), item);
|
||||
g_signal_connect((gpointer) item, "activate",
|
||||
|
@ -63,6 +63,8 @@ const GeanyEncoding* encodings_get_from_index(gint index);
|
||||
gchar* encodings_to_string(const GeanyEncoding* enc);
|
||||
const gchar* encodings_get_charset(const GeanyEncoding* enc);
|
||||
|
||||
void encodings_select_radio_item(const gchar *charset);
|
||||
|
||||
void encodings_init(void);
|
||||
|
||||
|
||||
|
@ -36,6 +36,7 @@ static void filetypes_create_menu_item(GtkWidget *menu, gchar *label, filetype *
|
||||
static void filetypes_create_newmenu_item(GtkWidget *menu, gchar *label, filetype *ftype);
|
||||
static void filetypes_init_build_programs(filetype *ftype);
|
||||
|
||||
static GtkWidget *radio_items[GEANY_MAX_FILE_TYPES];
|
||||
|
||||
|
||||
/* inits the filetype array and fill it with the known filetypes
|
||||
@ -48,6 +49,8 @@ void filetypes_init_types(void)
|
||||
#define C // these macros are only to ease navigation
|
||||
filetypes[GEANY_FILETYPES_C] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_C]->id = GEANY_FILETYPES_C;
|
||||
filetypes[GEANY_FILETYPES_C]->uid = 0; // never change this value
|
||||
filetypes[GEANY_FILETYPES_C]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_C]->lang = 0;
|
||||
filetypes[GEANY_FILETYPES_C]->name = g_strdup("C");
|
||||
filetypes[GEANY_FILETYPES_C]->has_tags = TRUE;
|
||||
@ -67,6 +70,8 @@ void filetypes_init_types(void)
|
||||
#define CPP
|
||||
filetypes[GEANY_FILETYPES_CPP] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_CPP]->id = GEANY_FILETYPES_CPP;
|
||||
filetypes[GEANY_FILETYPES_CPP]->uid = 1; // never change this value
|
||||
filetypes[GEANY_FILETYPES_CPP]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_CPP]->lang = 1;
|
||||
filetypes[GEANY_FILETYPES_CPP]->name = g_strdup("C++");
|
||||
filetypes[GEANY_FILETYPES_CPP]->has_tags = TRUE;
|
||||
@ -94,6 +99,8 @@ void filetypes_init_types(void)
|
||||
#define D
|
||||
filetypes[GEANY_FILETYPES_D] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_D]->id = GEANY_FILETYPES_D;
|
||||
filetypes[GEANY_FILETYPES_D]->uid = 2; // never change this value
|
||||
filetypes[GEANY_FILETYPES_D]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_D]->lang = 17;
|
||||
filetypes[GEANY_FILETYPES_D]->name = g_strdup("D");
|
||||
filetypes[GEANY_FILETYPES_D]->has_tags = TRUE;
|
||||
@ -114,6 +121,8 @@ void filetypes_init_types(void)
|
||||
filetypes[GEANY_FILETYPES_JAVA] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_JAVA]->id = GEANY_FILETYPES_JAVA;
|
||||
filetypes[GEANY_FILETYPES_JAVA]->name = g_strdup("Java");
|
||||
filetypes[GEANY_FILETYPES_JAVA]->uid = 3; // never change this value
|
||||
filetypes[GEANY_FILETYPES_JAVA]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_JAVA]->lang = 2;
|
||||
filetypes[GEANY_FILETYPES_JAVA]->has_tags = TRUE;
|
||||
filetypes[GEANY_FILETYPES_JAVA]->title = g_strdup(_("Java source file"));
|
||||
@ -131,6 +140,8 @@ void filetypes_init_types(void)
|
||||
#define PAS // to avoid warnings when building under Windows, the symbol PASCAL is there defined
|
||||
filetypes[GEANY_FILETYPES_PASCAL] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_PASCAL]->id = GEANY_FILETYPES_PASCAL;
|
||||
filetypes[GEANY_FILETYPES_PASCAL]->uid = 4; // never change this value
|
||||
filetypes[GEANY_FILETYPES_PASCAL]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_PASCAL]->lang = 4;
|
||||
filetypes[GEANY_FILETYPES_PASCAL]->name = g_strdup("Pascal");
|
||||
filetypes[GEANY_FILETYPES_PASCAL]->has_tags = TRUE;
|
||||
@ -153,6 +164,8 @@ void filetypes_init_types(void)
|
||||
#define ASM
|
||||
filetypes[GEANY_FILETYPES_ASM] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_ASM]->id = GEANY_FILETYPES_ASM;
|
||||
filetypes[GEANY_FILETYPES_ASM]->uid = 5; // never change this value
|
||||
filetypes[GEANY_FILETYPES_ASM]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_ASM]->lang = 9;
|
||||
filetypes[GEANY_FILETYPES_ASM]->name = g_strdup("ASM");
|
||||
filetypes[GEANY_FILETYPES_ASM]->has_tags = TRUE;
|
||||
@ -170,6 +183,8 @@ void filetypes_init_types(void)
|
||||
#define CAML
|
||||
filetypes[GEANY_FILETYPES_CAML] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_CAML]->id = GEANY_FILETYPES_CAML;
|
||||
filetypes[GEANY_FILETYPES_CAML]->uid = 6; // never change this value
|
||||
filetypes[GEANY_FILETYPES_CAML]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_CAML]->lang = -2;
|
||||
filetypes[GEANY_FILETYPES_CAML]->name = g_strdup("CAML");
|
||||
filetypes[GEANY_FILETYPES_CAML]->has_tags = FALSE;
|
||||
@ -188,6 +203,8 @@ void filetypes_init_types(void)
|
||||
#define PERL
|
||||
filetypes[GEANY_FILETYPES_PERL] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_PERL]->id = GEANY_FILETYPES_PERL;
|
||||
filetypes[GEANY_FILETYPES_PERL]->uid = 7; // never change this value
|
||||
filetypes[GEANY_FILETYPES_PERL]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_PERL]->lang = 5;
|
||||
filetypes[GEANY_FILETYPES_PERL]->name = g_strdup("Perl");
|
||||
filetypes[GEANY_FILETYPES_PERL]->has_tags = TRUE;
|
||||
@ -207,6 +224,8 @@ void filetypes_init_types(void)
|
||||
#define PHP
|
||||
filetypes[GEANY_FILETYPES_PHP] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_PHP]->id = GEANY_FILETYPES_PHP;
|
||||
filetypes[GEANY_FILETYPES_PHP]->uid = 8; // never change this value
|
||||
filetypes[GEANY_FILETYPES_PHP]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_PHP]->lang = 6;
|
||||
filetypes[GEANY_FILETYPES_PHP]->name = g_strdup("PHP");
|
||||
filetypes[GEANY_FILETYPES_PHP]->has_tags = TRUE;
|
||||
@ -230,6 +249,8 @@ void filetypes_init_types(void)
|
||||
#define PYTHON
|
||||
filetypes[GEANY_FILETYPES_PYTHON] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_PYTHON]->id = GEANY_FILETYPES_PYTHON;
|
||||
filetypes[GEANY_FILETYPES_PYTHON]->uid = 9; // never change this value
|
||||
filetypes[GEANY_FILETYPES_PYTHON]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_PYTHON]->lang = 7;
|
||||
filetypes[GEANY_FILETYPES_PYTHON]->name = g_strdup("Python");
|
||||
filetypes[GEANY_FILETYPES_PYTHON]->has_tags = TRUE;
|
||||
@ -248,6 +269,8 @@ void filetypes_init_types(void)
|
||||
#define RUBY
|
||||
filetypes[GEANY_FILETYPES_RUBY] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_RUBY]->id = GEANY_FILETYPES_RUBY;
|
||||
filetypes[GEANY_FILETYPES_RUBY]->uid = 10; // never change this value
|
||||
filetypes[GEANY_FILETYPES_RUBY]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_RUBY]->lang = 14;
|
||||
filetypes[GEANY_FILETYPES_RUBY]->name = g_strdup("Ruby");
|
||||
filetypes[GEANY_FILETYPES_RUBY]->has_tags = TRUE;
|
||||
@ -267,6 +290,8 @@ void filetypes_init_types(void)
|
||||
#define TCL
|
||||
filetypes[GEANY_FILETYPES_TCL] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_TCL]->id = GEANY_FILETYPES_TCL;
|
||||
filetypes[GEANY_FILETYPES_TCL]->uid = 11; // never change this value
|
||||
filetypes[GEANY_FILETYPES_TCL]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_TCL]->lang = 15;
|
||||
filetypes[GEANY_FILETYPES_TCL]->name = g_strdup("Tcl");
|
||||
filetypes[GEANY_FILETYPES_TCL]->has_tags = TRUE;
|
||||
@ -286,6 +311,8 @@ void filetypes_init_types(void)
|
||||
#define SH
|
||||
filetypes[GEANY_FILETYPES_SH] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_SH]->id = GEANY_FILETYPES_SH;
|
||||
filetypes[GEANY_FILETYPES_SH]->uid = 12; // never change this value
|
||||
filetypes[GEANY_FILETYPES_SH]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_SH]->lang = 16;
|
||||
filetypes[GEANY_FILETYPES_SH]->name = g_strdup("Sh");
|
||||
filetypes[GEANY_FILETYPES_SH]->has_tags = TRUE;
|
||||
@ -309,6 +336,8 @@ void filetypes_init_types(void)
|
||||
#define MAKE
|
||||
filetypes[GEANY_FILETYPES_MAKE] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_MAKE]->id = GEANY_FILETYPES_MAKE;
|
||||
filetypes[GEANY_FILETYPES_MAKE]->uid = 13; // never change this value
|
||||
filetypes[GEANY_FILETYPES_MAKE]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_MAKE]->lang = 3;
|
||||
filetypes[GEANY_FILETYPES_MAKE]->name = g_strdup("Make");
|
||||
filetypes[GEANY_FILETYPES_MAKE]->has_tags = TRUE;
|
||||
@ -327,6 +356,8 @@ void filetypes_init_types(void)
|
||||
#define XML
|
||||
filetypes[GEANY_FILETYPES_XML] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_XML]->id = GEANY_FILETYPES_XML;
|
||||
filetypes[GEANY_FILETYPES_XML]->uid = 14; // never change this value
|
||||
filetypes[GEANY_FILETYPES_XML]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_XML]->lang = -2;
|
||||
filetypes[GEANY_FILETYPES_XML]->name = g_strdup("XML");
|
||||
filetypes[GEANY_FILETYPES_XML]->has_tags = FALSE;
|
||||
@ -345,6 +376,8 @@ void filetypes_init_types(void)
|
||||
#define DOCBOOK
|
||||
filetypes[GEANY_FILETYPES_DOCBOOK] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_DOCBOOK]->id = GEANY_FILETYPES_DOCBOOK;
|
||||
filetypes[GEANY_FILETYPES_DOCBOOK]->uid = 15; // never change this value
|
||||
filetypes[GEANY_FILETYPES_DOCBOOK]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_DOCBOOK]->lang = 12;
|
||||
filetypes[GEANY_FILETYPES_DOCBOOK]->name = g_strdup("Docbook");
|
||||
filetypes[GEANY_FILETYPES_DOCBOOK]->has_tags = TRUE;
|
||||
@ -362,6 +395,8 @@ void filetypes_init_types(void)
|
||||
#define CSS
|
||||
filetypes[GEANY_FILETYPES_CSS] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_CSS]->id = GEANY_FILETYPES_CSS;
|
||||
filetypes[GEANY_FILETYPES_CSS]->uid = 16; // never change this value;
|
||||
filetypes[GEANY_FILETYPES_CSS]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_CSS]->lang = 13;
|
||||
filetypes[GEANY_FILETYPES_CSS]->name = g_strdup("CSS");
|
||||
filetypes[GEANY_FILETYPES_CSS]->has_tags = TRUE;
|
||||
@ -379,6 +414,8 @@ void filetypes_init_types(void)
|
||||
#define SQL
|
||||
filetypes[GEANY_FILETYPES_SQL] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_SQL]->id = GEANY_FILETYPES_SQL;
|
||||
filetypes[GEANY_FILETYPES_SQL]->uid = 17; // never change this value
|
||||
filetypes[GEANY_FILETYPES_SQL]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_SQL]->lang = 11;
|
||||
filetypes[GEANY_FILETYPES_SQL]->name = g_strdup("SQL");
|
||||
filetypes[GEANY_FILETYPES_SQL]->has_tags = TRUE;
|
||||
@ -396,6 +433,8 @@ void filetypes_init_types(void)
|
||||
#define LATEX
|
||||
filetypes[GEANY_FILETYPES_LATEX] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_LATEX]->id = GEANY_FILETYPES_LATEX;
|
||||
filetypes[GEANY_FILETYPES_LATEX]->uid = 18; // never change this value
|
||||
filetypes[GEANY_FILETYPES_LATEX]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_LATEX]->lang = 8;
|
||||
filetypes[GEANY_FILETYPES_LATEX]->name = g_strdup("LaTeX");
|
||||
filetypes[GEANY_FILETYPES_LATEX]->has_tags = TRUE;
|
||||
@ -415,6 +454,8 @@ void filetypes_init_types(void)
|
||||
#define OMS
|
||||
filetypes[GEANY_FILETYPES_OMS] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_OMS]->id = GEANY_FILETYPES_OMS;
|
||||
filetypes[GEANY_FILETYPES_OMS]->uid = 19; // never change this value
|
||||
filetypes[GEANY_FILETYPES_OMS]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_OMS]->lang = -2;
|
||||
filetypes[GEANY_FILETYPES_OMS]->name = g_strdup("O-Matrix");
|
||||
filetypes[GEANY_FILETYPES_OMS]->has_tags = FALSE;
|
||||
@ -432,6 +473,8 @@ void filetypes_init_types(void)
|
||||
#define CONF
|
||||
filetypes[GEANY_FILETYPES_CONF] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_CONF]->id = GEANY_FILETYPES_CONF;
|
||||
filetypes[GEANY_FILETYPES_CONF]->uid = 20; // never change this value
|
||||
filetypes[GEANY_FILETYPES_CONF]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_CONF]->lang = 10;
|
||||
filetypes[GEANY_FILETYPES_CONF]->name = g_strdup("Conf");
|
||||
filetypes[GEANY_FILETYPES_CONF]->has_tags = TRUE;
|
||||
@ -454,6 +497,8 @@ void filetypes_init_types(void)
|
||||
filetypes[GEANY_FILETYPES_ALL] = g_new0(filetype, 1);
|
||||
filetypes[GEANY_FILETYPES_ALL]->id = GEANY_FILETYPES_ALL;
|
||||
filetypes[GEANY_FILETYPES_ALL]->name = g_strdup("None");
|
||||
filetypes[GEANY_FILETYPES_ALL]->uid = 21; // never change this value
|
||||
filetypes[GEANY_FILETYPES_ALL]->item = NULL;
|
||||
filetypes[GEANY_FILETYPES_ALL]->lang = -2;
|
||||
filetypes[GEANY_FILETYPES_ALL]->has_tags = FALSE;
|
||||
filetypes[GEANY_FILETYPES_ALL]->title = g_strdup(_("All files"));
|
||||
@ -521,9 +566,22 @@ filetype *filetypes_get_from_filename(const gchar *filename)
|
||||
}
|
||||
|
||||
|
||||
void filetypes_select_radio_item(const filetype *ft)
|
||||
{
|
||||
g_return_if_fail(ft != NULL);
|
||||
|
||||
// app->ignore_callback has to be set by the caller
|
||||
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(radio_items[ft->id]), TRUE);
|
||||
}
|
||||
|
||||
|
||||
static void filetypes_create_menu_item(GtkWidget *menu, gchar *label, filetype *ftype)
|
||||
{
|
||||
GtkWidget *tmp = gtk_menu_item_new_with_label(label);
|
||||
static GSList *group = NULL;
|
||||
GtkWidget *tmp;
|
||||
tmp = gtk_radio_menu_item_new_with_label(group, label);
|
||||
group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(tmp));
|
||||
radio_items[ftype->id] = tmp;
|
||||
gtk_widget_show(tmp);
|
||||
gtk_container_add(GTK_CONTAINER(menu), tmp);
|
||||
g_signal_connect((gpointer) tmp, "activate", G_CALLBACK(on_filetype_change), (gpointer) ftype);
|
||||
@ -532,10 +590,8 @@ static void filetypes_create_menu_item(GtkWidget *menu, gchar *label, filetype *
|
||||
|
||||
static void filetypes_create_newmenu_item(GtkWidget *menu, gchar *label, filetype *ftype)
|
||||
{
|
||||
gchar *new_label = g_strdup_printf("%s", label);
|
||||
GtkWidget *tmp_menu = gtk_menu_item_new_with_label(new_label);
|
||||
GtkWidget *tmp_button = gtk_menu_item_new_with_label(new_label);
|
||||
g_free(new_label);
|
||||
GtkWidget *tmp_menu = gtk_menu_item_new_with_label(label);
|
||||
GtkWidget *tmp_button = gtk_menu_item_new_with_label(label);
|
||||
gtk_widget_show(tmp_menu);
|
||||
gtk_widget_show(tmp_button);
|
||||
gtk_container_add(GTK_CONTAINER(menu), tmp_menu);
|
||||
|
@ -79,6 +79,7 @@ typedef struct filetype
|
||||
{
|
||||
guint id;
|
||||
guint uid; // unique id as reference for saved filetype in config file
|
||||
GtkWidget *item; // holds a pointer to the menu item for this filetypes
|
||||
langType lang; // represents the langType of tagmanager(see the table
|
||||
// in tagmanager/parsers.h), -1 represents all, -2 none
|
||||
gchar *name; // will be used as name for tagmanager
|
||||
@ -112,4 +113,6 @@ gchar *filetypes_get_template(filetype *ft);
|
||||
|
||||
void filetypes_get_config(GKeyFile *config, GKeyFile *configh, gint ft);
|
||||
|
||||
void filetypes_select_radio_item(const filetype *ft);
|
||||
|
||||
#endif
|
||||
|
120
src/interface.c
120
src/interface.c
@ -37,7 +37,7 @@ create_window1 (void)
|
||||
GtkWidget *menuitem1_menu;
|
||||
GtkWidget *menu_new1;
|
||||
GtkWidget *menu_new_with_template1;
|
||||
GtkWidget *image987;
|
||||
GtkWidget *image1017;
|
||||
GtkWidget *menu_new_with_template1_menu;
|
||||
GtkWidget *invisible2;
|
||||
GtkWidget *separator12;
|
||||
@ -49,11 +49,11 @@ create_window1 (void)
|
||||
GtkWidget *menu_save1;
|
||||
GtkWidget *menu_save_as1;
|
||||
GtkWidget *menu_save_all1;
|
||||
GtkWidget *image988;
|
||||
GtkWidget *image1018;
|
||||
GtkWidget *menu_reload1;
|
||||
GtkWidget *image989;
|
||||
GtkWidget *image1019;
|
||||
GtkWidget *menu_reload_as1;
|
||||
GtkWidget *image990;
|
||||
GtkWidget *image1020;
|
||||
GtkWidget *menu_reload_as1_menu;
|
||||
GtkWidget *invisible7;
|
||||
GtkWidget *separator21;
|
||||
@ -63,7 +63,7 @@ create_window1 (void)
|
||||
GtkWidget *separator14;
|
||||
GtkWidget *menu_close1;
|
||||
GtkWidget *menu_close_all1;
|
||||
GtkWidget *image991;
|
||||
GtkWidget *image1021;
|
||||
GtkWidget *menu_separatormenuitem1;
|
||||
GtkWidget *menu_quit1;
|
||||
GtkWidget *edit1;
|
||||
@ -79,11 +79,11 @@ create_window1 (void)
|
||||
GtkWidget *menu_select_all1;
|
||||
GtkWidget *separator25;
|
||||
GtkWidget *insert_include2;
|
||||
GtkWidget *image992;
|
||||
GtkWidget *image1022;
|
||||
GtkWidget *insert_include2_menu;
|
||||
GtkWidget *invisible4;
|
||||
GtkWidget *add_comments1;
|
||||
GtkWidget *image993;
|
||||
GtkWidget *image1023;
|
||||
GtkWidget *add_comments1_menu;
|
||||
GtkWidget *menu_add_changelog_entry1;
|
||||
GtkWidget *insert_file_header1;
|
||||
@ -111,18 +111,18 @@ create_window1 (void)
|
||||
GtkWidget *find_next1;
|
||||
GtkWidget *find_previous1;
|
||||
GtkWidget *replace1;
|
||||
GtkWidget *image994;
|
||||
GtkWidget *image1024;
|
||||
GtkWidget *separator27;
|
||||
GtkWidget *find_in_files1;
|
||||
GtkWidget *separator11;
|
||||
GtkWidget *go_to_line1;
|
||||
GtkWidget *image995;
|
||||
GtkWidget *image1025;
|
||||
GtkWidget *menuitem3;
|
||||
GtkWidget *menuitem3_menu;
|
||||
GtkWidget *menu_change_font1;
|
||||
GtkWidget *image996;
|
||||
GtkWidget *image1026;
|
||||
GtkWidget *menu_choose_color1;
|
||||
GtkWidget *image997;
|
||||
GtkWidget *image1027;
|
||||
GtkWidget *menu_separator4;
|
||||
GtkWidget *menu_fullscreen1;
|
||||
GtkWidget *menu_show_messages_window1;
|
||||
@ -149,6 +149,7 @@ create_window1 (void)
|
||||
GtkWidget *invisible6;
|
||||
GtkWidget *menu_line_endings1;
|
||||
GtkWidget *menu_line_endings1_menu;
|
||||
GSList *crlf_group = NULL;
|
||||
GtkWidget *crlf;
|
||||
GtkWidget *lf;
|
||||
GtkWidget *cr;
|
||||
@ -258,9 +259,9 @@ create_window1 (void)
|
||||
gtk_widget_show (menu_new_with_template1);
|
||||
gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_new_with_template1);
|
||||
|
||||
image987 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image987);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image987);
|
||||
image1017 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image1017);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image1017);
|
||||
|
||||
menu_new_with_template1_menu = gtk_menu_new ();
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_new_with_template1), menu_new_with_template1_menu);
|
||||
@ -305,25 +306,25 @@ create_window1 (void)
|
||||
gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_save_all1);
|
||||
gtk_tooltips_set_tip (tooltips, menu_save_all1, _("Saves all open files"), NULL);
|
||||
|
||||
image988 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image988);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image988);
|
||||
image1018 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image1018);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image1018);
|
||||
|
||||
menu_reload1 = gtk_image_menu_item_new_with_mnemonic (_("_Reload"));
|
||||
gtk_widget_show (menu_reload1);
|
||||
gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_reload1);
|
||||
|
||||
image989 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image989);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload1), image989);
|
||||
image1019 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image1019);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload1), image1019);
|
||||
|
||||
menu_reload_as1 = gtk_image_menu_item_new_with_mnemonic (_("R_eload as"));
|
||||
gtk_widget_show (menu_reload_as1);
|
||||
gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_reload_as1);
|
||||
|
||||
image990 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image990);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_as1), image990);
|
||||
image1020 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image1020);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_as1), image1020);
|
||||
|
||||
menu_reload_as1_menu = gtk_menu_new ();
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_reload_as1), menu_reload_as1_menu);
|
||||
@ -364,9 +365,9 @@ create_window1 (void)
|
||||
gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_close_all1);
|
||||
gtk_tooltips_set_tip (tooltips, menu_close_all1, _("Closes all open files"), NULL);
|
||||
|
||||
image991 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image991);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image991);
|
||||
image1021 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image1021);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image1021);
|
||||
|
||||
menu_separatormenuitem1 = gtk_separator_menu_item_new ();
|
||||
gtk_widget_show (menu_separatormenuitem1);
|
||||
@ -432,9 +433,9 @@ create_window1 (void)
|
||||
gtk_widget_show (insert_include2);
|
||||
gtk_container_add (GTK_CONTAINER (edit1_menu), insert_include2);
|
||||
|
||||
image992 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image992);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image992);
|
||||
image1022 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image1022);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image1022);
|
||||
|
||||
insert_include2_menu = gtk_menu_new ();
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_include2), insert_include2_menu);
|
||||
@ -446,9 +447,9 @@ create_window1 (void)
|
||||
gtk_widget_show (add_comments1);
|
||||
gtk_container_add (GTK_CONTAINER (edit1_menu), add_comments1);
|
||||
|
||||
image993 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image993);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image993);
|
||||
image1023 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image1023);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image1023);
|
||||
|
||||
add_comments1_menu = gtk_menu_new ();
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (add_comments1), add_comments1_menu);
|
||||
@ -566,9 +567,9 @@ create_window1 (void)
|
||||
gtk_widget_show (replace1);
|
||||
gtk_container_add (GTK_CONTAINER (search1_menu), replace1);
|
||||
|
||||
image994 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image994);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image994);
|
||||
image1024 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image1024);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image1024);
|
||||
|
||||
separator27 = gtk_separator_menu_item_new ();
|
||||
gtk_widget_show (separator27);
|
||||
@ -588,9 +589,9 @@ create_window1 (void)
|
||||
gtk_widget_show (go_to_line1);
|
||||
gtk_container_add (GTK_CONTAINER (search1_menu), go_to_line1);
|
||||
|
||||
image995 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image995);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line1), image995);
|
||||
image1025 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image1025);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line1), image1025);
|
||||
|
||||
menuitem3 = gtk_menu_item_new_with_mnemonic (_("_View"));
|
||||
gtk_widget_show (menuitem3);
|
||||
@ -604,18 +605,18 @@ create_window1 (void)
|
||||
gtk_container_add (GTK_CONTAINER (menuitem3_menu), menu_change_font1);
|
||||
gtk_tooltips_set_tip (tooltips, menu_change_font1, _("Change the default font"), NULL);
|
||||
|
||||
image996 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image996);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image996);
|
||||
image1026 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image1026);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image1026);
|
||||
|
||||
menu_choose_color1 = gtk_image_menu_item_new_with_mnemonic (_("Show _Colour Chooser"));
|
||||
gtk_widget_show (menu_choose_color1);
|
||||
gtk_container_add (GTK_CONTAINER (menuitem3_menu), menu_choose_color1);
|
||||
gtk_tooltips_set_tip (tooltips, menu_choose_color1, _("Open a color chooser dialog, to interactively pick colors from a palette."), NULL);
|
||||
|
||||
image997 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image997);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image997);
|
||||
image1027 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU);
|
||||
gtk_widget_show (image1027);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image1027);
|
||||
|
||||
menu_separator4 = gtk_separator_menu_item_new ();
|
||||
gtk_widget_show (menu_separator4);
|
||||
@ -731,15 +732,18 @@ create_window1 (void)
|
||||
menu_line_endings1_menu = gtk_menu_new ();
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_line_endings1), menu_line_endings1_menu);
|
||||
|
||||
crlf = gtk_menu_item_new_with_mnemonic (_("Convert and set to _CR/LF (Win)"));
|
||||
crlf = gtk_radio_menu_item_new_with_mnemonic (crlf_group, _("Convert and set to _CR/LF (Win)"));
|
||||
crlf_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (crlf));
|
||||
gtk_widget_show (crlf);
|
||||
gtk_container_add (GTK_CONTAINER (menu_line_endings1_menu), crlf);
|
||||
|
||||
lf = gtk_menu_item_new_with_mnemonic (_("Convert and set to _LF (Unix)"));
|
||||
lf = gtk_radio_menu_item_new_with_mnemonic (crlf_group, _("Convert and set to _LF (Unix)"));
|
||||
crlf_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (lf));
|
||||
gtk_widget_show (lf);
|
||||
gtk_container_add (GTK_CONTAINER (menu_line_endings1_menu), lf);
|
||||
|
||||
cr = gtk_menu_item_new_with_mnemonic (_("Convert and set to CR (_Mac)"));
|
||||
cr = gtk_radio_menu_item_new_with_mnemonic (crlf_group, _("Convert and set to CR (_Mac)"));
|
||||
crlf_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (cr));
|
||||
gtk_widget_show (cr);
|
||||
gtk_container_add (GTK_CONTAINER (menu_line_endings1_menu), cr);
|
||||
|
||||
@ -1354,7 +1358,7 @@ create_window1 (void)
|
||||
GLADE_HOOKUP_OBJECT (window1, menuitem1_menu, "menuitem1_menu");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_new1, "menu_new1");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_new_with_template1, "menu_new_with_template1");
|
||||
GLADE_HOOKUP_OBJECT (window1, image987, "image987");
|
||||
GLADE_HOOKUP_OBJECT (window1, image1017, "image1017");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_new_with_template1_menu, "menu_new_with_template1_menu");
|
||||
GLADE_HOOKUP_OBJECT (window1, invisible2, "invisible2");
|
||||
GLADE_HOOKUP_OBJECT (window1, separator12, "separator12");
|
||||
@ -1366,11 +1370,11 @@ create_window1 (void)
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_save1, "menu_save1");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_save_as1, "menu_save_as1");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_save_all1, "menu_save_all1");
|
||||
GLADE_HOOKUP_OBJECT (window1, image988, "image988");
|
||||
GLADE_HOOKUP_OBJECT (window1, image1018, "image1018");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_reload1, "menu_reload1");
|
||||
GLADE_HOOKUP_OBJECT (window1, image989, "image989");
|
||||
GLADE_HOOKUP_OBJECT (window1, image1019, "image1019");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_reload_as1, "menu_reload_as1");
|
||||
GLADE_HOOKUP_OBJECT (window1, image990, "image990");
|
||||
GLADE_HOOKUP_OBJECT (window1, image1020, "image1020");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_reload_as1_menu, "menu_reload_as1_menu");
|
||||
GLADE_HOOKUP_OBJECT (window1, invisible7, "invisible7");
|
||||
GLADE_HOOKUP_OBJECT (window1, separator21, "separator21");
|
||||
@ -1380,7 +1384,7 @@ create_window1 (void)
|
||||
GLADE_HOOKUP_OBJECT (window1, separator14, "separator14");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_close1, "menu_close1");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_close_all1, "menu_close_all1");
|
||||
GLADE_HOOKUP_OBJECT (window1, image991, "image991");
|
||||
GLADE_HOOKUP_OBJECT (window1, image1021, "image1021");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_separatormenuitem1, "menu_separatormenuitem1");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_quit1, "menu_quit1");
|
||||
GLADE_HOOKUP_OBJECT (window1, edit1, "edit1");
|
||||
@ -1396,11 +1400,11 @@ create_window1 (void)
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_select_all1, "menu_select_all1");
|
||||
GLADE_HOOKUP_OBJECT (window1, separator25, "separator25");
|
||||
GLADE_HOOKUP_OBJECT (window1, insert_include2, "insert_include2");
|
||||
GLADE_HOOKUP_OBJECT (window1, image992, "image992");
|
||||
GLADE_HOOKUP_OBJECT (window1, image1022, "image1022");
|
||||
GLADE_HOOKUP_OBJECT (window1, insert_include2_menu, "insert_include2_menu");
|
||||
GLADE_HOOKUP_OBJECT (window1, invisible4, "invisible4");
|
||||
GLADE_HOOKUP_OBJECT (window1, add_comments1, "add_comments1");
|
||||
GLADE_HOOKUP_OBJECT (window1, image993, "image993");
|
||||
GLADE_HOOKUP_OBJECT (window1, image1023, "image1023");
|
||||
GLADE_HOOKUP_OBJECT (window1, add_comments1_menu, "add_comments1_menu");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_add_changelog_entry1, "menu_add_changelog_entry1");
|
||||
GLADE_HOOKUP_OBJECT (window1, insert_file_header1, "insert_file_header1");
|
||||
@ -1428,18 +1432,18 @@ create_window1 (void)
|
||||
GLADE_HOOKUP_OBJECT (window1, find_next1, "find_next1");
|
||||
GLADE_HOOKUP_OBJECT (window1, find_previous1, "find_previous1");
|
||||
GLADE_HOOKUP_OBJECT (window1, replace1, "replace1");
|
||||
GLADE_HOOKUP_OBJECT (window1, image994, "image994");
|
||||
GLADE_HOOKUP_OBJECT (window1, image1024, "image1024");
|
||||
GLADE_HOOKUP_OBJECT (window1, separator27, "separator27");
|
||||
GLADE_HOOKUP_OBJECT (window1, find_in_files1, "find_in_files1");
|
||||
GLADE_HOOKUP_OBJECT (window1, separator11, "separator11");
|
||||
GLADE_HOOKUP_OBJECT (window1, go_to_line1, "go_to_line1");
|
||||
GLADE_HOOKUP_OBJECT (window1, image995, "image995");
|
||||
GLADE_HOOKUP_OBJECT (window1, image1025, "image1025");
|
||||
GLADE_HOOKUP_OBJECT (window1, menuitem3, "menuitem3");
|
||||
GLADE_HOOKUP_OBJECT (window1, menuitem3_menu, "menuitem3_menu");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_change_font1, "menu_change_font1");
|
||||
GLADE_HOOKUP_OBJECT (window1, image996, "image996");
|
||||
GLADE_HOOKUP_OBJECT (window1, image1026, "image1026");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_choose_color1, "menu_choose_color1");
|
||||
GLADE_HOOKUP_OBJECT (window1, image997, "image997");
|
||||
GLADE_HOOKUP_OBJECT (window1, image1027, "image1027");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_separator4, "menu_separator4");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_fullscreen1, "menu_fullscreen1");
|
||||
GLADE_HOOKUP_OBJECT (window1, menu_show_messages_window1, "menu_show_messages_window1");
|
||||
|
14
src/utils.c
14
src/utils.c
@ -2510,6 +2510,8 @@ gboolean utils_is_unicode_charset(const gchar *string)
|
||||
|
||||
void utils_document_show_hide(gint idx)
|
||||
{
|
||||
gchar *widget_name;
|
||||
|
||||
if (idx == -1 || ! doc_list[idx].is_valid) return;
|
||||
app->ignore_callback = TRUE;
|
||||
|
||||
@ -2526,9 +2528,21 @@ void utils_document_show_hide(gint idx)
|
||||
GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_write_unicode_bom1")),
|
||||
doc_list[idx].has_bom);
|
||||
|
||||
switch (sci_get_eol_mode(doc_list[idx].sci))
|
||||
{
|
||||
case SC_EOL_CR: widget_name = "cr"; break;
|
||||
case SC_EOL_LF: widget_name = "lf"; break;
|
||||
default: widget_name = "crlf"; break;
|
||||
}
|
||||
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(app->window, widget_name)),
|
||||
TRUE);
|
||||
|
||||
gtk_widget_set_sensitive(lookup_widget(app->window, "menu_write_unicode_bom1"),
|
||||
utils_is_unicode_charset(doc_list[idx].encoding));
|
||||
|
||||
encodings_select_radio_item(doc_list[idx].encoding);
|
||||
filetypes_select_radio_item(doc_list[idx].file_type);
|
||||
|
||||
app->ignore_callback = FALSE;
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user