Valdes-Tresanco-MS / AMDock-win

(Windows) AMDock: Assisted molecular docking with AutoDock4 and AutoDockVina
GNU General Public License v3.0
60 stars 20 forks source link

Unable to change the directory #5

Closed VirtualChemist closed 4 years ago

VirtualChemist commented 4 years ago

Hi, I think there is a problem with browsing the different directories. Clicking the folder to enter into different directories is not possible. Please have a look at this.

image

Valdes-Tresanco-MS commented 4 years ago

@VirtualChemist Can you give me a more detailed description? I cannot reproduce this problem.

VirtualChemist commented 4 years ago

Yes, here is the video I recorded. I did try to change the directory to some other location, but I failed to do it. This issue is also with AMDock for the Linux platform. The video is in ZIP format.

20200425_152502.zip

Valdes-Tresanco-MS commented 4 years ago

I have tested on my two computers, the development one (Dell G5 15 5587) and the test one (Toshiba A665) and I cannot reproduce the error. I use Windows 10 because Windows 7 (Ultimate v6.1.7600) is no longer supported by Microsoft. To try to reproduce this error I installed a virtual machine, but the program works correctly. I have also tested it with Linux Mint 19.3 and Ubuntu 18.04 and it works correctly. Did you try it in any of these versions? Searching I found that QFileDialog (function of Qt file dialog(PyQt4 v4.11.4) which uses system native file manager by default) has several reported bugs.

A possible solution may be to not use the native system dialog. For this add the following line just after line 104 in the file AMDock_folder/Lib/site-packages/AMDock/file_loader.py:

data_file.setOption (QtGui.QFileDialog.DontUseNativeDialog)

so that it is as in the image. image

I cannot know if it has an effect because in both cases the user interface is the same, it only changes the way in which PyQt generates the dialog window. If it works or not, please tell me, to fix it in program

VirtualChemist commented 4 years ago

Thanks for looking at the issues. I did as you suggested, by including the lines as specified. After adding and saving the files, when I double click AMDock.exe, the program start, but I faced the same issue of unable to change the directory. Issues remain.

Valdes-Tresanco-MS commented 4 years ago

Oh, it really is a shame. Let's try to exhaust all possibilities.

Do you have any other version of python installed on your computer? First, it would be to test this code in different versions of PyQt This is important to know if the qt bug is only in the version I am using or if the bug is related to the options that QFileDialog has.

try:
    from PyQt5 import QtWidgets as QtGui
    from PyQt5.QtCore import QT_VERSION_STR
    from PyQt5.Qt import PYQT_VERSION_STR
except ImportError as msg:
    print(msg, 'Trying to import PyQt4')
    from PyQt4 import QtGui
    from PyQt4.QtCore import QT_VERSION_STR
    from PyQt4.Qt import PYQT_VERSION_STR

from sip import SIP_VERSION_STR
import sys

print(sys.platform)
print("Qt version:", QT_VERSION_STR)
print("SIP version:", SIP_VERSION_STR)
print("PyQt version:", PYQT_VERSION_STR)

class Test(QtGui.QFileDialog):
    def __init__(self, parent=None):
        super(Test, self).__init__(parent)

        # self.setFileMode(QtGui.QFileDialog.DirectoryOnly)
        # self.setOption(QtGui.QFileDialog.ShowDirsOnly)
        if self.exec_():
            filenames = self.selectedFiles()
            print('Successful Test...')
            exit(0)
        else:
            print('Test Failed...')
            exit(1)

if __name__ == '__main__':
    import sys
    app = QtGui.QApplication(sys.argv)
    w = Test()
    sys.exit(app.exec_())

If it works this way (as simple as possible) then try uncommenting the two lines that set the FileMode and Option.

Second, if you can to create a virtual machine with Windows 10 and test the program and check if the error remain. It is important because some bugs of this nature are sometimes linked with software from the providers of the computer and the registry.

VirtualChemist commented 4 years ago

Thanks for the detailed information. Here what I did.

  1. I created a test.py to test the code as mentioned above. the outcome is mentioned in the figure. unfortunately, the program did not work and error was produced. This issue was found only in windows 7 machine. image

image

When I tested the same code in Windows 10 machine, it worked well. image

  1. Then, I created a Virtual machine for Windows 10 and the program worked well. image

I think the program did not support windows 7. Because I have tested this program in two different windows 7 machine.

Thanks

Valdes-Tresanco-MS commented 4 years ago

Will it be a hardware related bug? I tested it on a virtual machine with Windows 7 and it worked correctly. In the next few days I will install Windows 7 on my test laptop and I will tell you if it works. It would be a great help if you could try different versions of PyQt4 and see if they all have the same problem.

At the moment I think you will have to use Windows 10 :( Best Wishes

Valdes-Tresanco-MS commented 4 years ago

Without activity. If you have any questions about this topic, please reopen this issue. Best wishes