aboutsummaryrefslogtreecommitdiff
path: root/src/Rootmenu.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Rootmenu.cc')
-rw-r--r--src/Rootmenu.cc44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/Rootmenu.cc b/src/Rootmenu.cc
index c86879f..5339630 100644
--- a/src/Rootmenu.cc
+++ b/src/Rootmenu.cc
@@ -19,8 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// stupid macros needed to access some functions in version 2 of the GNU C 22//Use GNU extensions
23// library
24#ifndef _GNU_SOURCE 23#ifndef _GNU_SOURCE
25#define _GNU_SOURCE 24#define _GNU_SOURCE
26#endif // _GNU_SOURCE 25#endif // _GNU_SOURCE
@@ -56,7 +55,7 @@ Rootmenu::Rootmenu(BScreen *scrn) : Basemenu(scrn) {
56} 55}
57 56
58 57
59void Rootmenu::itemSelected(int button, int index) { 58void Rootmenu::itemSelected(int button, unsigned int index) {
60 59
61 Fluxbox *fluxbox = Fluxbox::instance(); 60 Fluxbox *fluxbox = Fluxbox::instance();
62 61
@@ -65,8 +64,8 @@ void Rootmenu::itemSelected(int button, int index) {
65 64
66 if (item->function()) { 65 if (item->function()) {
67 switch (item->function()) { 66 switch (item->function()) {
68 case BScreen::Execute: 67 case BScreen::EXECUTE:
69 if (item->exec()) { 68 if (item->exec().size()) {
70 #ifndef __EMX__ 69 #ifndef __EMX__
71 char displaystring[MAXPATHLEN]; 70 char displaystring[MAXPATHLEN];
72 sprintf(displaystring, "DISPLAY=%s", 71 sprintf(displaystring, "DISPLAY=%s",
@@ -74,40 +73,41 @@ void Rootmenu::itemSelected(int button, int index) {
74 sprintf(displaystring + strlen(displaystring) - 1, "%d", 73 sprintf(displaystring + strlen(displaystring) - 1, "%d",
75 screen->getScreenNumber()); 74 screen->getScreenNumber());
76 75
77 bexec(item->exec(), displaystring); 76 bexec(item->exec().c_str(), displaystring);
78 #else // __EMX__ 77 #else // __EMX__
79 spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", item->exec(), NULL); 78 spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", item->exec().c_str(), NULL);
80 #endif // !__EMX__ 79 #endif // !__EMX__
81 } 80 }
82 break; 81 break;
83 82
84 case BScreen::Restart: 83 case BScreen::RESTART:
85 fluxbox->restart(); 84 fluxbox->restart();
86 break; 85 break;
87 86
88 case BScreen::RestartOther: 87 case BScreen::RESTARTOTHER:
89 if (item->exec()) 88 if (item->exec().size())
90 fluxbox->restart(item->exec()); 89 fluxbox->restart(item->exec().c_str());
91 break; 90 break;
92 91
93 case BScreen::Exit: 92 case BScreen::EXIT:
94 fluxbox->shutdown(); 93 fluxbox->shutdown();
95 break; 94 break;
96 95
97 case BScreen::SetStyle: 96 case BScreen::SETSTYLE:
98 if (item->exec()) { 97 if (item->exec().size()) {
99 fluxbox->saveStyleFilename(item->exec()); 98 fluxbox->saveStyleFilename(item->exec().c_str());
100 fluxbox->reconfigureTabs(); //TODO 99 fluxbox->reconfigureTabs();
101 } 100 }
102 101 fluxbox->reconfigure();
103 case BScreen::Reconfigure: 102 fluxbox->save_rc();
103 break;
104 case BScreen::RECONFIGURE:
104 fluxbox->reconfigure(); 105 fluxbox->reconfigure();
105 return; 106 return;
106 } 107 }
107
108 if (! (screen->getRootmenu()->isTorn() || isTorn()) && 108 if (! (screen->getRootmenu()->isTorn() || isTorn()) &&
109 item->function() != BScreen::Reconfigure && 109 item->function() != BScreen::RECONFIGURE &&
110 item->function() != BScreen::SetStyle) 110 item->function() != BScreen::SETSTYLE)
111 hide(); 111 hide();
112 } 112 }
113 } 113 }