Skip to content

Commit

Permalink
v0.10.2-dev to master (#173)
Browse files Browse the repository at this point in the history
* Corrected documentation

* Added missing bracket

* Started work on fixing resize terminal issues

* SF resizing from show works

* Added missing view mode

* Testing fix for settings resize

* SF resizing work

* Updated copyright year to 2024

* Updated docs

* Stop reverting settings when opening config menu

* Removed unneeded extern

* Bump version

* Removed some old commented code
  • Loading branch information
roberthawdon authored Mar 14, 2024
1 parent eb93ae6 commit 0dfdfae
Show file tree
Hide file tree
Showing 19 changed files with 149 additions and 88 deletions.
6 changes: 0 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,6 @@ Build DF-SHOW with
make
Complie translations

.. code-block:: bash
make update-po
Install DF-SHOW

.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([dfshow],[0.10.1],[https://github.com/roberthawdon/dfshow/issues])
AC_INIT([dfshow],[0.10.2],[https://github.com/roberthawdon/dfshow/issues])
AM_INIT_AUTOMAKE([subdir-objects])
AC_PROG_CC
AC_CONFIG_HEADERS([config.h:config.hin])
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
# -- Project information -----------------------------------------------------

project = 'Directory File Show (DF-SHOW)'
copyright = '2023, Robert Ian Hawdon'
copyright = '2024, Robert Ian Hawdon'
author = 'Robert Ian Hawdon'

# The short X.Y version
version = '0.10'
# The full version, including alpha/beta/rc tags
release = '0.10.1-beta'
release = '0.10.2-beta'


# -- General configuration ---------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ Ensure you have the following dependencies installed:
* A C compiler (``gcc`` or ``clang``)
* ``ncurses`` development packages
* ``libconfig`` development packages
* ``libacl`` development packages
* ``selinux`` development packages (optional, for use with ``--with-selinux``)
* ``gettext`` for internationalization

Download the project and prepare sources.

Expand Down
6 changes: 3 additions & 3 deletions docs/source/show.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ The following options are shared with ``ls``:
Displays the file sizes in a human readable format. For example,
1024 Bytes will be represented as 1M.

``-i``, ``--inode``
Prints the index number of each file

``--si``
As above, but uses powers of 1000. (1000 = 1m)

``-i``, ``--inode``
Prints the index number of each file

``-n``, ``-numeric-uid-gid``
Show numeric values for user and group IDs.

Expand Down
4 changes: 2 additions & 2 deletions man/sf.1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "SF" "1" "Jun 01, 2023" "0.10" "Directory File Show (DF-SHOW)"
.TH "SF" "1" "Mar 10, 2024" "0.10" "Directory File Show (DF-SHOW)"
.SH NAME
sf \- An interactive file viewer written for Unix-like systems.
.SH OVERVIEW
Expand Down Expand Up @@ -191,6 +191,6 @@ Saves settings for future sessions.
.SH AUTHOR
Robert Ian Hawdon
.SH COPYRIGHT
2023, Robert Ian Hawdon
2024, Robert Ian Hawdon
.\" Generated by docutils manpage writer.
.
10 changes: 5 additions & 5 deletions man/show.1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "SHOW" "1" "Jun 01, 2023" "0.10" "Directory File Show (DF-SHOW)"
.TH "SHOW" "1" "Mar 10, 2024" "0.10" "Directory File Show (DF-SHOW)"
.SH NAME
show \- An interactive directory/file browser written for Unix-like systems.
.SH OVERVIEW
Expand Down Expand Up @@ -87,12 +87,12 @@ Omits the group of each object in the output.
Displays the file sizes in a human readable format. For example,
1024 Bytes will be represented as 1M.
.TP
.B \fB\-i\fP, \fB\-\-inode\fP
Prints the index number of each file
.TP
.B \fB\-\-si\fP
As above, but uses powers of 1000. (1000 = 1m)
.TP
.B \fB\-i\fP, \fB\-\-inode\fP
Prints the index number of each file
.TP
.B \fB\-n\fP, \fB\-numeric\-uid\-gid\fP
Show numeric values for user and group IDs.
.TP
Expand Down Expand Up @@ -874,6 +874,6 @@ theme needs to be saved before this command can be used.
.SH AUTHOR
Robert Ian Hawdon
.SH COPYRIGHT
2023, Robert Ian Hawdon
2024, Robert Ian Hawdon
.\" Generated by docutils manpage writer.
.
5 changes: 4 additions & 1 deletion src/colors.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
DF-SHOW: An interactive directory/file browser written for Unix-like systems.
Based on the applications from the PC-DOS DF-EDIT suite by Larry Kroeker.
Copyright (C) 2018-2023 Robert Ian Hawdon
Copyright (C) 2018-2024 Robert Ian Hawdon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -61,6 +61,8 @@ extern int * pc;
extern char globalConfLocation[128];
extern char homeConfLocation[128];

extern int viewMode;

menuDef *colorMenu;
int colorMenuSize = 0;
wchar_t *colorMenuLabel;
Expand Down Expand Up @@ -771,6 +773,7 @@ void setCursorPos(int prev)

void themeBuilder()
{
viewMode = 2;
clear();
if (bgToggle){
snprintf(fgbgLabel, 11, _("background"));
Expand Down
24 changes: 21 additions & 3 deletions src/common.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
DF-SHOW: An interactive directory/file browser written for Unix-like systems.
Based on the applications from the PC-DOS DF-EDIT suite by Larry Kroeker.
Copyright (C) 2018-2023 Robert Ian Hawdon
Copyright (C) 2018-2024 Robert Ian Hawdon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -68,15 +68,31 @@ int displaysize;

char fileName[4096];

int viewMode = 0;

char *programName;

extern int * pc;

extern int resized;

extern bool topMenu;
extern bool bottomMenu;
extern wchar_t *topMenuBuffer;
extern wchar_t *bottomMenuBuffer;

void refreshScreenShow();
void refreshScreenSf();

void refreshScreen(char *application)
{
endwin();
clear();
cbreak();
noecho();
curs_set(FALSE);
keypad(stdscr, TRUE);
refresh();
#ifdef APPLICATION_SHOW
if (!strcmp(application, "show")) {
refreshScreenShow();
Expand All @@ -98,7 +114,9 @@ int getch10th (void) {
do {
if (resized) {
resized = 0;
refreshScreen("show");
refreshScreen(programName);
ch = -1;
break;
}
halfdelay (1);
ch = getch();
Expand Down Expand Up @@ -329,7 +347,7 @@ char * objectFromPath(const char *myStr){
void printVersion(char* programName){
printf (("Directory File Show (DF-SHOW) - %s %s\n"), programName, VERSION);
fputs (("\
Copyright (C) 2023 Robert Ian Hawdon\n\
Copyright (C) 2024 Robert Ian Hawdon\n\
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.\n\
This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you\n\
are welcome to redistribute it under certain conditions.\n"), stdout);
Expand Down
2 changes: 1 addition & 1 deletion src/display.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
DF-SHOW: An interactive directory/file browser written for Unix-like systems.
Based on the applications from the PC-DOS DF-EDIT suite by Larry Kroeker.
Copyright (C) 2018-2023 Robert Ian Hawdon
Copyright (C) 2018-2024 Robert Ian Hawdon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/input.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
DF-SHOW: An interactive directory/file browser written for Unix-like systems.
Based on the applications from the PC-DOS DF-EDIT suite by Larry Kroeker.
Copyright (C) 2018-2023 Robert Ian Hawdon
Copyright (C) 2018-2024 Robert Ian Hawdon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
14 changes: 13 additions & 1 deletion src/menu.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
DF-SHOW: An interactive directory/file browser written for Unix-like systems.
Based on the applications from the PC-DOS DF-EDIT suite by Larry Kroeker.
Copyright (C) 2018-2023 Robert Ian Hawdon
Copyright (C) 2018-2024 Robert Ian Hawdon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -29,6 +29,11 @@
#include "menu.h"
#include "banned.h"

bool topMenu = true;
bool bottomMenu = true;
wchar_t *topMenuBuffer;
wchar_t *bottomMenuBuffer;

int dynamicMenuLabel(wchar_t **label, const char *str)
{
int length = 0;
Expand Down Expand Up @@ -220,6 +225,13 @@ int wPrintMenu(int line, int col, wchar_t *menustring)
move(line, col);
clrtoeol();
len = wcslen(menustring);
if ( line == 0 ){
setDynamicWChar(&topMenuBuffer, L"%ls", menustring);
topMenu = true;
} else {
setDynamicWChar(&bottomMenuBuffer, L"%ls", menustring);
bottomMenu = true;
}
setColors(COMMAND_PAIR);
for (i = 0; i < len; i++)
{
Expand Down
11 changes: 5 additions & 6 deletions src/settings.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
DF-SHOW: An interactive directory/file browser written for Unix-like systems.
Based on the applications from the PC-DOS DF-EDIT suite by Larry Kroeker.
Copyright (C) 2018-2023 Robert Ian Hawdon
Copyright (C) 2018-2024 Robert Ian Hawdon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -45,6 +45,9 @@ extern int * pc;
extern char globalConfLocation[4096];
extern char homeConfLocation[4096];

extern int viewMode;


void updateSetting(settingIndex **settings, int index, int type, int intSetting)
{
// To-Do, do a verification on the type
Expand Down Expand Up @@ -392,6 +395,7 @@ int textValueLookup(t1CharValues **values, int *items, char *refLabel, char *val

void settingsMenuView(wchar_t *settingsMenuLabel, int settingsMenuSize, menuDef *settingsMenu, settingIndex **settings, t1CharValues **charValues, t2BinValues **binValues, int totalCharItems, int totalBinItems, int totalItems, char *application)
{
viewMode = 3;
int count = 0;
int x = 2;
int y = 3;
Expand All @@ -403,11 +407,6 @@ void settingsMenuView(wchar_t *settingsMenuLabel, int settingsMenuSize, menuDef
clear();
wPrintMenu(0,0,settingsMenuLabel);

// TODO call the settings loader
settingsAction("read", application, NULL, NULL, NULL, NULL, 0, 0, 0, globalConfLocation);
settingsAction("read", application, NULL, NULL, NULL, NULL, 0, 0, 0, homeConfLocation);
settingsAction("generate", application, NULL, NULL, NULL, NULL, 0, 0, 0, NULL);

while(1)
{
for (count = 0; count < totalItems; count++){
Expand Down
10 changes: 8 additions & 2 deletions src/sf.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
DF-SHOW: An interactive directory/file browser written for Unix-like systems.
Based on the applications from the PC-DOS DF-EDIT suite by Larry Kroeker.
Copyright (C) 2018-2023 Robert Ian Hawdon
Copyright (C) 2018-2024 Robert Ian Hawdon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -47,6 +47,9 @@ extern char regexinput[1024];

int colormode = 0;
int messageBreak = 0;

extern char *programName;

extern int displaysize;
extern int topline;
extern int leftcol;
Expand Down Expand Up @@ -131,7 +134,9 @@ int main(int argc, char *argv[])
int c;

initI18n();


setDynamicChar(&programName, "%s", PROGRAM_NAME);

setConfLocations();

// Read the config
Expand Down Expand Up @@ -245,3 +250,4 @@ int main(int argc, char *argv[])
exittoshell();
return 0;
}

Loading

0 comments on commit 0dfdfae

Please sign in to comment.