2
* This file is a part of the Cairo-Dock project
4
* Copyright : (C) see the 'copyright' file.
5
* E-mail : see the 'copyright' file.
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 3
10
* of the License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
#define __USE_XOPEN_EXTENDED
27
#include <glib/gstdio.h>
28
#include <glib/gi18n.h>
30
#include "../config.h"
31
#include "cairo-dock-config.h"
32
#include "cairo-dock-keyfile-utilities.h"
33
#include "cairo-dock-dock-manager.h"
34
#include "cairo-dock-modules.h"
35
#include "cairo-dock-backends-manager.h"
36
#include "cairo-dock-dialog-manager.h"
37
#include "cairo-dock-gui-manager.h"
38
#include "cairo-dock-task.h"
39
#include "cairo-dock-log.h"
40
#include "cairo-dock-packages.h"
41
#include "cairo-dock-themes-manager.h"
43
#define CAIRO_DOCK_MODIFIED_THEME_FILE ".cairo-dock-need-save"
44
#define CAIRO_DOCK_DISTANT_THEMES_DIR "themes2.2"
46
gchar *g_cCairoDockDataDir = NULL; // le repertoire racine contenant tout.
47
gchar *g_cCurrentThemePath = NULL; // le chemin vers le repertoire du theme courant.
48
gchar *g_cExtrasDirPath = NULL; // le chemin vers le repertoire des extra.
49
gchar *g_cThemesDirPath = NULL; // le chemin vers le repertoire des themes.
50
gchar *g_cCurrentLaunchersPath = NULL; // le chemin vers le repertoire des lanceurs du theme courant.
51
gchar *g_cCurrentIconsPath = NULL; // le chemin vers le repertoire des icones du theme courant.
52
gchar *g_cCurrentPlugInsPath = NULL; // le chemin vers le repertoire des plug-ins du theme courant.
53
gchar *g_cConfFile = NULL; // le chemin du fichier de conf.
54
int g_iMajorVersion, g_iMinorVersion, g_iMicroVersion; // version de la lib.
56
extern CairoDock *g_pMainDock;
58
#define CAIRO_DOCK_LOCAL_EXTRAS_DIR "extras"
59
#define CAIRO_DOCK_LAUNCHERS_DIR "launchers"
60
#define CAIRO_DOCK_PLUG_INS_DIR "plug-ins"
61
#define CAIRO_DOCK_LOCAL_ICONS_DIR "icons"
63
void cairo_dock_mark_current_theme_as_modified (gboolean bModified)
65
gchar *cModifiedFile = g_strdup_printf ("%s/%s", g_cCairoDockDataDir, CAIRO_DOCK_MODIFIED_THEME_FILE);
67
g_file_set_contents (cModifiedFile,
68
(bModified ? "1" : "0"),
72
g_free (cModifiedFile);
75
gboolean cairo_dock_current_theme_need_save (void)
77
gchar *cModifiedFile = g_strdup_printf ("%s/%s", g_cCairoDockDataDir, CAIRO_DOCK_MODIFIED_THEME_FILE);
79
gchar *cContent = NULL;
80
g_file_get_contents (cModifiedFile,
84
g_free (cModifiedFile);
87
bNeedSave = (*cContent == '1');
95
gboolean cairo_dock_export_current_theme (const gchar *cNewThemeName, gboolean bSaveBehavior, gboolean bSaveLaunchers)
97
g_return_val_if_fail (cNewThemeName != NULL, FALSE);
99
cairo_dock_extract_package_type_from_name (cNewThemeName);
101
cd_message ("on sauvegarde dans %s", cNewThemeName);
102
GString *sCommand = g_string_new ("");
103
gboolean bThemeSaved = FALSE;
105
gchar *cNewThemePath = g_strdup_printf ("%s/%s", g_cThemesDirPath, cNewThemeName);
106
if (g_file_test (cNewThemePath, G_FILE_TEST_EXISTS)) // on ecrase un theme existant.
108
cd_debug (" le theme existant sera mis a jour");
109
gchar *cQuestion = g_strdup_printf (_("Are you sure you want to overwrite theme %s?"), cNewThemeName);
110
int answer = cairo_dock_ask_general_question_and_wait (cQuestion);
112
if (answer == GTK_RESPONSE_YES)
114
//\___________________ On traite le fichier de conf.
115
gchar *cNewConfFilePath = g_strdup_printf ("%s/%s", cNewThemePath, CAIRO_DOCK_CONF_FILE);
118
g_string_printf (sCommand, "/bin/cp \"%s\" \"%s\"", g_cConfFile, cNewConfFilePath);
119
cd_message ("%s", sCommand->str);
120
r = system (sCommand->str);
124
cairo_dock_replace_keys_by_identifier (cNewConfFilePath, g_cConfFile, '+');
126
g_free (cNewConfFilePath);
128
//\___________________ On traite les lanceurs.
131
g_string_printf (sCommand, "rm -f \"%s/%s\"/*", cNewThemePath, CAIRO_DOCK_LAUNCHERS_DIR);
132
cd_message ("%s", sCommand->str);
133
r = system (sCommand->str);
135
g_string_printf (sCommand, "cp \"%s\"/* \"%s/%s\"", g_cCurrentLaunchersPath, cNewThemePath, CAIRO_DOCK_LAUNCHERS_DIR);
136
cd_message ("%s", sCommand->str);
137
r = system (sCommand->str);
140
//\___________________ On traite tous le reste.
141
/// TODO : traiter les .conf des applets comme celui du dock...
142
g_string_printf (sCommand, "find \"%s\" -mindepth 1 -maxdepth 1 ! -name '*.conf' ! -name \"%s\" -exec /bin/cp -r '{}' \"%s\" \\;", g_cCurrentThemePath, CAIRO_DOCK_LAUNCHERS_DIR, cNewThemePath);
143
cd_message ("%s", sCommand->str);
144
r = system (sCommand->str);
149
else // sinon on sauvegarde le repertoire courant tout simplement.
151
cd_debug (" creation du nouveau theme (%s)", cNewThemePath);
153
if (g_mkdir (cNewThemePath, 7*8*8+7*8+5) == 0)
155
g_string_printf (sCommand, "cp -r \"%s\"/* \"%s\"", g_cCurrentThemePath, cNewThemePath);
156
cd_message ("%s", sCommand->str);
157
r = system (sCommand->str);
162
cd_warning ("couldn't create %s", cNewThemePath);
165
g_free (cNewThemePath);
168
cairo_dock_mark_current_theme_as_modified (FALSE);
171
g_string_free (sCommand, TRUE);
176
gboolean cairo_dock_package_current_theme (const gchar *cThemeName)
178
g_return_val_if_fail (cThemeName != NULL, FALSE);
180
cairo_dock_extract_package_type_from_name (cThemeName);
182
cd_message ("building theme package ...");
184
if (g_file_test (CAIRO_DOCK_SHARE_DATA_DIR"/../../bin/cairo-dock-package-theme", G_FILE_TEST_EXISTS))
187
const gchar *cTerm = g_getenv ("TERM");
188
if (cTerm == NULL || *cTerm == '\0')
189
cCommand = g_strdup_printf ("xterm -e %s \"%s\"", "cairo-dock-package-theme", cThemeName);
191
cCommand = g_strdup_printf ("$TERM -e '%s \"%s\"'", "cairo-dock-package-theme", cThemeName);
192
r = system (cCommand);
198
cd_warning ("the package builder script was not found !");
202
gchar *cairo_dock_depackage_theme (const gchar *cPackagePath)
204
gchar *cNewThemePath = NULL;
205
if (*cPackagePath == '/' || strncmp (cPackagePath, "file://", 7) == 0) // paquet en local.
207
cd_debug (" paquet local\n");
208
gchar *cFilePath = (*cPackagePath == '/' ? g_strdup (cPackagePath) : g_filename_from_uri (cPackagePath, NULL, NULL));
209
cNewThemePath = cairo_dock_uncompress_file (cFilePath, g_cThemesDirPath, NULL);
212
else // paquet distant.
214
cd_debug (" paquet distant\n");
215
gchar *str = strrchr (cPackagePath, '/');
219
cNewThemePath = cairo_dock_download_file (cPackagePath, "", str+1, g_cThemesDirPath, NULL);
220
if (cNewThemePath == NULL)
222
cairo_dock_show_temporary_dialog_with_icon_printf (_("Could not access remote file %s/%s. Maybe the server is down.\nPlease retry later or contact us at glx-dock.org."), NULL, NULL, 0, NULL, cPackagePath, str+1);
226
return cNewThemePath;
229
gboolean cairo_dock_delete_themes (gchar **cThemesList)
231
g_return_val_if_fail (cThemesList != NULL && cThemesList[0] != NULL, FALSE);
233
GString *sCommand = g_string_new ("");
234
gboolean bThemeDeleted = FALSE;
236
if (cThemesList[1] == NULL)
237
g_string_printf (sCommand, _("Are you sure you want to delete theme %s?"), cThemesList[0]);
239
g_string_printf (sCommand, _("Are you sure you want to delete these themes?"));
240
int answer = cairo_dock_ask_general_question_and_wait (sCommand->str);
241
if (answer == GTK_RESPONSE_YES)
245
for (i = 0; cThemesList[i] != NULL; i ++)
247
cThemeName = cThemesList[i];
248
if (*cThemeName == '\0')
250
cairo_dock_extract_package_type_from_name (cThemeName);
252
bThemeDeleted = TRUE;
253
g_string_printf (sCommand, "rm -rf \"%s/%s/%s\"", g_cCairoDockDataDir, CAIRO_DOCK_THEMES_DIR, cThemeName);
254
r = system (sCommand->str); // g_rmdir n'efface qu'un repertoire vide.
258
g_string_free (sCommand, TRUE);
259
return bThemeDeleted;
262
static gboolean _find_module_from_user_data_dir (gchar *cModuleName, CairoDockModule *pModule, const gchar *cUserDataDirName)
264
if (pModule->pVisitCard->cUserDataDir && strcmp (cUserDataDirName, pModule->pVisitCard->cUserDataDir) == 0)
268
gboolean cairo_dock_import_theme (const gchar *cThemeName, gboolean bLoadBehavior, gboolean bLoadLaunchers)
270
//\___________________ On obtient le chemin du nouveau theme (telecharge ou decompresse si necessaire).
271
gchar *cNewThemeName = g_strdup (cThemeName);
272
gchar *cNewThemePath = NULL;
274
int length = strlen (cNewThemeName);
275
if (cNewThemeName[length-1] == '\n')
276
cNewThemeName[--length] = '\0'; // on vire le retour chariot final.
277
if (cNewThemeName[length-1] == '\r')
278
cNewThemeName[--length] = '\0';
279
cd_debug ("cNewThemeName : '%s'", cNewThemeName);
281
if (g_str_has_suffix (cNewThemeName, ".tar.gz") || g_str_has_suffix (cNewThemeName, ".tar.bz2") || g_str_has_suffix (cNewThemeName, ".tgz")) // c'est un paquet.
283
cd_debug ("c'est un paquet");
284
cNewThemePath = cairo_dock_depackage_theme (cNewThemeName);
286
g_return_val_if_fail (cNewThemePath != NULL, FALSE);
287
gchar *tmp = cNewThemeName;
288
cNewThemeName = g_path_get_basename (cNewThemePath);
291
else // c'est un theme officiel.
293
cd_debug ("c'est un theme officiel");
294
cNewThemePath = cairo_dock_get_package_path (cNewThemeName, CAIRO_DOCK_SHARE_THEMES_DIR, g_cThemesDirPath, CAIRO_DOCK_DISTANT_THEMES_DIR, CAIRO_DOCK_ANY_PACKAGE);
296
g_return_val_if_fail (cNewThemePath != NULL && g_file_test (cNewThemePath, G_FILE_TEST_EXISTS), FALSE);
297
//g_print ("cNewThemePath : %s ; cNewThemeName : %s\n", cNewThemePath, cNewThemeName);
299
//\___________________ On charge les parametres de comportement.
300
GString *sCommand = g_string_new ("");
302
cd_message ("Applying changes ...");
303
if (g_pMainDock == NULL || bLoadBehavior)
305
g_string_printf (sCommand, "/bin/cp \"%s\"/%s \"%s\"", cNewThemePath, CAIRO_DOCK_CONF_FILE, g_cCurrentThemePath);
306
cd_message ("%s", sCommand->str);
307
r = system (sCommand->str);
311
gchar *cNewConfFilePath = g_strdup_printf ("%s/%s", cNewThemePath, CAIRO_DOCK_CONF_FILE);
312
cairo_dock_replace_keys_by_identifier (g_cConfFile, cNewConfFilePath, '+');
313
g_free (cNewConfFilePath);
316
//\___________________ On charge les .conf des autres docks racines.
317
g_string_printf (sCommand, "find \"%s\" -mindepth 1 -maxdepth 1 -name '*.conf' ! -name '%s' -exec /bin/cp '{}' \"%s\" \\;", cNewThemePath, CAIRO_DOCK_CONF_FILE, g_cCurrentThemePath);
318
cd_debug ("%s", sCommand->str);
319
r = system (sCommand->str);
321
//\___________________ On charge les lanceurs.
324
g_string_printf (sCommand, "rm -f \"%s\"/*", g_cCurrentIconsPath);
325
cd_debug ("%s", sCommand->str);
326
r = system (sCommand->str);
327
g_string_printf (sCommand, "rm -f \"%s\"/.*", g_cCurrentIconsPath);
328
cd_debug ("%s", sCommand->str);
329
r = system (sCommand->str);
332
//\___________________ On charge les icones.
333
gchar *cNewLocalIconsPath = g_strdup_printf ("%s/%s", cNewThemePath, CAIRO_DOCK_LOCAL_ICONS_DIR);
334
if (! g_file_test (cNewLocalIconsPath, G_FILE_TEST_IS_DIR)) // c'est un ancien theme, on deplace les icones vers le repertoire 'icons'.
336
g_string_printf (sCommand, "find \"%s/%s\" -mindepth 1 ! -name '*.desktop' -exec /bin/cp '{}' '%s' \\;", cNewThemePath, CAIRO_DOCK_LAUNCHERS_DIR, g_cCurrentIconsPath);
340
g_string_printf (sCommand, "for f in \"%s\"/* ; do rm -f \"%s/`basename \"${f%%.*}\"`\"*; done;", cNewLocalIconsPath, g_cCurrentIconsPath); // on efface les doublons car sinon on pourrait avoir x.png et x.svg ensemble et le dock ne saurait pas lequel choisir.
341
cd_debug ("%s", sCommand->str);
342
r = system (sCommand->str);
344
g_string_printf (sCommand, "cp \"%s\"/* \"%s\"", cNewLocalIconsPath, g_cCurrentIconsPath);
346
cd_debug ("%s", sCommand->str);
347
r = system (sCommand->str);
348
g_free (cNewLocalIconsPath);
350
//\___________________ On charge les extras.
351
g_string_printf (sCommand, "%s/%s", cNewThemePath, CAIRO_DOCK_LOCAL_EXTRAS_DIR);
352
if (g_file_test (sCommand->str, G_FILE_TEST_IS_DIR))
354
g_string_printf (sCommand, "cp -r \"%s/%s\"/* \"%s\"", cNewThemePath, CAIRO_DOCK_LOCAL_EXTRAS_DIR, g_cExtrasDirPath);
355
cd_debug ("%s", sCommand->str);
356
r = system (sCommand->str);
359
//\___________________ On charge les lanceurs si necessaire, en effacant ceux existants.
360
if (! g_file_test (g_cCurrentLaunchersPath, G_FILE_TEST_EXISTS))
362
gchar *command = g_strdup_printf ("mkdir -p \"%s\"", g_cCurrentLaunchersPath);
363
r = system (command);
366
if (g_pMainDock == NULL || bLoadLaunchers)
368
g_string_printf (sCommand, "rm -f \"%s\"/*.desktop", g_cCurrentLaunchersPath);
369
cd_debug ("%s", sCommand->str);
370
r = system (sCommand->str);
372
g_string_printf (sCommand, "cp \"%s/%s\"/*.desktop \"%s\"", cNewThemePath, CAIRO_DOCK_LAUNCHERS_DIR, g_cCurrentLaunchersPath);
373
cd_debug ("%s", sCommand->str);
374
r = system (sCommand->str);
377
//\___________________ On remplace tous les autres fichiers par les nouveaux.
378
g_string_printf (sCommand, "find \"%s\" -mindepth 1 -maxdepth 1 ! -name '*.conf' -type f -exec rm -f '{}' \\;", g_cCurrentThemePath); // efface tous les fichiers du theme mais sans toucher aux lanceurs et aux plug-ins.
379
cd_debug ("%s", sCommand->str);
380
r = system (sCommand->str);
382
if (g_pMainDock == NULL || bLoadBehavior)
384
g_string_printf (sCommand, "find \"%s\"/* -prune ! -name '*.conf' ! -name %s -exec /bin/cp -r '{}' \"%s\" \\;", cNewThemePath, CAIRO_DOCK_LAUNCHERS_DIR, g_cCurrentThemePath); // copie tous les fichiers du nouveau theme sauf les lanceurs et le .conf, dans le repertoire du theme courant. Ecrase les fichiers de memes noms.
385
cd_debug ("%s", sCommand->str);
386
r = system (sCommand->str);
390
// on copie tous les fichiers du nouveau theme sauf les lanceurs et les .conf (dock et plug-ins).
391
g_string_printf (sCommand, "find \"%s\" -mindepth 1 ! -name '*.conf' ! -path '%s/%s*' ! -type d -exec cp -p {} \"%s\" \\;", cNewThemePath, cNewThemePath, CAIRO_DOCK_LAUNCHERS_DIR, g_cCurrentThemePath);
392
cd_debug ("%s", sCommand->str);
393
r = system (sCommand->str);
395
// on parcours les .conf des plug-ins, on les met a jour, et on fusionne avec le theme courant.
396
gchar *cNewPlugInsDir = g_strdup_printf ("%s/%s", cNewThemePath, CAIRO_DOCK_PLUG_INS_DIR); // repertoire des plug-ins du nouveau theme.
397
GDir *dir = g_dir_open (cNewPlugInsDir, 0, NULL); // NULL si ce theme n'a pas de repertoire 'plug-ins'.
398
const gchar* cModuleDirName;
399
gchar *cConfFilePath, *cNewConfFilePath, *cUserDataDirPath, *cConfFileName;
402
cModuleDirName = g_dir_read_name (dir); // nom du repertoire du theme (pas forcement egal au nom du theme)
403
if (cModuleDirName == NULL)
406
// on cree le repertoire du plug-in dans le theme courant.
407
cd_debug (" installing %s's config", cModuleDirName);
408
cUserDataDirPath = g_strdup_printf ("%s/%s", g_cCurrentPlugInsPath, cModuleDirName); // repertoire du plug-in dans le theme courant.
409
if (! g_file_test (cUserDataDirPath, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))
411
cd_debug (" directory %s doesn't exist, it will be created.", cUserDataDirPath);
413
g_string_printf (sCommand, "mkdir -p \"%s\"", cUserDataDirPath);
414
r = system (sCommand->str);
417
// on recupere le nom et le chemin du .conf du plug-in dans le nouveau theme.
418
cConfFileName = g_strdup_printf ("%s.conf", cModuleDirName);
419
cNewConfFilePath = g_strdup_printf ("%s/%s/%s", cNewPlugInsDir, cModuleDirName, cConfFileName);
420
if (! g_file_test (cNewConfFilePath, G_FILE_TEST_EXISTS))
422
g_free (cConfFileName);
423
g_free (cNewConfFilePath);
424
CairoDockModule *pModule = cairo_dock_foreach_module ((GHRFunc) _find_module_from_user_data_dir, (gpointer) cModuleDirName);
425
if (pModule == NULL) // du coup, dans ce cas-la, on ne charge pas des plug-ins non utilises par l'utilisateur.
427
cd_warning ("couldn't find the module owning '%s', this file will be ignored.");
430
cConfFileName = g_strdup (pModule->pVisitCard->cConfFileName);
431
cNewConfFilePath = g_strdup_printf ("%s/%s/%s", cNewPlugInsDir, cModuleDirName, cConfFileName);
433
cConfFilePath = g_strdup_printf ("%s/%s", cUserDataDirPath, cConfFileName); // chemin du .conf dans le theme courant.
435
// on fusionne les 2 .conf.
436
if (! g_file_test (cConfFilePath, G_FILE_TEST_EXISTS))
438
cd_debug (" no conf file %s, we will take the theme's one", cConfFilePath);
439
g_string_printf (sCommand, "cp \"%s\" \"%s\"", cNewConfFilePath, cConfFilePath);
440
r = system (sCommand->str);
444
cairo_dock_replace_keys_by_identifier (cConfFilePath, cNewConfFilePath, '+');
446
g_free (cNewConfFilePath);
447
g_free (cConfFilePath);
448
g_free (cUserDataDirPath);
449
g_free (cConfFileName);
453
g_free (cNewPlugInsDir);
456
// precaution probablement inutile.
457
g_string_printf (sCommand, "chmod -R 777 \"%s\"", g_cCurrentThemePath);
458
r = system (sCommand->str);
460
g_string_free (sCommand, TRUE);
465
static void _import_theme (gpointer *pSharedMemory)
467
pSharedMemory[5] = GINT_TO_POINTER (cairo_dock_import_theme (pSharedMemory[0], GPOINTER_TO_INT (pSharedMemory[1]), GPOINTER_TO_INT (pSharedMemory[2])));
469
static gboolean _finish_import (gpointer *pSharedMemory)
471
if (! pSharedMemory[5])
472
cd_warning ("Couldn't import the theme %s.", pSharedMemory[0]);
474
GFunc pCallback = pSharedMemory[3];
475
pCallback (pSharedMemory[5], pSharedMemory[4]);
478
static void _discard_import (gpointer *pSharedMemory)
480
g_free (pSharedMemory[0]);
481
g_free (pSharedMemory);
483
CairoDockTask *cairo_dock_import_theme_async (const gchar *cThemeName, gboolean bLoadBehavior, gboolean bLoadLaunchers, GFunc pCallback, gpointer data)
485
gpointer *pSharedMemory = g_new0 (gpointer, 6);
486
pSharedMemory[0] = g_strdup (cThemeName);
487
pSharedMemory[1] = GINT_TO_POINTER (bLoadBehavior);
488
pSharedMemory[2] = GINT_TO_POINTER (bLoadLaunchers);
489
pSharedMemory[3] = pCallback;
490
pSharedMemory[4] = data;
491
CairoDockTask *pTask = cairo_dock_new_task_full (0, (CairoDockGetDataAsyncFunc) _import_theme, (CairoDockUpdateSyncFunc) _finish_import, (GFreeFunc) _discard_import, pSharedMemory);
492
cairo_dock_launch_task (pTask);
497
void cairo_dock_load_current_theme (void)
499
cd_message ("%s ()", __func__);
501
//\___________________ On libere toute la memoire allouee par tout le monde (stoppe aussi tous les timeout).
502
cairo_dock_free_all ();
504
//\___________________ On cree le dock principal.
505
CairoDock *pMainDock = cairo_dock_create_dock (CAIRO_DOCK_MAIN_DOCK_NAME, NULL); // on ne lui assigne pas de vues, puisque la vue par defaut des docks principaux sera definie plus tard.
507
//\___________________ On lit son fichier de conf et on charge tout.
508
cairo_dock_load_config (g_cConfFile, pMainDock); // chargera des valeurs par defaut si le fichier de conf fourni est incorrect.
512
#define _check_dir(cDirPath) \
513
if (! g_file_test (cDirPath, G_FILE_TEST_IS_DIR)) {\
514
if (g_mkdir (cDirPath, 7*8*8+7*8+7) != 0) {\
515
cd_warning ("couldn't create directory %s", cDirPath);\
519
void cairo_dock_set_paths (gchar *cRootDataDirPath, gchar *cExtraDirPath, gchar *cThemesDirPath, gchar *cCurrentThemeDirPath, gchar *cThemeServerAdress)
521
//\___________________ On initialise les chemins de l'appli.
522
g_cCairoDockDataDir = cRootDataDirPath; // le repertoire racine contenant tout.
523
_check_dir (g_cCairoDockDataDir);
524
g_cCurrentThemePath = cCurrentThemeDirPath; // le chemin vers le repertoire du theme courant.
525
_check_dir (g_cCurrentThemePath);
526
g_cExtrasDirPath = cExtraDirPath; // le chemin vers le repertoire des extra.
527
_check_dir (g_cExtrasDirPath);
528
g_cThemesDirPath = cThemesDirPath; // le chemin vers le repertoire des themes.
529
_check_dir (g_cThemesDirPath);
531
g_cCurrentLaunchersPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_LAUNCHERS_DIR);
532
_check_dir (g_cCurrentLaunchersPath);
533
g_cCurrentIconsPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_LOCAL_ICONS_DIR);
534
_check_dir (g_cCurrentIconsPath);
535
g_cCurrentPlugInsPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_PLUG_INS_DIR);
536
_check_dir (g_cCurrentPlugInsPath);
537
g_cConfFile = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_CONF_FILE);
539
//\___________________ On initialise le gestionnaire de paquets.
540
cairo_dock_init_package_manager (cThemeServerAdress);
542
//\___________________ On initialise les numeros de version.
543
cairo_dock_get_version_from_string (GLDI_VERSION, &g_iMajorVersion, &g_iMinorVersion, &g_iMicroVersion);