~ubuntu-branches/ubuntu/utopic/ubuntu-kylin-software-center/utopic-proposed

« back to all changes in this revision

Viewing changes to test/restarttext.py

  • Committer: Package Import Robot
  • Author(s): Jun Ma, Shine, wenbo607
  • Date: 2014-04-30 14:03:20 UTC
  • Revision ID: package-import@ubuntu.com-20140430140320-juk0qslpxsnl39pc
Tags: 0.2.9.6
 
[ Shine ]
* solve the search entry ui problem (bug#1309900)

[ wenbo607 ]
* update the translations of some apps in feature category.
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# -*- coding: utf-8 -*-
 
3
__author__ = 'Shine Huang'
 
4
 
 
5
import sys
 
6
import os
 
7
from PyQt4.QtGui import *
 
8
from PyQt4.QtCore import *
 
9
class AAA(QMainWindow):
 
10
    def __init__(self,parent=None):
 
11
        QMainWindow.__init__(self,parent)
 
12
 
 
13
        self.resize(600,600)
 
14
        self.bbb = QPushButton(self)
 
15
        self.bbb.setGeometry(50,50,70,25)
 
16
        self.bbb.clicked.connect(self.ccc)
 
17
 
 
18
    def ccc(self):
 
19
        os.execv("/usr/bin/python", ["foo", "/home/shine/PycharmProjects/ubuntu-kylin-software-center/test/restarttext.py"])
 
20
 
 
21
def main():
 
22
    app = QApplication(sys.argv)
 
23
 
 
24
    QTextCodec.setCodecForTr(QTextCodec.codecForName("UTF-8"))
 
25
    QTextCodec.setCodecForCStrings(QTextCodec.codecForName("UTF-8"))
 
26
 
 
27
    mw = AAA()
 
28
    windowWidth = QApplication.desktop().width()
 
29
    windowHeight = QApplication.desktop().height()
 
30
    mw.move((windowWidth - mw.width()) / 2, (windowHeight - mw.height()) / 2)
 
31
    mw.show()
 
32
 
 
33
    sys.exit(app.exec_())
 
34
 
 
35
 
 
36
if __name__ == '__main__':
 
37
    main()
 
 
b'\\ No newline at end of file'