Skip to content

Commit

Permalink
Commit #2
Browse files Browse the repository at this point in the history
  • Loading branch information
madmurphy committed Apr 26, 2021
1 parent d94ff25 commit 08ff6be
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 70 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ Change Log
==========


## 0.1.1 (2021-04-26)

Changes:

* Translatable strings have changed
* Package review


## 0.1.0 (2021-04-25)

**Nautilus Hide** has been published.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ NEWS
## 0.1.0

**Nautilus Hide** has been published.

21 changes: 11 additions & 10 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ Details

**Nautilus Hide** does not add a leading dot to file names, but relies on
Nautilus' ability to hide the files that are listed in a `.hidden` file (to be
found in the same directory). The extension erases the `.hidden` files when
empty and is able to handle selections of files that are distributed across
multiple locations.
found in the same directory).

If a file is not immediately hidden/unhidden, press `F5` or `Ctrl` + `R` to
The extension erases the `.hidden` files when these are empty and is able to
handle selections of files that are distributed across multiple locations.

If a file is not immediately hidden/unhidden, press `Ctrl` + `R` or `F5` to
refresh the viewport.


Expand All @@ -28,13 +29,13 @@ Let's say you want to create a Dutch translation of **Nautilus Hide**. This
package comes with only a bunch of strings to translate, whose most important
ones are:

1. “Hide”
2. “Hide the selected files
3. “Unhide”
4. “Unhide the selected files
1. “Hide file(s)
2. “Hide the selected file(s)
3. “Unhide file(s)
4. “Unhide the selected file(s)

Other strings are only debug messages sent to the standard error stream and can
be left untraslated.
Other translatable strings are only debug messages sent to the standard error
stream and can be left untraslated.

First thing to do is to make sure that `gettext` and `intltool` are installed
on your system. Then clone this repository and launch the following four
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dnl ***************************************************************************
AC_PREREQ([2.69])

AC_INIT([Nautilus Hide],
[0.1.0],
[0.1.1],
[madmurphy333@gmail.com],
[nautilus-hide],
[https://gitlab.gnome.org/madmurphy/nautilus-hide])
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nautilus-hide",
"version": "0.1.0",
"version": "0.1.1",
"description": "A simple Nautilus extension that adds \"Hide\" and \"Unhide\" to Nautilus right-click menu",
"homepage": "https://gitlab.gnome.org/madmurphy/nautilus-hide",
"author": "madmurphy333@gmail.com",
Expand Down
58 changes: 33 additions & 25 deletions po/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Project-Id-Version: 0.1.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-04-24 10:15+0200\n"
"PO-Revision-Date: 2021-04-24 10:16+0200\n"
"POT-Creation-Date: 2021-04-26 18:05+0200\n"
"PO-Revision-Date: 2021-04-26 18:05+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Italian <tp@lists.linux.it>\n"
"Language: it\n"
Expand All @@ -17,78 +17,86 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: ../src/nautilus-hide.c:91
#: ../src/nautilus-hide.c:96
msgid "Could not close the database of hidden files"
msgstr "Impossibile chiudere il database dei file nascosti"

#: ../src/nautilus-hide.c:111 ../src/nautilus-hide.c:128
#: ../src/nautilus-hide.c:142 ../src/nautilus-hide.c:200
#: ../src/nautilus-hide.c:251 ../src/nautilus-hide.c:303
#: ../src/nautilus-hide.c:116 ../src/nautilus-hide.c:133
#: ../src/nautilus-hide.c:147 ../src/nautilus-hide.c:205
#: ../src/nautilus-hide.c:256 ../src/nautilus-hide.c:308
msgid "Error allocating memory"
msgstr "Errore nell'allocare memoria"

#: ../src/nautilus-hide.c:174
msgid "Database of hidden files is not seekable"
msgstr "Impossibile lanciare seek sul database dei file nascosti"
#: ../src/nautilus-hide.c:179
msgid "Could not calculate the size of the database of hidden files"
msgstr "Impossibile calcolare le dimensioni del database dei file nascosti"

#: ../src/nautilus-hide.c:186
#: ../src/nautilus-hide.c:191
msgid "Database of hidden files is too big"
msgstr "Il database dei file nascosti è troppo grande"

#: ../src/nautilus-hide.c:214
#: ../src/nautilus-hide.c:219
msgid "I/O error while accessing database of hidden files"
msgstr "Errore I/O nell'accedere al database dei file nascosti"

#: ../src/nautilus-hide.c:391
#: ../src/nautilus-hide.c:390
msgid "No files were selected to be hidden"
msgstr "Non ci sono file selezionati da nascondere"

#: ../src/nautilus-hide.c:405
#: ../src/nautilus-hide.c:404
msgid ""
"Could not hide the selected files, error attempting to group them according "
"to their parent directories"
msgstr ""
"Impossibile nascondere i file selezionati, errore nel tentativo di "
"raggrupparli in base alla loro directory di appartenenza"

#: ../src/nautilus-hide.c:433
#: ../src/nautilus-hide.c:432
msgid ""
"Could not hide the selected files, error attempting to edit the database"
msgstr ""
"Impossibile nascondere i file selezionati, errore nel tentativo di "
"modificare il database"

#: ../src/nautilus-hide.c:550
#: ../src/nautilus-hide.c:549
msgid "No files were selected to be unhidden"
msgstr "Non ci sono file selezionati da rendere visibili"

#: ../src/nautilus-hide.c:564
#: ../src/nautilus-hide.c:563
msgid ""
"Could not unhide the selected files, error attempting to group them "
"according to their parent directories"
msgstr ""
"Impossibile rendere visibili i file selezionati, errore nel tentativo di "
"raggrupparli in base alla loro directory di appartenenza"

#: ../src/nautilus-hide.c:605
#: ../src/nautilus-hide.c:604
msgid ""
"Could not unhide the selected files, error attempting to edit the database"
msgstr ""
"Impossibile rendere visibili i file selezionati, errore nel tentativo di "
"modificare il database"

#: ../src/nautilus-hide.c:835
msgid "Hide"
msgstr "Nascondi"
msgid "_Hide file"
msgid_plural "_Hide files"
msgstr[0] "_Nascondi"
msgstr[1] "_Nascondi i file"

#: ../src/nautilus-hide.c:836
msgid "Hide the selected files"
msgstr "Nascondi i file selezionati"
msgid "Hide the selected file"
msgid_plural "Hide the selected files"
msgstr[0] "Nascondi il file selezionato"
msgstr[1] "Nascondi i file selezionati"

#: ../src/nautilus-hide.c:863
msgid "Unhide"
msgstr "Ripristina visibilità"
msgid "_Unhide file"
msgid_plural "_Unhide files"
msgstr[0] "Ripristina _visibilità"
msgstr[1] "Ripristina _visibilità dei file"

#: ../src/nautilus-hide.c:864
msgid "Unhide the selected files"
msgstr "Rendi visibili i file selezionati"
msgid_plural "Unhide the selected files"
msgstr[0] "Rendi visibile il file selezionato"
msgstr[1] "Rendi visibili i file selezionati"
66 changes: 33 additions & 33 deletions src/nautilus-hide.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

/*\
|*|
|*| nautilus-hide.c
|*| nautilus-hide.c
|*|
|*| Copyright (C) 2021 <madmurphy333@gmail.com>
|*| Copyright (C) 2021 <madmurphy333@gmail.com>
|*|
|*| nautilus-hide is free software: you can redistribute it and/or modify it
|*| under the terms of the GNU General Public License as published by the Free
|*| Software Foundation, either version 3 of the License, or (at your option)
|*| nautilus-hide is free software: you can redistribute it and/or modify it
|*| under the terms of the GNU General Public License as published by the Free
|*| Software Foundation, either version 3 of the License, or (at your option)
|*| any later version.
|*|
|*| nautilus-hide is distributed in the hope that it will be useful, but
|*| WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|*| nautilus-hide is distributed in the hope that it will be useful, but
|*| WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|*| or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|*| more details.
|*|
|*| You should have received a copy of the GNU General Public License along
|*| with this program. If not, see <http://www.gnu.org/licenses/>.
|*| You should have received a copy of the GNU General Public License along
|*| with this program. If not, see <http://www.gnu.org/licenses/>.
|*|
\*/

Expand All @@ -35,9 +35,14 @@
#include <nautilus-extension.h>

#ifdef ENABLE_NLS
#include <libintl.h>
#include <glib/gi18n-lib.h>
#define __(STRING_S, STRING_PL, NUM) ((char *) \
dngettext(GETTEXT_PACKAGE, STRING_S, STRING_PL, NUM))
#else
#define _(STRING) STRING
#define _(STRING) ((char *) (STRING))
#define g_dngettext(DOMAIN, STRING1, STRING2, NUM) \
((NUM) > 1 ? (char *) (STRING2) : (char *) (STRING1))
#endif


Expand Down Expand Up @@ -171,7 +176,7 @@ static ssofwcp * ssofwcp_new_with_dir (
fprintf(
stderr,
"Nautilus Hide: %s\n",
_("Database of hidden files is not seekable")
_("Could not calculate the size of the database of hidden files")
);
close_hdb_file(hdb_file, new_ssofwcp->hdb_path);
return new_ssofwcp;
Expand Down Expand Up @@ -306,30 +311,24 @@ static GList * ordered_file_selection_new (

}

if (ordered_selection) {
for (d_iter = ordered_selection; d_iter; d_iter = d_iter->next) {

/* The ordered selection has already been partially populated */
#define subselection ((ssofwcp *) d_iter->data)

for (d_iter = ordered_selection; d_iter; d_iter = d_iter->next) {
if (!strcmp(subselection->directory, dpath)) {

#define subselection ((ssofwcp *) d_iter->data)
/* The parent directory of this file had already been indicized */

if (!strcmp(subselection->directory, dpath)) {

/* The parent directory of this file had already been indicized */

subselection->selection = g_list_prepend(
subselection->selection,
s_iter->data
);
goto free_and_continue;

}

#undef subselection
subselection->selection = g_list_prepend(
subselection->selection,
s_iter->data
);
goto free_and_continue;

}

#undef subselection

}

/* The parent directory of this file has not been indicized yet */
Expand Down Expand Up @@ -722,6 +721,7 @@ static GList * nautilus_hide_get_file_items (

}

const unsigned int sel_len = g_list_length(file_selection);
bool b_show_hide = false;
bool b_show_unhide = false;
size_t idx;
Expand Down Expand Up @@ -832,8 +832,8 @@ static GList * nautilus_hide_get_file_items (

NautilusMenuItem * const menu_item_hide = nautilus_menu_item_new(
"NautilusHide::hide",
_("Hide"),
_("Hide the selected files"),
g_dngettext(GETTEXT_PACKAGE, "_Hide file", "_Hide files", sel_len),
g_dngettext(GETTEXT_PACKAGE, "Hide the selected file", "Hide the selected files", sel_len),
NULL /* icon name or `NULL` */
);

Expand All @@ -860,8 +860,8 @@ static GList * nautilus_hide_get_file_items (

NautilusMenuItem * const menu_item_unhide = nautilus_menu_item_new(
"NautilusHide::unhide",
_("Unhide"),
_("Unhide the selected files"),
g_dngettext(GETTEXT_PACKAGE, "_Unhide file", "_Unhide files", sel_len),
g_dngettext(GETTEXT_PACKAGE, "Unhide the selected files", "Unhide the selected files", sel_len),
NULL /* icon name or `NULL` */
);

Expand Down Expand Up @@ -962,7 +962,7 @@ void nautilus_module_list_types (const GType ** types, int * num_types) {
}


/* NOTE: `ssofwcp` = Sub-Selection Of Files With Common Parent */
/* NOTE: `ssofwcp` ==> Sub-Selection Of Files With Common Parent */


/* EOF */
Expand Down

0 comments on commit 08ff6be

Please sign in to comment.