aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-06-11 07:56:34 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-06-11 07:56:34 +0000
commit6d0adc3a3c352ef624b865c88f30d332b9ad2073 (patch)
treefffafd08e89c9a342175fc6b11f58f75461cee67
parentcbbe2cb3b468a8bdf8225657fb7d522e133ee24c (diff)
fixed syl_plugin_folderview_add_sub_widget() and updated test plug-in.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2570 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog7
-rw-r--r--PLUGIN.ja.txt1
-rw-r--r--PLUGIN.txt1
-rw-r--r--plugin/test/test.c19
-rw-r--r--src/folderview.c2
-rw-r--r--src/plugin.c2
6 files changed, 30 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e0909b4d..41056e63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2010-06-11
+ * src/plugin.c
+ src/folderview.c: fixed syl_plugin_folderview_add_sub_widget().
+ * plugin/test/test.c: added syl_plugin_folderview_add_sub_widget()
+ test.
+
+2010-06-11
+
* src/plugin.[ch]
src/main.c
src/folderview.[ch]: added plug-in APIs for folder view.
diff --git a/PLUGIN.ja.txt b/PLUGIN.ja.txt
index aed55a5f..46a86c27 100644
--- a/PLUGIN.ja.txt
+++ b/PLUGIN.ja.txt
@@ -241,6 +241,7 @@ test プラグインは Sylpheed プラグインの基本的な構造に加え
- フォルダの一覧を取得し、標準出力に表示
- Sylpheed のバージョン文字列を取得し、標準出力に表示
- メインウィンドウを取得し、前面に出す
+- フォルダビューの下にサブウィジェットを追加
- 「ツール」メニューに「Plugin test」メニュー項目を追加
- 「Plugin test」メニューを選択すると、「Click this button」という
ボタンのみのウィンドウを表示し、クリックするとメッセージを出力
diff --git a/PLUGIN.txt b/PLUGIN.txt
index 8af6041f..75f2e765 100644
--- a/PLUGIN.txt
+++ b/PLUGIN.txt
@@ -239,6 +239,7 @@ following process:
- Get folder list and output to stdout
- Get Sylpheed version string and output to stdout
- Get the main window and put it in front
+- Add sub widget under the folder view
- Add 'Plugin test' menu item on the 'Tools' menu
- When 'Plugin test' menu is selected, a window with a button named
'Click this button' is displayed. When it is clicked, a message is displayed
diff --git a/plugin/test/test.c b/plugin/test/test.c
index 393a2b91..bd42fb4b 100644
--- a/plugin/test/test.c
+++ b/plugin/test/test.c
@@ -27,7 +27,7 @@
static SylPluginInfo info = {
"Test Plugin",
- "1.0.0",
+ "3.0.99",
"Hiroyuki Yamamoto",
"Test plug-in for Sylpheed plug-in system"
};
@@ -40,6 +40,7 @@ static void compose_created_cb(GObject *obj, gpointer compose);
static void compose_destroy_cb(GObject *obj, gpointer compose);
static void create_window(void);
+static void create_folderview_sub_widget(void);
void plugin_load(void)
{
@@ -64,6 +65,8 @@ void plugin_load(void)
g_print("mainwin: %p\n", mainwin);
syl_plugin_main_window_popup(mainwin);
+ create_folderview_sub_widget();
+
syl_plugin_add_menuitem("/Tools", NULL, NULL, NULL);
syl_plugin_add_menuitem("/Tools", "Plugin test", create_window, NULL);
@@ -153,3 +156,17 @@ static void create_window(void)
G_CALLBACK(button_clicked), NULL);
gtk_widget_show_all(window);
}
+
+static void create_folderview_sub_widget(void)
+{
+ GtkWidget *vbox;
+ GtkWidget *button;
+
+ g_print("creating sub widget\n");
+
+ vbox = gtk_vbox_new(FALSE, 2);
+ button = gtk_button_new_with_label("Test");
+ gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
+ gtk_widget_show_all(vbox);
+ syl_plugin_folderview_add_sub_widget(vbox);
+}
diff --git a/src/folderview.c b/src/folderview.c
index 7585a45b..d71bd2cd 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -580,6 +580,8 @@ void folderview_add_sub_widget(FolderView *folderview, GtkWidget *widget)
g_return_if_fail(folderview != NULL);
g_return_if_fail(widget != NULL);
+ debug_print("folderview_add_sub_widget: adding sub widget\n");
+
gtk_box_pack_start(GTK_BOX(folderview->vbox), widget, FALSE, FALSE, 0);
}
diff --git a/src/plugin.c b/src/plugin.c
index d7af9810..8c711d14 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -556,7 +556,7 @@ void syl_plugin_folderview_add_sub_widget(GtkWidget *widget)
folderview = syl_plugin_folderview_get();
if (folderview) {
- GETFUNC("folderview_get");
+ GETFUNC("folderview_add_sub_widget");
SAFE_CALL_ARG2(func, folderview, widget);
}
}