Commit 98d42ed3 authored by Moritz Lipp's avatar Moritz Lipp

Begin to test config structure

parent 6046fc71
/* See LICENSE file for license and copyright information */
#include <callbacks.h>
#include <girara.h>
#include "zathura.h"
gboolean
cb_destroy(GtkWidget* widget, gpointer data)
{
if(Zathura.UI.session)
girara_session_destroy(Zathura.UI.session);
return TRUE;
}
......@@ -3,4 +3,8 @@
#ifndef CALLBACKS_H
#define CALLBACKS_H
#include <gtk/gtk.h>
gboolean cb_destroy(GtkWidget* widget, gpointer data);
#endif // CALLBACKS_H
/* See LICENSE file for license and copyright information */
#include "shortcuts.h"
#include "zathura.h"
void
config_load_default()
{
if(!Zathura.UI.session)
return;
girara_shortcut_add(Zathura.UI.session, GDK_CONTROL_MASK, GDK_q, NULL, sc_quit, 0, 0, NULL);
}
......@@ -3,4 +3,6 @@
#ifndef CONFIG_H
#define CONFIG_H
void config_load_default();
#endif // CONFIG_H
/* See LICENSE file for license and copyright information */
#include <girara.h>
#include <gtk/gtk.h>
#include "callbacks.h"
#include "shortcuts.h"
void
......@@ -113,7 +117,12 @@ sc_toggle_statusbar(girara_session_t* session, girara_argument_t* argument)
void
sc_quit(girara_session_t* session, girara_argument_t* argument)
{
girara_argument_t arg = { GIRARA_HIDE, NULL };
girara_isc_completion(session, &arg);
cb_destroy(NULL, NULL);
gtk_main_quit();
}
void
......
/* See LICENSE file for license and copyright information */
#include "callbacks.h"
#include "config.h"
#include "shortcuts.h"
#include "zathura.h"
/* function implementation */
......@@ -12,6 +15,12 @@ init_zathura()
if(!girara_session_init(Zathura.UI.session))
return false;
/* signals */
g_signal_connect(G_OBJECT(Zathura.UI.session->gtk.window), "destroy", G_CALLBACK(cb_destroy), NULL);
/* configuration */
config_load_default();
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment