Shortcuts are now properly loaded again

Mon, 15 Jul 2013 22:25:00 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Mon, 15 Jul 2013 22:25:00 +0300
changeset 385
b136331072a0
parent 384
f4622b79133d
child 386
751d31336f08

Shortcuts are now properly loaded again

src/file.cpp file | annotate | diff | comparison | revisions
src/gui.cpp file | annotate | diff | comparison | revisions
--- a/src/file.cpp	Mon Jul 15 22:07:49 2013 +0300
+++ b/src/file.cpp	Mon Jul 15 22:25:00 2013 +0300
@@ -939,12 +939,12 @@
 	
 private:
 	LDOpenFile* m_curfile;
-} g_currentFile;
+} g_currentFileShell;
 
 LDOpenFile* currentFile() {
-	return g_currentFile.currentFile();
+	return g_currentFileShell.currentFile();
 }
 
 void setCurrentFile (LDOpenFile* f) {
-	g_currentFile.setCurrentFile (f);
+	g_currentFileShell.setCurrentFile (f);
 }
\ No newline at end of file
--- a/src/gui.cpp	Mon Jul 15 22:07:49 2013 +0300
+++ b/src/gui.cpp	Mon Jul 15 22:25:00 2013 +0300
@@ -61,6 +61,9 @@
 extern_cfg (bool, gl_wireframe);
 extern_cfg (bool, gl_colorbfc);
 
+#define act(N) extern_cfg (keyseq, key_##N);
+#include "actions.h"
+
 const char* g_modeActionNames[] = {
 	"modeSelect",
 	"modeDraw",
@@ -114,9 +117,10 @@
 	
 	connect (qApp, SIGNAL (aboutToQuit()), this, SLOT (slot_lastSecondCleanup()));
 	
-	// Connect all actions
+	// Connect all actions and set shortcuts
 #define act(N) \
-	connect (ui->action##N, SIGNAL (triggered()), this, SLOT (slot_action()));
+	connect (ui->action##N, SIGNAL (triggered()), this, SLOT (slot_action())); \
+	ui->action##N->setShortcut (key_##N);
 #include "actions.h"
 }
 

mercurial