gnome-commander r1615 - in trunk: . doc doc/C src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r1615 - in trunk: . doc doc/C src
- Date: Tue, 4 Mar 2008 18:04:31 +0000 (GMT)
Author: epiotr
Date: Tue Mar 4 18:04:31 2008
New Revision: 1615
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1615&view=rev
Log:
Added "Start GNOME Commander as root" action to menu and user actions
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/TODO
trunk/doc/C/gnome-commander.xml
trunk/doc/ChangeLog
trunk/src/gnome-cmd-main-menu.cc
trunk/src/gnome-cmd-main-win.cc
trunk/src/gnome-cmd-user-actions.cc
trunk/src/gnome-cmd-user-actions.h
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Tue Mar 4 18:04:31 2008
@@ -6,6 +6,7 @@
* Fixed problem #... (...)
New features:
+ * Root Mode for starting GNOME Commander with administrator privileges
* Multi-Rename-Tool - new $x and $X placeholders for random hexadecimal numbers
* Updated help docs
* New or updated translations: eu
Modified: trunk/TODO
==============================================================================
--- trunk/TODO (original)
+++ trunk/TODO Tue Mar 4 18:04:31 2008
@@ -39,7 +39,6 @@
- batch file processing
- converting txt <-> pdf
- other mc-like extensions ?
-* Root (administrator) mode - for root privileges
* vfolders for selecting files from arbitrary URI
(visible file selection can be merged internally to the vfolder at any point,
and then the usual multiple file actions can be applied)
Modified: trunk/doc/C/gnome-commander.xml
==============================================================================
--- trunk/doc/C/gnome-commander.xml (original)
+++ trunk/doc/C/gnome-commander.xml Tue Mar 4 18:04:31 2008
@@ -4364,6 +4364,15 @@
<entry><para></para></entry>
</row>
<row valign="top">
+ <entry><para>command.root_mode</para></entry>
+ <entry><para>Start &app; in root mode at the same location</para></entry>
+ <warning>
+ <para>Be careful while running &app; with root privileges
+ as you may damage your system.</para>
+ </warning>
+ <entry><para></para></entry>
+ </row>
+ <row valign="top">
<entry><para>connections.close</para></entry>
<entry><para>Disconnect from remote server</para></entry>
<entry><para><keycombo><keycap>CTRL</keycap><keycap>SHIFT</keycap><keycap>F</keycap></keycombo></para></entry>
@@ -5815,6 +5824,9 @@
<para>
<itemizedlist>
<listitem>
+ <para>Root Mode for starting GNOME Commander with administrator privileges</para>
+ </listitem>
+ <listitem>
<para>Multi-Rename-Tool - new $x and $X placeholders for random hexadecimal numbers</para>
</listitem>
<listitem>
Modified: trunk/src/gnome-cmd-main-menu.cc
==============================================================================
--- trunk/src/gnome-cmd-main-menu.cc (original)
+++ trunk/src/gnome-cmd-main-menu.cc Tue Mar 4 18:04:31 2008
@@ -479,6 +479,13 @@
},
MENUTYPE_SEPARATOR,
{
+ MENU_TYPE_ITEM, _("Start _GNOME Commander as Root"), "", NULL,
+ (gpointer) command_root_mode, NULL,
+ GNOME_APP_PIXMAP_STOCK, GTK_STOCK_DIALOG_AUTHENTICATION,
+ NULL
+ },
+ MENUTYPE_SEPARATOR,
+ {
MENU_TYPE_ITEM, _("_Quit"), "Ctrl+Q", NULL,
(gpointer) file_exit, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_QUIT,
Modified: trunk/src/gnome-cmd-main-win.cc
==============================================================================
--- trunk/src/gnome-cmd-main-win.cc (original)
+++ trunk/src/gnome-cmd-main-win.cc Tue Mar 4 18:04:31 2008
@@ -761,7 +761,8 @@
mw->priv->file_selector[LEFT] = NULL;
mw->priv->file_selector[RIGHT] = NULL;
- gnome_app_construct (GNOME_APP (main_win), "gnome-commander", _("GNOME Commander"));
+ gnome_app_construct (GNOME_APP (main_win), "gnome-commander", geteuid() ? _("GNOME Commander") :
+ _("GNOME Commander - ROOT PRIVILEGES"));
gtk_object_set_data (GTK_OBJECT (main_win), "main_win", main_win);
restore_size_and_pos (mw);
gtk_window_set_policy (GTK_WINDOW (main_win), TRUE, TRUE, FALSE);
Modified: trunk/src/gnome-cmd-user-actions.cc
==============================================================================
--- trunk/src/gnome-cmd-user-actions.cc (original)
+++ trunk/src/gnome-cmd-user-actions.cc Tue Mar 4 18:04:31 2008
@@ -208,6 +208,7 @@
actions.add(bookmarks_edit, "bookmarks.edit");
actions.add(bookmarks_goto, "bookmarks.goto");
actions.add(command_open_terminal, "command.open_terminal");
+ actions.add(command_root_mode, "command.root_mode");
actions.add(connections_close_current, "connections.close");
actions.add(connections_new, "connections.new");
actions.add(connections_open, "connections.open");
@@ -938,6 +939,37 @@
}
+void command_root_mode (GtkMenuItem *menuitem, gpointer not_used)
+{
+ char *su;
+
+ su = g_find_program_in_path ("gksudo");
+ if (!su)
+ su = g_find_program_in_path ("gksu");
+ if (!su)
+ su = g_find_program_in_path ("kdesu");
+
+ if (!su)
+ {
+ gnome_cmd_show_message (NULL, _("gksu or kdesu is not found."));
+ return ;
+ }
+
+ char *argv[3];
+
+ argv[0] = su;
+ argv[1] = g_get_prgname ();
+ argv[2] = NULL;
+
+ GError *error = NULL;
+
+ if (!g_spawn_async (NULL, argv, NULL, GSpawnFlags (G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL), NULL, NULL, NULL, &error))
+ gnome_cmd_error_message (_("Unable to start GNOME Commander in root mode."), error);
+
+ g_free (su);
+}
+
+
/************** Mark Menu **************/
void mark_toggle (GtkMenuItem *menuitem, gpointer not_used)
{
Modified: trunk/src/gnome-cmd-user-actions.h
==============================================================================
--- trunk/src/gnome-cmd-user-actions.h (original)
+++ trunk/src/gnome-cmd-user-actions.h Tue Mar 4 18:04:31 2008
@@ -134,6 +134,7 @@
/************** Command Menu **************/
GNOME_CMD_USER_ACTION(command_open_terminal);
+GNOME_CMD_USER_ACTION(command_root_mode);
/************** View Menu **************/
GNOME_CMD_USER_ACTION(view_conbuttons);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]