pstr.c pstr.h \
ptime.c ptime.h \
tw.c tw.h \
- ui.c ui.h
+ ui.c ui.h \
+ ui_newtask_diag.c ui_newtask_diag.h
dist_man_MANS = ptask.1
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
PROGRAMS = $(bin_PROGRAMS)
am_ptask_OBJECTS = main.$(OBJEXT) log.$(OBJEXT) note.$(OBJEXT) \
- pstr.$(OBJEXT) ptime.$(OBJEXT) tw.$(OBJEXT) ui.$(OBJEXT)
+ pstr.$(OBJEXT) ptime.$(OBJEXT) tw.$(OBJEXT) ui.$(OBJEXT) \
+ ui_newtask_diag.$(OBJEXT)
ptask_OBJECTS = $(am_ptask_OBJECTS)
ptask_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
pstr.c pstr.h \
ptime.c ptime.h \
tw.c tw.h \
- ui.c ui.h
+ ui.c ui.h \
+ ui_newtask_diag.c ui_newtask_diag.h
dist_man_MANS = ptask.1
gsettings_SCHEMAS = ptask.gschema.xml
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptime.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tw.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ui_newtask_diag.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
gtk_widget_set_sensitive(GTK_WIDGET(w_priority), 0);
}
-static void refresh()
+void refresh()
{
GtkWidget *dialog;
GtkTreeModel *model;
return FALSE;
}
-int newtask_clicked_cbk(GtkButton *btn, gpointer data)
-{
- gint result;
- static GtkDialog *diag;
- GtkBuilder *builder;
- GtkEntry *entry;
- const char *ctxt;
-
- log_debug("newtask_clicked_cbk");
-
- builder = gtk_builder_new();
- gtk_builder_add_from_file
- (builder,
- PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "ptask.glade",
- NULL);
- diag = GTK_DIALOG(gtk_builder_get_object(builder, "diag_tasknew"));
- gtk_builder_connect_signals(builder, NULL);
-
- result = gtk_dialog_run(diag);
-
- if (result == GTK_RESPONSE_ACCEPT) {
- log_debug("ok");
- entry = GTK_ENTRY(gtk_builder_get_object
- (builder, "diag_tasknew_description"));
- ctxt = gtk_entry_get_text(entry);
-
- log_debug("%s", ctxt);
-
- tw_add(ctxt);
- refresh();
- } else {
- log_debug("cancel");
- }
-
- g_object_unref(G_OBJECT(builder));
-
- gtk_widget_destroy(GTK_WIDGET(diag));
-
- return FALSE;
-}
-
static int status_changed_cbk(GtkComboBox *w, gpointer data)
{
log_debug("status_changed_cbk");
#include <log.h>
#include <ui.h>
+#include <ui_newtask_diag.h>
static GtkTreeView *w_treeview;
+int newtask_clicked_cbk(GtkButton *btn, gpointer data)
+{
+ ui_newtask();
+
+ return FALSE;
+}
+
+
static void save_settings(GtkWindow *window, GSettings *settings)
{
int w, h, x, y, sort_col_id;
#include <gtk/gtk.h>
GtkWindow *create_window(GtkBuilder *, GSettings *);
+void refresh();
#endif
--- /dev/null
+/*
+ * Copyright (C) 2012-2013 jeanfi@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <gtk/gtk.h>
+
+#include <log.h>
+#include <tw.h>
+#include <ui.h>
+
+void ui_newtask()
+{
+ gint result;
+ static GtkDialog *diag;
+ GtkBuilder *builder;
+ GtkEntry *entry;
+ const char *ctxt;
+
+ log_debug("newtask_clicked_cbk");
+
+ builder = gtk_builder_new();
+ gtk_builder_add_from_file
+ (builder,
+ PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "ptask.glade",
+ NULL);
+ diag = GTK_DIALOG(gtk_builder_get_object(builder, "diag_tasknew"));
+ gtk_builder_connect_signals(builder, NULL);
+
+ result = gtk_dialog_run(diag);
+
+ if (result == GTK_RESPONSE_ACCEPT) {
+ log_debug("ok");
+ entry = GTK_ENTRY(gtk_builder_get_object
+ (builder, "diag_tasknew_description"));
+ ctxt = gtk_entry_get_text(entry);
+
+ log_debug("%s", ctxt);
+
+ tw_add(ctxt);
+ refresh();
+ } else {
+ log_debug("cancel");
+ }
+
+ g_object_unref(G_OBJECT(builder));
+
+ gtk_widget_destroy(GTK_WIDGET(diag));
+}
--- /dev/null
+/*
+ * Copyright (C) 2012-2013 jeanfi@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef _PTASK_UI_NEWTASK_DIAG_H_
+#define _PTASK_UI_NEWTASK_DIAG_H_
+
+void ui_newtask();
+
+#endif