[Pymoul-svn] SF.net SVN: pymoul: [266] pymoul/trunk/src/moul
Status: Alpha
Brought to you by:
tiran
From: <ti...@us...> - 2007-03-19 16:39:56
|
Revision: 266 http://pymoul.svn.sourceforge.net/pymoul/?rev=266&view=rev Author: tiran Date: 2007-03-19 06:35:53 -0700 (Mon, 19 Mar 2007) Log Message: ----------- Corrected some paths (Linux and Mac) Adjusted font sizes of table items Modified Paths: -------------- pymoul/trunk/src/moul/osdependent/darwin/__init__.py pymoul/trunk/src/moul/osdependent/linux/__init__.py 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/osdependent/darwin/__init__.py =================================================================== --- pymoul/trunk/src/moul/osdependent/darwin/__init__.py 2007-03-19 09:19:33 UTC (rev 265) +++ pymoul/trunk/src/moul/osdependent/darwin/__init__.py 2007-03-19 13:35:53 UTC (rev 266) @@ -31,7 +31,7 @@ LOG.critical('Darwin/Mac support is not tested') HOME = os.path.expanduser('~') -MOUL_DIR = "Library/Preferences/UruLive Preferences/p_drive/My Documents/Uru Live" +MOUL_DIR = "%s/Library/Preferences/UruLive/Preferences/p_drive/My Documents/Uru Live" % HOME APP_PATH = "Uru Live.app/Contents/Resources/Game.app/Contents/Resources/transgaming/c_drive/Program Files/Uru Live/" APP_NAME = "Uru Live.app" EXEC_NAME = "???" # XXX @@ -40,7 +40,7 @@ "/Applications", "%s/Applications" % HOME, ] -PYMOUL_DIR = "Library/Preferences/pyMoul" +PYMOUL_DIR = "%s/Library/Preferences/pyMoul" % HOME def getMoulUserDataDir(): """Get path of MOUL data directory @@ -48,12 +48,12 @@ The MOUL data directory contains log files, chatlogs, KI images and many more things. """ - return os.path.join(HOME, MOUL_DIR) + return MOUL_DIR def getPyMoulDataDir(): """Get path to the pyMoul ini directory """ - return os.path.join(HOME, PYMOUL_DIR) + return HOME, PYMOUL_DIR def getMoulInstallDir(): """Get path to MOUL install dir Modified: pymoul/trunk/src/moul/osdependent/linux/__init__.py =================================================================== --- pymoul/trunk/src/moul/osdependent/linux/__init__.py 2007-03-19 09:19:33 UTC (rev 265) +++ pymoul/trunk/src/moul/osdependent/linux/__init__.py 2007-03-19 13:35:53 UTC (rev 266) @@ -31,7 +31,7 @@ LOG.critical('Linux support is not tested') HOME = os.path.expanduser('~') -MOUL_DIR = ".urulive" +MOUL_DIR = "%s/.urulive" % HOME INI_FILE = ('pyMoul', 'pymoul.ini') EXEC_NAME = "UruLauncher" PROCESSES = ('urulauncher', 'uruexplorer') @@ -40,7 +40,7 @@ "/media/d/games/MystOnline", "/usr/local/games/MystOnline" ] -PYMOUL_DIR = '.pymoul' +PYMOUL_DIR = '%s/.pymoul' % HOME def getMoulUserDataDir(): """Get path of MOUL data directory @@ -48,12 +48,12 @@ The MOUL data directory contains log files, chatlogs, KI images and many more things. """ - return os.path.join(HOME, MOUL_DIR) + return MOUL_DIR def getPyMoulDataDir(): """Get path to the pyMoul ini directory """ - return os.path.join(HOME, PYMOUL_DIR) + return PYMOUL_DIR def getMoulInstallDir(): """Get path to MOUL install dir Modified: pymoul/trunk/src/moul/qt/dninumbers.py =================================================================== --- pymoul/trunk/src/moul/qt/dninumbers.py 2007-03-19 09:19:33 UTC (rev 265) +++ pymoul/trunk/src/moul/qt/dninumbers.py 2007-03-19 13:35:53 UTC (rev 266) @@ -131,7 +131,7 @@ self.minute_timer.emit(SIGNAL('timeout()')) def _fmtdate(self, dt, spec=Qt.LocalTime): - fmt = self.trUtf8("MMM dd, hh:mm:ss") + fmt = self.trUtf8("MM/dd hh:mm") qdt = QtCore.QDateTime(dt).toTimeSpec(spec) return qdt.toString(fmt) @@ -149,17 +149,17 @@ tw.setRowCount(rows) proto = QtGui.QTableWidgetItem() - #font = QtGui.QFont() - #font.setPointSize(7) - #proto.setFont(font) + font = QtGui.QFont() + font.setPointSize(9) + proto.setFont(font) proto.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter) - header = QtGui.QTableWidgetItem() - header.setSizeHint(QtCore.QSize(0,0)) for n, midnight, dawn, dusk in iter(eg): if n > rows: break - tw.setVerticalHeaderItem(n, QtGui.QTableWidgetItem(header)) + #header = QtGui.QTableWidgetItem() + #header.setSizeHint(QtCore.QSize(0,0)) + #tw.setVerticalHeaderItem(n, header) for i, dt in enumerate((midnight, dawn, dusk)): item = QtGui.QTableWidgetItem(proto) item.setText(self._fmtdate(dt)) @@ -188,15 +188,14 @@ tw.setColumnCount(cols) proto = QtGui.QTableWidgetItem() - #font = QtGui.QFont() - #font.setPointSize(7) - #proto.setFont(font) + font = QtGui.QFont() + font.setPointSize(9) + proto.setFont(font) proto.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter) - for n in range(rows): - h = QtGui.QTableWidgetItem() - h.setSizeHint(QtCore.QSize(0,0)) - tw.setVerticalHeaderItem(n, h) + #for n in range(rows): + # tw.setVerticalHeaderItem(n, QtGui.QTableWidgetItem()) + # tw.verticalHeaderItem(n).setSizeHint(QtCore.QSize(0, 0)) for i, name in enumerate(listPodAges()): pat = PodAgeTime(name) Modified: pymoul/trunk/src/moul/qt/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/mainwindow.py 2007-03-19 09:19:33 UTC (rev 265) +++ pymoul/trunk/src/moul/qt/mainwindow.py 2007-03-19 13:35:53 UTC (rev 266) @@ -184,13 +184,13 @@ def handleDirtyOnClose(self): """ Handle dirty status on close - + @return: Accept event? @rtype: bool """ if not self.isDirty(): return True - + mb = qtutils.saveMB( self, self.trUtf8("Unsaved changes!"), @@ -411,33 +411,32 @@ def on_pingthread_started(self): self.button_ping.setEnabled(False) self.tw_ping.clearContents() - + def on_pingthread_done(self): self.button_ping.setEnabled(True) def on_pingthread_server(self, i, name): - row = self.tw_ping.rowCount() + tw = self.tw_ping + row = tw.rowCount() if row < (i+1): - self.tw_ping.setRowCount(i + 1) + tw.setRowCount(i + 1) proto = QtGui.QTableWidgetItem() font = QtGui.QFont() - font.setPointSize(7) + font.setPointSize(9) proto.setFont(font) proto.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter) - header = QtGui.QTableWidgetItem(proto) - header.setText(QtCore.QString.number(row + 1)) + #tw.setVerticalHeaderItem(i, QtGui.QTableWidgetItem()) + #tw.verticalHeaderItem(i).setSizeHint(QtCore.QSize(0, 0)) item0 = QtGui.QTableWidgetItem(proto) item0.setText(name) + tw.setItem(i, 0, item0) + tw.setItem(i, 1, QtGui.QTableWidgetItem(proto)) + tw.setItem(i, 2, QtGui.QTableWidgetItem(proto)) + tw.resizeRowsToContents() - self.tw_ping.setVerticalHeaderItem(i, header) - self.tw_ping.setItem(i, 0, item0) - self.tw_ping.setItem(i, 1, QtGui.QTableWidgetItem(proto)) - self.tw_ping.setItem(i, 2, QtGui.QTableWidgetItem(proto)) - self.tw_ping.resizeRowsToContents() - def on_pingthread_dns(self, i, time): item = self.tw_ping.item(i, 1) item.setText("%0.3f" % time) @@ -479,13 +478,13 @@ self.servers = servers if not self.isRunning(): self.start() - + def run(self): # TODO: thread safety! # emit a list of names first for i, server in enumerate(self.servers): self.emit(SIGNAL("server(int, const QString&)"), i, server.name) - + for i, server in enumerate(self.servers): name = server.name dns = server.dns() @@ -495,7 +494,7 @@ i, errno, msg) continue self.emit(SIGNAL("dns(int, float)"), i, dns) - + ping = server.portping() if isSocketError(ping): errno, msg = fmtSocketError(ping) @@ -522,7 +521,7 @@ # TODO check this self._running = False self.condition.wakeAll() - + def __del__(self): self.stopChecker() Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.py =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-03-19 09:19:33 UTC (rev 265) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.py 2007-03-19 13:35:53 UTC (rev 266) @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'src/moul/qt/ui/mainwindow.ui' +# Form implementation generated from reading ui file './src/moul/qt/ui/mainwindow.ui' # -# Created: Mon Mar 19 10:09:02 2007 +# Created: Mon Mar 19 14:34:52 2007 # by: PyQt4 UI code generator 4.1.1 # # WARNING! All changes made in this file will be lost! @@ -1010,8 +1010,13 @@ spacerItem10 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) self.gridlayout3.addItem(spacerItem10,0,5,1,1) + self.lb_localtime = QtGui.QLabel(self.groupBox_4) + self.lb_localtime.setGeometry(QtCore.QRect(360,250,81,20)) + self.lb_localtime.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.lb_localtime.setObjectName("lb_localtime") + self.tw_eg = QtGui.QTableWidget(self.groupBox_4) - self.tw_eg.setGeometry(QtCore.QRect(10,90,431,131)) + self.tw_eg.setGeometry(QtCore.QRect(10,90,431,151)) font = QtGui.QFont(self.tw_eg.font()) font.setPointSize(8) @@ -1020,11 +1025,6 @@ self.tw_eg.setDragDropOverwriteMode(False) self.tw_eg.setAlternatingRowColors(True) self.tw_eg.setObjectName("tw_eg") - - self.lb_localtime = QtGui.QLabel(self.groupBox_4) - self.lb_localtime.setGeometry(QtCore.QRect(360,230,81,20)) - self.lb_localtime.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.lb_localtime.setObjectName("lb_localtime") self.tab_sub_time.addTab(self.tab_time_eder,"") self.tab_time_podages = QtGui.QWidget() @@ -1035,8 +1035,13 @@ self.groupBox_6.setGeometry(QtCore.QRect(10,0,451,371)) self.groupBox_6.setObjectName("groupBox_6") + self.lb_localtime_2 = QtGui.QLabel(self.groupBox_6) + self.lb_localtime_2.setGeometry(QtCore.QRect(360,190,81,20)) + self.lb_localtime_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.lb_localtime_2.setObjectName("lb_localtime_2") + self.tw_pods = QtGui.QTableWidget(self.groupBox_6) - self.tw_pods.setGeometry(QtCore.QRect(10,30,431,131)) + self.tw_pods.setGeometry(QtCore.QRect(10,30,431,151)) font = QtGui.QFont(self.tw_pods.font()) font.setPointSize(8) @@ -1045,11 +1050,6 @@ self.tw_pods.setDragDropOverwriteMode(False) self.tw_pods.setAlternatingRowColors(True) self.tw_pods.setObjectName("tw_pods") - - self.lb_localtime_2 = QtGui.QLabel(self.groupBox_6) - self.lb_localtime_2.setGeometry(QtCore.QRect(360,170,81,20)) - self.lb_localtime_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.lb_localtime_2.setObjectName("lb_localtime_2") self.tab_sub_time.addTab(self.tab_time_podages,"") self.tabwidget.addTab(self.tab_time,"") @@ -1316,6 +1316,7 @@ self.label_13.setText(QtGui.QApplication.translate("MainWindow", "Light level", None, QtGui.QApplication.UnicodeUTF8)) self.label_14.setText(QtGui.QApplication.translate("MainWindow", "Length", None, QtGui.QApplication.UnicodeUTF8)) self.label_4.setText(QtGui.QApplication.translate("MainWindow", "Time", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_localtime.setText(QtGui.QApplication.translate("MainWindow", "local time", None, QtGui.QApplication.UnicodeUTF8)) self.tw_eg.clear() self.tw_eg.setColumnCount(3) self.tw_eg.setRowCount(0) @@ -1331,13 +1332,12 @@ headerItem5 = QtGui.QTableWidgetItem() headerItem5.setText(QtGui.QApplication.translate("MainWindow", "Dusk", None, QtGui.QApplication.UnicodeUTF8)) self.tw_eg.setHorizontalHeaderItem(2,headerItem5) - self.lb_localtime.setText(QtGui.QApplication.translate("MainWindow", "local time", None, QtGui.QApplication.UnicodeUTF8)) self.tab_sub_time.setTabText(self.tab_sub_time.indexOf(self.tab_time_eder), QtGui.QApplication.translate("MainWindow", "Eder Gira", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_6.setTitle(QtGui.QApplication.translate("MainWindow", "Gate appearence", None, QtGui.QApplication.UnicodeUTF8)) + self.lb_localtime_2.setText(QtGui.QApplication.translate("MainWindow", "local time", None, QtGui.QApplication.UnicodeUTF8)) self.tw_pods.clear() self.tw_pods.setColumnCount(0) self.tw_pods.setRowCount(0) - self.lb_localtime_2.setText(QtGui.QApplication.translate("MainWindow", "local time", None, QtGui.QApplication.UnicodeUTF8)) self.tab_sub_time.setTabText(self.tab_sub_time.indexOf(self.tab_time_podages), QtGui.QApplication.translate("MainWindow", "Pod Ages", 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)) Modified: pymoul/trunk/src/moul/qt/ui/mainwindow.ui =================================================================== --- pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-03-19 09:19:33 UTC (rev 265) +++ pymoul/trunk/src/moul/qt/ui/mainwindow.ui 2007-03-19 13:35:53 UTC (rev 266) @@ -2180,13 +2180,29 @@ </item> </layout> </widget> + <widget class="QLabel" name="lb_localtime" > + <property name="geometry" > + <rect> + <x>360</x> + <y>250</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>local time</string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> <widget class="QTableWidget" name="tw_eg" > <property name="geometry" > <rect> <x>10</x> <y>90</y> <width>431</width> - <height>131</height> + <height>151</height> </rect> </property> <property name="font" > @@ -2219,22 +2235,6 @@ </property> </column> </widget> - <widget class="QLabel" name="lb_localtime" > - <property name="geometry" > - <rect> - <x>360</x> - <y>230</y> - <width>81</width> - <height>20</height> - </rect> - </property> - <property name="text" > - <string>local time</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> </widget> </widget> <widget class="QWidget" name="tab_time_podages" > @@ -2256,13 +2256,29 @@ <property name="title" > <string>Gate appearence</string> </property> + <widget class="QLabel" name="lb_localtime_2" > + <property name="geometry" > + <rect> + <x>360</x> + <y>190</y> + <width>81</width> + <height>20</height> + </rect> + </property> + <property name="text" > + <string>local time</string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> <widget class="QTableWidget" name="tw_pods" > <property name="geometry" > <rect> <x>10</x> <y>30</y> <width>431</width> - <height>131</height> + <height>151</height> </rect> </property> <property name="font" > @@ -2280,22 +2296,6 @@ <bool>true</bool> </property> </widget> - <widget class="QLabel" name="lb_localtime_2" > - <property name="geometry" > - <rect> - <x>360</x> - <y>170</y> - <width>81</width> - <height>20</height> - </rect> - </property> - <property name="text" > - <string>local time</string> - </property> - <property name="alignment" > - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> </widget> </widget> </widget> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |