3
# Rapache - Apache Configuration Tool
4
# Copyright (C) 2008 Stefano Forenza, Jason Taylor, Emanuele Gentili
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
34
from RapacheCore.VirtualHost import *
35
from RapacheGtk import GuiUtils
37
class EditDocumentNameWindow:
39
def __init__ ( self, glade_path, document = ""):
40
self.return_value = None
42
gladefile = os.path.join(glade_path, "edit_document_name.glade")
43
wtree = gtk.glade.XML(gladefile)
45
self.window = wtree.get_widget("dialog_edit_document_name")
46
self.entry_document = wtree.get_widget("entry_document")
47
self.label_heading = wtree.get_widget("label_heading")
48
self.image_icon = wtree.get_widget("image_icon")
51
"on_button_ok_clicked" : self.on_button_ok_clicked,
52
"on_button_cancel_clicked" : self.on_button_cancel_clicked
54
wtree.signal_autoconnect(signals)
56
# add on destroy to quit loop
57
self.window.connect("destroy", self.on_destroy)
60
self.entry_document.set_text( document )
64
self.entry_document.select_region(0,-1)
67
return self.return_value
69
def on_destroy(self, widget, data=None):
72
def on_button_ok_clicked(self, widget):
73
self.return_value = self.entry_document.get_text()
77
def on_button_cancel_clicked(self, widget):