diff --git a/vnpy/app/csv_loader/__init__.py b/vnpy/app/csv_loader/__init__.py index f97d4319..390f61c2 100644 --- a/vnpy/app/csv_loader/__init__.py +++ b/vnpy/app/csv_loader/__init__.py @@ -13,4 +13,4 @@ class CsvLoaderApp(BaseApp): display_name = "CSV行情载入器" engine_class = CsvLoader widget_name = "CsvLoaderWidget" - icon_name = "cta.ico" + icon_name = "csv.ico" diff --git a/vnpy/app/csv_loader/ui/csv_loader.ui b/vnpy/app/csv_loader/ui/csv_loader.ui index 73b21e96..44b6542c 100644 --- a/vnpy/app/csv_loader/ui/csv_loader.ui +++ b/vnpy/app/csv_loader/ui/csv_loader.ui @@ -3,7 +3,7 @@ CsvLoader - Csv载入器 + CSV行情载入器 diff --git a/vnpy/app/csv_loader/ui/csv_loader_widget.py b/vnpy/app/csv_loader/ui/csv_loader_widget.py index 4264ac65..adcb2cc8 100644 --- a/vnpy/app/csv_loader/ui/csv_loader_widget.py +++ b/vnpy/app/csv_loader/ui/csv_loader_widget.py @@ -7,12 +7,15 @@ compile: pyuic5 csv_loader.ui -o uic/uic_csv_loader.py ``` """ -from PyQt5.QtWidgets import QFileDialog +from gettext import gettext as _ + +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 @@ -30,13 +33,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 +66,4 @@ class CsvLoaderWidget(QtWidgets.QWidget): self.loader.volume_head = self.ui.volume_edit.text() self.loader.load() + QMessageBox.information(self, _("载入成功!"), _("CSV行情载入成功!")) diff --git a/vnpy/app/csv_loader/ui/uic/uic_csv_loader.py b/vnpy/app/csv_loader/ui/uic/uic_csv_loader.py index 48789519..b96bd980 100644 --- a/vnpy/app/csv_loader/ui/uic/uic_csv_loader.py +++ b/vnpy/app/csv_loader/ui/uic/uic_csv_loader.py @@ -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"))