/usr/share/backintime/kde4/messagebox.py is in backintime-kde 1.0.34-0.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | # Copyright (c) 2012-2013 Germar Reitze
#
# 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.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import sys
from PyKDE4.kdecore import ki18n, KAboutData, KCmdLineArgs
from PyKDE4.kdeui import KApplication, KPasswordDialog
from PyQt4.QtCore import QString, QTimer, SIGNAL
import app
def ask_password_dialog(parent, config, title, prompt, timeout = None):
if parent is None:
kapp, kaboutData = app.create_kapplication( config )
dialog = KPasswordDialog()
timer = QTimer()
if not timeout is None:
dialog.connect(timer, SIGNAL("timeout()"), dialog.close)
timer.setInterval(timeout * 1000)
timer.start()
dialog.setPrompt( QString.fromUtf8(prompt))
KApplication.processEvents()
if parent is None:
dialog.show()
kapp.exec_()
else:
dialog.exec_()
timer.stop()
password = dialog.password().toUtf8()
del(dialog)
return(password)
|