This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
DUT2Curling/v/Vue1.rb

99 lines
3.0 KiB
Ruby
Raw Permalink Normal View History

# Classe creation de la vue de sélection de fichier ou dossier
class Vue1
modified: c/CtrlCheckLinks.rb modified: c/CtrlHistoLink.rb modified: c/Main.rb new file: doc/rdoc/CtrlCheckLinks.html new file: doc/rdoc/CtrlHistoLink.html new file: doc/rdoc/Menu.html new file: doc/rdoc/ReadFile.html new file: doc/rdoc/Vue1.html new file: doc/rdoc/VueHisto.html new file: doc/rdoc/VueMenu.html new file: doc/rdoc/VueResult.html new file: doc/rdoc/c/CtrlCheckLinks_rb.html new file: doc/rdoc/c/CtrlHistoLink_rb.html new file: doc/rdoc/c/Main_rb.html new file: doc/rdoc/c/hello_rb.html new file: doc/rdoc/created.rid new file: doc/rdoc/images/brick.png new file: doc/rdoc/images/brick_link.png new file: doc/rdoc/images/bug.png new file: doc/rdoc/images/bullet_black.png new file: doc/rdoc/images/bullet_toggle_minus.png new file: doc/rdoc/images/bullet_toggle_plus.png new file: doc/rdoc/images/date.png new file: doc/rdoc/images/find.png new file: doc/rdoc/images/loadingAnimation.gif new file: doc/rdoc/images/macFFBgHack.png new file: doc/rdoc/images/package.png new file: doc/rdoc/images/page_green.png new file: doc/rdoc/images/page_white_text.png new file: doc/rdoc/images/page_white_width.png new file: doc/rdoc/images/plugin.png new file: doc/rdoc/images/ruby.png new file: doc/rdoc/images/tag_green.png new file: doc/rdoc/images/wrench.png new file: doc/rdoc/images/wrench_orange.png new file: doc/rdoc/images/zoom.png new file: doc/rdoc/index.html new file: doc/rdoc/m/ReadFile_rb.html new file: doc/rdoc/rdoc.css new file: doc/rdoc/v/Vue1_rb.html new file: doc/rdoc/v/VueHisto_rb.html new file: doc/rdoc/v/VueMenu_rb.html new file: doc/rdoc/v/VueResult_rb.html modified: m/ReadFile.rb modified: v/Vue1.rb modified: v/VueHisto.rb modified: v/VueMenu.rb modified: v/VueResult.rb
2014-01-17 08:20:36 +00:00
# <b>Creation de la vue</b>
# * CtrlCheckLinks ctrl : controleur de la vue
# * String title : titre de la vue
# * int type : vue pour un fichier (==1) sinon pour un dossier
def initialize(ctrl, title, type)
@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)
modified: c/CtrlCheckLinks.rb modified: c/CtrlHistoLink.rb modified: c/Main.rb new file: doc/rdoc/CtrlCheckLinks.html new file: doc/rdoc/CtrlHistoLink.html new file: doc/rdoc/Menu.html new file: doc/rdoc/ReadFile.html new file: doc/rdoc/Vue1.html new file: doc/rdoc/VueHisto.html new file: doc/rdoc/VueMenu.html new file: doc/rdoc/VueResult.html new file: doc/rdoc/c/CtrlCheckLinks_rb.html new file: doc/rdoc/c/CtrlHistoLink_rb.html new file: doc/rdoc/c/Main_rb.html new file: doc/rdoc/c/hello_rb.html new file: doc/rdoc/created.rid new file: doc/rdoc/images/brick.png new file: doc/rdoc/images/brick_link.png new file: doc/rdoc/images/bug.png new file: doc/rdoc/images/bullet_black.png new file: doc/rdoc/images/bullet_toggle_minus.png new file: doc/rdoc/images/bullet_toggle_plus.png new file: doc/rdoc/images/date.png new file: doc/rdoc/images/find.png new file: doc/rdoc/images/loadingAnimation.gif new file: doc/rdoc/images/macFFBgHack.png new file: doc/rdoc/images/package.png new file: doc/rdoc/images/page_green.png new file: doc/rdoc/images/page_white_text.png new file: doc/rdoc/images/page_white_width.png new file: doc/rdoc/images/plugin.png new file: doc/rdoc/images/ruby.png new file: doc/rdoc/images/tag_green.png new file: doc/rdoc/images/wrench.png new file: doc/rdoc/images/wrench_orange.png new file: doc/rdoc/images/zoom.png new file: doc/rdoc/index.html new file: doc/rdoc/m/ReadFile_rb.html new file: doc/rdoc/rdoc.css new file: doc/rdoc/v/Vue1_rb.html new file: doc/rdoc/v/VueHisto_rb.html new file: doc/rdoc/v/VueMenu_rb.html new file: doc/rdoc/v/VueResult_rb.html modified: m/ReadFile.rb modified: v/Vue1.rb modified: v/VueHisto.rb modified: v/VueMenu.rb modified: v/VueResult.rb
2014-01-17 08:20:36 +00:00
#creation de label pour la saisie
lab = Gtk::Label.new('Chemin :')
bot.pack_start(lab, false, true, 6)
modified: c/CtrlCheckLinks.rb modified: c/CtrlHistoLink.rb modified: c/Main.rb new file: doc/rdoc/CtrlCheckLinks.html new file: doc/rdoc/CtrlHistoLink.html new file: doc/rdoc/Menu.html new file: doc/rdoc/ReadFile.html new file: doc/rdoc/Vue1.html new file: doc/rdoc/VueHisto.html new file: doc/rdoc/VueMenu.html new file: doc/rdoc/VueResult.html new file: doc/rdoc/c/CtrlCheckLinks_rb.html new file: doc/rdoc/c/CtrlHistoLink_rb.html new file: doc/rdoc/c/Main_rb.html new file: doc/rdoc/c/hello_rb.html new file: doc/rdoc/created.rid new file: doc/rdoc/images/brick.png new file: doc/rdoc/images/brick_link.png new file: doc/rdoc/images/bug.png new file: doc/rdoc/images/bullet_black.png new file: doc/rdoc/images/bullet_toggle_minus.png new file: doc/rdoc/images/bullet_toggle_plus.png new file: doc/rdoc/images/date.png new file: doc/rdoc/images/find.png new file: doc/rdoc/images/loadingAnimation.gif new file: doc/rdoc/images/macFFBgHack.png new file: doc/rdoc/images/package.png new file: doc/rdoc/images/page_green.png new file: doc/rdoc/images/page_white_text.png new file: doc/rdoc/images/page_white_width.png new file: doc/rdoc/images/plugin.png new file: doc/rdoc/images/ruby.png new file: doc/rdoc/images/tag_green.png new file: doc/rdoc/images/wrench.png new file: doc/rdoc/images/wrench_orange.png new file: doc/rdoc/images/zoom.png new file: doc/rdoc/index.html new file: doc/rdoc/m/ReadFile_rb.html new file: doc/rdoc/rdoc.css new file: doc/rdoc/v/Vue1_rb.html new file: doc/rdoc/v/VueHisto_rb.html new file: doc/rdoc/v/VueMenu_rb.html new file: doc/rdoc/v/VueResult_rb.html modified: m/ReadFile.rb modified: v/Vue1.rb modified: v/VueHisto.rb modified: v/VueMenu.rb modified: v/VueResult.rb
2014-01-17 08:20:36 +00:00
#creation du champ de saisie
#@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
@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
modified: c/CtrlCheckLinks.rb modified: c/CtrlHistoLink.rb modified: c/Main.rb new file: doc/rdoc/CtrlCheckLinks.html new file: doc/rdoc/CtrlHistoLink.html new file: doc/rdoc/Menu.html new file: doc/rdoc/ReadFile.html new file: doc/rdoc/Vue1.html new file: doc/rdoc/VueHisto.html new file: doc/rdoc/VueMenu.html new file: doc/rdoc/VueResult.html new file: doc/rdoc/c/CtrlCheckLinks_rb.html new file: doc/rdoc/c/CtrlHistoLink_rb.html new file: doc/rdoc/c/Main_rb.html new file: doc/rdoc/c/hello_rb.html new file: doc/rdoc/created.rid new file: doc/rdoc/images/brick.png new file: doc/rdoc/images/brick_link.png new file: doc/rdoc/images/bug.png new file: doc/rdoc/images/bullet_black.png new file: doc/rdoc/images/bullet_toggle_minus.png new file: doc/rdoc/images/bullet_toggle_plus.png new file: doc/rdoc/images/date.png new file: doc/rdoc/images/find.png new file: doc/rdoc/images/loadingAnimation.gif new file: doc/rdoc/images/macFFBgHack.png new file: doc/rdoc/images/package.png new file: doc/rdoc/images/page_green.png new file: doc/rdoc/images/page_white_text.png new file: doc/rdoc/images/page_white_width.png new file: doc/rdoc/images/plugin.png new file: doc/rdoc/images/ruby.png new file: doc/rdoc/images/tag_green.png new file: doc/rdoc/images/wrench.png new file: doc/rdoc/images/wrench_orange.png new file: doc/rdoc/images/zoom.png new file: doc/rdoc/index.html new file: doc/rdoc/m/ReadFile_rb.html new file: doc/rdoc/rdoc.css new file: doc/rdoc/v/Vue1_rb.html new file: doc/rdoc/v/VueHisto_rb.html new file: doc/rdoc/v/VueMenu_rb.html new file: doc/rdoc/v/VueResult_rb.html modified: m/ReadFile.rb modified: v/Vue1.rb modified: v/VueHisto.rb modified: v/VueMenu.rb modified: v/VueResult.rb
2014-01-17 08:20:36 +00:00
# <b>Listener fermeture fenetre</b>
def listenerDestroy
@window.signal_connect('destroy') {
@ctrl.destructionFen
}
end
modified: c/CtrlCheckLinks.rb modified: c/CtrlHistoLink.rb modified: c/Main.rb new file: doc/rdoc/CtrlCheckLinks.html new file: doc/rdoc/CtrlHistoLink.html new file: doc/rdoc/Menu.html new file: doc/rdoc/ReadFile.html new file: doc/rdoc/Vue1.html new file: doc/rdoc/VueHisto.html new file: doc/rdoc/VueMenu.html new file: doc/rdoc/VueResult.html new file: doc/rdoc/c/CtrlCheckLinks_rb.html new file: doc/rdoc/c/CtrlHistoLink_rb.html new file: doc/rdoc/c/Main_rb.html new file: doc/rdoc/c/hello_rb.html new file: doc/rdoc/created.rid new file: doc/rdoc/images/brick.png new file: doc/rdoc/images/brick_link.png new file: doc/rdoc/images/bug.png new file: doc/rdoc/images/bullet_black.png new file: doc/rdoc/images/bullet_toggle_minus.png new file: doc/rdoc/images/bullet_toggle_plus.png new file: doc/rdoc/images/date.png new file: doc/rdoc/images/find.png new file: doc/rdoc/images/loadingAnimation.gif new file: doc/rdoc/images/macFFBgHack.png new file: doc/rdoc/images/package.png new file: doc/rdoc/images/page_green.png new file: doc/rdoc/images/page_white_text.png new file: doc/rdoc/images/page_white_width.png new file: doc/rdoc/images/plugin.png new file: doc/rdoc/images/ruby.png new file: doc/rdoc/images/tag_green.png new file: doc/rdoc/images/wrench.png new file: doc/rdoc/images/wrench_orange.png new file: doc/rdoc/images/zoom.png new file: doc/rdoc/index.html new file: doc/rdoc/m/ReadFile_rb.html new file: doc/rdoc/rdoc.css new file: doc/rdoc/v/Vue1_rb.html new file: doc/rdoc/v/VueHisto_rb.html new file: doc/rdoc/v/VueMenu_rb.html new file: doc/rdoc/v/VueResult_rb.html modified: m/ReadFile.rb modified: v/Vue1.rb modified: v/VueHisto.rb modified: v/VueMenu.rb modified: v/VueResult.rb
2014-01-17 08:20:36 +00:00
# <b>Listener appuie bouton validation -> test liens fichier </b>
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 ou dossier !")
m.run
m.destroy
else
modified: c/CtrlCheckLinks.rb modified: c/CtrlHistoLink.rb modified: c/Main.rb new file: doc/rdoc/CtrlCheckLinks.html new file: doc/rdoc/CtrlHistoLink.html new file: doc/rdoc/Menu.html new file: doc/rdoc/ReadFile.html new file: doc/rdoc/Vue1.html new file: doc/rdoc/VueHisto.html new file: doc/rdoc/VueMenu.html new file: doc/rdoc/VueResult.html new file: doc/rdoc/c/CtrlCheckLinks_rb.html new file: doc/rdoc/c/CtrlHistoLink_rb.html new file: doc/rdoc/c/Main_rb.html new file: doc/rdoc/c/hello_rb.html new file: doc/rdoc/created.rid new file: doc/rdoc/images/brick.png new file: doc/rdoc/images/brick_link.png new file: doc/rdoc/images/bug.png new file: doc/rdoc/images/bullet_black.png new file: doc/rdoc/images/bullet_toggle_minus.png new file: doc/rdoc/images/bullet_toggle_plus.png new file: doc/rdoc/images/date.png new file: doc/rdoc/images/find.png new file: doc/rdoc/images/loadingAnimation.gif new file: doc/rdoc/images/macFFBgHack.png new file: doc/rdoc/images/package.png new file: doc/rdoc/images/page_green.png new file: doc/rdoc/images/page_white_text.png new file: doc/rdoc/images/page_white_width.png new file: doc/rdoc/images/plugin.png new file: doc/rdoc/images/ruby.png new file: doc/rdoc/images/tag_green.png new file: doc/rdoc/images/wrench.png new file: doc/rdoc/images/wrench_orange.png new file: doc/rdoc/images/zoom.png new file: doc/rdoc/index.html new file: doc/rdoc/m/ReadFile_rb.html new file: doc/rdoc/rdoc.css new file: doc/rdoc/v/Vue1_rb.html new file: doc/rdoc/v/VueHisto_rb.html new file: doc/rdoc/v/VueMenu_rb.html new file: doc/rdoc/v/VueResult_rb.html modified: m/ReadFile.rb modified: v/Vue1.rb modified: v/VueHisto.rb modified: v/VueMenu.rb modified: v/VueResult.rb
2014-01-17 08:20:36 +00:00
if(File.directory?(@chaine)) #si c'est un dossier -> utilisation du controleur adéquat
@ctrl.recupUrlsDoss(@chaine)
else
modified: c/CtrlCheckLinks.rb modified: c/CtrlHistoLink.rb modified: c/Main.rb new file: doc/rdoc/CtrlCheckLinks.html new file: doc/rdoc/CtrlHistoLink.html new file: doc/rdoc/Menu.html new file: doc/rdoc/ReadFile.html new file: doc/rdoc/Vue1.html new file: doc/rdoc/VueHisto.html new file: doc/rdoc/VueMenu.html new file: doc/rdoc/VueResult.html new file: doc/rdoc/c/CtrlCheckLinks_rb.html new file: doc/rdoc/c/CtrlHistoLink_rb.html new file: doc/rdoc/c/Main_rb.html new file: doc/rdoc/c/hello_rb.html new file: doc/rdoc/created.rid new file: doc/rdoc/images/brick.png new file: doc/rdoc/images/brick_link.png new file: doc/rdoc/images/bug.png new file: doc/rdoc/images/bullet_black.png new file: doc/rdoc/images/bullet_toggle_minus.png new file: doc/rdoc/images/bullet_toggle_plus.png new file: doc/rdoc/images/date.png new file: doc/rdoc/images/find.png new file: doc/rdoc/images/loadingAnimation.gif new file: doc/rdoc/images/macFFBgHack.png new file: doc/rdoc/images/package.png new file: doc/rdoc/images/page_green.png new file: doc/rdoc/images/page_white_text.png new file: doc/rdoc/images/page_white_width.png new file: doc/rdoc/images/plugin.png new file: doc/rdoc/images/ruby.png new file: doc/rdoc/images/tag_green.png new file: doc/rdoc/images/wrench.png new file: doc/rdoc/images/wrench_orange.png new file: doc/rdoc/images/zoom.png new file: doc/rdoc/index.html new file: doc/rdoc/m/ReadFile_rb.html new file: doc/rdoc/rdoc.css new file: doc/rdoc/v/Vue1_rb.html new file: doc/rdoc/v/VueHisto_rb.html new file: doc/rdoc/v/VueMenu_rb.html new file: doc/rdoc/v/VueResult_rb.html modified: m/ReadFile.rb modified: v/Vue1.rb modified: v/VueHisto.rb modified: v/VueMenu.rb modified: v/VueResult.rb
2014-01-17 08:20:36 +00:00
if(File.exist?(@chaine)) #si c'est un fichier -> existant utilisation du controleur adéquat
if(File.extname(@chaine)== ".txt" || File.extname(@chaine)== ".html" )
@ctrl.recupUrls(@chaine)
else
i = Gtk::MessageDialog.new(Gtk::Window.new, Gtk::Dialog::DESTROY_WITH_PARENT,
Gtk::MessageDialog::ERROR,
Gtk::MessageDialog::BUTTONS_CLOSE,
"Erreur : fichier extension invalide !")
i.run
i.destroy
end
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 ou dossier inexistant !")
d.run
d.destroy
end
end
end
}
end
end