*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
{
GSList *plugins, *cur;
const gchar *text;
- gint row;
GtkListStore *store;
GtkTreeIter iter;
GtkTextBuffer *textbuf;
store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW
(pluginwindow->plugin_list_view)));
+ gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store),
+ 0, GTK_SORT_ASCENDING);
gtk_list_store_clear(store);
textbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(pluginwindow->plugin_desc));
gtk_text_buffer_get_start_iter(textbuf, &start_iter);
gtk_text_buffer_get_end_iter(textbuf, &end_iter);
gtk_text_buffer_delete(textbuf, &start_iter, &end_iter);
- text = plugin_get_desc(plugin);
+ text = g_strconcat(plugin_get_desc(plugin), _("\n\nVersion: "),
+ plugin_get_version(plugin), "\n", NULL);
gtk_text_buffer_insert(textbuf, &start_iter, text, strlen(text));
gtk_widget_set_sensitive(pluginwindow->unload_btn, TRUE);
} else {
{
gchar *file, *error = NULL;
- file = filesel_select_file_open(_("Select Plugin to load"), PLUGINDIR);
+ file = filesel_select_file_open_with_filter(_("Select Plugin to load"),
+ PLUGINDIR,
+ "*." G_MODULE_SUFFIX);
if (file == NULL)
return;
plugin_load(file, &error);
if (error != NULL) {
- alertpanel_error("The following error occured while loading the plugin:\n%s\n", error);
+ alertpanel_error(_("The following error occured while loading the plugin:\n%s\n"), error);
g_free(error);
}
return FALSE;
}
+/*!
+ *\brief Save Gtk object size to prefs dataset
+ */
+static void pluginwindow_size_allocate_cb(GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ g_return_if_fail(allocation != NULL);
+
+ prefs_common.pluginswin_width = allocation->width;
+ prefs_common.pluginswin_height = allocation->height;
+}
+
+
void pluginwindow_create()
{
PluginWindow *pluginwindow;
GtkWidget *load_btn;
GtkWidget *unload_btn;
GtkWidget *close_btn;
+ static GdkGeometry geometry;
+ debug_print("Creating plugins window...\n");
+
pluginwindow = g_new0(PluginWindow, 1);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width(GTK_CONTAINER(window), 8);
- gtk_window_set_default_size(GTK_WINDOW(window), 480, 300);
gtk_window_set_title(GTK_WINDOW(window), _("Plugins"));
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
GTK_BUTTONBOX_END);
gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbuttonbox1), 6);
- load_btn = gtk_button_new_with_label(_("Load Plugin"));
+ load_btn = gtk_button_new_with_label(_("Load Plugin..."));
gtk_widget_show(load_btn);
gtk_container_add(GTK_CONTAINER(hbuttonbox1), load_btn);
GTK_WIDGET_SET_FLAGS(load_btn, GTK_CAN_DEFAULT);
G_CALLBACK(unload_cb), pluginwindow);
g_signal_connect(G_OBJECT(close_btn), "released",
G_CALLBACK(close_cb), pluginwindow);
+ g_signal_connect(G_OBJECT(window), "size_allocate",
+ G_CALLBACK(pluginwindow_size_allocate_cb), NULL);
g_signal_connect(G_OBJECT(window), "key_press_event",
G_CALLBACK(pluginwindow_key_pressed), pluginwindow);
set_plugin_list(pluginwindow);
inc_lock();
+
+ if (!geometry.min_height) {
+ geometry.min_width = 480;
+ geometry.min_height = 300;
+ }
+
+ gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL, &geometry,
+ GDK_HINT_MIN_SIZE);
+ gtk_widget_set_size_request(window, prefs_common.pluginswin_width,
+ prefs_common.pluginswin_height);
+
gtk_widget_show(window);
}