Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
8127d35d
Commit
8127d35d
authored
Sep 20, 2012
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Distributor, display version info for package (refs #118)
parent
91f9f52f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
201 additions
and
29 deletions
+201
-29
wb/lib/wb/gtk/wb_wpkg_gtk.cpp
wb/lib/wb/gtk/wb_wpkg_gtk.cpp
+3
-3
wb/lib/wb/src/wb_lfu.cpp
wb/lib/wb/src/wb_lfu.cpp
+6
-1
wb/lib/wb/src/wb_wpkgnav.cpp
wb/lib/wb/src/wb_wpkgnav.cpp
+160
-21
wb/lib/wb/src/wb_wpkgnav.h
wb/lib/wb/src/wb_wpkgnav.h
+32
-4
No files found.
wb/lib/wb/gtk/wb_wpkg_gtk.cpp
View file @
8127d35d
...
...
@@ -303,15 +303,15 @@ WPkgGtk::WPkgGtk(
GtkWidget
*
view_zoom_reset
=
gtk_image_menu_item_new_from_stock
(
GTK_STOCK_ZOOM_100
,
NULL
);
g_signal_connect
(
view_zoom_reset
,
"activate"
,
G_CALLBACK
(
WPkgGtk
::
activate_zoom_reset
),
this
);
GtkWidget
*
view_dmode_filediff
=
gtk_menu_item_new_with_mnemonic
(
"_Display File Differences"
);
GtkWidget
*
view_dmode_filediff
=
gtk_
check_
menu_item_new_with_mnemonic
(
"_Display File Differences"
);
g_signal_connect
(
view_dmode_filediff
,
"activate"
,
G_CALLBACK
(
WPkgGtk
::
activate_dmode_filediff
),
this
);
GtkWidget
*
view_dmode_filetime
=
gtk_menu_item_new_with_mnemonic
(
"Display Files In _Time Order"
);
GtkWidget
*
view_dmode_filetime
=
gtk_
check_
menu_item_new_with_mnemonic
(
"Display Files In _Time Order"
);
g_signal_connect
(
view_dmode_filetime
,
"activate"
,
G_CALLBACK
(
WPkgGtk
::
activate_dmode_filetime
),
this
);
GtkWidget
*
view_dmode_filepath
=
gtk_menu_item_new_with_mnemonic
(
"Display File _Path"
);
GtkWidget
*
view_dmode_filepath
=
gtk_
check_
menu_item_new_with_mnemonic
(
"Display File _Path"
);
g_signal_connect
(
view_dmode_filepath
,
"activate"
,
G_CALLBACK
(
WPkgGtk
::
activate_dmode_filepath
),
this
);
...
...
wb/lib/wb/src/wb_lfu.cpp
View file @
8127d35d
...
...
@@ -2755,8 +2755,13 @@ pwr_tStatus lfu_ReadBootFile(
}
if
(
utl_read_line
(
buff
,
sizeof
(
buff
),
file
,
NULL
)
==
0
)
{
// Sev node bootfile
fclose
(
file
);
return
LFU__FILECRP
;
*
volcount
=
0
;
*
plccount
=
0
;
if
(
plclist
)
*
plclist
=
(
pwr_tString80
*
)
0
;
return
LFU__SUCCESS
;
}
if
(
plclist
)
{
...
...
wb/lib/wb/src/wb_wpkgnav.cpp
View file @
8127d35d
...
...
@@ -53,6 +53,7 @@
#include "wb_wnav.h"
#include "wb_wnav_brow.h"
#include "wb_wnav_item.h"
#include "wb_lfu.h"
#include "wb_error.h"
...
...
@@ -575,16 +576,16 @@ int WItemPkgNode::open_children( WNavBrow *brow, double x, double y, int display
while
(
ODD
(
sts
))
{
brow_GetUserData
(
child
,
(
void
**
)
&
item
);
if
(
item
->
time
.
tv_sec
<
time
.
tv_sec
)
{
new
WItemPkgPackage
(
brow
,
file
,
file
,
time
,
child
,
flow_eDest_Before
);
new
WItemPkgPackage
(
brow
,
file
,
file
,
time
,
nodename
,
bus
,
child
,
flow_eDest_Before
);
inserted
=
1
;
break
;
}
sts
=
brow_GetNextSibling
(
brow
->
ctx
,
child
,
&
child
);
}
if
(
!
inserted
)
new
WItemPkgPackage
(
brow
,
file
,
file
,
time
,
node
,
flow_eDest_IntoLast
);
new
WItemPkgPackage
(
brow
,
file
,
file
,
time
,
node
name
,
bus
,
node
,
flow_eDest_IntoLast
);
pkg_cnt
++
;
...
...
@@ -603,13 +604,15 @@ int WItemPkgNode::open_children( WNavBrow *brow, double x, double y, int display
WItemPkgPackage
::
WItemPkgPackage
(
WNavBrow
*
brow
,
char
*
item_name
,
char
*
item_packagename
,
pwr_tTime
item_time
,
brow_tNode
dest
,
flow_eDest
dest_code
)
:
time
(
item_time
)
char
*
item_packagename
,
pwr_tTime
item_time
,
char
*
item_nodename
,
int
item_bus
,
brow_tNode
dest
,
flow_eDest
dest_code
)
:
time
(
item_time
),
bus
(
item_bus
)
{
char
timestr
[
32
];
strcpy
(
packagename
,
item_packagename
);
strcpy
(
nodename
,
item_nodename
);
time_AtoAscii
(
&
time
,
time_eFormat_DateAndTime
,
timestr
,
sizeof
(
timestr
));
brow_CreateNode
(
brow
->
ctx
,
name
,
brow
->
nc_object
,
...
...
@@ -620,6 +623,106 @@ WItemPkgPackage::WItemPkgPackage( WNavBrow *brow, char *item_name,
}
int
WItemPkgPackage
::
open_children
(
WNavBrow
*
brow
,
double
x
,
double
y
,
int
display_mode
)
{
if
(
brow_IsOpen
(
node
))
{
close
(
brow
,
0
,
0
);
return
1
;
}
brow_SetNodraw
(
brow
->
ctx
);
new
WItemPkgInfoHier
(
brow
,
"Info"
,
packagename
,
nodename
,
bus
,
node
,
flow_eDest_IntoLast
);
new
WItemPkgFileHier
(
brow
,
"Files"
,
packagename
,
node
,
flow_eDest_IntoLast
);
brow_ResetNodraw
(
brow
->
ctx
);
brow_Redraw
(
brow
->
ctx
,
0
);
brow_SetOpen
(
node
,
wnav_mOpen_Children
);
return
1
;
}
WItemPkgInfoHier
::
WItemPkgInfoHier
(
WNavBrow
*
brow
,
const
char
*
item_name
,
char
*
item_packagename
,
char
*
item_nodename
,
int
item_bus
,
brow_tNode
dest
,
flow_eDest
dest_code
)
:
bus
(
item_bus
)
{
strcpy
(
packagename
,
item_packagename
);
strcpy
(
nodename
,
item_nodename
);
brow_CreateNode
(
brow
->
ctx
,
name
,
brow
->
nc_object
,
dest
,
dest_code
,
(
void
*
)
this
,
1
,
&
node
);
brow_SetAnnotPixmap
(
node
,
0
,
brow
->
pixmap_map
);
brow_SetAnnotation
(
node
,
0
,
item_name
,
strlen
(
item_name
));
}
int
WItemPkgInfoHier
::
open_children
(
WNavBrow
*
brow
,
double
x
,
double
y
,
int
display_mode
)
{
pwr_tFileName
bootfile
;
pwr_tFileName
bfile
;
pwr_tTime
date
;
pwr_tString80
systemname
;
pwr_tString80
systemgroup
;
pwr_tVolumeId
*
vollist
;
pwr_tString40
*
volnamelist
;
int
volcount
;
pwr_tString80
*
plclist
;
int
plccount
;
char
version
[
40
];
pwr_tCmd
cmd
;
pwr_tStatus
sts
;
if
(
brow_IsOpen
(
node
))
{
close
(
brow
,
0
,
0
);
return
1
;
}
sprintf
(
bootfile
,
load_cNameBoot
,
"pkg_build/"
,
nodename
,
bus
);
sprintf
(
cmd
,
"cd $pwrp_tmp; tar -xzf $pwrp_load/%s %s"
,
packagename
,
bootfile
);
system
(
cmd
);
strcpy
(
bfile
,
"$pwrp_tmp/"
);
strcat
(
bfile
,
bootfile
);
sts
=
lfu_ReadBootFile
(
bfile
,
&
date
,
systemname
,
systemgroup
,
&
vollist
,
&
volnamelist
,
&
volcount
,
&
plclist
,
&
plccount
);
if
(
EVEN
(
sts
))
return
sts
;
sts
=
time_AtoAscii
(
&
date
,
time_eFormat_DateAndTime
,
version
,
sizeof
(
version
));
brow_SetNodraw
(
brow
->
ctx
);
new
WItemPkgInfo
(
brow
,
"NodeName"
,
nodename
,
node
,
flow_eDest_IntoLast
);
if
(
volcount
>
0
)
new
WItemPkgInfo
(
brow
,
"RootVolume"
,
volnamelist
[
0
],
node
,
flow_eDest_IntoLast
);
new
WItemPkgInfo
(
brow
,
"Version"
,
version
,
node
,
flow_eDest_IntoLast
);
brow_ResetNodraw
(
brow
->
ctx
);
brow_Redraw
(
brow
->
ctx
,
0
);
brow_SetOpen
(
node
,
wnav_mOpen_Children
);
return
1
;
}
WItemPkgInfo
::
WItemPkgInfo
(
WNavBrow
*
brow
,
const
char
*
item_name
,
char
*
item_value
,
brow_tNode
dest
,
flow_eDest
dest_code
)
{
strcpy
(
name
,
item_name
);
strcpy
(
value
,
item_value
);
brow_CreateNode
(
brow
->
ctx
,
name
,
brow
->
nc_object
,
dest
,
dest_code
,
(
void
*
)
this
,
1
,
&
node
);
brow_SetAnnotPixmap
(
node
,
0
,
brow
->
pixmap_leaf
);
brow_SetAnnotation
(
node
,
0
,
item_name
,
strlen
(
item_name
));
brow_SetAnnotation
(
node
,
1
,
item_value
,
strlen
(
item_value
));
}
WItemPkgFileHier
::
WItemPkgFileHier
(
WNavBrow
*
brow
,
const
char
*
item_name
,
char
*
item_packagename
,
brow_tNode
dest
,
flow_eDest
dest_code
)
{
strcpy
(
packagename
,
item_packagename
);
brow_CreateNode
(
brow
->
ctx
,
name
,
brow
->
nc_object
,
dest
,
dest_code
,
(
void
*
)
this
,
1
,
&
node
);
brow_SetAnnotPixmap
(
node
,
0
,
brow
->
pixmap_map
);
brow_SetAnnotation
(
node
,
0
,
item_name
,
strlen
(
item_name
));
}
int
WItemPkgFileHier
::
open_children
(
WNavBrow
*
brow
,
double
x
,
double
y
,
int
display_mode
)
{
char
cmd
[
200
];
char
tmpfile
[
200
];
...
...
@@ -630,12 +733,14 @@ int WItemPkgPackage::open_children( WNavBrow *brow, double x, double y, int disp
pwr_tTime
time
;
int
file_cnt
=
0
;
WItemPkgFile
*
item
;
WItemPkgPackage
*
next_item
=
0
;
WItemPkgFileHier
*
next_files_item
=
0
;
WItemPkgPackage
*
next_pkg_item
=
0
;
int
inserted
=
0
;
brow_tObject
child
;
int
sts
;
brow_tObject
next
;
int
next_was_open
=
0
;
brow_tObject
next_pkg
,
next_files
,
parent
;
int
next_pkg_was_open
=
0
;
int
next_files_was_open
=
0
;
if
(
brow_IsOpen
(
node
))
{
close
(
brow
,
0
,
0
);
...
...
@@ -653,14 +758,38 @@ int WItemPkgPackage::open_children( WNavBrow *brow, double x, double y, int disp
if
(
display_mode
&
wpkg_mDisplayMode_FileDiff
)
{
// Display only file with newer date compared to previous package
sts
=
brow_GetNextSibling
(
brow
->
ctx
,
node
,
&
next
);
sts
=
brow_GetParent
(
brow
->
ctx
,
node
,
&
parent
);
if
(
ODD
(
sts
))
sts
=
brow_GetNextSibling
(
brow
->
ctx
,
parent
,
&
next_pkg
);
if
(
ODD
(
sts
))
{
brow_GetUserData
(
next
,
(
void
**
)
&
next_item
);
if
(
brow_IsOpen
(
next
))
{
next_item
->
close
(
brow
,
0
,
0
);
next_was_open
=
1
;
brow_GetUserData
(
next_pkg
,
(
void
**
)
&
next_pkg_item
);
if
(
brow_IsOpen
(
next_pkg
))
{
sts
=
brow_GetChild
(
brow
->
ctx
,
next_pkg
,
&
next_files
);
if
(
ODD
(
sts
))
sts
=
brow_GetNextSibling
(
brow
->
ctx
,
next_files
,
&
next_files
);
if
(
ODD
(
sts
))
{
brow_GetUserData
(
next_files
,
(
void
**
)
&
next_files_item
);
if
(
brow_IsOpen
(
next_files
))
next_files_was_open
=
1
;
}
next_pkg_item
->
close
(
brow
,
0
,
0
);
next_pkg_was_open
=
1
;
}
next_pkg_item
->
open_children
(
brow
,
0
,
0
,
wpkg_mDisplayMode__
);
sts
=
brow_GetChild
(
brow
->
ctx
,
next_pkg
,
&
next_files
);
if
(
ODD
(
sts
))
sts
=
brow_GetNextSibling
(
brow
->
ctx
,
next_files
,
&
next_files
);
if
(
ODD
(
sts
))
{
brow_GetUserData
(
next_files
,
(
void
**
)
&
next_files_item
);
if
(
brow_IsOpen
(
next_files
))
{
next_files_item
->
close
(
brow
,
0
,
0
);
}
next_files_item
->
open_children
(
brow
,
0
,
0
,
wpkg_mDisplayMode__
);
}
next_item
->
open_children
(
brow
,
0
,
0
,
wpkg_mDisplayMode__
);
else
// No next sibling, display all files
display_mode
&=
~
wpkg_mDisplayMode_FileDiff
;
}
else
// No next sibling, display all files
...
...
@@ -684,7 +813,7 @@ int WItemPkgPackage::open_children( WNavBrow *brow, double x, double y, int disp
if
(
display_mode
&
wpkg_mDisplayMode_FileDiff
)
{
// Check if this file is changed
int
keep
=
1
;
sts
=
brow_GetChild
(
brow
->
ctx
,
next
,
&
child
);
sts
=
brow_GetChild
(
brow
->
ctx
,
next
_files
,
&
child
);
while
(
ODD
(
sts
))
{
brow_GetUserData
(
child
,
(
void
**
)
&
item
);
if
(
strcmp
(
item
->
filename
,
line_item
[
2
])
==
0
)
{
...
...
@@ -726,10 +855,20 @@ int WItemPkgPackage::open_children( WNavBrow *brow, double x, double y, int disp
is
.
close
();
if
(
display_mode
&
wpkg_mDisplayMode_FileDiff
&&
next_item
)
{
next_item
->
close
(
brow
,
0
,
0
);
if
(
next_was_open
)
next_item
->
open_children
(
brow
,
0
,
0
,
display_mode
);
if
(
display_mode
&
wpkg_mDisplayMode_FileDiff
&&
next_pkg_item
)
{
next_pkg_item
->
close
(
brow
,
0
,
0
);
if
(
next_pkg_was_open
)
{
next_pkg_item
->
open_children
(
brow
,
0
,
0
,
display_mode
);
if
(
next_files_was_open
)
{
sts
=
brow_GetChild
(
brow
->
ctx
,
next_pkg
,
&
next_files
);
if
(
ODD
(
sts
))
sts
=
brow_GetNextSibling
(
brow
->
ctx
,
next_files
,
&
next_files
);
if
(
ODD
(
sts
))
{
brow_GetUserData
(
next_files
,
(
void
**
)
&
next_files_item
);
next_files_item
->
open_children
(
brow
,
0
,
0
,
display_mode
);
}
}
}
}
if
(
file_cnt
)
{
...
...
wb/lib/wb/src/wb_wpkgnav.h
View file @
8127d35d
...
...
@@ -136,11 +136,41 @@ class WItemPkgNode : public WItemPkg {
class
WItemPkgPackage
:
public
WItemPkg
{
public:
WItemPkgPackage
(
WNavBrow
*
brow
,
char
*
item_name
,
char
*
item_packagename
,
pwr_tTime
item_time
,
brow_tNode
dest
,
flow_eDest
dest_code
);
WItemPkgPackage
(
WNavBrow
*
brow
,
char
*
item_name
,
char
*
item_packagename
,
pwr_tTime
item_time
,
char
*
item_nodename
,
int
item_bus
,
brow_tNode
dest
,
flow_eDest
dest_code
);
int
open_children
(
WNavBrow
*
brow
,
double
x
,
double
y
,
int
display_mode
);
char
packagename
[
120
];
pwr_tTime
time
;
char
nodename
[
32
];
int
bus
;
};
class
WItemPkgFileHier
:
public
WItemPkg
{
public:
WItemPkgFileHier
(
WNavBrow
*
brow
,
const
char
*
item_name
,
char
*
item_packagename
,
brow_tNode
dest
,
flow_eDest
dest_code
);
int
open_children
(
WNavBrow
*
brow
,
double
x
,
double
y
,
int
display_mode
);
char
packagename
[
120
];
};
class
WItemPkgInfoHier
:
public
WItemPkg
{
public:
WItemPkgInfoHier
(
WNavBrow
*
brow
,
const
char
*
item_name
,
char
*
item_packagename
,
char
*
item_nodename
,
int
item_bus
,
brow_tNode
dest
,
flow_eDest
dest_code
);
int
open_children
(
WNavBrow
*
brow
,
double
x
,
double
y
,
int
display_mode
);
char
packagename
[
120
];
char
nodename
[
120
];
int
bus
;
};
class
WItemPkgInfo
:
public
WItemPkg
{
public:
WItemPkgInfo
(
WNavBrow
*
brow
,
const
char
*
item_name
,
char
*
item_value
,
brow_tNode
dest
,
flow_eDest
dest_code
);
char
name
[
120
];
char
value
[
120
];
};
class
WItemPkgFile
:
public
WItemPkg
{
...
...
@@ -154,5 +184,3 @@ class WItemPkgFile : public WItemPkg {
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment