fclient-commit Mailing List for fclient (Page 15)
Status: Pre-Alpha
Brought to you by:
jurner
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(23) |
Nov
(54) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(17) |
Feb
(209) |
Mar
(63) |
Apr
(31) |
May
(7) |
Jun
(39) |
Jul
(390) |
Aug
(122) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
From: <jU...@us...> - 2008-07-13 14:14:43
|
Revision: 612 http://fclient.svn.sourceforge.net/fclient/?rev=612&view=rev Author: jUrner Date: 2008-07-13 07:14:48 -0700 (Sun, 13 Jul 2008) Log Message: ----------- adapt to Qt4Ex changes Modified Paths: -------------- trunk/fclient/src/fclient/lib/qt4ex/lib/settings.py Modified: trunk/fclient/src/fclient/lib/qt4ex/lib/settings.py =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/lib/settings.py 2008-07-13 14:14:12 UTC (rev 611) +++ trunk/fclient/src/fclient/lib/qt4ex/lib/settings.py 2008-07-13 14:14:48 UTC (rev 612) @@ -177,7 +177,7 @@ mthd = getattr(v, 'to' + typeSetting, None) if mthd is None: raise ValueError('%s: no conversion method found for type: %r' % (name, typeSetting)) - obj, ok = qtools.castVariant(v, typeSetting) + obj, ok = tools.castVariant(v, typeSetting) else: obj, ok = getattr(self, 'to' + typeSetting)(settings, name, v) self._settingsDict[name].value = obj if ok else self.default(name) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-13 14:14:06
|
Revision: 611 http://fclient.svn.sourceforge.net/fclient/?rev=611&view=rev Author: jUrner Date: 2008-07-13 07:14:12 -0700 (Sun, 13 Jul 2008) Log Message: ----------- package update Modified Paths: -------------- trunk/fclient/src/fclient/lib/qt4ex/lang/qt4ex_de.ts trunk/fclient/src/fclient/lib/qt4ex/lang/qt4ex_en.ts Modified: trunk/fclient/src/fclient/lib/qt4ex/lang/qt4ex_de.ts =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/lang/qt4ex_de.ts 2008-07-13 14:13:57 UTC (rev 610) +++ trunk/fclient/src/fclient/lib/qt4ex/lang/qt4ex_de.ts 2008-07-13 14:14:12 UTC (rev 611) @@ -1,24 +1,19 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS><TS version="1.1"> +<!DOCTYPE TS><TS> <context> <name>Assistant</name> <message> - <location filename="assistant.py" line="70"/> <source>Qt assistant error</source> <translation type="unfinished"></translation> </message> <message> - <location filename="assistant.py" line="110"/> <source>Can not display help. Assistant is not installed</source> <translation type="unfinished"></translation> </message> <message> - <location filename="assistant.py" line="114"/> <source>Can not display help. No such page: </source> <translation type="unfinished"></translation> </message> <message> - <location filename="assistant.py" line="116"/> <source>Can not display help. Page not found: </source> <translation type="unfinished"></translation> </message> @@ -26,854 +21,753 @@ <context> <name>DlgAbout</name> <message> - <location filename="dlgs/dlgabout/Ui_DlgAbout.py" line="46"/> <source>About</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgabout/Ui_DlgAbout.py" line="47"/> <source>About text here...</source> + <translation type="obsolete"></translation> + </message> + <message> + <source>Version:</source> <translation type="unfinished"></translation> </message> + <message> + <source>Email:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Licence:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Copyright:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Homepage:</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>DlgActionReplace</name> <message> - <location filename="dlgs/dlgfindreplace/__init__.py" line="240"/> <source>Replace...</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/__init__.py" line="242"/> <source>Find...</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/__init__.py" line="284"/> <source>Ready</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/__init__.py" line="300"/> <source>Replaced:</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/__init__.py" line="302"/> <source>Found:</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> </context> <context> <name>DlgFindReplace</name> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="147"/> <source>FindReplace...</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="148"/> <source>Find:</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="149"/> <source>Replace:</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="150"/> <source>&Find Next</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="151"/> <source>Ctrl+F</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="152"/> <source>&Upwards</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="153"/> <source>Ctrl+U</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="154"/> <source>&Replace</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="155"/> <source>Ctrl+R</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="156"/> <source>Replace &All</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="157"/> <source>Ctrl+A</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="158"/> <source>O&k</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="159"/> <source>Ctrl+K</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="160"/> <source>Whole &Word</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="161"/> <source>Custom &1</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="162"/> <source>Match &Case</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="163"/> <source>Custom &2</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="164"/> <source>Regular E&xpression</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="165"/> <source>Custom &3</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="166"/> <source>Status</source> + <translation type="obsolete"></translation> + </message> + <message> + <source>Replace...</source> <translation type="unfinished"></translation> </message> + <message> + <source>Find...</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Ready</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Replaced:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Found:</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>DlgPreferencesTree</name> <message> - <location filename="dlgs/dlgpreferences/Ui_DlgPreferencesTree.py" line="45"/> <source>Preferences</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgpreferences/Ui_DlgPreferencesTree.py" line="46"/> <source>1</source> + <translation type="obsolete"></translation> + </message> +</context> +<context> + <name>EditBoxContextMenuWrap</name> + <message> + <source>Undos the last ation</source> <translation type="unfinished"></translation> </message> + <message> + <source>Redos the last ation</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cuts the currently selected text</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Copies the currently selected text</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Pastes text from the clipboard</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Selects all text</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>LanguageNames</name> <message> - <location filename="language.py" line="71"/> <source>Oromo</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="72"/> <source>Abkhazian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="73"/> <source>Afar</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="74"/> <source>Afrikaans</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="75"/> <source>Albanian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="76"/> <source>Amharic</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="77"/> <source>Arabic</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="78"/> <source>Armenian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="79"/> <source>Assamese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="80"/> <source>Aymara</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="81"/> <source>Azerbaijani</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="82"/> <source>Bashkir</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="83"/> <source>Basque</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="84"/> <source>Bengali</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="85"/> <source>Bhutani</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="86"/> <source>Bihari</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="87"/> <source>Bislama</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="88"/> <source>Breton</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="89"/> <source>Bulgarian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="90"/> <source>Burmese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="91"/> <source>Byelorussian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="92"/> <source>Cambodian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="93"/> <source>Catalan</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="94"/> <source>Chinese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="95"/> <source>Corsican</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="96"/> <source>Croatian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="97"/> <source>Czech</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="98"/> <source>Danish</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="99"/> <source>Dutch</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="100"/> <source>English</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="101"/> <source>Esperanto</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="102"/> <source>Estonian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="103"/> <source>Faeroese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="104"/> <source>Fiji</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="105"/> <source>Finnish</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="106"/> <source>French</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="107"/> <source>Frisian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="108"/> <source>Galician</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="109"/> <source>Georgian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="110"/> <source>German</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="111"/> <source>Greek</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="112"/> <source>Greenlandic</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="113"/> <source>Guarani</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="114"/> <source>Gujarati</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="115"/> <source>Hausa</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="116"/> <source>Hebrew</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="117"/> <source>Hindi</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="118"/> <source>Hungarian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="119"/> <source>Icelandic</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="120"/> <source>Indonesian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="121"/> <source>Interlingua</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="122"/> <source>Interlingue</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="123"/> <source>Inupiak</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="124"/> <source>Inuktitut</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="125"/> <source>Irish</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="126"/> <source>Italian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="127"/> <source>Japanese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="128"/> <source>Javanese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="129"/> <source>Kannada</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="130"/> <source>Kashmiri</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="131"/> <source>Kazakh</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="132"/> <source>Kinyarwanda</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="133"/> <source>Kirghiz</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="134"/> <source>Kirundi</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="135"/> <source>Korean</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="136"/> <source>Kurdish</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="137"/> <source>Laothian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="138"/> <source>Latin</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="139"/> <source>Latvian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="140"/> <source>Lingala</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="141"/> <source>Lithuanian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="142"/> <source>Macedonian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="143"/> <source>Malagasy</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="144"/> <source>Malay</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="145"/> <source>Malayalam</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="146"/> <source>Maltese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="147"/> <source>Maori</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="148"/> <source>Marathi</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="149"/> <source>Moldavian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="150"/> <source>Mongolian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="151"/> <source>Nauru</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="152"/> <source>Nepali</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="153"/> <source>Norwegian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="154"/> <source>Occitan</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="155"/> <source>Oriya</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="156"/> <source>Pashto</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="157"/> <source>Persian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="158"/> <source>Polish</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="159"/> <source>Portuguese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="160"/> <source>Punjabi</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="161"/> <source>Quechua</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="162"/> <source>Rhaeto-Romance</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="163"/> <source>Romanian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="164"/> <source>Russian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="165"/> <source>Samoan</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="166"/> <source>Sangro</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="167"/> <source>Sanskrit</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="168"/> <source>Scots Gaelic</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="169"/> <source>Serbian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="170"/> <source>Serbo-Croatian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="171"/> <source>Sesotho</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="172"/> <source>Setswana</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="173"/> <source>Shona</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="174"/> <source>Sindhi</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="175"/> <source>Singhalese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="176"/> <source>Siswati</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="177"/> <source>Slovak</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="178"/> <source>Slovenian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="179"/> <source>Somali</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="180"/> <source>Spanish</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="181"/> <source>Sudanese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="182"/> <source>Swahili</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="183"/> <source>Swedish</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="184"/> <source>Tagalog</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="185"/> <source>Tajik</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="186"/> <source>Tamil</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="187"/> <source>Tatar</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="188"/> <source>Tegulu</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="189"/> <source>Thai</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="190"/> <source>Tibetan</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="191"/> <source>Tigrinya</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="192"/> <source>Tonga</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="193"/> <source>Tsonga</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="194"/> <source>Turkish</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="195"/> <source>Turkmen</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="196"/> <source>Twi</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="197"/> <source>Uigur</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="198"/> <source>Ukrainian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="199"/> <source>Urdu</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="200"/> <source>Uzbek</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="201"/> <source>Vietnamese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="202"/> <source>Volapuk</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="203"/> <source>Welch</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="204"/> <source>Wolof</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="205"/> <source>Xhosa</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="206"/> <source>Yiddish</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="207"/> <source>Yoruba</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="208"/> <source>Zhuang</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="209"/> <source>Zulu</source> <translation type="unfinished"></translation> </message> @@ -881,38 +775,54 @@ <context> <name>Page</name> <message> - <location filename="dlgs/dlgpreferences/__init__.py" line="103"/> <source>Page</source> <translation type="unfinished"></translation> </message> </context> <context> - <name>Page1</name> -</context> -<context> - <name>Page2</name> -</context> -<context> <name>ToolBarMenuWrap</name> <message> - <location filename="ctrls/toolbarwrap.py" line="113"/> <source>Icons only</source> <translation type="unfinished"></translation> </message> <message> - <location filename="ctrls/toolbarwrap.py" line="114"/> <source>Text only</source> <translation type="unfinished"></translation> </message> <message> - <location filename="ctrls/toolbarwrap.py" line="115"/> <source>Text next to icons</source> <translation type="unfinished"></translation> </message> <message> - <location filename="ctrls/toolbarwrap.py" line="116"/> <source>Text under icons</source> <translation type="unfinished"></translation> </message> </context> +<context> + <name>self.edit</name> + <message> + <source>&Undo</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>&Redo</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cu&t</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>&Copy</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>&Paste</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Select All</source> + <translation type="unfinished"></translation> + </message> +</context> </TS> Modified: trunk/fclient/src/fclient/lib/qt4ex/lang/qt4ex_en.ts =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/lang/qt4ex_en.ts 2008-07-13 14:13:57 UTC (rev 610) +++ trunk/fclient/src/fclient/lib/qt4ex/lang/qt4ex_en.ts 2008-07-13 14:14:12 UTC (rev 611) @@ -1,24 +1,19 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS><TS version="1.1"> +<!DOCTYPE TS><TS> <context> <name>Assistant</name> <message> - <location filename="assistant.py" line="70"/> <source>Qt assistant error</source> <translation type="unfinished"></translation> </message> <message> - <location filename="assistant.py" line="110"/> <source>Can not display help. Assistant is not installed</source> <translation type="unfinished"></translation> </message> <message> - <location filename="assistant.py" line="114"/> <source>Can not display help. No such page: </source> <translation type="unfinished"></translation> </message> <message> - <location filename="assistant.py" line="116"/> <source>Can not display help. Page not found: </source> <translation type="unfinished"></translation> </message> @@ -26,854 +21,753 @@ <context> <name>DlgAbout</name> <message> - <location filename="dlgs/dlgabout/Ui_DlgAbout.py" line="46"/> <source>About</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgabout/Ui_DlgAbout.py" line="47"/> <source>About text here...</source> + <translation type="obsolete"></translation> + </message> + <message> + <source>Version:</source> <translation type="unfinished"></translation> </message> + <message> + <source>Email:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Licence:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Copyright:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Homepage:</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>DlgActionReplace</name> <message> - <location filename="dlgs/dlgfindreplace/__init__.py" line="240"/> <source>Replace...</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/__init__.py" line="242"/> <source>Find...</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/__init__.py" line="284"/> <source>Ready</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/__init__.py" line="300"/> <source>Replaced:</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/__init__.py" line="302"/> <source>Found:</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> </context> <context> <name>DlgFindReplace</name> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="147"/> <source>FindReplace...</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="148"/> <source>Find:</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="149"/> <source>Replace:</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="150"/> <source>&Find Next</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="151"/> <source>Ctrl+F</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="152"/> <source>&Upwards</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="153"/> <source>Ctrl+U</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="154"/> <source>&Replace</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="155"/> <source>Ctrl+R</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="156"/> <source>Replace &All</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="157"/> <source>Ctrl+A</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="158"/> <source>O&k</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="159"/> <source>Ctrl+K</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="160"/> <source>Whole &Word</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="161"/> <source>Custom &1</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="162"/> <source>Match &Case</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="163"/> <source>Custom &2</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="164"/> <source>Regular E&xpression</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="165"/> <source>Custom &3</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgfindreplace/Ui_DlgFindReplace.py" line="166"/> <source>Status</source> + <translation type="obsolete"></translation> + </message> + <message> + <source>Replace...</source> <translation type="unfinished"></translation> </message> + <message> + <source>Find...</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Ready</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Replaced:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Found:</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>DlgPreferencesTree</name> <message> - <location filename="dlgs/dlgpreferences/Ui_DlgPreferencesTree.py" line="45"/> <source>Preferences</source> - <translation type="unfinished"></translation> + <translation type="obsolete"></translation> </message> <message> - <location filename="dlgs/dlgpreferences/Ui_DlgPreferencesTree.py" line="46"/> <source>1</source> + <translation type="obsolete"></translation> + </message> +</context> +<context> + <name>EditBoxContextMenuWrap</name> + <message> + <source>Undos the last ation</source> <translation type="unfinished"></translation> </message> + <message> + <source>Redos the last ation</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cuts the currently selected text</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Copies the currently selected text</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Pastes text from the clipboard</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Selects all text</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>LanguageNames</name> <message> - <location filename="language.py" line="71"/> <source>Oromo</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="72"/> <source>Abkhazian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="73"/> <source>Afar</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="74"/> <source>Afrikaans</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="75"/> <source>Albanian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="76"/> <source>Amharic</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="77"/> <source>Arabic</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="78"/> <source>Armenian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="79"/> <source>Assamese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="80"/> <source>Aymara</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="81"/> <source>Azerbaijani</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="82"/> <source>Bashkir</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="83"/> <source>Basque</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="84"/> <source>Bengali</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="85"/> <source>Bhutani</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="86"/> <source>Bihari</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="87"/> <source>Bislama</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="88"/> <source>Breton</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="89"/> <source>Bulgarian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="90"/> <source>Burmese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="91"/> <source>Byelorussian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="92"/> <source>Cambodian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="93"/> <source>Catalan</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="94"/> <source>Chinese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="95"/> <source>Corsican</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="96"/> <source>Croatian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="97"/> <source>Czech</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="98"/> <source>Danish</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="99"/> <source>Dutch</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="100"/> <source>English</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="101"/> <source>Esperanto</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="102"/> <source>Estonian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="103"/> <source>Faeroese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="104"/> <source>Fiji</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="105"/> <source>Finnish</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="106"/> <source>French</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="107"/> <source>Frisian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="108"/> <source>Galician</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="109"/> <source>Georgian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="110"/> <source>German</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="111"/> <source>Greek</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="112"/> <source>Greenlandic</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="113"/> <source>Guarani</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="114"/> <source>Gujarati</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="115"/> <source>Hausa</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="116"/> <source>Hebrew</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="117"/> <source>Hindi</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="118"/> <source>Hungarian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="119"/> <source>Icelandic</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="120"/> <source>Indonesian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="121"/> <source>Interlingua</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="122"/> <source>Interlingue</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="123"/> <source>Inupiak</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="124"/> <source>Inuktitut</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="125"/> <source>Irish</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="126"/> <source>Italian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="127"/> <source>Japanese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="128"/> <source>Javanese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="129"/> <source>Kannada</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="130"/> <source>Kashmiri</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="131"/> <source>Kazakh</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="132"/> <source>Kinyarwanda</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="133"/> <source>Kirghiz</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="134"/> <source>Kirundi</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="135"/> <source>Korean</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="136"/> <source>Kurdish</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="137"/> <source>Laothian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="138"/> <source>Latin</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="139"/> <source>Latvian</source> <translation type="unfinished"></translation> </message> <message> - <location filename="language.py" line="140"/... [truncated message content] |
From: <jU...@us...> - 2008-07-13 14:13:52
|
Revision: 610 http://fclient.svn.sourceforge.net/fclient/?rev=610&view=rev Author: jUrner Date: 2008-07-13 07:13:57 -0700 (Sun, 13 Jul 2008) Log Message: ----------- add 'homepage' kw ++ tr the stuff Modified Paths: -------------- trunk/fclient/src/fclient/lib/qt4ex/dlgabout.py Modified: trunk/fclient/src/fclient/lib/qt4ex/dlgabout.py =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/dlgabout.py 2008-07-13 14:13:13 UTC (rev 609) +++ trunk/fclient/src/fclient/lib/qt4ex/dlgabout.py 2008-07-13 14:13:57 UTC (rev 610) @@ -28,6 +28,7 @@ email=None, licence=None, copyright=None, + homepage=None, ): """ @param state: formerly saved state of the dialog or None @@ -49,19 +50,21 @@ if appName is not None: text += '<h3>%s</h3>\n' % appName if description is not None: - text += '<hr>%s<hr>\n' % description + text += '%s<hr>\n' % description text += '<ul>\n' if version is not None: - text += ' <li>Version: %s\n' % version + text += ' <li>%s %s\n' % (self.trUtf8('Version:'), version) if author is not None: - text += ' <li>Author: %s\n' % author + text += ' <li>%s %s\n' % (self.trUtf8('Author:'), author) if email is not None: - text += ' <li>Email: %s\n' % email + text += ' <li>%s %s\n' % (self.trUtf8('Email:'), email) if licence is not None: - text += ' <li>Licence: %s\n' % licence + text += ' <li>%s %s\n' % (self.trUtf8('Licence:'), licence) if copyright is not None: - text += ' <li>Copyright: %s\n' % copyright + text += ' <li>%s %s\n' % (self.trUtf8('Copyright:'), copyright) + if homepage is not None: + text += ' <li>%s %s\n' % (self.trUtf8('Homepage:'), homepage) for name, version in tools.versionInfo(): text += ' <li>%s: %s\n' % (name, version) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-13 14:13:07
|
Revision: 609 http://fclient.svn.sourceforge.net/fclient/?rev=609&view=rev Author: jUrner Date: 2008-07-13 07:13:13 -0700 (Sun, 13 Jul 2008) Log Message: ----------- Client.isOpen() is now Client.isConnected() Modified Paths: -------------- trunk/fclient/src/fclient/lib/fcp2/test/test_client.py Modified: trunk/fclient/src/fclient/lib/fcp2/test/test_client.py =================================================================== --- trunk/fclient/src/fclient/lib/fcp2/test/test_client.py 2008-07-13 14:12:14 UTC (rev 608) +++ trunk/fclient/src/fclient/lib/fcp2/test/test_client.py 2008-07-13 14:13:13 UTC (rev 609) @@ -316,7 +316,7 @@ event -= self._captureEventsFromClient # clean up tmpfiles for fpath in self.tmpfiles: os.remove(fpath) - if self.client.isOpen(): + if self.client.isConnected(): self.client.close() @@ -354,11 +354,11 @@ class Test_isOpen(BaseTestClient): def test_isOpen(self): - self.failIf(self.client.isOpen()) + self.failIf(self.client.isConnected()) self.connectClient() - self.failUnless(self.client.isOpen()) + self.failUnless(self.client.isConnected()) self.closeClient() - self.failIf(self.client.isOpen()) + self.failIf(self.client.isConnected()) #*********************************************************************************** # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-13 14:12:07
|
Revision: 608 http://fclient.svn.sourceforge.net/fclient/?rev=608&view=rev Author: jUrner Date: 2008-07-13 07:12:14 -0700 (Sun, 13 Jul 2008) Log Message: ----------- duh. weakref does not handle instancemethods. rollback Modified Paths: -------------- trunk/fclient/src/fclient/lib/fcp2/lib/events.py Modified: trunk/fclient/src/fclient/lib/fcp2/lib/events.py =================================================================== --- trunk/fclient/src/fclient/lib/fcp2/lib/events.py 2008-07-13 14:07:57 UTC (rev 607) +++ trunk/fclient/src/fclient/lib/fcp2/lib/events.py 2008-07-13 14:12:14 UTC (rev 608) @@ -74,7 +74,7 @@ for event, observer in events: event -= observer return self - + #********************************************************************* # #********************************************************************* @@ -103,7 +103,7 @@ @param name: name of the event """ self.name = name - self._refs = [] + self.observers = [] def __call__(self, *args, **kwargs): @@ -112,28 +112,22 @@ @note: all listeners will be called with the event a first parameter, followed by optional args and kwargs """ - for ref in self._refs: - observer = ref() - if ref is not None: - observer(self, *args, **kwargs) + for observer in self.observers: + observer(self, *args, **kwargs) def __iadd__(self, observer): """Adds an observer to the event @note: the observer will be called with the event as first paraeter, followed by any number of *args or **kwargs passed by the caller of an event """ - self._refs.append(weakref.ref(observer, self.handleDereference)) + self.observers.append(observer) return self def __isub__(self, observer): """Removes the first occurence of an observer from the event""" - observers = [i() for i in self._refs] - del self._refs[observers.index(observer)] + self.observers.remove(observer) return self - def handleDereference(self, ref): - self._refs.remove(ref) - #********************************************************************* # #********************************************************************* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-13 14:07:49
|
Revision: 607 http://fclient.svn.sourceforge.net/fclient/?rev=607&view=rev Author: jUrner Date: 2008-07-13 07:07:57 -0700 (Sun, 13 Jul 2008) Log Message: ----------- add main module Modified Paths: -------------- trunk/fclient/src/fclient/fclient.py Modified: trunk/fclient/src/fclient/fclient.py =================================================================== --- trunk/fclient/src/fclient/fclient.py 2008-07-13 14:07:33 UTC (rev 606) +++ trunk/fclient/src/fclient/fclient.py 2008-07-13 14:07:57 UTC (rev 607) @@ -1 +1,42 @@ +from __future__ import absolute_import +if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below + import os; __path__ = [os.path.dirname(__file__)] + +import sys +from PyQt4 import QtGui + +from .Ui_MainWindow import MainWindow +from .Ui_View import ViewWidget +from .Ui_ViewBrowser import ViewBrowserWidget +from .Ui_ViewConnection import ViewConnectionWidget +from .Ui_ViewLogger import ViewLoggerWidget +#************************************************************* +# +#************************************************************* +def main(): + + + app = QtGui.QApplication(sys.argv) + mainWindow = MainWindow() + viewWidget = ViewWidget(mainWindow) + mainWindow.setCentralWidget(viewWidget) + + viewWidget.addTopViews( + ViewConnectionWidget(mainWindow), + ViewBrowserWidget(mainWindow), + ) + viewWidget.addBottomViews(ViewLoggerWidget(mainWindow)) + + mainWindow.show() + res = app.exec_() + sys.exit(res) + +#********************************************************************************** +# +#********************************************************************************** +if __name__ == '__main__': + main() + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-13 14:07:23
|
Revision: 606 http://fclient.svn.sourceforge.net/fclient/?rev=606&view=rev Author: jUrner Date: 2008-07-13 07:07:33 -0700 (Sun, 13 Jul 2008) Log Message: ----------- add basic browser view impl Modified Paths: -------------- trunk/fclient/src/fclient/config.py Modified: trunk/fclient/src/fclient/config.py =================================================================== --- trunk/fclient/src/fclient/config.py 2008-07-13 14:07:23 UTC (rev 605) +++ trunk/fclient/src/fclient/config.py 2008-07-13 14:07:33 UTC (rev 606) @@ -10,12 +10,17 @@ from PyQt4 import QtCore from .lib import fcp2 -from .lib.qt4ex import settings +from .lib.qt4ex.lib import settings #********************************************************************************** # #********************************************************************************** FclientOrgName = 'fclient' FclientAppName = 'fclient' +FclientVersion = '0.1.0' +FclientAuthor = 'Juergen Urner' +FclientLicence = 'MIT' +FclientCopyright = '(c) 2008 Juergen Urner' +FclientHomepage = 'http://fclient.sourceforge.net/' SettingsDir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'settings') #********************************************************************************** @@ -24,11 +29,12 @@ # a dict for lookups... #********************************************************************************** IdMainWindow = 'MainWindow' -IdMainWindowMenuBar = 'MainWindowMenuBar' +IdMainWindowMenuBarWrap = 'MainWindowMenuBarWrap' IdMainWindowStatusBar = 'MainWindowStatusBar' IdViewWidget = 'ViewWidget' +IdViewBrowserWidget = 'ViewBrowserWidget' +IdViewConnectionWidget = 'ViewConnectionWidget' IdViewLoggerWidget = 'ViewLoggerWidget' -IdViewConnectionWidget = 'ViewConnectionWidget' class ObjectRegistry(weakref.WeakValueDictionary): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-13 14:07:15
|
Revision: 605 http://fclient.svn.sourceforge.net/fclient/?rev=605&view=rev Author: jUrner Date: 2008-07-13 07:07:23 -0700 (Sun, 13 Jul 2008) Log Message: ----------- add basic browser view impl Added Paths: ----------- trunk/fclient/src/fclient/Ui_ViewBrowser.py Added: trunk/fclient/src/fclient/Ui_ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/Ui_ViewBrowser.py (rev 0) +++ trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-13 14:07:23 UTC (rev 605) @@ -0,0 +1,109 @@ + + +from __future__ import absolute_import +if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below + import os; __path__ = [os.path.dirname(__file__)] + +import logging +import sys +logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) + +from PyQt4 import QtCore, QtGui + + +from . import config +from . import Ui_View + +from .tpls.Ui_ViewBrowserWidgetTpl import Ui_ViewBrowserWidget +#********************************************************************************** +# +#********************************************************************************** +class Settings(config.SettingsBase): + _key_ = config.IdViewBrowserWidget + _settings_ = ( + ) + +#*********************************************************************** +# +#*********************************************************************** +class ViewBrowserWidget(QtGui.QWidget, Ui_ViewBrowserWidget): + + + def __init__(self, parent): + QtGui.QWidget.__init__(self, parent) + self._acts = [] + self._isCreated = False + self._mainWindowMenus = [] + + self.settings = Settings() + + self.setupUi(self) + config.ObjectRegistry.register(self) + + # atatch menus to main window if present. have to do it in __init__ to reserve order + menuBarWrap = config.ObjectRegistry.get(config.IdMainWindowMenuBarWrap, None) + if menuBarWrap is not None: + menu = QtGui.QMenu(self.viewDisplayName(), menuBarWrap.menuBar()) + for act in self.acts(): + print act + menu.addAction(act) + self._mainWindowMenus = ( + menuBarWrap.addViewMenu(menu), + ) + + ######################################### + ## methods + ######################################### + def acts(self): + if not self._acts: + self._acts = ( + ) + return self._acts + + + def controlById(self, idControl): + return getattr(self, idControl) + + ######################################### + ##view methods + ######################################### + def viewClose(self): + pass + + def viewDisplayName(self): + return self.trUtf8('Browser') + + def viewHandleCurrentChanged(self, isCurrent): + for menu in self._mainWindowMenus: + menu.children()[0].setVisible(isCurrent) + + def viewIcon(self): + return QtGui.QIcon() + + def viewName(self): + return self.objectName() + + ######################################### + ## overwritten events + ######################################### + def showEvent(self, event): + if self._isCreated: + return + self._isCreated = True + +#********************************************************************************** +# +#********************************************************************************** +if __name__ == '__main__': + import sys + from . import Ui_ViewLogger + + app = QtGui.QApplication(sys.argv) + w = ViewBrowserWidget(None) + + w.show() + res = app.exec_() + sys.exit(res) + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-13 09:42:55
|
Revision: 604 http://fclient.svn.sourceforge.net/fclient/?rev=604&view=rev Author: jUrner Date: 2008-07-13 02:43:02 -0700 (Sun, 13 Jul 2008) Log Message: ----------- reorganisation of qt4ex Added Paths: ----------- trunk/fclient/src/fclient/lib/qt4ex/ trunk/fclient/src/fclient/lib/qt4ex/LICENCE.MIT trunk/fclient/src/fclient/lib/qt4ex/README trunk/fclient/src/fclient/lib/qt4ex/__init__.py trunk/fclient/src/fclient/lib/qt4ex/areatips.py trunk/fclient/src/fclient/lib/qt4ex/checkarraywrap.py trunk/fclient/src/fclient/lib/qt4ex/colorbutton.py trunk/fclient/src/fclient/lib/qt4ex/dlgabout.py trunk/fclient/src/fclient/lib/qt4ex/dlgfindreplace.py trunk/fclient/src/fclient/lib/qt4ex/dlgpreferences.py trunk/fclient/src/fclient/lib/qt4ex/dragtool.py trunk/fclient/src/fclient/lib/qt4ex/editboxwrap.py trunk/fclient/src/fclient/lib/qt4ex/labelwrap.py trunk/fclient/src/fclient/lib/qt4ex/lang/ trunk/fclient/src/fclient/lib/qt4ex/lang/qt4ex_de.ts trunk/fclient/src/fclient/lib/qt4ex/lang/qt4ex_en.ts trunk/fclient/src/fclient/lib/qt4ex/lib/ trunk/fclient/src/fclient/lib/qt4ex/lib/__init__.py trunk/fclient/src/fclient/lib/qt4ex/lib/assistant.py trunk/fclient/src/fclient/lib/qt4ex/lib/language.py trunk/fclient/src/fclient/lib/qt4ex/lib/resources.py trunk/fclient/src/fclient/lib/qt4ex/lib/settings.py trunk/fclient/src/fclient/lib/qt4ex/lib/tools.py trunk/fclient/src/fclient/lib/qt4ex/mrumenu.py trunk/fclient/src/fclient/lib/qt4ex/res/ trunk/fclient/src/fclient/lib/qt4ex/scripts/ trunk/fclient/src/fclient/lib/qt4ex/scripts/__init__.py trunk/fclient/src/fclient/lib/qt4ex/scripts/manifest.py trunk/fclient/src/fclient/lib/qt4ex/scripts/pylupdate.py trunk/fclient/src/fclient/lib/qt4ex/scripts/qtpro.py trunk/fclient/src/fclient/lib/qt4ex/tablewidget.py trunk/fclient/src/fclient/lib/qt4ex/toolbarwrap.py trunk/fclient/src/fclient/lib/qt4ex/tpls/ trunk/fclient/src/fclient/lib/qt4ex/tpls/DlgAbout.ui trunk/fclient/src/fclient/lib/qt4ex/tpls/DlgFindReplace.ui trunk/fclient/src/fclient/lib/qt4ex/tpls/DlgPreferencesTree.ui trunk/fclient/src/fclient/lib/qt4ex/tpls/Ui_DlgAbout.py trunk/fclient/src/fclient/lib/qt4ex/tpls/Ui_DlgFindReplace.py trunk/fclient/src/fclient/lib/qt4ex/tpls/Ui_DlgPreferencesTree.py trunk/fclient/src/fclient/lib/qt4ex/tpls/__init__.py trunk/fclient/src/fclient/lib/qt4ex/treewidgetwrap.py Added: trunk/fclient/src/fclient/lib/qt4ex/LICENCE.MIT =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/LICENCE.MIT (rev 0) +++ trunk/fclient/src/fclient/lib/qt4ex/LICENCE.MIT 2008-07-13 09:43:02 UTC (rev 604) @@ -0,0 +1,21 @@ + +qt4ex -- Qt5 / PyQt4 extensions + +Copyright (c) 2007 J\xFCrgen Urner + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file Added: trunk/fclient/src/fclient/lib/qt4ex/README =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/README (rev 0) +++ trunk/fclient/src/fclient/lib/qt4ex/README 2008-07-13 09:43:02 UTC (rev 604) @@ -0,0 +1,30 @@ + qt4ex -- Qt5 / PyQt4 extensions + + + +Version history: + + +******************************************************************* +0.2.0 +******************************************************************* +complete reorganisation of the package. too many changes to list here + + +******************************************************************* +0.1.0 +******************************************************************* +news: + x. initial release + +bugfixes: + x. + + + + + + + + + Added: trunk/fclient/src/fclient/lib/qt4ex/__init__.py =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/__init__.py (rev 0) +++ trunk/fclient/src/fclient/lib/qt4ex/__init__.py 2008-07-13 09:43:02 UTC (rev 604) @@ -0,0 +1,11 @@ +"""Qt4 extensions + +""" + +__version__ = '0.2.0' +__author__ = 'Juergen Urner' +__emeil__ = 'jU...@ar...' +__licence__ = 'Mit' +__copyright__ = '(c) 2007-2008 Juergen Urner' + + Added: trunk/fclient/src/fclient/lib/qt4ex/areatips.py =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/areatips.py (rev 0) +++ trunk/fclient/src/fclient/lib/qt4ex/areatips.py 2008-07-13 09:43:02 UTC (rev 604) @@ -0,0 +1,463 @@ +# -*- coding: utf-8 -*- + +"""Customized tooltips +""" + +# TODO: +# +# x. fix ComboBoxEditTip to act as promised +# x. add classes to handle temTips for editBoxes (...) +# +# x. ComboBox trouble. +# +# XXX jopefuly fixed by adding an event.type().Leave handler to cancel toolTip display XXX +# +# y. The dropdown of a combobox does not seem to eat up events +# An itemView underneath the dropdown still receives mouseMove events +# and may pop up an itemTip. No idea what todo. +# +# y. there is a glitch with comboBoxes. When an itemTip is popped up +# and the user clicks on it, the dropDown is closed, but the itemTip +# not. For some reason the itemView eats the mouse message and +# the itemTip never gets notified. +# +# x. there is a possible glitch aswell in itemTips when an itemView gets +# disabled / hidden while an itemTip is scheduled for display. No way to +# cancel the itemTip currently +# +# +import os +from PyQt4 import QtCore, QtGui +#*************************************************************************** +# +#*************************************************************************** +DEFAULT_SHOW_DELAY = 400 + +#*************************************************************************** +# +#*************************************************************************** +#code for the toolTip is taken from QToolTip.cpp + +class AreaTip(QtGui.QLabel): + """ + Customized tooltip class to show tooltips for a specified area + under the mouse cursor. + + """ + + def __init__(self, parent, showDelay=DEFAULT_SHOW_DELAY): + """constructor + + @param parent parent of the tooltip + @showDelay delay in milliseconds before the tootliptp is shown + """ + + + QtGui.QLabel.__init__(self, parent, QtCore.Qt.ToolTip) + self.hide() + + + self._currentAreaTipData = None + self._showTimer = QtCore.QTimer(self) + self._showDelay = showDelay + + self.connect( + self._showTimer, + QtCore.SIGNAL("timeout()"), + self.onShowTip) + + + + self.ensurePolished() + frameW = self.style().pixelMetric( + QtGui.QStyle.PM_ToolTipLabelFrameWidth, + None, + self + ) + self.setMargin( 1 + frameW) + self.setFrameStyle(QtGui.QFrame.NoFrame) + self.setAlignment(QtCore.Qt.AlignLeft) + self.setIndent(1) + + self.installEventFilter(self) + + opacity = self.style().styleHint( + QtGui.QStyle.SH_ToolTipLabel_Opacity, + None, + self + ) + self.setWindowOpacity( opacity / 255.0) + self.setPalette(QtGui.QToolTip.palette()) + + + + def showDelay(self): + """returns the current show delay""" + return self._showDelay + + def setShowDelay(self, n): + """adjusts the show delay + @param n milliseconds to delay the popup of the tooltip + """ + self._showDelay = n + + + def paintEvent(self, event): + """overwritten QWidget.paintEvent""" + p = QtGui.QStylePainter(self) + + opt = QtGui.QStyleOptionFrame() + opt.init(self) + p.drawPrimitive(QtGui.QStyle.PE_PanelTipLabel, opt) + p.end() + + QtGui.QLabel.paintEvent(self, event) + + + + def eventFilter(self, obj, event): + """event filter for the tooltip""" + + type_ = event.type() + if type_ == event.KeyPress or type == event.KeyRelease: + key = event.key() + modifiers = event.modifiers() + if modifiers & QtCore.Qt.KeyboardModifierMask or \ + key == QtCore.Qt.Key_Shift or \ + key == QtCore.Qt.Key_Control or \ + key == QtCore.Qt.Key_Alt or \ + key == QtCore.Qt.Key_Meta: + return False + + # TODO: delegate mouseactions to the window underneath the cursor + elif type_ in ( + event.Leave, + event.WindowActivate, + event.WindowDeactivate, + event.MouseButtonPress, + event.MouseButtonRelease, + event.MouseButtonDblClick, + event.FocusIn, + event.FocusOut, + event.Wheel, + ): + self.hideTip() + + return False + + + def onShowTip(self): + """called when the tooltip is about to be displayed""" + + if self._currentAreaTipData: + pt, text, rc = self._currentAreaTipData + pos = QtGui.QCursor().pos() + if not rc.contains(pos): + return + + desktop = QtGui.QApplication.desktop() + if desktop.isVirtualDesktop(): + scr = desktop.screenNumber(pt) + else: + scr = desktop.screenNumber(self.parent()) + + if os.name == "mac": + screen = desktop.availableGeometry(scr) + else: + screen = desktop.screenGeometry(scr) + + self.setText(text) + fm = QtGui.QFontMetrics(self.font()) + extra = QtCore.QSize(1, 0) + # Make it look good with the default ToolTip font on Mac, + # which has a small descent. + if fm.descent() == 2 and fm.ascent() >= 11: + extra.setHeight(extra.height() + 1) + + self.resize(self.sizeHint() + extra) + + self.setWordWrap(QtCore.Qt.mightBeRichText(text)) + self.move(pt) + self.show() + + + def cancel(self): + if self._showTimer.isActive(): + self._showTimer.stop() + + + def hideTip(self): + """hides the tooltip""" + self.cancel() + self.hide() + + + def showText(self, pt, text, rc): + """shows the tooltip + + @param pt: (global coordinates) point to show the tooltip at (left/top) + @param text: text to show (if emtpty string the tooltip is not shown) + @param rc: (global coordinates) bounding rect the tooltip is assigned to + + """ + self._currentAreaTipData = (pt, text, rc) + self.hideTip() + if not text.isEmpty(): + self._showTimer.start(self._showDelay) + + + def showItemTip(self, itemView, index): + """Shows an item tip for item views (QTreeView, QListView ....) + for the specified index if necessary. + + @param itemView: item view to display the tip for + @param index: QModelIndex of the item to display the tip for + + Note: the tolltip will only be displayed if the text of the item is truncated + or the item is not entirely visible. + """ + rc = self.getTruncatedItemRect(itemView, index) + if rc is not None: + text = index.data().toString() + if not text.isEmpty() and itemView.hasFocus(): + self.showText(rc.topLeft(), text, rc) + + + def getTruncatedItemRect(self, itemView, index): + """Helper method. Returns the rect of a truncted item in an item view + @param itemView: QAbstractItemView + @param index: index of the item + @return: (global coordinates QRect) if the item is truncated, None otherwise + @note: this method is callled by showItemTip() to determine wether to + display a toolTip for an item or not. Overwrite to customize + """ + viewport = itemView.viewport() + rcCli = viewport.contentsRect() + rcActual = itemView.visualRect(index) + rcDesired = QtCore.QRect( + rcActual.topLeft(), + itemView.sizeHintForIndex(index) + ) + if not rcActual.contains(rcDesired, False) or \ + not rcCli.contains(rcDesired, False): + + rcActual.moveTo( viewport.mapToGlobal(rcActual.topLeft()) ) + return rcActual + + +#**************************************************************************** +# +#**************************************************************************** +class ItemTips(QtCore.QObject): + """Equips an itemView (QTreeView, QListView ....) with tooltips for truncated items (item tips) + """ + + def __init__(self, itemView, showDelay=DEFAULT_SHOW_DELAY): + """ + @param itemView: itemView to equip with item tips + param showDelay: delay in (miliseconds) after wich to show a tooltip for an item + """ + QtCore.QObject.__init__(self, itemView) + + self.areaTip = AreaTip(itemView, showDelay=showDelay) + self.itemView = itemView + + itemView.setMouseTracking(True) # enshure we get mouseMove messages + itemView.viewport().installEventFilter(self) + + + def eventFilter(self, obj, event): + """Event filter for the itemTip""" + if event.type() == event.MouseMove: + if self.areaTip.isHidden(): + + # hope this check fixes a glitch with comboBoxes. Sometimes am itemTip + # did pop up when the combos dropdown was closed. + if not self.itemView.isHidden() and self.itemView.isEnabled() and self.itemView.underMouse(): + index = self.itemView.indexAt(event.pos()) + if index.isValid(): + self.areaTip.showItemTip(self.itemView, index) + if event.type() == event.Leave: + self.areaTip.cancel() + + return False + + + def setEnabled(self, flag): + self.areaTip.setEnabled(flag) + pass + + def isEnabled(self): + self.areaTip.isEnabled() + + def getShowDelay(self): + """returns the current show delay""" + return self.areaTip.getShowDelay() + + def setShowDelay(self, n): + """adjusts the show delay + @param n milliseconds to delay the popup of the tooltip + """ + return self.areaTip.setShowDelay(delay) + +#**************************************************************************** +# +#**************************************************************************** +class ComboBoxEditTips(QtCore.QObject): + """Equips a QComboBox with a toolTip popping up when the text in its edit box is truncated + + @note: this class does currently not quite what it is supposed todo. A normal toolTip is + sisplayed instead of a toolTip that covers the editBox. This may change in future versions. + """ + + def __init__(self, comboBox, showDelay=DEFAULT_SHOW_DELAY): + QtCore.QObject.__init__(self, comboBox) + + self.connect( + comboBox, + QtCore.SIGNAL('currentIndexChanged(const QString &)'), + self._adjustToolTip + ) + + comboBox.installEventFilter(self) + self.comboBox = comboBox + + + def eventFilter(self, obj, event): + if event.type() == event.Resize: + self._adjustToolTip(self.comboBox.currentText()) + return False + + def _adjustToolTip(self, text): + fm = self.comboBox.fontMetrics() + style = self.comboBox.style() + rc = self.comboBox.contentsRect() + rc2 = style.subControlRect( + style.CC_ComboBox, + QtGui.QStyleOptionComboBox(), + style.SC_ComboBoxEditField, + ) + + cx = rc.width() + rc2.width() + w = fm.width(text) + if w > cx -2: + self.comboBox.setToolTip(text) + else: + self.comboBox.setToolTip('') + + + + +#******************************************************************************************** +# some test guis +#******************************************************************************************** +def _testItemModel(): + """Tests itemTips for a QTableView""" + + import sys + + + class TestModel(QtCore.QAbstractTableModel): + + + def __init__(self, table): + QtCore.QAbstractTableModel.__init__(self, table) + + self.__table = table + self.__columns = ('foo', "foo") + self.__rows = ['foo'*10 for i in range(10)] + + self.areaTip = AreaTip(table) + + + def hasIndex(self, row, column): + """QAbstractTableModel.hasIndex() implementation""" + if -1 < column <= len(self.__columns): + if -1 < row < len(self.__rows): + return True + return False + + def rowCount(self, parent): + """QAbstractTableModel.rowCount() implementation""" + return len(self.__rows) + + + def columnCount(self, parent): + """QAbstractTableModel.columnCount() implementation""" + return len(self.__columns) + + + def headerData(self, section, orientation, role): + """QAbstractTableModel.headerData() implementation""" + if role == QtCore.Qt.DisplayRole and orientation == QtCore.Qt.Horizontal: + return QtCore.QVariant(self.__columns[section]) + return QtCore.QVariant() + + + def data(self, index, role): + """QAbstractTableModel.data() implementation""" + + if self.hasIndex(index.row(), index.column()): + if role == QtCore.Qt.DisplayRole: + return QtCore.QVariant(self.__rows[index.column()]) + + # display tooltip if text does not fit column width + # or item is not entirely visible + elif role == QtCore.Qt.ToolTipRole: + self.areaTip.showItemTip(self.__table, index) + + + return QtCore.QVariant() + + app = QtGui.QApplication(sys.argv) + dlg = QtGui.QWidget() + + grid = QtGui.QHBoxLayout(dlg) + + tv = QtGui.QTableView(dlg) + grid.addWidget(tv) + + tv.setModel(TestModel(tv)) + + dlg.show() + res = app.exec_() + sys.exit(res) + + + +def _testComboBox(): + """Tests itemTips for a QCombobox""" + + + import sys + + app = QtGui.QApplication(sys.argv) + w = QtGui.QWidget() + + b = QtGui.QGridLayout(w) + c = QtGui.QComboBox(w) + c.setMinimumContentsLength(5) + b.addWidget(c) + + itemTips = ItemTips(c.view()) + + + for i in range(10): + c.addItem('loooooooooooooooooooooooooooooong-itemText-%s' % i) + + w.show() + res = app.exec_() + sys.exit(res) + + + +#*********************************************************************** +# +#*********************************************************************** +if __name__ == "__main__": + pass + _testItemModel() + #_testComboBox() + + + Added: trunk/fclient/src/fclient/lib/qt4ex/checkarraywrap.py =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/checkarraywrap.py (rev 0) +++ trunk/fclient/src/fclient/lib/qt4ex/checkarraywrap.py 2008-07-13 09:43:02 UTC (rev 604) @@ -0,0 +1,93 @@ +"""wrapper class for handling checkboxes (...) as bit array + + +CONST_1 = 1 +CONST_2 = 2 +CONST_3 = 4 + +checks = { + CONST_1: ckeckbox1, + CONST_2: checkbox2, + CONST_3: cjeckbox3, + + } + + +flags = CheckArray(checks, initvalue=CONST_1 | CONST_2) + +flags |= CONST_3 # check 3rd checkbox +flags.showChecks(CONST_1 | CONST_2) # hide 3rd checkbox + +""" + +from PyQt4 import QtCore +#******************************************************* +# +#******************************************************* +class CheckArrayWrap(QtCore.QObject): + + def __init__(self, parent, checks, value=None): + QtCore.QObject.__init__(self, parent) + self._checks = checks + + if value is not None: + self.setChecks(value) + + ###################################### + ## public methods + ###################################### + def getValue(self): + value = 0 + for const, ck in self._checks.items(): + if ck.isChecked(): + value |= const + return value + + + def setChecks(self, flags): + for const, ck in self._checks.items(): + if flags & const: + ck.setCheckState(QtCore.Qt.Checked) + else: + ck.setCheckState(QtCore.Qt.Unchecked) + flags &= ~const + if not flags: + break + + + def showChecks(self, flags): + for const, ck in self._checks.items(): + if flags & const: + check.control.setEnabled(True) + check.control.show() + else: + check.control.setEnabled(False) + check.control.hide() + flags &= ~const + if not flags: + break + + + def __or__(self, n): + value = self.getValue() | n + self.setChecks(value) + return self + def __ior__(self, n): return self.__or__(n) + def __ror__(self, n): return self.__or__(n) + + def __and__(self, n): + value = self.getValue() & n + self.setChecks(value) + return self + def __iand__(self, n): return self.__and__(n) + def __rand__(self, n): return self.__and__(n) + + def __xor__(self, n): + value = self.getValue() ^ n + self.setChecks(value) + return self + def __ixor__(self, n): return self.__xor__(n) + def __rxor__(self, n): return self.__xor__(n) + + + Added: trunk/fclient/src/fclient/lib/qt4ex/colorbutton.py =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/colorbutton.py (rev 0) +++ trunk/fclient/src/fclient/lib/qt4ex/colorbutton.py 2008-07-13 09:43:02 UTC (rev 604) @@ -0,0 +1,228 @@ +"""pyQt4 ColorButton with drag and drop support + +mostly taken from +[http://api.kde.org/4.0-api/kdelibs-apidocs/kdeui/html/classKColorButton.html] +with some minor adjustements +""" +from __future__ import absolute_import +if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below + import os; __path__ = [os.path.dirname(__file__)] + + +import sys, os +from PyQt4 import QtCore, QtGui + +from .lib import tools +#************************************************************************ +# +#************************************************************************ +class ColorButtonWrap(QtCore.QObject): + """Event filter to transform a QPushButton into a color button + + The button will popup a color selection dialog when hit ++ the button supports + drag / drop of colors. + + @signal colorChanged(const QColor*): emited when the user changes the color of + the button via color dialog or color drop. + """ + + def __init__(self, button, color=None, fitColor=True): + """ + @param button: button to wrap + @param color: initial color. If None, initial color is black + @fitColor: if True the color shown is adjusted to fit the contents of the button + """ + QtCore.QObject.__init__(self, button) + + self.button = button + self._color = color or QtGui.QColor('black') + self.fitColor = fitColor + + button.setAcceptDrops(True) + button.installEventFilter(self) + self.connect(button, QtCore.SIGNAL('clicked()'), self.chooseColor) + + + def _initStyleOption(self, opt): + opt.initFrom(self.button) + opt.text.clear() + opt.icon = QtGui.QIcon() + opt.features = QtGui.QStyleOptionButton.None + + + def eventFilter(self, obj, event): + """Event filter for the button wrapped""" + + eventType = event.type() + + if eventType == event.Paint: + painter = QtGui.QPainter(self.button) + + # draw bevel + opt = QtGui.QStyleOptionButton() + self._initStyleOption(opt) + self.button.style().drawControl(QtGui.QStyle.CE_PushButtonBevel, opt, painter, self.button) + + # draw color box + #First, sort out where it goes + labelRect = self.button.style().subElementRect(QtGui.QStyle.SE_PushButtonContents, opt, self.button) + shift = self.button.style().pixelMetric(QtGui.QStyle.PM_ButtonMargin) + labelRect.adjust(shift, shift, -shift, -shift); + x, y, w, h = labelRect.getRect() + + if self.button.isChecked() or self.button.isDown(): + x += self.button.style().pixelMetric(QtGui.QStyle.PM_ButtonShiftHorizontal) + y += self.button.style().pixelMetric(QtGui.QStyle.PM_ButtonShiftVertical) + if self.button.isEnabled(): + fillCol = self.getColor() + else: + fillCol = self.button.palette().color(self.button.backgroundRole()) + + QtGui.qDrawShadePanel(painter, x, y, w, h, self.button.palette(), True, 1, None) + if fillCol.isValid(): + painter.fillRect( x+1, y+1, w-2, h-2, fillCol) + + if self.button.hasFocus(): + focusRect = self.button.style().subElementRect(QtGui.QStyle.SE_PushButtonFocusRect, opt, self.button) + focusOpt = QtGui.QStyleOptionFocusRect() + focusOpt.initFrom(self.button) + focusOpt.rect = focusRect + focusOpt.backgroundColor = self.button.palette().background().color() + self.button.style().drawPrimitive(QtGui.QStyle.PE_FrameFocusRect, focusOpt, painter, self.button) + return True + + elif eventType == event.MouseMove: + if not self._mouse_pressed: + return False + + if event.buttons() & QtCore.Qt.LeftButton: + if (self._mousepress_pos - event.pos()).manhattanLength() > QtGui.QApplication.startDragDistance(): + self._mouse_pressed = False + self.button.setDown(False) + drag = QtGui.QDrag(self.button) + data = QtCore.QMimeData() + data.setColorData(QtCore.QVariant(self._color)) + drag.setMimeData(data) + drag.start(QtCore.Qt.CopyAction) + return True + + elif eventType == event.MouseButtonPress: + self._mousepress_pos = QtCore.QPoint(event.pos()) + self._mouse_pressed = True + return False + + elif eventType == event.MouseButtonRelease: + self._mouse_pressed = False + return False + + elif eventType == event.DragEnter: + if event.mimeData().hasColor(): + event.accept() + else: + event.ignore() + return True + + elif eventType == event.DragMove: + if event.mimeData().hasColor(): + event.accept() + else: + Event.ignore() + return True + + elif eventType == event.Drop: + if event.mimeData().hasColor(): + v = event.mimeData().colorData() + self.setColor( QtGui.QColor(v.toString() ) ) + else: + event.ignore() + return True + + + # TODO: copy & paste + if eventType == event.KeyPress: + + if Qt4ExTools.isStandardKeyEvent(event, QtGui.QKeySequence.Copy): + mimeData = QtCore.QMimeData() + mimeData.setColorData(QtCore.QVariant(self.getColor() ) ) + QtGui.QApplication.clipboard().setMimeData(mimeData, QtGui.QClipboard.Clipboard) + elif qtools.isStandardKeyEvent(event, QtGui.QKeySequence.Paste): + mimeData = QtGui.QApplication.clipboard().mimeData(QtGui.QClipboard.Clipboard) + if mimeData.hasColor(): + v = mimeData.colorData() + self.setColor( QtGui.QColor(v.toString() ) ) + + + + + + """ + void KColorButton::keyPressEvent( QKeyEvent *e ) + { + int key = e->key() | e->modifiers(); + + if ( KStandardShortcut::copy().contains( key ) ) { + QMimeData *mime=new QMimeData; + KColorMimeData::populateMimeData(mime,color()); + QApplication::clipboard()->setMimeData( mime, QClipboard::Clipboard ); + } + else if ( KStandardShortcut::paste().contains( key ) ) { + QColor color=KColorMimeData::fromMimeData( QApplication::clipboard()->mimeData( QClipboard::Clipboard )); + setColor( color ); + } + else + QPushButton::keyPressEvent( e ); + } + """ + + return False + + + ############################################# + ## methods + ############################################# + def chooseColor(self): + """Pops up a color selection dialog to adjust the color of the button""" + color = QtGui.QColorDialog.getColor(self._color, self.button) + if color.isValid(): + self.setColor(color) + self.emit(QtCore.SIGNAL('colorChanged(const QColor*)'), color) + + def getColor(self): + """Returns the color of the button + @return: QColor + """ + return self._color + + def setColor(self, color): + """Sets the color of the button + @param color: QColor + """ + self._color = color + self.button.update() + self.emit(QtCore.SIGNAL('colorChanged(const QColor*)'), color) + + +#******************************************************************** +# +#******************************************************************** +if __name__ == '__main__': + import sys + + app = QtGui.QApplication(sys.argv) + w = QtGui.QWidget(None) + box = QtGui.QVBoxLayout(w) + colors = ('yellow', 'red', 'green', 'blue') + for color in colors: + bt = QtGui.QPushButton(w) + wrap = ColorButtonWrap(bt, QtGui.QColor(color)) + box.addWidget(bt) + + + + w.show() + res = app.exec_() + sys.exit(res) + + + + \ No newline at end of file Added: trunk/fclient/src/fclient/lib/qt4ex/dlgabout.py =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/dlgabout.py (rev 0) +++ trunk/fclient/src/fclient/lib/qt4ex/dlgabout.py 2008-07-13 09:43:02 UTC (rev 604) @@ -0,0 +1,123 @@ +from __future__ import absolute_import +if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below + import os; __path__ = [os.path.dirname(__file__)] + +import sys, os +import cPickle +from PyQt4 import QtCore, QtGui + +from .tpls.Ui_DlgAbout import Ui_DlgAbout +from .lib import tools +#********************************************************************* +# +#********************************************************************* +class DlgAbout(QtGui.QDialog, Ui_DlgAbout): + + # control ids + IdLabelAbout = 'label_about' + + + def __init__(self, + parent, + state=None, + caption=None, + appName=None, + description=None, + version=None, + author=None, + email=None, + licence=None, + copyright=None, + ): + """ + @param state: formerly saved state of the dialog or None + @param caption: ttle of the dialog or None + @note: all other keyword params should be pretty self explanatory and + should be (str, QString). + + """ + + QtGui.QDialog.__init__(self, parent) + self.setupUi(self) + + if caption is not None: + self.setWindowTitle(caption) + + label = self.controlById(self.IdLabelAbout) + + text = '' + if appName is not None: + text += '<h3>%s</h3>\n' % appName + if description is not None: + text += '<hr>%s<hr>\n' % description + + text += '<ul>\n' + if version is not None: + text += ' <li>Version: %s\n' % version + if author is not None: + text += ' <li>Author: %s\n' % author + if email is not None: + text += ' <li>Email: %s\n' % email + if licence is not None: + text += ' <li>Licence: %s\n' % licence + if copyright is not None: + text += ' <li>Copyright: %s\n' % copyright + + for name, version in tools.versionInfo(): + text += ' <li>%s: %s\n' % (name, version) + + text += '</ul>\n' + label.setText(text) + + # restore state + if state is not None: + self.restoreState(state) + + + def controlById(self, id_control): + """Returns a widget of the dialog given its id""" + return getattr(self, id_control) + + + def saveState(self): + """Saves the state of the dialog + @return: (str) state + """ + return cPickle.dumps(self.saveGeometry(), 0) + + + def restoreState(self, state): + """Restores the state of the dialog + @param state: formerly saved state + @return True if successful, False otherwise + """ + result = False + try: + state = cPickle.loads(state) + except: pass + else: + try: + result = self.restoreGeometry(state) + except: pass + return result + +#*********************************************************************** +# +#*********************************************************************** +if __name__ == '__main__': + import sys + + app = QtGui.QApplication(sys.argv) + w = DlgAbout(None, + caption=None, + appName=None, + description=None, + version=None, + author=None, + email=None, + licence=None, + copyright=None, + ) + w.show() + res = app.exec_() + sys.exit(res) Added: trunk/fclient/src/fclient/lib/qt4ex/dlgfindreplace.py =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/dlgfindreplace.py (rev 0) +++ trunk/fclient/src/fclient/lib/qt4ex/dlgfindreplace.py 2008-07-13 09:43:02 UTC (rev 604) @@ -0,0 +1,400 @@ + +# TODO: feedback on how many occurences have been replaced +from __future__ import absolute_import +if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below + import os; __path__ = [os.path.dirname(__file__)] + +import os, sys +import cPickle + +from PyQt4 import QtCore, QtGui + +from .tpls.Ui_DlgFindReplace import Ui_DlgFindReplace +from . import checkarraywrap +#***************************************************************** +# find parameters +#***************************************************************** +class FindParams(QtCore.QObject): + """data class that holds parameters of the current search""" + + DlgReplace = 0x1 # displays a replace dialog + + ActionDownwards = 0x100 # search direction is downwards + ActionUpwnwards = 0x200 # search direction is upwards + ActionReplace = 0x400 # replace + ActionReplaceAll = 0x800 # replace all + MaskActionsFind = ActionDownwards | ActionUpwnwards + MaskActionsReplace = ActionReplace | ActionReplaceAll + MaskActions = MaskActionsFind | MaskActionsReplace + + MatchNone = 0 + MatchWholeWord = 0x10000 # searches whole word + MatchCase = 0x20000 # searches case sensitive + MatchRegularExpression = 0x40000 # regular expression + MatchCustom1 = 0x80000 + MatchCustom2 = 0x100000 + MatchCustom3 = 0x200000 + MaskMatches = MatchWholeWord | MatchCase | MatchRegularExpression | \ + MatchCustom1 | MatchCustom1 | MatchCustom1 + + + __slots__ = ("flags", "find", "replace") + def __init__(self, parent): + """constructor + + @param parent: parent + @attr flags: one or more Action*, Dlg* and Match* flags + @attr find: (QString) string to find + @attr replace: (QString) string to replace + + @cvar DlgReplace: displays a Replace dialog + + @cvar ActionDownwards: the user hit the "Find Next" button + @cvar ActionUpwards: the user hit the "Upwards" button + @cvar ActionReplace: the user hit the "Replace" button + @cvar ActionReplaceAll: the user hit the "Replace All" button + @cvar MaskActionsFind: mask for find actions + @cvar MaskActionsReplace: mask for replace actions + @cvar MaskActions: mask for actions + + @cvar MatchNone: default match flag + @cvar MatchWholeWord: the user checked the "Match Word" checkbox + @cvar MatchCase: the user checked the "Match Case" checkbox + @cvar MatchRegualrExpressioin: the user checked the "Regualr Expression" checkbox + @cvar MatchCustom1: the user checked the custom-1 checkbox + @cvar MatchCustom2: the user checked the custom-2 checkbox + @cvar MatchCustom3: the user checked the custom-3 checkbox + @cvar MaskMatches: mask for match checkboxes + + """ + QtCore.QObject.__init__(self, parent) + + self.flags = self.MatchNone + self.find = QtCore.QString() + self.replace = QtCore.QString() + + + def giveFeedback(self, n): + """Notifies listenrers about the result of a find or replace action + @param n: (uint) number of occurences found or replaced + """ + self.emit(QtCore.SIGNAL('giveFeedback(int)'), n) + + + def printFindParams(self): + """helper for debugging, prints out all info gatherd in the class""" + print '-------------------------------------------' + print self.flags & self.DlgReplace and "<Replace Dialog>" or "<Find Dialog>" + print "Action:", { + self.ActionDownwards: "Find Downwards", + self.ActionUpwnwards: "Find Upwards", + self.ActionReplace: "Replace", + self.ActionReplaceAll: "Replace All", + }[self.flags & self.MaskActions] + print 'Find:', repr(str(self.find)) + print 'Replace:', repr(str(self.replace)) + print "Match Case:", bool(self.flags & self.MatchCase) + print "Match Word:", bool(self.flags & self.MatchWholeWord) + print "Match Regex:", bool(self.flags & self.MatchRegularExpression) + print "Match custom1:", bool(self.flags & self.MatchCustom1) + print "Match Custom2:", bool(self.flags & self.MatchCustom2) + print "Match Custom3:", bool(self.flags & self.MatchCustom3) + print '-------------------------------------------' + +#******************************************************************** +# +#******************************************************************** +class DlgFindReplace(QtGui.QDialog, Ui_DlgFindReplace): + """Displays a find or replace dialog + + In addition to the default checks for MatchWord, MatchCase, MatchRegularExperession + the dialog supports up to three custom checkboxes. + + + sample code: + + + def onReplaceWhatever(self): + + # setup find params + findParams = FindParams(self) + + # display a replace dialog + findParams.flags = FindParams.DlgReplace + + # checks to set initially + findParams.flags |= FindParams.WholeWord | FindParams.MatchCase + + # adjust checks to be shown + showChecks = FindParams.WholeWord | FindParams.MatchCase | FindParams.Custom1 + + # create dialog + dlg = DlgFindReplace(parent + #state=self.getDialogFindReplaceLastSate(), + findParams=findParams, + showChecks=showChecks, + customChecks=('My Custom Checkbox', ), + # if find or replace history was saved last time the dialog was run, pass them + #findHistory=MySavedFindHistory, + #replaceHistory=MySavedReplaceHistory, + ) + + # connect and run dialog + self.connect(dlg, QtCore.SIGNAL('find(QObject*)'), self.onReplaceDialog) + dlg.exec_() + + # save state if desired + state = dlg.saveState() + + def onReplaceDialog(self, findParams): + + if findParams.flags & FindParams.ReplaceAll: + + # user checked 'My Custom Checkbox' + myFlag = bool(findParams.flags & FindParams.MatchCustom1) + + # do replacement + nReplacements = self.replaceWhatever(myFlag) + + # notify dialog about the changes + findParams.notifyChanges(nReplacements) + """ + + # consts + IdLabelFind = 'labelFind' + IdLabelReplace = 'labelReplace' + IdCmbFind = 'cmbFind' + IdCmbReplace = 'cmbReplace' + + IdBtActionDownwards = 'btFindDownwards' + IdBtActionUpwnwards = 'btFindUpwards' + IdBtReplace = 'btReplace' + IdBtReplaceAll = 'btReplaceAll' + IdBtOk = 'btOk' + + IdLabelStatus = 'labelStatus' + + IdCkWholeWord = 'ckWholeWord' + IdCkMatchCase = 'ckMatchCase' + IdCkRegularExpression = 'ckRegularExpression' + IdCkCustom1 = 'ckCustom1' + IdCkCustom2 = 'ckCustom2' + IdCkCustom3 = 'ckCustom3' + + Checks = { + FindParams.MatchWholeWord: IdCkWholeWord, + FindParams.MatchCase: IdCkMatchCase, + FindParams.MatchRegularExpression: IdCkRegularExpression, + FindParams.MatchCustom1: IdCkCustom1, + FindParams.MatchCustom2: IdCkCustom2, + FindParams.MatchCustom3: IdCkCustom3, + } + CustomChecks = (IdCkCustom1, IdCkCustom2, IdCkCustom3) + + + def __init__(self, parent, + state=None, + findParams=None, + showChecks=None, + customChecks=None, + ): + """ + @param findParams: FindParams instance. The state of the checkboxes is initialized according + to FindParams.flags (Match* flags) in the FindParams instance passed. If the DlgReplace flag is + set, a Replace dialog is displayed. + @param state: (str) state of the dialog to restore or None (overwrites initial findParams) + @param showChecks: FindParams.Match* flags with checks to show. Default shows all checks + @param customChecks: (list QStrings) text for custom checkboxes or None + + @signal SIGNAL('find(QObject* findParams)'): emitted when the user hits one of the find or replace buttons. + """ + + QtGui.QDialog.__init__(self, parent) + self.setupUi(self) + + self._checkArray = None + self._findParams = findParams + + # init buttons + buttons = ( + (self.IdBtActionDownwards, self.onBtActionDownwards), + (self.IdBtActionUpwnwards, self.onBtActionUpwnwards), + (self.IdBtReplace, self.onBtReplace), + (self.IdBtReplaceAll, self.onBtReplaceAll), + (self.IdBtOk, self.close), + ) + for idControl, cb in buttons: + self.connect(self.controlById(idControl), QtCore.SIGNAL('clicked()'), cb) + + if findParams is not None: + + self.connect(findParams, QtCore.SIGNAL('giveFeedback(int)'), self.onGiveFeedback) + + # init find or replace + if findParams.flags & findParams.DlgReplace: + self.setWindowTitle(self.trUtf8("Replace...")) + else: + self.setWindowTitle(self.trUtf8("Find...")) + for idControl in (self.IdLabelReplace, self.IdCmbReplace, self.IdBtReplace, self.IdBtReplaceAll): + ctrl = self.controlById(idControl) + ctrl.setEnabled(False) + ctrl.setVisible(False) + + + # init checks + checks = self.Checks.copy() + for const, idControl in checks.items(): + checks[const] = self.controlById(idControl) + self._checkArray = checkarraywrap.CheckArrayWrap( + self, + checks, + value=findParams.flags + ) + if findParams is not None: + self._checkArray.setChecks(findParams.flags & findParams.MaskMatches) + + if showChecks is not None: + self._checkArray.showChecks(showChecks) + if customChecks is not None: + customChecks = list(customChecks) + for n, idControl in enumerate(self.CustomChecks): + ck = self.controlById(idControl) + if customChecks: + ck.setText(customChecks.pop(0)) + else: + ck.setEnabled(False) + ck.setVisible(False) + if customChecks: + raise ValueError('Only %s custom checks supported' % len(CustomChecks)) + + # TODO: check if overwrite is ok + if state is not None: + self.restoreState(state) + + ############################################ + ## events + ############################################ + def showEvent(self, event): + label = self.controlById(self.IdLabelStatus) + label.setText(self.trUtf8('Ready')) + self.resize(self.width(), 0) + self.setFixedHeight(self.height()) + + ################################################ + ## slots + ################################################ + def onBtActionDownwards(self): self._emitSignalFind(FindParams.ActionDownwards) + def onBtActionUpwnwards(self): self._emitSignalFind(FindParams.ActionUpwnwards) + def onBtReplace(self): self._emitSignalFind(FindParams.ActionReplace) + def onBtReplaceAll(self): self._emitSignalFind(FindParams.ActionReplaceAll) + + def onGiveFeedback(self, n): + """Slot called when the client gives feedback via FindParams()""" + label = self.controlById(self.IdLabelStatus) + if self._findParams.flags & FindParams.MaskActionsReplace: + label.setText(self.trUtf8('Replaced:') + ' ' + str(n)) + else: + label.setText(self.trUtf8('Found:') + ' ' + str(n)) + + ############################################## + ## private methods + ############################################## + def _emitSignalFind(self, flagFind): + """Emits the find signal""" + if self._findParams is None: + return + + flags = self._checkArray.getValue() + flags &= ~self._findParams.MaskActions + flags |= flagFind + self._findParams.flags = flags + self._findParams.find = self.controlById(self.IdCmbFind).lineEdit().text() + if flags & self._findParams.DlgReplace: + self._findParams.replace = self.controlById(self.IdCmbReplace).lineEdit().text() + else: + self._findParams.replace = "" + self.emit(QtCore.SIGNAL('find(QObject*)'), (self._findParams)) + + ############################################ + ## methods + ############################################ + def controlById(self, id_control): + """Returns a control fiven its id (one of the Id* consts as defined by the module)""" + return getattr(self, id_control) + + + def saveComboHistory(self, idCmb): + """Saves the find or replace history + @param idCmb: id of the combobox to save the history for + @return (QStringList) history + """ + cmb = self.controlById(IdCmb) + L = QtCore.QStringList() + for i in range(cmb.count()): + L << cmb.itemText(i) + return L + + + def saveState(self): + """Saves the state of the dialog + @return: (str) state + """ + state = { + 'checks': self._findParams.flags & FindParams.MaskMatch, + 'geometry': self.saveGeometry(), + 'historyFind': self.saveComboHistory(self.IdCmbFind), + 'historyReplace': self.saveComboHistory(self.IdCmbReplace), + } + return cPickle.dumps(state, 0) + + + def restoreState(self, state): + """Restors the state of the dialog + @param state: (str) state to restore + """ + # TODO: not tested + result = False + try: + state = cPickle.loads(state) + except Exception, d: pass + else: + # + try: + self.restoreGeometry(tate.get('geometry', None)) + except Exception, d: pass + # restore combos + try: + self.controlById(self.IdCmbFind).addItems(state.get('historyFind', None)) + except Exception, d: pass + try: + self.controlById(self.IdCmbReplace).addItems(state.get('historyReplace', None)) + except Exception, d: pass + # restore checks + try: + self._checkArray.setChecks(state.get('checks', 0)) + except Exception, d: pass + + +#*********************************************************************** +# +#*********************************************************************** +if __name__ == '__main__': + import sys + + app = QtGui.QApplication(sys.argv) + + findParams = FindParams(None) + findParams.flags |= findParams.DlgReplace + w =DlgFindReplace(None, + findParams=findParams, + customChecks=('A Custom Checkbox', ), + ) + + def cb(findParams): + findParams.printFindParams() + findParams.giveFeedback(10) + w.connect(w, QtCore.SIGNAL('find(QObject*)'), cb) + + w.show() + res = app.exec_() + sys.exit(res) Added: trunk/fclient/src/fclient/lib/qt4ex/dlgpreferences.py =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/dlgpreferences.py (rev 0) +++ trunk/fclient/src/fclient/lib/qt4ex/dlgpreferences.py 2008-07-13 09:43:02 UTC (rev 604) @@ -0,0 +1,821 @@ +"""Preferences dialog""" +from __future__ import absolute_import +if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below + import os; __path__ = [os.path.dirname(__file__)] + +# TODO: +# +# x. how to set some reasonable initial size? Mabe split the page population +# process into two stages: 1. precreate all page widgets 2. tell the individual page +# to init settings +# +# widget = page.create(parent) +# page.initialize() +# page.setVisible(flag) +# + + + +import sys, os +import cPickle + +from PyQt4 import QtCore, QtGui + +from .tpls.Ui_DlgPreferencesTree import Ui_DlgPreferencesTree +from .treewidgetwrap import TreeWidgetIterator +#********************************************************************* +# +#********************************************************************* +class Page(QtCore.QObject): + """Base class for preferences dialog pages + + usage: + + overwrite setVisible() to create the widget ontaining widgets of the preferences page + (if not already done) in the call. Overwrite all the can*() and do*() methods. Call + setDirty(True) when appropriate. + + sample code: + + class MyPage(Page): + + def __init__(self, *args): + Page.__init__(self, *args) + self._widget = None + + def setVisible(self, parent, flag): + createdNew = False + if flag and self._widget is None: + self._widget = self.CreateMyWidget(parent) + createdNew = True + self._widget.setVisible(flag) + return (createdNew, self._widget) + + ...use __call__() to setup hirarchical trees of pages + + page = Page('Parent')( + Page('ChildPage')( + Page('ChildPage') + ) + ) + + + """ + + _version_ = 1 # version number + + def __init__(self, uuid): + """Creates a new preferences page + @param uuid: (str) unique id of the page. + @note: currrently no check is done to eshure the uuid is unique throughout the tree of pages. + """ + QtCore.QObject.__init__(self) + self._pageData = { # internal state data + 'children': [], + 'isDirty': False, + 'lastSelectedChildPage': None, + 'parent': None, + 'userData': None, + 'uuid': uuid, + } + + def __call__(self, *others): + """Adds one or more pages as child pages to a page""" + children = self._pageData['children'] + for i in others: + children.append(i) + i._pageData['parent'] = self + return self + + def canApply(self): + """Should return a flag indicating if changes can be emidiatey applied by the page""" + return False + + def canHelp(self): + """Should return a flag indicating if a help page is available for the page""" + return False + + def canRestoreDefaults(self): + """Should return a flag indicating if the page can rstore default value""" + return False + + def children(self): + """Returns a list containing all emidiate child pages of the page""" + return self._pageData['children'] + + def displayName(self): + """Should return the name of the page as it is to be displayed by the preferences dialog + @return: QString + """ + return self.trUtf8('Page') + + def doApply(self): + """Should apply changes made + @return: True on success, False otherisde + """ + return True + + def doCancel(self): + """Should cancel all changes made + @return: True on success, False otherisde + """ + return True + + def doOk(self): + """Should apply changes + @return: True on success, False otherisde + """ + return True + + def doRestoreDefaults(self): + """Should restore defaults + @return: True on success, False otherisde + """ + return True + + def doHelp(self): + """Should pop up a help page for the page""" + + def icon(self): + """Should return the icon associated to a page or None""" + + def isDirty(self): + """Should return a flag indicating if the page has unsaved changes""" + return self._pageData['isDirty'] + + def lastSelectedChildPage(self): + """Returns the uuid of the most recently selected child page of the current page""" + return self._pageData['lastSelectedChildPage'] + + def pageFromUuid(self, uuid): + """Traverses the page and all its children to return a page given its uuid + @return: page or None if no page was found""" + for page in self.walk(): + if page.uuid() == uuid: + return page + + def parent(self): + """Returns the parent page of the page""" + return self._pageData['parent'] + + def setDirty(self, flag): + """Sets or clears the dirty flag""" + self._pageData['isDirty'] = bool(flag) + self.emit(QtCore.SIGNAL('setDirty(bool)'), self._pageData['isDirty']) + + def setUserData(self, data): + """Assignes any user data to the page + @param data: any data + @note: user data is reserved to Ui implementations displaying pages, do not use. + """ + self._pageData['userData'] = data + + def setLastSelectedChildPage(self, uuid): + """Stores the specified uuid as most recently selected child page of the current page""" + self._pageData['lastSelectedChildPage'] = uuid + + def setVisible(self, parent, flag): + """Should show or hide the page or create it if not already done + @param parent: parent widget + @param flag: True if the page is to be shown, False if it is to be hidden + @return: tuple(bool createdNew, QWidget widget) + """ + return (False, None) + + def userData(self): + """Returns internal user data""" + return self._pageData['userData'] + + def uuid(self): + """Returns the uuid of the page""" + return self._pageData['uuid'] + + def walk(self, report=False): + """Walks over a page and all its children + @param report: if If False the next page in turn is returned. If True, a tupple(flag, page) for the next + page in turn is returned, where flag is 1 if a page is a container for child pages, 0 if a page has no + child pages and -1 if traversal of a pages child pages is completed. + """ + if report: + def walker(page): + children = page.children() + if children: + yield 1, page + for childPage in children: + for x in walker(childPage): + yield x + yield -1, page + else: + yield 0, page + else: + def walker(page): + yield page + for childPage in page.children(): + for x in walker(childPage): + yield x + + return walker(self) + +#********************************************************************* +# +#********************************************************************* +class PageControler(QtCore.QObject): + """Controler for pages""" + + PageQueryParent = 1 + PageAdd = 2 + + PrefixCapability = 'can' + PrefixCapabilityApply = 'do' + MethodNameIsDirty = 'isDirty' + MethodNameApply = 'doApply' + + + def __init__(self, ui, cb, pageContainer, buttonBox, maxPageDepth=None, pages=None): + """ + @param ui: (QDialog) parent + @param cb: callback + @param pageContainer: (QWidget) displaying pages + @param maxPageDepth: (int) maximum nesting depth of pages. If None pages + may be nested up to sys.maxint + @param opages: tree of ppages to control + + @note: the callback will be called with three arguments: + + 1. one of the Page* consts to indicate the action + 2. message dependend param + 3. message dependend param + + messages: + + 1. PageQueryParent = the parent for all pages is requested + param1 = param2 = always none + return = (QWidget) parent + note = the parent returned will be passed + as param1 to all toplevel calls to PageAdd + + 2. PageAdd = a page should be added. + param1 = return value of the last call to PageAdd the parent page or None + param2 = the page to be added + return = will be passed in the next call of PageAdd to all emidiate child pages + + """ + QtCore.QObject.__init__(self, ui) + + self.buttonBox = buttonBox + self.cb = cb + self.grid = QtGui.QGridLayout(pageContainer) + self.lastSelectedPage = None + self.pageContainer = pageContainer + self.pages = pages + self.ui = ui + + # buttons handld by the controler + self.buttonBoxButtons = { + QtGui.QDialogButtonBox.Apply: 'Apply', + QtGui.QDialogButtonBox.Cancel: 'Cancel', + QtGui.QDialogButtonBox.Help: 'Help', + QtGui.QDialogButtonBox.Ok: 'Ok', + QtGui.QDialogButtonBox.RestoreDefaults: 'RestoreDefaults', + } + # page depandend buttons of the button box + self.buttonBoxOptionalButtons = ( + QtGui.QDialogButtonBox.Apply, + QtGui.QDialogButtonBox.Help, + QtGui.QDialogButtonBox.RestoreDefaults, + ) + + + # dump sections and pages to tree + if pages is not None: + + # drop root item + enum = iter(pages.walk(report=True)) + flag, root = enum.next() + + # dump items + parent = self.cb(self.PageQueryParent, None, None) + pageStack = [parent, ] + for flag, page in enum: + if flag == -1: + pageStack.pop() + continue + page.setParent(parent) + result = self.cb(self.PageAdd, pageStack[-1], page) + + if flag == 1: + if maxPageDepth is not None: + if len(pageStack) > maxPageDepth: + raise ValueError('Pages nested to deeply (%s level allowed)' % maxPageDepth) + pageStack.append(result) + + # setup button box + self.connect( + buttonBox, + QtCore.SIGNAL('clicked(QAbstractButton*)'), + self.onStandardButtonClicked + ) + self.adjustStandardButtons(None) + + + + ################################################ + ## slots + ################################################ + def onPageDirtyChanged(self, flag): + bt = self.buttonBox.button(QtGui.QDialogButtonBox.Apply) + if bt.isVisible(): + bt.setEnabled(flag) + + + def onStandardButtonClicked(self, button): + if self.lastSelectedPage is None: + return + + page = self.lastSelectedPage[0] + standardButton = self.buttonBox.standardButton(button) + standardButtonName = self.buttonBoxButtons.get(standardButton, None) + if standardButtonName is not None: + methodName = self.PrefixCapabilityApply + standardButtonName + method = getattr(page, methodName, None) + if method is None: + raise valueError('Pages must prvide a "%s" method' % methodName) + if method(): + if standardButton == QtGui.QDialogButtonBox.Apply: + page.setDirty(False) + + + ################################################## + ## methods + ################################################## + def adjustStandardButtons(self, page): + + for standardButton in self.buttonBoxOptionalButtons: + bt = self.buttonBox.button(standardButton) + if bt is None: + standardButtonName = self.buttonBoxButtons[standardButton] + raise ValueError('Button not found: ' + standardButtonName) + + # show / hide standard buttons + flag = False + if page is not None: + standardButtonName = self.buttonBoxButtons[standardButton] + methodName = self.PrefixCapability + standardButtonName + method = getattr(page, methodName, None) + if method is None: + raise valueError('Pages must prvide a "%s" method' % methodName) + flag = method() + bt.setEnabled(flag) + bt.setVisible(flag) + + # enable Apply button if necessary + if flag and standardButton == QtGui.QDialogButtonBox.Apply: + method = getattr(page, self.MethodNameIsDirty, None) + if method is None: + raise valueError('Pages must prvide a "%s" method' % self.MethodNameIsDirty) + bt.setEnabled(method()) + + + def close(self): + """Close the controler + @note: make shure to call this method on exit to apply outstanding changes + """ + if self.pages is not None: + for page in self.pages.walk(): + if page.isDirty(): + method = getattr(page, self.MethodNameApply, None) + if method is None: + raise ValueError('Pages must provide a "%s" method' % self.MethodNameApply) + method() + + + + def currentPage(self): + """Returns the currently displayed page or None""" + if self.lastSelectedPage is not None: + return self.lastSelectedPage[0] + + + def currentPageUuid(self): + """Returns the uuid of the current page or None""" + page = self.currentPage() + if page is not None: + return page.uuid() + + + def setCurrentPage(self, page): + """Displays a page""" + + # hide last page + if self.lastSelectedPage is not None: + oldPage, oldWidget = self.lastSelectedPage + if oldPage == page: + return + oldPage.setVisible(self.pageContainer, False) + self.grid.removeWidget(oldWidget) + self.disconnect( + page, + QtCore.SIGNAL('setDirty(bool)'), + self.onPageDirtyChanged + ) + self.lastSelectedPage = None + + # create next page if necessary + createdNew, widget = page.setVisible(self.pageContainer, True) + self.lastSelectedPage = (page, widget) + + # setup page + self.adjustStandardButtons(page) + self.connect( + page, + QtCore.SIGNAL('setDirty(bool)'), + self.onPageDirtyChanged + ) + + # inform parent about changes + if page.parent() is not None: + page.parent().setLastSelectedChildPage(page.uuid()) + + # enshure enough space is available for the widget + if widget is not None: + if createdNew: + cx, cy, cw, ch = self.grid.getContentsMargins() + w = widget.width() + cx + cw + h = widget.height() + cy + ch + pageContainerSize = self.pageContainer.minimumSize() + pageContainerW = pageContainerSize.width() + pageContainerH = pageContainerSize.height() + if pageContainerW < w or pageContainerH < h: + if pageContainerW > w: + w = pageContainerW + if pageContainerH > h: + h = pageContainerH + self.pageContainer.setMinimumSize(w, h) + # + # add page widget + self.grid.addWidget(widget) + self.grid.activate() + + ############################ + ##widget.setAutoFillBackground(True) + ##pal = QtGui.QPalette() + ##pal.setColor(pal.Window, QtGui.QColor('white')) + ##widget.setPalette(pal) + ############################# + + + def setCurrentPageFromUuid(self, uuid): + """Sets the current page from the pages uuid + @param uuid: unique id of the page + @return: the page selected or none + """ + if self.pages is not None: + page = self.pages.pageFromUuid(uuid) + if page is not None: + self.setCurrentPage(page) + return page + + +#********************************************************************* +# +#********************************************************************* +class DlgPreferencesTree(QtGui.QDialog, Ui_DlgPreferencesTree): + """Preferences dialog that lets the user navigate a page hirarchy via a tree + """ + + IdButtonBox = 'buttonBox' + IdFramePages = 'framePages' + IdTreePages = 'treePages' + IdSplitter = 'splitter' + + def __init__(self, + parent, + caption=None, + pages=None, + startPage=None, + state=None, + maxDepth=None, + ): + """ + @param parent: parent window or ... [truncated message content] |
From: <jU...@us...> - 2008-07-13 09:42:12
|
Revision: 603 http://fclient.svn.sourceforge.net/fclient/?rev=603&view=rev Author: jUrner Date: 2008-07-13 02:42:21 -0700 (Sun, 13 Jul 2008) Log Message: ----------- reorganisation of qt4ex Removed Paths: ------------- trunk/fclient/src/fclient/lib/qt4ex/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 20:01:07
|
Revision: 602 http://fclient.svn.sourceforge.net/fclient/?rev=602&view=rev Author: jUrner Date: 2008-07-12 13:01:07 -0700 (Sat, 12 Jul 2008) Log Message: ----------- fix exception Modified Paths: -------------- trunk/fclient/src/fclient/lib/qt4ex/settings.py Modified: trunk/fclient/src/fclient/lib/qt4ex/settings.py =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/settings.py 2008-07-12 20:00:08 UTC (rev 601) +++ trunk/fclient/src/fclient/lib/qt4ex/settings.py 2008-07-12 20:01:07 UTC (rev 602) @@ -294,7 +294,7 @@ elif len(i) == 4: setting = Setting(i[1], i[2], i[2], userData=i[3]) else: - raise ValueError('setting data should be 2 or three tuple: %r' % name) + raise ValueError('setting data should be 2 or three tuple: %r' % i[0]) name = i[0] if name in self._settingsOrder: raise valueError('setting already exists: %r' % name) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 20:00:05
|
Revision: 601 http://fclient.svn.sourceforge.net/fclient/?rev=601&view=rev Author: jUrner Date: 2008-07-12 13:00:08 -0700 (Sat, 12 Jul 2008) Log Message: ----------- customize context menu Modified Paths: -------------- trunk/fclient/src/fclient/Ui_ViewLogger.py Modified: trunk/fclient/src/fclient/Ui_ViewLogger.py =================================================================== --- trunk/fclient/src/fclient/Ui_ViewLogger.py 2008-07-12 19:59:24 UTC (rev 600) +++ trunk/fclient/src/fclient/Ui_ViewLogger.py 2008-07-12 20:00:08 UTC (rev 601) @@ -7,7 +7,7 @@ import sys logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) -from PyQt4 import QtGui +from PyQt4 import QtCore, QtGui from . import config @@ -21,9 +21,31 @@ _key_ = config.IdViewLoggerWidget _settings_ = ( - ('MaxLines', 'UInt', 1000), + ('MaxLines', 'UInt', 1000, config.SettingScopeUser), ) +#*********************************************************************** +# +#*********************************************************************** +#TODO: more here... +class TextEditActionClear(QtGui.QAction): + + def __init__(self, menu, ed): + QtGui.QAction.__init__(self, ed) + self.setText(self.trUtf8('Clear')) + ##self.setShortcut(self.trUtf8("del")) + self.connect(self, QtCore.SIGNAL('triggered(bool)'), self.handleTriggered) + self.connect(menu, QtCore.SIGNAL('aboutToShow()'), self.handleMenuAboutToShow) + + self.ed = ed + + def handleMenuAboutToShow(self): + self.setEnabled(not self.ed.document().isEmpty()) + + def handleTriggered(self, isChecked): + self.ed.clear() + + #*********************************************************************** # #*********************************************************************** @@ -53,6 +75,7 @@ self.settings.restore() ed = self.controlById(self.IdEddLogger) ed.document().setMaximumBlockCount(self.settings.value('MaxLines')) + ed.contextMenuEvent = self.edLoggerContextMenuEvent self.loggingHandler = self.MyLoggingHandler(self.addMessage) logging.getLogger('').addHandler(self.loggingHandler) @@ -65,6 +88,22 @@ ed = self.controlById(self.IdEddLogger) ed.append(text) + +######################################### + ## overwritten events + ######################################### + def edLoggerContextMenuEvent(self, event): + """customize context menu of the logger QTextEdit""" + ed = self.controlById(self.IdEddLogger) + menu = ed.createStandardContextMenu() + + act = TextEditActionClear(menu, ed) + menu.addAction(act) + + menu.exec_(event.globalPos()) + + + #********************************************************************************** # #********************************************************************************** @@ -91,14 +130,4 @@ def close(self): pass -#********************************************************************************** -# -#********************************************************************************** -if __name__ == '__main__': - import sys - - app = QtGui.QApplication(sys.argv) - w = ViewLoggerWidget(None) - w.show() - res = app.exec_() - sys.exit(res) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 19:59:18
|
Revision: 600 http://fclient.svn.sourceforge.net/fclient/?rev=600&view=rev Author: jUrner Date: 2008-07-12 12:59:24 -0700 (Sat, 12 Jul 2008) Log Message: ----------- beautify Modified Paths: -------------- trunk/fclient/src/fclient/Ui_ViewConnection.py Modified: trunk/fclient/src/fclient/Ui_ViewConnection.py =================================================================== --- trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-12 19:58:48 UTC (rev 599) +++ trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-12 19:59:24 UTC (rev 600) @@ -15,7 +15,6 @@ class Settings(config.SettingsBase): _key_ = config.IdViewConnectionWidget _settings_ = ( - #TODO: time secs vsmilis. should be either secs or milis. fix in fcp2.Client.connect ('ConnectionTimerTimeout', 'UInt', 800, config.SettingScopeExpert), ('ConnectionTimerMaxDuration', 'UInt', 20, config.SettingScopeExpert), @@ -122,23 +121,20 @@ def retranslateUi(self, w): Ui_ViewConnectionWidget.retranslateUi(self, w) bt = self.controlById(self.IdBtConnect) - if bt.isChecked(): - bt.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Connect", None, QtGui.QApplication.UnicodeUTF8)) - else: - bt.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Disconnect", None, QtGui.QApplication.UnicodeUTF8)) + bt.setText(self.trUtf8('Disconnect') if bt.isChecked() else self.trUtf8('Connect')) + ######################################### ## event handlers ######################################### - def handleBtConnectClicked(self, checked): + def handleBtConnectClicked(self, isChecked): bt = self.controlById(self.IdBtConnect) - if checked: - bt.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Disconnect", None, QtGui.QApplication.UnicodeUTF8)) + bt.setText(self.trUtf8('Disconnect') if isChecked else self.trUtf8('Connect')) + if isChecked: if config.fcpClient.isConnected(): config.fcpClient.close() self._connectionTimer.start(self.settings) else: - bt.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Connect", None, QtGui.QApplication.UnicodeUTF8)) self._connectionTimer.stop() if config.fcpClient.isConnected(): config.fcpClient.close() @@ -172,7 +168,6 @@ def objectName(self): return 'ViewConnection' - def widget(self, parent): if self._widget is None: self._widget = ViewConnectionWidget(parent) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 19:58:43
|
Revision: 599 http://fclient.svn.sourceforge.net/fclient/?rev=599&view=rev Author: jUrner Date: 2008-07-12 12:58:48 -0700 (Sat, 12 Jul 2008) Log Message: ----------- add settings and a bit this and that Modified Paths: -------------- trunk/fclient/src/fclient/Ui_View.py Modified: trunk/fclient/src/fclient/Ui_View.py =================================================================== --- trunk/fclient/src/fclient/Ui_View.py 2008-07-12 19:58:19 UTC (rev 598) +++ trunk/fclient/src/fclient/Ui_View.py 2008-07-12 19:58:48 UTC (rev 599) @@ -24,6 +24,7 @@ class Settings(config.SettingsBase): _key_ = config.IdViewWidget _settings_ = ( + ('LastView', 'String', '', config.SettingScopePrivate), ) #*********************************************************************** @@ -50,8 +51,7 @@ tabTop.removeTab(0) tabBottom = self.controlById(self.IdTabBottom) tabBottom.removeTab(0) - - + def controlById(self, idControl): return getattr(self, idControl) @@ -67,7 +67,7 @@ self.views[ido] = (i, tab, view) - def viewFromUuid(self, uuid): + def viewFromName(self, name): return self.views[uuid] def setCurrentView(self, view): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 19:58:10
|
Revision: 598 http://fclient.svn.sourceforge.net/fclient/?rev=598&view=rev Author: jUrner Date: 2008-07-12 12:58:19 -0700 (Sat, 12 Jul 2008) Log Message: ----------- new ids Modified Paths: -------------- trunk/fclient/src/fclient/config.py Modified: trunk/fclient/src/fclient/config.py =================================================================== --- trunk/fclient/src/fclient/config.py 2008-07-12 19:57:57 UTC (rev 597) +++ trunk/fclient/src/fclient/config.py 2008-07-12 19:58:19 UTC (rev 598) @@ -23,6 +23,9 @@ # with MSVC 6 where you should use qFindChild(). can not test this. so keep # a dict for lookups... #********************************************************************************** +IdMainWindow = 'MainWindow' +IdMainWindowMenuBar = 'MainWindowMenuBar' +IdMainWindowStatusBar = 'MainWindowStatusBar' IdViewWidget = 'ViewWidget' IdViewLoggerWidget = 'ViewLoggerWidget' IdViewConnectionWidget = 'ViewConnectionWidget' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 19:57:50
|
Revision: 597 http://fclient.svn.sourceforge.net/fclient/?rev=597&view=rev Author: jUrner Date: 2008-07-12 12:57:57 -0700 (Sat, 12 Jul 2008) Log Message: ----------- weakref observers Modified Paths: -------------- trunk/fclient/src/fclient/lib/fcp2/lib/events.py Modified: trunk/fclient/src/fclient/lib/fcp2/lib/events.py =================================================================== --- trunk/fclient/src/fclient/lib/fcp2/lib/events.py 2008-07-12 19:57:33 UTC (rev 596) +++ trunk/fclient/src/fclient/lib/fcp2/lib/events.py 2008-07-12 19:57:57 UTC (rev 597) @@ -1,5 +1,6 @@ """Signals and events""" +import weakref #********************************************************************* # #********************************************************************* @@ -81,7 +82,8 @@ """Event class @ivar name: name of the event - @ivar observers: observers listening to the event + @note: only a weak reference is kept observers to automatically remove observers when + the observer is no longer alive >>> event = Event('myEventsName') >>> event.name @@ -101,40 +103,41 @@ @param name: name of the event """ self.name = name - self.observers = [] + self._refs = [] + def __call__(self, *args, **kwargs): """Dispatches the event and additional parameters to all observers registerd @note: all listeners will be called with the event a first parameter, followed by optional args and kwargs """ - for observer in self.observers: - observer(self, *args, **kwargs) - - def __contains__(self, observer): - """Checks if an observer is aleady registered - @return: bool - """ - return observer in self.observers - + for ref in self._refs: + observer = ref() + if ref is not None: + observer(self, *args, **kwargs) + def __iadd__(self, observer): """Adds an observer to the event @note: the observer will be called with the event as first paraeter, followed by any number of *args or **kwargs passed by the caller of an event """ - self.observers.append(observer) + self._refs.append(weakref.ref(observer, self.handleDereference)) return self def __isub__(self, observer): """Removes the first occurence of an observer from the event""" - self.observers.remove(observer) + observers = [i() for i in self._refs] + del self._refs[observers.index(observer)] return self + + def handleDereference(self, ref): + self._refs.remove(ref) #********************************************************************* # #********************************************************************* if __name__ == '__main__': import doctest - doctest.testmod() + print 'doctests failed: %s/%s' % doctest.testmod() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 19:57:26
|
Revision: 596 http://fclient.svn.sourceforge.net/fclient/?rev=596&view=rev Author: jUrner Date: 2008-07-12 12:57:33 -0700 (Sat, 12 Jul 2008) Log Message: ----------- add main window Added Paths: ----------- trunk/fclient/src/fclient/Ui_MainWindow.py trunk/fclient/src/fclient/tpls/MainWindowTpl.ui trunk/fclient/src/fclient/tpls/Ui_MainWindowTpl.py Added: trunk/fclient/src/fclient/Ui_MainWindow.py =================================================================== --- trunk/fclient/src/fclient/Ui_MainWindow.py (rev 0) +++ trunk/fclient/src/fclient/Ui_MainWindow.py 2008-07-12 19:57:33 UTC (rev 596) @@ -0,0 +1,65 @@ +from __future__ import absolute_import +if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below + import os; __path__ = [os.path.dirname(__file__)] + +import logging +import sys +logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) + +from PyQt4 import QtCore, QtGui + + +from . import config +from . import Ui_View + +from .tpls.Ui_MainWindowTpl import Ui_MainWindow +#********************************************************************************** +# +#********************************************************************************** +class Settings(config.SettingsBase): + + _key_ = config.IdMainWindow + _settings_ = ( + ) + +#********************************************************************************** +# +#********************************************************************************** +class StatusBar(QtGui.QStatusBar): + + def __init__(self, parent): + QtGui.QStatusBar.__init__(self, parent) + self.setObjectName(config.IdMainWindowStatusBar) + +#********************************************************************************** +# +#********************************************************************************** +class MainWindow(QtGui.QMainWindow, Ui_MainWindow): + + def __init__(self, parent, cfg=None): + QtGui.QMainWindow.__init__(self, parent) + self.settings = Settings() + self.setupUi(self) + config.ObjectRegistry.register(self) + + # register menuBar + menuBar = self.menuBar() + menuBar.setObjectName(config.IdMainWindowMenuBar) + config.ObjectRegistry.register(menuBar) + + # register statusBar + statusBar = StatusBar(self) + self.setStatusBar(statusBar) + config.ObjectRegistry.register(statusBar) + +#********************************************************************************** +# +#********************************************************************************** +if __name__ == '__main__': + import sys + + app = QtGui.QApplication(sys.argv) + w = MainWindow(None) + w.show() + res = app.exec_() + sys.exit(res) \ No newline at end of file Added: trunk/fclient/src/fclient/tpls/MainWindowTpl.ui =================================================================== --- trunk/fclient/src/fclient/tpls/MainWindowTpl.ui (rev 0) +++ trunk/fclient/src/fclient/tpls/MainWindowTpl.ui 2008-07-12 19:57:33 UTC (rev 596) @@ -0,0 +1,30 @@ +<ui version="4.0" > + <class>MainWindow</class> + <widget class="QMainWindow" name="MainWindow" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>600</height> + </rect> + </property> + <property name="windowTitle" > + <string>MainWindow</string> + </property> + <widget class="QWidget" name="centralwidget" /> + <widget class="QMenuBar" name="menubar" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>26</height> + </rect> + </property> + </widget> + <widget class="QStatusBar" name="statusbar" /> + </widget> + <resources/> + <connections/> +</ui> Added: trunk/fclient/src/fclient/tpls/Ui_MainWindowTpl.py =================================================================== --- trunk/fclient/src/fclient/tpls/Ui_MainWindowTpl.py (rev 0) +++ trunk/fclient/src/fclient/tpls/Ui_MainWindowTpl.py 2008-07-12 19:57:33 UTC (rev 596) @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/MainWindowTpl.ui' +# +# Created: Sat Jul 12 21:39:29 2008 +# by: PyQt4 UI code generator 4.3.3 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,800,600).size()).expandedTo(MainWindow.minimumSizeHint())) + + self.centralwidget = QtGui.QWidget(MainWindow) + self.centralwidget.setObjectName("centralwidget") + MainWindow.setCentralWidget(self.centralwidget) + + self.menubar = QtGui.QMenuBar(MainWindow) + self.menubar.setGeometry(QtCore.QRect(0,0,800,26)) + self.menubar.setObjectName("menubar") + MainWindow.setMenuBar(self.menubar) + + self.statusbar = QtGui.QStatusBar(MainWindow) + self.statusbar.setObjectName("statusbar") + MainWindow.setStatusBar(self.statusbar) + + self.retranslateUi(MainWindow) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + + def retranslateUi(self, MainWindow): + MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8)) + + + +if __name__ == "__main__": + import sys + app = QtGui.QApplication(sys.argv) + MainWindow = QtGui.QMainWindow() + ui = Ui_MainWindow() + ui.setupUi(MainWindow) + MainWindow.show() + sys.exit(app.exec_()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 13:40:30
|
Revision: 595 http://fclient.svn.sourceforge.net/fclient/?rev=595&view=rev Author: jUrner Date: 2008-07-12 06:40:27 -0700 (Sat, 12 Jul 2008) Log Message: ----------- more work on widget Modified Paths: -------------- trunk/fclient/src/fclient/Ui_ViewConnection.py Modified: trunk/fclient/src/fclient/Ui_ViewConnection.py =================================================================== --- trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-12 13:40:07 UTC (rev 594) +++ trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-12 13:40:27 UTC (rev 595) @@ -15,7 +15,9 @@ class Settings(config.SettingsBase): _key_ = config.IdViewConnectionWidget _settings_ = ( - ('ConnectionTimerTimeout', 'UInt', 100, config.SettingScopeExpert), + #TODO: time secs vsmilis. should be either secs or milis. fix in fcp2.Client.connect + ('ConnectionTimerTimeout', 'UInt', 800, config.SettingScopeExpert), + ('ConnectionTimerMaxDuration', 'UInt', 20, config.SettingScopeExpert), ('AutoConnect', 'Bool', False, config.SettingScopeUser), ('ConnectionName', 'String', '', config.SettingScopeUser), #TODO: we need a python ansi string @@ -35,7 +37,10 @@ self.connect(self, QtCore.SIGNAL('timeout()'), self.handleNext) def start(self, settings): - self.iterConnect = config.fcpClient.iterConnect() #TODO: ...more args + self.iterConnect = config.fcpClient.iterConnect( + duration=settings.value('ConnectionTimerMaxDuration'), + timeout=0 + ) QtCore.QTimer.start(self, settings.value('ConnectionTimerTimeout')) def handleNext(self): @@ -54,6 +59,7 @@ class ViewConnectionWidget(QtGui.QWidget, Ui_ViewConnectionWidget): IdBtConnect = 'btConnect' + IdckAutoConnect = 'ckAutoConnect' IdEdConnectionHost = 'edConnectionHost' #TODO: combobox? validate input. IdSpinConnectionPort = 'spinConnectionPort' @@ -82,14 +88,15 @@ return self._isCreated = True - self.connect( - self.controlById(self.IdBtConnect), - QtCore.SIGNAL('clicked(bool)'), - self.handleBtConnectClicked + + self.settings.restore() + + #TODO: when on a tab closeEvent() is never called. how to disconnect on close? + # maybe fcp2.events should use weakrefs? + config.fcpClient.events += ( + (config.fcpClient.events.ClientDisconnected, self.handleFcpClientDisconected), ) - self.settings.restore() - # setup host / port boxes edHost = self.controlById(self.IdEdConnectionHost) edHost.setText(self.settings.value('ConnectionHost')) @@ -98,11 +105,17 @@ spinPort.setRange(0, 0xFFFF) #TODO: no idea if port range (0, 0xFFFF) this is reasonable spinPort.setValue(self.settings.value('ConnectionPort')) - # autoconnect if desired - if self.settings.value('AutoConnect'): - self.controlById(self.IdBtConnect).setChecked(True) - self.onBtConnectClicked(True) - + # setup Connect button and AutoConnect checkbox + doAutoConnect = self.settings.value('AutoConnect') + ck = self.controlById(self.IdckAutoConnect) + ck.setChecked(doAutoConnect) + self.connect(ck, QtCore.SIGNAL('stateChanged(int)'), self.handleCkAutoConnectStateChanged) + + bt = self.controlById(self.IdBtConnect) + self.connect(bt, QtCore.SIGNAL('clicked(bool)'), self.handleBtConnectClicked) + if doAutoConnect: + self.controlById(self.IdBtConnect).click() + ######################################### ## overwritten methods ######################################### @@ -110,7 +123,9 @@ Ui_ViewConnectionWidget.retranslateUi(self, w) bt = self.controlById(self.IdBtConnect) if bt.isChecked(): - bt.setText() + bt.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Connect", None, QtGui.QApplication.UnicodeUTF8)) + else: + bt.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Disconnect", None, QtGui.QApplication.UnicodeUTF8)) ######################################### ## event handlers @@ -118,22 +133,27 @@ def handleBtConnectClicked(self, checked): bt = self.controlById(self.IdBtConnect) if checked: - bt.setText(QtGui.QApplication.translate(config.IdViewConnectionWidget, "Disconnect", None, QtGui.QApplication.UnicodeUTF8)) - + bt.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Disconnect", None, QtGui.QApplication.UnicodeUTF8)) if config.fcpClient.isConnected(): config.fcpClient.close() self._connectionTimer.start(self.settings) - else: - bt.setText(QtGui.QApplication.translate(config.IdViewConnectionWidget, "Connect", None, QtGui.QApplication.UnicodeUTF8)) - config.fcpClient.close() + bt.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Connect", None, QtGui.QApplication.UnicodeUTF8)) self._connectionTimer.stop() + if config.fcpClient.isConnected(): + config.fcpClient.close() + + + def handleCkAutoConnectStateChanged(self, state): + self.settings.setValues(AutoConnect=state == QtCore.Qt.Checked) ######################################### ## fcp event handlers ######################################### - def handleFcpClientDisconected(self, event): - pass + def handleFcpClientDisconected(self, event, msg): + bt = self.controlById(self.IdBtConnect) + if bt.isChecked(): + bt.click() #********************************************************************************** # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 13:40:11
|
Revision: 594 http://fclient.svn.sourceforge.net/fclient/?rev=594&view=rev Author: jUrner Date: 2008-07-12 06:40:07 -0700 (Sat, 12 Jul 2008) Log Message: ----------- more work on widget Modified Paths: -------------- trunk/fclient/src/fclient/tpls/ViewConnectionWidgetTpl.ui Modified: trunk/fclient/src/fclient/tpls/ViewConnectionWidgetTpl.ui =================================================================== --- trunk/fclient/src/fclient/tpls/ViewConnectionWidgetTpl.ui 2008-07-12 13:40:01 UTC (rev 593) +++ trunk/fclient/src/fclient/tpls/ViewConnectionWidgetTpl.ui 2008-07-12 13:40:07 UTC (rev 594) @@ -6,7 +6,7 @@ <x>0</x> <y>0</y> <width>533</width> - <height>363</height> + <height>356</height> </rect> </property> <property name="windowTitle" > @@ -43,6 +43,33 @@ </item> </layout> </item> + <item> + <layout class="QVBoxLayout" > + <item> + <widget class="QCheckBox" name="ckAutoConnect" > + <property name="text" > + <string>Auto Connect</string> + </property> + </widget> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> </layout> </item> <item row="1" column="0" > @@ -52,8 +79,8 @@ </property> <property name="sizeHint" > <size> - <width>515</width> - <height>111</height> + <width>321</width> + <height>51</height> </size> </property> </spacer> @@ -66,6 +93,9 @@ <property name="checkable" > <bool>true</bool> </property> + <property name="autoExclusive" > + <bool>false</bool> + </property> </widget> </item> </layout> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 13:39:53
|
Revision: 593 http://fclient.svn.sourceforge.net/fclient/?rev=593&view=rev Author: jUrner Date: 2008-07-12 06:40:01 -0700 (Sat, 12 Jul 2008) Log Message: ----------- more work on widget Modified Paths: -------------- trunk/fclient/src/fclient/tpls/Ui_ViewConnectionWidgetTpl.py Modified: trunk/fclient/src/fclient/tpls/Ui_ViewConnectionWidgetTpl.py =================================================================== --- trunk/fclient/src/fclient/tpls/Ui_ViewConnectionWidgetTpl.py 2008-07-12 13:38:48 UTC (rev 592) +++ trunk/fclient/src/fclient/tpls/Ui_ViewConnectionWidgetTpl.py 2008-07-12 13:40:01 UTC (rev 593) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/ViewConnectionWidgetTpl.ui' # -# Created: Tue Jul 8 17:41:12 2008 +# Created: Sat Jul 12 15:26:16 2008 # by: PyQt4 UI code generator 4.3.3 # # WARNING! All changes made in this file will be lost! @@ -12,7 +12,7 @@ class Ui_ViewConnectionWidget(object): def setupUi(self, ViewConnectionWidget): ViewConnectionWidget.setObjectName("ViewConnectionWidget") - ViewConnectionWidget.resize(QtCore.QSize(QtCore.QRect(0,0,533,363).size()).expandedTo(ViewConnectionWidget.minimumSizeHint())) + ViewConnectionWidget.resize(QtCore.QSize(QtCore.QRect(0,0,533,356).size()).expandedTo(ViewConnectionWidget.minimumSizeHint())) self.gridlayout = QtGui.QGridLayout(ViewConnectionWidget) self.gridlayout.setObjectName("gridlayout") @@ -43,13 +43,25 @@ self.spinConnectionPort.setObjectName("spinConnectionPort") self.vboxlayout1.addWidget(self.spinConnectionPort) self.hboxlayout.addLayout(self.vboxlayout1) + + self.vboxlayout2 = QtGui.QVBoxLayout() + self.vboxlayout2.setObjectName("vboxlayout2") + + self.ckAutoConnect = QtGui.QCheckBox(ViewConnectionWidget) + self.ckAutoConnect.setObjectName("ckAutoConnect") + self.vboxlayout2.addWidget(self.ckAutoConnect) + + spacerItem = QtGui.QSpacerItem(20,40,QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Fixed) + self.vboxlayout2.addItem(spacerItem) + self.hboxlayout.addLayout(self.vboxlayout2) self.gridlayout.addLayout(self.hboxlayout,0,0,1,1) - spacerItem = QtGui.QSpacerItem(515,111,QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Expanding) - self.gridlayout.addItem(spacerItem,1,0,1,1) + spacerItem1 = QtGui.QSpacerItem(321,51,QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Expanding) + self.gridlayout.addItem(spacerItem1,1,0,1,1) self.btConnect = QtGui.QPushButton(ViewConnectionWidget) self.btConnect.setCheckable(True) + self.btConnect.setAutoExclusive(True) self.btConnect.setObjectName("btConnect") self.gridlayout.addWidget(self.btConnect,2,0,1,1) @@ -60,6 +72,7 @@ ViewConnectionWidget.setWindowTitle(QtGui.QApplication.translate("ViewConnectionWidget", "Form", None, QtGui.QApplication.UnicodeUTF8)) self.label.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Host:", None, QtGui.QApplication.UnicodeUTF8)) self.label_2.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Port:", None, QtGui.QApplication.UnicodeUTF8)) + self.ckAutoConnect.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Auto Connect", None, QtGui.QApplication.UnicodeUTF8)) self.btConnect.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Connect", None, QtGui.QApplication.UnicodeUTF8)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 13:38:59
|
Revision: 592 http://fclient.svn.sourceforge.net/fclient/?rev=592&view=rev Author: jUrner Date: 2008-07-12 06:38:48 -0700 (Sat, 12 Jul 2008) Log Message: ----------- wording Modified Paths: -------------- trunk/fclient/src/fclient/lib/fcp2/consts.py Modified: trunk/fclient/src/fclient/lib/fcp2/consts.py =================================================================== --- trunk/fclient/src/fclient/lib/fcp2/consts.py 2008-07-12 13:38:25 UTC (rev 591) +++ trunk/fclient/src/fclient/lib/fcp2/consts.py 2008-07-12 13:38:48 UTC (rev 592) @@ -242,7 +242,7 @@ Connecting = 'connecting' Connected = 'connected to node' - ConnectingFailed = 'connecting to node failed' + ConnectingFailed = 'Could not connect to node' RetryingConnect = 'Retrying to connect' Closing = 'Closing' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 13:38:16
|
Revision: 591 http://fclient.svn.sourceforge.net/fclient/?rev=591&view=rev Author: jUrner Date: 2008-07-12 06:38:25 -0700 (Sat, 12 Jul 2008) Log Message: ----------- fixed duration calculation Modified Paths: -------------- trunk/fclient/src/fclient/lib/fcp2/client.py trunk/fclient/src/fclient/lib/fcp2/iohandler.py Modified: trunk/fclient/src/fclient/lib/fcp2/client.py =================================================================== --- trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-12 11:12:59 UTC (rev 590) +++ trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-12 13:38:25 UTC (rev 591) @@ -486,7 +486,7 @@ msg = self.next(dispatch=False) if msg == message.MsgClientSocketTimeout: disconnectReason = consts.ConstDisconnectReason.NoNodeHello - timeElapsed += max(self.ioHandler.io.Timeout, 0.1) + timeElapsed += time.time() - t0 yield None elif msg == message.MsgNodeHello: self._nodeHelloMessage = msg @@ -506,6 +506,7 @@ DisconnectReason=disconnectReason, ) self._close(disconnectMsg) + consts.ConstLogger.Client.info(consts.ConstLogMessages.ConnectingFailed) raise StopIteration Modified: trunk/fclient/src/fclient/lib/fcp2/iohandler.py =================================================================== --- trunk/fclient/src/fclient/lib/fcp2/iohandler.py 2008-07-12 11:12:59 UTC (rev 590) +++ trunk/fclient/src/fclient/lib/fcp2/iohandler.py 2008-07-12 13:38:25 UTC (rev 591) @@ -190,7 +190,8 @@ if not timeout >= 0: raise ValueError('timeout must be >= 0') - timeElapsed = 0 + t0 = time.time() + timeElapsed = time.time() - t0 while timeElapsed <= duration: if self.isOpen(): self.close() @@ -209,7 +210,7 @@ # continue polling consts.ConstLogger.IOHandler.info(consts.ConstLogMessages.RetryingConnect) - timeElapsed += timeout + timeElapsed += time.time() - t0 time.sleep(timeout) raise StopIteration This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 11:12:49
|
Revision: 590 http://fclient.svn.sourceforge.net/fclient/?rev=590&view=rev Author: jUrner Date: 2008-07-12 04:12:59 -0700 (Sat, 12 Jul 2008) Log Message: ----------- do not append actual data in pprint() Modified Paths: -------------- trunk/fclient/src/fclient/lib/fcp2/message.py Modified: trunk/fclient/src/fclient/lib/fcp2/message.py =================================================================== --- trunk/fclient/src/fclient/lib/fcp2/message.py 2008-07-12 11:11:55 UTC (rev 589) +++ trunk/fclient/src/fclient/lib/fcp2/message.py 2008-07-12 11:12:59 UTC (rev 590) @@ -128,7 +128,7 @@ out.append('>>EndMessage') else: out.append('>>Data') - out.append(self.data) + #out.append(self.data) return '\n'.join(out) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 11:11:45
|
Revision: 589 http://fclient.svn.sourceforge.net/fclient/?rev=589&view=rev Author: jUrner Date: 2008-07-12 04:11:55 -0700 (Sat, 12 Jul 2008) Log Message: ----------- ups, wrong debug level Modified Paths: -------------- trunk/fclient/src/fclient/lib/fcp2/client.py Modified: trunk/fclient/src/fclient/lib/fcp2/client.py =================================================================== --- trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-12 11:10:03 UTC (rev 588) +++ trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-12 11:11:55 UTC (rev 589) @@ -296,7 +296,7 @@ if event == self.events.Idle: consts.ConstLogger.Event.log(consts.ConstDebugVerbosity.Chatty, consts.ConstLogMessages.EventTriggered + event.name) else: - consts.ConstLogger.Event.log(consts.ConstDebugVerbosity.Message, consts.ConstLogMessages.EventTriggered + event.name) + consts.ConstLogger.Event.debug(consts.ConstLogMessages.EventTriggered + event.name) def _close(self, msg): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-12 11:09:58
|
Revision: 588 http://fclient.svn.sourceforge.net/fclient/?rev=588&view=rev Author: jUrner Date: 2008-07-12 04:10:03 -0700 (Sat, 12 Jul 2008) Log Message: ----------- comb over logging Modified Paths: -------------- trunk/fclient/src/fclient/lib/fcp2/client.py Modified: trunk/fclient/src/fclient/lib/fcp2/client.py =================================================================== --- trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-12 11:09:38 UTC (rev 587) +++ trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-12 11:10:03 UTC (rev 588) @@ -296,7 +296,7 @@ if event == self.events.Idle: consts.ConstLogger.Event.log(consts.ConstDebugVerbosity.Chatty, consts.ConstLogMessages.EventTriggered + event.name) else: - consts.ConstLogger.Event.info(consts.ConstLogMessages.EventTriggered + event.name) + consts.ConstLogger.Event.log(consts.ConstDebugVerbosity.Message, consts.ConstLogMessages.EventTriggered + event.name) def _close(self, msg): @@ -316,12 +316,11 @@ self._ddaTests = [] self._requests = {} - - if msg is not None: - self.events.ClientDisconnected(msg) + if self.ioHandler.isOpen(): self.ioHandler.close() - + if msg is not None: + self.events.ClientDisconnected(msg) def _finalizeRequest(self, msg, request, event): """Finalzes a request This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |