8 this file is part of the project scolasync
10 Copyright (C) 2010-2014 Georges Khaznadar <georgesk@ofset.org>
12 This program is free software: you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation, either version3 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program. If not, see <http://www.gnu.org/licenses/>.
29 import ownedUsbDisk, help, copyToDialog1, chooseInSticks, usbThread
30 import diskFull, preferences, checkBoxDialog
31 import os.path, operator, subprocess, dbus, re, time, copy
32 from notification
import Notification
33 from usbDisk2
import safePath
37 from globaldef
import logFileName, _dir
55 global pastCommands, lastCommand
56 if cmd
in pastCommands:
57 pastCommands[cmd].append(partition.owner)
59 pastCommands[cmd]=[partition.owner]
70 QMainWindow.__init__(self)
71 QWidget.__init__(self, parent)
73 from Ui_mainWindow
import Ui_MainWindow
74 self.
ui = Ui_MainWindow()
76 self.
copyfromIcon=QIcon(
"/usr/share/icons/Tango/scalable/actions/back.svg")
77 self.
movefromIcon=QIcon(
"/usr/share/scolasync/images/movefrom.svg")
79 self.
namesFullIcon=QIcon(
"/usr/share/icons/Tango/scalable/actions/gtk-find-and-replace.svg")
80 self.
namesEmptyIcon=QIcon(
"/usr/share/icons/Tango/scalable/actions/gtk-find.svg")
81 self.
namesFullTip=QApplication.translate(
"MainWindow",
"<br />Des noms sont disponibles pour renommer les prochains baladeurs que vous brancherez",
None, QApplication.UnicodeUTF8)
82 self.
namesEmptyTip=QApplication.translate(
"MainWindow",
"<br />Cliquez sur ce bouton pour préparer une liste de noms afin de renommer les prochains baladeurs que vous brancherez",
None, QApplication.UnicodeUTF8)
88 self.
t=self.ui.tableView
89 self.
proxy=QSortFilterProxyModel()
90 self.proxy.setSourceModel(self.t.model())
96 QObject.connect(self.ui.helpButton, SIGNAL(
"clicked()"), self.
help)
97 QObject.connect(self.ui.umountButton, SIGNAL(
"clicked()"), self.
umount)
98 QObject.connect(self.ui.toButton, SIGNAL(
"clicked()"), self.
copyTo)
99 QObject.connect(self.ui.fromButton, SIGNAL(
"clicked()"), self.
copyFrom)
100 QObject.connect(self.ui.delButton, SIGNAL(
"clicked()"), self.
delFiles)
101 QObject.connect(self.ui.redoButton, SIGNAL(
"clicked()"), self.
redoCmd)
102 QObject.connect(self.ui.namesButton, SIGNAL(
"clicked()"), self.
namesCmd)
103 QObject.connect(self.ui.preferenceButton, SIGNAL(
"clicked()"), self.
preference)
104 QObject.connect(self.ui.tableView, SIGNAL(
"doubleClicked(const QModelIndex&)"), self.
tableClicked)
105 QObject.connect(self,SIGNAL(
"checkAll()"), self.
checkAll)
106 QObject.connect(self,SIGNAL(
"checkToggle()"), self.
checkToggle)
107 QObject.connect(self,SIGNAL(
"checkNone()"), self.
checkNone)
108 QObject.connect(self,SIGNAL(
"shouldNameDrive()"), self.
namingADrive)
110 qApp.available.addHook(
'object-added', self.
cbAdded())
111 qApp.available.addHook(
'object-removed', self.
cbRemoved())
112 self.connect(self, SIGNAL(
"pushCmd(QString, QString)"), self.
pushCmd)
113 self.connect(self, SIGNAL(
"popCmd(QString, QString)"), self.
popCmd)
122 global activeThreads, pastCommands, lastCommand
123 if owner
in activeThreads:
124 activeThreads[owner].append(cmd)
126 activeThreads[owner]=[cmd]
127 self.tm.updateOwnerColumn()
137 global activeThreads, pastCommands, lastCommand
138 if owner
in activeThreads:
139 cmd0=activeThreads[owner].pop()
141 msg=cmd.replace(cmd0,
"")+
"\n"
142 logFile=open(os.path.expanduser(logFileName),
"a")
146 raise Exception((
"mismatched commands\n%s\n%s" %(cmd,cmd0)))
147 if len(activeThreads[owner])==0:
148 activeThreads.pop(owner)
150 raise Exception(
"End of command without a begin.")
151 self.tm.updateOwnerColumn()
152 if len(activeThreads)==0 :
163 index0=model.createIndex(0,0)
164 index1=model.createIndex(len(model.donnees)-1,0)
165 srange=QItemSelectionRange(index0,index1)
166 for i
in srange.indexes():
167 checked=i.model().data(i,Qt.DisplayRole).toBool()
168 model.setData(i, boolFunc(checked),Qt.EditRole)
201 hint=db.readStudent(disk.serial, disk.uuid, ownedUsbDisk.tattooInDir(disk.mp))
207 nameList=self.namesDialog.itemStrings(),
208 driveIdent=(stickId, uuid, tattoo))
219 def _cbAdded(man, obj):
220 if qApp.available.modified:
225 qApp.available.modified=
False
234 def _cbRemoved(man, obj):
235 if qApp.available.modified:
237 if path
in qApp.available.targets:
241 qApp.available.modified=
False
270 self.iconRedo.addPixmap(QPixmap(
"/usr/share/icons/Tango/scalable/actions/go-jump.svg"), QIcon.Normal, QIcon.Off)
272 self.iconStop.addPixmap(QPixmap(
"/usr/share/icons/Tango/scalable/actions/stop.svg"), QIcon.Normal, QIcon.Off)
274 self.
redoToolTip=QApplication.translate(
"MainWindow",
"Refaire à nouveau",
None, QApplication.UnicodeUTF8)
275 self.
redoStatusTip=QApplication.translate(
"MainWindow",
"Refaire à nouveau la dernière opération réussie, avec les baladeurs connectés plus récemment",
None, QApplication.UnicodeUTF8)
276 self.
stopToolTip=QApplication.translate(
"MainWindow",
"Arrêter les opérations en cours",
None, QApplication.UnicodeUTF8)
277 self.
stopStatusTip=QApplication.translate(
"MainWindow",
"Essaie d'arrêter les opérations en cours. À faire seulement si celles-ci durent trop longtemps",
None, QApplication.UnicodeUTF8)
291 self.
header=ownedUsbDisk.uDisk2.headers()
307 connectedCount=int(qApp.available)
308 self.ui.lcdNumber.display(connectedCount)
309 self.t.resizeColumnsToContents()
329 mappedIdx=self.proxy.mapFromSource(idx)
339 cmd=
"xdg-open '%s'" %idx.data().toString ()
340 subprocess.call(cmd, shell=
True)
341 elif "capacity" in h:
342 mount=idx.model().partition(idx).mountPoint()
343 dev,total,used,remain,pcent,path = self.
diskSizeData(mount)
344 pcent=int(pcent[:-1])
348 QMessageBox.warning(
None,
349 QApplication.translate(
"Dialog",
"Double-clic non pris en compte",
None, QApplication.UnicodeUTF8),
350 QApplication.translate(
"Dialog",
"pas d'action pour l'attribut {a}",
None, QApplication.UnicodeUTF8).format(a=h))
368 if type(rowOrDev)==type(0):
369 path=qApp.available[rowOrDev][self.header.index(
"1mp")]
373 dfOutput=subprocess.Popen(cmd, shell=
True, stdout=subprocess.PIPE).communicate()[0]
374 dfOutput=str(dfOutput.split(b
"\n")[-2])
375 m = re.match(
"(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+).*", dfOutput).groups()
389 s=db.readStudent(d.stickid, d.uuid, d.tattoo())
392 elif s==
None and defaultDisk==
None :
404 student=
"%s" %self.tm.data(idx,Qt.DisplayRole).toString()
406 ownedUsbDisk.editRecord(self.
diskFromOwner(student), hint=student)
425 self.ui.namesButton.setIcon(icon)
426 self.ui.namesButton.setToolTip(msg)
427 self.ui.namesButton.setStatusTip(msg.replace(
"<br />",
""))
440 global activeThreads, lastCommand
441 active = len(qApp.available)>0
442 for button
in (self.ui.toButton,
445 self.ui.umountButton):
446 button.setEnabled(active)
456 if len(activeThreads) > 0:
457 self.ui.redoButton.setIcon(self.
iconStop)
460 self.ui.redoButton.setEnabled(
True)
463 self.ui.redoButton.setIcon(self.
iconRedo)
466 self.ui.redoButton.setEnabled(lastCommand!=
None)
467 l=self.namesDialog.ui.listWidget.findItems(
"*",Qt.MatchWildcard)
479 pref.setValues(db.readPrefs())
482 if pref.result()==QDialog.Accepted:
483 db.writePrefs(pref.values())
492 titre1=QApplication.translate(
"Dialog",
"Choix de fichiers à supprimer",
None, QApplication.UnicodeUTF8)
493 titre2=QApplication.translate(
"Dialog",
"Choix de fichiers à supprimer (jokers autorisés)",
None, QApplication.UnicodeUTF8)
497 pathList=d.pathList()
498 buttons=QMessageBox.Ok|QMessageBox.Cancel
499 defaultButton=QMessageBox.Cancel
500 reply=QMessageBox.warning(
502 QApplication.translate(
"Dialog",
"Vous allez effacer plusieurs baladeurs",
None, QApplication.UnicodeUTF8),
503 QApplication.translate(
"Dialog",
"Etes-vous certain de vouloir effacer : "+
"\n".join(pathList),
None, QApplication.UnicodeUTF8),
504 buttons, defaultButton)
505 if reply == QMessageBox.Ok:
506 cmd=
"usbThread.threadDeleteInUSB(p,{paths},subdir='Travail', logfile='{log}', parent=self)".format(paths=pathList,log=logFileName)
507 for p
in qApp.available:
508 if not p.selected:
continue
513 self.oldThreads.add(t)
516 msgBox=QMessageBox.warning(
518 QApplication.translate(
"Dialog",
"Aucun fichier sélectionné",
None, QApplication.UnicodeUTF8),
519 QApplication.translate(
"Dialog",
"Veuillez choisir au moins un fichier",
None, QApplication.UnicodeUTF8))
530 cmd=
"usbThread.threadCopyToUSB(p,{selected},subdir='{subdir}', logfile='{logfile}', parent=self)".format(selected=list(d.selectedList()), subdir=self.
workdir, logfile=logFileName)
532 for p
in qApp.available:
533 if not p.selected:
continue
538 self.oldThreads.add(t)
541 msgBox=QMessageBox.warning(
543 QApplication.translate(
"Dialog",
"Aucun fichier sélectionné",
None, QApplication.UnicodeUTF8),
544 QApplication.translate(
"Dialog",
"Veuillez choisir au moins un fichier",
None, QApplication.UnicodeUTF8))
552 titre1=QApplication.translate(
"Dialog",
"Choix de fichiers à copier",
None, QApplication.UnicodeUTF8)
553 titre2=QApplication.translate(
"Dialog",
"Choix de fichiers à copier depuis les baladeurs",
None, QApplication.UnicodeUTF8)
554 okPrompt=QApplication.translate(
"Dialog",
"Choix de la destination ...",
None, QApplication.UnicodeUTF8)
558 msgBox=QMessageBox.warning(
None,
559 QApplication.translate(
"Dialog",
"Aucun fichier sélectionné",
None, QApplication.UnicodeUTF8),
560 QApplication.translate(
"Dialog",
"Veuillez choisir au moins un fichier",
None, QApplication.UnicodeUTF8))
563 pathList=d.pathList()
564 mp=d.selectedDiskMountPoint()
565 initialPath=os.path.expanduser(
"~")
566 destDir = QFileDialog.getExistingDirectory(
568 QApplication.translate(
"Dialog",
"Choisir un répertoire de destination",
None, QApplication.UnicodeUTF8),
570 if destDir
and len(destDir)>0 :
572 cmd=
"""usbThread.threadMoveFromUSB(
573 p,{paths},subdir=self.workdir,
574 rootPath='{mp}', dest='{dest}', logfile='{log}',
575 parent=self)""".format(paths=pathList, mp=mp, dest=destDir, log=logFileName)
577 cmd=
"""usbThread.threadCopyFromUSB(
578 p,{paths},subdir=self.workdir,
579 rootPath='{mp}', dest='{dest}', logfile='{log}',
580 parent=self)""".format(paths=pathList, mp=mp, dest=destDir, log=logFileName)
582 for p
in qApp.available:
583 if not p.selected:
continue
593 self.oldThreads.add(t)
595 buttons=QMessageBox.Ok|QMessageBox.Cancel
596 defaultButton=QMessageBox.Cancel
597 if QMessageBox.question(
599 QApplication.translate(
"Dialog",
"Voir les copies",
None, QApplication.UnicodeUTF8),
600 QApplication.translate(
"Dialog",
"Voulez-vous voir les fichiers copiés ?",
None, QApplication.UnicodeUTF8),
601 buttons, defaultButton)==QMessageBox.Ok:
602 subprocess.call(
"xdg-open '%s'" %destDir,shell=
True)
605 msgBox=QMessageBox.warning(
607 QApplication.translate(
"Dialog",
"Destination manquante",
None, QApplication.UnicodeUTF8),
608 QApplication.translate(
"Dialog",
"Veuillez choisir une destination pour la copie des fichiers",
None, QApplication.UnicodeUTF8))
617 global lastCommand, pastCommands, activeThreads
618 if len(activeThreads)>0:
622 thread._Thread__stop()
623 print (str(thread.getName()) +
' is terminated')
625 print (str(thread.getName()) +
' could not be terminated')
627 if lastCommand==
None:
629 if QMessageBox.question(
631 QApplication.translate(
"Dialog",
"Réitérer la dernière commande",
None, QApplication.UnicodeUTF8),
632 QApplication.translate(
"Dialog",
"La dernière commande était<br>{cmd}<br>Voulez-vous la relancer avec les nouveaux baladeurs ?",
None, QApplication.UnicodeUTF8).format(cmd=lastCommand))==QMessageBox.Cancel:
634 for p
in qApp.available:
635 if p.owner
in pastCommands[lastCommand] :
continue
636 exec(compile(lastCommand,
'<string>',
'exec'))
639 self.oldThreads.add(t)
640 pastCommands[lastCommand].append(p.owner)
648 self.namesDialog.show()
664 buttons=QMessageBox.Ok|QMessageBox.Cancel
665 defaultButton=QMessageBox.Cancel
666 button=QMessageBox.question (
668 QApplication.translate(
"Main",
"Démontage des baladeurs",
None, QApplication.UnicodeUTF8),
669 QApplication.translate(
"Main",
"Êtes-vous sûr de vouloir démonter tous les baladeurs cochés de la liste ?",
None, QApplication.UnicodeUTF8),
670 buttons,defaultButton)
671 if button!=QMessageBox.Ok:
673 for d
in qApp.available.disks_ud():
674 for partition
in qApp.available.parts_ud(d.path):
676 cmd=
"umount {0}".format(partition.mp)
677 subprocess.call(cmd, shell=
True)
678 cmd=
"udisks --detach {0}".format(d.devStuff)
679 subprocess.call(cmd, shell=
True)
692 if h
in ownedUsbDisk.uDisk2._itemNames:
693 self.visibleheader.append(self.tr(ownedUsbDisk.uDisk2._itemNames[h]))
695 self.visibleheader.append(h)
697 self.t.setModel(self.
tm)
701 self.proxy.setSourceModel(self.t.model())
709 return len(one.targets) == len(two.targets)
and \
710 set([p.uniqueId()
for p
in one]) == set([p.uniqueId()
for p
in two])
724 def __init__(self, parent=None, header=[], donnees=None):
725 QAbstractTableModel.__init__(self,parent)
736 self.emit(SIGNAL(
"dataChanged(QModelIndex, QModelIndex)"), self.index(0,column), self.index(len(self.
donnees)-1, column))
737 self.pere.t.viewport().update()
754 if index.column()==0:
755 self.
donnees[index.row()].selected=value
758 return QAbstractTableModel.setData(self, index, role)
766 return self.
donnees[index.row()][-1]
769 if not index.isValid():
771 elif role==Qt.ToolTipRole:
773 h=self.pere.header[c]
775 return QApplication.translate(
"Main",
"Cocher ou décocher cette case en cliquant.<br><b>Double-clic</b> pour agir sur plusieurs baladeurs.",
None, QApplication.UnicodeUTF8)
777 return QApplication.translate(
"Main",
"Propriétaire de la clé USB ou du baladeur ;<br><b>Double-clic</b> pour modifier.",
None, QApplication.UnicodeUTF8)
779 return QApplication.translate(
"Main",
"Point de montage de la clé USB ou du baladeur ;<br><b>Double-clic</b> pour voir les fichiers.",
None, QApplication.UnicodeUTF8)
780 elif "capacity" in h:
781 return QApplication.translate(
"Main",
"Capacité de la clé USB ou du baladeur en kO ;<br><b>Double-clic</b> pour voir la place occupée.",
None, QApplication.UnicodeUTF8)
783 return QApplication.translate(
"Main",
"Fabricant de la clé USB ou du baladeur.",
None, QApplication.UnicodeUTF8)
785 return QApplication.translate(
"Main",
"Modèle de la clé USB ou du baladeur.",
None, QApplication.UnicodeUTF8)
787 return QApplication.translate(
"Main",
"Numéro de série de la clé USB ou du baladeur.",
None, QApplication.UnicodeUTF8)
790 elif role != Qt.DisplayRole:
792 if index.row()<len(self.
donnees):
794 return QVariant(self.
donnees[index.row()][index.column()])
796 print(
"Le bug du retrait de clé non détecté a encore frappé, quand sera-t-il éliminé ?")
797 self.pere.findAllDisks()
804 if orientation == Qt.Horizontal
and role == Qt.DisplayRole:
805 return QVariant(self.
header[section])
806 elif orientation == Qt.Vertical
and role == Qt.DisplayRole:
807 return QVariant(section+1)
815 def sort(self, Ncol, order=Qt.DescendingOrder):
816 self.emit(SIGNAL(
"layoutAboutToBeChanged()"))
817 self.
donnees = sorted(self.
donnees, key=operator.itemgetter(Ncol))
818 if order == Qt.DescendingOrder:
819 self.donnees.reverse()
820 self.emit(SIGNAL(
"layoutChanged()"))
829 check_box_style_option=QStyleOptionButton()
830 check_box_rect = QApplication.style().subElementRect(QStyle.SE_CheckBoxIndicator,check_box_style_option)
831 check_box_point=QPoint(view_item_style_options.rect.x() + view_item_style_options.rect.width() / 2 - check_box_rect.width() / 2, view_item_style_options.rect.y() + view_item_style_options.rect.height() / 2 - check_box_rect.height() / 2)
832 return QRect(check_box_point, check_box_rect.size())
836 QStyledItemDelegate.__init__(self,parent)
838 def paint(self, painter, option, index):
839 checked = index.model().data(index, Qt.DisplayRole).toBool()
840 check_box_style_option=QStyleOptionButton()
841 check_box_style_option.state |= QStyle.State_Enabled
843 check_box_style_option.state |= QStyle.State_On
845 check_box_style_option.state |= QStyle.State_Off
847 QApplication.style().drawControl(QStyle.CE_CheckBox, check_box_style_option, painter)
850 if ((event.type() == QEvent.MouseButtonRelease)
or (event.type() == QEvent.MouseButtonDblClick)):
851 if (event.button() != Qt.LeftButton
or not CheckBoxRect(option).contains(event.pos())):
853 if (event.type() == QEvent.MouseButtonDblClick):
855 elif (event.type() == QEvent.KeyPress):
856 if event.key() != Qt.Key_Space
and event.key() != Qt.Key_Select:
860 checked = index.model().data(index, Qt.DisplayRole).toBool()
861 result = model.setData(index,
not checked, Qt.EditRole)
873 QStyledItemDelegate.__init__(self,parent)
874 self.
okPixmap=QPixmap(
"/usr/share/icons/Tango/16x16/status/weather-clear.png")
875 self.
busyPixmap=QPixmap(
"/usr/share/icons/Tango/16x16/actions/view-refresh.png")
877 def paint(self, painter, option, index):
879 text = index.model().data(index, Qt.DisplayRole).toString()
880 rect0=QRect(option.rect)
881 rect1=QRect(option.rect)
884 rect0.setSize(QSize(h,h))
886 rect1.setSize(QSize(w-h,h))
887 QApplication.style().drawItemText (painter, rect1, Qt.AlignLeft+Qt.AlignVCenter, option.palette,
True, text)
888 QApplication.style().drawItemText (painter, rect0, Qt.AlignCenter, option.palette,
True,
"O")
889 if text
in activeThreads:
890 QApplication.style().drawItemPixmap (painter, rect0, Qt.AlignCenter, self.
busyPixmap)
892 QApplication.style().drawItemPixmap (painter, rect0, Qt.AlignCenter, self.
okPixmap)
902 QStyledItemDelegate.__init__(self,parent)
905 def paint(self, painter, option, index):
906 text=index.model().data(index, Qt.DisplayRole).toString()
910 value = int(index.model().data(index, Qt.DisplayRole).toString())
912 rect0=QRect(option.rect)
913 rect1=QRect(option.rect)
914 rect0.translate(2,(rect0.height()-16)/2)
915 rect0.setSize(QSize(16,16))
916 rect1.translate(20,0)
917 rect1.setWidth(rect1.width()-20)
918 QApplication.style().drawItemText (painter, rect1, Qt.AlignLeft+Qt.AlignVCenter, option.palette,
True, text)
920 mount=index.model().partition(index).mountPoint()
921 dev,total,used,remain,pcent,path = self.parent().diskSizeData(mount)
922 pcent=int(pcent[:-1])
923 painter.setBrush(QBrush(QColor(
"slateblue")))
924 painter.drawPie(rect0,0,16*360*pcent/100)
931 suffixes=[
"B",
"KB",
"MB",
"GB",
"TB"]
934 while val > 1024
and i < len(suffixes):
937 return "%4.1f %s" %(val, suffixes[i])
def columnCount(self, parent)
un QModelIndex
def partition(self, index)
def updateButtons(self)
Désactive ou active les flèches selon que l'option correspondante est possible ou non...
def registerCmd(cmd, partition)
enregistre la commande cmd pour la partition donnée
def paint(self, painter, option, index)
def pushCmd(self, owner, cmd)
fonction de rappel déclenchée par les threads (au commencement)
def editOwner(self, idx)
Édition du propriétaire d'une clé.
def checkAll(self)
Coche tous les baladeurs.
def checkNone(self)
Décoche tous les baladeurs.
def findAllDisks
Initialisation du catalogue des disques USB connectés, et maintenance de l'interface graphique...
def checkModify(self, boolFunc)
Une classe qui fournit une collection de disques USB connectés, avec leurs propriétaires.
def diskSizeData(self, rowOrDev)
def setData(self, index, value, role)
def diskFromOwner(self, student)
trouve le disque qui correspond à un propriétaire, ou alors renvoie le premier disque inconnu...
def connectTableModel(self, data)
Connecte le modèle de table à la table.
def updateOwnerColumn(self)
force la mise à jour de la colonne des propriétaires
def copyTo(self)
Lance l'action de copier vers les clés USB.
def tableClicked(self, idx)
fonction de rappel pour un double clic sur un élément de la table
Un dialogue pour choisir un ensemble de fichiers à transférer vers une collection de clés USB...
def copyFrom(self)
Lance l'action de copier depuis les clés USB.
def namingADrive(self)
Gère un dialogue pour renommer un baladeur désigné par self.recentConnect.
def __init__
Le constructeur.
Un dialogue pour gérer les cases à cocher de l'application.
implémente un dialogue permettant de choisir des élèves les propriétés importantes sont self...
def __init__(self, parent)
def headerData(self, section, orientation, role)
def sameDiskData(self, one, two)
def rowCount(self, parent)
un QModelIndex
def initRedoStuff(self)
Initialise des données pour le bouton central (refaire/stopper)
un dialogue pour renommer un baladeur, compte tenu d'une liste de noms disponibles ...
def popCmd(self, owner, cmd)
fonction de rappel déclenchée par les threads (à la fin)
def __init__(self, parent)
def setAvailableNames(self, available)
Met à jour l'icône qui reflète la disponibilité de noms pour renommer automatiquement des baladeurs...
def deviceRemoved(self)
fonction de rappel pour un medium retiré ; se base sur la valeur de self.recentDisConnect ...
def preference(self)
lance le dialogue des préférences
def safePath(obj)
Récupère de façon sûre le path d'une instance de UDisksObjectProxy.
def changeWd(self, newDir)
change le répertoire par défaut contenant les fichiers de travail
def applyPreferences(self)
Applique les préférences et les options de ligne de commande.
def __init__(self, parent)
def data(self, index, role)
def CheckBoxRect(view_item_style_options)
def help(self)
Affiche le widget d'aide.
def umount(self)
Démonte et détache les clés USB affichées.
def sort
Sort table by given column number.
def editorEvent(self, event, model, option, index)
def cbRemoved(self)
Renvoie une fonction de rappel pour l'abonnement aux évènements de l'arrière-boutique.
Classe pour identifier le baladeur dans le tableau.
def namesCmd(self)
montre le dialogue de choix de nouveaux noms à partir d'un fichier administratif. ...
def redoCmd(self)
Relance la dernière commande, mais en l'appliquant seulement aux baladeurs nouvellement branchés...
def manageCheckBoxes(self)
ouvre un dialogue pour permettre de gérer les cases à cocher globalement
def paint(self, painter, option, index)
def paint(self, painter, option, index)
def checkToggle(self)
Inverse la coche des baladeurs.
Classe pour figurer la taille de la mémoire du baladeur.
def delFiles(self)
Lance l'action de supprimer des fichiers ou des répertoires dans les clés USB.
Un modèle de table pour des séries de clés USB.
def cbAdded(self)
Renvoie une fonction de rappel pour l'abonnement aux évènements de l'arrière-boutique.
def deviceAdded(self)
Fonction de rappel pour un medium ajouté ; se base sur la valeur de self.recentConnect.
Un dialogue pour choisir un ensemble de fichiers à copier depuis une clé USB.