Started filechooser dialog

master
Yevgen Muntyan 2006-04-04 04:58:49 -05:00
parent 6aa643d812
commit 70e5daf2bb
5 changed files with 125 additions and 13 deletions

View File

@ -24,7 +24,7 @@
</ignoreparts>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<description></description>
<description/>
<secondaryLanguages>
<language>C</language>
</secondaryLanguages>
@ -36,15 +36,13 @@
<useconfiguration>debug</useconfiguration>
</general>
<run>
<mainprogram>./medit</mainprogram>
<mainprogram>medit</mainprogram>
<directoryradio>executable</directoryradio>
<customdirectory>/</customdirectory>
<programargs></programargs>
<programargs/>
<terminal>false</terminal>
<autocompile>false</autocompile>
<envvars>
<envvar value="c:\\medit\\" name="MOO_APP_DIRS" />
</envvars>
<envvars/>
</run>
<configurations>
<debug>
@ -218,12 +216,8 @@
</kdevautoproject>
<kdevdebugger>
<general>
<dbgshell></dbgshell>
<dbgshell/>
<programargs>--g-fatal-warnings</programargs>
<gdbpath></gdbpath>
<configGdbScript></configGdbScript>
<runShellScript></runShellScript>
<runGdbScript></runGdbScript>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>true</floatingtoolbar>
@ -324,7 +318,7 @@
</codecompletion>
<references/>
<creategettersetter>
<prefixGet></prefixGet>
<prefixGet/>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>

View File

@ -7,17 +7,22 @@ mooedit_plugins_srcdir = $(srcdir)/$(mooedit_plugins)
mooedit_plugins_built_sources = \
$(mooedit_plugins)/moofileselector-glade.h\
$(mooedit_plugins)/moofilechooser-glade.h \
$(mooedit_plugins)/moofind-glade.h
mooedit_plugins_extra_dist = \
$(mooedit_plugins)/moofileselector.glade \
$(mooedit_plugins)/moofilechooser.glade \
$(mooedit_plugins)/moofind.glade
$(mooedit_plugins)/moofileselector-glade.h: $(mooedit_plugins)/moofileselector.glade $(XML2H)
mkdir -p $(mooedit_plugins)
sh $(XML2H) MOO_FILE_SELECTOR_GLADE_XML $(mooedit_plugins_srcdir)/moofileselector.glade > \
$(mooedit_plugins)/moofileselector-glade.h
$(mooedit_plugins)/moofilechooser-glade.h: $(mooedit_plugins)/moofilechooser.glade $(XML2H)
mkdir -p $(mooedit_plugins)
sh $(XML2H) MOO_FILE_CHOOSER_GLADE_XML $(mooedit_plugins_srcdir)/moofilechooser.glade > \
$(mooedit_plugins)/moofilechooser-glade.h
$(mooedit_plugins)/moofind-glade.h: $(mooedit_plugins)/moofind.glade $(XML2H)
mkdir -p $(mooedit_plugins)
sh $(XML2H) MOO_FIND_GLADE_XML $(mooedit_plugins_srcdir)/moofind.glade > \
@ -33,6 +38,7 @@ mooedit_plugins_sources = \
if GTK_2_6
mooedit_plugins_sources += \
$(mooedit_plugins)/moofileselector-glade.h\
$(mooedit_plugins)/moofilechooser-glade.h \
$(mooedit_plugins)/fileselector.c
endif

View File

@ -20,6 +20,7 @@
#include "mooutils/moofileview/moobookmarkmgr.h"
#include "mooedit/plugins/mooeditplugins.h"
#include "mooedit/plugins/moofileselector-glade.h"
#include "mooedit/plugins/moofilechooser-glade.h"
#include "mooutils/moostock.h"
#include "mooutils/mooutils-fs.h"
#include "mooutils/mooutils-misc.h"
@ -1066,6 +1067,34 @@ show_file_selector (MooEditWindow *window)
}
// static void
// show_file_chooser (MooEditWindow *window)
// {
// GtkWidget *dialog;
// int response;
//
// dialog = g_object_get_data (G_OBJECT (window), "moo-file-chooser");
//
// if (!dialog)
// {
// MooGladeXML *xml;
//
// xml = moo_glade_xml_new_empty ();
// moo_glade_xml_map_id (xml, "fielview", MOO_TYPE_FILE_SELECTOR);
// moo_glade_xml_parse_memory (*xml, MOO_FILE_CHOOSER_GLADE_XML, -1, NULL);
//
// dialog = moo_glade_xml_get_widget (xml, "dialog");
// g_return_val_if_fail (dialog != NULL, NULL);
//
// gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
// g_object_set_data_full (G_OBJECT (window), "moo-file-chooser",
// dialog, gtk_widget_destroy);
// }
//
// response = gtk_dialog_run ();
// }
static gboolean
file_selector_plugin_init (Plugin *plugin)
{

View File

@ -0,0 +1,80 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
<widget class="GtkDialog" id="dialog">
<property name="title" translatable="yes">Open</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="modal">True</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="cancel">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">False</property>
<property name="response_id">-6</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="open">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-open</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">False</property>
<property name="response_id">-5</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkDrawingArea" id="fileview">
<property name="visible">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

View File

@ -1,3 +1,6 @@
;; -*- Mode: scheme; strip on; -*-
;; hand-edited
(define-function editor_instance
(c-name "moo_editor_instance")
(return-type "MooEditor*")