Compare commits
2 Commits
675139edb0
...
bbe22712fe
Author | SHA1 | Date | |
---|---|---|---|
bbe22712fe | |||
37bf8ee648 |
@ -218,8 +218,8 @@ endif (BUILD_TESTING)
|
||||
|
||||
# CPack
|
||||
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "StarDict terminal UI")
|
||||
set (CPACK_PACKAGE_VENDOR "Premysl Janouch")
|
||||
set (CPACK_PACKAGE_CONTACT "Přemysl Janouch <p@janouch.name>")
|
||||
set (CPACK_PACKAGE_VENDOR "Premysl Eric Janouch")
|
||||
set (CPACK_PACKAGE_CONTACT "Přemysl Eric Janouch <p@janouch.name>")
|
||||
set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||
set (CPACK_PACKAGE_VERSION_MAJOR ${project_VERSION_MAJOR})
|
||||
set (CPACK_PACKAGE_VERSION_MINOR ${project_VERSION_MINOR})
|
||||
|
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
||||
Copyright (c) 2013 - 2018, Přemysl Janouch <p@janouch.name>
|
||||
Copyright (c) 2013 - 2020, Přemysl Eric Janouch <p@janouch.name>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
4
po/cs.po
4
po/cs.po
@ -1,5 +1,5 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) 2013 Přemysl Janouch
|
||||
# Copyright (C) 2013 Přemysl Eric Janouch
|
||||
# This file is distributed under the same license as the sdtui package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
@ -9,7 +9,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: https://github.com/pjanouch/sdtui/issues\n"
|
||||
"POT-Creation-Date: 2016-09-28 16:12+0200\n"
|
||||
"PO-Revision-Date: 2016-09-28 16:15+0200\n"
|
||||
"Last-Translator: Přemysl Janouch <p@janouch.name>\n"
|
||||
"Last-Translator: Přemysl Eric Janouch <p@janouch.name>\n"
|
||||
"Language-Team: Czech <translation-team-cs@lists.sourceforge.net>\n"
|
||||
"Language: cs\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -42,6 +42,6 @@ fi
|
||||
# Finally make the template
|
||||
xgettext -LC -k_ -kN_ $SOURCES -o "$DIR/$PACKAGE.pot" \
|
||||
--package-name="$PACKAGE" --package-version="$VERSION" \
|
||||
--copyright-holder="Přemysl Janouch" \
|
||||
--copyright-holder="Přemysl Eric Janouch" \
|
||||
--msgid-bugs-address="https://github.com/pjanouch/$PACKAGE/issues"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR Přemysl Janouch
|
||||
# Copyright (C) YEAR Přemysl Eric Janouch
|
||||
# This file is distributed under the same license as the sdtui package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Here I use the `espeak' process rather than libespeak because of the GPL.
|
||||
* It's far from ideal, rather good as a starting point.
|
||||
*
|
||||
* Copyright (c) 2013, Přemysl Janouch <p@janouch.name>
|
||||
* Copyright (c) 2013, Přemysl Eric Janouch <p@janouch.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* dictzip-input-stream.c: dictzip GIO stream reader
|
||||
*
|
||||
* Copyright (c) 2013, Přemysl Janouch <p@janouch.name>
|
||||
* Copyright (c) 2013, Přemysl Eric Janouch <p@janouch.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* dictzip-input-stream.h: dictzip GIO stream reader
|
||||
*
|
||||
* Copyright (c) 2013, Přemysl Janouch <p@janouch.name>
|
||||
* Copyright (c) 2013, Přemysl Eric Janouch <p@janouch.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* generator.c: dictionary generator
|
||||
*
|
||||
* Copyright (c) 2013, Přemysl Janouch <p@janouch.name>
|
||||
* Copyright (c) 2013, Přemysl Eric Janouch <p@janouch.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Nothing fancy. Just something moved out off the `stardict' test to be
|
||||
* conveniently reused by the included tools.
|
||||
*
|
||||
* Copyright (c) 2013, Přemysl Janouch <p@janouch.name>
|
||||
* Copyright (c) 2013, Přemysl Eric Janouch <p@janouch.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
|
@ -8,7 +8,7 @@
|
||||
* So far only the `m' field is supported. Feel free to extend the program
|
||||
* according to your needs, it's not very complicated.
|
||||
*
|
||||
* Copyright (c) 2013, Přemysl Janouch <p@janouch.name>
|
||||
* Copyright (c) 2013, Přemysl Eric Janouch <p@janouch.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
|
35
src/sdtui.c
35
src/sdtui.c
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* StarDict terminal UI
|
||||
*
|
||||
* Copyright (c) 2013 - 2018, Přemysl Janouch <p@janouch.name>
|
||||
* Copyright (c) 2013 - 2020, Přemysl Eric Janouch <p@janouch.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
@ -980,7 +980,7 @@ app_show_help (Application *self)
|
||||
{
|
||||
PROJECT_NAME " " PROJECT_VERSION,
|
||||
_("Terminal UI for StarDict dictionaries"),
|
||||
"Copyright (c) 2013 - 2018, Přemysl Janouch",
|
||||
"Copyright (c) 2013 - 2018, Přemysl Eric Janouch",
|
||||
"",
|
||||
_("Type to search")
|
||||
};
|
||||
@ -1296,6 +1296,22 @@ app_goto_dictionary (Application *self, guint n)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/// Switch to a different dictionary by delta.
|
||||
static gboolean
|
||||
app_goto_dictionary_delta (Application *self, gint n)
|
||||
{
|
||||
GArray *dicts = self->dictionaries;
|
||||
if (dicts->len <= 1)
|
||||
return FALSE;
|
||||
|
||||
guint i = 0;
|
||||
while (i < dicts->len &&
|
||||
g_array_index (dicts, Dictionary, i).dict != self->dict)
|
||||
i++;
|
||||
|
||||
return app_goto_dictionary (self, (i + dicts->len + n) % dicts->len);
|
||||
}
|
||||
|
||||
/// The terminal has been resized, make appropriate changes.
|
||||
static gboolean
|
||||
app_process_resize (Application *self)
|
||||
@ -1337,6 +1353,8 @@ enum user_action
|
||||
USER_ACTION_GOTO_DEFINITION_NEXT,
|
||||
USER_ACTION_GOTO_PAGE_PREVIOUS,
|
||||
USER_ACTION_GOTO_PAGE_NEXT,
|
||||
USER_ACTION_GOTO_DICTIONARY_PREVIOUS,
|
||||
USER_ACTION_GOTO_DICTIONARY_NEXT,
|
||||
|
||||
USER_ACTION_INPUT_CONFIRM,
|
||||
USER_ACTION_INPUT_HOME,
|
||||
@ -1429,6 +1447,15 @@ app_process_user_action (Application *self, UserAction action)
|
||||
RESTORE_CURSOR
|
||||
return TRUE;
|
||||
|
||||
case USER_ACTION_GOTO_DICTIONARY_PREVIOUS:
|
||||
if (!app_goto_dictionary_delta (self, -1))
|
||||
beep ();
|
||||
return TRUE;
|
||||
case USER_ACTION_GOTO_DICTIONARY_NEXT:
|
||||
if (!app_goto_dictionary_delta (self, +1))
|
||||
beep ();
|
||||
return TRUE;
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
case USER_ACTION_INPUT_HOME:
|
||||
@ -1593,6 +1620,10 @@ app_process_keysym (Application *self, termo_key_t *event)
|
||||
{
|
||||
[TERMO_SYM_UP] = USER_ACTION_GOTO_ENTRY_PREVIOUS,
|
||||
[TERMO_SYM_DOWN] = USER_ACTION_GOTO_ENTRY_NEXT,
|
||||
[TERMO_SYM_LEFT] = USER_ACTION_GOTO_DICTIONARY_PREVIOUS,
|
||||
[TERMO_SYM_RIGHT] = USER_ACTION_GOTO_DICTIONARY_NEXT,
|
||||
[TERMO_SYM_PAGEUP] = USER_ACTION_GOTO_DICTIONARY_PREVIOUS,
|
||||
[TERMO_SYM_PAGEDOWN] = USER_ACTION_GOTO_DICTIONARY_NEXT,
|
||||
};
|
||||
|
||||
if (!event->modifiers)
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* stardict-private.h: internal StarDict API
|
||||
*
|
||||
* Copyright (c) 2013 - 2015, Přemysl Janouch <p@janouch.name>
|
||||
* Copyright (c) 2013 - 2015, Přemysl Eric Janouch <p@janouch.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* stardict.c: StarDict API
|
||||
*
|
||||
* Copyright (c) 2013 - 2016, Přemysl Janouch <p@janouch.name>
|
||||
* Copyright (c) 2013 - 2016, Přemysl Eric Janouch <p@janouch.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
|
@ -5,7 +5,7 @@
|
||||
* dictionaries, it should however be good enough for most of them that are
|
||||
* freely available on the Internet.
|
||||
*
|
||||
* Copyright (c) 2013 - 2016, Přemysl Janouch <p@janouch.name>
|
||||
* Copyright (c) 2013 - 2016, Přemysl Eric Janouch <p@janouch.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* test-stardict.c: StarDict API test
|
||||
*
|
||||
* Copyright (c) 2013, Přemysl Janouch <p@janouch.name>
|
||||
* Copyright (c) 2013, Přemysl Eric Janouch <p@janouch.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* utils.c: miscellaneous utilities
|
||||
*
|
||||
* Copyright (c) 2013 - 2015, Přemysl Janouch <p@janouch.name>
|
||||
* Copyright (c) 2013 - 2015, Přemysl Eric Janouch <p@janouch.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* utils.h: miscellaneous utilities
|
||||
*
|
||||
* Copyright (c) 2013 - 2015, Přemysl Janouch <p@janouch.name>
|
||||
* Copyright (c) 2013 - 2015, Přemysl Eric Janouch <p@janouch.name>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted.
|
||||
|
Loading…
x
Reference in New Issue
Block a user