diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-04-27 02:45:30 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-04-27 02:45:30 +0000 |
commit | babee5fe38026e5b6210fa381aace3a19a89785f (patch) | |
tree | f9b6d82d7373c81c7420acdbb8c692bbff57fe2b /qt-recordmydesktop/src/rmdTrayPopup.py | |
parent | de6c6f26c88d6f961f9e450edb337510d7c893f9 (diff) |
This commit was generated by cvs2svn to compensate for changes in r312,
which included commits to RCS files with non-trunk default branches.
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@313 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'qt-recordmydesktop/src/rmdTrayPopup.py')
-rw-r--r-- | qt-recordmydesktop/src/rmdTrayPopup.py | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/qt-recordmydesktop/src/rmdTrayPopup.py b/qt-recordmydesktop/src/rmdTrayPopup.py new file mode 100644 index 0000000..0c3b5c4 --- /dev/null +++ b/qt-recordmydesktop/src/rmdTrayPopup.py @@ -0,0 +1,70 @@ +#/****************************************************************************** +#* qt-recordMyDesktop * +#******************************************************************************* +#* * +#* Copyright (C) 2007 John Varouhakis * +#* * +#* * +#* This program is free software; you can redistribute it and/or modify * +#* it under the terms of the GNU General Public License as published by * +#* the Free Software Foundation; either version 2 of the License, or * +#* (at your option) any later version. * +#* * +#* This program is distributed in the hope that it will be useful, * +#* but WITHOUT ANY WARRANTY; without even the implied warranty of * +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +#* GNU General Public License for more details. * +#* * +#* You should have received a copy of the GNU General Public License * +#* along with this program; if not, write to the Free Software * +#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * +#* * +#* * +#* * +#* For further information contact me at johnvarouhakis@gmail.com * +#******************************************************************************/ + +from PyQt4 import QtGui,QtCore +import locale, gettext +import rmdConfig +def _(s): + return QtCore.QString.fromUtf8(gettext.gettext(s)) +gettext.textdomain('qt-recordMyDesktop') +gettext.bindtextdomain('qt-recordMyDesktop',rmdConfig.locale_install_dir) + +import rmdSelect as iSel +import sys +#import rmdPrefsWidget as pW + +class TrayPopupMenu: + options=None + def __init__(self,parent,values,optionsOpen): + self.parent=parent + self.optionsOpen=optionsOpen + self.values=values + self._setup_popup_menu() + self.selector = None + def _setup_popup_menu(self): + self.popupmenu = QtGui.QMenu() + self.popupmenu.addAction(_("Preferences"),self._prefs_widget) + self.popupmenu.addAction(_("_Select Area On Screen").replace("_",""),self._select_area_cb) + self.popupmenu.addAction(_("Quit"),self.parent.window.close) + + def _prefs_widget(self): + if self.optionsOpen[0] ==0: + self.optionsOpen[0]=1 + self.parent.show() + else: + self.parent.hide() + self.optionsOpen[0]=0 + + def _select_area_cb(self): + self.popupmenu.hide() + self.selector = iSel.QtAreaSelector(self.values[5]) + self.selector.showFullScreen() + self.parent.image.x1=-1 + def show(self): + QtGui.QMenu.show(self.popupmenu) + def hide(self): + self.popupmenu.hide() + |