Skip to content

Commit 4a42167

Browse files
committed
Merge remote-tracking branch 'upstream/icewm-1-4-BRANCH' into icewm-1-4-BRANCH
2 parents af1850f + bb8f7de commit 4a42167

27 files changed

+442
-428
lines changed

man/icewm-preferences.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ Command to select and run a program.
10231023

10241024
=item B<OpenCommand>=""
10251025

1026-
Open command.
1026+
Command to open a file or directory from the Start menu.
10271027

10281028
=item B<TerminalCommand>="xterm"
10291029

man/icewm-toolbar.pod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ Options and arguments that are passed to I<program>.
7272
Lines beginning with a hash (C<#>) are comment lines. Comment lines and
7373
blank lines are ignored.
7474

75+
Please note that all keywords from L<icewm-menu(5)> are permitted here
76+
as well.
77+
7578
=head2 EXAMPLES
7679

7780
Following is an example that places a number of toolbar buttons on the

po/hu.po

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ msgstr ""
1010
"Project-Id-Version: icewm 1.2.7\n"
1111
"Report-Msgid-Bugs-To: https://github.com/bbidulock/icewm/issues\n"
1212
"POT-Creation-Date: 2025-02-22 16:19+0100\n"
13-
"PO-Revision-Date: 2023-03-28 22:14+0000\n"
13+
"PO-Revision-Date: 2025-06-30 12:59+0000\n"
1414
"Last-Translator: Kempelen <[email protected]>\n"
15-
"Language-Team: Hungarian <https://l10n.opensuse.org/projects/icewm/icewm-1-4-"
16-
"branch/hu/>\n"
15+
"Language-Team: Hungarian <https://l10n.opensuse.org/projects/icewm/"
16+
"icewm-1-4-branch/hu/>\n"
1717
"Language: hu\n"
1818
"MIME-Version: 1.0\n"
1919
"Content-Type: text/plain; charset=UTF-8\n"
2020
"Content-Transfer-Encoding: 8bit\n"
2121
"Plural-Forms: nplurals=2; plural=n != 1;\n"
22-
"X-Generator: Weblate 4.9.1\n"
22+
"X-Generator: Weblate 5.12.2\n"
2323

2424
# ../src/icons.cc:220
2525
#: src/aapm.cc:113
2626
#, c-format
2727
msgid "Can't open the APM device %s"
28-
msgstr "Nem sikerült megnyitni a APM-eszközt: %s"
28+
msgstr "Nem sikerült megnyitni az APM-eszközt: %s"
2929

3030
#: src/aapm.cc:121 src/aapm.cc:139
3131
#, c-format
@@ -401,6 +401,41 @@ msgid ""
401401
"This program also listens to environment variables defined by\n"
402402
"the XDG Base Directory Specification:\n"
403403
msgstr ""
404+
"HASZNÁLAT: icewm-menu-fdo [KAPCSOLÓK] [FÁJLNÉV]\n"
405+
"KAPCSOLÓK:\n"
406+
"-g, --generic\t\tKerüljön bele a program általános neve, zárójelben\n"
407+
"-o, --output=FÁJL\tKimenet írása a FÁJL-ba\n"
408+
"-t, --terminal=NÉV\tNÉV használata a terminálhoz amely rendelkezik '-e' "
409+
"kapcsolóval\n"
410+
"-s, --no-lone-app\tHelyezze át a magányos elemeket a tartalmazó menübe\n"
411+
"-S, --no-lone-hint\tMint -s, de fűzze hozzá az eredeti almenü nevét\n"
412+
"-d, --deadline-apps=N\tAlkalmazásadatok betöltésének megszakítása N ms után\n"
413+
"-D, --deadline-all=N\tMinden betöltés megszakítása és az eddig összegyűjtött "
414+
"kiírása\n"
415+
"-m, --match=MINTA\t\tCsak a MINTÁT tartalmazó címek megjelenítése\n"
416+
"-M, --imatch=MINTA\tMint --match, de kis- és nagybetűk különböznek\n"
417+
"-L, --limit-max-len=N\tCímek vágása N karakternél, majd ... hozzáfűzése\n"
418+
"--seps \tElválasztók kiírása a tartalom előtt és után\n"
419+
"--sep-before\tElválasztó kiírása a tartalom előtt\n"
420+
"--sep-after\tElválasztó kiírása csak a tartalom után\n"
421+
"--no-sep-others\tElavult, nincs hatása\n"
422+
"--no-sub-cats\tNe legyenek további alkategóriák, csak egy menüszint\n"
423+
"--flat\t\tMinden alkalmazás egy szinten jelenjen meg, kategória tippel\n"
424+
"--flat-sep=ELV\tKategória elválasztó egy szintű módban (alapértelmezés: ' / "
425+
"')\n"
426+
"--match-sec\tA --match vagy --imatch alkalmazása a programokra és szekciókra "
427+
"is\n"
428+
"--match-osec\tA --match vagy --imatch alkalmazása kizárólag a szekciókra\n"
429+
"--orig-comment\tForrás .desktop fájl hozzáadása megjegyzésként\n"
430+
"-C, --copying\tCopyright információk megjelenítése\n"
431+
"-V, --version\tVerzió információk megjelenítése\n"
432+
"-h, --help\tEzen súgó megjelenítése és kilépés.\n"
433+
"\n"
434+
"FÁJLNÉV\tEgy tetszőleges .desktop fájl, az alkalmazásindító Exec parancsának "
435+
"lefuttatásához.\n"
436+
"\n"
437+
"Ez a program az XDG Alapkönyvtár Specifikáció által meghatározott\n"
438+
"környezeti változókat is figyelembe veszi.\n"
404439

405440
#. TRANSLATORS: This is a SHORT category menu name from freedesktop.org. Please add compact punctuation if needed but no double-quotes! Hint for the content inside: An audio application
406441
#: src/fdomenu.cc:1100 src/fdospecgen.h:64 src/fdospecgen.h:72
@@ -412,15 +447,15 @@ msgstr "Hang"
412447

413448
#: src/fdomenu.cc:1101
414449
msgid "Zarathustra"
415-
msgstr ""
450+
msgstr "Zarathustra"
416451

417452
#: src/fdomenu.cc:1201
418453
msgid "System too slow! Failed to load menu content!"
419-
msgstr ""
454+
msgstr "A rendszer túl lassú! A menü tartalmának betöltése nem sikerült!"
420455

421456
#: src/fdomenu.cc:1204
422457
msgid "Please push HERE and retry after some seconds."
423-
msgstr ""
458+
msgstr "Kattintson IDE és próbálja újra pár másodperc múlva."
424459

425460
#. TRANSLATORS: This is a SHORT category menu name from freedesktop.org. Please add compact punctuation if needed but no double-quotes! Hint for the content inside: A tool to manage printers
426461
#: src/fdospecgen.h:24
@@ -659,7 +694,6 @@ msgstr "Művészet"
659694

660695
#. TRANSLATORS: This is a SHORT category menu name from freedesktop.org. Please add compact punctuation if needed but no double-quotes! Hint for the content inside: Artificial Intelligence software
661696
#: src/fdospecgen.h:234 src/fdospecgen.h:240
662-
#, fuzzy
663697
msgid "Artificialtelligence"
664698
msgstr "Mesterséges intelligencia"
665699

@@ -759,7 +793,7 @@ msgstr "Óra"
759793
#. TRANSLATORS: This is a SHORT category menu name from freedesktop.org. Please add compact punctuation if needed but no double-quotes! Hint for the content inside: Application that only works inside a terminal (text-based or command line application)
760794
#: src/fdospecgen.h:366
761795
msgid "ConsoleOnly"
762-
msgstr ""
796+
msgstr "Terminál alapú"
763797

764798
#. TRANSLATORS: This is a SHORT category menu name from freedesktop.org. Please add compact punctuation if needed but no double-quotes! Hint for the content inside:  
765799
#: src/fdospecgen.h:372 src/fdospecgen.h:378
@@ -2202,7 +2236,7 @@ msgstr "_Alvó mód"
22022236

22032237
#: src/wmapp.cc:531 src/wmdialog.cc:91
22042238
msgid "_Hibernate"
2205-
msgstr ""
2239+
msgstr "_Hibernálás"
22062240

22072241
# ../src/wmapp.cc:468
22082242
#: src/wmapp.cc:535
@@ -2483,11 +2517,11 @@ msgstr ""
24832517

24842518
#: src/wmapp.cc:1652
24852519
msgid " -o, --output=FILE Redirect all output to FILE.\n"
2486-
msgstr ""
2520+
msgstr " -o, --output=FÁJL Minden kimenet átirányítása a FÁJL-ba.\n"
24872521

24882522
#: src/wmapp.cc:1658
24892523
msgid " -i, --install=THEME Install THEME from extra or 'list'.\n"
2490-
msgstr ""
2524+
msgstr " -i, --install=TÉMA A TÉMA telepítése az extrákból vagy 'listából'.\n"
24912525

24922526
#: src/wmapp.cc:1661
24932527
#, c-format

src/amemstatus.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,11 @@ void MEMStatus::getStatus() {
272272
membytes total = fMemInfo->parseField("MemTotal:");
273273
if (total < 1)
274274
total = 1;
275-
if (total >= cur[MEM_BUFFERS] + cur[MEM_CACHED] + cur[MEM_FREE])
276-
cur[MEM_USER] = cur[MEM_BUFFERS] + cur[MEM_CACHED] + cur[MEM_FREE];
277-
else
278-
cur[MEM_USER] = 0;
275+
membytes user = total;
276+
for (int j = 0; j < MEM_STATES; j++) {
277+
user -= cur[j];
278+
}
279+
cur[MEM_USER] = user;
279280
}
280281
fMemInfo->discard();
281282

src/browse.cc

Lines changed: 82 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,40 @@
77
#include "config.h"
88
#include "obj.h"
99
#include "objmenu.h"
10+
#include "default.h"
1011
#include "browse.h"
1112
#include "wmmgr.h"
1213
#include "wmprog.h"
1314
#include "yicon.h"
14-
#include "sysdep.h"
15+
#include "wmapp.h"
1516
#include "base.h"
16-
#include "udir.h"
17-
18-
BrowseMenu::BrowseMenu(
19-
IApp *app,
20-
YSMListener *smActionListener,
21-
YActionListener *wmActionListener,
22-
upath path,
23-
YWindow *parent): ObjectMenu(wmActionListener, parent)
17+
#include <dirent.h>
18+
#include <fcntl.h>
19+
#include <sys/stat.h>
20+
21+
BrowseMenu::BrowseMenu(IApp* app, upath path)
22+
: app(app)
23+
, fPath(path)
24+
, fModTime(None)
2425
{
25-
this->app = app;
26-
this->smActionListener = smActionListener;
27-
fPath = path;
28-
fModTime = 0;
26+
setActionListener(this);
2927
}
3028

3129
BrowseMenu::~BrowseMenu() {
30+
for (const ActionName& an : names) {
31+
delete[] an.name;
32+
}
33+
}
34+
35+
void BrowseMenu::actionPerformed(YAction action, unsigned) {
36+
for (const ActionName& an : names) {
37+
if (action == an.action) {
38+
upath target(fPath + an.name);
39+
const char *args[] = { openCommand, target.string(), nullptr };
40+
app->runProgram(openCommand, args);
41+
break;
42+
}
43+
}
3244
}
3345

3446
void BrowseMenu::updatePopup() {
@@ -44,15 +56,64 @@ void BrowseMenu::updatePopup() {
4456

4557
void BrowseMenu::loadItems() {
4658
removeAll();
47-
for (sdir dir(fPath); dir.next(); ) {
48-
upath npath(fPath + dir.entry());
49-
ObjectMenu *sub = nullptr;
50-
if (npath.dirExists())
51-
sub = new BrowseMenu(app, smActionListener,
52-
getActionListener(), npath);
53-
DFile *pfile = new DFile(app, dir.entry(), null, npath);
54-
addObject(pfile, sub ? "folder" : "file", sub);
59+
60+
DIR* dir = opendir(fPath.string());
61+
if (dir == nullptr) {
62+
return;
63+
}
64+
65+
YStringArray dirs, fils;
66+
struct stat st;
67+
68+
for (struct dirent* ent; (ent = readdir(dir)) != nullptr; ) {
69+
if (ent->d_name[0] == '.') {
70+
continue;
71+
}
72+
#if DT_DIR
73+
else if (ent->d_type != DT_UNKNOWN) {
74+
if (ent->d_type == DT_DIR) {
75+
dirs.append(ent->d_name);
76+
} else if (ent->d_type == DT_REG) {
77+
fils.append(ent->d_name);
78+
}
79+
}
80+
#endif
81+
else if (fstatat(dirfd(dir), ent->d_name, &st, AT_SYMLINK_NOFOLLOW) == 0) {
82+
if (S_ISDIR(st.st_mode)) {
83+
dirs.append(ent->d_name);
84+
} else if (S_ISREG(st.st_mode)) {
85+
fils.append(ent->d_name);
86+
}
87+
}
88+
}
89+
closedir(dir);
90+
91+
if (dirs.nonempty()) {
92+
ref<YIcon> icon = YIcon::getIcon("folder");
93+
dirs.sort();
94+
for (const char* name: dirs) {
95+
upath npath(fPath + name);
96+
ActionName an;
97+
an.name = newstr(name);
98+
YMenu* sub = new BrowseMenu(app, npath);
99+
YMenuItem *item = addItem(an.name, -1, an.action, sub);
100+
item->setIcon(icon);
101+
names.append(an);
102+
}
103+
}
104+
if (fils.nonempty()) {
105+
ref<YIcon> icon = YIcon::getIcon("file");
106+
fils.sort();
107+
for (const char* name: fils) {
108+
upath npath(fPath + name);
109+
ActionName an;
110+
an.name = newstr(name);
111+
YMenuItem *item = addItem(an.name, -1, an.action, nullptr);
112+
item->setIcon(icon);
113+
names.append(an);
114+
}
55115
}
116+
setSelectedItem(0);
56117
}
57118

58119
// vim: set sw=4 ts=4 et:

src/browse.h

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
#ifndef __BROWSE_H
2-
#define __BROWSE_H
1+
#ifndef BROWSE_H
2+
#define BROWSE_H
33

44
class YSMListener;
55

6-
class BrowseMenu: public ObjectMenu {
6+
class BrowseMenu: public YMenu, private YActionListener {
77
public:
8-
BrowseMenu(
9-
IApp *app,
10-
YSMListener *smActionListener,
11-
YActionListener *wmActionListener,
12-
upath path,
13-
YWindow *parent = nullptr);
14-
virtual ~BrowseMenu();
15-
virtual void updatePopup();
8+
BrowseMenu(IApp *app, upath path);
9+
~BrowseMenu();
10+
11+
void updatePopup() override;
1612

1713
private:
14+
void actionPerformed(YAction action, unsigned modifiers = 0) override;
1815
void loadItems();
1916

17+
IApp *app;
2018
upath fPath;
2119
time_t fModTime;
22-
YSMListener *smActionListener;
23-
IApp *app;
20+
21+
typedef struct {
22+
YAction action;
23+
const char* name;
24+
} ActionName;
25+
YArray<ActionName> names;
2426
};
2527

2628
#endif

src/default.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ cfoption icewm_preferences[] = {
449449
OSV("ClockCommand", &clockCommand, "Command to run on clock"),
450450
OSV("ClockClassHint", &clockClassHint, "WM_CLASS to allow runonce for ClockCommand"),
451451
OSV("RunCommand", &runDlgCommand, "Command to select and run a program"),
452-
OSV("OpenCommand", &openCommand, "Command to select and run a program."),
452+
OSV("OpenCommand", &openCommand, "Command to open a file or directory from the Start menu."),
453453
OSV("TerminalCommand", &terminalCommand, "Terminal emulator must accept -e option."),
454454
OSV("LogoutCommand", &logoutCommand, "Command to start logout"),
455455
OSV("LogoutCancelCommand", &logoutCancelCommand, "Command to cancel logout"),

0 commit comments

Comments
 (0)