Archive

Posts Tagged ‘QTerm’

Patching QTerm

October 23rd, 2010 No comments

Long time no post here. Recently, I reported 3 bugs to QTerm project and patches were provided. This is my first time to contribute an open-source project.

Then I was able to build my private patched debian package of QTerm with the guide here. I just use the official debian package meta info found in this mirror site. Some notes to take:
1. The path should be like: /home/<your_name>/packages/<your_project>/
2. Before running “dpkg-buildpackage -rfakeroot”, check the debian/control file to see what packages is required to build.
3. The revision of package seems to be controlled by debian/changelog.

My private build file can be found in my skydrive:
– For Hardy(8.04): QTerm 0.5.7
– For Lucid(10.04): QTerm 0.5.11

Categories: C/C++ Tags: ,

Hacking QTerm

July 13th, 2010 No comments

I read source code in QTerm and FQTerm today. Since I want to find reference for Ascii rendering control in my QAnsiEditor project. After hours of tracing and debugging, I was able to use the rendering control in simplest code. Here’s the patch in src/main.cpp:

# diff -ruN qterm-0.5.7/src/main.cpp qterm-0.5.7-1/src/main.cpp
--- qterm-0.5.7/src/main.cpp 2009-06-14 23:09:32.000000000 +0800
+++ qterm-0.5.7-1/src/main.cpp 2010-07-14 09:53:06.000000000 +0800
@@ -16,6 +16,9 @@
 #include "qtermconfig.h"
 #include "qtermglobal.h"
 #include "qterm.h"
+#include "qtermparam.h"
+#include "qtermwindow.h"
+#include "qtermscreen.h"
 
 #include <QtGlobal>
 #include <QApplication>
@@ -139,12 +142,27 @@
         return -1;
     }
 
-    QTerm::Frame * mw = new QTerm::Frame();
-    mw->setWindowTitle( "QTerm "+QString(QTERM_VERSION) );
-    mw->setWindowIcon( QPixmap(Global::instance()->pathLib()+"pic/qterm.png") );
-    mw->show();
-    a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
-    int res = a.exec();
+    //QTerm::Frame * mw = new QTerm::Frame();
+    //mw->setWindowTitle( "QTerm "+QString(QTERM_VERSION) );
+    //mw->setWindowIcon( QPixmap(Global::instance()->pathLib()+"pic/qterm.png") );
+    //mw->show();
+    //a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
+    //int res = a.exec();
+
+    using namespace QTerm;
+    Global::instance()->setScrollPosition(Global::Hide);
+    Param param;
+    param.m_BBSCode = "GBK";
+    param.m_nDispCode = 0;
+    param.m_strAddr = "bbs.yanxi.org";
+    //param.m_nProxyType = 4;
+    //param.m_strProxyHost = "gsopanel";
+    //param.m_uProxyPort = 8000;
+    Window *win = new QTerm::Window(0, param);
+    win->setAttribute(Qt::WA_DeleteOnClose);
+    win->setMinimumSize(600, 400);
+    win->show();
 
+    int res = a.exec();
     return res;
 }

The screenshot of standalone mode:

qterm057_1

The complete patch and patched source can be found here:

http://cid-481cbe104492a3af.office.live.com/browse.aspx/share/dev/QAnsiEditor

Categories: C/C++ Tags: ,

2 Projects on Google Code

July 8th, 2010 No comments

1. QSkin: http://code.google.com/p/qskin/
QSkin is a framework for easier skinning Windows GUI applications. It uses hook technologies, so applications can apply a skin with almost no changes.
The initial ‘Q’ comes from my last name. 🙂

2. QAnsiEditor: http://code.google.com/p/qansieditor/
QAnsiEditor is a program to edit Ansi graphics. It aims to run on multiple platforms base on Qt library.

I will start to code the 2nd project first. Hope I can update it daily.
Release early, release often. =.=

Categories: Tools Tags: ,