* Removed the home-brewn recent menu, and just uses the one libtracker.so
provides instead. * This also fixes bug #6774. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39285 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <PrintJob.h>
|
#include <PrintJob.h>
|
||||||
|
#include <RecentItems.h>
|
||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
#include <ScrollView.h>
|
#include <ScrollView.h>
|
||||||
@@ -55,58 +56,6 @@ const char* kTypeField = "be:type";
|
|||||||
const char* kTranslatorField = "be:translator";
|
const char* kTranslatorField = "be:translator";
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -- ShowImageWindow::RecentDocumentsMenu
|
|
||||||
|
|
||||||
|
|
||||||
class ShowImageWindow::RecentDocumentsMenu : public BMenu {
|
|
||||||
public:
|
|
||||||
RecentDocumentsMenu(const char* title,
|
|
||||||
menu_layout layout = B_ITEMS_IN_COLUMN);
|
|
||||||
bool AddDynamicItem(add_state addState);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
ShowImageWindow::RecentDocumentsMenu::RecentDocumentsMenu(const char* title,
|
|
||||||
menu_layout layout)
|
|
||||||
:
|
|
||||||
BMenu(title, layout)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
ShowImageWindow::RecentDocumentsMenu::AddDynamicItem(add_state addState)
|
|
||||||
{
|
|
||||||
if (addState != B_INITIAL_ADD)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
while (CountItems() > 0)
|
|
||||||
delete RemoveItem(0L);
|
|
||||||
|
|
||||||
BMenuItem* item;
|
|
||||||
BMessage list, *msg;
|
|
||||||
entry_ref ref;
|
|
||||||
char name[B_FILE_NAME_LENGTH];
|
|
||||||
|
|
||||||
be_roster->GetRecentDocuments(&list, 20, NULL, kApplicationSignature);
|
|
||||||
for (int i = 0; list.FindRef("refs", i, &ref) == B_OK; i++) {
|
|
||||||
BEntry entry(&ref);
|
|
||||||
if (entry.Exists() && entry.GetName(name) == B_OK) {
|
|
||||||
msg = new BMessage(B_REFS_RECEIVED);
|
|
||||||
msg->AddRef("refs", &ref);
|
|
||||||
item = new EntryMenuItem(&ref, name, msg, 0, 0);
|
|
||||||
AddItem(item);
|
|
||||||
item->SetTarget(be_app, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark
|
|
||||||
|
|
||||||
|
|
||||||
// This is temporary solution for building BString with printf like format.
|
// This is temporary solution for building BString with printf like format.
|
||||||
// will be removed in the future.
|
// will be removed in the future.
|
||||||
static void
|
static void
|
||||||
@@ -133,7 +82,6 @@ ShowImageWindow::ShowImageWindow(const entry_ref* ref,
|
|||||||
fNavigator(this),
|
fNavigator(this),
|
||||||
fSavePanel(NULL),
|
fSavePanel(NULL),
|
||||||
fBar(NULL),
|
fBar(NULL),
|
||||||
fOpenMenu(NULL),
|
|
||||||
fBrowseMenu(NULL),
|
fBrowseMenu(NULL),
|
||||||
fGoToPageMenu(NULL),
|
fGoToPageMenu(NULL),
|
||||||
fSlideShowDelay(NULL),
|
fSlideShowDelay(NULL),
|
||||||
@@ -317,13 +265,16 @@ void
|
|||||||
ShowImageWindow::AddMenus(BMenuBar* bar)
|
ShowImageWindow::AddMenus(BMenuBar* bar)
|
||||||
{
|
{
|
||||||
BMenu* menu = new BMenu(B_TRANSLATE("File"));
|
BMenu* menu = new BMenu(B_TRANSLATE("File"));
|
||||||
fOpenMenu = new RecentDocumentsMenu(B_TRANSLATE("Open"));
|
|
||||||
menu->AddItem(fOpenMenu);
|
// Add recent files to "Open File" entry as sub-menu.
|
||||||
fOpenMenu->Superitem()->SetTrigger('O');
|
BMenuItem* item = new BMenuItem(BRecentFilesList::NewFileListMenu(
|
||||||
fOpenMenu->Superitem()->SetMessage(new BMessage(MSG_FILE_OPEN));
|
B_TRANSLATE("Open"B_UTF8_ELLIPSIS), NULL, NULL, be_app, 10, true,
|
||||||
fOpenMenu->Superitem()->SetTarget(be_app);
|
NULL, kApplicationSignature), new BMessage(MSG_FILE_OPEN));
|
||||||
fOpenMenu->Superitem()->SetShortcut('O', 0);
|
item->SetShortcut('O', 0);
|
||||||
|
item->SetTarget(be_app);
|
||||||
|
menu->AddItem(item);
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
BMenu* menuSaveAs = new BMenu(B_TRANSLATE("Save as" B_UTF8_ELLIPSIS),
|
BMenu* menuSaveAs = new BMenu(B_TRANSLATE("Save as" B_UTF8_ELLIPSIS),
|
||||||
B_ITEMS_IN_COLUMN);
|
B_ITEMS_IN_COLUMN);
|
||||||
BTranslationUtils::AddTranslationItems(menuSaveAs, B_TRANSLATOR_BITMAP);
|
BTranslationUtils::AddTranslationItems(menuSaveAs, B_TRANSLATOR_BITMAP);
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ public:
|
|||||||
void WindowRedimension(BBitmap* bitmap);
|
void WindowRedimension(BBitmap* bitmap);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class RecentDocumentsMenu;
|
|
||||||
|
|
||||||
void _BuildViewMenu(BMenu* menu, bool popupMenu);
|
void _BuildViewMenu(BMenu* menu, bool popupMenu);
|
||||||
BMenuItem* _AddItemMenu(BMenu* menu, const char* label,
|
BMenuItem* _AddItemMenu(BMenu* menu, const char* label,
|
||||||
uint32 what, char shortcut, uint32 modifier,
|
uint32 what, char shortcut, uint32 modifier,
|
||||||
@@ -79,7 +77,6 @@ private:
|
|||||||
ImageFileNavigator fNavigator;
|
ImageFileNavigator fNavigator;
|
||||||
BFilePanel* fSavePanel;
|
BFilePanel* fSavePanel;
|
||||||
BMenuBar* fBar;
|
BMenuBar* fBar;
|
||||||
BMenu* fOpenMenu;
|
|
||||||
BMenu* fBrowseMenu;
|
BMenu* fBrowseMenu;
|
||||||
BMenu* fGoToPageMenu;
|
BMenu* fGoToPageMenu;
|
||||||
BMenu* fSlideShowDelay;
|
BMenu* fSlideShowDelay;
|
||||||
|
|||||||
Reference in New Issue
Block a user