Skip to content

Commit

Permalink
Updated user doc. Ready for release v1.1.0.
Browse files Browse the repository at this point in the history
Removed the MSG_VALUE_CHANGED cases in TestView and ActionView.

Thanks to Pete Goodeve for his bughunting, reporting and fixing and sending
a few patches with the changes he privately made to DarkWyrms original code.
  • Loading branch information
Humdinger committed May 14, 2016
1 parent e530135 commit 5230e97
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 28 deletions.
9 changes: 5 additions & 4 deletions documentation/Rule-Making Reference.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ <h2>
<tr><td class="onelinetop"><span class="key">Add to archive…</span></td><td></td><td>Adds the file to a ZIP archive.</td></tr>
<tr><td class="onelinetop"><span class="key">Move to Trash</span></td><td></td><td>Puts the file into the Trash.</td></tr>
<tr><td class="onelinetop"><span class="key">Delete</span></td><td></td><td>By-passes the Trash and removes the file directly.</td></tr>
<tr><td class="onelinetop"><span class="key">Shell command…</span></td><td></td><td>Run a command just as if you typed it into a Terminal. Substitutions (see below) are performed before the command is executed. This can make the Filer automatically do all sorts of things it couldn't do otherwise. If you move or rename the file this way, you'll need to do everything else with more Terminal command actions or a shell script, because the following actions/rules can't keep track of these changes.</td></tr>
<tr><td class="onelinetop"><span class="key">Shell command…</span></td><td></td><td>Run a command just as if you typed it into a Terminal. Substitutions (see below) are performed before the command is executed. This can make the Filer automatically do all sorts of things it couldn't do otherwise. If you move or rename the file this way, you'll need to do everything else with more shell command actions or a script, because the following actions/rules can't keep track of these changes.</td></tr>
<tr><td class="onelinetop"><span class="key">Continue</span></td><td></td><td>If you've set <span class="menu">Apply only the first matching rule</span> in the rules settings, this "<i>Continue</i>" will override it, and the matching of rules will continue anyway.</td></tr>
</table>

Expand All @@ -164,7 +164,7 @@ <h2>
<tr><td class="onelinetop">%EXTENSION%</td><td></td><td>Just the extension of the file, as in <span class="path">.txt</span> in <span class="path">MyTextFile.txt</span> or <span class="path">.tar.gz</span> in <span class="path">MyArchive.tar.gz</span>.</td></tr>
<tr><td class="onelinetop">%BASENAME%</td><td></td><td>File name without extension, like <span class="path">MyTextFile</span> in <span class="path">MyTextFile.txt</span>.</td></tr>
<tr><td class="onelinetop">%FOLDER%</td><td></td><td>Full location of the folder which contains the file, like <span class="path">/boot/home/Videos</span> for <span class="path">/boot/home/Videos/HaikuRocks.wmv</span>.</td></tr>
<tr><td class="onelinetop">%FULLPATH%</td><td></td><td>Full location of the file, such as <span class="path">/boot/home/config/MyFavoriteSong.mp3</span>. You'll need this for "Terminal Command" actions.</td></tr>
<tr><td class="onelinetop">%FULLPATH%</td><td></td><td>Full location of the file, such as <span class="path">/boot/home/config/MyFavoriteSong.mp3</span>. You'll need this for "Shell command" actions.</td></tr>
<tr><td class="onelinetop">%DATE%</td><td></td><td>Current date in the format MM-DD-YYYY.</td></tr>
<tr><td class="onelinetop">%EURODATE%</td><td></td><td>Current date in the format DD-MM-YYYY.</td></tr>
<tr><td class="onelinetop">%REVERSEDATE%</td><td></td><td>Current date in the format YYYY-MM-DD. This is often useful for file archives or for pictures.</td></tr>
Expand Down Expand Up @@ -209,17 +209,18 @@ <h2>
</table>
</li><li>
<p>Make sure that MP3s have searchable attributes using Axel Dörfler's excellent id3attr program, rename them to "ArtistName - SongName.mp3", and sort them in the /boot/home/music folder by the artist's name. This would make importing an MP3 collection from somewhere else very easy.</p>
<p><b>Note when using shell commands:</b> Take care to 'escape' the variable, here <tt>'%FULLPATH%'</tt>. The inverted commas make sure spaces and other special characters don't spoil the fun.</p>
<table>
<tr><td><i>When:</i></td><td width="10"></td><td><span class="key">Name</span></td><td width="10"></td><td class="onelinetop" width="20"><span class="key">ends with</span></td><td width="10"></td><td>.mp3</td></tr>
<tr><td><i>Do:</i></td><td width="10"></td><td class="onelinetop"><span class="key">Shell command…</span></td><td width="10"></td><td colspan="3">id3attr '%FULLPATH%'</td></tr>
<tr><td></td><td width="10"></td><td><span class="key">Rename to…</span></td><td width="10"></td><td class="onelinetop" colspan="3">%ATTR:Audio:Artist% - %ATTR:Audio:Title%.mp3</td></tr>
<tr><td></td><td width="10"></td><td><span class="key">Move to folder…</span></td><td width="10"></td><td colspan="3">/boot/home/music/%ATTR:Audio:Artist%</td></tr>
</table>
</li><li>
<p>Extract Zip archives to the Desktop and dump them into the Trash for later disposal:</p>
<p>Extract Zip archives to the Desktop and dump them into the Trash for later disposal. Again, mind the 'escaped' variable '%FULLPATH%' in the shell command!</p>
<table>
<tr><td><i>When:</i></td><td width="10"></td><td><span class="key">Name</span></td><td width="10"></td><td class="onelinetop" width="20"><span class="key">ends with</span></td><td width="10"></td><td>.zip</td></tr>
<tr><td><i>Do:</i></td><td width="10"></td><td class="onelinetop"><span class="key">Shell command…</span></td><td width="10"></td><td class="onelinetop" colspan="3">unzip %FULLPATH% -d boot/home/Desktop</td></tr>
<tr><td><i>Do:</i></td><td width="10"></td><td class="onelinetop"><span class="key">Shell command…</span></td><td width="10"></td><td class="onelinetop" colspan="3">unzip '%FULLPATH%' -d boot/home/Desktop</td></tr>
<tr><td></td><td width="10"></td><td colspan="6"><span class="key">Move to Trash</span></td></tr>
</table>
</li>
Expand Down
7 changes: 4 additions & 3 deletions documentation/User Documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ <h2>
<div align="center">
<img src="./images/filer_edit_rule.png" alt="Editing a rule" /></div>
<p>A rule needs three items: A <span class="menu">Description</span>, the condition <span class="menu">When</span> it is applied, and what action to <span class="menu">Do</span>.</p>
<p>Click on the buttons in the "When" and "Do" boxes to explore the various options to construct the right condition and what action will be taken. You can add several conditions which will <i>all</i> have to be met to trigger the action. If you add several actions in the "Do" box, be aware that they are executed in order, from top to bottom.</p>
<p>Click on the buttons in the "When" and "Do" boxes to explore the various options to construct the right condition and what action will be taken. You can add several conditions which will <i>all</i> have to be met to trigger the action. If you add several actions in the "Do" box, be aware that they are executed in order, from top to bottom.<br />
Conveniently, the text boxes support drag&amp;dropping of a file or folder.</p>
<p>Please read the <a href="Rule-Making%20Reference.html">Rule-Making Reference</a> (also available from the <span class="button">Help…</span> button) for more information on the various possibilities.</p>

<h2>
Expand All @@ -186,7 +187,7 @@ <h2>
</div>

<p>The <i>AutoFiler</i> itself is a background application. You can activate the checkbox at the top to automatically <span class="menu">Run AutoFiler on system startup</span>. The button to beside it lets you start/stop it manually.</p>
<p>You can <span class="button">Add…</span>, <span class="button">Edit…</span> and <span class="button">Remove</span> the folders that <i>AutoFiler</i> will monitor for incoming files.</p>
<p>You can <span class="button">Add…</span>, <span class="button">Edit…</span> and <span class="button">Remove</span> the folders that <i>AutoFiler</i> will monitor for incoming files. One or more folders are quickly added via drag&amp;drop.</p>

<h2>
<a href="#"><img src="images/up.png" style="border:none;float:right" alt="index" /></a>
Expand All @@ -204,7 +205,7 @@ <h2>
<li>Initial release.</li>
</ul>

<p><b>1.1.0</b> - <i>13-05-2016</i></p>
<p><b>1.1.0</b> - <i>14-05-2016</i></p>
<ul>
<li>A new GUI that integrates Filer and AutoFiler settings.</li>
<li>Change to the action names, rule settings have to be created anew.</li>
Expand Down
11 changes: 1 addition & 10 deletions sources/ActionView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ActionView::ActionView(const BRect& frame, const char* name, BMessage* action,
rect.right = rect.left + 10;

fValueBox = new AutoTextControl(rect, "valuebox", NULL, NULL,
new BMessage(MSG_VALUE_CHANGED), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
new BMessage(), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
AddChild(fValueBox);
fValueBox->SetDivider(0);

Expand Down Expand Up @@ -157,15 +157,6 @@ ActionView::MessageReceived(BMessage* msg)
SetAction(name.String());
break;
}
case MSG_VALUE_CHANGED:
{ // now done in GetAction, but left here for now
BString str;
if (fAction->FindString("value", &str) == B_OK)
fAction->ReplaceString("value", fValueBox->Text());
else
fAction->AddString("value", fValueBox->Text());
break;
}
default:
{
BView::MessageReceived(msg);
Expand Down
1 change: 0 additions & 1 deletion sources/FilerDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ static const char kSettingsFile[] = "Filer_settings";

#define MSG_ACTION_CHOSEN 'tsch'
#define MSG_SHOW_ACTION_MENU 'sham'
#define MSG_VALUE_CHANGED 'vlch'

#define MSG_TEST_CHOSEN 'tsch'
#define MSG_MODE_CHOSEN 'mdch'
Expand Down
11 changes: 1 addition & 10 deletions sources/TestView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ TestView::TestView(const BRect& frame, const char* name, BMessage* test,
rect.OffsetBy(rect.Width() + 5, 0);
rect.right = rect.left + StringWidth("application/x-vnd.dw-foo") + 5;
fValueBox = new AutoTextControl(rect, "valuebox", NULL, NULL,
new BMessage(MSG_VALUE_CHANGED), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
new BMessage(), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
AddChild(fValueBox);
fValueBox->SetDivider(0);
if (fValueBox->Bounds().Height() < fModeButton->Bounds().Height()) {
Expand Down Expand Up @@ -187,15 +187,6 @@ TestView::MessageReceived(BMessage* msg)
SetMode(mode.String());
break;
}
case MSG_VALUE_CHANGED:
{ // Now done in GetTest, but left for now...
BString str;
if (fTest->FindString("value", &str) == B_OK)
fTest->ReplaceString("value", fValueBox->Text());
else
fTest->AddString("value", fValueBox->Text());
break;
}
case MSG_SHOW_TEST_MENU:
{
BPopUpMenu* menu
Expand Down

0 comments on commit 5230e97

Please sign in to comment.