diff options
author | Papoteur <papoteur@mageialinux-online.org> | 2015-04-04 11:38:46 +0200 |
---|---|---|
committer | Papoteur <papoteur@mageialinux-online.org> | 2015-04-04 11:38:46 +0200 |
commit | a2b0e25dbf0ca0064a07e94c61f941d7759f6c2f (patch) | |
tree | a552195f303c9fcf43ae77f8c27d87b1dba532a9 /mageiaSync/mageiasync.py | |
parent | 867454a4371871d616707dfa992395d2bd145d55 (diff) | |
download | MageiaSync-a2b0e25dbf0ca0064a07e94c61f941d7759f6c2f.tar MageiaSync-a2b0e25dbf0ca0064a07e94c61f941d7759f6c2f.tar.gz MageiaSync-a2b0e25dbf0ca0064a07e94c61f941d7759f6c2f.tar.bz2 MageiaSync-a2b0e25dbf0ca0064a07e94c61f941d7759f6c2f.tar.xz MageiaSync-a2b0e25dbf0ca0064a07e94c61f941d7759f6c2f.zip |
Adapt the command "Select All"
Resizing columns in Local list
Diffstat (limited to 'mageiaSync/mageiasync.py')
-rw-r--r-- | mageiaSync/mageiasync.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/mageiaSync/mageiasync.py b/mageiaSync/mageiasync.py index 59d875b..a871e12 100644 --- a/mageiaSync/mageiasync.py +++ b/mageiaSync/mageiasync.py @@ -3,7 +3,7 @@ from PyQt5.QtWidgets import ( QProgressDialog, QMainWindow, QDialog, QFileDialog, QApplication) from PyQt5.QtGui import ( QStandardItemModel,QStandardItem, QDesktopServices, ) -from PyQt5.QtCore import ( QLibraryInfo, QUrl ) +from PyQt5.QtCore import ( QLibraryInfo, QUrl, QItemSelectionModel ) from PyQt5 import QtCore # , Qt, QThread, QObject, pyqtSignal) import sys import mageiaSyncUI @@ -135,8 +135,9 @@ class IsosViewer(QMainWindow, mageiaSyncUI.Ui_mainWindow): # settings for the local list view self.localList.setModel(self.model) - self.localList.setColumnWidth(0,220) - self.localList.setColumnWidth(1,220) + self.localList.setColumnWidth(0,230) + self.localList.setColumnWidth(1,230) + self.localList.setColumnWidth(2,140) self.localList.horizontalHeader().setStretchLastSection(True) self.localList.setSelectionMode(0) # NoSelection # settings for local iso names management @@ -372,13 +373,14 @@ class IsosViewer(QMainWindow, mageiaSyncUI.Ui_mainWindow): def selectAllIsos(self): # Select or unselect the ISOs in remote list if self.selectAllState : - for i in range(self.modelRemote.count()): - self.modelRemote.item(i).setSelected(True) + selectMode = QItemSelectionModel.Select self.selectAll.setText(self.tr("Unselect &All")) else: - for i in range(self.modelRemote.count()): - self.modelRemote.item(i).setSelected(False) + selectMode = QItemSelectionModel.Deselect self.selectAll.setText(self.tr("Select &All")) + for i in range(self.modelRemote.rowCount()): + self.listIsos.selectionModel().select(self.modelRemote.index(i,0),QItemSelectionModel.Rows| + selectMode) # set flag to selected or deselected self.selectAllState=not self.selectAllState def connectActions(self): |