~cairo-dock-team/ubuntu/precise/cairo-dock-plug-ins/3.0.0.0rc1

« back to all changes in this revision

Viewing changes to dnd2share/src/applet-backend-videobin.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne, Matthieu Baerts (matttbe), Julien Lavergne
  • Date: 2009-10-05 19:27:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20091005192717-mvqvb395guktr401
Tags: 2.0.9-0ubuntu1
[ Matthieu Baerts (matttbe) ]
* New upstream release (LP: #435590)
* debian/control: 
 - Remove ${shlibs:Depends} for integration plug-ins to avoid
   pulling shared libraries which are detected automatically.
 - Added curl as depends for cairo-dock-plug-ins
* debian/rules:
 - Add --enable-dnd2share and --enable-musicplayer to enable new applets.
 - Remove --enable-rhythmbox and --enable-nvidia to remove those applets,
   not maintained upstream.
* Update *.install to take all generated applets.

[ Julien Lavergne ]
* Adjust changelog with Daniel Holbach suggestions.
* cairo-dock-plug-ins.changelogs:  Install specific changelog for 2.0.9
* Build-depends on cairo-dock-dev (>= 2.0.9)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
* This file is a part of the Cairo-Dock project
 
3
*
 
4
* Copyright : (C) see the 'copyright' file.
 
5
* E-mail    : see the 'copyright' file.
 
6
*
 
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.
 
11
*
 
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/>.
 
18
*/
 
19
 
 
20
#define _BSD_SOURCE
 
21
#include <stdlib.h>
 
22
#include <math.h>
 
23
#include <unistd.h>
 
24
#include <glib/gstdio.h>
 
25
#include <string.h>
 
26
 
 
27
#include "applet-struct.h"
 
28
#include "applet-dnd2share.h"
 
29
#include "applet-backend-videobin.h"
 
30
 
 
31
#define NB_URLS 1
 
32
static const gchar *s_UrlLabels[NB_URLS] = {"DirectLink"};
 
33
 
 
34
 
 
35
static void upload (const gchar *cFilePath)
 
36
{
 
37
        // On lance la commande d'upload.
 
38
        gchar *cCommand = g_strdup_printf ("curl --connect-timeout 5 --retry 2 --limit-rate %dk http://www.videobin.org/add -F videoFile=@'%s' -F api=1", myConfig.iLimitRate, cFilePath);
 
39
        g_print ("%s\n", cCommand);
 
40
        gchar *cURL = cairo_dock_launch_command_sync (cCommand);
 
41
        g_free (cCommand);
 
42
 
 
43
        if (cURL == NULL)
 
44
        {
 
45
                return ;
 
46
        }
 
47
 
 
48
        
 
49
        // Enfin on remplit la memoire partagee avec nos URLs.
 
50
        myData.cResultUrls = g_new0 (gchar *, NB_URLS+1);
 
51
        myData.cResultUrls[0] = cURL;
 
52
}
 
53
 
 
54
 
 
55
void cd_dnd2share_register_videobin_backend (void)
 
56
{
 
57
        cd_dnd2share_register_new_backend (CD_TYPE_VIDEO,
 
58
                "videobin.org",
 
59
                NB_URLS,
 
60
                s_UrlLabels,
 
61
                0,
 
62
                upload);
 
63
}