2
# Copyright (C) 2008-2009 Oprea Dan
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License along
15
# with this program; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30
def show_question( parent, config, message ):
31
dialog = gtk.MessageDialog( parent, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO )
32
dialog.set_markup( message )
33
dialog.set_title( config.APP_NAME )
38
def show_error( parent, config, message ):
39
dialog = gtk.MessageDialog( parent, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK )
40
dialog.set_markup( message )
41
dialog.set_title( config.APP_NAME )
46
def text_input_dialog( parent, glade, title, default_value = "" ):
47
dialog = glade.get_widget( 'TextInputDialog' )
48
dialog.set_title( title )
49
dialog.set_transient_for( parent )
51
edit = glade.get_widget( 'edit_text' )
52
edit.set_text( default_value )
56
if gtk.RESPONSE_OK == dialog.run():
57
text = edit.get_text()