Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xfce4-dict
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Apps
xfce4-dict
Commits
3322fa4d
Commit
3322fa4d
authored
16 years ago
by
Enrico Tröger
Browse files
Options
Downloads
Patches
Plain Diff
Concatenate text command line arguments as one string as search text.
(Old svn revision: 4579)
parent
3b4d8dd0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
ChangeLog
+1
-0
1 addition, 0 deletions
ChangeLog
Makefile.am
+2
-0
2 additions, 0 deletions
Makefile.am
lib/common.h
+1
-1
1 addition, 1 deletion
lib/common.h
src/xfce4-dict.c
+28
-3
28 additions, 3 deletions
src/xfce4-dict.c
with
32 additions
and
4 deletions
ChangeLog
+
1
−
0
View file @
3322fa4d
...
...
@@ -3,6 +3,7 @@
* Update Readme.
* Reformat ChangeLog.
* Add "-h" command line option if GLib supports printing the help text.
* Concatenate text command line arguments as one string as search text.
2008-04-14 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
...
...
This diff is collapsed.
Click to expand it.
Makefile.am
+
2
−
0
View file @
3322fa4d
...
...
@@ -13,6 +13,7 @@ distclean-local:
EXTRA_DIST
=
\
xfce4-dict.1
\
intltool-extract.in
\
intltool-merge.in
\
intltool-update.in
\
...
...
@@ -28,6 +29,7 @@ hicolor48_DATA = xfce4-dict.svg
gtk_update_icon_cache
=
gtk-update-icon-cache
-f
-t
$(
datadir
)
/icons/hicolor
man_MANS
=
xfce4-dict.1
install-data-hook
:
@
-if
test
-z
"
$(
DESTDIR
)
"
;
then
\
...
...
This diff is collapsed.
Click to expand it.
lib/common.h
+
1
−
1
View file @
3322fa4d
...
...
@@ -27,7 +27,7 @@
((ptr) && (ptr)[0])
#define PLUGIN_WEBSITE "http://goodies.xfce.org/projects/xfce4-dict"
#define PLUGIN_WEBSITE "http://goodies.xfce.org/projects/
applications/
xfce4-dict"
#define DICT_FLAGS_FOCUS_PANEL_ENTRY 1
#define DICT_FLAGS_MODE_DICT 2
...
...
This diff is collapsed.
Click to expand it.
src/xfce4-dict.c
+
28
−
3
View file @
3322fa4d
...
...
@@ -102,11 +102,27 @@ static gchar get_flags()
}
static
gchar
*
get_search_text
(
gint
count
,
gchar
**
values
)
{
GString
*
str
=
g_string_sized_new
(
128
);
gint
i
;
for
(
i
=
1
;
i
<
count
;
i
++
)
{
g_string_append
(
str
,
values
[
i
]);
if
(
i
<
(
count
-
1
))
g_string_append_c
(
str
,
' '
);
}
return
g_string_free
(
str
,
FALSE
);
}
gint
main
(
gint
argc
,
gchar
*
argv
[])
{
DictData
*
dd
;
GOptionContext
*
context
;
gchar
flags
;
gchar
*
search_text
;
#ifdef ENABLE_NLS
xfce_textdomain
(
GETTEXT_PACKAGE
,
PACKAGE_LOCALE_DIR
,
"UTF-8"
);
...
...
@@ -146,9 +162,15 @@ gint main(gint argc, gchar *argv[])
flags
=
get_flags
();
/* concatenate remaining command line arguments */
search_text
=
get_search_text
(
argc
,
argv
);
/* try to find an existing panel plugin and pop it up */
if
(
dict_find_panel_plugin
(
flags
,
(
argc
>
1
)
?
argv
[
1
]
:
NULL
))
if
(
dict_find_panel_plugin
(
flags
,
search_text
))
{
g_free
(
search_text
);
exit
(
0
);
}
/* no plugin found, start stand-alone app */
...
...
@@ -172,8 +194,11 @@ gint main(gint argc, gchar *argv[])
/* search text from command line options, if any */
/* TODO take all remaining args, not only argv[1] */
if
(
argc
>
1
)
dict_search_word
(
dd
,
argv
[
1
]);
if
(
search_text
!=
NULL
)
{
dict_search_word
(
dd
,
search_text
);
g_free
(
search_text
);
}
dict_gui_status_add
(
dd
,
_
(
"Ready."
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment