Commit 9eefb769 authored by Andreas Rönnquist's avatar Andreas Rönnquist

New upstream version 1.11

parent 218b56fb
......@@ -2,6 +2,10 @@
ChangeLog:
----------
1.11
* Remove checks for GTK version, we require GTK 3 from now on
* Update required LUA version to 5.3
1.10
* 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
# as the sciteproj package, see COPYING file.
#
......@@ -13,24 +13,13 @@ to build are:
pkg-config
libgtk-3-dev
liblua5.1-0-dev
gettext
or if you are still using GTK version 2:
pkg-config
libgtk2.0-dev
liblua5.1-0-dev
liblua5.3-dev
gettext
Then the build process is simple - to build the program, just type
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
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
# as the sciteproj package, see COPYING file.
#
......@@ -46,32 +46,22 @@ DATADIR= ${DESTDIR}${PREFIX}/share
LOCALEDIR = ${DATADIR}/locale
VERSION=$(shell cat ./VERSION)
ifdef GTK2
PKG_GTK=gtk+-2.0
CHECK_GTK3=1
else
PKG_GTK=gtk+-3.0
endif
PKG_GTK=gtk+-3.0
CHECK_GTK3=1
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=
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_LDFLAGS=$(STD_CFLAGS) $(LDFLAGS) $(STD_LDFLAGS)
LOCAL_CPPFLAGS=$(CPPFLAGS)
ifdef CHECK_GTK3
LOCAL_CFLAGS+=-DGTK_DISABLE_SINGLE_INCLUDES
LOCAL_CFLAGS+=-DGSEAL_ENABLE
LOCAL_CFLAGS+=-DGTK_DISABLE_SINGLE_INCLUDES
LOCAL_CFLAGS+=-DGSEAL_ENABLE
CHECK_DEPRECATED=1
endif
ifdef CHECK_DEPRECATED
LOCAL_CFLAGS+=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
endif
LOCAL_CFLAGS+=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
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
# 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
# as the sciteproj package, see COPYING file.
#
......
1.10
\ No newline at end of file
1.11
\ 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
.\" as the sciteproj package, see COPYING file.
.\"
......
/**
* about.c - about dialog for SciteProj
*
* Copyright 2008-2017 Andreas Rönnquist
* Copyright 2008-2018 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......@@ -63,11 +63,7 @@ void show_about_dialog()
*/
void create_about_dialog()
{
#if GTK_MAJOR_VERSION >= 3
GtkWidget *grid;
#else
GtkWidget *vbox;
#endif
GtkWidget *textview_info;
GtkWidget *logo_image;
GtkWidget *linkbutton;
......@@ -96,42 +92,28 @@ void create_about_dialog()
gtk_widget_set_size_request(window, 500, 400);
// Make a container
#if GTK_MAJOR_VERSION >= 3
grid = gtk_grid_new();
gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
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);
#if GTK_MAJOR_VERSION >= 3
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);
gtk_label_set_selectable(GTK_LABEL(sciteproj_label), FALSE);
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);
#else
gtk_box_pack_start(GTK_BOX(vbox), sciteproj_label, FALSE, FALSE, 0);
#endif
// Show version of SciteProj
gchar *about_dialog_version_string;
#ifdef _DEBUG
#ifdef _DEBUG
about_dialog_version_string = g_strdup_printf("%s DEBUG",version_string);
#else
about_dialog_version_string = g_strdup_printf("%s", version_string);
......@@ -140,11 +122,7 @@ void create_about_dialog()
version_string_label = gtk_label_new(about_dialog_version_string);
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);
#else
gtk_box_pack_start(GTK_BOX(vbox), version_string_label, FALSE, FALSE, 0);
#endif
// Show SciteProj copyrights
copyrightstring = g_strdup_printf("Copyright (C) 2008-2017 Andreas Rönnquist <andreas@ronnquist.net>");
......@@ -152,11 +130,7 @@ void create_about_dialog()
copyright_label = gtk_label_new(copyrightstring);
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);
#else
gtk_box_pack_start(GTK_BOX(vbox), copyright_label, FALSE, FALSE, 0);
#endif
// show GTK versions
gchar *gtk_string = g_strdup_printf("GTK+ %d.%d.%d / GLib %d.%d.%d",
......@@ -168,24 +142,13 @@ void create_about_dialog()
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);
#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
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);
#else
gtk_box_pack_start(GTK_BOX(hbox), linkbutton, TRUE, FALSE, 0);
#endif
// New notebook - we want tabs for different sets of text
......@@ -285,20 +248,14 @@ void create_about_dialog()
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_license, notebook_label2);
#if GTK_MAJOR_VERSION >= 3
gtk_widget_set_vexpand(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);
#else
gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
#endif
gtk_text_buffer_place_cursor(textbuffer_info, &iter);
gtk_text_buffer_select_range(textbuffer_info, &iter, &iter);
......@@ -308,23 +265,10 @@ void create_about_dialog()
gtk_button_set_use_underline(GTK_BUTTON(ok_button), TRUE);
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_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);
#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);
......
/**
* about.h - about dialog for SciteProj
*
* Copyright 2008-2017 Andreas Rönnquist
* Copyright 2008-2018 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
......@@ -575,7 +575,7 @@ gchar *clean_folder(gchar *infolder)
len -= 2;
}
if (temp[len-1] == G_DIR_SEPARATOR) {
if (temp[len - 1] == G_DIR_SEPARATOR) {
result = g_strndup(temp, len - 1);
} else {
result = g_strdup(temp);
......
......@@ -22,12 +22,12 @@
#ifndef __HEADER_FILE_UTILS_
#define __HEADER_FILE_UTILS_
/*
/**
*
*/
extern gchar *current_directory;
/*
/**
*
*/
void init_file_utils();
......
......@@ -62,24 +62,17 @@ GdkCursor *busy_cursor = NULL;
*/
gboolean load_graphics(GtkWidget *widget, GError **err)
{
#if GTK_MAJOR_VERSION >= 3
GtkIconTheme *icon_theme;
icon_theme = gtk_icon_theme_get_default();
#endif
program_icon_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)sciteproj_xpm);
if (prefs.use_stock_folder_icon) {
// use GTK_STOCK_DIRECTORY
#if GTK_MAJOR_VERSION >= 3
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);
#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 {
directory_open_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)dir_open_xpm);
......
......@@ -25,6 +25,7 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
/*
#ifndef GDK_KEY_Return
#define GDK_KEY_BackSpace GDK_BackSpace
#define GDK_KEY_Delete GDK_Delete
......@@ -35,6 +36,7 @@
#define GDK_KEY_F2 GDK_F2
#define GDK_KEY_F5 GDK_F5
#endif
*/
#endif /*__HEADER_GTK3_COMPAT_*/
......@@ -94,11 +94,7 @@ GtkWidget *scrolledWindow = NULL;
GtkTreeViewColumn *column1 = NULL;
#if GTK_MAJOR_VERSION>=3
GtkWidget *recentGrid = NULL;
#else
GtkWidget *recentVbox=NULL;
#endif
GtkWidget *recentHbox = NULL;
......@@ -120,16 +116,8 @@ gboolean setup_gui(GError **err)
//GtkAccelGroup* accelgroup = NULL;
GError *tempErr = NULL;
#if GTK_MAJOR_VERSION >= 3
GtkWidget *grid;
GtkWidget *fullGrid = NULL;
#else
GtkWidget *vbox=NULL;
GtkWidget *hbox=NULL;
GtkWidget *statusBarVbox=NULL;
GtkWidget *fullVbox=NULL;
#endif
GtkWidget *recentScrolledWindow = NULL;
......@@ -167,115 +155,16 @@ gboolean setup_gui(GError **err)
// Main content of the window is a vpaned
#if GTK_MAJOR_VERSION>=3
vpaned = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
// Then we need a grid
grid = gtk_grid_new();
#else
vpaned=gtk_vpaned_new();
// Then we need a vbox
if (!(vbox = gtk_vbox_new(FALSE, 0))) {
g_set_error(err, APP_SCITEPROJ_ERROR, -1, "%s: %s, gtk_vbox_new() = NULL",
__func__,
"Couldn't init main vbox"
);
goto EXITPOINT;
}
//gtk_container_add(GTK_CONTAINER(sMainWindow), vbox);
#endif
// Create menus
/*
if (!(sActionGroup = gtk_action_group_new("SciteProjActions"))) {
g_set_error(err, APP_SCITEPROJ_ERROR, -1, "%s: %s, gtk_action_group_new() = NULL",
__func__,
"Couldn't init gtk_action_group"
);
goto EXITPOINT;
}
*/
/*
if (!(sGtkUIManager = gtk_ui_manager_new())) {
g_set_error(err, APP_SCITEPROJ_ERROR, -1, "%s: %s, gtk_ui_manager_new() = NULL",
__func__,
"Couldn't init gtk_ui_manager"
);
goto EXITPOINT;
}
*/
#if GTK_MAJOR_VERSION >= 3
//g_signal_connect(sGtkUIManager, "add_widget", G_CALLBACK(menu_add_widget_cb), grid);
#else
//g_signal_connect(sGtkUIManager, "add_widget", G_CALLBACK(menu_add_widget_cb), vpaned);
// g_signal_connect(sGtkUIManager, "add_widget", G_CALLBACK(menu_add_widget_cb), vbox);
#endif
// Fix the context-based translations for the menu strings
/*
int co=0;
gchar *temp=NULL;
gchar *context=NULL;
do {
context=menustrings[co].context;
if (context!=NULL) {
temp = (gchar*)g_dpgettext2(PACKAGE,menustrings[co].context,menustrings[co].string);
if (temp!=NULL) {
sMenuActions[co].label = g_strdup_printf("%s",temp);
++co;
}
}
} while (context!=NULL);
*/
/*
gtk_action_group_set_translation_domain(sActionGroup,PACKAGE);
gtk_action_group_add_actions(sActionGroup, sMenuActions, sNumMenuActions, NULL);
gtk_ui_manager_insert_action_group(sGtkUIManager, sActionGroup, 0);
if (gtk_ui_manager_add_ui_from_string(sGtkUIManager, sMenuDefXML, strlen(sMenuDefXML), &tempErr) == 0) {
g_set_error(err, APP_SCITEPROJ_ERROR, -1, "%s: %s, gtk_ui_manager_add_ui_from_string() = %s",
__func__,
"Couldn't init menus from XML",
tempErr->message
);
goto EXITPOINT;
}
gtk_ui_manager_ensure_update(sGtkUIManager);
*/
// Activate the keyboard accelerators
accelerator_group = gtk_accel_group_new();
gtk_window_add_accel_group(GTK_WINDOW(sMainWindow), accelerator_group);
/*
// Create popup menus (shown when user right-clicks in gui elements)
sGeneralPopupMenu = gtk_ui_manager_get_widget(sGtkUIManager, "/ui/GeneralPopup");
sGroupPopupMenu = gtk_ui_manager_get_widget(sGtkUIManager, "/ui/GroupPopup");
//sFilePopupMenu = gtk_ui_manager_get_widget(sGtkUIManager, "/ui/FilePopup");
*/
//sFilePopupMenu = gtk_menu_new();
if (init_menus(sMainWindow)!=0) {
g_set_error(err, APP_SCITEPROJ_ERROR, -1, "%s: %s, gtk_scrolled_window_new() = NULL",
__func__,
......@@ -284,14 +173,7 @@ gboolean setup_gui(GError **err)
goto EXITPOINT;
}
/*
recentPopupMenu = gtk_ui_manager_get_widget(sGtkUIManager, "/ui/RecentPopup");
sSortPopupMenu = gtk_ui_manager_get_widget(sGtkUIManager, "/ui/SortPopup");
*/
// Add a scrolled window to the main window
if (!(scrolledWindow = gtk_scrolled_window_new(NULL, NULL))) {
g_set_error(err, APP_SCITEPROJ_ERROR, -1, "%s: %s, gtk_scrolled_window_new() = NULL",
__func__,
......@@ -304,20 +186,10 @@ gboolean setup_gui(GError **err)
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow),
GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
#if GTK_MAJOR_VERSION>=3
gtk_grid_attach(GTK_GRID(grid), scrolledWindow, 0, 1, 1, 1);
gtk_widget_set_vexpand(scrolledWindow, TRUE);
gtk_widget_set_hexpand(scrolledWindow, TRUE);
#else
gtk_box_pack_start(GTK_BOX(vbox), scrolledWindow, TRUE, TRUE, 0);
hbox=gtk_hbox_new(FALSE,0);
gtk_widget_show(hbox);
gtk_box_pack_end(GTK_BOX(vbox),hbox,FALSE,TRUE,0);
#endif
// Create the tree datastore
......@@ -340,8 +212,6 @@ gboolean setup_gui(GError **err)
goto EXITPOINT;
}
//g_object_unref(G_OBJECT(projectTreeStore));
gtk_tree_view_set_enable_search(GTK_TREE_VIEW(projectTreeView), TRUE);
if (!(textCellRenderer = gtk_cell_renderer_text_new())) {
......@@ -393,8 +263,6 @@ gboolean setup_gui(GError **err)
gtk_tree_view_column_add_attribute(column1, textCellRenderer, "weight", COLUMN_FONTWEIGHT);
gtk_tree_view_column_add_attribute(column1, textCellRenderer, "weight-set", COLUMN_FONTWEIGHTSET);
//g_signal_connect(G_OBJECT(textCellRenderer), "edited", G_CALLBACK(rename_cb), NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(projectTreeView), column1);
// Stoopid gtk always expands the last column
......@@ -428,8 +296,6 @@ gboolean setup_gui(GError **err)
// --------------------------------
// Recent file stuff:
#if GTK_MAJOR_VERSION>=3
if (!(recentGrid = gtk_grid_new())) {
g_set_error(err, APP_SCITEPROJ_ERROR,-1,
"%s: %s, gtk_grid_new() = NULL",
......@@ -438,37 +304,12 @@ gboolean setup_gui(GError **err)
goto EXITPOINT;
}
#else
if (!(recentVbox=gtk_vbox_new(FALSE, 0))) {
g_set_error(err, APP_SCITEPROJ_ERROR,-1,
"%s: %s, gtk_vbox_new() = NULL",
__func__,
"Couldn't init recent grid"
);
goto EXITPOINT;
}
#endif
#if GTK_MAJOR_VERSION>=3
if (!(recentHbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0))) {
#else
if (!(recentHbox=gtk_hbox_new(FALSE,0))) {
#endif
g_set_error(err, APP_SCITEPROJ_ERROR, -1,
"%s: %s, gtk_hbox_new() = NULL",
__func__,
"Couldn't init main vbox"
);
goto EXITPOINT;
}
if ((recentScrolledWindow = init_recent_files(&tempErr)) == NULL) {
goto EXITPOINT;
}
#if GTK_MAJOR_VERSION >= 3
gtk_widget_set_vexpand(recentScrolledWindow, TRUE);
gtk_widget_set_hexpand(recentScrolledWindow, TRUE);
......@@ -476,48 +317,14 @@ gboolean setup_gui(GError **err)
fullGrid = gtk_grid_new();
#else
if (!(fullVbox=gtk_vbox_new(FALSE,0))) {
g_set_error(err, APP_SCITEPROJ_ERROR, -1,
"%s: %s, gtk_hbox_new() = NULL",
__func__,
"Couldn't init full_vbox"
);
goto EXITPOINT;
}
gtk_box_pack_start(GTK_BOX(recentVbox),recentScrolledWindow, TRUE,TRUE,0);
gtk_box_pack_end(GTK_BOX(recentVbox),recentHbox,FALSE,TRUE,0);
statusBarVbox=gtk_vbox_new(FALSE,0);
if (!statusBarVbox) {
g_set_error(err, APP_SCITEPROJ_ERROR, -1,
"%s: %s, gtk_hbox_new() = NULL",
__func__,
"Couldn't init statusbar_vbox"
);
goto EXITPOINT;
}
#endif
#if GTK_MAJOR_VERSION >= 3
gtk_paned_pack1(GTK_PANED(vpaned), grid, TRUE, FALSE);
gtk_paned_pack2(GTK_PANED(vpaned), recentGrid, TRUE, TRUE);
#else
gtk_paned_pack1(GTK_PANED(vpaned),vbox,TRUE,FALSE);
gtk_paned_pack2(GTK_PANED(vpaned),recentVbox,TRUE,TRUE);
#endif
gtk_widget_show(vpaned);
#if GTK_MAJOR_VERSION >= 3
gtk_grid_insert_row(GTK_GRID(fullGrid), 0);
gtk_grid_attach(GTK_GRID(fullGrid), vpaned, 0, 0, 1, 1);
......@@ -539,32 +346,6 @@ gboolean setup_gui(GError **err)
gtk_container_add(GTK_CONTAINER(sMainWindow), fullGrid);
#else
gtk_box_pack_start(GTK_BOX(fullVbox),menuBar, FALSE, FALSE, 0);
gtk_widget_show(menuBar);
gtk_box_pack_start(GTK_BOX(fullVbox),vpaned,TRUE,TRUE,0);
gtk_widget_show(GTK_WIDGET(fullVbox));
if (!prefs.hide_statusbar) {
if (!init_statusbar(fullVbox,vpaned,&tempErr)) {
g_set_error(err, APP_SCITEPROJ_ERROR, -1, "%s: %s",
tempErr->message,
"Couldn't init statusbar"
);
goto EXITPOINT;
}
}
gtk_container_add(GTK_CONTAINER(sMainWindow), fullVbox);
gtk_widget_show(fullVbox);
gtk_widget_show(vpaned);
#endif
g_signal_connect(G_OBJECT(recentTreeView), "key-press-event", G_CALLBACK(key_press_cb), recentTreeView);
gtk_window_resize(GTK_WINDOW(sMainWindow), prefs.width, prefs.height);
......@@ -577,7 +358,6 @@ gboolean setup_gui(GError **err)
// Show it all....
#if GTK_MAJOR_VERSION >= 3
gtk_widget_show(recentGrid);
if (!prefs.show_recent) {
......@@ -585,23 +365,10 @@ gboolean setup_gui(GError **err)
} else {
gtk_widget_show(recentGrid);
}
#else
gtk_widget_show(recentVbox);
if (!prefs.show_recent) {
gtk_widget_hide(recentVbox);
} else {
gtk_widget_show(recentVbox);
}
#endif
gtk_widget_show(projectTreeView);
gtk_widget_show(scrolledWindow);
#if GTK_MAJOR_VERSION >= 3
gtk_widget_show(grid);
#else
gtk_widget_show(vbox);
#endif
gtk_widget_show(sMainWindow);
resultCode = TRUE;
......@@ -837,17 +604,9 @@ 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))
if (generalPopupMenu) {
gtk_menu_popup_at_pointer(GTK_MENU(generalPopupMenu), (GdkEvent*)event);
}
#else
if (generalPopupMenu) {
gtk_menu_popup(GTK_MENU(generalPopupMenu),
NULL, NULL, NULL, NULL,
event->button, gdk_event_get_time((GdkEvent*) event));
}
#endif
goto EXITPOINT;
}
......@@ -891,32 +650,17 @@ 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))
if (fileRightClickPopupMenu) {
gtk_menu_popup_at_pointer(GTK_MENU(fileRightClickPopupMenu), (GdkEvent*)event);
}
#else
if (fileRightClickPopupMenu) {
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))
if (groupRightClickPopupMenu) {
gtk_menu_popup_at_pointer(GTK_MENU(groupRightClickPopupMenu), (GdkEvent*)event);
}
#else
if (groupRightClickPopupMenu) {
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
eventHandled = TRUE;
......@@ -976,7 +720,6 @@ void recent_files_switch_visible()
{
gboolean visible = FALSE;
#if GTK_MAJOR_VERSION >= 3
g_object_get(G_OBJECT(recentGrid), "visible", &visible, NULL);
if (visible) {
......@@ -985,16 +728,6 @@ void recent_files_switch_visible()
} else {
gtk_widget_show(recentGrid);
}
#else
g_object_get(G_OBJECT(recentVbox),"visible", &visible,NULL);
if (visible) {
gtk_widget_hide(recentVbox);
gtk_widget_grab_focus(projectTreeView);
} else {
gtk_widget_show(recentVbox);
}
#endif