modified: c/CtrlCheckLinks.rb

new file:   c/CtrlHistoLink.rb
	modified:   c/Main.rb
	modified:   fichier/haut.html
	deleted:    groupe3.html
	modified:   m/ReadFile.rb
	deleted:    m/ReadFolder.rb
	new file:   sauv/aa
	new file:   sauv/ff
	modified:   v/Vue1.rb
	new file:   v/VueHisto.rb
	new file:   v/VueMenu.rb
	modified:   v/VueResult.rb
This commit is contained in:
Quentin
2014-01-17 02:37:20 +01:00
parent e3cd387365
commit 7df4c9c289
13 changed files with 289 additions and 1971 deletions

View File

@ -1,33 +1,28 @@
# Classe creation de la vue de sélection de fichier ou dossier
class Vue1
def initialize(liste_dir, ctrl)
# Creation de la vue
def initialize(ctrl, title, type)
@ctrl = ctrl
#fenenetre generale
@window = Gtk::Window.new
@window.set_title('Saisie nom fichier')
@window.set_title(title)
#declaration des differents widgets
vb = Gtk::VBox.new(true, 6)
top = Gtk::HBox.new(false, 6)
bot = Gtk::HBox.new(false, 6)
###Partie supérieur fenetre###
#Creation du label de l'arbo
dir = Gtk::Label.new(liste_dir)
top.pack_start(dir, false, true, 6)
vb.pack_start(top)
##############################
###Partie Inferieur fenetre###
#creation label pour la saisie
lab = Gtk::Label.new('Chemin')
lab = Gtk::Label.new('Chemin :')
bot.pack_start(lab, false, true, 6)
#creation champ de saisie
@nom = Gtk::Entry.new
#@nom = Gtk::Entry.new
if (type == 1)
@nom = Gtk::FileChooserButton.new("choisir un fichier", Gtk::FileChooser::ACTION_OPEN)
else
@nom = Gtk::FileChooserButton.new("choisir un dossier ", Gtk::FileChooser::ACTION_SELECT_FOLDER)
end
@nom.set_current_folder("../fichier")
bot.pack_start(@nom, true, true)
#creation bouton de validation
@ -43,25 +38,27 @@ class Vue1
self.listenerDestroy
end
def getWindow
def getWindow #:nodoc:#
return @window
end
def getEntry
def getEntry #:nodoc:#
return @chaine
end
def listenerDestroy # Listener fermeture fenetre
@window.signal_connect('delete_event') {
@ctrl.destructionFen
# Listener fermeture fenetre
def listenerDestroy
@window.signal_connect('destroy') {
@ctrl.destructionFen
}
end
def listenerBouton #listener appuie validation
#Listener appuie bouton validation
def listenerBouton
@chaine = " "
@b.signal_connect('clicked'){
@chaine = @nom.text.to_s
if (@chaine =="")
@chaine = @nom.filename
if (@chaine =="") #gestion saisie vide
m = Gtk::MessageDialog.new(Gtk::Window.new, Gtk::Dialog::DESTROY_WITH_PARENT,
Gtk::MessageDialog::ERROR,
Gtk::MessageDialog::BUTTONS_CLOSE,
@ -69,16 +66,12 @@ class Vue1
m.run
m.destroy
else
@chaine = "../fichier/" + @chaine
if(File.directory?(@chaine))
if(File.directory?(@chaine)) #si c'est un dossier utilisation du controleur adéquat
@ctrl.recupUrlsDoss(@chaine)
else
if(File.exist?(@chaine))
if(File.exist?(@chaine)) #si c'est un fichier existant utilisation du controleur adéquat
@ctrl.recupUrls(@chaine)
else
else #gestion saisie invalide
d = Gtk::MessageDialog.new(Gtk::Window.new, Gtk::Dialog::DESTROY_WITH_PARENT,
Gtk::MessageDialog::ERROR,
Gtk::MessageDialog::BUTTONS_CLOSE,

78
v/VueHisto.rb Normal file
View File

@ -0,0 +1,78 @@
# Classe creation de la vue permettant d'aceder a l'historique
class VueHisto
# Creation de la vue
def initialize(ctrl, title)
@ctrl = ctrl
#fenenetre generale
@window = Gtk::Window.new
@window.set_title(title)
#declaration des differents widgets
vb = Gtk::VBox.new(true, 6)
bot = Gtk::HBox.new(false, 6)
#creation label pour la saisie
lab = Gtk::Label.new('Chemin du fichier a rejouer :')
bot.pack_start(lab, false, true, 6)
#creation champ de saisie
@nom = Gtk::FileChooserButton.new("choisir un fichier", Gtk::FileChooser::ACTION_OPEN)
@nom.set_current_folder("../sauv")
bot.pack_start(@nom, true, true)
#creation bouton de validation
@b = Gtk::Button.new('OK')
bot.pack_start(@b)
vb.pack_start(bot)
##############################
@window.add(vb)
# Abbonement fenetre au Listener
self.listenerBouton
self.listenerDestroy
end
def getWindow #:nodoc:#
return @window
end
def getEntry #:nodoc:#
return @chaine
end
# Listener fermeture fenetre
def listenerDestroy
@window.signal_connect('destroy') {
@ctrl.destructionFen
}
end
#Listener appuie bouton validation
def listenerBouton
@chaine = " "
@b.signal_connect('clicked'){
@chaine = @nom.filename
if (@chaine =="") #gestion saisie vide
m = Gtk::MessageDialog.new(Gtk::Window.new, Gtk::Dialog::DESTROY_WITH_PARENT,
Gtk::MessageDialog::ERROR,
Gtk::MessageDialog::BUTTONS_CLOSE,
"Erreur : Veuillez saisir un fichier !")
m.run
m.destroy
else
if(File.exist?(@chaine)) #si c'est un fichier existant utilisation du controleur adéquat
@ctrl.rejouer(@chaine)
else #gestion saisie invalide
d = Gtk::MessageDialog.new(Gtk::Window.new, Gtk::Dialog::DESTROY_WITH_PARENT,
Gtk::MessageDialog::ERROR,
Gtk::MessageDialog::BUTTONS_CLOSE,
"Erreur : Fichier inexistant !")
d.run
d.destroy
end
end
}
end
end

66
v/VueMenu.rb Normal file
View File

@ -0,0 +1,66 @@
#Classe creation vue du menu
class VueMenu
# Creation de la vue
def initialize(ctrl, title)
@ctrl = ctrl
#fenenetre generale
@window = Gtk::Window.new
@window.set_title(title)
#declaration des differents widgets
vb = Gtk::VBox.new(true, 6)
top = Gtk::HBox.new(false, 6)
#creation boutons
@newFile = Gtk::Button.new('Nouveau test fichier')
@newDoss = Gtk::Button.new('Nouveau test dossier')
@histo = Gtk::Button.new('Histo')
top.pack_start(@newFile)
top.pack_start(@newDoss)
top.pack_start(@histo)
vb.pack_start(top)
##############################
@window.add(vb)
# Abbonement fenetre au Listener
self.listenerBoutonNewFile
self.listenerBoutonNewDossier
self.listenerBoutonHisto
self.listenerDestroy
end
def getWindow #:nodoc:#
return @window
end
#Listener appuie bouton nouvelle vérification de 1 fichier
def listenerBoutonNewFile
@newFile.signal_connect('clicked'){
@ctrl.newVerifFile
}
end
#Listener appuie bouton validation nouvelle vérification de 1 dossier
def listenerBoutonNewDossier
@newDoss.signal_connect('clicked'){
@ctrl.newVerifDossier
}
end
#Listener appuie bouton validation pour rejouer un fichier dans de l'historique
def listenerBoutonHisto
@histo.signal_connect('clicke d'){
@ctrl.histo
}
end
# Listener fermeture fenetre Menu
def listenerDestroy
@window.signal_connect('destroy') {
@ctrl.destructionMenu
}
end
end

View File

@ -1,11 +1,16 @@
# Classe creation de la vue des resultats
class VueResult
# Creation de la vue
def initialize(liste_result, nom)
#fenenetre generale
@window = Gtk::Window.new
@window.set_title(nom)
#declaration des differents widgets
vb = Gtk::VBox.new(true, 6)
vh = Gtk::HBox.new(false, 6)
#creation label resultat
if(liste_result != "")
res = Gtk::Label.new(liste_result)
else
@ -14,18 +19,20 @@
vh.pack_start(res, false, true, 6)
vb.pack_start(vh)
# Abbonement fenetre au Listener
@window.add(vb)
self.listenerDestroy
end
def getWindow
def getWindow #:nodoc:#
return @window
end
def listenerDestroy
# Listener fermeture Resultat
def listenerDestroy
@window.signal_connect('destroy') {
@window.destroy
Gtk.main_quit
@window.destroy
Gtk.main_quit
}
end
end