Exemple #1
0
    def commit_and_push(self):
        """
        Commit every marked file with a separate commit.
        Push at the end.
        Print error-message if an error occurred.
        """
        success = self.git_interactions.pull()
        if success:
            files = [item.text() for item in self.list_widget.selectedItems()]
            for file in files:
                pattern = re.compile(r'(\w\w\d\d\w)_ue')
                matches = pattern.search(file)
                group_name = ''
                if matches:
                    group_name = matches.group(1)
                message = self.commit_message_line_edit.text().format(group_name=group_name)

                success = self.git_interactions.commit_file(file, message)
                if not success:
                    break
            else:
                success = self.git_interactions.push()
        if success:
            QMessageBox.about(self, 'Erfolgreich', 'Dateien erfolgreich committet.')
        elif self.list_widget.selectedItems():
            QMessageBox.about(self, 'Fehler', 'Es gab einen Fehler beim Committen der neuen Dateien. \n'
                              'Bitte kontrollieren Sie das Git-Repository manuell.')
Exemple #2
0
 def addFunc(self):
     f1=random.randint(1, 99)
     self.tableModel.insertRows(0, 1)
     self.tableModel.setData(self.tableModel.index(0, 0), f1)
     self.tableModel.setData(self.tableModel.index(0, 1), "test")
     self.tableModel.submitAll()
     QMessageBox.about( self, 'addFuncCall', "addFunc")
Exemple #3
0
 def about(self):
     s = ('<b>PHYPNO Version {version}</b><br />'
          '<p>You can download the latest version at '
          '<a href="https://github.com/gpiantoni/phypno">'
          'https://github.com/gpiantoni/phypno</a> '
          'or you can upgrade to the latest release with:'
          '</p><p>'
          '<code>pip install --upgrade phypno</code>'
          '</p><p>'
          'Copyright &copy; 2013-{year} '
          '<a href="http://www.gpiantoni.com">Gio Piantoni</a>'
          '</p><p>'
          'This program is free software: you can redistribute it '
          'and/or modify it under the terms of the GNU General Public '
          'License as published by the Free Software Foundation, either '
          'version 3 of the License, or (at your option) any later version.'
          '</p><p>'
          'This program is distributed in the hope that it will be useful, '
          'but WITHOUT ANY WARRANTY; without even the implied warranty of '
          'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the '
          'GNU General Public License for more details.'
          '</p><p>'
          'You should have received a copy of the GNU General Public '
          'License along with this program.  If not, see '
          '<a href="http://www.gnu.org/licenses/">'
          'http://www.gnu.org/licenses/</a>.'
          '</p><p>'
          'Other licenses available, contact the author'
          '</p>')
     QMessageBox.about(self, 'PHYPNO', s.format(version=__version__,
                                                year=now.year))
 def gerar_export_excel(self):
     # Leitura da TableWidget da tela do programa
     if self.tableWidget.rowCount()== 0:
         QMessageBox.about(self,'Warning','Tabela de dados inexistente')
         return  None
     lista_tabela = list()
     cabecalhos = list()
     index_coluna = 0
     while index_coluna < self.tableWidget.columnCount():
         cabecalhos.append(self.tableWidget.horizontalHeaderItem(index_coluna).text())
         index_coluna = index_coluna + 1
     lista_tabela.append(cabecalhos)
     index_linha = 0
     while index_linha < self.tableWidget.rowCount():
         index_coluna = 0
         linha = list()
         while index_coluna < self.tableWidget.columnCount():
             if self.tableWidget.item(index_linha,index_coluna) != None:
                 linha.append(self.tableWidget.item(index_linha,index_coluna).text())
             else:
                 linha.append('-')
             index_coluna += 1
         lista_tabela.append(linha)
         index_linha += 1
     exportar = ExcelExport()
     exportar.exportacao(lista_tabela)
     QMessageBox.about(self,'Message','Arquivo exportado com sucesso')
Exemple #5
0
 def isConnectedToBoard(self):
     # check if the computer is connectted to the arduino board
     if self.connection.isNull():
         QMessageBox.about(self, "Missed Connection", "Please turn on the arduino and restart the program!" )
         return False
     else:
         return True
Exemple #6
0
    def on_start_import_pushButton_clicked(self):
        config = self.getCurrentConfig()
        dest_dir = config.get('hdf5', 'dir')
        if not os.path.exists(dest_dir) or not os.path.isdir(dest_dir):
            QMessageBox.about(self, "错误", '指定的目标数据存放目录不存在!')
            return

        if config.getboolean('tdx', 'enable') \
            and (not os.path.exists(config['tdx']['dir']
                 or os.path.isdir(config['tdx']['dir']))):
            QMessageBox.about(self, "错误", "请确认通达信安装目录是否正确!")
            return

        self.import_running = True
        self.start_import_pushButton.setEnabled(False)
        self.reset_progress_bar()

        self.import_status_label.setText("正在启动任务....")
        QApplication.processEvents()

        if self.tdx_radioButton.isChecked():
            self.hdf5_import_thread = UseTdxImportToH5Thread(config)
        else:
            self.hdf5_import_thread = UsePytdxImportToH5Thread(config)

        self.hdf5_import_thread.message.connect(self.on_message_from_thread)
        self.hdf5_import_thread.start()

        self.escape_time = 0.0
        self.escape_time_thread = EscapetimeThread()
        self.escape_time_thread.message.connect(self.on_message_from_thread)
        self.escape_time_thread.start()
Exemple #7
0
 def on_about(self):
     QMessageBox.about(self,
                       tr('MyWallet', 'About application'),
                       tr('MyWallet', 'MyWallet developed in June 2015\n'
                                      'author: Dmitry Voronin\n'
                                      'email: [email protected]\n'
                                      'version: %s') % MY_WALLET_VERSION_STR)
Exemple #8
0
    def on_about(self, event):
        """
        """
        # import os
        from PyQt5.QtWidgets import QMessageBox
        from pytripgui import __version__ as pytripgui_version
        from pytrip import __version__ as pytrip_version

        # with open(os.path.join(main_dir(), "res", "LICENSE.rst"), "rU") as fp:
        #     licence = fp.read()

        title = "PyTRiPGUI"
        text = ""
        text += "PyTRipGUI Version: " + pytripgui_version + "\n"
        text += "PyTRiP Version:" + pytrip_version + "\n"
        text += "\n"
        text += "(c) 2012 - 2018 PyTRiP98 Developers\n"
        # text += "<a href=\"https://github.com/pytrip/pytripgui\">'https://github.com/pytrip/pytripgui'</a>\n"
        # text += licence

        text += "    Niels Bassler\n"
        text += "    Leszek Grzanka\n"
        text += "\n"
        text += "Previous contributors:\n"
        text += "    Jakob Toftegaard\n"

        QMessageBox.about(self.app, title, text)
Exemple #9
0
    def __init__(self, parent=None):
        QMainWindow.__init__(self, parent)
        self.setWindowTitle('Shortcut')
        self.setWindowIcon(QIcon(os.path.join(os.curdir, 'icons/Shortcut.ico')))
        self.resize(300, 400)
        screenRect = QDesktopWidget().screenGeometry()
        self.move((screenRect.width() - self.width()) / 2, (screenRect.height() - self.height()) / 2)

        self.mainWidget = QWidget()
        self.gridlayout = QGridLayout()
        self.mainWidget.setLayout(self.gridlayout)
        self.setCentralWidget(self.mainWidget)

        try:
            configloader = ConfigLoader()
        except ConfigError as e:
            QMessageBox.about(self, 'Config Error', str(e))
            return

        for i, (title, action) in enumerate(configloader.config.items()):
            if 'open' in action[0]:
                button = OpenButton(title, action[1])
            elif 'edit' in action[0]:
                button = EditButton(title, action[1], action[2])
            elif 'cmd' in action[0]:
                button = CmdButton(title, action[1])
            else:
                continue

            colnum = 2
            self.gridlayout.addWidget(button, i / colnum, i % colnum)
Exemple #10
0
    def aboutBox(self):

        from PyQt5.QtCore import QT_VERSION_STR
        from PyQt5.Qt import PYQT_VERSION_STR
        from sip import SIP_VERSION_STR
        from ._version import get_versions
        __version__ = get_versions()["version"][:5]
        del get_versions
        from IPython import __version__ as IPython_version

        QMessageBox.about(self, "About ypkpathway",
                             """<b>Planning of yeast pathway kit constructions.</b>
                                <p>version: {}<br>
                                 Copyright 2015-2017 Björn Johansson.
                                 This software is released under a BSD style license.
                                 This software comes with no warranties
                                 expressed or implied.<br><br>
                                 Python version: {}<br><br>
                                 IPython version: {}<br>
                                 Qt version: {}<br>
                                 SIP version: {}<br>
                                 PyQt version: {}<br>
                                 pydna version: {}<br></p>
                                 """.format(__version__,
                                            sys.version,
                                            IPython_version,
                                            QT_VERSION_STR,
                                            SIP_VERSION_STR,
                                            PYQT_VERSION_STR,
                                            pydna.__version__[:5]))
Exemple #11
0
 def received_move(self):
     try:
         data = self.socket.recv(1024)
     except Exception as e:
         QMessageBox.about(None, "Connection closed", e)
     move = pickle.loads(data)
     self.data_received.emit(move[0], move[1], move[2], move[3])
Exemple #12
0
 def onMovieInfoButton(self):
     if self.imdbModel.rowSelected == None:
         QMessageBox.about(
             self, _("Error"), _("Please search and select a movie from the list"))
     else:
         imdbID = self.imdbModel.getSelectedImdb()["id"]
         webbrowser.open("http://www.imdb.com/title/tt%s" %
                         imdbID, new=2, autoraise=1)
 def onOkButton(self):
     if not self.ui.languagesList.currentItem():
         QMessageBox.about(self, "Alert", "Please select a language")
     else:
         choosen_lang = \
             self.ui.languagesList.currentItem().data(Qt.UserRole)
         self._main.choosenLanguage = choosen_lang
         self.reject()
Exemple #14
0
    def _about(self):
        """ Tell the user about the application. """

        QMessageBox.about(self, "About pyqtdeploy",
"""This is pyqtdeploy v%s

pyqtdeploy is a tool for deploying PyQt4 and PyQt5 applications written using Python v2.7 or later or Python v3.3 or later to desktop and mobile devices.
""" % PYQTDEPLOY_RELEASE)
    def show_system_information(self):

        fields = dict(self._platform.__dict__)
        fields.update({
                'babel_version': str(Version.babel),
                })
        message = Messages.system_information_message_pattern % fields
        QMessageBox.about(self.main_window, 'System Information', message)
Exemple #16
0
    def show_about(self):
        msg = """<p><b>net.tsinghua {}</b><br>
<small>Copyright Ⓒ 2015 Thomas Lee</small></p>

<p><a href="https://github.com/ThomasLee969/net.tsinghua">Github 主页</a>
</p>""".format(__VERSION__)

        QMessageBox.about(None, '关于 net.tsinghua', msg)
Exemple #17
0
 def on_aboutAction_triggered(self):
     QMessageBox.about(self, "About Style sheet",
             "The <b>Style Sheet</b> example shows how widgets can be "
             "styled using "
             "<a href=\"http://doc.qt.digia.com/4.5/stylesheet.html\">Qt "
             "Style Sheets</a>. Click <b>File|Edit Style Sheet</b> to pop "
             "up the style editor, and either choose an existing style "
             "sheet or design your own.")
Exemple #18
0
    def about(self):
        QMessageBox.about(self, "About",
"""Stop Signal Task Control Program

This program is a simple system for neuroscience research of behavior inhibition.

It may be used and modified with no restriction."""
)
Exemple #19
0
 def about(self):
     QMessageBox.about(
         self,
         "About",
         "This example demonstrates Qt's rich text editing facilities "
         "in action, providing an example document for you to "
         "experiment with.",
     )
Exemple #20
0
 def about(self) :
     QMessageBox.about(self, 
         "About Function Evaluator",
         """<b>Function Evaluator</b>
            <p>Copyright &copy; 2017 Jeremy Roberts, All Rights Reserved.
            <p>Python %s -- Qt %s -- PyQt %s on %s""" %
         (platform.python_version(),
          QT_VERSION_STR, PYQT_VERSION_STR, platform.system()))
Exemple #21
0
    def onAboutTriggered(self):
        '''
        显示软件信息
        :return:
        '''

        versionMsg = self.sysXMLDict['version']
        QMessageBox.about(self.menubar,'软件信息','版本v' + versionMsg)
Exemple #22
0
 def onOkButton(self):
     if self.imdbModel.rowSelected == None:
         QMessageBox.about(
             self, _("Error"), _("Please search and select a movie from the list"))
     else:
         selection = self.imdbModel.getSelectedImdb()
         self._main.imdbDetected.emit(
             selection["id"], selection["title"], "search")
         self.accept()
Exemple #23
0
    def fail_box(self):
        """Fail box for playlist and single song"""

        if self.is_playlist:
            QMessageBox.about(self, "Error Download",
                              "Playlist '%s' failed to download." % self.text_url.text().rsplit('/', 1)[-1])
        else:
            QMessageBox.about(self, "Error Download",
                              "Download failed for song: %s" % self.track.title)
Exemple #24
0
    def on_show_about_clicked(self):
        descr = "<b><h2>Universal Radio Hacker</h2></b>Version: {0}<br />" \
                "GitHub: <a href='https://github.com/jopohl/urh'>https://github.com/jopohl/urh</a><br /><br />" \
                "Creators:<i><ul><li>" \
                "Johannes Pohl &lt;<a href='mailto:[email protected]'>[email protected]</a>&gt;</li>" \
                "<li>Andreas Noack &lt;<a href='mailto:[email protected]'>[email protected]</a>&gt;</li>" \
                "</ul></i>".format(version.VERSION)

        QMessageBox.about(self, self.tr("About"), self.tr(descr))
Exemple #25
0
 def about(self):
     """Show modal window with description of this program."""
     QMessageBox.about(
         self,
         'About Dotplot',
         'There are <i>many</i> programs that attempt to create dotplots already. '
         'Unfortunately most of these programs was created long time ago and written '
         'in old versions of Java. <p>This Python3 package will allow new generations '
         'of bioinformaticians to generate dotplots much easier.</p>'
     )
Exemple #26
0
 def addFunc(self):
     # f1=random.randint(1, 9999)
     # sql  = "insert into t1(f1,f2) values (%s,%s)"%(f1,f1)
     # self.db.execSQL(sql)
     f1=random.randint(1, 99)
     self.myTableModel.insertRows(0, 1)
     self.myTableModel.setData(self.myTableModel.index(0, 0), f1)
     self.myTableModel.setData(self.myTableModel.index(0, 1), "test")
     self.myTableModel.submitAll()
     QMessageBox.about( self, 'addFuncCall', "addFunc")
Exemple #27
0
	def about(self):
		"""
		Visualize an About window.
		"""
		QMessageBox.about(self, "About geoWeightedSum model",
		"""
			<p>Performs geographic multi-criteria decision making using weighted sum model 
			Documents and data 	are available in <a href="http://maplab.alwaysdata.net/geomcda.html"> www.maplab.alwaysdata.net</a></p>
			<p>Author:  Gianluca Massei <a href="mailto:[email protected]">[g_massa at libero.it]</a></p>
		""")
Exemple #28
0
 def about(self):
     """called when user wants to know a bit more on the app"""
     import sys
     python_version = str(sys.version_info[0])
     python_version_temp = sys.version_info[1:5]
     for item in python_version_temp:
         python_version = python_version + "." + str(item)
     QMessageBox.about(self, "About Lekture",
                         "pylekture build " + str(pylekture.__version__ + "\n" + \
                         "python version " + str(python_version)))
Exemple #29
0
	def about(self):
		"""
		Visualize an About window.
		"""
		QMessageBox.about(self, "About geoTOPIS model",
		"""
			<p>Performs geographic multi-criteria decision making using TOPIS model (Hwang, C.L.; Yoon, K. - 1981. Multiple Attribute Decision Making: Methods and Applications. New York: Springer-Verlag).
			Documents and data 	are available in <a href="http://maplab.alwaysdata.net/geomcda.html"> www.maplab.alwaysdata.net</a></p>
			<p>Author:  Gianluca Massei <a href="mailto:[email protected]">[g_massa at libero.it]</a></p>
		""")
 def showAbout(self):
     QMessageBox.about(
         self, "About SimSo",
         "<b>SimSo - Simulation of Multiprocessor Scheduling with Overheads</b><br/><br/>"
         "Version: SimSo {}, Graphical User Interface {}<br/><br/>"
         "SimSo is a free software developed by Maxime Cheramy (LAAS-CNRS).<br/>"
         "This software is distributed under the <a href='http://www.cecill.info'>CECILL license</a>, "
         "compatible with the GNU GPL.<br/><br/>"
         "Contact: <a href='mailto:[email protected]'>[email protected]</a>".format(simso.__version__, simsogui.__version__)
     )
Exemple #31
0
    def on_btn_run_clicked(self):
        if(self.input_matdosa.currentText() == "unselected" or self.input_nhietdo.currentText() == "unselected" or self.input_doam.currentText() == "unselected" or self.input_gionglua.currentText() == "unselected" or self.input_maula.currentText() == "unselected" or self.input_tinhtrangbenh.currentText() == "unselected" ):
            QMessageBox.about(self, 'Message', "Some Feature are empty !")
        else:
            value_matdosa = None
            value_nhietdo = None
            value_doam = None
            if(int(self.input_matdosa.currentText()) >= 20):
                value_matdosa = 'high'
            else:
                value_matdosa = 'low'
            if(int(self.input_nhietdo.currentText()) > 27):
                value_nhietdo = 'high'
            else:
                value_nhietdo = 'low'
            if(int(self.input_doam.currentText()) > 80):
                value_doam = 'high'
            else:
                value_doam = 'low'

            tup =(self.input_gionglua.currentText(),value_matdosa,value_nhietdo,value_doam,
                         int(self.input_maula.currentText()),int(self.input_tinhtrangbenh.currentText()))
            sample = [tup]
            sample = pandas.DataFrame.from_records(sample,
                                          columns=["Giong_Lua", "Mat_Do_Sa", "Nhiet_Do", "Do_Am", "Mau_La",
                                                   "Tinh_Trang_Benh"])
            solution = model_training.predict(sample)

            if solution[0] == 0:
                self.txt_pp.setPlainText('Không phát hiện bệnh đạo ôn, ngưng bón đạm, tăng cường bón kali cho lúa. Tiếp tục chăm sóc và quan sát lúa để phòng trừ bệnh đạo ôn kịp thời.')
            if solution[0] == 1:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá, vết bệnh hình chấm kim, ẩm độ không khí thấp, nhiệt độ môi trường cao. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị phòng ngừa bệnh đạo ôn với lượng thuốc phun 160-240 lít/ha. Tiếp tục quan sát lúa để phòng trừ bệnh đạo ôn kịp thời.')
            if solution[0] == 2:
                 self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá, vết bệnh hình chấm kim, ẩm độ không khí cao, nhiệt độ môi trường thấp. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị phòng ngừa bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha. Tiếp tục quan sát lúa để phòng trừ bệnh đạo ôn kịp thời. ')
            if solution[0] == 3:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá với vết bệnh điển hình (dạng mắt én). Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng.Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha.')
            if solution[0] == 4:
                self.txt_pp.setPlainText('Bệnh xuất hiện nhiều vết bệnh hình chấm kim. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha.')
            if solution[0] == 5:
                self.txt_pp.setPlainText('Bệnh có vết điển hình (dạng mắt én) xuất hiện nhiều ở tầng lá bên trên. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha. Theo dõi bệnh và phun lặp lại sau 1 tuần.')
            if solution[0] == 6:
                self.txt_pp.setPlainText('Bệnh điển hình (dạng mắt én) xuất hiện nhiều, vết bệnh xuất hiện xuống các tầng lá bên dưới. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 600-800 lít/ha để đảm bảo thuốc xuống được các lá bên dưới (phun chồng lối hoặc phun đẫm). Tiếp tục theo dõi bệnh đặc biệt là ở các lá bên dưới, tiến hành phun lặp lại sau khi phun lần đầu 5 ngày với lượng thuốc 300-400 lít/ha trong trường hợp bệnh thuyên giảm; đổi thuốc phun với lượng 600-800 lít/ha trong trường hợp bệnh không giảm.')
            if solution[0] == 7:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá, vết bệnh hình chấm kim. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị phòng ngừa bệnh đạo ôn với lượng thuốc phun 160-240 lít/ha. Tiếp tục quan sát lúa để phòng trừ bệnh đạo ôn kịp thời.')
            if solution[0] == 8:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá với vết bệnh điển hình (dạng mắt én) .Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha.')
            if solution[0] == 9:
                self.txt_pp.setPlainText('Bệnh xuất hiện nhiều vết bệnh hình chấm kim. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha.')
            if solution[0] == 10:
                self.txt_pp.setPlainText('Bệnh có vết điển hình (dạng mắt én) xuất hiện nhiều ở tầng lá bên trên. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha. Theo dõi bệnh và phun lặp lại sau 1 tuần.')
            if solution[0] == 11:
                self.txt_pp.setPlainText('Bệnh điển hình (dạng mắt én) xuất hiện nhiều, vết bệnh xuất hiện xuống các tầng lá bên dưới. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 600-800 lít/ha để đảm bảo thuốc xuống được các lá bên dưới (phun chồng lối hoặc phun đẫm). Tiếp tục theo dõi bệnh đặc biệt là ở các lá bên dưới, tiến hành phun lặp lại sau khi phun lần đầu 5 ngày với lượng thuốc 300-400 lít/ha trong trường hợp bệnh thuyên giảm; đổi thuốc phun với lượng 600-800 lít/ha trong trường hợp bệnh không giảm.')
            if solution[0] == 12:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá, vết bệnh hình chấm kim. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị phòng ngừa bệnh đạo ôn với lượng thuốc phun 160-240 lít/ha. Tiếp tục quan sát lúa để phòng trừ bệnh đạo ôn kịp thời.')
            if solution[0] == 13:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá với vết bệnh điển hình (dạng mắt én). Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha.')
            if solution[0] == 14:
                self.txt_pp.setPlainText('Xuất hiện nhiều vết bệnh hình chấm kim. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha.')
            if solution[0] == 15:
                self.txt_pp.setPlainText('Bệnh có vết điển hình (dạng mắt én) xuất hiện nhiều ở tầng lá bên trên. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha. Theo dõi bệnh và phun lặp lại sau 1 tuần.')
            if solution[0] == 16:
                self.txt_pp.setPlainText('Bệnh điển hình (dạng mắt én) xuất hiện nhiều, vết bệnh xuất hiện xuống các tầng lá bên dưới. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng.Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 600-800 lít/ha để đảm bảo thuốc xuống được các lá bên dưới (phun chồng lối hoặc phun đẫm). Tiếp tục theo dõi bệnh đặc biệt là ở các lá bên dưới, tiến hành phun lặp lại sau khi phun lần đầu 5 ngày với lượng thuốc 300-400 lít/ha trong trường hợp bệnh thuyên giảm; đổi thuốc phun với lượng 600-800 lít/ha trong trường hợp bệnh không giảm.')
            if solution[0] == 17:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá, vết bệnh hình chấm kim, ẩm độ không khí thấp, nhiệt độ môi trường cao. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Tiếp tục quan sát lúa để phòng trừ bệnh đạo ôn kịp thời.')
            if solution[0] == 18:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá, vết bệnh hình chấm kim, ẩm độ không khí cao, nhiệt độ môi trường thấp. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị phòng ngừa bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha. Tiếp tục quan sát lúa để phòng trừ bệnh đạo ôn kịp thời.')
            if solution[0] == 19:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá với vết bệnh điển hình (dạng mắt én). Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha')
            if solution[0] == 20:
                self.txt_pp.setPlainText('Bệnh xuất hiện nhiều vết bệnh hình chấm kim. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha')
            if solution[0] == 21:
                self.txt_pp.setPlainText('Bệnh có vết điển hình (dạng mắt én) xuất hiện nhiều ở tầng lá bên trên. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha. Theo dõi bệnh và phun lặp lại sau 1 tuần.')
            if solution[0] == 22:
                self.txt_pp.setPlainText('Bệnh điển hình (dạng mắt én) xuất hiện nhiều, vết bệnh xuất hiện xuống các tầng lá bên dưới. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 600-800 lít/ha để đảm bảo thuốc xuống được các lá bên dưới (phun chồng lối hoặc phun đẫm). Tiếp tục theo dõi bệnh đặc biệt là ở các lá bên dưới, tiến hành phun lặp lại sau khi phun lần đầu 5 ngày với lượng thuốc 300-400 lít/ha trong trường hợp bệnh thuyên giảm; đổi thuốc phun với lượng 600-800 lít/ha trong trường hợp bệnh không giảm.')
            if solution[0] == 23:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá, vết bệnh hình chấm kim. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Tiếp tục quan sát lúa để phòng trừ bệnh đạo ôn kịp thời.')
            if solution[0] == 24:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá với vết bệnh điển hình (dạng mắt én). Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 160-240 lít/ha.')
            if solution[0] == 25:
                self.txt_pp.setPlainText('Bệnh xuất hiện nhiều vết bệnh hình chấm kim. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 160-240 lít/ha')
            if solution[0] == 26:
                self.txt_pp.setPlainText('Bệnh có vết điển hình (dạng mắt én) xuất hiện nhiều ở tầng lá bên trên. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha. Theo dõi bệnh để tiếp tục phòng trừ bệnh đạo ôn.')
            if solution[0] == 27:
                self.txt_pp.setPlainText('Bệnh điển hình (dạng mắt én) xuất hiện nhiều, vết bệnh xuất hiện xuống các tầng lá bên dưới. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 600-800 lít/ha để đảm bảo thuốc xuống được các lá bên dưới (phun chồng lối hoặc phun đẫm). Tiếp tục theo dõi bệnh đặc biệt là ở các lá bên dưới, tiến hành phun lặp lại sau khi phun lần đầu 5 ngày với lượng thuốc 300-400 lít/ha trong trường hợp bệnh thuyên giảm; đổi thuốc phun với lượng 600-800 lít/ha trong trường hợp bệnh không giảm.')
            if solution[0] == 28:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá, vết bệnh hình chấm kim. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Tiếp tục quan sát lúa để phòng trừ bệnh đạo ôn kịp thời.')
            if solution[0] == 29:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá, vết bệnh điển hình (dạng mắt én). Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Tiếp tục quan sát lúa để phòng trừ bệnh đạo ôn kịp thời.')
            if solution[0] == 30:
                self.txt_pp.setPlainText('Bệnh xuất hiện nhiều vết bệnh hình chấm kim. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 160-240 lít/ha.')
            if solution[0] == 31:
                self.txt_pp.setPlainText('Bệnh có vết điển hình (dạng mắt én) xuất hiện nhiều ở tầng lá bên trên. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha. Theo dõi bệnh để tiếp tục phòng trừ bệnh đạo ôn.')
            if solution[0] == 32:
                self.txt_pp.setPlainText('Bệnh điển hình (dạng mắt én) xuất hiện nhiều, vết bệnh xuất hiện xuống các tầng lá bên dưới. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng.Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 600-800 lít/ha để đảm bảo thuốc xuống được các lá bên dưới (phun chồng lối hoặc phun đẫm). Tiếp tục theo dõi bệnh đặc biệt là ở các lá bên dưới, tiến hành phun lặp lại sau khi phun lần đầu 5 ngày với lượng thuốc 300-400 lít/ha trong trường hợp bệnh thuyên giảm; đổi thuốc phun với lượng 600-800 lít/ha trong trường hợp bệnh không giảm.')
            if solution[0] == 33:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá, vết bệnh hình chấm kim. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng.Phun thuốc đặc trị phòng ngừa bệnh đạo ôn với lượng thuốc phun 160-240 lít/ha. Tiếp tục quan sát lúa để phòng trừ bệnh đạo ôn kịp thời.')
            if solution[0] == 34:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá với vết bệnh điển hình (dạng mắt én). Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng.Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha.')
            if solution[0] == 35:
                self.txt_pp.setPlainText('Bệnh xuất hiện lác đác trên lá với xuất hiện nhiều vết bệnh hình chấm kim. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng.Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha.')
            if solution[0] == 36:
                self.txt_pp.setPlainText('Bệnh có vết điển hình (dạng mắt én) xuất hiện nhiều ở tầng lá bên trên. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng.Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 300-400 lít/ha. Theo dõi bệnh và phun lặp lại sau 1 tuần.')
            if solution[0] == 37:
                self.txt_pp.setPlainText('Bệnh điển hình (dạng mắt én) xuất hiện nhiều, vết bệnh xuất hiện xuống các tầng lá bên dưới. Cần ngừng ngay việc bón phân, duy trì mực nước trong ruộng. Phun thuốc đặc trị bệnh đạo ôn với lượng thuốc phun 600-800 lít/ha để đảm bảo thuốc xuống được các lá bên dưới (phun chồng lối hoặc phun đẫm). Tiếp tục theo dõi bệnh đặc biệt là ở các lá bên dưới, tiến hành phun lặp lại sau khi phun lần đầu 5 ngày với lượng thuốc 300-400 lít/ha trong trường hợp bệnh thuyên giảm; đổi thuốc phun với lượng 600-800 lít/ha trong trường hợp bệnh không giảm.')
    def view_End(self):
        reply = QMessageBox.question(self.view, "Message", "You want to attend above event.",
                                     QMessageBox.Yes | QMessageBox.No)

        if reply == QMessageBox.Yes:
            if len(self.view_event_list) == 0:
                QMessageBox.about(self.view, 'Error',
                                  "You don't select any event.")
            else:
                print("Length of view_event_list: " +
                      str(len(self.view_event_list)))

                for i in range(len(self.view_event_list)):
                    view_event_name = self.view_event_list[i].event_name

                    for j in range(len(self.total_user_view_list)):
                        exit_attend = False

                        for k in range(len(self.total_user_view_list[j].admin.events_list)):
                            if view_event_name == self.total_user_view_list[j].admin.events_list[k].event_name:
                                view_event_creator = self.total_user_view_list[j].account

                                if view_event_creator == self.search_account:
                                    QMessageBox.about(
                                        self.view, "Error", "Can't attend " + view_event_name + " which is created by you.")
                                    exit_attend = True
                                    break
                                else:
                                    start_hour_temp = self.view_event_list[i].event_date.time_slot.start_hour
                                    start_min_temp = self.view_event_list[i].event_date.time_slot.start_minute
                                    end_hour_temp = self.view_event_list[i].event_date.time_slot.end_hour
                                    end_min_temp = self.view_event_list[i].event_date.time_slot.end_minute

                                    self.total_user_view_list[j].admin.events_list[k].event_date.time_slot.fill_attend_slot(
                                        start_hour_temp, start_min_temp, end_hour_temp, end_min_temp, self.search_account)

                                    if not self.total_user_view_list[j].admin.events_list[k].event_date.time_slot.check_event_attend:
                                        QMessageBox.about(
                                            self.view, "Error", "Your chosen participation time is not in the event time")
                                        exit_attend = True
                                        break
                                    else:
                                        QMessageBox.about(
                                            self.view, "Message", "Successfully attend " + view_event_name + ".")
                                        self.total_user_view_list[j].admin.events_list[
                                            k].event_date.time_slot.check_event_attend = False
                                        exit_attend = True
                                        break

                        if exit_attend:
                            break

                self.view_event_list = []
                write_file = open("event.txt", "w+")

                for i in range(len(self.total_user_view_list)):
                    write_file.write(
                        self.total_user_view_list[i].account + " Admin ")

                    for j in range(len(self.total_user_view_list[i].admin.events_list)):
                        write_file.write("EventName ")
                        write_file.write(
                            self.total_user_view_list[i].admin.events_list[j].event_name + " ")
                        write_file.write("EventEnd ")
                        write_file.write(
                            str(self.total_user_view_list[i].admin.events_list[j].event_date.year) + " " + str(
                                self.total_user_view_list[i].admin.events_list[j].event_date.month) + " " + str(
                                self.total_user_view_list[i].admin.events_list[j].event_date.day) + " ")
                        write_file.write(str(self.total_user_view_list[i].admin.events_list[
                            j].event_date.time_slot.start_hour) + " " + str(
                            self.total_user_view_list[i].admin.events_list[j].event_date.time_slot.start_minute) + " ")
                        write_file.write(str(self.total_user_view_list[i].admin.events_list[
                            j].event_date.time_slot.end_hour) + " " + str(
                            self.total_user_view_list[i].admin.events_list[j].event_date.time_slot.end_minute) + " ")

                    write_file.write("AdminEnd View ")

                    for j in range(len(self.total_user_view_list[i].admin.events_list)):
                        for m in range(len(
                                self.total_user_view_list[i].admin.events_list[j].event_date.time_slot.attend_slot)):
                            if len(self.total_user_view_list[i].admin.events_list[j].event_date.time_slot.attend_slot[
                                    m]) > 0:
                                write_file.write(str(j) + " ")
                                for n in range(len(self.total_user_view_list[i].admin.events_list[
                                        j].event_date.time_slot.attend_slot[m])):
                                    write_file.write(str(m) + " " + str(n) + " " +
                                                     self.total_user_view_list[i].admin.events_list[
                                                         j].event_date.time_slot.attend_slot[m][n] + " ")

                    write_file.write("ViewEnd\n")
                write_file.close()
            self.view.textBrowser.clear()
        else:
            QMessageBox.about(self.view, 'Message', 'Canceled')
Exemple #33
0
 def zlykilk(self):
     QMessageBox.about(self, "Zasady ","Kliknales w zlym momencie")
     self.highs1+=1
     self.score-=1
Exemple #34
0
 def about(self):
     QMessageBox.about(self, "About", "This is a Template")
Exemple #35
0
 def about(self):
     QMessageBox.about(self,'鼠标','你点鼠标了吧!')
Exemple #36
0
    def setupTab2(self, tab2):
        """Special widgets for preview panel"""
        scrollContainer = QVBoxLayout()
        scrollArea = QScrollArea()
        scrollArea.setWidgetResizable(True)
        mainWidget = QWidget()
        layout = QVBoxLayout()
        mainWidget.setLayout(layout)
        mainWidget.setMinimumSize(QSize(420, 800))
        scrollArea.setWidget(mainWidget)
        scrollContainer.addWidget(scrollArea)
        tab2.setLayout(scrollContainer)

        # Dialog
        group0 = QGroupBox("Dialog")
        group1Layout = QVBoxLayout()
        layoutRow1 = QHBoxLayout()
        layoutRow2 = QHBoxLayout()
        group1Layout.addLayout(layoutRow1)
        group1Layout.addLayout(layoutRow2)
        group0.setLayout(group1Layout)
        layout.addWidget(group0)

        b1 = QPushButton(self.tr("Info"))
        b1.clicked.connect(lambda: QMessageBox.information(
            self, "Info", self.tr("This is a message."), QMessageBox.Ok,
            QMessageBox.Ok))
        b2 = QPushButton(self.tr("Question"))
        b2.clicked.connect(lambda: QMessageBox.question(
            self, "question", self.tr("Are you sure?"), QMessageBox.No |
            QMessageBox.Yes, QMessageBox.Yes))
        b3 = QPushButton(self.tr("Warning"))
        b3.clicked.connect(lambda: QMessageBox.warning(
            self, "warning", self.tr("This is a warning."), QMessageBox.No |
            QMessageBox.Yes, QMessageBox.Yes))
        b4 = QPushButton(self.tr("Error"))
        b4.clicked.connect(lambda: QMessageBox.critical(
            self, "error", self.tr("It's a error."), QMessageBox.No |
            QMessageBox.Yes, QMessageBox.Yes))
        b5 = QPushButton(self.tr("About"))
        b5.clicked.connect(lambda: QMessageBox.about(
            self, "about", self.tr("About this software")))
        b6 = QPushButton(self.tr("Input"))  # ,"输入对话框"))
        b6.clicked.connect(lambda: QInputDialog.getInt(
            self, self.tr("input"), self.tr("please input int")))
        b6.clicked.connect(lambda: QInputDialog.getDouble(
            self, self.tr("input"), self.tr("please input float")))
        b6.clicked.connect(lambda: QInputDialog.getItem(
            self, self.tr("input"), self.tr("please select"), ["aaa", "bbb"]))
        b7 = QPushButton(self.tr("Color"))  # ,"颜色对话框"))
        b7.clicked.connect(lambda: QColorDialog.getColor())
        b8 = QPushButton(self.tr("Font"))  # ,"字体对话框"))
        b8.clicked.connect(lambda: QFontDialog.getFont())
        b9 = QPushButton(self.tr("OpenFile"))  # ,"打开对话框"))
        b9.clicked.connect(lambda: QFileDialog.getOpenFileName(
            self, "open", "", "Text(*.txt *.text)"))
        b10 = QPushButton(self.tr("SaveFile"))  # ,"保存对话框"))
        b10.clicked.connect(lambda: QFileDialog.getSaveFileName())
        layoutRow1.addWidget(b1)
        layoutRow1.addWidget(b2)
        layoutRow1.addWidget(b3)
        layoutRow1.addWidget(b4)
        layoutRow1.addWidget(b5)
        layoutRow2.addWidget(b6)
        layoutRow2.addWidget(b7)
        layoutRow2.addWidget(b8)
        layoutRow2.addWidget(b9)
        layoutRow2.addWidget(b10)

        # DateTime
        group1 = QGroupBox("DateTime")
        group1.setCheckable(True)
        group1Layout = QHBoxLayout()
        layoutRow1 = QVBoxLayout()
        layoutRow2 = QVBoxLayout()
        group1Layout.addLayout(layoutRow1)
        group1Layout.addLayout(layoutRow2)
        group1.setLayout(group1Layout)
        layout.addWidget(group1)

        group1.setMaximumHeight(240)
        dt1 = QDateEdit()
        dt1.setDate(QDate.currentDate())
        dt2 = QTimeEdit()
        dt2.setTime(QTime.currentTime())
        dt3 = QDateTimeEdit()
        dt3.setDateTime(QDateTime.currentDateTime())
        dt4 = QDateTimeEdit()
        dt4.setCalendarPopup(True)
        dt5 = QCalendarWidget()
        dt5.setMaximumSize(QSize(250, 240))
        layoutRow1.addWidget(dt1)
        layoutRow1.addWidget(dt2)
        layoutRow1.addWidget(dt3)
        layoutRow1.addWidget(dt4)
        layoutRow2.addWidget(dt5)

        # Slider
        group2 = QGroupBox("Sliders")
        group2.setCheckable(True)
        group2Layout = QVBoxLayout()
        layoutRow1 = QHBoxLayout()
        layoutRow2 = QHBoxLayout()
        group2Layout.addLayout(layoutRow1)
        group2Layout.addLayout(layoutRow2)
        group2.setLayout(group2Layout)
        layout.addWidget(group2)

        slider = QSlider()
        slider.setOrientation(Qt.Horizontal)
        slider.setMaximum(100)
        progress = QProgressBar()
        slider.valueChanged.connect(progress.setValue)
        slider.setValue(50)
        scroll1 = QScrollBar()
        scroll2 = QScrollBar()
        scroll3 = QScrollBar()
        scroll1.setMaximum(255)
        scroll2.setMaximum(255)
        scroll3.setMaximum(255)
        scroll1.setOrientation(Qt.Horizontal)
        scroll2.setOrientation(Qt.Horizontal)
        scroll3.setOrientation(Qt.Horizontal)
        c = QLabel(self.tr("Slide to change color"))  # , "拖动滑块改变颜色"))
        c.setAutoFillBackground(True)
        c.setAlignment(Qt.AlignCenter)
        # c.setStyleSheet("border:1px solid gray;")
        c.setStyleSheet("background:rgba(0,0,0,100);")

        def clr():
            # clr=QColor(scroll1.getValue(),scroll2.getValue(),scroll3.getValue(),100)
            # p=QPalette()
            # p.setColor(QPalette.Background,clr)
            # c.setPalette(p)
            c.setStyleSheet("background: rgba({},{},{},100);".format(
                scroll1.value(), scroll2.value(), scroll3.value()))

        scroll1.valueChanged.connect(clr)
        scroll2.valueChanged.connect(clr)
        scroll3.valueChanged.connect(clr)
        scroll1.setValue(128)
        layoutRow1.addWidget(slider)
        layoutRow1.addWidget(progress)
        layCol1 = QVBoxLayout()
        layCol1.addWidget(scroll1)
        layCol1.addWidget(scroll2)
        layCol1.addWidget(scroll3)
        layoutRow2.addLayout(layCol1)
        layoutRow2.addWidget(c)

        # Meter
        group3 = QGroupBox("Meters")
        group3.setCheckable(True)
        layRow = QHBoxLayout()
        group3.setLayout(layRow)
        layout.addWidget(group3)

        dial1 = QDial()
        dial2 = QDial()
        dial2.setNotchesVisible(True)
        dial1.valueChanged.connect(dial2.setValue)
        layRow.addWidget(dial1)
        layRow.addWidget(dial2)

        layout.addStretch(1)
Exemple #37
0
 def infobox(self, title, message):
     QMessageBox.about(self, title, message).show()
Exemple #38
0
def AdicionarFilme():

	nome = TelaAdicionarFilme.lineEdit.text()

	if(nome=="" or len(nome) > 40):
		QMessageBox.about(TelaAdicionarFilme, "Aviso", "O campo 'nome do filme' deve ser preenchido\ne deve conter no máximo 40 caracteres.")
		return 1

	l = SELECT(["nome"],"filme",True,"nome",nome)

	if(len(l) > 0):
		QMessageBox.about(TelaAdicionarFilme, "Aviso", "Um filme com este nome já está cadastrado no catálogo!")
		return 1

	strduracaohora = TelaAdicionarFilme.lineEdit_2.text()

	if(len(strduracaohora) == 0 or len(strduracaohora) > 2):
		QMessageBox.about(TelaAdicionarFilme, "Aviso", "O campo 'duração (horas)' deve ser preenchido\ne deve ter no máximo um dígito")
		return 1		

	if(not strduracaohora.isdigit()):
		QMessageBox.about(TelaAdicionarFilme, "Aviso", "O campo 'duração (horas)' deve ser um número")
		return 1

	strduracaominuto = TelaAdicionarFilme.lineEdit_3.text()

	if(len(strduracaominuto) == 0 or len(strduracaominuto) > 3):
		QMessageBox.about(TelaAdicionarFilme, "Aviso", "O campo 'duração (minutos)' deve ser preenchido\ne deve ter no máximo dois dígitos")
		return 1		

	if(len(strduracaominuto) == 1):
		strduracaominuto = "0" + strduracaominuto

	if((not strduracaominuto[0].isdigit()) or (not strduracaominuto[1].isdigit())):
		QMessageBox.about(TelaAdicionarFilme, "Aviso", "O campo 'duração (minutos)' deve ser um número")
		return 1

	sinopse = TelaAdicionarFilme.textEdit.toPlainText()

	if(sinopse=="" or len(nome) > 200):
		QMessageBox.about(TelaAdicionarFilme, "Aviso", "O campo 'sinopse do filme' deve ser preenchido\ne deve conter no máximo 200 caracteres.")
		return 1


	linhas = TelaAdicionarFilme.tableWidget.rowCount()

	if(linhas == 0):
		QMessageBox.about(TelaAdicionarFilme, "Aviso", "Você deve adicionar pelo menos uma sessão ao filme")
		return 1

	dia          = []
	mes          = []
	ano          = []
	numsala      = []
	iniciohora   = []
	iniciominuto = []

	for i in range(linhas):

		itemdata    = TelaAdicionarFilme.tableWidget.item(i,0)
		iteminicio  = TelaAdicionarFilme.tableWidget.item(i,1)
		itemnumsala = TelaAdicionarFilme.tableWidget.item(i,2)

		strdata    = itemdata.text()
		strinicio  = iteminicio.text()
		strnumsala = itemnumsala.text()

		dia.append(int(strdata[0]+strdata[1]))
		mes.append(int(strdata[3]+strdata[4]))
		ano.append(int(strdata[6]+strdata[7]+strdata[8]+strdata[9]))

		numsala.append(int(strnumsala))

		iniciohora.append(int(strinicio[0]+strinicio[1]))
		iniciominuto.append(int(strinicio[3]+strinicio[4]))
Exemple #39
0
 def call(window, *args, **kwargs):
     try:
         return f(window, *args, **kwargs)
     except Exception:
         exc_info = traceback.format_exc()
         QMessageBox.about(window, '错误信息', exc_info)
Exemple #40
0
	
	for i in range(linhas):

		IDSESSAO = -1
		
		for j in range(1000000):
		
			l = SELECT(["id"],"sessao",True,"id",str(j))

			if(len(l) == 0):
				IDSESSAO = j
				break

		INSERT("sessao",[str(IDSESSAO),str(dia[i]),str(mes[i]),str(ano[i]),str(numsala[i]),str(IDFILME),str(iniciohora[i]),str(iniciominuto[i])])

	QMessageBox.about(TelaAdicionarFilme, "Aviso", "O filme foi adicionado ao catálogo com sucesso!")
	
	TelaAdicionarFilme.lineEdit.setText("")
	TelaAdicionarFilme.lineEdit_2.setText("")
	TelaAdicionarFilme.lineEdit_3.setText("")

	while(TelaAdicionarFilme.tableWidget.rowCount() > 0):
		TelaAdicionarFilme.tableWidget.removeRow(0)
	
	TelaAdicionarFilme.textEdit.setText("")

	TelaAdicionarFilme.hide()
	TelaPrincipalFuncionario.show()
	return 1

Exemple #41
0
 def OpenAboutWindow(self):
     QMessageBox.about(self, self.tr("关于"), self.tr(self.GetAbout()))
Exemple #42
0
 def msg(self, text):
     QMessageBox.about(self.centralWidget, "标题", "{}".format(text))
Exemple #43
0
 def acercaDe(self):
     QMessageBox.about(
         self, "Información",
         "Autor: Luis Fernando Ospino Ayala\nFecha: 20/09/2019\nSoftware: Bloc de Notas®"
     )
Exemple #44
0
 def about(self):
     QMessageBox.about(
         self, "About Application",
         "The <b>Application</b> example demonstrates how to write "
         "modern GUI applications using Qt, with a menu bar, "
         "toolbars, and a status bar.")
 def fthButtonClicked(self):
     QMessageBox.about(self, "message", "clicked")
Exemple #46
0
 def about(self):
     """Show about info.
     """
     QMessageBox.about(self, 'ConvertAll',
                       _('ConvertAll Version {0}\nby {1}').
                       format(__version__, __author__))
 def presionado(self):
     QMessageBox.about(self, "Dialogo About",
                       "Esto es un texto informativo")
Exemple #48
0
 def about(self):
     QMessageBox.about(
         self, "About Settings Editor",
         "The <b>Settings Editor</b> example shows how to access "
         "application settings using Qt.")
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets
import MySQLdb as mdb
from PyQt5.QtWidgets import QTableWidget, QTableWidgetItem
from PyQt5.QtWidgets import QMessageBox
#mysql database connection
try:
    db = mdb.connect('localhost', 'root', 'divpes1998', 'CRICKETTOURNAMENT')
    print("database connected in addplayer")
    cur = db.cursor()
except mdb.Error as e:
    QMessageBox.about(self, 'Connection', 'Failed To Connect Database')
    sys.exit(1)


class Ui_viewTeam(object):
    def editteam(self):
        self.tuple_team_row = cur.execute("SELECT DisplayName FROM tblTeams")
        self.tuple_team_data = cur.fetchall()
        self.list_team_data_1 = list(self.tuple_team_data)
        self.list_team_data_1 = [_[0] for _ in self.list_team_data_1]
        print(self.list_team_data_1)
        a = self.teamNameLineEdit.text().title()
        b = self.displayTeamNameLineEdit.text().upper()
        self.teamNameLineEdit.clear()
        self.displayTeamNameLineEdit.clear()
        if len(a) < 4 or len(b) < 2:
Exemple #50
0
def clickMethod(self, msg):
    QMessageBox.about(self, "Warning", msg)
 def on_pushButton_3_clicked(self):
     """
     Slot documentation goes here.
     """
     my_button = QMessageBox.about(self, "关于", "软件使用说明,软件版本")
     print(my_button)
Exemple #52
0
 def message(self):
     QMessageBox.about(self, "Игра окончена", "Вы проиграли")
 def about_apol(self):
     QMessageBox.about(self, "About Apol", "Version {0}<br>"
                       "Apol is a graphical SELinux policy analysis tool and part of "
                       "<a href=\"https://github.com/TresysTechnology/setools/wiki\">"
                       "SETools</a>.<p>"
                       "Copyright (C) 2015-2016, Tresys Technology.".format(__version__))
    def set_all_info(self):
        start_hour = self.admin.timeEdit_start.time().hour()
        start_min = self.admin.timeEdit_start.time().minute()
        end_hour = self.admin.timeEdit_end.time().hour()
        end_min = self.admin.timeEdit_end.time().minute()
        timeslot_ = slot(start_hour, start_min, end_hour, end_min)
        timeslot_.pure_attend_slot(
            start_hour, start_min, end_hour, end_min, self.search_account)
        temp_date = self.admin.calendarWidget.selectedDate()
        date_string = str(temp_date.toPyDate())
        temp = re.findall(r'\d+', date_string)
        _date = list(map(int, temp))
        year = _date[0]
        month = _date[1]
        day = _date[2]

        is_valid = self.check_valid_info(
            year, month, day, start_hour, start_min, end_hour, end_min)

        if is_valid == "True":
            date_obj = date(year, month, day, timeslot_)
            event_name = self.admin.lineEdit_eventname.text()
            event_obj = event(event_name, date_obj)
            mode = admin_mode()
            mode.add_event(event_obj)

            if event_name == "":
                QMessageBox.about(self.admin, "Error",
                                  "Event name can't be empty.")
            else:
                confirm = QMessageBox.question(self.admin, 'Message',
                                               'Confirm adding this event \n{}'.format(
                                                   event_name),
                                               QMessageBox.Yes | QMessageBox.No)
                if confirm == QMessageBox.Yes:
                    self.admin_mode = mode

                    for i in range(len(self.total_user_list)):
                        if self.total_user_list[i].account == self.search_account:
                            self.total_user_list_index = i
                            break

                    if self.total_user_list_index == -1:
                        event_name_exist_in_total = False

                        for i in range(len(self.total_user_list)):
                            for j in range(len(self.total_user_list[i].admin.events_list)):
                                if self.total_user_list[i].admin.events_list[j].event_name == \
                                        self.admin_mode.events_list[0].event_name:
                                    event_name_exist_in_total = True
                                    break

                        if event_name_exist_in_total:
                            QMessageBox.about(self.admin, "Message",
                                              "This event name is existed. Please try another one.")
                        else:
                            user_temp = user_class()

                            admin_temp = self.admin_mode

                            user_temp.account = self.search_account
                            user_temp.admin = admin_temp

                            self.total_user_list.append(user_temp)
                            self.write_event_file()
                            self.admin.textBrowser.append(
                                self.admin_mode.info_text_24())
                            # self.send_admin_mode()
                    else:
                        event_name_exit = False
                        for i in range(len(self.total_user_list[self.total_user_list_index].admin.events_list)):
                            print(
                                self.total_user_list[self.total_user_list_index].admin.events_list[i].event_name)
                            if event_name == self.total_user_list[self.total_user_list_index].admin.events_list[
                                    i].event_name:
                                self.admin.textBrowser.append("Event existed")
                                event_name_exit = True
                                break

                        if not event_name_exit:
                            event_name_exist_in_total = False

                            for i in range(len(self.total_user_list)):
                                for j in range(len(self.total_user_list[i].admin.events_list)):
                                    if self.total_user_list[i].admin.events_list[j].event_name == \
                                            self.admin_mode.events_list[0].event_name:
                                        event_name_exist_in_total = True
                                        break

                            if event_name_exist_in_total:
                                QMessageBox.about(self.admin, "Message",
                                                  "This event name is existed. Please try another one.")
                            else:
                                year_temp = self.admin_mode.events_list[0].event_date.year
                                month_temp = self.admin_mode.events_list[0].event_date.month
                                day_temp = self.admin_mode.events_list[0].event_date.day
                                start_hour_temp = self.admin_mode.events_list[
                                    0].event_date.time_slot.start_hour
                                start_min_temp = self.admin_mode.events_list[
                                    0].event_date.time_slot.start_minute
                                end_hour_temp = self.admin_mode.events_list[0].event_date.time_slot.end_hour
                                end_min_temp = self.admin_mode.events_list[0].event_date.time_slot.end_minute

                                # self.total_user_list[self.total_user_list_index].admin.events_list.append(event_obj)
                                # self.write_event_file()
                                # self.admin.textBrowser.append(self.admin_mode.info_text_24())

                                if self.total_user_list[self.total_user_list_index].admin.checkevent_date(year_temp, month_temp, day_temp, start_hour_temp, start_min_temp, end_hour_temp, end_min_temp):
                                    self.total_user_list[self.total_user_list_index].admin.events_list.append(
                                        event_obj)
                                    self.write_event_file()
                                    self.admin.textBrowser.append(
                                        self.admin_mode.info_text_24())
                                    # self.send_admin_mode()
                                else:
                                    QMessageBox.about(
                                        self.admin, "Message", "Time slot occupied!")
                        else:
                            QMessageBox.about(
                                self.admin, "Message", "You have created this event.")
                else:
                    QMessageBox.about(self.admin, 'Message', 'Canceled')
        else:
            QMessageBox.about(self.admin, "Message", is_valid)
 def on_actionAbout_triggered(self):
     QMessageBox.about(self, "About WebBrowser",
             "This Example has been created using the ActiveQt integration into Qt Designer.\n"
             "It demonstrates the use of QAxWidget to embed the Internet Explorer ActiveX\n"
             "control into a Qt application.")
Exemple #56
0
 def pop_error(self, num):
     QMessageBox.about(None, "错误", num + "未开启!")
Exemple #57
0
 def handleInfo(self):
     msg = QMessageBox.about(self, "QT5 Player", self.myinfo)
    def set_all_info(self):
        start_hour = self.view.start_time.time().hour()
        start_min = self.view.start_time.time().minute()
        end_hour = self.view.end_time.time().hour()
        end_min = self.view.end_time.time().minute()

        beginning = int(3 * start_hour + start_min / 20)
        end = int(3 * end_hour + end_min / 20)

        if end <= beginning:
            QMessageBox.about(self.view, "Error",
                              "End time can't earlier than beginning time.")
        else:
            print("Start time: " + str(start_hour) + ":" + str(start_min) + '\n' + "End time: " + str(
                end_hour) + ":" + str(end_min) + '\n')

            try:
                text_length = len(
                    self.view.listWidget.currentItem().text().split())

                event_name = ""
                for i in range(2, text_length - 8):
                    if event_name == "":
                        event_name = self.view.listWidget.currentItem().text().split()[
                            i]
                    else:
                        event_name += " " + \
                            self.view.listWidget.currentItem().text().split()[
                                i]

                if len(self.view_event_list) != 0:
                    QMessageBox.about(
                        self.view, "Message", "You have added an event. Please click finish add.")
                else:
                    confirm = QMessageBox.question(self.view, 'Message',
                                                   'Confirm adding this event \n{}'.format(
                                                       event_name),
                                                   QMessageBox.Yes | QMessageBox.No)

                    if confirm == QMessageBox.Yes:
                        text_length = len(
                            self.view.listWidget.currentItem().text().split())
                        print("text length: " + str(text_length))

                        num = re.findall(
                            '\w+', self.view.listWidget.currentItem().text().split()[text_length - 7])
                        cur_year = num[0]
                        cur_month = num[1]
                        cur_day = num[2]

                        num = re.findall(
                            '\w+', self.view.listWidget.currentItem().text().split()[text_length - 5])
                        cur_start_hour = num[0]
                        cur_start_minute = num[1]

                        num = re.findall(
                            '\w+', self.view.listWidget.currentItem().text().split()[text_length - 3])
                        cur_end_hour = num[0]
                        cur_end_minute = num[1]

                        print("Year: " + cur_year + "\nMonth: " +
                              cur_month + "\nDay: " + cur_day)
                        print("Start time: " + cur_start_hour +
                              ":" + cur_start_minute)
                        print("End time: " + cur_end_hour +
                              ":" + cur_end_minute + '\n')

                        event_time_slot_temp = slot(
                            start_hour, start_min, end_hour, end_min)
                        event_date_temp = date(int(cur_year), int(
                            cur_month), int(cur_day), event_time_slot_temp)
                        event_temp = event(event_name, event_date_temp)

                        self.view_event_list.append(event_temp)
                        print("Total length of view_event_list: " +
                              str(len(self.view_event_list)) + '\n')

                        self.view.textBrowser.append(
                            "Event name:" + event_name)
                        self.view.textBrowser.append(
                            "Time slot you participated: " + str(start_hour) + ":" + str(start_min) + "-" + str(
                                end_hour) + ":" + str(end_min) + '\n')
                    else:
                        QMessageBox.about(self.view, 'Message', 'Canceled')
            except:
                QMessageBox.information(self.view, "Error",
                                        "Please click one event which you want to attend, then click the red arrow.")
Exemple #59
0
 def about(self):
     QMessageBox.about(
         self, "About " + QCoreApplication.applicationName(),
         "UXDesigner\nVersion: " + QCoreApplication.applicationVersion() +
         "\n(C) Copyright 2019 Olaf Japp. All rights reserved.\n\nThis program is provided AS IS with NO\nWARRANTY OF ANY KIND, INCLUDING THE\nWARRANTY OF UXDesigner, MERCHANTABILITY AND\nFITNESS FOR A PATICULAR PURPOSE."
     )
 def aboutClicked(self):
     QMessageBox.about(
         self, 'About', 'This is the Molecular Nanophotonics TrackerLab. ' +
         'It is based on PyQt and the PyQtGraph libary.' + 2 * '\n' +
         'Martin Fränzl')