[Add] Disable maximun button
[Add] Added an icon [Add] Popup an message if market data is fully loaded [Mod] combobox: remove Prefix [Mod] rename: CSV行情载入器
This commit is contained in:
parent
6c47c869dd
commit
a7a647a3b8
@ -13,4 +13,4 @@ class CsvLoaderApp(BaseApp):
|
||||
display_name = "CSV行情载入器"
|
||||
engine_class = CsvLoader
|
||||
widget_name = "CsvLoaderWidget"
|
||||
icon_name = "cta.ico"
|
||||
icon_name = "csv.ico"
|
||||
|
@ -3,7 +3,7 @@
|
||||
<class>CsvLoader</class>
|
||||
<widget class="QDialog" name="CsvLoader">
|
||||
<property name="windowTitle">
|
||||
<string>Csv载入器</string>
|
||||
<string>CSV行情载入器</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
|
@ -7,15 +7,17 @@ compile:
|
||||
pyuic5 csv_loader.ui -o uic/uic_csv_loader.py
|
||||
```
|
||||
"""
|
||||
from PyQt5.QtWidgets import QFileDialog
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtWidgets import QFileDialog, QMessageBox
|
||||
|
||||
from vnpy.event import EventEngine
|
||||
from vnpy.trader.constant import Interval, Exchange
|
||||
from vnpy.trader.constant import Exchange, Interval
|
||||
from vnpy.trader.engine import MainEngine
|
||||
from vnpy.trader.ui import QtWidgets
|
||||
|
||||
from .uic.uic_csv_loader import Ui_CsvLoader
|
||||
from ..csv_loader import CsvLoader
|
||||
|
||||
from gettext import gettext as _
|
||||
|
||||
class CsvLoaderWidget(QtWidgets.QWidget):
|
||||
""""""
|
||||
@ -30,13 +32,17 @@ class CsvLoaderWidget(QtWidgets.QWidget):
|
||||
|
||||
def init_ui(self):
|
||||
""""""
|
||||
# someone ask me to disable maximum button
|
||||
self.setWindowFlags(
|
||||
(self.windowFlags() | Qt.CustomizeWindowHint)
|
||||
& ~Qt.WindowMaximizeButtonHint)
|
||||
self.ui.setupUi(self)
|
||||
|
||||
for i in Interval:
|
||||
self.ui.interval_combo.addItem(str(i), i)
|
||||
self.ui.interval_combo.addItem(str(i.name), i)
|
||||
|
||||
for i in Exchange:
|
||||
self.ui.exchange_combo.addItem(str(i), i)
|
||||
self.ui.exchange_combo.addItem(str(i.name), i)
|
||||
|
||||
def on_choose_button_pressed(self):
|
||||
""""""
|
||||
@ -59,3 +65,4 @@ class CsvLoaderWidget(QtWidgets.QWidget):
|
||||
self.loader.volume_head = self.ui.volume_edit.text()
|
||||
|
||||
self.loader.load()
|
||||
QMessageBox.information(self, _("载入成功!"), _("CSV行情载入成功!"))
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'csv_loader.ui'
|
||||
# Form implementation generated from reading ui file '../csv_loader.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.11.3
|
||||
#
|
||||
@ -94,7 +94,7 @@ class Ui_CsvLoader(object):
|
||||
|
||||
def retranslateUi(self, CsvLoader):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
CsvLoader.setWindowTitle(_translate("CsvLoader", "Csv载入器"))
|
||||
CsvLoader.setWindowTitle(_translate("CsvLoader", "CSV行情载入器"))
|
||||
self.choose_button.setText(_translate("CsvLoader", "选择文件"))
|
||||
self.label_8.setText(_translate("CsvLoader", "合约信息"))
|
||||
self.label_9.setText(_translate("CsvLoader", "Symbol"))
|
||||
|
Loading…
Reference in New Issue
Block a user