HaikuDepot: Add "Log in" menu item which shows new window

This commit is contained in:
Stephan Aßmus 2014-09-18 22:27:36 +02:00
parent 700a71bdb8
commit 81c000dd0d
2 changed files with 20 additions and 0 deletions

View File

@ -45,6 +45,7 @@
#include "PackageListView.h"
#include "PackageManager.h"
#include "RatePackageWindow.h"
#include "UserLoginWindow.h"
#undef B_TRANSLATION_CONTEXT
@ -54,6 +55,7 @@
enum {
MSG_MODEL_WORKER_DONE = 'mmwd',
MSG_REFRESH_DEPOTS = 'mrdp',
MSG_LOG_IN = 'lgin',
MSG_PACKAGE_STATE_CHANGED = 'mpsc',
MSG_SHOW_SOURCE_PACKAGES = 'ssrc',
MSG_SHOW_DEVELOP_PACKAGES = 'sdvl'
@ -206,6 +208,10 @@ MainWindow::MessageReceived(BMessage* message)
_StartRefreshWorker(true);
break;
case MSG_LOG_IN:
_OpenLoginWindow();
break;
case MSG_SHOW_SOURCE_PACKAGES:
{
BAutolock locker(fModel.Lock());
@ -394,6 +400,8 @@ MainWindow::_BuildMenu(BMenuBar* menuBar)
BMenu* menu = new BMenu(B_TRANSLATE("Tools"));
menu->AddItem(new BMenuItem(B_TRANSLATE("Refresh depots"),
new BMessage(MSG_REFRESH_DEPOTS)));
menu->AddItem(new BMenuItem(B_TRANSLATE("Log in"),
new BMessage(MSG_LOG_IN)));
menuBar->AddItem(menu);
// menu = new BMenu(B_TRANSLATE("Options"));
@ -839,3 +847,13 @@ MainWindow::_NotifyUser(const char* title, const char* message)
if (alert != NULL)
alert->Go();
}
void
MainWindow::_OpenLoginWindow()
{
UserLoginWindow* window = new UserLoginWindow(this,
BRect(0, 0, 500, 400));
window->Show();
}

View File

@ -71,6 +71,8 @@ private:
void _NotifyUser(const char* title,
const char* message);
void _OpenLoginWindow();
private:
FilterView* fFilterView;
PackageListView* fPackageListView;