aboutsummaryrefslogtreecommitdiffstats
path: root/pbx/pbx_gtkconsole.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-01-30 15:03:20 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-01-30 15:03:20 +0000
commita8282b50e1826df08d77e3989b637814415b5865 (patch)
tree03c27ab3cc019e3323dea0a3464f071a18fa1d18 /pbx/pbx_gtkconsole.c
parent3e152dc0f17e3948a6d3945f203f62060f987c17 (diff)
Version 0.3.0 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@593 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/pbx_gtkconsole.c')
-rwxr-xr-xpbx/pbx_gtkconsole.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/pbx/pbx_gtkconsole.c b/pbx/pbx_gtkconsole.c
index d93ef6fa9..727fe38f3 100755
--- a/pbx/pbx_gtkconsole.c
+++ b/pbx/pbx_gtkconsole.c
@@ -39,6 +39,7 @@
#include <glib.h>
/* For where to put dynamic tables */
#include "../asterisk.h"
+#include "../astconf.h"
static pthread_mutex_t verb_lock = AST_MUTEX_INITIALIZER;
@@ -228,10 +229,12 @@ static void reload_module()
static void file_ok_sel(GtkWidget *w, GtkFileSelection *fs)
{
+ char tmp[AST_CONFIG_MAX_PATH];
char *module = gtk_file_selection_get_filename(fs);
char buf[256];
- if (!strncmp(module, AST_MODULE_DIR "/", strlen(AST_MODULE_DIR "/")))
- module += strlen(AST_MODULE_DIR "/");
+ snprintf((char *)tmp,sizeof(tmp)-1,"%s/",(char *)ast_config_AST_MODULE_DIR);
+ if (!strncmp(module, (char *)tmp, strlen(tmp)))
+ module += strlen(tmp);
gdk_threads_leave();
if (ast_load_resource(module)) {
snprintf(buf, sizeof(buf), "Error loading module '%s'.", module);
@@ -246,13 +249,15 @@ static void file_ok_sel(GtkWidget *w, GtkFileSelection *fs)
static void add_module()
{
+ char tmp[AST_CONFIG_MAX_PATH];
GtkWidget *filew;
+ snprintf((char *)tmp,sizeof(tmp)-1,"%s/*.so",(char *)ast_config_AST_MODULE_DIR);
filew = gtk_file_selection_new("Load Module");
gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION(filew)->ok_button),
"clicked", GTK_SIGNAL_FUNC(file_ok_sel), filew);
gtk_signal_connect_object(GTK_OBJECT (GTK_FILE_SELECTION(filew)->cancel_button),
"clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(filew));
- gtk_file_selection_set_filename(GTK_FILE_SELECTION(filew), AST_MODULE_DIR "/*.so");
+ gtk_file_selection_set_filename(GTK_FILE_SELECTION(filew), (char *)tmp);
gtk_widget_show(filew);
}