Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about kde (old posts, page 26)

Kid, wanna try a WM?

Read­ing a post on plan­etkde, I saw an ap­par­ent­ly out­-of-nowhere ref­er­ence to black­boxqt...

Not all that in­ter­est­ing, I sup­pose, but I am fond of ol'B­B,and this Qt4 re­make could be pret­ty cool (although I can't test it be­cause it does­n't build for me). Here's a link to the code.

Text-based presentations

There have been a few posts on plan­et KDE about tex­t-based pre­sen­ta­tion tools (1 , 2 , 3) and while their so­lu­tions are all prob­a­bly bet­ter than mine, I have to say I did some­thing in the area about a year ago.

Since I like re­struc­tured text and PyQt that's what it's based on, but you can just use it with vi and a wyse60, if you wan­t.

My project is called To­bo­gan and it has a work­ing ver­sion.

It has a GUI, but let's ig­nore it for this post about tex­t-based soft­ware ;-) and show the text be­hind it:

===============
Why use Tobogan
===============

-------------------
(If you are a nerd)
-------------------

:transitions: from_left,to_left,from_top,to_top,from_right,to_right,to_bottom,fade_out



It's nerd-oriented
------------------

It's trivial to display source code, with
proper syntax highlighting.

.. code-block:: python

    from base64 import *
    def myFirstFunction():
          print b64decode ('YnllIHdvcmxkIQ==')

Even for things like shell sessions.
Dammit, I am a nerd, I will try to add every nerd
feature I deem cool.



It does things simply
---------------------

This is a subtitle?
===================

Wanna show a flickr photo?

.. code-block:: rst

    .. flickr:: myPhotoTitle

How about using openomy.com to share your files?
And whatever else you can think of, it probably
**can**\  be done.

.. footer:: Smart thing goes here

And here is the re­sult af­ter run­ning rst2s­l.py on it.

Hints:

  • If you move the cur­­sor to the top, you will get (bro­ken?) pre­vi­ous/next ar­rows

  • If you click on the win­­dow, you get to the next slide.

I have not touched this in al­most a year, and it would need lots of love, but it's not a bad con­cep­t, IMVHO.

Thinking in 800x480: Web browsing

I am still anx­ious­ly wait­ing for my Asus eee (still a week to go or so), and I was think­ing about web brows­ing in the 7", 800x480 screen.

Yes, you can do the usu­al things, go to full screen mod­e, what­ev­er, but for many sites, 800 pix­els is just too nar­row.

You can make pages fit bet­ter in a lim­it­ed width by re­duc­ing the font size. A good 8pt font is prob­a­bly read­able on that screen, since you will be pret­ty close to the screen.

How­ev­er, that does noth­ing for lay­outs that are pix­el-based, and for the size of im­ages.

How­ev­er, af­ter read­ing about Qt 4.4's sup­port for we­bkit and wid­gets in QGraph­icsView, I start­ed think­ing... that's do­ing it wrong.

What you want in lim­it­ed screen space is text in the usu­al size and the page in a small­er size.

So, my idea is:

  • Make the font larg­er. Say, 12p­t.

  • Ren­der the page in a we­bkit wid­get that's 1200x720 pix­el­s.

  • Put the wid­get in a QGraph­ic­sS­cene, and re­­duce it 33%.

The re­sult? a 800x480 web page view that con­tains the whole page.

Of course you should be able to change all these pa­ram­e­ters with a sin­gle con­trol. Is the page too wide to see in 800x480 with 8pt fonts?

Then try 1000x600 with 10pt fonts, and re­duce it to fit the screen.

Still too wide? Then try 1200x720 and a 33% re­duc­tion.

Pos­si­ble tip­s:

  • Should work bet­ter with aliased fonts, since the size re­­duc­­tion should make an­­tialiased fonts too blur­ry. A wide, open font will look bet­ter,

  • The scrol­l­bars will look squashed, I ex­pec­t. Prob­a­bly check­­box­es and ra­­dio but­­tons will look funky. Here, more ad­­vanced wiz­­ardry is need­ed.

Of course it would have to be test­ed, but I am will­ing to bet this will work bet­ter than oth­er al­ter­na­tives. If I had a work­ing PyQt 4.4 I would try to do it my­self ;-)

Everything is still around

For a project I am do­ing for one of my cus­tomer­s, I need­ed a mail­ing list ar­chive. I looked, and it seems the nicer one is Lurk­er.

Sad­ly, there are no RPM pack­ages, so I had to build it man­u­al­ly... and ran in­to mimelib. Which, look­ing closer, is the same mimelib from Doug Saud­er I used in KRN back in the late 90s.

And which I had a hand in GPLing, too. And it's still in use. One of the things I al­ways liked about FLOSS: noth­ing ev­er re­al­ly gets thrown away.

New library: ChipScene

This is the re­al out­come of my Py­Week fail­ure: a neat li­brary.

Take Chip­munk and Qt mash them up, and what do you get?

A OpenGL-ac­cel­er­at­ed, mul­ti­plat­for­m, easy-­to-use play­ground!

But watch the sil­ly video that shows no in­ter­est­ing fea­tures in­stead:

You can't see it but there are 29 bal­loon­s, num­bered, that bounce around hap­pi­ly.

Per­for­mance in the video sucks be­cause I had to dis­able OpenGL in or­der to cap­ture it cor­rect­ly (and video record­ing kills my note­book,any­way). That de­mo nor­mal­ly runs in 3 sec­ond­s, not 57.

Here's the non-boil­er­plate code for that de­mo:

def fillWorld(scene):
  items=[]
  for x in range(1, 29):
      b=cs.CPBodyItem(bpos=[0+13*random.randint(0,25), -50-30*random.randint(0,10)],m=10)
      s=cs.CPCircleShapeItem(10, b, e=.5, offset=[0, 0])
      t=QtGui.QGraphicsSimpleTextItem(str(x), s)
      t.setPos(-5, -5)
      items.append(b)
  items.append(cs.CPSegmentShapeItem([0, 50], [500, 450], 1, None, e=.7))
  items.append(cs.CPSegmentShapeItem([0, 450], [500, 50], 1, None, e=.7))

  for i in items:
      scene.addItem(i)

Neat, is­n't it?

You can get it at the Chip­Scene google code project in­clud­ing, of course, the source.


Contents © 2000-2023 Roberto Alsina