# # # patch "src/model/InventoryProxyModel.cpp" # from [5d1c6ddf5394a061d60ad61f59adc58cefaddfa3] # to [e03c57d82a6e0ec6f1b842523a7a87278f7ac983] # # patch "src/model/InventoryProxyModel.h" # from [55ef557f5b2db51a7851fbfc0e6ce037f3ea6763] # to [61eb7da315ee67909835aeacd223141f8fc40fdd] # # patch "src/view/DatabaseMenuBar.cpp" # from [3e40ec1de7e690887aaff95a85785b7d55879ee5] # to [6236815c5b8c7646cea7b748507155e2a13adeef] # # patch "src/view/MenuBar.cpp" # from [e289eb15152708f47e4a58af5ce150a50fc4061c] # to [d692716f0818ddbd8c293b124940d8fef2c4d1df] # # patch "src/view/WorkspaceMenuBar.cpp" # from [99be5d3394b63addbadf7e1278b811f6976b91ac] # to [79395e00c0a347b59a71f00738882d0e58d69fce] # # patch "src/view/WorkspaceMenuBar.h" # from [5ff25dbe25f18656d83bcf73b555ed2f92257a95] # to [00dd3c433ab74935e3b0b8c4227a651f367724ae] # # patch "src/view/WorkspaceWindow.cpp" # from [18a45e72cf0b8c25dcd442b4bf5dc6b73d8d813e] # to [8e2d05c91b8f13a2ab34bf3d930f28aeb0a35e51] # ============================================================ --- src/model/InventoryProxyModel.cpp 5d1c6ddf5394a061d60ad61f59adc58cefaddfa3 +++ src/model/InventoryProxyModel.cpp e03c57d82a6e0ec6f1b842523a7a87278f7ac983 @@ -20,6 +20,7 @@ #include "InventoryProxyModel.h" #include "InventoryItem.h" +#include "vocab.h" InventoryProxyModel::InventoryProxyModel(QObject * parent, bool isFolderTree) : QSortFilterProxyModel(parent), folderTree(isFolderTree), @@ -134,10 +135,11 @@ void InventoryProxyModel::setHideIgnored clear(); } -void InventoryProxyModel::setViewOption(ViewOption opt) +void InventoryProxyModel::setViewOption(int opt) { - if (viewOption == opt) return; - viewOption = opt; + ViewOption newOpt = static_cast(opt); + if (viewOption == newOpt) return; + viewOption = newOpt; clear(); } ============================================================ --- src/model/InventoryProxyModel.h 55ef557f5b2db51a7851fbfc0e6ce037f3ea6763 +++ src/model/InventoryProxyModel.h 61eb7da315ee67909835aeacd223141f8fc40fdd @@ -38,7 +38,7 @@ public slots: public slots: void setHideIgnoredFiles(bool); - void setViewOption(ViewOption); + void setViewOption(int); private: bool folderTree; ============================================================ --- src/view/DatabaseMenuBar.cpp 3e40ec1de7e690887aaff95a85785b7d55879ee5 +++ src/view/DatabaseMenuBar.cpp 6236815c5b8c7646cea7b748507155e2a13adeef @@ -39,8 +39,8 @@ DatabaseMenuBar::DatabaseMenuBar(QWidget menuDatabase->addSeparator(); menuDatabase->addAction(actionCheckout_revision); - // insert the menu before the help menu - insertAction(menuHelp->menuAction(), menuDatabase->menuAction()); + // insert the menu before the Window menu + insertMenu(menuWindow->menuAction(), menuDatabase); connect( actionChangeset_browser, SIGNAL(triggered()), ============================================================ --- src/view/MenuBar.cpp e289eb15152708f47e4a58af5ce150a50fc4061c +++ src/view/MenuBar.cpp d692716f0818ddbd8c293b124940d8fef2c4d1df @@ -89,6 +89,7 @@ MenuBar::MenuBar(QWidget * parent) : QMe // add the created menus to this menu bar addAction(menuFile->menuAction()); + addAction(menuWindow->menuAction()); addAction(menuHelp->menuAction()); connect( ============================================================ --- src/view/WorkspaceMenuBar.cpp 99be5d3394b63addbadf7e1278b811f6976b91ac +++ src/view/WorkspaceMenuBar.cpp 79395e00c0a347b59a71f00738882d0e58d69fce @@ -55,6 +55,18 @@ WorkspaceMenuBar::WorkspaceMenuBar(QWidg actionIgnored_files->setCheckable(true); actionIgnored_files->setShortcut(tr("Alt+I")); + // FIXME: yeah, I know, magic values suck, but registering enums + // to be usable in Qt's signal/slot system sucks for the moment, too + actionAll_files->setData(QVariant(0)); + actionAll_changed_files->setData(QVariant(1)); + actionPatched_files->setData(QVariant(2)); + actionAdded_files->setData(QVariant(3)); + actionRemoved_files->setData(QVariant(4)); + actionRenamed_files->setData(QVariant(5)); + actionMissing_files->setData(QVariant(6)); + actionUnknown_files->setData(QVariant(7)); + actionIgnored_files->setData(QVariant(8)); + menuShow = new QMenu(tr("Show"), this); menuShow->addAction(actionAll_files); @@ -99,10 +111,10 @@ WorkspaceMenuBar::WorkspaceMenuBar(QWidg menuWorkspace->addAction(actionFind_unaccounted_renames); // insert the workspace menu before the database menu - insertAction(menuWorkspace->menuAction(), menuDatabase->menuAction()); + insertMenu(menuDatabase->menuAction(), menuWorkspace); // insert the view menu before the workspace menu - insertAction(menuView->menuAction(), menuWorkspace->menuAction()); + insertMenu(menuWorkspace->menuAction(), menuView); // view actions connect( @@ -146,7 +158,7 @@ void WorkspaceMenuBar::toggleFilterFiles void WorkspaceMenuBar::toggleFilterFiles(QAction * act) { - emit filterFiles(static_cast(act->data().toInt())); + emit filterFiles(act->data().toInt()); // disable any previous action and check the new action entry QList assocWidgets = act->associatedWidgets(); ============================================================ --- src/view/WorkspaceMenuBar.h 5ff25dbe25f18656d83bcf73b555ed2f92257a95 +++ src/view/WorkspaceMenuBar.h 00dd3c433ab74935e3b0b8c4227a651f367724ae @@ -22,7 +22,6 @@ #define WORKSPACE_MENU_BAR_H #include "DatabaseMenuBar.h" -#include "InventoryProxyModel.h" class WorkspaceMenuBar : public DatabaseMenuBar { @@ -34,7 +33,7 @@ signals: signals: void hideIgnoredFiles(bool); void expandTree(bool); - void filterFiles(InventoryProxyModel::ViewOption); + void filterFiles(int); void showUpdateWorkspace(); void showCommitRevision(); ============================================================ --- src/view/WorkspaceWindow.cpp 18a45e72cf0b8c25dcd442b4bf5dc6b73d8d813e +++ src/view/WorkspaceWindow.cpp 8e2d05c91b8f13a2ab34bf3d930f28aeb0a35e51 @@ -187,13 +187,13 @@ void WorkspaceWindow::setup() ); connect( - menuBar, SIGNAL(filterFiles(InventoryProxyModel::ViewOption)), - proxyModelFileList, SLOT(setViewOption(InventoryProxyModel::ViewOption)) + menuBar, SIGNAL(filterFiles(int)), + proxyModelFileList, SLOT(setViewOption(int)) ); connect( - menuBar, SIGNAL(filterFiles(InventoryProxyModel::ViewOption)), - proxyModelFolderTree, SLOT(setViewOption(InventoryProxyModel::ViewOption)) + menuBar, SIGNAL(filterFiles(int)), + proxyModelFolderTree, SLOT(setViewOption(int)) ); treeView->setModel(proxyModelFolderTree);