# Path: RapacheGtk/GuiUtils.py
# def style_as_tooltip( obj ):
# def paint(box, event):
# def change_button_label ( button, new_label ):
# def new_apache_sourceview():


import sys
import re
     import pygtk
    import gtk
    import gtk.glade
import os
import pango
import tempfile
from RapacheCore.VirtualHost import *
from RapacheGtk import GuiUtils
        self.xml.get_widget( 'message_text' ).set_label( '<b>'+message+'</b>' )
        self.xml.get_widget( 'message_container' ).show()
        
    def quit (self, widget):      
        self.father.new_vhost_window = None
    
    def close ( self, widget = None ):
        self.window = self.xml.get_widget( 'vhost_edit_window' )
        self.window.destroy()
    def domain_name_updated ( self, widget, a = None, b = None, c = None ):
        name = widget.get_text()
        if ( valid_domain_name( name ) ):
            self.xml.get_widget( 'ok_button' ).set_sensitive(True);
            if self.create_new :
                self.xml.get_widget( 'default_folder' ).set_text( '/var/www/'+name+'/httpdocs' )
        else:
            self.xml.get_widget( 'ok_button' ).set_sensitive(False);
    def custom_folder_toggled( self, widget ):
        if ( widget.get_active() == True ):
            self.xml.get_widget( 'custom_folder' ).show()
            self.xml.get_widget( 'default_folder' ).hide()
        else:
            self.xml.get_widget( 'custom_folder' ).hide()
            self.xml.get_widget( 'default_folder' ).show()            
    
    
    def save( self, widget ):
        options = {}
        options[ 'has_www' ] = self.xml.get_widget( 'has_www' ).get_active()     
        options[ 'domain_name' ] = ( self.xml.get_widget( 'domain_name' ).get_text() )

# Path: RapacheGtk/GuiUtils.py
# def style_as_tooltip( obj ):
# def paint(box, event):
# def change_button_label ( button, new_label ):
# def new_apache_sourceview():


# Path: RapacheGtk/old_VirtualHostGui.py
import sys
import re
     import pygtk
    import gtk
    import gtk.glade
import os
import pango
import tempfile
from RapacheCore.VirtualHost import *
from RapacheGtk import GuiUtils

        self.xml.get_widget( 'message_text' ).set_label( '<b>'+message+'</b>' )
        self.xml.get_widget( 'message_container' ).show()
        
    def quit (self, widget):      
        self.father.new_vhost_window = None
    
    def close ( self, widget = None ):
        self.window = self.xml.get_widget( 'vhost_edit_window' )
        self.window.destroy()
    def domain_name_updated ( self, widget, a = None, b = None, c = None ):
        name = widget.get_text()
        if ( valid_domain_name( name ) ):
            self.xml.get_widget( 'ok_button' ).set_sensitive(True);
            if self.create_new :
                self.xml.get_widget( 'default_folder' ).set_text( '/var/www/'+name+'/httpdocs' )
        else:
            self.xml.get_widget( 'ok_button' ).set_sensitive(False);
    def custom_folder_toggled( self, widget ):
        if ( widget.get_active() == True ):
            self.xml.get_widget( 'custom_folder' ).show()
            self.xml.get_widget( 'default_folder' ).hide()
        else:
            self.xml.get_widget( 'custom_folder' ).hide()
            self.xml.get_widget( 'default_folder' ).show()            
    
    
    def save( self, widget ):
        options = {}
        options[ 'has_www' ] = self.xml.get_widget( 'has_www' ).get_active()     
        options[ 'domain_name' ] = ( self.xml.get_widget( 'domain_name' ).get_text() )

        options[ 'hack_hosts' ] = self.xml.get_widget( 'create_hosts_entry' ).get_active()                