Esempio n. 1
0
    def __init__(self, parent=None):
        Qt.QStatusBar.__init__(self, parent)

        #####

        self.__activation_semaphore = 0

        self.__timer = Qt.QTimer(self)

        #####

        icon_width = icon_height = label_height = self.style().pixelMetric(Qt.QStyle.PM_SmallIconSize)

        self.__message_label = Qt.QLabel(self)
        self.__message_label.setTextFormat(Qt.Qt.PlainText)
        self.__message_label.setMaximumHeight(label_height)
        self.addWidget(self.__message_label, 1)

        self.__wait_picture_movie = IconsLoader.gifMovie("circular")
        self.__wait_picture_movie.setScaledSize(Qt.QSize(icon_width, icon_height))
        self.__wait_picture_movie.jumpToFrame(0)
        self.__wait_picture_movie_label = Qt.QLabel(self)
        self.__wait_picture_movie_label.setMovie(self.__wait_picture_movie)
        self.__wait_picture_movie_label.hide()
        self.addWidget(self.__wait_picture_movie_label)

        #####

        self.connect(self.__timer, Qt.SIGNAL("timeout()"), self.clearStatusMessage)
Esempio n. 2
0
	def __init__(self, dict_name, parent = None) :
		Qt.QDialog.__init__(self, parent)

		self.setWindowIcon(IconsLoader.icon("xsl"))

		self.setMinimumSize(550, 400)
		self.resize(550, 400)

		#####

		self.__main_layout = Qt.QVBoxLayout()
		self.__main_layout.setContentsMargins(0, 0, 0, 0)
		self.__main_layout.setSpacing(0)
		self.setLayout(self.__main_layout)

		self.__dict_info_browser_layout = Qt.QVBoxLayout()
		self.__dict_info_browser_layout.setContentsMargins(0, 0, 0, 0)
		self.__dict_info_browser_layout.setSpacing(0)
		self.__main_layout.addLayout(self.__dict_info_browser_layout)

		self.__control_buttons_layout = Qt.QHBoxLayout()
		self.__control_buttons_layout.setContentsMargins(6, 6, 6, 6)
		self.__control_buttons_layout.setSpacing(6)
		self.__main_layout.addLayout(self.__control_buttons_layout)

		#####

		self.__dict_name = Qt.QString(dict_name)
		self.__info_loaded_flag = False

		self.__sl_dicts_info = SlDictsInfo.SlDictsInfo(self)

		#####

		self.__dict_info_browser = TextBrowser.TextBrowser(self)
		self.__dict_info_browser_layout.addWidget(self.__dict_info_browser)

		self.__wait_picture_movie = IconsLoader.gifMovie("circular")
		icon_width = icon_height = self.style().pixelMetric(Qt.QStyle.PM_SmallIconSize)
		self.__wait_picture_movie.setScaledSize(Qt.QSize(icon_width, icon_height))
		self.__wait_picture_movie.jumpToFrame(0)
		self.__wait_picture_movie_label = Qt.QLabel(self)
		self.__wait_picture_movie_label.setMovie(self.__wait_picture_movie)
		self.__wait_picture_movie_label.hide()
		self.__control_buttons_layout.addWidget(self.__wait_picture_movie_label)

		self.__wait_message_label = Qt.QLabel(self)
		self.__wait_message_label.hide()
		self.__control_buttons_layout.addWidget(self.__wait_message_label)

		self.__control_buttons_layout.addStretch()

		self.__update_info_button = Qt.QPushButton(self)
		self.__update_info_button.setIcon(IconsLoader.icon("view-refresh"))
		self.__control_buttons_layout.addWidget(self.__update_info_button)

		self.__ok_button = Qt.QPushButton(self)
		self.__ok_button.setIcon(IconsLoader.icon("dialog-ok-apply"))
		self.__ok_button.setDefault(True)
		self.__control_buttons_layout.addWidget(self.__ok_button)

		#####

		self.connect(self.__update_info_button, Qt.SIGNAL("clicked()"), self.updateInfo)
		self.connect(self.__ok_button, Qt.SIGNAL("clicked()"), self.accept)

		#####

		self.translateUi()
Esempio n. 3
0
	def __init__(self, parent = None) :
		Qt.QDialog.__init__(self, parent)

		self.setWindowIcon(IconsLoader.icon("xsl"))

		#####

		left_margin = self.style().pixelMetric(Qt.QStyle.PM_LayoutLeftMargin)
		top_margin = self.style().pixelMetric(Qt.QStyle.PM_LayoutTopMargin)
		right_margin = self.style().pixelMetric(Qt.QStyle.PM_LayoutRightMargin)
		bottom_margin = self.style().pixelMetric(Qt.QStyle.PM_LayoutBottomMargin)
		vertical_spacing = self.style().pixelMetric(Qt.QStyle.PM_LayoutVerticalSpacing)

		self.__main_layout = Qt.QVBoxLayout()
		self.__main_layout.setContentsMargins(0, 0, 0, 0)
		self.setLayout(self.__main_layout)

		self.__line_edit_layout = Qt.QHBoxLayout()
		self.__line_edit_layout.setContentsMargins(left_margin, top_margin, right_margin, vertical_spacing)
		self.__main_layout.addLayout(self.__line_edit_layout)

		self.__dicts_browser_stacked_layout = Qt.QStackedLayout()
		self.__main_layout.addLayout(self.__dicts_browser_stacked_layout)

		self.__control_buttons_layout = Qt.QHBoxLayout()
		self.__control_buttons_layout.setContentsMargins(left_margin, vertical_spacing, right_margin, bottom_margin)
		self.__main_layout.addLayout(self.__control_buttons_layout)

		self.__message_labels_stacked_widget = Qt.QStackedWidget()
		self.__control_buttons_layout.addWidget(self.__message_labels_stacked_widget)

		#####

		self.__settings = Settings.Settings(self)

		self.__all_dicts_dir_watcher = Qt.QFileSystemWatcher(Qt.QStringList() << Const.AllDictsDirPath, self)
		self.__all_dicts_dir_watcher_timer = Qt.QTimer(self)
		self.__all_dicts_dir_watcher_timer.setInterval(5000)
		self.__all_dicts_dir_watcher_timer.setSingleShot(True)

		#####

		self.__filter_label = Qt.QLabel(self)
		self.__line_edit_layout.addWidget(self.__filter_label)

		self.__line_edit = LineEdit.LineEdit(self)
		self.__filter_label.setBuddy(self.__line_edit)
		self.__line_edit_layout.addWidget(self.__line_edit)

		self.__dicts_browser = DictsListWidget.DictsListWidget(self)
		self.__dicts_browser_stacked_layout.addWidget(self.__dicts_browser)

		self.__wait_picture_movie = IconsLoader.gifMovie("circular")
		self.__wait_picture_movie.setScaledSize(Qt.QSize(32, 32))
		self.__wait_picture_movie.jumpToFrame(0)
		self.__wait_picture_movie_label = Qt.QLabel(self)
		self.__wait_picture_movie_label.setAlignment(Qt.Qt.AlignHCenter|Qt.Qt.AlignVCenter)
		self.__wait_picture_movie_label.setMovie(self.__wait_picture_movie)
		self.__dicts_browser_stacked_layout.addWidget(self.__wait_picture_movie_label)

		self.__install_dicts_label = Qt.QLabel(self)
		self.__install_dicts_label.setOpenExternalLinks(True)
		self.__install_dicts_label.setTextFormat(Qt.Qt.RichText)
		self.__message_labels_stacked_widget.addWidget(self.__install_dicts_label)

		self.__wait_message_label = Qt.QLabel(self)
		self.__message_labels_stacked_widget.addWidget(self.__wait_message_label)

		self.__control_buttons_layout.addStretch()

		self.__update_dicts_button = Qt.QPushButton(self)
		self.__update_dicts_button.setIcon(IconsLoader.icon("view-refresh"))
		self.__update_dicts_button.setAutoDefault(False)
		self.__update_dicts_button.setDefault(False)
		self.__control_buttons_layout.addWidget(self.__update_dicts_button)

		self.__ok_button = Qt.QPushButton(self)
		self.__ok_button.setIcon(IconsLoader.icon("dialog-ok-apply"))
		self.__ok_button.setAutoDefault(False)
		self.__ok_button.setDefault(False)
		self.__control_buttons_layout.addWidget(self.__ok_button)

		self.__message_labels_stacked_widget.setMaximumHeight(self.__control_buttons_layout.minimumSize().height())

		#####

		self.connect(self.__all_dicts_dir_watcher, Qt.SIGNAL("directoryChanged(const QString &)"), self.planToUpdateDicts)
		self.connect(self.__all_dicts_dir_watcher_timer, Qt.SIGNAL("timeout()"), self.updateDicts)

		self.connect(self.__line_edit, Qt.SIGNAL("textChanged(const QString &)"), self.__dicts_browser.setFilter)

		self.connect(self.__dicts_browser, Qt.SIGNAL("dictsListChanged(const QStringList &)"), self.dictsListChangedSignal)

		self.connect(self.__update_dicts_button, Qt.SIGNAL("clicked()"), self.updateDicts)
		self.connect(self.__ok_button, Qt.SIGNAL("clicked()"), self.accept)

		#####

		self.__dicts_browser_stacked_layout.setCurrentIndex(0)
		self.__message_labels_stacked_widget.setCurrentIndex(0)

		self.translateUi()