Commit f920e284 authored by Andreas Rönnquist's avatar Andreas Rönnquist

Imported Upstream version 0.7.02

parent 76b0ada9
......@@ -2,6 +2,18 @@
ChangeLog:
----------
0.7.02
* Really fix the dependency generation
0.7.01
* Add LIB_CFLAGS to dependency generation in Makefile
0.7.00
* Make it possible to hide the statusbar to save screen space
* Made SciteProj translatable using gettext
* Complete GTK3 migration
* Add linking on gthread-2.0
0.6.06
* Update makefile to nicely use obj folder again
......
......@@ -7,14 +7,13 @@ OBJ=obj
ifdef DEBUG
STD_CFLAGS=-c -Wall -g3 -ggdb -D_DEBUG
else
STD_CFLAGS=-c -Wall
STD_CFLAGS=-c -Wall -Wformat -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -Wformat=2 -Wdeprecated-declarations
endif
PROG=bin/sciteproj
OBJECTS=$(OBJ)/about.o $(OBJ)/addfiles.o $(OBJ)/clipboard.o $(OBJ)/drag_drop.o\
$(OBJ)/file_utils.o $(OBJ)/filelist.o $(OBJ)/folder_to_xml.o $(OBJ)/graphics.o\
$(OBJ)/gui.o $(OBJ)/main.o $(OBJ)/prefs.o $(OBJ)/properties_dialog.o \
$(OBJ)/file_utils.o $(OBJ)/filelist.o $(OBJ)/folder_to_xml.o $(OBJ)/graphics.o \
$(OBJ)/gui.o $(OBJ)/main.o $(OBJ)/prefs.o \
$(OBJ)/properties_dialog.o \
$(OBJ)/recent_files.o $(OBJ)/remove.o $(OBJ)/rename.o $(OBJ)/scite_utils.o\
$(OBJ)/search.o $(OBJ)/statusbar.o $(OBJ)/string_utils.o\
$(OBJ)/tree_manipulation.o $(OBJ)/xml_processing.o
......@@ -28,14 +27,23 @@ $(GRPH)/text-x-java.xpm \
$(GRPH)/text-x-lua.xpm \
$(GRPH)/sciteproj.xpm
ifndef prefix
ifndef PREFIX
ifdef INSTALL_PREFIX
prefix=$(INSTALL_PREFIX)
PREFIX=$(INSTALL_PREFIX)
else
prefix=/usr/local
PREFIX=/usr/local
endif
endif
NAME=sciteproj
PROG=${BIN}/${NAME}
DEPEND=Makefile.dep
DATADIR= ${DESTDIR}${PREFIX}/share
LOCALEDIR = ${DATADIR}/locale
VERSION=$(shell cat ./VERSION)
ifdef GTK2
PKG_GTK=gtk+-2.0
CHECK_GTK3=1
......@@ -44,10 +52,12 @@ else
endif
LIB_CFLAGS=`pkg-config --cflags $(PKG_GTK)`
STD_LDFLAGS= `pkg-config --libs $(PKG_GTK)`
STD_LDFLAGS=
LOCAL_CFLAGS=$(STD_CFLAGS) $(DEPRECATED) $(CFLAGS) $(LIB_CFLAGS)
LOCAL_LDFLAGS=$(LDFLAGS) $(STD_LDFLAGS)
LIBS+=`pkg-config --libs $(PKG_GTK) pkg-config --libs gthread-2.0`
LOCAL_CFLAGS=$(STD_CFLAGS) $(DEPRECATED) $(CFLAGS) $(LIB_CFLAGS)
LOCAL_LDFLAGS=$(LDFLAGS) $(STD_LDFLAGS)
ifdef CHECK_GTK3
LOCAL_CFLAGS+=-DGTK_DISABLE_SINGLE_INCLUDES
......@@ -58,30 +68,36 @@ endif
ifdef CHECK_DEPRECATED
LOCAL_CFLAGS+=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
endif
endif
LOCAL_CFLAGS+=-DLOCALEDIR=\"$(LOCALEDIR)\" -DPACKAGE=\"$(NAME)\" -DSCITEPROJ_VERSION=\"$(VERSION)\"
all: $(BIN)/sciteproj
all: $(BIN)/$(NAME)
${MAKE} -C po all
$(OBJ)/%.o: $(SRC)/%.c
$(CC) $(LOCAL_CFLAGS) -c $< -o $@
$(BIN)/sciteproj: $(OBJECTS)
$(CC) $(OBJECTS) -o $(PROG) $(LOCAL_LDFLAGS)
$(BIN)/$(NAME): $(OBJECTS)
$(CC) $(LOCAL_LDFLAGS) $(OBJECTS) -o $(PROG) $(LIBS)
clean:
rm -rf $(OBJECTS) $(PROG) Makefile.dep
rm -rf $(OBJECTS) $(PROG) $(DEPEND)
${MAKE} -C po clean
install:
install -d $(DESTDIR)$(prefix)/bin
install -m 755 $(PROG) $(DESTDIR)$(prefix)/bin
install -d $(DESTDIR)$(prefix)/share/pixmaps
install -m 644 graphics/sciteproj.xpm $(DESTDIR)$(prefix)/share/pixmaps
install -d $(DESTDIR)$(PREFIX)/bin
install -m 755 $(PROG) $(DESTDIR)$(PREFIX)/bin
install -d $(DESTDIR)$(PREFIX)/share/pixmaps
install -m 644 graphics/sciteproj.xpm $(DESTDIR)$(PREFIX)/share/pixmaps
${MAKE} -C po install
uninstall:
rm -f $(DESTDIR)$(prefix)/$(PROG)
rm -f $(DESTDIR)$(prefix)/share/pixmaps/sciteproj.xpm
rm -f $(DESTDIR)$(PREFIX)/$(PROG)
rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/sciteproj.xpm
${MAKE} -C po uninstall
Makefile.dep:
$(CC) -MM $(SRC)/*.c | sed -e "s/\([A-Za-z+-0._&+-]*:\)/\$(OBJ)\/\1/g" > Makefile.dep
$(DEPEND):
$(CC) -MM $(SRC)/*.c | sed -e "s/\([A-Za-z0-9+-0._&+-]*:\)/\$(OBJ)\/\1/g" > $(DEPEND)
-include Makefile.dep
-include $(DEPEND)
......@@ -33,7 +33,7 @@ The options availible in the file are:
* The window geometry
You can enter wanted window geometry/positioning, which will be applied to
the program upon next program start. The variable are xpos, ypos, width and
the program upon next program start. The variables are xpos, ypos, width and
height.
Also, the following options exist:
......@@ -54,6 +54,9 @@ Also, the following options exist:
Specifies wether SciteProj shall try to identify the XML as saved by
SciteProj? (Defaults to TRUE)
* hide_statusbar
Don't show the statusbar to save valuable screen-space.
The search dialogs size and position can also be customzed via the
configuration file. See the variables
......
Information for new translators
-------------------------------
Starting fresh
--------------
Get a copy of the sciteproj sources, and create a sciteproj.pot file:
cd po
make sciteproj.pot
Copy the sciteproj.pot to [LANGUAGE ABBREV].po, (replace [LANGUAGE ABBREV] with
the correct abbreviation for your language, e.g. 'sv_SE' if you are translating
into Swedish).
cp sciteproj.pot sv_SE.po
and start translating all strings in the sv_SE.po using your favourite
texteditor, or a "gettext catalogs (.po files) editor" like poedit (which can be
found at http://www.poedit.net.)
Checking your translation for errors and completeness
-----------------------------------------------------
msgfmt -c --statistics sv_SE.po -o /dev/null
Building SciteProj with your translation included
--------------------------------------------------
Edit the Makefile in the po folder to include your translation in the listing
under the LANGUAGES variable.
Then build sciteproj as usual with make and install using make install as root.
Updating your translation
-------------------------
When it is time to update your translation, get the latest git version of
sciteproj, and then do the following:
cd po
rm sciteproj.pot
make sciteproj.pot
Next issue the following command to update your po file:
msgmerge --update sv_SE.po sciteproj.pot
Then open your file and locate the strings that need updating.
0.7.02
\ No newline at end of file
#
# Sciteproj po makefile
# $Id$
#
ifndef PREFIX
ifdef INSTALL_PREFIX
PREFIX=$(INSTALL_PREFIX)
else
PREFIX=/usr/local
endif
endif
NAME = sciteproj
VERSION = $(shell cat ../VERSION)
DATADIR = ${DESTDIR}${PREFIX}/share
LOCALEDIR = ${DATADIR}/locale
SOURCES = about.c addfiles.c clipboard.c drag_drop.c file_utils.c filelist.c \
folder_to_xml.c graphics.c gui.c main.c prefs.c properties_dialog.c \
recent_files.c remove.c rename.c scite_utils.c search.c statusbar.c \
string_utils.c tree_manipulation.c xml_processing.c
XG_ARGS = --keyword=_ --keyword=N_ -w 80 --package-name=${NAME} --package-version=${VERSION} --msgid-bugs-address=gusnan@gusnan.se
LANGUAGES = sv_SE
#
LANGUAGES_MO = $(foreach currlang,$(LANGUAGES),$(currlang).mo)
LANGUAGES_PO = $(foreach currlang,$(LANGUAGES),$(currlang).po)
all: build
${NAME}.pot:
xgettext ${XG_ARGS} --directory=../src/ ${SOURCES} -d ${NAME} -o ./${NAME}.pot
update-pot: ${NAME}.pot
%.pox: %.po
msgmerge -o $@ --previous $< ${NAME}.pot
build: $(LANGUAGES_MO)
$(LANGUAGES_MO): $(LANGUAGES_PO)
for po in ${LANGUAGES}; \
do msgfmt -v --statistics -c -o t-$${po} $${po}.po && mv -f t-$${po} $${po}.mo; \
done
install: all install-dirs
for po in ${LANGUAGES}; \
do install -m 0644 $${po}.mo ${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
done
install-dirs:
for po in ${LANGUAGES}; \
do install -d ${LOCALEDIR}/$${po}/LC_MESSAGES; \
done
uninstall:
for po in ${LANGUAGES}; \
do rm -f ${LOCALEDIR}/$${po}/LC_MESSAGES/${NAME}.mo; \
done
clean-build:
rm -f *.mo
clean-pox:
rm -f *.pox
clean: clean-build
rm -f *~
.PHONY: all build install install-dirs uninstall clean clean-pox clean-build update-pot
This diff is collapsed.
.TH sciteproj 1 "17 October 2011" "Version 0.6.00"
.TH sciteproj 1 "6 February 2011" "Version 0.7.00"
.SH NAME
SciteProj - a Project Manager for the SciTE editor
.SH DESCRIPTION
......@@ -9,15 +9,18 @@ to group files in folders, and saves the project to disc in XML format.
It is based on the program ScitePM by Roy Wood. It uses the director
interface of SciTE to communicate between SciTE and SciteProj.
.SH OPTIONS
.IP "--scite FILENAME"
.IP "-s, --scite FILENAME"
Sets the filename for the instance of SciTE to open.
.IP "--version"
.IP "-v, --version"
Displays the version number of SciteProj
.IP "--generate FILENAME [MAX_DEPTH]"
Generate a sciteproj project file with the name FILENAME from the contents of the current
folder. Go at most down MAX_DEPTH levels in the folder hierarchy. This option will not
consider adding hidden files to the generated project.
.IP "--help"
.IP "-g, --generate=XML_FILENAME"
Generate a sciteproj project file with the name FILENAME from the contents of
the current folder. This option will not consider adding hidden files to the
generated project.
.IP "-m, --max_depth=MAX_DEPTH"
Set maximum depth of folders to read through to MAX_DEPTH when generating
project file.
.IP "-h, --help"
Display a short help
.SH CONFIG FILE
The config file SciteProj is using is stored in the users home directory and is
......
......@@ -51,6 +51,11 @@
<file>./sciteproj.xml</file>
<file>./sciteproj.1</file>
<file>./Makefile</file>
<file>./VERSION</file>
</group>
<group name='po' expanded='TRUE'>
<file>./po/Makefile</file>
<file>./po/sv_SE.po</file>
</group>
<group name='docs' expanded='TRUE'>
<file>./ChangeLog</file>
......@@ -58,6 +63,7 @@
<file>./GPL3.txt</file>
<file>./INSTALL</file>
<file>./README</file>
<file>./README.translators</file>
<file>./sciteproj.desktop</file>
</group>
<group name='graphics' expanded='TRUE'>
......
/**
* about.c - about dialog for SciteProj
*
* Copyright 2008-2011 Andreas Rönnquist
* Copyright 2008-2012 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......@@ -22,6 +22,9 @@
#include <glib.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <locale.h>
#include "about.h"
......@@ -29,24 +32,9 @@
#include "prefs.h"
static gchar *sLicense = (gchar*)"SciteProj is free software: you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License as published by\n"
"the Free Software Foundation, either version 3 of the License, or\n"
"(at your option) any later version.\n"
"\n"
"SciteProj is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
"GNU General Public License for more details.\n"
"\n"
"You should have received a copy of the GNU General Public License\n"
"along with SciteProj. If not, see <http://www.gnu.org/licenses/>.\n";
gchar *homepage_string=(gchar*)"http://sciteproj.sourceforge.net";
gchar *sVersion = (gchar*)"0.6.06";
gchar *sVersion = (gchar*)SCITEPROJ_VERSION;
static GtkWidget *window;
......@@ -74,7 +62,11 @@ 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;
......@@ -82,6 +74,12 @@ void create_about_dialog()
GtkWidget *notebook;
GtkWidget *notebook_label1;
GtkWidget *notebook_label2;
GtkWidget *sciteproj_label;
GtkWidget *version_string_label;
GtkWidget *copyright_label;
GtkWidget *gtk_version_label;
GtkTextBuffer *textbuffer_info;
GtkTextBuffer *textbuffer_license;
GtkWidget *textview_license;
......@@ -89,8 +87,6 @@ void create_about_dialog()
gchar *copyrightstring;
GtkWidget *label;
// Make the dialog
window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
......@@ -99,40 +95,67 @@ 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
label=gtk_label_new(NULL);
gtk_label_set_selectable(GTK_LABEL(label),FALSE);
gtk_label_set_markup(GTK_LABEL(label),"<big><b>SciteProj</b></big>");
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>");
gtk_box_pack_start(GTK_BOX(vbox),label,FALSE,FALSE,0);
#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 *version_string;
#ifdef _DEBUG
version_string=g_strdup_printf("version %s DEBUG",sVersion);
version_string=g_strdup_printf(_("version %s DEBUG"),sVersion);
#else
version_string=g_strdup_printf("version %s",sVersion);
version_string=g_strdup_printf(_("version %s"),sVersion);
#endif
label=gtk_label_new(version_string);
gtk_label_set_selectable(GTK_LABEL(label),FALSE);
gtk_box_pack_start(GTK_BOX(vbox),label,FALSE,FALSE,0);
version_string_label=gtk_label_new(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-2011 Andreas Rönnquist <gusnan@gusnan.se>");
label=gtk_label_new(copyrightstring);
gtk_label_set_selectable(GTK_LABEL(label),FALSE);
gtk_box_pack_start(GTK_BOX(vbox),label,FALSE,FALSE,0);
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",
......@@ -140,33 +163,62 @@ void create_about_dialog()
gtk_major_version, gtk_minor_version, gtk_micro_version,
glib_major_version, glib_minor_version, glib_micro_version);
label=gtk_label_new(gtk_string);
gtk_version_label=gtk_label_new(gtk_string);
gtk_label_set_selectable(GTK_LABEL(label),FALSE);
gtk_box_pack_start(GTK_BOX(vbox),label,FALSE,FALSE,0);
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
notebook=gtk_notebook_new();
notebook_label1=gtk_label_new("Information");
notebook_label2=gtk_label_new("License");
notebook_label1=gtk_label_new(_("Information"));
notebook_label2=gtk_label_new(_("License"));
// create a scrolled_window and a textview for the license
textbuffer_license=gtk_text_buffer_new(NULL);
gtk_text_buffer_get_start_iter(textbuffer_license,&iter);
gchar *sLicense = _("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.\n"
"\n"
"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.\n"
"\n"
"You should have received a copy of the GNU General Public License "
"along with SciteProj. If not, see <http://www.gnu.org/licenses/>.\n");
gtk_text_buffer_insert(textbuffer_license,&iter,sLicense,-1);
textview_license=gtk_text_view_new_with_buffer(textbuffer_license);
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(textview_license),GTK_WRAP_WORD);
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(textview_license),TRUE);
gtk_text_view_set_editable(GTK_TEXT_VIEW(textview_license),FALSE);
......@@ -187,15 +239,17 @@ void create_about_dialog()
gtk_text_buffer_get_start_iter(textbuffer_info,&iter);
gchar *about_text2=g_strdup_printf(""
"SciteProj is based on ScitePM by\n"
"%s\n"
"Roy Wood <roy.wood@gmail.com> and\n"
"Martin Andrews <ScitePM@PLATFORMedia.com>\n\n"
"Many thanks to\n"
"%s\n"
"Mattias Wecksten <wecksten@gmail.com>\n"
"Frank Wunderlich\n\n"
"For more information about SciteProj, see the README file that\n"
"is provided with the package."
);
"%s",
_("SciteProj is based on ScitePM by"),
_("Many thanks to"),
_("For more information about SciteProj, see the README file that\n"
"is provided with this package."));
gchar *text_to_add;
......@@ -234,20 +288,40 @@ void create_about_dialog()
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);
hbox=gtk_hbox_new(FALSE,0);
// Create an ok button
ok_button=gtk_button_new_from_stock(GTK_STOCK_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_end(GTK_BOX(hbox),ok_button,FALSE,FALSE,0);
//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);
gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,0);
#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);
......@@ -273,7 +347,7 @@ void create_about_dialog()
*/
void show_version()
{
g_print("SciteProj version %s\n", sVersion);
g_print(_("SciteProj version %s\n"), sVersion);
}
......
/**
* about.h - about dialog for SciteProj
*
* Copyright 2008-2011 Andreas Rönnquist
* Copyright 2008-2012 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* addfiles.c - Interface for adding files to the project
*
* Copyright 2011 Andreas Rönnquist
* Copyright 2011-2012 Andreas Rönnquist
*
* This file is part of SciteProj
*
......@@ -22,6 +22,9 @@
#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib/gi18n.h>
#include <locale.h>
#include "clicked_node.h"
......@@ -139,7 +142,12 @@ void addfile_menu_cb()
*/
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);
}
......@@ -225,27 +233,46 @@ void ask_name_add_group(GtkTreeIter *nodeIter)
GtkWidget* gtkEntry = NULL;
GtkWidget* gtkLabel = NULL;
GtkWidget* table = NULL;
#if GTK_MAJOR_VERSION<3
GtkAttachOptions options = (GtkAttachOptions) (GTK_EXPAND | GTK_SHRINK | GTK_FILL);
#endif
const gchar *groupName = NULL;
gint dialogResponse;
// Create a dialog box with a nicely-centered text entry widget
dialog = gtk_dialog_new_with_buttons("Choose Group Name", NULL, GTK_DIALOG_MODAL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL);
dialog = gtk_dialog_new_with_buttons(_("Create Group"), NULL, GTK_DIALOG_MODAL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL);
g_signal_connect(dialog, "response", G_CALLBACK(gtk_widget_hide), dialog);
gtk_container_set_border_width(GTK_CONTAINER(dialog), 0);
#if GTK_MAJOR_VERSION>=3
table=gtk_grid_new();
gtk_grid_set_row_spacing (GTK_GRID (table), 6);
gtk_grid_set_column_spacing(GTK_GRID(table),6);
#else
table = gtk_table_new(1, 2, FALSE);
#endif
gtkLabel = gtk_label_new("Enter name of new group:");
gtk_table_attach(GTK_TABLE(table), gtkLabel, 0, 1, 0, 1, options, options, 5, 5);
gtkLabel = gtk_label_new(_("Enter name of new group:"));
#if GTK_MAJOR_VERSION>=3
gtk_grid_attach(GTK_GRID(table),gtkLabel,0,0,3,1);
#else
gtk_table_attach(GTK_TABLE(table), gtkLabel, 0, 1, 0, 1, options, options, 5, 5);
#endif
gtkEntry = gtk_entry_new();
g_signal_connect(G_OBJECT(gtkEntry), "activate", G_CALLBACK(entry_widget_activated_cb), dialog);
#if GTK_MAJOR_VERSION>=3
gtk_grid_attach_next_to(GTK_GRID(table),gtkEntry,gtkLabel,GTK_POS_RIGHT,3,1);
#else
gtk_table_attach(GTK_TABLE(table), gtkEntry, 1, 2, 0, 1, options, options, 5, 5);
#endif
GtkWidget *container_vbox=gtk_dialog_get_content_area(GTK_DIALOG(dialog));
......
/**
* addfiles.h - Interface for adding files to the project
*
* Copyright 2011 Andreas Rönnquist
* Copyright 2011-2012 Andreas Rönnquist
*
* This file is part of SciteProj
*
......
/**
* clicked_node.h - clicked node struct for SciteProj
*
* Copyright 2006 Roy Wood, 2009-2011 Andreas Rönnquist
* Copyright 2006 Roy Wood, 2009-2012 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......
/**
* clipboard.c - clipboard code for SciteProj
*
* Copyright 2010-2011 Andreas Rönnquist