Commit 672a9ea5 authored by sveseli's avatar sveseli
Browse files

Merge branch '1.9.1' into release/1.9

parents e8a4e8b6 468aa7d7
#!/bin/sh
# Run command
if [ -z $DM_ROOT_DIR ]; then
cd `dirname $0` && myDir=`pwd`
setupFile=$myDir/../../setup.sh
if [ ! -f $setupFile ]; then
echo "Cannot find setup file: $setupFile"
exit 1
fi
source $setupFile > /dev/null
fi
source $DM_ROOT_DIR/bin/dm_command_setup.sh
eval "$DM_ROOT_DIR/src/python/dm/aps_beamline_tools/cli/daqCli.py $DM_COMMAND_ARGS"
#!/bin/sh
# Run command
if [ -z $DM_ROOT_DIR ]; then
cd `dirname $0` && myDir=`pwd`
setupFile=$myDir/../../setup.sh
if [ ! -f $setupFile ]; then
echo "Cannot find setup file: $setupFile"
exit 1
fi
source $setupFile > /dev/null
fi
source $DM_ROOT_DIR/bin/dm_command_setup.sh
eval "$DM_ROOT_DIR/src/python/dm/aps_beamline_tools/cli/uploadCli.py $DM_COMMAND_ARGS"
Release 1.10 (03/30/2018)
=============================
- Added support for command output in html format
- Added support for requesting only subset of keys for list of processing jobs
- Resolved issues with symbolic links for uploading directories and files
via rsync
- Fixed DAQ mode issue with double counting of observed files under certain
circumstances
- Fixed problem with cataloging of HDF5 files that contain non-ascii metadata
- DM Station GUI fixes/enhancements:
- Fixed issue with user permissions when creating new experiments
- Fixed upload configuration issue
- Fixed caching issues for experiment file metadata and users
- Added live metadata browsing while files load in background
- Added sorting for user table
- Added ability to copy table information to clipboard
- Improved selection behavior on tables
Release 1.9 (01/31/2018)
=============================
......
......@@ -17,5 +17,5 @@ DM_CAT_WEB_SERVICE_HOST=DM_HOSTNAME
DM_CAT_WEB_SERVICE_PORT=44436
DM_PROC_WEB_SERVICE_HOST=DM_HOSTNAME
DM_PROC_WEB_SERVICE_PORT=55536
DM_SOFTWARE_VERSION=1.9
DM_SOFTWARE_VERSION=1.10
......@@ -35,7 +35,7 @@ DM_HTTPD_DIR=${DM_OPT_DIR}/httpd/${DM_HOST_ARCH}
DM_LOG_DIR=${DM_INSTALL_DIR}/var/log/httpd
DM_PID_FILE=${DM_INSTALL_DIR}/var/run/dm.httpd.pid
DM_DAEMON_NAME=httpd
DM_DAEMON_NAME=dm.Httpd
DM_DAEMON_CONTROL_CMD=${DM_HTTPD_DIR}/bin/apachectl
DM_DAEMON_START_ARGS="start"
DM_DAEMON_STOP_ARGS="stop"
......@@ -88,6 +88,7 @@ case "$1" in
;;
restart)
stop
sleep 1
start
;;
status)
......
......@@ -118,7 +118,7 @@ stop() {
restart() {
stop
sleep 1
sleep 3
start
}
......
#!/bin/sh
# Helper script to start and stop monitor services
#MY_DIR=`dirname $0` && cd $MY_DIR && MY_DIR=`pwd`
MY_FILE=`readlink -f $0` && MY_DIR=`dirname $MY_FILE`
# The list below defines order of starting/stopping services
startList="nginx httpd nagios"
stopList="nagios httpd nginx"
restartList=$startList
statusList=$startList
# Check action
action=$1
case $action in
start|stop|restart|status)
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac
# Perform action
serviceList="\$"${action}List
serviceList=`eval "echo $serviceList"`
for service in $serviceList; do
$MY_DIR/dm-$service $action
sleep 1
done
......@@ -177,7 +177,7 @@ fi
case "$1" in
start)
echo -n "Starting nagios:"
echo -n "Starting dm.Nagios:"
if test "$checkconfig" = "true"; then
check_config
......@@ -202,7 +202,7 @@ case "$1" in
;;
stop)
echo -n "Stopping nagios:"
echo -n "Stopping dm.Nagios:"
pid_nagios
killproc_nagios TERM
......
......@@ -90,6 +90,7 @@ case "$1" in
;;
restart)
stop
sleep 1
start
;;
status)
......
#!/bin/sh
cd `dirname $0`/.. && DM_SBIN_DIR=`pwd`
$DM_SBIN_DIR/dm_system_test_upload.sh /home/dm/test
......@@ -29,6 +29,6 @@ $DM_ROOT_DIR/sbin/dm_station_upgrade_stage1.sh || exit 1
$DM_ROOT_DIR/sbin/dm_station_upgrade_stage2.sh $DM_SOFTWARE_VERSION || exit 1
$DM_ROOT_DIR/sbin/dm_station_upgrade_stage3.sh || exit 1
$DM_ROOT_DIR/sbin/dm_station_upgrade_stage4.sh || exit 1
echo "Spgrade to version $DM_SOFTWARE_VERSION - done"
echo "Station upgrade to version $DM_SOFTWARE_VERSION - done"
......@@ -36,9 +36,19 @@ DM_UPLOAD_LIST_FILE=$DM_SYSTEM_DIR/uploads.$DM_DATE.txt
echo "Station upgrade stage 1: list daqs/uploads"
# Only restart running daqs
dm-list-daqs --display-keys=experimentName,dataDirectory,status | grep running | awk '{print $1, $2}' | sort -u > $DM_DAQ_LIST_FILE || exit 1
if [ ! -f $DM_DAQ_LIST_FILE ]; then
echo "Creating DAQ list file: $DM_DAQ_LIST_FILE"
dm-list-daqs --display-keys=experimentName,dataDirectory,status | grep running | awk '{print $1, $2}' | sort -u > $DM_DAQ_LIST_FILE || exit 1
else
echo "Using existing DAQ list file: $DM_DAQ_LIST_FILE"
fi
# Restart all uploads other than those that are done
dm-list-uploads --display-keys=experimentName,dataDirectory,status | grep -v done | grep -v "system_test/upload" | awk '{print $1, $2}' | sort -u > $DM_UPLOAD_LIST_FILE || exit 1
if [ ! -f $DM_UPLOAD_LIST_FILE ]; then
echo "Creating upload list file: $DM_UPLOAD_LIST_FILE"
dm-list-uploads --display-keys=experimentName,dataDirectory,status | grep -v done | grep -v "system_test/upload" | awk '{print $1, $2}' | sort -u > $DM_UPLOAD_LIST_FILE || exit 1
else
echo "Using existing upload list file: $DM_UPLOAD_LIST_FILE"
fi
echo "Station upgrade stage 1: list daqs/uploads - done"
__version__ = "1.9 (2018.01.30)"
__version__ = "1.10 (2018.03.28)"
......@@ -6,6 +6,7 @@ from PyQt4.QtCore import Qt, QElapsedTimer
from dmApiFactory import DmApiFactory
from objects.userInfo import UserInfo
from datetime import date, datetime
from subclasses import customSelectionModel, customStyledDelegate
# Define the experiments tab content:
class AddExperimentTab(QWidget):
......@@ -33,6 +34,8 @@ class AddExperimentTab(QWidget):
self.lbl = QLabel(self.stationName + ' GUP List', self)
self.propToggle = QPushButton('Use ESAF DB', self)
self.startBtn = QPushButton('Use GUP', self)
self.propToggle.setFocusPolicy(Qt.NoFocus)
self.startBtn.setFocusPolicy(Qt.NoFocus)
if self.parent.onlyEsaf == 1:
self.propToggle.hide()
grid.addWidget(self.lbl, 0, 1, 1, 3)
......@@ -46,15 +49,18 @@ class AddExperimentTab(QWidget):
backBtn = QPushButton('Back', self)
backBtn.clicked.connect(self.checkBack)
backBtn.setFocusPolicy(Qt.NoFocus)
grid.addWidget(backBtn, 0, 0)
backBtn.setMaximumWidth(100)
self.runDropdown = QComboBox()
self.runDropdown.setFocusPolicy(Qt.NoFocus)
self.runDropdown.setMaximumWidth(130)
self.runDropdown.currentIndexChanged.connect(self.updateList)
self.updateDropdown()
self.detailBtn = QPushButton('Show Details', self)
self.detailBtn.setFocusPolicy(Qt.NoFocus)
self.detailBtn.clicked.connect(self.toggleDetails)
self.detailBtn.setMaximumWidth(130)
......@@ -62,10 +68,15 @@ class AddExperimentTab(QWidget):
self.tableWidget = QTableWidget()
self.tableWidget.cellDoubleClicked.connect(self.startProposal)
self.tableWidget.clicked.connect(self.enableButtons)
self.tableWidget.setSelectionMode(QAbstractItemView.SingleSelection)
self.tableWidget.setItemDelegate(customStyledDelegate.CustomStyledDelegate(self.tableWidget, self))
self.tableWidget.setSelectionModel(customSelectionModel.CustomSelectionModel(self, self.tableWidget.model()))
self.updateList()
self.detailsTable = QTableWidget()
self.detailsTable.setItemDelegate(customStyledDelegate.CustomStyledDelegate(self.detailsTable, self))
self.detailsTable.setSelectionModel(customSelectionModel.CustomSelectionModel(self, self.detailsTable.model()))
self.detailsTable.hide()
alternate = QPalette()
alternate.setColor(QPalette.AlternateBase, QColor.fromRgb(230, 241, 245))
alternate.setColor(QPalette.Base, QColor.fromRgb(255, 255, 255))
......@@ -75,6 +86,7 @@ class AddExperimentTab(QWidget):
self.tableWidget.setPalette(alternate)
modBtn = QPushButton('Continue Manually', self)
modBtn.setFocusPolicy(Qt.NoFocus)
modBtn.clicked.connect(self.startManual)
modBtn.setMaximumWidth(130)
......@@ -165,7 +177,7 @@ class AddExperimentTab(QWidget):
ids.append(proposal.get('id'))
self.tableWidget.setRowCount(len(self.proposalList))
self.tableWidget.setColumnCount(2)
self.tableWidget.setSelectionBehavior(QAbstractItemView.SelectRows)
self.tableWidget.setSelectionMode(QAbstractItemView.SingleSelection)
self.tableWidget.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.tableWidget.setHorizontalHeaderLabels('ID;Description;'.split(';'))
self.tableWidget.horizontalHeader().setStretchLastSection(True)
......@@ -237,6 +249,7 @@ class AddExperimentTab(QWidget):
objectAllUsers.append(userInfo)
userBadges.append(userInfo.getBadge())
self.parent.generalSettings = {'description': proposal.get('title')}
self.parent.expSwitched()
self.parent.currentUsers = objectAllUsers
QApplication.restoreOverrideCursor()
self.parent.GenParamsTab.fillParams(self.parent.genParamsTab)
......@@ -244,6 +257,7 @@ class AddExperimentTab(QWidget):
# Starts a blank experiment
def startManual(self):
self.parent.expSwitched()
self.parent.currentUsers = []
self.parent.generalSettings = {}
for x in self.parent.beamlineManagers:
......@@ -306,7 +320,7 @@ class AddExperimentTab(QWidget):
experimenters = proposal['experimenters']
self.detailsTable.setHorizontalHeaderLabels('Badge Number;First Name;Last Name;Institution'.split(';'))
self.detailsTable.setColumnCount(4)
self.detailsTable.setSelectionBehavior(QAbstractItemView.SelectRows)
self.detailsTable.setSelectionMode(QAbstractItemView.SingleSelection)
self.detailsTable.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.detailsTable.cellDoubleClicked.connect(lambda row, column: self.expandRow(row, column, self.detailsTable))
......@@ -363,6 +377,20 @@ class AddExperimentTab(QWidget):
else:
self.parent.setTab(0)
# Manually updates the tableView
def updateView(self):
if self.tableWidget.isVisible():
self.tableWidget.update()
else:
self.detailsTable.update()
# Signals the parent to handle the right click event
def contextMenuEvent(self, event):
if self.tableWidget.isVisible():
self.parent.handleRightClickMenu(self.tableWidget, event)
else:
self.parent.handleRightClickMenu(self.detailsTable, event)
# Error dialog to ensure the user selects an experiment to show details on
def selectProposalDialog(self):
msg = QMessageBox()
......
......@@ -4,6 +4,7 @@ from PyQt4.QtGui import QGridLayout, QSpacerItem, QSizePolicy, QPushButton, QWid
QFont, QLabel, QTableWidget, QTableWidgetItem, QColor, QAbstractItemView, QHBoxLayout, QPalette, QMessageBox
from PyQt4.QtCore import Qt
from dmApiFactory import DmApiFactory
from subclasses import customSelectionModel, customStyledDelegate
# Define the DAQs tab content:
class DaqsTab(QWidget):
......@@ -26,12 +27,14 @@ class DaqsTab(QWidget):
grid.addWidget(lbl, 0, 0, 1, 5)
self.backBtn = QPushButton('Back', self)
self.backBtn.setFocusPolicy(Qt.NoFocus)
self.backBtn.clicked.connect(self.toggleDetails)
self.backBtn.setMinimumWidth(100)
self.backBtn.hide()
grid.addWidget(self.backBtn, 0, 0, Qt.AlignLeft)
self.refreshBtn = QPushButton('Refresh', self)
self.refreshBtn.setFocusPolicy(Qt.NoFocus)
self.refreshBtn.setToolTip('Automatically refreshes every 60 seconds.')
self.refreshBtn.clicked.connect(self.parent.refreshTables)
self.refreshBtn.setMinimumWidth(100)
......@@ -44,6 +47,8 @@ class DaqsTab(QWidget):
self.tableWidget.clicked.connect(self.enableDetails)
self.tableWidget.cellDoubleClicked.connect(self.toggleDetails)
self.tableWidget.setSelectionMode(QAbstractItemView.SingleSelection)
self.tableWidget.setItemDelegate(customStyledDelegate.CustomStyledDelegate(self.tableWidget, self))
self.tableWidget.setSelectionModel(customSelectionModel.CustomSelectionModel(self, self.tableWidget.model()))
self.detailsTable = QTableWidget()
alternate = QPalette()
......@@ -51,22 +56,28 @@ class DaqsTab(QWidget):
alternate.setColor(QPalette.Base, QColor.fromRgb(255, 255, 255))
self.detailsTable.setAlternatingRowColors(True)
self.detailsTable.setPalette(alternate)
self.detailsTable.setItemDelegate(customStyledDelegate.CustomStyledDelegate(self.detailsTable, self))
self.detailsTable.setSelectionModel(customSelectionModel.CustomSelectionModel(self, self.detailsTable.model()))
grid.addWidget(self.detailsTable, 3, 0, 1, 5)
grid.addWidget(self.tableWidget, 3, 0, 1, 5)
addBtn = QPushButton('Start New', self)
addBtn.setFocusPolicy(Qt.NoFocus)
addBtn.clicked.connect(lambda: self.parent.tabs.setCurrentIndex(0))
addBtn.setMaximumWidth(130)
self.detailBtn = QPushButton('Show Details', self)
self.detailBtn.setFocusPolicy(Qt.NoFocus)
self.detailBtn.clicked.connect(self.toggleDetails)
self.detailBtn.setMaximumWidth(130)
self.clearBtn = QPushButton('Clear Selected', self)
self.clearBtn.setFocusPolicy(Qt.NoFocus)
self.clearBtn.clicked.connect(self.clearDaq)
self.clearBtn.setMaximumWidth(130)
self.stopBtn = QPushButton('Stop Selected', self)
self.stopBtn.setFocusPolicy(Qt.NoFocus)
self.stopBtn.clicked.connect(self.stopDaq)
self.stopBtn.setMaximumWidth(130)
......@@ -102,7 +113,7 @@ class DaqsTab(QWidget):
self.tableWidget.setRowCount(len(self.daqList))
self.tableWidget.setColumnCount(8)
self.tableWidget.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.tableWidget.setSelectionBehavior(QAbstractItemView.SelectRows)
self.tableWidget.setSelectionMode(QAbstractItemView.SingleSelection)
self.tableWidget.setHorizontalHeaderLabels('Name;Status;Start Date;Files;Processed;Waiting;Errors;% Completed;'.split(';'))
self.tableWidget.horizontalHeader().setStretchLastSection(True)
......@@ -218,7 +229,7 @@ class DaqsTab(QWidget):
self.detailsTable.setRowCount(len(allInfo.data))
self.detailsTable.setColumnCount(2)
self.detailsTable.setSelectionBehavior(QAbstractItemView.SelectRows)
self.detailsTable.setSelectionMode(QAbstractItemView.SingleSelection)
self.detailsTable.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.detailsTable.setHorizontalHeaderLabels('Parameter;Value'.split(';'))
self.detailsTable.horizontalHeader().setStretchLastSection(True)
......@@ -251,3 +262,17 @@ class DaqsTab(QWidget):
# Enables the detail button when the table is selected
def enableDetails(self):
self.detailBtn.setEnabled(True)
# Manually updates the tableView
def updateView(self):
if self.tableWidget.isVisible():
self.tableWidget.update()
else:
self.detailsTable.update()
# Signals the parent to handle the right click event
def contextMenuEvent(self, event):
if self.tableWidget.isVisible():
self.parent.handleRightClickMenu(self.tableWidget, event)
else:
self.parent.handleRightClickMenu(self.detailsTable, event)
......@@ -2,7 +2,7 @@
import sys
import os
from PyQt4.QtGui import QMainWindow, QStackedLayout, QApplication, QWidget, QTabWidget, QSplashScreen, QPixmap
from PyQt4.QtGui import QMainWindow, QStackedLayout, QApplication, QWidget, QTabWidget, QSplashScreen, QPixmap, QMenu, QAction, QCursor
from PyQt4.QtCore import Qt, QTimer, QElapsedTimer
from time import sleep, time
......@@ -21,6 +21,8 @@ from manageUsersTab import ManageUsersTab
from genParamsTab import GenParamsTab
from fileTab import FileTab
#TODO: Make allUserTable sortable on FileTab
class DmStationUi(QMainWindow):
def __init__(self):
......@@ -144,6 +146,11 @@ class DmStationUi(QMainWindow):
elif newIndex == 4:
FileTab.updateList(self.fileTab)
# Run when experiment is switched
def expSwitched(self):
ManageUsersTab.experimentSwitched(self.manageUsersTab)
FileTab.experimentSwitched(self.fileTab)
# Gets the index of the current sub tab
def getTab(self):
return self.stackedLayout.currentIndex()
......@@ -166,6 +173,32 @@ class DmStationUi(QMainWindow):
def restoreCurrentUsers(self):
GenParamsTab.restoreCurrentUsers(self.genParamsTab)
# Returns the selected index from within a table, this is used for the unique highlighting functionality
def getSelectedIndex(self, table):
selectedRows = []
indexes = table.selectionModel().selectedIndexes()
for index in indexes:
selectedRows.append(index.row())
return indexes, selectedRows
# Capture the right click event and open a context menu
def handleRightClickMenu(self, table, event):
if table.selectionModel().selection().indexes():
index = table.selectionModel().selection().indexes()[0]
row, column = index.row(), index.column()
menu = QMenu(self)
copyAction = QAction("Copy", self)
copyAction.triggered.connect(lambda: self.copyAction(row, column, table))
menu.addAction(copyAction)
menu.popup(QCursor.pos())
def copyAction(self, row, column, table):
clipboard = ""
index = table.model().index(row, column)
clipboard += str(index.data().toString())
sysclip = QApplication.clipboard()
sysclip.setText(clipboard)
if __name__ == "__main__":
try:
......
......@@ -8,6 +8,7 @@ from dm.cat_web_service.api.fileCatApi import FileCatApi
from objects.userInfo import UserInfo
from datetime import datetime
from re import search
from subclasses import customSelectionModel, customStyledDelegate
# Define the experiments tab content:
class ExperimentsTab(QWidget):
......@@ -31,6 +32,7 @@ class ExperimentsTab(QWidget):
grid.addWidget(lbl, 0, 0, 1, 5)
refBtn = QPushButton('Refresh', self)
refBtn.setFocusPolicy(Qt.NoFocus)
refBtn.setToolTip('Automatically refreshes every 60 seconds.')
refBtn.clicked.connect(self.parent.refreshTables)
refBtn.setMinimumWidth(100)
......@@ -41,7 +43,8 @@ class ExperimentsTab(QWidget):
self.tableWidget = QTableWidget()
self.tableWidget.cellDoubleClicked.connect(self.setExperiment)
self.tableWidget.clicked.connect(self.enableButtons)
self.tableWidget.setSelectionMode(QAbstractItemView.SingleSelection)
self.tableWidget.setItemDelegate(customStyledDelegate.CustomStyledDelegate(self.tableWidget, self))
self.tableWidget.setSelectionModel(customSelectionModel.CustomSelectionModel(self, self.tableWidget.model()))
alternate = QPalette()
alternate.setColor(QPalette.AlternateBase, QColor.fromRgb(230, 241, 245))
alternate.setColor(QPalette.Base, QColor.fromRgb(255, 255, 255))
......@@ -50,14 +53,17 @@ class ExperimentsTab(QWidget):
grid.addWidget(self.tableWidget, 3, 0, 1, 5)
addBtn = QPushButton('Add Experiment', self)
addBtn.setFocusPolicy(Qt.NoFocus)
addBtn.clicked.connect(self.addExperiment)
addBtn.setMaximumWidth(130)
self.delBtn = QPushButton('Delete Experiment', self)
self.delBtn.setFocusPolicy(Qt.NoFocus)
self.delBtn.clicked.connect(self.deleteExperiment)
self.delBtn.setMaximumWidth(130)
self.modBtn = QPushButton('Use Selected', self)
self.modBtn.setFocusPolicy(Qt.NoFocus)
self.modBtn.clicked.connect(self.setExperiment)
self.modBtn.setMaximumWidth(130)
......@@ -82,7 +88,7 @@ class ExperimentsTab(QWidget):
self.experimentList = self.experimentDsApi.getExperimentsByStation(self.stationName)
self.tableWidget.setRowCount(len(self.experimentList))
self.tableWidget.setColumnCount(4)
self.tableWidget.setSelectionBehavior(QAbstractItemView.SelectRows)
self.tableWidget.setSelectionMode(QAbstractItemView.SingleSelection)
self.tableWidget.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.tableWidget.setHorizontalHeaderLabels('Name;Type;Start Date;Description;'.split(';'))
self.tableWidget.horizontalHeader().setStretchLastSection(True)
......@@ -122,6 +128,7 @@ class ExperimentsTab(QWidget):
date = datetime.strptime(match.group(), '%Y-%m-%d').strftime('%Y-%m-%d')
self.parent.generalSettings['endDate'] = QDate.fromString(date, 'yyyy-MM-dd')
userList = [self.userApi.getUserByUsername(user) for user in experiment.get('experimentUsernameList')]
self.parent.expSwitched()
self.parent.currentUsers = []
userBadges = []
for x in userList:
......@@ -142,6 +149,7 @@ class ExperimentsTab(QWidget):
# Removes all temporarily stored experiment data and switches to the correct page
def addExperiment(self):
self.parent.generalSettings = {}
self.parent.expSwitched()
self.parent.currentUsers = []
if self.parent.beamlineName or self.parent.onlyEsaf == 1:
self.parent.setTab(3)
......@@ -160,6 +168,7 @@ class ExperimentsTab(QWidget):
reply = QMessageBox.warning(self, "Delete Experiment", text, QMessageBox.Yes, QMessageBox.No)
if reply == QMessageBox.Yes:
self.experimentDsApi.deleteExperimentByName(name)
self.fileCatApi.deleteExperimentFileCollection(name)
self.parent.refreshTables()
# Enables the buttons after the user has clicked on a row
......@@ -167,3 +176,11 @@ class ExperimentsTab(QWidget):
self.delBtn.setEnabled(True)
self.modBtn.setEnabled(True)
# Manually updates the tableView
def updateView(self):
self.tableWidget.update()
# Signals the parent to handle the right click event
def contextMenuEvent(self, event):
self.parent.handleRightClickMenu(self.tableWidget, event)
......@@ -2,10 +2,10 @@
from PyQt4.QtGui import QGridLayout, QSpacerItem, QSizePolicy, QPushButton, QWidget, QTableView, \
QFont, QLabel, QTableWidget, QTableWidgetItem, QColor, QAbstractItemView, QHBoxLayout, QPalette, \
QSortFilterProxyModel, QLineEdit, QMessageBox
QSortFilterProxyModel, QLineEdit, QMessageBox, QApplication, QMenu, QAction, QCursor
from PyQt4.QtCore import Qt, QThread, SIGNAL, QElapsedTimer
from dmApiFactory import DmApiFactory
from subclasses import customAbstractTableModel
from subclasses import customAbstractTableModel, copySelectedCellsAction, customSelectionModel, customStyledDelegate
from operator import itemgetter
from math import ceil
import numpy
......@@ -40,6 +40,7 @@ class FileTab(QWidget):
grid.addWidget(self.lbl, 0, 0, 1, 5)
backBtn = QPushButton('Back', self)
backBtn.setFocusPolicy(Qt.NoFocus)
backBtn.clicked.connect(self.checkBack)
backBtn.setMinimumWidth(100)
grid.addWidget(backBtn, 0, 0, Qt.AlignLeft)
......@@ -63,6 +64,7 @@ class FileTab(QWidget):
self.filterPath.setMaximumWidth(100)
self.filterPath.setPlaceholderText("Path")
self.startFilter = QPushButton("Search")
self.startFilter.setFocusPolicy(Qt.NoFocus)
self.startFilter.clicked.connect(self.setFilter)
self.startFilter.setEnabled(False)
filterLayout = QHBoxLayout()
......@@ -75,7 +77,6 @@ class FileTab(QWidget):
grid.addWidget(self.startFilter, 3, 1)
#self.fileTableModel = customAbstractTableModel.CustomAbstractTableModel()
self.fileTableModel = customAbstractTableModel.Model()
self.proxyModelContact = QSortFilterProxyModel()
self.proxyModelContact.setSourceModel(self.fileTableModel)
......@@ -85,7 +86,8 @@ class FileTab(QWidget):
self.fileTableView.setPalette(alternate)
self.fileTableView.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.fileTableView.setSelectionMode(QAbstractItemView.SingleSelection)
self.fileTableView.setSelectionBehavior(QAbstractItemView.SelectRows)
self.fileTableView.setItemDelegate(customStyledDelegate.CustomStyledDelegate(self.fileTableView, self))
self.fileTableView.setSelectionModel(customSelectionModel.CustomSelectionModel(self, self.