~ubuntu-branches/ubuntu/oneiric/cairo-dock-plug-ins/oneiric-updates

« back to all changes in this revision

Viewing changes to Disks/src/applet-init.c

  • Committer: Kees Cook
  • Date: 2011-08-11 23:17:39 UTC
  • mfrom: (20.1.1 cairo-dock-plug-ins)
  • Revision ID: kees@outflux.net-20110811231739-cteedan51tmdg77v
Tags: 2.4.0~0beta2-0ubuntu1
releasing version 2.4.0~0beta2-0ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
CD_APPLET_DEFINITION (N_("Disks"),
30
30
        2, 0, 5,
31
31
        CAIRO_DOCK_CATEGORY_APPLET_SYSTEM,
32
 
        N_("<b><i>monitors disks activity</i></b>.\n\n"
33
 
        "Initial release, a lot more need to be done :\n"
34
 
        " - All disks option\n"
35
 
        " - Pop up showing disks info to know what to add in the list\n"
36
 
        " - Free space\n"
37
 
        " - Find actions : left, middle click, drop and wheel\n"
38
 
        " - Fill menu with actions\n"
39
 
        " - Editable labels ?\n"
 
32
        N_("<b><i>Monitors disks speed and space</i></b>.\n"
 
33
        "\n"
 
34
        "This applet show your disks informations. You can activate both options at once, but they're better separated in 2 or more instances of the applet.\n"
 
35
        "Using both in the same applet can cause problems with the speed display not scaling down.\n"
 
36
        "\n"
 
37
        "<b>Disk space</b> :  Show disk transfer rates. Up to 10 partitions\n"
 
38
        "  You need to configure the mount point of each monitored partition like / or /home\n"
 
39
        "  Better seen in a gauge, with 30 or 60s refresh rate and really short or no transition delay.\n"
 
40
        "\n"
 
41
        "<b>Disk speed</b> :  Show disk transfer rates. Up to 5 disks\n"
 
42
        "  You need to configure the name of each monitored disk with his device name like sda or sdb\n"
 
43
        "  Better seen in a graph, with 2 or 3s refresh rate and no delay between transitions.\n"
 
44
        "\n"
 
45
        "Second release, a lot more need to be done :\n"
 
46
        " <u>Free space :</u>\n"
 
47
        " - Popup with detailed informations.\n"
 
48
        " - Editable labels ?\n"
 
49
        " <u>Speed :</u>\n"
 
50
        " - All disks option.\n"
 
51
        " - Pop up showing disks info to know what to add in the list.\n"
 
52
        " - Editable labels ?\n"
 
53
        " - Get real block size for disks\n"
 
54
        " <u>Global</u>\n"
 
55
        " - Find actions : left, middle click, drop and wheel.\n"
 
56
        " - Fill menu with actions.\n"
40
57
        ),
41
58
        "SQP");
42
59
 
80
97
        if (pRenderAttr != NULL)  // attributs generiques.
81
98
        {
82
99
                const gchar *labels[CD_DISKS_NB_MAX_VALUES] = {};
 
100
                
 
101
                if (myConfig.iNumberParts > 0)
 
102
                {
 
103
                        gsize i;
 
104
                        for (i = 0; i < myConfig.iNumberParts; i++)
 
105
                        {
 
106
        /// Ca non plus je suppose :)
 
107
                                double *pSize;
 
108
                                pSize = g_new0 (double, 1);
 
109
                                myData.lParts = g_list_append (myData.lParts, pSize);
 
110
                                labels[i] = myConfig.cParts[i];
 
111
                        }
 
112
                }
 
113
 
83
114
                if (myData.iNumberDisks > 0)
84
115
                {
85
116
                        gsize i;
97
128
 
98
129
                pRenderAttr->cLabels = (gchar **)labels;
99
130
                pRenderAttr->iLatencyTime = myConfig.iCheckInterval * 1000 * myConfig.fSmoothFactor;
100
 
                pRenderAttr->iNbValues = 2 * myData.iNumberDisks;
101
 
                pRenderAttr->bUpdateMinMax = TRUE;
 
131
                pRenderAttr->iNbValues = myConfig.iNumberParts + 2 * myData.iNumberDisks;
 
132
                
 
133
                /// Problem here : should be FALSE for size and TRUE for speed.
 
134
                /// This version force FALSE when size is monitored, so applets using both monitors
 
135
                /// could have some display problems on speed display.
 
136
                pRenderAttr->bUpdateMinMax = !(myConfig.iNumberParts > 0);
 
137
 
102
138
                if (myConfig.iInfoDisplay == CAIRO_DOCK_INFO_ON_ICON)
103
139
                {
104
140
                        pRenderAttr->bWriteValues = TRUE;
155
191
                        CD_APPLET_ALLOW_NO_CLICKABLE_DESKLET;
156
192
                }
157
193
                
158
 
                reset_disks_list (myApplet);
 
194
                cd_disks_reset_parts_list (myApplet);
 
195
                cd_disks_reset_disks_list (myApplet);
159
196
                
160
197
                _set_data_renderer (myApplet, TRUE);
161
198