Skip to content

Commit

Permalink
remove Control's inheritance on ActionHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
bhennion committed Sep 9, 2023
1 parent 158df45 commit 7cd1bf7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/core/control/Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ Control::Control(GApplication* gtkApp, GladeSearchpath* gladeSearchPath, bool di
this->metadata = new MetadataManager();
this->cursor = new XournalppCursor(this);

this->lastAction = ACTION_NONE;
this->lastGroup = GROUP_NOGROUP;
this->lastEnabled = false;

auto name = Util::getConfigFile(SETTINGS_XML_FILE);
this->settings = new Settings(std::move(name));
this->settings->load();
Expand Down Expand Up @@ -1436,7 +1432,8 @@ void Control::setViewPresentationMode(bool enabled) {
this->actionDB->enableAction(Action::ZOOM_FIT, !enabled);
this->actionDB->enableAction(Action::ZOOM_100, !enabled);

fireEnableAction(ACTION_FOOTER_ZOOM_SLIDER, !enabled);
// TODO Figure out how to replace this
// fireEnableAction(ACTION_FOOTER_ZOOM_SLIDER, !enabled);

this->actionDB->enableAction(Action::SET_LAYOUT_BOTTOM_TO_TOP, !enabled);
this->actionDB->enableAction(Action::SET_LAYOUT_RIGHT_TO_LEFT, !enabled);
Expand All @@ -1453,7 +1450,8 @@ void Control::setViewPresentationMode(bool enabled) {

void Control::setPairsOffset(int numOffset) {
settings->setPairsOffset(numOffset);
fireActionSelected(GROUP_PAIRED_PAGES, numOffset ? ACTION_SET_PAIRS_OFFSET : ACTION_NOT_SELECTED);
// TODO Implement unused action Action::PAIRED_PAGES_OFFSET??
// fireActionSelected(GROUP_PAIRED_PAGES, numOffset ? ACTION_SET_PAIRS_OFFSET : ACTION_NOT_SELECTED);
win->getXournal()->layoutPages();
scrollHandler->scrollToPage(getCurrentPageNo());
}
Expand Down
1 change: 0 additions & 1 deletion src/core/control/Control.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class Callback;
class ActionDatabase;

class Control:
public ActionHandler,
public ToolListener,
public DocumentHandler,
public UndoRedoListener,
Expand Down
3 changes: 2 additions & 1 deletion src/core/plugin/luapi_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ static int applib_uiActionSelected(lua_State* L) {
ActionType action = ActionType_fromString(luaL_checkstring(L, 2));

Control* ctrl = plugin->getControl();
ctrl->fireActionSelected(group, action);
// TODO Figure out a way for backwards compat.
// ctrl->fireActionSelected(group, action);

return 0;
}
Expand Down

0 comments on commit 7cd1bf7

Please sign in to comment.