How to make an app - Andromo App Maker

Announcement

Collapse
No announcement yet.

Free Plugin : RAR Plugin

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Originally posted by rexzooly View Post
    Ok your not even calling your function move th fucntion to the globe and then try calling the function with the details requested from the function i am 2 tired to fix or test anymore now i am half dead but look at that your coding on the extract is way out you call functions have the hole function in the button.
    Thanks, am already in global function and call function makes
    Code:
    Rar.Extract (rar_File [1], {"*.*"}, Sfold, true, true, "", RAR_OVERWRITE_ALWAYS, "rar_Extract");
    but this did not solve the problem, but any suggestions?

    Comment


    • Originally posted by kauster View Post
      Thanks, am already in global function and call function makes
      Code:
      Rar.Extract (rar_File [1], {"*.*"}, Sfold, true, true, "", RAR_OVERWRITE_ALWAYS, "rar_Extract");
      but this did not solve the problem, but any suggestions?
      is that code on your button? can i ask it the rest of the function working part from the call back?

      Comment


      • Originally posted by rexzooly View Post
        is that code on your button? can i ask it the rest of the function working part from the call back?
        Ok

        Code global functions:

        Code:
        -- Funcion para Callback function en rarExtract
        function rar_Extract (Msg, Name, Percent, Size)
        -- Progreso de extraccion de archivos
          if Msg == "process" then
         
           StatusDlg.Show(MB_ICONNONE, false);
           StatusDlg.SetMessage("Extrayendo...");
              StatusDlg.SetMeterPos(Percent);
           StatusDlg.SetStatusText(String.SplitPath(Name).Filename..String.SplitPath(Name).Extension.." : "..Math.Floor(Size/1024).." KB");
           
        
           
        
           return true;
           
        -- Si el rar a extraer se compone de mas volumenes..
          elseif Msg == "volume" then
         	
         		result = Dialog.FileBrowse(true, "Locate Rar Part File", "'", "Rar Part Files(*part.rar)|*.part*.rar|", "", "", false, false)
        		if result[1] == "CANCEL" then
        			result[1] = ""
        		end
        		return result[1]
        
        -- Si el archivo a extraer dispone de password..insertamos pass en el dialog
          elseif Msg == "password" then
         	
        		return Dialog.PasswordInput("Contraseña", "El archivo esta protegigo, introduce la contraseña", MB_ICONQUESTION);
         
          end
        end
        Code buton to load rar:

        Code:
        -- Buscamos archivo rar, delimitamos browser para solo .rar
        rar_File = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.rar)|*.rar|", "", "dat", false, false);
        -- Si no se cancela el buscador
        if (rar_File[1] ~= "CANCEL") then
        -- Recogemos la información del rar seleccionado
         info_rar = Rar.GetInfo(rar_File[1], "");
        -- error devuleve nil en ese caso ..mensaje 
          if info_rar == nil then
          
           Dialog.Message("Error !", "Erorr al copilar la información.")
        -- Si todo va bien
          else
          info_rar.TotalSize = tamano(info_rar.TotalSize)
          info_rar.PackedSize = tamano(info_rar.PackedSize)
          -- Si la info del rar nos dice que no tiene comentarios el archivo..
            if info_rar.Comment == nil then
        -- Impresion de la tabla de informacion del rar ( sin comentarios)
            Paragraph.SetText("Paragraph1","Versión :"..info_rar.UnpackVer.."\r\nHost OS : "..
        									    info_rar.HostOS.."\r\nTotal Archivos : "..
        									    info_rar.TotalFiles.."\r\nTamaño total : "..
        									    info_rar.TotalSize.."\r\nTamaño comprimido : "..
        									    info_rar.PackedSize.."\r\nRatio : "..
        									    info_rar.Ratio.." %" );
        	
        	Paragraph.SetText("Paragraph2"," El archivo no tiene comentarios");
        	else
        	-- Si tiene comentarios , inpresion de la tabla de informacion del rar
        	Paragraph.SetText("Paragraph1","Versión :"..info_rar.UnpackVer.."\r\nHost OS : "..
        									    info_rar.HostOS.."\r\nTotal Archivos : "..
        									    info_rar.TotalFiles.."\r\nTamaño total : "..
        									    info_rar.TotalSize.."\r\nTamaño comprimido : "..
        									    info_rar.PackedSize.."\r\nRatio : "..
        									    info_rar.Ratio.." %");								    
        	Paragraph.SetText("Paragraph2","Comentarios : "..info_rar.Comment);							    
              end
           end
        end
        -- Funcion para pasar el listado del rar ( delimitado por "|" ) en una tabla
        function DelimitedStringToTable(DelimitedString, Delimiter)
        	tbReturn = {};
        	local strWorking;
        	local nPos = nil;
        	local strData;
        	local nTableIndex = 1;
        	local nDelimiterLength = String.Length(Delimiter);
        	
        	if(nDelimiterLength < 1)then
        		tbReturn[nTableIndex] = DelimitedString;
        		return tbReturn;
        	end
        	
        	strWorking = DelimitedString;
        	nPos = String.Find(strWorking,Delimiter);
        	while(nPos ~= -1)do
        		strData = String.Left(strWorking,nPos-1);
        		tbReturn[nTableIndex] = strData;
        		nTableIndex = nTableIndex + 1;
        		local nLength = String.Length(strWorking);
        		strWorking = String.Right(strWorking,nLength - (nPos + (nDelimiterLength-1)));
        		nPos = String.Find(strWorking,Delimiter);
        	end
        	if(strWorking ~= "")then
        		tbReturn[nTableIndex] = strWorking;
        	end
        	
        	return tbReturn;
        end
        -- Lllamamos a los archivos contenidos en el rar
        rar_contents = Rar.GetContents(rar_File[1], "AMSWaves", false);
        -- Si el rar esta vacio o hay algun error mensaje
        if rar_contents == nil then
        
        	Dialog.Message("Error !", "Error al copilar el contenido del rar")
        else
        -- Borramos items anteriores en el listbox
            ListBox.DeleteItem("ListBox1", LB_ALLITEMS);
          -- Conevertimos en tabla la lista rar_contens 
            contents = DelimitedStringToTable(rar_contents, "|")
            for a,b in contents do
            
         
            -- Imprimimos lista en el listbox
            ListBox.AddItem("ListBox1",b , "");	
            end
        end
        Code buton to extract:

        Code:
        -- Si no seleccionamos ningun rar en "Buscar archivo rar" mesaje de error
        if rar_File == nil then
          Dialog.Message("Error", "No has seleccionado un archivo .rar", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
         else
         -- Si todo esta bien , llamamos al dialogo para ubicación de extracción
          sFolder = Dialog.FolderBrowse("Selecciona directorio donde extraer archivos", _DesktopFolder);
         -- Si no cancelamos el dialogo..seguimos con la extraccion , en caso contario no hay acción
         if (sFolder ~= "CANCEL") then
         -- Extraemos archivos del rar_File( rar buscado anteriormente) en sFolder( ubicacion)
          correcto = Rar.Extract(rar_File[1], {"*.*"}, sFolder, true, true, "", RAR_OVERWRITE_ALWAYS, "rar_Extract");
          -- Si la extraccion es correcta primer dialogo, si hay errores segundo
          if correcto == true then
           Dialog.Message("Extracción de archivos", "La Extracción se realizó correctamente.");
          else
           Dialog.Message("Extracción de archivos", "Ocurrió un problema en el proceso de copia.");
          end
         end
        StatusDlg.SetMeterPos(0);
        StatusDlg.Hide(); 
        end
        Apz project:
        Attached Files

        Comment


        • Not what i asked for but ok i said does the rest of the function work part from the call back does it extract the rar file?

          Comment


          • Originally posted by rexzooly View Post
            Not what i asked for but ok i said does the rest of the function work part from the call back does it extract the rar file?
            yes ,if it makes the callback function to extract the file

            Comment


            • Originally posted by kauster View Post
              yes ,if it makes the callback function to extract the file
              No i said does the fucntion work apart from that? ok i going to take a back step as i don't have this plugin and i am having time to make a new one my self.

              sorry.

              Comment


              • How do I transfer this Plugin to run on AutoPlay Media Studio 8

                thank you

                Comment

                Working...
                X