• Nenhum resultado encontrado

Dentre as possíveis melhorias futuras, a que provavelmente traria maior ganho a este projeto seria a configuração correta do LuaJIT. Se o LuaJIT pudesse utilizar as bibliotecas externas da Lua, não haveria a necessidade do acesso ao

prompt e da instalação da versão da Lua para Windows. Além disso, seria possível

uma integração maior com a estrutura do BD, assim a tela não precisaria ser fechada para que o BD recebesse as alterações.

Outra alteração em Lua que poderia melhorar a utilização da tela seria, transformar a navegação de listas para árvore. Hoje a navegação por diretórios e arquivos se baseia em duas listas. Ainda, poderia ser feita a alteração de seleção simples na lista, ou árvore, para seleção múltipla, por exemplo, fazer check out de

diversos arquivos de uma pasta. A utilização de comandos em pastas é outra opção que não foi considerada neste trabalho.

Sem sair das alterações em Lua, uma funcionalidade que sincronizasse o BD com o VSS aumentaria a segurança. Para exemplificar, no caso da RGE, nem todos os desenvolvedores estão utilizando a estrutura nova. Isso causa uma enorme diferença entre o que esta no SourceSafe e que está no BD. No VSS Explorer é possível encontrar 57 objetos de BD versionados, já na tabela “VCS” apenas 12 estão cadastrados.

Na parte de melhorias para o SourceSafe, ficaram faltando as funcionalidades 1 e 2 propostas na sessão 4.2.3, Abrir e Fechar projeto. Atualmente a tela trabalha com o projeto aberto no VSS Explorer. Para alterar o projeto na tela é necessário fazer o mesmo no VSS Explorer.

Partindo para melhorias propostas na estrutura do BD, a primeira seria criar uma tabela nova permitindo que cada desenvolvedor fizesse um cadastro de máquinas utilizadas e email para receber alertas. Atualmente um objeto só pode estar relacionado a uma máquina.

Atualmente a estrutura dentro do BD deve ser criada manualmente, uma alteração na tela que permitisse a criação automática dessa estrutura, provavelmente iria facilitar a sua adesão.

Outra melhoria relacionada ao BD seria conseguir uma forma de recompilar objetos inválidos sem alteração do código. Isso iria inutilizar a tabela “VCS_VERSIONS”, que com o tempo pode passar a utilizar muito espaço.

REFERÊNCIAS

ABREU, M.; MACHADO, F. Projeto de Banco de Dados: Uma Visão Prática. 11. ed. São Paulo: Érica, 2004. 303p.

BEAULIEU, A.; MISHRA, S. Mastering Oracle SQL. Beijing: O’Reilly & Associates, 2002. 336p.

BOLINGER, D.; BRONSON, T. Applying RCS and SCCS - From Source Control

to Project Control. 1. ed. : O'Reilly & Associates , 1995. 528p.

CHACON, S. Pro Git. 1. ed. : Apress, 2009. 288p.

COLLINS-SUSSMAN, B.; FITZPATRICK, B. W.; PILATOCC, C. M. Version Control

with Subversion: For Subversion 1.7. : O'Reilly & Associates, 2011. 468p.

Disponível em: <http://svnbook.red-bean.com/en/1.7/svn-book.pdf> Acesso em: 12 nov. 2013

DATE, C. J. An Introduction to Database Systems. 8. ed. : Addison-Wesley, 2004. 1024p.

DAWES, C.; FEUERSTEIN, S.; PRIBYL, B. Oracle PL/SQL Language Pocket

Reference. 4. ed. Beijing: O’Reilly & Associates, 2008. 180p.

FERREIRA, J. E.; ITALIANO, I. C.; TAKAI, O. K. Introdução a Banco de Dados. : , 2005. 124p.

FEUERSTEIN, S. Oracle PL/SQL Programming. 5. ed. Beijing: O’Reilly & Associates, 2009. 1299p.

FREITAS, R. C.; RAMOS, E. S. Análise Comparativa de Sistemas de Controle de

Versões Baseados em Código Aberto. InfoBrasil, Fortaleza, n.1, p. , 2010.

GLASSER, A. L. The evolution of a source code control system. Proceedings of thesoftware quality assurance workshop on Functional and performance issues, New York, n.1, p.122-125, 1978.

HARDMAN, R.; MCLAUGHLIN, M.; URMAN, S. Oracle Database 10g PL/SQL

Programming. New York: Oracle Press, 2004. 895p.

HARPER, S. ORACLE SQL Developer 2.1. BIRMINGHAM - MUMBAI: Packt Publishing, 2009. 496p.

HEUSER, C. A. Projeto de Banco de Dados. 6. ed. Porto Alegre: Bookman, 2010. 282p.

IERUSALIMSCHY, R., FIGUEIREDO, L., CELES, W. Lua 5.1 Reference Manual (2006).

JONES, A. D.; PLEW, R.; STEPHENS, R. Sams Teach Yourself SQL in 24 hours. 5. ed. Indianapolis: Pearson, 2011. 497p.

JUNIOR, A. O. APLICAÇÃO DE GERÊNCIA DE OBJETOS COMPARTILHÁVEIS

DE UM SGBD ORACLE. 206. 60f. Monografia (Bacharelado em CIÊNCIAS DA

COMPUTAÇÃO) - UNIVERSIDADE REGIONAL DE BLUMENAU, BLUMENAU, 206. KORTH, H. F.; SILBERSCHATZ, A.; SUDARSHAN, S. Sistema de Banco de

Dados. 5. ed. : Campus, 2006. 804p.

LEITE, M. M. R. UM ESTUDO COMPARATIVO DOS SISTEMAS DE BANCO DE

DADOS ORACLE E POSTGRESQL COM ÊNFASE NAS EXTENSÕES

ESPACIAIS. 2011. 68f. Monografia (Especialização em GEOPROCESSAMENTO) -

UNIVERSIDADE ESTADUAL DA PARAÍBA, CAMPINA GRANDE, 2011.

MOORE, S. Oracle Database PL/SQL Language Reference 11g Release 1 (11.1). : Oracle, 2009. 712p.

NATHAN, P.; PATABALLA, N. Oracle9i: Program with PL/SQL. : Oracle, 2001. 336p.

NATHAN, P.; PATABALLA, N. Introduction to Oracle 9i PL/SQL. : ORACLE, 2001. 330p.

POWELL, G. Beginning Database Design. : Wrox, 2006. 496p.

Banco de Dados Capítulo 1: Introdução. Disponível em:

<http://www.dsc.ufcg.edu.br/~baptista/cursos/BDadosI/Capitulo1.pdf> Acesso em: 19 mai. 2013

COMPANY NEWS; MICROSOFT SAYS IT HAS ACQUIRED ONE TREE SOFTWARE. Disponível em:

<http://www.nytimes.com/1994/11/16/business/company-news-microsoft-says-it-has- acquired-one-tree-software.html> Acesso em: 2 jul. 2013

Conceitos Básicos de Controle de Versão de Software - Centralizado e Distribuído.. André Felipe Dias Disponível em:

<http://www.pronus.eng.br/artigos_tutoriais/gerencia_configuracao/conceitos_basico s_controle_versao_centralizado_e_distribuido.php?pagNum=0> Acesso em: 9 abr. 2013

Enciclopédia. Disponível em:

<http://www.pcmag.com/encyclopedia/term/44707/ide> Acesso em: 3 jul. 2013

Introdução à TRIGGERS.. Wagner Bianchi Disponível em:

<http://www.devmedia.com.br/introducao-a-triggers/1695> Acesso em: 16 jun. 2013

Sistemas de Controle de Versão.. Eduardo Cavalcante Lacerda Disponível em:

<http://www.devmedia.com.br/sistemas-de-controle-de-versao/24574> Acesso em: 9 abr. 2013

Suporte Microsoft. Disponível em:

<http://support.microsoft.com/lifecycle/search/default.aspx?sort=PN&alpha=sourcesa fe&Filter=FilterNO> Acesso em: 2 jul. 2013

APÊNDICE A - CÓDIGO FONTE DO ARQUIVO TCAD_VCS_DB

create or replace trigger "TCAD_VCS_DB"

before create or alter or drop on database declare v_mac varchar2(30); machine varchar2(30); v_user varchar2(30); aux number; ln_count number;

ln_comp vcs.comp_qdo_inval%type;

sql_text dbms_standard.ora_name_list_t;

n pls_integer;

v_stmt clob; begin

v_stmt := ' ';

select count(*) into aux from vcs where upper(vcs.objeto) = upper(ora_dict_obj_name);

if aux > 0 then

select upper(sys_context('USERENV', 'TERMINAL')), upper(sys_context('USERENV', 'OS_USER'))

into v_mac, v_user from dual;

select upper(machine), comp_qdo_inval into machine, ln_comp

from vcs

where vcs.objeto = ora_dict_obj_name;

if trim(v_mac) not like '%' || machine || '%' then

select count(*)

into ln_count from all_objects where status <> 'VALID'

and object_name = upper(ora_dict_obj_name);

if ln_count <> 0 and ln_comp = 1 then

n := ora_sql_txt(sql_text); for i in 1 .. n loop v_stmt := v_stmt || sql_text(i); end loop;

pac_vcs.p_grava_text(ora_dict_obj_name, v_stmt, v_mac);

else

raise_application_error(-20000, 'Voce nao tem permissao para compilar esse objeto!');

end if;

end if;

end if; end;

APÊNDICE B - CÓDIGO FONTE DO ARQUIVO VCS

-- Create table

create table OWNER.VCS (

nome VARCHAR2(50) not null,

re VARCHAR2(10) not null,

machine VARCHAR2(50) not null,

email VARCHAR2(50),

objeto VARCHAR2(50) not null,

dt_ini DATE not null,

dt_fim DATE,

comp_qdo_inval NUMBER default 0 not null );

-- Add comments to the table comment on table OWNER.VCS is 'Tabela de VCS';

-- Add comments to the columns comment on column OWNER.VCS.nome is 'Nome do usr';

comment on column OWNER.VCS.re is 'RE/ID/Matricula do usr';

comment on column OWNER.VCS.machine is 'Maquina utilizada';

comment on column OWNER.VCS.email is 'email para receber notificações'; comment on column OWNER.VCS.objeto

is 'NOME DO OBJETO QUE ESTA SENDO VERSIONADO'; comment on column OWNER.VCS.dt_ini

is 'Data inicio uso do objeto'; comment on column OWNER.VCS.dt_fim is 'Data fim uso do objeto';

comment on column OWNER.VCS.comp_qdo_inval

APÊNDICE C - CÓDIGO FONTE DO ARQUIVO VCS_VERSIONS

-- Create table

create table OWNER.VCS_VERSIONS (

objeto VARCHAR2(50) not null,

machine VARCHAR2(50) not null,

obj_code CLOB not null,

dt_comp DATE not null );

-- Add comments to the table

comment on table OWNER.VCS_VERSIONS

is 'Tabela que guarda versoes dos objetos invalidos recompilados por outros usrs';

-- Add comments to the columns

comment on column OWNER.VCS_VERSIONS.objeto is 'NOME DO OBJETO QUE ESTA SENDO RECOMPILADO'; comment on column OWNER.VCS_VERSIONS.machine

is 'Maquina utilizada para compilar objeto invalido'; comment on column OWNER.VCS_VERSIONS.obj_code

is 'CÓDIGO DO OBJETO QUE ESTA SENDO RECOMPILADO'; comment on column OWNER.VCS_VERSIONS.dt_comp

APÊNDICE D - CÓDIGO FONTE DO ARQUIVO PAC_VCS

create or replace package body pac_vcs is

--- -- p_insere_vcs --- -- Author : 3003886 -- Created : 09/12/2013 11:23:24 ---

procedure p_insere_vcs(piv_objeto vcs.objeto%type,

piv_re vcs.re%type,

piv_machine vcs.machine%type) is

begin

insert into vcs

(objeto, nome, re, machine, dt_ini)

values

(piv_objeto, piv_re, piv_re, piv_machine, sysdate);

commit;

end p_insere_vcs;

procedure p_deleta_vcs(piv_objeto vcs.objeto%type) is

begin

delete vcs where objeto = piv_objeto;

commit;

end p_deleta_vcs;

procedure p_grava_text(piv_objeto vcs.objeto%type, pclob clob,

piv_machine vcs.machine%type) is

begin

insert into vcs_versions values (piv_objeto, piv_machine, pclob, sysdate);

end p_grava_text; end pac_vcs;

APÊNDICE E - CÓDIGO FONTE DO ARQUIVO MAIN.LUA

local AddMenu = ... local plsql = plsql

local SYS, IDE, SQL = plsql.sys, plsql.ide, plsql.sql local ShowMessage = plsql.ShowMessage

local Gsub, Sub, Upper, Lower = string.gsub, string.sub, string.upper, string.lower

do

local function VSS()

--Chama o arquivo LUA a ser executado e joga o retorno em um arquivo

a = io.popen('"c://plsql developer/PlugIns/lua/VSS/vss_pl.lua"')

-- Lê o retorno do LUA no arquivo

b = (a:read("*a"))

--Fecha o arquivo

a:close()

reg_ss = 0

for linhas in string.gmatch(b, ".-\n") do --split \n --Pega somente registros de alteracao SS

if reg_ss == 1 then

--pega da terceira letra ate o fim/tira o "ss " for linha in string.gmatch(linhas:sub(3), ".-\n") do

--pega a primeira palavra

aux = 0

lin = ' '

for palavras in string.gmatch(linha, "%w+") do if palavras:gsub("^%s*(.-)%s*$", "%1") == 'add' or palavras:gsub("^%s*(.-)%s*$", "%1") == 'checkout' or palavras:gsub("^%s*(.-)%s*$", "%1") == 'checkin' or palavras:gsub("^%s*(.-)%s*$", "%1") == 'undocheckout' then

command = palavras:gsub("^%s*(.- )%s*$", "%1")

objeto = linha:sub(command:len() +2)

objeto =

objeto:sub(1,objeto:find('%.')-1)

insere_tabela(command, objeto) end

end end

end

if linhas:gsub("^%s*(.-)%s*$", "%1") == 'INICIO' then -- Testa depois para ignorar Linha de INICIO

reg_ss =1

end

end

AddMenu(VSS, "&Lua / VSS") end

function insere_tabela (c, o)

re = prompt('echo %username%')

re = re:sub(1,re:len()-1)

maq = prompt('hostname')

maq = maq:sub(1,maq:len()-1)

obj = o:sub(3,o:len())

p = string.char(39) if c == 'checkout' then

ins = 'begin \n pac_vcs.p_insere_vcs( '.. p.. obj.. p..

', ' ..

p .. re .. p .. ', ' ..

p .. maq .. p ..

');\n end;'

ins = SQL.Execute(ins)

elseif c == 'undocheckout' or c == 'checkin' then command = 'begin \n pac_vcs.p_deleta_vcs( '.. p ..

obj .. p.. ');\n end;'

ins = SQL.Execute(command) end

end--insere_tabela

function prompt(c)--executa um comando no prompt e retorna o valor pra "b"

a = io.popen('cmd.exe /c call ' .. c)

b = (a:read("*a")) a:close()

return b

end --FIM prompt return { OnActivate, OnDeactivate, CanClose, AfterStart, AfterReload, OnBrowserChange, OnWindowChange, OnWindowCreate, OnWindowCreated, OnWindowClose, BeforeExecuteWindow, AfterExecuteWindow, OnConnectionChange, OnPopup, OnMainMenu, OnTemplate, OnFileLoaded,

OnFileSaved, About, CommandLine, RegisterExport, ExportInit, ExportFinished, ExportPrepare, ExportData }

APÊNDICE F - CÓDIGO FONTE DO ARQUIVO VSS_PL.LUA

vss = require "vss"

APÊNDICE G - CÓDIGO FONTE DO ARQUIVO VSS.LUA

local vss = {}

local msg_no_check = "No checked out files found."

local problemas ='1. Todas as perguntas são respondidas com SIM(Y)'..

' para evitar travar.\n'..

'2. Algumas vezes os arquivos "travam" para checkout, necessário '..

'realizar pelo VSS Explorer.\n'..

'3. Funcionalidade de comentario somente para o CheckIn.\n'..

'4. Checkin nao valida se esta em checkout. \n'..

'5. Para alterar o ambiente de trabalho a pasta selecionada deve '..

'conter algum arquivo\n'..

'-Fica com a tela do prompt aberta atraz da aplicação.'

require "iuplua" function vss.ini_ss() retorno = "INICIO" --- --- --Cria a interface --- --- --Cria os botoes

btn_on_off = iup.button{ title = "Iniciar SS" }

btn_voltar = iup.button{ title = "Voltar" }

btn_checkin = iup.button{ title = "Check In" }

btn_checkout = iup.button{ title = "Check Out" }

btn_undo_checkout = iup.button{ title = "Undo Check Out" }

btn_add_new = iup.button{ title = "Add new item" }

btn_del_item = iup.button{ title = "Delete item"}

btn_alter_workfold = iup.button{ title = "Alterar \nWorking \nFolder"}

--Cria checkbox

tg_log = iup.toggle{title ="Ver log", value = "YES"} --Cria os itens dos Menus

item_probls = iup.item{title = "Problemas conhecidos"}

--Cria os Menus

menu_file = iup.menu {item_probls}

submenu_file = iup.submenu {menu_file; title = "File"}

menu = iup.menu {submenu_file} --Cria as listas

list_folder = iup.list { multiple="NO", size="200x100", expand = 'YES'}

list_itens = iup.list { multiple="NO", size="200x100",

editbox ='YES', expand = 'YES'}

list_log = iup.list { multiple="NO", size="200x100", expand = 'YES'}

--Cria os frames/box

frm_bts1 = iup.frame {iup.vbox {btn_on_off,btn_voltar,

btn_alter_workfold}}

frm_bts2 = iup.frame {iup.vbox {btn_checkin,btn_checkout,

btn_del_item}}

frm_log = iup.frame {iup.vbox {tg_log,list_log}}

frm_top = iup.frame {iup.hbox {list_folder,frm_bts1,frm_log};

title = "Pastas"}

frm_bot = iup.frame {iup.hbox {list_itens,frm_bts2};

title = "Itens"} --Cria a tela

dlg = iup.dialog {iup.vbox{frm_top,frm_bot};

title="VSS - Pablo", menu=menu} --Bloqueia os botoes btn_checkin.active = "NO" btn_checkout.active = "NO" btn_undo_checkout.active = "NO" btn_add_new.active = "NO" btn_alter_workfold.active = "NO" btn_del_item.active = "NO" btn_voltar.active = "NO"

--Inicia a tela principal centralizada

dlg:showxy(iup.CENTER, iup.CENTER)

--- ---

--Custom functions

--- ---

function open_dir(dir)

--Abre o diretorio

os.execute('cmd.exe /c call ss cd '.. dir)

--Lista arquivos e pastas return prompt('ss dir') end --FIM open_dir

function refresh_list (new_list) --Zera as variaveis auxiliares

l1 = 0 fim = 0

--Limpa as duas listas

list_folder.removeitem = ALL list_itens.removeitem = ALL --Bloqueia os botoes btn_checkin.active = "NO" btn_checkout.active = "NO" btn_del_item.active = "NO"

--Separa a string recebida por linha "\n" for c in string.gmatch(new_list, ".-\n") do

--Se for a primeira linha ignora if l1 == 1 then

--Substitui espacos por branco (trim)

d = trim(c)

--Se encontrar uma linha em branco if d == '' then

--Apos a linha em branco traz o total de resultados

fim = 1 end

--Se ainda tem itens a inserir if fim ~= 1 then

--Verifica se o primeiro caracter é cifrao ("$"). Se for entao é pasta

p = string.sub(c,0,1)

--Se for pasta insere na list_folder if p == '$' then

list_folder.appenditem = ""..c

else

--Se for realmente um item if

string.sub(trim(rem_endline(c)),1,22) ~= 'No items found under $' then

--senao insere na list_itens

list_itens.appenditem = ""..c else fim = 1 end end end end

--Seta primeira linha OK

l1 = 1 end

end --FIM refresh_list function trim(b)

b = b:gsub("^%s*(.-)%s*$", "%1") return b

end --FIM trim

function rem_endline(b)

b=b:gsub((string.char(10)), "") return b

end--FIM rem_endline

function prompt(c)--executa um comando no prompt e retorna o valor pra "b"

a = io.popen('cmd.exe /c call ' .. c)

b = (a:read("*a")) a:close()

list_log.appenditem = c retorno = retorno ..'\n'.. c

return b

end --FIM prompt

function get_fisrt_word(d)

aux=0

for word in string.gmatch(d, "%w+") do --pega a primeira sequenca de caracteres ate espaco

if aux == 0 then d = word aux = 1 end end return d end--FIM get_fisrt_word

function busca_ss_usr_obj(b)

d=string.sub(b,20,40)--pega apartir do fim do nome do arquivo return get_fisrt_word(d)

end --FIM busca_ss_usr_obj function busca_ss_usr()

return prompt('ss whoami') end --FIM busca_ss_usr

function busca_os_usr()

return prompt('echo %username%') end --FIM busca_os_usr

function ss_undo_checkout(c)

c = 'ss undocheckout '..'"'..c..'"'..' -I-Y'

return prompt(c)

end --FIM ss_undo_checkout function ss_add(f)

return prompt('ss add "'.. trim(rem_endline(f)) .. '" -C- -I- Y')

end --FIM ss_add

--- ---

--Menus functions

--- ---

function item_probls:action()

iup.Message("Problemas Conhecidos", problemas) end --- --- --Buttons functions --- ---

function btn_on_off:action() b = open_dir('$/')

refresh_list(b)

btn_voltar.active = "YES"

btn_alter_workfold.active = "YES"

if string.sub(trim(rem_endline(b)),1,1) ~= '$' then

iup.Message('ERRO','Não foi possível abrir o projeto do SourceSafe verifique as variáveis de ambiente e tente novamente.\n'..

'Configurar o path com o diretorio do SS e SSDIR com o diretorio do arquivo srcsafe.ini.\n'..

'Pode ser necessário reiniciar o sitema após setar as variáveis.')

iup.Close() end

end--FIM btn_on_off:action function btn_voltar:action()

b = open_dir('..')

refresh_list(b)

end--FIM btn_voltar:action function btn_checkin:action()

b = prompt('ss status '..'"'.. trim(rem_endline(item)) ..'"')

if b ~= msg_no_check and b ~= '' then

obj_owner = busca_ss_usr_obj(b)

ss_usr = busca_ss_usr()

if trim(ss_usr) == trim(obj_owner) then a = iup.GetText("Comentario","") a = trim(rem_endline(a)) if a ~= '' then a = ' -C ' .. '"' .. a .. '"' else a = '' end

a = 'ss checkin '..'"'.. trim(rem_endline(item)) ..

'"' .. a .. ' -I-Y'

b = prompt(a)

b = trim(rem_endline(b)) else

iup.Message("Erro", 'O arquivo '..

trim(rem_endline(item)).. ' está em check para o usuário '.. obj_owner) end

else

iup.Message("Erro", 'O arquivo '..trim(rem_endline(item)).. ' não está em checkout.')

end

end--FIM btn_checkin:action

function btn_alter_workfold:action() f, err = iup.GetFile("*")

g, count = f:gsub(string.char(92),string.char(92)) if err == 0 then

f = f:sub(1, (f:len() - string.find(f:reverse(), string.char(92))))

if count == 1 then

f = f .. string.char(92)

end

g = prompt(' ss workfold "' .. f.. '"' )

os.execute('taskkill /f /t /im ssexp.exe')

elseif err == -1 then

iup.Message("Cancelada", "Operação cancelada.") elseif err == -2 then

iup.Message("Erro", "Allocation error") elseif err == -3 then

iup.Message("Erro", "Invalid parameter") end

end--FIM btn_alter_workfold:action function btn_checkout:action()

b = 'ss checkout '.. string.char(34)..trim(rem_endline(item)) .. string.char(34)

b = prompt(b)

if trim(b) == '' then

iup.Message("Erro", 'Não foi possivel realizar o Checkout do arquivo '.. trim(rem_endline(item)) ..'.')

else

if trim(rem_endline(b)) == trim(rem_endline(item)) then iup.Message("OK", "Checkout do arquivo "..

trim(rem_endline(item)) .. " realizado com sucesso.") end

end

function btn_undo_checkout:action()

b = prompt('ss status '..'"'.. trim(rem_endline(item)) ..'"')

b = trim(b)

if b ~= msg_no_check and b ~= '' then

obj_owner = busca_ss_usr_obj(b)

ss_usr = busca_ss_usr()

if trim(ss_usr) == trim(obj_owner) then

b= ss_undo_checkout(trim(rem_endline(item)))

if trim(rem_endline(b)) == trim(rem_endline(item)) then

iup.Message("OK", "Undo Checkout do arquivo "..trim(rem_endline(item)).." realizado com sucesso.")

else

iup.Message("Erro", trim(rem_endline(b)) ..

'\n' .. trim(rem_endline(item))) end

else

iup.Message("Erro", 'O arquivo '..

trim(rem_endline(item)).. ' está em check para o usuário '.. obj_owner) end

else

iup.Message("Erro", 'O arquivo '..trim(rem_endline(item)).. ' não está em checkout.')

end

end--FIM btn_undo_checkout:action function btn_add_new:action()

f, err = iup.GetFile("*") if err == 0 then

--File already exists

ss_add(f)

refresh_list(prompt('ss dir'))--refresh lista atual elseif err == -1 then

iup.Message("Cancelada", "Operação cancelada.") elseif err == -2 then

iup.Message("Erro", "Allocation error") elseif err == -3 then

iup.Message("Erro", "Invalid parameter") end

end--FIM btn_add_new:action function btn_del_item:action()

prompt('ss delete '.. trim(rem_endline(item)))

refresh_list(prompt('ss dir')) end --FIM btn_del_item:action

--- ---

--Lists functions

--- ---

function list_folder:action(t,i,v)

if v == 0 then btn_add_new.active = "NO" else btn_add_new.active = "YES" end end--FIM list_folder:action

function list_itens:action(t, i, v) if v == 0 then btn_checkin.active = "NO" btn_checkout.active = "NO" btn_undo_checkout.active = "NO" btn_del_item.active = "NO" else btn_checkin.active = "YES" btn_checkout.active = "YES" btn_undo_checkout.active = "YES" btn_del_item.active = "YES" item = t end end--FIM list_itens:action

function list_folder:dblclick_cb(i, t)

b = open_dir('"'..trim(rem_endline(t))..'"')

refresh_list(b) return iup.DEFAULT

end--FIM list_folder:dblclick_cb

--- ---

--Checks functions (toggle)

--- ---

function tg_log:action()

list_log.visible = "NO" frm_log.size = "10x100" end --- --- --MainLoop --- --- if (iup.MainLoopLevel()==0) then iup.MainLoop() print(retorno) end end return vss

Documentos relacionados