Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
12f0b41d
Commit
12f0b41d
authored
May 14, 2005
by
Martin Fuchs
Committed by
Alexandre Julliard
May 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display free and total disk space in status bar.
parent
73eee213
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
1 deletion
+43
-1
De.rc
programs/winefile/De.rc
+2
-0
En.rc
programs/winefile/En.rc
+1
-0
resource.h
programs/winefile/resource.h
+2
-0
winefile.c
programs/winefile/winefile.c
+38
-1
No files found.
programs/winefile/De.rc
View file @
12f0b41d
...
...
@@ -209,4 +209,6 @@ STRINGTABLE
IDS_COL_LINKS "Links"
IDS_COL_ATTR "Attribute"
IDS_COL_SEC "Sicherheit"
IDS_FREE_SPACE_FMT "%s von %s frei"
}
programs/winefile/En.rc
View file @
12f0b41d
...
...
@@ -209,4 +209,5 @@ STRINGTABLE
IDS_COL_LINKS "Links"
IDS_COL_ATTR "Attributes"
IDS_COL_SEC "Security"
IDS_FREE_SPACE_FMT "%s of %s free"
}
programs/winefile/resource.h
View file @
12f0b41d
...
...
@@ -95,6 +95,8 @@
#define IDS_COL_ATTR 1217
#define IDS_COL_SEC 1218
#define IDS_FREE_SPACE_FMT 1219
/* range for drive bar command ids: 0x9000..0x90FF */
#define ID_DRIVE_UNIX_FS 0x9000
#define ID_DRIVE_SHELL_NS 0x9001
...
...
programs/winefile/winefile.c
View file @
12f0b41d
...
...
@@ -2348,6 +2348,40 @@ static int insert_entries(Pane* pane, Entry* dir, int idx)
}
static
void
format_bytes
(
LPTSTR
buffer
,
LONGLONG
bytes
)
{
const
static
TCHAR
sFmtGB
[]
=
{
'%'
,
'.'
,
'1'
,
'f'
,
' '
,
'G'
,
'B'
,
'\0'
};
const
static
TCHAR
sFmtMB
[]
=
{
'%'
,
'.'
,
'1'
,
'f'
,
' '
,
'M'
,
'B'
,
'\0'
};
const
static
TCHAR
sFmtkB
[]
=
{
'%'
,
'.'
,
'1'
,
'f'
,
' '
,
'k'
,
'B'
,
'\0'
};
float
fBytes
=
(
float
)
bytes
;
if
(
bytes
>=
1073741824
)
/* 1 GB */
_stprintf
(
buffer
,
sFmtGB
,
fBytes
/
1073741824
.
f
+
.
5
f
);
else
if
(
bytes
>=
1048576
)
/* 1 MB */
_stprintf
(
buffer
,
sFmtMB
,
fBytes
/
1048576
.
f
+
.
5
f
);
else
if
(
bytes
>=
1024
)
/* 1 kB */
_stprintf
(
buffer
,
sFmtkB
,
fBytes
/
1024
.
f
+
.
5
f
);
else
_stprintf
(
buffer
,
sLongNumFmt
,
bytes
);
}
static
void
set_space_status
()
{
ULARGE_INTEGER
ulFreeBytesToCaller
,
ulTotalBytes
,
ulFreeBytes
;
TCHAR
fmt
[
64
],
b1
[
64
],
b2
[
64
],
buffer
[
BUFFER_LEN
];
if
(
GetDiskFreeSpaceEx
(
NULL
,
&
ulFreeBytesToCaller
,
&
ulTotalBytes
,
&
ulFreeBytes
))
{
format_bytes
(
b1
,
ulFreeBytesToCaller
.
QuadPart
);
format_bytes
(
b2
,
ulTotalBytes
.
QuadPart
);
_stprintf
(
buffer
,
RS
(
fmt
,
IDS_FREE_SPACE_FMT
),
b1
,
b2
);
}
else
_tcscpy
(
buffer
,
sQMarks
);
SendMessage
(
Globals
.
hstatusbar
,
SB_SETTEXT
,
0
,
(
LPARAM
)
buffer
);
}
static
WNDPROC
g_orgTreeWndProc
;
static
void
create_tree_window
(
HWND
parent
,
Pane
*
pane
,
int
id
,
int
id_header
)
...
...
@@ -3202,7 +3236,8 @@ static void set_curdir(ChildWnd* child, Entry* entry, HWND hwnd)
SetWindowText
(
child
->
hwnd
,
path
);
if
(
path
[
0
])
SetCurrentDirectory
(
path
);
if
(
SetCurrentDirectory
(
path
))
set_space_status
();
}
...
...
@@ -3620,6 +3655,8 @@ LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
case
WM_SETFOCUS
:
SetCurrentDirectory
(
child
->
path
);
if
(
SetCurrentDirectory
(
child
->
path
))
set_space_status
();
SetFocus
(
child
->
focus_pane
?
child
->
right
.
hwnd
:
child
->
left
.
hwnd
);
break
;
...
...
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