Bezig met plugin menu systeem
This commit is contained in:
parent
601d071d0f
commit
048843a1d4
10 changed files with 93 additions and 16 deletions
|
|
@ -30,25 +30,25 @@ void QueryToolModule::init()
|
|||
{
|
||||
auto ca = makeContextAction<QueryTool>(tr("Save SQL"), &QueryTool::save);
|
||||
ca->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S));
|
||||
// ca->setMenuLocation(MenuPath("File/Save"));
|
||||
// ca->setToolbarLocation(ToolbarLocation("main", "save"));
|
||||
ca->setMenuLocation(MenuPath("File/Save"));
|
||||
ca->setToolbarLocation(ToolbarLocation("main", "save"));
|
||||
// how we tell the system we want this to become a menu button with this as it's default action
|
||||
registerContextAction(ca);
|
||||
}
|
||||
// {
|
||||
// auto ca = makeContextAction<QueryTool>(tr("Save SQL as"), &QueryTool::saveAs);
|
||||
// ca->setMenuLocation(MenuPath("File/Save"));
|
||||
// ca->setToolbarLocation(ToolbarLocation("main", "save"));
|
||||
// // how we tell the system we want this to become a secondary action for the previous button?
|
||||
// registerContextAction(ca);
|
||||
// }
|
||||
// {
|
||||
// auto ca = makeContextAction<QueryTool>(tr("Save copy of SQL as"), &QueryTool::saveCopyAs);
|
||||
// ca->setMenuLocation(MenuPath("File/Save"));
|
||||
// ca->setToolbarLocation(ToolbarLocation("main", "save"));
|
||||
// // how we tell the system we want this to become a secondary action for the previous button?
|
||||
// registerContextAction(ca);
|
||||
// }
|
||||
{
|
||||
auto ca = makeContextAction<QueryTool>(tr("Save SQL as"), &QueryTool::saveAs);
|
||||
ca->setMenuLocation(MenuPath("File/Save"));
|
||||
ca->setToolbarLocation(ToolbarLocation("main", "save"));
|
||||
// how we tell the system we want this to become a secondary action for the previous button?
|
||||
registerContextAction(ca);
|
||||
}
|
||||
{
|
||||
auto ca = makeContextAction<QueryTool>(tr("Save copy of SQL as"), &QueryTool::saveCopyAs);
|
||||
ca->setMenuLocation(MenuPath("File/Save"));
|
||||
ca->setToolbarLocation(ToolbarLocation("main", "save"));
|
||||
// how we tell the system we want this to become a secondary action for the previous button?
|
||||
registerContextAction(ca);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ SOURCES += main.cpp\
|
|||
ConnectionManagerWindow.cpp \
|
||||
ConnectionListModel.cpp \
|
||||
BackupRestore.cpp \
|
||||
plugin_support/LMenu.cpp \
|
||||
plugin_support/LMenuBar.cpp \
|
||||
plugin_support/LMenuItem.cpp \
|
||||
plugin_support/LMenuSection.cpp \
|
||||
stopwatch.cpp \
|
||||
TuplesResultWidget.cpp \
|
||||
BackupDialog.cpp \
|
||||
|
|
@ -104,6 +108,10 @@ HEADERS += \
|
|||
CreateDatabaseDialog.h \
|
||||
ConnectionManagerWindow.h \
|
||||
ConnectionListModel.h \
|
||||
plugin_support/LMenu.h \
|
||||
plugin_support/LMenuBar.h \
|
||||
plugin_support/LMenuItem.h \
|
||||
plugin_support/LMenuSection.h \
|
||||
stopwatch.h \
|
||||
TuplesResultWidget.h \
|
||||
BackupDialog.h \
|
||||
|
|
|
|||
6
pglab/plugin_support/LMenu.cpp
Normal file
6
pglab/plugin_support/LMenu.cpp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#include "LMenu.h"
|
||||
|
||||
LMenu::LMenu()
|
||||
{
|
||||
|
||||
}
|
||||
13
pglab/plugin_support/LMenu.h
Normal file
13
pglab/plugin_support/LMenu.h
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef LMENU_H
|
||||
#define LMENU_H
|
||||
|
||||
/** Represents a menu wraps QMenu to give it more dynamic functionality
|
||||
*
|
||||
*/
|
||||
class LMenu
|
||||
{
|
||||
public:
|
||||
LMenu();
|
||||
};
|
||||
|
||||
#endif // LMENU_H
|
||||
6
pglab/plugin_support/LMenuBar.cpp
Normal file
6
pglab/plugin_support/LMenuBar.cpp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#include "LMenuBar.h"
|
||||
|
||||
LMenuBar::LMenuBar()
|
||||
{
|
||||
|
||||
}
|
||||
11
pglab/plugin_support/LMenuBar.h
Normal file
11
pglab/plugin_support/LMenuBar.h
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef LMENUBAR_H
|
||||
#define LMENUBAR_H
|
||||
|
||||
/** Represents the main menubar. Linked to a QMenuBar
|
||||
*/
|
||||
class LMenuBar {
|
||||
public:
|
||||
LMenuBar();
|
||||
};
|
||||
|
||||
#endif // LMENUBAR_H
|
||||
6
pglab/plugin_support/LMenuItem.cpp
Normal file
6
pglab/plugin_support/LMenuItem.cpp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#include "LMenuItem.h"
|
||||
|
||||
LMenuItem::LMenuItem()
|
||||
{
|
||||
|
||||
}
|
||||
10
pglab/plugin_support/LMenuItem.h
Normal file
10
pglab/plugin_support/LMenuItem.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef LMENUITEM_H
|
||||
#define LMENUITEM_H
|
||||
|
||||
|
||||
class LMenuItem {
|
||||
public:
|
||||
LMenuItem();
|
||||
};
|
||||
|
||||
#endif // LMENUITEM_H
|
||||
6
pglab/plugin_support/LMenuSection.cpp
Normal file
6
pglab/plugin_support/LMenuSection.cpp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#include "LMenuSection.h"
|
||||
|
||||
LMenuSection::LMenuSection()
|
||||
{
|
||||
|
||||
}
|
||||
11
pglab/plugin_support/LMenuSection.h
Normal file
11
pglab/plugin_support/LMenuSection.h
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef LMENUSECTION_H
|
||||
#define LMENUSECTION_H
|
||||
|
||||
/** Logical grouping within a menu
|
||||
*/
|
||||
class LMenuSection {
|
||||
public:
|
||||
LMenuSection();
|
||||
};
|
||||
|
||||
#endif // LMENUSECTION_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue