Building MMview, a universal file viewer

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#281 Post by MochiMoppel »

greengeek wrote:Ahhh yes - it seems that renaming a "Places" bookmark does not rename the target directory
It "seems" ? :lol:
If you are not convinced then start MMview, use your preferred method to display hidden files and have a look at /root/.gtk-bookmarks. This is the file where GTK reads and writes bookmarks. I hope you are impressed by the simplicity of this file and by the way, custom names are added to bookmarked directories. By a single space. The idea of a genius.

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#282 Post by rockedge »

setup mm_view on a Void Linux / Puppy Linux hybrid OS....works great...going to be using it as a main tool in the WeeDog (firstrib) OS's built from wiak's scripts described here ->

http://murga-linux.com/puppy/viewtopic.php?t=116212

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#283 Post by rockedge »

I am have trouble getting the quick view to work on the latest versions of WeeDog based on Void Linux. Earlier test versions of WeeDog MM_VIEW was working well. Now mm_view seems to work for example I can hex dump a file and see the text, but for some reason the quick view will not function....


Can anyone give a tip on how to get mm_view to work on WeeDog and Void Linux once again?

Code: Select all

_sh-5.0# /usr/bin/mm_view_20190702
widget_menuitem_create(): <width> not implemented for this widget.
timeout: invalid option -- t
BusyBox v1.30.0 (2018-12-30 22:25:27 CET) multi-call binary.

Usage: timeout [-s SIG] SECS PROG ARGS

Runs PROG. Sends SIG to it if it is not gone in SECS seconds.
Default SIG: TERM.
environment: line 18: file: command not found
environment: line 18: file: command not found
MAIN_DIALOG=""
vBTN_DISABLEVIEW="false"
vBTN_WRAP="false"
vCHOOSER="/root/Build/shinobi_recipe.txt"
vCMDLINE=""
vDURATION="156613867760"
vHIDDEN_RESTARTBUTTON=""
vMACRO_REFRESH=""
vMACRO_REFRESH_FORCE=""
vMENU_CHAR2HEX=""
vMENU_CMDBOX_OPEN=""
vMENU_DISABLEVIEW="false"
vMENU_HEXDUMP_ALL=""
vMENU_HEXDUMP_HEAD=""
vMENU_HEXDUMP_HELP=""
vMENU_HEXMARK_ALL=""
vMENU_HEXMARK_HEAD=""
vMENU_LAYOUT="false"
vMENU_PLAY="false"
vMENU_VIEWHISTORY=""
vMENU_WRAP="false"
vNOTE="0"
vSTATUSBAR="/root/Build/shinobi_recipe.txt â "
vTSTART="156613867759
"
EXIT="OK"
_

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#284 Post by greengeek »

Looks like it may be to do with the -t option issue highlighted on the previous page by radky and mochimoppel http://murga-linux.com/puppy/viewtopic. ... 80#1031680

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#285 Post by wiak »

greengeek wrote:Looks like it may be to do with the -t option issue highlighted on the previous page by radky and mochimoppel http://murga-linux.com/puppy/viewtopic. ... 80#1031680
'Fix' was to match GNU coreutils timeout syntax:

https://github.com/mirror/busybox/commi ... dfbc66075b

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#286 Post by MochiMoppel »

rockedge wrote:I am have trouble getting the quick view to work on the latest versions of WeeDog based on Void Linux. Earlier test versions of WeeDog MM_VIEW was working well.
Thanks rockedge for your error report and your PMs with your screenshot. This made me look again at your error messages.
There are three:

Code: Select all

widget_menuitem_create(): <width> not implemented for this widget.
As I told you in my PM I have no idea what this refers to.
In MMview there is no "widget_menuitem_create()" function and in GTK - as far as I read the documentation - there is no such function either. In menus <width> is used for icons in menuitems and AFAIK supported since the earliest version of gtkdialog, so "widget_menuitem_create()" remains a mystery. Maybe other members can help.

Code: Select all

BusyBox v1.30.0 (2018-12-30 22:25:27 CET) multi-call binary. 

Usage: timeout [-s SIG] SECS PROG ARGS 

Runs PROG. Sends SIG to it if it is not gone in SECS seconds. 
Default SIG: TERM.
This was an easy one. Cause and remedies are known and as I understand you fixed it already. In any case this affects only the display for directories and not text or image files.

Code: Select all

environment: line 18: file: command not found
This is the one I overlooked and which is responsible for your dysfunctional viewer pane. Your system lacks or can't find the file command. MMview wouldn't work without it. I took it for granted that every Puppy has it installed.

Looks like "Void Linux" is a little bit too void :wink:

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#287 Post by wiak »

Please refer to my next post for where error seems to come from in detail. Hope that allows issue to be sorted out easily.
MochiMoppel wrote:

Code: Select all

widget_menuitem_create(): <width> not implemented for this widget.
As I told you in my PM I have no idea what this refers to.
In MMview there is no "widget_menuitem_create()" function and in GTK - as far as I read the documentation - there is no such function either. In menus <width> is used for icons in menuitems and AFAIK supported since the earliest version of gtkdialog, so "widget_menuitem_create()" remains a mystery. Maybe other members can help.

Code: Select all

GtkWidget *widget_menuitem_create(
	AttributeSet *Attr, tag_attr *attr, gint Type)
{
	#define           TYPE_MENUITEM 0
	#define           TYPE_MENUITEM_IMAGE_STOCK 1
	#define           TYPE_MENUITEM_IMAGE_ICON 2
	#define           TYPE_MENUITEM_IMAGE_FILE 3
	#define           TYPE_MENUITEM_CHECK 4
	#define           TYPE_MENUITEM_RADIO 5
	#define           TYPE_MENUITEM_SEPARATOR 6
	GdkPixbuf        *pixbuf;
	GError           *error = NULL;
	GList            *element;
	GtkAccelGroup    *accel_group = NULL;
	GtkIconTheme     *icon_theme;
	GtkWidget        *image;
	GtkWidget        *widget;
	gchar             accel_path[64];
	gchar            *active;
	gchar            *icon_name, *image_name;
	gchar            *label, *stock_id;
	gchar            *value;
	gint              is_active;
	gint              menuitemtype = TYPE_MENUITEM;
	gint              width = -1, height = -1, size = 16;
guint accel_key = 0, accel_mods = 0, custom_accel = 0;
That function is in gtkdialog widget_menuitem.c:

https://github.com/01micko/gtkdialog/bl ... menuitem.c

I don't know what the issue is at the moment though. Presumably, <width> not implemented. Checks docs for the function advised (on 01micko's github gtkdialog site - will double check where - been a long time since I looked at any of this):

http://01micko.com/reference/

Above is the reference but I don't know if it documents the issue anyway - like I say I haven't been working with this stuff for too long to help further just now.
MochiMoppel wrote:Looks like "Void Linux" is a little bit too void :wink:
Void must be awful then... (but rockedge knows how to install 'file' package - don't worry about that).

wiak
Last edited by wiak on Tue 20 Aug 2019, 03:37, edited 1 time in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#288 Post by wiak »

https://github.com/01micko/gtkdialog/bl ... menuitem.c

Here is where the error seems to come from I think. Maybe the comment-line at the top explains the issue.

wiak

Code: Select all

	/* Only image menuitems from theme or file support this */
	if (attributeset_is_avail(Attr, ATTR_WIDTH)) {
		if (menuitemtype == TYPE_MENUITEM_IMAGE_ICON ||
			menuitemtype == TYPE_MENUITEM_IMAGE_FILE) {
			width = atoi(attributeset_get_first(&element, Attr, ATTR_WIDTH));
		} else {
			fprintf(stderr, "%s(): <width> not implemented for this widget.\n",
				__func__);
		}
}
So I guess must be issue involving:

/* Only image menuitems from theme or file support this */

It seems that the "menuitemtype" currently being used in rockedges set up isn't one of these (icon issue?):

(menuitemtype == TYPE_MENUITEM_IMAGE_ICON ||
menuitemtype == TYPE_MENUITEM_IMAGE_FILE)

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#289 Post by rockedge »

Thank you everyone for the spot on help. I was missing "file" in my WeeDog (Void Linux base) After installing file, MMview (mm_view_20190702) is working once again.

Only the warning

Code: Select all

widget_menuitem_create(): <width> not implemented for this widget.
shows up when MMview is started from the command line but everything seems to be working well otherwise.

I have included "file" now in the WeeDog firstbuild.plug build recipe script since I had missed that file was not included in the Void Linux base-minimal package.

A screenshot of WeeDog (firstrib-s102) based on Void Linux binaries
Attachments
2019-08-20-112752_600px.png
(126.06 KiB) Downloaded 769 times

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#290 Post by perdido »

Couple icons for MMview desktop are no longer available, MM explains where the "official" icon resides in the post following this one.
Last edited by perdido on Sun 25 Aug 2019, 11:02, edited 1 time in total.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#291 Post by MochiMoppel »

For a desktop icon start MMview, and when you are happy with the color of his fashion glasses, copy the file /tmp/mm_view/iconmmv.svg to a permanent location, e.g. /root/.config/mm_view/iconmmv.svg. It's a 48x48px icon and only 317 bytes small.

Though I don't like desktop icons in general I really recommend to have MMview on the desktop. Dragging a file from ROX-Filer onto a MMview icon or into a running window provides functionality and speed not possible with a menu entry.

Here the code for a genuine MMview icon - with pink glasses:

Code: Select all

<svg width="48" height="48" viewBox="0 0 100 100">
<style type="text/css">circle{fill:#ffc0cb}*{fill:#fff;stroke:#000;stroke-width:6;stroke-linecap:round;}</style>
<path	d="M-2,100 C0,-10 100,-10 102,100M 40,5 50,15 70,10 60,17M 65,80 70,80"/>
<circle	cx="27" cy="50" r="20"/>
<circle	cx="73" cy="50" r="20"/>
</svg>
.
Last edited by MochiMoppel on Fri 30 Aug 2019, 14:06, edited 1 time in total.

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#292 Post by perdido »

MochiMoppel wrote::shock: How did you manage to make him uglier than he already is?

I cut the icon from the MMview window and used my "artistic depiction"
It took a lot of work making mine look like that..... :lol:

The icon in /tmp/mm_view/iconmmv.svg being almost the spitting image of my rendition has convinced me that additional icons are not needed.
Now using the icon located in /tmp/mm_view/iconmmv.svg as the desktop icon, I like the eyeglasses on the desktop icon change color after shutting down and restarting the program,

.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#293 Post by MochiMoppel »

perdido wrote:Now using the icon located in /tmp/mm_view/iconmmv.svg as the desktop icon, I like the eyeglasses on the desktop icon change color after shutting down and restarting the program,.
But this means that you see an ugly ROX default icon when MMview is not running, doesn't it?

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#294 Post by perdido »

MochiMoppel wrote:
perdido wrote:Now using the icon located in /tmp/mm_view/iconmmv.svg as the desktop icon, I like the eyeglasses on the desktop icon change color after shutting down and restarting the program,.
But this means that you see an ugly ROX default icon when MMview is not running, doesn't it?
After a reboot only, once MMview has run once the icon remains.
The icon glasses then change color on each subsequent start of MMview - if I touch the desktop icon with the mouse pointer. No doubt due to regeneration of the icon in /tmp

I suppose maybe having the iconmmv.svg icon generated in /usr/local/libs/X11/pixmaps/ would let it remain in the system between reboots :)

.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#295 Post by MochiMoppel »

perdido wrote:After a reboot only, once MMview has run once the icon remains..
Are you sure? This would be a bug.
Currently MMview is designed to delete /tmp/mm_view/iconmmv.svg after the last running instance of MMview is closed. So if the icon remains you either have another MMview open, you haven't yet moved your mouse cursor over the icon (which would reset it to ROX default), or /tmp/mm_view/iconmmv.svg hasn't been properly deleted, in which case I would have to switch into debug mode.

Once we have sorted this out let's think of a method to display a permanent icon (uncolored glasses?) and, after starting MMview, change the color of the glasses to the current color. After closing MMview the permanent icon should be restored. Sounds crazy enough not to try :lol:

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#296 Post by perdido »

MochiMoppel wrote:
perdido wrote:After a reboot only, once MMview has run once the icon remains..
Are you sure? This would be a bug.
Currently MMview is designed to delete /tmp/mm_view/iconmmv.svg after the last running instance of MMview is closed. So if the icon remains you either have another MMview open, you haven't yet moved your mouse cursor over the icon (which would reset it to ROX default), or /tmp/mm_view/iconmmv.svg hasn't been properly deleted, in which case I would have to switch into debug mode :lol:
I was using MMview version 04-09-2019 and it was leaving 4 files in /tmp/mm_view/ after closing the program.
I changed to an older version 11-01-2018 and /tmp/mm_view/ contents are deleted after closing the program.
I tried latest version 07-02-2019 and /tmp/mm_view/ contents are deleted after closing the program. No bug in latest version.

Looks like I was using the only version that acted like that :)
Whatever bug it was in 04-09-2019 has been squashed in 07-02-2019

I thought I was going crazier there for a minute :lol:
Once we have sorted this out let's think of a method to display a permanent icon (uncolored glasses?) and, after starting MMview, change the color of the glasses to the current color. After closing MMview the permanent icon should be restored. Sounds crazy enough not to try :lol:
Ok, sounds like fun :)

.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#297 Post by MochiMoppel »

Update 2019-08-29 (see also initial post)

This is a small service update. No new functionality. It adds support for busybox v1.30 or newer and fixes some minor glitches in recent distros. I also changed some keyboard shortcuts to bring them closer to de-facto standards (e.g. F2 for Rename) or to defuse potentially disruptive GTK built-in shortcuts (e.g. F6, which by default toggles between the 2 chooser panes but in some cases opens the search bar, making it difficult to return to the file list).

Shortcut changes:

Code: Select all

Menu                         Old          New
--------------------------------------------------
File > Rename                Ctrl+R       F2
File > Show in Rox           Shift+Ctrl+R Ctrl+R
Document > Line Wrapping     none         F6
Document > Show Line Numbers F2           Ctrl+F6

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#298 Post by MochiMoppel »

Special desktop edition
Promised to perdido and based on above update I tried to set an icon for MMview that would change according to the color of the fat guy's glasses. When he is not viewing anything glasses are light gray.
Affected are icons on the pinboard and in ROX-Filer window

This is a special edition of MMview and I'm not sure if I will ever include this gimmick into future official versions though I admit that I'm starting to like it. It may even be useful: I often have multiple instances open and it happens that I forget an instance on a different desktop. The icon color tells me if there is still an instance open somewhere.

Uncompress and make executable as usual. For most fun drag the script from ROX-Filer to the desktop. Don't add an icon manually, just click and see what happens.

[Udate 2020-02-22]
Attached version is now based on MMview 2020-02-13.
If you have installed a previous version, please delete the directory /root/.config/mm_view. The script will generated an updated version.
Have fun :lol:
Attachments
mm_viewme.gz
New version based on MMview 2020-02-13
(23.19 KiB) Downloaded 278 times
ROXicons.jpg
(49.71 KiB) Downloaded 458 times
Last edited by MochiMoppel on Sat 22 Feb 2020, 11:28, edited 3 times in total.

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#299 Post by perdido »

Hi MochiMoppel

Well would you look at that :shock:

Drag the script to the desktop and after MMview is started the first time there he is looking back at me.
Working beautifully, glasses turn color when MMview launched then turn light gray when shut down, thats very cool :)

Thanks for doing the icon mod, much appreciated! I like it :)

.

foxpup
Posts: 1132
Joined: Fri 29 Jul 2016, 21:08

#300 Post by foxpup »

MochiMoppel wrote:This is a special edition of MMview and I'm not sure if I will ever include this gimmick into future official versions though I admit that I'm starting to like it.
To be sure I have it, I've downloaded this little gem! :D

Post Reply