Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ensembl-gh-mirror
zmap
Commits
be213d6f
Commit
be213d6f
authored
19 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
add configuration file entries to optionally hide the main window and show a default sequence.
parent
f43b3bab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/zmapApp/zmapApp_P.h
+7
-2
7 additions, 2 deletions
src/zmapApp/zmapApp_P.h
src/zmapApp/zmapAppwindow.c
+85
-27
85 additions, 27 deletions
src/zmapApp/zmapAppwindow.c
with
92 additions
and
29 deletions
src/zmapApp/zmapApp_P.h
+
7
−
2
View file @
be213d6f
...
...
@@ -25,9 +25,9 @@
* Description:
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited:
May
2
7
1
1:16
200
5
(
rds
)
* Last edited:
Feb
2
2
1
5:23
200
6
(
edgrif
)
* Created: Thu Jul 24 14:35:41 2003 (edgrif)
* CVS info: $Id: zmapApp_P.h,v 1.1
1
200
5-06-01 13:11:18 rds
Exp $
* CVS info: $Id: zmapApp_P.h,v 1.1
2
200
6-02-22 15:57:05 edgrif
Exp $
*-------------------------------------------------------------------
*/
#ifndef ZMAP_APP_PRIV_H
...
...
@@ -66,6 +66,11 @@ typedef struct _ZMapAppContextStruct
zMapXRemoteNotifyData
propertyNotifyData
;
gboolean
show_mainwindow
;
/* Should main window be displayed. */
char
*
default_sequence
;
/* Was a default sequence specified in
the config. file.*/
}
ZMapAppContextStruct
,
*
ZMapAppContext
;
...
...
This diff is collapsed.
Click to expand it.
src/zmapApp/zmapAppwindow.c
+
85
−
27
View file @
be213d6f
...
...
@@ -26,9 +26,9 @@
* Description:
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited: Feb
17 09:52
2006 (edgrif)
* Last edited: Feb
22 15:48
2006 (edgrif)
* Created: Thu Jul 24 14:36:27 2003 (edgrif)
* CVS info: $Id: zmapAppwindow.c,v 1.2
3
2006-02-
17 10:44:32
edgrif Exp $
* CVS info: $Id: zmapAppwindow.c,v 1.2
4
2006-02-
22 15:57:05
edgrif Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -41,6 +41,7 @@
#include
<ZMap/zmapUtils.h>
#include
<ZMap/zmapCmdLineArgs.h>
#include
<ZMap/zmapConfigDir.h>
#include
<ZMap/zmapConfig.h>
#include
<ZMap/zmapControl.h>
#include
<zmapApp_P.h>
...
...
@@ -59,7 +60,7 @@ static gboolean removeZmapRowForeachFunc(GtkTreeModel *model, GtkTreePath *path,
void
exitCB
(
void
*
app_data
,
void
*
zmap_data_unused
)
;
static
void
appExit
(
ZMapAppContext
app_context
)
;
static
gboolean
getConfiguration
(
ZMapAppContext
app_context
)
;
ZMapManagerCallbacksStruct
app_window_cbs_G
=
{
removeZmapRow
,
infoSetCB
,
exitCB
}
;
...
...
@@ -68,27 +69,29 @@ int test_global = 10 ;
int
test_overlap
=
0
;
#define ZMAP_APP_CONFIG "ZMap"
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
/* Place a copyright notice in the executable. */
char
*
obj_copyright_G
=
ZMAP_OBJ_COPYRIGHT_STRING
(
ZMAP_TITLE
,
ZMAP_VERSION
,
ZMAP_RELEASE
,
ZMAP_UPDATE
,
ZMAP_DESCRIPTION
)
;
#endif
/* ED_G_NEVER_INCLUDE_THIS_CODE */
int
zmapMainMakeAppWindow
(
int
argc
,
char
*
argv
[])
{
ZMapAppContext
app_context
;
GtkWidget
*
toplevel
,
*
vbox
,
*
menubar
,
*
connect_frame
,
*
manage_frame
;
GtkWidget
*
quit_button
;
char
*
sequence
;
int
start
,
end
;
/* this all needs revving up sometime.... */
if
(
argc
>
1
)
test_global
=
atoi
(
argv
[
1
])
;
if
(
argc
>
2
)
test_overlap
=
1
;
/*
* Application initialisation.
*/
/* Application initialisation. */
/* Since thread support is crucial we do compile and run time checks that its all intialised.
* the function calls look obscure but its what's recommended in the glib docs. */
...
...
@@ -110,7 +113,6 @@ int zmapMainMakeAppWindow(int argc, char *argv[])
checkForCmdLineVersionArg
(
argc
,
argv
)
;
/* Set up configuration directory/files, this function exits if the directory/files can't be
* accessed. */
checkConfigDir
()
;
...
...
@@ -127,11 +129,10 @@ int zmapMainMakeAppWindow(int argc, char *argv[])
app_context
->
logger
=
zMapLogCreate
(
NULL
)
;
getConfiguration
(
app_context
)
;
/*
* GTK initialisation
*/
/* GTK initialisation */
initGnomeGTK
(
argc
,
argv
)
;
/* May exit if checks fail. */
...
...
@@ -162,28 +163,33 @@ int zmapMainMakeAppWindow(int argc, char *argv[])
GTK_SIGNAL_FUNC
(
quitCB
),
(
gpointer
)
app_context
)
;
gtk_box_pack_start
(
GTK_BOX
(
vbox
),
quit_button
,
FALSE
,
FALSE
,
0
)
;
/* Always create the widget. */
gtk_widget_show_all
(
toplevel
)
;
/* We don't always want to show this window, for lace users it is useless.... */
if
(
!
(
app_context
->
show_mainwindow
))
gtk_widget_unmap
(
toplevel
)
;
/* Did user specify a sequence on the command line. */
sequence
=
NULL
;
/* If user specifyed a sequence in the config. file or on the command line then
* display it straight away. */
sequence
=
app_context
->
default_sequence
;
start
=
1
;
end
=
0
;
checkForCmdLineSequenceArgs
(
argc
,
argv
,
&
sequence
,
&
start
,
&
end
)
;
/* May exit if bad cmdline args. */
if
(
!
sequence
)
checkForCmdLineSequenceArgs
(
argc
,
argv
,
&
sequence
,
&
start
,
&
end
)
;
/* May exit if bad cmdline args. */
if
(
sequence
)
{
zmapAppCreateZMap
(
app_context
,
sequence
,
start
,
end
)
;
}
/*
* Start the GUI.
*/
/* Start the GUI. */
gtk_main
()
;
zMapExit
(
EXIT_SUCCESS
)
;
/* exits.... */
...
...
@@ -438,3 +444,55 @@ static void appExit(ZMapAppContext app_context)
return
;
}
/* Read ZMap application defaults. */
static
gboolean
getConfiguration
(
ZMapAppContext
app_context
)
{
gboolean
result
=
FALSE
;
ZMapConfig
config
;
ZMapConfigStanzaSet
zmap_list
=
NULL
;
ZMapConfigStanza
zmap_stanza
;
char
*
zmap_stanza_name
=
ZMAP_APP_CONFIG
;
ZMapConfigStanzaElementStruct
zmap_elements
[]
=
{{
"show_mainwindow"
,
ZMAPCONFIG_BOOL
,
{
NULL
}},
{
"default_sequence"
,
ZMAPCONFIG_STRING
,
{
NULL
}},
{
NULL
,
-
1
,
{
NULL
}}}
;
zMapConfigGetStructBool
(
zmap_elements
,
"show_mainwindow"
)
=
TRUE
;
/* By default show main window. */
if
((
config
=
zMapConfigCreate
()))
{
zmap_stanza
=
zMapConfigMakeStanza
(
zmap_stanza_name
,
zmap_elements
)
;
if
(
zMapConfigFindStanzas
(
config
,
zmap_stanza
,
&
zmap_list
))
{
ZMapConfigStanza
next_zmap
;
/* Get the first zmap stanza found, we will ignore any others. */
next_zmap
=
zMapConfigGetNextStanza
(
zmap_list
,
NULL
)
;
app_context
->
show_mainwindow
=
zMapConfigGetElementBool
(
next_zmap
,
"show_mainwindow"
)
;
if
((
app_context
->
default_sequence
=
zMapConfigGetElementString
(
next_zmap
,
"default_sequence"
)))
app_context
->
default_sequence
=
g_strdup_printf
(
app_context
->
default_sequence
)
;
zMapConfigDeleteStanzaSet
(
zmap_list
)
;
/* Not needed anymore. */
}
zMapConfigDestroyStanza
(
zmap_stanza
)
;
zMapConfigDestroy
(
config
)
;
result
=
TRUE
;
}
return
result
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
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