95#define SHOW_ERR(args) dialogs_show_msgbox(GTK_MESSAGE_ERROR, args)
96#define SHOW_ERR1(args, more) dialogs_show_msgbox(GTK_MESSAGE_ERROR, args, more)
97#define MAX_NAME_LEN 50
100#define PROJECT_DIR _("projects")
123 _(
"Move the current documents into the new project's session?")))
156 GTK_DIALOG_DESTROY_WITH_PARENT,
157 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
NULL);
159 gtk_widget_set_name(e.
dialog,
"GeanyDialogProject");
161 gtk_widget_set_can_default(button, TRUE);
162 gtk_window_set_default(GTK_WINDOW(e.
dialog), button);
163 gtk_dialog_add_action_widget(GTK_DIALOG(e.
dialog), button, GTK_RESPONSE_OK);
167 table = gtk_table_new(3, 2, FALSE);
168 gtk_table_set_row_spacings(GTK_TABLE(table), 5);
169 gtk_table_set_col_spacings(GTK_TABLE(table), 10);
171 label = gtk_label_new(
_(
"Name:"));
172 gtk_misc_set_alignment(GTK_MISC(
label), 1, 0);
174 e.
name = gtk_entry_new();
175 gtk_entry_set_activates_default(GTK_ENTRY(e.
name), TRUE);
178 gtk_widget_set_tooltip_text(e.
name,
_(
"Project name"));
182 label = gtk_label_new(
_(
"Filename:"));
183 gtk_misc_set_alignment(GTK_MISC(
label), 1, 0);
186 gtk_entry_set_activates_default(GTK_ENTRY(e.
file_name), TRUE);
188 gtk_entry_set_width_chars(GTK_ENTRY(e.
file_name), 30);
189 tooltip = g_strdup_printf(
190 _(
"Path of the file representing the project and storing its settings. "
192 gtk_widget_set_tooltip_text(e.
file_name, tooltip);
194 button = gtk_button_new();
196 image = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON);
198 bbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
199 gtk_box_pack_start(GTK_BOX(bbox), e.
file_name, TRUE, TRUE, 0);
200 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
204 label = gtk_label_new(
_(
"Base path:"));
205 gtk_misc_set_alignment(GTK_MISC(
label), 1, 0);
208 gtk_entry_set_activates_default(GTK_ENTRY(e.
base_path), TRUE);
211 _(
"Base directory of all files that make up the project. "
212 "This can be a new path, or an existing directory tree. "
213 "You can use paths relative to the project filename."));
215 GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_ENTRY(e.
base_path));
219 gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);
231 gtk_widget_destroy(e.
dialog);
239 if (gtk_dialog_run(GTK_DIALOG(e->
dialog)) != GTK_RESPONSE_OK ||
249 SHOW_ERR(
_(
"Project file could not be written"));
260 while (gtk_dialog_run(GTK_DIALOG(e->
dialog)) == GTK_RESPONSE_OK);
292 while (gtk_dialog_run(
dialog) == GTK_RESPONSE_ACCEPT)
294 gchar *
filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(
dialog));
302 SHOW_ERR1(
_(
"Project file \"%s\" could not be loaded."), utf8_filename);
303 gtk_widget_grab_focus(GTK_WIDGET(
dialog));
304 g_free(utf8_filename);
321 gchar *file = win32_show_project_open_dialog(
main_widgets.
window,
_(
"Open Project"), dir, FALSE, TRUE);
328 SHOW_ERR1(
_(
"Project file \"%s\" could not be loaded."), file);
341 GTK_FILE_CHOOSER_ACTION_OPEN,
342 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
343 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL);
344 gtk_widget_set_name(
dialog,
"GeanyDialogProject");
347 gtk_dialog_set_default_response(GTK_DIALOG(
dialog), GTK_RESPONSE_ACCEPT);
348 gtk_window_set_destroy_with_parent(GTK_WINDOW(
dialog), TRUE);
349 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(
dialog), TRUE);
350 gtk_window_set_type_hint(GTK_WINDOW(
dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
352 gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(
dialog), TRUE);
355 filter = gtk_file_filter_new();
356 gtk_file_filter_set_name(
filter,
_(
"All files"));
357 gtk_file_filter_add_pattern(
filter,
"*");
358 gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(
dialog),
filter);
359 filter = gtk_file_filter_new();
360 gtk_file_filter_set_name(
filter,
_(
"Project files"));
362 gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(
dialog),
filter);
363 gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(
dialog),
filter);
366 if (g_file_test(locale_path, G_FILE_TEST_EXISTS) &&
367 g_file_test(locale_path, G_FILE_TEST_IS_DIR))
369 gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(
dialog), locale_path);
375 gtk_widget_destroy(GTK_WIDGET(
dialog));
434 g_signal_emit_by_name(
geany_object,
"project-before-close");
485 GtkWidget *base_path_entry)
489 g_return_if_fail(base_path_entry !=
NULL);
490 g_return_if_fail(GTK_IS_WIDGET(base_path_entry));
492 dialog = gtk_file_chooser_dialog_new(
_(
"Choose Project Base Path"),
493 NULL, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
494 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
495 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
498 if (gtk_dialog_run(GTK_DIALOG(
dialog)) == GTK_RESPONSE_ACCEPT)
500 gtk_entry_set_text(GTK_ENTRY(base_path_entry),
501 gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(
dialog)));
504 gtk_widget_destroy(
dialog);
510 GtkWidget *build_table, *
label;
518 gtk_container_set_border_width(GTK_CONTAINER(build_table), 6);
519 label = gtk_label_new(
_(
"Build"));
528 static guint base_path_button_handler_id = 0;
529 static guint radio_long_line_handler_id = 0;
546 if (base_path_button_handler_id == 0)
549 base_path_button_handler_id =
550 g_signal_connect(wid,
"clicked",
556 if (radio_long_line_handler_id == 0)
559 radio_long_line_handler_id =
560 g_signal_connect(wid,
"toggled",
570 GtkWidget *widget =
NULL;
571 GtkWidget *radio_long_line_custom;
575 GtkTextBuffer *buffer;
588 gtk_entry_set_text(GTK_ENTRY(e.
name), p->
name);
597 case 2: widget = radio_long_line_custom;
break;
599 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
606 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(e.
description));
611 gtk_entry_set_text(GTK_ENTRY(e.
patterns), entry_text);
621 gtk_notebook_set_current_page(GTK_NOTEBOOK(e.
notebook), 0);
623 while (gtk_dialog_run(GTK_DIALOG(e.
dialog)) == GTK_RESPONSE_OK)
629 SHOW_ERR(
_(
"Project file could not be written"));
641 gtk_widget_hide(e.
dialog);
665 _(
"Do you want to close it before proceeding?"),
703 const gchar *
name, *file_name, *base_path;
704 gchar *locale_filename;
709 g_return_val_if_fail(e !=
NULL, TRUE);
711 name = gtk_entry_get_text(GTK_ENTRY(e->
name));
712 name_len = strlen(
name);
715 SHOW_ERR(
_(
"The specified project name is too short."));
716 gtk_widget_grab_focus(e->
name);
722 gtk_widget_grab_focus(e->
name);
727 file_name = gtk_entry_get_text(GTK_ENTRY(e->
file_name));
729 file_name = gtk_label_get_text(GTK_LABEL(e->
file_name));
731 if (G_UNLIKELY(
EMPTY(file_name)))
733 SHOW_ERR(
_(
"You have specified an invalid project filename."));
739 base_path = gtk_entry_get_text(GTK_ENTRY(e->
base_path));
740 if (!
EMPTY(base_path))
744 if (! g_path_is_absolute(locale_path))
746 gchar *dir = g_path_get_dirname(locale_filename);
747 SETPTR(locale_path, g_build_filename(dir, locale_path,
NULL));
751 if (! g_file_test(locale_path, G_FILE_TEST_IS_DIR))
756 _(
"Create the project's base path directory?"),
757 _(
"The path \"%s\" does not exist."),
763 if (! create_dir || err_code != 0)
766 SHOW_ERR1(
_(
"Project base directory could not be created (%s)."),
767 g_strerror(err_code));
777 (err_code = g_file_test(locale_filename, G_FILE_TEST_IS_DIR) ? EISDIR : 0) != 0)
779 SHOW_ERR1(
_(
"Project file could not be written (%s)."), g_strerror(err_code));
781 g_free(locale_filename);
784 else if (new_project && g_file_test(locale_filename, G_FILE_TEST_EXISTS) &&
787 _(
"The file '%s' already exists. Do you want to overwrite it?"),
791 g_free(locale_filename);
794 g_free(locale_filename);
810 GtkTextIter start, end;
811 GtkTextBuffer *buffer;
813 GeanyBuildCommand *oldvalue;
821 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(e->
description));
822 gtk_text_buffer_get_start_iter(buffer, &start);
823 gtk_text_buffer_get_end_iter(buffer, &end);
843 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
848 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
860 tmp = g_strdup(gtk_entry_get_text(GTK_ENTRY(e->
patterns)));
863 str = g_string_new(tmp);
866 g_string_free(str, TRUE);
880 const gchar *utf8_filename = gtk_entry_get_text(GTK_ENTRY(
entry));
883 if (g_path_is_absolute(locale_filename))
885 if (g_file_test(locale_filename, G_FILE_TEST_EXISTS))
890 if (g_file_test(locale_filename, G_FILE_TEST_IS_DIR))
891 gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(
dialog), locale_filename);
893 gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(
dialog), utf8_filename);
897 gchar *locale_dir = g_path_get_dirname(locale_filename);
898 gchar *
name = g_path_get_basename(utf8_filename);
900 if (g_file_test(locale_dir, G_FILE_TEST_EXISTS))
901 gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(
dialog), locale_dir);
902 gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(
dialog),
name);
908 else if (gtk_file_chooser_get_action(GTK_FILE_CHOOSER(
dialog)) != GTK_FILE_CHOOSER_ACTION_OPEN)
910 gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(
dialog), utf8_filename);
912 g_free(locale_filename);
915 if (gtk_dialog_run(GTK_DIALOG(
dialog)) == GTK_RESPONSE_ACCEPT)
917 gchar *
filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(
dialog));
920 gtk_entry_set_text(GTK_ENTRY(
entry), tmp_utf8_filename);
922 g_free(tmp_utf8_filename);
925 gtk_widget_destroy(
dialog);
933 gchar *path = win32_show_project_open_dialog(e->
dialog,
_(
"Choose Project Filename"),
934 gtk_entry_get_text(GTK_ENTRY(e->
file_name)), TRUE, TRUE);
937 gtk_entry_set_text(GTK_ENTRY(e->
file_name), path);
944 dialog = gtk_file_chooser_dialog_new(
_(
"Choose Project Filename"),
NULL,
945 GTK_FILE_CHOOSER_ACTION_SAVE,
946 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
947 GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
NULL);
948 gtk_widget_set_name(
dialog,
"GeanyDialogProject");
949 gtk_window_set_destroy_with_parent(GTK_WINDOW(
dialog), TRUE);
950 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(
dialog), TRUE);
951 gtk_window_set_type_hint(GTK_WINDOW(
dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
952 gtk_dialog_set_default_response(GTK_DIALOG(
dialog), GTK_RESPONSE_ACCEPT);
965 const gchar *project_dir =
local_prefs.project_file_path;
970 name = gtk_editable_get_chars(editable, 0, -1);
973 base_path = g_strconcat(project_dir, G_DIR_SEPARATOR_S,
976 file_name = g_strconcat(project_dir, G_DIR_SEPARATOR_S,
name, G_DIR_SEPARATOR_S,
979 file_name = g_strconcat(project_dir, G_DIR_SEPARATOR_S,
984 base_path = g_strconcat(project_dir, G_DIR_SEPARATOR_S,
NULL);
985 file_name = g_strconcat(project_dir, G_DIR_SEPARATOR_S,
NULL);
989 gtk_entry_set_text(GTK_ENTRY(e->
base_path), base_path);
990 gtk_entry_set_text(GTK_ENTRY(e->
file_name), file_name);
1007 gtk_widget_set_sensitive(spin_long_line, gtk_toggle_button_get_active(radio));
1013 g_return_val_if_fail(locale_file_name !=
NULL, FALSE);
1022 g_free(utf8_filename);
1029 ui_set_statusbar(TRUE,
_(
"Project file \"%s\" could not be loaded."), utf8_filename);
1030 g_free(utf8_filename);
1049 config = g_key_file_new();
1050 if (! g_key_file_load_from_file(config,
filename, G_KEY_FILE_NONE,
NULL))
1052 g_key_file_free(config);
1068 "long_line_behaviour", 1 );
1083 g_signal_emit_by_name(
geany_object,
"project-open", config);
1084 g_key_file_free(config);
1108 gboolean ret = FALSE;
1115 config = g_key_file_new();
1118 g_key_file_load_from_file(config,
filename, G_KEY_FILE_NONE,
NULL);
1123 g_key_file_set_string(config,
"project",
"name", p->
name);
1124 g_key_file_set_string(config,
"project",
"base_path", p->
base_path);
1127 g_key_file_set_string(config,
"project",
"description", p->
description);
1129 g_key_file_set_string_list(config,
"project",
"file_patterns",
1134 g_key_file_set_integer(config,
"long line marker",
"long_line_column", p->
priv->
long_line_column);
1140 g_signal_emit_by_name(
geany_object,
"project-save", config);
1142 data = g_key_file_to_data(config,
NULL,
NULL);
1147 g_key_file_free(config);
1162 SHOW_ERR(
_(
"Project file could not be written"));
1177 if (g_path_is_absolute(project->
base_path))
1182 gchar *dir = g_path_get_dirname(project->
file_name);
1203 const gchar *utf8_filename = (project ==
NULL) ?
"" : project->
file_name;
1205 g_key_file_set_string(config,
"project",
"session_file", utf8_filename);
1207 g_key_file_set_string(config,
"project",
"project_file_path",
1218 "session_file",
"");
1221 "project_file_path",
NULL);
1234 static gboolean callback_setup = FALSE;
1239 if (! callback_setup)
1241 callback_setup = TRUE;
1243 GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_ENTRY(
path_entry));
1254 str = gtk_entry_get_text(GTK_ENTRY(
path_entry));
1264 if (!apply_defaults)
1267 kf = g_key_file_new();
1269 g_key_file_free(kf);
1284 "indent_width", 4,
"spin_indent_width_project");
1293 "indent_hard_tab_width", 8);
1295 "detect_indent", FALSE,
"check_detect_indent_type_project");
1297 "detect_indent_width", FALSE,
"check_detect_indent_width_project");
1319 "check_auto_multiline1");
1324#define COPY_PREF(dest, prefname)\
1325 (dest.prefname = priv.prefname)
1336 COPY_PREF(fp, ensure_convert_new_lines);
void build_free_fields(BuildTableData table_data)
void build_save_menu(GKeyFile *config, gpointer ptr, GeanyBuildSource src)
void build_menu_update(GeanyDocument *doc)
void build_load_menu(GKeyFile *config, GeanyBuildSource src, gpointer p)
GtkWidget * build_commands_table(GeanyDocument *doc, GeanyBuildSource dst, BuildTableData *table_data, GeanyFiletype *ft)
void build_read_project(GeanyFiletype *ft, BuildTableData build_properties)
void build_remove_menu_item(const GeanyBuildSource src, const GeanyBuildGroup grp, const gint cmd)
Remove the specified Build menu item.
Interface to the Build menu functionality.
@ GEANY_GBG_NON_FT
non filetype items.
@ GEANY_GBG_EXEC
execute items
@ GEANY_BCS_PROJ
Project file if open.
gboolean dialogs_show_question_full(GtkWidget *parent, const gchar *yes_btn, const gchar *no_btn, const gchar *extra_text, const gchar *main_text,...)
gboolean dialogs_show_question(const gchar *text,...)
Shows a question message box with text and Yes/No buttons.
File related dialogs, miscellaneous dialogs, font dialog.
GeanyDocument * document_get_current(void)
Finds the current document.
gboolean document_close_all(void)
GeanyDocument * document_new_file_if_non_open(void)
GeanyFilePrefs file_prefs
Document related actions: new, save, open, etc.
#define documents
Wraps GeanyData::documents_array so it can be used with C array syntax.
#define foreach_document(i)
Iterates all valid document indexes.
const GeanyIndentPrefs * editor_get_indent_prefs(GeanyEditor *editor)
Gets the indentation prefs for the editor.
void editor_apply_update_prefs(GeanyEditor *editor)
GeanyEditorPrefs editor_prefs
Editor-related functions for GeanyEditor.
@ GEANY_AUTOINDENT_CURRENTCHARS
@ GEANY_INDENT_TYPE_BOTH
Both.
@ GEANY_INDENT_TYPE_TABS
Tabs.
@ GEANY_INDENT_TYPE_SPACES
Spaces.
static GtkWidget * path_entry
#define GEANY_STRING_UNTITLED
void configuration_reload_default_session(void)
void configuration_open_files(void)
void configuration_clear_default_session(void)
void configuration_save_default_session(void)
void configuration_load_session_files(GKeyFile *config, gboolean read_recent_files)
void configuration_save_session_files(GKeyFile *config)
CommandLineOptions cl_options
Main program-related commands.
static gboolean update_config(const PropertyDialogElements *e, gboolean new_project)
static gboolean write_config(void)
static void show_project_properties(gboolean show_build)
void project_build_properties(void)
struct _PropertyDialogElements PropertyDialogElements
static void run_new_dialog(PropertyDialogElements *e)
gchar * project_get_base_path(void)
static void apply_editor_prefs(void)
static void init_stash_prefs(void)
gboolean project_close(gboolean open_default)
void project_write_config(void)
Forces the project file rewrite and emission of the project-save signal.
void project_apply_prefs(void)
static void run_dialog(GtkWidget *dialog, GtkWidget *entry)
static void destroy_project(gboolean open_default)
static void run_open_dialog(GtkDialog *dialog)
static gboolean handle_current_session(void)
void project_finalize(void)
static GeanyProjectPrivate priv
gboolean project_load_file_with_session(const gchar *locale_file_name)
static void insert_build_page(PropertyDialogElements *e)
static void on_entries_changed(GtkEditable *editable, PropertyDialogElements *e)
gchar * project_file_path
void project_load_prefs(GKeyFile *config)
gboolean project_load_file(const gchar *locale_file_name)
static void create_properties_dialog(PropertyDialogElements *e)
static GeanyProject * create_project(void)
static void on_project_properties_base_path_button_clicked(GtkWidget *button, GtkWidget *base_path_entry)
ProjectPrefs project_prefs
void project_setup_prefs(void)
static void on_radio_long_line_custom_toggled(GtkToggleButton *radio, GtkWidget *spin_long_line)
const GeanyFilePrefs * project_get_file_prefs(void)
#define SHOW_ERR1(args, more)
static gboolean load_config(const gchar *filename)
#define COPY_PREF(dest, prefname)
gboolean project_ask_close(void)
static struct @102 local_prefs
static void on_file_save_button_clicked(GtkButton *button, PropertyDialogElements *e)
static void add_stash_group(StashGroup *group, gboolean apply_defaults)
static GSList * stash_groups
static GeanyIndentPrefs indentation
void project_save_prefs(GKeyFile *config)
static void update_ui(void)
static void on_name_entry_changed(GtkEditable *editable, PropertyDialogElements *e)
void project_properties(void)
static gboolean have_session_docs(void)
static void remove_foreach_project_filetype(gpointer data, gpointer user_data)
#define GEANY_PROJECT_EXT
stash_group_update(group, dialog)
stash_group_add_toggle_button(group, &want_handle, "handle", TRUE, "check_handle")
gtk_container_add(GTK_CONTAINER(dialog->vbox), check_button)
gtk_widget_show_all(dialog)
stash_group_display(group, dialog)
void stash_group_add_spin_button_integer(StashGroup *group, gint *setting, const gchar *key_name, gint default_value, StashWidgetID widget_id)
Adds a GtkSpinButton widget pref.
void stash_group_add_radio_buttons(StashGroup *group, gint *setting, const gchar *key_name, gint default_value, StashWidgetID widget_id, gint enum_id,...)
Adds a GtkRadioButton widget group pref.
void stash_group_save_to_key_file(StashGroup *group, GKeyFile *keyfile)
Writes group settings into key values in keyfile.
void stash_group_add_integer(StashGroup *group, gint *setting, const gchar *key_name, gint default_value)
Adds integer setting.
void stash_group_load_from_key_file(StashGroup *group, GKeyFile *keyfile)
Reads key values from keyfile into the group settings.
void stash_group_add_combo_box(StashGroup *group, gint *setting, const gchar *key_name, gint default_value, StashWidgetID widget_id)
Adds a GtkComboBox widget pref.
void stash_group_set_use_defaults(StashGroup *group, gboolean use_defaults)
StashGroup * stash_group_new(const gchar *name)
Creates a new group.
void stash_group_free(StashGroup *group)
Frees a group.
Lightweight library for reading/writing GKeyFile settings and synchronizing widgets with C variables.
struct GeanyProject * project
Currently active project or NULL if none is open.
Structure for representing an open tab with all its properties.
gchar * file_name
The UTF-8 encoded file name.
gboolean changed
Whether this document has been changed since it was last saved.
GeanyFiletype * file_type
The filetype for this document, it's only a reference to one of the elements of the global filetypes ...
gboolean auto_continue_multiline
gboolean strip_trailing_spaces
gboolean ensure_convert_new_lines
gchar * projerror_regex_string
GeanyBuildCommand * projfilecmds
GeanyBuildCommand * projexeccmds
struct GeanyFiletypePrivate * priv
Indentation prefs that might be different according to project or filetype.
GeanyIndentType type
Whether to use tabs, spaces or both to indent.
gint hard_tab_width
Width of a tab, but only when using GEANY_INDENT_TYPE_BOTH.
GeanyAutoIndent auto_indent_mode
gboolean use_native_windows_dialogs
whether to use native Windows' dialogs (only used on Windows)
GtkWidget * window
Main window.
GtkWidget * notebook
Document notebook.
struct GeanyIndentPrefs * indentation
GPtrArray * build_filetypes_list
gboolean auto_continue_multiline
gboolean ensure_convert_new_lines
gboolean strip_trailing_spaces
Structure for representing a project.
GStrv file_patterns
Array of filename extension patterns.
gchar * file_name
Where the project file is stored (in UTF-8).
gchar * description
Short description of the project.
struct GeanyProjectPrivate * priv
gchar * base_path
Base path of the project directory (in UTF-8, maybe relative).
gchar * name
The name of the project.
gboolean entries_modified
BuildTableData build_properties
Defines internationalization macros.
void ui_table_add_row(GtkTable *table, gint row,...)
Packs all GtkWidgets passed after the row argument into a table, using one widget per cell.
GtkWidget * ui_dialog_vbox_new(GtkDialog *dialog)
Makes a fixed border for dialogs without increasing the button box border.
GtkWidget * create_project_dialog(void)
void ui_add_recent_project_file(const gchar *utf8_filename)
GtkWidget * ui_path_box_new(const gchar *title, GtkFileChooserAction action, GtkEntry *entry)
Creates a GtkHBox with entry packed into it and an open button which runs a file chooser,...
void ui_set_window_title(GeanyDocument *doc)
GeanyMainWidgets main_widgets
void ui_entry_add_clear_icon(GtkEntry *entry)
Adds a small clear icon to the right end of the passed entry.
void ui_set_statusbar(gboolean log, const gchar *format,...)
Displays text on the statusbar.
void ui_focus_current_document(void)
GtkWidget * ui_button_new_with_image(const gchar *stock_id, const gchar *text)
Creates a GtkButton with custom text and a stock image similar to gtk_button_new_from_stock().
void ui_update_recent_project_menu(void)
GtkWidget * ui_lookup_widget(GtkWidget *widget, const gchar *widget_name)
Returns a widget from a name in a component, usually created by Glade.
void ui_setup_open_button_callback(GtkWidget *open_btn, const gchar *title, GtkFileChooserAction action, GtkEntry *entry)
GeanyInterfacePrefs interface_prefs
User Interface general utility functions.
gint utils_write_file(const gchar *filename, const gchar *text)
Writes text into a file named filename.
guint utils_string_replace_all(GString *haystack, const gchar *needle, const gchar *replace)
Replaces all occurrences of needle in haystack with replace.
gint utils_get_setting_integer(GKeyFile *config, const gchar *section, const gchar *key, const gint default_value)
Wraps g_key_file_get_integer() to add a default value argument.
gchar * utils_get_utf8_from_locale(const gchar *locale_text)
Converts the given string (in locale encoding) into UTF-8 encoding.
gint utils_mkdir(const gchar *path, gboolean create_parent_dirs)
Creates a directory if it doesn't already exist.
gboolean utils_str_equal(const gchar *a, const gchar *b)
NULL-safe string comparison.
gchar * utils_get_setting_string(GKeyFile *config, const gchar *section, const gchar *key, const gchar *default_value)
Wraps g_key_file_get_string() to add a default value argument.
void utils_free_pointers(gsize arg_count,...)
gint utils_is_file_writable(const gchar *locale_filename)
gchar * utils_get_locale_from_utf8(const gchar *utf8_text)
Converts the given UTF-8 encoded string into locale encoding.
General utility functions, non-GTK related.
#define foreach_slist(node, list)
Iterates all the nodes in list.
#define SETPTR(ptr, result)
Assigns result to ptr, then frees the old value.
#define EMPTY(ptr)
Returns TRUE if ptr is NULL or *ptr is FALSE.