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

Imported Upstream version 1.05

parent 7a2976f2
......@@ -2,6 +2,16 @@
ChangeLog:
----------
1.05
* Update copyright years
* Fix gtk_misc_set_alignment warnings
* Fix Swedish translation of descending
* Update translation example with valid language code
* Remove unused Swedish translations, cleaning up the po-file
* Don't use deprecated cursor functions
* Formatting and whitespace fixes
* Makefile: make CC customizable
1.04
* Fix manpage commenting
......@@ -329,7 +339,7 @@ ChangeLog:
* Initial release
--------------------------------------------------------------------------------
Copyright (C) 2010-2014 Andreas Rönnquist
Copyright (C) 2010-2015 Andreas Rönnquist
This file is distributed under the same license
as the sciteproj package, see COPYING file.
--------------------------------------------------------------------------------
......@@ -4,7 +4,9 @@
# as the sciteproj package, see COPYING file.
#
CC=gcc
ifndef CC
CC=gcc
endif
SRC=src
BIN=bin
GRPH=graphics
......@@ -99,6 +101,6 @@ uninstall:
${MAKE} -C po uninstall
$(DEPEND):
$(CC) -MM $(SRC)/*.c | sed -e "s/\([A-Za-z0-9+-0._&+-]*:\)/\$(OBJ)\/\1/g" > $(DEPEND)
$(CC) $(LOCAL_CFLAGS) -MM $(SRC)/*.c | sed -e "s/\([A-Za-z0-9+-0._&+-]*:\)/\$(OBJ)\/\1/g" > $(DEPEND)
-include $(DEPEND)
#
# Copyright (C) 2010-2014 Andreas Rönnquist
# Copyright (C) 2010-2015 Andreas Rönnquist
# This file is distributed under the same license
# as the sciteproj package, see COPYING file.
#
......@@ -34,7 +34,7 @@ following "_" is the keyboard shortcut for that menu item.
Checking your translation for errors and completeness
-----------------------------------------------------
msgfmt -c --statistics sv_SE.po -o /dev/null
msgfmt -c --statistics sv.po -o /dev/null
Building SciteProj with your translation included
......@@ -57,6 +57,6 @@ make sciteproj.pot
Next issue the following command to update your po file:
msgmerge --update sv_SE.po sciteproj.pot
msgmerge --update sv.po sciteproj.pot
Then open your file and locate the strings that need updating.
1.04
\ No newline at end of file
1.05
\ No newline at end of file
......@@ -210,7 +210,7 @@ msgstr "Sortera mapp stigande efter namn"
#: menus.c:186
msgid "Sort descending by name"
msgstr "Sortera mapp stigande efter namn"
msgstr "Sortera mapp fallande efter namn"
#: menus.c:188
msgid "Sort ascending by extension"
......@@ -218,7 +218,7 @@ msgstr "Sortera mapp stigande efter filändelse"
#: menus.c:189
msgid "Sort descending by extension"
msgstr "Sortera mapp stigande efter filändelse"
msgstr "Sortera mapp fallande efter filändelse"
#: menus.c:212
msgid "Update folder content"
......@@ -336,368 +336,3 @@ msgstr "Fel:%s"
msgid "Welcome to SciteProj\n"
msgstr "Välkommen till SciteProj\n"
#~ msgid "Create Group"
#~ msgstr "Skapa Grupp"
#~ msgid "Enter name of new group:"
#~ msgstr "Mata in namnet på den nya gruppen:"
#~ msgid "C/C++ Files"
#~ msgstr "C/C++-filer"
#~ msgid "LAMP Script Files"
#~ msgstr "LAMP-skript-filer"
#~ msgid "Java Files"
#~ msgstr "Java-filer"
#~ msgid "JavaScript Files"
#~ msgstr "Javascript-filer"
#~ msgid "HTML Files"
#~ msgstr "HTML-filer"
#~ msgid "All Files"
#~ msgstr "Alla filer"
#~ msgid "You need to save the project before adding files."
#~ msgstr "Du måste spara projektet innan du adderar filer."
#~ msgid "Add Files"
#~ msgstr "Lägg till filer"
#~ msgid ""
#~ "\n"
#~ "The following files:\n"
#~ "\n"
#~ msgstr ""
#~ "\n"
#~ "Följande filer:\n"
#~ "\n"
#~ msgid ""
#~ "%s\n"
#~ "couldn't be added, because they were already present in the project.\n"
#~ msgstr ""
#~ "%s\n"
#~ "kunde inte läggas till, eftersom dom redan fanns i projektet.\n"
#~ msgctxt "Menu|File|"
#~ msgid "_Exit"
#~ msgstr "_Avsluta"
#~ msgctxt "Menu|Edit|"
#~ msgid "Create _group"
#~ msgstr "Skapa _grupp"
#~ msgctxt "Menu|Edit|"
#~ msgid "Create _file"
#~ msgstr "Skapa _fil"
#~ msgctxt "Menu|Edit|"
#~ msgid "Delete file(s)"
#~ msgstr "Ta bort fil(er)"
#~ msgctxt "Menu|Edit|"
#~ msgid "Expand all groups"
#~ msgstr "Expandera alla grupper"
#~ msgctxt "Menu|Edit|"
#~ msgid "Collapse all groups"
#~ msgstr "Kollapsa alla grupper"
#~ msgctxt "Menu|Edit|"
#~ msgid "Create files"
#~ msgstr "Skapa filer"
#~ msgctxt "Menu|Edit|"
#~ msgid "Create folder"
#~ msgstr "Skapa mapp"
#~ msgctxt "Menu|Popup|Group"
#~ msgid "Create file"
#~ msgstr "Skapa Fil"
#~ msgctxt "Menu|Popup|Group"
#~ msgid "Add folder"
#~ msgstr "Lägg till mapp"
#~ msgctxt "Menu|Popup|Group"
#~ msgid "Rename folder"
#~ msgstr "Döp om mapp"
#~ msgctxt "Menu|Popup|Group"
#~ msgid "Delete folder"
#~ msgstr "Ta bort mapp"
#~ msgctxt "Menu|Edit"
#~ msgid "Sort folder descending by name"
#~ msgstr "Sortera mapp fallande efter namn"
#~ msgctxt "Menu|Edit|"
#~ msgid "Sort folder descending by extension"
#~ msgstr "Sortera mapp fallande efter filändelse"
#~ msgctxt "Menu|Reload"
#~ msgid "Refresh folder content"
#~ msgstr "Uppdatera mappinnehåll"
#~ msgctxt "Menu|View|"
#~ msgid "View recently opened files"
#~ msgstr "Visa nyligen öppnade filer"
#~ msgctxt "Menu|Popup|File"
#~ msgid "Delete file"
#~ msgstr "Ta bort fil"
#~ msgctxt "Menu|Popup|File"
#~ msgid "Properties"
#~ msgstr "Egenskaper"
#~ msgctxt "Menu|Popup|RecentFile"
#~ msgid "Open file in SciTE"
#~ msgstr "Öppnar en fil i SciTE"
#~ msgctxt "Menu|Popup|RecentFile"
#~ msgid "Copy filename to clipboard"
#~ msgstr "Kopiera filnamn till urklipp"
#~ msgctxt "Menu|Popup|RecentFile"
#~ msgid "Properties"
#~ msgstr "Egenskaper"
#~ msgid "Error: Invalid directory!"
#~ msgstr "Fel: Ogiltig katalog!"
#~ msgid "Error: Couldn't g_chdir to directory"
#~ msgstr "Fel: Kunde inte byta till katalog med hjälp av g_chdir"
#~ msgid "Couldn't create file with the name %s!"
#~ msgstr "Kunde inte skapa en fil med namnet '%s'!"
#~ msgid ""
#~ "Generate a sciteproj project file with name XML_FILENAME, recursively "
#~ "from current folder"
#~ msgstr ""
#~ "Generera en projektfil för sciteproj med namnet XML_FILNAMN, rekursivt "
#~ "från aktuell mapp"
#~ msgid "XML_FILENAME"
#~ msgstr "XML_FILNAMN"
#~ msgid ""
#~ "Set maximum depth of folders to read through to MAX_DEPTH when generating "
#~ "project file"
#~ msgstr ""
#~ "Sätt maximalt djup av mappar att läsa igenom till MAX_DJUP vid generering "
#~ "av projektfil"
#~ msgid "MAX_DEPTH"
#~ msgstr "MAX_DJUP"
#~ msgid "Generated '%s' successfully!"
#~ msgstr "Genererade '%s' framgångsrikt!"
#~ msgid "Error initing preferences: %s"
#~ msgstr "Fel vid initiering av inställningar: %s"
#~ msgid "Contains number of Files:"
#~ msgstr "Innehåller antal filer:"
#~ msgid "Remove file '%s' from project?"
#~ msgstr "Ta bort filen '%s' från projektet?"
#~ msgid "Remove file from project?"
#~ msgstr "Ta bort fil från projektet?"
#~ msgid "Search project"
#~ msgstr "Sök i projektet"
#~ msgid "Find What:"
#~ msgstr "Hitta vad:"
#~ msgid "Match case"
#~ msgstr "Matcha stora/små bokstäver"
#~ msgid "Match whole word only"
#~ msgstr "Matcha endast hela ord"
#~ msgid ""
#~ "There was problems opening the following files in the project:\n"
#~ "\n"
#~ msgstr ""
#~ "Det var problem med att öppna följande filer i projektet:\n"
#~ "\n"
#~ msgid ""
#~ "\n"
#~ "They couldn't be opened for reading in the search.\n"
#~ msgstr ""
#~ "\n"
#~ "Dom kunde inte öppnas för läsning i sökningen.\n"
#~ msgid "Please enter a text to search for!\n"
#~ msgstr "Vänligen mata in en text att söka efter!\n"
#~ msgid "Filename"
#~ msgstr "Filnamn"
#~ msgid "Line"
#~ msgstr "Rad"
#~ msgid "File contents"
#~ msgstr "Fil-innehåll"
#~ msgid "Found %d elements"
#~ msgstr "Hittade %d element"
#~ msgid "The search didn't give any results."
#~ msgstr "Sökningen gav inga resultat."
#~ msgctxt "Menu|Edit|"
#~ msgid "Search"
#~ msgstr "Sök"
#~ msgid ""
#~ "An error occurred while trying to load the specified project file: %s"
#~ msgstr "Ett fel uppstod vid öppning av en specifik projektfil: %s"
#~ msgid "Save Project"
#~ msgstr "Spara projekt"
#~ msgid "An error occurred while making project file paths relative: %s"
#~ msgstr "Ett fel uppstod medans projektets sökvägar gjordes relativa: %s"
#~ msgid "Open Project"
#~ msgstr "Öppna projekt"
#~ msgid "Project Files (*.xml)"
#~ msgstr "Projektfiler (*.xml)"
#~ msgid "%s: Not a valid sciteproj XML file!"
#~ msgstr "%s: Är inte en giltig sciteproj XML-fil!"
#~ msgid "An error occurred while saving the project: %s"
#~ msgstr "Ett fel uppstod medan projektets sparades: %s"
#~ msgid "An error occurred while opening project file: %s"
#~ msgstr "Ett fel uppstod under öppning av projektfil: %s"
#~ msgctxt "Menu|File|"
#~ msgid "_Open project"
#~ msgstr "_Öppna projekt"
#~ msgctxt "Menu|File|"
#~ msgid "_Save project"
#~ msgstr "_Spara projekt"
#~ msgctxt "Menu|File|"
#~ msgid "Save project as..."
#~ msgstr "Spara projekt som..."
#~ msgctxt "Menu|Edit|"
#~ msgid "Add _file"
#~ msgstr "Lägg till _fil"
#~ msgctxt "Menu|Popup|Group"
#~ msgid "Add files to group"
#~ msgstr "Lägg till filer till grupp"
#~ msgctxt "Menu|Popup|Group"
#~ msgid "Add subgroup to group"
#~ msgstr "Lägg till undergrupp till grupp"
#~ msgctxt "Menu|Popup|Group"
#~ msgid "Remove group from project"
#~ msgstr "Ta bort grupp från projektet"
#~ msgctxt "Menu|Popup|File"
#~ msgid "Remove file From project"
#~ msgstr "Ta bort fil från projektet"
#~ msgid "Save Project with a specific filename"
#~ msgstr "Spara projekt med ett specifikt filnamn"
#~ msgid "Exit"
#~ msgstr "Avsluta"
#~ msgctxt "Edit|"
#~ msgid "Create _group"
#~ msgstr "Skapa _grupp"
#~ msgid "Create a new group in the project"
#~ msgstr "Skapar en ny grupp i projektet"
#~ msgid "Add a file to the project"
#~ msgstr "Lägg till en fil i projektet"
#~ msgid "Remove selected files from the project"
#~ msgstr "Ta bort valda filer från projektet"
#~ msgid "Expand All Groups"
#~ msgstr "Expandera alla grupper"
#~ msgid "Collapse All Groups"
#~ msgstr "Kollapsa alla grupper"
#~ msgid "Search for a string in the project"
#~ msgstr "Sök efter en sträng i projektet"
#~ msgid "Show information about this application"
#~ msgstr "Visa information om denna applikation"
#~ msgid "Add files to the project"
#~ msgstr "Lägg till filer till projektet"
#~ msgid "Add files to an existing group"
#~ msgstr "Lägg till filer till en existerande grupp"
#~ msgid "Add a subgroup to an existing group"
#~ msgstr "Lägger till en undergrupp till en existerande grupp"
#~ msgid "Rename a group"
#~ msgstr "Byter namn på en grupp"
#~ msgid "Remove a group and its children from the project"
#~ msgstr "Ta bort en grupp och dess innehåll från projektet"
#~ msgid "Sort the filenames ascending"
#~ msgstr "Sorterar filnamnen i gruppen stigande"
#~ msgid "Sort the filenames descending"
#~ msgstr "Sorterar filnamnen i gruppen fallande"
#~ msgid "Show group properties"
#~ msgstr "Visa mappegenskaper"
#~ msgid "Edit program options"
#~ msgstr "Editera programmets egenskaper"
#~ msgid "Open a file in SciTE"
#~ msgstr "Öppnar en fil i SciTE"
#~ msgid "Remove a file from the project"
#~ msgstr "Ta bort en fil från projektet"
#~ msgid "Copies the full path and filename to the clipboard"
#~ msgstr "Kopierar filnamn inklusive hela sökvägen till urklipp"
#~ msgctxt "RightClickFilePopup"
#~ msgid "Properties"
#~ msgstr "Egenskaper"
#~ msgid "Show file properties"
#~ msgstr "Visa fileegenskaper"
#~ msgid "Remove file from this List"
#~ msgstr "Ta bort fil från denna lista"
#~ msgctxt "RecentFilePopup"
#~ msgid "Properties"
#~ msgstr "Egenskaper"
#~ msgid "version %s DEBUG"
#~ msgstr "version %s DEBUG"
#~ msgid "SciteProj version %s\n"
#~ msgstr "SciteProj version %s\n"
This diff is collapsed.
......@@ -46,8 +46,8 @@
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);
#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
......
/**
* clipboard.c - clipboard code for SciteProj
*
* Copyright 2010-2012 Andreas Rönnquist
* Copyright 2010-2015 Andreas Rönnquist
*
* This file is part of SciteProj.
*
......@@ -40,19 +40,19 @@
*/
void copy_filename_to_clipboard(GtkTreeModel *model, GtkTreeIter *iter)
{
GError *err=NULL;
GError *err = NULL;
gchar *nodename=NULL;
gchar *filePath=NULL;
int nodeType=-1;
GdkDisplay *display=NULL;
GtkClipboard *clipboard=NULL;
gchar *nodename = NULL;
gchar *filePath = NULL;
int nodeType = -1;
GdkDisplay *display = NULL;
GtkClipboard *clipboard = NULL;
gtk_tree_model_get(model, iter,
COLUMN_FILENAME, &nodename,
COLUMN_ITEMTYPE, &nodeType,
COLUMN_FILEPATH, &filePath,
-1);
COLUMN_FILENAME, &nodename,
COLUMN_ITEMTYPE, &nodeType,
COLUMN_FILEPATH, &filePath,
-1);
gchar *absFilePath = NULL; //g_strdup_printf("%s",filePath);
......@@ -63,11 +63,11 @@ void copy_filename_to_clipboard(GtkTreeModel *model, GtkTreeIter *iter)
goto EXITPOINT;
}
display=gdk_display_get_default();
display = gdk_display_get_default();
clipboard=gtk_clipboard_get_for_display(display,GDK_SELECTION_CLIPBOARD);
clipboard = gtk_clipboard_get_for_display(display, GDK_SELECTION_CLIPBOARD);
gtk_clipboard_set_text(clipboard,absFilePath,-1);
gtk_clipboard_set_text(clipboard, absFilePath, -1);
EXITPOINT:
......@@ -83,7 +83,7 @@ void copy_filename_to_clipboard_cb()
if (!clicked_node.valid || clicked_node.type != ITEMTYPE_FILE) {
//goto EXITPOINT;
} else {
copy_filename_to_clipboard(gtk_tree_view_get_model(GTK_TREE_VIEW(projectTreeView)),&(clicked_node.iter));
copy_filename_to_clipboard(gtk_tree_view_get_model(GTK_TREE_VIEW(projectTreeView)), &(clicked_node.iter));
}
}
/**
* expand.c - expand a folder in the treeview
*
*
* Copyright 2012 Andreas Rönnquist
*
* This file is part of SciteProj.
*
* devilspie2 is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* devilspie2 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.
*
......@@ -16,7 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with devilspie2.
* along with devilspie2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <glib.h>
......@@ -49,26 +49,26 @@
void expand_tree(GtkTreeModel *tree_model, GtkTreeIter *start_iter)
{
GtkTreeIter child_iter;
gint type;
gchar *filepath;
if (start_iter) {
if (gtk_tree_model_iter_children(tree_model,&child_iter,start_iter)) {
if (gtk_tree_model_iter_children(tree_model, &child_iter, start_iter)) {
do {
gtk_tree_model_get(tree_model, &child_iter,
COLUMN_ITEMTYPE, &type,
COLUMN_FILEPATH, &filepath, -1);
gtk_tree_model_get(tree_model, &child_iter,
COLUMN_ITEMTYPE, &type,
COLUMN_FILEPATH, &filepath, -1);
if (type == ITEMTYPE_GROUP) {
if (type==ITEMTYPE_GROUP) {
// Check if we should expand this row
//printf("filepath :%s\n", filepath);
GtkTreePath *path=gtk_tree_model_get_path(tree_model, &child_iter);
GtkTreePath *path = gtk_tree_model_get_path(tree_model, &child_iter);
if (get_expand_folder(filepath)) {
expand_tree_row(path, FALSE);
expand_tree(tree_model, &child_iter);
......@@ -95,99 +95,99 @@ void start_expand_tree(GtkTreeModel *tree_model, GtkTreeIter *iter)
*/
gboolean get_expand_folder(gchar *folder_name)
{
gboolean result=FALSE;
gboolean result = FALSE;
gchar *script_filename = g_build_filename(get_project_directory(), "sciteprojrc.lua", NULL);
lua_State *lua=NULL;
lua_State *lua = NULL;
if (g_file_test(script_filename, G_FILE_TEST_EXISTS)) {
int num=-1;
lua=init_script();
if (load_script(lua, script_filename)!=0) {
int num = -1;
lua = init_script();
if (load_script(lua, script_filename) != 0) {
printf("error loading script: %s\n", script_filename);
goto EXITPOINT;
}
run_script(lua);
lua_getglobal(lua, "open_folders");
// Make sure we have a value at all
if (lua_isnil(lua, -1)) {
goto EXITPOINT;
}
// And make sure that it is a table
if (!lua_istable(lua,-1)) {
if (!lua_istable(lua, -1)) {
printf("open_folders is supposed to be a table!\n");
goto EXITPOINT;
}
lua_pushnil(lua);
while(lua_next(lua, -2)) {
gchar *key=NULL;
if (lua_type(lua, -2)==LUA_TSTRING) { // key type is string
key=g_strdup(lua_tostring(lua, -2));
gchar *temp=clean_folder(key);
gchar *key = NULL;
if (lua_type(lua, -2) == LUA_TSTRING) { // key type is string
key = g_strdup(lua_tostring(lua, -2));
gchar *temp = clean_folder(key);
g_free(key);
key=temp;
key = temp;
}
if (lua_type(lua, -1)==LUA_TBOOLEAN) { // value is boolean
if (lua_type(lua, -1) == LUA_TBOOLEAN) { // value is boolean
num = lua_toboolean(lua, -1);
}
// gboolean abs_path_to_relative_path(const gchar *absPath, gchar **relativePath, const gchar *basePath, GError **err);
// convert the absolute path to a relative path
gchar *relative_path=NULL;
if (g_strcmp0(folder_name, get_project_directory())==0) {
relative_path=g_strdup("."); //get_project_directory();
gchar *relative_path = NULL;
if (g_strcmp0(folder_name, get_project_directory()) == 0) {
relative_path = g_strdup("."); //get_project_directory();
}
if (!relative_path) {
if (abs_path_to_relative_path(folder_name, &relative_path, get_project_directory(), NULL)) {
}
}
gchar *folder_cleaned=clean_folder(relative_path);
if (g_strcmp0(key, folder_cleaned)==0) {
result=FALSE;
if (num) result=TRUE;
gchar *folder_cleaned = clean_folder(relative_path);
if (g_strcmp0(key, folder_cleaned) == 0) {
result = FALSE;
if (num) result = TRUE;
}
if (key) g_free(key);
if (relative_path) g_free(relative_path);
if (folder_cleaned) g_free(folder_cleaned);
lua_pop(lua, 1);
}
lua_pop(lua, 1);
}
EXITPOINT:
EXITPOINT:
g_free(script_filename);
if (lua)
done_script(lua);
return result;
}
/**
* expand.h - expand a folder in the treeview
*
*
* Copyright 2012 Andreas Rönnquist
*
* This file is part of SciteProj.
*
* devilspie2 is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* devilspie2 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.
*
......@@ -16,7 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with devilspie2.
* along with devilspie2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __HEADER_EXPAND_
......
......@@ -46,7 +46,7 @@
/**
*