You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.9 KiB
73 lines
2.9 KiB
#-*- coding: utf-8 -*-
|
|
|
|
# Copyright 2012 Calculate Ltd. http://www.calculate-linux.org
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
from PySide import QtGui, QtCore
|
|
from more import LabelWordWrap
|
|
import datetime, os
|
|
|
|
class HelpWgt(QtGui.QWidget):
|
|
def __init__(self, parent):
|
|
QtGui.QWidget.__init__(self)
|
|
|
|
cur_year = str(datetime.date.today().year)
|
|
|
|
help_text = '%s v%s. \n' %(parent.ClientObj.Name, \
|
|
parent.ClientObj.Version) + \
|
|
_('Composed of Calculate Utilities 3.0\n') + \
|
|
_("Calculate Utilities developed company ") + \
|
|
_('Calculate. (c) 2007-%s') %cur_year
|
|
|
|
helpLabel = LabelWordWrap(help_text, self)
|
|
helpLabel.setAlignment(QtCore.Qt.AlignJustify | QtCore.Qt.AlignVCenter)
|
|
# "<a href=\"http://www.calculate.ru\">link</a>", self)
|
|
linkLabel = LabelWordWrap("<a href='http://www.calculate.ru'>Сайт компании</a>"\
|
|
"<br><br><a href='http://www.calculate-linux.ru'>Сайт дистрибутива</a>")
|
|
linkLabel.setOpenExternalLinks(True)
|
|
helpQuit = QtGui.QPushButton(_("Quit"))
|
|
|
|
self.image_lbl = QtGui.QLabel(self)
|
|
|
|
filename = '/usr/share/apps/kwin/calculatecubecap.png'
|
|
x = 0
|
|
if not os.path.isfile(filename):
|
|
filename = '/usr/share/wallpapers/calculate-logo.png'
|
|
x += 100
|
|
ir = QtGui.QImageReader(filename)
|
|
ir.setScaledSize(QtCore.QSize(140 + x, 140))
|
|
img = ir.read()
|
|
pm2 = QtGui.QPixmap().fromImage(img)
|
|
|
|
self.image_lbl.setPixmap(pm2)
|
|
|
|
layout = QtGui.QGridLayout(self)
|
|
|
|
layout.addWidget(self.image_lbl, 0,0,3,1)
|
|
layout.addWidget(helpLabel,0,1)
|
|
layout.addWidget(linkLabel,1,1)
|
|
layout.addWidget(helpQuit,2,1)
|
|
self.setLayout(layout)
|
|
self.connect(helpQuit, QtCore.SIGNAL("clicked()"),
|
|
self, QtCore.SLOT("close()"))
|
|
|
|
self.move(100+parent.frameGeometry().x(), \
|
|
100+parent.frameGeometry().y())
|
|
self.resize(400 + x,200)
|
|
self.setWindowTitle (_('Calculate Utilities'))
|
|
self.setWindowIcon (QtGui.QIcon.fromTheme("help-about"))
|
|
|
|
# for clear memory after closed this window
|
|
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
|