Commit 7ca9587e authored by Thiago H. S. Picharski's avatar Thiago H. S. Picharski

Merge remote branch 'le-light-edubar/master'

Signed-off-by: default avatarThiago H. S. Picharski <thsp08@c3sl.ufpr.br>
parents 3d28ecc2 836329a8
#!/bin/bash
# gerar.sh
# Copyright (c) 2006 by Bruno Ribas <ribas@ufpr.br>
DIRTMP=$(mktemp -d)
VERSAO=$(cat VERSAO)
#arrumar versao
#$1 tipo de incremento
MAJOR=$(echo $VERSAO| cut -d'.' -f1)
MINOR=$(echo $VERSAO| cut -d'.' -f2)
REVISION=$(echo $VERSAO| cut -d'.' -f3)
case $1 in
Minor)
((MINOR++))
REVISION=0
;;
Major)
((MAJOR++))
MINOR=0
REVISION=0
;;
help)
echo "Uso: $0 Major|Minor|Revision"
echo ' Major - Altera versao Major'
echo ' Minor - Altera versao Minor'
exit
;;
*)
((REVISION++))
;;
esac
VERSAO="${MAJOR}.${MINOR}.${REVISION}"
echo "$VERSAO" > VERSAO
#Compila a documentacao do pacote no diretorio doc/
#cd doc/
#hevea -text *.tex
#hevea -text *.tex
#cd ../
cp -a pacote $DIRTMP
#Copia a documentacao compilada para dentro do pacote.
#cp doc/*.txt $DIRTMP/pacote/usr/share/doc/prd-*
cd $DIRTMP
find . -name ".git" -exec rm -rf {} \; &>/dev/null
sed -i -e "s/Version:/Version: $VERSAO/" pacote/DEBIAN/control
fakeroot dpkg -b pacote .
cd -
cp $DIRTMP/*deb .
rm -rf $DIRTMP
# vim:tabstop=4:shiftwidth=4:encoding=iso-8859-1
Package: le-light-edubar
Priority: important
Section: main
Version:
Architecture: i386
Pre-Depends: plasma-desktop
Depends: python
Maintainer: LE Maintainer <le-maintainer@c3sl.ufpr.br>
Description: Desktop panel to allow access to educational contents
#!/bin/bash
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-edubar
#
# le-autoupgrade is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# Add edubar to widgets list
kbuildsycoca4 || true
#!/bin/bash
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-edubar
#
# le-autoupgrade is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# Remove edubar from widgets list
kbuildsycoca4 || true
#!/bin/bash
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-edubar
#
# le-autoupgrade is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# Add MEC repository to apt sources
SRCFILE=/etc/apt/sources.list.d/le-repos.list
if ! test -f $SRCFILE; then
cat <<EOF> $SRCFILE
# MEC repository, contains educational contents
deb http://repositorio.mec.gov.br mec 3.0
EOF
apt-get update
fi
exit 0
#!/bin/bash
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-edubar
#
# le-autoupgrade is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
PACKAGESFILE="/etc/le-edubar/mecpackages.list"
if ! test -e "/etc/le-light"; then
apt-cache search '^mec-' | awk '{print $1}' > $PACKAGESFILE
fi
filter "Pacotes do MEC" {
section {
inclusive false;
sections {
};
};
status {
flags 0x1ffff;
};
pattern {
andMode 1;
patterns {
Maintainer; "MEC"; false;
Name; "mec-"; false;
};
};
priority {
};
reducedview {
enabled false;
};
};
#!/bin/bash
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-edubar-fixed-position
#
# le-edubar-fixed-position is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
SCREEN_WIDTH=$(xrandr | grep '*' | awk '{print $1}' | cut -d"x" -f1)
if (( SCREEN_WIDTH < 1024 )); then
ICON_SIZE=96
else
ICON_SIZE=128
fi
EDUBAR_WIDTH=$((ICON_SIZE * 5 + 10));
EDUBAR_HEIGHT=$ICON_SIZE;
CONFIG="$HOME/.kde/share/config/plasma-desktop-appletsrc"
POS_X=$((SCREEN_WIDTH/4))
POS_Y=0;
PLUGIN=$(grep "^plugin=edubar$" $CONFIG)
if [ -z "$PLUGIN" ]; then
ID=$(egrep "^\[Containments\]\[[0-9]*\]\[Applets\]\[[0-9]*\]$" $CONFIG | \
cut -d "[" -f5 | sed 's/\]//g' | sort -g | tail -n1)
ID=$((ID+1))
kwriteconfig --file $CONFIG --group Containments --group 1 --group Applets \
--group $ID \
--key geometry "$POS_X,$POS_Y,$EDUBAR_WIDTH,$EDUBAR_HEIGHT"
kwriteconfig --file $CONFIG --group Containments --group 1 --group Applets \
--group $ID --key immutability "1"
kwriteconfig --file $CONFIG --group Containments --group 1 --group Applets \
--group $ID --key plugin "edubar"
kwriteconfig --file $CONFIG --group Containments --group 1 --group Applets \
--group $ID --key zvalue "0"
fi
chown -R --reference="$HOME" "$HOME/.kde"
C3SL - Centro de Computacao Cientifica e Software Livre
Adriano da Luz
Bruno Cesar Ribas
Carlos Carvalho
Cleide Luzia Bonfim Possamai
Danilo Kiyoshi Simizu Yorinori
Diego Giovane Pasqualin
Eduardo Todt
Erik Alexandre Pucci
Felipe Cys Laskoski
Guilherme Zasyeki Machado
Josiney de Souza
Juliana Bueno
Klismann Smoger Mottin
Laura Sanchez Garcia
Luis Carlos Erpen de Bona
Marcela Saragioto
Marcos Castilho
Pedro Eugenio Rocha
Renan Franca De Miranda
Ricardo Tavares De Oliveira
Rubens Massayuki Suguimoto
Thiago Henrique Dos Santos Picharski
Tiago Rodrigo Kepe
Victor Tarabola Cortiano
Vinicius Kwiecien Ruoso
This diff is collapsed.
DIR=edubar
METADATANAME=plasma-widget-edubar.desktop
all: install
install:
sudo cp -r ../$(DIR) /usr/share/kde4/apps/plasma/plasmoids/
sudo cp -r metadata.desktop /usr/share/kde4/services/$(METADATANAME)
kbuildsycoca4
distclean:
sudo rm -fr /usr/share/kde4/apps/plasma/plasmoids/$(DIR)
sudo rm -f /usr/share/kde4/services/$(METADATANAME)
kbuildsycoca4
#!/usr/bin/python
#coding: utf-8
from PyQt4.QtCore import Qt, QString, QSizeF, SIGNAL
from PyKDE4.kdecore import KToolInvocation
from PyQt4.QtGui import QGraphicsLinearLayout
from PyKDE4.plasma import Plasma
from PyKDE4 import plasmascript
import sys, subprocess, os, pwd, grp
class Edubar(plasmascript.Applet):
def __init__(self,parent,args=None):
plasmascript.Applet.__init__(self,parent)
def createIcon(self, imagefile, size, widget=None):
obj = Plasma.IconWidget()
obj.setIcon(QString(imagefile))
obj.setMinimumSize(QSizeF(size,size))
return obj
def launchBrowser(self, link):
""" Open browser using 'link' as parameter. """
KToolInvocation.invokeBrowser(link)
def hDomain(self):
self.launchBrowser("http://www.dominiopublico.gov.br/")
def hSchool(self):
self.launchBrowser("http://tvescola.mec.gov.br/")
def hObjects(self):
self.launchBrowser("http://objetoseducacionais2.mec.gov.br/")
def hTeacher(self):
self.launchBrowser("http://portaldoprofessor.mec.gov.br/")
def imgPathFromFile(self,imgFile):
imagespath = self.applet.package().path() + "contents/imgs/"
return imagespath + imgFile
def _runCmd(self, cmd):
""" Run cmd and return a tuple (retcode, output) """
s = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, shell=True)
# FIXME: Find out why s.wait() freezes sometimes
#retcode = s.wait()
output = s.communicate()
#if retcode == 0:
# output = output[0].split("\n")
#else:
# output = output[1]
try:
output = output[0].split("\n")
except:
output = []
retcode = 0
return (retcode,output)
def logMsg(self, msg):
sys.stderr.write("LOG: %s\n" % msg)
def getScreenGeometry(self):
""" Return screen geometry in QSize format"""
return self.applet.scene().screenGeometry(0)
def imAdmin(self):
""" Check if the current user is member of admin group.
return True is he is, and False otherwise """
login = pwd.getpwuid(os.geteuid()).pw_name
if login in grp.getgrnam("admin").gr_mem:
return True
else:
return False
def init(self):
self.setHasConfigurationInterface(False)
self.setAspectRatioMode(Plasma.IgnoreAspectRatio)
self.setBackgroundHints(Plasma.Applet.NoBackground)
mlayout = QGraphicsLinearLayout(Qt.Horizontal, self.applet)
mlayout.setSpacing(0)
iDict = {"domain": {"handler":self.hDomain, "img":"1.png", "label": "Dominio Publico" },
"school": {"handler":self.hSchool, "img":"2.png", "label": "TV Escola" },
"teacher": {"handler":self.hTeacher, "img":"3.png", "label": "Portal do Professor" },
"objects": {"handler":self.hObjects, "img":"4.png", "label": "Objetos Educacionais" },
}
icons = [iDict["domain"], iDict["school"], iDict["teacher"],
iDict["objects"]]
# Get the screen size and calculate the icon size
width = self.getScreenGeometry().width()
if width < 1024:
wsize = 96
else:
wsize = 128
for iDesc in icons:
icon = self.createIcon(self.imgPathFromFile(iDesc["img"]),wsize)
icon.setToolTip ( iDesc["label"] )
icon.connect(icon,SIGNAL("clicked()"),iDesc["handler"])
mlayout.addItem(icon)
self.applet.setLayout(mlayout)
self.resize(len(icons)*wsize,wsize)
def CreateApplet(parent):
return Edubar(parent)
[Desktop Entry]
Encoding=UTF-8
Name=Edubar
Name[nl]=Edubar
Type=Service
ServiceTypes=Plasma/Applet
Icon=leedubar
X-Plasma-API=python
X-Plasma-MainScript=code/main.py
X-KDE-PluginInfo-Author=C3SL
X-KDE-PluginInfo-Email=le-maintainer@c3sl.ufpr.br
X-KDE-PluginInfo-Name=edubar
X-KDE-PluginInfo-Version=1.0
X-KDE-PluginInfo-Website=http://www.inf.ufpr.br/rfm08/
X-KDE-PluginInfo-Category=Utilities
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
-KDE-PluginInfo-EnabledByDefault=true
[Desktop Entry]
Encoding=UTF-8
Name=Edubar
Name[nl]=Edubar
Type=Service
ServiceTypes=Plasma/Applet
Icon=leedubar
X-Plasma-API=python
X-Plasma-MainScript=code/main.py
X-KDE-PluginInfo-Author=C3SL
X-KDE-PluginInfo-Email=le-maintainer@c3sl.ufpr.br
X-KDE-PluginInfo-Name=edubar
X-KDE-PluginInfo-Version=1.0
X-KDE-PluginInfo-Website=http://www.inf.ufpr.br/rfm08/
X-KDE-PluginInfo-Category=Utilities
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment