Añadido plugin para SQLite.
VnLogin: - Ahora utiliza SQLite para guardar la configuracion.
This commit is contained in:
parent
6c900d351e
commit
3770dec9b5
|
@ -62,9 +62,11 @@ vn_guidir = $(vn_datadir)/gui
|
|||
module_querydir = $(hedera_datadir)/module/sql
|
||||
|
||||
if ENABLE_INSTALL
|
||||
vn_configdir = $(vn_datadir)
|
||||
vn_xmldir = $(datadir)/xml/$(PACKAGE)
|
||||
module_datadir = $(hedera_datadir)/module
|
||||
else
|
||||
vn_configdir = $(vn_datadir)/schema
|
||||
vn_xmldir = $(vn_datadir)/schema
|
||||
module_datadir = $(hedera_datadir)/module/data
|
||||
endif
|
||||
|
|
295
db/db-iterator.c
295
db/db-iterator.c
|
@ -178,11 +178,10 @@ static void db_iterator_on_model_status_changed (DbModel * model, DbModelStatus
|
|||
if (status == DB_MODEL_STATUS_READY)
|
||||
{
|
||||
DbIter iter;
|
||||
gint nrows = db_model_get_nrows (model);
|
||||
|
||||
g_signal_emit (self, signals[STATUS_CHANGED], 0, IS_READY(self));
|
||||
|
||||
if (self->row >= 0 && self->row < nrows
|
||||
|
||||
if (self->row >= 0 && self->row < db_model_get_nrows (model)
|
||||
&& db_model_get_iter (model, &iter, self->row))
|
||||
db_iterator_set_iter (self, &iter);
|
||||
else
|
||||
|
@ -636,98 +635,6 @@ gint db_iterator_get_column_index (DbIterator * self, const gchar * name)
|
|||
g_return_val_if_fail (IS_READY (self), -1);
|
||||
|
||||
return db_model_get_column_index (self->model, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* db_iterator_get_value:
|
||||
* @self: a #DbIterator
|
||||
* @column_name: the column name.
|
||||
*
|
||||
* Gets the value of the specified column name.
|
||||
*
|
||||
* Return value: (transfer none) (allow-none): the value or %NULL if
|
||||
* can't get it because the model isn't ready.
|
||||
**/
|
||||
const GValue * db_iterator_get_value (DbIterator * self, const gchar * column_name)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), NULL);
|
||||
|
||||
if (!self->row_selected)
|
||||
{
|
||||
gint column = db_model_get_column_index (self->model, column_name);
|
||||
|
||||
if (column != -1)
|
||||
return db_model_get_value (self->model, &self->iter, column, NULL);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* db_iterator_set_value:
|
||||
* @self: a #DbIterator
|
||||
* @column: the column name.
|
||||
* @value: a #GValue with the new value.
|
||||
* @err: (out) (allow-none): the return location for a #GError or %NULL.
|
||||
*
|
||||
* Sets the value of the specified column name.
|
||||
*
|
||||
* Return value: %TRUE if the value was changed, %FALSE otherwise
|
||||
**/
|
||||
gboolean db_iterator_set_value (DbIterator * self, const gchar * column_name, const GValue * value, GError ** err)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), FALSE);
|
||||
|
||||
if (db_iterator_check_row_selected (self))
|
||||
{
|
||||
gint column = db_model_get_column_index (self->model, column_name);
|
||||
|
||||
if (column != -1)
|
||||
return db_model_set_value (self->model, &self->iter, column, value, err);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* db_iterator_get_value_by_index:
|
||||
* @self: a #DbIterator
|
||||
* @column: the column index.
|
||||
*
|
||||
* Gets the value of the specified column index.
|
||||
*
|
||||
* Return value: (transfer none) (allow-none): the value or %NULL if
|
||||
* can't get it because the model isn't ready.
|
||||
**/
|
||||
const GValue * db_iterator_get_value_by_index (DbIterator * self, gint column)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), NULL);
|
||||
|
||||
if (self->row_selected)
|
||||
return db_model_get_value (self->model, &self->iter, column, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* db_iterator_set_value_by_index:
|
||||
* @self: a #DbIterator
|
||||
* @column: the column index.
|
||||
* @value: a #GValue with the new value.
|
||||
* @err: (out) (allow-none): the return location for a #GError or %NULL.
|
||||
*
|
||||
* Sets the value of the specified column index.
|
||||
*
|
||||
* Return value: %TRUE if the value was changed, %FALSE otherwise
|
||||
**/
|
||||
gboolean db_iterator_set_value_by_index (DbIterator * self, gint column, const GValue * value, GError ** err)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), FALSE);
|
||||
|
||||
if (db_iterator_check_row_selected (self))
|
||||
return db_model_set_value (self->model, &self->iter, column, value, err);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -951,6 +858,204 @@ gboolean db_iterator_has_pending_operations (DbIterator * self)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* db_iterator_get_value:
|
||||
* @self: a #DbIterator
|
||||
* @column_name: the column name.
|
||||
*
|
||||
* Gets the value of the specified column name.
|
||||
*
|
||||
* Return value: (transfer none) (allow-none): the value or %NULL if
|
||||
* can't get it because the model isn't ready.
|
||||
**/
|
||||
const GValue * db_iterator_get_value (DbIterator * self, const gchar * column_name)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), NULL);
|
||||
|
||||
if (self->row_selected)
|
||||
{
|
||||
gint column = db_model_get_column_index (self->model, column_name);
|
||||
|
||||
if (column != -1)
|
||||
return db_model_get_value (self->model, &self->iter, column, NULL);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* db_iterator_set_value:
|
||||
* @self: a #DbIterator
|
||||
* @column: the column name.
|
||||
* @value: a #GValue with the new value.
|
||||
* @err: (out) (allow-none): the return location for a #GError or %NULL.
|
||||
*
|
||||
* Sets the value of the specified column name.
|
||||
*
|
||||
* Return value: %TRUE if the value was changed, %FALSE otherwise
|
||||
**/
|
||||
gboolean db_iterator_set_value (DbIterator * self, const gchar * column_name, const GValue * value, GError ** err)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), FALSE);
|
||||
|
||||
if (db_iterator_check_row_selected (self))
|
||||
{
|
||||
gint column = db_model_get_column_index (self->model, column_name);
|
||||
|
||||
if (column != -1)
|
||||
return db_model_set_value (self->model, &self->iter, column, value, err);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* db_iterator_get_value_by_index:
|
||||
* @self: a #DbIterator
|
||||
* @column: the column index.
|
||||
*
|
||||
* Gets the value of the specified column index.
|
||||
*
|
||||
* Return value: (transfer none) (allow-none): the value or %NULL if
|
||||
* can't get it because the model isn't ready.
|
||||
**/
|
||||
const GValue * db_iterator_get_value_by_index (DbIterator * self, gint column)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), NULL);
|
||||
|
||||
if (self->row_selected)
|
||||
return db_model_get_value (self->model, &self->iter, column, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* db_iterator_set_value_by_index:
|
||||
* @self: a #DbIterator
|
||||
* @column: the column index.
|
||||
* @value: a #GValue with the new value.
|
||||
* @err: (out) (allow-none): the return location for a #GError or %NULL.
|
||||
*
|
||||
* Sets the value of the specified column index.
|
||||
*
|
||||
* Return value: %TRUE if the value was changed, %FALSE otherwise
|
||||
**/
|
||||
gboolean db_iterator_set_value_by_index (DbIterator * self, gint column, const GValue * value, GError ** err)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), FALSE);
|
||||
|
||||
if (db_iterator_check_row_selected (self))
|
||||
return db_model_set_value (self->model, &self->iter, column, value, err);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Useful methods
|
||||
/*
|
||||
static void db_iterator_take_value (DbIterator * self, const gchar * column_name, GValue * value)
|
||||
{
|
||||
db_iterator_set_value (self, const gchar * column_name, value);
|
||||
gvn_value_free (value);
|
||||
}
|
||||
|
||||
gboolean db_iterator_is_null (DbIterator * self, const gchar * column_name)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), TRUE);
|
||||
|
||||
return gvn_value_is_null (db_iterator_get_value (self, column_name));
|
||||
}
|
||||
|
||||
void db_iterator_set_null (DbIterator * self, const gchar * column_name)
|
||||
{
|
||||
g_return_if_fail (DB_IS_ITERATOR (self));
|
||||
|
||||
db_iterator_take_value (self, column_name, gvn_value_new_null ());
|
||||
}
|
||||
|
||||
gboolean db_iterator_get_boolean (DbIterator * self, const gchar * column_name)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), FALSE);
|
||||
|
||||
return gvn_value_get_boolean (db_iterator_get_value (self, column_name));
|
||||
}
|
||||
|
||||
void db_iterator_set_boolean (DbIterator * self, const gchar * column_name, gboolean value)
|
||||
{
|
||||
g_return_if_fail (DB_IS_ITERATOR (self));
|
||||
|
||||
db_iterator_take_value (self, column_name, gvn_value_new_boolean (value));
|
||||
}
|
||||
|
||||
gint db_iterator_get_int (DbIterator * self, const gchar * column_name)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), 0);
|
||||
|
||||
return gvn_value_get_int (db_iterator_get_value (self, column_name));;
|
||||
}
|
||||
|
||||
void db_iterator_set_int (DbIterator * self, const gchar * column_name, gint value)
|
||||
{
|
||||
g_return_if_fail (DB_IS_ITERATOR (self));
|
||||
|
||||
db_iterator_take_value (self, column_name, gvn_value_new_int (value));
|
||||
}
|
||||
|
||||
glong db_iterator_get_long (DbIterator * self, const gchar * column_name)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), 0);
|
||||
|
||||
return gvn_value_get_long (db_iterator_get_value (self, column_name));
|
||||
}
|
||||
|
||||
void db_iterator_set_long (DbIterator * self, const gchar * column_name, glong value)
|
||||
{
|
||||
g_return_if_fail (DB_IS_ITERATOR (self));
|
||||
|
||||
db_iterator_take_value (self, column_name, gvn_value_new_long (value));
|
||||
}
|
||||
|
||||
gdouble db_iterator_get_double (DbIterator * self, const gchar * column_name)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), 0);
|
||||
|
||||
return gvn_value_get_double (db_iterator_get_value (self, column_name));
|
||||
}
|
||||
|
||||
void db_iterator_set_double (DbIterator * self, const gchar * column_name, gdouble value)
|
||||
{
|
||||
g_return_if_fail (DB_IS_ITERATOR (self));
|
||||
|
||||
db_iterator_take_value (self, column_name, gvn_value_new_double (value));
|
||||
}
|
||||
|
||||
const gchar * db_iterator_get_string (DbIterator * self, const gchar * column_name)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), NULL);
|
||||
|
||||
return gvn_value_get_string (db_iterator_get_value (self, column_name));
|
||||
}
|
||||
|
||||
void db_iterator_set_string (DbIterator * self, const gchar * column_name, const gchar * value)
|
||||
{
|
||||
g_return_if_fail (DB_IS_ITERATOR (self));
|
||||
|
||||
db_iterator_take_value (self, column_name, gvn_value_new_string (value));
|
||||
}
|
||||
|
||||
gpointer db_iterator_get_boxed (DbIterator * self, const gchar * column_name)
|
||||
{
|
||||
g_return_val_if_fail (DB_IS_ITERATOR (self), NULL);
|
||||
|
||||
return gvn_value_get_boxed (db_iterator_get_value (self, column_name));
|
||||
}
|
||||
|
||||
void db_iterator_set_boxed (DbIterator * self, const gchar * column_name, gpointer value)
|
||||
{
|
||||
g_return_if_fail (DB_IS_ITERATOR (self));
|
||||
|
||||
db_iterator_take_value (self, column_name, gvn_value_new_boxed (value));
|
||||
}
|
||||
*/
|
||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++ Properties
|
||||
|
||||
enum
|
||||
|
|
|
@ -1335,6 +1335,8 @@ gint db_model_get_column_index (DbModel * self, const gchar * name)
|
|||
if (name && self->priv->column_index
|
||||
&& g_hash_table_lookup_extended (self->priv->column_index, name, NULL, &column))
|
||||
return GPOINTER_TO_INT (column);
|
||||
else
|
||||
g_warning ("DbModel: Column '%s' doesn't exists", name);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
|
147
gvn/gvn-param.c
147
gvn/gvn-param.c
|
@ -86,47 +86,6 @@ void gvn_param_set_value (GvnParam * self, const GValue * value)
|
|||
gvn_param_request_value (self, value, NULL);
|
||||
}
|
||||
|
||||
gboolean gvn_param_get_boolean (GvnParam * self)
|
||||
{
|
||||
if (!gvn_value_is_null (self->value))
|
||||
return g_value_get_boolean (self->value);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gint gvn_param_get_int (GvnParam * self)
|
||||
{
|
||||
if (!gvn_value_is_null (self->value))
|
||||
return g_value_get_int (self->value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
glong gvn_param_get_long (GvnParam * self)
|
||||
{
|
||||
if (!gvn_value_is_null (self->value))
|
||||
return g_value_get_long (self->value);
|
||||
|
||||
return 0L;
|
||||
}
|
||||
|
||||
gdouble gvn_param_get_double (GvnParam * self)
|
||||
{
|
||||
if (!gvn_value_is_null (self->value))
|
||||
return g_value_get_double (self->value);
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
const gchar * gvn_param_get_string (GvnParam * self)
|
||||
{
|
||||
if (!gvn_value_is_null (self->value))
|
||||
return g_value_get_string (self->value);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gvn_param_get_master:
|
||||
* @self: a #GvnParam where be took the value
|
||||
|
@ -198,6 +157,112 @@ void gvn_param_value_changed (GvnParam * self)
|
|||
g_signal_emit (self, signals[VALUE_CHANGED], 0, gvn_param_get_value (self));
|
||||
}
|
||||
|
||||
// Useful methods
|
||||
|
||||
static void gvn_param_take_value (GvnParam * self, GValue * value)
|
||||
{
|
||||
gvn_param_set_value (self, value);
|
||||
gvn_value_free (value);
|
||||
}
|
||||
|
||||
gboolean gvn_param_is_null (GvnParam * self)
|
||||
{
|
||||
g_return_val_if_fail (GVN_IS_PARAM (self), TRUE);
|
||||
|
||||
return gvn_value_is_null (gvn_param_get_value (self));
|
||||
}
|
||||
|
||||
void gvn_param_set_null (GvnParam * self)
|
||||
{
|
||||
g_return_if_fail (GVN_IS_PARAM (self));
|
||||
|
||||
gvn_param_take_value (self, gvn_value_new_null ());
|
||||
}
|
||||
|
||||
gboolean gvn_param_get_boolean (GvnParam * self)
|
||||
{
|
||||
g_return_val_if_fail (GVN_IS_PARAM (self), FALSE);
|
||||
|
||||
return gvn_value_get_boolean (gvn_param_get_value (self));
|
||||
}
|
||||
|
||||
void gvn_param_set_boolean (GvnParam * self, gboolean value)
|
||||
{
|
||||
g_return_if_fail (GVN_IS_PARAM (self));
|
||||
|
||||
gvn_param_take_value (self, gvn_value_new_boolean (value));
|
||||
}
|
||||
|
||||
gint gvn_param_get_int (GvnParam * self)
|
||||
{
|
||||
g_return_val_if_fail (GVN_IS_PARAM (self), 0);
|
||||
|
||||
return gvn_value_get_int (gvn_param_get_value (self));;
|
||||
}
|
||||
|
||||
void gvn_param_set_int (GvnParam * self, gint value)
|
||||
{
|
||||
g_return_if_fail (GVN_IS_PARAM (self));
|
||||
|
||||
gvn_param_take_value (self, gvn_value_new_int (value));
|
||||
}
|
||||
|
||||
glong gvn_param_get_long (GvnParam * self)
|
||||
{
|
||||
g_return_val_if_fail (GVN_IS_PARAM (self), 0);
|
||||
|
||||
return gvn_value_get_long (gvn_param_get_value (self));
|
||||
}
|
||||
|
||||
void gvn_param_set_long (GvnParam * self, glong value)
|
||||
{
|
||||
g_return_if_fail (GVN_IS_PARAM (self));
|
||||
|
||||
gvn_param_take_value (self, gvn_value_new_long (value));
|
||||
}
|
||||
|
||||
gdouble gvn_param_get_double (GvnParam * self)
|
||||
{
|
||||
g_return_val_if_fail (GVN_IS_PARAM (self), 0);
|
||||
|
||||
return gvn_value_get_double (gvn_param_get_value (self));
|
||||
}
|
||||
|
||||
void gvn_param_set_double (GvnParam * self, gdouble value)
|
||||
{
|
||||
g_return_if_fail (GVN_IS_PARAM (self));
|
||||
|
||||
gvn_param_take_value (self, gvn_value_new_double (value));
|
||||
}
|
||||
|
||||
const gchar * gvn_param_get_string (GvnParam * self)
|
||||
{
|
||||
g_return_val_if_fail (GVN_IS_PARAM (self), NULL);
|
||||
|
||||
return gvn_value_get_string (gvn_param_get_value (self));
|
||||
}
|
||||
|
||||
void gvn_param_set_string (GvnParam * self, const gchar * value)
|
||||
{
|
||||
g_return_if_fail (GVN_IS_PARAM (self));
|
||||
|
||||
gvn_param_take_value (self, gvn_value_new_string (value));
|
||||
}
|
||||
|
||||
gpointer gvn_param_get_boxed (GvnParam * self)
|
||||
{
|
||||
g_return_val_if_fail (GVN_IS_PARAM (self), NULL);
|
||||
|
||||
return gvn_value_get_boxed (gvn_param_get_value (self));
|
||||
}
|
||||
|
||||
void gvn_param_set_boxed (GvnParam * self, gpointer value)
|
||||
{
|
||||
g_return_if_fail (GVN_IS_PARAM (self));
|
||||
|
||||
gvn_param_take_value (self, gvn_value_new_boxed (value));
|
||||
}
|
||||
|
||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++ Class
|
||||
|
||||
static void gvn_param_default_init (GvnParamInterface * iface)
|
||||
|
|
|
@ -82,4 +82,19 @@ const GvnParamSpec * gvn_param_get_spec (GvnParam * self);
|
|||
GvnParamStatus gvn_param_get_status (GvnParam * self);
|
||||
void gvn_param_value_changed (GvnParam * self);
|
||||
|
||||
gboolean gvn_param_is_null (GvnParam * self);
|
||||
void gvn_param_set_null (GvnParam * self);
|
||||
gboolean gvn_param_get_boolean (GvnParam * self);
|
||||
void gvn_param_set_boolean (GvnParam * self, gboolean value);
|
||||
gint gvn_param_get_int (GvnParam * self);
|
||||
void gvn_param_set_int (GvnParam * self, gint value);
|
||||
glong gvn_param_get_long (GvnParam * self);
|
||||
void gvn_param_set_long (GvnParam * self, glong value);
|
||||
gdouble gvn_param_get_double (GvnParam * self);
|
||||
void gvn_param_set_double (GvnParam * self, gdouble value);
|
||||
const gchar * gvn_param_get_string (GvnParam * self);
|
||||
void gvn_param_set_string (GvnParam * self, const gchar * value);
|
||||
gpointer gvn_param_get_boxed (GvnParam * self);
|
||||
void gvn_param_set_boxed (GvnParam * self, gpointer value);
|
||||
|
||||
#endif
|
110
gvn/gvn-value.c
110
gvn/gvn-value.c
|
@ -115,7 +115,10 @@ static void gvn_value_transform_string_to_any (const GValue * src, GValue * dst)
|
|||
G_VALUE_TYPE (dst), g_value_get_string (src), -1);
|
||||
}
|
||||
|
||||
static void gvn_value_transform_null_to_any (const GValue * src, GValue * dst) {}
|
||||
static void gvn_value_transform_null_to_any (const GValue * src, GValue * dst)
|
||||
{
|
||||
g_value_reset (dst);
|
||||
}
|
||||
|
||||
static void gvn_value_transform_any_to_null (const GValue * src, GValue * dst)
|
||||
{
|
||||
|
@ -298,7 +301,7 @@ void gvn_value_new_with_content (GValue * value, GType type, gpointer content)
|
|||
|
||||
/**
|
||||
* gvn_value_get_valist:
|
||||
* @value: the type of value
|
||||
* @value: the #GValue
|
||||
* @va: a string to be converted
|
||||
*
|
||||
* Sets the value of the initilized @value with the value of next
|
||||
|
@ -597,6 +600,109 @@ void gvn_value_to_format_string (const GValue * src, const gchar * format, GValu
|
|||
}
|
||||
}
|
||||
|
||||
// Useful methods
|
||||
|
||||
void gvn_value_free (GValue * value)
|
||||
{
|
||||
g_value_unset (value);
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
GValue * gvn_value_new_null ()
|
||||
{
|
||||
return g_value_init (g_new0 (GValue, 1), GVN_TYPE_NULL);
|
||||
}
|
||||
|
||||
gboolean gvn_value_get_boolean (const GValue * value)
|
||||
{
|
||||
if (!gvn_value_is_null (value))
|
||||
return g_value_get_boolean (value);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GValue * gvn_value_new_boolean (gboolean value)
|
||||
{
|
||||
GValue * gvalue = g_new0 (GValue, 1);
|
||||
g_value_set_boolean (g_value_init (gvalue, G_TYPE_BOOLEAN), value);
|
||||
return gvalue;
|
||||
}
|
||||
|
||||
gint gvn_value_get_int (const GValue * value)
|
||||
{
|
||||
if (!gvn_value_is_null (value))
|
||||
return g_value_get_int (value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GValue * gvn_value_new_int (gint value)
|
||||
{
|
||||
GValue * gvalue = g_new0 (GValue, 1);
|
||||
g_value_set_int (g_value_init (gvalue, G_TYPE_INT), value);
|
||||
return gvalue;
|
||||
}
|
||||
|
||||
glong gvn_value_get_long (const GValue * value)
|
||||
{
|
||||
if (!gvn_value_is_null (value))
|
||||
return g_value_get_long (value);
|
||||
|
||||
return 0L;
|
||||
}
|
||||
|
||||
GValue * gvn_value_new_long (glong value)
|
||||
{
|
||||
GValue * gvalue = g_new0 (GValue, 1);
|
||||
g_value_set_long (g_value_init (gvalue, G_TYPE_LONG), value);
|
||||
return gvalue;
|
||||
}
|
||||
|
||||
gdouble gvn_value_get_double (const GValue * value)
|
||||
{
|
||||
if (!gvn_value_is_null (value))
|
||||
return g_value_get_double (value);
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
GValue * gvn_value_new_double (gdouble value)
|
||||
{
|
||||
GValue * gvalue = g_new0 (GValue, 1);
|
||||
g_value_set_double (g_value_init (gvalue, G_TYPE_DOUBLE), value);
|
||||
return gvalue;
|
||||
}
|
||||
|
||||
const gchar * gvn_value_get_string (const GValue * value)
|
||||
{
|
||||
if (!gvn_value_is_null (value))
|
||||
return g_value_get_string (value);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GValue * gvn_value_new_string (const gchar * value)
|
||||
{
|
||||
GValue * gvalue = g_new0 (GValue, 1);
|
||||
g_value_set_string (g_value_init (gvalue, G_TYPE_STRING), value);
|
||||
return gvalue;
|
||||
}
|
||||
|
||||
gpointer gvn_value_get_boxed (const GValue * value)
|
||||
{
|
||||
if (!gvn_value_is_null (value))
|
||||
return g_value_get_boxed (value);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GValue * gvn_value_new_boxed (gpointer value)
|
||||
{
|
||||
GValue * gvalue = g_new0 (GValue, 1);
|
||||
g_value_set_string (g_value_init (gvalue, G_TYPE_BOXED), value);
|
||||
return gvalue;
|
||||
}
|
||||
|
||||
/**
|
||||
* gvn_type_init:
|
||||
*
|
||||
|
|
|
@ -24,15 +24,31 @@
|
|||
#define gvn_value_compare(a, b) (!gvn_value_compare0 (a, b))
|
||||
#define gvn_value_is_null(value) (G_VALUE_TYPE (value) == GVN_TYPE_NULL)
|
||||
|
||||
GValue * gvn_value_new (GType type);
|
||||
void gvn_value_new_with_content (GValue * value, GType type, gpointer content);
|
||||
void gvn_value_new_from_string (GValue * value, GType type, const gchar * string, gsize length);
|
||||
void gvn_value_set_null (GValue * value);
|
||||
void gvn_value_get_valist (const GValue * value, va_list va);
|
||||
gint gvn_value_compare0 (const GValue * a, const GValue * b);
|
||||
void gvn_value_copy (const GValue * src, GValue * dst);
|
||||
gboolean gvn_value_ccopy (const GValue * src, GValue * dst);
|
||||
void gvn_value_to_format_string (const GValue * src, const gchar * format, GValue * dst);
|
||||
void gvn_type_init ();
|
||||
GValue * gvn_value_new (GType type);
|
||||
void gvn_value_new_with_content (GValue * value, GType type, gpointer content);
|
||||
void gvn_value_new_from_string (GValue * value, GType type, const gchar * string, gsize length);
|
||||
void gvn_value_set_null (GValue * value);
|
||||
void gvn_value_get_valist (const GValue * value, va_list va);
|
||||
gint gvn_value_compare0 (const GValue * a, const GValue * b);
|
||||
void gvn_value_copy (const GValue * src, GValue * dst);
|
||||
gboolean gvn_value_ccopy (const GValue * src, GValue * dst);
|
||||
void gvn_value_to_format_string (const GValue * src, const gchar * format, GValue * dst);
|
||||
|
||||
void gvn_value_free (GValue * value);
|
||||
GValue * gvn_value_new_null ();
|
||||
gboolean gvn_value_get_boolean (const GValue * value);
|
||||
GValue * gvn_value_new_boolean (gboolean value);
|
||||
gint gvn_value_get_int (const GValue * value);
|
||||
GValue * gvn_value_new_int (gint value);
|
||||
glong gvn_value_get_long (const GValue * value);
|
||||
GValue * gvn_value_new_long (glong value);
|
||||
gdouble gvn_value_get_double (const GValue * value);
|
||||
GValue * gvn_value_new_double (gdouble value);
|
||||
const gchar * gvn_value_get_string (const GValue * value);
|
||||
GValue * gvn_value_new_string (const gchar * value);
|
||||
gpointer gvn_value_get_boxed (const GValue * value);
|
||||
GValue * gvn_value_new_boxed (gpointer value);
|
||||
|
||||
void gvn_type_init ();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -39,7 +39,7 @@ int main (int argc, char * argv[])
|
|||
gvn_type_init ();
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
app = gtk_application_new ("apps.hedera", G_APPLICATION_FLAGS_NONE);
|
||||
app = gtk_application_new ("org.hedera", G_APPLICATION_FLAGS_NONE);
|
||||
login = vn_login_new (app);
|
||||
|
||||
if (g_application_register (G_APPLICATION (app), NULL, NULL))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.18.3 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.8"/>
|
||||
<requires lib="gtk+" version="3.12"/>
|
||||
<requires lib="vn" version="0.0"/>
|
||||
<!-- interface-local-resource-path ../image -->
|
||||
<object class="GtkActionGroup" id="actions">
|
||||
|
@ -31,6 +31,12 @@
|
|||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkListStore" id="model">
|
||||
<columns>
|
||||
<!-- column-name col -->
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
</object>
|
||||
<object class="GtkBox" id="main">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
|
@ -79,8 +85,8 @@
|
|||
<object class="GtkButtonBox" id="buttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">4</property>
|
||||
<property name="layout_style">start</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<property name="layout_style">expand</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button-send">
|
||||
<property name="label" translatable="yes">Send</property>
|
||||
|
@ -92,8 +98,8 @@
|
|||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
@ -108,8 +114,8 @@
|
|||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
@ -123,8 +129,8 @@
|
|||
<signal name="clicked" handler="vn_consulter_on_stop_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
@ -251,10 +257,4 @@
|
|||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkListStore" id="model">
|
||||
<columns>
|
||||
<!-- column-name col -->
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
|
@ -69,6 +69,8 @@ vn_gui_DATA = \
|
|||
gui/main.glade \
|
||||
gui/date-chooser.glade \
|
||||
gui/menu.glade
|
||||
vn_config_DATA = \
|
||||
schema/config.db
|
||||
|
||||
gsettings_SCHEMAS = $(top_srcdir)/vn/schema/$(PACKAGE).gschema.xml
|
||||
@GSETTINGS_RULES@
|
||||
|
@ -79,7 +81,8 @@ DEFINES = \
|
|||
-D_VN_MODULE_DATA_DIR=\"$(module_datadir)\" \
|
||||
-D_VN_MODULE_QUERY_DIR=\"$(module_querydir)\" \
|
||||
-D_HEDERA_LOCALE_DIR=\"$(datadir)/locale\" \
|
||||
-D_DTD_DIR=\"$(vn_xmldir)\"
|
||||
-D_DTD_DIR=\"$(vn_xmldir)\" \
|
||||
-D_VN_CONFIG_DIR=\"$(vn_configdir)\"
|
||||
|
||||
EXTRA_DIST = vn.pc.in
|
||||
|
||||
|
|
|
@ -6,227 +6,103 @@
|
|||
<!-- interface-local-resource-path ../image -->
|
||||
<object class="VnSet" id="models">
|
||||
<child>
|
||||
<object class="VnModel" id="model-connections">
|
||||
<property name="sql">SELECT rowid, name FROM connection</property>
|
||||
<property name="update_flags">DB_MODEL_INSERT | DB_MODEL_UPDATE</property>
|
||||
<object class="VnModel" id="model-last-conn">
|
||||
<property name="sql">SELECT rowid, last_connection FROM config LIMIT 1</property>
|
||||
<property name="update_flags">DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="VnModel" id="model-connection">
|
||||
<object class="VnModel" id="model-login">
|
||||
<property name="sql">SELECT rowid, name, plugin, schema, host, ssl_ca, user, password
|
||||
FROM connection WHERE #link</property>
|
||||
<property name="update_flags">DB_MODEL_UPDATE</property>
|
||||
<links>
|
||||
<link field="connection.rowid" param="edit-connection" linked="True"/>
|
||||
<link field="connection.rowid" param="connection" linked="True"/>
|
||||
</links>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="VnModel" id="model-connections">
|
||||
<property name="sql">SELECT rowid, name, plugin, schema, host, ssl_ca, user, password FROM connection</property>
|
||||
<property name="update_flags">DB_MODEL_INSERT | DB_MODEL_DELETE | DB_MODEL_UPDATE</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="VnSet" id="iterators">
|
||||
<child>
|
||||
<object class="VnIterator" id="iterator-last-conn">
|
||||
<property name="model">model-last-conn</property>
|
||||
<property name="mode">on-demand</property>
|
||||
<signal name="status-changed" handler="vn_login_on_last_conn_ready" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="VnIterator" id="iterator-login">
|
||||
<property name="model">model-login</property>
|
||||
<property name="mode">on-demand</property>
|
||||
<signal name="iter-changed" handler="vn_login_on_server_changed" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="VnIterator" id="iterator-connections">
|
||||
<property name="model">model-connections</property>
|
||||
<property name="mode">on-iter</property>
|
||||
<child>
|
||||
<object class="DbParam" id="edit-connection">
|
||||
<property name="column_name">name</property>
|
||||
<property name="column_name">rowid</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="VnIterator" id="iterator-conection">
|
||||
<property name="model">model-connection</property>
|
||||
<property name="mode">on-demand</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window">
|
||||
<object class="GtkApplicationWindow" id="window">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">15</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Access</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="window_position">center</property>
|
||||
<property name="icon">../image/icon.svg</property>
|
||||
<signal name="destroy" handler="vn_login_on_destroyed" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkBox" id="box4">
|
||||
<object class="GtkBox" id="login-box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="box1">
|
||||
<property name="height_request">40</property>
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="height_request">32</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="spacing">15</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="pixbuf">../image/logo.svg</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner" id="spinner">
|
||||
<property name="width_request">25</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="active">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="pixbuf">../image/logo.svg</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="login-grid">
|
||||
<object class="GtkBox" id="body-box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<property name="row_homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="remember">
|
||||
<property name="label" translatable="yes">Remember</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="password-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Password:</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="password">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="secondary_icon_name">edit-find-symbolic</property>
|
||||
<property name="secondary_icon_tooltip_text" translatable="yes">Press here to see the password</property>
|
||||
<signal name="icon-press" handler="vn_login_on_pass_show" swapped="no"/>
|
||||
<signal name="icon-release" handler="vn_login_on_pass_hide" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="user">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="user-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">User:</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="connection-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Server:</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">4</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="VnCombo" id="connection">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="iterator">iterator-last-conn</property>
|
||||
<property name="column_name">last_connection</property>
|
||||
<property name="null">False</property>
|
||||
<property name="model">model-connections</property>
|
||||
<child internal-child="widget">
|
||||
<object class="GtkComboBox" id="connection-widget">
|
||||
<object class="GtkComboBox" id="combo-widget1">
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButtonBox" id="bbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">8</property>
|
||||
<property name="layout_style">spread</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="settings">
|
||||
<property name="label">gtk-edit</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="vn_login_on_settings_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
|
@ -234,15 +110,15 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="connect">
|
||||
<property name="label">gtk-connect</property>
|
||||
<object class="VnEntry" id="user">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="vn_login_on_connect_clicked" swapped="no"/>
|
||||
<accelerator key="Return" signal="clicked"/>
|
||||
<accelerator key="KP_Enter" signal="clicked"/>
|
||||
<property name="can_focus">False</property>
|
||||
<child internal-child="widget">
|
||||
<object class="GtkEntry" id="entry-widget">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="placeholder_text" translatable="yes">User</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -250,11 +126,100 @@
|
|||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="VnEntry" id="password">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child internal-child="widget">
|
||||
<object class="GtkEntry" id="entry-widget10">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="secondary_icon_name">edit-find-symbolic</property>
|
||||
<property name="placeholder_text" translatable="yes">Password</property>
|
||||
<signal name="icon-press" handler="vn_login_on_pass_show" swapped="no"/>
|
||||
<signal name="icon-release" handler="vn_login_on_pass_hide" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="VnCheck" id="remember">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="null">False</property>
|
||||
<child internal-child="widget">
|
||||
<object class="GtkCheckButton" id="check-widget">
|
||||
<property name="label" translatable="yes">Remember</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="inconsistent">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButtonBox" id="buttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<property name="layout_style">expand</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="settings-button">
|
||||
<property name="label">gtk-preferences</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="vn_login_on_settings_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="connect">
|
||||
<property name="label">gtk-connect</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="vn_login_on_connect_clicked" swapped="no"/>
|
||||
<accelerator key="KP_Enter" signal="clicked"/>
|
||||
<accelerator key="Return" signal="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -262,7 +227,6 @@
|
|||
</object>
|
||||
<object class="GtkDialog" id="settings-dialog">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Configuration</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="destroy_with_parent">True</property>
|
||||
|
@ -271,13 +235,14 @@
|
|||
<property name="transient_for">window</property>
|
||||
<signal name="delete-event" handler="vn_login_settings_on_delete_event" swapped="no"/>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="settings-vbox">
|
||||
<object class="GtkBox" id="dialog-vbox">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox" id="settings-actions">
|
||||
<object class="GtkButtonBox" id="dialog-action_area">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="baseline_position">top</property>
|
||||
<property name="layout_style">spread</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="close">
|
||||
|
@ -286,9 +251,9 @@
|
|||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="vn_login_on_settings_apply_clicked" swapped="no"/>
|
||||
<accelerator key="Return" signal="clicked"/>
|
||||
<signal name="clicked" handler="vn_login_on_settings_close_clicked" swapped="no"/>
|
||||
<accelerator key="KP_Enter" signal="clicked"/>
|
||||
<accelerator key="Return" signal="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -308,6 +273,7 @@
|
|||
<object class="GtkBox" id="settings-box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="connections-box">
|
||||
|
@ -327,9 +293,7 @@
|
|||
<property name="can_focus">True</property>
|
||||
<property name="iterator">iterator-connections</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="grid-selection">
|
||||
<property name="mode">multiple</property>
|
||||
</object>
|
||||
<object class="GtkTreeSelection" id="grid-selection"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="VnColumnEntry" id="column-connections">
|
||||
|
@ -434,12 +398,15 @@
|
|||
<object class="VnEntry" id="ssl-ca">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="iterator">iterator-conection</property>
|
||||
<property name="iterator">iterator-connections</property>
|
||||
<property name="column_name">ssl_ca</property>
|
||||
<child internal-child="widget">
|
||||
<object class="GtkEntry" id="ssl-ca-child">
|
||||
<object class="GtkEntry" id="entry-widget9">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="secondary_icon_name">dialog-information-symbolic</property>
|
||||
<property name="secondary_icon_tooltip_text" translatable="yes">Path to the file containing the CA certificate, if this is empty SSL won't be used</property>
|
||||
<property name="secondary_icon_tooltip_markup" translatable="yes">Path to the file containing the CA certificate, if this is empty SSL won't be used</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -452,10 +419,11 @@
|
|||
<object class="VnEntry" id="schema">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="iterator">iterator-conection</property>
|
||||
<property name="iterator">iterator-connections</property>
|
||||
<property name="column_name">schema</property>
|
||||
<child internal-child="widget">
|
||||
<object class="GtkEntry" id="schema-child">
|
||||
<object class="GtkEntry" id="entry-widget11">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
|
@ -469,10 +437,11 @@
|
|||
<object class="VnEntry" id="host">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="iterator">iterator-conection</property>
|
||||
<property name="iterator">iterator-connections</property>
|
||||
<property name="column_name">host</property>
|
||||
<child internal-child="widget">
|
||||
<object class="GtkEntry" id="host-child">
|
||||
<object class="GtkEntry" id="entry-widget12">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
|
@ -482,23 +451,6 @@
|
|||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="VnCombo" id="plugin">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="iterator">iterator-conection</property>
|
||||
<property name="column_name">plugin</property>
|
||||
<child internal-child="widget">
|
||||
<object class="GtkComboBox" id="plugin-child">
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="name-label">
|
||||
<property name="visible">True</property>
|
||||
|
@ -515,10 +467,11 @@
|
|||
<object class="VnEntry" id="name">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="iterator">iterator-conection</property>
|
||||
<property name="iterator">iterator-connections</property>
|
||||
<property name="column_name">name</property>
|
||||
<child internal-child="widget">
|
||||
<object class="GtkEntry" id="name-child">
|
||||
<object class="GtkEntry" id="entry-widget13">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
|
@ -528,6 +481,53 @@
|
|||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="VnEntry" id="plugin">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="iterator">iterator-connections</property>
|
||||
<property name="column_name">plugin</property>
|
||||
<child internal-child="widget">
|
||||
<object class="GtkEntry" id="entry-widget14">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="user-label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">User:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="VnEntry" id="user1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="iterator">iterator-connections</property>
|
||||
<property name="column_name">user</property>
|
||||
<child internal-child="widget">
|
||||
<object class="GtkEntry" id="entry-widget15">
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -539,7 +539,7 @@
|
|||
<object class="VnHandler" id="handler-connection">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="iterator">iterator-conection</property>
|
||||
<property name="iterator">iterator-connections</property>
|
||||
<property name="show_flags">VN_HANDLER_SHOW_UNDO | VN_HANDLER_SHOW_SAVE</property>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
|
@ -12,161 +12,121 @@
|
|||
version="1.1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
width="196.80357"
|
||||
height="26.799999"
|
||||
viewBox="0 0 196.80357 26.799999"
|
||||
width="180"
|
||||
height="24.694674"
|
||||
viewBox="0 0 180 24.694674"
|
||||
enable-background="new 0 0 226.229 31.038"
|
||||
xml:space="preserve"
|
||||
id="svg2"
|
||||
inkscape:version="0.48.1 r9760"
|
||||
inkscape:version="0.48.5 r10040"
|
||||
sodipodi:docname="logo.svg"><metadata
|
||||
id="metadata61"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs59" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="710"
|
||||
id="namedview57"
|
||||
showgrid="false"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="106.10715"
|
||||
inkscape:cy="-24.459399"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="26"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="-0.2" />
|
||||
<g
|
||||
id="Background"
|
||||
transform="translate(246,-6.0370002)">
|
||||
</g>
|
||||
<g
|
||||
id="Guides"
|
||||
transform="translate(246,-6.0370002)">
|
||||
</g>
|
||||
<g
|
||||
id="Foreground"
|
||||
transform="matrix(0.86992944,0,0,0.86992944,-1.8041992e-6,0)">
|
||||
<g
|
||||
id="g7">
|
||||
<g
|
||||
id="g9">
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="M 10.417,30.321 0,0 h 8.233 l 4.26,15.582 0.349,1.276 c 0.521,1.866 0.918,3.431 1.191,4.693 0.15,-0.618 0.335,-1.345 0.555,-2.182 0.219,-0.837 0.528,-1.935 0.925,-3.293 L 19.981,0 h 8.19 l -10.5,30.321 h -7.254 z"
|
||||
id="path11"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill-rule:evenodd" />
|
||||
</g>
|
||||
<g
|
||||
id="g13">
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="m 139.809,19.787 c -0.665,0.357 -1.748,0.686 -3.25,0.988 -0.727,0.137 -1.283,0.254 -1.667,0.35 -0.95,0.247 -1.661,0.563 -2.134,0.947 -0.472,0.384 -0.799,0.899 -0.979,1.544 -0.223,0.796 -0.155,1.438 0.204,1.925 0.359,0.488 0.945,0.731 1.757,0.731 1.252,0 2.375,-0.36 3.369,-1.081 0.994,-0.721 1.653,-1.665 1.98,-2.831 l 0.72,-2.573 z m 5.106,10.534 h -7.458 c 0.017,-0.356 0.048,-0.726 0.094,-1.11 l 0.159,-1.192 c -1.318,1.026 -2.627,1.786 -3.927,2.279 -1.299,0.493 -2.643,0.739 -4.031,0.739 -2.158,0 -3.7,-0.593 -4.625,-1.779 -0.925,-1.187 -1.106,-2.788 -0.542,-4.804 0.519,-1.851 1.431,-3.356 2.737,-4.515 1.307,-1.159 3.021,-1.972 5.142,-2.438 1.169,-0.247 2.641,-0.515 4.413,-0.803 2.646,-0.412 4.082,-1.016 4.304,-1.812 l 0.151,-0.539 c 0.182,-0.65 0.076,-1.145 -0.317,-1.483 -0.393,-0.339 -1.071,-0.508 -2.033,-0.508 -1.045,0 -1.934,0.214 -2.666,0.643 -0.731,0.428 -1.289,1.058 -1.673,1.887 h -6.748 c 1.065,-2.53 2.64,-4.413 4.723,-5.65 2.083,-1.237 4.724,-1.856 7.923,-1.856 1.991,0 3.602,0.241 4.833,0.722 1.231,0.481 2.095,1.209 2.59,2.185 0.339,0.701 0.483,1.536 0.432,2.504 -0.052,0.969 -0.377,2.525 -0.978,4.669 l -2.375,8.483 c -0.284,1.014 -0.416,1.812 -0.396,2.395 0.02,0.583 0.188,0.962 0.503,1.141 l -0.235,0.842 z"
|
||||
id="path15"
|
||||
style="fill:#8ed300;fill-opacity:1;fill-rule:evenodd"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
id="g17">
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="m 185.7,30.321 6.27,-22.393 h 7.049 l -1.097,3.918 c 1.213,-1.537 2.502,-2.659 3.867,-3.366 1.365,-0.707 2.951,-1.074 4.758,-1.101 l -2.03,7.25 c -0.304,-0.042 -0.608,-0.072 -0.912,-0.093 -0.303,-0.02 -0.592,-0.03 -0.867,-0.03 -1.126,0 -2.104,0.168 -2.932,0.504 -0.829,0.336 -1.561,0.854 -2.197,1.555 -0.406,0.467 -0.789,1.136 -1.149,2.007 -0.361,0.872 -0.814,2.282 -1.359,4.232 l -2.104,7.516 H 185.7 z"
|
||||
id="path19"
|
||||
style="fill:#8ed300;fill-opacity:1;fill-rule:evenodd"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
id="g21">
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="m 217.631,19.787 c -0.664,0.357 -1.748,0.686 -3.25,0.988 -0.727,0.137 -1.282,0.254 -1.667,0.35 -0.95,0.247 -1.661,0.563 -2.134,0.947 -0.472,0.384 -0.799,0.899 -0.979,1.544 -0.223,0.796 -0.155,1.438 0.205,1.925 0.359,0.488 0.945,0.731 1.757,0.731 1.252,0 2.375,-0.36 3.369,-1.081 0.994,-0.721 1.654,-1.665 1.98,-2.831 l 0.719,-2.573 z m 5.106,10.534 h -7.458 c 0.017,-0.356 0.048,-0.726 0.094,-1.11 l 0.159,-1.192 c -1.318,1.026 -2.627,1.786 -3.927,2.279 -1.299,0.493 -2.643,0.739 -4.031,0.739 -2.158,0 -3.7,-0.593 -4.625,-1.779 -0.926,-1.187 -1.106,-2.788 -0.542,-4.804 0.519,-1.851 1.431,-3.356 2.737,-4.515 1.306,-1.159 3.02,-1.972 5.142,-2.438 1.169,-0.247 2.641,-0.515 4.413,-0.803 2.647,-0.412 4.082,-1.016 4.304,-1.812 l 0.151,-0.539 c 0.182,-0.65 0.077,-1.145 -0.317,-1.483 -0.393,-0.339 -1.071,-0.508 -2.033,-0.508 -1.045,0 -1.934,0.214 -2.666,0.643 -0.731,0.428 -1.289,1.058 -1.672,1.887 h -6.748 c 1.065,-2.53 2.64,-4.413 4.723,-5.65 2.083,-1.237 4.724,-1.856 7.923,-1.856 1.99,0 3.601,0.241 4.833,0.722 1.232,0.481 2.095,1.209 2.591,2.185 0.339,0.701 0.483,1.536 0.431,2.504 -0.051,0.969 -0.377,2.525 -0.978,4.669 l -2.375,8.483 c -0.284,1.014 -0.416,1.812 -0.396,2.395 0.02,0.583 0.188,0.962 0.503,1.141 l -0.236,0.842 z"
|
||||
id="path23"
|
||||
style="fill:#8ed300;fill-opacity:1;fill-rule:evenodd"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
id="g25">
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="m 188.386,7.928 -6.269,22.393 h -7.174 l 0.864,-3.085 c -1.227,1.246 -2.476,2.163 -3.746,2.751 -1.27,0.588 -2.625,0.882 -4.067,0.882 -2.471,0 -4.154,-0.634 -5.048,-1.901 -0.895,-1.268 -0.993,-3.149 -0.294,-5.644 l 4.31,-15.396 h 7.338 l -3.508,12.53 c -0.516,1.842 -0.641,3.109 -0.375,3.803 0.266,0.694 0.967,1.041 2.105,1.041 1.275,0 2.323,-0.422 3.142,-1.267 0.819,-0.845 1.497,-2.223 2.031,-4.133 l 3.353,-11.974 h 7.338 z"
|
||||
id="path27"
|
||||
style="fill:#8ed300;fill-opacity:1;fill-rule:evenodd"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
id="g29">
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="m 149.937,12.356 1.239,-4.428 h 2.995 l 1.771,-6.326 h 7.338 l -1.771,6.326 h 3.753 l -1.24,4.428 h -3.753 l -2.716,9.702 c -0.416,1.483 -0.498,2.465 -0.247,2.946 0.25,0.48 0.905,0.721 1.964,0.721 l 0.549,-0.011 0.39,-0.031 -1.31,4.678 c -0.811,0.148 -1.596,0.263 -2.354,0.344 -0.758,0.081 -1.48,0.122 -2.167,0.122 -2.543,0 -4.108,-0.621 -4.695,-1.863 -0.587,-1.242 -0.313,-3.887 0.82,-7.936 l 2.428,-8.672 h -2.994 z"
|
||||
id="path31"
|
||||
style="fill:#8ed300;fill-opacity:1;fill-rule:evenodd"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
<g
|
||||
id="g33">
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="m 73.875,18.896 c -0.561,2.004 -0.616,3.537 -0.167,4.601 0.449,1.064 1.375,1.595 2.774,1.595 1.399,0 2.605,-0.524 3.62,-1.574 1.015,-1.05 1.806,-2.59 2.375,-4.622 0.526,-1.879 0.556,-3.334 0.09,-4.363 -0.466,-1.029 -1.393,-1.543 -2.778,-1.543 -1.304,0 -2.487,0.528 -3.551,1.585 -1.064,1.057 -1.852,2.496 -2.363,4.321 z M 96.513,0 88.024,30.321 h -7.337 l 0.824,-2.944 c -1.166,1.22 -2.369,2.121 -3.61,2.703 -1.241,0.582 -2.583,0.874 -4.025,0.874 -2.802,0 -4.772,-1.081 -5.912,-3.243 -1.139,-2.162 -1.218,-4.993 -0.238,-8.493 0.988,-3.528 2.668,-6.404 5.042,-8.627 2.374,-2.224 4.927,-3.336 7.661,-3.336 1.47,0 2.695,0.296 3.676,0.887 0.981,0.591 1.681,1.465 2.099,2.62 L 89.217,0 h 7.296 z"
|
||||
id="path35"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-rule:evenodd" />
|
||||
<g
|
||||
id="g37">
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="m 73.875,18.896 c -0.561,2.004 -0.616,3.537 -0.167,4.601 0.449,1.064 1.375,1.595 2.774,1.595 1.399,0 2.605,-0.524 3.62,-1.574 1.015,-1.05 1.806,-2.59 2.375,-4.622 0.526,-1.879 0.556,-3.334 0.09,-4.363 -0.466,-1.029 -1.393,-1.543 -2.778,-1.543 -1.304,0 -2.487,0.528 -3.551,1.585 -1.064,1.057 -1.852,2.496 -2.363,4.321 z M 96.513,0 88.024,30.321 h -7.337 l 0.824,-2.944 c -1.166,1.22 -2.369,2.121 -3.61,2.703 -1.241,0.582 -2.583,0.874 -4.025,0.874 -2.802,0 -4.772,-1.081 -5.912,-3.243 -1.139,-2.162 -1.218,-4.993 -0.238,-8.493 0.988,-3.528 2.668,-6.404 5.042,-8.627 2.374,-2.224 4.927,-3.336 7.661,-3.336 1.47,0 2.695,0.296 3.676,0.887 0.981,0.591 1.681,1.465 2.099,2.62 L 89.217,0 h 7.296 z"
|
||||
id="path39"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill-rule:evenodd" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="g41">
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="M 46.488,30.321 52.757,7.928 h 7.049 l -1.098,3.918 C 59.921,10.309 61.21,9.187 62.576,8.48 63.942,7.773 68.591,7.406 70.398,7.379 l -2.03,7.25 c -0.304,-0.042 -0.608,-0.072 -0.911,-0.093 -0.304,-0.02 -0.592,-0.03 -0.867,-0.03 -1.126,0 -5.167,0.168 -5.997,0.504 -0.829,0.336 -1.561,0.854 -2.196,1.555 -0.406,0.467 -0.789,1.136 -1.149,2.007 -0.361,0.872 -0.814,2.282 -1.36,4.232 l -2.104,7.516 h -7.296 z"
|
||||
id="path43"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill-rule:evenodd" />
|
||||
</g>
|
||||
<g
|
||||
id="g45">
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="m 32.673,16.742 8.351,-0.021 c 0.375,-1.436 0.308,-2.558 -0.201,-3.365 -0.509,-0.807 -1.402,-1.211 -2.68,-1.211 -1.209,0 -2.285,0.397 -3.229,1.19 -0.944,0.793 -1.69,1.93 -2.241,3.407 z m 6.144,6.536 h 7.043 c -1.347,2.456 -3.172,4.356 -5.477,5.7 -2.305,1.345 -4.885,2.017 -7.74,2.017 -3.473,0 -5.923,-1.054 -7.351,-3.161 -1.427,-2.107 -1.632,-4.98 -0.613,-8.618 1.038,-3.707 2.875,-6.641 5.512,-8.803 2.637,-2.163 5.678,-3.244 9.123,-3.244 3.555,0 6.04,1.099 7.456,3.298 1.417,2.198 1.582,5.234 0.498,9.109 l -0.239,0.814 -0.167,0.484 H 31.721 c -0.441,1.575 -0.438,2.777 0.01,3.606 0.448,0.829 1.332,1.244 2.65,1.244 0.975,0 1.836,-0.206 2.583,-0.617 0.747,-0.411 1.366,-1.021 1.853,-1.829 z"
|
||||
id="path47"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-rule:evenodd" />
|
||||
<g
|
||||
id="g49">
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="m 32.673,16.742 8.351,-0.021 c 0.375,-1.436 0.308,-2.558 -0.201,-3.365 -0.509,-0.807 -1.402,-1.211 -2.68,-1.211 -1.209,0 -2.285,0.397 -3.229,1.19 -0.944,0.793 -1.69,1.93 -2.241,3.407 z m 6.144,6.536 h 7.043 c -1.347,2.456 -3.172,4.356 -5.477,5.7 -2.305,1.345 -4.885,2.017 -7.74,2.017 -3.473,0 -5.923,-1.054 -7.351,-3.161 -1.427,-2.107 -1.632,-4.98 -0.613,-8.618 1.038,-3.707 2.875,-6.641 5.512,-8.803 2.637,-2.163 5.678,-3.244 9.123,-3.244 3.555,0 6.04,1.099 7.456,3.298 1.417,2.198 1.582,5.234 0.498,9.109 l -0.239,0.814 -0.167,0.484 H 31.721 c -0.441,1.575 -0.438,2.777 0.01,3.606 0.448,0.829 1.332,1.244 2.65,1.244 0.975,0 1.836,-0.206 2.583,-0.617 0.747,-0.411 1.366,-1.021 1.853,-1.829 z"
|
||||
id="path51"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill-rule:evenodd" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="g53">
|
||||
<path
|
||||
d="m 112.881,30.643 -6.404,-18.639 -6.455,18.639 h -7.254 l 9.565,-30.321 h 8.19 l 4.434,15.582 0.35,1.276 c 0.521,1.866 0.917,3.431 1.191,4.693 l 0.555,-2.182 c 0.219,-0.837 0.528,-1.935 0.925,-3.293 l 4.468,-16.076 h 8.19 l -10.501,30.321 h -7.254 z"
|
||||
id="path55"
|
||||
style="fill:#8ed300;fill-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
id="metadata61"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /><cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/publicdomain/" /></cc:Work><cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/publicdomain/"><cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" /><cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" /><cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /></cc:License></rdf:RDF></metadata><defs
|
||||
id="defs59" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="702"
|
||||
id="namedview57"
|
||||
showgrid="false"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="57.000001"
|
||||
inkscape:cy="-26.42275"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="339"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2"
|
||||
fit-margin-top="2.7755576e-17"
|
||||
fit-margin-left="2.7755576e-17"
|
||||
fit-margin-right="2.7755576e-17"
|
||||
fit-margin-bottom="2.7755576e-17" /><g
|
||||
id="Background"
|
||||
transform="translate(223,-3.3423258)" /><g
|
||||
id="Guides"
|
||||
transform="translate(223,-3.3423258)" /><g
|
||||
id="Foreground"
|
||||
transform="matrix(0.79565275,0,0,0.79565275,-1.5713392e-6,0)"><g
|
||||
id="g7"><g
|
||||
id="g9"><path
|
||||
clip-rule="evenodd"
|
||||
d="M 10.417,30.321 0,0 h 8.233 l 4.26,15.582 0.349,1.276 c 0.521,1.866 0.918,3.431 1.191,4.693 0.15,-0.618 0.335,-1.345 0.555,-2.182 0.219,-0.837 0.528,-1.935 0.925,-3.293 L 19.981,0 h 8.19 l -10.5,30.321 h -7.254 z"
|
||||
id="path11"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill-rule:evenodd" /></g><g
|
||||
id="g13"><path
|
||||
clip-rule="evenodd"
|
||||
d="m 139.809,19.787 c -0.665,0.357 -1.748,0.686 -3.25,0.988 -0.727,0.137 -1.283,0.254 -1.667,0.35 -0.95,0.247 -1.661,0.563 -2.134,0.947 -0.472,0.384 -0.799,0.899 -0.979,1.544 -0.223,0.796 -0.155,1.438 0.204,1.925 0.359,0.488 0.945,0.731 1.757,0.731 1.252,0 2.375,-0.36 3.369,-1.081 0.994,-0.721 1.653,-1.665 1.98,-2.831 l 0.72,-2.573 z m 5.106,10.534 h -7.458 c 0.017,-0.356 0.048,-0.726 0.094,-1.11 l 0.159,-1.192 c -1.318,1.026 -2.627,1.786 -3.927,2.279 -1.299,0.493 -2.643,0.739 -4.031,0.739 -2.158,0 -3.7,-0.593 -4.625,-1.779 -0.925,-1.187 -1.106,-2.788 -0.542,-4.804 0.519,-1.851 1.431,-3.356 2.737,-4.515 1.307,-1.159 3.021,-1.972 5.142,-2.438 1.169,-0.247 2.641,-0.515 4.413,-0.803 2.646,-0.412 4.082,-1.016 4.304,-1.812 l 0.151,-0.539 c 0.182,-0.65 0.076,-1.145 -0.317,-1.483 -0.393,-0.339 -1.071,-0.508 -2.033,-0.508 -1.045,0 -1.934,0.214 -2.666,0.643 -0.731,0.428 -1.289,1.058 -1.673,1.887 h -6.748 c 1.065,-2.53 2.64,-4.413 4.723,-5.65 2.083,-1.237 4.724,-1.856 7.923,-1.856 1.991,0 3.602,0.241 4.833,0.722 1.231,0.481 2.095,1.209 2.59,2.185 0.339,0.701 0.483,1.536 0.432,2.504 -0.052,0.969 -0.377,2.525 -0.978,4.669 l -2.375,8.483 c -0.284,1.014 -0.416,1.812 -0.396,2.395 0.02,0.583 0.188,0.962 0.503,1.141 l -0.235,0.842 z"
|
||||
id="path15"
|
||||
style="fill:#8ed300;fill-opacity:1;fill-rule:evenodd"
|
||||
inkscape:connector-curvature="0" /></g><g
|
||||
id="g17"><path
|
||||
clip-rule="evenodd"
|
||||
d="m 185.7,30.321 6.27,-22.393 h 7.049 l -1.097,3.918 c 1.213,-1.537 2.502,-2.659 3.867,-3.366 1.365,-0.707 2.951,-1.074 4.758,-1.101 l -2.03,7.25 c -0.304,-0.042 -0.608,-0.072 -0.912,-0.093 -0.303,-0.02 -0.592,-0.03 -0.867,-0.03 -1.126,0 -2.104,0.168 -2.932,0.504 -0.829,0.336 -1.561,0.854 -2.197,1.555 -0.406,0.467 -0.789,1.136 -1.149,2.007 -0.361,0.872 -0.814,2.282 -1.359,4.232 l -2.104,7.516 H 185.7 z"
|
||||
id="path19"
|
||||
style="fill:#8ed300;fill-opacity:1;fill-rule:evenodd"
|
||||
inkscape:connector-curvature="0" /></g><g
|
||||
id="g21"><path
|
||||
clip-rule="evenodd"
|
||||
d="m 217.631,19.787 c -0.664,0.357 -1.748,0.686 -3.25,0.988 -0.727,0.137 -1.282,0.254 -1.667,0.35 -0.95,0.247 -1.661,0.563 -2.134,0.947 -0.472,0.384 -0.799,0.899 -0.979,1.544 -0.223,0.796 -0.155,1.438 0.205,1.925 0.359,0.488 0.945,0.731 1.757,0.731 1.252,0 2.375,-0.36 3.369,-1.081 0.994,-0.721 1.654,-1.665 1.98,-2.831 l 0.719,-2.573 z m 5.106,10.534 h -7.458 c 0.017,-0.356 0.048,-0.726 0.094,-1.11 l 0.159,-1.192 c -1.318,1.026 -2.627,1.786 -3.927,2.279 -1.299,0.493 -2.643,0.739 -4.031,0.739 -2.158,0 -3.7,-0.593 -4.625,-1.779 -0.926,-1.187 -1.106,-2.788 -0.542,-4.804 0.519,-1.851 1.431,-3.356 2.737,-4.515 1.306,-1.159 3.02,-1.972 5.142,-2.438 1.169,-0.247 2.641,-0.515 4.413,-0.803 2.647,-0.412 4.082,-1.016 4.304,-1.812 l 0.151,-0.539 c 0.182,-0.65 0.077,-1.145 -0.317,-1.483 -0.393,-0.339 -1.071,-0.508 -2.033,-0.508 -1.045,0 -1.934,0.214 -2.666,0.643 -0.731,0.428 -1.289,1.058 -1.672,1.887 h -6.748 c 1.065,-2.53 2.64,-4.413 4.723,-5.65 2.083,-1.237 4.724,-1.856 7.923,-1.856 1.99,0 3.601,0.241 4.833,0.722 1.232,0.481 2.095,1.209 2.591,2.185 0.339,0.701 0.483,1.536 0.431,2.504 -0.051,0.969 -0.377,2.525 -0.978,4.669 l -2.375,8.483 c -0.284,1.014 -0.416,1.812 -0.396,2.395 0.02,0.583 0.188,0.962 0.503,1.141 l -0.236,0.842 z"
|
||||
id="path23"
|
||||
style="fill:#8ed300;fill-opacity:1;fill-rule:evenodd"
|
||||
inkscape:connector-curvature="0" /></g><g
|
||||
id="g25"><path
|
||||
clip-rule="evenodd"
|
||||
d="m 188.386,7.928 -6.269,22.393 h -7.174 l 0.864,-3.085 c -1.227,1.246 -2.476,2.163 -3.746,2.751 -1.27,0.588 -2.625,0.882 -4.067,0.882 -2.471,0 -4.154,-0.634 -5.048,-1.901 -0.895,-1.268 -0.993,-3.149 -0.294,-5.644 l 4.31,-15.396 h 7.338 l -3.508,12.53 c -0.516,1.842 -0.641,3.109 -0.375,3.803 0.266,0.694 0.967,1.041 2.105,1.041 1.275,0 2.323,-0.422 3.142,-1.267 0.819,-0.845 1.497,-2.223 2.031,-4.133 l 3.353,-11.974 h 7.338 z"
|
||||
id="path27"
|
||||
style="fill:#8ed300;fill-opacity:1;fill-rule:evenodd"
|
||||
inkscape:connector-curvature="0" /></g><g
|
||||
id="g29"><path
|
||||
clip-rule="evenodd"
|
||||
d="m 149.937,12.356 1.239,-4.428 h 2.995 l 1.771,-6.326 h 7.338 l -1.771,6.326 h 3.753 l -1.24,4.428 h -3.753 l -2.716,9.702 c -0.416,1.483 -0.498,2.465 -0.247,2.946 0.25,0.48 0.905,0.721 1.964,0.721 l 0.549,-0.011 0.39,-0.031 -1.31,4.678 c -0.811,0.148 -1.596,0.263 -2.354,0.344 -0.758,0.081 -1.48,0.122 -2.167,0.122 -2.543,0 -4.108,-0.621 -4.695,-1.863 -0.587,-1.242 -0.313,-3.887 0.82,-7.936 l 2.428,-8.672 h -2.994 z"
|
||||
id="path31"
|
||||
style="fill:#8ed300;fill-opacity:1;fill-rule:evenodd"
|
||||
inkscape:connector-curvature="0" /></g><g
|
||||
id="g33"><path
|
||||
clip-rule="evenodd"
|
||||
d="m 73.875,18.896 c -0.561,2.004 -0.616,3.537 -0.167,4.601 0.449,1.064 1.375,1.595 2.774,1.595 1.399,0 2.605,-0.524 3.62,-1.574 1.015,-1.05 1.806,-2.59 2.375,-4.622 0.526,-1.879 0.556,-3.334 0.09,-4.363 -0.466,-1.029 -1.393,-1.543 -2.778,-1.543 -1.304,0 -2.487,0.528 -3.551,1.585 -1.064,1.057 -1.852,2.496 -2.363,4.321 z M 96.513,0 88.024,30.321 h -7.337 l 0.824,-2.944 c -1.166,1.22 -2.369,2.121 -3.61,2.703 -1.241,0.582 -2.583,0.874 -4.025,0.874 -2.802,0 -4.772,-1.081 -5.912,-3.243 -1.139,-2.162 -1.218,-4.993 -0.238,-8.493 0.988,-3.528 2.668,-6.404 5.042,-8.627 2.374,-2.224 4.927,-3.336 7.661,-3.336 1.47,0 2.695,0.296 3.676,0.887 0.981,0.591 1.681,1.465 2.099,2.62 L 89.217,0 h 7.296 z"
|
||||
id="path35"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-rule:evenodd" /><g
|
||||
id="g37"><path
|
||||
clip-rule="evenodd"
|
||||
d="m 73.875,18.896 c -0.561,2.004 -0.616,3.537 -0.167,4.601 0.449,1.064 1.375,1.595 2.774,1.595 1.399,0 2.605,-0.524 3.62,-1.574 1.015,-1.05 1.806,-2.59 2.375,-4.622 0.526,-1.879 0.556,-3.334 0.09,-4.363 -0.466,-1.029 -1.393,-1.543 -2.778,-1.543 -1.304,0 -2.487,0.528 -3.551,1.585 -1.064,1.057 -1.852,2.496 -2.363,4.321 z M 96.513,0 88.024,30.321 h -7.337 l 0.824,-2.944 c -1.166,1.22 -2.369,2.121 -3.61,2.703 -1.241,0.582 -2.583,0.874 -4.025,0.874 -2.802,0 -4.772,-1.081 -5.912,-3.243 -1.139,-2.162 -1.218,-4.993 -0.238,-8.493 0.988,-3.528 2.668,-6.404 5.042,-8.627 2.374,-2.224 4.927,-3.336 7.661,-3.336 1.47,0 2.695,0.296 3.676,0.887 0.981,0.591 1.681,1.465 2.099,2.62 L 89.217,0 h 7.296 z"
|
||||
id="path39"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill-rule:evenodd" /></g></g><g
|
||||
id="g41"><path
|
||||
clip-rule="evenodd"
|
||||
d="M 46.488,30.321 52.757,7.928 h 7.049 l -1.098,3.918 C 59.921,10.309 61.21,9.187 62.576,8.48 63.942,7.773 68.591,7.406 70.398,7.379 l -2.03,7.25 c -0.304,-0.042 -0.608,-0.072 -0.911,-0.093 -0.304,-0.02 -0.592,-0.03 -0.867,-0.03 -1.126,0 -5.167,0.168 -5.997,0.504 -0.829,0.336 -1.561,0.854 -2.196,1.555 -0.406,0.467 -0.789,1.136 -1.149,2.007 -0.361,0.872 -0.814,2.282 -1.36,4.232 l -2.104,7.516 h -7.296 z"
|
||||
id="path43"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill-rule:evenodd" /></g><g
|
||||
id="g45"><path
|
||||
clip-rule="evenodd"
|
||||
d="m 32.673,16.742 8.351,-0.021 c 0.375,-1.436 0.308,-2.558 -0.201,-3.365 -0.509,-0.807 -1.402,-1.211 -2.68,-1.211 -1.209,0 -2.285,0.397 -3.229,1.19 -0.944,0.793 -1.69,1.93 -2.241,3.407 z m 6.144,6.536 h 7.043 c -1.347,2.456 -3.172,4.356 -5.477,5.7 -2.305,1.345 -4.885,2.017 -7.74,2.017 -3.473,0 -5.923,-1.054 -7.351,-3.161 -1.427,-2.107 -1.632,-4.98 -0.613,-8.618 1.038,-3.707 2.875,-6.641 5.512,-8.803 2.637,-2.163 5.678,-3.244 9.123,-3.244 3.555,0 6.04,1.099 7.456,3.298 1.417,2.198 1.582,5.234 0.498,9.109 l -0.239,0.814 -0.167,0.484 H 31.721 c -0.441,1.575 -0.438,2.777 0.01,3.606 0.448,0.829 1.332,1.244 2.65,1.244 0.975,0 1.836,-0.206 2.583,-0.617 0.747,-0.411 1.366,-1.021 1.853,-1.829 z"
|
||||
id="path47"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-rule:evenodd" /><g
|
||||
id="g49"><path
|
||||
clip-rule="evenodd"
|
||||
d="m 32.673,16.742 8.351,-0.021 c 0.375,-1.436 0.308,-2.558 -0.201,-3.365 -0.509,-0.807 -1.402,-1.211 -2.68,-1.211 -1.209,0 -2.285,0.397 -3.229,1.19 -0.944,0.793 -1.69,1.93 -2.241,3.407 z m 6.144,6.536 h 7.043 c -1.347,2.456 -3.172,4.356 -5.477,5.7 -2.305,1.345 -4.885,2.017 -7.74,2.017 -3.473,0 -5.923,-1.054 -7.351,-3.161 -1.427,-2.107 -1.632,-4.98 -0.613,-8.618 1.038,-3.707 2.875,-6.641 5.512,-8.803 2.637,-2.163 5.678,-3.244 9.123,-3.244 3.555,0 6.04,1.099 7.456,3.298 1.417,2.198 1.582,5.234 0.498,9.109 l -0.239,0.814 -0.167,0.484 H 31.721 c -0.441,1.575 -0.438,2.777 0.01,3.606 0.448,0.829 1.332,1.244 2.65,1.244 0.975,0 1.836,-0.206 2.583,-0.617 0.747,-0.411 1.366,-1.021 1.853,-1.829 z"
|
||||
id="path51"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill-rule:evenodd" /></g></g><g
|
||||
id="g53"><path
|
||||
d="m 112.881,30.643 -6.404,-18.639 -6.455,18.639 h -7.254 l 9.565,-30.321 h 8.19 l 4.434,15.582 0.35,1.276 c 0.521,1.866 0.917,3.431 1.191,4.693 l 0.555,-2.182 c 0.219,-0.837 0.528,-1.935 0.925,-3.293 l 4.468,-16.076 h 8.19 l -10.501,30.321 h -7.254 z"
|
||||
id="path55"
|
||||
style="fill:#8ed300;fill-opacity:1"
|
||||
inkscape:connector-curvature="0" /></g></g></g></svg>
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
|
@ -1,23 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<schemalist>
|
||||
<schema id="apps.hedera" path="/apps/hedera/">
|
||||
<key type="s" name="plugin">
|
||||
<default>""</default>
|
||||
</key>
|
||||
<key type="s" name="host">
|
||||
<default>"localhost"</default>
|
||||
</key>
|
||||
<key type="s" name="schema">
|
||||
<default>""</default>
|
||||
</key>
|
||||
<key type="s" name="user">
|
||||
<default>""</default>
|
||||
</key>
|
||||
<key type="s" name="pass">
|
||||
<default>""</default>
|
||||
</key>
|
||||
<key type="s" name="ssl-ca">
|
||||
<default>""</default>
|
||||
</key>
|
||||
<schema id="org.hedera" path="/org/hedera/">
|
||||
</schema>
|
||||
</schemalist>
|
||||
|
|
|
@ -104,7 +104,7 @@ static void vn_column_update_column_index (VnColumn * obj)
|
|||
{
|
||||
DbModel * model = vn_column_get_model (obj);
|
||||
|
||||
if (model)
|
||||
if (model && db_model_is_ready (model))
|
||||
{
|
||||
obj->column_index = db_model_get_column_index (model, obj->column_name);
|
||||
|
||||
|
|
56
vn/vn-grid.c
56
vn/vn-grid.c
|
@ -71,27 +71,36 @@ static void vn_grid_on_selection_changed (GtkTreeSelection * selection, GtkTreeV
|
|||
g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
|
||||
}
|
||||
|
||||
static void vn_grid_on_cursor_changed (GtkTreeView * obj, DbIterator * iterator)
|
||||
static void vn_grid_on_cursor_changed (GtkTreeView * tree_view, VnGrid * obj)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GtkTreePath * path;
|
||||
|
||||
if (gtk_tree_selection_count_selected_rows (gtk_tree_view_get_selection (obj)) > 1)
|
||||
gint selected_rows;
|
||||
|
||||
if (!db_iterator_is_ready (obj->iterator))
|
||||
return;
|
||||
|
||||
gtk_tree_view_get_cursor (obj, &path, NULL);
|
||||
selected_rows = gtk_tree_selection_count_selected_rows (gtk_tree_view_get_selection (tree_view));
|
||||
|
||||
if (path && gtk_tree_model_get_iter (gtk_tree_view_get_model (obj), &iter, path))
|
||||
if (selected_rows == 1)
|
||||
{
|
||||
DbIter dbiter;
|
||||
vn_gtk_tree_iter_to_db_iter (&iter, &dbiter);
|
||||
GtkTreeIter iter;
|
||||
GtkTreePath * path;
|
||||
|
||||
g_signal_handlers_block_by_func (iterator, vn_grid_on_iter_changed, obj);
|
||||
db_iterator_move_iter (iterator, &dbiter);
|
||||
g_signal_handlers_unblock_by_func (iterator, vn_grid_on_iter_changed, obj);
|
||||
gtk_tree_view_get_cursor (tree_view, &path, NULL);
|
||||
|
||||
if (path && gtk_tree_model_get_iter (gtk_tree_view_get_model (tree_view), &iter, path))
|
||||
{
|
||||
DbIter dbiter;
|
||||
vn_gtk_tree_iter_to_db_iter (&iter, &dbiter);
|
||||
|
||||
g_signal_handlers_block_by_func (obj->iterator, vn_grid_on_iter_changed, obj);
|
||||
db_iterator_move_iter (obj->iterator, &dbiter);
|
||||
g_signal_handlers_unblock_by_func (obj->iterator, vn_grid_on_iter_changed, obj);
|
||||
}
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
else if (selected_rows == 0)
|
||||
db_iterator_move_iter (obj->iterator, NULL);
|
||||
}
|
||||
|
||||
static void vn_grid_on_iter_changed (DbIterator * iterator, GtkTreeView * obj)
|
||||
|
@ -305,9 +314,6 @@ void vn_grid_set_iterator (VnGrid * obj, DbIterator * iterator)
|
|||
|
||||
if (obj->iterator)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (obj,
|
||||
vn_grid_on_cursor_changed, obj->iterator);
|
||||
|
||||
g_object_disconnect (obj->iterator
|
||||
,"any-signal", vn_grid_on_iter_changed, obj
|
||||
,"any-signal", vn_grid_on_status_changed, obj
|
||||
|
@ -328,9 +334,6 @@ void vn_grid_set_iterator (VnGrid * obj, DbIterator * iterator)
|
|||
|
||||
vn_grid_on_status_changed (iterator,
|
||||
db_iterator_is_ready (iterator), obj);
|
||||
|
||||
g_signal_connect_after (obj, "cursor-changed",
|
||||
G_CALLBACK (vn_grid_on_cursor_changed), iterator);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -394,12 +397,13 @@ static void vn_grid_init (VnGrid * obj)
|
|||
g_signal_connect (selection, "changed",
|
||||
G_CALLBACK (vn_grid_on_selection_changed), obj);
|
||||
|
||||
g_signal_connect (obj, "notify::model",
|
||||
G_CALLBACK (vn_grid_on_model_changed), NULL);
|
||||
g_signal_connect (obj, "key-press-event",
|
||||
G_CALLBACK (vn_grid_on_cursor_key_pressed), NULL);
|
||||
g_signal_connect (obj, "key-press-event",
|
||||
G_CALLBACK (vn_grid_on_escape_pressed), NULL);
|
||||
g_object_connect (obj
|
||||
,"signal::notify::model", vn_grid_on_model_changed, obj
|
||||
,"signal::key-press-event", vn_grid_on_cursor_key_pressed, obj
|
||||
,"signal::key-press-event", vn_grid_on_escape_pressed, obj
|
||||
,"signal-after::cursor-changed", vn_grid_on_cursor_changed, obj
|
||||
,NULL
|
||||
);
|
||||
}
|
||||
|
||||
static void vn_grid_finalize (VnGrid * obj)
|
||||
|
|
|
@ -77,10 +77,7 @@ static void vn_handler_on_remove_activated (GSimpleAction * a, GVariant * p, gpo
|
|||
|
||||
static void vn_handler_on_save_activated (GSimpleAction * a, GVariant * p, gpointer obj)
|
||||
{
|
||||
if (db_iterator_get_mode (VN_HANDLER (obj)->iterator) != DB_ITERATOR_MODE_ON_DEMAND)
|
||||
db_iterator_perform_operations (VN_HANDLER (obj)->iterator);
|
||||
else if (vn_handler_dialog (obj, _("Are you sure you want to save the changes?")))
|
||||
db_iterator_perform_operations (VN_HANDLER (obj)->iterator);
|
||||
db_iterator_perform_operations (VN_HANDLER (obj)->iterator);
|
||||
}
|
||||
|
||||
static void vn_handler_on_undo_activated (GSimpleAction * a, GVariant * p, gpointer obj)
|
||||
|
|
373
vn/vn-login.c
373
vn/vn-login.c
|
@ -16,8 +16,10 @@
|
|||
*/
|
||||
|
||||
#include "vn-login.h"
|
||||
#include "vn-set.h"
|
||||
|
||||
#define LOGIN_UI _GUI_DIR"/login.glade"
|
||||
#define CONFIG_DB _VN_CONFIG_DIR"/config.db"
|
||||
|
||||
#define IS_DEFINED(string) (string && g_strcmp0 (string, ""))
|
||||
#define BUILDER_GET(self, name) ((gpointer) gtk_builder_get_object (self, name))
|
||||
|
@ -25,12 +27,6 @@
|
|||
typedef struct
|
||||
{
|
||||
VnLogin * self;
|
||||
gchar * user;
|
||||
gchar * pass;
|
||||
gchar * plugin;
|
||||
gchar * host;
|
||||
gchar * schema;
|
||||
gchar * ssl_ca;
|
||||
DbConn * conn;
|
||||
GThread * thread;
|
||||
gboolean connected;
|
||||
|
@ -65,12 +61,6 @@ void connect_data_free (ConnectData * connect_data)
|
|||
if (connect_data->error)
|
||||
g_error_free (connect_data->error);
|
||||
|
||||
g_free (connect_data->user);
|
||||
g_free (connect_data->pass);
|
||||
g_free (connect_data->plugin);
|
||||
g_free (connect_data->host);
|
||||
g_free (connect_data->schema);
|
||||
g_free (connect_data->ssl_ca);
|
||||
g_object_unref (connect_data->conn);
|
||||
g_object_unref (connect_data->self);
|
||||
g_thread_unref (connect_data->thread);
|
||||
|
@ -83,26 +73,38 @@ void connect_data_free (ConnectData * connect_data)
|
|||
static void vn_login_load (VnLogin * self)
|
||||
{
|
||||
GError * err = NULL;
|
||||
GtkBuilder * builder;
|
||||
gchar * cfg_dir;
|
||||
gchar * cfg_file;
|
||||
GFile * src_file;
|
||||
GFile * dst_file;
|
||||
|
||||
// Initializing SQLite connection
|
||||
|
||||
cfg_file = g_build_filename (g_get_user_config_dir (), "config.db", NULL);
|
||||
cfg_dir = g_build_filename (g_get_user_config_dir (), "hedera", NULL);
|
||||
cfg_file = g_build_filename (cfg_dir, "config.db", NULL);
|
||||
|
||||
src_file = g_file_new_for_path (CONFIG_DB);
|
||||
dst_file = g_file_new_for_path (cfg_file);
|
||||
|
||||
if (!g_file_query_exists (dst_file, NULL))
|
||||
{
|
||||
g_mkdir_with_parents (cfg_dir, 0700);
|
||||
|
||||
if (!g_file_copy (src_file, dst_file, 0, NULL, NULL, NULL, &err))
|
||||
goto exit;
|
||||
}
|
||||
|
||||
self->cfg_conn = db_conn_new ();
|
||||
|
||||
if (!db_conn_load_plugin (self->cfg_conn, "sqlite", &err)
|
||||
|| !db_conn_open (self->cfg_conn, NULL, cfg_file, NULL, NULL, &err))
|
||||
goto exit;
|
||||
|
||||
// Loading interface
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
|
||||
if (gtk_builder_add_from_file (builder, LOGIN_UI, &err))
|
||||
// Loading interface
|
||||
|
||||
if (gtk_builder_add_from_file (self->builder, LOGIN_UI, &err))
|
||||
{
|
||||
GSList * i;
|
||||
const GList * i;
|
||||
VnSet * models;
|
||||
|
||||
models = BUILDER_GET (self->builder, "models");
|
||||
|
@ -111,21 +113,22 @@ static void vn_login_load (VnLogin * self)
|
|||
for (i = vn_set_get_objects (models); i; i = i->next)
|
||||
db_model_set_conn (i->data, self->cfg_conn);
|
||||
|
||||
self->window = BUILDER_GET (builder, "window");
|
||||
self->user = BUILDER_GET (builder, "user");
|
||||
self->pass = BUILDER_GET (builder, "password");
|
||||
self->remember = BUILDER_GET (builder, "remember");
|
||||
self->connect = BUILDER_GET (builder, "connect");
|
||||
self->settings_button = BUILDER_GET (builder, "settings");
|
||||
self->spinner = BUILDER_GET (builder, "spinner");
|
||||
self->settings_dialog = BUILDER_GET (builder, "settings-dialog");
|
||||
gtk_builder_connect_signals (builder, self);
|
||||
|
||||
self->window = BUILDER_GET (self->builder, "window");
|
||||
self->user = BUILDER_GET (self->builder, "user");
|
||||
self->pass = BUILDER_GET (self->builder, "password");
|
||||
self->remember = BUILDER_GET (self->builder, "remember");
|
||||
self->connect = BUILDER_GET (self->builder, "connect");
|
||||
self->settings_button = BUILDER_GET (self->builder, "settings");
|
||||
self->settings_dialog = BUILDER_GET (self->builder, "settings-dialog");
|
||||
self->login_data = BUILDER_GET (self->builder, "iterator-login");
|
||||
self->last_conn = BUILDER_GET (self->builder, "iterator-last-conn");
|
||||
self->connections = BUILDER_GET (self->builder, "iterator-connections");
|
||||
self->settings_button = BUILDER_GET (self->builder, "settings-button");
|
||||
gtk_builder_connect_signals (self->builder, self);
|
||||
|
||||
gtk_application_add_window (self->app, self->window);
|
||||
}
|
||||
|
||||
g_object_unref (builder);
|
||||
|
||||
// Freeing resources
|
||||
|
||||
exit:
|
||||
|
@ -136,7 +139,10 @@ static void vn_login_load (VnLogin * self)
|
|||
g_clear_error (&err);
|
||||
}
|
||||
|
||||
g_free (cfg_dir);
|
||||
g_free (cfg_file);
|
||||
g_object_unref (src_file);
|
||||
g_object_unref (dst_file);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -144,21 +150,13 @@ static void vn_login_load (VnLogin * self)
|
|||
*/
|
||||
static void vn_login_show (VnLogin * self)
|
||||
{
|
||||
gboolean autologin = FALSE;
|
||||
|
||||
if (!self->window)
|
||||
{
|
||||
vn_login_load (self);
|
||||
autologin = TRUE;
|
||||
}
|
||||
|
||||
if (self->window)
|
||||
{
|
||||
gtk_widget_show_all (GTK_WIDGET (self->window));
|
||||
gtk_widget_grab_focus (GTK_WIDGET (self->user));
|
||||
|
||||
if (autologin)
|
||||
gtk_button_clicked (self->connect);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,16 +171,21 @@ static void vn_login_set_loading (VnLogin * self, gboolean loading)
|
|||
gtk_widget_set_sensitive (GTK_WIDGET (self->pass), !loading);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (self->remember), !loading);
|
||||
|
||||
gtk_button_set_label (self->connect, NULL);
|
||||
gtk_container_remove (GTK_CONTAINER (self->connect),
|
||||
gtk_bin_get_child (GTK_BIN (self->connect)));
|
||||
|
||||
if (loading)
|
||||
{
|
||||
gtk_widget_show (self->spinner);
|
||||
gtk_widget_hide (GTK_WIDGET (self->connect));
|
||||
GtkWidget * spinner = gtk_spinner_new ();
|
||||
gtk_spinner_start (GTK_SPINNER (spinner));
|
||||
gtk_container_add (GTK_CONTAINER (self->connect), spinner);
|
||||
gtk_widget_show_all (spinner);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_hide (self->spinner);
|
||||
gtk_widget_show (GTK_WIDGET (self->connect));
|
||||
}
|
||||
gtk_button_set_label (self->connect, "gtk-connect");
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (self->connect), !loading);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -201,44 +204,16 @@ static void vn_login_free_gui (VnLogin * self)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Shows the settings dialog.
|
||||
*/
|
||||
void vn_login_on_settings_clicked (GtkButton * button, VnLogin * self)
|
||||
{
|
||||
gtk_dialog_run (self->settings_dialog);
|
||||
}
|
||||
|
||||
/*
|
||||
* Hides the settings dialog.
|
||||
*/
|
||||
void vn_login_on_settings_cancel_clicked (GtkButton * button, VnLogin * self)
|
||||
{
|
||||
gtk_widget_hide (GTK_WIDGET (self->settings_dialog));
|
||||
}
|
||||
|
||||
/*
|
||||
* Hides the settings dialog when escape is pressed.
|
||||
*/
|
||||
void vn_login_settings_on_delete_event (GtkWidget * settings_dialog)
|
||||
{
|
||||
gtk_widget_hide (settings_dialog);
|
||||
}
|
||||
|
||||
/*
|
||||
* Applies the changes made on settings dialog.
|
||||
*/
|
||||
void vn_login_on_settings_apply_clicked (GtkButton * button, VnLogin * self)
|
||||
{
|
||||
gtk_widget_hide (GTK_WIDGET (self->settings_dialog));
|
||||
}
|
||||
|
||||
/*
|
||||
* Shows the login dialog when user logout from GUI.
|
||||
*/
|
||||
void vn_login_on_gui_logout (VnGui * gui, VnLogin * self)
|
||||
{
|
||||
g_settings_set_string (self->settings, "pass", "");
|
||||
GValue * null_pass = gvn_value_new_null ();
|
||||
db_iterator_set_value (self->login_data, "password", null_pass, NULL);
|
||||
db_iterator_perform_operations (self->login_data);
|
||||
gvn_value_free (null_pass);
|
||||
|
||||
vn_login_free_gui (self);
|
||||
vn_login_show (self);
|
||||
}
|
||||
|
@ -252,6 +227,92 @@ void vn_login_on_gui_exit (VnGui * gui, VnLogin * self)
|
|||
gtk_widget_destroy (GTK_WIDGET (self->window));
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if exists a configuration record, if not, creates it.
|
||||
*/
|
||||
void vn_login_on_last_conn_ready (DbIterator * iterator, gboolean ready, VnLogin * self)
|
||||
{
|
||||
if (ready && db_iterator_get_nrows (iterator) == 0)
|
||||
db_iterator_insert (iterator);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets the default user and password for selected configuration.
|
||||
*/
|
||||
void vn_login_on_server_changed (DbIterator * iterator, VnLogin * self)
|
||||
{
|
||||
gboolean first_login;
|
||||
gboolean remember = FALSE;
|
||||
|
||||
if (db_iterator_get_row (self->login_data) != -1)
|
||||
{
|
||||
const gchar * pass = gvn_value_get_string (db_iterator_get_value (self->login_data, "password"));
|
||||
|
||||
gvn_param_set_value (self->user, db_iterator_get_value (self->login_data, "user"));
|
||||
|
||||
if (pass)
|
||||
{
|
||||
gchar * decoded = gvn_decode (pass);
|
||||
gvn_param_set_string (self->pass, decoded);
|
||||
g_free (decoded);
|
||||
|
||||
remember = TRUE;
|
||||
}
|
||||
else
|
||||
gvn_param_set_null (self->pass);
|
||||
}
|
||||
else
|
||||
{
|
||||
gvn_param_set_null (self->user);
|
||||
gvn_param_set_null (self->pass);
|
||||
}
|
||||
|
||||
first_login = gvn_param_is_null (self->remember);
|
||||
gvn_param_set_boolean (self->remember, remember);
|
||||
|
||||
if (remember && first_login)
|
||||
gtk_button_clicked (self->connect);
|
||||
}
|
||||
|
||||
/*
|
||||
* Closes the application when login window is destroyed.
|
||||
*/
|
||||
void vn_login_on_destroyed (GtkWidget * window, VnLogin * self)
|
||||
{
|
||||
self->window = NULL;
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
void vn_login_on_pass_show (GtkEntry * entry, GtkEntryIconPosition * pos,
|
||||
GdkEvent * event, VnLogin * self)
|
||||
{
|
||||
gtk_entry_set_visibility (entry, TRUE);
|
||||
}
|
||||
|
||||
void vn_login_on_pass_hide (GtkEntry * entry, GtkEntryIconPosition * pos,
|
||||
GdkEvent * event, VnLogin * self)
|
||||
{
|
||||
gtk_entry_set_visibility (entry, FALSE);
|
||||
}
|
||||
|
||||
static void vn_login_on_startup (GApplication * app, VnLogin * self)
|
||||
{
|
||||
// g_object_set (gtk_settings_get_default (), "gtk-button-images", TRUE, NULL);
|
||||
}
|
||||
|
||||
static void vn_login_on_activate (GApplication * app, VnLogin * self)
|
||||
{
|
||||
if (gtk_main_level () == 0)
|
||||
{
|
||||
vn_login_show (self);
|
||||
gtk_main ();
|
||||
}
|
||||
else if (!self->gui)
|
||||
gtk_window_present (self->window);
|
||||
}
|
||||
|
||||
//------------------------------------ Login process
|
||||
|
||||
/*
|
||||
* Saves the login information and opens the main GUI.
|
||||
*/
|
||||
|
@ -259,19 +320,24 @@ static gboolean vn_login_done (ConnectData * connect_data)
|
|||
{
|
||||
VnLogin * self = connect_data->self;
|
||||
|
||||
g_signal_handlers_block_by_func (self->login_data,
|
||||
vn_login_on_server_changed, self);
|
||||
|
||||
if (connect_data->connected)
|
||||
{
|
||||
db_iterator_set_value (self->config, "user", gvn_param_get_value (self->user), NULL);
|
||||
db_iterator_set_value (self->config, "remember", gvn_param_get_value (self->remember), NULL);
|
||||
db_iterator_set_value (self->login_data, "user", gvn_param_get_value (self->user), NULL);
|
||||
|
||||
if (gvn_param_get_boolean (self->remember))
|
||||
{
|
||||
GValue encoded = G_VALUE_INIT;
|
||||
g_value_init (&encoded, G_TYPE_STRING);
|
||||
g_value_take_string (&encoded, gvn_encode (gvn_param_get_string (self->pass)));
|
||||
db_iterator_set_value (self->config, "password", &encoded, NULL);
|
||||
db_iterator_set_value (self->login_data, "password", &encoded, NULL);
|
||||
g_value_unset (&encoded);
|
||||
}
|
||||
|
||||
|
||||
db_iterator_perform_operations (self->last_conn);
|
||||
db_iterator_perform_operations (self->login_data);
|
||||
gvn_param_set_null (self->pass);
|
||||
|
||||
gtk_widget_hide (GTK_WIDGET (self->window));
|
||||
|
@ -301,7 +367,7 @@ static gboolean vn_login_done (ConnectData * connect_data)
|
|||
"%s", connect_data->error->message);
|
||||
|
||||
if (connect_data->error->code == DB_CONN_ERROR_BAD_LOGIN)
|
||||
gtk_entry_set_text (self->pass, "");
|
||||
gvn_param_set_null (self->pass);
|
||||
}
|
||||
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
|
@ -309,6 +375,9 @@ static gboolean vn_login_done (ConnectData * connect_data)
|
|||
vn_login_show (self);
|
||||
}
|
||||
|
||||
g_signal_handlers_unblock_by_func (self->login_data,
|
||||
vn_login_on_server_changed, self);
|
||||
|
||||
vn_login_set_loading (self, FALSE);
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
@ -320,18 +389,26 @@ static void vn_login_thread (ConnectData * connect_data)
|
|||
{
|
||||
VnLogin * self = connect_data->self;
|
||||
|
||||
if (IS_DEFINED (connect_data->plugin) && IS_DEFINED (connect_data->schema))
|
||||
// FIXME: Thread unsafe functions
|
||||
const gchar * user = gvn_param_get_string (self->user);
|
||||
const gchar * pass = gvn_param_get_string (self->pass);
|
||||
const gchar * plugin = gvn_value_get_string (db_iterator_get_value (self->login_data, "plugin"));
|
||||
const gchar * host = gvn_value_get_string (db_iterator_get_value (self->login_data, "host"));
|
||||
const gchar * schema = gvn_value_get_string (db_iterator_get_value (self->login_data, "schema"));
|
||||
const gchar * ssl_ca = gvn_value_get_string (db_iterator_get_value (self->login_data, "ssl_ca"));
|
||||
|
||||
if (IS_DEFINED (plugin) && IS_DEFINED (schema))
|
||||
{
|
||||
if (db_conn_load_plugin (connect_data->conn, connect_data->plugin, &connect_data->error))
|
||||
if (db_conn_load_plugin (connect_data->conn, plugin, &connect_data->error))
|
||||
{
|
||||
if (IS_DEFINED (connect_data->ssl_ca))
|
||||
db_conn_set_ssl (connect_data->conn, connect_data->ssl_ca);
|
||||
if (IS_DEFINED (ssl_ca))
|
||||
db_conn_set_ssl (connect_data->conn, ssl_ca);
|
||||
|
||||
connect_data->connected = db_conn_open (connect_data->conn
|
||||
,connect_data->host
|
||||
,connect_data->schema
|
||||
,connect_data->user
|
||||
,connect_data->pass
|
||||
,host
|
||||
,schema
|
||||
,user
|
||||
,pass
|
||||
,&connect_data->error
|
||||
);
|
||||
}
|
||||
|
@ -354,79 +431,67 @@ void vn_login_on_connect_clicked (GtkButton * button, VnLogin * self)
|
|||
{
|
||||
ConnectData * connect_data;
|
||||
|
||||
vn_login_set_loading (self, TRUE);
|
||||
|
||||
connect_data = g_new (ConnectData, 1);
|
||||
connect_data->self = g_object_ref (self);
|
||||
connect_data->user = g_strdup (gvn_param_get_string (self->user));
|
||||
connect_data->pass = g_strdup (gvn_param_get_string (self->pass));
|
||||
connect_data->plugin = g_strdup (db_iterator_get_string (self->config, "plugin"));
|
||||
connect_data->host = g_strdup (db_iterator_get_string (self->config, "host"));
|
||||
connect_data->schema = g_strdup (db_iterator_get_string (self->config, "schema"));
|
||||
connect_data->ssl_ca = g_strdup (db_iterator_get_string (self->config, "ssl_ca"));
|
||||
connect_data->conn = db_conn_new ();
|
||||
connect_data->connected = FALSE;
|
||||
connect_data->error = NULL;
|
||||
connect_data->thread = g_thread_new ("vn-login",
|
||||
(GThreadFunc) vn_login_thread, connect_data);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets the default user and password for selected configuration.
|
||||
*/
|
||||
static void vn_login_on_server_changed (VnLogin * self)
|
||||
{
|
||||
const GValue * pass = db_iterator_get_value (self->config, "password");
|
||||
|
||||
gvn_param_set_value (self->user, db_iterator_get_value (self->config, "user"));
|
||||
gvn_param_set_value (self->remember, db_iterator_get_value (self->config, "remember"));
|
||||
|
||||
if (!gvn_value_is_null (pass))
|
||||
if (db_iterator_get_row (self->login_data) != -1)
|
||||
{
|
||||
GValue decoded = G_VALUE_INIT;
|
||||
g_value_take_string (&decoded, gvn_decode (g_value_get_string (pass)));
|
||||
gvn_param_set_value (self->pass, &decoded);
|
||||
g_value_unset (&decoded);
|
||||
vn_login_set_loading (self, TRUE);
|
||||
|
||||
connect_data = g_new (ConnectData, 1);
|
||||
connect_data->self = g_object_ref (self);
|
||||
connect_data->conn = db_conn_new ();
|
||||
connect_data->connected = FALSE;
|
||||
connect_data->error = NULL;
|
||||
connect_data->thread = g_thread_new ("vn-login",
|
||||
(GThreadFunc) vn_login_thread, connect_data);
|
||||
}
|
||||
else
|
||||
gvn_param_set_value (self->pass, pass);
|
||||
{
|
||||
GtkWidget * dialog = gtk_message_dialog_new (self->window
|
||||
,GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT
|
||||
,GTK_MESSAGE_ERROR
|
||||
,GTK_BUTTONS_OK
|
||||
,_("Please select a connection")
|
||||
);
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), _("Login error"));
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------ Settings dialog
|
||||
|
||||
/*
|
||||
* Shows the settings dialog.
|
||||
*/
|
||||
void vn_login_on_settings_clicked (GtkButton * button, VnLogin * self)
|
||||
{
|
||||
db_iterator_refresh (self->connections);
|
||||
gtk_widget_show_all (GTK_WIDGET (self->settings_dialog));
|
||||
gtk_dialog_run (self->settings_dialog);
|
||||
}
|
||||
|
||||
/*
|
||||
* Closes the application when login window is destroyed.
|
||||
* Hides the settings dialog.
|
||||
*/
|
||||
void vn_login_on_destroyed (GtkWidget * window, VnLogin * self)
|
||||
void vn_login_hide_settings (VnLogin * self)
|
||||
{
|
||||
self->window = NULL;
|
||||
gtk_main_quit ();
|
||||
db_iterator_refresh (self->login_data);
|
||||
gtk_widget_hide (GTK_WIDGET (self->settings_dialog));
|
||||
}
|
||||
|
||||
void vn_login_on_pass_show (GtkEntry * entry, GtkEntryIconPosition * pos,
|
||||
GdkEvent * event, VnLogin * self)
|
||||
/*
|
||||
* Hides the settings dialog when close is clicked.
|
||||
*/
|
||||
void vn_login_on_settings_close_clicked (GtkButton * button, VnLogin * self)
|
||||
{
|
||||
gtk_entry_set_visibility (entry, TRUE);
|
||||
vn_login_hide_settings (self);
|
||||
}
|
||||
|
||||
void vn_login_on_pass_hide (GtkEntry * entry, GtkEntryIconPosition * pos,
|
||||
GdkEvent * event, VnLogin * self)
|
||||
/*
|
||||
* Hides the settings dialog when escape is pressed.
|
||||
*/
|
||||
void vn_login_settings_on_delete_event (GtkWidget * settings_dialog, GdkEvent * event, VnLogin * self)
|
||||
{
|
||||
gtk_entry_set_visibility (entry, FALSE);
|
||||
}
|
||||
|
||||
static void vn_login_on_startup (GApplication * app, VnLogin * self)
|
||||
{
|
||||
g_object_set (gtk_settings_get_default (), "gtk-button-images", TRUE, NULL);
|
||||
}
|
||||
|
||||
static void vn_login_on_activate (GApplication * app, VnLogin * self)
|
||||
{
|
||||
if (gtk_main_level () == 0)
|
||||
{
|
||||
vn_login_show (self);
|
||||
gtk_main ();
|
||||
}
|
||||
else if (!self->gui)
|
||||
gtk_window_present (self->window);
|
||||
vn_login_hide_settings (self);
|
||||
}
|
||||
|
||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++ Properties
|
||||
|
@ -450,8 +515,8 @@ static void vn_login_set_property (VnLogin * self, guint id,
|
|||
,NULL
|
||||
);
|
||||
|
||||
self->settings = g_settings_new (
|
||||
g_application_get_application_id (G_APPLICATION (self->app)));
|
||||
// self->settings = g_settings_new (
|
||||
// g_application_get_application_id (G_APPLICATION (self->app)));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -478,6 +543,7 @@ static void vn_login_init (VnLogin * self)
|
|||
self->settings = NULL;
|
||||
self->app = NULL;
|
||||
self->cfg_conn = NULL;
|
||||
self->builder = gtk_builder_new ();
|
||||
}
|
||||
|
||||
static void vn_login_finalize (VnLogin * self)
|
||||
|
@ -489,6 +555,7 @@ static void vn_login_finalize (VnLogin * self)
|
|||
,NULL
|
||||
);
|
||||
|
||||
g_clear_object (&self->builder);
|
||||
g_clear_object (&self->cfg_conn);
|
||||
g_clear_object (&self->settings);
|
||||
g_clear_object (&self->app);
|
||||
|
|
|
@ -39,17 +39,20 @@ struct _VnLogin
|
|||
{
|
||||
GObject parent;
|
||||
|
||||
GtkBuilder * builder;
|
||||
GtkApplication * app;
|
||||
VnGui * gui;
|
||||
GtkWindow * window;
|
||||
GtkEntry * user;
|
||||
GtkEntry * pass;
|
||||
GtkToggleButton * remember;
|
||||
GvnParam * user;
|
||||
GvnParam * pass;
|
||||
GvnParam * remember;
|
||||
GtkButton * connect;
|
||||
GtkWidget * stop;
|
||||
GtkButton * settings_button;
|
||||
GtkWidget * spinner;
|
||||
DbConn * cfg_conn;
|
||||
DbIterator * login_data;
|
||||
DbIterator * last_conn;
|
||||
DbIterator * connections;
|
||||
|
||||
GtkDialog * settings_dialog;
|
||||
GtkEntry * plugin;
|
||||
|
|
Reference in New Issue