summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Lipovsky <janlipovsky@gmail.com>2010-02-16 13:55:08 +0100
committerJan Lipovsky <janlipovsky@gmail.com>2010-02-16 13:55:08 +0100
commit507ef00d1e80737221190e409d9e534091efe006 (patch)
tree49410c6ebcf6ac7664b41b35d721825d85489c9a
downloadsfshare-507ef00d1e80737221190e409d9e534091efe006.tar.gz
sfshare-507ef00d1e80737221190e409d9e534091efe006.tar.xz
sfshare-507ef00d1e80737221190e409d9e534091efe006.zip
Init
-rw-r--r--sfshare-gui/data/sfs_window.ui260
-rw-r--r--sfshare-gui/src/sfshare.c41
2 files changed, 301 insertions, 0 deletions
diff --git a/sfshare-gui/data/sfs_window.ui b/sfshare-gui/data/sfs_window.ui
new file mode 100644
index 0000000..2320059
--- /dev/null
+++ b/sfshare-gui/data/sfs_window.ui
@@ -0,0 +1,260 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy project-wide -->
+ <object class="GtkWindow" id="sfs_window">
+ <property name="width_request">380</property>
+ <property name="height_request">255</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Simple File Share</property>
+ <property name="resizable">False</property>
+ <property name="icon_name">folder-remote</property>
+ <child>
+ <object class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkImage" id="image_icon">
+ <property name="visible">True</property>
+ <property name="pixel_size">60</property>
+ <property name="icon_name">folder-remote</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="heading">
+ <property name="width_request">253</property>
+ <property name="visible">True</property>
+ <property name="xalign">0.40000000596046448</property>
+ <property name="label" translatable="yes">Folder Sharing Setup</property>
+ <property name="single_line_mode">True</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="scale" value="1.500000"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHSeparator" id="hseparator1">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">2</property>
+ <property name="row_spacing">2</property>
+ <child>
+ <object class="GtkLabel" id="share">
+ <property name="width_request">95</property>
+ <property name="visible">True</property>
+ <property name="xalign">0.10000000149011612</property>
+ <property name="label" translatable="yes">Share:</property>
+ <property name="single_line_mode">True</property>
+ </object>
+ <packing>
+ <property name="x_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="share_name">
+ <property name="width_request">95</property>
+ <property name="visible">True</property>
+ <property name="xalign">0.10000000149011612</property>
+ <property name="label" translatable="yes">Share name:</property>
+ <property name="single_line_mode">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="comment">
+ <property name="width_request">95</property>
+ <property name="visible">True</property>
+ <property name="xalign">0.10000000149011612</property>
+ <property name="label" translatable="yes">Comment:</property>
+ <property name="single_line_mode">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry_share_name">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="combobox_share">
+ <property name="visible">True</property>
+ <property name="model">combo_texts</property>
+ <property name="active">0</property>
+ <child>
+ <object class="GtkCellRendererText" id="combo_cell_texts"/>
+ <attributes>
+ <attribute name="markup">0</attribute>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry_comment">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_readonly">
+ <property name="label" translatable="yes">Read only access</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton1">
+ <property name="label" translatable="yes">Allow GUEST access</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHSeparator" id="hseparator2">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHButtonBox" id="hbuttonbox1">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button_save">
+ <property name="label">gtk-save</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_close">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkListStore" id="combo_texts">
+ <columns>
+ <!-- column-name share_type -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">Do not share this folder</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Share via Samba</col>
+ </row>
+ </data>
+ </object>
+</interface>
diff --git a/sfshare-gui/src/sfshare.c b/sfshare-gui/src/sfshare.c
new file mode 100644
index 0000000..6969ec7
--- /dev/null
+++ b/sfshare-gui/src/sfshare.c
@@ -0,0 +1,41 @@
+#include <gtk/gtk.h>
+
+typedef struct _sfsdialog
+{
+ GtkWidget *close;
+ GtkWidget *about;
+} SFSDialog;
+
+
+int main( int argc, char **argv )
+{
+ GtkBuilder *builder;
+ GtkWidget *window;
+ SFSDialog sfsdialog;
+
+ gtk_init( &argc, &argv );
+
+ /* Create builder and load interface */
+ builder = gtk_builder_new();
+ gtk_builder_add_from_file( builder, "../data/sfs_window.ui", NULL );
+
+ /* Obtain widgets that we need */
+ window = GTK_WIDGET( gtk_builder_get_object( builder, "sfs_window" ) );
+
+ g_signal_connect (window, "destroy", gtk_main_quit, NULL);
+
+ sfsdialog.close = GTK_WIDGET( gtk_builder_get_object( builder, "button_close" ));
+ g_signal_connect (sfsdialog.close, "clicked", gtk_main_quit, GTK_OBJECT (window)); //data.about = GTK_WIDGET( gtk_builder_get_object( builder, "aboutdialog1" ) );
+
+ /* Connect callbacks */
+ // gtk_builder_connect_signals( builder, &sfsdialog );
+
+ /* Destroy builder */
+ g_object_unref( G_OBJECT( builder ) );
+
+ /* Show main window and start main loop */
+ gtk_widget_show( window );
+ gtk_main();
+
+ return(0);
+}