mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Updating files
This commit is contained in:
parent
8d68d7cf64
commit
c387a5a76a
@ -4,7 +4,7 @@ Etip documentation
|
|||||||
Etip is 'Tip of the Day' program which will show tips about EDE usage.
|
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.
|
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
|
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
|
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
|
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
|
(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
|
*.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
|
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.
|
for the details), and must be updated each time when a source file with tips is updated.
|
||||||
|
|
||||||
[NOTE]
|
[NOTE]
|
||||||
Both files must exists so etip can read the content.
|
Both files must exists so ede-tip can read the content.
|
||||||
|
|
||||||
Example
|
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
|
Please let end line in each tip contains *%* character. With this we retain a small
|
||||||
compatibility with fortune
|
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:
|
You will see output like this:
|
||||||
@ -62,22 +62,22 @@ Longest string: 46 bytes
|
|||||||
Shortest string: 17 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
|
it shows that he created *demo.dat* file. If you want to suppress these outputs, just
|
||||||
use '-s' flag, like:
|
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
|
'ede-tip-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
|
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). 'etip-compiler' have some more options, and for the details see below.
|
to find .dat file). 'ede-tip-compiler' have some more options, and for the details see below.
|
||||||
|
|
||||||
Configuration
|
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:
|
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.
|
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
|
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]
|
[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.
|
incorrect data.
|
||||||
|
|
||||||
etip-compiler options
|
ede-tip-compiler options
|
||||||
---------------------
|
------------------------
|
||||||
|
|
||||||
-s::
|
-s::
|
||||||
Suppress output details
|
Suppress output details
|
||||||
|
@ -176,7 +176,7 @@ STR *Firstch; /* first chars of each string */
|
|||||||
|
|
||||||
void usage(void)
|
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");
|
fprintf(stderr, "Creates .dat file from fortune source file\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: etip.cpp 1664 2006-06-14 00:21:44Z karijes $
|
* $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).
|
* Part of Equinox Desktop Environment (EDE).
|
||||||
* Copyright (c) 2008 EDE Authors.
|
* Copyright (c) 2008 EDE Authors.
|
||||||
*
|
*
|
||||||
@ -10,6 +10,10 @@
|
|||||||
* See COPYING for the details.
|
* See COPYING for the details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <FL/Fl.H>
|
#include <FL/Fl.H>
|
||||||
#include <FL/Fl_Window.H>
|
#include <FL/Fl_Window.H>
|
||||||
#include <FL/Fl_Check_Button.H>
|
#include <FL/Fl_Check_Button.H>
|
||||||
@ -27,10 +31,6 @@
|
|||||||
#include <edelib/MessageBox.h>
|
#include <edelib/MessageBox.h>
|
||||||
#include <edelib/Directory.h>
|
#include <edelib/Directory.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include "icons/hint.xpm"
|
#include "icons/hint.xpm"
|
||||||
#include "Fortune.h"
|
#include "Fortune.h"
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ const char* random_fortune(void) {
|
|||||||
|
|
||||||
FortuneFile* load_fortune_file(void) {
|
FortuneFile* load_fortune_file(void) {
|
||||||
edelib::Config conf;
|
edelib::Config conf;
|
||||||
if(!conf.load("etip.conf"))
|
if(!conf.load("ede-tip.conf"))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
char path[1024];
|
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
|
* Autostart resides in ~/.config/autostart and directory does not
|
||||||
* exists, it will be created (only /autostart/, not full path).
|
* 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))
|
if(!create_directory_if_needed(path))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// now see if etip.desktop exists, and update it if do
|
// now see if ede-tip.desktop exists, and update it if do
|
||||||
path += "/etip.desktop";
|
path += "/ede-tip.desktop";
|
||||||
edelib::DesktopFile conf;
|
edelib::DesktopFile conf;
|
||||||
|
|
||||||
bool show_at_startup = check_button->value();
|
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
|
// always write these values so someone does not try to play with us
|
||||||
conf.set_hidden(show_at_startup);
|
conf.set_hidden(show_at_startup);
|
||||||
conf.set_name("Etip");
|
conf.set_name("EDE Tips");
|
||||||
conf.set_exec("etip");
|
conf.set_exec("ede-tip");
|
||||||
|
|
||||||
if(conf.save(path.c_str()) == false)
|
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());
|
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) {
|
void read_autostart_stuff(void) {
|
||||||
edelib::String path = edelib::user_config_dir();
|
edelib::String path = edelib::user_config_dir();
|
||||||
path += "/autostart/etip.desktop";
|
path += "/autostart/ede-tip.desktop";
|
||||||
|
|
||||||
edelib::DesktopFile conf;
|
edelib::DesktopFile conf;
|
||||||
if(!conf.load(path.c_str())) {
|
if(!conf.load(path.c_str())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user