Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workbench #598

Closed
wants to merge 74 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
87b6d5c
New plugin 'workbench': initial commit.
lpaulsen93 Jul 30, 2017
4f5563d
Removed accidentally committed test files.
lpaulsen93 Jul 31, 2017
770bfbc
Put own content in NEWS file.
lpaulsen93 Jul 31, 2017
b5b9cc2
Also display context menu if nothing is selected in the workbench sid…
lpaulsen93 Jul 31, 2017
2890905
Added some content to the README file.
lpaulsen93 Jul 31, 2017
3a47865
Code cleanup.
lpaulsen93 Aug 2, 2017
1cb06e1
On adding a directory to a project, set the location of the project f…
lpaulsen93 Aug 2, 2017
dc219bd
Fixed to small buffer in function 'wb_project_load()'.
lpaulsen93 Aug 3, 2017
3e2c7c7
Only update project title in sidebar on saving of a project.
lpaulsen93 Aug 3, 2017
b93eb75
Cleaned up comment style.
lpaulsen93 Aug 3, 2017
b4cd244
Workbench: updated german translation. Fixed strings that do not need…
lpaulsen93 Aug 13, 2017
008194a
Fixed wrong parameter passed for error message.
lpaulsen93 Aug 14, 2017
4104285
Restored translation files without "real" changes.
lpaulsen93 Aug 18, 2017
b77f73a
Merge branch 'master' into workbench
LarsGit223 Aug 18, 2017
389d827
Added mnemonic for "Create" in dialog "Create new workbench".
lpaulsen93 Aug 18, 2017
7c66abf
Do not convert encoding of filename strings returned by file chooser …
lpaulsen93 Aug 18, 2017
fc99613
Added mnemonic for "Open" for "Open workbench" dialog.
lpaulsen93 Aug 18, 2017
76d1253
Replaced spaces with tab.
lpaulsen93 Aug 18, 2017
66acbb9
Fixed spaces between function names and the opening parenthesis.
lpaulsen93 Aug 18, 2017
7a9d154
Added mnemonic for "Add" for dialogs "Add project" and "Add directory".
lpaulsen93 Aug 18, 2017
8211ea8
Replaced spaces with tab.
lpaulsen93 Aug 18, 2017
d921260
Added mnemonics for workbench menu.
lpaulsen93 Aug 18, 2017
74a634c
Removed calls to "geany_plugin_set_data()" in menu.c.
lpaulsen93 Aug 18, 2017
e39fea5
Fixed useless leftover conditional return at end of function.
lpaulsen93 Aug 18, 2017
556f03f
Corrected storage class for "plugin_workbench_callbacks".
lpaulsen93 Aug 18, 2017
549cd76
Do not use "&&" in if conditions alone in a line.
lpaulsen93 Aug 19, 2017
4d1c33d
Removed useless casts to "gpointer" in calls to "g_signal_connect".
lpaulsen93 Aug 19, 2017
4451157
Use "g_slist_free_full()" to minimize code.
lpaulsen93 Aug 19, 2017
61b0991
Fixed increment of pointer, instead increment the value pointed to.
lpaulsen93 Aug 19, 2017
aff5cb9
Check for NULL pointers before calling "g_object_unref(icon)".
lpaulsen93 Aug 19, 2017
8846193
Replaced too similar variable names.
lpaulsen93 Aug 19, 2017
dc98c37
Replaced spaces with tab.
lpaulsen93 Aug 19, 2017
465d9ae
Replaced "strdup()" with "g_strdup()".
lpaulsen93 Aug 19, 2017
bbe27e8
Improved code for determining the "POPUP_CONTEXT".
lpaulsen93 Aug 19, 2017
6ae0a3b
Removed unused struct.
lpaulsen93 Aug 19, 2017
36fbfb6
Free old strings in "wb_project_set_filename()" (not happening today …
lpaulsen93 Aug 19, 2017
0212100
Fixed missing "const" qualifiers.
lpaulsen93 Aug 19, 2017
13d3b70
Minimized code by using "g_slist_free_full()".
lpaulsen93 Aug 19, 2017
cace73d
Fixed missing "g_dir_close()".
lpaulsen93 Aug 19, 2017
7574055
Removed useless cast.
lpaulsen93 Aug 19, 2017
00b8941
Small code improvement in "wb_project_dir_rescan_int()".
lpaulsen93 Aug 19, 2017
109b8d0
Use "g_return_val_if_fail()" instead of producing an own error message.
lpaulsen93 Aug 19, 2017
e0de82b
Minimized code.
lpaulsen93 Aug 19, 2017
daba342
Fixed missing ';'.
lpaulsen93 Aug 19, 2017
36f8d84
Fixed memory leak in "wb_project_free()".
lpaulsen93 Aug 19, 2017
65a5e5b
Parameter "filename" can be "const" in functions "workbench_set_filen…
lpaulsen93 Aug 19, 2017
4c92297
All filename parameters and return values in "wb_project.c" and "work…
lpaulsen93 Aug 19, 2017
fa97eaa
Minor code improvements in "workbench_add_bookmark_int()".
lpaulsen93 Aug 19, 2017
d6993d8
Do not use deprecated Gtk Stock Items.
lpaulsen93 Aug 19, 2017
4ae4580
Use "gtk_widget_destroy()" to clean up workbench menu.
lpaulsen93 Aug 19, 2017
c20dc6f
Re-factored control of menu item activation and de-activation.
lpaulsen93 Aug 19, 2017
6560f6b
Merged "sidebar_update_project()" and "sidebar_update_project_title()…
lpaulsen93 Aug 19, 2017
bfa8662
Use "GString" instead of doing manual string manipulation in "sidebar…
lpaulsen93 Aug 19, 2017
f67c194
Use "GString" instead of "g_snprintf()" in "wb_project_dir_get_info()".
lpaulsen93 Aug 19, 2017
6aa0b70
Use "GString" instead of "g_snprintf()" in "wb_project_get_info()".
lpaulsen93 Aug 19, 2017
c24fe00
Restored accidentally deleted strings.
lpaulsen93 Aug 19, 2017
9c90b80
Removed useless/duplicate check.
lpaulsen93 Aug 19, 2017
be25bad
Make sure to not continue if "g_key_file_to_data()" fails (especially…
lpaulsen93 Aug 19, 2017
fa35023
Attach workbench menu to the tools menu, not to the main menu bar.
lpaulsen93 Aug 20, 2017
eaa9265
Replaced deprecated "gtk_menu_append()" with "gtk_menu_shell_append()".
lpaulsen93 Aug 20, 2017
316e11f
Fixed too many initializers.
lpaulsen93 Aug 20, 2017
6d8d2d8
Use "ui_widget_modify_font_from_string()" to change the workbench sid…
lpaulsen93 Aug 20, 2017
145476a
Made message "File %s is not a valid workbench file!" translateable a…
lpaulsen93 Aug 20, 2017
ed27167
Made sidebar title translateable.
lpaulsen93 Aug 20, 2017
039d43f
Added ellipses (…) to "New", "Open", "Add project" and "Add directory".
lpaulsen93 Aug 20, 2017
8409530
Added mnemonics to popup menu.
lpaulsen93 Aug 20, 2017
48c08cc
Re-factored "get_combined_path()": now uses g_strconcat and handles a…
lpaulsen93 Aug 20, 2017
2e09b55
Re-factored "get_any_relative_path()": use "GPtrArray" to get rid of …
lpaulsen93 Aug 20, 2017
6199a6b
Also supply icons of the size 24x24, 32x32, 48x48 and scalable.
lpaulsen93 Aug 20, 2017
f7ba628
Fixed wrong dest directories (iconsdir) in sub-makefiles.
lpaulsen93 Aug 21, 2017
bea0a0f
Suppress warnings for intentionally unused parameters in callback fun…
lpaulsen93 Aug 21, 2017
01a8dfa
Fixed more compiler warnings.
lpaulsen93 Aug 21, 2017
d19678c
Set attribute "text" instead of markup for "GtkCellRendererText".
lpaulsen93 Aug 21, 2017
9fecc2c
Fixed missing NULL pointer check.
lpaulsen93 Aug 21, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions workbench/src/wb_project.c
Expand Up @@ -744,7 +744,7 @@ void wb_project_rescan(WB_PROJECT *prj)
* @return TRUE if file is included, FALSE otherwise
*
**/
gboolean wb_project_dir_file_is_included(WB_PROJECT_DIR *dir, gchar *filename)
gboolean wb_project_dir_file_is_included(WB_PROJECT_DIR *dir, const gchar *filename)
{
if (filename == NULL || dir == NULL)
{
Expand All @@ -767,7 +767,7 @@ gboolean wb_project_dir_file_is_included(WB_PROJECT_DIR *dir, gchar *filename)
* @return TRUE if file is included, FALSE otherwise
*
**/
gboolean wb_project_file_is_included(WB_PROJECT *prj, gchar *filename)
gboolean wb_project_file_is_included(WB_PROJECT *prj, const gchar *filename)
{
GSList *elem;

Expand Down Expand Up @@ -829,7 +829,7 @@ static gboolean add_tm_idle(gpointer foo)
* Additional problem: The tag removal in Geany happens after this function is called.
* To be sure, perform on idle after this happens (even though from my knowledge of TM
* this shouldn't probably matter). */
void wb_project_add_single_tm_file(WB_PROJECT *prj, gchar *filename)
void wb_project_add_single_tm_file(WB_PROJECT *prj, const gchar *filename)
{
if (prj == NULL)
{
Expand Down Expand Up @@ -890,7 +890,7 @@ static gboolean remove_tm_idle(gpointer foo)
* when this function is called and if we remove the TmSourceFile now, line
* number for the searched tag won't be found. For this reason delay the tag
* TmSourceFile removal until idle */
void wb_project_remove_single_tm_file(WB_PROJECT *prj, gchar *utf8_filename)
void wb_project_remove_single_tm_file(WB_PROJECT *prj, const gchar *utf8_filename)
{
if (prj == NULL)
{
Expand Down Expand Up @@ -1105,7 +1105,7 @@ static void wb_project_save_directories (gpointer data, gpointer user_data)


/* Add a bookmark to the project */
static gboolean wb_project_add_bookmark_int(WB_PROJECT *prj, gchar *filename)
static gboolean wb_project_add_bookmark_int(WB_PROJECT *prj, const gchar *filename)
{
if (prj != NULL)
{
Expand All @@ -1129,7 +1129,7 @@ static gboolean wb_project_add_bookmark_int(WB_PROJECT *prj, gchar *filename)
* @return TRUE on success, FALSE otherwise
*
**/
gboolean wb_project_add_bookmark(WB_PROJECT *prj, gchar *filename)
gboolean wb_project_add_bookmark(WB_PROJECT *prj, const gchar *filename)
{
if (wb_project_add_bookmark_int(prj, filename) == TRUE)
{
Expand All @@ -1147,7 +1147,7 @@ gboolean wb_project_add_bookmark(WB_PROJECT *prj, gchar *filename)
* @return TRUE on success, FALSE otherwise
*
**/
gboolean wb_project_remove_bookmark(WB_PROJECT *prj, gchar *filename)
gboolean wb_project_remove_bookmark(WB_PROJECT *prj, const gchar *filename)
{
if (prj != NULL)
{
Expand Down Expand Up @@ -1430,7 +1430,7 @@ gboolean wb_project_load(WB_PROJECT *prj, gchar *filename, GError **error)
* @return Address of the new structure.
*
**/
WB_PROJECT *wb_project_new(gchar *filename)
WB_PROJECT *wb_project_new(const gchar *filename)
{
WB_PROJECT *new_prj;

Expand Down
14 changes: 7 additions & 7 deletions workbench/src/wb_project.h
Expand Up @@ -24,7 +24,7 @@
typedef struct S_WB_PROJECT WB_PROJECT;
typedef struct S_WB_PROJECT_DIR WB_PROJECT_DIR;

WB_PROJECT *wb_project_new(gchar *filename);
WB_PROJECT *wb_project_new(const gchar *filename);
void wb_project_free(WB_PROJECT *prj);

void wb_project_set_modified(WB_PROJECT *prj, gboolean value);
Expand All @@ -37,9 +37,9 @@ GSList *wb_project_get_directories(WB_PROJECT *prj);
gboolean wb_project_add_directory(WB_PROJECT *prj, const gchar *dirname);
gboolean wb_project_remove_directory (WB_PROJECT *prj, WB_PROJECT_DIR *dir);
void wb_project_rescan(WB_PROJECT *prj);
gboolean wb_project_file_is_included(WB_PROJECT *prj, gchar *filename);
void wb_project_add_single_tm_file(WB_PROJECT *prj, gchar *filename);
void wb_project_remove_single_tm_file(WB_PROJECT *prj, gchar *filename);
gboolean wb_project_file_is_included(WB_PROJECT *prj, const gchar *filename);
void wb_project_add_single_tm_file(WB_PROJECT *prj, const gchar *filename);
void wb_project_remove_single_tm_file(WB_PROJECT *prj, const gchar *filename);

const gchar *wb_project_dir_get_name (WB_PROJECT_DIR *directory);
GHashTable *wb_project_dir_get_file_table (WB_PROJECT_DIR *directory);
Expand All @@ -52,10 +52,10 @@ gchar **wb_project_dir_get_ignored_file_patterns (WB_PROJECT_DIR *directory);
gboolean wb_project_dir_set_ignored_file_patterns (WB_PROJECT_DIR *directory, gchar **new);
gint wb_project_dir_rescan(WB_PROJECT *prj, WB_PROJECT_DIR *root);
gchar *wb_project_dir_get_info (WB_PROJECT_DIR *dir);
gboolean wb_project_dir_file_is_included(WB_PROJECT_DIR *dir, gchar *filename);
gboolean wb_project_dir_file_is_included(WB_PROJECT_DIR *dir, const gchar *filename);

gboolean wb_project_add_bookmark(WB_PROJECT *prj, gchar *filename);
gboolean wb_project_remove_bookmark(WB_PROJECT *prj, gchar *filename);
gboolean wb_project_add_bookmark(WB_PROJECT *prj, const gchar *filename);
gboolean wb_project_remove_bookmark(WB_PROJECT *prj, const gchar *filename);
GPtrArray *wb_project_get_bookmarks(WB_PROJECT *prj);
gchar *wb_project_get_bookmark_at_index (WB_PROJECT *prj, guint index);
guint wb_project_get_bookmarks_count(WB_PROJECT *prj);
Expand Down
14 changes: 7 additions & 7 deletions workbench/src/workbench.c
Expand Up @@ -246,7 +246,7 @@ void workbench_set_filename(WORKBENCH *wb, const gchar *filename)
* @return The filename or NULL
*
**/
gchar *workbench_get_filename(WORKBENCH *wb)
const gchar *workbench_get_filename(WORKBENCH *wb)
{
if (wb != NULL)
{
Expand Down Expand Up @@ -358,7 +358,7 @@ PROJECT_ENTRY_STATUS workbench_get_project_status_by_address (WORKBENCH *wb, WB_
* @return TRUE on success, FALSE otherwise
*
**/
gboolean workbench_add_project(WORKBENCH *wb, gchar *filename)
gboolean workbench_add_project(WORKBENCH *wb, const gchar *filename)
{
if (wb != NULL)
{
Expand Down Expand Up @@ -443,7 +443,7 @@ gboolean workbench_remove_project_with_address(WORKBENCH *wb, WB_PROJECT *projec
* NULL if the file is not included in any workbench project.
*
**/
WB_PROJECT *workbench_file_is_included (WORKBENCH *wb, gchar *filename)
WB_PROJECT *workbench_file_is_included (WORKBENCH *wb, const gchar *filename)
{
if (wb != NULL)
{
Expand All @@ -464,7 +464,7 @@ WB_PROJECT *workbench_file_is_included (WORKBENCH *wb, gchar *filename)


/* Add a workbench bookmark */
static gboolean workbench_add_bookmark_int(WORKBENCH *wb, gchar *filename)
static gboolean workbench_add_bookmark_int(WORKBENCH *wb, const gchar *filename)
{
if (wb != NULL)
{
Expand All @@ -488,7 +488,7 @@ static gboolean workbench_add_bookmark_int(WORKBENCH *wb, gchar *filename)
* @return TRUE on success, FALSE otherwise
*
**/
gboolean workbench_add_bookmark(WORKBENCH *wb, gchar *filename)
gboolean workbench_add_bookmark(WORKBENCH *wb, const gchar *filename)
{
if (workbench_add_bookmark_int(wb, filename) == TRUE)
{
Expand All @@ -506,7 +506,7 @@ gboolean workbench_add_bookmark(WORKBENCH *wb, gchar *filename)
* @return TRUE on success, FALSE otherwise
*
**/
gboolean workbench_remove_bookmark(WORKBENCH *wb, gchar *filename)
gboolean workbench_remove_bookmark(WORKBENCH *wb, const gchar *filename)
{
if (wb != NULL)
{
Expand Down Expand Up @@ -658,7 +658,7 @@ gboolean workbench_save(WORKBENCH *wb, GError **error)
* @return TRUE on success, FALSE otherwise
*
**/
gboolean workbench_load(WORKBENCH *wb, gchar *filename, GError **error)
gboolean workbench_load(WORKBENCH *wb, const gchar *filename, GError **error)
{
gboolean success = FALSE;

Expand Down
12 changes: 6 additions & 6 deletions workbench/src/workbench.h
Expand Up @@ -42,19 +42,19 @@ gboolean workbench_get_rescan_projects_on_open(WORKBENCH *wb);
WB_PROJECT *workbench_get_project_at_index(WORKBENCH *wb, guint index);
PROJECT_ENTRY_STATUS workbench_get_project_status_at_index(WORKBENCH *wb, guint index);
PROJECT_ENTRY_STATUS workbench_get_project_status_by_address(WORKBENCH *wb, WB_PROJECT *address);
gboolean workbench_add_project(WORKBENCH *wb, gchar *filename);
gboolean workbench_add_project(WORKBENCH *wb, const gchar *filename);
gboolean workbench_remove_project_with_address(WORKBENCH *wb, WB_PROJECT *project);
WB_PROJECT *workbench_file_is_included (WORKBENCH *wb, gchar *filename);
WB_PROJECT *workbench_file_is_included (WORKBENCH *wb, const gchar *filename);

void workbench_set_filename(WORKBENCH *wb, const gchar *filename);
gchar *workbench_get_filename(WORKBENCH *wb);
const gchar *workbench_get_filename(WORKBENCH *wb);
gchar *workbench_get_name(WORKBENCH *wb);

gboolean workbench_save(WORKBENCH *wb, GError **error);
gboolean workbench_load(WORKBENCH *wb, gchar *filename, GError **error);
gboolean workbench_load(WORKBENCH *wb, const gchar *filename, GError **error);

gboolean workbench_add_bookmark(WORKBENCH *wb, gchar *filename);
gboolean workbench_remove_bookmark(WORKBENCH *wb, gchar *filename);
gboolean workbench_add_bookmark(WORKBENCH *wb, const gchar *filename);
gboolean workbench_remove_bookmark(WORKBENCH *wb, const gchar *filename);
gchar *workbench_get_bookmark_at_index (WORKBENCH *wb, guint index);
guint workbench_get_bookmarks_count(WORKBENCH *wb);

Expand Down