00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 from PyQt4.QtCore  import  *
00029 from PyQt4.QtGui import *
00030 from PyQt4.uic import *
00031 
00032 from Koo.Common.Settings import *
00033 from Koo.Common.Paths import *
00034 
00035 Tips = [
00036 _("""
00037 <p>
00038 <b>Welcome to Koo!</b>
00039 </p>
00040 <p>
00041 Koo is a client that gives you access to the powerful OpenERP application with
00042 very good performance and bleeding edge features.
00043 </p>
00044 """),
00045 _("""
00046 <p>
00047 <b>Integrated calculator</b>
00048 </p>
00049 <p>
00050 Did you know that you can use number input boxes like a calculator? Go to a field where you should insert a number and type <i>3+4*12</i>. Then press enter to see the result or store the form directly. In both cases you will see the result updated in the same input box. Allowed operators include: +, -, *, / and you can also use parenthesis.
00051 </p>
00052 """),
00053 _("""
00054 <p>
00055 <b>Full Text Search</b>
00056 </p>
00057 <p>
00058 Did you know that you can search any record of your database from a single place, just like you do with Google? Search and install the full_text_search module and follow the instructions on how to configure it properly.
00059 </p>
00060 """),
00061 _("""
00062 <p>
00063 <b>Export information</b>
00064 </p>
00065 <p>
00066 Did you know that you can easily export OpenERP information? Go to Form and then Export Data. You can even store your preferences and use it easily as many times as you need.
00067 </p>
00068 """),
00069 ]
00070 
00071 (TipOfTheDayDialogUi, TipOfTheDayDialogBase) = loadUiType( uiPath('tip.ui') )
00072 
00073 
00074 class TipOfTheDayDialog( QDialog, TipOfTheDayDialogUi ):
00075         def __init__(self, parent=None):
00076                 QDialog.__init__(self, parent)
00077                 TipOfTheDayDialogUi.__init__(self)
00078                 self.setupUi( self )
00079 
00080                 try:
00081                         self.number = int( Settings.value('tip.position') )
00082                 except:
00083                         self.number = 0
00084 
00085                 self.connect( self.pushNext, SIGNAL('clicked()'), self.nextTip )
00086                 self.connect( self.pushPrevious, SIGNAL('clicked()'), self.previousTip )
00087                 self.connect( self.pushClose, SIGNAL('clicked()'), self.closeTip )
00088                 self.uiShowNextTime.setChecked( Settings.value('tip.autostart') )
00089                 self.showTip()
00090         
00091         def showTip(self):
00092                 self.uiTip.setText( Tips[ self.number % len(Tips) ] )
00093 
00094         def nextTip(self):
00095                 self.number += 1
00096                 self.showTip()
00097 
00098         def previousTip(self):
00099                 self.number -= 1
00100                 self.showTip()
00101 
00102         def closeTip(self):
00103                 Settings.setValue( 'tip.autostart', self.uiShowNextTime.isChecked() )
00104                 Settings.setValue( 'tip.position', self.number + 1 )
00105                 Settings.saveToFile()
00106                 self.close()
00107