mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
Made the floppy path in the file panel be configurable via the FloppyPath
key in the WMGLOBAL file, instead of the '/floppy' hardcoded value.
This commit is contained in:
@@ -389,6 +389,7 @@ typedef struct _WINGsConfiguration {
|
|||||||
char *boldSystemFont;
|
char *boldSystemFont;
|
||||||
int defaultFontSize;
|
int defaultFontSize;
|
||||||
Bool useMultiByte;
|
Bool useMultiByte;
|
||||||
|
char *floppyPath;
|
||||||
unsigned doubleClickDelay;
|
unsigned doubleClickDelay;
|
||||||
unsigned mouseWheelUp;
|
unsigned mouseWheelUp;
|
||||||
unsigned mouseWheelDown;
|
unsigned mouseWheelDown;
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ _WINGsConfiguration WINGsConfiguration;
|
|||||||
|
|
||||||
#define BOLD_SYSTEM_FONT "-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-bold-r-*-*-%d-*-*-*-*-*-*-*"
|
#define BOLD_SYSTEM_FONT "-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-bold-r-*-*-%d-*-*-*-*-*-*-*"
|
||||||
|
|
||||||
|
#define FLOPPY_PATH "/floppy"
|
||||||
|
|
||||||
|
|
||||||
static unsigned
|
static unsigned
|
||||||
getButtonWithName(const char *name, unsigned defaultButton)
|
getButtonWithName(const char *name, unsigned defaultButton)
|
||||||
@@ -63,6 +65,9 @@ W_ReadConfigurations(void)
|
|||||||
WINGsConfiguration.doubleClickDelay =
|
WINGsConfiguration.doubleClickDelay =
|
||||||
WMGetUDIntegerForKey(defaults, "DoubleClickTime");
|
WMGetUDIntegerForKey(defaults, "DoubleClickTime");
|
||||||
|
|
||||||
|
WINGsConfiguration.floppyPath =
|
||||||
|
WMGetUDStringForKey(defaults, "FloppyPath");
|
||||||
|
|
||||||
buttonName = WMGetUDStringForKey(defaults, "MouseWheelUp");
|
buttonName = WMGetUDStringForKey(defaults, "MouseWheelUp");
|
||||||
if (buttonName) {
|
if (buttonName) {
|
||||||
button = getButtonWithName(buttonName, Button4);
|
button = getButtonWithName(buttonName, Button4);
|
||||||
@@ -97,6 +102,9 @@ W_ReadConfigurations(void)
|
|||||||
if (!WINGsConfiguration.boldSystemFont) {
|
if (!WINGsConfiguration.boldSystemFont) {
|
||||||
WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT;
|
WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT;
|
||||||
}
|
}
|
||||||
|
if (!WINGsConfiguration.floppyPath) {
|
||||||
|
WINGsConfiguration.floppyPath = FLOPPY_PATH;
|
||||||
|
}
|
||||||
if (WINGsConfiguration.doubleClickDelay == 0) {
|
if (WINGsConfiguration.doubleClickDelay == 0) {
|
||||||
WINGsConfiguration.doubleClickDelay = 250;
|
WINGsConfiguration.doubleClickDelay = 250;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,6 @@
|
|||||||
#define PATH_MAX 1024
|
#define PATH_MAX 1024
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FLOPPY_PATH
|
|
||||||
#define FLOPPY_PATH "/floppy"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct W_FilePanel {
|
typedef struct W_FilePanel {
|
||||||
WMWindow *win;
|
WMWindow *win;
|
||||||
@@ -846,20 +843,20 @@ goUnmount(WMButton *bPtr, WMFilePanel *panel)
|
|||||||
static void
|
static void
|
||||||
goFloppy(WMButton *bPtr, WMFilePanel *panel)
|
goFloppy(WMButton *bPtr, WMFilePanel *panel)
|
||||||
{
|
{
|
||||||
char *file;
|
|
||||||
struct stat filestat;
|
struct stat filestat;
|
||||||
WMScreen *scr = WMWidgetScreen(panel->win);
|
WMScreen *scr = WMWidgetScreen(panel->win);
|
||||||
|
|
||||||
file = FLOPPY_PATH;
|
if (stat(WINGsConfiguration.floppyPath, &filestat)) {
|
||||||
if (stat(FLOPPY_PATH,&filestat)) {
|
showError(scr, panel->win, "An error occured browsing '%s'.",
|
||||||
showError(scr, panel->win, "An error occured browsing '%s'.", file);
|
WINGsConfiguration.floppyPath);
|
||||||
return;
|
return;
|
||||||
} else if (!S_ISDIR(filestat.st_mode)) {
|
} else if (!S_ISDIR(filestat.st_mode)) {
|
||||||
showError(scr, panel->win, "'%s' is not a directory.", file);
|
showError(scr, panel->win, "'%s' is not a directory.",
|
||||||
|
WINGsConfiguration.floppyPath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WMSetFilePanelDirectory(panel, FLOPPY_PATH);
|
WMSetFilePanelDirectory(panel, WINGsConfiguration.floppyPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
SystemFont = "-*-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
SystemFont = "-*-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*";
|
||||||
BoldSystemFont = "-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*";
|
BoldSystemFont = "-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*";
|
||||||
|
FloppyPath = "/floppy";
|
||||||
MultiByteText = NO;
|
MultiByteText = NO;
|
||||||
DoubleClickTime = 250;
|
DoubleClickTime = 250;
|
||||||
MouseWheelUp = Button4;
|
MouseWheelUp = Button4;
|
||||||
|
|||||||
Reference in New Issue
Block a user