Ticket #137 (closed task: wontfix)

Opened 22 months ago

Last modified 20 months ago

Non-GTK UI

Reported by: sadrul Owned by: daelstorm
Priority: major Milestone:
Component: nicotine Version:
Keywords: Cc:

Description

Hi. I have created a python wrapper for libgnt (an ncurses widgetset), and I am planning on writing a nicotine+ frontend that uses this gnt toolkit (this toolkit is what gaim-text uses). Is there some documentation I could follow? Or would someone please volunteer a quick rundown of things I need to do? I want to start off with UI for searching and search results. If I can get that to work, I think I can slowly get to UIs for downloading, chatting etc.

Attachments

Change History

Changed 22 months ago by daelstorm

hmm.. well, I can't think of anything that'd be helpful for that, since i've never used gnt before (do recall using a curses-lib for gtk+, tho). Nicotine+ uses gobject, pygtk and a bunch of optional libraries/python bindings.

Here's a rather basic dependency graph. http://thegraveyard.org/daelstorm/nicotine/nicotine-dependencies.png

You'd probably want a python module graph, but I haven't had a chance to make one, yet.

I can recommend you try mucous (curses-ui) & museek-plus (c++ daemon) @ http://museek-plus.org/ unless you really want to implement nicotine+ as a curses/python interface. I'm the author of mucous.

Changed 22 months ago by sadrul

I found museek-plus and mucous after I filed this report. This will probably meet my needs quite nicely! Thanks :)

On a side note, the widgets in libgnt are also GObjects. They work in a very similar way to the GTK+ widgets. For a sample code:

#!/usr/bin/python import gnt

def button_activate(button, entry):

entry.set_text("clicked!!!")

gnt.gnt_init() win = gnt.Window() win.set_title("Example") entry = gnt.Entry("") win.add_widget(entry) button = gnt.Button("Click!") win.add_widget(button) button.connect("activate", button_activate, entry) win.show() gnt.gnt_main() gnt.gnt_quit()

Considering libgnt provides an ncurses counterpart for most GTK+ widgets, it probably would be possible to write a libgnt UI without too much difficulty, seeing as how the ui code is nicely separated from the core. But getting started is a little daunting for me, especially due to my unfamiliarity with both nicotine internals and python. :)

Changed 22 months ago by daelstorm

Actually, Nicotine's UI code isn't completely seperate from the networking stuff. It's not as clean as it could be.

A large amount of the GUI code ( gtkgui/nicotine_glade.py and gtkgui/settings_glade.py ) is generated from glade-2 files with the glade2py script.

frame.py loads the glade-generated python files and creates all the main window's widgets and the trayicon.

'Notebooks' and 'Notebook Tabs' are contained in their respective python files, with User Info and User Browse sharing the UserTabs? notebook class in userinfo.py

UserBrowse? also used to use a browsetreemodels.py file, but I removed that.

pynicotine/gtkgui/utils.py contains a bunch of functions that are shared across different files, such as InitialiseColumns?, a function for creating listview/treeview columns. AppendLine? is used for adding text to all textviews. The Notebooks are wrapped with the IconNotebook? class, which allows for an icon (which changes) and close button on each tab.

pynicotine/utils.py contains the translation function _() and the shares scanning code.

Networking

pynicotine/pynicotine.py holds the networking callbacks. They pass thru frame.py's callback, networkcallback to OnNetworkEvent? where the proper function (that's in pynicotine.py's events dict) is executed.

slskproto.py is the networking thread. lots of undocumented stuff, here. Server and Peer messages get downloaded and get sent off to be parsed in slskmessages.py, unless they are peerinit messages. Outgoing messages are packed and sent from here, as well. slskmessages.py has classes for unpacking/packing server and peer messages. It uses struct for packing numbers.

Transfers

pynicotine/transfers.py manages transfers and updates the gui after every change. pynicotine/gtkgui/transferlist.py is a class that gets incorporated in both downloads.py and uploads.py. The update function is probably the most important part of that. Currently, I have transfers in a tree, sorted by username.

Search, the about dialogs, Interests, and the buddies list have their own classes and functions.

Private Chat, Chatrooms have their own input /commands.

Often you'll see a notebook class that has a function with the same names as the tab class. These will try to run same function in each class.

Anyway.. I doubt this summary will help, much. More extensive documentation would be a good thing.

Changed 20 months ago by daelstorm

  • status changed from new to closed
  • resolution set to wontfix

Add/Change #137 (Non-GTK UI)

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.