summaryrefslogtreecommitdiff
path: root/callbacks.c
diff options
context:
space:
mode:
Diffstat (limited to 'callbacks.c')
-rw-r--r--callbacks.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/callbacks.c b/callbacks.c
index 89325f7..d3fe1bc 100644
--- a/callbacks.c
+++ b/callbacks.c
@@ -20,8 +20,10 @@
#include <stdlib.h>
#include <string.h>
#include "callbacks.h"
-#include "subtitle.h"
-#include "interface.h"
+#include "main.h"
+#include "mainwin.h"
+#include "listview.h"
+#include "dictwin.h"
#include "srt.h"
#include "word.h"
@@ -30,8 +32,6 @@
#define ERR_READING_FILE "Error reading file"
#define ERR_MSG_CAPTION "Error"
-extern Word *words;
-
gint main_window_close(GtkWidget *widget, GdkEvent *event, gpointer main_window)
{
GtkWidget *dialog;
@@ -60,6 +60,7 @@ void open_btn_click(GtkWidget *widget, gpointer parent)
char *filename;
char *errstr;
FILE *subtitle;
+ char **word_list;
filter = gtk_file_filter_new();
gtk_file_filter_add_mime_type(filter, "application/x-subrip");
@@ -96,12 +97,19 @@ void open_btn_click(GtkWidget *widget, gpointer parent)
else
enable_search();
process_srt(subtitle);
- print_words(words);
+ word_list = get_sorted();
+ fill_list(word_list);
+ free(word_list);
fclose(subtitle);
}
gtk_widget_destroy(filedialog);
}
+void dict_btn_click(GtkWidget *widget, gpointer data)
+{
+ create_dict_win();
+}
+
void show_about(GtkWidget *widget, gpointer data)
{
const gchar *authors[] = {"Borisov Alexandr aka b0ric", NULL};