[Xfce4-commits] r23397 - xarchiver/branches/xarchiver-psybsd/src
Stephan Arts
stephan at xfce.org
Fri Oct 13 11:47:21 UTC 2006
Author: stephan
Date: 2006-10-13 11:47:20 +0000 (Fri, 13 Oct 2006)
New Revision: 23397
Added:
xarchiver/branches/xarchiver-psybsd/src/settings.c
xarchiver/branches/xarchiver-psybsd/src/settings.h
Modified:
xarchiver/branches/xarchiver-psybsd/src/Makefile.am
xarchiver/branches/xarchiver-psybsd/src/main_window.c
Log:
Added settings object. (for storing / restoring settings)
Modified: xarchiver/branches/xarchiver-psybsd/src/Makefile.am
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/Makefile.am 2006-10-13 10:35:08 UTC (rev 23396)
+++ xarchiver/branches/xarchiver-psybsd/src/Makefile.am 2006-10-13 11:47:20 UTC (rev 23397)
@@ -5,6 +5,7 @@
main_window.c main_window.h \
navigation_bar.c navigation_bar.h \
tool_bar.c tool_bar.h \
+ settings.c settings.h \
archive_store.c archive_store.h \
archive_tree_store.c archive_tree_store.h \
preferences_dialog.c preferences_dialog.h \
Modified: xarchiver/branches/xarchiver-psybsd/src/main_window.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main_window.c 2006-10-13 10:35:08 UTC (rev 23396)
+++ xarchiver/branches/xarchiver-psybsd/src/main_window.c 2006-10-13 11:47:20 UTC (rev 23397)
@@ -25,13 +25,8 @@
#include <glib.h>
#include <gtk/gtk.h>
#include <libxarchiver/libxarchiver.h>
-
-#ifdef HAVE_THUNAR_VFS
-#define EXO_API_SUBJECT_TO_CHANGE
-#include <thunar-vfs/thunar-vfs.h>
-#else
+#include <libxarchiver/mime.h>
#include <gettext.h>
-#endif
#include "archive_store.h"
#include "archive_tree_store.h"
@@ -709,7 +704,7 @@
GValue *value = g_new0(GValue, 1);
value = g_value_init(value, G_TYPE_UINT);
- g_value_set_uint(value, GTK_ICON_SIZE_MENU);
+ g_value_set_uint(value, GTK_ICON_SIZE_SMALL_TOOLBAR);
GList *columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(window->treeview));
gboolean show_only_filenames = FALSE;
@@ -748,7 +743,7 @@
break;
}
gtk_tree_view_column_set_resizable(column, TRUE);
- gtk_tree_view_column_set_sort_column_id(column, x+1);
+ gtk_tree_view_column_set_sort_column_id(column, x+2);
gtk_tree_view_append_column(GTK_TREE_VIEW(window->treeview), column);
}
}
Added: xarchiver/branches/xarchiver-psybsd/src/settings.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/settings.c (rev 0)
+++ xarchiver/branches/xarchiver-psybsd/src/settings.c 2006-10-13 11:47:20 UTC (rev 23397)
@@ -0,0 +1,82 @@
+/* Copyright (c) 2006 Stephan Arts <psybsd at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <config.h>
+#include <glib.h>
+#include <glib-object.h>
+
+#include "settings.h"
+
+static void
+xa_settings_init(XASettings *);
+static void
+xa_settings_class_init(XASettingsClass *);
+
+GType
+xa_settings_get_type ()
+{
+ static GType xa_settings_type = 0;
+
+ if (!xa_settings_type)
+ {
+ static const GTypeInfo xa_settings_info =
+ {
+ sizeof (XASettingsClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) xa_settings_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL,
+ sizeof (XASettings),
+ 0,
+ (GInstanceInitFunc) xa_settings_init,
+ NULL
+ };
+
+ xa_settings_type = g_type_register_static (G_TYPE_OBJECT, "XASettings", &xa_settings_info, 0);
+ }
+ return xa_settings_type;
+}
+
+static void
+xa_settings_init(XASettings *object)
+{
+
+}
+
+static void
+xa_settings_class_init(XASettingsClass *object_class)
+{
+
+}
+
+XASettings *
+xa_settings_new(gchar *config_dir)
+{
+ XASettings *object = g_object_new(XA_TYPE_SETTINGS, NULL);
+ if(!config_dir)
+ config_dir = "~/.config/";
+ object->config_file = g_strconcat(config_dir, "/xarchiver/config.xml", NULL);
+
+ return object;
+}
+
+gboolean
+xa_settings_load(XASettings *settings)
+{
+
+}
Added: xarchiver/branches/xarchiver-psybsd/src/settings.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/settings.h (rev 0)
+++ xarchiver/branches/xarchiver-psybsd/src/settings.h 2006-10-13 11:47:20 UTC (rev 23397)
@@ -0,0 +1,64 @@
+/* Copyright (c) 2006 Stephan Arts <psybsd at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __XA_SETTINGS_H__
+#define __XA_SETTINGS_H__
+G_BEGIN_DECLS
+
+#define XA_TYPE_SETTINGS xa_settings_get_type()
+
+#define XA_SETTINGS(obj) ( \
+ G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ xa_settings_get_type(), \
+ XASettings))
+
+#define XA_IS_SETTINGS(obj) ( \
+ G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ xa_settings_get_type()))
+
+#define XA_SETTINGS_CLASS(class) ( \
+ G_TYPE_CHECK_CLASS_CAST ((class), \
+ xa_settings_get_type(), \
+ XASettingsClass))
+
+#define XA_IS_SETTINGS_CLASS(class) ( \
+ G_TYPE_CHECK_CLASS_TYPE ((class), \
+ xa_settings_get_type()))
+
+typedef struct _XASettings XASettings;
+
+struct _XASettings
+{
+ GObject parent;
+ gchar *config_file;
+};
+
+typedef struct _XASettingsClass XASettingsClass;
+
+struct _XASettingsClass
+{
+ GObjectClass parent;
+};
+
+XASettings *xa_settings_new(gchar *config_dir);
+GType xa_settings_get_type ();
+
+gboolean xa_settings_load(XASettings *);
+
+G_END_DECLS
+
+#endif /* __XA_SETTINGS_H__ */
More information about the Xfce4-commits
mailing list