~helene-verhaeghe27/cairo-dock-core/bugfix

« back to all changes in this revision

Viewing changes to src/cairo-dock-menu.c

  • Committer: Fabounet (Fabrice Rey) - http://cairo-dock.org
  • Date: 2009-12-13 03:03:14 UTC
  • Revision ID: fabounet_fabrice_rey_-_httpcairo-dock.org-20091213030314-nt89kt1j5tucgq5y
added a simple config panel (available as an easter egg for the moment) + fixed default font system size

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
#include "cairo-dock-class-manager.h"
53
53
#include "cairo-dock-gui-factory.h"
54
54
#include "cairo-dock-gui-manager.h"
 
55
#include "cairo-dock-gui-simple.h"
55
56
#include "cairo-dock-internal-icons.h"
56
57
#include "cairo-dock-internal-accessibility.h"
57
58
#include "cairo-dock-container.h"
80
81
extern int g_iXScreenWidth[2], g_iXScreenHeight[2];  // change tous les g_iScreen par g_iXScreen le 28/07/2009
81
82
extern gboolean g_bLocked;
82
83
extern gboolean g_bForceCairo;
 
84
extern gboolean g_bEasterEggs;
83
85
 
84
86
#define cairo_dock_icons_are_locked(...) (myAccessibility.bLockIcons || myAccessibility.bLockAll || g_bLocked)
85
87
#define cairo_dock_is_locked(...) (myAccessibility.bLockAll || g_bLocked)
86
88
 
 
89
 
 
90
static gboolean on_apply_config_simple (gpointer data)
 
91
{
 
92
        g_print ("pouet\n");
 
93
}
 
94
 
 
95
static gboolean on_destroy_config_simple (gpointer data)
 
96
{
 
97
        g_print ("pouic\n");
 
98
}
 
99
 
87
100
static void _present_help_from_dialog (int iClickedButton, GtkWidget *pInteractiveWidget, gpointer data, CairoDialog *pDialog)
88
101
{
89
102
        if (iClickedButton == 0 || iClickedButton == -1)  // click OK or press Enter.
97
110
{
98
111
        Icon *icon = data[0];
99
112
        CairoDock *pDock = data[1];
100
 
 
101
 
        GtkWidget *pWindow = cairo_dock_build_main_ihm (g_cConfFile, FALSE);
102
113
        
103
 
        CairoDockModule *pModule = cairo_dock_find_module_from_name ("Help");
104
 
        if (pModule != NULL)
105
 
        {
106
 
                gchar *cHelpHistory = g_strdup_printf ("%s/.help/entered-once", g_cCairoDockDataDir);
107
 
                if (! g_file_test (cHelpHistory, G_FILE_TEST_EXISTS))
 
114
        GtkWidget *pWindow;
 
115
        if (g_bEasterEggs)
 
116
        {
 
117
                cairo_dock_build_simplified_ihm ();
 
118
        }
 
119
        else
 
120
        {
 
121
                pWindow = cairo_dock_build_main_ihm (g_cConfFile, FALSE);
 
122
                CairoDockModule *pModule = cairo_dock_find_module_from_name ("Help");
 
123
                if (pModule != NULL)
108
124
                {
109
 
                        Icon *pIcon = cairo_dock_get_dialogless_icon ();
110
 
                        cairo_dock_show_dialog_full (_("It seems that you've never entered the help module yet.\nIf you have some difficulty to configure the dock, or if you are willing to customize it,\nthe Help module is here for you !\nDo you want to take a look at it now ?"),
111
 
                        pIcon,
112
 
                        CAIRO_CONTAINER (g_pMainDock),
113
 
                        10e3,
114
 
                        CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_ICON,
115
 
                        NULL,
116
 
                        (CairoDockActionOnAnswerFunc) _present_help_from_dialog,
117
 
                        NULL,
118
 
                        NULL);
 
125
                        gchar *cHelpHistory = g_strdup_printf ("%s/.help/entered-once", g_cCairoDockDataDir);
 
126
                        if (! g_file_test (cHelpHistory, G_FILE_TEST_EXISTS))
 
127
                        {
 
128
                                Icon *pIcon = cairo_dock_get_dialogless_icon ();
 
129
                                cairo_dock_show_dialog_full (_("It seems that you've never entered the help module yet.\nIf you have some difficulty to configure the dock, or if you are willing to customize it,\nthe Help module is here for you !\nDo you want to take a look at it now ?"),
 
130
                                        pIcon,
 
131
                                        CAIRO_CONTAINER (g_pMainDock),
 
132
                                        10e3,
 
133
                                        CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_ICON,
 
134
                                        NULL,
 
135
                                        (CairoDockActionOnAnswerFunc) _present_help_from_dialog,
 
136
                                        NULL,
 
137
                                        NULL);
 
138
                        }
119
139
                }
120
140
        }
121
141
}
122
142
 
123
 
static void _cairo_dock_initiate_theme_management (GtkMenuItem *pMenuItem, gpointer *data)
 
143
static void _cairo_dock_initiate_theme_management (GtkMenuItem *pMenuItem, gpointer data)
124
144
{
125
 
        Icon *icon = data[0];
126
 
        CairoDock *pDock = data[1];
127
 
 
128
145
        cairo_dock_manage_themes ();
129
146
}
130
147
 
682
699
 /////////// LES OPERATIONS SUR LES APPLETS ///////////////////////
683
700
//////////////////////////////////////////////////////////////////
684
701
 
 
702
 
685
703
static void _cairo_dock_initiate_config_module (GtkMenuItem *pMenuItem, gpointer *data)
686
704
{
687
705
        Icon *icon = data[0];
690
708
                icon = (CAIRO_DESKLET (pContainer))->pIcon;  // l'icone cliquee du desklet n'est pas forcement celle qui contient le module !
691
709
        g_return_if_fail (CAIRO_DOCK_IS_APPLET (icon));
692
710
        
693
 
        cairo_dock_build_main_ihm (g_cConfFile, FALSE);
694
 
        cairo_dock_present_module_instance_gui (icon->pModuleInstance);
695
 
        /// activer la categorie iCategory ...
696
 
        cairo_dock_toggle_category_button (icon->pModuleInstance->pModule->pVisitCard->iCategory);
 
711
        /*if (g_bEasterEggs)
 
712
        {
 
713
                GtkWidget *pWindow;
 
714
                cairo_dock_build_normal_gui ("/home/fab/CD2/cairo-dock/cairo-dock-core/data/cairo-dock-simplified.con.in",
 
715
                        NULL, "Config Simple",
 
716
                        800, 600,
 
717
                        (CairoDockApplyConfigFunc) on_apply_config_simple,
 
718
                        NULL,
 
719
                        (GFreeFunc) on_destroy_config_simple,
 
720
                        &pWindow);
 
721
        }
 
722
        else*/
 
723
        {
 
724
                cairo_dock_build_main_ihm (g_cConfFile, FALSE);
 
725
                cairo_dock_present_module_instance_gui (icon->pModuleInstance);
 
726
                cairo_dock_toggle_category_button (icon->pModuleInstance->pModule->pVisitCard->iCategory);  // on active la categorie du module.
 
727
        }
697
728
}
698
729
 
699
730
static void _cairo_dock_detach_module (GtkMenuItem *pMenuItem, gpointer *data)