mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-05 09:00:54 +00:00
home directory
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@412 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <pwd.h>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ static void okay(MwWidget handle, void* user, void* call) {
|
|||||||
destroy(handle->parent);
|
destroy(handle->parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void msgbox_okay(MwWidget handle, void* user, void* call){
|
static void msgbox_okay(MwWidget handle, void* user, void* call) {
|
||||||
(void)user;
|
(void)user;
|
||||||
(void)call;
|
(void)call;
|
||||||
|
|
||||||
@@ -93,6 +93,22 @@ static void files_activate(MwWidget handle, void* user, void* call) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void nav_activate(MwWidget handle, void* user, void* call) {
|
||||||
|
int index = *(int*)call;
|
||||||
|
const char* e = MwListBoxGet(handle, index);
|
||||||
|
|
||||||
|
(void)user;
|
||||||
|
|
||||||
|
if(strcmp(e, "Home") == 0) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
#else
|
||||||
|
struct passwd* p = getpwuid(getuid());
|
||||||
|
|
||||||
|
scan(handle->parent, p->pw_dir);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void addr_up_activate(MwWidget handle, void* user, void* call) {
|
static void addr_up_activate(MwWidget handle, void* user, void* call) {
|
||||||
filechooser_t* fc = handle->parent->opaque;
|
filechooser_t* fc = handle->parent->opaque;
|
||||||
char* p = MwDirectoryJoin(fc->path, "..");
|
char* p = MwDirectoryJoin(fc->path, "..");
|
||||||
@@ -127,6 +143,7 @@ static void layout(MwWidget handle) {
|
|||||||
MwNleftPadding, 16,
|
MwNleftPadding, 16,
|
||||||
NULL);
|
NULL);
|
||||||
MwListBoxInsert(fc->nav, -1, fc->computer, "Home", NULL);
|
MwListBoxInsert(fc->nav, -1, fc->computer, "Home", NULL);
|
||||||
|
MwAddUserHandler(fc->nav, MwNactivateHandler, nav_activate, NULL);
|
||||||
} else {
|
} else {
|
||||||
MwVaApply(fc->nav,
|
MwVaApply(fc->nav,
|
||||||
MwNx, wx,
|
MwNx, wx,
|
||||||
|
|||||||
Reference in New Issue
Block a user