Commit 7679b79b authored by Andreas Rönnquist's avatar Andreas Rönnquist

New upstream version 1.06

parent aa1d4d6b
......@@ -2,6 +2,10 @@
ChangeLog:
----------
1.06
* Various formatting fixes, source cleanups
* Add GTK 3.22 versions of menu popups
1.05
* Update copyright years
* Fix gtk_misc_set_alignment warnings
......
#
# Copyright (C) 2010-2014 Andreas Rönnquist
# Copyright (C) 2010-2016 Andreas Rönnquist
# This file is distributed under the same license
# as the sciteproj package, see COPYING file.
#
......
#
# Copyright (C) 2009-2014 Andreas Rönnquist
# Copyright (C) 2009-2016 Andreas Rönnquist
# This file is distributed under the same license
# as the sciteproj package, see COPYING file.
#
......@@ -18,7 +18,7 @@ else
STD_CFLAGS=-Wall -Wformat -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -Wformat=2 -Wdeprecated-declarations
endif
OBJECTS=$(OBJ)/about.o $(OBJ)/addfiles.o $(OBJ)/clipboard.o $(OBJ)/expand.o\
OBJECTS=$(OBJ)/about.o $(OBJ)/clipboard.o $(OBJ)/expand.o\
$(OBJ)/file_utils.o $(OBJ)/folder_config.o\
$(OBJ)/graphics.o $(OBJ)/gui.o $(OBJ)/gui_callbacks.o\
$(OBJ)/icon.o $(OBJ)/load_folder.o $(OBJ)/menus.o $(OBJ)/main.o $(OBJ)/prefs.o\
......
#
# Copyright (C) 2010-2014 Andreas Rönnquist
# Copyright (C) 2010-2016 Andreas Rönnquist
# This file is distributed under the same license
# as the sciteproj package, see COPYING file.
#
......
1.05
\ No newline at end of file
1.06
\ No newline at end of file
#
# Copyright (C) 2009-2014 Andreas Rönnquist
# Copyright (C) 2009-2016 Andreas Rönnquist
# This file is distributed under the same license
# as the sciteproj package, see COPYING file.
#
......@@ -17,7 +17,7 @@ VERSION = $(shell cat ../VERSION)
DATADIR = ${DESTDIR}${PREFIX}/share
LOCALEDIR = ${DATADIR}/locale
SOURCES = about.c addfiles.c clipboard.c file_utils.c expand.c\
SOURCES = about.c clipboard.c file_utils.c expand.c\
folder_config.c graphics.c gui.c gui_callbacks.c load_folder.c\
main.c menus.c prefs.c properties_dialog.c recent_files.c remove.c\
scite_utils.c script.c sort.c statusbar.c string_utils.c tree_manipulation.c\
......
.\"
.\" Copyright (C) 2010-2014 Andreas Rönnquist
.\" Copyright (C) 2010-2016 Andreas Rönnquist
.\" This file is distributed under the same license
.\" as the sciteproj package, see COPYING file.
.\"
......
/**
* about.c - about dialog for SciteProj
*
* Copyright 2008-2012 Andreas Rönnquist
* Copyright 2008-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......@@ -147,7 +147,7 @@ void create_about_dialog()
#endif
// Show SciteProj copyrights
copyrightstring = g_strdup_printf("Copyright (C) 2008-2014 Andreas Rönnquist <gusnan@gusnan.se>");
copyrightstring = g_strdup_printf("Copyright (C) 2008-2016 Andreas Rönnquist <gusnan@openmailbox.org>");
copyright_label = gtk_label_new(copyrightstring);
gtk_label_set_selectable(GTK_LABEL(copyright_label), FALSE);
......
/**
* about.h - about dialog for SciteProj
*
* Copyright 2008-2012 Andreas Rönnquist
* Copyright 2008-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* addfiles.c - Interface for adding files to the project
*
* Copyright 2011-2012 Andreas Rönnquist
*
* This file is part of SciteProj
*
* SciteProj is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SciteProj is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SciteProj. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib/gi18n.h>
#include <locale.h>
#include "clicked_node.h"
#include "gui.h"
#include "tree_manipulation.h"
#include "addfiles.h"
/**
* Callback for menu manager to populate GUI widgets
*
* @param ui is the GtkUIManager
* @param widget is the GtkWidget to add to the UI
* @param container is the container to add widget to
*/
void menu_add_widget_cb(GtkUIManager *ui, GtkWidget *widget, GtkContainer *container)
{
// use Grid instead of box packing on GTK3
#if GTK_MAJOR_VERSION >= 3
gtk_grid_attach(GTK_GRID(container), widget, 0, 0, 1, 1);
#else
gtk_box_pack_start(GTK_BOX(container), widget, FALSE, FALSE, 0);
#endif
gtk_widget_show(widget);
}
/**
* addfiles.h - Interface for adding files to the project
*
* Copyright 2011-2012 Andreas Rönnquist
*
* This file is part of SciteProj
*
* SciteProj is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SciteProj is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SciteProj. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __HEADER_ADDFILES_
#define __HEADER_ADDFILES_
/**
*
*/
void ask_name_add_group(GtkTreeIter *nodeIter);
void menu_add_widget_cb(GtkUIManager *ui, GtkWidget *widget, GtkContainer *container);
#endif /*__HEADER_ADDFILES_*/
/**
* clicked_node.h - clicked node struct for SciteProj
*
* Copyright 2006 Roy Wood, 2009-2012 Andreas Rönnquist
* Copyright 2006 Roy Wood, 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* clipboard.c - clipboard code for SciteProj
*
* Copyright 2010-2015 Andreas Rönnquist
* Copyright 2010-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* clipboard.h - clipboard support for SciteProj
*
* Copyright 2010-2012 Andreas Rönnquist
* Copyright 2010-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* expand.c - expand a folder in the treeview
*
* Copyright 2012 Andreas Rönnquist
* Copyright 2012-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* expand.h - expand a folder in the treeview
*
* Copyright 2012 Andreas Rönnquist
* Copyright 2012-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* file_utils.c - file utilities for SciteProj
*
* Copyright 2009-2012 Andreas Rönnquist
* Copyright 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* file_utils.h - file utilities for SciteProj
*
* Copyright 2009-2012 Andreas Rönnquist
* Copyright 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* folder_config.c - per folder configuration loaded from LUA
*
* Copyright 2012 Andreas Rönnquist
* Copyright 2012-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* folder_config.h - per folder configuration loaded from LUA
*
* Copyright 2012 Andreas Rönnquist
* Copyright 2012-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* graphics.c - graphics code for SciteProj
*
* Copyright 2009-2012 Andreas Rönnquist
* Copyright 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* graphics.h - graphics code for SciteProj
*
* Copyright 2009-2012 Andreas Rönnquist
* Copyright 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* gtk3_compat.h - GTK3 compatibility definitions
*
* Copyright 2011-2012 Andreas Rönnquist
* Copyright 2011-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* gui.c - GUI code for SciteProj
*
* Copyright 2006 Roy Wood, 2009-2014 Andreas Rönnquist
* Copyright 2006 Roy Wood, 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......@@ -48,7 +48,6 @@
#include "clipboard.h"
#include "remove.h"
#include "addfiles.h"
#include "recent_files.h"
......@@ -838,10 +837,15 @@ static gboolean mouse_button_pressed_cb(GtkWidget *treeView, GdkEventButton *eve
&path, NULL, NULL, NULL)) {
// Nope-- user clicked in the GtkTreeView, but not on a node
#if ((GTK_MAJOR_VERSION >= 3) && (GTK_MINOR_VERSION >= 22))
gtk_menu_popup_at_pointer(GTK_MENU(generalPopupMenu), (GdkEvent*)event);
#else
gtk_menu_popup(GTK_MENU(generalPopupMenu),
NULL, NULL, NULL, NULL,
event->button, gdk_event_get_time((GdkEvent*) event));
#endif
goto EXITPOINT;
}
......@@ -884,12 +888,20 @@ static gboolean mouse_button_pressed_cb(GtkWidget *treeView, GdkEventButton *eve
// Pop up the appropriate menu for the node type
if (nodeItemType == ITEMTYPE_FILE) {
#if ((GTK_MAJOR_VERSION >= 3) && (GTK_MINOR_VERSION >= 22))
gtk_menu_popup_at_pointer(GTK_MENU(fileRightClickPopupMenu), (GdkEvent*)event);
#else
gtk_menu_popup(GTK_MENU(fileRightClickPopupMenu), NULL, NULL, NULL, NULL,
event->button, gdk_event_get_time((GdkEvent*) event));
#endif
}
else if (nodeItemType == ITEMTYPE_GROUP) {
#if ((GTK_MAJOR_VERSION >= 3) && (GTK_MINOR_VERSION >= 22))
gtk_menu_popup_at_pointer(GTK_MENU(groupRightClickPopupMenu), (GdkEvent*)event);
#else
gtk_menu_popup(GTK_MENU(groupRightClickPopupMenu), NULL, NULL, NULL, NULL,
event->button, gdk_event_get_time((GdkEvent*) event));
#endif
}
// We took care of the event, so no need to propogate it
......
/**
* gui.h - GUI code for SciteProj
*
* Copyright 2006 Roy Wood, 2009-2012 Andreas Rönnquist
* Copyright 2006 Roy Wood, 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* gui_callbacks.c - GUI callback code for SciteProj
*
* Copyright 2006 Roy Wood, 2009-2012 Andreas Rönnquist
* Copyright 2006 Roy Wood, 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......@@ -50,7 +50,6 @@
#include "properties_dialog.h"
#include "file_utils.h"
#include "addfiles.h"
#include "recent_files.h"
#include "remove.h"
#include "sort.h"
......@@ -85,7 +84,7 @@ void popup_open_file_cb()
goto EXITPOINT;
}
add_file_to_recent(clicked_node.name,NULL);
add_file_to_recent(clicked_node.name, NULL);
EXITPOINT:
......@@ -127,7 +126,7 @@ void edit_properties_cb()
activate_scite(NULL);
if (prefs.give_scite_focus==TRUE) {
if (prefs.give_scite_focus == TRUE) {
send_scite_command((gchar*)"focus:0", NULL);
}
}
......@@ -151,14 +150,14 @@ static void fix_folders_step_through(GtkTreeView *tree_view, GtkTreeIter newiter
GError *error;
gint nodeItemType;
GtkTreeIter iter=newiter;
GtkTreeIter iter = newiter;
do {
gtk_tree_model_get(tree_model, &iter, COLUMN_ITEMTYPE, &nodeItemType, -1);
if (nodeItemType==ITEMTYPE_GROUP) {
if (nodeItemType == ITEMTYPE_GROUP) {
GtkTreePath *srcPath = gtk_tree_model_get_path(tree_model, &iter);
gboolean groupIsExpanded = tree_row_is_expanded(srcPath);
......@@ -177,7 +176,7 @@ static void fix_folders_step_through(GtkTreeView *tree_view, GtkTreeIter newiter
GtkTreeIter newIter;
gtk_tree_model_iter_children(tree_model, &newIter, &iter);
fix_folders_step_through(tree_view,newIter, tree_path);
fix_folders_step_through(tree_view, newIter, tree_path);
}
g_free(relFilePath);
......@@ -372,12 +371,12 @@ gboolean tree_view_search_equal_func(GtkTreeModel *model,gint column,
{
gchar *filename;
// For some reason this should return TRUE if the row DONT match
gboolean res=TRUE;
gboolean res = TRUE;
gtk_tree_model_get(model, iter, COLUMN_FILENAME, &filename, -1);
// zero when matches, which means we should return FALSE
if (g_ascii_strncasecmp(key,filename,strlen(key))==0) res=FALSE;
if (g_ascii_strncasecmp(key, filename, strlen(key)) == 0) res = FALSE;
g_free(filename);
......@@ -395,10 +394,10 @@ void refresh_folder_cb()
}
gchar *folder_name;
GtkTreeModel *tree_model=gtk_tree_view_get_model(GTK_TREE_VIEW(projectTreeView));
GtkTreeIter iter=clicked_node.iter;
GtkTreeModel *tree_model = gtk_tree_view_get_model(GTK_TREE_VIEW(projectTreeView));
GtkTreeIter iter = clicked_node.iter;
GtkTreeIter *stored_iter=gtk_tree_iter_copy(&iter);
GtkTreeIter *stored_iter = gtk_tree_iter_copy(&iter);
gboolean expanded;
......@@ -414,7 +413,7 @@ void refresh_folder_cb()
GtkTreeIter child;
GList *list_of_items=NULL;
GList *list_of_items = NULL;
// First, store all GtkTreePath in a linked list
......@@ -422,7 +421,7 @@ void refresh_folder_cb()
int co=0;
GtkTreePath *tree_path;
GtkTreeIter *temp_iter=&child;
GtkTreeIter *temp_iter = &child;
do {
gchar *temp;
......@@ -454,7 +453,7 @@ void refresh_folder_cb()
g_list_foreach(list_of_items, (GFunc) gtk_tree_row_reference_free, NULL);
}
GtkTreeIter *temp_iter=gtk_tree_iter_copy(stored_iter);
GtkTreeIter *temp_iter = gtk_tree_iter_copy(stored_iter);
gchar *folder;
gtk_tree_model_get(tree_model, temp_iter,
......
/**
* gui_callbacks.h - GUI callback code for SciteProj
*
* Copyright 2006 Roy Wood, 2009-2012 Andreas Rönnquist
* Copyright 2006 Roy Wood, 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
......@@ -2,7 +2,7 @@
* icon.c - Icon helper functions
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
* (C) 2012 - Andreas Rönnquist <gusnan@gusnan.se>
* (C) 2012-2016 - Andreas Rönnquist
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -43,10 +43,10 @@ get_pixbuf_from_icon(GIcon *icon, GtkIconSize size)
if (!icon)
return NULL;
theme=gtk_icon_theme_get_default();
theme = gtk_icon_theme_get_default();
gtk_icon_size_lookup(size, &width, NULL);
info=gtk_icon_theme_lookup_by_gicon(theme,
info = gtk_icon_theme_lookup_by_gicon(theme,
icon,
width,
GTK_ICON_LOOKUP_USE_BUILTIN);
......@@ -71,7 +71,7 @@ get_pixbuf_from_file(GFile *file, GtkIconSize size)
GdkPixbuf *result = NULL;
info=g_file_query_info(file,
info = g_file_query_info(file,
G_FILE_ATTRIBUTE_STANDARD_ICON,
G_FILE_QUERY_INFO_NONE,
NULL,
......@@ -80,10 +80,10 @@ get_pixbuf_from_file(GFile *file, GtkIconSize size)
if (!info)
return NULL;
icon=g_file_info_get_icon(info);
icon = g_file_info_get_icon(info);
if (icon != NULL) {
result=get_pixbuf_from_icon(icon,size);
result=get_pixbuf_from_icon(icon, size);
}
g_object_unref(info);
......
......@@ -2,7 +2,7 @@
* icon.h - Icon helper functions
*
* Copyright (C) 2006 - Jesse van den Kieboom <jesse@icecrew.nl>
* (C) 2012 - Andreas Rönnquist <gusnan@gusnan.se>
* (C) 2012-2016 - Andreas Rönnquist
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -28,7 +28,7 @@
*
*/
GdkPixbuf *get_pixbuf_from_file(GFile *file,GtkIconSize size);
GdkPixbuf *get_pixbuf_from_file(GFile *file, GtkIconSize size);
GdkPixbuf *get_pixbuf_from_filename(gchar *filename, GtkIconSize size);
#endif /*__HEADER_ICON_*/
......
/**
* load_folder.c - folder loading support for sciteproj
*
* Copyright 2012 Andreas Rönnquist
* Copyright 2012-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* load_folder.h - folder loading support for sciteproj
*
* Copyright 2012 Andreas Rönnquist
* Copyright 2012-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* main.c - main for SciteProj
*
* Copyright 2006 Roy Wood, 2009-2013 Andreas Rönnquist
* Copyright 2006 Roy Wood, 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* menus.c - Menus for SciteProj
*
* Copyright 2009-2014 Andreas Rönnquist
* Copyright 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......@@ -255,10 +255,3 @@ int init_menus(GtkWidget *window)
return 0;
}
/**
*
*/
void done_menus()
{
}
/**
* menus.h - Menus for SciteProj
*
* Copyright 2009-2014 Andreas Rönnquist
* Copyright 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......@@ -47,8 +47,6 @@ extern GtkWidget *recentPopupMenu;
extern GtkWidget *quitMenuItem;
int init_menus(GtkWidget* widget);
void done_menus();
#endif /*__HEADER_MENUS_*/
/**
* prefs.c - prefs for SciteProj
*
* Copyright 2006 Roy Wood, 2009-2012 Andreas Rönnquist
* Copyright 2006 Roy Wood, 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* prefs.h - prefs for SciteProj
*
* Copyright 2006 Roy Wood, 2009-2012 Andreas Rönnquist
* Copyright 2006 Roy Wood, 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* properties_dialog.c - Properties Dialogs code for SciteProj
*
* Copyright 2009-2012 Andreas Rönnquist
* Copyright 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* properties_dialog.h - Properties Dialogs code for SciteProj
*
* Copyright 2009-2012 Andreas Rönnquist
* Copyright 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* recent_files.c - list of recently opened files
*
* Copyright 2011-2012 Andreas Rönnquist
* Copyright 2011-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......@@ -425,6 +425,9 @@ static gboolean recent_mouse_button_pressed_cb(GtkWidget *treeView, GdkEventButt
// Pop up the appropriate menu for the node type
//if (nodeItemType == ITEMTYPE_FILE) {
#if ((GTK_MAJOR_VERSION >= 3) && (GTK_MINOR_VERSION >= 22))
gtk_menu_popup_at_pointer(GTK_MENU(recentPopupMenu), (GdkEvent*)event);
#else
gtk_menu_popup(GTK_MENU(recentPopupMenu),
NULL,
NULL,
......@@ -432,6 +435,7 @@ static gboolean recent_mouse_button_pressed_cb(GtkWidget *treeView, GdkEventButt
NULL,
event->button,
gdk_event_get_time((GdkEvent*) event));
#endif
/*
}
else if (nodeItemType == ITEMTYPE_GROUP) {
......
/**
* recent_files.h - list of recently opened files
*
* Copyright 2011-2012 Andreas Rönnquist
* Copyright 2011-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* remove.c - code for removing nodes
*
* Copyright 2011-2012 Andreas Rönnquist
* Copyright 2011-2016 Andreas Rönnquist
*
* This file is part of SciteProj
*
......
/**
* remove.h - code for removing nodes
*
* Copyright 2011-2012 Andreas Rönnquist
* Copyright 2011-2016 Andreas Rönnquist
*
* This file is part of SciteProj
*
......
/**
* scite_utils_linux.c - Code for working with Scite (GNU/Linux version)
*
* Copyright 2006 Roy Wood, 2009-2012 Andreas Rönnquist
* Copyright 2006 Roy Wood, 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* scite_utils_linux.h - Code for working with Scite (GNU/Linux version)
*
* Copyright 2006 Roy Wood, 2009-2011 Andreas Rönnquist
* Copyright 2006 Roy Wood, 2009-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* script.c - Script code for sciteproj
*
* Copyright 2012 Andreas Rönnquist
* Copyright 2012-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* script.h - Script code for sciteproj
*
* Copyright 2012 Andreas Rönnquist
* Copyright 2012-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* sort.c - Helpers for sorting
*
* Copyright 2012-2013 Andreas Rönnquist
* Copyright 2012-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* sort.h - Helpers for sorting
*
* Copyright 2012-2013 Andreas Rönnquist
* Copyright 2012-2016 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* statusbar.c - statusbar for SciteProj
*
* Copyright 2009-2014 Andreas Rönnquist
* Copyright 2009-20