summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Lipovský <janlipovsky@gmail.com>2010-12-30 15:04:19 +0100
committerJan Lipovský <janlipovsky@gmail.com>2010-12-30 15:04:19 +0100
commit5bc120cf2567329f35b9ef9da971cd50f3956d07 (patch)
treef4768040a470786227dccc9acf9327c26de49b72
parent6d35bdab4251873a3020730d6a4438a64d4627ba (diff)
downloadgncpmount-5bc120cf2567329f35b9ef9da971cd50f3956d07.tar.gz
gncpmount-5bc120cf2567329f35b9ef9da971cd50f3956d07.tar.xz
gncpmount-5bc120cf2567329f35b9ef9da971cd50f3956d07.zip
Code cleanup; Makefile
-rw-r--r--Makefile29
-rw-r--r--dialogs.c12
-rw-r--r--globals.c3
-rw-r--r--globals.h3
-rw-r--r--gncpmount.c12
-rw-r--r--ncpwrapper.c2
-rw-r--r--ncpwrapper.h1
7 files changed, 54 insertions, 8 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e8adffb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,29 @@
+PROG=gncpmount
+CXX=gcc
+CXXFLAGS=-Wall -pedantic -ansi
+GTK=`pkg-config --cflags --libs gtk+-2.0`
+
+
+OBJS=globals.o dialogs.o ncpwrapper.o
+
+.PHONY: clean
+
+all: $(PROG)
+
+# Obecne pravidlo
+%.o: %.c
+ $(CXX) $(CXXFLAGS) $(GTK) -c $<
+
+#Zavislosti (g++ -MM *.cpp)
+globals.o: globals.c globals.h
+dialogs.o: dialogs.c dialogs.h globals.h
+ncpwrapper.o: ncpwrapper.c ncpwrapper.h globals.h dialogs.h
+
+
+#Slinkovani
+$(PROG): $(PROG).c $(OBJS)
+ $(CXX) $(OBJS) $(CXXFLAGS) $(GTK) $(PROG).c -o $(PROG)
+
+clean:
+ $(RM) *.o $(PROG)
+
diff --git a/dialogs.c b/dialogs.c
index 34beacc..83f1753 100644
--- a/dialogs.c
+++ b/dialogs.c
@@ -1,6 +1,8 @@
#include <gtk/gtk.h>
#include "dialogs.h"
+
+
/** Signature level type */
typedef enum lvl
{
@@ -11,6 +13,8 @@ typedef enum lvl
REQUIRED
} TLevel;
+
+
/** Signature leve combo box text */
gchar *sig_level_texts[] =
{
@@ -21,6 +25,8 @@ gchar *sig_level_texts[] =
"Level 3 - required"
};
+
+
/**
* Save options to cmd_params
*/
@@ -74,6 +80,7 @@ void save_options_to_cmdparams()
}
+
/**
* Prefill set options to dialog
*/
@@ -133,7 +140,6 @@ set_options_from_cmdparams ()
-
/**
* Function opens option dialog box
*/
@@ -308,7 +314,6 @@ void show_options_dialog ()
gtk_table_attach (GTK_TABLE(table), hsep, 0, 2, row, row+1, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 6, 6);
row++;
-
/* Prefill set options */
set_options_from_cmdparams();
@@ -396,9 +401,6 @@ void show_ncpmount_command ()
hsep = gtk_hseparator_new();
gtk_box_pack_start (GTK_BOX (vbox), hsep, FALSE, TRUE, 0);
-
-
-
gtk_widget_show_all(dialog);
gtk_dialog_run ( GTK_DIALOG (dialog));
diff --git a/globals.c b/globals.c
index 21a89bc..28c7b06 100644
--- a/globals.c
+++ b/globals.c
@@ -2,6 +2,8 @@
#include "globals.h"
+
+
/**
* Set text value in given parameter
*/
@@ -24,6 +26,7 @@ void set_parameter_text (GtkWidget *entry, gchar **param)
}
+
/**
* Set boolean value in given parameter
*/
diff --git a/globals.h b/globals.h
index c2f79e0..7ca556e 100644
--- a/globals.h
+++ b/globals.h
@@ -40,6 +40,7 @@ typedef struct gui_struct
TWindow gui;
+
/**
* Define type TWindow - structure of important widgets in gui
*/
@@ -105,7 +106,7 @@ typedef struct params
} TParameters;
-
+/** Optionns and mount-point */
TParameters cmd_params;
diff --git a/gncpmount.c b/gncpmount.c
index e508918..001ec6e 100644
--- a/gncpmount.c
+++ b/gncpmount.c
@@ -9,6 +9,7 @@
#define HEIGHT -1
+
/**
* Load savet options to GUI
*/
@@ -35,6 +36,7 @@ set_gui_from_cmdparams ()
}
+
/**
* Save options set in GUI by user to cmd_params
*/
@@ -52,6 +54,7 @@ save_gui_to_cmdparams()
}
+
/**
* Check length of all entry and if they are filled enables mount button
*/
@@ -79,6 +82,7 @@ void enable_mount_button ()
}
+
/**
* Create Open folder dialog and let user select folder
* for mount point
@@ -105,6 +109,7 @@ open_folder (GtkWidget *wid, GtkWidget *win)
}
+
/**
* Call ncpmount command
*/
@@ -116,6 +121,7 @@ call_ncpmount (GtkWidget *wid, GtkWidget *win)
}
+
/**
* Set if -P (password) is used or not
*/
@@ -141,6 +147,7 @@ passwd_usage (GtkWidget *wid, GtkWidget *win)
}
+
/**
* Open Options dialog
*/
@@ -151,6 +158,7 @@ run_options_dialog ( GtkWidget *w, gpointer data )
}
+
/**
* Open Show command dialog
*/
@@ -162,6 +170,7 @@ run_command_dialog ( GtkWidget *w, gpointer data )
}
+
/** Menu, an array of GtkItemFactoryEntry structures that defines each menu item */
static GtkItemFactoryEntry menu_items[] =
{
@@ -179,10 +188,12 @@ static GtkItemFactoryEntry menu_items[] =
};
+
/** Menu items count */
static gint nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
+
/**
* Returns a menubar widget made from the above menu
*/
@@ -205,6 +216,7 @@ get_menubar_menu( GtkWidget *window )
}
+
int main (int argc, char *argv[])
{
GtkWidget *label = NULL;
diff --git a/ncpwrapper.c b/ncpwrapper.c
index 0a7cf25..ac24f91 100644
--- a/ncpwrapper.c
+++ b/ncpwrapper.c
@@ -1,8 +1,6 @@
#include <gtk/gtk.h>
-#include "globals.h"
#include "ncpwrapper.h"
-#include "dialogs.h"
gboolean mounted = TRUE;
diff --git a/ncpwrapper.h b/ncpwrapper.h
index 822d8fe..165c5ab 100644
--- a/ncpwrapper.h
+++ b/ncpwrapper.h
@@ -2,6 +2,7 @@
#define GNCPMOUNT_NCPWRAPPER_H
#include "globals.h"
+#include "dialogs.h"
void run_ncpmount();