Python PyQt5.QtWidgets.QFileDialog.DontUseNativeDialog() Examples

The following are 18 code examples of PyQt5.QtWidgets.QFileDialog.DontUseNativeDialog(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtWidgets.QFileDialog , or try the search function .
Example #1
Source File: menu_file.py    From ocelot with GNU General Public License v3.0 7 votes vote down vote up
def dialog_save_lattice(self):
        """Save lattice to file"""

        filename = QFileDialog.getSaveFileName(self.mw, 'Save Lattice', '', "Python Files (*.py);;All Files (*)", options=QFileDialog.DontUseNativeDialog)
        if filename[0] == '':
            return 0

        lp = Parser()
        lines = lp.gui_lattice2input(self.mw.lattice, split=True)

        if filename[1] == 'Python Files (*.py)' and filename[0][-3:] != '.py':
            filename = filename[0] + '.py'
        else:
            filename = filename[0]

        with open(filename, 'w') as fp:
            fp.writelines(lines) 
Example #2
Source File: DyStockTableWidget.py    From DevilYuan with MIT License 6 votes vote down vote up
def _saveAsAct(self):
        data = {}
        if not DyStockTableSelectDlg(data, '{0}保存'.format(self.getUniqueName())).exec_():
            return

        defaultFileName = '{0}.json' if data['all'] else '{0}_高亮.json'
        defaultFileName = defaultFileName.format(self.getUniqueName())

        defaultDir = DyCommon.createPath('Stock/User/Save/Strategy')
        fileName, _ = QFileDialog.getSaveFileName(None, '保存股票表', os.path.join(defaultDir, defaultFileName), "JSON files (*.json);;all files(*.*)", options=QFileDialog.DontUseNativeDialog)
        if fileName:
            self._saveAs(fileName, data['all']) 
Example #3
Source File: finder.py    From guiscrcpy with GNU General Public License v3.0 6 votes vote down vote up
def open_exe_name_dialog(parent, appname):
    options = QFileDialog.Options()
    options |= QFileDialog.DontUseNativeDialog
    file_name, _ = \
        QFileDialog.getOpenFileName(
            parent,
            "{} could not be found. Please locate it manually".format(appname),
            "",
            "Valid {} executable (*);;".format(appname),
            options=options
        )
    if file_name:
        print(file_name)
        return file_name
    else:
        print("No file is selected. guiscrcpy is likely to fail") 
Example #4
Source File: sparrowdialogs.py    From sparrow-wifi with GNU General Public License v3.0 5 votes vote down vote up
def openFileDialog(fileSpec="CSV Files (*.csv);;All Files (*)"):    
    options = QFileDialog.Options()
    options |= QFileDialog.DontUseNativeDialog
    fileName, _ = QFileDialog.getOpenFileName(None,"QFileDialog.getOpenFileName()", "",fileSpec, options=options)
    if fileName:
        return fileName
    else:
        return None 
Example #5
Source File: mainempresa.py    From controleEstoque with MIT License 5 votes vote down vote up
def UploadLogo(self):
        Dialog = QFileDialog()
        Dialog.setOption(QFileDialog.DontUseNativeDialog, True)

        fname = Dialog.getOpenFileName(
            self, "Selecionar Logo", "", "Image files (*.jpg *.png)")[0]

        self.lb_LogoEmpresa.setPixmap(QPixmap(fname).scaledToWidth(
            300, Qt.TransformationMode(Qt.FastTransformation)))
        # self.lb_LogoEmpresa.setScaledContents(True)
        self.bt_AddLogo.setHidden(True)
        self.bt_DelLogo.setVisible(True) 
Example #6
Source File: mainprodutos.py    From controleEstoque with MIT License 5 votes vote down vote up
def UploadImagem(self):
        Dialog = QFileDialog()
        Dialog.setOption(QFileDialog.DontUseNativeDialog, True)

        fname = Dialog.getOpenFileName(
            self, "Selecionar Imagem", "", "Image files (*.jpg *.png)")[0]

        self.lb_FotoProduto.setPixmap(QPixmap(fname).scaledToWidth(
            150, Qt.TransformationMode(Qt.FastTransformation)))
        # self.lb_FotoProduto.setScaledContents(True)
        self.bt_AddImagem.setHidden(True)
        self.bt_DelImagem.setVisible(True) 
Example #7
Source File: PlotFeatures.py    From tierpsy-tracker with MIT License 5 votes vote down vote up
def _get_save_name(self, ext):
        fullname = '{}_{}{}'.format(self.root_file, self.save_postfix ,ext)

        dialog = QFileDialog()
        
        dialog.selectFile(fullname)
        dialog.setOptions(QFileDialog.DontUseNativeDialog)
        dialog.setFileMode(QFileDialog.AnyFile)
        dialog.setAcceptMode(QFileDialog.AcceptSave)
        dialog.setNameFilters(['*' + ext])
        ret = dialog.exec();
        if (ret == QDialog.Accepted):
            fullname = dialog.selectedFiles()[0]
        return fullname 
Example #8
Source File: sparrowdialogs.py    From sparrow-wifi with GNU General Public License v3.0 5 votes vote down vote up
def openFileDialog(self):    
        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
        fileName, _ = QFileDialog.getOpenFileName(self,"QFileDialog.getOpenFileName()", "","CSV Files (*.csv);;All Files (*)", options=options)
        if fileName:
            return fileName
        else:
            return None 
Example #9
Source File: sparrowdialogs.py    From sparrow-wifi with GNU General Public License v3.0 5 votes vote down vote up
def saveFileDialog(self):    
        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
        fileName, _ = QFileDialog.getSaveFileName(self,"QFileDialog.getSaveFileName()","","HTML Files (*.html);;All Files (*)", options=options)
        if fileName:
            return fileName
        else:
            return None 
Example #10
Source File: sparrowdialogs.py    From sparrow-wifi with GNU General Public License v3.0 5 votes vote down vote up
def saveFileDialog(self):    
        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
        fileName, _ = QFileDialog.getSaveFileName(self,"QFileDialog.getSaveFileName()","","SQLite3 Files (*.sqlite3);;All Files (*)", options=options)
        if fileName:
            return fileName
        else:
            return None 
Example #11
Source File: sparrowdialogs.py    From sparrow-wifi with GNU General Public License v3.0 5 votes vote down vote up
def saveFileDialog(fileSpec="CSV Files (*.csv);;All Files (*)"):    
    options = QFileDialog.Options()
    options |= QFileDialog.DontUseNativeDialog
    fileName, _ = QFileDialog.getSaveFileName(None,"QFileDialog.getSaveFileName()","",fileSpec, options=options)
    if fileName:
        return fileName
    else:
        return None


# ------------------  Global functions for agent HTTP requests ------------------------------ 
Example #12
Source File: start.py    From Camelishing with MIT License 5 votes vote down vote up
def attach(self):

        try:

            options = QFileDialog.Options()
            options |= QFileDialog.DontUseNativeDialog
            fileName, _ = QFileDialog.getOpenFileName(self, options=options)
            osrep = fileName.replace("/","\\\\")
            self.attachment.setText(osrep)
        except Exception as f:
            t, o, tb = sys.exc_info()
            print(f,tb.tb_lineno) 
Example #13
Source File: start.py    From Camelishing with MIT License 5 votes vote down vote up
def selectPrivate(self):

        try:

            options = QFileDialog.Options()
            options |= QFileDialog.DontUseNativeDialog
            fileName, _ = QFileDialog.getOpenFileName(self, options=options)

            icodir = fileName.replace('/',"\\\\")

            self.privatekey.setText(icodir)
        except Exception as f:

            t, o, tb = sys.exc_info()
            print(f, tb.tb_lineno) 
Example #14
Source File: start.py    From Camelishing with MIT License 5 votes vote down vote up
def AgentIco(self):

        try:

            options = QFileDialog.Options()
            options |= QFileDialog.DontUseNativeDialog
            fileName, _ = QFileDialog.getOpenFileName(self, options=options)

            icodir = fileName.replace('/',"\\\\")

            self.fileico.setText(icodir)
        except Exception as f:

            t, o, tb = sys.exc_info()
            print(f, tb.tb_lineno) 
Example #15
Source File: DyStockTableWidget.py    From DevilYuan with MIT License 5 votes vote down vote up
def _export2JqkaAct(self):
        data = {}
        if not DyStockTableSelectDlg(data, '{0}导出到同花顺'.format(self.getUniqueName())).exec_():
            return

        defaultFileName = '{0}.sel' if data['all'] else '{0}_高亮.sel'
        defaultFileName = defaultFileName.format(self.getUniqueName())

        defaultDir = DyCommon.createPath('Stock/User/Save/Strategy/同花顺')
        fileName, _ = QFileDialog.getSaveFileName(None, '导出到同花顺', os.path.join(defaultDir, defaultFileName), "同花顺files (*.sel);;all files(*.*)", options=QFileDialog.DontUseNativeDialog)
        if fileName:
            self.export2Jqka(fileName) 
Example #16
Source File: menu_file.py    From ocelot with GNU General Public License v3.0 5 votes vote down vote up
def dialog_open_lattice(self):
        """Read lattice from file"""

        filename = QFileDialog.getOpenFileName(self.mw, 'Open Lattice', '', "Python Files (*.py);;All Files (*)", options=QFileDialog.DontUseNativeDialog)[0]
        if filename == '':
            return 0
            
        self.mw.lattice = GUILattice()    
        
        # executing opened file
        loc_dict = {}
        try:
            exec(open(filename).read(), globals(), loc_dict)
        except Exception as err:
            self.mw.error_window('Open Lattice File Error', str(err))
        
        # parsing sequences and create elements list from cell
        if 'cell' in loc_dict:
            self.mw.lattice.cell = deepcopy(loc_dict['cell'])
            lp = Parser()
            self.mw.lattice.elements = lp.get_elements(self.mw.lattice.cell)
        else:
            self.mw.error_window('Open Lattice File Error', 'NO secuence named "cell"')
        
        # parsing method
        if 'method' in loc_dict:
            self.mw.lattice.method = deepcopy(loc_dict['method'])
        
        # parsing beam
        if 'beam' in loc_dict:
            self.mw.lattice.beam = deepcopy(loc_dict['beam'])
        
        # parsing tws0
        if 'tws0' in loc_dict:
            self.mw.lattice.tws0 = deepcopy(loc_dict['tws0'])
        
        self.mw.menu_edit.edit_lattice() 
Example #17
Source File: window.py    From visma with GNU General Public License v3.0 4 votes vote down vote up
def loadEquations(self):
        options = QFileDialog.Options()
        options |= QFileDialog.DontUseNativeDialog
        fileName, _ = QFileDialog.getOpenFileName(self, "Add Custom Equations", "", "All Files (*);;Visma Files (*.vis)", options=options)
        if os.path.isfile(fileName):
            if os.path.getsize(fileName) == 0:
                return self.workSpace.warning("Input equations file is empty!")
            if self.workSpace.equations[0][0] == "No equations stored":
                self.workSpace.equations.pop(0)
            with open(fileName) as fileobj:
                for line in fileobj:
                    line = line.replace(' ', '').replace('\n', '')
                    if not any(line in item for item in self.workSpace.equations) and not (line.isspace() or line == ''):
                        self.workSpace.equations.insert(0, ('Equation No.' + str(len(self.workSpace.equations) + 1), line))
                self.workSpace.addEquation() 
Example #18
Source File: start.py    From Camelishing with MIT License 4 votes vote down vote up
def openmail(self):

        try:

            self.mail = list()

            options = QFileDialog.Options()
            options |= QFileDialog.DontUseNativeDialog
            fileName, _ = QFileDialog.getOpenFileName(self, options=options)

            say = 0
            nagato = ""
            notlist = list()
            yeslist = list()

            with open(fileName, 'r') as g:

                for k999 in g:
                    notlist.append(k999)

            with open(fileName, 'r') as f:

                if not fileName.endswith(".txt"):
                    self.ThreadMessage("Mail List Error", "Please Select '.txt' File" , "Info")

                else:
                    self.maillist.setText(fileName)
                    for _ in f:
                        mailReg = re.search(r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)", _)


                        if mailReg:

                            yeslist.append(_)
                            itemsTextList = [str(self.maillistWidget.item(i).text()) for i in
                                             range(self.maillistWidget.count())]
                            say += 1

                            if _ in itemsTextList:
                                pass
                            else:
                                self.maillistWidget.addItem(_)
                                self.mailliststatus.setText(" " * 21 + str(say) + " Email Added")

                                self.mail.append(_)

                    else:

                        ka = list(set(notlist)-set(yeslist))
                        count = 0

                        for ningendo in ka:
                            count += 1
                            nagato += "{}".format(count)+"- "+ningendo+"\n"

                        self.ThreadMessage("Mail Attach Error", "Not Email Adress;\n\n {}".format(nagato), "Info")
        except:

            pass