Updating files

This commit is contained in:
Sanel Zukan 2008-09-22 13:58:31 +00:00
parent 8d68d7cf64
commit c387a5a76a
3 changed files with 32 additions and 32 deletions

View File

@ -4,7 +4,7 @@ Etip documentation
Etip is 'Tip of the Day' program which will show tips about EDE usage.
It is also capable to show fortune-like tips, reading fortune files.
image:images/etip.jpg[Etip]
image:images/ede-tip.jpg[ede-tip]
Details
-------
@ -21,15 +21,15 @@ File with tips is plain text file in human readable form and is main source wher
you should add, changed and delete tips. Each tip is separated with *%* character
at the beginning of the line, and (as advice), those should be nicely formatted
(proposal is to use around 66 characters per line so they can nicely fit inside
etip window).
ede-tip window).
*.dat* file is binary file and does not contain any tip strings; it have only
offsets to those in plain text file to allow fast random access to any of
specific tip string. *.dat* files are created with 'etip-compiler' command (see bellow
specific tip string. *.dat* files are created with 'ede-tip-compiler' command (see bellow
for the details), and must be updated each time when a source file with tips is updated.
[NOTE]
Both files must exists so etip can read the content.
Both files must exists so ede-tip can read the content.
Example
-------
@ -49,9 +49,9 @@ This is tip three. Progress, man, progress :)
Please let end line in each tip contains *%* character. With this we retain a small
compatibility with fortune
Now save this file in 'demo' and invoke 'etip-compiler' on it. Doing that is like:
Now save this file in 'demo' and invoke 'ede-tip-compiler' on it. Doing that is like:
--------------
etip-compiler demo
ede-tip-compiler demo
--------------
You will see output like this:
@ -62,22 +62,22 @@ Longest string: 46 bytes
Shortest string: 17 bytes
--------------
Output from 'etip-compiler' shows some informations you probably don't need and, most important,
Output from 'ede-tip-compiler' shows some informations you probably don't need and, most important,
it shows that he created *demo.dat* file. If you want to suppress these outputs, just
use '-s' flag, like:
--------------
etip-compiler -s demo
ede-tip-compiler -s demo
--------------
'etip-compiler' will, by default, use input name and append *.dat* suffix; the best way is to keep
it like that since etip expects names of tip file and .dat file are the same (or will not be able
to find .dat file). 'etip-compiler' have some more options, and for the details see below.
'ede-tip-compiler' will, by default, use input name and append *.dat* suffix; the best way is to keep
it like that since ede-tip expects names of tip file and .dat file are the same (or will not be able
to find .dat file). 'ede-tip-compiler' have some more options, and for the details see below.
Configuration
-------------
Etip does not have command options and the only file it reads (beside tip files) is 'etip.conf'.
Etip does not have command options and the only file it reads (beside tip files) is 'ede-tip.conf'.
This file should contain path to the tip file name. Here is the sample:
--------------
@ -89,19 +89,19 @@ This file should contain path to the tip file name. Here is the sample:
Make sure in the same directory exists *.dat* file.
etip-compiler details
---------------------
ede-tip-compiler details
------------------------
As you could see from the previous text, 'etip-compiler' is simple command line tool that will
As you could see from the previous text, 'ede-tip-compiler' is simple command line tool that will
create .dat files. It will correctly scan tip file, calculate offsets (and something more) and spit
that in the file that etip understands.
that in the file that ede-tip understands.
[NOTE]
You must invoke etip-compiler each time you change file with the tips or .dat companion will contains
You must invoke ede-tip-compiler each time you change file with the tips or .dat companion will contains
incorrect data.
etip-compiler options
---------------------
ede-tip-compiler options
------------------------
-s::
Suppress output details

View File

@ -176,7 +176,7 @@ STR *Firstch; /* first chars of each string */
void usage(void)
{
fprintf(stderr, "etip-compiler [-iorsx] [-c char] sourcefile [datafile]\n");
fprintf(stderr, "ede-tip-compiler [-iorsx] [-c char] sourcefile [datafile]\n");
fprintf(stderr, "Creates .dat file from fortune source file\n");
exit(1);
}

View File

@ -1,7 +1,7 @@
/*
* $Id: etip.cpp 1664 2006-06-14 00:21:44Z karijes $
*
* Etip, show some tips!
* ede-tip, show some tips!
* Part of Equinox Desktop Environment (EDE).
* Copyright (c) 2008 EDE Authors.
*
@ -10,6 +10,10 @@
* See COPYING for the details.
*/
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Check_Button.H>
@ -27,10 +31,6 @@
#include <edelib/MessageBox.h>
#include <edelib/Directory.h>
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include "icons/hint.xpm"
#include "Fortune.h"
@ -67,7 +67,7 @@ const char* random_fortune(void) {
FortuneFile* load_fortune_file(void) {
edelib::Config conf;
if(!conf.load("etip.conf"))
if(!conf.load("ede-tip.conf"))
return NULL;
char path[1024];
@ -97,7 +97,7 @@ bool create_directory_if_needed(const edelib::String& path) {
}
/*
* Save/create etip.desktop inside autostart directory.
* Save/create ede-tip.desktop inside autostart directory.
* Autostart resides in ~/.config/autostart and directory does not
* exists, it will be created (only /autostart/, not full path).
*
@ -119,8 +119,8 @@ void write_autostart_stuff(void) {
if(!create_directory_if_needed(path))
return;
// now see if etip.desktop exists, and update it if do
path += "/etip.desktop";
// now see if ede-tip.desktop exists, and update it if do
path += "/ede-tip.desktop";
edelib::DesktopFile conf;
bool show_at_startup = check_button->value();
@ -130,8 +130,8 @@ void write_autostart_stuff(void) {
// always write these values so someone does not try to play with us
conf.set_hidden(show_at_startup);
conf.set_name("Etip");
conf.set_exec("etip");
conf.set_name("EDE Tips");
conf.set_exec("ede-tip");
if(conf.save(path.c_str()) == false)
edelib::alert(_("I'm not able to save %s. Probably I don't have enough permissions to do that ?"), path.c_str());
@ -139,7 +139,7 @@ void write_autostart_stuff(void) {
void read_autostart_stuff(void) {
edelib::String path = edelib::user_config_dir();
path += "/autostart/etip.desktop";
path += "/autostart/ede-tip.desktop";
edelib::DesktopFile conf;
if(!conf.load(path.c_str())) {