Thread: [Pymoul-svn] SF.net SVN: pymoul: [69] pymoul/trunk/src/moul/qt
Status: Alpha
Brought to you by:
tiran
From: <ti...@us...> - 2007-01-24 18:27:03
|
Revision: 69 http://pymoul.svn.sourceforge.net/pymoul/?rev=69&view=rev Author: tiran Date: 2007-01-24 10:26:59 -0800 (Wed, 24 Jan 2007) Log Message: ----------- Some UI cleanup Modified Paths: -------------- pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-24 17:01:15 UTC (rev 68) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-24 18:26:59 UTC (rev 69) @@ -50,8 +50,15 @@ # Set up the user interface from Designer. self.setupUi(self) + # hook up main buttonbox + but = self.main_buttonbox.button + self.main_buttonbox_reset = but(QtGui.QDialogButtonBox.Reset) + self.main_buttonbox_save = but(QtGui.QDialogButtonBox.Save) + self.main_buttonbox_close = but(QtGui.QDialogButtonBox.Close) + # dirty flag: unsaved changes self._dirty = False + self.setDirty(False) # init handlers self._timezone_init() @@ -60,6 +67,7 @@ self._ping_init() self._systray_init() + def closeEvent(self, event): """Close event handler @@ -84,6 +92,13 @@ # event.accept() event.ignore() + def setDirty(self, boolean): + """Sets the save state + """ + self._dirty = bool(boolean) + self.main_buttonbox_reset.setEnabled(boolean) + self.main_buttonbox_save.setEnabled(boolean) + # ************************************************************************ # system tray def _systray_init(self): Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-24 17:01:15 UTC (rev 68) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-24 18:26:59 UTC (rev 69) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'src\moul\qt\ui\mainwindow.ui' # -# Created: Wed Jan 24 17:55:00 2007 +# Created: Wed Jan 24 19:25:53 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -27,12 +27,12 @@ self.centralwidget.setEnabled(True) self.centralwidget.setObjectName("centralwidget") - self.label = QtGui.QLabel(self.centralwidget) - self.label.setGeometry(QtCore.QRect(15,10,430,58)) - self.label.setFrameShape(QtGui.QFrame.StyledPanel) - self.label.setFrameShadow(QtGui.QFrame.Sunken) - self.label.setPixmap(QtGui.QPixmap(":/resources/moul_logo.png")) - self.label.setObjectName("label") + self.lb_top_image = QtGui.QLabel(self.centralwidget) + self.lb_top_image.setGeometry(QtCore.QRect(15,10,430,58)) + self.lb_top_image.setFrameShape(QtGui.QFrame.StyledPanel) + self.lb_top_image.setFrameShadow(QtGui.QFrame.Sunken) + self.lb_top_image.setPixmap(QtGui.QPixmap(":/resources/moul_logo.png")) + self.lb_top_image.setObjectName("lb_top_image") self.horizontalLayout = QtGui.QWidget(self.centralwidget) self.horizontalLayout.setGeometry(QtCore.QRect(60,70,341,31)) @@ -44,6 +44,7 @@ self.hboxlayout.setObjectName("hboxlayout") self.comboBox = QtGui.QComboBox(self.horizontalLayout) + self.comboBox.setEnabled(False) font = QtGui.QFont(self.comboBox.font()) font.setPointSize(6) @@ -52,12 +53,15 @@ self.hboxlayout.addWidget(self.comboBox) self.pushButton = QtGui.QPushButton(self.horizontalLayout) + self.pushButton.setEnabled(False) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(0),QtGui.QSizePolicy.Policy(0)) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth()) self.pushButton.setSizePolicy(sizePolicy) + self.pushButton.setMaximumSize(QtCore.QSize(16777215,20)) + self.pushButton.setBaseSize(QtCore.QSize(0,20)) font = QtGui.QFont(self.pushButton.font()) font.setPointSize(8) @@ -65,72 +69,47 @@ self.pushButton.setObjectName("pushButton") self.hboxlayout.addWidget(self.pushButton) - self.buttonbox_rresavcl = QtGui.QDialogButtonBox(self.centralwidget) - self.buttonbox_rresavcl.setGeometry(QtCore.QRect(10,480,441,32)) - self.buttonbox_rresavcl.setOrientation(QtCore.Qt.Horizontal) - self.buttonbox_rresavcl.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Reset|QtGui.QDialogButtonBox.Save) - self.buttonbox_rresavcl.setObjectName("buttonbox_rresavcl") + self.main_buttonbox = QtGui.QDialogButtonBox(self.centralwidget) + self.main_buttonbox.setGeometry(QtCore.QRect(10,480,441,32)) + self.main_buttonbox.setOrientation(QtCore.Qt.Horizontal) + self.main_buttonbox.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Reset|QtGui.QDialogButtonBox.Save) + self.main_buttonbox.setObjectName("main_buttonbox") - self.tab_graphics = QtGui.QTabWidget(self.centralwidget) - self.tab_graphics.setGeometry(QtCore.QRect(5,100,450,375)) - self.tab_graphics.setTabPosition(QtGui.QTabWidget.North) + self.tabwidget = QtGui.QTabWidget(self.centralwidget) + self.tabwidget.setGeometry(QtCore.QRect(5,100,450,375)) + self.tabwidget.setTabPosition(QtGui.QTabWidget.North) + self.tabwidget.setObjectName("tabwidget") + + self.tab_graphics = QtGui.QWidget() self.tab_graphics.setObjectName("tab_graphics") - self.tab_graphics1 = QtGui.QWidget() - self.tab_graphics1.setObjectName("tab_graphics1") - - self.groupBox_gra_checkboxes = QtGui.QGroupBox(self.tab_graphics1) + self.groupBox_gra_checkboxes = QtGui.QGroupBox(self.tab_graphics) self.groupBox_gra_checkboxes.setEnabled(True) self.groupBox_gra_checkboxes.setGeometry(QtCore.QRect(240,10,201,71)) self.groupBox_gra_checkboxes.setObjectName("groupBox_gra_checkboxes") - self.groupBox_4 = QtGui.QGroupBox(self.groupBox_gra_checkboxes) - self.groupBox_4.setGeometry(QtCore.QRect(250,100,201,71)) - self.groupBox_4.setObjectName("groupBox_4") + self.verticalLayout = QtGui.QWidget(self.groupBox_gra_checkboxes) + self.verticalLayout.setGeometry(QtCore.QRect(10,0,160,71)) + self.verticalLayout.setObjectName("verticalLayout") - self.verticalLayout_4 = QtGui.QWidget(self.groupBox_4) - self.verticalLayout_4.setGeometry(QtCore.QRect(10,0,160,71)) - self.verticalLayout_4.setObjectName("verticalLayout_4") - - self.vboxlayout = QtGui.QVBoxLayout(self.verticalLayout_4) + self.vboxlayout = QtGui.QVBoxLayout(self.verticalLayout) self.vboxlayout.setMargin(0) self.vboxlayout.setSpacing(6) self.vboxlayout.setObjectName("vboxlayout") - self.checkBox_4 = QtGui.QCheckBox(self.verticalLayout_4) - self.checkBox_4.setObjectName("checkBox_4") - self.vboxlayout.addWidget(self.checkBox_4) - - self.checkBox_5 = QtGui.QCheckBox(self.verticalLayout_4) - self.checkBox_5.setObjectName("checkBox_5") - self.vboxlayout.addWidget(self.checkBox_5) - - self.checkBox_6 = QtGui.QCheckBox(self.verticalLayout_4) - self.checkBox_6.setObjectName("checkBox_6") - self.vboxlayout.addWidget(self.checkBox_6) - - self.verticalLayout = QtGui.QWidget(self.groupBox_gra_checkboxes) - self.verticalLayout.setGeometry(QtCore.QRect(10,0,160,71)) - self.verticalLayout.setObjectName("verticalLayout") - - self.vboxlayout1 = QtGui.QVBoxLayout(self.verticalLayout) - self.vboxlayout1.setMargin(0) - self.vboxlayout1.setSpacing(6) - self.vboxlayout1.setObjectName("vboxlayout1") - self.cb_gra_windowed = QtGui.QCheckBox(self.verticalLayout) self.cb_gra_windowed.setObjectName("cb_gra_windowed") - self.vboxlayout1.addWidget(self.cb_gra_windowed) + self.vboxlayout.addWidget(self.cb_gra_windowed) self.cb_gra_vsync = QtGui.QCheckBox(self.verticalLayout) self.cb_gra_vsync.setObjectName("cb_gra_vsync") - self.vboxlayout1.addWidget(self.cb_gra_vsync) + self.vboxlayout.addWidget(self.cb_gra_vsync) self.cb_gra_shadow = QtGui.QCheckBox(self.verticalLayout) self.cb_gra_shadow.setObjectName("cb_gra_shadow") - self.vboxlayout1.addWidget(self.cb_gra_shadow) + self.vboxlayout.addWidget(self.cb_gra_shadow) - self.groupBox_screenres = QtGui.QGroupBox(self.tab_graphics1) + self.groupBox_screenres = QtGui.QGroupBox(self.tab_graphics) self.groupBox_screenres.setGeometry(QtCore.QRect(10,0,220,81)) self.groupBox_screenres.setObjectName("groupBox_screenres") @@ -138,10 +117,10 @@ self.verticalLayout_2.setGeometry(QtCore.QRect(20,20,181,51)) self.verticalLayout_2.setObjectName("verticalLayout_2") - self.vboxlayout2 = QtGui.QVBoxLayout(self.verticalLayout_2) - self.vboxlayout2.setMargin(0) - self.vboxlayout2.setSpacing(6) - self.vboxlayout2.setObjectName("vboxlayout2") + self.vboxlayout1 = QtGui.QVBoxLayout(self.verticalLayout_2) + self.vboxlayout1.setMargin(0) + self.vboxlayout1.setSpacing(6) + self.vboxlayout1.setObjectName("vboxlayout1") self.sl_gra_screenres = QtGui.QSlider(self.verticalLayout_2) self.sl_gra_screenres.setMaximum(10) @@ -152,14 +131,14 @@ self.sl_gra_screenres.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_screenres.setTickInterval(1) self.sl_gra_screenres.setObjectName("sl_gra_screenres") - self.vboxlayout2.addWidget(self.sl_gra_screenres) + self.vboxlayout1.addWidget(self.sl_gra_screenres) self.lb_screenres = QtGui.QLabel(self.verticalLayout_2) self.lb_screenres.setAlignment(QtCore.Qt.AlignCenter) self.lb_screenres.setObjectName("lb_screenres") - self.vboxlayout2.addWidget(self.lb_screenres) + self.vboxlayout1.addWidget(self.lb_screenres) - self.groupBox_gra_quality = QtGui.QGroupBox(self.tab_graphics1) + self.groupBox_gra_quality = QtGui.QGroupBox(self.tab_graphics) self.groupBox_gra_quality.setEnabled(True) self.groupBox_gra_quality.setGeometry(QtCore.QRect(10,79,430,261)) self.groupBox_gra_quality.setObjectName("groupBox_gra_quality") @@ -168,15 +147,15 @@ self.verticalLayout_7.setGeometry(QtCore.QRect(230,20,179,71)) self.verticalLayout_7.setObjectName("verticalLayout_7") - self.vboxlayout3 = QtGui.QVBoxLayout(self.verticalLayout_7) - self.vboxlayout3.setMargin(0) - self.vboxlayout3.setSpacing(6) - self.vboxlayout3.setObjectName("vboxlayout3") + self.vboxlayout2 = QtGui.QVBoxLayout(self.verticalLayout_7) + self.vboxlayout2.setMargin(0) + self.vboxlayout2.setSpacing(6) + self.vboxlayout2.setObjectName("vboxlayout2") - self.label_20 = QtGui.QLabel(self.verticalLayout_7) - self.label_20.setAlignment(QtCore.Qt.AlignCenter) - self.label_20.setObjectName("label_20") - self.vboxlayout3.addWidget(self.label_20) + self.lb_gra_tq = QtGui.QLabel(self.verticalLayout_7) + self.lb_gra_tq.setAlignment(QtCore.Qt.AlignCenter) + self.lb_gra_tq.setObjectName("lb_gra_tq") + self.vboxlayout2.addWidget(self.lb_gra_tq) self.sl_gra_texture = QtGui.QSlider(self.verticalLayout_7) self.sl_gra_texture.setMinimum(0) @@ -189,36 +168,36 @@ self.sl_gra_texture.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_texture.setTickInterval(1) self.sl_gra_texture.setObjectName("sl_gra_texture") - self.vboxlayout3.addWidget(self.sl_gra_texture) + self.vboxlayout2.addWidget(self.sl_gra_texture) self.hboxlayout1 = QtGui.QHBoxLayout() self.hboxlayout1.setMargin(0) self.hboxlayout1.setSpacing(6) self.hboxlayout1.setObjectName("hboxlayout1") - self.label_21 = QtGui.QLabel(self.verticalLayout_7) - self.label_21.setObjectName("label_21") - self.hboxlayout1.addWidget(self.label_21) + self.lb_gra_tq_low = QtGui.QLabel(self.verticalLayout_7) + self.lb_gra_tq_low.setObjectName("lb_gra_tq_low") + self.hboxlayout1.addWidget(self.lb_gra_tq_low) - self.label_22 = QtGui.QLabel(self.verticalLayout_7) - self.label_22.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.label_22.setObjectName("label_22") - self.hboxlayout1.addWidget(self.label_22) - self.vboxlayout3.addLayout(self.hboxlayout1) + self.lb_gra_tq_high = QtGui.QLabel(self.verticalLayout_7) + self.lb_gra_tq_high.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.lb_gra_tq_high.setObjectName("lb_gra_tq_high") + self.hboxlayout1.addWidget(self.lb_gra_tq_high) + self.vboxlayout2.addLayout(self.hboxlayout1) self.verticalLayout_5 = QtGui.QWidget(self.groupBox_gra_quality) self.verticalLayout_5.setGeometry(QtCore.QRect(20,100,179,71)) self.verticalLayout_5.setObjectName("verticalLayout_5") - self.vboxlayout4 = QtGui.QVBoxLayout(self.verticalLayout_5) - self.vboxlayout4.setMargin(0) - self.vboxlayout4.setSpacing(6) - self.vboxlayout4.setObjectName("vboxlayout4") + self.vboxlayout3 = QtGui.QVBoxLayout(self.verticalLayout_5) + self.vboxlayout3.setMargin(0) + self.vboxlayout3.setSpacing(6) + self.vboxlayout3.setObjectName("vboxlayout3") - self.label_13 = QtGui.QLabel(self.verticalLayout_5) - self.label_13.setAlignment(QtCore.Qt.AlignCenter) - self.label_13.setObjectName("label_13") - self.vboxlayout4.addWidget(self.label_13) + self.lb_gra_aa = QtGui.QLabel(self.verticalLayout_5) + self.lb_gra_aa.setAlignment(QtCore.Qt.AlignCenter) + self.lb_gra_aa.setObjectName("lb_gra_aa") + self.vboxlayout3.addWidget(self.lb_gra_aa) self.sl_gra_antialias = QtGui.QSlider(self.verticalLayout_5) self.sl_gra_antialias.setMinimum(0) @@ -232,36 +211,36 @@ self.sl_gra_antialias.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_antialias.setTickInterval(2) self.sl_gra_antialias.setObjectName("sl_gra_antialias") - self.vboxlayout4.addWidget(self.sl_gra_antialias) + self.vboxlayout3.addWidget(self.sl_gra_antialias) self.hboxlayout2 = QtGui.QHBoxLayout() self.hboxlayout2.setMargin(0) self.hboxlayout2.setSpacing(6) self.hboxlayout2.setObjectName("hboxlayout2") - self.label_14 = QtGui.QLabel(self.verticalLayout_5) - self.label_14.setObjectName("label_14") - self.hboxlayout2.addWidget(self.label_14) + self.lb_gra_aa_low = QtGui.QLabel(self.verticalLayout_5) + self.lb_gra_aa_low.setObjectName("lb_gra_aa_low") + self.hboxlayout2.addWidget(self.lb_gra_aa_low) - self.label_16 = QtGui.QLabel(self.verticalLayout_5) - self.label_16.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.label_16.setObjectName("label_16") - self.hboxlayout2.addWidget(self.label_16) - self.vboxlayout4.addLayout(self.hboxlayout2) + self.lb_gra_aa_low1 = QtGui.QLabel(self.verticalLayout_5) + self.lb_gra_aa_low1.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.lb_gra_aa_low1.setObjectName("lb_gra_aa_low1") + self.hboxlayout2.addWidget(self.lb_gra_aa_low1) + self.vboxlayout3.addLayout(self.hboxlayout2) self.verticalLayout_3 = QtGui.QWidget(self.groupBox_gra_quality) self.verticalLayout_3.setGeometry(QtCore.QRect(20,20,179,71)) self.verticalLayout_3.setObjectName("verticalLayout_3") - self.vboxlayout5 = QtGui.QVBoxLayout(self.verticalLayout_3) - self.vboxlayout5.setMargin(0) - self.vboxlayout5.setSpacing(6) - self.vboxlayout5.setObjectName("vboxlayout5") + self.vboxlayout4 = QtGui.QVBoxLayout(self.verticalLayout_3) + self.vboxlayout4.setMargin(0) + self.vboxlayout4.setSpacing(6) + self.vboxlayout4.setObjectName("vboxlayout4") - self.label_2 = QtGui.QLabel(self.verticalLayout_3) - self.label_2.setAlignment(QtCore.Qt.AlignCenter) - self.label_2.setObjectName("label_2") - self.vboxlayout5.addWidget(self.label_2) + self.lb_gra_quality = QtGui.QLabel(self.verticalLayout_3) + self.lb_gra_quality.setAlignment(QtCore.Qt.AlignCenter) + self.lb_gra_quality.setObjectName("lb_gra_quality") + self.vboxlayout4.addWidget(self.lb_gra_quality) self.sl_gra_quality = QtGui.QSlider(self.verticalLayout_3) self.sl_gra_quality.setMinimum(0) @@ -274,46 +253,46 @@ self.sl_gra_quality.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_quality.setTickInterval(1) self.sl_gra_quality.setObjectName("sl_gra_quality") - self.vboxlayout5.addWidget(self.sl_gra_quality) + self.vboxlayout4.addWidget(self.sl_gra_quality) self.hboxlayout3 = QtGui.QHBoxLayout() self.hboxlayout3.setMargin(0) self.hboxlayout3.setSpacing(6) self.hboxlayout3.setObjectName("hboxlayout3") - self.label_8 = QtGui.QLabel(self.verticalLayout_3) - self.label_8.setObjectName("label_8") - self.hboxlayout3.addWidget(self.label_8) + self.lb_gra_quality_low = QtGui.QLabel(self.verticalLayout_3) + self.lb_gra_quality_low.setObjectName("lb_gra_quality_low") + self.hboxlayout3.addWidget(self.lb_gra_quality_low) - self.label_9 = QtGui.QLabel(self.verticalLayout_3) - self.label_9.setAlignment(QtCore.Qt.AlignCenter) - self.label_9.setObjectName("label_9") - self.hboxlayout3.addWidget(self.label_9) + self.lb_gra_quality_medium = QtGui.QLabel(self.verticalLayout_3) + self.lb_gra_quality_medium.setAlignment(QtCore.Qt.AlignCenter) + self.lb_gra_quality_medium.setObjectName("lb_gra_quality_medium") + self.hboxlayout3.addWidget(self.lb_gra_quality_medium) - self.label_10 = QtGui.QLabel(self.verticalLayout_3) - self.label_10.setAlignment(QtCore.Qt.AlignCenter) - self.label_10.setObjectName("label_10") - self.hboxlayout3.addWidget(self.label_10) + self.lb_gra_quality_high = QtGui.QLabel(self.verticalLayout_3) + self.lb_gra_quality_high.setAlignment(QtCore.Qt.AlignCenter) + self.lb_gra_quality_high.setObjectName("lb_gra_quality_high") + self.hboxlayout3.addWidget(self.lb_gra_quality_high) - self.label_7 = QtGui.QLabel(self.verticalLayout_3) - self.label_7.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.label_7.setObjectName("label_7") - self.hboxlayout3.addWidget(self.label_7) - self.vboxlayout5.addLayout(self.hboxlayout3) + self.lb_gra_quality_ultra = QtGui.QLabel(self.verticalLayout_3) + self.lb_gra_quality_ultra.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.lb_gra_quality_ultra.setObjectName("lb_gra_quality_ultra") + self.hboxlayout3.addWidget(self.lb_gra_quality_ultra) + self.vboxlayout4.addLayout(self.hboxlayout3) self.verticalLayout_8 = QtGui.QWidget(self.groupBox_gra_quality) self.verticalLayout_8.setGeometry(QtCore.QRect(20,180,179,71)) self.verticalLayout_8.setObjectName("verticalLayout_8") - self.vboxlayout6 = QtGui.QVBoxLayout(self.verticalLayout_8) - self.vboxlayout6.setMargin(0) - self.vboxlayout6.setSpacing(6) - self.vboxlayout6.setObjectName("vboxlayout6") + self.vboxlayout5 = QtGui.QVBoxLayout(self.verticalLayout_8) + self.vboxlayout5.setMargin(0) + self.vboxlayout5.setSpacing(6) + self.vboxlayout5.setObjectName("vboxlayout5") - self.label_15 = QtGui.QLabel(self.verticalLayout_8) - self.label_15.setAlignment(QtCore.Qt.AlignCenter) - self.label_15.setObjectName("label_15") - self.vboxlayout6.addWidget(self.label_15) + self.lb_gra_sq = QtGui.QLabel(self.verticalLayout_8) + self.lb_gra_sq.setAlignment(QtCore.Qt.AlignCenter) + self.lb_gra_sq.setObjectName("lb_gra_sq") + self.vboxlayout5.addWidget(self.lb_gra_sq) self.sl_gra_shadow = QtGui.QSlider(self.verticalLayout_8) self.sl_gra_shadow.setMinimum(0) @@ -326,36 +305,36 @@ self.sl_gra_shadow.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_shadow.setTickInterval(25) self.sl_gra_shadow.setObjectName("sl_gra_shadow") - self.vboxlayout6.addWidget(self.sl_gra_shadow) + self.vboxlayout5.addWidget(self.sl_gra_shadow) self.hboxlayout4 = QtGui.QHBoxLayout() self.hboxlayout4.setMargin(0) self.hboxlayout4.setSpacing(6) self.hboxlayout4.setObjectName("hboxlayout4") - self.label_23 = QtGui.QLabel(self.verticalLayout_8) - self.label_23.setObjectName("label_23") - self.hboxlayout4.addWidget(self.label_23) + self.lb_gra_sq_low = QtGui.QLabel(self.verticalLayout_8) + self.lb_gra_sq_low.setObjectName("lb_gra_sq_low") + self.hboxlayout4.addWidget(self.lb_gra_sq_low) - self.label_24 = QtGui.QLabel(self.verticalLayout_8) - self.label_24.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.label_24.setObjectName("label_24") - self.hboxlayout4.addWidget(self.label_24) - self.vboxlayout6.addLayout(self.hboxlayout4) + self.lb_gra_sq_high = QtGui.QLabel(self.verticalLayout_8) + self.lb_gra_sq_high.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.lb_gra_sq_high.setObjectName("lb_gra_sq_high") + self.hboxlayout4.addWidget(self.lb_gra_sq_high) + self.vboxlayout5.addLayout(self.hboxlayout4) self.verticalLayout_6 = QtGui.QWidget(self.groupBox_gra_quality) self.verticalLayout_6.setGeometry(QtCore.QRect(230,100,179,73)) self.verticalLayout_6.setObjectName("verticalLayout_6") - self.vboxlayout7 = QtGui.QVBoxLayout(self.verticalLayout_6) - self.vboxlayout7.setMargin(0) - self.vboxlayout7.setSpacing(6) - self.vboxlayout7.setObjectName("vboxlayout7") + self.vboxlayout6 = QtGui.QVBoxLayout(self.verticalLayout_6) + self.vboxlayout6.setMargin(0) + self.vboxlayout6.setSpacing(6) + self.vboxlayout6.setObjectName("vboxlayout6") - self.label_17 = QtGui.QLabel(self.verticalLayout_6) - self.label_17.setAlignment(QtCore.Qt.AlignCenter) - self.label_17.setObjectName("label_17") - self.vboxlayout7.addWidget(self.label_17) + self.lb_gra_af = QtGui.QLabel(self.verticalLayout_6) + self.lb_gra_af.setAlignment(QtCore.Qt.AlignCenter) + self.lb_gra_af.setObjectName("lb_gra_af") + self.vboxlayout6.addWidget(self.lb_gra_af) self.sl_gra_anisotropic = QtGui.QSlider(self.verticalLayout_6) self.sl_gra_anisotropic.setMinimum(1) @@ -368,23 +347,23 @@ self.sl_gra_anisotropic.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_gra_anisotropic.setTickInterval(5) self.sl_gra_anisotropic.setObjectName("sl_gra_anisotropic") - self.vboxlayout7.addWidget(self.sl_gra_anisotropic) + self.vboxlayout6.addWidget(self.sl_gra_anisotropic) self.hboxlayout5 = QtGui.QHBoxLayout() self.hboxlayout5.setMargin(0) self.hboxlayout5.setSpacing(6) self.hboxlayout5.setObjectName("hboxlayout5") - self.label_18 = QtGui.QLabel(self.verticalLayout_6) - self.label_18.setObjectName("label_18") - self.hboxlayout5.addWidget(self.label_18) + self.lb_gra_af_low = QtGui.QLabel(self.verticalLayout_6) + self.lb_gra_af_low.setObjectName("lb_gra_af_low") + self.hboxlayout5.addWidget(self.lb_gra_af_low) - self.label_19 = QtGui.QLabel(self.verticalLayout_6) - self.label_19.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.label_19.setObjectName("label_19") - self.hboxlayout5.addWidget(self.label_19) - self.vboxlayout7.addLayout(self.hboxlayout5) - self.tab_graphics.addTab(self.tab_graphics1,"") + self.lb_gra_af_high = QtGui.QLabel(self.verticalLayout_6) + self.lb_gra_af_high.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.lb_gra_af_high.setObjectName("lb_gra_af_high") + self.hboxlayout5.addWidget(self.lb_gra_af_high) + self.vboxlayout6.addLayout(self.hboxlayout5) + self.tabwidget.addTab(self.tab_graphics,"") self.tab_audio = QtGui.QWidget() self.tab_audio.setObjectName("tab_audio") @@ -398,15 +377,15 @@ self.verticalLayout_12.setGeometry(QtCore.QRect(230,80,179,43)) self.verticalLayout_12.setObjectName("verticalLayout_12") - self.vboxlayout8 = QtGui.QVBoxLayout(self.verticalLayout_12) - self.vboxlayout8.setMargin(0) - self.vboxlayout8.setSpacing(6) - self.vboxlayout8.setObjectName("vboxlayout8") + self.vboxlayout7 = QtGui.QVBoxLayout(self.verticalLayout_12) + self.vboxlayout7.setMargin(0) + self.vboxlayout7.setSpacing(6) + self.vboxlayout7.setObjectName("vboxlayout7") - self.label_31 = QtGui.QLabel(self.verticalLayout_12) - self.label_31.setAlignment(QtCore.Qt.AlignCenter) - self.label_31.setObjectName("label_31") - self.vboxlayout8.addWidget(self.label_31) + self.lb_aud_npc = QtGui.QLabel(self.verticalLayout_12) + self.lb_aud_npc.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_npc.setObjectName("lb_aud_npc") + self.vboxlayout7.addWidget(self.lb_aud_npc) self.sl_aud_npc = QtGui.QSlider(self.verticalLayout_12) self.sl_aud_npc.setMinimum(0) @@ -419,21 +398,21 @@ self.sl_aud_npc.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_aud_npc.setTickInterval(25) self.sl_aud_npc.setObjectName("sl_aud_npc") - self.vboxlayout8.addWidget(self.sl_aud_npc) + self.vboxlayout7.addWidget(self.sl_aud_npc) self.verticalLayout_9 = QtGui.QWidget(self.groupBox_aud_level) self.verticalLayout_9.setGeometry(QtCore.QRect(20,30,179,43)) self.verticalLayout_9.setObjectName("verticalLayout_9") - self.vboxlayout9 = QtGui.QVBoxLayout(self.verticalLayout_9) - self.vboxlayout9.setMargin(0) - self.vboxlayout9.setSpacing(6) - self.vboxlayout9.setObjectName("vboxlayout9") + self.vboxlayout8 = QtGui.QVBoxLayout(self.verticalLayout_9) + self.vboxlayout8.setMargin(0) + self.vboxlayout8.setSpacing(6) + self.vboxlayout8.setObjectName("vboxlayout8") - self.label_28 = QtGui.QLabel(self.verticalLayout_9) - self.label_28.setAlignment(QtCore.Qt.AlignCenter) - self.label_28.setObjectName("label_28") - self.vboxlayout9.addWidget(self.label_28) + self.lb_aud_fx = QtGui.QLabel(self.verticalLayout_9) + self.lb_aud_fx.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_fx.setObjectName("lb_aud_fx") + self.vboxlayout8.addWidget(self.lb_aud_fx) self.sl_aud_fx = QtGui.QSlider(self.verticalLayout_9) self.sl_aud_fx.setMinimum(0) @@ -446,21 +425,21 @@ self.sl_aud_fx.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_aud_fx.setTickInterval(25) self.sl_aud_fx.setObjectName("sl_aud_fx") - self.vboxlayout9.addWidget(self.sl_aud_fx) + self.vboxlayout8.addWidget(self.sl_aud_fx) self.verticalLayout_10 = QtGui.QWidget(self.groupBox_aud_level) self.verticalLayout_10.setGeometry(QtCore.QRect(230,30,179,43)) self.verticalLayout_10.setObjectName("verticalLayout_10") - self.vboxlayout10 = QtGui.QVBoxLayout(self.verticalLayout_10) - self.vboxlayout10.setMargin(0) - self.vboxlayout10.setSpacing(6) - self.vboxlayout10.setObjectName("vboxlayout10") + self.vboxlayout9 = QtGui.QVBoxLayout(self.verticalLayout_10) + self.vboxlayout9.setMargin(0) + self.vboxlayout9.setSpacing(6) + self.vboxlayout9.setObjectName("vboxlayout9") - self.label_29 = QtGui.QLabel(self.verticalLayout_10) - self.label_29.setAlignment(QtCore.Qt.AlignCenter) - self.label_29.setObjectName("label_29") - self.vboxlayout10.addWidget(self.label_29) + self.lb_aud_ambience = QtGui.QLabel(self.verticalLayout_10) + self.lb_aud_ambience.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_ambience.setObjectName("lb_aud_ambience") + self.vboxlayout9.addWidget(self.lb_aud_ambience) self.sl_aud_ambience = QtGui.QSlider(self.verticalLayout_10) self.sl_aud_ambience.setMinimum(0) @@ -473,21 +452,21 @@ self.sl_aud_ambience.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_aud_ambience.setTickInterval(25) self.sl_aud_ambience.setObjectName("sl_aud_ambience") - self.vboxlayout10.addWidget(self.sl_aud_ambience) + self.vboxlayout9.addWidget(self.sl_aud_ambience) self.verticalLayout_11 = QtGui.QWidget(self.groupBox_aud_level) self.verticalLayout_11.setGeometry(QtCore.QRect(20,80,179,43)) self.verticalLayout_11.setObjectName("verticalLayout_11") - self.vboxlayout11 = QtGui.QVBoxLayout(self.verticalLayout_11) - self.vboxlayout11.setMargin(0) - self.vboxlayout11.setSpacing(6) - self.vboxlayout11.setObjectName("vboxlayout11") + self.vboxlayout10 = QtGui.QVBoxLayout(self.verticalLayout_11) + self.vboxlayout10.setMargin(0) + self.vboxlayout10.setSpacing(6) + self.vboxlayout10.setObjectName("vboxlayout10") - self.label_30 = QtGui.QLabel(self.verticalLayout_11) - self.label_30.setAlignment(QtCore.Qt.AlignCenter) - self.label_30.setObjectName("label_30") - self.vboxlayout11.addWidget(self.label_30) + self.lb_aud_music = QtGui.QLabel(self.verticalLayout_11) + self.lb_aud_music.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_music.setObjectName("lb_aud_music") + self.vboxlayout10.addWidget(self.lb_aud_music) self.sl_aud_music = QtGui.QSlider(self.verticalLayout_11) self.sl_aud_music.setMinimum(0) @@ -500,7 +479,7 @@ self.sl_aud_music.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_aud_music.setTickInterval(25) self.sl_aud_music.setObjectName("sl_aud_music") - self.vboxlayout11.addWidget(self.sl_aud_music) + self.vboxlayout10.addWidget(self.sl_aud_music) self.cb_aud_mute = QtGui.QCheckBox(self.groupBox_aud_level) self.cb_aud_mute.setGeometry(QtCore.QRect(180,10,70,19)) @@ -515,15 +494,15 @@ self.verticalLayout_14.setGeometry(QtCore.QRect(230,40,179,43)) self.verticalLayout_14.setObjectName("verticalLayout_14") - self.vboxlayout12 = QtGui.QVBoxLayout(self.verticalLayout_14) - self.vboxlayout12.setMargin(0) - self.vboxlayout12.setSpacing(6) - self.vboxlayout12.setObjectName("vboxlayout12") + self.vboxlayout11 = QtGui.QVBoxLayout(self.verticalLayout_14) + self.vboxlayout11.setMargin(0) + self.vboxlayout11.setSpacing(6) + self.vboxlayout11.setObjectName("vboxlayout11") - self.label_34 = QtGui.QLabel(self.verticalLayout_14) - self.label_34.setAlignment(QtCore.Qt.AlignCenter) - self.label_34.setObjectName("label_34") - self.vboxlayout12.addWidget(self.label_34) + self.lb_aud_priority = QtGui.QLabel(self.verticalLayout_14) + self.lb_aud_priority.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_priority.setObjectName("lb_aud_priority") + self.vboxlayout11.addWidget(self.lb_aud_priority) self.sl_aud_priority = QtGui.QSlider(self.verticalLayout_14) self.sl_aud_priority.setMaximum(9) @@ -534,26 +513,26 @@ self.sl_aud_priority.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_aud_priority.setTickInterval(3) self.sl_aud_priority.setObjectName("sl_aud_priority") - self.vboxlayout12.addWidget(self.sl_aud_priority) + self.vboxlayout11.addWidget(self.sl_aud_priority) self.verticalLayout_15 = QtGui.QWidget(self.groupBox_aud_hardware) self.verticalLayout_15.setGeometry(QtCore.QRect(20,20,179,63)) self.verticalLayout_15.setObjectName("verticalLayout_15") - self.vboxlayout13 = QtGui.QVBoxLayout(self.verticalLayout_15) - self.vboxlayout13.setMargin(0) - self.vboxlayout13.setSpacing(6) - self.vboxlayout13.setObjectName("vboxlayout13") + self.vboxlayout12 = QtGui.QVBoxLayout(self.verticalLayout_15) + self.vboxlayout12.setMargin(0) + self.vboxlayout12.setSpacing(6) + self.vboxlayout12.setObjectName("vboxlayout12") - self.label_35 = QtGui.QLabel(self.verticalLayout_15) - self.label_35.setAlignment(QtCore.Qt.AlignCenter) - self.label_35.setObjectName("label_35") - self.vboxlayout13.addWidget(self.label_35) + self.lb_aud_device_modes = QtGui.QLabel(self.verticalLayout_15) + self.lb_aud_device_modes.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_device_modes.setObjectName("lb_aud_device_modes") + self.vboxlayout12.addWidget(self.lb_aud_device_modes) self.lb_aud_device = QtGui.QLabel(self.verticalLayout_15) self.lb_aud_device.setAlignment(QtCore.Qt.AlignCenter) self.lb_aud_device.setObjectName("lb_aud_device") - self.vboxlayout13.addWidget(self.lb_aud_device) + self.vboxlayout12.addWidget(self.lb_aud_device) self.sl_aud_device = QtGui.QSlider(self.verticalLayout_15) self.sl_aud_device.setMaximum(2) @@ -564,7 +543,7 @@ self.sl_aud_device.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_aud_device.setTickInterval(1) self.sl_aud_device.setObjectName("sl_aud_device") - self.vboxlayout13.addWidget(self.sl_aud_device) + self.vboxlayout12.addWidget(self.sl_aud_device) self.cb_aud_eax = QtGui.QCheckBox(self.groupBox_aud_hardware) self.cb_aud_eax.setGeometry(QtCore.QRect(260,10,111,19)) @@ -583,16 +562,16 @@ self.verticalLayout_13.setGeometry(QtCore.QRect(20,20,179,43)) self.verticalLayout_13.setObjectName("verticalLayout_13") - self.vboxlayout14 = QtGui.QVBoxLayout(self.verticalLayout_13) - self.vboxlayout14.setMargin(0) - self.vboxlayout14.setSpacing(6) - self.vboxlayout14.setObjectName("vboxlayout14") + self.vboxlayout13 = QtGui.QVBoxLayout(self.verticalLayout_13) + self.vboxlayout13.setMargin(0) + self.vboxlayout13.setSpacing(6) + self.vboxlayout13.setObjectName("vboxlayout13") - self.label_33 = QtGui.QLabel(self.verticalLayout_13) - self.label_33.setEnabled(False) - self.label_33.setAlignment(QtCore.Qt.AlignCenter) - self.label_33.setObjectName("label_33") - self.vboxlayout14.addWidget(self.label_33) + self.lb_aud_microphon = QtGui.QLabel(self.verticalLayout_13) + self.lb_aud_microphon.setEnabled(False) + self.lb_aud_microphon.setAlignment(QtCore.Qt.AlignCenter) + self.lb_aud_microphon.setObjectName("lb_aud_microphon") + self.vboxlayout13.addWidget(self.lb_aud_microphon) self.sl_aud_microphon = QtGui.QSlider(self.verticalLayout_13) self.sl_aud_microphon.setEnabled(False) @@ -606,12 +585,17 @@ self.sl_aud_microphon.setTickPosition(QtGui.QSlider.TicksBelow) self.sl_aud_microphon.setTickInterval(25) self.sl_aud_microphon.setObjectName("sl_aud_microphon") - self.vboxlayout14.addWidget(self.sl_aud_microphon) - self.tab_graphics.addTab(self.tab_audio,"") + self.vboxlayout13.addWidget(self.sl_aud_microphon) + self.tabwidget.addTab(self.tab_audio,"") self.tab_time = QtGui.QWidget() self.tab_time.setObjectName("tab_time") + self.gb_dnitime = QtGui.QGroupBox(self.tab_time) + self.gb_dnitime.setEnabled(True) + self.gb_dnitime.setGeometry(QtCore.QRect(10,120,431,221)) + self.gb_dnitime.setObjectName("gb_dnitime") + self.gb_caverntime = QtGui.QGroupBox(self.tab_time) self.gb_caverntime.setGeometry(QtCore.QRect(10,10,431,101)) self.gb_caverntime.setObjectName("gb_caverntime") @@ -677,13 +661,8 @@ self.label_12 = QtGui.QLabel(self.gridLayout) self.label_12.setObjectName("label_12") self.gridlayout.addWidget(self.label_12,1,3,1,1) + self.tabwidget.addTab(self.tab_time,"") - self.gb_dnitime = QtGui.QGroupBox(self.tab_time) - self.gb_dnitime.setEnabled(True) - self.gb_dnitime.setGeometry(QtCore.QRect(10,120,431,221)) - self.gb_dnitime.setObjectName("gb_dnitime") - self.tab_graphics.addTab(self.tab_time,"") - self.tab_ping = QtGui.QWidget() self.tab_ping.setObjectName("tab_ping") @@ -691,18 +670,18 @@ self.gb_servers.setGeometry(QtCore.QRect(10,0,421,341)) self.gb_servers.setObjectName("gb_servers") + self.button_ping = QtGui.QPushButton(self.gb_servers) + self.button_ping.setGeometry(QtCore.QRect(330,310,75,24)) + self.button_ping.setObjectName("button_ping") + self.text_ping = QtGui.QTextEdit(self.gb_servers) self.text_ping.setGeometry(QtCore.QRect(10,20,401,281)) self.text_ping.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.text_ping.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.text_ping.setReadOnly(True) self.text_ping.setObjectName("text_ping") + self.tabwidget.addTab(self.tab_ping,"") - self.button_ping = QtGui.QPushButton(self.gb_servers) - self.button_ping.setGeometry(QtCore.QRect(330,310,75,24)) - self.button_ping.setObjectName("button_ping") - self.tab_graphics.addTab(self.tab_ping,"") - self.tab_about = QtGui.QWidget() self.tab_about.setObjectName("tab_about") @@ -710,7 +689,7 @@ self.label_6.setGeometry(QtCore.QRect(120,170,181,20)) self.label_6.setAlignment(QtCore.Qt.AlignCenter) self.label_6.setObjectName("label_6") - self.tab_graphics.addTab(self.tab_about,"") + self.tabwidget.addTab(self.tab_about,"") MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtGui.QStatusBar(MainWindow) @@ -718,55 +697,53 @@ MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) - self.tab_graphics.setCurrentIndex(0) - QtCore.QObject.connect(self.buttonbox_rresavcl,QtCore.SIGNAL("rejected()"),MainWindow.close) + self.tabwidget.setCurrentIndex(0) + QtCore.QObject.connect(self.main_buttonbox,QtCore.SIGNAL("rejected()"),MainWindow.close) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Tool for Myst Online", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton.setText(QtGui.QApplication.translate("MainWindow", "Configure", None, QtGui.QApplication.UnicodeUTF8)) - self.checkBox_4.setText(QtGui.QApplication.translate("MainWindow", "CheckBox", None, QtGui.QApplication.UnicodeUTF8)) - self.checkBox_5.setText(QtGui.QApplication.translate("MainWindow", "CheckBox", None, QtGui.QApplication.UnicodeUTF8)) - self.checkBox_6.setText(QtGui.QApplication.translate("MainWindow", "CheckBox", None, QtGui.QApplication.UnicodeUTF8)) self.cb_gra_windowed.setText(QtGui.QApplication.translate("MainWindow", "Windowed", None, QtGui.QApplication.UnicodeUTF8)) self.cb_gra_vsync.setText(QtGui.QApplication.translate("MainWindow", "Vertical Sync", None, QtGui.QApplication.UnicodeUTF8)) self.cb_gra_shadow.setText(QtGui.QApplication.translate("MainWindow", "Display Shadows", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_screenres.setTitle(QtGui.QApplication.translate("MainWindow", "Screen Resolution", None, QtGui.QApplication.UnicodeUTF8)) self.lb_screenres.setText(QtGui.QApplication.translate("MainWindow", "800x600 (4:3)", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_gra_quality.setTitle(QtGui.QApplication.translate("MainWindow", "Quality", None, QtGui.QApplication.UnicodeUTF8)) - self.label_20.setText(QtGui.QApplication.translate("MainWindow", "Texture Quality", None, QtGui.QApplication.UnicodeUTF8)) - self.label_21.setText(QtGui.QApplication.translate("MainWindow", "Low", None, QtGui.QApplication.UnicodeUTF8)) - self.label_22.setText(QtGui.QApplication.translate("MainWindow", "High", None, QtGui.QApplication.UnicodeUTF8)) - self.label_13.setText(QtGui.QApplication.translate("MainWindow", "Anti-Aliasing", None, QtGui.QApplication.UnicodeUTF8)) - self.label_14.setText(QtGui.QApplication.translate("MainWindow", "Low", None, QtGui.QApplication.UnicodeUTF8)) - self.label_16.setText(QtGui.QApplication.translate("MainWindow", "High", None, QtGui.QApplication.UnicodeUTF8)) - self.label_2.setText(QtGui.QApplication.translate("MainWindow", "Graphics Quality", None, QtGui.QApplication.UnicodeUTF8)) - self.label_8.setText(QtGui.QApplication.translate("MainWindow", "Low", None, QtGui.QApplication.UnicodeUTF8)) - self.label_9.setText(QtGui.QApplication.translate("MainWindow", "Med.", None, QtGui.QApplication.UnicodeUTF8)) - self.label_10.setText(QtGui.QApplication.translate("MainWindow", "High", None, QtGui.QApplication.UnicodeUTF8)) - self.label_7.setText(QtGui.QApplication.translate("MainWindow", "Ultra", None, QtGui.QApplication.UnicodeUTF8)) - self.label_15.setText(QtGui.QApplication.translate("MainWindow", "Shadow Quality", None, QtGui.QApplication.UnicodeUTF8)) - self.label_23.setText(QtGui.QApplication.translate("MainWindow", "Low", None, QtGui.QApplication.UnicodeUTF8)) - self.label_24.setText(QtGui.QApplication.translate("MainWindow", "High", None, QtGui.QApplication.UnicodeUTF8)) - self.label_17.setText(QtGui.QApplication.translate("MainWindow", "Anisotropic-Filtering", None, QtGui.QApplication.UnicodeUTF8)) - self.label_18.setText(QtGui.QApplication.translate("MainWindow", "Low", None, QtGui.QApplication.UnicodeUTF8)) - self.label_19.setText(QtGui.QApplication.translate("MainWindow", "High", None, QtGui.QApplication.UnicodeUTF8)) - self.tab_graphics.setTabText(self.tab_graphics.indexOf(self.tab_graphics1), QtGui.QApplication.translate("MainWindow", "Graphics", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_tq.setText(QtGui.QApplication.translate("MainWindow", "Texture Quality", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_tq_low.setText(QtGui.QApplication.translate("MainWindow", "Low", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_tq_high.setText(QtGui.QApplication.translate("MainWindow", "High", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_aa.setText(QtGui.QApplication.translate("MainWindow", "Anti-Aliasing", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_aa_low.setText(QtGui.QApplication.translate("MainWindow", "Low", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_aa_low1.setText(QtGui.QApplication.translate("MainWindow", "High", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_quality.setText(QtGui.QApplication.translate("MainWindow", "Graphics Quality", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_quality_low.setText(QtGui.QApplication.translate("MainWindow", "Low", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_quality_medium.setText(QtGui.QApplication.translate("MainWindow", "Med.", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_quality_high.setText(QtGui.QApplication.translate("MainWindow", "High", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_quality_ultra.setText(QtGui.QApplication.translate("MainWindow", "Ultra", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_sq.setText(QtGui.QApplication.translate("MainWindow", "Shadow Quality", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_sq_low.setText(QtGui.QApplication.translate("MainWindow", "Low", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_sq_high.setText(QtGui.QApplication.translate("MainWindow", "High", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_af.setText(QtGui.QApplication.translate("MainWindow", "Anisotropic-Filtering", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_af_low.setText(QtGui.QApplication.translate("MainWindow", "Low", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_gra_af_high.setText(QtGui.QApplication.translate("MainWindow", "High", None, QtGui.QApplication.UnicodeUTF8)) + self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_graphics), QtGui.QApplication.translate("MainWindow", "Graphics", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_aud_level.setTitle(QtGui.QApplication.translate("MainWindow", "Level", None, QtGui.QApplication.UnicodeUTF8)) - self.label_31.setText(QtGui.QApplication.translate("MainWindow", "NPC Voices", None, QtGui.QApplication.UnicodeUTF8)) - self.label_28.setText(QtGui.QApplication.translate("MainWindow", "Sound FX", None, QtGui.QApplication.UnicodeUTF8)) - self.label_29.setText(QtGui.QApplication.translate("MainWindow", "Ambience Sound", None, QtGui.QApplication.UnicodeUTF8)) - self.label_30.setText(QtGui.QApplication.translate("MainWindow", "Music", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_aud_npc.setText(QtGui.QApplication.translate("MainWindow", "NPC Voices", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_aud_fx.setText(QtGui.QApplication.translate("MainWindow", "Sound FX", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_aud_ambience.setText(QtGui.QApplication.translate("MainWindow", "Ambience Sound", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_aud_music.setText(QtGui.QApplication.translate("MainWindow", "Music", None, QtGui.QApplication.UnicodeUTF8)) self.cb_aud_mute.setText(QtGui.QApplication.translate("MainWindow", "Mute all", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_aud_hardware.setTitle(QtGui.QApplication.translate("MainWindow", "Hardware", None, QtGui.QApplication.UnicodeUTF8)) - self.label_34.setText(QtGui.QApplication.translate("MainWindow", "Sound Priority", None, QtGui.QApplication.UnicodeUTF8)) - self.label_35.setText(QtGui.QApplication.translate("MainWindow", "Audio Modes", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_aud_priority.setText(QtGui.QApplication.translate("MainWindow", "Sound Priority", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_aud_device_modes.setText(QtGui.QApplication.translate("MainWindow", "Audio Modes", None, QtGui.QApplication.UnicodeUTF8)) self.lb_aud_device.setText(QtGui.QApplication.translate("MainWindow", "Generic Software", None, QtGui.QApplication.UnicodeUTF8)) self.cb_aud_eax.setText(QtGui.QApplication.translate("MainWindow", "Enable EAX", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_voicechat.setTitle(QtGui.QApplication.translate("MainWindow", "Voice chat", None, QtGui.QApplication.UnicodeUTF8)) self.cb_aud_voicechat.setText(QtGui.QApplication.translate("MainWindow", "Enable Voice Chat", None, QtGui.QApplication.UnicodeUTF8)) - self.label_33.setText(QtGui.QApplication.translate("MainWindow", "Microphon Level", None, QtGui.QApplication.UnicodeUTF8)) - self.tab_graphics.setTabText(self.tab_graphics.indexOf(self.tab_audio), QtGui.QApplication.translate("MainWindow", "Audio", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_aud_microphon.setText(QtGui.QApplication.translate("MainWindow", "Microphon Level", None, QtGui.QApplication.UnicodeUTF8)) + self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_audio), QtGui.QApplication.translate("MainWindow", "Audio", None, QtGui.QApplication.UnicodeUTF8)) + self.gb_dnitime.setTitle(QtGui.QApplication.translate("MainWindow", "D\'ni time", None, QtGui.QApplication.UnicodeUTF8)) self.gb_caverntime.setTitle(QtGui.QApplication.translate("MainWindow", "Time zones", None, QtGui.QApplication.UnicodeUTF8)) self.label_4.setText(QtGui.QApplication.translate("MainWindow", "Cavern time:", None, QtGui.QApplication.UnicodeUTF8)) self.label_5.setText(QtGui.QApplication.translate("MainWindow", "Cyan time:", None, QtGui.QApplication.UnicodeUTF8)) @@ -774,17 +751,16 @@ self.lb_cavern_utc.setText(QtGui.QApplication.translate("MainWindow", "UTC -0", None, QtGui.QApplication.UnicodeUTF8)) self.label_11.setText(QtGui.QApplication.translate("MainWindow", "(Mountain Standard Time)", None, QtGui.QApplication.UnicodeUTF8)) self.label_12.setText(QtGui.QApplication.translate("MainWindow", "(Pacific Standard Time)", None, QtGui.QApplication.UnicodeUTF8)) - self.gb_dnitime.setTitle(QtGui.QApplication.translate("MainWindow", "D\'ni time", None, QtGui.QApplication.UnicodeUTF8)) - self.tab_graphics.setTabText(self.tab_graphics.indexOf(self.tab_time), QtGui.QApplication.translate("MainWindow", "Time", None, QtGui.QApplication.UnicodeUTF8)) + self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_time), QtGui.QApplication.translate("MainWindow", "Time", None, QtGui.QApplication.UnicodeUTF8)) self.gb_servers.setTitle(QtGui.QApplication.translate("MainWindow", "Ping servers", None, QtGui.QApplication.UnicodeUTF8)) + self.button_ping.setText(QtGui.QApplication.translate("MainWindow", "Ping", None, QtGui.QApplication.UnicodeUTF8)) self.text_ping.setHtml(QtGui.QApplication.translate("MainWindow", "<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:\'MS Shell Dlg 2\'; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;\">\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; font-size:8pt;\"></p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) - self.button_ping.setText(QtGui.QApplication.translate("MainWindow", "Ping", None, QtGui.QApplication.UnicodeUTF8)) - self.tab_graphics.setTabText(self.tab_graphics.indexOf(self.tab_ping), QtGui.QApplication.translate("MainWindow", "Servers", None, QtGui.QApplication.UnicodeUTF8)) + self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_ping), QtGui.QApplication.translate("MainWindow", "Servers", None, QtGui.QApplication.UnicodeUTF8)) self.label_6.setText(QtGui.QApplication.translate("MainWindow", "pyMoul tools", None, QtGui.QApplication.UnicodeUTF8)) - self.tab_graphics.setTabText(self.tab_graphics.indexOf(self.tab_about), QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8)) + self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_about), QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8)) from moul.qt.ui import moulqt_rc Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-01-24 17:01:15 UTC (rev 68) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-01-24 18:26:59 UTC (rev 69) @@ -31,7 +31,7 @@ <property name="enabled" > <bool>true</bool> </property> - <widget class="QLabel" name="label" > + <widget class="QLabel" name="lb_top_image" > <property name="geometry" > <rect> <x>15</x> @@ -71,6 +71,9 @@ </property> <item> <widget class="QComboBox" name="comboBox" > + <property name="enabled" > + <bool>false</bool> + </property> <property name="font" > <font> <pointsize>6</pointsize> @@ -80,6 +83,9 @@ </item> <item> <widget class="QPushButton" name="pushButton" > + <property name="enabled" > + <bool>false</bool> + </property> <property name="sizePolicy" > <sizepolicy> <hsizetype>0</hsizetype> @@ -88,6 +94,18 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="maximumSize" > + <size> + <width>16777215</width> + <height>20</height> + </size> + </property> + <property name="baseSize" > + <size> + <width>0</width> + <height>20</height> + </size> + </property> <property name="font" > <font> <pointsize>8</pointsize> @@ -100,7 +118,7 @@ </item> </layout> </widget> - <widget class="QDialogButtonBox" name="buttonbox_rresavcl" > + <widget class="QDialogButtonBox" name="main_buttonbox" > <property name="geometry" > <rect> <x>10</x> @@ -116,7 +134,7 @@ <set>QDialogButtonBox::Close|QDialogButtonBox::NoButton|QDialogButtonBox::Reset|QDialogButtonBox::Save</set> </property> </widget> - <widget class="QTabWidget" name="tab_graphics" > + <widget class="QTabWidget" name="tabwidget" > <property name="geometry" > <rect> <x>5</x> @@ -150,58 +168,6 @@ <property name="title" > <string/> </property> - <widget class="QGroupBox" name="groupBox_4" > - <property name="geometry" > - <rect> - <x>250</x> - <y>100</y> - <width>201</width> - <height>71</height> - </rect> - </property> - <property name="title" > - <string/> - </property> - <widget class="QWidget" name="verticalLayout_4" > - <property name="geometry" > - <rect> - <x>10</x> - <y>0</y> - <width>160</width> - <height>71</height> - </rect> - </property> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QCheckBox" name="checkBox_4" > - <property name="text" > - <string>CheckBox</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_5" > - <property name="text" > - <string>CheckBox</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_6" > - <property name="text" > - <string>CheckBox</string> - </property> - </widget> - </item> - </layout> - </widget> - </widget> <widget class="QWidget" name="verticalLayout" > <property name="geometry" > <rect> @@ -340,7 +306,7 @@ <number>6</number> </property> <item> - <widget class="QLabel" name="label_20" > + <widget class="QLabel" name="lb_gra_tq" > <property name="text" > <string>Texture Quality</string> </property> @@ -389,14 +355,14 @@ <number>6</number> </property> <item> - <widget class="QLabel" name="label_21" > + <widget class="QLabel" name="lb_gra_tq_low" > <property name="text" > <string>Low</string> </property> </widget> </item> <item> - <widget class="QLabel" name="label_22" > + <widget class="QLabel" name="lb_gra_tq_high" > <property name="text" > <string>High</string> </property> @@ -426,7 +392,7 @@ <number>6</number> </property> <item> - <widget class="QLabel" name="label_13" > + <widget class="QLabel" name="lb_gra_aa" > <property name="text" > <string>Anti-Aliasing</string> </property> @@ -478,14 +444,14 @@ <number>6</number> </property> <item> - <widget class="QLabel" name="label_14" > + <widget class="QLabel" name="lb_gra_aa_low" > <property name="text" > <string>Low</string> </property> </widget> </item> <item> - <widget class="QLabel" name="label_16" > + <widget class="QLabel" name="lb_gra_aa_low" > <property name="text" > <string>High</string> </property> @@ -515,7 +481,7 @@ <number>6</number> </property> <item> - <widget class="QLabel" name="label_2" > + <widget class="QLabel" name="lb_gra_quality" > <property name="text" > <string>Graphics Quality</string> </property> @@ -564,14 +530,14 @@ <number>6</number> </property> <item> - <widget class="QLabel" name="label_8" > + <widget class="QLabel" name="lb_gra_quality_low" > <property name="text" > <string>Low</string> </property> </widget> </item> <item> - <widget class="QLabel" name="label_9" > + <widget class="QLabel" name="lb_gra_quality_medium" > <property name="text" > <string>Med.</string> </property> @@ -581,7 +547,7 @@ </widget> </item> <item> - <widget class="QLabel" name="label_10" > + <widget class="QLabel" name="lb_gra_quality_high" > <property name="text" > <string>High</string> </property> @@ -591,7 +557,7 @@ </widget> </item> <item> - <widget class="QLabel" name="label_7" > + <widget class="QLabel" name="lb_gra_quality_ultra" > <property name="text" > <string>Ultra</string> </property> @@ -621,7 +587,7 @@ <number>6</number> </property> <item> - <widget class="QLabel" name="label_15" > + <widget class="QLabel" name="lb_gra_sq" > <property name="text" > <string>Shadow Quality</string> </property> @@ -670,14 +636,14 @@ <number>6</number> </property> <item> - <widget class="QLabel" name="label_23" > + <widget class="QLabel" name="lb_gra_sq_low" > <property name="text" > <string>Low</string> </property> </widget> </item> <item> - <widget class="QLabel" name="label_24" > + <widget class="QLabel" name="lb_gra_sq_high" > <property name="text" > <string>High</string> </property> @@ -707,7 +673,7 @@ <number>6</number> </property> <item> - <widget class="QLabel" name="label_17" > + <widget class="QLabel" name="lb_gra_af" > <property name="text" > <string>Anisotropic-Filtering</string> </property> @@ -756,14 +722,14 @@ <number>6</number> ... [truncated message content] |
From: <ti...@us...> - 2007-01-25 18:54:52
|
Revision: 78 http://pymoul.svn.sourceforge.net/pymoul/?rev=78&view=rev Author: tiran Date: 2007-01-25 10:54:52 -0800 (Thu, 25 Jan 2007) Log Message: ----------- Doc tab no works only on my computer - infrastructure isn't present Modified Paths: -------------- pymoul/trunk/src/moul/qt/localization.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui Modified: pymoul/trunk/src/moul/qt/localization.py =================================================================== --- pymoul/trunk/src/moul/qt/localization.py 2007-01-25 18:50:37 UTC (rev 77) +++ pymoul/trunk/src/moul/qt/localization.py 2007-01-25 18:54:52 UTC (rev 78) @@ -22,6 +22,7 @@ __revision__ = "$Revision$" import sys +import os from PyQt4 import QtGui from PyQt4 import QtCore @@ -45,8 +46,12 @@ """Mixin for documents tab """ def _documents_init(self): + locDir = lookupDir('loc') + if not os.path.isdir(locDir): + return + self.tab_documents.setEnabled(True) - locDir = lookupDir('loc') + parseLocDirectory(locDir) self._documents_state = {} Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-25 18:50:37 UTC (rev 77) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-25 18:54:52 UTC (rev 78) @@ -68,7 +68,7 @@ self._ping_init() self._systray_init() self.tab_documents.setEnabled(False) - #self._documents_init() + self._documents_init() def _notimplemented(self): """TODO: remove me Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-25 18:50:37 UTC (rev 77) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-01-25 18:54:52 UTC (rev 78) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'src\moul\qt\ui\mainwindow.ui' # -# Created: Thu Jan 25 19:49:10 2007 +# Created: Thu Jan 25 19:53:15 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -554,10 +554,6 @@ self.groupBox_voicechat.setGeometry(QtCore.QRect(10,150,431,71)) self.groupBox_voicechat.setObjectName("groupBox_voicechat") - self.cb_aud_voicechat = QtGui.QCheckBox(self.groupBox_voicechat) - self.cb_aud_voicechat.setGeometry(QtCore.QRect(250,30,111,19)) - self.cb_aud_voicechat.setObjectName("cb_aud_voicechat") - self.verticalLayout_13 = QtGui.QWidget(self.groupBox_voicechat) self.verticalLayout_13.setGeometry(QtCore.QRect(20,20,179,43)) self.verticalLayout_13.setObjectName("verticalLayout_13") @@ -586,22 +582,21 @@ self.sl_aud_microphon.setTickInterval(25) self.sl_aud_microphon.setObjectName("sl_aud_microphon") self.vboxlayout13.addWidget(self.sl_aud_microphon) + + self.cb_aud_voicechat = QtGui.QCheckBox(self.groupBox_voicechat) + self.cb_aud_voicechat.setGeometry(QtCore.QRect(250,30,171,19)) + self.cb_aud_voicechat.setObjectName("cb_aud_voicechat") self.tabwidget.addTab(self.tab_audio,"") self.tab_time = QtGui.QWidget() self.tab_time.setObjectName("tab_time") - self.gb_dnitime = QtGui.QGroupBox(self.tab_time) - self.gb_dnitime.setEnabled(True) - self.gb_dnitime.setGeometry(QtCore.QRect(10,120,431,221)) - self.gb_dnitime.setObjectName("gb_dnitime") - self.gb_caverntime = QtGui.QGroupBox(self.tab_time) self.gb_caverntime.setGeometry(QtCore.QRect(10,10,431,101)) self.gb_caverntime.setObjectName("gb_caverntime") self.gridLayout = QtGui.QWidget(self.gb_caverntime) - self.gridLayout.setGeometry(QtCore.QRect(10,20,381,71)) + self.gridLayout.setGeometry(QtCore.QRect(10,20,411,71)) self.gridLayout.setObjectName("gridLayout") self.gridlayout = QtGui.QGridLayout(self.gridLayout) @@ -661,6 +656,11 @@ self.label_12 = QtGui.QLabel(self.gridLayout) self.label_12.setObjectName("label_12") self.gridlayout.addWidget(self.label_12,1,3,1,1) + + self.gb_dnitime = QtGui.QGroupBox(self.tab_time) + self.gb_dnitime.setEnabled(False) + self.gb_dnitime.setGeometry(QtCore.QRect(10,120,431,221)) + self.gb_dnitime.setObjectName("gb_dnitime") self.tabwidget.addTab(self.tab_time,"") self.tab_ping = QtGui.QWidget() @@ -758,7 +758,7 @@ MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) - self.tabwidget.setCurrentIndex(4) + self.tabwidget.setCurrentIndex(0) QtCore.QObject.connect(self.main_buttonbox,QtCore.SIGNAL("rejected()"),MainWindow.close) QtCore.QMetaObject.connectSlotsByName(MainWindow) @@ -801,10 +801,9 @@ self.lb_aud_device.setText(QtGui.QApplication.translate("MainWindow", "Generic Software", None, QtGui.QApplication.UnicodeUTF8)) self.cb_aud_eax.setText(QtGui.QApplication.translate("MainWindow", "Enable EAX", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_voicechat.setTitle(QtGui.QApplication.translate("MainWindow", "Voice chat", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_aud_microphon.setText(QtGui.QApplication.translate("MainWindow", "Microphon Level", None, QtGui.QApplication.UnicodeUTF8)) self.cb_aud_voicechat.setText(QtGui.QApplication.translate("MainWindow", "Enable Voice Chat", None, QtGui.QApplication.UnicodeUTF8)) - self.lb_aud_microphon.setText(QtGui.QApplication.translate("MainWindow", "Microphon Level", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_audio), QtGui.QApplication.translate("MainWindow", "Audio", None, QtGui.QApplication.UnicodeUTF8)) - self.gb_dnitime.setTitle(QtGui.QApplication.translate("MainWindow", "D\'ni time", None, QtGui.QApplication.UnicodeUTF8)) self.gb_caverntime.setTitle(QtGui.QApplication.translate("MainWindow", "Time zones", None, QtGui.QApplication.UnicodeUTF8)) self.label_4.setText(QtGui.QApplication.translate("MainWindow", "Cavern time:", None, QtGui.QApplication.UnicodeUTF8)) self.label_5.setText(QtGui.QApplication.translate("MainWindow", "Cyan time:", None, QtGui.QApplication.UnicodeUTF8)) @@ -812,6 +811,7 @@ self.lb_cavern_utc.setText(QtGui.QApplication.translate("MainWindow", "UTC -0", None, QtGui.QApplication.UnicodeUTF8)) self.label_11.setText(QtGui.QApplication.translate("MainWindow", "(Mountain Standard Time)", None, QtGui.QApplication.UnicodeUTF8)) self.label_12.setText(QtGui.QApplication.translate("MainWindow", "(Pacific Standard Time)", None, QtGui.QApplication.UnicodeUTF8)) + self.gb_dnitime.setTitle(QtGui.QApplication.translate("MainWindow", "D\'ni time", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_time), QtGui.QApplication.translate("MainWindow", "Time", None, QtGui.QApplication.UnicodeUTF8)) self.gb_servers.setTitle(QtGui.QApplication.translate("MainWindow", "Ping servers", None, QtGui.QApplication.UnicodeUTF8)) self.button_ping.setText(QtGui.QApplication.translate("MainWindow", "Ping", None, QtGui.QApplication.UnicodeUTF8)) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-01-25 18:50:37 UTC (rev 77) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-01-25 18:54:52 UTC (rev 78) @@ -147,7 +147,7 @@ <enum>QTabWidget::North</enum> </property> <property name="currentIndex" > - <number>4</number> + <number>0</number> </property> <widget class="QWidget" name="tab_graphics" > <attribute name="title" > @@ -1173,19 +1173,6 @@ <property name="title" > <string>Voice chat</string> </property> - <widget class="QCheckBox" name="cb_aud_voicechat" > - <property name="geometry" > - <rect> - <x>250</x> - <y>30</y> - <width>111</width> - <height>19</height> - </rect> - </property> - <property name="text" > - <string>Enable Voice Chat</string> - </property> - </widget> <widget class="QWidget" name="verticalLayout_13" > <property name="geometry" > <rect> @@ -1251,28 +1238,25 @@ </item> </layout> </widget> + <widget class="QCheckBox" name="cb_aud_voicechat" > + <property name="geometry" > + <rect> + <x>250</x> + <y>30</y> + <width>171</width> + <height>19</height> + </rect> + </property> + <property name="text" > + <string>Enable Voice Chat</string> + </property> + </widget> </widget> </widget> <widget class="QWidget" name="tab_time" > <attribute name="title" > <string>Time</string> </attribute> - <widget class="QGroupBox" name="gb_dnitime" > - <property name="enabled" > - <bool>true</bool> - </property> - <property name="geometry" > - <rect> - <x>10</x> - <y>120</y> - <width>431</width> - <height>221</height> - </rect> - </property> - <property name="title" > - <string>D'ni time</string> - </property> - </widget> <widget class="QGroupBox" name="gb_caverntime" > <property name="geometry" > <rect> @@ -1290,7 +1274,7 @@ <rect> <x>10</x> <y>20</y> - <width>381</width> + <width>411</width> <height>71</height> </rect> </property> @@ -1397,6 +1381,22 @@ </layout> </widget> </widget> + <widget class="QGroupBox" name="gb_dnitime" > + <property name="enabled" > + <bool>false</bool> + </property> + <property name="geometry" > + <rect> + <x>10</x> + <y>120</y> + <width>431</width> + <height>221</height> + </rect> + </property> + <property name="title" > + <string>D'ni time</string> + </property> + </widget> </widget> <widget class="QWidget" name="tab_ping" > <attribute name="title" > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-26 16:29:25
|
Revision: 83 http://pymoul.svn.sourceforge.net/pymoul/?rev=83&view=rev Author: tiran Date: 2007-01-26 08:29:18 -0800 (Fri, 26 Jan 2007) Log Message: ----------- added test thread WMI is not thread safe :( Modified Paths: -------------- pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/moulqt.py Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-26 15:15:00 UTC (rev 82) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-26 16:29:18 UTC (rev 83) @@ -33,6 +33,7 @@ from moul.qt.ui.mainwindow import Ui_MainWindow from moul.qt.localization import LocalizationMixin +from moul.osdependent import isMoulRunning from moul.config import lookupDir from moul.file.wdysini import AudioIni from moul.file.wdysini import GraphicsIni @@ -45,6 +46,17 @@ LOG = getLogger('moul.qt') +def criticalMessageBox(self, title, text): + """Critical warning! + """ + mb = QtGui.QMessageBox() + mb.setWindowIcon(QtGui.QIcon(":/resources/uru_icon_32x32.png")) + mb.setIcon(QtGui.QMessageBox.Critical) + mb.setWindowTitle(self.trUtf8(title)) + mb.setText(self.trUtf8(text)) + mb.setStandardButtons(QtGui.QMessageBox.Close) + return mb + class MainWindow(QtGui.QMainWindow, Ui_MainWindow, LocalizationMixin): def __init__(self): QtGui.QMainWindow.__init__(self) @@ -69,7 +81,17 @@ self._systray_init() self.tab_documents.setEnabled(False) self._documents_init() + + # run checker + self._moulrunning_thread = MoulRunningThread() + self.connect(self._moulrunning_thread, SIGNAL('moulIsRunning(bool)'), + self.on_moulIsRunning) + self._moulrunning_thread.startChecker(10.0) # check now and every 10 seconds + @signalLogDecorator(LOG) + def on_moulIsRunning(self, bool): + pass + def _notimplemented(self): """TODO: remove me """ @@ -493,11 +515,13 @@ self._servers = None def pingServers(self, servers): + # TODO: thread safety! self.servers = servers if not self.isRunning(): self.start() def run(self): + # TODO: thread safety! self.emit(SIGNAL("started")) # emit a list of names first for server in self.servers: @@ -520,3 +544,39 @@ self.emit(SIGNAL("ping(const QString&, float)"), name, ping) self.emit(SIGNAL("done()")) + +class MoulRunningThread(QtCore.QThread): + def __init__(self, parent=None): + QtCore.QThread.__init__(self, parent) + self.mutex = QtCore.QMutex() + self.condition = QtCore.QWaitCondition() + self._timer = None + self._running = False + + def startChecker(self, timer): + self._timer = long(timer * 1000) + if not self.isRunning(): + self._running = True + self.start() + + def stopChecker(self): + # TODO check this + self._running = False + self.condition.wakeAll() + + def __del__(self): + self.stopChecker() + + def run(self): + while True: + result = True #isMoulRunning() + if result: + self.emit(SIGNAL('moulIsRunning(bool)'), True) + else: + self.emit(SIGNAL('moulIsRunning(bool)'), False) + + self.mutex.lock() + self.condition.wait(self.mutex, self._timer) + self.mutex.unlock() + if not self._running: + return Modified: pymoul/trunk/src/moul/qt/moulqt.py =================================================================== --- pymoul/trunk/src/moul/qt/moulqt.py 2007-01-26 15:15:00 UTC (rev 82) +++ pymoul/trunk/src/moul/qt/moulqt.py 2007-01-26 16:29:18 UTC (rev 83) @@ -27,36 +27,28 @@ from PyQt4 import QtGui from moul.qt.mainwindow import MainWindow +from moul.qt.mainwindow import criticalMessageBox from moul.osdependent.singleapp import SimpleSingleApp from moul.config import getPyMoulDataDir from moul.osdependent import isMoulRunning -def critical(self, title, text): - """Critical warning! - """ - mb = QtGui.QMessageBox() - mb.setWindowIcon(QtGui.QIcon(":/resources/uru_icon_32x32.png")) - mb.setIcon(QtGui.QMessageBox.Critical) - mb.setWindowTitle(self.trUtf8(title)) - mb.setText(self.trUtf8(text)) - mb.setStandardButtons(QtGui.QMessageBox.Close) - return mb - def main(*args): app = QtGui.QApplication(*args) singleapp = SimpleSingleApp('pymoulqt', path=getPyMoulDataDir()) try: singleapp.acquire() except OSError: - mb = critical(app, "pyMoul QT already running", + mb = criticalMessageBox(app, + "pyMoul QT already running", """An instance of pyMoul QT is already running!""") mb.exec_() sys.exit(1) - if isMoulRunning(): - mb = critical(app, "URU is running", - """URU is running! Please close Uru or Uru Launcher first.""") - mb.exec_() - sys.exit(2) + #if isMoulRunning(): + # mb = criticalMessageBox(app, + # "URU is running", + # """URU is running! Please close Uru or Uru Launcher first.""") + # mb.exec_() + # sys.exit(2) mainWindow = MainWindow() mainWindow.show() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-01-28 15:49:23
|
Revision: 91 http://pymoul.svn.sourceforge.net/pymoul/?rev=91&view=rev Author: tiran Date: 2007-01-28 07:49:22 -0800 (Sun, 28 Jan 2007) Log Message: ----------- Added pymoul translation file Changed doc strings - pylupdate4's parser doesn't understand some constructs with triple quotes Modified Paths: -------------- pymoul/trunk/src/moul/qt/localization.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/moulqt.py pymoul/trunk/src/moul/qt/ui/__init__.py Added Paths: ----------- pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts Added: pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts =================================================================== --- pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts (rev 0) +++ pymoul/trunk/src/moul/qt/i18n/pymoul_de.ts 2007-01-28 15:49:22 UTC (rev 91) @@ -0,0 +1,248 @@ +<!DOCTYPE TS><TS> +<context> + <name>MainWindow</name> + <message> + <source>MOUL is running</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>MOUL</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>MOUL is not running</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Not Implemented</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Sorry, this feature is not implemented yet!</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Error opening graphics.ini</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Error opening audio.ini</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Tool for Myst Online</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Configure</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Windowed</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Vertical Sync</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Display Shadows</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Screen Resolution</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>800x600 (4:3)</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Quality</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Texture Quality</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Low</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>High</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Anti-Aliasing</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Graphics Quality</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Med.</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Ultra</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Shadow Quality</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Anisotropic-Filtering</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Graphics</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Level</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>NPC Voices</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Sound FX</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Ambience Sound</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Music</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Mute all</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Hardware</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Sound Priority</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Audio Modes</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Generic Software</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Enable EAX</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Voice chat</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Microphon Level</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Enable Voice Chat</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Audio</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Time zones</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cavern time:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cyan time:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>UTC -0</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>(Mountain Standard Time)</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>(Pacific Standard Time)</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>D'ni time</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Time</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Ping servers</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Ping</source> + <translation type="unfinished"></translation> + </message> + <message> + <source><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;"> +<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; font-size:8pt;"></p></body></html></source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Servers</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Browse in game documents</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Age</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Element</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Language</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Set</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Documents</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>pyMoul tools</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>About</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> Modified: pymoul/trunk/src/moul/qt/localization.py =================================================================== --- pymoul/trunk/src/moul/qt/localization.py 2007-01-28 15:23:44 UTC (rev 90) +++ pymoul/trunk/src/moul/qt/localization.py 2007-01-28 15:49:22 UTC (rev 91) @@ -15,6 +15,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # Temple Place, Suite 330, Boston, MA 02111-1307 USA # + """Moul localization / documents """ __author__ = "Christian Heimes" @@ -43,8 +44,9 @@ return QtCore.QStringList(dummy+lst) class LocalizationMixin(object): - """Mixin for documents tab """ + Mixin for documentation tab + """ def _documents_init(self): locDir = lookupDir('loc') if not os.path.isdir(locDir): Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-28 15:23:44 UTC (rev 90) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-01-28 15:49:22 UTC (rev 91) @@ -15,6 +15,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # Temple Place, Suite 330, Boston, MA 02111-1307 USA # + """Moul QT GUI main windows """ from __future__ import with_statement @@ -47,8 +48,9 @@ LOG = getLogger('moul.qt') def criticalMessageBox(self, title, text): - """Critical warning! """ + Critical warning! + """ mb = QtGui.QMessageBox() mb.setWindowIcon(QtGui.QIcon(":/resources/uru_icon_32x32.png")) mb.setIcon(QtGui.QMessageBox.Critical) @@ -110,14 +112,16 @@ QtGui.QSystemTrayIcon.Information, 10000) def _notimplemented(self): - """TODO: remove me """ + TODO: remove me + """ QtGui.QMessageBox.information(self, self.trUtf8("Not Implemented"), self.trUtf8("""Sorry, this feature is not implemented yet!""")) def closeEvent(self, event): - """Close event handler + """ + Close event handler @param event close event (QCloseEvent) """ @@ -129,7 +133,8 @@ event.accept() def keyPressEvent(self, event): - """Key event handler + """ + Key event handler @param event key event (QKeyEvent) @@ -141,8 +146,9 @@ event.ignore() def setDirty(self, boolean): - """Sets the save state """ + Sets the save state + """ self._dirty = bool(boolean) #self.main_buttonbox_reset.setEnabled(boolean) #self.main_buttonbox_save.setEnabled(boolean) @@ -164,8 +170,9 @@ # graphics settings def _graphics_init(self): - """init graphics tab """ + init graphics tab + """ self.connect(self, SIGNAL("graphicsini_loaded()"), self.on_graphicsini_loaded) self.connect(self, SIGNAL("graphicsini_reset()"), self.on_graphicsini_reset) self.connect(self, SIGNAL("graphicsini_save()"), self.on_graphicsini_save) @@ -175,8 +182,9 @@ @signalLogDecorator(LOG) def on_graphicsini_loaded(self): - """SIGNAL graphicsini_loaded() """ + SIGNAL graphicsini_loaded() + """ inipath = lookupDir('ini') self._graphics_ini = gini = GraphicsIni() try: @@ -191,22 +199,25 @@ @signalLogDecorator(LOG) def on_graphicsini_reset(self): - """SIGNAL graphicsini_reset() """ + SIGNAL graphicsini_reset() + """ self._graphics_ini.reset() self._graphicsini_setstate() @signalLogDecorator(LOG) def on_graphicsini_save(self): - """SIGNAL graphicsini_save() """ + SIGNAL graphicsini_save() + """ #self._notimplemented() self._graphics_ini.write() self.setDirty(False) def _graphicsini_setstate(self): - """Set sliders according to graphics ini settings """ + Set sliders according to graphics ini settings + """ gini = self._graphics_ini length = len(videoModes) - 1 self.sl_gra_screenres.setMaximum(length) @@ -224,8 +235,9 @@ @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_gra_screenres_valueChanged(self, idx): - """SIGNAL: valueChanged (int) """ + SIGNAL: valueChanged (int) + """ # XXX: fixme txt = videoModes.getVidModeHuman(idx) self.lb_screenres.setText(QtCore.QString(txt)) @@ -234,73 +246,83 @@ @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_gra_screenres_sliderMoved(self, idx): - """SIGNAL: sliderMoved(int) """ + SIGNAL: sliderMoved(int) + """ txt = videoModes.getVidModeHuman(idx) self.lb_screenres.setText(QtCore.QString(txt)) @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_gra_quality_valueChanged(self, idx): - """SIGNAL: valueChanged (int) """ + SIGNAL: valueChanged (int) + """ self._graphics_ini.quality = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_gra_texture_valueChanged(self, idx): - """SIGNAL: valueChanged (int) """ + SIGNAL: valueChanged (int) + """ self._graphics_ini.texture = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_gra_antialias_valueChanged(self, idx): - """SIGNAL: valueChanged (int) """ + SIGNAL: valueChanged (int) + """ self._graphics_ini.antialias = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_gra_anisotropic_valueChanged(self, idx): - """SIGNAL: valueChanged (int) """ + SIGNAL: valueChanged (int) + """ self._graphics_ini.anisotropic = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_gra_shadow_valueChanged(self, idx): - """SIGNAL: valueChanged (int) """ + SIGNAL: valueChanged (int) + """ self._graphics_ini.shadow = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_cb_gra_windowed_stateChanged(self, state): - """SIGNAL: stateChanged(int) """ + SIGNAL: stateChanged(int) + """ self._graphics_ini.windowed = state @signalLogDecorator(LOG) @pyqtSignature("int") def on_cb_gra_vsync_stateChanged (self, state): - """SIGNAL: stateChanged(int) """ + SIGNAL: stateChanged(int) + """ self._graphics_ini.vsync = state @signalLogDecorator(LOG) @pyqtSignature("int") def on_cb_gra_shadow_stateChanged (self, state): - """SIGNAL: stateChanged(int) """ + SIGNAL: stateChanged(int) + """ self._graphics_ini.shadow_enabled = state # ************************************************************************ # audio settings def _audio_init(self): - """init graphics tab """ + init graphics tab + """ self.connect(self, SIGNAL("audioini_loaded()"), self.on_audioini_loaded) self.connect(self, SIGNAL("audiini_reset()"), self.on_audioini_reset) self.connect(self, SIGNAL("audiini_save()"), self.on_audioini_save) @@ -310,8 +332,9 @@ @signalLogDecorator(LOG) def on_audioini_loaded(self): - """SIGNAL: audioini_loaded() """ + SIGNAL: audioini_loaded() + """ inipath = lookupDir('ini') self._audio_ini = aini = AudioIni() try: @@ -326,22 +349,25 @@ @signalLogDecorator(LOG) def on_audioini_reset(self): - """SIGNAL audioini_reset() """ + SIGNAL audioini_reset() + """ self._audio_ini.reset() self._audioini_setstate() @signalLogDecorator(LOG) def on_audioini_save(self): - """SIGNAL audioini_save() """ + SIGNAL audioini_save() + """ #self._notimplemented() self._audio_ini.write() self.setDirty(False) # urks def _audioini_setstate(self): - """Set sliders according to audio ini settings """ + Set sliders according to audio ini settings + """ aini = self._audio_ini self.sl_aud_device.setMaximum(aini.numberOfDevices()-1) @@ -358,8 +384,6 @@ @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_aud_device_valueChanged(self, idx): - """SIGNAL: valueChanged (int) - """ self._audio_ini.device = idx txt = self._audio_ini.getDeviceName(idx) self.lb_aud_device.setText(QtCore.QString(txt[1:-1])) @@ -367,72 +391,55 @@ @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_aud_device_sliderMoved(self, idx): - """SIGNAL: sliderMoved(int) - """ txt = self._audio_ini.getDeviceName(idx) self.lb_aud_device.setText(QtCore.QString(txt[1:-1])) @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_aud_npc_valueChanged(self, idx): - """SIGNAL: valueChanged (int) - """ self._audio_ini.npc = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_aud_music_valueChanged(self, idx): - """SIGNAL: valueChanged (int) - """ self._audio_ini.music = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_aud_fx_valueChanged(self, idx): - """SIGNAL: valueChanged (int) - """ self._audio_ini.fx = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_aud_ambience_valueChanged(self, idx): - """SIGNAL: valueChanged (int) - """ self._audio_ini.ambience = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_aud_priority_valueChanged(self, idx): - """SIGNAL: valueChanged (int) - """ self._audio_ini.priority = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_cb_aud_eax_stateChanged (self, state): - """SIGNAL: stateChanged(int) - """ self._audio_ini.eax = state @signalLogDecorator(LOG) @pyqtSignature("int") def on_cb_aud_mute_stateChanged (self, state): - """SIGNAL: stateChanged(int) - """ self._audio_ini.mute = state @signalLogDecorator(LOG) @pyqtSignature("int") def on_cb_aud_voicechat_stateChanged (self, state): - """SIGNAL: stateChanged(int) - """ self._audio_ini.voicechat = state # ************************************************************************ # time zones def _timezone_init(self): - """Init time zone tab""" + """ + Init time zone tab""" # create info object and update display the first time self._caverntime = CavernTime() self._timezone_update() @@ -445,7 +452,9 @@ timer.start() def _timezone_update(self): - """Update datetime widgets""" + """ + Update datetime widgets + """ ct = self._caverntime.info() self.dt_cavern.setDateTime(ct['cavern']['datetime']) @@ -461,8 +470,9 @@ @pyqtSignature("") def on_timezone_timer_timeout(self): - """SIGNAL: QTimer timeout """ + SIGNAL: QTimer timeout + """ ct = self._caverntime() self.dt_cavern.setDateTime(ct['cavern']) self.dt_pacific.setDateTime(ct['pacific']) @@ -470,8 +480,9 @@ # ************************************************************************ # ping def _ping_init(self): - """init ping tab """ + init ping tab + """ self._ping_thread = thread = PingServerThread() self.connect(thread, SIGNAL("started"), @@ -597,3 +608,4 @@ self.mutex.unlock() if not self._running: return + Modified: pymoul/trunk/src/moul/qt/moulqt.py =================================================================== --- pymoul/trunk/src/moul/qt/moulqt.py 2007-01-28 15:23:44 UTC (rev 90) +++ pymoul/trunk/src/moul/qt/moulqt.py 2007-01-28 15:49:22 UTC (rev 91) @@ -16,6 +16,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # Temple Place, Suite 330, Boston, MA 02111-1307 USA # + """Moul QT GUI main module """ __author__ = "Christian Heimes" Modified: pymoul/trunk/src/moul/qt/ui/__init__.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/__init__.py 2007-01-28 15:23:44 UTC (rev 90) +++ pymoul/trunk/src/moul/qt/ui/__init__.py 2007-01-28 15:49:22 UTC (rev 91) @@ -15,6 +15,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # Temple Place, Suite 330, Boston, MA 02111-1307 USA # + """ """ __author__ = "Christian Heimes" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-05 16:17:10
|
Revision: 141 http://pymoul.svn.sourceforge.net/pymoul/?rev=141&view=rev Author: tiran Date: 2007-02-05 08:16:28 -0800 (Mon, 05 Feb 2007) Log Message: ----------- Use text browser instead of text edit to display text. More about text Modified Paths: -------------- pymoul/trunk/src/moul/qt/localization.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui Modified: pymoul/trunk/src/moul/qt/localization.py =================================================================== --- pymoul/trunk/src/moul/qt/localization.py 2007-02-05 14:51:30 UTC (rev 140) +++ pymoul/trunk/src/moul/qt/localization.py 2007-02-05 16:16:28 UTC (rev 141) @@ -137,7 +137,7 @@ names = ['language', 'age', 'set', 'element', 'doc'] for name in names[names.index(name):]: if name == 'doc': - qobj = self.te_doc_view + qobj = self.tb_journal_view else: qobj = getattr(self.context, 'cb_doc_%s' % name) qobj.clear() @@ -190,5 +190,5 @@ element = self._documents_state['elements'][idx-1] translation = tr[(lang, age, set, element)] qstr = QtCore.QString(translation) - self.te_doc_view.setPlainText(qstr) - self.te_doc_view.setEnabled(True) + self.tb_journal_view.setPlainText(qstr) + self.tb_journal_view.setEnabled(True) Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-05 14:51:30 UTC (rev 140) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-05 16:16:28 UTC (rev 141) @@ -96,6 +96,23 @@ self.on_moulIsRunning) self._moulrunning_thread.startChecker(5.0) # check now and every 5 seconds + about = self.trUtf8(""" +<center> +<h3>Tool for Myst Online : Uru Live</h3> + +<p>(c) 2007 Christian Heimes</p> + +<p><a href="http://pymoul.sourceforge.net">http://pymoul.sourceforge.net</a></p> +</center> + +<p align="justify">If you like the tool please consider to <a href="%1">donate</a> some money to sponsor my work. The tool is created in my free time as an open source project. You can sent money to my PayPal account using your PayPal account, credit card or bank account.</p> + +<p>sincerely yours<br> +Tiran [KI: #00025784]</p> + """) + about.arg("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=christian%40cheimes%2ede&item_name=Donate%20for%20Tiran%27s%20open%20source%20activities&page_style=PayPal&no_shipping=2&cn=Your%20note%20for%20me&tax=0¤cy_code=EUR&lc=DE&bn=PP%2dDonationsBF&charset=UTF%2d8") + self.tb_abouttext.setHtml(about) + def on_moulIsRunning(self, boolean): """ @qtslot moulIsRunning(bool): notify if moul is running @@ -274,7 +291,7 @@ # ************************************************************************ # about tab def _about_init(self): - self.te_license.setPlainText(metadata.LICENSE) + self.tb_license.setPlainText(metadata.LICENSE) # ************************************************************************ # time zones @@ -344,28 +361,28 @@ def on_pingthread_started(self): self.button_ping.setEnabled(False) - self.text_ping.clear() + self.tb_ping_view.clear() def on_pingthread_done(self): self.button_ping.setEnabled(True) def on_pingthread_server(self, name): pass - #self.text_ping.insertPlainText("%s ... " % name) + #self.tb_ping_view.insertPlainText("%s ... " % name) def on_pingthread_dns(self, name, time): - self.text_ping.insertPlainText("%s ... DNS: %0.3f " % (name, time)) + self.tb_ping_view.insertPlainText("%s ... DNS: %0.3f " % (name, time)) def on_pingthread_ping(self, name, time): - self.text_ping.insertPlainText("PING: %0.3f\n" % time) + self.tb_ping_view.insertPlainText("PING: %0.3f\n" % time) def on_pingthread_dnserror(self, name, errcode, errmsg): LOG.error('dns error: %s, %i, %s' % (name, errcode, errmsg)) - self.text_ping.insertPlainText("%s ... DNS error: %s\n" % (name, errmsg)) + self.tb_ping_view.insertPlainText("%s ... DNS error: %s\n" % (name, errmsg)) def on_pingthread_pingerror(self, name, errcode, errmsg): LOG.error('ping error: %s, %i, %s' % (name, errcode, errmsg)) - self.text_ping.insertPlainText("PING error: %s\n" % errmsg) + self.tb_ping_view.insertPlainText("PING error: %s\n" % errmsg) @pyqtSignature("bool") def on_button_ping_clicked(self, ignore=False): Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-05 14:51:30 UTC (rev 140) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-05 16:16:28 UTC (rev 141) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file './src/moul/qt/ui/mainwindow.ui' # -# Created: Mon Feb 5 15:25:54 2007 +# Created: Mon Feb 5 17:13:00 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -738,16 +738,15 @@ self.gb_servers.setGeometry(QtCore.QRect(10,0,451,401)) self.gb_servers.setObjectName("gb_servers") - self.text_ping = QtGui.QTextEdit(self.gb_servers) - self.text_ping.setGeometry(QtCore.QRect(10,20,431,341)) - self.text_ping.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded) - self.text_ping.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.text_ping.setReadOnly(True) - self.text_ping.setObjectName("text_ping") - self.button_ping = QtGui.QPushButton(self.gb_servers) self.button_ping.setGeometry(QtCore.QRect(370,370,75,24)) self.button_ping.setObjectName("button_ping") + + self.tb_ping_view = QtGui.QTextBrowser(self.gb_servers) + self.tb_ping_view.setGeometry(QtCore.QRect(10,20,431,341)) + self.tb_ping_view.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) + self.tb_ping_view.setOpenExternalLinks(True) + self.tb_ping_view.setObjectName("tb_ping_view") self.tabwidget.addTab(self.tab_ping,"") self.tab_browse = QtGui.QWidget() @@ -765,14 +764,6 @@ self.groupBox_5.setGeometry(QtCore.QRect(10,0,451,371)) self.groupBox_5.setObjectName("groupBox_5") - self.te_chatlog_view = QtGui.QTextEdit(self.groupBox_5) - self.te_chatlog_view.setGeometry(QtCore.QRect(10,50,431,311)) - self.te_chatlog_view.setUndoRedoEnabled(False) - self.te_chatlog_view.setReadOnly(True) - self.te_chatlog_view.setAcceptRichText(False) - self.te_chatlog_view.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) - self.te_chatlog_view.setObjectName("te_chatlog_view") - self.cb_chatlog = QtGui.QComboBox(self.groupBox_5) self.cb_chatlog.setGeometry(QtCore.QRect(70,20,323,22)) @@ -782,6 +773,12 @@ sizePolicy.setHeightForWidth(self.cb_chatlog.sizePolicy().hasHeightForWidth()) self.cb_chatlog.setSizePolicy(sizePolicy) self.cb_chatlog.setObjectName("cb_chatlog") + + self.tb_chatlog_view = QtGui.QTextBrowser(self.groupBox_5) + self.tb_chatlog_view.setGeometry(QtCore.QRect(10,50,431,311)) + self.tb_chatlog_view.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) + self.tb_chatlog_view.setOpenExternalLinks(True) + self.tb_chatlog_view.setObjectName("tb_chatlog_view") self.tabWidget.addTab(self.tab_sub_chatlogs,"") self.tab_sub_journals = QtGui.QWidget() @@ -853,12 +850,11 @@ self.lb_doc_status.setObjectName("lb_doc_status") self.gridlayout2.addWidget(self.lb_doc_status,1,2,3,1) - self.te_doc_view = QtGui.QTextEdit(self.gb_documents) - self.te_doc_view.setGeometry(QtCore.QRect(10,140,431,221)) - self.te_doc_view.setUndoRedoEnabled(False) - self.te_doc_view.setReadOnly(True) - self.te_doc_view.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) - self.te_doc_view.setObjectName("te_doc_view") + self.tb_journal_view = QtGui.QTextBrowser(self.gb_documents) + self.tb_journal_view.setGeometry(QtCore.QRect(10,140,431,221)) + self.tb_journal_view.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) + self.tb_journal_view.setOpenExternalLinks(True) + self.tb_journal_view.setObjectName("tb_journal_view") self.tabWidget.addTab(self.tab_sub_journals,"") self.tabwidget.addTab(self.tab_browse,"") @@ -872,28 +868,21 @@ self.tab_sub_about = QtGui.QWidget() self.tab_sub_about.setObjectName("tab_sub_about") - self.label_6 = QtGui.QLabel(self.tab_sub_about) - self.label_6.setGeometry(QtCore.QRect(20,10,431,351)) - self.label_6.setTextFormat(QtCore.Qt.PlainText) - self.label_6.setAlignment(QtCore.Qt.AlignCenter) - self.label_6.setObjectName("label_6") + self.tb_abouttext = QtGui.QTextBrowser(self.tab_sub_about) + self.tb_abouttext.setGeometry(QtCore.QRect(10,10,451,361)) + self.tb_abouttext.setTextInteractionFlags(QtCore.Qt.TextBrowserInteraction) + self.tb_abouttext.setOpenExternalLinks(True) + self.tb_abouttext.setObjectName("tb_abouttext") self.tabwidget_about.addTab(self.tab_sub_about,"") self.tab_sub_license = QtGui.QWidget() self.tab_sub_license.setObjectName("tab_sub_license") - self.te_license = QtGui.QTextEdit(self.tab_sub_license) - self.te_license.setGeometry(QtCore.QRect(10,10,446,361)) - - font = QtGui.QFont(self.te_license.font()) - font.setPointSize(7) - self.te_license.setFont(font) - self.te_license.setAcceptDrops(False) - self.te_license.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.te_license.setUndoRedoEnabled(False) - self.te_license.setReadOnly(True) - self.te_license.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) - self.te_license.setObjectName("te_license") + self.tb_license = QtGui.QTextBrowser(self.tab_sub_license) + self.tb_license.setGeometry(QtCore.QRect(10,10,451,361)) + self.tb_license.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) + self.tb_license.setOpenExternalLinks(True) + self.tb_license.setObjectName("tb_license") self.tabwidget_about.addTab(self.tab_sub_license,"") self.tabwidget.addTab(self.tab_about,"") @@ -978,18 +967,14 @@ self.tab_sub_settings.setTabText(self.tab_sub_settings.indexOf(self.tab_audio), QtGui.QApplication.translate("MainWindow", "Audio", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_settings), QtGui.QApplication.translate("MainWindow", "Settings", None, QtGui.QApplication.UnicodeUTF8)) self.gb_servers.setTitle(QtGui.QApplication.translate("MainWindow", "Ping servers", None, QtGui.QApplication.UnicodeUTF8)) - self.text_ping.setHtml(QtGui.QApplication.translate("MainWindow", "<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; text-decoration:none;\">\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; font-family:\'MS Shell Dlg 2\'; font-size:8pt;\"></p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) self.button_ping.setText(QtGui.QApplication.translate("MainWindow", "Ping", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_ping), QtGui.QApplication.translate("MainWindow", "Servers", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_5.setTitle(QtGui.QApplication.translate("MainWindow", "Read chatlogs", None, QtGui.QApplication.UnicodeUTF8)) - self.te_chatlog_view.setHtml(QtGui.QApplication.translate("MainWindow", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" + self.cb_chatlog.addItem(QtGui.QApplication.translate("MainWindow", "Not implemented", None, QtGui.QApplication.UnicodeUTF8)) + self.tb_chatlog_view.setHtml(QtGui.QApplication.translate("MainWindow", "<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; text-decoration:none;\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Not implemented</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) - self.cb_chatlog.addItem(QtGui.QApplication.translate("MainWindow", "Not implemented", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_sub_chatlogs), QtGui.QApplication.translate("MainWindow", "Chat logs", None, QtGui.QApplication.UnicodeUTF8)) self.gb_documents.setTitle(QtGui.QApplication.translate("MainWindow", "Browse journals and notes", None, QtGui.QApplication.UnicodeUTF8)) self.label.setText(QtGui.QApplication.translate("MainWindow", "Language", None, QtGui.QApplication.UnicodeUTF8)) @@ -1000,12 +985,15 @@ self.lb_doc_status.setText(QtGui.QApplication.translate("MainWindow", "TextLabel", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_sub_journals), QtGui.QApplication.translate("MainWindow", "Journals", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_browse), QtGui.QApplication.translate("MainWindow", "Browse", None, QtGui.QApplication.UnicodeUTF8)) - self.label_6.setText(QtGui.QApplication.translate("MainWindow", "Tool for Myst Online : Uru Live\n" - "\n" - "(c) 2007 by Christian Heimes\n" - "\n" - "http://pymoul.sourceforge.net/", None, QtGui.QApplication.UnicodeUTF8)) + self.tb_abouttext.setHtml(QtGui.QApplication.translate("MainWindow", "<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; text-decoration:none;\">\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></body></html>", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget_about.setTabText(self.tabwidget_about.indexOf(self.tab_sub_about), QtGui.QApplication.translate("MainWindow", "About pyMoul", None, QtGui.QApplication.UnicodeUTF8)) + self.tb_license.setHtml(QtGui.QApplication.translate("MainWindow", "<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; text-decoration:none;\">\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></body></html>", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget_about.setTabText(self.tabwidget_about.indexOf(self.tab_sub_license), QtGui.QApplication.translate("MainWindow", "License", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_about), QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8)) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-02-05 14:51:30 UTC (rev 140) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-02-05 16:16:28 UTC (rev 141) @@ -1574,31 +1574,6 @@ <property name="title" > <string>Ping servers</string> </property> - <widget class="QTextEdit" name="text_ping" > - <property name="geometry" > - <rect> - <x>10</x> - <y>20</y> - <width>431</width> - <height>341</height> - </rect> - </property> - <property name="verticalScrollBarPolicy" > - <enum>Qt::ScrollBarAsNeeded</enum> - </property> - <property name="horizontalScrollBarPolicy" > - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="readOnly" > - <bool>true</bool> - </property> - <property name="html" > - <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> -<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; font-family:'MS Shell Dlg 2'; font-size:8pt;"></p></body></html></string> - </property> - </widget> <widget class="QPushButton" name="button_ping" > <property name="geometry" > <rect> @@ -1612,6 +1587,22 @@ <string>Ping</string> </property> </widget> + <widget class="QTextBrowser" name="tb_ping_view" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>431</width> + <height>341</height> + </rect> + </property> + <property name="textInteractionFlags" > + <enum>Qt::TextSelectableByMouse</enum> + </property> + <property name="openExternalLinks" > + <bool>true</bool> + </property> + </widget> </widget> </widget> <widget class="QWidget" name="tab_browse" > @@ -1649,34 +1640,6 @@ <property name="title" > <string>Read chatlogs</string> </property> - <widget class="QTextEdit" name="te_chatlog_view" > - <property name="geometry" > - <rect> - <x>10</x> - <y>50</y> - <width>431</width> - <height>311</height> - </rect> - </property> - <property name="undoRedoEnabled" > - <bool>false</bool> - </property> - <property name="readOnly" > - <bool>true</bool> - </property> - <property name="html" > - <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Not implemented</p></body></html></string> - </property> - <property name="acceptRichText" > - <bool>false</bool> - </property> - <property name="textInteractionFlags" > - <enum>Qt::TextSelectableByMouse</enum> - </property> - </widget> <widget class="QComboBox" name="cb_chatlog" > <property name="geometry" > <rect> @@ -1700,6 +1663,28 @@ </property> </item> </widget> + <widget class="QTextBrowser" name="tb_chatlog_view" > + <property name="geometry" > + <rect> + <x>10</x> + <y>50</y> + <width>431</width> + <height>311</height> + </rect> + </property> + <property name="html" > + <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Not implemented</p></body></html></string> + </property> + <property name="textInteractionFlags" > + <enum>Qt::TextSelectableByMouse</enum> + </property> + <property name="openExternalLinks" > + <bool>true</bool> + </property> + </widget> </widget> </widget> <widget class="QWidget" name="tab_sub_journals" > @@ -1838,7 +1823,7 @@ </item> </layout> </widget> - <widget class="QTextEdit" name="te_doc_view" > + <widget class="QTextBrowser" name="tb_journal_view" > <property name="geometry" > <rect> <x>10</x> @@ -1847,15 +1832,12 @@ <height>221</height> </rect> </property> - <property name="undoRedoEnabled" > - <bool>false</bool> - </property> - <property name="readOnly" > - <bool>true</bool> - </property> <property name="textInteractionFlags" > <enum>Qt::TextSelectableByMouse</enum> </property> + <property name="openExternalLinks" > + <bool>true</bool> + </property> </widget> </widget> </widget> @@ -1881,27 +1863,26 @@ <attribute name="title" > <string>About pyMoul</string> </attribute> - <widget class="QLabel" name="label_6" > + <widget class="QTextBrowser" name="tb_abouttext" > <property name="geometry" > <rect> - <x>20</x> + <x>10</x> <y>10</y> - <width>431</width> - <height>351</height> + <width>451</width> + <height>361</height> </rect> </property> - <property name="text" > - <string>Tool for Myst Online : Uru Live - -(c) 2007 by Christian Heimes - -http://pymoul.sourceforge.net/</string> + <property name="html" > + <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<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></body></html></string> </property> - <property name="textFormat" > - <enum>Qt::PlainText</enum> + <property name="textInteractionFlags" > + <enum>Qt::TextBrowserInteraction</enum> </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> + <property name="openExternalLinks" > + <bool>true</bool> </property> </widget> </widget> @@ -1909,35 +1890,27 @@ <attribute name="title" > <string>License</string> </attribute> - <widget class="QTextEdit" name="te_license" > + <widget class="QTextBrowser" name="tb_license" > <property name="geometry" > <rect> <x>10</x> <y>10</y> - <width>446</width> + <width>451</width> <height>361</height> </rect> </property> - <property name="font" > - <font> - <pointsize>7</pointsize> - </font> + <property name="html" > + <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<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></body></html></string> </property> - <property name="acceptDrops" > - <bool>false</bool> - </property> - <property name="horizontalScrollBarPolicy" > - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="undoRedoEnabled" > - <bool>false</bool> - </property> - <property name="readOnly" > - <bool>true</bool> - </property> <property name="textInteractionFlags" > <enum>Qt::TextSelectableByMouse</enum> </property> + <property name="openExternalLinks" > + <bool>true</bool> + </property> </widget> </widget> </widget> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-16 13:09:45
|
Revision: 174 http://pymoul.svn.sourceforge.net/pymoul/?rev=174&view=rev Author: tiran Date: 2007-02-16 05:09:45 -0800 (Fri, 16 Feb 2007) Log Message: ----------- Added hacky code to move the number in the right position Modified Paths: -------------- pymoul/trunk/src/moul/qt/dninumbers.py pymoul/trunk/src/moul/qt/mainwindow.py Property Changed: ---------------- pymoul/trunk/src/moul/qt/dninumbers.py Modified: pymoul/trunk/src/moul/qt/dninumbers.py =================================================================== --- pymoul/trunk/src/moul/qt/dninumbers.py 2007-02-15 18:18:46 UTC (rev 173) +++ pymoul/trunk/src/moul/qt/dninumbers.py 2007-02-16 13:09:45 UTC (rev 174) @@ -19,8 +19,8 @@ """Moul QT D'ni Number renderer """ __author__ = "Christian Heimes" -__version__ = "$Id: wdysini.py 144 2007-02-06 03:51:21Z tiran $" -__revision__ = "$Revision: 144 $" +__version__ = "$Id$" +__revision__ = "$Revision$" import sys from PyQt4 import QtCore @@ -127,6 +127,7 @@ self.dni = None self.height = None self.numbers = () + self._layout = None def setDniNumbers(self, dninumbers): """Set D'ni number instance @@ -163,6 +164,20 @@ self.setMaximumSize(self.width, self.height) self.resize(self.width, self.height) + def setPosition(self, layout, row, col, position): + """Set position (hack) + """ + self._layout = None + if position == QtCore.Qt.AlignLeft: + return + elif position == QtCore.Qt.AlignCenter: + pass + elif position == QtCore.Qt.AlignRight: + pass + else: + raise ValueError(position) + self._layout = layout, row, col, position + def paintEvent(self, event): """Render and paint numbers """ @@ -178,3 +193,14 @@ painter.drawPixmap(0, 0, self._pmleft) painter.drawPixmap(self.width-self._pmright.width(), 0, self._pmright) painter.end() + + # remove the hack! + if self._layout is not None: + layout, row, col, position = self._layout + x, y, w, h = layout.cellRect(row, col).getRect() + geometry = self.geometry() + movex = self.width - w + if position == QtCore.Qt.AlignCenter: + movex = movex // 2 + self.move(geometry.x()+movex, geometry.y()) + self._layout = None Property changes on: pymoul/trunk/src/moul/qt/dninumbers.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-15 18:18:46 UTC (rev 173) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-16 13:09:45 UTC (rev 174) @@ -554,9 +554,10 @@ dnipix = QDniNumberWidget(widget) dnipix.setDniNumbers(self._dninumbers) dnipix.setHeight(25) - dnipix.setNumbers(5, 24) - dnipix.setObjectName("dnw_dninumber_test") - grid.addWidget(dnipix, 5, 8, 1, 2) + dnipix.setNumbers(1, 0) + dnipix.setObjectName("dnw_dninumber_250") + dnipix.setPosition(grid, 5, 0, QtCore.Qt.AlignRight) + grid.addWidget(dnipix, 5, 0, 1, 2) class PingServerThread(QtCore.QThread): def __init__(self, parent=None): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-17 18:10:25
|
Revision: 175 http://pymoul.svn.sourceforge.net/pymoul/?rev=175&view=rev Author: tiran Date: 2007-02-17 10:10:20 -0800 (Sat, 17 Feb 2007) Log Message: ----------- Added basics for D'ni clock Modified Paths: -------------- pymoul/trunk/src/moul/qt/dninumbers.py pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui Modified: pymoul/trunk/src/moul/qt/dninumbers.py =================================================================== --- pymoul/trunk/src/moul/qt/dninumbers.py 2007-02-16 13:09:45 UTC (rev 174) +++ pymoul/trunk/src/moul/qt/dninumbers.py 2007-02-17 18:10:20 UTC (rev 175) @@ -22,6 +22,7 @@ __version__ = "$Id$" __revision__ = "$Revision$" +import operator import sys from PyQt4 import QtCore from PyQt4 import QtGui @@ -29,37 +30,214 @@ from PyQt4.QtCore import SIGNAL from PyQt4.QtCore import pyqtSignature +from moul.time.cavern import CavernTime +from moul.time.dni import DniTime +from moul.time.dni import FACTOR_SP +from moul.log import getLogger from moul.qt.utils import QNamespaceContainer from moul.qt.utils import QSignalLoggerMetaclass -from moul.qt.utils import questionMB -from moul.qt.utils import criticalMB +from moul.qt.utils import skipLogging +NUMBER_HEIGHT = 25 +LOG = getLogger('moul.qt.dni') + +class DniTimeNumberContainer(QNamespaceContainer): + """Container for Dni Date and Dni + number stuff + """ + __metaclass__ = QSignalLoggerMetaclass + __logger__ = LOG.debug + + def initialize(self): + # D'ni numbers + self.dninumbers = QDniNumbers() + self.setup_dniclock() + self.setup_dninumbers() + + # D'ni date and time + self.dnitime = DniTime() + self.on_dnitimer_timeout() + self.dnitime_timer = QtCore.QTimer(self.context) + self.dnitime_timer.setInterval(FACTOR_SP*1000) + self.connect(self.dnitime_timer, SIGNAL('timeout()'), + self.on_dnitimer_timeout) + self.dnitime_timer.start() + + # time zone + self.caverntime = CavernTime() + self.timezone_update() + # TODO: change timer from every second to every minute + self.timezone_timer = QtCore.QTimer(self.context) + self.timezone_timer.setInterval(1000) # 1 sec + # TODO: needs optimization? run only when timer tab is active + self.connect(self.timezone_timer, SIGNAL('timeout()'), + self.on_timezone_timer_timeout) + self.timezone_timer.start() + + def timezone_update(self): + """ + Update datetime widgets + """ + ct = self.caverntime.info() + + self.dt_cavern.setDateTime(ct['cavern']['datetime']) + self.dt_pacific.setDateTime(ct['pacific']['datetime']) + + off = ct['cavern']['utcoffset'] + txt = "UTC %s%i" % (off[0], abs(off[1])) + self.lb_cavern_utc.setText(QtCore.QString(txt)) + + off = ct['pacific']['utcoffset'] + txt = "UTC %s%i" % (off[0], abs(off[1])) + self.lb_pacific_utc.setText(QtCore.QString(txt)) + + @pyqtSignature("") + @skipLogging + def on_timezone_timer_timeout(self): + """ + SIGNAL: QTimer timeout + """ + ct = self.caverntime() + self.dt_cavern.setDateTime(ct['cavern']) + self.dt_pacific.setDateTime(ct['pacific']) + + @pyqtSignature("") + @skipLogging + def on_dnitimer_timeout(self): + """ + SIGNAL: QTimer timeout + """ + dni = self.dnitime.fromUTC() # set to now + self.context.le_dnitime.setText(str(self.dnitime)+", bell: %s" % + self.dnitime.pahrtovo) + + def setup_dniclock(self): + height = 15 + space = 5 + width = self.dninumbers.get(0, height=height).width() + widthl = self.dninumbers.getLeft(0, height=height).width() + widthm = self.dninumbers.getMiddle(0, height=height).width() + widthr = self.dninumbers.getRight(0, height=height).width() + widthhahr = widthl + widthm + widthr + widthyahr = widthhahr + 2 * space + width + + view = self.gv_dniclock + dniclock = self.dniclock = QtGui.QGraphicsScene(view.parent()) + view.setScene(self.dniclock) + view.show() + + self.hahrl = QDniNumberRing(dniclock, 0, 24, height, 'left') + self.hahrl.setPos(0, height+space) + self.hahrm = QDniNumberRing(dniclock, 0, 24, height, 'middle') + self.hahrm.setPos(widthl, height+space) + self.hahrr = QDniNumberRing(dniclock, 0, 24, height, 'right') + self.hahrr.setPos(widthl+widthm, height+space) + + self.vailee = QDniNumberRing(dniclock, 1, 10, height) + self.vailee.setPos(widthhahr+space, height+space) + self.yahrl = QDniNumberRing(dniclock, 0, 10, height, 'left') + self.yahrl.setPos(widthyahr, height+space) + self.yahrr = QDniNumberRing(dniclock, 0, 24, height, 'right') + self.yahrr.setPos(widthyahr+widthl, height+space) + + for i, ring in enumerate((self.hahrl, self.hahrm, self.hahrr, self.vailee, + self.yahrl, self.yahrr)): + ring.setNumber(i) + + for i, name in enumerate(('gahrtahvo', 'tahvo', 'gorahn', 'prorahn')): + ring = QDniNumberRing(dniclock, 0, 24, height, cyclic=True) + setattr(self, name, ring) + ring.setPos((width+space)*i+width/2, 0) + ring.setNumber(i) + + + def setup_dninumbers(self): + # may change! + widget = self.context.gridLayout_3 + grid = self.context.gridlayout3 + + alignl = QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter + alignc = QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter + for i in range(0, 5): + for j in range(0, 5): + nr = QtGui.QLabel(widget) + nr.setObjectName("lb_dninumber_nr_%02i_%02i" % (i, j)) + nr.setAlignment(alignc) + nr.setText(str(i + j*5)) + grid.addWidget(nr, j, i*2) + dni_pic = self.dninumbers.get(i + j*5, height=NUMBER_HEIGHT) + dni = QtGui.QLabel(widget) + dni.setObjectName("lb_dninumber_%02i_%02i" % (i, j)) + dni.setPixmap(dni_pic) + dni.setAlignment(alignl) + grid.addWidget(dni, j, i*2+1) + + nr = QtGui.QLabel(widget) + nr.setObjectName("lb_dninumber_nr_25") + nr.setAlignment(alignc) + nr.setText("25") + grid.addWidget(nr, 5, 2) + dni_pic = self.dninumbers.get(25, height=NUMBER_HEIGHT) + dni = QtGui.QLabel(widget) + dni.setObjectName("lb_dninumber_25") + dni.setAlignment(alignl) + dni.setPixmap(dni_pic) + grid.addWidget(dni, 5, 3) + + nr = QtGui.QLabel(widget) + nr.setObjectName("lb_dninumber_nr_00c") + nr.setAlignment(alignc) + nr.setText(self.trUtf8("cyclic 0")) + grid.addWidget(nr, 5, 5, 1, 2) + dni_pic = self.dninumbers.get("cyclic", height=NUMBER_HEIGHT) + dni = QtGui.QLabel(widget) + dni.setObjectName("lb_dninumber_00c") + dni.setAlignment(alignl) + dni.setPixmap(dni_pic) + grid.addWidget(dni, 5, 7) + + dnipix = QDniNumberWidget(widget) + dnipix.setHeight(NUMBER_HEIGHT) + dnipix.setByDecimal(25, digits=2) + dnipix.setObjectName("dnw_dninumber_250") + dnipix.setPosition(grid, 5, 0, QtCore.Qt.AlignRight) + grid.addWidget(dnipix, 5, 0, 1, 2) + +QtGui.QPixmapCache.setCacheLimit(QtGui.QPixmapCache.cacheLimit() + 1024) + class QDniNumbers(object): """Qt D'ni Number helper class - - Lookup and scale pixmaps for D'ni numbers + + Lookup and scale pixmaps for D'ni numbers. Pixmaps are cached in a + QPixmapCache. You can create as many instances as you require w/o much + efficency drawbacks """ - def __init__(self): - self.pixmaps = {} - for i in range(0, 26): - self.pixmaps[i] = QtGui.QPixmap( - ":/dninumbers/resources/dninumbers/%02i.png" % i) - self.pixmaps['cyclic'] = QtGui.QPixmap( - ":/dninumbers/resources/dninumbers/00c.png") - # w, h = 67, 55 - self._rectleft = QtCore.QRect(0, 0, 60, 55) # with right border - self._rectright = QtCore.QRect(12, 0, 55, 55) # w/o left border - self._rectmiddle = QtCore.QRect(12, 0, 49, 55) # right line + __slots__ = () + # w, h = 67, 55 + _rectleft = QtCore.QRect(0, 0, 60, 55) # with right border + _rectright = QtCore.QRect(12, 0, 55, 55) # w/o left border + _rectmiddle = QtCore.QRect(12, 0, 49, 55) # right line + _valid = tuple(range(0, 26)) + ('cyclic',) @staticmethod - def _scale(pixmap, height=None): + def _insertCache(nr, height, pos, pm): + key = 'dninumber%s_%s_%s' % (nr, height if height else '', pos) + QtGui.QPixmapCache.insert(key, pm) + + @staticmethod + def _findCache(nr, height, pos): + key = 'dninumber%s_%s_%s' % (nr, height if height else '', pos) + return QtGui.QPixmapCache.find(key) + + @staticmethod + def _scale(pm, height=None): """Scale a pixmap to height """ if height is not None: - return pixmap.scaledToHeight(height, QtCore.Qt.SmoothTransformation) + return pm.scaledToHeight(height, QtCore.Qt.SmoothTransformation) else: - return pixmap + return pm def get(self, nr, height=None): """Get pixmap by number and scale it @@ -71,13 +249,29 @@ @return: (scaled) pixmap @rtype: QPixmap instance """ - try: + pm = self._findCache(nr, height, 'full') + if pm: + return pm + + if nr == "cyclic": + fname = "00c.png" + else: nr = int(nr) - except ValueError: - pass - pixmap = self.pixmaps[nr] - return self._scale(pixmap, height) + fname = "%02i.png" % nr + if nr not in self._valid: + raise ValueError(nr) + + # lookup non scaled + pm = self._findCache(nr, None, 'full') + if not pm: + pm = QtGui.QPixmap(":/dninumbers/resources/dninumbers/%s" % fname) + self._insertCache(nr, None, 'full', pm) + + spm = self._scale(pm, height) + self._insertCache(nr, height, 'full', spm) + return spm + def getLeft(self, nr, height=None): """Get pixmap for left digit of combined number @@ -88,8 +282,13 @@ @return: (scaled) pixmap @rtype: QPixmap instance """ - pixmap = self.get(nr).copy(self._rectleft) - return self._scale(pixmap, height) + pm = self._findCache(nr, height, 'left') + if pm: + return pm + pm = self.get(nr).copy(self._rectleft) + spm = self._scale(pm, height) + self._insertCache(nr, height, 'left', spm) + return spm def getRight(self, nr, height=None): """Get pixmap for right digit of combined number @@ -101,10 +300,15 @@ @return: (scaled) pixmap @rtype: QPixmap instance """ - pixmap = self.get(nr).copy(self._rectright) - return self._scale(pixmap, height) + pm = self._findCache(nr, height, 'right') + if pm: + return pm + pm = self.get(nr).copy(self._rectright) + spm = self._scale(pm, height) + self._insertCache(nr, height, 'right', spm) + return spm - def getMiddle(self, nr, heigh=None): + def getMiddle(self, nr, height=None): """Get pixmap for middle digit of combined number @param nr: number (0-25, 'cyclic') @@ -114,9 +318,28 @@ @return: (scaled) pixmap @rtype: QPixmap instance """ - pixmap = self.get(nr).copy(self._rectmiddle) - return self._scale(pixmap, height) + pm = self._findCache(nr, height, 'middle') + if pm: + return pm + pm = self.get(nr).copy(self._rectmiddle) + spm = self._scale(pm, height) + self._insertCache(nr, height, 'middle', spm) + return spm + def getFactory(self, model='full'): + """Get factory method for model + """ + if model == 'full': + return self.get + elif model == 'left': + return self.getLeft + elif model == 'right': + return self.getRight + elif model == 'middle': + return self.getMiddle + else: + raise ValueError(model) + class QDniNumberWidget(QtGui.QWidget): """Q D'ni number widget @@ -124,42 +347,61 @@ """ def __init__(self, parent): QtGui.QWidget.__init__(self, parent) - self.dni = None + self.dni = QDniNumbers() self.height = None self.numbers = () self._layout = None - def setDniNumbers(self, dninumbers): - """Set D'ni number instance - """ - if not isinstance(dninumbers, QDniNumbers): - raise TypeError(type(dninumbers)) - self.dni = dninumbers - def setHeight(self, height=None): """Set height to scale """ self.height=height + def setByDecimal(self, number, digits=1): + """Set numbers by decial value with minimum digits + """ + numbers = [] + pos = 0 + while True: + div = 25**pos + cur = (number / div) % 25 + number -= cur * div + pos+=1 + numbers.insert(0, cur) + if not number: + break + while len(numbers) < digits: + numbers.insert(0, 0) + return self.setNumbers(*numbers) + def setNumbers(self, *args): """Set numbers to display """ valid = tuple(range(0, 26)) + ('cyclic',) for number in args: - if not isinstance(number, int): + if not isinstance(number, (int, basestring)): raise TypeError(number) if number not in valid: raise ValueError(number) self.numbers = args - self._pmleft = self.dni.getLeft(self.numbers[0], height=self.height) - self._pmright = self.dni.getRight(self.numbers[-1], height=self.height) - self._pmmiddle = [self.dni.getMiddle(nr, height=self.height) - for nr in self.numbers[1:-1]] - if self._pmmiddle: - raise NotImplementedError + self.pmlist = [] + if len(args) == 1: + self.pmlist.append(self.dni.get(self.numbers[0], + height=self.height)) else: - middlewidth = 0 - self.width = self._pmleft.width() + self._pmright.width() + middlewidth + for i, number in enumerate(args): + if i == 0: + # first + self.pmlist.append(self.dni.getLeft(number, + height=self.height)) + elif i == len(self.numbers)-1: + # last + self.pmlist.append(self.dni.getRight(number, + height=self.height)) + else: + self.pmlist.append(self.dni.getMiddle(number, + height=self.height)) + self.width = reduce(operator.add, [pm.width() for pm in self.pmlist]) self.setMinimumSize(self.width, self.height) self.setMaximumSize(self.width, self.height) self.resize(self.width, self.height) @@ -190,8 +432,10 @@ #painter.setWindow(self.parent().rect()) # left - painter.drawPixmap(0, 0, self._pmleft) - painter.drawPixmap(self.width-self._pmright.width(), 0, self._pmright) + pos = 0 + for i, pm in enumerate(self.pmlist): + painter.drawPixmap(pos, 0, pm) + pos += pm.width() painter.end() # remove the hack! @@ -204,3 +448,74 @@ movex = movex // 2 self.move(geometry.x()+movex, geometry.y()) self._layout = None + +class QDniNumberRing(object): + """Qt D'ni number graphics item ring + + The class emulates a ring structure similar to a clock. Internally it + stores a list of QGraphicsPixmapItem assossiacted with a scene. All items + are hidden by default and at position (0,0) + + >>> example = QDniNumberRing(scene, start=1, stop=25) + >>> example.setPosition(24) + <Pixmap Graphics Item 24> + >>> example.next() + <Pixmap Graphics Item 25> + >>> example.next() + <Pixmap Graphics Item 25> + """ + __slots__ = ('_elements', '_first', '_last', '_pos') + + def __init__(self, scene, start=0, stop=24, height=None, + model='full', cyclic=False): + factory = QDniNumbers().getFactory(model) + self._elements = [] + self._first = start + self._last = stop + self._pos = start + for i in range(start, stop+1): + if cyclic and i == 0: + i = 'cyclic' + pmitem = QtGui.QGraphicsPixmapItem(factory(i, height=height)) + pmitem.hide() + scene.addItem(pmitem) + self._elements.append(pmitem) + + def __getitem__(self, pos): + return self._elements[pos - self._first] + + def next(self): + """Get next item + + Hides the current item and returns the next item after it is made visible + """ + pos = self._pos + self[pos].hide() + pos += 1 + if pos > self._last: + pos = self._first + self._pos = pos + element = self[pos] + element.show() + return element + + def setNumber(self, nr): + """Set current number to nr + + Also hides all elements before returning the current element + """ + for element in self._elements: + element.hide() + element = self[nr] + element.show() + self._pos = nr + return element + + def setPos(self, xpos, y=None): + """Set position of element + """ + for element in self._elements: + if y is not None: + element.setPos(xpos, y) + else: + element.setPos(xpos) Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-16 13:09:45 UTC (rev 174) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-17 18:10:20 UTC (rev 175) @@ -41,10 +41,8 @@ from moul.server.ping import ServerList from moul.server.ping import isSocketError from moul.server.ping import fmtSocketError -from moul.time.cavern import CavernTime -from moul.time.dni import DniTime -from moul.time.dni import FACTOR_SP +from moul.qt.dninumbers import DniTimeNumberContainer from moul.qt.localization import LocalizationContainer from moul.qt.wdysini import IniFileContainer from moul.qt.simpleprogressbar import SimpleProgressbar @@ -52,8 +50,6 @@ from moul.qt.threadlet import Threadlet from moul.qt.ui.mainwindow import Ui_MainWindow from moul.qt import utils as qtutils -from moul.qt.dninumbers import QDniNumbers -from moul.qt.dninumbers import QDniNumberWidget LOG = getLogger('moul.qt') @@ -89,14 +85,13 @@ self.urupersonaldir.initializeFactories() # init handlers - self._dninumbers_init() - self._timezone_init() self._ping_init() self._systray_init() self._about_init() self._chatlog_init() self.qcLocalization = LocalizationContainer(self) self.qcIniFile = IniFileContainer(self) + self.qcDniTimeNumber = DniTimeNumberContainer(self) # run checker self._moulrunning = None @@ -388,68 +383,6 @@ sfdonate_url)) # ************************************************************************ - # time zones - def _timezone_init(self): - """ - Init time zone tab""" - # create info object and update display the first time - self._caverntime = CavernTime() - self._timezone_update() - - # create a timer to update the display every second - # TODO: change timer from every second to every minute - self._timezone_timer = QtCore.QTimer(self) - self._timezone_timer.setInterval(1000) # 1 sec - # TODO: needs optimization? run only when timer tab is active - self.connect(self._timezone_timer, SIGNAL('timeout()'), - self.on_timezone_timer_timeout) - self._timezone_timer.start() - - self._dnitime = DniTime() - self.on_dnitimer_timeout() - self._dnitime_timer = QtCore.QTimer(self) - self._dnitime_timer.setInterval(FACTOR_SP*1000) - self.connect(self._dnitime_timer, SIGNAL('timeout()'), - self.on_dnitimer_timeout) - self._dnitime_timer.start() - - def _timezone_update(self): - """ - Update datetime widgets - """ - ct = self._caverntime.info() - - self.dt_cavern.setDateTime(ct['cavern']['datetime']) - self.dt_pacific.setDateTime(ct['pacific']['datetime']) - - off = ct['cavern']['utcoffset'] - txt = "UTC %s%i" % (off[0], abs(off[1])) - self.lb_cavern_utc.setText(QtCore.QString(txt)) - - off = ct['pacific']['utcoffset'] - txt = "UTC %s%i" % (off[0], abs(off[1])) - self.lb_pacific_utc.setText(QtCore.QString(txt)) - - @pyqtSignature("") - @qtutils.skipLogging - def on_timezone_timer_timeout(self): - """ - SIGNAL: QTimer timeout - """ - ct = self._caverntime() - self.dt_cavern.setDateTime(ct['cavern']) - self.dt_pacific.setDateTime(ct['pacific']) - - @pyqtSignature("") - @qtutils.skipLogging - def on_dnitimer_timeout(self): - """ - SIGNAL: QTimer timeout - """ - dni = self._dnitime.fromUTC() # set to now - self.le_dnitime.setText(str(self._dnitime)+", bell: %s" % self._dnitime.pahrtovo) - - # ************************************************************************ # ping def _ping_init(self): """ @@ -506,59 +439,6 @@ else: LOG.error("Ping thread is already running") - def _dninumbers_init(self): - self._dninumbers = QDniNumbers() - height = 25 - widget = self.gridLayout_3 - grid = self.gridlayout3 - alignl = QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter - alignc = QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter - for i in range(0, 5): - for j in range(0, 5): - nr = QtGui.QLabel(widget) - nr.setObjectName("lb_dninumber_nr_%02i_%02i" % (i, j)) - nr.setAlignment(alignc) - nr.setText(str(i + j*5)) - grid.addWidget(nr, j, i*2) - dni_pic = self._dninumbers.get(i + j*5, height=height) - dni = QtGui.QLabel(widget) - dni.setObjectName("lb_dninumber_%02i_%02i" % (i, j)) - dni.setPixmap(dni_pic) - dni.setAlignment(alignl) - grid.addWidget(dni, j, i*2+1) - - nr = QtGui.QLabel(widget) - nr.setObjectName("lb_dninumber_nr_25") - nr.setAlignment(alignc) - nr.setText("25") - grid.addWidget(nr, 5, 2) - dni_pic = self._dninumbers.get(25, height=height) - dni = QtGui.QLabel(widget) - dni.setObjectName("lb_dninumber_25") - dni.setAlignment(alignl) - dni.setPixmap(dni_pic) - grid.addWidget(dni, 5, 3) - - nr = QtGui.QLabel(widget) - nr.setObjectName("lb_dninumber_nr_00c") - nr.setAlignment(alignc) - nr.setText(self.trUtf8("cyclic 0")) - grid.addWidget(nr, 5, 5, 1, 2) - dni_pic = self._dninumbers.get("cyclic", height=height) - dni = QtGui.QLabel(widget) - dni.setObjectName("lb_dninumber_00c") - dni.setAlignment(alignl) - dni.setPixmap(dni_pic) - grid.addWidget(dni, 5, 7) - - dnipix = QDniNumberWidget(widget) - dnipix.setDniNumbers(self._dninumbers) - dnipix.setHeight(25) - dnipix.setNumbers(1, 0) - dnipix.setObjectName("dnw_dninumber_250") - dnipix.setPosition(grid, 5, 0, QtCore.Qt.AlignRight) - grid.addWidget(dnipix, 5, 0, 1, 2) - class PingServerThread(QtCore.QThread): def __init__(self, parent=None): QtCore.QThread.__init__(self, parent) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-16 13:09:45 UTC (rev 174) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-17 18:10:20 UTC (rev 175) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file './src/moul/qt/ui/mainwindow.ui' # -# Created: Thu Feb 15 13:28:03 2007 +# Created: Sat Feb 17 18:51:48 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -117,11 +117,11 @@ self.gridlayout.addWidget(self.lb_log_remove,1,1,1,3) self.groupBox_2 = QtGui.QGroupBox(self.tab_tasks) - self.groupBox_2.setGeometry(QtCore.QRect(10,120,451,81)) + self.groupBox_2.setGeometry(QtCore.QRect(10,120,451,61)) self.groupBox_2.setObjectName("groupBox_2") self.layoutWidget1 = QtGui.QWidget(self.groupBox_2) - self.layoutWidget1.setGeometry(QtCore.QRect(10,30,431,30)) + self.layoutWidget1.setGeometry(QtCore.QRect(10,20,431,30)) self.layoutWidget1.setObjectName("layoutWidget1") self.hboxlayout1 = QtGui.QHBoxLayout(self.layoutWidget1) @@ -142,7 +142,7 @@ self.hboxlayout1.addItem(spacerItem3) self.gb_caverntime = QtGui.QGroupBox(self.tab_tasks) - self.gb_caverntime.setGeometry(QtCore.QRect(10,200,451,101)) + self.gb_caverntime.setGeometry(QtCore.QRect(10,180,451,101)) self.gb_caverntime.setObjectName("gb_caverntime") self.gridLayout = QtGui.QWidget(self.gb_caverntime) @@ -203,14 +203,20 @@ self.gridlayout1.addItem(spacerItem4,0,3,1,1) self.gb_dnitime = QtGui.QGroupBox(self.tab_tasks) - self.gb_dnitime.setGeometry(QtCore.QRect(10,300,451,101)) + self.gb_dnitime.setGeometry(QtCore.QRect(10,280,451,121)) self.gb_dnitime.setObjectName("gb_dnitime") self.le_dnitime = QtGui.QLineEdit(self.gb_dnitime) - self.le_dnitime.setGeometry(QtCore.QRect(10,40,281,25)) + self.le_dnitime.setGeometry(QtCore.QRect(200,20,241,25)) self.le_dnitime.setEchoMode(QtGui.QLineEdit.Normal) self.le_dnitime.setReadOnly(True) self.le_dnitime.setObjectName("le_dnitime") + + self.gv_dniclock = QtGui.QGraphicsView(self.gb_dnitime) + self.gv_dniclock.setGeometry(QtCore.QRect(10,20,181,94)) + self.gv_dniclock.setAcceptDrops(False) + self.gv_dniclock.setFrameShadow(QtGui.QFrame.Plain) + self.gv_dniclock.setObjectName("gv_dniclock") self.tabwidget.addTab(self.tab_tasks,"") self.tab_settings = QtGui.QWidget() Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-02-16 13:09:45 UTC (rev 174) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-02-17 18:10:20 UTC (rev 175) @@ -282,7 +282,7 @@ <x>10</x> <y>120</y> <width>451</width> - <height>81</height> + <height>61</height> </rect> </property> <property name="title" > @@ -292,7 +292,7 @@ <property name="geometry" > <rect> <x>10</x> - <y>30</y> + <y>20</y> <width>431</width> <height>30</height> </rect> @@ -347,7 +347,7 @@ <property name="geometry" > <rect> <x>10</x> - <y>200</y> + <y>180</y> <width>451</width> <height>101</height> </rect> @@ -470,9 +470,9 @@ <property name="geometry" > <rect> <x>10</x> - <y>300</y> + <y>280</y> <width>451</width> - <height>101</height> + <height>121</height> </rect> </property> <property name="title" > @@ -481,9 +481,9 @@ <widget class="QLineEdit" name="le_dnitime" > <property name="geometry" > <rect> - <x>10</x> - <y>40</y> - <width>281</width> + <x>200</x> + <y>20</y> + <width>241</width> <height>25</height> </rect> </property> @@ -494,6 +494,22 @@ <bool>true</bool> </property> </widget> + <widget class="QGraphicsView" name="gv_dniclock" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>181</width> + <height>94</height> + </rect> + </property> + <property name="acceptDrops" > + <bool>false</bool> + </property> + <property name="frameShadow" > + <enum>QFrame::Plain</enum> + </property> + </widget> </widget> </widget> <widget class="QWidget" name="tab_settings" > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-19 20:12:40
|
Revision: 180 http://pymoul.svn.sourceforge.net/pymoul/?rev=180&view=rev Author: tiran Date: 2007-02-19 12:12:39 -0800 (Mon, 19 Feb 2007) Log Message: ----------- New time tab with time converter Modified Paths: -------------- pymoul/trunk/src/moul/qt/dninumbers.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui Modified: pymoul/trunk/src/moul/qt/dninumbers.py =================================================================== --- pymoul/trunk/src/moul/qt/dninumbers.py 2007-02-19 18:27:50 UTC (rev 179) +++ pymoul/trunk/src/moul/qt/dninumbers.py 2007-02-19 20:12:39 UTC (rev 180) @@ -429,7 +429,7 @@ self.clocktext.setPos(0, yoff+2*height+2*space) # circular day clock self.circle = QDniClockCircle(None, self) - self.circle.setPos(300, 3) + self.circle.setPos(250, 3) # initialize view self.timeEvent(initialize=True) @@ -467,13 +467,14 @@ class QDniClockCircle(QtGui.QGraphicsItem): """Circular part of the D'ni clock """ - r = 45.0 # radios of circle + r = 70.0 # radios of circle rdot = 3.0 # radius of dots - rinner = 5.0 # radius of inner circle + rinner = 6.0 # radius of inner circle outrect = QtCore.QRectF(0.0, 0.0, 2.0*r, 2.0*r) center = (r, r) angel = 2.0*math.pi/25.0 offset = 0.5 * math.pi + 5.0 * angel + pm_height = 18 def __init__(self, parent=None, scene=None): QtGui.QGraphicsItem.__init__(self, parent, scene) @@ -528,16 +529,15 @@ painter.restore() # number - h = 15 - pm = self._dni.get(self._pahrtovo, height=h) + pm = self._dni.get(self._pahrtovo, height=self.pm_height) w = pm.width() - posx, posy = self.center[0]-w/2.0, self.center[1]+10.0 - painter.save() - painter.setBrush(QtGui.QBrush(QtGui.QColor(Qt.white))) - painter.setPen(QtGui.QPen(Qt.NoPen)) - painter.drawRect(posx-1, posy-1, w+2, h+2) + posx, posy = self.center[0]-w/2.0, self.center[1]-25.0-self.pm_height + #painter.save() + #painter.setBrush(QtGui.QBrush(QtGui.QColor(Qt.white))) + #painter.setPen(QtGui.QPen(Qt.NoPen)) + #painter.drawRect(posx-1, posy-1, w+2, self.pm_height+2) painter.drawPixmap(posx, posy, pm) - painter.restore() + #painter.restore() # pointer painter.save() Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-19 18:27:50 UTC (rev 179) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-19 20:12:39 UTC (rev 180) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file './src/moul/qt/ui/mainwindow.ui' # -# Created: Mon Feb 19 15:44:53 2007 +# Created: Mon Feb 19 21:09:28 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -44,6 +44,12 @@ spacerItem1 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) self.hboxlayout.addItem(spacerItem1) + self.main_buttonbox = QtGui.QDialogButtonBox(self.centralwidget) + self.main_buttonbox.setGeometry(QtCore.QRect(10,520,451,32)) + self.main_buttonbox.setOrientation(QtCore.Qt.Horizontal) + self.main_buttonbox.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Reset|QtGui.QDialogButtonBox.Save) + self.main_buttonbox.setObjectName("main_buttonbox") + self.tabwidget = QtGui.QTabWidget(self.centralwidget) self.tabwidget.setGeometry(QtCore.QRect(0,80,471,434)) self.tabwidget.setTabPosition(QtGui.QTabWidget.North) @@ -146,7 +152,7 @@ self.gb_caverntime.setObjectName("gb_caverntime") self.gridLayout = QtGui.QWidget(self.gb_caverntime) - self.gridLayout.setGeometry(QtCore.QRect(10,20,431,61)) + self.gridLayout.setGeometry(QtCore.QRect(20,20,292,56)) self.gridLayout.setObjectName("gridLayout") self.gridlayout1 = QtGui.QGridLayout(self.gridLayout) @@ -154,24 +160,20 @@ self.gridlayout1.setSpacing(6) self.gridlayout1.setObjectName("gridlayout1") - self.lb_cavern_utc = QtGui.QLabel(self.gridLayout) - self.lb_cavern_utc.setObjectName("lb_cavern_utc") - self.gridlayout1.addWidget(self.lb_cavern_utc,0,2,1,1) + self.label_5 = QtGui.QLabel(self.gridLayout) - self.lb_pacific_utc = QtGui.QLabel(self.gridLayout) - self.lb_pacific_utc.setObjectName("lb_pacific_utc") - self.gridlayout1.addWidget(self.lb_pacific_utc,1,2,1,1) - - self.label_4 = QtGui.QLabel(self.gridLayout) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(0),QtGui.QSizePolicy.Policy(5)) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) - self.label_4.setSizePolicy(sizePolicy) - self.label_4.setObjectName("label_4") - self.gridlayout1.addWidget(self.label_4,0,0,1,1) + sizePolicy.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth()) + self.label_5.setSizePolicy(sizePolicy) + self.label_5.setObjectName("label_5") + self.gridlayout1.addWidget(self.label_5,0,0,1,1) + self.lb_cavern_utc = QtGui.QLabel(self.gridLayout) + self.lb_cavern_utc.setObjectName("lb_cavern_utc") + self.gridlayout1.addWidget(self.lb_cavern_utc,0,2,1,1) + self.dt_cavern = QtGui.QDateTimeEdit(self.gridLayout) self.dt_cavern.setCursor(QtGui.QCursor(QtCore.Qt.CursorShape(0))) self.dt_cavern.setFocusPolicy(QtCore.Qt.NoFocus) @@ -181,16 +183,6 @@ self.dt_cavern.setObjectName("dt_cavern") self.gridlayout1.addWidget(self.dt_cavern,0,1,1,1) - self.label_5 = QtGui.QLabel(self.gridLayout) - - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(0),QtGui.QSizePolicy.Policy(5)) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth()) - self.label_5.setSizePolicy(sizePolicy) - self.label_5.setObjectName("label_5") - self.gridlayout1.addWidget(self.label_5,1,0,1,1) - self.dt_pacific = QtGui.QDateTimeEdit(self.gridLayout) self.dt_pacific.setFocusPolicy(QtCore.Qt.NoFocus) self.dt_pacific.setContextMenuPolicy(QtCore.Qt.NoContextMenu) @@ -199,25 +191,19 @@ self.dt_pacific.setObjectName("dt_pacific") self.gridlayout1.addWidget(self.dt_pacific,1,1,1,1) - spacerItem4 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) - self.gridlayout1.addItem(spacerItem4,0,3,1,1) + self.label_8 = QtGui.QLabel(self.gridLayout) - self.gb_dnitime = QtGui.QGroupBox(self.tab_tasks) - self.gb_dnitime.setGeometry(QtCore.QRect(10,270,451,131)) - self.gb_dnitime.setObjectName("gb_dnitime") + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(0),QtGui.QSizePolicy.Policy(5)) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_8.sizePolicy().hasHeightForWidth()) + self.label_8.setSizePolicy(sizePolicy) + self.label_8.setObjectName("label_8") + self.gridlayout1.addWidget(self.label_8,1,0,1,1) - self.gv_dniclock = QtGui.QGraphicsView(self.gb_dnitime) - self.gv_dniclock.setGeometry(QtCore.QRect(10,20,431,101)) - self.gv_dniclock.setFocusPolicy(QtCore.Qt.NoFocus) - self.gv_dniclock.setContextMenuPolicy(QtCore.Qt.NoContextMenu) - self.gv_dniclock.setAcceptDrops(False) - self.gv_dniclock.setFrameShadow(QtGui.QFrame.Plain) - self.gv_dniclock.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.gv_dniclock.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.gv_dniclock.setInteractive(False) - self.gv_dniclock.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.gv_dniclock.setRenderHints(QtGui.QPainter.Antialiasing|QtGui.QPainter.SmoothPixmapTransform|QtGui.QPainter.TextAntialiasing) - self.gv_dniclock.setObjectName("gv_dniclock") + self.lb_pacific_utc = QtGui.QLabel(self.gridLayout) + self.lb_pacific_utc.setObjectName("lb_pacific_utc") + self.gridlayout1.addWidget(self.lb_pacific_utc,1,2,1,1) self.tabwidget.addTab(self.tab_tasks,"") self.tab_settings = QtGui.QWidget() @@ -766,6 +752,156 @@ self.tb_ping_view.setObjectName("tb_ping_view") self.tabwidget.addTab(self.tab_ping,"") + self.tab_time = QtGui.QWidget() + self.tab_time.setObjectName("tab_time") + + self.groupBox_3 = QtGui.QGroupBox(self.tab_time) + self.groupBox_3.setGeometry(QtCore.QRect(10,0,451,181)) + self.groupBox_3.setObjectName("groupBox_3") + + self.gridLayout_5 = QtGui.QWidget(self.groupBox_3) + self.gridLayout_5.setGeometry(QtCore.QRect(10,20,431,154)) + self.gridLayout_5.setObjectName("gridLayout_5") + + self.gridlayout2 = QtGui.QGridLayout(self.gridLayout_5) + self.gridlayout2.setMargin(0) + self.gridlayout2.setSpacing(6) + self.gridlayout2.setObjectName("gridlayout2") + + self.hboxlayout9 = QtGui.QHBoxLayout() + self.hboxlayout9.setMargin(0) + self.hboxlayout9.setSpacing(6) + self.hboxlayout9.setObjectName("hboxlayout9") + + self.sb_ = QtGui.QSpinBox(self.gridLayout_5) + self.sb_.setButtonSymbols(QtGui.QAbstractSpinBox.UpDownArrows) + self.sb_.setMaximum(4) + self.sb_.setProperty("value",QtCore.QVariant(0)) + self.sb_.setObjectName("sb_") + self.hboxlayout9.addWidget(self.sb_) + + self.sb_1 = QtGui.QSpinBox(self.gridLayout_5) + self.sb_1.setMinimumSize(QtCore.QSize(0,0)) + self.sb_1.setButtonSymbols(QtGui.QAbstractSpinBox.UpDownArrows) + self.sb_1.setMaximum(24) + self.sb_1.setProperty("value",QtCore.QVariant(0)) + self.sb_1.setObjectName("sb_1") + self.hboxlayout9.addWidget(self.sb_1) + + self.sb_2 = QtGui.QSpinBox(self.gridLayout_5) + self.sb_2.setButtonSymbols(QtGui.QAbstractSpinBox.UpDownArrows) + self.sb_2.setMaximum(24) + self.sb_2.setProperty("value",QtCore.QVariant(0)) + self.sb_2.setObjectName("sb_2") + self.hboxlayout9.addWidget(self.sb_2) + + self.sb_3 = QtGui.QSpinBox(self.gridLayout_5) + self.sb_3.setButtonSymbols(QtGui.QAbstractSpinBox.UpDownArrows) + self.sb_3.setMaximum(24) + self.sb_3.setProperty("value",QtCore.QVariant(0)) + self.sb_3.setObjectName("sb_3") + self.hboxlayout9.addWidget(self.sb_3) + + spacerItem4 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.hboxlayout9.addItem(spacerItem4) + self.gridlayout2.addLayout(self.hboxlayout9,3,1,1,1) + + self.hboxlayout10 = QtGui.QHBoxLayout() + self.hboxlayout10.setMargin(0) + self.hboxlayout10.setSpacing(6) + self.hboxlayout10.setObjectName("hboxlayout10") + + self.dateTimeEdit = QtGui.QDateTimeEdit(self.gridLayout_5) + self.dateTimeEdit.setCalendarPopup(True) + self.dateTimeEdit.setObjectName("dateTimeEdit") + self.hboxlayout10.addWidget(self.dateTimeEdit) + + self.comboBox_2 = QtGui.QComboBox(self.gridLayout_5) + self.comboBox_2.setObjectName("comboBox_2") + self.hboxlayout10.addWidget(self.comboBox_2) + + spacerItem5 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.hboxlayout10.addItem(spacerItem5) + self.gridlayout2.addLayout(self.hboxlayout10,1,1,1,1) + + spacerItem6 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.gridlayout2.addItem(spacerItem6,0,1,1,1) + + self.radioButton_4 = QtGui.QRadioButton(self.gridLayout_5) + self.radioButton_4.setObjectName("radioButton_4") + self.gridlayout2.addWidget(self.radioButton_4,4,0,1,1) + + self.hboxlayout11 = QtGui.QHBoxLayout() + self.hboxlayout11.setMargin(0) + self.hboxlayout11.setSpacing(6) + self.hboxlayout11.setObjectName("hboxlayout11") + + self.sb_4 = QtGui.QSpinBox(self.gridLayout_5) + self.sb_4.setButtonSymbols(QtGui.QAbstractSpinBox.UpDownArrows) + self.sb_4.setMaximum(9999) + self.sb_4.setProperty("value",QtCore.QVariant(9662)) + self.sb_4.setObjectName("sb_4") + self.hboxlayout11.addWidget(self.sb_4) + + self.comboBox_3 = QtGui.QComboBox(self.gridLayout_5) + self.comboBox_3.setMinimumSize(QtCore.QSize(0,0)) + self.comboBox_3.setObjectName("comboBox_3") + self.hboxlayout11.addWidget(self.comboBox_3) + + self.spinBox_2 = QtGui.QSpinBox(self.gridLayout_5) + self.spinBox_2.setMaximum(29) + self.spinBox_2.setMinimum(1) + self.spinBox_2.setProperty("value",QtCore.QVariant(1)) + self.spinBox_2.setObjectName("spinBox_2") + self.hboxlayout11.addWidget(self.spinBox_2) + + spacerItem7 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.hboxlayout11.addItem(spacerItem7) + self.gridlayout2.addLayout(self.hboxlayout11,2,1,1,1) + + self.radioButton = QtGui.QRadioButton(self.gridLayout_5) + self.radioButton.setObjectName("radioButton") + self.gridlayout2.addWidget(self.radioButton,0,0,1,1) + + self.radioButton_3 = QtGui.QRadioButton(self.gridLayout_5) + self.radioButton_3.setObjectName("radioButton_3") + self.gridlayout2.addWidget(self.radioButton_3,2,0,1,1) + + self.radioButton_2 = QtGui.QRadioButton(self.gridLayout_5) + self.radioButton_2.setObjectName("radioButton_2") + self.gridlayout2.addWidget(self.radioButton_2,1,0,1,1) + + self.hboxlayout12 = QtGui.QHBoxLayout() + self.hboxlayout12.setMargin(0) + self.hboxlayout12.setSpacing(6) + self.hboxlayout12.setObjectName("hboxlayout12") + + self.comboBox = QtGui.QComboBox(self.gridLayout_5) + self.comboBox.setObjectName("comboBox") + self.hboxlayout12.addWidget(self.comboBox) + + spacerItem8 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) + self.hboxlayout12.addItem(spacerItem8) + self.gridlayout2.addLayout(self.hboxlayout12,4,1,1,1) + + self.gb_dnitime = QtGui.QGroupBox(self.tab_time) + self.gb_dnitime.setGeometry(QtCore.QRect(10,220,451,181)) + self.gb_dnitime.setObjectName("gb_dnitime") + + self.gv_dniclock = QtGui.QGraphicsView(self.gb_dnitime) + self.gv_dniclock.setGeometry(QtCore.QRect(10,20,431,151)) + self.gv_dniclock.setFocusPolicy(QtCore.Qt.NoFocus) + self.gv_dniclock.setContextMenuPolicy(QtCore.Qt.NoContextMenu) + self.gv_dniclock.setAcceptDrops(False) + self.gv_dniclock.setFrameShadow(QtGui.QFrame.Plain) + self.gv_dniclock.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.gv_dniclock.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.gv_dniclock.setInteractive(False) + self.gv_dniclock.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.gv_dniclock.setRenderHints(QtGui.QPainter.Antialiasing|QtGui.QPainter.SmoothPixmapTransform|QtGui.QPainter.TextAntialiasing) + self.gv_dniclock.setObjectName("gv_dniclock") + self.tabwidget.addTab(self.tab_time,"") + self.tab_browse = QtGui.QWidget() self.tab_browse.setObjectName("tab_browse") @@ -781,6 +917,12 @@ self.groupBox_5.setGeometry(QtCore.QRect(10,0,451,371)) self.groupBox_5.setObjectName("groupBox_5") + self.tb_chatlog_view = QtGui.QTextBrowser(self.groupBox_5) + self.tb_chatlog_view.setGeometry(QtCore.QRect(10,50,431,311)) + self.tb_chatlog_view.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) + self.tb_chatlog_view.setOpenExternalLinks(True) + self.tb_chatlog_view.setObjectName("tb_chatlog_view") + self.cb_chatlog = QtGui.QComboBox(self.groupBox_5) self.cb_chatlog.setGeometry(QtCore.QRect(70,20,323,22)) @@ -790,12 +932,6 @@ sizePolicy.setHeightForWidth(self.cb_chatlog.sizePolicy().hasHeightForWidth()) self.cb_chatlog.setSizePolicy(sizePolicy) self.cb_chatlog.setObjectName("cb_chatlog") - - self.tb_chatlog_view = QtGui.QTextBrowser(self.groupBox_5) - self.tb_chatlog_view.setGeometry(QtCore.QRect(10,50,431,311)) - self.tb_chatlog_view.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) - self.tb_chatlog_view.setOpenExternalLinks(True) - self.tb_chatlog_view.setObjectName("tb_chatlog_view") self.tabWidget.addTab(self.tab_sub_chatlogs,"") self.tab_sub_journals = QtGui.QWidget() @@ -809,14 +945,14 @@ self.gridLayout_2.setGeometry(QtCore.QRect(10,20,431,113)) self.gridLayout_2.setObjectName("gridLayout_2") - self.gridlayout2 = QtGui.QGridLayout(self.gridLayout_2) - self.gridlayout2.setMargin(0) - self.gridlayout2.setSpacing(6) - self.gridlayout2.setObjectName("gridlayout2") + self.gridlayout3 = QtGui.QGridLayout(self.gridLayout_2) + self.gridlayout3.setMargin(0) + self.gridlayout3.setSpacing(6) + self.gridlayout3.setObjectName("gridlayout3") self.cb_doc_element = QtGui.QComboBox(self.gridLayout_2) self.cb_doc_element.setObjectName("cb_doc_element") - self.gridlayout2.addWidget(self.cb_doc_element,3,1,1,1) + self.gridlayout3.addWidget(self.cb_doc_element,3,1,1,1) self.cb_doc_language = QtGui.QComboBox(self.gridLayout_2) @@ -826,38 +962,38 @@ sizePolicy.setHeightForWidth(self.cb_doc_language.sizePolicy().hasHeightForWidth()) self.cb_doc_language.setSizePolicy(sizePolicy) self.cb_doc_language.setObjectName("cb_doc_language") - self.gridlayout2.addWidget(self.cb_doc_language,0,1,1,1) + self.gridlayout3.addWidget(self.cb_doc_language,0,1,1,1) self.label = QtGui.QLabel(self.gridLayout_2) self.label.setMinimumSize(QtCore.QSize(80,0)) self.label.setObjectName("label") - self.gridlayout2.addWidget(self.label,0,0,1,1) + self.gridlayout3.addWidget(self.label,0,0,1,1) self.cb_doc_set = QtGui.QComboBox(self.gridLayout_2) self.cb_doc_set.setObjectName("cb_doc_set") - self.gridlayout2.addWidget(self.cb_doc_set,2,1,1,1) + self.gridlayout3.addWidget(self.cb_doc_set,2,1,1,1) self.label_7 = QtGui.QLabel(self.gridLayout_2) self.label_7.setObjectName("label_7") - self.gridlayout2.addWidget(self.label_7,3,0,1,1) + self.gridlayout3.addWidget(self.label_7,3,0,1,1) self.label_2 = QtGui.QLabel(self.gridLayout_2) self.label_2.setObjectName("label_2") - self.gridlayout2.addWidget(self.label_2,1,0,1,1) + self.gridlayout3.addWidget(self.label_2,1,0,1,1) self.label_3 = QtGui.QLabel(self.gridLayout_2) self.label_3.setObjectName("label_3") - self.gridlayout2.addWidget(self.label_3,2,0,1,1) + self.gridlayout3.addWidget(self.label_3,2,0,1,1) self.cb_doc_age = QtGui.QComboBox(self.gridLayout_2) self.cb_doc_age.setObjectName("cb_doc_age") - self.gridlayout2.addWidget(self.cb_doc_age,1,1,1,1) + self.gridlayout3.addWidget(self.cb_doc_age,1,1,1,1) self.pb_doc_loadjournals = QtGui.QPushButton(self.gridLayout_2) self.pb_doc_loadjournals.setMinimumSize(QtCore.QSize(0,22)) self.pb_doc_loadjournals.setMaximumSize(QtCore.QSize(16777215,22)) self.pb_doc_loadjournals.setObjectName("pb_doc_loadjournals") - self.gridlayout2.addWidget(self.pb_doc_loadjournals,0,2,1,1) + self.gridlayout3.addWidget(self.pb_doc_loadjournals,0,2,1,1) self.lb_doc_status = QtGui.QLabel(self.gridLayout_2) self.lb_doc_status.setMinimumSize(QtCore.QSize(120,80)) @@ -865,7 +1001,7 @@ self.lb_doc_status.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop) self.lb_doc_status.setWordWrap(True) self.lb_doc_status.setObjectName("lb_doc_status") - self.gridlayout2.addWidget(self.lb_doc_status,1,2,3,1) + self.gridlayout3.addWidget(self.lb_doc_status,1,2,3,1) self.tb_journal_view = QtGui.QTextBrowser(self.gb_documents) self.tb_journal_view.setGeometry(QtCore.QRect(10,140,431,221)) @@ -885,10 +1021,10 @@ self.gridLayout_3.setGeometry(QtCore.QRect(10,20,411,341)) self.gridLayout_3.setObjectName("gridLayout_3") - self.gridlayout3 = QtGui.QGridLayout(self.gridLayout_3) - self.gridlayout3.setMargin(0) - self.gridlayout3.setSpacing(6) - self.gridlayout3.setObjectName("gridlayout3") + self.gridlayout4 = QtGui.QGridLayout(self.gridLayout_3) + self.gridlayout4.setMargin(0) + self.gridlayout4.setSpacing(6) + self.gridlayout4.setObjectName("gridlayout4") self.tabWidget.addTab(self.tab,"") self.tabwidget.addTab(self.tab_browse,"") @@ -920,12 +1056,6 @@ self.tb_license.setObjectName("tb_license") self.tabwidget_about.addTab(self.tab_sub_license,"") self.tabwidget.addTab(self.tab_about,"") - - self.main_buttonbox = QtGui.QDialogButtonBox(self.centralwidget) - self.main_buttonbox.setGeometry(QtCore.QRect(10,520,451,32)) - self.main_buttonbox.setOrientation(QtCore.Qt.Horizontal) - self.main_buttonbox.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Reset|QtGui.QDialogButtonBox.Save) - self.main_buttonbox.setObjectName("main_buttonbox") MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtGui.QStatusBar(MainWindow) @@ -937,7 +1067,7 @@ self.lb_doc_status.setBuddy(self.pb_doc_loadjournals) self.retranslateUi(MainWindow) - self.tabwidget.setCurrentIndex(0) + self.tabwidget.setCurrentIndex(3) self.tab_sub_settings.setCurrentIndex(0) self.tabWidget.setCurrentIndex(0) self.tabwidget_about.setCurrentIndex(0) @@ -957,11 +1087,10 @@ self.pb_kiimage_repair.setText(QtGui.QApplication.translate("MainWindow", "Repair", None, QtGui.QApplication.UnicodeUTF8)) self.pb_kiimage_repair1.setText(QtGui.QApplication.translate("MainWindow", "Fix KI and avatar images", None, QtGui.QApplication.UnicodeUTF8)) self.gb_caverntime.setTitle(QtGui.QApplication.translate("MainWindow", "Time zones", None, QtGui.QApplication.UnicodeUTF8)) + self.label_5.setText(QtGui.QApplication.translate("MainWindow", "Cavern time:", None, QtGui.QApplication.UnicodeUTF8)) self.lb_cavern_utc.setText(QtGui.QApplication.translate("MainWindow", "UTC -0", None, QtGui.QApplication.UnicodeUTF8)) + self.label_8.setText(QtGui.QApplication.translate("MainWindow", "Cyan time:", None, QtGui.QApplication.UnicodeUTF8)) self.lb_pacific_utc.setText(QtGui.QApplication.translate("MainWindow", "UTC -0", None, QtGui.QApplication.UnicodeUTF8)) - self.label_4.setText(QtGui.QApplication.translate("MainWindow", "Cavern time:", None, QtGui.QApplication.UnicodeUTF8)) - self.label_5.setText(QtGui.QApplication.translate("MainWindow", "Cyan time:", None, QtGui.QApplication.UnicodeUTF8)) - self.gb_dnitime.setTitle(QtGui.QApplication.translate("MainWindow", "D\'ni time", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_tasks), QtGui.QApplication.translate("MainWindow", "Tasks", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_screenres.setTitle(QtGui.QApplication.translate("MainWindow", "Screen Resolution", None, QtGui.QApplication.UnicodeUTF8)) self.lb_screenres.setText(QtGui.QApplication.translate("MainWindow", "800x600 (4:3)", None, QtGui.QApplication.UnicodeUTF8)) @@ -1005,12 +1134,20 @@ self.gb_servers.setTitle(QtGui.QApplication.translate("MainWindow", "Ping servers", None, QtGui.QApplication.UnicodeUTF8)) self.button_ping.setText(QtGui.QApplication.translate("MainWindow", "Ping", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_ping), QtGui.QApplication.translate("MainWindow", "Servers", None, QtGui.QApplication.UnicodeUTF8)) + self.groupBox_3.setTitle(QtGui.QApplication.translate("MainWindow", "Choose Time", None, QtGui.QApplication.UnicodeUTF8)) + self.radioButton_4.setText(QtGui.QApplication.translate("MainWindow", "D\'ni Holiday", None, QtGui.QApplication.UnicodeUTF8)) + self.comboBox_3.addItem(QtGui.QApplication.translate("MainWindow", "8 Leevosahn", None, QtGui.QApplication.UnicodeUTF8)) + self.radioButton.setText(QtGui.QApplication.translate("MainWindow", "Current Time", None, QtGui.QApplication.UnicodeUTF8)) + self.radioButton_3.setText(QtGui.QApplication.translate("MainWindow", "D\'ni Time", None, QtGui.QApplication.UnicodeUTF8)) + self.radioButton_2.setText(QtGui.QApplication.translate("MainWindow", "Earth Time", None, QtGui.QApplication.UnicodeUTF8)) + self.gb_dnitime.setTitle(QtGui.QApplication.translate("MainWindow", "D\'ni time", None, QtGui.QApplication.UnicodeUTF8)) + self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_time), QtGui.QApplication.translate("MainWindow", "Time", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_5.setTitle(QtGui.QApplication.translate("MainWindow", "Read chatlogs", None, QtGui.QApplication.UnicodeUTF8)) - self.cb_chatlog.addItem(QtGui.QApplication.translate("MainWindow", "Not implemented", None, QtGui.QApplication.UnicodeUTF8)) self.tb_chatlog_view.setHtml(QtGui.QApplication.translate("MainWindow", "<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; text-decoration:none;\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Not implemented</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) + self.cb_chatlog.addItem(QtGui.QApplication.translate("MainWindow", "Not implemented", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_sub_chatlogs), QtGui.QApplication.translate("MainWindow", "Chat logs", None, QtGui.QApplication.UnicodeUTF8)) self.gb_documents.setTitle(QtGui.QApplication.translate("MainWindow", "Browse journals and notes", None, QtGui.QApplication.UnicodeUTF8)) self.label.setText(QtGui.QApplication.translate("MainWindow", "Language", None, QtGui.QApplication.UnicodeUTF8)) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-02-19 18:27:50 UTC (rev 179) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-02-19 20:12:39 UTC (rev 180) @@ -97,6 +97,22 @@ </item> </layout> </widget> + <widget class="QDialogButtonBox" name="main_buttonbox" > + <property name="geometry" > + <rect> + <x>10</x> + <y>520</y> + <width>451</width> + <height>32</height> + </rect> + </property> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons" > + <set>QDialogButtonBox::Close|QDialogButtonBox::NoButton|QDialogButtonBox::Reset|QDialogButtonBox::Save</set> + </property> + </widget> <widget class="QTabWidget" name="tabwidget" > <property name="geometry" > <rect> @@ -110,7 +126,7 @@ <enum>QTabWidget::North</enum> </property> <property name="currentIndex" > - <number>0</number> + <number>3</number> </property> <widget class="QWidget" name="tab_tasks" > <attribute name="title" > @@ -358,10 +374,10 @@ <widget class="QWidget" native="1" name="gridLayout" > <property name="geometry" > <rect> - <x>10</x> + <x>20</x> <y>20</y> - <width>431</width> - <height>61</height> + <width>292</width> + <height>56</height> </rect> </property> <layout class="QGridLayout" > @@ -371,22 +387,8 @@ <property name="spacing" > <number>6</number> </property> - <item row="0" column="2" > - <widget class="QLabel" name="lb_cavern_utc" > - <property name="text" > - <string>UTC -0</string> - </property> - </widget> - </item> - <item row="1" column="2" > - <widget class="QLabel" name="lb_pacific_utc" > - <property name="text" > - <string>UTC -0</string> - </property> - </widget> - </item> <item row="0" column="0" > - <widget class="QLabel" name="label_4" > + <widget class="QLabel" name="label_5" > <property name="sizePolicy" > <sizepolicy> <hsizetype>0</hsizetype> @@ -400,6 +402,13 @@ </property> </widget> </item> + <item row="0" column="2" > + <widget class="QLabel" name="lb_cavern_utc" > + <property name="text" > + <string>UTC -0</string> + </property> + </widget> + </item> <item row="0" column="1" > <widget class="QDateTimeEdit" name="dt_cavern" > <property name="cursor" > @@ -419,21 +428,6 @@ </property> </widget> </item> - <item row="1" column="0" > - <widget class="QLabel" name="label_5" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>5</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>Cyan time:</string> - </property> - </widget> - </item> <item row="1" column="1" > <widget class="QDateTimeEdit" name="dt_pacific" > <property name="focusPolicy" > @@ -450,72 +444,31 @@ </property> </widget> </item> - <item row="0" column="3" > - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> + <item row="1" column="0" > + <widget class="QLabel" name="label_8" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> + <property name="text" > + <string>Cyan time:</string> </property> - </spacer> + </widget> </item> + <item row="1" column="2" > + <widget class="QLabel" name="lb_pacific_utc" > + <property name="text" > + <string>UTC -0</string> + </property> + </widget> + </item> </layout> </widget> </widget> - <widget class="QGroupBox" name="gb_dnitime" > - <property name="geometry" > - <rect> - <x>10</x> - <y>270</y> - <width>451</width> - <height>131</height> - </rect> - </property> - <property name="title" > - <string>D'ni time</string> - </property> - <widget class="QGraphicsView" name="gv_dniclock" > - <property name="geometry" > - <rect> - <x>10</x> - <y>20</y> - <width>431</width> - <height>101</height> - </rect> - </property> - <property name="focusPolicy" > - <enum>Qt::NoFocus</enum> - </property> - <property name="contextMenuPolicy" > - <enum>Qt::NoContextMenu</enum> - </property> - <property name="acceptDrops" > - <bool>false</bool> - </property> - <property name="frameShadow" > - <enum>QFrame::Plain</enum> - </property> - <property name="verticalScrollBarPolicy" > - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="horizontalScrollBarPolicy" > - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="interactive" > - <bool>false</bool> - </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - <property name="renderHints" > - <set>QPainter::Antialiasing|QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set> - </property> - </widget> - </widget> </widget> <widget class="QWidget" name="tab_settings" > <attribute name="title" > @@ -1655,6 +1608,337 @@ </widget> </widget> </widget> + <widget class="QWidget" name="tab_time" > + <attribute name="title" > + <string>Time</string> + </attribute> + <widget class="QGroupBox" name="groupBox_3" > + <property name="geometry" > + <rect> + <x>10</x> + <y>0</y> + <width>451</width> + <height>181</height> + </rect> + </property> + <property name="title" > + <string>Choose Time</string> + </property> + <widget class="QWidget" name="gridLayout_5" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>431</width> + <height>154</height> + </rect> + </property> + <layout class="QGridLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item row="3" column="1" > + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QSpinBox" name="sb_" > + <property name="buttonSymbols" > + <enum>QAbstractSpinBox::UpDownArrows</enum> + </property> + <property name="maximum" > + <number>4</number> + </property> + <property name="value" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="sb_1" > + <property name="minimumSize" > + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="buttonSymbols" > + <enum>QAbstractSpinBox::UpDownArrows</enum> + </property> + <property name="maximum" > + <number>24</number> + </property> + <property name="value" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="sb_2" > + <property name="buttonSymbols" > + <enum>QAbstractSpinBox::UpDownArrows</enum> + </property> + <property name="maximum" > + <number>24</number> + </property> + <property name="value" > + <number>0</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="sb_3" > + <property name="buttonSymbols" > + <enum>QAbstractSpinBox::UpDownArrows</enum> + </property> + <property name="maximum" > + <number>24</number> + </property> + <property name="value" > + <number>0</number> + </property> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" > + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="1" column="1" > + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QDateTimeEdit" name="dateTimeEdit" > + <property name="calendarPopup" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="comboBox_2" /> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" > + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="0" column="1" > + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" > + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="4" column="0" > + <widget class="QRadioButton" name="radioButton_4" > + <property name="text" > + <string>D'ni Holiday</string> + </property> + </widget> + </item> + <item row="2" column="1" > + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QSpinBox" name="sb_4" > + <property name="buttonSymbols" > + <enum>QAbstractSpinBox::UpDownArrows</enum> + </property> + <property name="maximum" > + <number>9999</number> + </property> + <property name="value" > + <number>9662</number> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="comboBox_3" > + <property name="minimumSize" > + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <item> + <property name="text" > + <string>8 Leevosahn</string> + </property> + </item> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinBox_2" > + <property name="maximum" > + <number>29</number> + </property> + <property name="minimum" > + <number>1</number> + </property> + <property name="value" > + <number>1</number> + </property> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" > + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item row="0" column="0" > + <widget class="QRadioButton" name="radioButton" > + <property name="text" > + <string>Current Time</string> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QRadioButton" name="radioButton_3" > + <property name="text" > + <string>D'ni Time</string> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QRadioButton" name="radioButton_2" > + <property name="text" > + <string>Earth Time</string> + </property> + </widget> + </item> + <item row="4" column="1" > + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QComboBox" name="comboBox" /> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" > + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + </widget> + <widget class="QGroupBox" name="gb_dnitime" > + <property name="geometry" > + <rect> + <x>10</x> + <y>220</y> + <width>451</width> + <height>181</height> + </rect> + </property> + <property name="title" > + <string>D'ni time</string> + </property> + <widget class="QGraphicsView" name="gv_dniclock" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>431</width> + <height>151</height> + </rect> + </property> + <property name="focusPolicy" > + <enum>Qt::NoFocus</enum> + </property> + <property name="contextMenuPolicy" > + <enum>Qt::NoContextMenu</enum> + </property> + <property name="acceptDrops" > + <bool>false</bool> + </property> + <property name="frameShadow" > + <enum>QFrame::Plain</enum> + </property> + <property name="verticalScrollBarPolicy" > + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + <property name="horizontalScrollBarPolicy" > + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + <property name="interactive" > + <bool>false</bool> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <property name="renderHints" > + <set>QPainter::Antialiasing|QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set> + </property> + </widget> + </widget> + </widget> <widget class="QWidget" name="tab_browse" > <attribute name="title" > <string>Browse</string> @@ -1690,6 +1974,28 @@ <property name="title" > <string>Read chatlogs</string> </property> + <widget class="QTextBrowser" name="tb_chatlog_view" > + <property name="geometry" > + <rect> + <x>10</x> + <y>50</y> + <width>431</width> + <height>311</height> + </rect> + </property> + <property name="html" > + <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Not implemented</p></body></html></string> + </property> + <property name="textInteractionFlags" > + <enum>Qt::TextSelectableByMouse</enum> + </property> + <property name="openExternalLinks" > + <bool>true</bool> + </property> + </widget> <widget class="QComboBox" name="cb_chatlog" > <property name="geometry" > <rect> @@ -1713,28 +2019,6 @@ </property> </item> </widget> - <widget class="QTextBrowser" name="tb_chatlog_view" > - <property name="geometry" > - <rect> - <x>10</x> - <y>50</y> - <width>431</width> - <height>311</height> - </rect> - </property> - <property name="html" > - <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Not implemented</p></body></html></string> - </property> - <property name="textInteractionFlags" > - <enum>Qt::TextSelectableByMouse</enum> - </property> - <property name="openExternalLinks" > - <bool>true</bool> - </property> - </widget> </widget> </widget> <widget class="QWidget" name="tab_sub_journals" > @@ -2005,22 +2289,6 @@ </widget> </widget> </widget> - <widget class="QDialogButtonBox" name="main_buttonbox" > - <property name="geometry" > - <rect> - <x>10</x> - <y>520</y> - <width>451</width> - <height>32</height> - </rect> - </property> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons" > - <set>QDialogButtonBox::Close|QDialogButtonBox::NoButton|QDialogButtonBox::Reset|QDialogButtonBox::Save</set> - </property> - </widget> </widget> <widget class="QStatusBar" name="statusbar" /> </widget> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-03-19 21:58:19
|
Revision: 268 http://pymoul.svn.sourceforge.net/pymoul/?rev=268&view=rev Author: tiran Date: 2007-03-19 14:08:20 -0700 (Mon, 19 Mar 2007) Log Message: ----------- Reverted font changes Modified Paths: -------------- pymoul/trunk/src/moul/qt/dninumbers.py pymoul/trunk/src/moul/qt/mainwindow.py Modified: pymoul/trunk/src/moul/qt/dninumbers.py =================================================================== --- pymoul/trunk/src/moul/qt/dninumbers.py 2007-03-19 20:56:14 UTC (rev 267) +++ pymoul/trunk/src/moul/qt/dninumbers.py 2007-03-19 21:08:20 UTC (rev 268) @@ -149,9 +149,9 @@ tw.setRowCount(rows) proto = QtGui.QTableWidgetItem() - font = QtGui.QFont() - font.setPointSize(9) - proto.setFont(font) + #font = QtGui.QFont() + #font.setPointSize(9) + #proto.setFont(font) proto.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter) for n, midnight, dawn, dusk in iter(eg): @@ -188,9 +188,9 @@ tw.setColumnCount(cols) proto = QtGui.QTableWidgetItem() - font = QtGui.QFont() - font.setPointSize(9) - proto.setFont(font) + #font = QtGui.QFont() + #font.setPointSize(9) + #proto.setFont(font) proto.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter) #for n in range(rows): Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-03-19 20:56:14 UTC (rev 267) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-03-19 21:08:20 UTC (rev 268) @@ -422,9 +422,9 @@ tw.setRowCount(i + 1) proto = QtGui.QTableWidgetItem() - font = QtGui.QFont() - font.setPointSize(9) - proto.setFont(font) + #font = QtGui.QFont() + #font.setPointSize(9) + #proto.setFont(font) proto.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter) #tw.setVerticalHeaderItem(i, QtGui.QTableWidgetItem()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-02 03:49:54
|
Revision: 117 http://pymoul.svn.sourceforge.net/pymoul/?rev=117&view=rev Author: tiran Date: 2007-02-01 19:49:46 -0800 (Thu, 01 Feb 2007) Log Message: ----------- Run localization loading in a Threadlet Modified Paths: -------------- pymoul/trunk/src/moul/qt/localization.py pymoul/trunk/src/moul/qt/threadlet.py Modified: pymoul/trunk/src/moul/qt/localization.py =================================================================== --- pymoul/trunk/src/moul/qt/localization.py 2007-02-02 03:32:28 UTC (rev 116) +++ pymoul/trunk/src/moul/qt/localization.py 2007-02-02 03:49:46 UTC (rev 117) @@ -36,6 +36,7 @@ from moul.file.directory import UruGameDataDirectory from moul.log import getLogger from moul.log import signalLogDecorator +from moul.qt.threadlet import Threadlet LOG = getLogger('moul.loc') @@ -52,8 +53,13 @@ self._gamedir = UruGameDataDirectory(installDir) if not self._gamedir.exists('loc'): return + self._journal_threadlet = Threadlet() + self.connect(self._journal_threadlet, SIGNAL('finished()'), + self.on_localization_loaded) + self._journal_threadlet.detach(self._gamedir.factory, 'loc') - self._gamedir.factory('loc') + @signalLogDecorator(LOG) + def on_localization_loaded(self): self.tab_sub_journals.setEnabled(True) self._documents_state = {} Modified: pymoul/trunk/src/moul/qt/threadlet.py =================================================================== --- pymoul/trunk/src/moul/qt/threadlet.py 2007-02-02 03:32:28 UTC (rev 116) +++ pymoul/trunk/src/moul/qt/threadlet.py 2007-02-02 03:49:46 UTC (rev 117) @@ -26,11 +26,15 @@ import sys from PyQt4 import QtCore +from moul.log import getLogger +from PyQt4.QtCore import SIGNAL -LOG = getLogger('moul.tasklket') +LOG = getLogger('moul.tasklet') class Threadlet(QtCore.QThread): """Threadlet - execute a function in a seperate thread + + Use this class to run a CPU or I/O bound function in a seperate thread. @signal started(): Signal is emitted when the thread starts executing. @signal finished(): Signal is emitted when the thread has finished. @@ -40,9 +44,9 @@ >>> def pow(x, y): return x**y >>> def printer(r): print r - >>> example =Threadlet(pow, parent=None, 2, 6) + >>> example =Threadlet() >>> connect(example, SIGNAL('done(result)'), printer) - >>> example.start() + >>> example.detach(pow, 2, 6) started() done(result) @@ -51,18 +55,29 @@ @warning: The function and all applied arguments must be reentrant or thread safe! """ - def __init__(self, func, parent=None, *args, **kwargs): + def __init__(self, parent=None): + QtCore.QThread.__init__(self, parent) + self.mutex = QtCore.QMutex() + self._func = None + self._args = None + self._kwargs = None + + def detach(self, func, *args, **kwargs): """ @param func: a callable - @param parent: Qt parent @param *args: additional arguments for the function @param **kwargs: additional keyword arguments for the function """ - QtCore.QThread.__init__(self, parent) + self.mutex.lock() self._func = func self._args = args self._kwargs = kwargs + self.mutex.unlock() + if not self.isRunning(): + self.start() def run(self): + self.mutex.lock() result = self._func(*self._args, **self._kwargs) self.emit(SIGNAL("done(result)"), result) + self.mutex.unlock() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-02 18:11:59
|
Revision: 126 http://pymoul.svn.sourceforge.net/pymoul/?rev=126&view=rev Author: tiran Date: 2007-02-02 10:11:58 -0800 (Fri, 02 Feb 2007) Log Message: ----------- More fixes for windows and sys.frozen apps Modified Paths: -------------- pymoul/trunk/src/moul/qt/errorhandler.py pymoul/trunk/src/moul/qt/mainwindow.py Modified: pymoul/trunk/src/moul/qt/errorhandler.py =================================================================== --- pymoul/trunk/src/moul/qt/errorhandler.py 2007-02-02 17:59:04 UTC (rev 125) +++ pymoul/trunk/src/moul/qt/errorhandler.py 2007-02-02 18:11:58 UTC (rev 126) @@ -45,7 +45,8 @@ """ # TODO: translation aware LOG.critical("UNHANDLED ERROR", exc_info=(typ, value, traceback)) - return # XXX: remove + if not getattr(sys, 'frozen', False): + return try: title= QtGui.QApplication.translate("excepthook", "An unhandled error has occured", Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-02 17:59:04 UTC (rev 125) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-02 18:11:58 UTC (rev 126) @@ -619,14 +619,14 @@ dns = server.dns() if isSocketError(dns): self.emit(SIGNAL("dnserror(const QString&, int, const QString&)"), - name, dns[0], dns[1]) + name, dns.args[0], dns.args[1]) continue self.emit(SIGNAL("dns(const QString&, float)"), name, dns) ping = server.portping() if isSocketError(ping): self.emit(SIGNAL("pingerror(const QString&, int, const QString&)"), - name, ping[0], (len(ping) == 2) and ping[1] or "unknown") + name, ping.args[0], ping.args[1]) continue self.emit(SIGNAL("ping(const QString&, float)"), name, ping) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-03 21:56:02
|
Revision: 131 http://pymoul.svn.sourceforge.net/pymoul/?rev=131&view=rev Author: tiran Date: 2007-02-03 13:55:59 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Added dirty handler Modified Paths: -------------- pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/simpleprogressbar.py pymoul/trunk/src/moul/qt/threadlet.py pymoul/trunk/src/moul/qt/wdysini.py Property Changed: ---------------- pymoul/trunk/src/moul/qt/errorhandler.py pymoul/trunk/src/moul/qt/simpleprogressbar.py pymoul/trunk/src/moul/qt/threadlet.py pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py pymoul/trunk/src/moul/qt/ui/simpleprogressbar.ui pymoul/trunk/src/moul/qt/utils.py Property changes on: pymoul/trunk/src/moul/qt/errorhandler.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-03 19:26:53 UTC (rev 130) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-03 21:55:59 UTC (rev 131) @@ -35,7 +35,6 @@ from moul.config import lookupDir from moul.file.directory import UruGameDataDirectory from moul.file.directory import UruPersonalDataDirectory -from moul.file.wdysini import videoModes from moul.log import getLogger from moul.log import signalLogDecorator from moul.osdependent import isMoulRunning @@ -62,11 +61,12 @@ self.main_buttonbox_reset = but(QtGui.QDialogButtonBox.Reset) self.main_buttonbox_save = but(QtGui.QDialogButtonBox.Save) self.main_buttonbox_close = but(QtGui.QDialogButtonBox.Close) - + self.main_buttonbox_save.setEnabled(False) + self.main_buttonbox_reset.setEnabled(False) + # dirty flag: unsaved changes - self._dirty = False - self.setDirty(False) - + self._dirty = {} + # set directory handlers self.urugamedir = UruGameDataDirectory(lookupDir('install')) self.urugamedir.initializeFactories() @@ -150,15 +150,34 @@ event.accept() event.ignore() - def setDirty(self, boolean): + def isDirty(self): """ + Check if we have unsaved changes + """ + if any(self._dirty.values()): + return True + else: + return False + + def clearDirty(self): + """ + Clear dirty state + """ + self._dirty.clear() + self.main_buttonbox_save.setEnabled(False) + self.main_buttonbox_reset.setEnabled(False) + + def notifyDirty(self, name, boolean): + """ Sets the save state """ - self._dirty = bool(boolean) - #self.main_buttonbox_reset.setEnabled(boolean) - #self.main_buttonbox_save.setEnabled(boolean) - self.main_buttonbox_save.setEnabled(True) - self.main_buttonbox_reset.setEnabled(True) + self._dirty[name] = boolean + if self.isDirty(): + self.main_buttonbox_save.setEnabled(True) + self.main_buttonbox_reset.setEnabled(True) + else: + self.main_buttonbox_save.setEnabled(False) + self.main_buttonbox_reset.setEnabled(False) # ************************************************************************ # tasks Modified: pymoul/trunk/src/moul/qt/simpleprogressbar.py =================================================================== --- pymoul/trunk/src/moul/qt/simpleprogressbar.py 2007-02-03 19:26:53 UTC (rev 130) +++ pymoul/trunk/src/moul/qt/simpleprogressbar.py 2007-02-03 21:55:59 UTC (rev 131) @@ -19,8 +19,8 @@ """Moul QT GUI main windows """ __author__ = "Christian Heimes" -__version__ = "$Id: mainwindow.py 116 2007-02-02 03:32:28Z tiran $" -__revision__ = "$Revision: 116 $" +__version__ = "$Id$" +__revision__ = "$Revision$" __all__ = ['SimpleProgressbar'] Property changes on: pymoul/trunk/src/moul/qt/simpleprogressbar.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/qt/threadlet.py =================================================================== --- pymoul/trunk/src/moul/qt/threadlet.py 2007-02-03 19:26:53 UTC (rev 130) +++ pymoul/trunk/src/moul/qt/threadlet.py 2007-02-03 21:55:59 UTC (rev 131) @@ -20,8 +20,8 @@ """Threadlet - execute a function in a seperate thread """ __author__ = "Christian Heimes" -__version__ = "$Id: moulqt.py 110 2007-01-31 15:40:51Z tiran $" -__revision__ = "$Revision: 110 $" +__version__ = "$Id$" +__revision__ = "$Revision$" import sys from PyQt4 import QtCore Property changes on: pymoul/trunk/src/moul/qt/threadlet.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Property changes on: pymoul/trunk/src/moul/qt/ui/simpleprogressbar.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Property changes on: pymoul/trunk/src/moul/qt/ui/simpleprogressbar.ui ___________________________________________________________________ Name: svn:eol-style + native Property changes on: pymoul/trunk/src/moul/qt/utils.py ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: pymoul/trunk/src/moul/qt/wdysini.py =================================================================== --- pymoul/trunk/src/moul/qt/wdysini.py 2007-02-03 19:26:53 UTC (rev 130) +++ pymoul/trunk/src/moul/qt/wdysini.py 2007-02-03 21:55:59 UTC (rev 131) @@ -45,21 +45,40 @@ class IniFileContainer(QNamespaceContainer): def initialize(self): # graphics.ini + self.connect(self.context, SIGNAL("graphicsChanged(bool)"), self.on_graphicsChanged) self.connect(self.context, SIGNAL("graphicsini_loaded()"), self.on_graphicsini_loaded) self.connect(self.context, SIGNAL("graphicsini_reset()"), self.on_graphicsini_reset) self.connect(self.context, SIGNAL("graphicsini_save()"), self.on_graphicsini_save) self.connect(self.main_buttonbox_reset, SIGNAL("clicked()"), self.on_graphicsini_reset) self.connect(self.main_buttonbox_save, SIGNAL("clicked()"), self.on_graphicsini_save) - self.context.emit(SIGNAL("graphicsini_loaded()")) # XXX: hard coded emit # audio.ini + self.connect(self.context, SIGNAL("audioChanged(bool)"), self.on_audioChanged) self.connect(self.context, SIGNAL("audioini_loaded()"), self.on_audioini_loaded) self.connect(self.context, SIGNAL("audiini_reset()"), self.on_audioini_reset) self.connect(self.context, SIGNAL("audiini_save()"), self.on_audioini_save) self.connect(self.main_buttonbox_reset, SIGNAL("clicked()"), self.on_audioini_reset) self.connect(self.main_buttonbox_save, SIGNAL("clicked()"), self.on_audioini_save) + self.context.emit(SIGNAL("audioini_loaded()")) # XXX: hard coded emit + self.context.emit(SIGNAL("graphicsini_loaded()")) # XXX: hard coded emit @signalLogDecorator(LOG) + @pyqtSignature("bool") + def on_graphicsChanged(self, boolean): + """ + @qtslot on_graphicsChanged(bool): notify when graphics settings are changed + """ + self.context.notifyDirty('graphicsini', boolean) + + @signalLogDecorator(LOG) + @pyqtSignature("bool") + def on_audioChanged(self, boolean): + """ + @qtslot on_audioChanged(bool): notify when audio settings are changed + """ + self.context.notifyDirty('audioini', boolean) + + @signalLogDecorator(LOG) @pyqtSignature("") def on_graphicsini_loaded(self): """ @@ -75,6 +94,7 @@ self.trUtf8("""Something bad happend while opening the graphics.ini\n%s""" % msg)) return self._graphicsini_setstate() + self.emit(SIGNAL("graphicsChanged(bool)"), False) @signalLogDecorator(LOG) @pyqtSignature("") @@ -82,6 +102,7 @@ """ SIGNAL graphicsini_reset() """ + self.emit(SIGNAL("graphicsChanged(bool)"), False) self.urupersonaldir.graphicsini.reset() self._graphicsini_setstate() @@ -91,7 +112,7 @@ """ SIGNAL graphicsini_save() """ - #self._notimplemented() + self.emit(SIGNAL("graphicsChanged(bool)"), False) self.urupersonaldir.graphicsini.write() self.setDirty(False) @@ -121,6 +142,7 @@ """ SIGNAL: valueChanged (int) """ + self.emit(SIGNAL("graphicsChanged(bool)"), True) self.urupersonaldir.graphicsini.screenres = idx @signalLogDecorator(LOG) @@ -129,6 +151,7 @@ """ SIGNAL: sliderMoved(int) """ + self.emit(SIGNAL("graphicsChanged(bool)"), True) txt = videoModes.getVidModeHuman(idx) self.lb_screenres.setText(QtCore.QString(txt)) @@ -138,6 +161,7 @@ """ SIGNAL: valueChanged (int) """ + self.emit(SIGNAL("graphicsChanged(bool)"), True) self.urupersonaldir.graphicsini.quality = idx @signalLogDecorator(LOG) @@ -146,6 +170,7 @@ """ SIGNAL: valueChanged (int) """ + self.emit(SIGNAL("graphicsChanged(bool)"), True) self.urupersonaldir.graphicsini.texture = idx @signalLogDecorator(LOG) @@ -154,6 +179,7 @@ """ SIGNAL: valueChanged (int) """ + self.emit(SIGNAL("graphicsChanged(bool)"), True) self.urupersonaldir.graphicsini.antialias = idx @signalLogDecorator(LOG) @@ -162,6 +188,7 @@ """ SIGNAL: valueChanged (int) """ + self.emit(SIGNAL("graphicsChanged(bool)"), True) self.urupersonaldir.graphicsini.anisotropic = idx @signalLogDecorator(LOG) @@ -170,6 +197,7 @@ """ SIGNAL: valueChanged (int) """ + self.emit(SIGNAL("graphicsChanged(bool)"), True) self.urupersonaldir.graphicsini.shadow = idx @signalLogDecorator(LOG) @@ -178,6 +206,7 @@ """ SIGNAL: stateChanged(int) """ + self.emit(SIGNAL("graphicsChanged(bool)"), True) self.urupersonaldir.graphicsini.windowed = state @signalLogDecorator(LOG) @@ -186,6 +215,7 @@ """ SIGNAL: stateChanged(int) """ + self.emit(SIGNAL("graphicsChanged(bool)"), True) self.urupersonaldir.graphicsini.vsync = state @signalLogDecorator(LOG) @@ -194,6 +224,7 @@ """ SIGNAL: stateChanged(int) """ + self.emit(SIGNAL("graphicsChanged(bool)"), True) self.urupersonaldir.graphicsini.shadow_enabled = state # ************************************************************************ @@ -214,12 +245,14 @@ self.trUtf8("""Something bad happend while opening the audio.ini\n%s""" % msg)) return self._audioini_setstate() + self.emit(SIGNAL("audioChanged(bool)"), False) @signalLogDecorator(LOG) def on_audioini_reset(self): """ SIGNAL audioini_reset() """ + self.emit(SIGNAL("audioChanged(bool)"), False) self.urupersonaldir.audioini.reset() self._audioini_setstate() @@ -228,7 +261,7 @@ """ SIGNAL audioini_save() """ - #self._notimplemented() + self.emit(SIGNAL("audioChanged(bool)"), False) self.urupersonaldir.audioini.write() self.setDirty(False) # urks @@ -259,45 +292,54 @@ @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_aud_device_sliderMoved(self, idx): + self.emit(SIGNAL("audioChanged(bool)"), True) txt = self.urupersonaldir.audioini.getDeviceName(idx) self.lb_aud_device.setText(QtCore.QString(txt[1:-1])) @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_aud_npc_valueChanged(self, idx): + self.emit(SIGNAL("audioChanged(bool)"), True) self.urupersonaldir.audioini.npc = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_aud_music_valueChanged(self, idx): + self.emit(SIGNAL("audioChanged(bool)"), True) self.urupersonaldir.audioini.music = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_aud_fx_valueChanged(self, idx): + self.emit(SIGNAL("audioChanged(bool)"), True) self.urupersonaldir.audioini.fx = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_aud_ambience_valueChanged(self, idx): + self.emit(SIGNAL("audioChanged(bool)"), True) self.urupersonaldir.audioini.ambience = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_sl_aud_priority_valueChanged(self, idx): + self.emit(SIGNAL("audioChanged(bool)"), True) self.urupersonaldir.audioini.priority = idx @signalLogDecorator(LOG) @pyqtSignature("int") def on_cb_aud_eax_stateChanged (self, state): + self.emit(SIGNAL("audioChanged(bool)"), True) self.urupersonaldir.audioini.eax = state @signalLogDecorator(LOG) @pyqtSignature("int") def on_cb_aud_mute_stateChanged (self, state): + self.emit(SIGNAL("audioChanged(bool)"), True) self.urupersonaldir.audioini.mute = state @signalLogDecorator(LOG) @pyqtSignature("int") def on_cb_aud_voicechat_stateChanged (self, state): + self.emit(SIGNAL("audioChanged(bool)"), True) self.urupersonaldir.audioini.voicechat = state This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-15 03:13:11
|
Revision: 170 http://pymoul.svn.sourceforge.net/pymoul/?rev=170&view=rev Author: tiran Date: 2007-02-14 19:13:10 -0800 (Wed, 14 Feb 2007) Log Message: ----------- Added D'ni number tab to UI Modified Paths: -------------- pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-15 02:26:43 UTC (rev 169) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-15 03:13:10 UTC (rev 170) @@ -87,6 +87,7 @@ self.urupersonaldir.initializeFactories() # init handlers + self._dninumbers_init() self._timezone_init() self._ping_init() self._systray_init() @@ -336,10 +337,9 @@ mb.exec_() return logzipper = self.urupersonaldr.logzipper - logzipper.setZip(self.radio_ziplogs.isChecked() - # always remove + logzipper.setZip(self.radio_ziplogs.isChecked()) + # always remove: self.radio_deletelogs.isChecked() logzipper.setRemove(True) - #doremove = self.radio_deletelogs.isChecked() # ************************************************************************ # system tray @@ -504,6 +504,50 @@ else: LOG.error("Ping thread is already running") + def _dninumbers_init(self): + # XXX needs better alignment + widget = self.gridLayout_3 + grid = self.gridlayout3 + alignvcr = QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter + for i in range(0, 5): + for j in range(0, 5): + nr = QtGui.QLabel(widget) + nr.setObjectName("lb_dninumber_nr_%02i_%02i" % (i, j)) + nr.setAlignment(alignvcr) + nr.setText(str(i + j*5)) + grid.addWidget(nr, j, i*2) + dni = QtGui.QLabel(widget) + dni.setObjectName("lb_dninumber_%02i_%02i" % (i, j)) + dni_pic = QtGui.QPixmap(":/dninumbers/resources/dninumbers/%02i.png" % (i + j*5)) + #dni_pic.scale(20, 20, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) + dni_pic = dni_pic.scaledToHeight(30, QtCore.Qt.SmoothTransformation) + dni.setPixmap(dni_pic) + grid.addWidget(dni, j, i*2+1) + + nr = QtGui.QLabel(widget) + nr.setObjectName("lb_dninumber_nr_25") + nr.setAlignment(alignvcr) + nr.setText("25") + grid.addWidget(nr, 5, 3) + dni = QtGui.QLabel(widget) + dni.setObjectName("lb_dninumber_25") + dni_pic = QtGui.QPixmap(":/dninumbers/resources/dninumbers/25.png") + dni_pic = dni_pic.scaledToHeight(30, QtCore.Qt.SmoothTransformation) + dni.setPixmap(dni_pic) + grid.addWidget(dni, 5, 4) + + nr = QtGui.QLabel(widget) + nr.setObjectName("lb_dninumber_nr_00c") + nr.setAlignment(alignvcr) + nr.setText("cyclic 0") + grid.addWidget(nr, 5, 5) + dni = QtGui.QLabel(widget) + dni.setObjectName("lb_dninumber_00c") + dni_pic = QtGui.QPixmap(":/dninumbers/resources/dninumbers/00c.png") + dni_pic = dni_pic.scaledToHeight(30, QtCore.Qt.SmoothTransformation) + dni.setPixmap(dni_pic) + grid.addWidget(dni, 5, 6) + class PingServerThread(QtCore.QThread): def __init__(self, parent=None): QtCore.QThread.__init__(self, parent) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-15 02:26:43 UTC (rev 169) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-15 03:13:10 UTC (rev 170) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file './src/moul/qt/ui/mainwindow.ui' # -# Created: Mon Feb 12 20:15:18 2007 +# Created: Thu Feb 15 03:57:16 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -866,6 +866,23 @@ self.tb_journal_view.setOpenExternalLinks(True) self.tb_journal_view.setObjectName("tb_journal_view") self.tabWidget.addTab(self.tab_sub_journals,"") + + self.tab = QtGui.QWidget() + self.tab.setObjectName("tab") + + self.gb_dninumbers = QtGui.QGroupBox(self.tab) + self.gb_dninumbers.setGeometry(QtCore.QRect(10,0,451,371)) + self.gb_dninumbers.setObjectName("gb_dninumbers") + + self.gridLayout_3 = QtGui.QWidget(self.gb_dninumbers) + self.gridLayout_3.setGeometry(QtCore.QRect(10,20,431,341)) + self.gridLayout_3.setObjectName("gridLayout_3") + + self.gridlayout3 = QtGui.QGridLayout(self.gridLayout_3) + self.gridlayout3.setMargin(0) + self.gridlayout3.setSpacing(6) + self.gridlayout3.setObjectName("gridlayout3") + self.tabWidget.addTab(self.tab,"") self.tabwidget.addTab(self.tab_browse,"") self.tab_about = QtGui.QWidget() @@ -913,9 +930,9 @@ self.lb_doc_status.setBuddy(self.pb_doc_loadjournals) self.retranslateUi(MainWindow) - self.tabwidget.setCurrentIndex(0) + self.tabwidget.setCurrentIndex(3) self.tab_sub_settings.setCurrentIndex(0) - self.tabWidget.setCurrentIndex(0) + self.tabWidget.setCurrentIndex(2) self.tabwidget_about.setCurrentIndex(0) QtCore.QObject.connect(self.main_buttonbox,QtCore.SIGNAL("rejected()"),MainWindow.close) QtCore.QMetaObject.connectSlotsByName(MainWindow) @@ -926,9 +943,9 @@ self.lb_log_archive.setText(QtGui.QApplication.translate("MainWindow", "Archive chatlogs and zip log files", None, QtGui.QApplication.UnicodeUTF8)) self.pb_log_remove.setText(QtGui.QApplication.translate("MainWindow", "Remove", None, QtGui.QApplication.UnicodeUTF8)) self.pb_log_archive.setText(QtGui.QApplication.translate("MainWindow", "Archive", None, QtGui.QApplication.UnicodeUTF8)) - self.radio_ziplogs.setText(QtGui.QApplication.translate("MainWindow", "Zip debug logs", None, QtGui.QApplication.UnicodeUTF8)) + self.radio_ziplogs.setText(QtGui.QApplication.translate("MainWindow", "Zip and delete debug logs", None, QtGui.QApplication.UnicodeUTF8)) self.radio_deletelogs.setText(QtGui.QApplication.translate("MainWindow", "Delete debug logs", None, QtGui.QApplication.UnicodeUTF8)) - self.lb_log_remove.setText(QtGui.QApplication.translate("MainWindow", "Remove zipped logs", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_log_remove.setText(QtGui.QApplication.translate("MainWindow", "Remove all zipped logs", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_2.setTitle(QtGui.QApplication.translate("MainWindow", "KI Image repair", None, QtGui.QApplication.UnicodeUTF8)) self.pb_kiimage_repair.setText(QtGui.QApplication.translate("MainWindow", "Repair", None, QtGui.QApplication.UnicodeUTF8)) self.pb_kiimage_repair1.setText(QtGui.QApplication.translate("MainWindow", "Fix KI and avatar images", None, QtGui.QApplication.UnicodeUTF8)) @@ -996,6 +1013,8 @@ self.pb_doc_loadjournals.setText(QtGui.QApplication.translate("MainWindow", "Load journals", None, QtGui.QApplication.UnicodeUTF8)) self.lb_doc_status.setText(QtGui.QApplication.translate("MainWindow", "TextLabel", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_sub_journals), QtGui.QApplication.translate("MainWindow", "Journals", None, QtGui.QApplication.UnicodeUTF8)) + self.gb_dninumbers.setTitle(QtGui.QApplication.translate("MainWindow", "D\'ni Numbers", None, QtGui.QApplication.UnicodeUTF8)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("MainWindow", "D\'ni Numbers", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_browse), QtGui.QApplication.translate("MainWindow", "Browse", None, QtGui.QApplication.UnicodeUTF8)) self.tb_abouttext.setHtml(QtGui.QApplication.translate("MainWindow", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-02-15 02:26:43 UTC (rev 169) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-02-15 03:13:10 UTC (rev 170) @@ -110,7 +110,7 @@ <enum>QTabWidget::North</enum> </property> <property name="currentIndex" > - <number>0</number> + <number>3</number> </property> <widget class="QWidget" name="tab_tasks" > <attribute name="title" > @@ -1648,7 +1648,7 @@ </rect> </property> <property name="currentIndex" > - <number>0</number> + <number>2</number> </property> <widget class="QWidget" name="tab_sub_chatlogs" > <attribute name="title" > @@ -1870,6 +1870,42 @@ </widget> </widget> </widget> + <widget class="QWidget" name="tab" > + <attribute name="title" > + <string>D'ni Numbers</string> + </attribute> + <widget class="QGroupBox" name="gb_dninumbers" > + <property name="geometry" > + <rect> + <x>10</x> + <y>0</y> + <width>451</width> + <height>371</height> + </rect> + </property> + <property name="title" > + <string>D'ni Numbers</string> + </property> + <widget class="QWidget" name="gridLayout_3" > + <property name="geometry" > + <rect> + <x>10</x> + <y>20</y> + <width>431</width> + <height>341</height> + </rect> + </property> + <layout class="QGridLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + </layout> + </widget> + </widget> + </widget> </widget> </widget> <widget class="QWidget" name="tab_about" > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-15 12:30:31
|
Revision: 172 http://pymoul.svn.sourceforge.net/pymoul/?rev=172&view=rev Author: tiran Date: 2007-02-15 04:30:31 -0800 (Thu, 15 Feb 2007) Log Message: ----------- Much better alignement of D'ni numbers Modified Paths: -------------- pymoul/trunk/src/moul/qt/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-15 03:14:42 UTC (rev 171) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-15 12:30:31 UTC (rev 172) @@ -505,48 +505,51 @@ LOG.error("Ping thread is already running") def _dninumbers_init(self): - # XXX needs better alignment widget = self.gridLayout_3 grid = self.gridlayout3 - alignvcr = QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter + alignl = QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter + alignc = QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter for i in range(0, 5): for j in range(0, 5): nr = QtGui.QLabel(widget) nr.setObjectName("lb_dninumber_nr_%02i_%02i" % (i, j)) - nr.setAlignment(alignvcr) + nr.setAlignment(alignc) nr.setText(str(i + j*5)) grid.addWidget(nr, j, i*2) - dni = QtGui.QLabel(widget) - dni.setObjectName("lb_dninumber_%02i_%02i" % (i, j)) dni_pic = QtGui.QPixmap(":/dninumbers/resources/dninumbers/%02i.png" % (i + j*5)) #dni_pic.scale(20, 20, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) dni_pic = dni_pic.scaledToHeight(30, QtCore.Qt.SmoothTransformation) + dni = QtGui.QLabel(widget) + dni.setObjectName("lb_dninumber_%02i_%02i" % (i, j)) dni.setPixmap(dni_pic) + dni.setAlignment(alignl) grid.addWidget(dni, j, i*2+1) nr = QtGui.QLabel(widget) nr.setObjectName("lb_dninumber_nr_25") - nr.setAlignment(alignvcr) + nr.setAlignment(alignc) nr.setText("25") - grid.addWidget(nr, 5, 3) + grid.addWidget(nr, 5, 2) + dni_pic = QtGui.QPixmap(":/dninumbers/resources/dninumbers/25.png") + dni_pic = dni_pic.scaledToHeight(30, QtCore.Qt.SmoothTransformation) dni = QtGui.QLabel(widget) dni.setObjectName("lb_dninumber_25") - dni_pic = QtGui.QPixmap(":/dninumbers/resources/dninumbers/25.png") - dni_pic = dni_pic.scaledToHeight(30, QtCore.Qt.SmoothTransformation) + dni.setAlignment(alignl) dni.setPixmap(dni_pic) - grid.addWidget(dni, 5, 4) + grid.addWidget(dni, 5, 3) nr = QtGui.QLabel(widget) nr.setObjectName("lb_dninumber_nr_00c") - nr.setAlignment(alignvcr) + nr.setAlignment(alignc) nr.setText("cyclic 0") - grid.addWidget(nr, 5, 5) + grid.addWidget(nr, 5, 5, 1, 2) + dni_pic = QtGui.QPixmap(":/dninumbers/resources/dninumbers/00c.png") + dni_pic = dni_pic.scaledToHeight(30, QtCore.Qt.SmoothTransformation) dni = QtGui.QLabel(widget) dni.setObjectName("lb_dninumber_00c") - dni_pic = QtGui.QPixmap(":/dninumbers/resources/dninumbers/00c.png") - dni_pic = dni_pic.scaledToHeight(30, QtCore.Qt.SmoothTransformation) + dni.setAlignment(alignl) dni.setPixmap(dni_pic) - grid.addWidget(dni, 5, 6) + grid.addWidget(dni, 5, 7) class PingServerThread(QtCore.QThread): def __init__(self, parent=None): Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-15 03:14:42 UTC (rev 171) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-15 12:30:31 UTC (rev 172) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file './src/moul/qt/ui/mainwindow.ui' # -# Created: Thu Feb 15 03:57:16 2007 +# Created: Thu Feb 15 13:28:03 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -875,7 +875,7 @@ self.gb_dninumbers.setObjectName("gb_dninumbers") self.gridLayout_3 = QtGui.QWidget(self.gb_dninumbers) - self.gridLayout_3.setGeometry(QtCore.QRect(10,20,431,341)) + self.gridLayout_3.setGeometry(QtCore.QRect(10,20,411,341)) self.gridLayout_3.setObjectName("gridLayout_3") self.gridlayout3 = QtGui.QGridLayout(self.gridLayout_3) @@ -930,9 +930,9 @@ self.lb_doc_status.setBuddy(self.pb_doc_loadjournals) self.retranslateUi(MainWindow) - self.tabwidget.setCurrentIndex(3) + self.tabwidget.setCurrentIndex(0) self.tab_sub_settings.setCurrentIndex(0) - self.tabWidget.setCurrentIndex(2) + self.tabWidget.setCurrentIndex(0) self.tabwidget_about.setCurrentIndex(0) QtCore.QObject.connect(self.main_buttonbox,QtCore.SIGNAL("rejected()"),MainWindow.close) QtCore.QMetaObject.connectSlotsByName(MainWindow) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-02-15 03:14:42 UTC (rev 171) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-02-15 12:30:31 UTC (rev 172) @@ -110,7 +110,7 @@ <enum>QTabWidget::North</enum> </property> <property name="currentIndex" > - <number>3</number> + <number>0</number> </property> <widget class="QWidget" name="tab_tasks" > <attribute name="title" > @@ -1648,7 +1648,7 @@ </rect> </property> <property name="currentIndex" > - <number>2</number> + <number>0</number> </property> <widget class="QWidget" name="tab_sub_chatlogs" > <attribute name="title" > @@ -1891,7 +1891,7 @@ <rect> <x>10</x> <y>20</y> - <width>431</width> + <width>411</width> <height>341</height> </rect> </property> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-15 18:18:46
|
Revision: 173 http://pymoul.svn.sourceforge.net/pymoul/?rev=173&view=rev Author: tiran Date: 2007-02-15 10:18:46 -0800 (Thu, 15 Feb 2007) Log Message: ----------- Added Dni number stuff for Qt Modified Paths: -------------- pymoul/trunk/src/moul/qt/mainwindow.py Added Paths: ----------- pymoul/trunk/src/moul/qt/dninumbers.py Added: pymoul/trunk/src/moul/qt/dninumbers.py =================================================================== --- pymoul/trunk/src/moul/qt/dninumbers.py (rev 0) +++ pymoul/trunk/src/moul/qt/dninumbers.py 2007-02-15 18:18:46 UTC (rev 173) @@ -0,0 +1,180 @@ +# pyMoul - Python interface to Myst Online URU Live +# Copyright (C) 2007 Christian Heimes <christian (at) cheimes (dot) de> + +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., 59 +# Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +"""Moul QT D'ni Number renderer +""" +__author__ = "Christian Heimes" +__version__ = "$Id: wdysini.py 144 2007-02-06 03:51:21Z tiran $" +__revision__ = "$Revision: 144 $" + +import sys +from PyQt4 import QtCore +from PyQt4 import QtGui +from PyQt4.QtCore import Qt +from PyQt4.QtCore import SIGNAL +from PyQt4.QtCore import pyqtSignature + +from moul.qt.utils import QNamespaceContainer +from moul.qt.utils import QSignalLoggerMetaclass +from moul.qt.utils import questionMB +from moul.qt.utils import criticalMB + + +class QDniNumbers(object): + """Qt D'ni Number helper class + + Lookup and scale pixmaps for D'ni numbers + """ + def __init__(self): + self.pixmaps = {} + for i in range(0, 26): + self.pixmaps[i] = QtGui.QPixmap( + ":/dninumbers/resources/dninumbers/%02i.png" % i) + self.pixmaps['cyclic'] = QtGui.QPixmap( + ":/dninumbers/resources/dninumbers/00c.png") + # w, h = 67, 55 + self._rectleft = QtCore.QRect(0, 0, 60, 55) # with right border + self._rectright = QtCore.QRect(12, 0, 55, 55) # w/o left border + self._rectmiddle = QtCore.QRect(12, 0, 49, 55) # right line + + @staticmethod + def _scale(pixmap, height=None): + """Scale a pixmap to height + """ + if height is not None: + return pixmap.scaledToHeight(height, QtCore.Qt.SmoothTransformation) + else: + return pixmap + + def get(self, nr, height=None): + """Get pixmap by number and scale it + + @param nr: number (0-25, 'cyclic') + @type nr: int or str + @param height: scale pixmap to height + @param height: int or None for default size + @return: (scaled) pixmap + @rtype: QPixmap instance + """ + try: + nr = int(nr) + except ValueError: + pass + pixmap = self.pixmaps[nr] + return self._scale(pixmap, height) + + def getLeft(self, nr, height=None): + """Get pixmap for left digit of combined number + + @param nr: number (0-25, 'cyclic') + @type nr: int or str + @param height: scale pixmap to height + @param height: int or None for default size + @return: (scaled) pixmap + @rtype: QPixmap instance + """ + pixmap = self.get(nr).copy(self._rectleft) + return self._scale(pixmap, height) + + def getRight(self, nr, height=None): + """Get pixmap for right digit of combined number + + @param nr: number (0-25, 'cyclic') + @type nr: int or str + @param height: scale pixmap to height + @param height: int or None for default size + @return: (scaled) pixmap + @rtype: QPixmap instance + """ + pixmap = self.get(nr).copy(self._rectright) + return self._scale(pixmap, height) + + def getMiddle(self, nr, heigh=None): + """Get pixmap for middle digit of combined number + + @param nr: number (0-25, 'cyclic') + @type nr: int or str + @param height: scale pixmap to height + @param height: int or None for default size + @return: (scaled) pixmap + @rtype: QPixmap instance + """ + pixmap = self.get(nr).copy(self._rectmiddle) + return self._scale(pixmap, height) + +class QDniNumberWidget(QtGui.QWidget): + """Q D'ni number widget + + Displays combined number + """ + def __init__(self, parent): + QtGui.QWidget.__init__(self, parent) + self.dni = None + self.height = None + self.numbers = () + + def setDniNumbers(self, dninumbers): + """Set D'ni number instance + """ + if not isinstance(dninumbers, QDniNumbers): + raise TypeError(type(dninumbers)) + self.dni = dninumbers + + def setHeight(self, height=None): + """Set height to scale + """ + self.height=height + + def setNumbers(self, *args): + """Set numbers to display + """ + valid = tuple(range(0, 26)) + ('cyclic',) + for number in args: + if not isinstance(number, int): + raise TypeError(number) + if number not in valid: + raise ValueError(number) + self.numbers = args + self._pmleft = self.dni.getLeft(self.numbers[0], height=self.height) + self._pmright = self.dni.getRight(self.numbers[-1], height=self.height) + self._pmmiddle = [self.dni.getMiddle(nr, height=self.height) + for nr in self.numbers[1:-1]] + if self._pmmiddle: + raise NotImplementedError + else: + middlewidth = 0 + self.width = self._pmleft.width() + self._pmright.width() + middlewidth + self.setMinimumSize(self.width, self.height) + self.setMaximumSize(self.width, self.height) + self.resize(self.width, self.height) + + def paintEvent(self, event): + """Render and paint numbers + """ + painter = QtGui.QPainter() + painter.begin(self) + #rect = painter.viewport() + #size = QtCore.QSize(width, height) + #size.scale(rect.size(), QtCore.Qt.KeepAspectRatio) + #painter.setViewport(0, 0, size.width(), size.height()) + #painter.setWindow(self.parent().rect()) + + # left + painter.drawPixmap(0, 0, self._pmleft) + painter.drawPixmap(self.width-self._pmright.width(), 0, self._pmright) + painter.end() Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-15 12:30:31 UTC (rev 172) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-02-15 18:18:46 UTC (rev 173) @@ -52,6 +52,8 @@ from moul.qt.threadlet import Threadlet from moul.qt.ui.mainwindow import Ui_MainWindow from moul.qt import utils as qtutils +from moul.qt.dninumbers import QDniNumbers +from moul.qt.dninumbers import QDniNumberWidget LOG = getLogger('moul.qt') @@ -505,6 +507,8 @@ LOG.error("Ping thread is already running") def _dninumbers_init(self): + self._dninumbers = QDniNumbers() + height = 25 widget = self.gridLayout_3 grid = self.gridlayout3 alignl = QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter @@ -516,9 +520,7 @@ nr.setAlignment(alignc) nr.setText(str(i + j*5)) grid.addWidget(nr, j, i*2) - dni_pic = QtGui.QPixmap(":/dninumbers/resources/dninumbers/%02i.png" % (i + j*5)) - #dni_pic.scale(20, 20, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) - dni_pic = dni_pic.scaledToHeight(30, QtCore.Qt.SmoothTransformation) + dni_pic = self._dninumbers.get(i + j*5, height=height) dni = QtGui.QLabel(widget) dni.setObjectName("lb_dninumber_%02i_%02i" % (i, j)) dni.setPixmap(dni_pic) @@ -530,8 +532,7 @@ nr.setAlignment(alignc) nr.setText("25") grid.addWidget(nr, 5, 2) - dni_pic = QtGui.QPixmap(":/dninumbers/resources/dninumbers/25.png") - dni_pic = dni_pic.scaledToHeight(30, QtCore.Qt.SmoothTransformation) + dni_pic = self._dninumbers.get(25, height=height) dni = QtGui.QLabel(widget) dni.setObjectName("lb_dninumber_25") dni.setAlignment(alignl) @@ -541,16 +542,22 @@ nr = QtGui.QLabel(widget) nr.setObjectName("lb_dninumber_nr_00c") nr.setAlignment(alignc) - nr.setText("cyclic 0") + nr.setText(self.trUtf8("cyclic 0")) grid.addWidget(nr, 5, 5, 1, 2) - dni_pic = QtGui.QPixmap(":/dninumbers/resources/dninumbers/00c.png") - dni_pic = dni_pic.scaledToHeight(30, QtCore.Qt.SmoothTransformation) + dni_pic = self._dninumbers.get("cyclic", height=height) dni = QtGui.QLabel(widget) dni.setObjectName("lb_dninumber_00c") dni.setAlignment(alignl) dni.setPixmap(dni_pic) grid.addWidget(dni, 5, 7) + dnipix = QDniNumberWidget(widget) + dnipix.setDniNumbers(self._dninumbers) + dnipix.setHeight(25) + dnipix.setNumbers(5, 24) + dnipix.setObjectName("dnw_dninumber_test") + grid.addWidget(dnipix, 5, 8, 1, 2) + class PingServerThread(QtCore.QThread): def __init__(self, parent=None): QtCore.QThread.__init__(self, parent) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ti...@us...> - 2007-02-26 17:36:54
|
Revision: 196 http://pymoul.svn.sourceforge.net/pymoul/?rev=196&view=rev Author: tiran Date: 2007-02-26 09:36:53 -0800 (Mon, 26 Feb 2007) Log Message: ----------- Use own grid layout for D'ni numbers Modified Paths: -------------- pymoul/trunk/src/moul/qt/dninumbers.py pymoul/trunk/src/moul/qt/ui/mainwindow.py pymoul/trunk/src/moul/qt/ui/mainwindow.ui Modified: pymoul/trunk/src/moul/qt/dninumbers.py =================================================================== --- pymoul/trunk/src/moul/qt/dninumbers.py 2007-02-26 17:33:11 UTC (rev 195) +++ pymoul/trunk/src/moul/qt/dninumbers.py 2007-02-26 17:36:53 UTC (rev 196) @@ -193,6 +193,16 @@ if self.rb_earthtime.isChecked(): self.update_earthtime() + @pyqtSignature("int") + def on_cb_earthtime_tz_currentIndeChanged(self, idx): + if idx == 0: + spec = Qt.LoalTime + elif idx == 1: + spec = Qt.UTC + else: + raise ValueError(idx) + #self.dte_earthtime.setTimeSpec(spec) + def update_dni(self): """Update view from D'ni time widgets """ @@ -237,10 +247,17 @@ self.sb_prorahn.setValue(dnitime.prorahn) def setup_dninumbers(self): - # may change! - widget = self.context.gridLayout_3 - grid = self.context.gridlayout3 + widget = QtGui.QWidget(self.gb_dninumbers) + widget.setGeometry(QtCore.QRect(10,20,411,341)) + widget.setObjectName("gridLayoutWidget_Dninumbers") + self.context.glw_dninumbers = widget + grid = QtGui.QGridLayout(widget) + grid.setMargin(0) + grid.setSpacing(6) + grid.setObjectName("gridLayout_Dninumbers") + self.context.gl_dninumbers = grid + alignl = QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter alignc = QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter for i in range(0, 5): Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-26 17:33:11 UTC (rev 195) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-02-26 17:36:53 UTC (rev 196) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file './src/moul/qt/ui/mainwindow.ui' # -# Created: Sat Feb 24 20:39:41 2007 +# Created: Mon Feb 26 18:31:00 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -44,6 +44,12 @@ spacerItem1 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) self.hboxlayout.addItem(spacerItem1) + self.main_buttonbox = QtGui.QDialogButtonBox(self.centralwidget) + self.main_buttonbox.setGeometry(QtCore.QRect(10,520,451,32)) + self.main_buttonbox.setOrientation(QtCore.Qt.Horizontal) + self.main_buttonbox.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Reset|QtGui.QDialogButtonBox.Save) + self.main_buttonbox.setObjectName("main_buttonbox") + self.tabwidget = QtGui.QTabWidget(self.centralwidget) self.tabwidget.setGeometry(QtCore.QRect(0,80,471,434)) self.tabwidget.setTabPosition(QtGui.QTabWidget.North) @@ -769,7 +775,7 @@ self.groupBox_3.setObjectName("groupBox_3") self.gridLayout_5 = QtGui.QWidget(self.groupBox_3) - self.gridLayout_5.setGeometry(QtCore.QRect(10,20,451,138)) + self.gridLayout_5.setGeometry(QtCore.QRect(10,20,436,138)) self.gridLayout_5.setObjectName("gridLayout_5") self.gridlayout2 = QtGui.QGridLayout(self.gridLayout_5) @@ -861,9 +867,9 @@ self.hboxlayout11.setObjectName("hboxlayout11") self.sb_fahrah = QtGui.QSpinBox(self.gridLayout_5) - self.sb_fahrah.setMaximumSize(QtCore.QSize(46,16777215)) - self.sb_fahrah.setMaximum(15) - self.sb_fahrah.setMinimum(1) + self.sb_fahrah.setMaximumSize(QtCore.QSize(44,16777215)) + self.sb_fahrah.setMaximum(18) + self.sb_fahrah.setMinimum(11) self.sb_fahrah.setProperty("value",QtCore.QVariant(15)) self.sb_fahrah.setObjectName("sb_fahrah") self.hboxlayout11.addWidget(self.sb_fahrah) @@ -881,8 +887,10 @@ self.hboxlayout11.addWidget(self.label_12) self.sb_hahr = QtGui.QSpinBox(self.gridLayout_5) + self.sb_hahr.setMinimumSize(QtCore.QSize(60,0)) self.sb_hahr.setButtonSymbols(QtGui.QAbstractSpinBox.UpDownArrows) - self.sb_hahr.setMaximum(9999) + self.sb_hahr.setMaximum(17654) + self.sb_hahr.setMinimum(7657) self.sb_hahr.setProperty("value",QtCore.QVariant(9662)) self.sb_hahr.setObjectName("sb_hahr") self.hboxlayout11.addWidget(self.sb_hahr) @@ -899,7 +907,7 @@ self.hboxlayout11.addWidget(self.cb_vailee) self.sb_yahr = QtGui.QSpinBox(self.gridLayout_5) - self.sb_yahr.setMaximumSize(QtCore.QSize(46,16777215)) + self.sb_yahr.setMaximumSize(QtCore.QSize(44,16777215)) self.sb_yahr.setMaximum(29) self.sb_yahr.setMinimum(1) self.sb_yahr.setProperty("value",QtCore.QVariant(29)) @@ -916,6 +924,7 @@ self.hboxlayout12.setObjectName("hboxlayout12") self.dte_earthtime = QtGui.QDateTimeEdit(self.gridLayout_5) + self.dte_earthtime.setMinimumDate(QtCore.QDate(1752,9,14)) self.dte_earthtime.setCalendarPopup(True) self.dte_earthtime.setObjectName("dte_earthtime") self.hboxlayout12.addWidget(self.dte_earthtime) @@ -1055,15 +1064,6 @@ self.gb_dninumbers = QtGui.QGroupBox(self.tab) self.gb_dninumbers.setGeometry(QtCore.QRect(10,0,451,371)) self.gb_dninumbers.setObjectName("gb_dninumbers") - - self.gridLayout_3 = QtGui.QWidget(self.gb_dninumbers) - self.gridLayout_3.setGeometry(QtCore.QRect(10,20,411,341)) - self.gridLayout_3.setObjectName("gridLayout_3") - - self.gridlayout4 = QtGui.QGridLayout(self.gridLayout_3) - self.gridlayout4.setMargin(0) - self.gridlayout4.setSpacing(6) - self.gridlayout4.setObjectName("gridlayout4") self.tabWidget.addTab(self.tab,"") self.tabwidget.addTab(self.tab_browse,"") @@ -1095,12 +1095,6 @@ self.tb_license.setObjectName("tb_license") self.tabwidget_about.addTab(self.tab_sub_license,"") self.tabwidget.addTab(self.tab_about,"") - - self.main_buttonbox = QtGui.QDialogButtonBox(self.centralwidget) - self.main_buttonbox.setGeometry(QtCore.QRect(10,520,451,32)) - self.main_buttonbox.setOrientation(QtCore.Qt.Horizontal) - self.main_buttonbox.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Reset|QtGui.QDialogButtonBox.Save) - self.main_buttonbox.setObjectName("main_buttonbox") MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtGui.QStatusBar(MainWindow) @@ -1112,9 +1106,9 @@ self.lb_doc_status.setBuddy(self.pb_doc_loadjournals) self.retranslateUi(MainWindow) - self.tabwidget.setCurrentIndex(2) + self.tabwidget.setCurrentIndex(0) self.tab_sub_settings.setCurrentIndex(0) - self.tabWidget.setCurrentIndex(0) + self.tabWidget.setCurrentIndex(2) self.tabwidget_about.setCurrentIndex(0) QtCore.QObject.connect(self.main_buttonbox,QtCore.SIGNAL("rejected()"),MainWindow.close) QtCore.QMetaObject.connectSlotsByName(MainWindow) @@ -1205,7 +1199,6 @@ self.label_12.setText(QtGui.QApplication.translate("MainWindow", "/", None, QtGui.QApplication.UnicodeUTF8)) self.cb_vailee.addItem(QtGui.QApplication.translate("MainWindow", "8 Leevosahn", None, QtGui.QApplication.UnicodeUTF8)) self.cb_earthtime_tz.addItem(QtGui.QApplication.translate("MainWindow", "local time", None, QtGui.QApplication.UnicodeUTF8)) - self.cb_earthtime_tz.addItem(QtGui.QApplication.translate("MainWindow", "cavern time", None, QtGui.QApplication.UnicodeUTF8)) self.cb_earthtime_tz.addItem(QtGui.QApplication.translate("MainWindow", "UTC", None, QtGui.QApplication.UnicodeUTF8)) self.rb_dnitime.setText(QtGui.QApplication.translate("MainWindow", "D\'ni Time", None, QtGui.QApplication.UnicodeUTF8)) self.tabwidget.setTabText(self.tabwidget.indexOf(self.tab_time), QtGui.QApplication.translate("MainWindow", "Time", None, QtGui.QApplication.UnicodeUTF8)) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-02-26 17:33:11 UTC (rev 195) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-02-26 17:36:53 UTC (rev 196) @@ -97,6 +97,22 @@ </item> </layout> </widget> + <widget class="QDialogButtonBox" name="main_buttonbox" > + <property name="geometry" > + <rect> + <x>10</x> + <y>520</y> + <width>451</width> + <height>32</height> + </rect> + </property> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons" > + <set>QDialogButtonBox::Close|QDialogButtonBox::NoButton|QDialogButtonBox::Reset|QDialogButtonBox::Save</set> + </property> + </widget> <widget class="QTabWidget" name="tabwidget" > <property name="geometry" > <rect> @@ -110,7 +126,7 @@ <enum>QTabWidget::North</enum> </property> <property name="currentIndex" > - <number>2</number> + <number>0</number> </property> <widget class="QWidget" name="tab_tasks" > <attribute name="title" > @@ -1672,7 +1688,7 @@ <rect> <x>10</x> <y>20</y> - <width>451</width> + <width>436</width> <height>138</height> </rect> </property> @@ -1857,15 +1873,15 @@ <widget class="QSpinBox" name="sb_fahrah" > <property name="maximumSize" > <size> - <width>46</width> + <width>44</width> <height>16777215</height> </size> </property> <property name="maximum" > - <number>15</number> + <number>18</number> </property> <property name="minimum" > - <number>1</number> + <number>11</number> </property> <property name="value" > <number>15</number> @@ -1900,12 +1916,21 @@ </item> <item> <widget class="QSpinBox" name="sb_hahr" > + <property name="minimumSize" > + <size> + <width>60</width> + <height>0</height> + </size> + </property> <property name="buttonSymbols" > <enum>QAbstractSpinBox::UpDownArrows</enum> </property> <property name="maximum" > - <number>9999</number> + <number>17654</number> </property> + <property name="minimum" > + <number>7657</number> + </property> <property name="value" > <number>9662</number> </property> @@ -1938,7 +1963,7 @@ <widget class="QSpinBox" name="sb_yahr" > <property name="maximumSize" > <size> - <width>46</width> + <width>44</width> <height>16777215</height> </size> </property> @@ -1978,6 +2003,13 @@ </property> <item> <widget class="QDateTimeEdit" name="dte_earthtime" > + <property name="minimumDate" > + <date> + <year>1752</year> + <month>9</month> + <day>14</day> + </date> + </property> <property name="calendarPopup" > <bool>true</bool> </property> @@ -2006,11 +2038,6 @@ </item> <item> <property name="text" > - <string>cavern time</string> - </property> - </item> - <item> - <property name="text" > <string>UTC</string> </property> </item> @@ -2056,7 +2083,7 @@ </rect> </property> <property name="currentIndex" > - <number>0</number> + <number>2</number> </property> <widget class="QWidget" name="tab_sub_chatlogs" > <attribute name="title" > @@ -2294,24 +2321,6 @@ <property name="title" > <string>D'ni Numbers</string> </property> - <widget class="QWidget" name="gridLayout_3" > - <property name="geometry" > - <rect> - <x>10</x> - <y>20</y> - <width>411</width> - <height>341</height> - </rect> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - </layout> - </widget> </widget> </widget> </widget> @@ -2392,22 +2401,6 @@ </widget> </widget> </widget> - <widget class="QDialogButtonBox" name="main_buttonbox" > - <property name="geometry" > - <rect> - <x>10</x> - <y>520</y> - <width>451</width> - <height>32</height> - </rect> - </property> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons" > - <set>QDialogButtonBox::Close|QDialogButtonBox::NoButton|QDialogButtonBox::Reset|QDialogButtonBox::Save</set> - </property> - </widget> </widget> <widget class="QStatusBar" name="statusbar" /> </widget> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |