changeset 436:0dba4c0e5234

Added AboutDialog to translator.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Thu, 11 Oct 2007 16:34:22 +0200
parents 156d6301d79e
children 7ac9f94ca7ff
files trunk/src/translator/about.ui trunk/src/translator/translator.py trunk/src/translator/translator.ui trunk/src/translator/ui_about.py trunk/src/translator/ui_translator.py
diffstat 5 files changed, 161 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/trunk/src/translator/about.ui	Thu Oct 11 16:34:22 2007 +0200
@@ -0,0 +1,70 @@
+<ui version="4.0" >
+ <class>AboutDialog</class>
+ <widget class="QDialog" name="AboutDialog" >
+  <property name="windowModality" >
+   <enum>Qt::WindowModal</enum>
+  </property>
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>414</width>
+    <height>157</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>About</string>
+  </property>
+  <layout class="QVBoxLayout" >
+   <item>
+    <widget class="QLabel" name="label1" >
+     <property name="text" >
+      <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+p, li { white-space: pre-wrap; }
+&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">A tool for managing message catalogues in different languages.&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These catalogues can be used to make an application multilingual.&lt;/p>
+&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Copyright © 2007 by Aziz Köksal &amp;lt;aziz.koeksal@gmail.com&amp;gt;&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Licensed under the GPL2.&lt;/p>&lt;/body>&lt;/html></string>
+     </property>
+     <property name="textFormat" >
+      <enum>Qt::RichText</enum>
+     </property>
+     <property name="alignment" >
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+     </property>
+     <property name="wordWrap" >
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QDialogButtonBox" name="buttonBox" >
+     <property name="standardButtons" >
+      <set>QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>AboutDialog</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>346</x>
+     <y>274</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>317</x>
+     <y>256</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
--- a/trunk/src/translator/translator.py	Tue Oct 09 20:57:16 2007 +0200
+++ b/trunk/src/translator/translator.py	Thu Oct 11 16:34:22 2007 +0200
@@ -6,11 +6,26 @@
 from PyQt4 import QtCore, QtGui
 
 from ui_translator import Ui_MainWindow
+from ui_about import Ui_AboutDialog
+
+class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
+  def __init__(self):
+    QtGui.QMainWindow.__init__(self)
+    self.setupUi(self)
+
+    # Modifications
+
+    # Custom connections
+    QtCore.QObject.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.aboutDialog)
+
+  def aboutDialog(self):
+    about = QtGui.QDialog()
+    Ui_AboutDialog().setupUi(about)
+    about.exec_()
 
 
 if __name__ == "__main__":
-    app = QtGui.QApplication(sys.argv)
-    main = QtGui.QMainWindow()
-    Ui_MainWindow().setupUi(main)
-    main.show()
-    sys.exit(app.exec_())
+  app = QtGui.QApplication(sys.argv)
+  main = MainWindow()
+  main.show()
+  sys.exit(app.exec_())
--- a/trunk/src/translator/translator.ui	Tue Oct 09 20:57:16 2007 +0200
+++ b/trunk/src/translator/translator.ui	Thu Oct 11 16:34:22 2007 +0200
@@ -82,7 +82,14 @@
     </property>
     <addaction name="actionQuit" />
    </widget>
+   <widget class="QMenu" name="menu_Help" >
+    <property name="title" >
+     <string>&amp;Help</string>
+    </property>
+    <addaction name="actionAbout" />
+   </widget>
    <addaction name="menu_File" />
+   <addaction name="menu_Help" />
   </widget>
   <widget class="QStatusBar" name="statusbar" />
   <action name="actionQuit" >
@@ -93,6 +100,11 @@
     <string>Ctrl+Q</string>
    </property>
   </action>
+  <action name="actionAbout" >
+   <property name="text" >
+    <string>&amp;About</string>
+   </property>
+  </action>
  </widget>
  <tabstops>
   <tabstop>listView</tabstop>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/trunk/src/translator/ui_about.py	Thu Oct 11 16:34:22 2007 +0200
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'about.ui'
+#
+# Created: Thu Oct 11 13:54:26 2007
+#      by: PyQt4 UI code generator 4.1
+#
+# WARNING! All changes made in this file will be lost!
+
+import sys
+from PyQt4 import QtCore, QtGui
+
+class Ui_AboutDialog(object):
+    def setupUi(self, AboutDialog):
+        AboutDialog.setObjectName("AboutDialog")
+        AboutDialog.setWindowModality(QtCore.Qt.WindowModal)
+        AboutDialog.resize(QtCore.QSize(QtCore.QRect(0,0,414,157).size()).expandedTo(AboutDialog.minimumSizeHint()))
+
+        self.vboxlayout = QtGui.QVBoxLayout(AboutDialog)
+        self.vboxlayout.setObjectName("vboxlayout")
+
+        self.label1 = QtGui.QLabel(AboutDialog)
+        self.label1.setTextFormat(QtCore.Qt.RichText)
+        self.label1.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
+        self.label1.setWordWrap(True)
+        self.label1.setObjectName("label1")
+        self.vboxlayout.addWidget(self.label1)
+
+        self.buttonBox = QtGui.QDialogButtonBox(AboutDialog)
+        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
+        self.buttonBox.setObjectName("buttonBox")
+        self.vboxlayout.addWidget(self.buttonBox)
+
+        self.retranslateUi(AboutDialog)
+        QtCore.QObject.connect(self.buttonBox,QtCore.SIGNAL("accepted()"),AboutDialog.close)
+        QtCore.QMetaObject.connectSlotsByName(AboutDialog)
+
+    def retranslateUi(self, AboutDialog):
+        AboutDialog.setWindowTitle(QtGui.QApplication.translate("AboutDialog", "About", None, QtGui.QApplication.UnicodeUTF8))
+        self.label1.setText(QtGui.QApplication.translate("AboutDialog", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
+        "p, li { white-space: pre-wrap; }\n"
+        "</style></head><body style=\" font-family:\'Sans Serif\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
+        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">A tool for managing message catalogues in different languages.</p>\n"
+        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">These catalogues can be used to make an application multilingual.</p>\n"
+        "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n"
+        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Copyright © 2007 by Aziz Köksal &lt;aziz.koeksal@gmail.com&gt;</p>\n"
+        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Licensed under the GPL2.</p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
+
--- a/trunk/src/translator/ui_translator.py	Tue Oct 09 20:57:16 2007 +0200
+++ b/trunk/src/translator/ui_translator.py	Thu Oct 11 16:34:22 2007 +0200
@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'translator.ui'
 #
-# Created: Tue Oct  9 20:36:01 2007
+# Created: Wed Oct 10 22:04:31 2007
 #      by: PyQt4 UI code generator 4.1
 #
 # WARNING! All changes made in this file will be lost!
@@ -63,6 +63,9 @@
 
         self.menu_File = QtGui.QMenu(self.menubar)
         self.menu_File.setObjectName("menu_File")
+
+        self.menu_Help = QtGui.QMenu(self.menubar)
+        self.menu_Help.setObjectName("menu_Help")
         MainWindow.setMenuBar(self.menubar)
 
         self.statusbar = QtGui.QStatusBar(MainWindow)
@@ -71,8 +74,13 @@
 
         self.actionQuit = QtGui.QAction(MainWindow)
         self.actionQuit.setObjectName("actionQuit")
+
+        self.actionAbout = QtGui.QAction(MainWindow)
+        self.actionAbout.setObjectName("actionAbout")
         self.menu_File.addAction(self.actionQuit)
+        self.menu_Help.addAction(self.actionAbout)
         self.menubar.addAction(self.menu_File.menuAction())
+        self.menubar.addAction(self.menu_Help.menuAction())
 
         self.retranslateUi(MainWindow)
         QtCore.QObject.connect(self.pushButton,QtCore.SIGNAL("clicked()"),MainWindow.close)
@@ -86,6 +94,8 @@
         MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Translator", None, QtGui.QApplication.UnicodeUTF8))
         self.pushButton.setText(QtGui.QApplication.translate("MainWindow", "Exit", None, QtGui.QApplication.UnicodeUTF8))
         self.menu_File.setTitle(QtGui.QApplication.translate("MainWindow", "&File", None, QtGui.QApplication.UnicodeUTF8))
+        self.menu_Help.setTitle(QtGui.QApplication.translate("MainWindow", "&Help", None, QtGui.QApplication.UnicodeUTF8))
         self.actionQuit.setText(QtGui.QApplication.translate("MainWindow", "Quit", None, QtGui.QApplication.UnicodeUTF8))
         self.actionQuit.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Q", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionAbout.setText(QtGui.QApplication.translate("MainWindow", "&About", None, QtGui.QApplication.UnicodeUTF8))