Compare commits
No commits in common. "c469d585e293a81f0943929d0166aeffb0c8f263" and "2e1c1512be959e64ea3499d68b659c1d68c245f5" have entirely different histories.
c469d585e2
...
2e1c1512be
@ -99,9 +99,9 @@ static void mainWindow_configure_treeView(struct mainWindow *mainWindow)
|
|||||||
GtkCellRenderer *renderer;
|
GtkCellRenderer *renderer;
|
||||||
GtkTreeSortable *sortable;
|
GtkTreeSortable *sortable;
|
||||||
GtkTreeViewColumn *col;
|
GtkTreeViewColumn *col;
|
||||||
|
GtkTreeModel *model;
|
||||||
GtkTreeModelFilter *filtered;
|
GtkTreeModelFilter *filtered;
|
||||||
GtkTreeModelSort *sorted;
|
GtkTreeModelSort *sorted;
|
||||||
GtkTreeModel *model;
|
|
||||||
|
|
||||||
mainWindow->entryListStore = gtk_list_store_new(COL_COUNT,
|
mainWindow->entryListStore = gtk_list_store_new(COL_COUNT,
|
||||||
G_TYPE_STRING,
|
G_TYPE_STRING,
|
||||||
@ -184,11 +184,6 @@ static void mainWindow_connect_signals(struct mainWindow *mainWindow)
|
|||||||
"day-selected",
|
"day-selected",
|
||||||
(GCallback) mainWindow_calendarSelected,
|
(GCallback) mainWindow_calendarSelected,
|
||||||
mainWindow);
|
mainWindow);
|
||||||
|
|
||||||
g_signal_connect(mainWindow->entryListSelection,
|
|
||||||
"changed",
|
|
||||||
(GCallback) mainWindow_entrySelected,
|
|
||||||
mainWindow);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct mainWindow *mainWindow_new()
|
struct mainWindow *mainWindow_new()
|
||||||
@ -208,7 +203,6 @@ struct mainWindow *mainWindow_new()
|
|||||||
mainWindow->popoverDate = GTK_WIDGET(gtk_builder_get_object(builder, "popoverDate"));
|
mainWindow->popoverDate = GTK_WIDGET(gtk_builder_get_object(builder, "popoverDate"));
|
||||||
mainWindow->calendarRange = GTK_WIDGET(gtk_builder_get_object(builder, "calendarRange"));
|
mainWindow->calendarRange = GTK_WIDGET(gtk_builder_get_object(builder, "calendarRange"));
|
||||||
mainWindow->entryListView = GTK_TREE_VIEW(gtk_builder_get_object(builder, "entryListView"));
|
mainWindow->entryListView = GTK_TREE_VIEW(gtk_builder_get_object(builder, "entryListView"));
|
||||||
mainWindow->entryListSelection = GTK_TREE_SELECTION(gtk_builder_get_object(builder, "entryListSelection"));
|
|
||||||
|
|
||||||
gtk_builder_connect_signals(builder, NULL);
|
gtk_builder_connect_signals(builder, NULL);
|
||||||
|
|
||||||
@ -250,20 +244,3 @@ void mainWindow_calendarSelected(GtkWidget *widget, gpointer user_data)
|
|||||||
|
|
||||||
gtk_popover_popdown(GTK_POPOVER(mainWindow->popoverDate));
|
gtk_popover_popdown(GTK_POPOVER(mainWindow->popoverDate));
|
||||||
}
|
}
|
||||||
|
|
||||||
void mainWindow_entrySelected(GtkWidget *widget, gpointer user_data)
|
|
||||||
{
|
|
||||||
struct mainWindow *mainWindow = (struct mainWindow *)user_data;
|
|
||||||
GtkTreeSelection *selection;
|
|
||||||
GtkTreeModel *model;
|
|
||||||
GtkTreeIter iter;
|
|
||||||
gchar *temp;
|
|
||||||
|
|
||||||
selection = gtk_tree_view_get_selection(mainWindow->entryListView);
|
|
||||||
if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
|
|
||||||
gtk_tree_model_get(model, &iter, COL_TITLE, &temp, -1);
|
|
||||||
printf("Selected entry: %s\n", temp);
|
|
||||||
fflush(stdout);
|
|
||||||
g_free(temp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -14,7 +14,6 @@ struct mainWindow {
|
|||||||
GtkWidget *popoverDate;
|
GtkWidget *popoverDate;
|
||||||
GtkWidget *calendarRange;
|
GtkWidget *calendarRange;
|
||||||
GtkTreeView *entryListView;
|
GtkTreeView *entryListView;
|
||||||
GtkTreeSelection *entryListSelection;
|
|
||||||
|
|
||||||
GtkListStore *entryListStore;
|
GtkListStore *entryListStore;
|
||||||
GtkWidget *selectedDateEntry;
|
GtkWidget *selectedDateEntry;
|
||||||
@ -26,6 +25,5 @@ struct mainWindow *mainWindow_new();
|
|||||||
void mainWindow_showPopover(GtkWidget *widget, GdkEvent *event, gpointer user_data);
|
void mainWindow_showPopover(GtkWidget *widget, GdkEvent *event, gpointer user_data);
|
||||||
void mainWindow_chooseWorkspaceClicked(GtkWidget *widget, gint event, gpointer user_data);
|
void mainWindow_chooseWorkspaceClicked(GtkWidget *widget, gint event, gpointer user_data);
|
||||||
void mainWindow_calendarSelected(GtkWidget *widget, gpointer user_data);
|
void mainWindow_calendarSelected(GtkWidget *widget, gpointer user_data);
|
||||||
void mainWindow_entrySelected(GtkWidget *widget, gpointer user_data);
|
|
||||||
|
|
||||||
#endif /* MAINWINDOW_H */
|
#endif /* MAINWINDOW_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user