Update for the Catalog API change. Based on r37345. Review appreciated.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39087 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matt Madia 2010-10-23 20:18:22 +00:00
parent 974d4226ff
commit afbf2c78d1
3 changed files with 29 additions and 31 deletions

View File

@ -4,7 +4,7 @@
//
// InspectorApp.cpp
//
// BApplication object for the Inspector application. The purpose of
// BApplication object for the Inspector application. The purpose of
// Inspector is to provide the user with as much relevant information as
// possible about the currently open document.
//
@ -14,18 +14,18 @@
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/*****************************************************************************/
@ -49,14 +49,12 @@ InspectorApp::InspectorApp()
{
fpActivesWin = NULL;
fpInfoWin = NULL;
be_locale->GetAppCatalog(&fAppCatalog);
AddToTranslatorsList("/system/add-ons/Translators",
SYSTEM_TRANSLATOR);
AddToTranslatorsList("/boot/home/config/add-ons/Translators",
USER_TRANSLATOR);
// Show application window
BRect rect(100, 100, 500, 400);
ImageWindow *pwin = new ImageWindow(rect, IMAGEWINDOW_TITLE);
@ -68,14 +66,14 @@ InspectorApp::AddToTranslatorsList(const char *folder, int32 group)
{
BDirectory dir;
if (dir.SetTo(folder) == B_OK) {
BEntry ent;
while (dir.GetNextEntry(&ent) == B_OK) {
BPath path;
if (ent.GetPath(&path) == B_OK)
flstTranslators.AddItem(
new BTranslatorItem(path.Leaf(), path.Path(), group));
}
}
}
}
@ -86,24 +84,24 @@ InspectorApp::MessageReceived(BMessage *pmsg)
case M_ACTIVE_TRANSLATORS_WINDOW:
if (!fpActivesWin)
fpActivesWin = new ActiveTranslatorsWindow(
BRect(625, 350, 800, 600),
BRect(625, 350, 800, 600),
B_TRANSLATE("Active Translators"),
GetTranslatorsList());
break;
case M_ACTIVE_TRANSLATORS_WINDOW_QUIT:
fpActivesWin = NULL;
break;
case M_INFO_WINDOW:
if (!fpInfoWin)
fpInfoWin = new InfoWindow(BRect(625, 50, 800, 300),
B_TRANSLATE_COMMENT("Info Win",
B_TRANSLATE_COMMENT("Info Win",
"This is a quite narrow info window and title 'Info Win' "
"is therefore shortened."), fbstrInfo.String());
break;
case M_INFO_WINDOW_QUIT:
fpInfoWin = NULL;
break;
break;
case M_INFO_WINDOW_TEXT:
// If image view is telling me to
// update the info window...
@ -111,7 +109,7 @@ InspectorApp::MessageReceived(BMessage *pmsg)
if (fpInfoWin)
fpInfoWin->PostMessage(pmsg);
break;
default:
BApplication::MessageReceived(pmsg);
break;
@ -136,12 +134,12 @@ InspectorApp::GetTranslatorsList()
int main(int argc, char **argv)
{
InspectorApp *papp = new InspectorApp();
papp->Run();
delete papp;
papp = NULL;
return 0;
}

View File

@ -4,7 +4,7 @@
//
// InspectorApp.h
//
// BApplication object for the Inspector application. The purpose of
// BApplication object for the Inspector application. The purpose of
// Inspector is to provide the user with as much relevant information as
// possible about the currently open document.
//
@ -14,18 +14,18 @@
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/*****************************************************************************/
@ -47,9 +47,9 @@ public:
InspectorApp();
void MessageReceived(BMessage *pmsg);
void RefsReceived(BMessage *pmsg);
BList *GetTranslatorsList();
private:
void AddToTranslatorsList(const char *folder, int32 group);
@ -57,7 +57,6 @@ private:
BList flstTranslators;
ActiveTranslatorsWindow *fpActivesWin;
InfoWindow *fpInfoWin;
BCatalog fAppCatalog;
};
#endif // #ifndef INSPECTORAPP_H

View File

@ -2,7 +2,7 @@ SubDir HAIKU_TOP src tools translation inspector ;
AddResources Inspector : Inspector.rsrc ;
Application Inspector :
Application Inspector :
TranslatorItem.cpp
StatusCheck.cpp
ActiveTranslatorsWindow.cpp
@ -20,5 +20,6 @@ DoCatalogs Inspector :
ActiveTranslatorsWindow.cpp
;
LinkAgainst Inspector : be tracker locale translation $(TARGET_LIBSUPC++) ;
LinkAgainst Inspector :
be tracker translation $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS) ;