r3216 - software/ui/src
Miriam Ruiz
baby-guest at alioth.debian.org
Tue Jul 3 20:14:32 UTC 2007
Author: baby-guest
Date: 2007-07-03 20:14:32 +0000 (Tue, 03 Jul 2007)
New Revision: 3216
Modified:
software/ui/src/pkgbrowser.cpp
Log:
Show package description in the information text widget
Modified: software/ui/src/pkgbrowser.cpp
===================================================================
--- software/ui/src/pkgbrowser.cpp 2007-07-03 20:11:49 UTC (rev 3215)
+++ software/ui/src/pkgbrowser.cpp 2007-07-03 20:14:32 UTC (rev 3216)
@@ -24,6 +24,12 @@
#include "ui.h"
#include "common.h"
+#include "Environment.h"
+#include "GamesOptions.h"
+#include "Engine.h"
+
+#include <ept/apt/packagerecord.h>
+
#include <stdio.h>
#include <string.h>
#include <limits.h>
@@ -33,6 +39,12 @@
#include <FL/Fl_JPEG_Image.H>
#include <FL/Fl_BMP_Image.H>
+using namespace std;
+using namespace ept;
+using namespace ept::debtags;
+using namespace ept::apt;
+using namespace ept::textsearch;
+
PackageBrowser::PackageBrowser(int x, int y, int w, int h, const char *l)
: VersatileBrowser(x, y, w, h, l)
{
@@ -100,13 +112,20 @@
while (highest_parent->parent()) highest_parent = highest_parent->parent();
GamesUI *ui = highest_parent ? (GamesUI*)(highest_parent->user_data()) : NULL;
if (ui && img) ui->Screenshot(img);
+
+ PackageRecord rec(ui->engine->apt().rawRecord((const char *)data));
+
if (ui)
{
Fl_Text_Buffer *buffer = ui->InfoBuffer();
- char *txt = new char[1024];
- snprintf(txt, 1024, "Package: %s", (const char *)data);
+ char *txt = new char[4096];
+ snprintf(txt, 4096, "Package: %s\n", rec.package().c_str());
buffer->text(txt);
- //delete txt;
+ snprintf(txt, 4096, "Description: %s\n", rec.shortDescription().c_str());
+ buffer->append(txt);
+ snprintf(txt, 4096, "\n%s\n", rec.longDescription().c_str());
+ buffer->append(txt);
+ delete [] txt;
}
fflush(stdout);
}
More information about the Pkg-games-commits
mailing list