Commit 16f86759 authored by Andreas Rönnquist's avatar Andreas Rönnquist

Update upstream source from tag 'upstream/1.11'

Update to upstream version '1.11'
with Debian dir 1d07027e1b07774f24d77e729361c2825120eecf
parents 7e0d4e7e 9eefb769
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
ChangeLog: ChangeLog:
---------- ----------
1.11
* Remove checks for GTK version, we require GTK 3 from now on
* Update required LUA version to 5.3
1.10 1.10
* Fix webpage link in about dialog * Fix webpage link in about dialog
......
# #
# Copyright (C) 2010-2017 Andreas Rönnquist # Copyright (C) 2010-2018 Andreas Rönnquist
# This file is distributed under the same license # This file is distributed under the same license
# as the sciteproj package, see COPYING file. # as the sciteproj package, see COPYING file.
# #
...@@ -13,24 +13,13 @@ to build are: ...@@ -13,24 +13,13 @@ to build are:
pkg-config pkg-config
libgtk-3-dev libgtk-3-dev
liblua5.1-0-dev liblua5.3-dev
gettext
or if you are still using GTK version 2:
pkg-config
libgtk2.0-dev
liblua5.1-0-dev
gettext gettext
Then the build process is simple - to build the program, just type Then the build process is simple - to build the program, just type
make make
or on GTK2, you need to pass
make GTK2=1
which will in the end create an executable in the bin folder. If you want to which will in the end create an executable in the bin folder. If you want to
build an executable with debug symbols enable, run build an executable with debug symbols enable, run
......
# #
# Copyright (C) 2009-2017 Andreas Rönnquist # Copyright (C) 2009-2018 Andreas Rönnquist
# This file is distributed under the same license # This file is distributed under the same license
# as the sciteproj package, see COPYING file. # as the sciteproj package, see COPYING file.
# #
...@@ -46,32 +46,22 @@ DATADIR= ${DESTDIR}${PREFIX}/share ...@@ -46,32 +46,22 @@ DATADIR= ${DESTDIR}${PREFIX}/share
LOCALEDIR = ${DATADIR}/locale LOCALEDIR = ${DATADIR}/locale
VERSION=$(shell cat ./VERSION) VERSION=$(shell cat ./VERSION)
ifdef GTK2 PKG_GTK=gtk+-3.0
PKG_GTK=gtk+-2.0 CHECK_GTK3=1
CHECK_GTK3=1
else
PKG_GTK=gtk+-3.0
endif
LIB_CFLAGS=$(shell pkg-config --cflags --silence-errors $(PKG_GTK) $(PKG_WNCK) lua5.1 || pkg-config --cflags $(PKG_GTK) $(PKG_WNCK) lua) LIB_CFLAGS=$(shell pkg-config --cflags --silence-errors $(PKG_GTK) $(PKG_WNCK) lua5.3 || pkg-config --cflags $(PKG_GTK) $(PKG_WNCK) lua)
STD_LDFLAGS= STD_LDFLAGS=
LIBS=-lX11 $(shell pkg-config --libs --silence-errors $(PKG_GTK) $(PKG_WNCK) lua5.1 || pkg-config --libs $(PKG_GTK) $(PKG_WNCK) lua) LIBS=-lX11 $(shell pkg-config --libs --silence-errors $(PKG_GTK) $(PKG_WNCK) lua5.3 || pkg-config --libs $(PKG_GTK) $(PKG_WNCK) lua)
LOCAL_CFLAGS=$(STD_CFLAGS) $(DEPRECATED) $(CFLAGS) $(LIB_CFLAGS) LOCAL_CFLAGS=$(STD_CFLAGS) $(DEPRECATED) $(CFLAGS) $(LIB_CFLAGS)
LOCAL_LDFLAGS=$(STD_CFLAGS) $(LDFLAGS) $(STD_LDFLAGS) LOCAL_LDFLAGS=$(STD_CFLAGS) $(LDFLAGS) $(STD_LDFLAGS)
LOCAL_CPPFLAGS=$(CPPFLAGS) LOCAL_CPPFLAGS=$(CPPFLAGS)
ifdef CHECK_GTK3 LOCAL_CFLAGS+=-DGTK_DISABLE_SINGLE_INCLUDES
LOCAL_CFLAGS+=-DGTK_DISABLE_SINGLE_INCLUDES LOCAL_CFLAGS+=-DGSEAL_ENABLE
LOCAL_CFLAGS+=-DGSEAL_ENABLE
CHECK_DEPRECATED=1 LOCAL_CFLAGS+=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
endif
ifdef CHECK_DEPRECATED
LOCAL_CFLAGS+=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
endif
LOCAL_CFLAGS+=-DLOCALEDIR=\"$(LOCALEDIR)\" -DPACKAGE=\"$(NAME)\" -DSCITEPROJ_VERSION=\"$(VERSION)\" LOCAL_CFLAGS+=-DLOCALEDIR=\"$(LOCALEDIR)\" -DPACKAGE=\"$(NAME)\" -DSCITEPROJ_VERSION=\"$(VERSION)\"
......
# #
# Copyright (C) 2010-2017 Andreas Rönnquist # Copyright (C) 2010-2018 Andreas Rönnquist
# This file is distributed under the same license # This file is distributed under the same license
# as the sciteproj package, see COPYING file. # as the sciteproj package, see COPYING file.
# #
......
# #
# Copyright (C) 2010-2017 Andreas Rönnquist # Copyright (C) 2010-2018 Andreas Rönnquist
# This file is distributed under the same license # This file is distributed under the same license
# as the sciteproj package, see COPYING file. # as the sciteproj package, see COPYING file.
# #
......
1.10 1.11
\ No newline at end of file \ No newline at end of file
.\" .\"
.\" Copyright (C) 2010-2017 Andreas Rönnquist .\" Copyright (C) 2010-2018 Andreas Rönnquist
.\" This file is distributed under the same license .\" This file is distributed under the same license
.\" as the sciteproj package, see COPYING file. .\" as the sciteproj package, see COPYING file.
.\" .\"
......
/** /**
* about.c - about dialog for SciteProj * about.c - about dialog for SciteProj
* *
* Copyright 2008-2017 Andreas Rönnquist * Copyright 2008-2018 Andreas Rönnquist
* *
* This file is part of SciteProj. * This file is part of SciteProj.
* *
...@@ -63,11 +63,7 @@ void show_about_dialog() ...@@ -63,11 +63,7 @@ void show_about_dialog()
*/ */
void create_about_dialog() void create_about_dialog()
{ {
#if GTK_MAJOR_VERSION >= 3
GtkWidget *grid; GtkWidget *grid;
#else
GtkWidget *vbox;
#endif
GtkWidget *textview_info; GtkWidget *textview_info;
GtkWidget *logo_image; GtkWidget *logo_image;
GtkWidget *linkbutton; GtkWidget *linkbutton;
...@@ -96,42 +92,28 @@ void create_about_dialog() ...@@ -96,42 +92,28 @@ void create_about_dialog()
gtk_widget_set_size_request(window, 500, 400); gtk_widget_set_size_request(window, 500, 400);
// Make a container // Make a container
#if GTK_MAJOR_VERSION >= 3
grid = gtk_grid_new(); grid = gtk_grid_new();
gtk_grid_set_row_spacing (GTK_GRID (grid), 6); gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
gtk_container_add(GTK_CONTAINER(window), grid); gtk_container_add(GTK_CONTAINER(window), grid);
#else
vbox = gtk_vbox_new(FALSE,5);
gtk_container_add(GTK_CONTAINER(window), vbox);
#endif
logo_image = gtk_image_new_from_pixbuf(program_icon_pixbuf); logo_image = gtk_image_new_from_pixbuf(program_icon_pixbuf);
#if GTK_MAJOR_VERSION >= 3
gtk_grid_attach(GTK_GRID(grid), logo_image, 0, 0, 5, 1); gtk_grid_attach(GTK_GRID(grid), logo_image, 0, 0, 5, 1);
#else
gtk_box_pack_start(GTK_BOX(vbox), logo_image, FALSE, FALSE, 0);
#endif
sciteproj_label = gtk_label_new(NULL); sciteproj_label = gtk_label_new(NULL);
gtk_label_set_selectable(GTK_LABEL(sciteproj_label), FALSE); gtk_label_set_selectable(GTK_LABEL(sciteproj_label), FALSE);
gtk_label_set_markup(GTK_LABEL(sciteproj_label), "<big><b>SciteProj</b></big>"); gtk_label_set_markup(GTK_LABEL(sciteproj_label), "<big><b>SciteProj</b></big>");
#if GTK_MAJOR_VERSION>=3
gtk_grid_attach_next_to(GTK_GRID(grid), sciteproj_label, logo_image, GTK_POS_BOTTOM, 5, 1); gtk_grid_attach_next_to(GTK_GRID(grid), sciteproj_label, logo_image, GTK_POS_BOTTOM, 5, 1);
#else
gtk_box_pack_start(GTK_BOX(vbox), sciteproj_label, FALSE, FALSE, 0);
#endif
// Show version of SciteProj // Show version of SciteProj
gchar *about_dialog_version_string; gchar *about_dialog_version_string;
#ifdef _DEBUG #ifdef _DEBUG
about_dialog_version_string = g_strdup_printf("%s DEBUG",version_string); about_dialog_version_string = g_strdup_printf("%s DEBUG",version_string);
#else #else
about_dialog_version_string = g_strdup_printf("%s", version_string); about_dialog_version_string = g_strdup_printf("%s", version_string);
...@@ -140,11 +122,7 @@ void create_about_dialog() ...@@ -140,11 +122,7 @@ void create_about_dialog()
version_string_label = gtk_label_new(about_dialog_version_string); version_string_label = gtk_label_new(about_dialog_version_string);
gtk_label_set_selectable(GTK_LABEL(version_string_label), FALSE); gtk_label_set_selectable(GTK_LABEL(version_string_label), FALSE);
#if GTK_MAJOR_VERSION >= 3
gtk_grid_attach_next_to(GTK_GRID(grid), version_string_label, sciteproj_label, GTK_POS_BOTTOM, 5, 1); gtk_grid_attach_next_to(GTK_GRID(grid), version_string_label, sciteproj_label, GTK_POS_BOTTOM, 5, 1);
#else
gtk_box_pack_start(GTK_BOX(vbox), version_string_label, FALSE, FALSE, 0);
#endif
// Show SciteProj copyrights // Show SciteProj copyrights
copyrightstring = g_strdup_printf("Copyright (C) 2008-2017 Andreas Rönnquist <andreas@ronnquist.net>"); copyrightstring = g_strdup_printf("Copyright (C) 2008-2017 Andreas Rönnquist <andreas@ronnquist.net>");
...@@ -152,11 +130,7 @@ void create_about_dialog() ...@@ -152,11 +130,7 @@ void create_about_dialog()
copyright_label = gtk_label_new(copyrightstring); copyright_label = gtk_label_new(copyrightstring);
gtk_label_set_selectable(GTK_LABEL(copyright_label), FALSE); gtk_label_set_selectable(GTK_LABEL(copyright_label), FALSE);
#if GTK_MAJOR_VERSION >= 3
gtk_grid_attach_next_to(GTK_GRID(grid), copyright_label, version_string_label, GTK_POS_BOTTOM, 5, 1); gtk_grid_attach_next_to(GTK_GRID(grid), copyright_label, version_string_label, GTK_POS_BOTTOM, 5, 1);
#else
gtk_box_pack_start(GTK_BOX(vbox), copyright_label, FALSE, FALSE, 0);
#endif
// show GTK versions // show GTK versions
gchar *gtk_string = g_strdup_printf("GTK+ %d.%d.%d / GLib %d.%d.%d", gchar *gtk_string = g_strdup_printf("GTK+ %d.%d.%d / GLib %d.%d.%d",
...@@ -168,24 +142,13 @@ void create_about_dialog() ...@@ -168,24 +142,13 @@ void create_about_dialog()
gtk_label_set_selectable(GTK_LABEL(gtk_version_label), FALSE); gtk_label_set_selectable(GTK_LABEL(gtk_version_label), FALSE);
#if GTK_MAJOR_VERSION >= 3
gtk_grid_attach_next_to(GTK_GRID(grid), gtk_version_label, copyright_label, GTK_POS_BOTTOM, 5, 1); gtk_grid_attach_next_to(GTK_GRID(grid), gtk_version_label, copyright_label, GTK_POS_BOTTOM, 5, 1);
#else
gtk_box_pack_start(GTK_BOX(vbox), gtk_version_label, FALSE, FALSE, 0);
GtkWidget *hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
#endif
// Show a link to the SciteProj homepage // Show a link to the SciteProj homepage
linkbutton = gtk_link_button_new_with_label(homepage_string, homepage_string); linkbutton = gtk_link_button_new_with_label(homepage_string, homepage_string);
#if GTK_MAJOR_VERSION>=3
gtk_grid_attach_next_to(GTK_GRID(grid), linkbutton, gtk_version_label, GTK_POS_BOTTOM, 5, 1); gtk_grid_attach_next_to(GTK_GRID(grid), linkbutton, gtk_version_label, GTK_POS_BOTTOM, 5, 1);
#else
gtk_box_pack_start(GTK_BOX(hbox), linkbutton, TRUE, FALSE, 0);
#endif
// New notebook - we want tabs for different sets of text // New notebook - we want tabs for different sets of text
...@@ -285,20 +248,14 @@ void create_about_dialog() ...@@ -285,20 +248,14 @@ void create_about_dialog()
gtk_container_add(GTK_CONTAINER(scrolled_window_info), textview_info); gtk_container_add(GTK_CONTAINER(scrolled_window_info), textview_info);
//gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scrolled_window_info, notebook_label1); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scrolled_window_info, notebook_label1);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scrolled_window_license, notebook_label2); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), scrolled_window_license, notebook_label2);
#if GTK_MAJOR_VERSION >= 3
gtk_widget_set_vexpand(notebook, TRUE); gtk_widget_set_vexpand(notebook, TRUE);
gtk_widget_set_hexpand(notebook, TRUE); gtk_widget_set_hexpand(notebook, TRUE);
gtk_grid_attach_next_to(GTK_GRID(grid), notebook, linkbutton/*gtk_version_label*/, GTK_POS_BOTTOM, 5, 1); gtk_grid_attach_next_to(GTK_GRID(grid), notebook, linkbutton/*gtk_version_label*/, GTK_POS_BOTTOM, 5, 1);
#else
gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
#endif
gtk_text_buffer_place_cursor(textbuffer_info, &iter); gtk_text_buffer_place_cursor(textbuffer_info, &iter);
gtk_text_buffer_select_range(textbuffer_info, &iter, &iter); gtk_text_buffer_select_range(textbuffer_info, &iter, &iter);
...@@ -308,23 +265,10 @@ void create_about_dialog() ...@@ -308,23 +265,10 @@ void create_about_dialog()
gtk_button_set_use_underline(GTK_BUTTON(ok_button), TRUE); gtk_button_set_use_underline(GTK_BUTTON(ok_button), TRUE);
gtk_button_set_label(GTK_BUTTON(ok_button), "_OK"); gtk_button_set_label(GTK_BUTTON(ok_button), "_OK");
#if GTK_MAJOR_VERSION >= 3
gtk_widget_set_halign(ok_button, GTK_ALIGN_END); gtk_widget_set_halign(ok_button, GTK_ALIGN_END);
gtk_widget_set_hexpand(ok_button, FALSE); gtk_widget_set_hexpand(ok_button, FALSE);
#endif
//gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
// gtk_grid_attach_next_to(GTK_GRID(grid), hbox, notebook, GTK_POS_BOTTOM, 5, 1);
#if GTK_MAJOR_VERSION >= 3
gtk_grid_attach_next_to(GTK_GRID(grid), ok_button, notebook, GTK_POS_BOTTOM, 5, 1); gtk_grid_attach_next_to(GTK_GRID(grid), ok_button, notebook, GTK_POS_BOTTOM, 5, 1);
#else
GtkWidget *ok_button_hbox = gtk_hbox_new(FALSE,0);
gtk_box_pack_end(GTK_BOX(ok_button_hbox), ok_button, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), ok_button_hbox, FALSE, FALSE, 0);
#endif
gtk_widget_grab_focus(ok_button); gtk_widget_grab_focus(ok_button);
......
/** /**
* about.h - about dialog for SciteProj * about.h - about dialog for SciteProj
* *
* Copyright 2008-2017 Andreas Rönnquist * Copyright 2008-2018 Andreas Rönnquist
* *
* This file is part of SciteProj. * This file is part of SciteProj.
* *
......
...@@ -575,7 +575,7 @@ gchar *clean_folder(gchar *infolder) ...@@ -575,7 +575,7 @@ gchar *clean_folder(gchar *infolder)
len -= 2; len -= 2;
} }
if (temp[len-1] == G_DIR_SEPARATOR) { if (temp[len - 1] == G_DIR_SEPARATOR) {
result = g_strndup(temp, len - 1); result = g_strndup(temp, len - 1);
} else { } else {
result = g_strdup(temp); result = g_strdup(temp);
......
...@@ -22,12 +22,12 @@ ...@@ -22,12 +22,12 @@
#ifndef __HEADER_FILE_UTILS_ #ifndef __HEADER_FILE_UTILS_
#define __HEADER_FILE_UTILS_ #define __HEADER_FILE_UTILS_
/* /**
* *
*/ */
extern gchar *current_directory; extern gchar *current_directory;
/* /**
* *
*/ */
void init_file_utils(); void init_file_utils();
......
...@@ -62,24 +62,17 @@ GdkCursor *busy_cursor = NULL; ...@@ -62,24 +62,17 @@ GdkCursor *busy_cursor = NULL;
*/ */
gboolean load_graphics(GtkWidget *widget, GError **err) gboolean load_graphics(GtkWidget *widget, GError **err)
{ {
#if GTK_MAJOR_VERSION >= 3
GtkIconTheme *icon_theme; GtkIconTheme *icon_theme;
icon_theme = gtk_icon_theme_get_default(); icon_theme = gtk_icon_theme_get_default();
#endif
program_icon_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)sciteproj_xpm); program_icon_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)sciteproj_xpm);
if (prefs.use_stock_folder_icon) { if (prefs.use_stock_folder_icon) {
// use GTK_STOCK_DIRECTORY // use GTK_STOCK_DIRECTORY
#if GTK_MAJOR_VERSION >= 3
directory_closed_pixbuf = gtk_icon_theme_load_icon(icon_theme, "folder", 14, 0, NULL); directory_closed_pixbuf = gtk_icon_theme_load_icon(icon_theme, "folder", 14, 0, NULL);
directory_open_pixbuf = gtk_icon_theme_load_icon(icon_theme, "folder", 14, 0, NULL); directory_open_pixbuf = gtk_icon_theme_load_icon(icon_theme, "folder", 14, 0, NULL);
#else
directory_closed_pixbuf = gtk_widget_render_icon(widget, GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_MENU, NULL);
directory_open_pixbuf = gtk_widget_render_icon(widget, GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_MENU, NULL);
#endif
} else { } else {
directory_open_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)dir_open_xpm); directory_open_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)dir_open_xpm);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
/*
#ifndef GDK_KEY_Return #ifndef GDK_KEY_Return
#define GDK_KEY_BackSpace GDK_BackSpace #define GDK_KEY_BackSpace GDK_BackSpace
#define GDK_KEY_Delete GDK_Delete #define GDK_KEY_Delete GDK_Delete
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
#define GDK_KEY_F2 GDK_F2 #define GDK_KEY_F2 GDK_F2
#define GDK_KEY_F5 GDK_F5 #define GDK_KEY_F5 GDK_F5
#endif #endif
*/
#endif /*__HEADER_GTK3_COMPAT_*/ #endif /*__HEADER_GTK3_COMPAT_*/
This diff is collapsed.
/** /**
* gui_callbacks.c - GUI callback code for SciteProj * gui_callbacks.c - GUI callback code for SciteProj
* *
* Copyright 2006 Roy Wood, 2009-2017 Andreas Rönnquist * Copyright 2006 Roy Wood, 2009-2018 Andreas Rönnquist
* *
* This file is part of SciteProj. * This file is part of SciteProj.
* *
...@@ -204,7 +204,7 @@ void load_tree_at_iter(GtkTreeView *tree_view, GtkTreeIter *iter) ...@@ -204,7 +204,7 @@ void load_tree_at_iter(GtkTreeView *tree_view, GtkTreeIter *iter)
if (iter) { if (iter) {
if (gtk_tree_model_iter_children(tree_model, &child, iter)) { if (gtk_tree_model_iter_children(tree_model, &child, iter)) {
remove_tree_node(&child,NULL); remove_tree_node(&child, NULL);
gchar *folder_path; gchar *folder_path;
...@@ -221,21 +221,21 @@ void load_tree_at_iter(GtkTreeView *tree_view, GtkTreeIter *iter) ...@@ -221,21 +221,21 @@ void load_tree_at_iter(GtkTreeView *tree_view, GtkTreeIter *iter)
GCompareFunc comparer = get_sort_order_of_folder(folder_path); GCompareFunc comparer = get_sort_order_of_folder(folder_path);
file_list=load_folder_to_list(folder_path, FALSE, comparer /*file_sort_by_extension_bigger_func*/, filter_list); file_list = load_folder_to_list(folder_path, FALSE, comparer /*file_sort_by_extension_bigger_func*/, filter_list);
folder_list=load_folder_to_list(folder_path, TRUE, compare_strings_bigger, filter_list); folder_list = load_folder_to_list(folder_path, TRUE, compare_strings_bigger, filter_list);
// Here we should filter out the unwanted items // Here we should filter out the unwanted items
add_tree_folderlist(iter, folder_list, folder_path); add_tree_folderlist(iter, folder_list, folder_path);
if (file_list) { if (file_list) {
//file_list=g_slist_reverse(file_list); //file_list = g_slist_reverse(file_list);
add_tree_filelist(iter, file_list, NULL); add_tree_filelist(iter, file_list, NULL);
} }
set_tree_node_expanded(iter,TRUE, NULL); set_tree_node_expanded(iter, TRUE, NULL);
GtkTreePath *tree_path = gtk_tree_model_get_path(tree_model, iter); GtkTreePath *tree_path = gtk_tree_model_get_path(tree_model, iter);
...@@ -267,7 +267,7 @@ void row_expand_or_collapse_cb(GtkTreeView *tree_view, GtkTreeIter *iter, ...@@ -267,7 +267,7 @@ void row_expand_or_collapse_cb(GtkTreeView *tree_view, GtkTreeIter *iter,
GtkTreeModel *tree_model = gtk_tree_view_get_model(tree_view); GtkTreeModel *tree_model = gtk_tree_view_get_model(tree_view);
// make sure all icons the folder (and folders inside it) are set to a correct icon. // make sure all icons the folder (and folders inside it) are set to a correct icon.
fix_folders_step_through(tree_view,*iter,tree_path); fix_folders_step_through(tree_view, *iter,tree_path);
gchar *temp; gchar *temp;
gboolean expanded; gboolean expanded;
...@@ -426,10 +426,10 @@ void refresh_folder_cb() ...@@ -426,10 +426,10 @@ void refresh_folder_cb()
gchar *temp; gchar *temp;
gtk_tree_model_get(tree_model, temp_iter, COLUMN_FILENAME, &temp, -1); gtk_tree_model_get(tree_model, temp_iter, COLUMN_FILENAME, &temp, -1);
tree_path=gtk_tree_model_get_path(tree_model, temp_iter); tree_path = gtk_tree_model_get_path(tree_model, temp_iter);
GtkTreeRowReference *row_reference=gtk_tree_row_reference_new(tree_model, tree_path); GtkTreeRowReference *row_reference = gtk_tree_row_reference_new(tree_model, tree_path);
list_of_items=g_list_append(list_of_items, row_reference); list_of_items = g_list_append(list_of_items, row_reference);
gtk_tree_path_free(tree_path); gtk_tree_path_free(tree_path);
...@@ -439,7 +439,7 @@ void refresh_folder_cb() ...@@ -439,7 +439,7 @@ void refresh_folder_cb()
GList *node; GList *node;
for (node = list_of_items; node != NULL; node = node -> next) { for (node = list_of_items; node != NULL; node = node -> next) {
tree_path=gtk_tree_row_reference_get_path((GtkTreeRowReference*)node->data); tree_path = gtk_tree_row_reference_get_path((GtkTreeRowReference*)node->data);
if (tree_path) { if (tree_path) {
GtkTreeIter iter; GtkTreeIter iter;
...@@ -448,7 +448,7 @@ void refresh_folder_cb() ...@@ -448,7 +448,7 @@ void refresh_folder_cb()
} }
} }
g_list_foreach(list_of_items, (GFunc) gtk_tree_row_reference_free, NULL); 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);
......
/** /**
* gui_callbacks.h - GUI callback code for SciteProj * gui_callbacks.h - GUI callback code for SciteProj
* *
* Copyright 2006 Roy Wood, 2009-2017 Andreas Rönnquist * Copyright 2006 Roy Wood, 2009-2018 Andreas Rönnquist
* *
* This file is part of SciteProj. * This file is part of SciteProj.
* *
......
...@@ -128,10 +128,11 @@ int main(int argc, char *argv[]) ...@@ -128,10 +128,11 @@ int main(int argc, char *argv[])
gtk_init(&argc, &argv); gtk_init(&argc, &argv);
// Since glib 2.36, this isn't needed // Since glib 2.36, this isn't needed
/*
#if GLIB_MAJOR_VERSION<=2 && GLIB_MINOR_VERSION<36 #if GLIB_MAJOR_VERSION<=2 && GLIB_MINOR_VERSION<36
g_type_init(); g_type_init();
#endif #endif
*/
init_file_utils(); init_file_utils();
......
...@@ -37,19 +37,17 @@ ...@@ -37,19 +37,17 @@
#include "string_utils.h" #include "string_utils.h"
#include "file_utils.h" #include "file_utils.h"
/** /**
* My set align * My set align
*/ */
void my_set_align(GtkWidget *widget) void my_set_align(GtkWidget *widget)
{ {
#if GTK_MAJOR_VERSION>=3
gtk_widget_set_halign(widget, GTK_ALIGN_START); gtk_widget_set_halign(widget, GTK_ALIGN_START);
gtk_widget_set_valign(widget, GTK_ALIGN_START); gtk_widget_set_valign(widget, GTK_ALIGN_START);
#else
gtk_misc_set_alignment(GTK_MISC(widget), 0, 0);
#endif
} }
/** /**
* Group properties callback * Group properties callback
*/ */
...@@ -59,8 +57,9 @@ void group_properties_gui(GtkTreeModel *tree_model, GtkTreeIter *iter) ...@@ -59,8 +57,9 @@ void group_properties_gui(GtkTreeModel *tree_model, GtkTreeIter *iter)
gchar *nodename = NULL; gchar *nodename = NULL;
GtkWidget *table; GtkWidget *table;
GtkWidget *label1,*label2; GtkWidget *label1, *label2;
GtkWidget *filename, *filepath_label; GtkWidget *filename, *filepath_label;
GtkWidget *container_box = NULL;
gchar *filePath = NULL; gchar *filePath = NULL;
int nodeType = -1; int nodeType = -1;
...@@ -71,12 +70,8 @@ void group_properties_gui(GtkTreeModel *tree_model, GtkTreeIter *iter) ...@@ -71,12 +70,8 @@ void group_properties_gui(GtkTreeModel *tree_model, GtkTreeIter *iter)
COLUMN_FILEPATH, &filePath, COLUMN_FILEPATH, &filePath,
-1); -1);
#if GTK_MAJOR_VERSION>=3
dialog = gtk_dialog_new_with_buttons(_("Group Properties"), NULL, GTK_DIALOG_MODAL, dialog = gtk_dialog_new_with_buttons(_("Group Properties"), NULL, GTK_DIALOG_MODAL,
_("OK"), GTK_RESPONSE_ACCEPT, NULL); _("OK"), GTK_RESPONSE_ACCEPT, NULL);
#else
dialog = gtk_dialog_new_with_buttons(_("Group Properties"), NULL, GTK_DIALOG_MODAL, GTK_STOCK_OK,GTK_RESPONSE_OK,NULL);
#endif
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
...@@ -94,34 +89,19 @@ void group_properties_gui(GtkTreeModel *tree_model, GtkTreeIter *iter) ...@@ -94,34 +89,19 @@ void group_properties_gui(GtkTreeModel *tree_model, GtkTreeIter *iter)
my_set_align(label1); my_set_align(label1);
my_set_align(label2); my_set_align(label2);
#if GTK_MAJOR_VERSION>=3
table = gtk_grid_new(); table = gtk_grid_new();
gtk_grid_attach(GTK_GRID(table), label1, 0, 0, 1, 1); gtk_grid_attach(GTK_GRID(table), label1, 0, 0, 1, 1);
gtk_grid_attach(GTK_GRID(table), label2, 0, 1, 1, 1); gtk_grid_attach(GTK_GRID(table), label2, 0, 1, 1, 1);
gtk_grid_attach(GTK_GRID(table),filename, 1, 0, 4, 1); gtk_grid_attach(GTK_GRID(table), filename, 1, 0, 4, 1);
gtk_grid_attach(GTK_GRID(table),filepath_label, 1, 1, 4, 1); gtk_grid_attach(GTK_GRID(table), filepath_label, 1, 1, 4, 1);
gtk_grid_set_row_spacing (GTK_GRID (table), 6);
gtk_grid_set_column_spacing (GTK_GRID (table), 6);
#else
table = gtk_table_new(3,3,FALSE);
gtk_table_attach_defaults(GTK_TABLE(table), label1, 0, 1, 0, 1);
gtk_table_attach_defaults(GTK_TABLE(table), label2, 0, 1, 1, 2);
gtk_table_attach_defaults(GTK_TABLE(table), filename, 1, 2, 0, 1);
gtk_table_attach_defaults(GTK_TABLE(table), filepath_label, 1, 2, 1, 2);
gtk_table_set_row_spacings(GTK_TABLE(table), 5); gtk_grid_set_row_spacing(GTK_GRID (table), 6);