You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
(11) |
Aug
(45) |
Sep
(12) |
Oct
(8) |
Nov
(4) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(1) |
Feb
(12) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(25) |
Aug
(9) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2007 |
Jan
(11) |
Feb
|
Mar
|
Apr
|
May
(19) |
Jun
(3) |
Jul
(3) |
Aug
(16) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
(54) |
Feb
(5) |
Mar
(34) |
Apr
|
May
(33) |
Jun
(7) |
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
(54) |
Dec
(32) |
2009 |
Jan
(5) |
Feb
(54) |
Mar
(29) |
Apr
(30) |
May
(86) |
Jun
(159) |
Jul
(16) |
Aug
|
Sep
(1) |
Oct
(9) |
Nov
|
Dec
(91) |
2010 |
Jan
(82) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
(31) |
Jul
(19) |
Aug
(33) |
Sep
(3) |
Oct
(1) |
Nov
(4) |
Dec
(3) |
2011 |
Jan
|
Feb
(1) |
Mar
(27) |
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(5) |
Dec
(4) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
(1) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(11) |
Jul
(2) |
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
(6) |
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
|
From: <si...@us...> - 2010-07-29 14:30:29
|
Revision: 1208 http://qterm.svn.sourceforge.net/qterm/?rev=1208&view=rev Author: sidos Date: 2010-07-29 14:30:19 +0000 (Thu, 29 Jul 2010) Log Message: ----------- XML-ize address book Modified Paths: -------------- trunk/qterm-qt4/src/addrdialog.cpp trunk/qterm-qt4/src/addrdialog.h trunk/qterm-qt4/src/dommodel.cpp trunk/qterm-qt4/src/dommodel.h trunk/qterm-qt4/src/qtermframe.cpp trunk/qterm-qt4/src/qtermframe.h trunk/qterm-qt4/src/qtermglobal.cpp trunk/qterm-qt4/src/qtermwindow.cpp trunk/qterm-qt4/src/qtermwindow.h trunk/qterm-qt4/src/quickdialog.cpp Modified: trunk/qterm-qt4/src/addrdialog.cpp =================================================================== --- trunk/qterm-qt4/src/addrdialog.cpp 2010-07-22 06:19:17 UTC (rev 1207) +++ trunk/qterm-qt4/src/addrdialog.cpp 2010-07-29 14:30:19 UTC (rev 1208) @@ -76,7 +76,7 @@ QMap<QString, QString> listFavorite = Global::instance()->loadFavoriteList(doc); if (listFavorite.count() > 0) { - Global::instance()->loadAddress(doc, listFavorite.keys().at(0), param); + //Global::instance()->loadAddress(doc, listFavorite.keys().at(0), param); ui.nameTreeView->setCurrentIndex(domModel->index(0,0,domModel->index(0,0))); } else // the default Global::instance()->loadAddress(doc, QUuid().toString(), param); @@ -93,6 +93,11 @@ { } +QString addrDialog :: uuid() +{ + return domModel->data(lastIndex, Qt::UserRole).toString(); +} + void addrDialog::updateSchemeList() { ui.schemeComboBox->clear(); @@ -145,23 +150,25 @@ QMenu menu; QAction *actionFolder=0, *actionFavorite=0, *actionRemove=0, *actionSite; - if (type != DomModel::Favorite) { - actionFolder = menu.addAction("New Folder"); - if (type != DomModel::Unknown) { - actionSite = menu.addAction("New Site"); - actionRemove = menu.addAction("Remove"); - } + + actionFolder = menu.addAction(tr("New Folder")); + actionSite = menu.addAction(tr("New Site")); + + if (type != DomModel::Unknown) { + actionRemove = menu.addAction(tr("Remove")); } - if (type == DomModel::Site && parentType != DomModel::Favorite) { - actionFavorite = menu.addAction("Add to favorite"); + if (type == DomModel::Site ) { + actionFavorite = menu.addAction(tr("Add Favorite")); } - - QAction *actionActive = menu.exec(mapToGlobal(point)); + if (type == DomModel::Favorite) { + actionFavorite = menu.addAction(tr("Clear Favorite")); + } + QAction *actionActive = menu.exec(mapToGlobal(point),actionFolder); if (actionActive != 0) { if (actionActive == actionFolder) domModel->addFolder(index); else if (actionActive == actionFavorite) - domModel->addFavorite(index); + domModel->toggleFavorite(index); else if (actionActive == actionSite) domModel->addSite(index); else if (actionActive == actionRemove) @@ -171,6 +178,9 @@ void addrDialog::onNamechange(const QModelIndex & index) { + if (domModel->type(index) == DomModel::Folder) + return; + if (isChanged()) { QMessageBox mb("QTerm", tr("Setting changed, do you want to save?"), @@ -208,11 +218,14 @@ void addrDialog::onClose() { if (!bPartial) - Global::instance()->addrCfg()->save(); + Global::instance()->saveAddressXml(domModel->document()); done(0); } void addrDialog::onConnect(const QModelIndex & index) { + if (domModel->type(index) == DomModel::Folder) + return; + if (isChanged()) { QMessageBox mb("QTerm", tr("Setting changed, do you want to save?"), @@ -224,7 +237,7 @@ onApply(); } if (!bPartial) - Global::instance()->addrCfg()->save(); + Global::instance()->saveAddressXml(domModel->document()); done(1); } Modified: trunk/qterm-qt4/src/addrdialog.h =================================================================== --- trunk/qterm-qt4/src/addrdialog.h 2010-07-22 06:19:17 UTC (rev 1207) +++ trunk/qterm-qt4/src/addrdialog.h 2010-07-29 14:30:19 UTC (rev 1208) @@ -27,6 +27,7 @@ Param param; void updateData(bool save); + QString uuid(); protected slots: void onNamechange(const QModelIndex & index); Modified: trunk/qterm-qt4/src/dommodel.cpp =================================================================== --- trunk/qterm-qt4/src/dommodel.cpp 2010-07-22 06:19:17 UTC (rev 1207) +++ trunk/qterm-qt4/src/dommodel.cpp 2010-07-29 14:30:19 UTC (rev 1208) @@ -170,13 +170,13 @@ return item->name(); break; case Qt::DecorationRole: - if (item->isFolder()) { - if (item->name() == "favorite") + switch (type(index)) { + case Folder: + return QVariant(QIcon(":/pic/folder.png")); + case Favorite: return QVariant(QIcon(":/pic/folder_favorite.png")); - else - return QVariant(QIcon(":/pic/folder.png")); - } else if (item->isSiteReference()) { - return QVariant(QIcon(":/pic/tabpad.png")); + case Site: + return QVariant(QIcon(":/pic/tabpad.png")); } default: return QVariant(); @@ -189,14 +189,13 @@ DomItem *item = static_cast<DomItem*>(index.internalPointer()); ItemType itemType = type(index); + defaultFlags |= Qt::ItemIsDragEnabled; if (itemType == Folder) - return Qt::ItemIsDropEnabled | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | defaultFlags; - else if (itemType == Favorite) // Favorite is special thus not editable + return Qt::ItemIsDropEnabled | Qt::ItemIsEditable | defaultFlags; + else if (itemType == Site) return defaultFlags; - else if (itemType == Site) - return Qt::ItemIsDragEnabled | defaultFlags; else - return defaultFlags | Qt::ItemIsDragEnabled | Qt::ItemIsDragEnabled; + return Qt::ItemIsDropEnabled | defaultFlags; } QVariant DomModel::headerData(int section, Qt::Orientation orientation, @@ -247,14 +246,22 @@ return Unknown; DomItem *item = static_cast<DomItem*>(index.internalPointer()); - if (item->isFolder()) { - if (item->name() == "favorite") - return Favorite; - else - return Folder; - } else - return Site; - + if (item->isFolder()) + return Folder; + else if (item->isSiteReference()) { + QString uuid = data(index, Qt::UserRole).toString(); + // get favor attributes + QDomNodeList siteList = domDocument.elementsByTagName("site"); + for (int i=0; i<siteList.count(); i++) { + QDomElement element = siteList.item(i).toElement(); + if (element.attribute("uuid") == uuid) + if (element.attribute("favor") == "1") + return Favorite; + else + return Site; + } + } + return Unknown; } int DomModel::rowCount(const QModelIndex &parent) const @@ -434,17 +441,21 @@ insertRow(row, parentIndex, item); } -void DomModel::addFavorite(const QModelIndex &index) +void DomModel::toggleFavorite(const QModelIndex &index) { QString uuid = data(index, Qt::UserRole).toString(); if (QUuid(uuid).isNull()) return; - // Create favorite element - QDomElement favorite = domDocument.createElement("addsite"); - favorite.setAttribute("uuid", uuid); - // Create and insert - DomItem *item = new DomItem(favorite, 0); - insertRow(-1, DomModel::index(0,0,QModelIndex()), item); + // toggle favor attributes + QDomNodeList siteList = domDocument.elementsByTagName("site"); + for (int i=0; i<siteList.count(); i++) { + QDomElement element = siteList.item(i).toElement(); + if (element.attribute("uuid") == uuid) + if (element.attribute("favor") == "1") + element.setAttribute("favor", 0); + else + element.setAttribute("favor", 1); + } } void DomModel::addSite(const QModelIndex &index) @@ -463,7 +474,6 @@ QDomElement newSite = site.cloneNode().toElement(); newSite.setAttribute("uuid", newUuid); QDomElement root = domDocument.documentElement(); - QMessageBox::information(0,root.nodeName(),QString::number(root.childNodes().count())); root.appendChild(newSite); break; } @@ -487,13 +497,14 @@ void DomModel::removeItem(const QModelIndex &index) { - if (type(index) == Folder) - for (int n=0; n<rowCount(index); n++) { + if (type(index) == Folder) { + // recursively remove all children + for (int n=0; n<rowCount(index); n++) removeItem(index.child(n,0)); - } - else if (type(index.parent()) == Favorite) { + // remove folder itself, should be empty now removeRows(index.row(), 1, index.parent()); - } else { + } + else { QString uuid = data(index, Qt::UserRole).toString(); QDomNodeList nodeList; // remove the actual site @@ -504,7 +515,6 @@ domDocument.removeChild(node); } } - // and its reference in favorite // and its reference in folder removeRows(index.row(), 1, index.parent()); } Modified: trunk/qterm-qt4/src/dommodel.h =================================================================== --- trunk/qterm-qt4/src/dommodel.h 2010-07-22 06:19:17 UTC (rev 1207) +++ trunk/qterm-qt4/src/dommodel.h 2010-07-29 14:30:19 UTC (rev 1208) @@ -73,7 +73,7 @@ void addSite(const QModelIndex &position); void addFolder(const QModelIndex &position); - void addFavorite(const QModelIndex &position); + void toggleFavorite(const QModelIndex &position); void removeItem(const QModelIndex &index); QDomDocument document() { return domDocument; } Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2010-07-22 06:19:17 UTC (rev 1207) +++ trunk/qterm-qt4/src/qtermframe.cpp 2010-07-29 14:30:19 UTC (rev 1208) @@ -74,6 +74,7 @@ #include <QtGui/QPrintDialog> #include <QtGui/QPainter> #include <QtDebug> +#include <QUuid> namespace QTerm { @@ -238,7 +239,7 @@ addrDialog addr(this, false); if (addr.exec() == 1) { - newWindow(addr.param);//, addr.ui.nameListWidget->currentRow()); + newWindow(addr.param, addr.uuid()); } } @@ -247,7 +248,7 @@ { quickDialog quick(this); - Global::instance()->loadAddress(-2, quick.param); + Global::instance()->loadAddress(Global::instance()->addrXml(), QUuid().toString(), quick.param); if (quick.exec() == 1) { newWindow(quick.param); @@ -263,7 +264,7 @@ for (int i = 0; i < int(windows.count()); ++i) { if ((qobject_cast<Window *>(windows.at(i)))->isConnected()) { titleList << windows.at(i)->windowTitle(); - sites << qobject_cast<Window *>(windows.at(i))->index(); + sites << qobject_cast<Window *>(windows.at(i))->uuid(); } } if ((!titleList.isEmpty())&&(Global::instance()->m_pref.bWarn)) { @@ -288,7 +289,7 @@ for (int i = 0; i < int(windows.count()); ++i) { if ((qobject_cast<Window *>(windows.at(i)))->isConnected()) { titleList << windows.at(i)->windowTitle(); - sites << qobject_cast<Window *>(windows.at(i))->index(); + sites << qobject_cast<Window *>(windows.at(i))->uuid(); } } @@ -303,9 +304,9 @@ } //create a new display window -void Frame::newWindow(const Param& param, int index) +void Frame::newWindow(const Param& param, const QString& uuid) { - Window * window = new Window(this, param, index, mdiArea, 0); + Window * window = new Window(this, param, uuid, mdiArea, 0); window->setWindowTitle(param.m_mapParam["name"].toString()); window->setWindowIcon(QIcon(":/pic/tabpad.png")); window->setAttribute(Qt::WA_DeleteOnClose); @@ -397,27 +398,32 @@ { connectMenu->clear(); - connectMenu->addAction(tr("Quick Login"), this, SLOT(quickLogin())); + connectMenu->addAction(actionQuick_Login); connectMenu->addSeparator(); - QStringList listName = Global::instance()->loadNameList(); - QSignalMapper * connectMapper = new QSignalMapper(this); + QMap<QString,QString> listSite = Global::instance()->loadFavoriteList( + Global::instance()->addrXml()); + QMapIterator<QString,QString> i(listSite); - for (int i = 0; i < listName.count(); i++) { - QAction * idAction = new QAction(listName[i], connectMenu); + QSignalMapper * connectMapper = new QSignalMapper(this); + + while (i.hasNext()) { + i.next(); + QAction * idAction = new QAction(i.value(), connectMenu); connectMenu->addAction(idAction); connect(idAction, SIGNAL(triggered()), connectMapper, SLOT(map())); - connectMapper->setMapping(idAction, i); - } - connect(connectMapper, SIGNAL(mapped(int)), this, SLOT(connectMenuActivated(int))); + connectMapper->setMapping(idAction, i.key()); + } + connect(connectMapper, SIGNAL(mapped(QString)), this, SLOT(connectMenuActivated(QString))); } -void Frame::connectMenuActivated(int id) +void Frame::connectMenuActivated(const QString& uuid) { Param param; - // FIXME: don't know the relation with id and param setted by setItemParameter - if (Global::instance()->loadAddress(id, param)) - newWindow(param, id); + if (Global::instance()->loadAddress( + Global::instance()->addrXml(), + uuid, param)) + newWindow(param, uuid); } /********************************************************* @@ -542,7 +548,7 @@ { if (mdiArea->activeSubWindow() == NULL) { Param param; - Global::instance()->loadAddress(-1, param); + Global::instance()->loadAddress(Global::instance()->addrXml(), QUuid().toString(), param); newWindow(param); } else if (!qobject_cast<Window *>(mdiArea->activeSubWindow())->isConnected()) @@ -683,16 +689,14 @@ void Frame::on_actionDefault_Session_Setting_triggered() { addrDialog set(this, true); - - if (Global::instance()->addrCfg()->hasSection("default")) - Global::instance()->loadAddress(-1, set.param); - + // load default + Global::instance()->loadAddress(Global::instance()->addrXml(),QUuid().toString(), set.param); set.updateData(false); - if (set.exec() == 1) { - Global::instance()->saveAddress(-1, set.param); - Global::instance()->addrCfg()->save(); - } + QDomDocument doc = Global::instance()->addrXml(); + Global::instance()->saveAddress(doc, QUuid().toString(), set.param); + Global::instance()->saveAddressXml(doc); + } } void Frame::on_actionPreference_triggered() @@ -759,32 +763,33 @@ int i = 0; QShortcut * shortcut = NULL; + // FIXME: map number to favorite site list // shortcuts to addressbook entries - QSignalMapper * addrMapper = new QSignalMapper(this); - for (i = 0; i < 9; i++) { - shortcut = new QShortcut(Qt::CTRL + Qt::ALT + 0x30 + 1 + i, this); - shortcut->setObjectName(QString("Open addressbook enetry %1").arg(i+1)); - connect(shortcut, SIGNAL(activated()), addrMapper, SLOT(map())); - addrMapper->setMapping(shortcut, i); - } - connect(addrMapper, SIGNAL(mapped(int)), this, SLOT(connectMenuActivated(int))); + //QSignalMapper * addrMapper = new QSignalMapper(this); + //for (i = 0; i < 9; i++) { + // shortcut = new QShortcut(Qt::CTRL + Qt::ALT + 0x30 + 1 + i, this); + // shortcut->setObjectName(QString(tr("Open addressbook enetry %1")).arg(i+1)); + // connect(shortcut, SIGNAL(activated()), addrMapper, SLOT(map())); + // addrMapper->setMapping(shortcut, i); + //} + //connect(addrMapper, SIGNAL(mapped(int)), this, SLOT(connectMenuActivated(int))); // shortcuts to swtch windows QSignalMapper * windowMapper = new QSignalMapper(this); for (i = 0; i < 9; i++) { shortcut = new QShortcut(Qt::ALT + 0x30 + 1 + i, this); - shortcut->setObjectName(QString("Switch to window %1").arg(i+1)); + shortcut->setObjectName(QString(tr("Switch to window %1")).arg(i+1)); connect(shortcut, SIGNAL(activated()), windowMapper, SLOT(map())); windowMapper->setMapping(shortcut, i); } shortcut = new QShortcut(Qt::ALT + Qt::Key_Left, this); - shortcut->setObjectName("Previous window"); + shortcut->setObjectName(tr("Previous window")); connect(shortcut, SIGNAL(activated()), windowMapper, SLOT(map())); windowMapper->setMapping(shortcut, 200); shortcut = new QShortcut(Qt::ALT + Qt::Key_Right, this); - shortcut->setObjectName("Next window"); + shortcut->setObjectName(tr("Next window")); connect(shortcut, SIGNAL(activated()), windowMapper, SLOT(map())); windowMapper->setMapping(shortcut, 201); @@ -1090,11 +1095,11 @@ { QList<QVariant> sites = Global::instance()->loadSession(); if (sites.empty()) { - connectMenuActivated(0); + connectMenuActivated(""); } else { for (int i = 0; i < sites.size(); i++) { - int index = sites.at(i).toInt(); - connectMenuActivated(index); + QString uuid = sites.at(i).toString(); + connectMenuActivated(uuid); } } } @@ -1112,7 +1117,7 @@ { // These are actions which are enabled without any subwindow listBasicActions - << "actionNew_Console" + << "actionNew_Console" << "actionConnect" << "actionQuick_Login" << "actionAddressBook" << "actionQuit" << "actionNew_ANSI" << "actionOpen_ANSI" << "actionFont" << "actionStatusbar" << "actionMenubar" << "actionFullscreen" Modified: trunk/qterm-qt4/src/qtermframe.h =================================================================== --- trunk/qterm-qt4/src/qtermframe.h 2010-07-22 06:19:17 UTC (rev 1207) +++ trunk/qterm-qt4/src/qtermframe.h 2010-07-29 14:30:19 UTC (rev 1208) @@ -93,7 +93,7 @@ void windowsMenuAboutToShow(); void windowsMenuActivated(); void connectMenuAboutToShow(); - void connectMenuActivated(int); + void connectMenuActivated(const QString &uuid); void windowActivated(QMdiSubWindow*); void windowClosed(QObject*); @@ -119,7 +119,7 @@ StatusBar *m_pStatusBar; //function - void newWindow(const Param& param, int index = -1); + void newWindow(const Param& param, const QString& uuid=""); void closeEvent(QCloseEvent *); void keyPressEvent(QKeyEvent *); void mouseReleaseEvent(QMouseEvent *); Modified: trunk/qterm-qt4/src/qtermglobal.cpp =================================================================== --- trunk/qterm-qt4/src/qtermglobal.cpp 2010-07-22 06:19:17 UTC (rev 1207) +++ trunk/qterm-qt4/src/qtermglobal.cpp 2010-07-29 14:30:19 UTC (rev 1208) @@ -149,25 +149,10 @@ { QMap<QString,QString> listSite; // import xml address book - QDomElement favorite; - QDomNodeList nodeList = doc.elementsByTagName("folder"); + QDomNodeList nodeList = doc.elementsByTagName("site"); for (int i=0; i<nodeList.count(); i++) { QDomElement node = nodeList.at(i).toElement(); - if (node.attribute("name") == "favorite") { - favorite = node; - break; - } - } - QStringList listUuid; - nodeList = favorite.elementsByTagName("addsite"); - for (int i=0; i<nodeList.count(); i++) { - QDomElement node = nodeList.at(i).toElement(); - listUuid << node.attribute("uuid"); - } - nodeList = doc.elementsByTagName("site"); - for (int i=0; i<nodeList.count(); i++) { - QDomElement node = nodeList.at(i).toElement(); - if (listUuid.contains(node.attribute("uuid"))) + if (node.attribute("favor") == "1") listSite[node.attribute("uuid")] = node.attribute("name"); } @@ -191,6 +176,8 @@ bool Global::loadAddress(QDomDocument doc, QString uuid, Param& param) { + if (uuid.isEmpty()) + uuid = QUuid().toString(); QDomNodeList nodeList = doc.elementsByTagName("site"); for (int i=0; i<nodeList.count(); i++) { QDomElement node = nodeList.at(i).toElement(); @@ -278,7 +265,7 @@ foreach (QString key, param.m_mapParam.keys()) site.setAttribute(key, param.m_mapParam[key].toString()); - doc.appendChild(site); + doc.documentElement().appendChild(site); result = true; } @@ -317,20 +304,6 @@ doc.removeChild(node); } } - // and its reference in favorite - QDomElement favorite; - nodeList = doc.elementsByTagName("folder"); - for (int i=0; i<nodeList.count(); i++) { - QDomElement node = nodeList.at(i).toElement(); - if (node.attribute("name") == "favorite") - favorite = node; - } - nodeList = favorite.elementsByTagName("addsite"); - for (int i=0; i<nodeList.count(); i++) { - QDomElement node = nodeList.at(i).toElement(); - if (node.attribute("uuid") == uuid) - favorite.removeChild(node); - } } bool Global::convertAddressBook2XML() @@ -364,21 +337,10 @@ //QDomElement addresses = doc.createElement("addresses"); //doc.appendChild(addresses); - //QDomElement favorite = doc.createElement("folder"); - //favorite.setAttribute("name", "favorite"); - //addresses.appendChild(favorite); - QDomElement addresses = doc.documentElement(); - QDomElement favorite; - QDomNodeList nodeList = doc.elementsByTagName("folder"); - for (int i=0; i<nodeList.count(); i++) { - QDomElement node = nodeList.at(i).toElement(); - if (node.attribute("name") == "favorite") { - favorite = node; - break; - } - } + QDomElement imported = doc.createElement("folder"); + imported.setAttribute("name", tr("imported sites")); for (int i = -1; i < num; i++) { Param param; @@ -392,7 +354,7 @@ site.setAttribute("uuid", uuid); QDomElement addsite = doc.createElement("addsite"); addsite.setAttribute("uuid", uuid); - favorite.appendChild(addsite); + imported.appendChild(addsite); } foreach(QString key,param.m_mapParam.keys()) site.setAttribute(key, param.m_mapParam[key].toString()); Modified: trunk/qterm-qt4/src/qtermwindow.cpp =================================================================== --- trunk/qterm-qt4/src/qtermwindow.cpp 2010-07-22 06:19:17 UTC (rev 1207) +++ trunk/qterm-qt4/src/qtermwindow.cpp 2010-07-29 14:30:19 UTC (rev 1208) @@ -238,14 +238,14 @@ }; //constructor -Window::Window(Frame * frame, Param param, int addr, QWidget * parent, const char * name, Qt::WFlags wflags) +Window::Window(Frame * frame, Param param, const QString &uuid, QWidget * parent, const char * name, Qt::WFlags wflags) : WindowBase(parent, wflags), m_strMessage(), location() { groupActions(); m_pFrame = frame; m_param = param; - m_nAddrIndex = addr; + m_strUuid = uuid; m_hostInfo = NULL; m_translator = NULL; QString pathLib = Global::instance()->pathLib(); @@ -1257,7 +1257,9 @@ if (set.exec() == 1) { m_param = set.param; - Global::instance()->saveAddress(m_nAddrIndex, m_param); + QDomDocument doc = Global::instance()->addrXml(); + Global::instance()->saveAddress(doc,m_strUuid, m_param); + Global::instance()->saveAddressXml(doc); } else { m_param = backup; } @@ -1825,7 +1827,8 @@ void Window :: groupActions() { - listActions << "actionSave" << "actionSave_As" + listActions << "actionDisconnect" + << "actionSave" << "actionSave_As" << "actionPrint" << "actionPrint_Preview" << "actionCopy" << "actionPaste" << "actionAuto_Copy" << "actionCopy_w_Color" Modified: trunk/qterm-qt4/src/qtermwindow.h =================================================================== --- trunk/qterm-qt4/src/qtermwindow.h 2010-07-22 06:19:17 UTC (rev 1207) +++ trunk/qterm-qt4/src/qtermwindow.h 2010-07-29 14:30:19 UTC (rev 1208) @@ -75,7 +75,7 @@ { Q_OBJECT public: - Window(Frame * frame, Param param, int addr = -1, QWidget* parent = 0, + Window(Frame * frame, Param param, const QString& uuid, QWidget* parent = 0, const char* name = 0, Qt::WFlags wflags = Qt::Window); ~Window(); @@ -84,8 +84,8 @@ return m_bConnected; } - int index() { - return m_nAddrIndex; + QString uuid() { + return m_strUuid; } @@ -222,7 +222,7 @@ QTimer * m_updateTimer; // address setting - int m_nAddrIndex; + QString m_strUuid; bool m_bDoingLogin; bool m_bCheckIP; Modified: trunk/qterm-qt4/src/quickdialog.cpp =================================================================== --- trunk/qterm-qt4/src/quickdialog.cpp 2010-07-22 06:19:17 UTC (rev 1207) +++ trunk/qterm-qt4/src/quickdialog.cpp 2010-07-29 14:30:19 UTC (rev 1208) @@ -16,6 +16,7 @@ #include <QComboBox> #include <QPixmap> #include <QMessageBox> +#include <QUuid> namespace QTerm { @@ -102,19 +103,21 @@ } void quickDialog::addAddr() { - QString strTmp; - strTmp = Global::instance()->addrCfg()->getItemValue("bbs list", "num").toString(); - int num = strTmp.toInt(); - - strTmp.setNum(num + 1); - Global::instance()->addrCfg()->setItemValue("bbs list", "num", strTmp); - + // Update param param.m_mapParam["name"] = ui.addrLineEdit->text(); param.m_mapParam["addr"] = ui.addrLineEdit->text(); param.m_mapParam["port"] = ui.portSpinBox->value(); param.m_mapParam["protocol"] = ui.protocolComboBox->currentIndex(); - - Global::instance()->saveAddress(num, param); + // Create new site and reference in top level + QDomDocument doc = Global::instance()->addrXml(); + QString uuid = QUuid::createUuid().toString(); + Global::instance()->saveAddress(doc,uuid,param); + // Create site reference + QDomElement newSiteRef = doc.createElement("addsite"); + newSiteRef.setAttribute("uuid", uuid); + doc.documentElement().insertBefore(newSiteRef,QDomNode()); + // Save + Global::instance()->saveAddressXml(doc); } void quickDialog::deleteAddr() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-07-22 06:19:24
|
Revision: 1207 http://qterm.svn.sourceforge.net/qterm/?rev=1207&view=rev Author: sidos Date: 2010-07-22 06:19:17 +0000 (Thu, 22 Jul 2010) Log Message: ----------- premature checkin because of holiday leave Modified Paths: -------------- trunk/qterm-qt4/src/CMakeLists.txt trunk/qterm-qt4/src/addrdialog.cpp trunk/qterm-qt4/src/addrdialog.h trunk/qterm-qt4/src/qterm.qrc trunk/qterm-qt4/src/qtermframe.cpp trunk/qterm-qt4/src/qtermglobal.cpp trunk/qterm-qt4/src/qtermglobal.h trunk/qterm-qt4/src/ui/addrdialog.ui Added Paths: ----------- trunk/qterm-qt4/src/dommodel.cpp trunk/qterm-qt4/src/dommodel.h Modified: trunk/qterm-qt4/src/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/CMakeLists.txt 2010-07-21 20:05:00 UTC (rev 1206) +++ trunk/qterm-qt4/src/CMakeLists.txt 2010-07-22 06:19:17 UTC (rev 1207) @@ -162,6 +162,7 @@ keyboardtranslator.cpp closedialog.cpp uaocodec.cpp + dommodel.cpp ${optionalSources}) set(qterm_UIS ui/aboutdialog.ui Modified: trunk/qterm-qt4/src/addrdialog.cpp =================================================================== --- trunk/qterm-qt4/src/addrdialog.cpp 2010-07-21 20:05:00 UTC (rev 1206) +++ trunk/qterm-qt4/src/addrdialog.cpp 2010-07-22 06:19:17 UTC (rev 1207) @@ -8,6 +8,7 @@ ****************************************************************************/ #include "addrdialog.h" +#include "dommodel.h" #include "qtermparam.h" #include "qtermconfig.h" #include "qtermglobal.h" @@ -21,7 +22,10 @@ #include <QPainter> #include <QFileDialog> #include <QPalette> +#include <QMenu> #include <QtCore/QTextCodec> +#include <QtCore/QUuid> +#include <QtCore/QTextStream> namespace QTerm { @@ -33,14 +37,9 @@ * TRUE to construct a modal dialog. */ addrDialog::addrDialog(QWidget* parent, bool partial, Qt::WFlags fl) - : QDialog(parent, fl), bPartial(partial), bgMenu(this), nLastItem(-1) + : QDialog(parent, fl), bPartial(partial), bgMenu(this) { ui.setupUi(this); - ui.portSpinBox->setRange(0, 65535); - ui.proxyportSpinBox->setRange(0, 65535); - ui.rowSpinBox->setRange(5,500); - ui.columnSpinBox->setRange(5,500); - ui.scrollSpinBox->setRange(0,1000000); QList<QByteArray> codecList = QTextCodec::availableCodecs(); QByteArray codecName; foreach(codecName, codecList) { @@ -49,9 +48,10 @@ updateSchemeList(); updateKeyboardProfiles(); if (bPartial) { - ui.nameListWidget->hide(); + ui.nameTreeView->hide(); ui.Line->hide(); - ui.addPushButton->hide(); + ui.addSitePushButton->hide(); + ui.addFolderPushButton->hide(); ui.deletePushButton->hide(); ui.connectPushButton->hide(); ui.closePushButton->setText(tr("Cancel")); @@ -69,18 +69,21 @@ setMinimumSize(QSize(800, 600)); setMaximumSize(QSize(800, 600)); setWindowTitle(tr("AddressBook")); - ui.nameListWidget->addItems(Global::instance()->loadNameList()); - if (ui.nameListWidget->count() > 0) { - Global::instance()->loadAddress(0, param); - ui.nameListWidget->setCurrentRow(0); + + QDomDocument doc = Global::instance()->addrXml(); + domModel = new DomModel(doc); + ui.nameTreeView->setModel(domModel); + + QMap<QString, QString> listFavorite = Global::instance()->loadFavoriteList(doc); + if (listFavorite.count() > 0) { + Global::instance()->loadAddress(doc, listFavorite.keys().at(0), param); + ui.nameTreeView->setCurrentIndex(domModel->index(0,0,domModel->index(0,0))); } else // the default - if (Global::instance()->addrCfg()->hasSection("default")) - Global::instance()->loadAddress(-1, param); + Global::instance()->loadAddress(doc, QUuid().toString(), param); updateData(false); - ui.nameListWidget->setFocus(Qt::OtherFocusReason); + ui.nameTreeView->setFocus(Qt::OtherFocusReason); } connectSlots(); - ui.connectPushButton->setDefault(true); } /* @@ -134,8 +137,40 @@ } } -void addrDialog::onNamechange(int item) +void addrDialog::onPopupTreeContextMenu(const QPoint& point) { + QModelIndex index = ui.nameTreeView->indexAt(point); + DomModel::ItemType type = domModel->type(index); + DomModel::ItemType parentType = domModel->type(index.parent()); + + QMenu menu; + QAction *actionFolder=0, *actionFavorite=0, *actionRemove=0, *actionSite; + if (type != DomModel::Favorite) { + actionFolder = menu.addAction("New Folder"); + if (type != DomModel::Unknown) { + actionSite = menu.addAction("New Site"); + actionRemove = menu.addAction("Remove"); + } + } + if (type == DomModel::Site && parentType != DomModel::Favorite) { + actionFavorite = menu.addAction("Add to favorite"); + } + + QAction *actionActive = menu.exec(mapToGlobal(point)); + if (actionActive != 0) { + if (actionActive == actionFolder) + domModel->addFolder(index); + else if (actionActive == actionFavorite) + domModel->addFavorite(index); + else if (actionActive == actionSite) + domModel->addSite(index); + else if (actionActive == actionRemove) + domModel->removeItem(index); + } +} + +void addrDialog::onNamechange(const QModelIndex & index) +{ if (isChanged()) { QMessageBox mb("QTerm", tr("Setting changed, do you want to save?"), @@ -145,87 +180,28 @@ 0, this, 0); if (mb.exec() == QMessageBox::Yes) { updateData(true); - if (nLastItem != -1) { - Global::instance()->saveAddress(nLastItem, param); - ui.nameListWidget->item(nLastItem)->setText(param.m_mapParam["name"].toString()); - ui.nameListWidget->setCurrentRow(item); - return; + if (lastIndex.isValid()) { + QString uuid = domModel->data(lastIndex,Qt::UserRole).toString(); + if (!QUuid(uuid).isNull()) + Global::instance()->saveAddress(domModel->document(), uuid, param); } } } - nLastItem = item; - Global::instance()->loadAddress(item, param); + lastIndex = index; + QString uuid = domModel->data(index, Qt::UserRole).toString(); + if (!uuid.isEmpty()) + Global::instance()->loadAddress(domModel->document(), uuid, param); updateData(false); } -void addrDialog::onAdd() -{ - QString strTmp; - Config * pConf = Global::instance()->addrCfg(); - strTmp = pConf->getItemValue("bbs list", "num").toString(); - int num = strTmp.toInt(); - - int index = ui.nameListWidget->currentRow(); - - // change section names after the insert point - QString strSection; - for (int i = num - 1; i > index; i--) { - strSection = QString("bbs %1").arg(i); - strTmp = QString("bbs %1").arg(i + 1); - //strSection.sprintf("bbs %d",i); - //strTmp.sprintf("bbs %d",i+1); - pConf->renameSection(strSection, strTmp); - } - // add list number by one - strTmp.setNum(num + 1); - pConf->setItemValue("bbs list", "num", strTmp); - // update the data - updateData(true); - Global::instance()->saveAddress(index + 1, param); - - // insert it to the listbox - ui.nameListWidget->insertItem(index + 1, param.m_mapParam["name"].toString()); - ui.nameListWidget->setItemSelected(ui.nameListWidget->item(index + 1), true); -} -void addrDialog::onDelete() -{ - QString strTmp; - Config * pConf = Global::instance()->addrCfg(); - strTmp = pConf->getItemValue("bbs list", "num").toString(); - int num = strTmp.toInt(); - - if (ui.nameListWidget->count() == 0) - return; - int index = ui.nameListWidget->currentRow(); - - // delete the section - QString strSection = QString("bbs %1").arg(index); -// strSection.sprintf("bbs %d",index); - Global::instance()->removeAddress(index); - // change the number after that - for (int i = index + 1; i < num; i++) { - strSection = QString("bbs %1").arg(i); - strTmp = QString("bbs %1").arg(i-1); -// strSection.sprintf("bbs %d",i); -// strTmp.sprintf("bbs %d",i-1); - pConf->renameSection(strSection, strTmp); - } - // ass list number by one - strTmp.setNum(qMax(0, num - 1)); - pConf->setItemValue("bbs list", "num", strTmp); - // delete it from name listbox - Global::instance()->loadAddress(qMin(index, num - 2), param); - updateData(false); - ui.nameListWidget->takeItem(index); - ui.nameListWidget->setItemSelected(ui.nameListWidget->item(qMin(index, ui.nameListWidget->count() - 1)), true); -} void addrDialog::onApply() { updateData(true); if (!bPartial) { - Global::instance()->saveAddress(ui.nameListWidget->currentRow(), param); - if (ui.nameListWidget->count() != 0) - ui.nameListWidget->item(ui.nameListWidget->currentRow())->setText(param.m_mapParam["name"].toString()); + QString uuid = domModel->data(lastIndex,Qt::UserRole).toString(); + if (!uuid.isEmpty()) + Global::instance()->saveAddress(domModel->document(), uuid, param); + Global::instance()->saveAddressXml(domModel->document()); } else done(1); } @@ -235,7 +211,7 @@ Global::instance()->addrCfg()->save(); done(0); } -void addrDialog::onConnect() +void addrDialog::onConnect(const QModelIndex & index) { if (isChanged()) { QMessageBox mb("QTerm", @@ -342,11 +318,13 @@ void addrDialog::connectSlots() { - connect(ui.nameListWidget, SIGNAL(currentRowChanged(int)), this, SLOT(onNamechange(int))); - connect(ui.nameListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(onConnect())); + connect(ui.nameTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(onNamechange(QModelIndex))); + connect(ui.nameTreeView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(onConnect(QModelIndex))); + connect(ui.nameTreeView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onPopupTreeContextMenu(QPoint))); - connect(ui.addPushButton, SIGNAL(clicked()), this, SLOT(onAdd())); - connect(ui.deletePushButton, SIGNAL(clicked()), this, SLOT(onDelete())); + connect(ui.addFolderPushButton, SIGNAL(clicked()), this, SLOT(onAddFolder())); + connect(ui.addSitePushButton, SIGNAL(clicked()), this, SLOT(onAddSite())); + connect(ui.deletePushButton, SIGNAL(clicked()), this, SLOT(onDelete())); connect(ui.applyPushButton, SIGNAL(clicked()), this, SLOT(onApply())); connect(ui.closePushButton, SIGNAL(clicked()), this, SLOT(onClose())); connect(ui.connectPushButton, SIGNAL(clicked()), this, SLOT(onConnect())); Modified: trunk/qterm-qt4/src/addrdialog.h =================================================================== --- trunk/qterm-qt4/src/addrdialog.h 2010-07-21 20:05:00 UTC (rev 1206) +++ trunk/qterm-qt4/src/addrdialog.h 2010-07-22 06:19:17 UTC (rev 1207) @@ -15,6 +15,7 @@ namespace QTerm { class Config; +class DomModel; class addrDialog : public QDialog { @@ -28,11 +29,9 @@ void updateData(bool save); protected slots: - void onNamechange(int); - void onAdd(); - void onDelete(); + void onNamechange(const QModelIndex & index); void onApply(); - void onConnect(); + void onConnect(const QModelIndex & index); void onClose(); void onReset(); void onConfigScheme(); @@ -44,7 +43,7 @@ void onASCIIFont(const QFont & font); void onGeneralFont(const QFont & font); void onFontSize(int size); - + void onPopupTreeContextMenu(const QPoint& point); protected: void connectSlots(); bool isChanged(); @@ -64,8 +63,8 @@ QStringList schemeFileList; QStringList keyboardProfileList; - int nLastItem; - + QModelIndex lastIndex; + DomModel *domModel; public: Ui::addrDialog ui; }; Added: trunk/qterm-qt4/src/dommodel.cpp =================================================================== --- trunk/qterm-qt4/src/dommodel.cpp (rev 0) +++ trunk/qterm-qt4/src/dommodel.cpp 2010-07-22 06:19:17 UTC (rev 1207) @@ -0,0 +1,515 @@ +#include "dommodel.h" + +#include <QtCore/QStringList> +#include <QtCore/QMimeData> +#include <QtCore/QFile> +#include <QtCore/QTextStream> +#include <QtCore/QUuid> +#include <QtGui/QMessageBox> +#include <QtGui/QIcon> + +namespace QTerm +{ + +DomItem::DomItem(QDomElement &element, DomItem *parent) +{ + domElement = element; + parentItem = parent; + // Populate child items + QDomNodeList nodeList = domElement.childNodes(); + for (int i=0; i<nodeList.count(); i++) { + QDomElement childElement = domElement.childNodes().item(i).toElement(); + DomItem *childItem = new DomItem(childElement, this); + childItems << childItem; + } +} + +DomItem::~DomItem() +{ + foreach(DomItem *item, childItems) + delete item; +} + +QString DomItem::name() +{ + QString name; + if (isFolder()) { + name = domElement.attribute("name"); + } else if (isSiteReference()) { + // Compare uuid with all sites and get site name + QString uuid = domElement.attribute("uuid"); + QDomNodeList siteList = domElement.ownerDocument().elementsByTagName("site"); + for (int i=0; i<siteList.count(); i++) { + QDomElement element = siteList.item(i).toElement(); + if (element.attribute("uuid") == uuid) + name = element.attribute("name"); + } + } + return name; +} + +bool DomItem::setName(const QString& name) +{ + if (!domElement.hasAttribute("name")) + return false; + domElement.setAttribute("name", name); + return true; +} + +QString DomItem::uuid() +{ + return domElement.attribute("uuid"); +} + +bool DomItem::setUuid(const QString & uuid) +{ + if (!domElement.hasAttribute("uuid")) + return false; + domElement.setAttribute("uuid", uuid); + return true; +} + +bool DomItem::isSite() +{ + return domElement.nodeName() == "site"; +} + +bool DomItem::isSiteReference() +{ + return domElement.nodeName() == "addsite"; +} + +bool DomItem::isFolder() +{ + return domElement.nodeName() == "folder"; +} + +QDomElement DomItem::element() const +{ + return domElement; +} + +DomItem *DomItem::parent() +{ + return parentItem; +} + +void DomItem::reparent(DomItem *parent) +{ + parentItem = parent; +} + +DomItem *DomItem::child(int i) +{ + if (i>=0 && i<childItems.count()) + return childItems[i]; + return 0; +} + +void DomItem::insertChild(int i, DomItem* item) +{ + if (i<0 || i>childItems.count()) + return; + + QDomNode node = domElement.childNodes().item(i); + domElement.insertBefore(item->element(),node); + item->reparent(this); + childItems.insert(i, item); +} + +void DomItem::removeChild(int i) +{ + if (i<0 || i>=childItems.count()) + return; + + QDomNode node = domElement.childNodes().item(i); + domElement.removeChild(node); + + delete childItems.takeAt(i); +} + +int DomItem::row() +{ + if (parentItem) + return parentItem->childItems.indexOf(this); + + return 0; +} + +DomModel::DomModel(QDomDocument document, QObject *parent) + : QAbstractItemModel(parent), domDocument(document) +{ + rootItem = new DomItem(document.documentElement(), 0); +} + +DomModel::~DomModel() +{ + delete rootItem; +} + +int DomModel::columnCount(const QModelIndex &/*parent*/) const +{ + return 1; +} + +QVariant DomModel::data(const QModelIndex &index, int role) const +{ + if (!index.isValid()) + return QVariant(); + DomItem *item = static_cast<DomItem*>(index.internalPointer()); + + switch (role) { + case Qt::UserRole: + if (item->isFolder()) { + return item->name(); + } else { + return item->uuid(); + } + break; + case Qt::DisplayRole: + return item->name(); + break; + case Qt::DecorationRole: + if (item->isFolder()) { + if (item->name() == "favorite") + return QVariant(QIcon(":/pic/folder_favorite.png")); + else + return QVariant(QIcon(":/pic/folder.png")); + } else if (item->isSiteReference()) { + return QVariant(QIcon(":/pic/tabpad.png")); + } + default: + return QVariant(); + } +} +Qt::ItemFlags DomModel::flags(const QModelIndex &index) const +{ + Qt::ItemFlags defaultFlags = QAbstractItemModel::flags(index); + + DomItem *item = static_cast<DomItem*>(index.internalPointer()); + ItemType itemType = type(index); + + if (itemType == Folder) + return Qt::ItemIsDropEnabled | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | defaultFlags; + else if (itemType == Favorite) // Favorite is special thus not editable + return defaultFlags; + else if (itemType == Site) + return Qt::ItemIsDragEnabled | defaultFlags; + else + return defaultFlags | Qt::ItemIsDragEnabled | Qt::ItemIsDragEnabled; +} + +QVariant DomModel::headerData(int section, Qt::Orientation orientation, + int role) const +{ + if (orientation == Qt::Horizontal && role == Qt::DisplayRole) + return tr("Name"); + + return QVariant(); +} + +QModelIndex DomModel::index(int row, int column, const QModelIndex &parent) const +{ + if (!hasIndex(row, column, parent)) + return QModelIndex(); + + DomItem *parentItem; + + if (!parent.isValid()) + parentItem = rootItem; + else + parentItem = static_cast<DomItem*>(parent.internalPointer()); + + DomItem *childItem = parentItem->child(row); + if (childItem) + return createIndex(row, column, childItem); + else + return QModelIndex(); +} + +QModelIndex DomModel::parent(const QModelIndex &child) const +{ + if (!child.isValid()) + return QModelIndex(); + + DomItem *childItem = static_cast<DomItem*>(child.internalPointer()); + DomItem *parentItem = childItem->parent(); + + if (!parentItem || parentItem == rootItem) + return QModelIndex(); + + return createIndex(parentItem->row(), 0, parentItem); +} + +DomModel::ItemType DomModel::type(const QModelIndex &index) const +{ + if (!index.isValid()) + return Unknown; + + DomItem *item = static_cast<DomItem*>(index.internalPointer()); + if (item->isFolder()) { + if (item->name() == "favorite") + return Favorite; + else + return Folder; + } else + return Site; + +} + +int DomModel::rowCount(const QModelIndex &parent) const +{ + if (parent.column() > 0) + return 0; + + DomItem *parentItem; + int sitesCount = 0; // This is the number of site elements of root item + if (!parent.isValid()) { + parentItem = rootItem; + sitesCount = domDocument.elementsByTagName("site").count(); + } + else + parentItem = static_cast<DomItem*>(parent.internalPointer()); + + return parentItem->element().childNodes().count() - sitesCount; +} + +bool DomModel::removeRows(int row, int count, const QModelIndex &parent) +{ + DomItem *parentItem; + + if (!parent.isValid()) + parentItem = rootItem; + else + parentItem = static_cast<DomItem*>(parent.internalPointer()); + + if (row < 0 || row >= rowCount(parent)) + return false; + + beginRemoveRows(parent, row, row+count-1); + for (int n=0; n<count; n++) + parentItem->removeChild(row); + endRemoveRows(); + + return true; +} + +bool DomModel::insertRow(int row, const QModelIndex &parent, DomItem *item) +{ + DomItem *parentItem; + + if (!parent.isValid()) + parentItem = rootItem; + else + parentItem = static_cast<DomItem*>(parent.internalPointer()); + + if (row < 0 || row > rowCount(parent)) + row = rowCount(parent); + + beginInsertRows(parent, row, row); + parentItem->insertChild(row, item); + endInsertRows(); + + return true; +} + +bool DomModel::setData(const QModelIndex &index, + const QVariant &value, int role) +{ + if (!index.isValid()) + return false; + + DomItem *item = static_cast<DomItem*>(index.internalPointer()); + + switch (role) { + case Qt::EditRole: + item->setName(value.toString()); + break; + case Qt::UserRole: + if (item->isFolder()) + item->setName(value.toString()); + else if (item->isSiteReference()) + item->setUuid(value.toString()); + break; + default: + return false; + } + + emit dataChanged(index, index); + return true; +} + +bool DomModel::dropMimeData(const QMimeData *data, + Qt::DropAction action, int row, int column, const QModelIndex &parent) +{ + if (action == Qt::IgnoreAction) + return true; + + if (!data->hasFormat("text/plain")) + return false; + + // Find out after which row to insert + int beginRow; + if (row != -1) // given + beginRow = row; + else if (parent.isValid()) // 1st of parent item + beginRow = 0; + else // last of the root item + beginRow = rowCount(QModelIndex()); + + DomItem *parentItem; + if (!parent.isValid()) + parentItem = rootItem; + else + parentItem = static_cast<DomItem*>(parent.internalPointer()); + + // Extract dropped items + QByteArray encodedData = data->data("text/plain"); + QDataStream stream(&encodedData, QIODevice::ReadOnly); + QList<DomItem*> newItems; + while (!stream.atEnd()) { + quintptr p; + stream >> p; + newItems << static_cast<DomItem*>((void *)p); + } + int count = newItems.count(); + + switch(action) { + case Qt::MoveAction: + for (int i=0; i<count; i++) { + DomItem *item = newItems.at(i); + QDomElement node = item->element().cloneNode().toElement(); + DomItem *newItem = new DomItem(node, 0); + insertRow(beginRow, parent, newItem); + } + break; + default: + return false; + } + return true; +} + +QMimeData *DomModel::mimeData(const QModelIndexList &indexes) const +{ + QByteArray encodedData; + QDataStream stream(&encodedData, QIODevice::WriteOnly); + foreach (QModelIndex index, indexes) { + if (index.isValid()) + stream << quintptr(index.internalPointer()); + } + QMimeData *mimeData = new QMimeData(); + mimeData->setData("text/plain", encodedData); + return mimeData; +} + +QStringList DomModel::mimeTypes() const +{ + QStringList types; + types << "text/plain"; + return types; +} + +Qt::DropActions DomModel::supportedDropActions() const +{ + return Qt::MoveAction; +} + +void DomModel::addFolder(const QModelIndex &index) +{ + // New folder is either subfolder or sibyling + QModelIndex parentIndex; + int row; + if (type(index) == Folder) { + parentIndex = index; + row = -1; + } else { + parentIndex = index.parent(); + row = index.row(); + } + // Create folder element + QDomElement folder = domDocument.createElement("folder"); + folder.setAttribute("name", "New Folder"); + // Create and insert + DomItem *item = new DomItem(folder, 0); + insertRow(row, parentIndex, item); +} + +void DomModel::addFavorite(const QModelIndex &index) +{ + QString uuid = data(index, Qt::UserRole).toString(); + if (QUuid(uuid).isNull()) + return; + // Create favorite element + QDomElement favorite = domDocument.createElement("addsite"); + favorite.setAttribute("uuid", uuid); + // Create and insert + DomItem *item = new DomItem(favorite, 0); + insertRow(-1, DomModel::index(0,0,QModelIndex()), item); +} + +void DomModel::addSite(const QModelIndex &index) +{ + QString newUuid = QUuid::createUuid().toString(); + // Clone current site or default site + QString uuid; + if (type(index) == Site) + uuid = data(index, Qt::UserRole).toString(); + else + uuid = QUuid().toString(); + QDomNodeList siteList = domDocument.elementsByTagName("site"); + for (int i=0; i<siteList.count(); i++) { + QDomElement site = siteList.item(i).toElement(); + if (site.attribute("uuid") == uuid) { + QDomElement newSite = site.cloneNode().toElement(); + newSite.setAttribute("uuid", newUuid); + QDomElement root = domDocument.documentElement(); + QMessageBox::information(0,root.nodeName(),QString::number(root.childNodes().count())); + root.appendChild(newSite); + break; + } + } + // Create site reference + QDomElement newSiteRef = domDocument.createElement("addsite"); + newSiteRef.setAttribute("uuid", newUuid); + // New site reference is either child or sibyling + QModelIndex parentIndex; + int row; + if (type(index) == Folder) { + parentIndex = index; + row = -1; + } else { + parentIndex = index.parent(); + row = index.row(); + } + DomItem *item = new DomItem(newSiteRef, 0); + insertRow(row, parentIndex, item); +} + +void DomModel::removeItem(const QModelIndex &index) +{ + if (type(index) == Folder) + for (int n=0; n<rowCount(index); n++) { + removeItem(index.child(n,0)); + } + else if (type(index.parent()) == Favorite) { + removeRows(index.row(), 1, index.parent()); + } else { + QString uuid = data(index, Qt::UserRole).toString(); + QDomNodeList nodeList; + // remove the actual site + nodeList = domDocument.elementsByTagName("site"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + if (uuid == node.attribute("uuid")) { + domDocument.removeChild(node); + } + } + // and its reference in favorite + // and its reference in folder + removeRows(index.row(), 1, index.parent()); + } +} + +} //namespace QTerm + +#include <dommodel.moc> \ No newline at end of file Added: trunk/qterm-qt4/src/dommodel.h =================================================================== --- trunk/qterm-qt4/src/dommodel.h (rev 0) +++ trunk/qterm-qt4/src/dommodel.h 2010-07-22 06:19:17 UTC (rev 1207) @@ -0,0 +1,86 @@ +#ifndef DOMMODEL_H +#define DOMMODEL_H + +#include <QtCore/QAbstractItemModel> +#include <QtCore/QVariant> +#include <QtCore/QModelIndex> +#include <QtXml/QDomDocument> +#include <QtXml/QDomElement> +#include <QHash> + +namespace QTerm +{ +class DomItem +{ +public: + DomItem(QDomElement &element, DomItem *parent = 0); + ~DomItem(); + DomItem *child(int i); + void insertChild(int i, DomItem *item); + void removeChild(int i); + void reparent(DomItem *parent); + DomItem *parent(); + QDomElement element() const; + int row(); + + QString name(); + bool setName(const QString& name); + + QString uuid(); + bool setUuid(const QString& uuid); + + bool isFolder(); + bool isSite(); + bool isSiteReference(); + +private: + QDomElement domElement; + QList<DomItem*> childItems; + DomItem *parentItem; +}; + +class DomModel : public QAbstractItemModel +{ + Q_OBJECT +public: + enum ItemType {Unknown, Folder, Site, Favorite}; + + DomModel(QDomDocument document, QObject *parent = 0); + ~DomModel(); + + QVariant data(const QModelIndex &index, int role) const; + Qt::ItemFlags flags(const QModelIndex &index) const; + QVariant headerData(int section, Qt::Orientation orientation, + int role = Qt::DisplayRole) const; + QModelIndex index(int row, int column, + const QModelIndex &parent = QModelIndex()) const; + QModelIndex parent(const QModelIndex &child) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + + bool removeRows(int row, int count, const QModelIndex &parent); + bool insertRow(int row, const QModelIndex &parent, DomItem *item); + bool setData(const QModelIndex &index, const QVariant &value, + int role = Qt::EditRole); + + bool dropMimeData(const QMimeData *data, Qt::DropAction action, + int row, int column, const QModelIndex &parent); + QMimeData *mimeData(const QModelIndexList &indexes) const; + QStringList mimeTypes() const; + Qt::DropActions supportedDropActions() const; + + ItemType type(const QModelIndex & index) const; + + void addSite(const QModelIndex &position); + void addFolder(const QModelIndex &position); + void addFavorite(const QModelIndex &position); + void removeItem(const QModelIndex &index); + + QDomDocument document() { return domDocument; } + +private: + QDomDocument domDocument; + DomItem *rootItem; +}; +} // namespace QTerm +#endif //DOMMODEL_H Modified: trunk/qterm-qt4/src/qterm.qrc =================================================================== --- trunk/qterm-qt4/src/qterm.qrc 2010-07-21 20:05:00 UTC (rev 1206) +++ trunk/qterm-qt4/src/qterm.qrc 2010-07-22 06:19:17 UTC (rev 1207) @@ -20,6 +20,8 @@ <file>pic/disconnect.png</file> <file>pic/fonts.png</file> <file>pic/keys.png</file> + <file>pic/folder_favorite.png</file> + <file>pic/folder.png</file> <file>pic/message.png</file> <file>pic/messagebox_critical.png</file> <file>pic/messagebox_info.png</file> Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2010-07-21 20:05:00 UTC (rev 1206) +++ trunk/qterm-qt4/src/qtermframe.cpp 2010-07-22 06:19:17 UTC (rev 1207) @@ -238,7 +238,7 @@ addrDialog addr(this, false); if (addr.exec() == 1) { - newWindow(addr.param, addr.ui.nameListWidget->currentRow()); + newWindow(addr.param);//, addr.ui.nameListWidget->currentRow()); } } Modified: trunk/qterm-qt4/src/qtermglobal.cpp =================================================================== --- trunk/qterm-qt4/src/qtermglobal.cpp 2010-07-21 20:05:00 UTC (rev 1206) +++ trunk/qterm-qt4/src/qtermglobal.cpp 2010-07-22 06:19:17 UTC (rev 1207) @@ -109,6 +109,20 @@ return m_address; } +QDomDocument Global::addrXml() +{ + QDomDocument doc; + QFile file(m_addrXml); + if (file.open(QIODevice::ReadOnly)) { + QTextStream in; + in.setCodec("UTF-8"); + in.setDevice(&file); + doc.setContent(in.readAll()); + file.close(); + } + return doc; +} + const QString & Global::pathLib() { return m_pathLib; @@ -131,38 +145,32 @@ } } -QMap<QString,QString> Global::getFavoriteSiteList() +QMap<QString,QString> Global::loadFavoriteList(QDomDocument doc) { QMap<QString,QString> listSite; // import xml address book - QDomDocument doc; - QFile file(m_addrXml); - if (file.open(QIODevice::ReadOnly)) { - if (doc.setContent(&file)) { - QDomElement favorite; - QDomNodeList nodeList = doc.elementsByTagName("folder"); - for (int i=0; i<nodeList.count(); i++) { - QDomElement node = nodeList.at(i).toElement(); - if (node.attribute("name") == "favorite") { - favorite = node; - break; - } - } - QStringList listUuid; - nodeList = favorite.elementsByTagName("addsite"); - for (int i=0; i<nodeList.count(); i++) { - QDomElement node = nodeList.at(i).toElement(); - listUuid << node.attribute("uuid"); - } - nodeList = doc.elementsByTagName("site"); - for (int i=0; i<nodeList.count(); i++) { - QDomElement node = nodeList.at(i).toElement(); - if (listUuid.contains(node.attribute("uuid"))) - listSite[node.attribute("uuid")] = node.attribute("name"); - } + QDomElement favorite; + QDomNodeList nodeList = doc.elementsByTagName("folder"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + if (node.attribute("name") == "favorite") { + favorite = node; + break; } } - file.close(); + QStringList listUuid; + nodeList = favorite.elementsByTagName("addsite"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + listUuid << node.attribute("uuid"); + } + nodeList = doc.elementsByTagName("site"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + if (listUuid.contains(node.attribute("uuid"))) + listSite[node.attribute("uuid")] = node.attribute("name"); + } + return listSite; } QStringList Global::loadNameList() @@ -181,6 +189,18 @@ return listName; } +bool Global::loadAddress(QDomDocument doc, QString uuid, Param& param) +{ + QDomNodeList nodeList = doc.elementsByTagName("site"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + if (uuid == node.attribute("uuid")) + foreach (QString key, param.m_mapParam.keys()) + param.m_mapParam[key] = node.attribute(key); + } + return true; +} + bool Global::loadAddress(int n, Param& param) { QString strTmp, strSection; @@ -236,6 +256,36 @@ } +void Global::saveAddress(QDomDocument doc, QString uuid, const Param& param) +{ + bool result = false; + // find and replace existing site + QDomNodeList nodeList = doc.elementsByTagName("site"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + if (uuid == node.attribute("uuid")) { + foreach (QString key, param.m_mapParam.keys()) + node.setAttribute(key, + param.m_mapParam[key].toString()); + result = true; + break; + } + } + // create new site otherwise + if (!result) { + QDomElement site = doc.createElement("site"); + site.setAttribute("uuid", uuid); + foreach (QString key, param.m_mapParam.keys()) + site.setAttribute(key, + param.m_mapParam[key].toString()); + doc.appendChild(site); + result = true; + } + + if (!result) return; + +} + void Global::removeAddress(int n) { if (n < 0) @@ -256,6 +306,33 @@ m_address->deleteSection(strSection); } +void Global::removeAddress(QDomDocument doc, QString uuid) +{ + QDomNodeList nodeList; + // remove the actual site + nodeList = doc.elementsByTagName("site"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + if (uuid == node.attribute("uuid")) { + doc.removeChild(node); + } + } + // and its reference in favorite + QDomElement favorite; + nodeList = doc.elementsByTagName("folder"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + if (node.attribute("name") == "favorite") + favorite = node; + } + nodeList = favorite.elementsByTagName("addsite"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + if (node.attribute("uuid") == uuid) + favorite.removeChild(node); + } +} + bool Global::convertAddressBook2XML() { QDir dir; @@ -334,6 +411,17 @@ return true; } +void Global::saveAddressXml(const QDomDocument& doc) +{ + QFile ofile(m_addrXml); + if (ofile.open(QIODevice::WriteOnly)) { + QTextStream out(&ofile); + out.setCodec("UTF-8"); + out << doc.toString(); + ofile.close(); + } +} + void Global::loadPrefence() { QString strTmp; Modified: trunk/qterm-qt4/src/qtermglobal.h =================================================================== --- trunk/qterm-qt4/src/qtermglobal.h 2010-07-21 20:05:00 UTC (rev 1206) +++ trunk/qterm-qt4/src/qtermglobal.h 2010-07-22 06:19:17 UTC (rev 1207) @@ -19,6 +19,7 @@ #include <QtCore/QString> #include <QtCore/QMap> #include <QtCore/QObject> +#include <QtXml/QDomDocument> namespace QTerm { @@ -78,14 +79,21 @@ static Global * instance(); Config * fileCfg(); Config * addrCfg(); + QDomDocument addrXml(); const QString & pathLib(); const QString & pathPic(); const QString & pathCfg(); void clearDir(const QString & path); + QMap<QString,QString> loadFavoriteList(QDomDocument); QStringList loadNameList(); + bool loadAddress(QDomDocument doc, QString uuid, Param & param); bool loadAddress(int n, Param & param); void saveAddress(int n, const Param & param); + void saveAddress(QDomDocument doc, QString uuid, const Param & param); void removeAddress(int n); + void removeAddress(QDomDocument doc, QString uuid); + void saveAddressXml(const QDomDocument& doc); + bool convertAddressBook2XML(); QString getOpenFileName(const QString & filter, QWidget * widget); QString getSaveFileName(const QString & filename, QWidget * widget); bool isOK(); @@ -135,6 +143,7 @@ void closeNotification(uint id); QString m_fileCfg; QString m_addrCfg; + QString m_addrXml; QString m_pathLib; QString m_pathPic; QString m_pathCfg; Modified: trunk/qterm-qt4/src/ui/addrdialog.ui =================================================================== --- trunk/qterm-qt4/src/ui/addrdialog.ui 2010-07-21 20:05:00 UTC (rev 1206) +++ trunk/qterm-qt4/src/ui/addrdialog.ui 2010-07-22 06:19:17 UTC (rev 1207) @@ -449,6 +449,9 @@ <height>32</height> </rect> </property> + <property name="maximum"> + <number>65535</number> + </property> </widget> </widget> <widget class="QWidget" name="tab1"> @@ -709,9 +712,7 @@ <set>QFontComboBox::AllFonts</set> </property> <property name="currentFont"> - <font> - <family>Andale Mono</family> - </font> + <font/> </property> </widget> <widget class="QSpinBox" name="fontSizeSpinBox"> @@ -1022,6 +1023,12 @@ <height>32</height> </rect> </property> + <property name="minimum"> + <number>5</number> + </property> + <property name="maximum"> + <number>500</number> + </property> </widget> <widget class="QSpinBox" name="rowSpinBox"> <property name="geometry"> @@ -1032,6 +1039,12 @@ <height>32</height> </rect> </property> + <property name="minimum"> + <number>5</number> + </property> + <property name="maximum"> + <number>500</number> + </property> </widget> <widget class="QSpinBox" name="scrollSpinBox"> <property name="geometry"> @@ -1042,6 +1055,9 @@ <height>32</height> </rect> </property> + <property name="maximum"> + <number>10000</number> + </property> </widget> </widget> <widget class="QWidget" name="tab3"> @@ -1661,10 +1677,13 @@ <height>32</height> </rect> </property> + <property name="maximum"> + <number>65535</number> + </property> </widget> </widget> </widget> - <widget class="QListWidget" name="nameListWidget"> + <widget class="QTreeView" name="nameTreeView"> <property name="geometry"> <rect> <x>10</x> @@ -1673,6 +1692,24 @@ <height>541</height> </rect> </property> + <property name="contextMenuPolicy"> + <enum>Qt::CustomContextMenu</enum> + </property> + <property name="dragEnabled"> + <bool>true</bool> + </property> + <property name="dragDropMode"> + <enum>QAbstractItemView::DragDrop</enum> + </property> + <property name="selectionMode"> + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + <attribute name="headerVisible"> + <bool>false</bool> + </attribute> + <attribute name="headerVisible"> + <bool>false</bool> + </attribute> </widget> <widget class="QPushButton" name="resetPushButton"> <property name="geometry"> @@ -1690,9 +1727,9 @@ <widget class="QPushButton" name="deletePushButton"> <property name="geometry"> <rect> - <x>120</x> + <x>150</x> <y>562</y> - <width>91</width> + <width>61</width> <height>31</height> </rect> </property> @@ -1712,12 +1749,12 @@ <bool>true</bool> </property> </widget> - <widget class="QPushButton" name="addPushButton"> + <widget class="QPushButton" name="addSitePushButton"> <property name="geometry"> <rect> <x>12</x> <y>562</y> - <width>72</width> + <width>51</width> <height>31</height> </rect> </property> @@ -1728,7 +1765,7 @@ </sizepolicy> </property> <property name="text"> - <string>Add</string> + <string>Add Site</string> </property> </widget> <widget class="QPushButton" name="applyPushButton"> @@ -1785,11 +1822,30 @@ <bool>true</bool> </property> </widget> + <widget class="QPushButton" name="addFolderPushButton"> + <property name="geometry"> + <rect> + <x>70</x> + <y>562</y> + <width>72</width> + <height>31</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Add Folder</string> + </property> + </widget> </widget> <layoutdefault spacing="6" margin="11"/> <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> <tabstops> - <tabstop>nameListWidget</tabstop> + <tabstop>nameTreeView</tabstop> <tabstop>tabWidget</tabstop> <tabstop>nameLineEdit</tabstop> <tabstop>addrLineEdit</tabstop> @@ -1840,7 +1896,7 @@ <tabstop>applyPushButton</tabstop> <tabstop>closePushButton</tabstop> <tabstop>resetPushButton</tabstop> - <tabstop>addPushButton</tabstop> + <tabstop>addSitePushButton</tabstop> <tabstop>deletePushButton</tabstop> </tabstops> <resources/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-07-21 20:05:06
|
Revision: 1206 http://qterm.svn.sourceforge.net/qterm/?rev=1206&view=rev Author: sidos Date: 2010-07-21 20:05:00 +0000 (Wed, 21 Jul 2010) Log Message: ----------- forgot commit Modified Paths: -------------- trunk/qterm-qt4/src/qtermparam.h Modified: trunk/qterm-qt4/src/qtermparam.h =================================================================== --- trunk/qterm-qt4/src/qtermparam.h 2010-07-15 13:13:53 UTC (rev 1205) +++ trunk/qterm-qt4/src/qtermparam.h 2010-07-21 20:05:00 UTC (rev 1206) @@ -6,6 +6,8 @@ #include <QString> #include <QColor> +#include <QVariant> + namespace QTerm { class Param; @@ -19,93 +21,8 @@ ~Param(); Param& operator=(const Param&); -// General - // Name - QString m_strName; - // Address - QString m_strAddr; - // Port - quint16 m_uPort; - // Host Type - int m_nHostType; // 0--BBS 1--*NIX - // Auto Login - bool m_bAutoLogin; - // Pre Login - QString m_strPreLogin; - // User Name - QString m_strUser; - // Password - QString m_strPasswd; - // Post Login - QString m_strPostLogin; -// Display - // 0--GBK 1--BGI5 - QString m_BBSCode; - // 0--GBK 1--BIG5 - int m_nDispCode; - // Auto Change Font When Window Resized - bool m_bAutoFont; - // Always Highlight - bool m_bAlwaysHighlight; - // ANSI Color - bool m_bAnsiColor; - // Font Name - QString m_strASCIIFontName; - QString m_strGeneralFontName; - // Font Size - int m_nFontSize; - // Scheme File - QString m_strSchemeFile; -// Terminal - // Terminal Type - QString m_strTerm; - // Keyboard Profile - QString m_strKeyboardProfile; - // Columns & Rows - int m_nCol, m_nRow; - // Scroll Lines - int m_nScrollLines; - // Curor Type - int m_nCursorType; // 0--Block 1--Underline 2--I Type - // the esacpe string - QString m_strEscape; -// Connection - // Proxy Type - int m_nProxyType; // 0--None 1--Wingate 2--SOCKS4 3--SOCKS5 4--HTTP - // Address - QString m_strProxyHost; - // Port - quint16 m_uProxyPort; - // Authentation - bool m_bAuth; - // User Name - QString m_strProxyUser; - // Password - QString m_strProxyPasswd; - // Protocol - int m_nProtocolType; // 0--Telnet 1--SSH1 2--SSH2 -// Misc - // Max Idle Time %s - int m_nMaxIdle; - QString m_strReplyKey; - // Send When Idle - QString m_strAntiString; - // wether autoreply - bool m_bAutoReply; - // Auto Reply Messages - QString m_strAutoReply; - // Reconnect When Disconnected By Host - bool m_bReconnect; - // Reconnect Interval (s) - int m_nReconnectInterval; - // Retry times - int m_nRetry; // -1 -- infinite -// Mouse - int m_nMenuType; // 0--underline 1--reverse 2--color - QColor m_clrMenu; -// Script - bool m_bLoadScript; - QString m_strScriptFile; + + QVariantMap m_mapParam; }; } // namespace QTerm This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-07-15 13:14:02
|
Revision: 1205 http://qterm.svn.sourceforge.net/qterm/?rev=1205&view=rev Author: sidos Date: 2010-07-15 13:13:53 +0000 (Thu, 15 Jul 2010) Log Message: ----------- simplify qtermparam with a QVariantMap convert address book address.cfg to address.xml Modified Paths: -------------- trunk/qterm-qt4/src/CMakeLists.txt trunk/qterm-qt4/src/addrdialog.cpp trunk/qterm-qt4/src/main.cpp trunk/qterm-qt4/src/qtermframe.cpp trunk/qterm-qt4/src/qtermglobal.cpp trunk/qterm-qt4/src/qtermparam.cpp trunk/qterm-qt4/src/qtermscreen.cpp trunk/qterm-qt4/src/qtermwindow.cpp trunk/qterm-qt4/src/quickdialog.cpp Modified: trunk/qterm-qt4/src/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/CMakeLists.txt 2010-07-10 18:30:51 UTC (rev 1204) +++ trunk/qterm-qt4/src/CMakeLists.txt 2010-07-15 13:13:53 UTC (rev 1205) @@ -226,6 +226,7 @@ ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} + ${QT_QTXML_LIBRARY} ${optionalLibs}) if(WIN32 AND MINGW) target_link_libraries(qterm ${win32Libs}) Modified: trunk/qterm-qt4/src/addrdialog.cpp =================================================================== --- trunk/qterm-qt4/src/addrdialog.cpp 2010-07-10 18:30:51 UTC (rev 1204) +++ trunk/qterm-qt4/src/addrdialog.cpp 2010-07-15 13:13:53 UTC (rev 1205) @@ -147,7 +147,7 @@ updateData(true); if (nLastItem != -1) { Global::instance()->saveAddress(nLastItem, param); - ui.nameListWidget->item(nLastItem)->setText(param.m_strName); + ui.nameListWidget->item(nLastItem)->setText(param.m_mapParam["name"].toString()); ui.nameListWidget->setCurrentRow(item); return; } @@ -184,7 +184,7 @@ Global::instance()->saveAddress(index + 1, param); // insert it to the listbox - ui.nameListWidget->insertItem(index + 1, param.m_strName); + ui.nameListWidget->insertItem(index + 1, param.m_mapParam["name"].toString()); ui.nameListWidget->setItemSelected(ui.nameListWidget->item(index + 1), true); } void addrDialog::onDelete() @@ -225,7 +225,7 @@ if (!bPartial) { Global::instance()->saveAddress(ui.nameListWidget->currentRow(), param); if (ui.nameListWidget->count() != 0) - ui.nameListWidget->item(ui.nameListWidget->currentRow())->setText(param.m_strName); + ui.nameListWidget->item(ui.nameListWidget->currentRow())->setText(param.m_mapParam["name"].toString()); } else done(1); } @@ -368,173 +368,168 @@ bool addrDialog::isChanged() { - return(param.m_strName != ui.nameLineEdit->text() || - param.m_strAddr != ui.addrLineEdit->text() || - param.m_uPort != ui.portSpinBox->value() || - param.m_nHostType != ui.hostTypeComboBox->currentIndex() || - param.m_bAutoLogin != ui.autoLoginCheckBox->isChecked() || - param.m_strPreLogin != ui.preloginLineEdit->text() || - param.m_strUser != ui.userLineEdit->text() || - param.m_strPasswd != ui.passwdLineEdit->text() || - param.m_strPostLogin != ui.postloginLineEdit->text() || - param.m_BBSCode != ui.bbscodeComboBox->currentText() || - param.m_nDispCode != ui.displaycodeComboBox->currentIndex() || - param.m_bAutoFont != ui.autofontCheckBox->isChecked() || - param.m_bAlwaysHighlight != ui.highlightCheckBox->isChecked() || - param.m_bAnsiColor != ui.ansicolorCheckBox->isChecked() || - param.m_strASCIIFontName != strASCIIFontName || - param.m_strGeneralFontName != strGeneralFontName|| - param.m_nFontSize != nFontSize || - param.m_strSchemeFile != strSchemeFile || - param.m_strKeyboardProfile != strKeyboardProfile|| - param.m_strTerm != ui.termtypeLineEdit->text() || - param.m_nCol != ui.columnSpinBox->value() || - param.m_nRow != ui.rowSpinBox->value() || - param.m_nScrollLines != ui.scrollSpinBox->value() || - param.m_nCursorType != ui.cursorTypeComboBox->currentIndex() || - param.m_strEscape != ui.escapeLineEdit->text() || - param.m_nProxyType != ui.proxytypeComboBox->currentIndex() || - param.m_strProxyHost != ui.proxyaddrLineEdit->text() || - param.m_uProxyPort != ui.proxyportSpinBox->value() || - param.m_bAuth != ui.authCheckBox->isChecked() || - param.m_strProxyUser != ui.proxyuserLineEdit->text() || - param.m_strProxyPasswd != ui.proxypasswdLineEdit->text() || - param.m_nProtocolType != ui.protocolComboBox->currentIndex() || - param.m_nMaxIdle != ui.idletimeLineEdit->text().toInt() || - param.m_strAntiString != ui.antiLineEdit->text() || - param.m_strReplyKey != ui.replykeyLineEdit->text() || - param.m_strAutoReply != ui.replyLineEdit->text()) || - param.m_bAutoReply != ui.replyCheckBox->isChecked() || - param.m_bReconnect != ui.reconnectCheckBox->isChecked() || - param.m_nReconnectInterval != ui.reconnectLineEdit->text().toInt() || -// param.m_nRetry != ui.retryLineEdit->text().toInt() || - param.m_bLoadScript != ui.scriptCheckBox->isChecked() || - param.m_strScriptFile != ui.scriptLineEdit->text() || - param.m_nMenuType != ui.menuTypeComboBox->currentIndex() || - param.m_clrMenu != clrMenu; + return(param.m_mapParam["name"].toString() != ui.nameLineEdit->text() || + param.m_mapParam["addr"].toString() != ui.addrLineEdit->text() || + param.m_mapParam["port"].toInt() != ui.portSpinBox->value() || + param.m_mapParam["hosttype"].toInt() != ui.hostTypeComboBox->currentIndex() || + param.m_mapParam["autologin"].toBool() != ui.autoLoginCheckBox->isChecked() || + param.m_mapParam["prelogin"].toString() != ui.preloginLineEdit->text() || + param.m_mapParam["user"].toString() != ui.userLineEdit->text() || + param.m_mapParam["password"].toString() != ui.passwdLineEdit->text() || + param.m_mapParam["postlogin"].toString() != ui.postloginLineEdit->text() || + param.m_mapParam["bbscode"].toString() != ui.bbscodeComboBox->currentText() || + param.m_mapParam["displaycode"].toInt() != ui.displaycodeComboBox->currentIndex() || + param.m_mapParam["autofont"].toBool() != ui.autofontCheckBox->isChecked() || + param.m_mapParam["alwayshighlight"].toBool() != ui.highlightCheckBox->isChecked() || + param.m_mapParam["ansicolor"].toBool() != ui.ansicolorCheckBox->isChecked() || + param.m_mapParam["asciifont"].toString() != strASCIIFontName || + param.m_mapParam["generalfont"].toString() != strGeneralFontName|| + param.m_mapParam["fontsize"].toInt() != nFontSize || + param.m_mapParam["schemefile"].toString() != strSchemeFile || + param.m_mapParam["keyboardprofile"].toString() != strKeyboardProfile|| + param.m_mapParam["termtype"].toString() != ui.termtypeLineEdit->text() || + param.m_mapParam["column"].toInt() != ui.columnSpinBox->value() || + param.m_mapParam["row"].toInt() != ui.rowSpinBox->value() || + param.m_mapParam["scroll"].toInt() != ui.scrollSpinBox->value() || + param.m_mapParam["cursor"].toInt() != ui.cursorTypeComboBox->currentIndex() || + param.m_mapParam["escape"].toString() != ui.escapeLineEdit->text() || + param.m_mapParam["proxytype"].toInt() != ui.proxytypeComboBox->currentIndex() || + param.m_mapParam["proxyaddr"].toString() != ui.proxyaddrLineEdit->text() || + param.m_mapParam["proxyport"].toInt() != ui.proxyportSpinBox->value() || + param.m_mapParam["proxyauth"].toBool() != ui.authCheckBox->isChecked() || + param.m_mapParam["proxyuser"].toString() != ui.proxyuserLineEdit->text() || + param.m_mapParam["proxypassword"].toString() != ui.proxypasswdLineEdit->text() || + param.m_mapParam["protocol"].toInt() != ui.protocolComboBox->currentIndex() || + param.m_mapParam["maxidle"].toInt() != ui.idletimeLineEdit->text().toInt() || + param.m_mapParam["antiidlestring"].toString() != ui.antiLineEdit->text() || + param.m_mapParam["replykey"].toString() != ui.replykeyLineEdit->text() || + param.m_mapParam["autoreply"].toString() != ui.replyLineEdit->text()) || + param.m_mapParam["bautoreply"].toBool() != ui.replyCheckBox->isChecked() || + param.m_mapParam["reconnect"].toBool() != ui.reconnectCheckBox->isChecked() || + param.m_mapParam["interval"].toInt() != ui.reconnectLineEdit->text().toInt() || +// param.m_mapParam["retrytimes"].toInt() != ui.retryLineEdit->text().toInt() || + param.m_mapParam["loadscript"].toBool() != ui.scriptCheckBox->isChecked() || + param.m_mapParam["scriptfile"].toString() != ui.scriptLineEdit->text() || + param.m_mapParam["menutype"].toInt() != ui.menuTypeComboBox->currentIndex() || + param.m_mapParam["menucolor"] != clrMenu; } void addrDialog::updateData(bool save) { if (save) { // from display to param - param.m_strName = ui.nameLineEdit->text(); - param.m_strAddr = ui.addrLineEdit->text(); - param.m_uPort = ui.portSpinBox->value(); - param.m_nHostType = ui.hostTypeComboBox->currentIndex(); - param.m_bAutoLogin = ui.autoLoginCheckBox->isChecked(); - param.m_strPreLogin = ui.preloginLineEdit->text(); - param.m_strUser = ui.userLineEdit->text(); - param.m_strPasswd = ui.passwdLineEdit->text(); - param.m_strPostLogin = ui.postloginLineEdit->text(); - param.m_BBSCode = ui.bbscodeComboBox->currentText(); - param.m_nDispCode = ui.displaycodeComboBox->currentIndex(); - param.m_bAutoFont = ui.autofontCheckBox->isChecked(); - param.m_bAlwaysHighlight = ui.highlightCheckBox->isChecked(); - param.m_bAnsiColor = ui.ansicolorCheckBox->isChecked(); - param.m_strASCIIFontName = strASCIIFontName; - param.m_strGeneralFontName = strGeneralFontName; - param.m_nFontSize = nFontSize; - param.m_strSchemeFile = strSchemeFile; - param.m_strKeyboardProfile = strKeyboardProfile; - param.m_strTerm = ui.termtypeLineEdit->text(); - param.m_nCol = ui.columnSpinBox->value(); - param.m_nRow = ui.rowSpinBox->value(); - param.m_nScrollLines = ui.scrollSpinBox->value(); - param.m_nCursorType = ui.cursorTypeComboBox->currentIndex(); - param.m_strEscape = ui.escapeLineEdit->text(); - param.m_nProxyType = ui.proxytypeComboBox->currentIndex(); - param.m_strProxyHost = ui.proxyaddrLineEdit->text(); - param.m_uProxyPort = ui.proxyportSpinBox->value(); - param.m_bAuth = ui.authCheckBox->isChecked(); - param.m_strProxyUser = ui.proxyuserLineEdit->text(); - param.m_strProxyPasswd = ui.proxypasswdLineEdit->text(); - param.m_nProtocolType = ui.protocolComboBox->currentIndex(); - param.m_nMaxIdle = ui.idletimeLineEdit->text().toInt(); - param.m_strReplyKey = ui.replykeyLineEdit->text(); - if (param.m_strReplyKey.isNull()) + param.m_mapParam["name"] = ui.nameLineEdit->text(); + param.m_mapParam["addr"] = ui.addrLineEdit->text(); + param.m_mapParam["port"] = ui.portSpinBox->value(); + param.m_mapParam["hosttype"] = ui.hostTypeComboBox->currentIndex(); + param.m_mapParam["autologin"] = ui.autoLoginCheckBox->isChecked(); + param.m_mapParam["prelogin"] = ui.preloginLineEdit->text(); + param.m_mapParam["user"] = ui.userLineEdit->text(); + param.m_mapParam["password"] = ui.passwdLineEdit->text(); + param.m_mapParam["postlogin"] = ui.postloginLineEdit->text(); + param.m_mapParam["bbscode"] = ui.bbscodeComboBox->currentText(); + param.m_mapParam["displaycode"] = ui.displaycodeComboBox->currentIndex(); + param.m_mapParam["autofont"] = ui.autofontCheckBox->isChecked(); + param.m_mapParam["alwayshighlight"] = ui.highlightCheckBox->isChecked(); + param.m_mapParam["ansicolor"] = ui.ansicolorCheckBox->isChecked(); + param.m_mapParam["asciifont"] = strASCIIFontName; + param.m_mapParam["generalfont"] = strGeneralFontName; + param.m_mapParam["fontsize"] = nFontSize; + param.m_mapParam["schemefile"] = strSchemeFile; + param.m_mapParam["keyboardprofile"] = strKeyboardProfile; + param.m_mapParam["termtype"] = ui.termtypeLineEdit->text(); + param.m_mapParam["column"] = ui.columnSpinBox->value(); + param.m_mapParam["row"] = ui.rowSpinBox->value(); + param.m_mapParam["scroll"] = ui.scrollSpinBox->value(); + param.m_mapParam["cursor"] = ui.cursorTypeComboBox->currentIndex(); + param.m_mapParam["escape"] = ui.escapeLineEdit->text(); + param.m_mapParam["proxytype"] = ui.proxytypeComboBox->currentIndex(); + param.m_mapParam["proxyhost"] = ui.proxyaddrLineEdit->text(); + param.m_mapParam["proxyport"] = ui.proxyportSpinBox->value(); + param.m_mapParam["proxyauth"] = ui.authCheckBox->isChecked(); + param.m_mapParam["proxyuser"] = ui.proxyuserLineEdit->text(); + param.m_mapParam["proxypassword"] = ui.proxypasswdLineEdit->text(); + param.m_mapParam["protocol"] = ui.protocolComboBox->currentIndex(); + param.m_mapParam["maxidle"] = ui.idletimeLineEdit->text().toInt(); + param.m_mapParam["replykey"] = ui.replykeyLineEdit->text(); + if (param.m_mapParam["replykey"].toString().isNull()) qDebug("saving null"); - param.m_strAntiString = ui.antiLineEdit->text(); - param.m_bAutoReply = ui.replyCheckBox->isChecked(); - param.m_strAutoReply = ui.replyLineEdit->text(); - param.m_bReconnect = ui.reconnectCheckBox->isChecked(); - param.m_nReconnectInterval = ui.reconnectLineEdit->text().toInt(); -// param.m_nRetry = ui.retryLineEdit->text().toInt(); - param.m_bLoadScript = ui.scriptCheckBox->isChecked(); - param.m_strScriptFile = ui.scriptLineEdit->text(); - param.m_nMenuType = ui.menuTypeComboBox->currentIndex(); - param.m_clrMenu = clrMenu; + param.m_mapParam["antiidlestring"] = ui.antiLineEdit->text(); + param.m_mapParam["bautoreply"] = ui.replyCheckBox->isChecked(); + param.m_mapParam["autoreply"] = ui.replyLineEdit->text(); + param.m_mapParam["reconnect"] = ui.reconnectCheckBox->isChecked(); + param.m_mapParam["interval"] = ui.reconnectLineEdit->text().toInt(); +// param.m_mapParam["retrytimes"] = ui.retryLineEdit->text().toInt(); + param.m_mapParam["loadscript"] = ui.scriptCheckBox->isChecked(); + param.m_mapParam["scriptfile"] = ui.scriptLineEdit->text(); + param.m_mapParam["menutype"] = ui.menuTypeComboBox->currentIndex(); + param.m_mapParam["menucolor"] = clrMenu; } else { // from param to display disconnect(ui.protocolComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onProtocol(int))); QString strTmp; - ui.nameLineEdit->setText(param.m_strName); - ui.addrLineEdit->setText(param.m_strAddr); - strTmp.setNum(param.m_uPort); - ui.portSpinBox->setValue(strTmp.toUInt()); - ui.hostTypeComboBox->setCurrentIndex(param.m_nHostType); - ui.autoLoginCheckBox->setChecked(param.m_bAutoLogin); - ui.preloginLineEdit->setEnabled(param.m_bAutoLogin); - ui.userLineEdit->setEnabled(param.m_bAutoLogin); - ui.passwdLineEdit->setEnabled(param.m_bAutoLogin); - ui.postloginLineEdit->setEnabled(param.m_bAutoLogin); - ui.preloginLineEdit->setText(param.m_strPreLogin); - ui.userLineEdit->setText(param.m_strUser); - ui.passwdLineEdit->setText(param.m_strPasswd); - ui.postloginLineEdit->setText(param.m_strPostLogin); - ui.bbscodeComboBox->setCurrentIndex(ui.bbscodeComboBox->findText(param.m_BBSCode)); - ui.displaycodeComboBox->setCurrentIndex(param.m_nDispCode); - ui.autofontCheckBox->setChecked(param.m_bAutoFont); - ui.highlightCheckBox->setChecked(param.m_bAlwaysHighlight); - ui.ansicolorCheckBox->setChecked(param.m_bAnsiColor); - strASCIIFontName = param.m_strASCIIFontName; + ui.nameLineEdit->setText(param.m_mapParam["name"].toString()); + ui.addrLineEdit->setText(param.m_mapParam["addr"].toString()); + ui.portSpinBox->setValue(param.m_mapParam["port"].toInt()); + ui.hostTypeComboBox->setCurrentIndex(param.m_mapParam["hosttype"].toInt()); + ui.autoLoginCheckBox->setChecked(param.m_mapParam["autologin"].toBool()); + ui.preloginLineEdit->setEnabled(param.m_mapParam["autologin"].toBool()); + ui.userLineEdit->setEnabled(param.m_mapParam["autologin"].toBool()); + ui.passwdLineEdit->setEnabled(param.m_mapParam["autologin"].toBool()); + ui.postloginLineEdit->setEnabled(param.m_mapParam["autologin"].toBool()); + ui.preloginLineEdit->setText(param.m_mapParam["prelogin"].toString()); + ui.userLineEdit->setText(param.m_mapParam["user"].toString()); + ui.passwdLineEdit->setText(param.m_mapParam["password"].toString()); + ui.postloginLineEdit->setText(param.m_mapParam["postlogin"].toString()); + ui.bbscodeComboBox->setCurrentIndex(ui.bbscodeComboBox->findText(param.m_mapParam["bbscode"].toString())); + ui.displaycodeComboBox->setCurrentIndex(param.m_mapParam["displaycode"].toInt()); + ui.autofontCheckBox->setChecked(param.m_mapParam["autofont"].toBool()); + ui.highlightCheckBox->setChecked(param.m_mapParam["alwayshighlight"].toBool()); + ui.ansicolorCheckBox->setChecked(param.m_mapParam["ansicolor"].toBool()); + strASCIIFontName = param.m_mapParam["asciifont"].toString(); ui.asciiFontComboBox->setCurrentFont(QFont(strASCIIFontName)); - strGeneralFontName = param.m_strGeneralFontName; + strGeneralFontName = param.m_mapParam["generalfont"].toString(); ui.generalFontComboBox->setCurrentFont(QFont(strGeneralFontName)); - nFontSize = param.m_nFontSize ; + nFontSize = param.m_mapParam["fontsize"].toInt(); ui.fontSizeSpinBox->setValue(nFontSize); - strSchemeFile = param.m_strSchemeFile; + strSchemeFile = param.m_mapParam["schemefile"].toString(); ui.schemeComboBox->setCurrentIndex(schemeFileList.indexOf(strSchemeFile)); - strKeyboardProfile = param.m_strKeyboardProfile; + strKeyboardProfile = param.m_mapParam["keyboardprofile"].toString(); ui.keytypeComboBox->setCurrentIndex(keyboardProfileList.indexOf(strKeyboardProfile)); - ui.termtypeLineEdit->setText(param.m_strTerm); - ui.columnSpinBox->setValue(param.m_nCol); - ui.rowSpinBox->setValue(param.m_nRow); - ui.scrollSpinBox->setValue(param.m_nScrollLines); - ui.cursorTypeComboBox->setCurrentIndex(param.m_nCursorType); - ui.escapeLineEdit->setText(param.m_strEscape); - ui.proxytypeComboBox->setCurrentIndex(param.m_nProxyType); - ui.proxyaddrLineEdit->setText(param.m_strProxyHost); - strTmp.setNum(param.m_uProxyPort); - ui.proxyportSpinBox->setValue(strTmp.toUInt()); - ui.authCheckBox->setChecked(param.m_bAuth); - ui.proxyuserLineEdit->setEnabled(param.m_bAuth); - ui.proxypasswdLineEdit->setEnabled(param.m_bAuth); - ui.proxyuserLineEdit->setText(param.m_strProxyUser); - ui.proxypasswdLineEdit->setText(param.m_strProxyPasswd); - ui.protocolComboBox->setCurrentIndex(param.m_nProtocolType); - strTmp.setNum(param.m_nMaxIdle); - ui.idletimeLineEdit->setText(strTmp); - ui.replykeyLineEdit->setText(param.m_strReplyKey); - ui.antiLineEdit->setText(param.m_strAntiString); - ui.replyCheckBox->setChecked(param.m_bAutoReply); - ui.replyLineEdit->setEnabled(param.m_bAutoReply); - ui.replyLineEdit->setText(param.m_strAutoReply); - ui.reconnectCheckBox->setChecked(param.m_bReconnect); - ui.reconnectLineEdit->setEnabled(param.m_bReconnect); -// ui.retryLineEdit->setEnabled(param.m_bReconnect); - strTmp.setNum(param.m_nReconnectInterval); - ui.reconnectLineEdit->setText(strTmp); - strTmp.setNum(param.m_nRetry); -// ui.retryLineEdit->setText(strTmp); - ui.scriptCheckBox->setChecked(param.m_bLoadScript); - ui.scriptLineEdit->setEnabled(param.m_bLoadScript); - ui.scriptPushButton->setEnabled(param.m_bLoadScript); - ui.scriptLineEdit->setText(param.m_strScriptFile); - ui.menuTypeComboBox->setCurrentIndex(param.m_nMenuType); + ui.termtypeLineEdit->setText(param.m_mapParam["termtype"].toString()); + ui.columnSpinBox->setValue(param.m_mapParam["column"].toInt()); + ui.rowSpinBox->setValue(param.m_mapParam["row"].toInt()); + ui.scrollSpinBox->setValue(param.m_mapParam["scroll"].toInt()); + ui.cursorTypeComboBox->setCurrentIndex(param.m_mapParam["cursor"].toInt()); + ui.escapeLineEdit->setText(param.m_mapParam["escape"].toString()); + ui.proxytypeComboBox->setCurrentIndex(param.m_mapParam["proxytype"].toInt()); + ui.proxyaddrLineEdit->setText(param.m_mapParam["proxyaddr"].toString()); + ui.proxyportSpinBox->setValue(param.m_mapParam["proxyport"].toInt()); + ui.authCheckBox->setChecked(param.m_mapParam["proxyauth"].toBool()); + ui.proxyuserLineEdit->setEnabled(param.m_mapParam["proxyauth"].toBool()); + ui.proxypasswdLineEdit->setEnabled(param.m_mapParam["proxyauth"].toBool()); + ui.proxyuserLineEdit->setText(param.m_mapParam["proxyuser"].toString()); + ui.proxypasswdLineEdit->setText(param.m_mapParam["proxypassword"].toString()); + ui.protocolComboBox->setCurrentIndex(param.m_mapParam["protocol"].toInt()); + ui.idletimeLineEdit->setText(param.m_mapParam["maxidle"].toString()); + ui.replykeyLineEdit->setText(param.m_mapParam["replykey"].toString()); + ui.antiLineEdit->setText(param.m_mapParam["antiidlestring"].toString()); + ui.replyCheckBox->setChecked(param.m_mapParam["bautoreply"].toBool()); + ui.replyLineEdit->setEnabled(param.m_mapParam["bautoreply"].toBool()); + ui.replyLineEdit->setText(param.m_mapParam["autoreply"].toString()); + ui.reconnectCheckBox->setChecked(param.m_mapParam["reconnect"].toBool()); + ui.reconnectLineEdit->setEnabled(param.m_mapParam["reconnect"].toBool()); +// ui.retryLineEdit->setEnabled(param.m_mapParam["reconnect"].toBool()); + ui.reconnectLineEdit->setText(param.m_mapParam["interval"].toString()); +// ui.retryLineEdit->setText(param.m_mapParam["retrytimes"].toString()); + ui.scriptCheckBox->setChecked(param.m_mapParam["loadscript"].toBool()); + ui.scriptLineEdit->setEnabled(param.m_mapParam["loadscript"].toBool()); + ui.scriptPushButton->setEnabled(param.m_mapParam["loadscript"].toBool()); + ui.scriptLineEdit->setText(param.m_mapParam["scriptfile"].toString()); + ui.menuTypeComboBox->setCurrentIndex(param.m_mapParam["menutype"].toInt()); //ui.menuGroup->setButton(param.m_nMenuType); //QRadioButton * rbMenu = qobject_cast<QRadioButton*>(bgMenu.button(param.m_nMenuType)); //rbMenu->setChecked(true); - clrMenu = param.m_clrMenu; + clrMenu = param.m_mapParam["menucolor"].toString(); connect(ui.protocolComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onProtocol(int))); } } Modified: trunk/qterm-qt4/src/main.cpp =================================================================== --- trunk/qterm-qt4/src/main.cpp 2010-07-10 18:30:51 UTC (rev 1204) +++ trunk/qterm-qt4/src/main.cpp 2010-07-15 13:13:53 UTC (rev 1205) @@ -144,6 +144,7 @@ return -1; } + // Registrate the new codec UAOCodec hackCodec; Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2010-07-10 18:30:51 UTC (rev 1204) +++ trunk/qterm-qt4/src/qtermframe.cpp 2010-07-15 13:13:53 UTC (rev 1205) @@ -306,7 +306,7 @@ void Frame::newWindow(const Param& param, int index) { Window * window = new Window(this, param, index, mdiArea, 0); - window->setWindowTitle(param.m_strName); + window->setWindowTitle(param.m_mapParam["name"].toString()); window->setWindowIcon(QIcon(":/pic/tabpad.png")); window->setAttribute(Qt::WA_DeleteOnClose); window->showMaximized(); Modified: trunk/qterm-qt4/src/qtermglobal.cpp =================================================================== --- trunk/qterm-qt4/src/qtermglobal.cpp 2010-07-10 18:30:51 UTC (rev 1204) +++ trunk/qterm-qt4/src/qtermglobal.cpp 2010-07-15 13:13:53 UTC (rev 1205) @@ -29,6 +29,9 @@ #include <QtGui/QDesktopServices> #include <QtGui/QFileDialog> #include <QtGui/QMessageBox> +#include <QtXml/QDomDocument> +#include <QtCore/QUuid> +#include <QtCore/QTextStream> #if defined(_OS_WIN32_) || defined(Q_OS_WIN32) #include <windows.h> @@ -59,7 +62,7 @@ } Global::Global() - : m_fileCfg("./qterm.cfg"), m_addrCfg("./address.cfg"), + : m_fileCfg("./qterm.cfg"), m_addrCfg("./address.cfg"), m_addrXml("./address.xml"), m_pathLib("./"), m_pathCfg("./"), m_windowState(), m_status(INIT_OK), m_style(), m_fullScreen(false), m_language(Global::English) @@ -128,6 +131,40 @@ } } +QMap<QString,QString> Global::getFavoriteSiteList() +{ + QMap<QString,QString> listSite; + // import xml address book + QDomDocument doc; + QFile file(m_addrXml); + if (file.open(QIODevice::ReadOnly)) { + if (doc.setContent(&file)) { + QDomElement favorite; + QDomNodeList nodeList = doc.elementsByTagName("folder"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + if (node.attribute("name") == "favorite") { + favorite = node; + break; + } + } + QStringList listUuid; + nodeList = favorite.elementsByTagName("addsite"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + listUuid << node.attribute("uuid"); + } + nodeList = doc.elementsByTagName("site"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + if (listUuid.contains(node.attribute("uuid"))) + listSite[node.attribute("uuid")] = node.attribute("name"); + } + } + } + file.close(); + return listSite; +} QStringList Global::loadNameList() { QStringList listName; @@ -159,94 +196,19 @@ strTmp = m_address->getItemValue("bbs list", "num").toString(); if (n >= strTmp.toInt()) return false; - param.m_strName = m_address->getItemValue(strSection, "name").toString(); - param.m_strAddr = m_address->getItemValue(strSection, "addr").toString(); - strTmp = m_address->getItemValue(strSection, "port").toString(); - param.m_uPort = strTmp.toUShort(); - strTmp = m_address->getItemValue(strSection, "hosttype").toString(); - param.m_nHostType = strTmp.toInt(); - strTmp = m_address->getItemValue(strSection, "autologin").toString(); - param.m_bAutoLogin = (strTmp != "0"); - param.m_strPreLogin = m_address->getItemValue(strSection, "prelogin").toString(); - param.m_strUser = m_address->getItemValue(strSection, "user").toString(); -#ifdef KWALLET_ENABLED - if (m_wallet != NULL) { - m_wallet->open(); - param.m_strPasswd = m_wallet->readPassword(param.m_strName, param.m_strUser); - } else -#endif // KWALLET_ENABLED - param.m_strPasswd = m_address->getItemValue(strSection, "password").toString(); - param.m_strPostLogin = m_address->getItemValue(strSection, "postlogin").toString(); - strTmp = m_address->getItemValue(strSection, "bbscode").toString(); - param.m_BBSCode = strTmp; - strTmp = m_address->getItemValue(strSection, "displaycode").toString(); - param.m_nDispCode = strTmp.toInt(); - strTmp = m_address->getItemValue(strSection, "autofont").toString(); - param.m_bAutoFont = (strTmp != "0"); - strTmp = m_address->getItemValue(strSection, "alwayshighlight").toString(); - param.m_bAlwaysHighlight = (strTmp != "0"); - strTmp = m_address->getItemValue(strSection, "ansicolor").toString(); - param.m_bAnsiColor = (strTmp != "0"); - param.m_strASCIIFontName = m_address->getItemValue(strSection, "asciifont").toString(); - param.m_strGeneralFontName = m_address->getItemValue(strSection, "generalfont").toString(); - strTmp = m_address->getItemValue(strSection, "fontsize").toString(); - param.m_nFontSize = strTmp.toInt(); - param.m_strSchemeFile = m_address->getItemValue(strSection, "schemefile").toString(); - param.m_strKeyboardProfile = m_address->getItemValue(strSection, "keyboardprofile").toString(); + foreach(QString key,param.m_mapParam.keys()) { + #ifdef KWALLET_ENABLED + if (key == "password" && m_wallet != NULL) { + m_wallet->open(); + param.m_mapParam["password"] = m_wallet->readPassword( + param.m_mapParam["name"], + param.m_mapParam["user"]); + } else + #endif // KWALLET_ENABLED + param.m_mapParam[key] = m_address->getItemValue(strSection,key); + } - param.m_strTerm = m_address->getItemValue(strSection, "termtype").toString(); - strTmp = m_address->getItemValue(strSection, "column").toString(); - param.m_nCol = strTmp.toInt(); - strTmp = m_address->getItemValue(strSection, "row").toString(); - param.m_nRow = strTmp.toInt(); - strTmp = m_address->getItemValue(strSection, "scroll").toString(); - param.m_nScrollLines = strTmp.toInt(); - strTmp = m_address->getItemValue(strSection, "cursor").toString(); - param.m_nCursorType = strTmp.toInt(); - param.m_strEscape = m_address->getItemValue(strSection, "escape").toString(); - - strTmp = m_address->getItemValue(strSection, "proxytype").toString(); - param.m_nProxyType = strTmp.toInt(); - strTmp = m_address->getItemValue(strSection, "proxyauth").toString(); - param.m_bAuth = (strTmp != "0"); - param.m_strProxyHost = m_address->getItemValue(strSection, "proxyaddr").toString(); - strTmp = m_address->getItemValue(strSection, "proxyport").toString(); - param.m_uProxyPort = strTmp.toInt(); - param.m_strProxyUser = m_address->getItemValue(strSection, "proxyuser").toString(); - param.m_strProxyPasswd = m_address->getItemValue(strSection, "proxypassword").toString(); - strTmp = m_address->getItemValue(strSection, "protocol").toString(); - param.m_nProtocolType = strTmp.toInt(); - - strTmp = m_address->getItemValue(strSection, "maxidle").toString(); - param.m_nMaxIdle = strTmp.toInt(); - param.m_strReplyKey = m_address->getItemValue(strSection, "replykey").toString(); - if (param.m_strReplyKey.isNull()) - qDebug("loading null\n"); - - param.m_strAntiString = m_address->getItemValue(strSection, "antiidlestring").toString(); - param.m_strAutoReply = m_address->getItemValue(strSection, "autoreply").toString(); - strTmp = m_address->getItemValue(strSection, "bautoreply").toString(); - param.m_bAutoReply = (strTmp != "0"); - - strTmp = m_address->getItemValue(strSection, "reconnect").toString(); - param.m_bReconnect = (strTmp != "0"); - strTmp = m_address->getItemValue(strSection, "interval").toString(); - param.m_nReconnectInterval = strTmp.toInt(); - strTmp = m_address->getItemValue(strSection, "retrytimes").toString(); - param.m_nRetry = strTmp.toInt(); - - strTmp = m_address->getItemValue(strSection, "loadscript").toString(); - param.m_bLoadScript = (strTmp != "0"); - param.m_strScriptFile = m_address->getItemValue(strSection, "scriptfile").toString(); - if (param.m_strScriptFile.isEmpty()) { - param.m_bLoadScript = false; - } - - strTmp = m_address->getItemValue(strSection, "menutype").toString(); - param.m_nMenuType = strTmp.toInt(); - param.m_clrMenu.setNamedColor(m_address->getItemValue(strSection, "menucolor").toString()); - return true; } @@ -258,79 +220,18 @@ else strSection.sprintf("bbs %d", n); - m_address->setItemValue(strSection, "name", param.m_strName); - m_address->setItemValue(strSection, "addr", param.m_strAddr); - strTmp.setNum(param.m_uPort); - m_address->setItemValue(strSection, "port", strTmp); - strTmp.setNum(param.m_nHostType); - m_address->setItemValue(strSection, "hosttype", strTmp); - m_address->setItemValue(strSection, "autologin", param.m_bAutoLogin ? "1" : "0"); - m_address->setItemValue(strSection, "prelogin", param.m_strPreLogin); - m_address->setItemValue(strSection, "user", param.m_strUser); - -#ifdef KWALLET_ENABLED - if (m_wallet != NULL) { + foreach(QString key,param.m_mapParam.keys()) { + #ifdef KWALLET_ENABLED + if (key == "password" && m_wallet != NULL) { m_wallet->open(); - m_wallet->writePassword(param.m_strName, param.m_strUser, param.m_strPasswd); + m_wallet->writePassword( + param.m_mapParam["name"], + param.m_mapParam["user"], + param.m_mapParam["password"]); } else -#endif // KWALLET_ENABLED - m_address->setItemValue(strSection, "password", param.m_strPasswd); - m_address->setItemValue(strSection, "postlogin", param.m_strPostLogin); - - strTmp=param.m_BBSCode; - m_address->setItemValue(strSection, "bbscode", strTmp); - strTmp.setNum(param.m_nDispCode); - m_address->setItemValue(strSection, "displaycode", strTmp); - m_address->setItemValue(strSection, "autofont", param.m_bAutoFont ? "1" : "0"); - m_address->setItemValue(strSection, "alwayshighlight", param.m_bAlwaysHighlight ? "1" : "0"); - m_address->setItemValue(strSection, "ansicolor", param.m_bAnsiColor ? "1" : "0"); - m_address->setItemValue(strSection, "asciifont", param.m_strASCIIFontName); - m_address->setItemValue(strSection, "generalfont", param.m_strGeneralFontName); - strTmp.setNum(param.m_nFontSize); - m_address->setItemValue(strSection, "fontsize", strTmp); - m_address->setItemValue(strSection, "schemefile", param.m_strSchemeFile); - m_address->setItemValue(strSection, "keyboardprofile", param.m_strKeyboardProfile); - - m_address->setItemValue(strSection, "termtype", param.m_strTerm); - strTmp.setNum(param.m_nCol); - m_address->setItemValue(strSection, "column", strTmp); - strTmp.setNum(param.m_nRow); - m_address->setItemValue(strSection, "row", strTmp); - strTmp.setNum(param.m_nScrollLines); - m_address->setItemValue(strSection, "scroll", strTmp); - strTmp.setNum(param.m_nCursorType); - m_address->setItemValue(strSection, "cursor", strTmp); - m_address->setItemValue(strSection, "escape", param.m_strEscape); - - strTmp.setNum(param.m_nProxyType); - m_address->setItemValue(strSection, "proxytype", strTmp); - m_address->setItemValue(strSection, "proxyauth", param.m_bAuth ? "1" : "0"); - m_address->setItemValue(strSection, "proxyaddr", param.m_strProxyHost); - strTmp.setNum(param.m_uProxyPort); - m_address->setItemValue(strSection, "proxyport", strTmp); - m_address->setItemValue(strSection, "proxyuser", param.m_strProxyUser); - m_address->setItemValue(strSection, "proxypassword", param.m_strProxyPasswd); - strTmp.setNum(param.m_nProtocolType); - m_address->setItemValue(strSection, "protocol", strTmp); - - strTmp.setNum(param.m_nMaxIdle); - m_address->setItemValue(strSection, "maxidle", strTmp); - m_address->setItemValue(strSection, "replykey", param.m_strReplyKey); - m_address->setItemValue(strSection, "antiidlestring", param.m_strAntiString); - m_address->setItemValue(strSection, "bautoreply", param.m_bAutoReply ? "1" : "0"); - m_address->setItemValue(strSection, "autoreply", param.m_strAutoReply); - m_address->setItemValue(strSection, "reconnect", param.m_bReconnect ? "1" : "0"); - strTmp.setNum(param.m_nReconnectInterval); - m_address->setItemValue(strSection, "interval", strTmp); - strTmp.setNum(param.m_nRetry); - m_address->setItemValue(strSection, "retrytimes", strTmp); - - m_address->setItemValue(strSection, "loadscript", param.m_bLoadScript ? "1" : "0"); - m_address->setItemValue(strSection, "scriptfile", param.m_strScriptFile); - - strTmp.setNum(param.m_nMenuType); - m_address->setItemValue(strSection, "menutype", strTmp); - m_address->setItemValue(strSection, "menucolor", param.m_clrMenu.name()); + #endif + m_address->setItemValue(strSection, key, param.m_mapParam[key]); + } m_address->save(); } @@ -355,6 +256,84 @@ m_address->deleteSection(strSection); } +bool Global::convertAddressBook2XML() +{ + QDir dir; + if (dir.exists(m_addrXml)) + return true; + else { + if (!dir.exists(m_addrCfg)) + return createLocalFile(m_addrXml, m_pathLib + "address.xml"); + } + // import xml address book + QDomDocument doc; + QFile file(m_addrXml); + if (!file.open(QIODevice::ReadOnly)) + return false; + if (!doc.setContent(&file)) { + file.close(); + return false; + } + file.close(); + + // Combine cfg address book + m_address = new Config(m_addrCfg); + int num = m_address->getItemValue("bbs list", "num").toInt(); + + //QDomProcessingInstruction instr = + // doc.createProcessingInstruction("xml","version=\"1.0\" encoding=\"UTF-8\""); + //doc.appendChild(instr); + + //QDomElement addresses = doc.createElement("addresses"); + //doc.appendChild(addresses); + + //QDomElement favorite = doc.createElement("folder"); + //favorite.setAttribute("name", "favorite"); + //addresses.appendChild(favorite); + + QDomElement addresses = doc.documentElement(); + + QDomElement favorite; + QDomNodeList nodeList = doc.elementsByTagName("folder"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + if (node.attribute("name") == "favorite") { + favorite = node; + break; + } + } + + for (int i = -1; i < num; i++) { + Param param; + loadAddress(i, param); + QDomElement site = doc.createElement("site"); + if (i==-1) + site.setAttribute("uuid", QUuid().toString()); + else + { + QString uuid = QUuid::createUuid().toString(); + site.setAttribute("uuid", uuid); + QDomElement addsite = doc.createElement("addsite"); + addsite.setAttribute("uuid", uuid); + favorite.appendChild(addsite); + } + foreach(QString key,param.m_mapParam.keys()) + site.setAttribute(key, param.m_mapParam[key].toString()); + + addresses.appendChild(site); + } + QFile ofile(m_addrXml); + if (!ofile.open(QIODevice::WriteOnly)) + return false; + QByteArray xml = doc.toByteArray(); + QTextStream stream(&ofile); + stream << xml; + ofile.close(); + + delete m_address; + return true; +} + void Global::loadPrefence() { QString strTmp; @@ -435,7 +414,7 @@ #if defined(_OS_WIN32_) || defined(Q_OS_WIN32) bool Global::iniWorkingDir(QString param) { - char ExeNamePath[MAX_PATH], _fileCfg[MAX_PATH], _addrCfg[MAX_PATH]; + char ExeNamePath[MAX_PATH], _fileCfg[MAX_PATH], _addrCfg[MAX_PATH], _addrXml[MAX_PATH]; size_t LastSlash = 0; if (0 == GetModuleFileNameA(NULL, ExeNamePath, MAX_PATH)) { @@ -458,6 +437,11 @@ strcpy(_addrCfg, ExeNamePath); strcat(_addrCfg, "address.cfg"); m_addrCfg = QString::fromLocal8Bit(_addrCfg); + strcpy(_addrXml, ExeNamePath); + strcat(_addrXml, "address.xml"); + m_addrXml = QString::fromLocal8Bit(_addrXml); + if (!convertAddressBook2XML()) + return false; QString pathScheme = m_pathCfg + "scheme"; if (!isPathExist(pathScheme)) @@ -525,10 +509,14 @@ m_fileCfg = m_pathCfg + "qterm.cfg"; if (!createLocalFile(m_fileCfg, m_pathLib + "qterm.cfg")) return false; - m_addrCfg = m_pathCfg + "address.cfg"; - if (!createLocalFile(m_addrCfg, m_pathLib + "address.cfg")) - return false; - + //m_addrCfg = m_pathCfg + "address.cfg"; + //if (!createLocalFile(m_addrCfg, m_pathLib + "address.cfg")) + // return false; + m_addrXml = m_pathCfg + "address.xml"; + //if (!createLocalFile(m_addrXml, m_pathLib + "address.xml")) + // return false; + if (!convertAddressBook2XML()) + return false; return true; } #endif Modified: trunk/qterm-qt4/src/qtermparam.cpp =================================================================== --- trunk/qterm-qt4/src/qtermparam.cpp 2010-07-10 18:30:51 UTC (rev 1204) +++ trunk/qterm-qt4/src/qtermparam.cpp 2010-07-15 13:13:53 UTC (rev 1205) @@ -13,108 +13,64 @@ { Param::Param() { - m_strName = "SMTH"; - m_strAddr = "smth.org"; - m_uPort = 23; - m_nHostType = 0; // 0--BBS 1--*NIX - m_bAutoLogin = false; - m_strPreLogin = ""; - m_strUser = ""; - m_strPasswd = ""; - m_strPostLogin = ""; -// Display - m_BBSCode = "GBK"; - m_nDispCode = 0; - m_bAutoFont = 1; - m_bAlwaysHighlight = 0; - m_bAnsiColor = 1; - m_strASCIIFontName = "Monospace"; - m_strGeneralFontName = "Monospace"; - m_nFontSize = 14; - m_strSchemeFile = ""; -// Terminal - m_strTerm = "vt102"; - m_strKeyboardProfile= ""; - m_nCol = 80; - m_nRow = 24; - m_nScrollLines = 240; - m_nCursorType = 0; // 0--Block 1--Underline 2--I Type - m_strEscape = "^[^[["; -// Connection - m_nProxyType = 0; // 0--None 1--Wingate 2--SOCKS4 3--SOCKS5 4--HTTP - m_strProxyHost = ""; - m_uProxyPort = 0; - m_bAuth = false; - m_strProxyUser = ""; - m_strProxyPasswd = ""; - m_nProtocolType = 0; // 0--Telnet 1--SSH1 2--SSH2 -// Misc - m_nMaxIdle = 180; - m_strReplyKey = "^Z"; - m_strAntiString = "^@"; - m_bAutoReply = false; - m_strAutoReply = "(QTerm) Sorry, I am not around"; - m_bReconnect = false; - m_nReconnectInterval = 3; - m_nRetry = 0; - m_bLoadScript = false; - m_strScriptFile = ""; -// Mouse - m_nMenuType=2; - m_clrMenu = QColor(0,65,132); + m_mapParam["name"] = "SMTH"; + m_mapParam["addr"] = "smth.org"; + m_mapParam["port"] = 23; + m_mapParam["hosttype"] = 0; // 0--BBS 1--*NIX + m_mapParam["autologin"] = false; + m_mapParam["prelogin"] = ""; + m_mapParam["user"] = ""; + m_mapParam["password"] = ""; + m_mapParam["postlogin"] = ""; + + m_mapParam["bbscode"] = "GBK"; + m_mapParam["displaycode"] = 0; + m_mapParam["autofont"] = true; + m_mapParam["alwayshighlight"] = false; + m_mapParam["ansicolor"] = true; + m_mapParam["asciifont"] = "Monospace"; + m_mapParam["generalfont"] = "Monospace"; + m_mapParam["fontsize"] = 14; + m_mapParam["schemefile"] = ""; + + m_mapParam["termtype"] = "vt102"; + m_mapParam["keytype"] = 0; + m_mapParam["keyboardprofile"] = ""; + m_mapParam["column"] = 80; + m_mapParam["row"] = 24; + m_mapParam["scroll"] = 240; + m_mapParam["cursor"] = 0; // 0--Block 1--Underline 2--I Type + m_mapParam["escape"] = "^[^[["; + + m_mapParam["protocol"] = 0; // 0--Telnet 1--SSH1 2--SSH2 + m_mapParam["sshuser"] = ""; + m_mapParam["sshpassword"] = ""; + m_mapParam["proxytype"] = 0; // 0--None 1--Wingate 2--SOCKS4 3--SOCKS5 4--HTTP + m_mapParam["proxyaddr"] = ""; + m_mapParam["proxyport"] = 0; + m_mapParam["proxyauth"] = false; + m_mapParam["proxyuser"] = ""; + m_mapParam["proxypassword"] = ""; + + m_mapParam["maxidle"] = 180; + m_mapParam["antiidlestring"] = "^@"; + m_mapParam["bautoreply"] = true; + m_mapParam["replykey"] = "^Z"; + m_mapParam["autoreply"] = "(QTerm) Sorry, I am not around"; + m_mapParam["reconnect"] = false; + m_mapParam["interval"] = 2; + m_mapParam["retrytimes"] = -1; + m_mapParam["loadscript"] = false; + m_mapParam["scriptfile"] = ""; + + m_mapParam["menutype"] = 2; + m_mapParam["menucolor"] = QColor(0,65,132); + } Param::Param( const Param & param ) { - m_strName = param.m_strName; - m_strAddr = param.m_strAddr; - m_uPort = param.m_uPort; - m_nHostType = param.m_nHostType; // 0--BBS 1--*NIX - m_bAutoLogin = param.m_bAutoLogin; - m_strPreLogin = param.m_strPreLogin; - m_strUser = param.m_strUser; - m_strPasswd = param.m_strPasswd; - m_strPostLogin = param.m_strPostLogin; -// Display - m_BBSCode = param.m_BBSCode; - m_nDispCode = param.m_nDispCode; - m_bAutoFont = param.m_bAutoFont; - m_bAlwaysHighlight = param.m_bAlwaysHighlight; - m_bAnsiColor = param.m_bAnsiColor; - m_strASCIIFontName = param.m_strASCIIFontName; - m_strGeneralFontName = param.m_strGeneralFontName; - m_nFontSize = param.m_nFontSize; - m_strSchemeFile = param.m_strSchemeFile; -// Terminal - m_strTerm = param.m_strTerm; - m_strKeyboardProfile = param.m_strKeyboardProfile; - m_nCol = param.m_nCol; - m_nRow = param.m_nRow; - m_nScrollLines = param.m_nScrollLines; - m_nCursorType = param.m_nCursorType; // 0--Block 1--Underline 2--I Type - m_strEscape = param.m_strEscape; // 0--ESC ESC 1--Ctrl+u -// Connection - m_nProxyType = param.m_nProxyType; // 0--None 1--Wingate 2--SOCKS4 3--SOCKS5 4--HTTP - m_strProxyHost = param.m_strProxyHost; - m_uProxyPort = param.m_uProxyPort; - m_bAuth = param.m_bAuth; - m_strProxyUser = param.m_strProxyUser; - m_strProxyPasswd = param.m_strProxyPasswd; - m_nProtocolType = param.m_nProtocolType; // 0--Telnet 1--SSH1 2--SSH2 -// Misc - m_nMaxIdle = param.m_nMaxIdle; - m_strReplyKey = param.m_strReplyKey; - m_strAntiString = param.m_strAntiString; - m_bAutoReply = param.m_bAutoReply; - m_strAutoReply = param.m_strAutoReply; - m_bReconnect = param.m_bReconnect; - m_nReconnectInterval = param.m_nReconnectInterval; - m_nRetry = param.m_nRetry; - m_bLoadScript = param.m_bLoadScript; - m_strScriptFile = param.m_strScriptFile; -// Mouse - m_nMenuType = param.m_nMenuType; - m_clrMenu = param.m_clrMenu; + m_mapParam = param.m_mapParam; } Param::~Param() @@ -123,56 +79,7 @@ Param& Param::operator=(const Param& param) { - m_strName = param.m_strName; - m_strAddr = param.m_strAddr; - m_uPort = param.m_uPort; - m_nHostType = param.m_nHostType; // 0--BBS 1--*NIX - m_bAutoLogin = param.m_bAutoLogin; - m_strPreLogin = param.m_strPreLogin; - m_strUser = param.m_strUser; - m_strPasswd = param.m_strPasswd; - m_strPostLogin = param.m_strPostLogin; -// Display - m_BBSCode = param.m_BBSCode; - m_nDispCode = param.m_nDispCode; - m_bAutoFont = param.m_bAutoFont; - m_bAlwaysHighlight = param.m_bAlwaysHighlight; - m_bAnsiColor = param.m_bAnsiColor; - m_strASCIIFontName = param.m_strASCIIFontName; - m_strGeneralFontName = param.m_strGeneralFontName; - m_nFontSize = param.m_nFontSize; - m_strSchemeFile = param.m_strSchemeFile; -// Terminal - m_strTerm = param.m_strTerm; - m_strKeyboardProfile = param.m_strKeyboardProfile; - m_nCol = param.m_nCol; - m_nRow = param.m_nRow; - m_nScrollLines = param.m_nScrollLines; - m_nCursorType = param.m_nCursorType; // 0--Block 1--Underline 2--I Type - m_strEscape = param.m_strEscape; // 0--ESC ESC 1--Ctrl+u -// Connection - m_nProxyType = param.m_nProxyType; // 0--None 1--Wingate 2--SOCKS4 3--SOCKS5 4--HTTP - m_strProxyHost = param.m_strProxyHost; - m_uProxyPort = param.m_uProxyPort; - m_bAuth = param.m_bAuth; - m_strProxyUser = param.m_strProxyUser; - m_strProxyPasswd = param.m_strProxyPasswd; - m_nProtocolType = param.m_nProtocolType; // 0--Telnet 1--SSH1 2--SSH2 -// Misc - m_nMaxIdle = param.m_nMaxIdle; - m_strReplyKey = param.m_strReplyKey; - m_strAntiString = param.m_strAntiString; - m_bAutoReply = param.m_bAutoReply; - m_strAutoReply = param.m_strAutoReply; - m_bReconnect = param.m_bReconnect; - m_nReconnectInterval = param.m_nReconnectInterval; - m_nRetry = param.m_nRetry; - m_bLoadScript = param.m_bLoadScript; - m_strScriptFile = param.m_strScriptFile; -// Mouse - m_nMenuType = param.m_nMenuType; - m_clrMenu = param.m_clrMenu; - + m_mapParam = param.m_mapParam; return *this; } Modified: trunk/qterm-qt4/src/qtermscreen.cpp =================================================================== --- trunk/qterm-qt4/src/qtermscreen.cpp 2010-07-10 18:30:51 UTC (rev 1204) +++ trunk/qterm-qt4/src/qtermscreen.cpp 2010-07-15 13:13:53 UTC (rev 1205) @@ -177,7 +177,7 @@ int linelength = m_pBuffer->at(m_pBuffer->caretY())->getLength(); int startx = m_pBuffer->caretX(); - switch (m_pParam->m_nCursorType) { + switch (m_pParam->m_mapParam["cursor"].toInt()) { case 0: // block if (startx < linelength) { drawLine(painter, m_pBuffer->caretY(), startx, startx, false); @@ -231,7 +231,7 @@ // } // m_pCanvas = new QPixmap(width(), height()); - if (m_pParam->m_bAutoFont) { + if (m_pParam->m_mapParam["autofont"].toBool()) { updateFont(); } else { int cx = m_rcClient.width() / m_nCharWidth; @@ -310,8 +310,10 @@ if (m_pGeneralFont != NULL) { delete m_pGeneralFont; } - m_pASCIIFont = new QFont(m_pParam->m_strASCIIFontName, qMax(8, m_pParam->m_nFontSize)); - m_pGeneralFont = new QFont(m_pParam->m_strGeneralFontName, qMax(8, m_pParam->m_nFontSize)); + m_pASCIIFont = new QFont(m_pParam->m_mapParam["asciifont"].toString(), + qMax(8, m_pParam->m_mapParam["fontsize"].toInt())); + m_pGeneralFont = new QFont(m_pParam->m_mapParam["generalfont"].toString(), + qMax(8, m_pParam->m_mapParam["fontsize"].toInt())); m_pASCIIFont->setWeight(QFont::Normal); m_pGeneralFont->setWeight(QFont::Normal); @@ -390,8 +392,8 @@ delete m_pASCIIFont; } m_pASCIIFont = new QFont(font); - m_pASCIIFont->setPixelSize(qMax(8,m_pParam->m_nFontSize)); - m_pGeneralFont->setPixelSize(qMax(8,m_pParam->m_nFontSize)); + m_pASCIIFont->setPixelSize(qMax(8,m_pParam->m_mapParam["fontsize"].toInt())); + m_pGeneralFont->setPixelSize(qMax(8,m_pParam->m_mapParam["fontsize"].toInt())); QResizeEvent* re = new QResizeEvent(size(), size()); resizeEvent(re); } @@ -402,8 +404,8 @@ delete m_pGeneralFont; } m_pGeneralFont = new QFont(font); - m_pASCIIFont->setPixelSize(qMax(8,m_pParam->m_nFontSize)); - m_pGeneralFont->setPixelSize(qMax(8,m_pParam->m_nFontSize)); + m_pASCIIFont->setPixelSize(qMax(8,m_pParam->m_mapParam["fontsize"].toInt())); + m_pGeneralFont->setPixelSize(qMax(8,m_pParam->m_mapParam["fontsize"].toInt())); m_pMessage->setFont(*m_pGeneralFont); QResizeEvent* re = new QResizeEvent(size(), size()); resizeEvent(re); @@ -411,9 +413,9 @@ void Screen::fontSizeChanged(int value) { - m_pParam->m_nFontSize = value; - m_pASCIIFont->setPixelSize(qMax(8,m_pParam->m_nFontSize)); - m_pGeneralFont->setPixelSize(qMax(8,m_pParam->m_nFontSize)); + m_pParam->m_mapParam["fontsize"] = value; + m_pASCIIFont->setPixelSize(qMax(8,value)); + m_pGeneralFont->setPixelSize(qMax(8,value)); QResizeEvent* re = new QResizeEvent(size(), size()); resizeEvent(re); } @@ -430,7 +432,7 @@ int Screen::fontSize() { - return m_pParam->m_nFontSize; + return m_pParam->m_mapParam["fontsize"].toInt(); } /* ------------------------------------------------------------------------ */ @@ -461,12 +463,12 @@ m_nPxmType = 0; - + QString strSchemeFile = m_pParam->m_mapParam["schemefile"].toString(); // if we have scheme defined - if (QFile::exists(m_pParam->m_strSchemeFile)) { + if (QFile::exists(strSchemeFile)) { -// printf("scheme %s loaded sucessfully\n", m_pParam->m_strSchemeFile); - Config *pConf = new Config(m_pParam->m_strSchemeFile); +// printf("scheme %s loaded sucessfully\n", strSchemeFile); + Config *pConf = new Config(strSchemeFile); m_color[0].setNamedColor(pConf->getItemValue("color", "color0").toString()); m_color[1].setNamedColor(pConf->getItemValue("color", "color1").toString()); @@ -495,7 +497,7 @@ return; } QStringList schemeList = schemeDialog::loadSchemeList(); - m_pParam->m_strSchemeFile = schemeList[index]; + m_pParam->m_mapParam["schemefile"] = schemeList[index]; setScheme(); QResizeEvent* re = new QResizeEvent(size(), size()); resizeEvent(re); @@ -866,7 +868,7 @@ for (int y = tlPoint.y(); y <= brPoint.y(); y++) { drawLine(painter, y); - //if( m_pBBS->isSelected(y)&&m_pParam->m_nMenuType==1 ) + //if( m_pBBS->isSelected(y)&&m_pParam->m_mapParam["menutype"].toInt()==1 ) //{ // QRect rcMenu = mapToRect(m_pBBS->getSelectRect()); // QPixmap pxm(rcMenu.width(), rcMenu.height()); @@ -918,7 +920,7 @@ if (complete == true && m_pBBS->isSelected(index)) { drawMenuSelect(painter, index); - if (m_pParam -> m_nMenuType == 1) { + if (m_pParam->m_mapParam["menutype"].toInt() == 1) { bReverse = true; } beginx = 0; @@ -959,7 +961,7 @@ //qDebug() << "startx: " << startx << " i: " << i << " string: " << strShow; // There should be only one. // TODO: Rewrite this when we want to do more than char to char convert - strShow = Global::instance()->convert(pTextLine->getText(startx, len), (Global::Conversion)m_pParam->m_nDispCode); + strShow = Global::instance()->convert(pTextLine->getText(startx, len), (Global::Conversion)m_pParam->m_mapParam["displaycode"].toInt()); if (strShow.isEmpty()) { qDebug("drawLine: empty string?"); @@ -1001,7 +1003,7 @@ char ea = GETATTR(attribute); // test bold mask or always highlighted - if (GETBOLD(ea) || m_pParam->m_bAlwaysHighlight) + if (GETBOLD(ea) || m_pParam->m_mapParam["alwayshighlight"].toBool()) cp = SETHIGHLIGHT(cp); // use 8-15 color // test dim mask if (GETDIM(ea)) { @@ -1042,11 +1044,11 @@ return; } - painter.setPen(m_color[m_pParam->m_bAnsiColor||GETFG(cp)==0?GETFG(cp):7]); + painter.setPen(m_color[m_pParam->m_mapParam["ansicolor"].toBool()||GETFG(cp)==0?GETFG(cp):7]); if (GETBG(cp) != 0 && !transparent) { painter.setBackgroundMode(Qt::OpaqueMode); - painter.setBackground(m_color[m_pParam->m_bAnsiColor||GETBG(cp)==7?GETBG(cp):0]); + painter.setBackground(m_color[m_pParam->m_mapParam["ansicolor"].toBool()||GETBG(cp)==7?GETBG(cp):0]); } else painter.setBackgroundMode(Qt::TransparentMode); @@ -1099,12 +1101,12 @@ if (m_pBBS->isSelected(index)) { rcMenu = mapToRect(m_pBBS->getSelectRect().intersected(QRect(0,index,m_pBuffer->columns(), 1))); - switch (m_pParam->m_nMenuType) { + switch (m_pParam->m_mapParam["menutype"].toInt()) { case 0: // underline painter.fillRect(rcMenu.x(), rcMenu.y() + 10*m_nCharHeight / 11, rcMenu.width(), m_nCharHeight / 11, m_color[7]); break; case 2: - painter.fillRect(rcMenu, QBrush(m_pParam->m_clrMenu)); + painter.fillRect(rcMenu, QBrush(m_pParam->m_mapParam["menucolor"].value<QColor>())); break; } } Modified: trunk/qterm-qt4/src/qtermwindow.cpp =================================================================== --- trunk/qterm-qt4/src/qtermwindow.cpp 2010-07-10 18:30:51 UTC (rev 1204) +++ trunk/qterm-qt4/src/qtermwindow.cpp 2010-07-15 13:13:53 UTC (rev 1205) @@ -260,26 +260,28 @@ #endif // SCRIPT_ENABLED //init the textline list - m_codec = QTextCodec::codecForName(param.m_BBSCode.toLatin1()); - m_pBuffer = new Buffer(m_param.m_nRow, m_param.m_nCol, m_param.m_nScrollLines); - if (param.m_nProtocolType == 0) - m_pTelnet = new Telnet(m_param.m_strTerm, - m_param.m_nRow, m_param.m_nCol, false); + QString strTerm = m_param.m_mapParam["termtype"].toString(); + int nColumn = m_param.m_mapParam["column"].toInt(); + int nRow = m_param.m_mapParam["row"].toInt(); + int nScroll = m_param.m_mapParam["scroll"].toInt(); + + m_codec = QTextCodec::codecForName(param.m_mapParam["bbscode"].toString().toLatin1()); + m_pBuffer = new Buffer(nRow, nColumn, nScroll); + if (param.m_mapParam["protocol"] == 0) + m_pTelnet = new Telnet(strTerm, nRow, nColumn, false); else { #ifndef SSH_ENABLED QMessageBox::warning(this, "QTerm", tr("SSH support is not compiled, QTerm can only use Telnet!")); - m_pTelnet = new Telnet(m_param.m_strTerm, - m_param.m_nRow, m_param.m_nCol, false); + m_pTelnet = new Telnet(strTerm, nRow, nColumn, false); #else - m_pTelnet = new Telnet(m_param.m_strTerm, - m_param.m_nRow, m_param.m_nCol, true); + m_pTelnet = new Telnet(strTerm, nRow, nColumn, true); #endif } connect(m_pBuffer, SIGNAL(windowSizeChanged(int, int)), m_pTelnet, SLOT(windowSizeChanged(int, int))); m_pZmDialog = new zmodemDialog(this); - m_pZmodem = new Zmodem(this, m_pTelnet, m_codec, param.m_nProtocolType); + m_pZmodem = new Zmodem(this, m_pTelnet, m_codec, param.m_mapParam["protocol"].toInt()); if (m_codec == 0) { qDebug("Fallback to GBK codec"); @@ -347,7 +349,7 @@ m_bColorCopy = false; m_bRectCopy = false; m_bAntiIdle = true; - m_bAutoReply = m_param.m_bAutoReply; + m_bAutoReply = m_param.m_mapParam["bautoreply"].toBool(); m_bBeep = !( #ifndef PHONON_ENABLED Global::instance()->m_pref.strPlayer.isEmpty() || @@ -357,7 +359,7 @@ m_bWordWrap = false; m_bAutoCopy = true; m_bMessage = false; - m_bReconnect = m_param.m_bReconnect; + m_bReconnect = m_param.m_mapParam["reconnect"].toBool(); m_pDAThread = 0; m_bConnected = false; @@ -366,7 +368,7 @@ m_bMouseX11 = false; m_bMouseClicked = false; #ifdef SSH_ENABLED - if (param.m_nProtocolType != 0) + if (param.m_mapParam["protocol"].toInt() != 0) m_bDoingLogin = true; else #endif @@ -387,7 +389,7 @@ initScript(); - loadKeyboardTranslator(param.m_strKeyboardProfile); + loadKeyboardTranslator(param.m_mapParam["keyboardprofile"].toString()); connectHost(); } @@ -452,7 +454,7 @@ m_bIdling = true; // system script can handle that #ifdef SCRIPT_ENABLED - if (m_scriptEngine != NULL && m_param.m_bLoadScript) { + if (m_scriptEngine != NULL && m_param.m_mapParam["loadscript"].toBool()) { QScriptValue func = m_scriptEngine->globalObject().property("QTerm").property("antiIdle"); if (func.isFunction()) { func.call(); @@ -470,7 +472,7 @@ #endif // the default function int length; - QByteArray cstr = parseString(m_param.m_strAntiString.toLocal8Bit(), &length); + QByteArray cstr = parseString(m_param.m_mapParam["antiidlestring"].toString().toLocal8Bit(), &length); m_pTelnet->write(cstr, length); } @@ -499,7 +501,7 @@ void Window::mouseDoubleClickEvent(QMouseEvent * me) { #ifdef SCRIPT_ENABLED - if (m_scriptEngine != NULL && m_param.m_bLoadScript) { + if (m_scriptEngine != NULL && m_param.m_mapParam["loadscript"].toBool()) { QScriptValue func = m_scriptEngine->globalObject().property("QTerm").property("onMouseEvent"); if (func.isFunction()) { func.call(QScriptValue(), QScriptValueList() << 3 << (int) me->button() << (int) me->buttons() << (int) me->modifiers() << me->x() << me->y()); @@ -535,7 +537,7 @@ } #ifdef SCRIPT_ENABLED - if (m_scriptEngine != NULL && m_param.m_bLoadScript) { + if (m_scriptEngine != NULL && m_param.m_mapParam["loadscript"].toBool()) { QScriptValue func = m_scriptEngine->globalObject().property("QTerm").property("onMouseEvent"); if (func.isFunction()) { func.call(QScriptValue(), QScriptValueList() << 0 << (int) me->button() << (int) me->buttons() << (int) me->modifiers() << me->x() << me->y()); @@ -607,7 +609,7 @@ } #ifdef SCRIPT_ENABLED - if (m_scriptEngine != NULL && m_param.m_bLoadScript) { + if (m_scriptEngine != NULL && m_param.m_mapParam["loadscript"].toBool()) { QScriptValue func = m_scriptEngine->globalObject().property("QTerm").property("onMouseEvent"); if (func.isFunction()) { func.call(QScriptValue(), QScriptValueList() << 2 << (int) me->button() << (int) me->buttons() << (int) me->modifiers() << me->x() << me->y()); @@ -681,7 +683,7 @@ #ifdef SCRIPT_ENABLED - if (m_scriptEngine != NULL && m_param.m_bLoadScript) { + if (m_scriptEngine != NULL && m_param.m_mapParam["loadscript"].toBool()) { QScriptValue func = m_scriptEngine->globalObject().property("QTerm").property("onMouseEvent"); if (func.isFunction()) { func.call(QScriptValue(), QScriptValueList() << 1 << (int) me->button() << (int) me->buttons() << (int) me->modifiers() << me->x() << me->y()); @@ -762,7 +764,7 @@ void Window::wheelEvent(QWheelEvent *we) { #ifdef SCRIPT_ENABLED - if (m_scriptEngine != NULL && m_param.m_bLoadScript) { + if (m... [truncated message content] |
From: <hep...@us...> - 2010-07-10 18:31:01
|
Revision: 1204 http://qterm.svn.sourceforge.net/qterm/?rev=1204&view=rev Author: hephooey Date: 2010-07-10 18:30:51 +0000 (Sat, 10 Jul 2010) Log Message: ----------- Out-of-source build Modified Paths: -------------- trunk/qterm-qt4/src/doc/CMakeLists.txt trunk/qterm-qt4/src/doc/qterm.qhcp Modified: trunk/qterm-qt4/src/doc/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/doc/CMakeLists.txt 2010-07-02 13:07:17 UTC (rev 1203) +++ trunk/qterm-qt4/src/doc/CMakeLists.txt 2010-07-10 18:30:51 UTC (rev 1204) @@ -1,28 +1,31 @@ -CONFIGURE_FILE(../pic/qterm.png qterm.png COPYONLY) -CONFIGURE_FILE(qterm.qhp.in qterm.qhp) -CONFIGURE_FILE(index.html.in index.html) - -FIND_PROGRAM(QT_HELP_COLLECTION_GENERATOR - qcollectiongenerator - PATHS "${QT_BINARY_DIR}" - DOC "qcollectiongenerator used to compile Qt help collection project files") - - -ADD_CUSTOM_COMMAND( - OUTPUT qterm.qhc - DEPENDS qterm.qhcp - DEPENDS qterm.qhp - COMMAND ${QT_HELP_COLLECTION_GENERATOR} - ARGS qterm.qhcp - -o qterm.qhc - COMMENT "Compiling Qt help collection project qterm.qhcp" -) - -ADD_CUSTOM_TARGET(help_target - DEPENDS qterm.qhc) - -INSTALL( - FILES qterm.qhc - DESTINATION share/qterm/doc -) - +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/src/pic/qterm.png ${CMAKE_CURRENT_BINARY_DIR}/qterm.png COPYONLY) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/qterm.qhp.in ${CMAKE_CURRENT_BINARY_DIR}/qterm.qhp) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/index.html.in ${CMAKE_CURRENT_BINARY_DIR}/index.html) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Script.html ${CMAKE_CURRENT_BINARY_DIR}/Script.html COPYONLY) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/about.txt ${CMAKE_CURRENT_BINARY_DIR}/about.txt COPYONLY) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doc.css ${CMAKE_CURRENT_BINARY_DIR}/doc.css COPYONLY) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/qterm.qhcp ${CMAKE_CURRENT_BINARY_DIR}/qterm.qhcp COPYONLY) + +FIND_PROGRAM(QT_HELP_COLLECTION_GENERATOR + qcollectiongenerator + PATHS "${QT_BINARY_DIR}" + DOC "qcollectiongenerator used to compile Qt help collection project files") + +ADD_CUSTOM_COMMAND( + OUTPUT qterm.qhc + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qterm.qhcp + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qterm.qhp + COMMAND ${QT_HELP_COLLECTION_GENERATOR} + ARGS qterm.qhcp + -o qterm.qhc + COMMENT "Compiling Qt help collection project qterm.qhcp" +) + +ADD_CUSTOM_TARGET(help_target + DEPENDS qterm.qhc) + +INSTALL( + FILES qterm.qhc + DESTINATION share/qterm/doc +) + Modified: trunk/qterm-qt4/src/doc/qterm.qhcp =================================================================== --- trunk/qterm-qt4/src/doc/qterm.qhcp 2010-07-02 13:07:17 UTC (rev 1203) +++ trunk/qterm-qt4/src/doc/qterm.qhcp 2010-07-10 18:30:51 UTC (rev 1204) @@ -1,26 +1,26 @@ -<?xml version="1.0" encoding="utf-8" ?> -<QHelpCollectionProject version="1.0"> - <assistant> - <title>QTerm Help</title> - <startPage>qthelp://org.qterm/doc/index.html</startPage> - <applicationIcon>../pic/qterm.png</applicationIcon> - <aboutMenuText> - <text>About QTerm</text> - </aboutMenuText> - <aboutDialog> - <file>about.txt</file> - <icon>../pic/qterm.png</icon> - </aboutDialog> - </assistant> - <docFiles> - <generate> - <file> - <input>qterm.qhp</input> - <output>qterm.qch</output> - </file> - </generate> - <register> - <file>qterm.qch</file> - </register> - </docFiles> -</QHelpCollectionProject> +<?xml version="1.0" encoding="utf-8" ?> +<QHelpCollectionProject version="1.0"> + <assistant> + <title>QTerm Help</title> + <startPage>qthelp://org.qterm/doc/index.html</startPage> + <applicationIcon>qterm.png</applicationIcon> + <aboutMenuText> + <text>About QTerm</text> + </aboutMenuText> + <aboutDialog> + <file>about.txt</file> + <icon>qterm.png</icon> + </aboutDialog> + </assistant> + <docFiles> + <generate> + <file> + <input>qterm.qhp</input> + <output>qterm.qch</output> + </file> + </generate> + <register> + <file>qterm.qch</file> + </register> + </docFiles> +</QHelpCollectionProject> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-07-02 13:07:23
|
Revision: 1203 http://qterm.svn.sourceforge.net/qterm/?rev=1203&view=rev Author: sidos Date: 2010-07-02 13:07:17 +0000 (Fri, 02 Jul 2010) Log Message: ----------- help_target as one dependence Modified Paths: -------------- trunk/qterm-qt4/src/CMakeLists.txt Modified: trunk/qterm-qt4/src/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/CMakeLists.txt 2010-07-02 12:35:00 UTC (rev 1202) +++ trunk/qterm-qt4/src/CMakeLists.txt 2010-07-02 13:07:17 UTC (rev 1203) @@ -238,7 +238,7 @@ add_subdirectory(po) add_subdirectory(keyboard_profiles) add_subdirectory(doc) -add_dependencies(qterm translations_target) +add_dependencies(qterm translations_target help_target) if(QTERM_ENABLE_TEST) add_subdirectory(test) endif(QTERM_ENABLE_TEST) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-07-02 12:35:08
|
Revision: 1202 http://qterm.svn.sourceforge.net/qterm/?rev=1202&view=rev Author: sidos Date: 2010-07-02 12:35:00 +0000 (Fri, 02 Jul 2010) Log Message: ----------- integrate assistant help Modified Paths: -------------- trunk/qterm-qt4/src/CMakeLists.txt trunk/qterm-qt4/src/qtermframe.cpp trunk/qterm-qt4/src/qtermframe.h trunk/qterm-qt4/src/qtermglobal.h trunk/qterm-qt4/src/qtermwindow.h trunk/qterm-qt4/src/qtermwindowbase.h Added Paths: ----------- trunk/qterm-qt4/src/assistantclient.cpp trunk/qterm-qt4/src/assistantclient.h trunk/qterm-qt4/src/doc/ trunk/qterm-qt4/src/doc/CMakeLists.txt trunk/qterm-qt4/src/doc/Script.html trunk/qterm-qt4/src/doc/about.txt trunk/qterm-qt4/src/doc/doc.css trunk/qterm-qt4/src/doc/index.html.in trunk/qterm-qt4/src/doc/qterm.qhcp trunk/qterm-qt4/src/doc/qterm.qhp.in Modified: trunk/qterm-qt4/src/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/CMakeLists.txt 2010-07-02 11:34:10 UTC (rev 1201) +++ trunk/qterm-qt4/src/CMakeLists.txt 2010-07-02 12:35:00 UTC (rev 1202) @@ -119,6 +119,7 @@ aboutdialog.cpp addrdialog.cpp articledialog.cpp + assistantclient.cpp imageviewer.cpp imagelistviewer.cpp keydialog.cpp @@ -236,6 +237,7 @@ add_subdirectory(scripts) add_subdirectory(po) add_subdirectory(keyboard_profiles) +add_subdirectory(doc) add_dependencies(qterm translations_target) if(QTERM_ENABLE_TEST) add_subdirectory(test) Added: trunk/qterm-qt4/src/assistantclient.cpp =================================================================== --- trunk/qterm-qt4/src/assistantclient.cpp (rev 0) +++ trunk/qterm-qt4/src/assistantclient.cpp 2010-07-02 12:35:00 UTC (rev 1202) @@ -0,0 +1,159 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt...@no...) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt...@no.... +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "assistantclient.h" +#include "qtermglobal.h" + +#include <QtCore/QString> +#include <QtCore/QProcess> +#include <QtCore/QDir> +#include <QtCore/QLibraryInfo> +#include <QtCore/QDebug> +#include <QtCore/QFileInfo> +#include <QtCore/QObject> +#include <QtCore/QTextStream> +#include <QtCore/QCoreApplication> + +namespace QTerm +{ + +enum { debugAssistantClient = 0 }; + +AssistantClient::AssistantClient() : + m_process(0) +{ +} + +AssistantClient::~AssistantClient() +{ + if (isRunning()) { + m_process->terminate(); + m_process->waitForFinished(); + } + delete m_process; +} + +bool AssistantClient::showPage(const QString &path, QString *errorMessage) +{ + QString cmd = QLatin1String("SetSource "); + cmd += path; + return sendCommand(cmd, errorMessage); +} + +bool AssistantClient::activateIdentifier(const QString &identifier, QString *errorMessage) +{ + QString cmd = QLatin1String("ActivateIdentifier "); + cmd += identifier; + return sendCommand(cmd, errorMessage); +} + +bool AssistantClient::activateKeyword(const QString &keyword, QString *errorMessage) +{ + QString cmd = QLatin1String("ActivateKeyword "); + cmd += keyword; + return sendCommand(cmd, errorMessage); +} + +bool AssistantClient::sendCommand(const QString &cmd, QString *errorMessage) +{ + if (debugAssistantClient) + qDebug() << "sendCommand " << cmd; + if (!ensureRunning(errorMessage)) + return false; + if (!m_process->isWritable() || m_process->bytesToWrite() > 0) { + *errorMessage = QCoreApplication::translate("AssistantClient", "Unable to send request: Assistant is not responding."); + return false; + } + QTextStream str(m_process); + str << cmd << QLatin1Char('\0') << endl; + return true; +} + +bool AssistantClient::isRunning() const +{ + return m_process && m_process->state() != QProcess::NotRunning; +} + +QString AssistantClient::binary() +{ + QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QDir::separator(); +#if !defined(Q_OS_MAC) + app += QLatin1String("assistant"); +#else + app += QLatin1String("Assistant.app/Contents/MacOS/Assistant"); +#endif + +#if defined(Q_OS_WIN) + app += QLatin1String(".exe"); +#endif + + return app; +} + +bool AssistantClient::ensureRunning(QString *errorMessage) +{ + if (isRunning()) + return true; + + if (!m_process) + m_process = new QProcess; + + const QString app = binary(); + if (!QFileInfo(app).isFile()) { + *errorMessage = QCoreApplication::translate("AssistantClient", "The binary '%1' does not exist.").arg(app); + return false; + } + if (debugAssistantClient) + qDebug() << "Running " << app; + // run + QStringList args; + args << QLatin1String("-enableRemoteControl") + << QLatin1String("-collectionFile") + << Global::instance()->pathLib() + QDir::separator() + "doc/qterm.qhc"; + m_process->start(app, args); + if (!m_process->waitForStarted()) { + *errorMessage = QCoreApplication::translate("AssistantClient", "Unable to launch assistant (%1).").arg(app); + return false; + } + return true; +} + +} Added: trunk/qterm-qt4/src/assistantclient.h =================================================================== --- trunk/qterm-qt4/src/assistantclient.h (rev 0) +++ trunk/qterm-qt4/src/assistantclient.h 2010-07-02 12:35:00 UTC (rev 1202) @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt...@no...) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt...@no.... +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef ASSISTANTCLIENT_H +#define ASSISTANTCLIENT_H + +#include <QtCore/qglobal.h> + +class QProcess; +class QString; + +namespace QTerm +{ +class AssistantClient +{ + AssistantClient(const AssistantClient &); + AssistantClient &operator=(const AssistantClient &); + +public: + AssistantClient(); + ~AssistantClient(); + + bool showPage(const QString &path, QString *errorMessage); + bool activateIdentifier(const QString &identifier, QString *errorMessage); + bool activateKeyword(const QString &keyword, QString *errorMessage); + + bool isRunning() const; + +private: + static QString binary(); + bool sendCommand(const QString &cmd, QString *errorMessage); + bool ensureRunning(QString *errorMessage); + + QProcess *m_process; +}; +} // namespace QTerm +#endif // ASSISTANTCLIENT_H Added: trunk/qterm-qt4/src/doc/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/doc/CMakeLists.txt (rev 0) +++ trunk/qterm-qt4/src/doc/CMakeLists.txt 2010-07-02 12:35:00 UTC (rev 1202) @@ -0,0 +1,28 @@ +CONFIGURE_FILE(../pic/qterm.png qterm.png COPYONLY) +CONFIGURE_FILE(qterm.qhp.in qterm.qhp) +CONFIGURE_FILE(index.html.in index.html) + +FIND_PROGRAM(QT_HELP_COLLECTION_GENERATOR + qcollectiongenerator + PATHS "${QT_BINARY_DIR}" + DOC "qcollectiongenerator used to compile Qt help collection project files") + + +ADD_CUSTOM_COMMAND( + OUTPUT qterm.qhc + DEPENDS qterm.qhcp + DEPENDS qterm.qhp + COMMAND ${QT_HELP_COLLECTION_GENERATOR} + ARGS qterm.qhcp + -o qterm.qhc + COMMENT "Compiling Qt help collection project qterm.qhcp" +) + +ADD_CUSTOM_TARGET(help_target + DEPENDS qterm.qhc) + +INSTALL( + FILES qterm.qhc + DESTINATION share/qterm/doc +) + Added: trunk/qterm-qt4/src/doc/Script.html =================================================================== --- trunk/qterm-qt4/src/doc/Script.html (rev 0) +++ trunk/qterm-qt4/src/doc/Script.html 2010-07-02 12:35:00 UTC (rev 1202) @@ -0,0 +1,268 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> + +<html> +<head> + <title>Script - QTerm Documents</title> + <link rel="stylesheet" type="text/css" href="doc.css"/> +</head> +<body> + +<div class="Documentation"> + <div class="Heading"> + Script + </div> +</div> + +<div class="toc"> + <p><strong>Contents</strong></p> + <ul> + <li><a href="#Introduction">Introduction</a></li> + <li><a href="#How_to_Use">How to Use</a></li> + <li><a href="#How_to_Debug">How to Debug</a></li> + <li><a href="#How_to_Write_a_Script">How to Write a + Script</a></li> + <li><a href="#How_to_Write_a_System_Script">How to Write + a System Script</a></li> + </ul> +</div> +<a name="Introduction" id="Introduction"></a><h3> Introduction</span></h3> +<p>Starting from the version 0.5.6, QTerm supports scripts with QtScript. With +the greatest and latest script support in QTerm, you can:</p> +<ul> + <li> Do boring and repeating operation automatically.</li> + <li> Change the default behavior of QTerm with system scripts.</li> + <li> Try new functions with script (In order to do this you might want to have Qt bindings for QtScript installed, they can be downloaded from <a href="http://labs.trolltech.com/page/Projects/QtScript/Generator" class="external free" title="http://labs.trolltech.com/page/Projects/QtScript/Generator" rel="nofollow">http://labs.trolltech.com/page/Projects/QtScript/Generator</a>)</li> +</ul> + +<a name="How_to_Use" id="How_to_Use"></a><h3> How to Use</h3> +<p>You can run simple scripts using Script->Run, for example, save the following +code</p> +<pre>for (var i = 0; i < 10; i++) + QTerm.sendString("q"); +</pre> +<p>to a script file, run it in QTerm will send 10 q's to the server.</p> +<p>To use the system control script. Open the address book, in the very end of +the General tab. First enable the Load Control Script checkbox, then choose +your system script.</p> + +<a name="How_to_Debug" id="How_to_Debug"></a><h3> How to Debug</h3> +<p>If you want to develop serious/complicate scripts for QTerm, it is very +helpful to have QScriptEngineDebugger enable. This feature is introduced in Qt +4.5, make sure your qt is new enough. Then you can run cmake with +-DQTERM_ENABLE_SCRIPT_DEBUGGER=ON, for example:</p> +<pre>cmake .. -DQTERM_ENABLE_SCRIPT_DEBUGGER=ON</pre> +<p>Then do the usual make, make install to install QTerm +</p><p>After you enable the debugger. It will pop up every time the script engine +catches a exception. You can also call the debugger any time by Script->Debug.</p> + +<a name="How_to_Write_a_Script" id="How_to_Write_a_Script"></a><h3> How to Write a Script</h3> +<p>Here is a list of functions you can call in the scripts, they are all in the +"QTerm" object, so for example if you want to call "version()" you should call +"QTerm.version()" instead.</p> +<p>QString version()</p> +<pre> Return the version of QTerm.</pre> +<p>int caretX()</p> +<p>int caretY()</p> +<pre> Return the x or y coordinate of the current position of caret.</pre> +<p>int columns()</p> +<p>int rows()</p> +<pre> Return the number of columns or rows of the current window.</pre> +<p>int charX(int x, int y)</p> +<p>int charY(int x, int y)</p> +<pre> Given the graphical coordinate in the current window, convert it to the + text coordinate. +</pre> +<p>int posX()</p> +<p>int posY()</p> +<pre> Return the x or y coordinate of the mouse.</pre> +<p>QString getUrl()</p> +<p>QString getIP()</p> +<pre> Return the URL or IP address under the mouse pointer, if no url is + detected an empty string will be returned. +</pre> +<p>bool isConnected()</p> +<pre> Check if the current window is conneced to a BBS server.</pre> +<p>void reconnect()</p> +<pre> Reconnect to the BBS server, do nothing if the current window is already + connected. +</pre> +<p>void disconnect()</p> +<pre> Disconnect from the current BBS server.</pre> +<p>void buzz()</p> +<pre> Shake QTerm.</pre> +<p>void sendString(const QString & string)</p> +<pre> Send string to the BBS server.</pre> +<p>void sendParsedString(const QString & string)</p> +<pre> Send parsed string to the BBS server. you can use '^M' to represent the + return key for example. +</pre> +<p>void osdMessage(const QString & message, int icon = 1, int duration = 0) +</p> +<pre> Show message in the osd, icon = 0, 1, 2, 3 means No/Info/Warning/Error + icon. Duration is in the unit of ms, 0 means forever. +</pre> +<p>void showMessage(const QString & message, int duration = -1) +</p> +<pre> Show message in the notification area or system tray. duration is not + really useful for now. +</pre> +<p>void cancelZmodem() +</p> +<pre> Cancel the current zmodem transfer. +</pre> +<p>void setZmodemFileList(const QStringList & fileList) +</p> +<pre> Set the list of files you want to upload with zmodem. call it before your + start zmodem to avoid the file selection dialog. +</pre> +<p>QScriptValue getLine(int line) +</p> +<pre> Get the object represent the 'line' line text. +</pre> +<p>QScriptValue window() +</p> +<pre> Return the current window object. +</pre> +<p>bool addPopupMenu(QString id, QString menuTitle, QString icon = "QTerm") +</p> +<pre> Add a menu item to the popup menu, you can access to the new action with + QTerm.id property if the method succeed. menuTitle is the text displayed + in the menu. currently icon parameter has no effect. Return true if + succeed, otherwise it will return false. +</pre> +<p>bool addUrlMenu(QString id, QString menuTitle, QString icon = "QTerm") +</p> +<pre> Add a menu item to the url popup menu, you can access to the new action + with QTerm.id property if the method succeed. menuTitle is the text + displayed in the menu. currently icon parameter has no effect. Return true + if succeed, otherwise it will return false. +</pre> +<p>void addPopupSeparator() +</p><p>void addUrlSeparator() +</p> +<pre> Add separators to the popup/url menu so they will look nicer. +</pre> +<p>void loadScript(const QString & filename) +</p> +<pre> Load external javascript files, QTerm will search the file under the + "scripts" directory under the local path (e.g.SHOME/.qterm) first and then + search the global path (e.g. /usr/share) +</pre> +<p>void globalPath() +</p> +<pre> Return the global data path, for example, if you installed QTerm to /usr, + then it will return /usr/share. +</pre> +<p>void localPath() +</p> +<pre> Return the local data path, $HOME/.qterm under Linux. +</pre> +<p>QString getSelectedText(bool rect = false, bool color = false, const QString & escape = "") +</p> +<pre> Return the current selected region. rect should always be false currently. + color indicate if you want the copy the attribute of the text, escape is + only useful when color is true, indicate how you want to represent the + escape sequence. +</pre> +<p>void openUrl(const QString & url) +</p> +<pre> Open the url using the http browser specified in QTerm. +</pre> +<p>void loadExtension(const QString & extension) +</p> +<pre> Load extension, if you want to use the classes in Qt bindings, you + need to load them first. +</pre> +<a name="How_to_Write_a_System_Script" id="How_to_Write_a_System_Script"></a><h3> <span class="mw-headline">How to Write a System Script</span></h3> +<p>In order to change the behavior of QTerm. You can reimplement the following +functions in the system script, again all the functions are members of 'QTerm' +object, for example init() should be understand as QTerm.init(): +</p><p>There is a property which is important for this usage: QTerm.accepted. It +should be set to true if you do not want the native QTerm code to handle the +event any further, otherwise it should set to false. +</p><p>init() +</p> +<pre> This function is called every time the system script is loaded. You can + show messages or initiate some variables here. +</pre> +<p>setCursorType(x,y) +</p> +<pre> Determine what kind of mouse cursor should be shown in the current + context, if mouse release events is not handle by the script this function + also determine how the mouse release will be handled. +</pre> +<p>setPageState() +</p> +<pre> Determine the current state of the BBS page, useful for further determine + the mouse behavior +</pre> +<p>isLineClickable(x,y) +</p> +<pre> Determine if the current line under mouse cursor is clickable, x and y is + the mouse text coordinate. +</pre> +<p>getClickableString(x,y) +</p> +<pre> Determine if the string under mouse cursor is clickable, x and y is the + mouse text coordinate, the string should be returned and will be + highlighted by QTerm. +</pre> +<p>onMouseEvent(type, button, buttons, modifiers, pt_x, pt_y) +</p> +<pre> Handle the mouse event, type, button, buttons, modifiers follow the + definition in QMouseEvent, pt_x and pt_y is the graphical coordinate of the + mouse pointer. +</pre> +<p>onKeyPressEvent(key, modifiers, text) +</p> +<pre> Handle the key press event, the definition of the arguments again follows + QKeyEvent. +</pre> +<p>onWheelEvent(delta, buttons, modifiers, orientation, pt_x, pt_y) +</p> +<pre> Handle the mouse wheel event, the definition of delta, button, modifiers, + and orientation follow QWheelEvent. pt_x and pt_y is the graphical + coordinate of the mouse pointer. +</pre> +<p>onNewData() +</p> +<pre> The function will be called every time QTerm gets new data, you can + manipulate the received data a little bit. +</pre> +<p>antiIdle() +</p> +<pre> Determine how the anti idle event should be handled. +</pre> +<p>autoReply() +</p> +<pre> Determine how to reply the incoming message. Useful for those who want to + write BBS robots. +</pre> +<p>checkUrl() +</p> +<pre> Determine if there is a URL under the mouse pointer, return the URL if + found, otherwise return a empty string. +</pre> +<p>checkIP() +</p> +<pre> Determine if there is a IP address under the mouse pointer, return the URL + if found, otherwise return a empty string. +</pre> +<p>onTelnetState(int state) +</p> +<pre> Handle telnet events +</pre> +<p>onZmodemState(int type, int value, const QString& msg) +</p> +<pre> Handle zmodem events +</pre> +<p>endOfArticle() +</p> +<pre> Implement this to check the end of articles for downloading articles +</pre> +<p>There is also a signal: scriptEvent(const QString& type) which can be used by +the script to emit and handle signals +</p> + +</body> +</html> Added: trunk/qterm-qt4/src/doc/about.txt =================================================================== --- trunk/qterm-qt4/src/doc/about.txt (rev 0) +++ trunk/qterm-qt4/src/doc/about.txt 2010-07-02 12:35:00 UTC (rev 1202) @@ -0,0 +1 @@ +QTerm is a BBS client written in Qt. Added: trunk/qterm-qt4/src/doc/doc.css =================================================================== --- trunk/qterm-qt4/src/doc/doc.css (rev 0) +++ trunk/qterm-qt4/src/doc/doc.css 2010-07-02 12:35:00 UTC (rev 1202) @@ -0,0 +1,39 @@ +body { + border: 1px solid #000000; + background: #EEF3F5; + margin: 0px; + padding: 0px; +} +div.Heading { + padding-top: 5px; + padding-bottom: 5px; + padding-left: 5px; + background: #adc4d2; + font-weight: bold; + font-size: 24pt; + border-bottom: 1px solid #000000; +} +span.HeadingSmallText { + font-weight: bold; + font-size: 12pt; +} +div.LongHelp { + margin: 20px; + font-style: italic; +} +div.Description { + border-top: 1px solid; +} +table.PropertiesTable { +} +tr.PropertiesTableHeading { + background: #85a8bc; +} + +div.toc { + background: #DDDDDD; + border: 1px solid #000000; + margin: 2em 2em; + padding: 1em; + width: 30em; +} Added: trunk/qterm-qt4/src/doc/index.html.in =================================================================== --- trunk/qterm-qt4/src/doc/index.html.in (rev 0) +++ trunk/qterm-qt4/src/doc/index.html.in 2010-07-02 12:35:00 UTC (rev 1202) @@ -0,0 +1,42 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> + +<html> +<head> + <title>Main - QTerm Documents</title> + <link rel="stylesheet" type="text/css" href="doc.css"/> +</head> +<body> + +<div class="Documentation"> + <div class="Heading"> + QTerm @QTERM_VERSION_MAJOR@.@QTERM_VERSION_MINOR@.@QTERM_VERSION_RELEASE@ + </div> +</div> + +<p align="center"><a href="http://www.qterm.org"><img src="qterm.png"/></a></p> + +<p> +QTerm is a BBS client written in Qt, thus running on multiple platforms, +e.g. Linux, Windows, Mac OS X. + + +<div class="toc"> + <p><strong>Table of Contents</strong></p> + <ul> + <li> + <a href="Script.html">Script</a> + <ul> + <li><a href="Script.html#Introduction">Introduction</a></li> + <li><a href="Script.html#How_to_Use">How to Use</a></li> + <li><a href="Script.html#How_to_Debug">How to Debug</a></li> + <li><a href="Script.html#How_to_Write_a_Script">How to Write a + Script</a></li> + <li><a href="Script.html#How_to_Write_a_System_Script">How to Write + a System Script</a></li> + </ul> + </li> + </ul> +</div> + +</body> +</html> Added: trunk/qterm-qt4/src/doc/qterm.qhcp =================================================================== --- trunk/qterm-qt4/src/doc/qterm.qhcp (rev 0) +++ trunk/qterm-qt4/src/doc/qterm.qhcp 2010-07-02 12:35:00 UTC (rev 1202) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8" ?> +<QHelpCollectionProject version="1.0"> + <assistant> + <title>QTerm Help</title> + <startPage>qthelp://org.qterm/doc/index.html</startPage> + <applicationIcon>../pic/qterm.png</applicationIcon> + <aboutMenuText> + <text>About QTerm</text> + </aboutMenuText> + <aboutDialog> + <file>about.txt</file> + <icon>../pic/qterm.png</icon> + </aboutDialog> + </assistant> + <docFiles> + <generate> + <file> + <input>qterm.qhp</input> + <output>qterm.qch</output> + </file> + </generate> + <register> + <file>qterm.qch</file> + </register> + </docFiles> +</QHelpCollectionProject> Added: trunk/qterm-qt4/src/doc/qterm.qhp.in =================================================================== --- trunk/qterm-qt4/src/doc/qterm.qhp.in (rev 0) +++ trunk/qterm-qt4/src/doc/qterm.qhp.in 2010-07-02 12:35:00 UTC (rev 1202) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<QtHelpProject version="1.0"> + <namespace>org.qterm</namespace> + <virtualFolder>doc</virtualFolder> + <filterSection> + <toc> + <section title="QTerm" ref="index.html"> + <section title="Script" ref="Script.html"/> + </section> + </toc> + <filterAttribute>QTerm</filterAttribute> + <filterAttribute>@QTERM_VERSION_MAJOR@.@QTERM_VERSION_MINOR@.@QTERM_VERSION_RELEASE@</filterAttribute> + <keywords> + <keyword name="Script" ref="Script.html" id="Script::Script"/> + </keywords> + <files> + <file>doc.css</file> + <file>*.html</file> + <file>*.png</file> + </files> + </filterSection> +</QtHelpProject> Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2010-07-02 11:34:10 UTC (rev 1201) +++ trunk/qterm-qt4/src/qtermframe.cpp 2010-07-02 12:35:00 UTC (rev 1202) @@ -336,6 +336,14 @@ Global::instance()->openUrl(strUrl); } +//slot Help->Contents +void Frame::on_actionContents_triggered() +{ + QString errorMessage; + if (!m_assistant.showPage("qthelp://org.qterm/doc/index.html", &errorMessage)) + QMessageBox::warning(this, tr("Assistant"), errorMessage); +} + //slot Windows menu aboutToShow void Frame::windowsMenuAboutToShow() { Modified: trunk/qterm-qt4/src/qtermframe.h =================================================================== --- trunk/qterm-qt4/src/qtermframe.h 2010-07-02 11:34:10 UTC (rev 1201) +++ trunk/qterm-qt4/src/qtermframe.h 2010-07-02 12:35:00 UTC (rev 1202) @@ -1,7 +1,9 @@ #ifndef QTERMFRAME_H #define QTERMFRAME_H +#include "ui_mainframe.h" +#include "assistantclient.h" #include "statusBar.h" #include <QPixmap> #include <QByteArray> @@ -21,13 +23,12 @@ namespace QTerm { -class WndMgr; class Window; class QTermTimeLabel; class Param; class Config; -class Frame : public QMainWindow +class Frame : public QMainWindow, public Ui::Frame { Q_OBJECT public: @@ -36,9 +37,7 @@ static Frame * instance() { return s_instance; } - - void updateMenuToolBar(); - void enableMenuToolBar(bool); + QMenu * createPopupMenu(); void popupFocusIn(Window * window = 0); void buzz(); QMenu * genPopupMenu(QWidget * owner); @@ -49,165 +48,76 @@ void saveAndDisconnect(); signals: - void bossColor(); void scrollChanged(); void statusBarChanged(bool); protected slots: + // custum key + void on_actionKey_Setup_triggered(); void keyClicked(int); - // Menu - void addressBook(); - void quickLogin(); + // theme submenu + void initThemeMenu(); + void themesMenuActivated(QAction *); + // toolbar submenu + void initToolbarMenu(); + // File + void on_actionAddressBook_triggered(); + void on_actionQuick_Login_triggered(); + void on_actionPrint_triggered(); + // View + void on_actionFont_triggered(); + void on_actionMenubar_toggled(bool); + void on_actionStatusbar_toggled(bool); + void on_actionFullscreen_triggered(bool); + // BBS + void on_actionImage_Viewer_triggered(); + // Options + void on_actionDefault_Session_Setting_triggered(); + void on_actionPreference_triggered(); + void on_actionConfigure_Shortcuts_triggered(); + void on_actionConfigure_Toolbars_triggered(); + // Help + void on_actionAbout_QTerm_triggered(); + void on_actionQTerm_Online_triggered(); + void on_actionAbout_Qt_triggered(); + void on_actionContents_triggered(); - void aboutQTerm(); - void homepage(); - void updateLang(QAction*); - void defaultSetting(); - void preference(); - void reloadScript(); - void runScript(); - void stopScript(); - void debugConsole(); - - // Toolbar +protected slots: + // Action groups void connectIt(); - void disconnect(); - void copy(); - void paste(); - void copyRect(bool); - void copyColor(bool); - void copyArticle(); - void autoCopy(bool); - void wordWrap(bool); void updateESC(QAction*); void updateCodec(QAction*); void updateScroll(QAction*); - void updateSwitchBar(bool); - void updateStatusBar(bool); - void refresh(); - void triggerFullScreen(bool isFullScreen); - void hideMenuBar(bool hide); - void bosscolor(); - void uiFont(); - void antiIdle(bool); - void autoReply(bool); - void setting(); - void viewMessages(); - void updateMouse(bool); - void updateBeep(bool); - void reconnect(bool); - void keySetup(); - void printScreen(); + void updateLang(QAction*); - void viewImages(); - - void initThemesMenu(); - void themesMenuActivated(QAction *); void windowsMenuAboutToShow(); void windowsMenuActivated(); + void connectMenuAboutToShow(); void connectMenuActivated(int); - void popupConnectMenu(); + void windowActivated(QMdiSubWindow*); + void windowClosed(QObject*); + void actionsDispatcher(QAction*); + void trayActivated(QSystemTrayIcon::ActivationReason reason); void trayHide(); void trayShow(); void buildTrayMenu(); void switchWin(int); - void paintEvent(QPaintEvent *); - void configShortcuts(); - void configToolbars(); void slotShowQTerm(); -public: - QMdiArea * m_MdiArea; + protected: //variables - //QTermTimeLabel *labelTime; - QMenu *windowsMenu; - QMenu *themesMenu; - - QString theme; - - QToolBar * key; - - QMenu * escapeMenu; - QMenu * langMenu; QMenu * connectMenu; - -// File - QAction * m_connectAction; - QAction * m_disconnectAction; - QAction * m_addressAction; - QAction * m_quickConnectAction; - QAction * m_printAction; - QAction * m_exitAction; - -// Edit - QAction * m_copyAction; - QAction * m_pasteAction; - QAction * m_colorCopyAction; - QAction * m_rectAction; - QAction * m_autoCopyAction; - QAction * m_wwrapAction; - QAction * m_noescAction; - QAction * m_escescAction; - QAction * m_uescAction; - QAction * m_customescAction; - QAction * m_NoConvAction; - QAction * m_S2TAction; - QAction * m_T2SAction; - - QAction * m_refreshAction; - QAction * m_engAction; - QAction * m_chsAction; - QAction * m_chtAction; - QAction * m_uiFontAction; - QAction * m_fullAction; - QAction * m_bossAction; - QAction * m_scrollHideAction; - QAction * m_scrollLeftAction; - QAction * m_scrollRightAction; - QAction * m_switchAction; - -// View - QAction * m_currentSessionAction; - QAction * m_defaultAction; - QAction * m_prefAction; - QAction * m_copyArticleAction; - QAction * m_antiIdleAction; - QAction * m_autoReplyAction; - QAction * m_viewMessageAction; - QAction * m_beepAction; - QAction * m_mouseAction; - QAction * m_viewImageAction; - QAction * m_menuBarAction; - - QAction * m_scriptReloadAction; - QAction * m_scriptRunAction; - QAction * m_scriptStopAction; - QAction * m_scriptDebugAction; - - QAction * m_aboutAction; - QAction * m_homepageAction; - - QAction * m_reconnectAction; - QAction * m_shortcutsAction; - QAction * m_toolbarsAction; - - StatusBar * m_pStatusBar; - QToolButton *connectButton; - QMenuBar * mainMenu; - QToolBar *mdiconnectTools, *mdiTools; - -// bool m_bFullScreen; -// bool m_bSwitchBar; - + QMenu *trayMenu; QSystemTrayIcon *tray; - QMenu *trayMenu; + StatusBar *m_pStatusBar; + //function void newWindow(const Param& param, int index = -1); void closeEvent(QCloseEvent *); @@ -215,9 +125,11 @@ void mouseReleaseEvent(QMouseEvent *); void selectStyleMenu(int , int); void iniSetting(); - void initActions(); + void initShortcuts(); - //void loadPref(Config *); + + void groupActions(); + void saveSetting(); void saveShortcuts(); void loadShortcuts(); @@ -225,18 +137,18 @@ void loadToolbars(); void loadSession(); - void addMainMenu(); - void addMainTool(); - void updateKeyToolBar(); QAction * insertThemeItem(const QString &); void setUseTray(bool); private: - static Frame * s_instance; + static Frame * s_instance; + AssistantClient m_assistant; + + QStringList listBasicActions; + QActionGroup* actionsExtra; }; } // namespace QTerm -#endif //QTERMFRAME_H - +#endif //QTERMFRAME_H \ No newline at end of file Modified: trunk/qterm-qt4/src/qtermglobal.h =================================================================== --- trunk/qterm-qt4/src/qtermglobal.h 2010-07-02 11:34:10 UTC (rev 1201) +++ trunk/qterm-qt4/src/qtermglobal.h 2010-07-02 12:35:00 UTC (rev 1202) @@ -14,6 +14,7 @@ #include "qtermparam.h" +#include <QtCore/QTranslator> #include <QtCore/QMutex> #include <QtCore/QString> #include <QtCore/QMap> @@ -31,7 +32,7 @@ Q_OBJECT public: enum Language { - SimpilifiedChinese, + SimplifiedChinese, TraditionalChinese, English }; @@ -48,6 +49,13 @@ Simplified_To_Traditional, Traditional_To_Simplified }; + + enum Position { + Hide = 0, + Left, + Right + }; + struct Pref { Conversion XIM; int nWordWrap; @@ -83,7 +91,6 @@ bool isOK(); Pref m_pref; void loadPrefence(); - enum Position {Hide, Left, Right}; bool isBossColor() const; const QString & escapeString() const; Conversion clipConversion() const; @@ -91,20 +98,21 @@ Position scrollPosition() const; bool isFullScreen() const; bool showSwitchBar() const; - bool showToolBar(const QString & toolbar); - const QString & style() const; + bool showStatusBar() const; + bool showMenuBar() const; + const QString & style() const; + void setClipConversion(Conversion conversionId); void setEscapeString(const QString & escapeString); void setScrollPosition(Position position); void setStatusBar(bool isShow); //Better name? + void setMenuBar(bool isShow); void setBossColor(bool isBossColor); void setFullScreen(bool isFullscreen); void setSwitchBar(bool isShow); void setLanguage(const Language language); void setStyle(const QString & style); - void setShowToolBar(const QString & toolbar, bool isShown); - void saveShowToolBar(); void loadConfig(); //TODO: Merge with iniSettings void saveConfig(); QByteArray loadGeometry(); @@ -143,8 +151,10 @@ Position m_scrollPos; bool m_fullScreen; bool m_switchBar; + bool m_menuBar; Language m_language; - QMap<QString, bool> m_showToolBar; + QTranslator *m_translatorQT; + QTranslator *m_translatorQTerm; #ifdef KWALLET_ENABLED Wallet * m_wallet; #endif // KWALLET_ENABLED Modified: trunk/qterm-qt4/src/qtermwindow.h =================================================================== --- trunk/qterm-qt4/src/qtermwindow.h 2010-07-02 11:34:10 UTC (rev 1201) +++ trunk/qterm-qt4/src/qtermwindow.h 2010-07-02 12:35:00 UTC (rev 1202) @@ -88,27 +88,46 @@ return m_nAddrIndex; } + + public slots: + // File + void on_actionDisconnect_triggered(); + // Edit + void on_actionCopy_triggered(); + void on_actionPaste_triggered(); + void on_actionRectangle_Selection_toggled(bool rect) { m_bRectCopy = rect; } + void on_actionCopy_w_Color_toggled(bool color) { m_bColorCopy = color; } + void on_actionAuto_Copy_toggled(bool automatic) { m_bAutoCopy = automatic; } + void on_actionPaste_w_Wrodwrap(bool wordwrap) { m_bWordWrap = wordwrap; } + // View + void on_actionRefresh_triggered(); + void on_actionBoss_Color_toggled(bool); + // BBS + void on_actionAuto_Reply_toggled(bool); + void on_actionAnti_Idle_toggled(bool); + void on_actionCopy_Article_triggered(); + void on_actionView_Message_triggered(); + void on_actionBeep_on_message_toggled(bool beep) { m_bBeep = beep; } + void on_actionSupport_Mouse_toggled(bool mouse) { m_bMouse = mouse; } + + // Option + void on_actionCurrent_Session_Setting_triggered(); + // Script + void on_actionRun_triggered(); + void on_actionStop_triggered(); + void on_actionDebug_Console_triggered(); + void on_actionReload_Script_triggered(); + +public slots: // ui - void copy(); - void paste(); - void copyArticle(); - void setting(); - void runScript(const QString & filename=""); - void stopScript(); - void debugConsole(); void reconnect(); void sendParsedString(const QString &); void showIP(); void inputHandle(const QString & text); public: - void disconnect(); - void refresh(); - void viewMessages(); - void autoReply(bool); - void antiIdle(bool); - void initScript(); + void runScript(const QString & filename=""); void externInput(const QString &); void getHttpHelper(const QString&, bool); void osdMessage(const QString &, int type, int duration); @@ -148,11 +167,12 @@ void httpDone(QObject*); // decode - void setMouseMode(bool); + void setMouseMode(bool on ) { m_bMouseX11 = on; } void jobDone(int); void showArticle(const QString text); protected: + // Mouse Events void mouseDoubleClickEvent(QMouseEvent *); void mouseMoveEvent(QMouseEvent *); void mousePressEvent(QMouseEvent *); @@ -161,12 +181,6 @@ void enterEvent(QEvent *); void leaveEvent(QEvent *); -// void customEvent( QCustomEvent * ); - /* - void imStartEvent (QIMEvent *); - void imComposeEvent (QIMEvent *); - void imEndEvent (QIMEvent *); - */ void reconnectProcess(); void connectionClosed(); void doAutoLogin(); @@ -181,6 +195,8 @@ void keyPressEvent(QKeyEvent *); void loadKeyboardTranslator(const QString & profile); + + void groupActions(); Screen * m_pScreen; Decode * m_pDecode; @@ -261,8 +277,8 @@ BBS * m_pBBS; HostInfo * m_hostInfo; // menu and toolbar state - bool m_bCopyColor; - bool m_bCopyRect; + bool m_bColorCopy; + bool m_bRectCopy; bool m_bAutoCopy; bool m_bWordWrap; bool m_bAntiIdle; Modified: trunk/qterm-qt4/src/qtermwindowbase.h =================================================================== --- trunk/qterm-qt4/src/qtermwindowbase.h 2010-07-02 11:34:10 UTC (rev 1201) +++ trunk/qterm-qt4/src/qtermwindowbase.h 2010-07-02 12:35:00 UTC (rev 1202) @@ -2,6 +2,7 @@ #define QTERMWINDOWBASE_H #include <QMdiSubWindow> +#include <QMap> namespace QTerm { @@ -16,9 +17,15 @@ virtual ~WindowBase() {} bool hasAction(const QString& act){return listActions.contains(act);} - + bool isActionChecked(const QString& act) { + if (mapToggleStates.contains(act)) + return *mapToggleStates[act]; + else + return false; + } protected: QStringList listActions; + QMap<QString, bool*> mapToggleStates; }; } // namespace QTerm This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-07-02 11:34:17
|
Revision: 1201 http://qterm.svn.sourceforge.net/qterm/?rev=1201&view=rev Author: sidos Date: 2010-07-02 11:34:10 +0000 (Fri, 02 Jul 2010) Log Message: ----------- clear warnings Modified Paths: -------------- trunk/qterm-qt4/src/qtermconvert.cpp Modified: trunk/qterm-qt4/src/qtermconvert.cpp =================================================================== --- trunk/qterm-qt4/src/qtermconvert.cpp 2010-07-01 09:12:56 UTC (rev 1200) +++ trunk/qterm-qt4/src/qtermconvert.cpp 2010-07-02 11:34:10 UTC (rev 1201) @@ -15,10 +15,10 @@ #include <QtCore/QTextCodec> #include <QtCore/QByteArray> -#define BtoG_bad1 0xa1 -#define BtoG_bad2 0xf5 -#define GtoB_bad1 0xa1 -#define GtoB_bad2 0xbc +#define BtoG_bad1 '\xa1' +#define BtoG_bad2 '\xf5' +#define GtoB_bad1 '\xa1' +#define GtoB_bad2 '\xbc' #define HIGHBYTE(word) (word)>>8 & 0x00ff #define LOWBYTE(word) (word) & 0x00ff This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-07-01 09:13:04
|
Revision: 1200 http://qterm.svn.sourceforge.net/qterm/?rev=1200&view=rev Author: sidos Date: 2010-07-01 09:12:56 +0000 (Thu, 01 Jul 2010) Log Message: ----------- this is a major rewrite of frame->subwindow signal passing based on experiments done in branch/frame. it opens possibilities of ansi editor and webbrowser integration. Modified Paths: -------------- trunk/qterm-qt4/src/CMakeLists.txt trunk/qterm-qt4/src/qtermframe.cpp trunk/qterm-qt4/src/qtermglobal.cpp trunk/qterm-qt4/src/qtermscreen.cpp trunk/qterm-qt4/src/qtermwindow.cpp trunk/qterm-qt4/src/ui/mainframe.ui Modified: trunk/qterm-qt4/src/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/CMakeLists.txt 2010-06-18 15:00:23 UTC (rev 1199) +++ trunk/qterm-qt4/src/CMakeLists.txt 2010-07-01 09:12:56 UTC (rev 1200) @@ -105,6 +105,7 @@ ui_articledialog.h ui_imageviewer.h ui_keydialog.h + ui_mainframe.h ui_msgdialog.h ui_prefdialog.h ui_quickdialog.h Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2010-06-18 15:00:23 UTC (rev 1199) +++ trunk/qterm-qt4/src/qtermframe.cpp 2010-07-01 09:12:56 UTC (rev 1200) @@ -87,10 +87,12 @@ s_instance = this; setAttribute(Qt::WA_DeleteOnClose); - m_MdiArea = new QMdiArea(this); - m_MdiArea->setViewMode(QMdiArea::TabbedView); + setupUi(this); - setCentralWidget(m_MdiArea); + mdiArea->setViewMode(QMdiArea::TabbedView); + connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), + this, SLOT(windowActivated(QMdiSubWindow*)) ); + setCentralWidget(mdiArea); tray = 0; @@ -109,13 +111,8 @@ initShortcuts(); -//set menubar - initActions(); - - addMainMenu(); - //setup toolbar - addMainTool(); + loadToolbars(); // add the custom defined key updateKeyToolBar(); @@ -125,11 +122,25 @@ loadShortcuts(); -// diaable some menu & toolbar - enableMenuToolBar(false); + initThemeMenu(); + initToolbarMenu(); - initThemesMenu(); + connect(menuWindow, SIGNAL(aboutToShow()), + this, SLOT(windowsMenuAboutToShow())); + connect(actionQuit, SIGNAL(triggered()), + this, SLOT(confirmExitQTerm())); + + connectMenu = new QMenu(this); + QToolButton * connectButton = qobject_cast<QToolButton *> (terminalToolBar->widgetForAction(actionConnect)); + connectButton->setObjectName("buttonConnect"); + + connect(connectMenu, SIGNAL(aboutToShow()), this, SLOT(connectMenuAboutToShow())); + connectButton->setMenu(connectMenu); + connectButton->setPopupMode(QToolButton::InstantPopup); + + groupActions(); + installEventFilter(this); } @@ -138,8 +149,16 @@ { } -//initialize setting from qterm.cfg +QMenu * Frame::createPopupMenu() +{ + QMenu * menuContext = QMainWindow::createPopupMenu(); + menuContext->addAction(actionMenubar); + return menuContext; +} +/********************************************************* + * Initialize and Finalize Routines * + *********************************************************/ void Frame::iniSetting() { Global::instance()->loadConfig(); @@ -147,39 +166,36 @@ restoreGeometry(Global::instance()->loadGeometry()); restoreState(Global::instance()->loadState()); if (Global::instance()->isFullScreen()) { - m_fullAction->setChecked(true); + actionFullscreen->setChecked(true); showFullScreen(); } - mdiTools->setVisible(Global::instance()->showToolBar(mdiTools->objectName())); - mdiconnectTools->setVisible(Global::instance()->showToolBar(mdiconnectTools->objectName())); - key->setVisible(Global::instance()->showToolBar(key->objectName())); - theme = Global::instance()->style(); + QString theme = Global::instance()->style(); QStyle * style = QStyleFactory::create(theme); if (style) qApp->setStyle(style); //language if (Global::instance()->language() == Global::English) - m_engAction->setChecked(true); - else if (Global::instance()->language() == Global::SimpilifiedChinese) - m_chsAction->setChecked(true); + actionEnglish->setChecked(true); + else if (Global::instance()->language() == Global::SimplifiedChinese) + actionSimplified_Chinese->setChecked(true); else if (Global::instance()->language() == Global::TraditionalChinese) - m_chtAction->setChecked(true); + actionTraditional_Chinese->setChecked(true); else - m_engAction->setChecked(true); + actionEnglish->setChecked(true); - m_noescAction->setChecked(true); + actionNone_Color->setChecked(true); switch (Global::instance()->clipConversion()) { case Global::No_Conversion: - m_NoConvAction->setChecked(true); + actionNone->setChecked(true); break; case Global::Simplified_To_Traditional: - m_S2TAction->setChecked(true); + actionCHS_CHT->setChecked(true); break; case Global::Traditional_To_Simplified: - m_T2SAction->setChecked(true); + actionCHT_CHS->setChecked(true); break; default: qDebug("ClipboardConversion: we should not be here"); @@ -187,19 +203,19 @@ } if (Global::instance()->scrollPosition() == Global::Hide) { - m_scrollHideAction->setChecked(true); + actionScroll_Hide->setChecked(true); } else if (Global::instance()->scrollPosition() == Global::Left) { - m_scrollLeftAction->setChecked(true); + actionScroll_Left->setChecked(true); } else { - m_scrollRightAction->setChecked(true); + actionScroll_Right->setChecked(true); } - m_switchAction->setChecked(Global::instance()->showSwitchBar()); - if (Global::instance()->showSwitchBar()) - statusBar()->show(); - else - statusBar()->hide(); + actionStatusbar->setChecked(Global::instance()->showStatusBar()); + statusBar()->setVisible(Global::instance()->showStatusBar()); + + actionMenubar->setChecked(Global::instance()->showMenuBar()); + menuBar()->setVisible(Global::instance()->showMenuBar()); setUseTray(Global::instance()->m_pref.bTray); } @@ -213,8 +229,11 @@ saveToolbars(); } +/********************************************************* + * SLOTS * + *********************************************************/ //addressbook -void Frame::addressBook() +void Frame::on_actionAddressBook_triggered() { addrDialog addr(this, false); @@ -224,7 +243,7 @@ } //quicklogin -void Frame::quickLogin() +void Frame::on_actionQuick_Login_triggered() { quickDialog quick(this); @@ -235,10 +254,11 @@ } } +//quit bool Frame::confirmExitQTerm() { QList<QVariant> sites; - QList<QMdiSubWindow *> windows = m_MdiArea->subWindowList(); + QList<QMdiSubWindow *> windows = mdiArea->subWindowList(); QStringList titleList; for (int i = 0; i < int(windows.count()); ++i) { if ((qobject_cast<Window *>(windows.at(i)))->isConnected()) { @@ -260,11 +280,10 @@ // We should never reach here; return true; } - void Frame::saveAndDisconnect() { QList<QVariant> sites; - QList<QMdiSubWindow *> windows = m_MdiArea->subWindowList(); + QList<QMdiSubWindow *> windows = mdiArea->subWindowList(); QStringList titleList; for (int i = 0; i < int(windows.count()); ++i) { if ((qobject_cast<Window *>(windows.at(i)))->isConnected()) { @@ -286,29 +305,32 @@ //create a new display window void Frame::newWindow(const Param& param, int index) { - Window * window = new Window(this, param, index, m_MdiArea, - 0); - QMdiSubWindow * w = m_MdiArea->addSubWindow(window); - window->setWindowTitle(param.m_strName); + Window * window = new Window(this, param, index, mdiArea, 0); + window->setWindowTitle(param.m_strName); window->setWindowIcon(QIcon(":/pic/tabpad.png")); window->setAttribute(Qt::WA_DeleteOnClose); - if (m_menuBarAction->isChecked()) { - w->setWindowFlags(Qt::FramelessWindowHint); - } window->showMaximized(); - m_MdiArea->setActiveSubWindow(window); + mdiArea->addSubWindow(window); + mdiArea->setActiveSubWindow(window); + connect(window, SIGNAL(destroyed(QObject*)), + this, SLOT(windowClosed(QObject*))); } //slot Help->About QTerm -void Frame::aboutQTerm() +void Frame::on_actionAbout_QTerm_triggered() { aboutDialog about(this); - about.exec(); } +//slot Help->About Qt +void Frame::on_actionAbout_Qt_triggered() +{ + qApp->aboutQt(); +} + //slot Help->Homepage -void Frame::homepage() +void Frame::on_actionQTerm_Online_triggered() { QString strUrl = "http://www.qterm.org"; Global::instance()->openUrl(strUrl); @@ -317,14 +339,14 @@ //slot Windows menu aboutToShow void Frame::windowsMenuAboutToShow() { - windowsMenu->clear(); - QAction * cascadeAction = windowsMenu->addAction(tr("&Cascade"), m_MdiArea, SLOT(cascadeSubWindows())); - QAction * tileAction = windowsMenu->addAction(tr("&Tile"), m_MdiArea, SLOT(tileSubWindows())); - if (m_MdiArea->subWindowList().isEmpty()) { + menuWindow->clear(); + QAction * cascadeAction = menuWindow->addAction(tr("&Cascade"), mdiArea, SLOT(cascadeSubWindows())); + QAction * tileAction = menuWindow->addAction(tr("&Tile"), mdiArea, SLOT(tileSubWindows())); + if (mdiArea->subWindowList().isEmpty()) { cascadeAction->setEnabled(false); tileAction->setEnabled(false); } - windowsMenu->addSeparator(); + menuWindow->addSeparator(); #ifdef Q_OS_MACX // used to dock the programe @@ -332,16 +354,16 @@ windowsMenu->addAction(tr("&Main Window"), this, SLOT(trayShow())); #endif - QList<QMdiSubWindow *> windows = m_MdiArea->subWindowList(); + QList<QMdiSubWindow *> windows = mdiArea->subWindowList(); QActionGroup * windowsGroup = new QActionGroup(this); windowsGroup->setExclusive(true); for (int i = 0; i < int(windows.count()); ++i) { - QAction * idAction = windowsMenu->addAction(windows.at(i)->windowTitle(), + QAction * idAction = menuWindow->addAction(windows.at(i)->windowTitle(), this, SLOT(windowsMenuActivated())); idAction->setCheckable(true); idAction->setData(i); windowsGroup->addAction(idAction); - idAction->setChecked(m_MdiArea->activeSubWindow() == windows.at(i)); + idAction->setChecked(mdiArea->activeSubWindow() == windows.at(i)); } } @@ -354,7 +376,7 @@ return; } int id = qobject_cast<QAction *>(action)->data().toInt(); - Window * w = qobject_cast<Window *>(m_MdiArea->subWindowList().at(id)); + Window * w = qobject_cast<Window *>(mdiArea->subWindowList().at(id)); if (w) { w->setFocus(); w->showMaximized(); @@ -363,7 +385,7 @@ } } -void Frame::popupConnectMenu() +void Frame::connectMenuAboutToShow() { connectMenu->clear(); @@ -390,38 +412,97 @@ newWindow(param, id); } +/********************************************************* + * Window Switch Management * + *********************************************************/ +void Frame::windowClosed(QObject*w) +{ + QList<QMdiSubWindow *> listWindow = mdiArea->subWindowList(); + // if no window left, only show basic actions + if(listWindow.count()==0) { + QList<QAction*> actions = findChildren<QAction*>(QRegExp("action*")); + foreach(QAction* action, actions) + action->setVisible(listBasicActions.contains(action->objectName()) + || action->actionGroup()!=actionsExtra); + } +} + +void Frame::windowActivated(QMdiSubWindow * w) +{ + WindowBase * wb=qobject_cast<WindowBase*>(w); + if(wb==0) + return; + + QList<QAction*> actions = findChildren<QAction*>(QRegExp("action*")); + foreach(QAction* action, actions) + { + // only show actions belonging to BasicActions or WindowActions + action->setVisible(listBasicActions.contains(action->objectName()) + || action->actionGroup()!=actionsExtra + || wb->hasAction(action->objectName())); + // update checkable actions status + if (wb->hasAction(action->objectName()) && action->isCheckable()) + action->setChecked(wb->isActionChecked(action->objectName())); + } +} + +void Frame :: actionsDispatcher(QAction* action) +{ + WindowBase * wb=qobject_cast<WindowBase*>(mdiArea->activeSubWindow()); + if(wb==0) + return; + if (action->isCheckable()) + { + QString nameSlot="on_"+action->objectName()+"_toggled"; + if(wb->hasAction(action->objectName())) + { + bool ret=QMetaObject::invokeMethod(wb, + nameSlot.toLatin1().constData(), Q_ARG(bool, action->isChecked())); + if(!ret) + qWarning("Failed to execute %s", + nameSlot.toLatin1().constData()); + } + } + else + { + QString nameSlot="on_"+action->objectName()+"_triggered"; + if(wb->hasAction(action->objectName())) + { + bool ret=QMetaObject::invokeMethod(wb, + nameSlot.toLatin1().constData()); + if(!ret) + qWarning("Failed to execute %s", + nameSlot.toLatin1().constData()); + } + + } +} + void Frame::switchWin(int id) { - QList<QMdiSubWindow *> windows = m_MdiArea->subWindowList(); + QList<QMdiSubWindow *> windows = mdiArea->subWindowList(); if (windows.count() <= id && id < 200) return; if (id == 200) { - m_MdiArea->activatePreviousSubWindow(); + mdiArea->activatePreviousSubWindow(); return; } if (id == 201 || id == 202) { - m_MdiArea->activateNextSubWindow(); + mdiArea->activateNextSubWindow(); return; } QMdiSubWindow *w = windows.at(id); if (w != NULL) { - m_MdiArea->setActiveSubWindow(w); + mdiArea->setActiveSubWindow(w); } } -//slot draw something e.g. logo in the background -//TODO : draw a pixmap in the background -void Frame::paintEvent(QPaintEvent *) -{ - -} - void Frame::closeEvent(QCloseEvent * clse) { - QList<QMdiSubWindow *> windows = m_MdiArea->subWindowList(); + QList<QMdiSubWindow *> windows = mdiArea->subWindowList(); for (int i = 0; i < int(windows.count()); ++i) { if (((Window *)windows.at(i))->isConnected()) { @@ -441,70 +522,34 @@ void Frame::updateLang(QAction * action) { - QMessageBox::information(this, "QTerm", - tr("This will take effect after restart,\nplease close all windows and restart.")); - Config * conf = Global::instance()->fileCfg(); - conf->setItemValue("global", "language", action->data().toString()); - conf->save(); + if (action == actionEnglish) + Global::instance()->setLanguage(Global::English); + else if (action == actionSimplified_Chinese) + Global::instance()->setLanguage(Global::SimplifiedChinese); + else if (action == actionTraditional_Chinese) + Global::instance()->setLanguage(Global::TraditionalChinese); } void Frame::connectIt() { - if (m_MdiArea->activeSubWindow() == NULL) { + if (mdiArea->activeSubWindow() == NULL) { Param param; Global::instance()->loadAddress(-1, param); newWindow(param); } else - if (!qobject_cast<Window *>(m_MdiArea->activeSubWindow())->isConnected()) - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->reconnect(); + if (!qobject_cast<Window *>(mdiArea->activeSubWindow())->isConnected()) + qobject_cast<Window *>(mdiArea->activeSubWindow())->reconnect(); } -void Frame::disconnect() -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->disconnect(); -} -void Frame::copy() -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->copy(); -} -void Frame::paste() -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->paste(); -} -void Frame::copyRect(bool isEnabled) -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bCopyRect = isEnabled; -} - -void Frame::copyColor(bool isEnabled) -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bCopyColor = isEnabled; -} - -void Frame::copyArticle() -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->copyArticle(); -} - -void Frame::autoCopy(bool isEnabled) -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bAutoCopy = isEnabled; -} - -void Frame::wordWrap(bool isEnabled) -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bWordWrap = isEnabled; -} - void Frame::updateESC(QAction * action) { - if (action->objectName() == "actionNoESC") { + if (action == actionNone_Color) { Global::instance()->setEscapeString(""); - } else if (action->objectName() == "actionESCESC") { + } else if (action == actionESC_ESC) { Global::instance()->setEscapeString("^[^[["); - } else if (action->objectName() == "actionUESC") { + } else if (action == actionCtrl_U) { Global::instance()->setEscapeString("^u["); - } else if (action->objectName() == "actionCustomESC") { + } else if (action == actionCustom) { bool ok; QString strEsc = QInputDialog::getText(this, "define escape", "scape string *[", QLineEdit::Normal, Global::instance()->escapeString(), &ok); if (ok) @@ -516,23 +561,19 @@ void Frame::updateCodec(QAction * action) { - if (action->objectName() == "actionNoConversion") { + if (action == actionNone) { Global::instance()->setClipConversion(Global::No_Conversion); - } else if (action->objectName() == "actionS2T") { + } else if (action == actionCHS_CHT) { Global::instance()->setClipConversion(Global::Simplified_To_Traditional); - } else if (action->objectName() == "actionT2S") { + } else if (action == actionCHT_CHS) { Global::instance()->setClipConversion(Global::Traditional_To_Simplified); } else { qDebug("updateCodec: should not be here"); } } -void Frame::refresh() -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->refresh(); -} -void Frame::uiFont() +void Frame::on_actionFont_triggered() { bool ok; QFont font = QFontDialog::getFont(&ok, qApp->font()); @@ -545,25 +586,13 @@ } } -void Frame::hideMenuBar(bool hide) +void Frame::on_actionMenubar_toggled(bool show) { - if (hide) { - menuBar()->hide(); - QList<QMdiSubWindow *> windows = m_MdiArea->subWindowList(); - foreach (QMdiSubWindow * window, windows) { - window->setWindowFlags(Qt::FramelessWindowHint); - } - } - else { - QList<QMdiSubWindow *> windows = m_MdiArea->subWindowList(); - foreach (QMdiSubWindow * window, windows) { - window->setWindowFlags(Qt::SubWindow); - } - menuBar()->show(); - } + Global::instance()->setMenuBar(show); + menuBar()->setVisible(show); } -void Frame::triggerFullScreen(bool isFullScreen) +void Frame::on_actionFullscreen_triggered(bool isFullScreen) { Global::instance()->setFullScreen(isFullScreen); @@ -571,50 +600,50 @@ if (isFullScreen) { Global::instance()->saveGeometry(saveGeometry()); Global::instance()->saveState(saveState()); - //menuBar()->hide(); - mdiTools->hide(); - mdiconnectTools->hide(); - key->hide(); - //showStatusBar(); - //showSwitchBar(); + mainToolBar->hide(); + terminalToolBar->hide(); + keyToolBar->hide(); showFullScreen(); } else { - //menuBar()->show(); restoreGeometry(Global::instance()->loadGeometry()); restoreState(Global::instance()->loadState()); emit scrollChanged(); showNormal(); - //showStatusBar(); - //showSwitchBar(); } - m_fullAction->setChecked(isFullScreen); + actionFullscreen->setChecked(isFullScreen); } -void Frame::bosscolor() +void Frame::initToolbarMenu() { - bool tmp = !Global::instance()->isBossColor(); - Global::instance()->setBossColor(tmp); - - emit bossColor(); - - m_bossAction->setChecked(tmp); + menuToolbar->clear(); + foreach(QToolBar *toolbar, findChildren<QToolBar *>()) + menuToolbar->addAction(toolbar->toggleViewAction()); } -void Frame::initThemesMenu() +void Frame::initThemeMenu() { - themesMenu->clear(); + menuTheme->clear(); QActionGroup * themesGroup = new QActionGroup(this); QStringList styles = QStyleFactory::keys(); for (QStringList::ConstIterator it = styles.begin(); it != styles.end(); it++) themesGroup->addAction(insertThemeItem(*it)); - connect(themesGroup, SIGNAL(triggered(QAction*)), this, SLOT(themesMenuActivated(QAction*))); + connect(themesGroup, SIGNAL(triggered(QAction*)), + this, SLOT(themesMenuActivated(QAction*))); } - +QAction * Frame::insertThemeItem(const QString & themeitem) +{ + QAction * idAction = new QAction(themeitem, this); + menuTheme->addAction(idAction); + idAction->setCheckable(true); + idAction->setChecked( + themeitem.compare(qApp->style()->objectName(), Qt::CaseInsensitive)==0); + return idAction; +} void Frame::themesMenuActivated(QAction * action) { - theme = action->text(); + QString theme = action->text(); QStyle * style = QStyleFactory::create(theme); if (style) { qApp->setStyle(style); @@ -624,11 +653,11 @@ void Frame::updateScroll(QAction * action) { - if (action->objectName() == "actionHide") { + if (action == actionScroll_Hide) { Global::instance()->setScrollPosition(Global::Hide); - } else if (action->objectName() == "actionLeft") { + } else if (action == actionScroll_Left) { Global::instance()->setScrollPosition(Global::Left); - } else if (action->objectName() == "actionRight") { + } else if (action == actionScroll_Right) { Global::instance()->setScrollPosition(Global::Right); } else { qDebug("updateScroll: should not be here"); @@ -636,29 +665,15 @@ emit scrollChanged(); } -void Frame::updateSwitchBar(bool isEnabled) +void Frame::on_actionStatusbar_toggled(bool isEnabled) { - Global::instance()->setSwitchBar(isEnabled); - - if (Global::instance()->showSwitchBar()) - statusBar()->show(); - else - statusBar()->hide(); -} - -void Frame::updateStatusBar(bool isEnabled) -{ Global::instance()->setStatusBar(isEnabled); - + statusBar()->setVisible(isEnabled); emit statusBarChanged(isEnabled); } -void Frame::setting() +void Frame::on_actionDefault_Session_Setting_triggered() { - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->setting(); -} -void Frame::defaultSetting() -{ addrDialog set(this, true); if (Global::instance()->addrCfg()->hasSection("default")) @@ -672,7 +687,7 @@ } } -void Frame::preference() +void Frame::on_actionPreference_triggered() { prefDialog pref(this); @@ -682,7 +697,7 @@ } } -void Frame::keySetup() +void Frame::on_actionKey_Setup_triggered() { keyDialog keyDlg(this); if (keyDlg.exec() == 1) { @@ -690,7 +705,7 @@ } } -void Frame::printScreen() +void Frame::on_actionPrint_triggered() { QPrinter printer(QPrinter::HighResolution); QPrintDialog *dialog = new QPrintDialog(&printer, this); @@ -699,78 +714,21 @@ return; QPainter painter; painter.begin(&printer); - QPixmap screen = QPixmap::grabWidget(qobject_cast<Window *>(m_MdiArea->activeSubWindow())); + QPixmap screen = QPixmap::grabWidget(qobject_cast<Window *>(mdiArea->activeSubWindow())); QPixmap target = screen.scaled(printer.pageRect().width(),printer.pageRect().height(),Qt::KeepAspectRatio,Qt::SmoothTransformation); painter.drawPixmap(0,0,target); painter.end(); } - -void Frame::antiIdle(bool isEnabled) +void Frame::on_actionImage_Viewer_triggered() { - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->antiIdle(isEnabled); -} - -void Frame::autoReply(bool isEnabled) -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->autoReply(isEnabled); -} - -void Frame::viewMessages() -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->viewMessages(); -} - -void Frame::updateMouse(bool isEnabled) -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bMouse = isEnabled; - m_mouseAction->setChecked(qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bMouse); -} - -void Frame::viewImages() -{ Image *pViewer = new Image(Global::instance()->m_pref.strPoolPath); pViewer->show(); } -void Frame::updateBeep(bool isEnabled) -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bBeep = isEnabled; - m_beepAction->setChecked(qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bBeep); -} - -void Frame::reconnect(bool isEnabled) -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bReconnect = isEnabled; -} - -void Frame::debugConsole() -{ -#ifndef SCRIPTTOOLS_ENABLED - QMessageBox::information(this, "QTerm", - tr("You need to enable the script engine debugger to use this feature. Please recompile QTerm with the debugger enabled (need Qt 4.5 or newer version)")); -#else - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->debugConsole(); -#endif -} - -void Frame::reloadScript() -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->initScript(); -} - -void Frame::runScript() -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->runScript(); -} -void Frame::stopScript() -{ - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->stopScript(); -} - void Frame::keyClicked(int id) { - if (qobject_cast<Window *>(m_MdiArea->activeSubWindow()) == NULL) + if (qobject_cast<Window *>(mdiArea->activeSubWindow()) == NULL) return; Config * conf = Global::instance()->fileCfg(); @@ -780,42 +738,14 @@ QString strTmp = conf->getItemValue("key", strItem).toString(); if (strTmp[0] == '0') { // key - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->externInput(strTmp.mid(1)); + qobject_cast<Window *>(mdiArea->activeSubWindow())->externInput(strTmp.mid(1)); } else if (strTmp[0] == '1') { // script - qobject_cast<Window *>(m_MdiArea->activeSubWindow())->runScript(strTmp.mid(1)); + qobject_cast<Window *>(mdiArea->activeSubWindow())->runScript(strTmp.mid(1)); } else if (strTmp[0] == '2') { // program system((strTmp.mid(1) + " &").toLocal8Bit()); } } -void Frame::addMainTool() -{ - mdiTools = addToolBar("Main ToolBar"); - mdiTools->setObjectName("mainToolBar"); - - QAction * connectAction = new QAction(QIcon(":/pic/connect.png"), tr("&Connect"), this); - connectAction->setObjectName("actionConnectButton"); - mdiTools->addAction(connectAction); - connectMenu = new QMenu(this); - - QToolButton * connectButton = qobject_cast<QToolButton *> (mdiTools->widgetForAction(connectAction)); - connectButton->setObjectName("buttonConnect"); - - connect(connectMenu, SIGNAL(aboutToShow()), this, SLOT(popupConnectMenu())); - connectButton->setMenu(connectMenu); - connectButton->setPopupMode(QToolButton::InstantPopup); - - // custom define - key = addToolBar("Custom Key"); - key->setObjectName("customKeyToolBar"); - - // the toolbar - mdiconnectTools = addToolBar("BBS Operations"); - mdiconnectTools->setObjectName("bbsOperationsToolBar"); - - loadToolbars(); -} - void Frame::initShortcuts() { int i = 0; @@ -853,438 +783,24 @@ connect(windowMapper, SIGNAL(mapped(int)), this, SLOT(switchWin(int))); } -void Frame::initActions() -{ - m_connectAction = new QAction(QIcon(":/pic/connect.png"), tr("&Connect"), this); - m_connectAction->setObjectName("actionConnect"); - m_disconnectAction = new QAction(QIcon(":/pic/disconnect.png"), tr("&Disconnect"), this); - m_disconnectAction->setObjectName("actionDisconnect"); - m_addressAction = new QAction(QIcon(":/pic/addr.png"), tr("&Address Book..."), this); - m_addressAction->setObjectName("actionAddress"); - m_quickConnectAction = new QAction(QIcon(":/pic/quick.png"), tr("&Quick Login..."), this); - m_quickConnectAction->setObjectName("actionQuickConnect"); - m_printAction = new QAction(tr("&Print..."), this); - m_printAction->setObjectName("actionPrint"); - m_exitAction = new QAction(tr("&Exit"), this); - m_exitAction->setObjectName("actionExit"); - - m_copyAction = new QAction(QIcon(":/pic/copy.png"), tr("&Copy"), this); - m_copyAction->setObjectName("actionCopy"); - m_pasteAction = new QAction(QIcon(":/pic/paste.png"), tr("&Paste"), this); - m_pasteAction->setObjectName("actionPaste"); - m_colorCopyAction = new QAction(QIcon(":/pic/color-copy.png"), tr("C&opy With Color"), this); - m_colorCopyAction->setObjectName("actionColorCopy"); - m_colorCopyAction->setCheckable(true); - m_rectAction = new QAction(QIcon(":/pic/rect.png"), tr("&Rectangle Select"), this); - m_rectAction->setObjectName("actionRect"); - m_rectAction->setCheckable(true); - m_autoCopyAction = new QAction(tr("Auto Copy &Select"), this); - m_autoCopyAction->setObjectName("actionAutoCopy"); - m_autoCopyAction->setCheckable(true); - m_wwrapAction = new QAction(tr("P&aste With Wordwrap"), this); - m_wwrapAction->setObjectName("actionWordWrap"); - m_wwrapAction->setCheckable(true); - - QActionGroup * escapeGroup = new QActionGroup(this); - m_noescAction = new QAction(tr("&None"), this); - m_noescAction->setObjectName("actionNoESC"); - m_noescAction->setCheckable(true); - m_escescAction = new QAction(tr("&ESC ESC ["), this); - m_escescAction->setObjectName("actionESCESC"); - m_escescAction->setCheckable(true); - m_uescAction = new QAction(tr("Ctrl+&U ["), this); - m_uescAction->setObjectName("actionUESC"); - m_uescAction->setCheckable(true); - m_customescAction = new QAction(tr("&Custom..."), this); - m_customescAction->setObjectName("actionCustomESC"); - m_customescAction->setCheckable(true); - escapeGroup->addAction(m_noescAction); - escapeGroup->addAction(m_escescAction); - escapeGroup->addAction(m_uescAction); - escapeGroup->addAction(m_customescAction); - - QActionGroup * codecGroup = new QActionGroup(this); - m_NoConvAction = new QAction(tr("&No Conversion"), this); - m_NoConvAction->setObjectName("actionNoConversion"); - m_NoConvAction->setCheckable(true); - m_S2TAction = new QAction(tr("&Simplified to Traditional"), this); - m_S2TAction->setObjectName("actionS2T"); - m_S2TAction->setCheckable(true); - m_T2SAction = new QAction(tr("&Traditional to Simplified"), this); - m_T2SAction->setObjectName("actionBig5"); - m_T2SAction->setCheckable(true); - codecGroup->addAction(m_NoConvAction); - codecGroup->addAction(m_S2TAction); - codecGroup->addAction(m_T2SAction); - - m_refreshAction = new QAction(QIcon(":/pic/refresh.png"), tr("&Refresh"), this); - m_refreshAction->setObjectName("actionRefresh"); - - QActionGroup * langGroup = new QActionGroup(this); - m_engAction = new QAction(tr("&English"), this); - m_engAction->setObjectName("actionEng"); - m_engAction->setCheckable(true); - m_engAction->setData("eng"); - m_chsAction = new QAction(tr("&Simplified Chinese"), this); - m_chsAction->setObjectName("actionChs"); - m_chsAction->setCheckable(true); - m_chsAction->setData("chs"); - m_chtAction = new QAction(tr("&Traditional Chinese"), this); - m_chtAction->setObjectName("actionCht"); - m_chtAction->setCheckable(true); - m_chtAction->setData("cht"); - langGroup->addAction(m_engAction); - langGroup->addAction(m_chsAction); - langGroup->addAction(m_chtAction); - - m_uiFontAction = new QAction(tr("&UI Font..."), this); - m_uiFontAction->setObjectName("actionUiFont"); - m_fullAction = new QAction(tr("&Full Screen"), this); - m_fullAction->setObjectName("actionFull"); - m_fullAction->setCheckable(true); - addAction(m_fullAction); - m_menuBarAction= new QAction(tr("&Hide Menu Bar"), this); - m_menuBarAction->setObjectName("actionMenuBar"); - m_menuBarAction->setCheckable(true); - addAction(m_menuBarAction); - m_bossAction = new QAction(tr("Boss &Color"), this); - m_bossAction->setObjectName("actionBoss"); - - QActionGroup * scrollGroup = new QActionGroup(this); - m_scrollHideAction = new QAction(tr("&Hide"), this); - m_scrollHideAction->setObjectName("actionHide"); - m_scrollHideAction->setCheckable(true); - m_scrollLeftAction = new QAction(tr("&Left"), this); - m_scrollLeftAction->setObjectName("actionLeft"); - m_scrollLeftAction->setCheckable(true); - m_scrollRightAction = new QAction(tr("&Right"), this); - m_scrollRightAction->setObjectName("actionRight"); - m_scrollRightAction->setCheckable(true); - scrollGroup->addAction(m_scrollHideAction); - scrollGroup->addAction(m_scrollLeftAction); - scrollGroup->addAction(m_scrollRightAction); - - m_switchAction = new QAction(tr("S&witch Bar"), this); - m_switchAction->setObjectName("actionSwitch"); - m_switchAction->setCheckable(true); - - m_currentSessionAction = new QAction(QIcon(":/pic/pref.png"), tr("&Setting For Currrent Session..."), this); - m_currentSessionAction->setObjectName("actionCurrentSession"); - m_defaultAction = new QAction(tr("&Default Setting..."), this); - m_defaultAction->setObjectName("actionDefault"); - m_prefAction = new QAction(tr("&Preference..."), this); - m_prefAction->setObjectName("actionPref"); - - m_copyArticleAction = new QAction(QIcon(":/pic/article.png"), tr("&Copy Article..."), this); - m_copyArticleAction->setObjectName("actionCopyArticle"); - m_antiIdleAction = new QAction(QIcon(":/pic/anti-idle.png"), tr("Anti &Idle"), this); - m_antiIdleAction->setObjectName("actionAntiIdle"); - m_antiIdleAction->setCheckable(true); - m_autoReplyAction = new QAction(QIcon(":/pic/auto-reply.png"), tr("Auto &Reply"), this); - m_autoReplyAction->setObjectName("actionAutoReply"); - m_autoReplyAction->setCheckable(true); - m_viewMessageAction = new QAction(QIcon(":/pic/message.png"), tr("&View Messages..."), this); - m_viewMessageAction->setObjectName("actionViewMessage"); - m_beepAction = new QAction(QIcon(":/pic/sound.png"), tr("&Beep "), this); - m_beepAction->setObjectName("actionBeep"); - m_beepAction->setCheckable(true); - m_mouseAction = new QAction(QIcon(":/pic/mouse.png"), tr("&Mouse Support"), this); - m_mouseAction->setObjectName("actionMouse"); - m_mouseAction->setCheckable(true); - m_viewImageAction = new QAction(tr("&Image Viewer..."), this); - m_viewImageAction->setObjectName("actionViewImage"); - - m_scriptReloadAction = new QAction(tr("&Reload System Script"), this); - m_scriptReloadAction->setObjectName("actionScriptReload"); - m_scriptReloadAction->setEnabled(false); - m_scriptRunAction = new QAction(tr("&Run..."), this); - m_scriptRunAction->setObjectName("actionScriptRun"); - m_scriptRunAction->setEnabled(false); - m_scriptStopAction = new QAction(tr("&Stop"), this); - m_scriptStopAction->setObjectName("actionScriptStop"); - m_scriptStopAction->setEnabled(false); - m_scriptDebugAction = new QAction(tr("&Debug..."), this); - m_scriptDebugAction->setObjectName("actionScriptDebug"); - m_scriptDebugAction->setEnabled(false); - - m_aboutAction = new QAction(tr("About &QTerm"), this); - m_aboutAction->setObjectName("actionAbout"); - m_homepageAction = new QAction(tr("QTerm's &Homepage"), this); - m_homepageAction->setObjectName("actionHomepage"); - - m_reconnectAction = new QAction(QIcon(":/pic/reconnect.png"), tr("Auto Reconnect"), this); - m_reconnectAction->setObjectName("actionReconnect"); - m_reconnectAction->setCheckable(true); - - m_shortcutsAction = new QAction(tr("&Configure Shortcuts..."),this); - m_shortcutsAction->setObjectName("actionShortcuts"); - - m_toolbarsAction = new QAction(tr("Configure &Toolbars..."),this); - m_toolbarsAction->setObjectName("actionToolbars"); - - connect(m_connectAction, SIGNAL(triggered()), this, SLOT(connectIt())); - connect(m_disconnectAction, SIGNAL(triggered()), this, SLOT(disconnect())); - connect(m_addressAction, SIGNAL(triggered()), this, SLOT(addressBook())); - connect(m_quickConnectAction, SIGNAL(triggered()), this, SLOT(quickLogin())); - connect(m_printAction, SIGNAL(triggered()), this, SLOT(printScreen())); - connect(m_exitAction, SIGNAL(triggered()), this, SLOT(confirmExitQTerm())); - - connect(m_copyAction, SIGNAL(triggered()), this, SLOT(copy())); - connect(m_pasteAction, SIGNAL(triggered()), this, SLOT(paste())); - connect(m_colorCopyAction, SIGNAL(toggled(bool)), this, SLOT(copyColor(bool))); - connect(m_rectAction, SIGNAL(toggled(bool)), this, SLOT(copyRect(bool))); - connect(m_autoCopyAction, SIGNAL(toggled(bool)), this, SLOT(autoCopy(bool))); - connect(m_wwrapAction, SIGNAL(toggled(bool)), this, SLOT(wordWrap(bool))); - - connect(escapeGroup, SIGNAL(triggered(QAction*)), this, SLOT(updateESC(QAction*))); - connect(codecGroup, SIGNAL(triggered(QAction*)), this, SLOT(updateCodec(QAction*))); - - connect(m_refreshAction, SIGNAL(triggered()), this, SLOT(refresh())); - - connect(langGroup, SIGNAL(triggered(QAction*)), this, SLOT(updateLang(QAction*))); - - connect(m_uiFontAction, SIGNAL(triggered()), this, SLOT(uiFont())); - connect(m_fullAction, SIGNAL(toggled(bool)), this, SLOT(triggerFullScreen(bool))); - connect(m_menuBarAction, SIGNAL(toggled(bool)), this, SLOT(hideMenuBar(bool))); - connect(m_bossAction, SIGNAL(triggered()), this, SLOT(bosscolor())); - - connect(scrollGroup, SIGNAL(triggered(QAction*)), this, SLOT(updateScroll(QAction*))); - - connect(m_switchAction, SIGNAL(toggled(bool)), this, SLOT(updateSwitchBar(bool))); - - connect(m_currentSessionAction, SIGNAL(triggered()), this, SLOT(setting())); - connect(m_defaultAction, SIGNAL(triggered()), this, SLOT(defaultSetting())); - connect(m_prefAction, SIGNAL(triggered()), this, SLOT(preference())); - - connect(m_copyArticleAction, SIGNAL(triggered()), this, SLOT(copyArticle())); - connect(m_antiIdleAction, SIGNAL(toggled(bool)), this, SLOT(antiIdle(bool))); - connect(m_autoReplyAction, SIGNAL(toggled(bool)), this, SLOT(autoReply(bool))); - connect(m_viewMessageAction, SIGNAL(triggered()), this, SLOT(viewMessages())); - connect(m_beepAction, SIGNAL(toggled(bool)), this, SLOT(updateBeep(bool))); - connect(m_mouseAction, SIGNAL(toggled(bool)), this, SLOT(updateMouse(bool))); - connect(m_viewImageAction, SIGNAL(triggered()), this, SLOT(viewImages())); - - connect(m_scriptReloadAction, SIGNAL(triggered()), this, SLOT(reloadScript())); - connect(m_scriptRunAction, SIGNAL(triggered()), this, SLOT(runScript())); - connect(m_scriptStopAction, SIGNAL(triggered()), this, SLOT(stopScript())); - connect(m_scriptDebugAction, SIGNAL(triggered()), this, SLOT(debugConsole())); - - connect(m_aboutAction, SIGNAL(triggered()), this, SLOT(aboutQTerm())); - connect(m_homepageAction, SIGNAL(triggered()), this, SLOT(homepage())); - - connect(m_reconnectAction, SIGNAL(toggled(bool)), this, SLOT(reconnect(bool))); - connect(m_shortcutsAction, SIGNAL(triggered()), this, SLOT(configShortcuts())); - connect(m_toolbarsAction, SIGNAL(triggered()), this, SLOT(configToolbars())); -} - -void Frame::addMainMenu() -{ - mainMenu = menuBar(); - - QMenu * file = mainMenu->addMenu(tr("File")); - file->addAction(m_connectAction); - file->addAction(m_disconnectAction); - - file->addSeparator(); - file->addAction(m_addressAction); - file->addAction(m_quickConnectAction); - file->addSeparator(); - file->addAction(m_printAction); - file->addSeparator(); - file->addAction(m_exitAction); - - //Edit Menu - QMenu * edit = new QMenu(tr("Edit"), this); - mainMenu->addMenu(edit); - - edit->addAction(m_copyAction); - edit->addAction(m_pasteAction); - edit->addSeparator(); - edit->addAction(m_colorCopyAction); - edit->addAction(m_rectAction); - edit->addAction(m_autoCopyAction); - edit->addAction(m_wwrapAction); - - QMenu * escapeMenu = new QMenu(tr("Paste &with color"), this); - escapeMenu->addAction(m_noescAction); - escapeMenu->addAction(m_escescAction); - escapeMenu->addAction(m_uescAction); - escapeMenu->addAction(m_customescAction); - edit->addMenu(escapeMenu); - - QMenu * codecMenu = new QMenu(tr("Clipboard Chinese &Conversion"), this); - codecMenu->addAction(m_NoConvAction); - codecMenu->addAction(m_S2TAction); - codecMenu->addAction(m_T2SAction); - edit->addMenu(codecMenu); - - //View menu - QMenu * view = new QMenu(tr("View"), this); - mainMenu->addMenu(view); - - view->addAction(m_refreshAction); - view->addSeparator(); - - //language menu - langMenu = new QMenu(tr("&Language"), this); - langMenu->addAction(m_engAction); - langMenu->addAction(m_chsAction); - langMenu->addAction(m_chtAction); - view->addMenu(langMenu); - view->addAction(m_uiFontAction); - - themesMenu = new QMenu(tr("&Themes"), this); - view->addMenu(themesMenu); - - view->addAction(m_bossAction); - - view->addSeparator(); - QMenu *scrollMenu = new QMenu(tr("&ScrollBar"), this); - scrollMenu->addAction(m_scrollHideAction); - scrollMenu->addAction(m_scrollLeftAction); - scrollMenu->addAction(m_scrollRightAction); - view->addMenu(scrollMenu); - view->addAction(m_switchAction); - view->addSeparator(); - view->addAction(m_menuBarAction); - view->addAction(m_fullAction); - - - // Option Menu - QMenu * option = new QMenu(tr("Option"), this); - mainMenu->addMenu(option); - - option->addAction(m_currentSessionAction); - option->addSeparator(); - option->addAction(m_defaultAction); - option->addAction(m_prefAction); - option->addSeparator(); - option->addAction(m_shortcutsAction); - option->addAction(m_toolbarsAction); - - // Special - QMenu * spec = new QMenu(tr("Special"), this); - mainMenu->addMenu(spec); - spec->addAction(m_copyArticleAction); - spec->addAction(m_antiIdleAction); - spec->addAction(m_autoReplyAction); - spec->addAction(m_viewMessageAction); - spec->addAction(m_beepAction); - spec->addAction(m_mouseAction); - spec->addAction(m_viewImageAction); - - - //Script - QMenu * script = new QMenu(tr("Script"), this); - mainMenu->addMenu(script); - script->addAction(m_scriptRunAction); - script->addAction(m_scriptStopAction); - script->addSeparator(); - script->addAction(m_scriptDebugAction); - script->addAction(m_scriptReloadAction); - - //Window menu - windowsMenu = new QMenu(tr("Windows"), this); - connect(windowsMenu, SIGNAL(aboutToShow()), - this, SLOT(windowsMenuAboutToShow())); - - mainMenu->addMenu(windowsMenu); - mainMenu->addSeparator(); - - //Help menu - QMenu * help = new QMenu(tr("Help"), this); - mainMenu->addMenu(help); - help->addAction(m_aboutAction); - help->addAction(m_homepageAction); - -} - QMenu * Frame::genPopupMenu(QWidget * owner) { QMenu * popupMenu = new QMenu(owner); - popupMenu->addAction(m_menuBarAction); - popupMenu->addAction(m_fullAction); + popupMenu->addAction(actionMenubar); + popupMenu->addAction(actionFullscreen); popupMenu->addSeparator(); - popupMenu->addAction(m_copyAction); - popupMenu->addAction(m_pasteAction); - popupMenu->addAction(m_copyArticleAction); + popupMenu->addAction(actionCopy); + popupMenu->addAction(actionPaste); + popupMenu->addAction(actionCopy_Article); popupMenu->addSeparator(); - popupMenu->addAction(m_currentSessionAction); + popupMenu->addAction(actionCurrent_Session_Setting); return popupMenu; } -void Frame::updateMenuToolBar() -{ - Window * window = qobject_cast<Window *>(m_MdiArea->activeSubWindow()); - - if (window == NULL) - return; - - m_disconnectAction->setEnabled(window->isConnected()); - - m_colorCopyAction->setChecked(window->m_bCopyColor); - m_rectAction->setChecked(window->m_bCopyRect); - m_autoCopyAction->setChecked(window->m_bAutoCopy); - m_wwrapAction->setChecked(window->m_bWordWrap); - - - m_fullAction->setChecked(Global::instance()->isFullScreen()); - - m_antiIdleAction->setChecked(window->m_bAntiIdle); - m_autoReplyAction->setChecked(window->m_bAutoReply); - m_beepAction->setChecked(window->m_bBeep); - m_mouseAction->setChecked(window->m_bMouse); - -} - -void Frame::enableMenuToolBar(bool enable) -{ - m_disconnectAction->setEnabled(enable); - m_printAction->setEnabled(enable); - - m_copyAction->setEnabled(enable); - m_pasteAction->setEnabled(enable); - m_colorCopyAction->setEnabled(enable); - m_rectAction->setEnabled(enable); - m_autoCopyAction->setEnabled(enable); - m_wwrapAction->setEnabled(enable); - - m_refreshAction->setEnabled(enable); - - m_currentSessionAction->setEnabled(enable); - - m_copyArticleAction->setEnabled(enable); - m_antiIdleAction->setEnabled(enable); - m_autoReplyAction->setEnabled(enable); - m_viewMessageAction->setEnabled(enable); - m_beepAction->setEnabled(enable); - m_mouseAction->setEnabled(enable); - -#ifdef SCRIPT_ENABLED - m_scriptReloadAction->setEnabled(enable); - m_scriptRunAction->setEnabled(enable); - m_scriptStopAction->setEnabled(enable); -#ifdef SCRIPTTOOLS_ENABLED - m_scriptDebugAction->setEnabled(enable); -#endif // SCRIPTTOOLS_ENABLED -#endif - if (enable) { - mdiconnectTools->setVisible(Global::instance()->showToolBar(mdiconnectTools->objectName())); - } else { - //FIXME: Saveing states of the toolbars only works when a window is open - Global::instance()->setShowToolBar(mdiTools->objectName(), !mdiTools->isHidden()); - Global::instance()->setShowToolBar(mdiconnectTools->objectName(),!mdiconnectTools->isHidden()); - Global::instance()->setShowToolBar(key->objectName(),!key->isHidden()); - mdiconnectTools->hide(); - } - - return; -} - void Frame::updateKeyToolBar() { - key->clear(); - key->addAction(QIcon(":/pic/keys.png"), tr("Key Setup"), this, SLOT(keySetup())); + keyToolBar->clear(); + keyToolBar->addAction(actionKey_Setup); Config * conf = Global::instance()->fileCfg(); QString strItem, strTmp; @@ -1294,16 +810,12 @@ for (int i = 0; i < num; i++) { strItem = QString("name%1").arg(i); strTmp = conf->getItemValue("key", strItem).toString(); - ToolButton *button = new ToolButton(key, i, strTmp); -// button->setUsesTextLabel(true); + ToolButton *button = new ToolButton(keyToolBar, i, strTmp); button->setText(strTmp); -// button->setTextPosition(QToolButton::BesideIcon); strItem = QString("key%1").arg(i); strTmp = (conf->getItemValue("key", strItem).toString()); -// QToolTip::add( button, strTmp.mid(1) ); -// button->addToolTip(strTmp.mid(1)); connect(button, SIGNAL(buttonClicked(int)), this, SLOT(keyClicked(int))); - key->addWidget(button); + keyToolBar->addWidget(button); } } @@ -1323,14 +835,6 @@ activateWindow(); } -QAction * Frame::insertThemeItem(const QString & themeitem) -{ - QAction * idAction = new QAction(themeitem, this); - themesMenu->addAction(idAction); - idAction->setCheckable(true); - idAction->setChecked(themeitem == theme); - return idAction; -} void Frame::setUseTray(bool use) { @@ -1476,7 +980,7 @@ } } -void Frame::configShortcuts() +void Frame::on_actionConfigure_Shortcuts_triggered() { QList<QAction*> actions = findChildren<QAction*>(QRegExp("action*")); QList<QShortcut*> shortcuts = findChildren<QShortcut*>(); @@ -1488,14 +992,12 @@ void Frame::saveToolbars() { Config * conf = Global::instance()->fileCfg(); - QList<QToolBar*> toolbars = findChildren<QToolBar*>(); - QToolBar * toolbar; QSize toolButtonIconSize; - foreach (toolbar, toolbars) + foreach (QToolBar *toolbar, findChildren<QToolBar*>()) { toolButtonIconSize = toolbar->iconSize(); QStringList listActions; - if (toolbar == key) + if (toolbar == keyToolBar) continue; foreach(QAction* action, toolbar->actions()) { @@ -1523,7 +1025,7 @@ foreach (toolbar, toolbars) { QStringList actions=conf->getItemValue("ToolBars", toolbar->objectName()).toStringList(); - if (toolbar == key) + if (toolbar == keyToolBar) continue; foreach(QString action, actions) { @@ -1534,7 +1036,7 @@ toolbar->addSeparator(); else { act=findChild<QAction*>(action); - if (act != 0 && act->actionGroup()==0) + if (act != 0 ) // kingson: I forgot why && act->actionGroup()==0) toolbar->addAction(act); } } @@ -1543,7 +1045,7 @@ setIconSize(conf->getItemValue("ToolBars", "IconSize").toSize()); } -void Frame::configToolbars() +void Frame::on_actionConfigure_Toolbars_triggered() { ToolbarDialog td(this); td.exec(); @@ -1558,7 +1060,7 @@ void Frame::keyPressEvent(QKeyEvent * e) { - if (m_MdiArea->subWindowList().count() == 0 && (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter)) { + if (mdiArea->subWindowList().count() == 0 && (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter)) { loadSession(); e->accept(); } else { @@ -1568,7 +1070,7 @@ void Frame::mouseReleaseEvent(QMouseEvent * e) { - if (m_MdiArea->subWindowList().count() == 0 && (e->button() == Qt::LeftButton)) { + if (mdiArea->subWindowList().count() == 0 && (e->button() == Qt::LeftButton)) { loadSession(); e->accept(); } else { @@ -1597,6 +1099,64 @@ tray->showMessage(title, message, QSystemTrayIcon::Information, millisecondsTimeoutHint); return true; } + +void Frame::groupActions() +{ + // These are actions which are enabled without any subwindow + listBasicActions + << "actionNew_Console" + << "actionQuick_Login" << "actionAddressBook" << "actionQuit" + << "actionNew_ANSI" << "actionOpen_ANSI" + << "actionFont" << "actionStatusbar" << "actionMenubar" << "actionFullscreen" + << "actionImage_Viewer" + << "actionManage_Favarites" << "actionArticle_Manager" + << "actionDefault_Session_Setting" << "actionPreference" + << "actionConfigure_Toolbars" << "actionConfigure_Shortcuts" << "actionKey_Setup" + << "actionQTerm_Online" << "actionContents" <<"actionWhat_s_this" + << "actionAbout_QTerm" << "actionAbout_Qt"; + QActionGroup *group; + // These actions belong to Edit->Past with Color submenu + group = new QActionGroup(this); + group->addAction(actionNone_Color); + group->addAction(actionESC_ESC); + group->addAction(actionCtrl_U); + group->addAction(actionCustom); + connect(group, SIGNAL(triggered(QAction*)), this, SLOT(updateESC(QAction*))); + // These actions belong to Edit->Clipboard Conversion submenu + group = new QActionGroup(this); + group->addAction(actionNone); + group->addAction(actionCHS_CHT); + group->addAction(actionCHT_CHS); + connect(group, SIGNAL(triggered(QAction*)), this, SLOT(updateCodec(QAction*))); + // These actions belong to View->Scrollbar submenu + group = new QActionGroup(this); + group->addAction(actionScroll_Hide); + group->addAction(actionScroll_Left); + group->addAction(actionScroll_Right); + connect(group, SIGNAL(triggered(QAction*)), this, SLOT(updateScroll(QAction*))); + // These actions belong to View->Language submenu + group = new QActionGroup(this); + group->addAction(actionEnglish); + group->addAction(actionSimplified_Chinese); + group->addAction(actionTraditional_Chinese); + connect(group, SIGNAL(triggered(QAction*)), this, SLOT(updateLang(QAction*))); + + // The other actions are grouped and redirected to subwindow + QList<QAction*> actions = findChildren<QAction*>(QRegExp("action*")); + + actionsExtra = new QActionGroup(this); + actionsExtra->setExclusive(false); + connect(actionsExtra, SIGNAL(triggered(QAction*)), + this, SLOT(actionsDispatcher(QAction*))); + + foreach(QAction* action, actions) { + action->setVisible(listBasicActions.contains(action->objectName()) + || action->actionGroup() != 0); + if (action->actionGroup() == 0) + actionsExtra->addAction(action); + } } +} + #include <qtermframe.moc> Modified: trunk/qterm-qt4/src/qtermglobal.cpp =================================================================== --- trunk/qterm-qt4/src/qtermglobal.cpp 2010-06-18 15:00:23 UTC (rev 1199) +++ trunk/qterm-qt4/src/qtermglobal.cpp 2010-07-01 09:12:56 UTC (rev 1200) @@ -59,14 +59,20 @@ } Global::Global() - : m_fileCfg("./qterm.cfg"), m_addrCfg("./address.cfg"), m_pathLib("./"), m_pathCfg("./"), m_windowState(), m_status(INIT_OK), m_style(), m_fullScreen(false), m_language(Global::English), m_showToolBar() + : m_fileCfg("./qterm.cfg"), m_addrCfg("./address.cfg"), + m_pathLib("./"), m_pathCfg("./"), + m_windowState(), m_status(INIT_OK), m_style(), + m_fullScreen(false), m_language(Global::English) { if (!iniWorkingDir(qApp->arguments()[0])) { m_status = INIT_ERROR; return; } - m_config = new Config(m_fileCfg); - m_address = new Config(m_addrCfg); + m_translatorQT = new QTranslator(0); + m_translatorQTerm = new QTranslator(0); + + m_config = new Config(m_fileCfg); + m_address = new Config(m_addrCfg); m_converter = new Convert(); #ifdef KWALLET_ENABLED if (Wallet::isWalletAvailable()) { @@ -352,42 +358,33 @@ void Global::loadPrefence() { QString strTmp; - strTmp = m_config->getItemValue("preference", "xim").toString(); - m_pref.XIM = (Global::Conversion)strTmp.toInt(); - strTmp = m_config->getItemValue("preference", "wordwrap").toString(); - m_pref.nWordWrap = strTmp.toInt(); - strTmp = m_config->getItemValue("preference", "wheel").toString(); - m_pref.bWheel = (strTmp != "0"); - strTmp = m_config->getItemValue("preference", "url").toString(); - m_pref.bUrl = (strTmp != "0"); - strTmp = m_config->getItemValue("preference", "blinktab").toString(); - m_pref.bBlinkTab = (strTmp != "0"); - strTmp = m_config->getItemValue("preference", "warn").toString(); - m_pref.bWarn = (strTmp != "0"); - strTmp = m_config->getItemValue("preference", "beep").toString(); - m_pref.nBeep = strTmp.toInt(); + + m_pref.XIM = (Global::Conversion)m_config->getItemValue("preference", "xim").toInt(); + m_pref.nWordWrap = m_config->getItemValue("preference", "wordwrap").toInt(); + m_pref.bWheel = m_config->getItemValue("preference", "wheel").toBool(); + m_pref.bUrl = m_config->getItemValue("preference", "url").toBool(); + m_pref.bBlinkTab = m_config->getItemValue("preference", "blinktab").toBool(); + m_pref.bWarn = m_config->getItemValue("preference", "warn").toBool(); + m_pref.nBeep = m_config->getItemValue("preference", "beep").toInt(); m_pref.strWave = m_config->getItemValue("preference", "wavefile").toString(); - strTmp = m_config->getItemValue("preference", "http").toString(); - m_pref.strHttp = strTmp; - strTmp = m_config->getItemValue("preference", "antialias").toString(); - m_pref.bAA = (strTmp != "0"); - strTmp = m_config->getItemValue("preference", "tray").toString(); - m_pref.bTray = (strTmp != "0"); - strTmp = m_config->getItemValue("preference", "externalplayer").toString(); - m_pref.strPlayer = strTmp; + m_pref.strHttp = m_config->getItemValue("preference", "http").toString(); + m_pref.bAA = m_config->getItemValue("preference", "antialias").toBool(); + m_pref.bTray = m_config->getItemValue("preference", "tray").toBool(); + m_pref.strPlayer = m_config->getItemValue("preference", "externalplayer").toString(); + m_pref.strImageViewer = m_config->getItemValue("preference", "image").toString(); + m_pref.bClearPool = m_config->getItemValue("preference", "clearpool").toBool(); - strTmp = m_config->getItemValue("preference", "clearpool").toString(); - m_pref.bClearPool = (strTmp != "0"); strTmp = m_config->getItemValue("preference", "pool").toString(); m_pref.strPoolPath = strTmp.isEmpty() ? Global::instance()->pathCfg() + "pool/" : strTmp; if (m_pref.strPoolPath.right(1) != "/") m_pref.strPoolPath.append('/'); - strTmp = m_config->getItemValue("preference", "zmodem").toString(); - m_pref.strZmPath = strTmp.isEmpty() ? Global::instance()->pathCfg() + "zmodem/" : strTmp; + + strTmp = m_config->getItemValue("preference", "zmodem").toString(); + m_pref.strZmPath = strTmp.isEmpty() ? Global::instance()->pathCfg() + "zmodem/" : strTmp; if (m_pref.strZmPath.right(1) != "/") m_pref.strZmPath.append('/'); - strTmp = m_config->getItemValue("preference", "image").toString(); - m_pref.strImageViewer = strTmp; + + } QString Global::getOpenFileName(const QString & filter, QWidget * widget) @@ -540,35 +537,12 @@ { //install the translator QString lang = m_config->getItemValue("global", "language").toString(); - if (lang == "eng") - m_language = Global::English; - else if (lang == "chs") - m_language = Global::SimpilifiedChinese; + Global::Language language = Global::English; + if (lang == "chs") + language = Global::SimplifiedChinese; else if (lang == "cht") - m_language = Global::TraditionalChinese; - else { - qDebug("Language setting is not correct"); - m_language = Global::English; - } - if (lang != "eng" && !lang.isEmpty()) { - QString qt_qm; - if (lang == "chs") - qt_qm = QLibraryInfo::location(QLibraryInfo::TranslationsPath)+"/qt_zh_CN.qm"; - else - qt_qm = QLibraryInfo::location(QLibraryInfo::TranslationsPath)+"/qt_zh_TW.qm"; - - static QTranslator * translator = new QTranslator(0); - translator->load(qt_qm); - qApp->installTranslator(translator); - - // look in $HOME/.qterm/po/ first - QString qterm_qm = QDir::homePath() + "/.qterm/po/qterm_" + lang + ".qm"; - if (!QFile::exists(qterm_qm)) - qterm_qm = m_pathLib + "po/qterm_" + lang + ".qm"; - translator = new QTranslator(0); - translator->load(qterm_qm); - qApp->installTranslator(translator); - } + language = Global::TraditionalChinese; + setLanguage(language); //set font QString family = m_config->getItemValue("global", "font").toString(); QString pointsize = m_config->getItemValue("global", "pointsize").toString(); @@ -590,10 +564,8 @@ return false; QString pathPool = m_config->getItemValue("preference", "pool").toString(); - if (pathPool.isEmpty()) pathPool = m_pathCfg + "pool/"; - if (pathPool.right(1) != "/") pathPool.append('/'); @@ -676,6 +648,16 @@ return m_switchBar; } +bool Global::showStatusBar() const +{ + return m_statusBar; +} + +bool Global::showMenuBar() const +{ + return m_menuBar; +} + void Global::setClipConversion(Global::Conversion conversionId) { m_clipConversion = conversionId; @@ -696,6 +678,11 @@ m_statusBar = isShow; } +void Global::setMenuBar(bool isShow) +{ + m_menuBar = isShow; +} + void Global::setBossColor(bool isBossColor) { m_bossColor = isBossColor; @@ -714,6 +701,37 @@ void Global::setLanguage(Global::Language language) { m_language = language; + // unload previous translation + if (!m_translatorQT->isEmpty()) + qApp->removeTranslator(m_translatorQT); + if (!m_translatorQTerm->isEmpty()) + qApp->removeTranslator(m_translatorQTerm); + // check new translation files + QString qt_qm, qterm_qm; + switch(language) + { + case Global::SimplifiedChinese: + qt_qm = QLibraryInfo::location(QLibraryInfo::TranslationsPath)+"/qt_zh_CN.qm"; + qterm_qm = m_pathCfg + "/po/qterm_chs.qm"; + if (!QFile::exists(qterm_qm)) + qterm_qm = m_pathLib + "po/qterm_chs.qm"; + + break; + case Global::TraditionalChinese: + qt_qm = QLibraryInfo::location(QLibraryInfo::Trans... [truncated message content] |
From: <si...@us...> - 2010-06-18 15:00:29
|
Revision: 1199 http://qterm.svn.sourceforge.net/qterm/?rev=1199&view=rev Author: sidos Date: 2010-06-18 15:00:23 +0000 (Fri, 18 Jun 2010) Log Message: ----------- remove tab blinking feature Modified Paths: -------------- trunk/qterm-qt4/src/qtermwindow.cpp trunk/qterm-qt4/src/qtermwindow.h Modified: trunk/qterm-qt4/src/qtermwindow.cpp =================================================================== --- trunk/qterm-qt4/src/qtermwindow.cpp 2010-06-18 14:51:08 UTC (rev 1198) +++ trunk/qterm-qt4/src/qtermwindow.cpp 2010-06-18 15:00:23 UTC (rev 1199) @@ -335,8 +335,6 @@ connect(m_idleTimer, SIGNAL(timeout()), this, SLOT(idleProcess())); m_replyTimer = new QTimer; connect(m_replyTimer, SIGNAL(timeout()), this, SLOT(replyProcess())); - m_tabTimer = new QTimer; - connect(m_tabTimer, SIGNAL(timeout()), this, SLOT(blinkTab())); m_reconnectTimer = new QTimer; connect(m_reconnectTimer, SIGNAL(timeout()), this, SLOT(reconnect())); m_updateTimer = new QTimer; @@ -406,7 +404,6 @@ delete m_idleTimer; delete m_replyTimer; - delete m_tabTimer; delete m_updateTimer; delete m_pUrl; @@ -448,9 +445,6 @@ // do as autoreply when it is enabled if (m_replyTimer->isActive() && m_bAutoReply) { replyMessage(); - if (m_tabTimer->isActive()) { - m_tabTimer->stop(); - } return; } @@ -486,18 +480,8 @@ replyMessage(); else // else just stop the timer m_replyTimer->stop(); - - if (m_tabTimer->isActive()) { - m_tabTimer->stop(); - } } -void Window::blinkTab() -{ - static bool bVisible = TRUE; - bVisible = !bVisible; -} - /* ------------------------------------------------------------------------ */ /* */ /* Mouse & Key */ @@ -534,11 +518,6 @@ void Window::mousePressEvent(QMouseEvent * me) { - // stop the tab blinking - if (m_tabTimer->isActive()) { - m_tabTimer->stop(); - } - // Left Button for selecting if (me->button()&Qt::LeftButton && !(me->modifiers())) { // clear the selected before @@ -834,11 +813,6 @@ return; } - // stop the tab blinking - if (m_tabTimer->isActive()) { - m_tabTimer->stop(); - } - // message replying if (m_replyTimer->isActive()) m_replyTimer->stop(); @@ -1746,8 +1720,6 @@ delete m_pSound; m_pSound = NULL; } - if (Global::instance()->m_pref.bBlinkTab) - m_tabTimer->start(500); QString strMsg = m_pBBS->getMessage(); if (!strMsg.isEmpty()) Modified: trunk/qterm-qt4/src/qtermwindow.h =================================================================== --- trunk/qterm-qt4/src/qtermwindow.h 2010-06-18 14:51:08 UTC (rev 1198) +++ trunk/qterm-qt4/src/qtermwindow.h 2010-06-18 15:00:23 UTC (rev 1199) @@ -137,7 +137,6 @@ void idleProcess(); void replyProcess(); void updateWindow(); - void blinkTab(); //http menu void previewLink(); @@ -203,7 +202,7 @@ // timer bool m_bIdling; - QTimer *m_idleTimer, *m_replyTimer, *m_tabTimer, *m_reconnectTimer, * m_ipTimer; + QTimer *m_idleTimer, *m_replyTimer, *m_reconnectTimer, * m_ipTimer; QTimer * m_updateTimer; // address setting This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-06-18 14:51:14
|
Revision: 1198 http://qterm.svn.sourceforge.net/qterm/?rev=1198&view=rev Author: sidos Date: 2010-06-18 14:51:08 +0000 (Fri, 18 Jun 2010) Log Message: ----------- add mainframe ui Modified Paths: -------------- trunk/qterm-qt4/src/CMakeLists.txt trunk/qterm-qt4/src/ui/aboutdialog.ui Added Paths: ----------- trunk/qterm-qt4/src/qterm.qrc trunk/qterm-qt4/src/ui/mainframe.ui Removed Paths: ------------- trunk/qterm-qt4/src/frame.qrc trunk/qterm-qt4/src/ui/frame.ui Modified: trunk/qterm-qt4/src/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/CMakeLists.txt 2010-06-18 14:49:25 UTC (rev 1197) +++ trunk/qterm-qt4/src/CMakeLists.txt 2010-06-18 14:51:08 UTC (rev 1198) @@ -165,8 +165,10 @@ ui/aboutdialog.ui ui/addrdialog.ui ui/articledialog.ui + ui/closedialog.ui ui/imageviewer.ui ui/keydialog.ui + ui/mainframe.ui ui/msgdialog.ui ui/prefdialog.ui ui/quickdialog.ui @@ -175,14 +177,13 @@ ui/soundconf.ui ui/sshlogin.ui ui/toolbardialog.ui - ui/closedialog.ui ui/zmodemdialog.ui) set(qterm_MISC address.cfg credits qterm.cfg) set(qterm_RCCS - frame.qrc) + qterm.qrc) if(WIN32) if(MINGW) Deleted: trunk/qterm-qt4/src/frame.qrc =================================================================== --- trunk/qterm-qt4/src/frame.qrc 2010-06-18 14:49:25 UTC (rev 1197) +++ trunk/qterm-qt4/src/frame.qrc 2010-06-18 14:51:08 UTC (rev 1198) @@ -1,43 +0,0 @@ -<RCC> - <qresource> - <file>cursor/prev.xpm</file> - <file>cursor/end.xpm</file> - <file>cursor/enter.xpm</file> - <file>cursor/exit.xpm</file> - <file>cursor/hand.xpm</file> - <file>cursor/home.xpm</file> - <file>cursor/next.xpm</file> - <file>cursor/pagedown.xpm</file> - <file>cursor/pageup.xpm</file> - <file>pic/addr.png</file> - <file>pic/anti-idle.png</file> - <file>pic/appearance.png</file> - <file>pic/article.png</file> - <file>pic/auto-reply.png</file> - <file>pic/color-copy.png</file> - <file>pic/connect.png</file> - <file>pic/copy.png</file> - <file>pic/disconnect.png</file> - <file>pic/fonts.png</file> - <file>pic/keys.png</file> - <file>pic/message.png</file> - <file>pic/messagebox_critical.png</file> - <file>pic/messagebox_info.png</file> - <file>pic/messagebox_warning.png</file> - <file>pic/mouse.png</file> - <file>pic/paste.png</file> - <file>pic/popwidget.png</file> - <file>pic/pref.png</file> - <file>pic/qterm.png</file> - <file>pic/qterm_32x32.png</file> - <file>pic/qterm_48x48.png</file> - <file>pic/qterm_tray.png</file> - <file>pic/quick.png</file> - <file>pic/reconnect.png</file> - <file>pic/rect.png</file> - <file>pic/refresh.png</file> - <file>pic/shadow.png</file> - <file>pic/sound.png</file> - <file>pic/tabpad.png</file> - </qresource> -</RCC> Copied: trunk/qterm-qt4/src/qterm.qrc (from rev 1194, trunk/qterm-qt4/src/frame.qrc) =================================================================== --- trunk/qterm-qt4/src/qterm.qrc (rev 0) +++ trunk/qterm-qt4/src/qterm.qrc 2010-06-18 14:51:08 UTC (rev 1198) @@ -0,0 +1,43 @@ +<RCC> + <qresource> + <file>cursor/prev.xpm</file> + <file>cursor/end.xpm</file> + <file>cursor/enter.xpm</file> + <file>cursor/exit.xpm</file> + <file>cursor/hand.xpm</file> + <file>cursor/home.xpm</file> + <file>cursor/next.xpm</file> + <file>cursor/pagedown.xpm</file> + <file>cursor/pageup.xpm</file> + <file>pic/addr.png</file> + <file>pic/anti-idle.png</file> + <file>pic/appearance.png</file> + <file>pic/article.png</file> + <file>pic/auto-reply.png</file> + <file>pic/color-copy.png</file> + <file>pic/connect.png</file> + <file>pic/copy.png</file> + <file>pic/disconnect.png</file> + <file>pic/fonts.png</file> + <file>pic/keys.png</file> + <file>pic/message.png</file> + <file>pic/messagebox_critical.png</file> + <file>pic/messagebox_info.png</file> + <file>pic/messagebox_warning.png</file> + <file>pic/mouse.png</file> + <file>pic/paste.png</file> + <file>pic/popwidget.png</file> + <file>pic/pref.png</file> + <file>pic/qterm.png</file> + <file>pic/qterm_32x32.png</file> + <file>pic/qterm_48x48.png</file> + <file>pic/qterm_tray.png</file> + <file>pic/quick.png</file> + <file>pic/reconnect.png</file> + <file>pic/rect.png</file> + <file>pic/refresh.png</file> + <file>pic/shadow.png</file> + <file>pic/sound.png</file> + <file>pic/tabpad.png</file> + </qresource> +</RCC> Modified: trunk/qterm-qt4/src/ui/aboutdialog.ui =================================================================== --- trunk/qterm-qt4/src/ui/aboutdialog.ui 2010-06-18 14:49:25 UTC (rev 1197) +++ trunk/qterm-qt4/src/ui/aboutdialog.ui 2010-06-18 14:51:08 UTC (rev 1198) @@ -53,7 +53,7 @@ <string/> </property> <property name="pixmap"> - <pixmap resource="../frame.qrc">:/pic/qterm_32x32.png</pixmap> + <pixmap resource="../qterm.qrc">:/pic/qterm_32x32.png</pixmap> </property> <property name="scaledContents"> <bool>true</bool> @@ -138,7 +138,7 @@ <string/> </property> <property name="pixmap"> - <pixmap resource="../frame.qrc">:/pic/qterm.png</pixmap> + <pixmap resource="../qterm.qrc">:/pic/qterm.png</pixmap> </property> <property name="scaledContents"> <bool>true</bool> @@ -186,7 +186,7 @@ <string/> </property> <property name="pixmap"> - <pixmap resource="../frame.qrc">:/pic/qterm.png</pixmap> + <pixmap resource="../qterm.qrc">:/pic/qterm.png</pixmap> </property> <property name="scaledContents"> <bool>true</bool> @@ -229,8 +229,8 @@ <tabstop>mainTabWidget</tabstop> </tabstops> <resources> - <include location="../frame.qrc"/> - <include location="../frame.qrc"/> + <include location="../qterm.qrc"/> + <include location="../qterm.qrc"/> </resources> <connections> <connection> Deleted: trunk/qterm-qt4/src/ui/frame.ui =================================================================== --- trunk/qterm-qt4/src/ui/frame.ui 2010-06-18 14:49:25 UTC (rev 1197) +++ trunk/qterm-qt4/src/ui/frame.ui 2010-06-18 14:51:08 UTC (rev 1198) @@ -1,631 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Frame</class> - <widget class="QMainWindow" name="Frame"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>674</width> - <height>393</height> - </rect> - </property> - <property name="windowTitle"> - <string>QTerm</string> - </property> - <widget class="QMdiArea" name="mdiArea"/> - <widget class="QMenuBar" name="menubar"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>674</width> - <height>20</height> - </rect> - </property> - <widget class="QMenu" name="menuFile"> - <property name="title"> - <string>&File</string> - </property> - <addaction name="actionConsole"/> - <addaction name="actionNew_ANSI"/> - <addaction name="actionOpen_ANSI"/> - <addaction name="separator"/> - <addaction name="actionSave"/> - <addaction name="actionSave_As"/> - <addaction name="actionClose"/> - <addaction name="separator"/> - <addaction name="actionQuick_Login"/> - <addaction name="actionAddressBook"/> - <addaction name="separator"/> - <addaction name="actionPrint_Preview"/> - <addaction name="actionPrint"/> - <addaction name="actionQuit"/> - </widget> - <widget class="QMenu" name="menuView"> - <property name="title"> - <string>&View</string> - </property> - <widget class="QMenu" name="menuLanguage"> - <property name="title"> - <string>Language</string> - </property> - <addaction name="actionEnglish"/> - <addaction name="actionSimplified_Chinese"/> - <addaction name="actionTraditional_Chinese"/> - </widget> - <widget class="QMenu" name="menuTheme"> - <property name="title"> - <string>Theme</string> - </property> - </widget> - <addaction name="actionFont"/> - <addaction name="separator"/> - <addaction name="actionStatusbar"/> - <addaction name="actionRuler"/> - <addaction name="actionFullscreen"/> - <addaction name="actionRefresh"/> - <addaction name="menuLanguage"/> - <addaction name="menuTheme"/> - </widget> - <widget class="QMenu" name="menuEdit"> - <property name="title"> - <string>&Edit</string> - </property> - <widget class="QMenu" name="menuPaste_w_Color"> - <property name="title"> - <string>Paste w Color</string> - </property> - <addaction name="actionNone_Color"/> - <addaction name="actionESC_ESC"/> - <addaction name="actionCtrl_U"/> - <addaction name="actionCustom"/> - </widget> - <widget class="QMenu" name="menuClipboard_Conversion"> - <property name="title"> - <string>Clipboard Conversion</string> - </property> - <addaction name="actionNone"/> - <addaction name="actionCHS_CHT"/> - <addaction name="actionCHT_CHS"/> - </widget> - <addaction name="actionCut"/> - <addaction name="actionCopy"/> - <addaction name="actionPaste"/> - <addaction name="separator"/> - <addaction name="actionAuto_Copy"/> - <addaction name="actionRectangle_Selection"/> - <addaction name="actionPaste_w_Wordwrap"/> - <addaction name="separator"/> - <addaction name="actionCopy_w_Color"/> - <addaction name="menuPaste_w_Color"/> - <addaction name="separator"/> - <addaction name="actionSymbols"/> - <addaction name="menuClipboard_Conversion"/> - </widget> - <widget class="QMenu" name="menuFavatite"> - <property name="title"> - <string>&Favatite</string> - </property> - <addaction name="actionAdd_to_favarites"/> - <addaction name="actionManage_Favarites"/> - <addaction name="separator"/> - </widget> - <widget class="QMenu" name="menuBBS"> - <property name="title"> - <string>&BBS </string> - </property> - <addaction name="actionCopy_Article"/> - <addaction name="actionAnti_idle"/> - <addaction name="actionAuto_Reply"/> - <addaction name="actionSupport_Mouse"/> - <addaction name="actionBeep_on_message"/> - <addaction name="actionView_Message"/> - <addaction name="actionArticle_Manager"/> - <addaction name="actionImage_Viewer"/> - </widget> - <widget class="QMenu" name="menuOptions"> - <property name="title"> - <string>&Options</string> - </property> - <addaction name="actionDefault_Session_Setting"/> - <addaction name="actionPreference"/> - <addaction name="separator"/> - <addaction name="actionConfigure_Shortcuts"/> - <addaction name="actionConfigure_Toolbars"/> - </widget> - <widget class="QMenu" name="menuScript"> - <property name="title"> - <string>&Script</string> - </property> - <addaction name="actionRun"/> - <addaction name="actionStop"/> - <addaction name="actionDebug_Console"/> - <addaction name="actionReload_Script"/> - </widget> - <widget class="QMenu" name="menuHelp"> - <property name="title"> - <string>Help</string> - </property> - <addaction name="actionQTerm_Online"/> - <addaction name="actionContents"/> - <addaction name="actionWhat_s_this"/> - <addaction name="separator"/> - <addaction name="actionAbout_QTerm"/> - <addaction name="actionAbout_Qt"/> - </widget> - <widget class="QMenu" name="menuWindow"> - <property name="title"> - <string>Window</string> - </property> - </widget> - <addaction name="menuFile"/> - <addaction name="menuEdit"/> - <addaction name="menuBBS"/> - <addaction name="menuView"/> - <addaction name="menuFavatite"/> - <addaction name="menuOptions"/> - <addaction name="menuScript"/> - <addaction name="menuWindow"/> - <addaction name="menuHelp"/> - </widget> - <widget class="QStatusBar" name="statusbar"/> - <widget class="QToolBar" name="terminalToolBar"> - <property name="windowTitle"> - <string>Terminal</string> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <attribute name="toolBarArea"> - <enum>TopToolBarArea</enum> - </attribute> - <attribute name="toolBarBreak"> - <bool>false</bool> - </attribute> - <addaction name="actionDisconnect"/> - </widget> - <widget class="QToolBar" name="mainToolBar"> - <property name="windowTitle"> - <string>toolBar</string> - </property> - <attribute name="toolBarArea"> - <enum>TopToolBarArea</enum> - </attribute> - <attribute name="toolBarBreak"> - <bool>false</bool> - </attribute> - <addaction name="actionAddressBook"/> - <addaction name="actionQuick_Login"/> - </widget> - <widget class="QToolBar" name="keyToolBar"> - <property name="windowTitle"> - <string>toolBar</string> - </property> - <attribute name="toolBarArea"> - <enum>TopToolBarArea</enum> - </attribute> - <attribute name="toolBarBreak"> - <bool>false</bool> - </attribute> - <addaction name="actionKey_Setup"/> - </widget> - <action name="actionQuick_Login"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/quick.png</normaloff>:/pic/quick.png</iconset> - </property> - <property name="text"> - <string>Quick Login</string> - </property> - <property name="whatsThis"> - <string>This provides an express way to connect.</string> - </property> - </action> - <action name="actionAddressBook"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/addr.png</normaloff>:/pic/addr.png</iconset> - </property> - <property name="text"> - <string>&AddressBook</string> - </property> - </action> - <action name="actionNew_ANSI"> - <property name="text"> - <string>New ANSI</string> - </property> - </action> - <action name="actionOpen_ANSI"> - <property name="text"> - <string>Open ANSI</string> - </property> - </action> - <action name="actionQuit"> - <property name="text"> - <string>&Quit</string> - </property> - <property name="iconText"> - <string>Quit</string> - </property> - <property name="toolTip"> - <string>Quit</string> - </property> - <property name="whatsThis"> - <string>This will close all windows. You will be prompted to confirm disconnent active sessions or save modified files.</string> - </property> - </action> - <action name="actionSave"> - <property name="text"> - <string>Save</string> - </property> - </action> - <action name="actionSave_As"> - <property name="text"> - <string>Save As...</string> - </property> - </action> - <action name="actionConsole"> - <property name="text"> - <string>New &Console</string> - </property> - </action> - <action name="actionCopy"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/copy.png</normaloff>:/pic/copy.png</iconset> - </property> - <property name="text"> - <string>&Copy</string> - </property> - </action> - <action name="actionPaste"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/paste.png</normaloff>:/pic/paste.png</iconset> - </property> - <property name="text"> - <string>&Paste</string> - </property> - </action> - <action name="actionCopy_w_Color"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/color-copy.png</normaloff>:/pic/color-copy.png</iconset> - </property> - <property name="text"> - <string>Copy w Color</string> - </property> - </action> - <action name="actionPaste_w_Wordwrap"> - <property name="text"> - <string>Paste w Wordwrap</string> - </property> - </action> - <action name="actionRectangle_Selection"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/rect.png</normaloff>:/pic/rect.png</iconset> - </property> - <property name="text"> - <string>Rectangle Selection</string> - </property> - </action> - <action name="actionAuto_Copy"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>&Auto Copy</string> - </property> - </action> - <action name="actionSymbols"> - <property name="text"> - <string>Symbols</string> - </property> - <property name="toolTip"> - <string>Symbols</string> - </property> - </action> - <action name="actionFullscreen"> - <property name="text"> - <string>&Fullscreen</string> - </property> - </action> - <action name="actionDefault_Session_Setting"> - <property name="text"> - <string>Default Session Setting</string> - </property> - </action> - <action name="actionPreference"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/pref.png</normaloff>:/pic/pref.png</iconset> - </property> - <property name="text"> - <string>&Preference</string> - </property> - </action> - <action name="actionAdd_to_favarites"> - <property name="text"> - <string>Add to favarites</string> - </property> - </action> - <action name="actionManage_Favarites"> - <property name="text"> - <string>Manage Favarites ...</string> - </property> - </action> - <action name="actionCopy_Article"> - <property name="icon"> - <iconset> - <normaloff>:/pic/copyarticle.png</normaloff>:/pic/copyarticle.png</iconset> - </property> - <property name="text"> - <string>&Copy Article</string> - </property> - </action> - <action name="actionAuto_Reply"> - <property name="text"> - <string>&Auto Reply</string> - </property> - </action> - <action name="actionSupport_Mouse"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/mouse.png</normaloff>:/pic/mouse.png</iconset> - </property> - <property name="text"> - <string>Support &Mouse</string> - </property> - </action> - <action name="actionBeep_on_message"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/sound.png</normaloff>:/pic/sound.png</iconset> - </property> - <property name="text"> - <string>&Beep on message</string> - </property> - </action> - <action name="actionConfigure_Shortcuts"> - <property name="text"> - <string>Configure Shortcuts</string> - </property> - </action> - <action name="actionView_Message"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/message.png</normaloff>:/pic/message.png</iconset> - </property> - <property name="text"> - <string>&View Message </string> - </property> - </action> - <action name="actionRun"> - <property name="text"> - <string>Run...</string> - </property> - </action> - <action name="actionStop"> - <property name="text"> - <string>Stop</string> - </property> - </action> - <action name="actionContents"> - <property name="text"> - <string>Contents...</string> - </property> - </action> - <action name="actionAbout_QTerm"> - <property name="text"> - <string>About QTerm</string> - </property> - </action> - <action name="actionAbout_Qt"> - <property name="text"> - <string>About Qt</string> - </property> - </action> - <action name="actionPrint"> - <property name="text"> - <string>Print</string> - </property> - </action> - <action name="actionPrint_Preview"> - <property name="text"> - <string>Print Preview</string> - </property> - </action> - <action name="actionClose"> - <property name="text"> - <string>Close</string> - </property> - </action> - <action name="actionAnti_idle"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/anti-idle.png</normaloff>:/pic/anti-idle.png</iconset> - </property> - <property name="text"> - <string>Anti-&idle</string> - </property> - </action> - <action name="actionDebug_Console"> - <property name="text"> - <string>Debug Console</string> - </property> - </action> - <action name="actionWhat_s_this"> - <property name="text"> - <string>What's this?</string> - </property> - </action> - <action name="actionQTerm_Online"> - <property name="text"> - <string>QTerm Online</string> - </property> - </action> - <action name="actionConfigure_Toolbars"> - <property name="text"> - <string>Configure Toolbars</string> - </property> - </action> - <action name="actionCut"> - <property name="text"> - <string>Cu&t</string> - </property> - </action> - <action name="actionRuler"> - <property name="text"> - <string>Ruler</string> - </property> - </action> - <action name="actionFont"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/fonts.png</normaloff>:/pic/fonts.png</iconset> - </property> - <property name="text"> - <string>Font</string> - </property> - </action> - <action name="actionStatusbar"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Statusbar</string> - </property> - <property name="toolTip"> - <string>Show/Hide Statusbar</string> - </property> - <property name="whatsThis"> - <string>Show/Hide Statusbar</string> - </property> - </action> - <action name="actionArticle_Manager"> - <property name="text"> - <string>Article Manager</string> - </property> - </action> - <action name="actionRefresh"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/refresh.png</normaloff>:/pic/refresh.png</iconset> - </property> - <property name="text"> - <string>Refresh</string> - </property> - </action> - <action name="actionReload_Script"> - <property name="text"> - <string>Reload Script</string> - </property> - </action> - <action name="actionImage_Viewer"> - <property name="text"> - <string>Image Viewer</string> - </property> - </action> - <action name="actionNone"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>None</string> - </property> - </action> - <action name="actionCHS_CHT"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>CHS -> CHT</string> - </property> - </action> - <action name="actionCHT_CHS"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>CHT -> CHS</string> - </property> - </action> - <action name="actionEnglish"> - <property name="text"> - <string>English</string> - </property> - </action> - <action name="actionNone_Color"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>None</string> - </property> - </action> - <action name="actionESC_ESC"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>ESC ESC [</string> - </property> - </action> - <action name="actionCtrl_U"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Ctrl+U [</string> - </property> - </action> - <action name="actionCustom"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Custom ...</string> - </property> - </action> - <action name="actionSimplified_Chinese"> - <property name="text"> - <string>Simplified Chinese</string> - </property> - </action> - <action name="actionTraditional_Chinese"> - <property name="text"> - <string>Traditional Chinese</string> - </property> - </action> - <action name="actionKey_Setup"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/keys.png</normaloff>:/pic/keys.png</iconset> - </property> - <property name="text"> - <string>Key Setup</string> - </property> - <property name="toolTip"> - <string>Key Setup</string> - </property> - </action> - <action name="actionDisconnect"> - <property name="icon"> - <iconset resource="../frame.qrc"> - <normaloff>:/pic/disconnect.png</normaloff>:/pic/disconnect.png</iconset> - </property> - <property name="text"> - <string>Disconnect</string> - </property> - <property name="toolTip"> - <string>Disconnect</string> - </property> - </action> - </widget> - <resources> - <include location="../frame.qrc"/> - </resources> - <connections/> -</ui> Copied: trunk/qterm-qt4/src/ui/mainframe.ui (from rev 1195, trunk/qterm-qt4/src/ui/frame.ui) =================================================================== --- trunk/qterm-qt4/src/ui/mainframe.ui (rev 0) +++ trunk/qterm-qt4/src/ui/mainframe.ui 2010-06-18 14:51:08 UTC (rev 1198) @@ -0,0 +1,631 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Frame</class> + <widget class="QMainWindow" name="Frame"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>674</width> + <height>393</height> + </rect> + </property> + <property name="windowTitle"> + <string>QTerm</string> + </property> + <widget class="QMdiArea" name="mdiArea"/> + <widget class="QMenuBar" name="menubar"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>674</width> + <height>20</height> + </rect> + </property> + <widget class="QMenu" name="menuFile"> + <property name="title"> + <string>&File</string> + </property> + <addaction name="actionConsole"/> + <addaction name="actionNew_ANSI"/> + <addaction name="actionOpen_ANSI"/> + <addaction name="separator"/> + <addaction name="actionSave"/> + <addaction name="actionSave_As"/> + <addaction name="actionClose"/> + <addaction name="separator"/> + <addaction name="actionQuick_Login"/> + <addaction name="actionAddressBook"/> + <addaction name="separator"/> + <addaction name="actionPrint_Preview"/> + <addaction name="actionPrint"/> + <addaction name="actionQuit"/> + </widget> + <widget class="QMenu" name="menuView"> + <property name="title"> + <string>&View</string> + </property> + <widget class="QMenu" name="menuLanguage"> + <property name="title"> + <string>Language</string> + </property> + <addaction name="actionEnglish"/> + <addaction name="actionSimplified_Chinese"/> + <addaction name="actionTraditional_Chinese"/> + </widget> + <widget class="QMenu" name="menuTheme"> + <property name="title"> + <string>Theme</string> + </property> + </widget> + <addaction name="actionFont"/> + <addaction name="separator"/> + <addaction name="actionStatusbar"/> + <addaction name="actionRuler"/> + <addaction name="actionFullscreen"/> + <addaction name="actionRefresh"/> + <addaction name="menuLanguage"/> + <addaction name="menuTheme"/> + </widget> + <widget class="QMenu" name="menuEdit"> + <property name="title"> + <string>&Edit</string> + </property> + <widget class="QMenu" name="menuPaste_w_Color"> + <property name="title"> + <string>Paste w Color</string> + </property> + <addaction name="actionNone_Color"/> + <addaction name="actionESC_ESC"/> + <addaction name="actionCtrl_U"/> + <addaction name="actionCustom"/> + </widget> + <widget class="QMenu" name="menuClipboard_Conversion"> + <property name="title"> + <string>Clipboard Conversion</string> + </property> + <addaction name="actionNone"/> + <addaction name="actionCHS_CHT"/> + <addaction name="actionCHT_CHS"/> + </widget> + <addaction name="actionCut"/> + <addaction name="actionCopy"/> + <addaction name="actionPaste"/> + <addaction name="separator"/> + <addaction name="actionAuto_Copy"/> + <addaction name="actionRectangle_Selection"/> + <addaction name="actionPaste_w_Wordwrap"/> + <addaction name="separator"/> + <addaction name="actionCopy_w_Color"/> + <addaction name="menuPaste_w_Color"/> + <addaction name="separator"/> + <addaction name="actionSymbols"/> + <addaction name="menuClipboard_Conversion"/> + </widget> + <widget class="QMenu" name="menuFavatite"> + <property name="title"> + <string>&Favatite</string> + </property> + <addaction name="actionAdd_to_favarites"/> + <addaction name="actionManage_Favarites"/> + <addaction name="separator"/> + </widget> + <widget class="QMenu" name="menuBBS"> + <property name="title"> + <string>&BBS </string> + </property> + <addaction name="actionCopy_Article"/> + <addaction name="actionAnti_idle"/> + <addaction name="actionAuto_Reply"/> + <addaction name="actionSupport_Mouse"/> + <addaction name="actionBeep_on_message"/> + <addaction name="actionView_Message"/> + <addaction name="actionArticle_Manager"/> + <addaction name="actionImage_Viewer"/> + </widget> + <widget class="QMenu" name="menuOptions"> + <property name="title"> + <string>&Options</string> + </property> + <addaction name="actionDefault_Session_Setting"/> + <addaction name="actionPreference"/> + <addaction name="separator"/> + <addaction name="actionConfigure_Shortcuts"/> + <addaction name="actionConfigure_Toolbars"/> + </widget> + <widget class="QMenu" name="menuScript"> + <property name="title"> + <string>&Script</string> + </property> + <addaction name="actionRun"/> + <addaction name="actionStop"/> + <addaction name="actionDebug_Console"/> + <addaction name="actionReload_Script"/> + </widget> + <widget class="QMenu" name="menuHelp"> + <property name="title"> + <string>Help</string> + </property> + <addaction name="actionQTerm_Online"/> + <addaction name="actionContents"/> + <addaction name="actionWhat_s_this"/> + <addaction name="separator"/> + <addaction name="actionAbout_QTerm"/> + <addaction name="actionAbout_Qt"/> + </widget> + <widget class="QMenu" name="menuWindow"> + <property name="title"> + <string>Window</string> + </property> + </widget> + <addaction name="menuFile"/> + <addaction name="menuEdit"/> + <addaction name="menuBBS"/> + <addaction name="menuView"/> + <addaction name="menuFavatite"/> + <addaction name="menuOptions"/> + <addaction name="menuScript"/> + <addaction name="menuWindow"/> + <addaction name="menuHelp"/> + </widget> + <widget class="QStatusBar" name="statusbar"/> + <widget class="QToolBar" name="terminalToolBar"> + <property name="windowTitle"> + <string>Terminal</string> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <attribute name="toolBarArea"> + <enum>TopToolBarArea</enum> + </attribute> + <attribute name="toolBarBreak"> + <bool>false</bool> + </attribute> + <addaction name="actionDisconnect"/> + </widget> + <widget class="QToolBar" name="mainToolBar"> + <property name="windowTitle"> + <string>toolBar</string> + </property> + <attribute name="toolBarArea"> + <enum>TopToolBarArea</enum> + </attribute> + <attribute name="toolBarBreak"> + <bool>false</bool> + </attribute> + <addaction name="actionAddressBook"/> + <addaction name="actionQuick_Login"/> + </widget> + <widget class="QToolBar" name="keyToolBar"> + <property name="windowTitle"> + <string>toolBar</string> + </property> + <attribute name="toolBarArea"> + <enum>TopToolBarArea</enum> + </attribute> + <attribute name="toolBarBreak"> + <bool>false</bool> + </attribute> + <addaction name="actionKey_Setup"/> + </widget> + <action name="actionQuick_Login"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/quick.png</normaloff>:/pic/quick.png</iconset> + </property> + <property name="text"> + <string>Quick Login</string> + </property> + <property name="whatsThis"> + <string>This provides an express way to connect.</string> + </property> + </action> + <action name="actionAddressBook"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/addr.png</normaloff>:/pic/addr.png</iconset> + </property> + <property name="text"> + <string>&AddressBook</string> + </property> + </action> + <action name="actionNew_ANSI"> + <property name="text"> + <string>New ANSI</string> + </property> + </action> + <action name="actionOpen_ANSI"> + <property name="text"> + <string>Open ANSI</string> + </property> + </action> + <action name="actionQuit"> + <property name="text"> + <string>&Quit</string> + </property> + <property name="iconText"> + <string>Quit</string> + </property> + <property name="toolTip"> + <string>Quit</string> + </property> + <property name="whatsThis"> + <string>This will close all windows. You will be prompted to confirm disconnent active sessions or save modified files.</string> + </property> + </action> + <action name="actionSave"> + <property name="text"> + <string>Save</string> + </property> + </action> + <action name="actionSave_As"> + <property name="text"> + <string>Save As...</string> + </property> + </action> + <action name="actionConsole"> + <property name="text"> + <string>New &Console</string> + </property> + </action> + <action name="actionCopy"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/copy.png</normaloff>:/pic/copy.png</iconset> + </property> + <property name="text"> + <string>&Copy</string> + </property> + </action> + <action name="actionPaste"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/paste.png</normaloff>:/pic/paste.png</iconset> + </property> + <property name="text"> + <string>&Paste</string> + </property> + </action> + <action name="actionCopy_w_Color"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/color-copy.png</normaloff>:/pic/color-copy.png</iconset> + </property> + <property name="text"> + <string>Copy w Color</string> + </property> + </action> + <action name="actionPaste_w_Wordwrap"> + <property name="text"> + <string>Paste w Wordwrap</string> + </property> + </action> + <action name="actionRectangle_Selection"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/rect.png</normaloff>:/pic/rect.png</iconset> + </property> + <property name="text"> + <string>Rectangle Selection</string> + </property> + </action> + <action name="actionAuto_Copy"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>&Auto Copy</string> + </property> + </action> + <action name="actionSymbols"> + <property name="text"> + <string>Symbols</string> + </property> + <property name="toolTip"> + <string>Symbols</string> + </property> + </action> + <action name="actionFullscreen"> + <property name="text"> + <string>&Fullscreen</string> + </property> + </action> + <action name="actionDefault_Session_Setting"> + <property name="text"> + <string>Default Session Setting</string> + </property> + </action> + <action name="actionPreference"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/pref.png</normaloff>:/pic/pref.png</iconset> + </property> + <property name="text"> + <string>&Preference</string> + </property> + </action> + <action name="actionAdd_to_favarites"> + <property name="text"> + <string>Add to favarites</string> + </property> + </action> + <action name="actionManage_Favarites"> + <property name="text"> + <string>Manage Favarites ...</string> + </property> + </action> + <action name="actionCopy_Article"> + <property name="icon"> + <iconset> + <normaloff>:/pic/copyarticle.png</normaloff>:/pic/copyarticle.png</iconset> + </property> + <property name="text"> + <string>&Copy Article</string> + </property> + </action> + <action name="actionAuto_Reply"> + <property name="text"> + <string>&Auto Reply</string> + </property> + </action> + <action name="actionSupport_Mouse"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/mouse.png</normaloff>:/pic/mouse.png</iconset> + </property> + <property name="text"> + <string>Support &Mouse</string> + </property> + </action> + <action name="actionBeep_on_message"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/sound.png</normaloff>:/pic/sound.png</iconset> + </property> + <property name="text"> + <string>&Beep on message</string> + </property> + </action> + <action name="actionConfigure_Shortcuts"> + <property name="text"> + <string>Configure Shortcuts</string> + </property> + </action> + <action name="actionView_Message"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/message.png</normaloff>:/pic/message.png</iconset> + </property> + <property name="text"> + <string>&View Message </string> + </property> + </action> + <action name="actionRun"> + <property name="text"> + <string>Run...</string> + </property> + </action> + <action name="actionStop"> + <property name="text"> + <string>Stop</string> + </property> + </action> + <action name="actionContents"> + <property name="text"> + <string>Contents...</string> + </property> + </action> + <action name="actionAbout_QTerm"> + <property name="text"> + <string>About QTerm</string> + </property> + </action> + <action name="actionAbout_Qt"> + <property name="text"> + <string>About Qt</string> + </property> + </action> + <action name="actionPrint"> + <property name="text"> + <string>Print</string> + </property> + </action> + <action name="actionPrint_Preview"> + <property name="text"> + <string>Print Preview</string> + </property> + </action> + <action name="actionClose"> + <property name="text"> + <string>Close</string> + </property> + </action> + <action name="actionAnti_idle"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/anti-idle.png</normaloff>:/pic/anti-idle.png</iconset> + </property> + <property name="text"> + <string>Anti-&idle</string> + </property> + </action> + <action name="actionDebug_Console"> + <property name="text"> + <string>Debug Console</string> + </property> + </action> + <action name="actionWhat_s_this"> + <property name="text"> + <string>What's this?</string> + </property> + </action> + <action name="actionQTerm_Online"> + <property name="text"> + <string>QTerm Online</string> + </property> + </action> + <action name="actionConfigure_Toolbars"> + <property name="text"> + <string>Configure Toolbars</string> + </property> + </action> + <action name="actionCut"> + <property name="text"> + <string>Cu&t</string> + </property> + </action> + <action name="actionRuler"> + <property name="text"> + <string>Ruler</string> + </property> + </action> + <action name="actionFont"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/fonts.png</normaloff>:/pic/fonts.png</iconset> + </property> + <property name="text"> + <string>Font</string> + </property> + </action> + <action name="actionStatusbar"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Statusbar</string> + </property> + <property name="toolTip"> + <string>Show/Hide Statusbar</string> + </property> + <property name="whatsThis"> + <string>Show/Hide Statusbar</string> + </property> + </action> + <action name="actionArticle_Manager"> + <property name="text"> + <string>Article Manager</string> + </property> + </action> + <action name="actionRefresh"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/refresh.png</normaloff>:/pic/refresh.png</iconset> + </property> + <property name="text"> + <string>Refresh</string> + </property> + </action> + <action name="actionReload_Script"> + <property name="text"> + <string>Reload Script</string> + </property> + </action> + <action name="actionImage_Viewer"> + <property name="text"> + <string>Image Viewer</string> + </property> + </action> + <action name="actionNone"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>None</string> + </property> + </action> + <action name="actionCHS_CHT"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>CHS -> CHT</string> + </property> + </action> + <action name="actionCHT_CHS"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>CHT -> CHS</string> + </property> + </action> + <action name="actionEnglish"> + <property name="text"> + <string>English</string> + </property> + </action> + <action name="actionNone_Color"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>None</string> + </property> + </action> + <action name="actionESC_ESC"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>ESC ESC [</string> + </property> + </action> + <action name="actionCtrl_U"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Ctrl+U [</string> + </property> + </action> + <action name="actionCustom"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Custom ...</string> + </property> + </action> + <action name="actionSimplified_Chinese"> + <property name="text"> + <string>Simplified Chinese</string> + </property> + </action> + <action name="actionTraditional_Chinese"> + <property name="text"> + <string>Traditional Chinese</string> + </property> + </action> + <action name="actionKey_Setup"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/keys.png</normaloff>:/pic/keys.png</iconset> + </property> + <property name="text"> + <string>Key Setup</string> + </property> + <property name="toolTip"> + <string>Key Setup</string> + </property> + </action> + <action name="actionDisconnect"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/disconnect.png</normaloff>:/pic/disconnect.png</iconset> + </property> + <property name="text"> + <string>Disconnect</string> + </property> + <property name="toolTip"> + <string>Disconnect</string> + </property> + </action> + </widget> + <resources> + <include location="../qterm.qrc"/> + </resources> + <connections/> +</ui> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-06-18 14:49:32
|
Revision: 1197 http://qterm.svn.sourceforge.net/qterm/?rev=1197&view=rev Author: sidos Date: 2010-06-18 14:49:25 +0000 (Fri, 18 Jun 2010) Log Message: ----------- show maximized new window Modified Paths: -------------- trunk/qterm-qt4/src/qtermframe.cpp Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2010-06-18 14:19:31 UTC (rev 1196) +++ trunk/qterm-qt4/src/qtermframe.cpp 2010-06-18 14:49:25 UTC (rev 1197) @@ -295,6 +295,7 @@ if (m_menuBarAction->isChecked()) { w->setWindowFlags(Qt::FramelessWindowHint); } + window->showMaximized(); m_MdiArea->setActiveSubWindow(window); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-06-18 14:19:37
|
Revision: 1196 http://qterm.svn.sourceforge.net/qterm/?rev=1196&view=rev Author: sidos Date: 2010-06-18 14:19:31 +0000 (Fri, 18 Jun 2010) Log Message: ----------- remove qtermwndmgr from cmakelist.txt Modified Paths: -------------- trunk/qterm-qt4/src/CMakeLists.txt Modified: trunk/qterm-qt4/src/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/CMakeLists.txt 2010-06-18 14:16:57 UTC (rev 1195) +++ trunk/qterm-qt4/src/CMakeLists.txt 2010-06-18 14:19:31 UTC (rev 1196) @@ -147,7 +147,6 @@ qtermtoolbutton.cpp qtermwindow.cpp qtermwindowbase.cpp - qtermwndmgr.cpp qtermzmodem.cpp qtermglobal.cpp quickdialog.cpp This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-06-18 14:17:03
|
Revision: 1195 http://qterm.svn.sourceforge.net/qterm/?rev=1195&view=rev Author: sidos Date: 2010-06-18 14:16:57 +0000 (Fri, 18 Jun 2010) Log Message: ----------- remove old friend qtermwndmgr/tabbar and use QMdiArea::TabbedView Modified Paths: -------------- trunk/qterm-qt4/src/qtermframe.cpp trunk/qterm-qt4/src/qtermframe.h trunk/qterm-qt4/src/qtermscreen.cpp trunk/qterm-qt4/src/qtermwindow.cpp trunk/qterm-qt4/src/ui/frame.ui Removed Paths: ------------- trunk/qterm-qt4/src/qtermwndmgr.cpp trunk/qterm-qt4/src/qtermwndmgr.h Property Changed: ---------------- trunk/qterm-qt4/src/ Property changes on: trunk/qterm-qt4/src ___________________________________________________________________ Modified: svn:ignore - *.cfg *.rule + address.cfg Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2010-06-18 12:05:11 UTC (rev 1194) +++ trunk/qterm-qt4/src/qtermframe.cpp 2010-06-18 14:16:57 UTC (rev 1195) @@ -11,7 +11,6 @@ #include "qtermwindow.h" #include "qtermframe.h" -#include "qtermwndmgr.h" #include "qtermtimelabel.h" #include "qtermconfig.h" #include "qtermglobal.h" @@ -89,7 +88,10 @@ setAttribute(Qt::WA_DeleteOnClose); m_MdiArea = new QMdiArea(this); + m_MdiArea->setViewMode(QMdiArea::TabbedView); + setCentralWidget(m_MdiArea); + tray = 0; trayMenu = 0; @@ -100,23 +102,11 @@ connect(DBus::instance(), SIGNAL(showQTerm()), this, SLOT(slotShowQTerm())); #endif //DBUS_ENABLED -//create a tabbar in the hbox - tabBar = new QTabBar(statusBar()); - tabBar->setExpanding(false); - statusBar()->addWidget(tabBar, 90); - connect(tabBar, SIGNAL(selected(int)), this, SLOT(selectionChanged(int))); - //tabBar->setShape(QTabBar::TriangularBelow); - tabBar->setShape(QTabBar:: RoundedSouth); - tabBar->setDrawBase(false); //create a progress bar to notify the download process m_pStatusBar = new QTerm::StatusBar(statusBar(), "mainStatusBar"); statusBar()->addWidget(m_pStatusBar, 0); -//create the window manager to deal with the window-tab-icon pairs - wndmgr = new WndMgr(this); - - initShortcuts(); //set menubar @@ -146,7 +136,6 @@ //destructor Frame::~Frame() { - delete wndmgr; } //initialize setting from qterm.cfg @@ -284,14 +273,6 @@ } } - while ( wndmgr->count() > 0) - { - Window * active_window = wndmgr->activeWindow(); - active_window->disconnect(); - wndmgr->activeNextPrev(true); - wndmgr->removeWindow(active_window); - } - Global::instance()->saveSession(sites); saveSetting(); // clear zmodem and pool if needed @@ -314,22 +295,9 @@ if (m_menuBarAction->isChecked()) { w->setWindowFlags(Qt::FramelessWindowHint); } - - //add window-tab-icon to window manager - wndmgr->addWindow(window); - tabBar->addTab(QIcon(":/pic/tabpad.png"),window->windowTitle()); - - window->setFocus(); - window->showMaximized(); - + m_MdiArea->setActiveSubWindow(window); } -//the tabbar selection changed -void Frame::selectionChanged(int n) -{ - wndmgr->activateTheWindow(n); -} - //slot Help->About QTerm void Frame::aboutQTerm() { @@ -428,20 +396,17 @@ return; if (id == 200) { - wndmgr->activeNextPrev(false); + m_MdiArea->activatePreviousSubWindow(); return; } if (id == 201 || id == 202) { - wndmgr->activeNextPrev(true); + m_MdiArea->activateNextSubWindow(); return; } - QWidget *w = windows.at(id); - if (w == m_MdiArea->activeSubWindow()) - return; - + QMdiSubWindow *w = windows.at(id); if (w != NULL) { - w->setFocus(); + m_MdiArea->setActiveSubWindow(w); } } @@ -484,50 +449,50 @@ void Frame::connectIt() { - if (wndmgr->activeWindow() == NULL) { + if (m_MdiArea->activeSubWindow() == NULL) { Param param; Global::instance()->loadAddress(-1, param); newWindow(param); } else - if (!wndmgr->activeWindow()->isConnected()) - wndmgr->activeWindow()->reconnect(); + if (!qobject_cast<Window *>(m_MdiArea->activeSubWindow())->isConnected()) + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->reconnect(); } void Frame::disconnect() { - wndmgr->activeWindow()->disconnect(); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->disconnect(); } void Frame::copy() { - wndmgr->activeWindow()->copy(); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->copy(); } void Frame::paste() { - wndmgr->activeWindow()->paste(); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->paste(); } void Frame::copyRect(bool isEnabled) { - wndmgr->activeWindow()->m_bCopyRect = isEnabled; + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bCopyRect = isEnabled; } void Frame::copyColor(bool isEnabled) { - wndmgr->activeWindow()->m_bCopyColor = isEnabled; + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bCopyColor = isEnabled; } void Frame::copyArticle() { - wndmgr->activeWindow()->copyArticle(); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->copyArticle(); } void Frame::autoCopy(bool isEnabled) { - wndmgr->activeWindow()->m_bAutoCopy = isEnabled; + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bAutoCopy = isEnabled; } void Frame::wordWrap(bool isEnabled) { - wndmgr->activeWindow()->m_bWordWrap = isEnabled; + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bWordWrap = isEnabled; } void Frame::updateESC(QAction * action) @@ -563,7 +528,7 @@ void Frame::refresh() { - wndmgr->activeWindow()->refresh(); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->refresh(); } void Frame::uiFont() @@ -689,7 +654,7 @@ void Frame::setting() { - wndmgr->activeWindow()->setting(); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->setting(); } void Frame::defaultSetting() { @@ -733,7 +698,7 @@ return; QPainter painter; painter.begin(&printer); - QPixmap screen = QPixmap::grabWidget(wndmgr->activeWindow()); + QPixmap screen = QPixmap::grabWidget(qobject_cast<Window *>(m_MdiArea->activeSubWindow())); QPixmap target = screen.scaled(printer.pageRect().width(),printer.pageRect().height(),Qt::KeepAspectRatio,Qt::SmoothTransformation); painter.drawPixmap(0,0,target); painter.end(); @@ -742,23 +707,23 @@ void Frame::antiIdle(bool isEnabled) { - wndmgr->activeWindow()->antiIdle(isEnabled); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->antiIdle(isEnabled); } void Frame::autoReply(bool isEnabled) { - wndmgr->activeWindow()->autoReply(isEnabled); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->autoReply(isEnabled); } void Frame::viewMessages() { - wndmgr->activeWindow()->viewMessages(); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->viewMessages(); } void Frame::updateMouse(bool isEnabled) { - wndmgr->activeWindow()->m_bMouse = isEnabled; - m_mouseAction->setChecked(wndmgr->activeWindow()->m_bMouse); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bMouse = isEnabled; + m_mouseAction->setChecked(qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bMouse); } void Frame::viewImages() @@ -769,13 +734,13 @@ void Frame::updateBeep(bool isEnabled) { - wndmgr->activeWindow()->m_bBeep = isEnabled; - m_beepAction->setChecked(wndmgr->activeWindow()->m_bBeep); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bBeep = isEnabled; + m_beepAction->setChecked(qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bBeep); } void Frame::reconnect(bool isEnabled) { - wndmgr->activeWindow()->m_bReconnect = isEnabled; + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->m_bReconnect = isEnabled; } void Frame::debugConsole() @@ -784,27 +749,27 @@ QMessageBox::information(this, "QTerm", tr("You need to enable the script engine debugger to use this feature. Please recompile QTerm with the debugger enabled (need Qt 4.5 or newer version)")); #else - wndmgr->activeWindow()->debugConsole(); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->debugConsole(); #endif } void Frame::reloadScript() { - wndmgr->activeWindow()->initScript(); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->initScript(); } void Frame::runScript() { - wndmgr->activeWindow()->runScript(); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->runScript(); } void Frame::stopScript() { - wndmgr->activeWindow()->stopScript(); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->stopScript(); } void Frame::keyClicked(int id) { - if (wndmgr->activeWindow() == NULL) + if (qobject_cast<Window *>(m_MdiArea->activeSubWindow()) == NULL) return; Config * conf = Global::instance()->fileCfg(); @@ -814,9 +779,9 @@ QString strTmp = conf->getItemValue("key", strItem).toString(); if (strTmp[0] == '0') { // key - wndmgr->activeWindow()->externInput(strTmp.mid(1)); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->externInput(strTmp.mid(1)); } else if (strTmp[0] == '1') { // script - wndmgr->activeWindow()->runScript(strTmp.mid(1)); + qobject_cast<Window *>(m_MdiArea->activeSubWindow())->runScript(strTmp.mid(1)); } else if (strTmp[0] == '2') { // program system((strTmp.mid(1) + " &").toLocal8Bit()); } @@ -1249,7 +1214,7 @@ void Frame::updateMenuToolBar() { - Window * window = wndmgr->activeWindow(); + Window * window = qobject_cast<Window *>(m_MdiArea->activeSubWindow()); if (window == NULL) return; @@ -1592,7 +1557,7 @@ void Frame::keyPressEvent(QKeyEvent * e) { - if (wndmgr->count() == 0 && (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter)) { + if (m_MdiArea->subWindowList().count() == 0 && (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter)) { loadSession(); e->accept(); } else { @@ -1602,7 +1567,7 @@ void Frame::mouseReleaseEvent(QMouseEvent * e) { - if (wndmgr->count() == 0 && (e->button() == Qt::LeftButton)) { + if (m_MdiArea->subWindowList().count() == 0 && (e->button() == Qt::LeftButton)) { loadSession(); e->accept(); } else { Modified: trunk/qterm-qt4/src/qtermframe.h =================================================================== --- trunk/qterm-qt4/src/qtermframe.h 2010-06-18 12:05:11 UTC (rev 1194) +++ trunk/qterm-qt4/src/qtermframe.h 2010-06-18 14:16:57 UTC (rev 1195) @@ -59,7 +59,6 @@ void addressBook(); void quickLogin(); - void selectionChanged(int); void aboutQTerm(); void homepage(); void updateLang(QAction*); @@ -121,9 +120,6 @@ void configToolbars(); void slotShowQTerm(); public: - QTabBar *tabBar; - WndMgr * wndmgr; - QMdiArea * m_MdiArea; protected: //variables Modified: trunk/qterm-qt4/src/qtermscreen.cpp =================================================================== --- trunk/qterm-qt4/src/qtermscreen.cpp 2010-06-18 12:05:11 UTC (rev 1194) +++ trunk/qterm-qt4/src/qtermscreen.cpp 2010-06-18 14:16:57 UTC (rev 1195) @@ -17,7 +17,6 @@ #include "qtermbuffer.h" #include "qtermbbs.h" #include "qtermframe.h" -#include "qtermwndmgr.h" #include "qtermparam.h" #include "qtermtelnet.h" #include "qtermconfig.h" @@ -132,13 +131,11 @@ // focus event received void Screen::focusInEvent(QFocusEvent *) { - if (m_pWindow->isMaximized() && m_pWindow->m_pFrame->wndmgr->afterRemove()) { + if (m_pWindow->isMaximized()) { m_pWindow->showNormal(); m_pWindow->showMaximized(); } - m_pWindow->m_pFrame->wndmgr->activateTheTab(m_pWindow); - m_scPrevPage->setEnabled(true); m_scNextPage->setEnabled(true); m_scPrevLine->setEnabled(true); Modified: trunk/qterm-qt4/src/qtermwindow.cpp =================================================================== --- trunk/qterm-qt4/src/qtermwindow.cpp 2010-06-18 12:05:11 UTC (rev 1194) +++ trunk/qterm-qt4/src/qtermwindow.cpp 2010-06-18 14:16:57 UTC (rev 1195) @@ -12,8 +12,6 @@ #include "qterm.h" #include "qtermwindow.h" #include "qtermframe.h" -#include "qtermwndmgr.h" - #include "qtermscreen.h" #include "qtermdecode.h" #include "qtermtelnet.h" @@ -433,12 +431,10 @@ QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); if (ret == QMessageBox::Yes) { m_pTelnet->close(); - m_pFrame->wndmgr->removeWindow(this); clse->accept(); } else clse->ignore(); } else { - m_pFrame->wndmgr->removeWindow(this); clse->accept(); } } @@ -454,7 +450,6 @@ replyMessage(); if (m_tabTimer->isActive()) { m_tabTimer->stop(); - m_pFrame->wndmgr->blinkTheTab(this, TRUE); } return; } @@ -494,14 +489,12 @@ if (m_tabTimer->isActive()) { m_tabTimer->stop(); - m_pFrame->wndmgr->blinkTheTab(this, TRUE); } } void Window::blinkTab() { static bool bVisible = TRUE; - m_pFrame->wndmgr->blinkTheTab(this, bVisible); bVisible = !bVisible; } @@ -544,7 +537,6 @@ // stop the tab blinking if (m_tabTimer->isActive()) { m_tabTimer->stop(); - m_pFrame->wndmgr->blinkTheTab(this, TRUE); } // Left Button for selecting @@ -845,7 +837,6 @@ // stop the tab blinking if (m_tabTimer->isActive()) { m_tabTimer->stop(); - m_pFrame->wndmgr->blinkTheTab(this, TRUE); } // message replying @@ -1763,7 +1754,7 @@ m_strMessage += strMsg + "\n\n"; - if (!isActiveWindow() || m_pFrame->wndmgr->activeWindow() != this) + if (!isActiveWindow()) { showMessage("New Message in QTerm", strMsg, -1); } Deleted: trunk/qterm-qt4/src/qtermwndmgr.cpp =================================================================== --- trunk/qterm-qt4/src/qtermwndmgr.cpp 2010-06-18 12:05:11 UTC (rev 1194) +++ trunk/qterm-qt4/src/qtermwndmgr.cpp 2010-06-18 14:16:57 UTC (rev 1195) @@ -1,183 +0,0 @@ -/******************************************************************************* -FILENAME: qtermwndmgr.cpp -REVISION: 2001.8.12 first created. - -AUTHOR: kingson fiasco -*******************************************************************************/ -/******************************************************************************* - NOTE - This file may be used, distributed and modified without limitation. - *******************************************************************************/ - -#include "qtermwindow.h" -#include "qtermwndmgr.h" -#include "qtermframe.h" -#include "qtermglobal.h" - -#include <QString> -#include <QApplication> -#include <QTabBar> -#include <QIcon> -#include <QTimer> - -#include <stdio.h> - -namespace QTerm -{ - -//constructor -WndMgr::WndMgr( QObject * parent, const char * name ) - :QObject(parent) -{ - setObjectName(name); - pFrame = (Frame *) parent; - - nCurrentIndex = -1; - - removed = false; - - //pWin.setAutoDelete( false ); - //pTab.setAutoDelete( false ); - //pIcon.setAutoDelete( false ); -} - -//destructor -WndMgr::~WndMgr() -{ -} - -//add window-tab-iconset -int WndMgr::addWindow(Window * mw) -{ - Q_ASSERT(mw!=NULL); - pWin.append(mw); - - if( pWin.count()==1 ) - pFrame->enableMenuToolBar( true ); - - return pWin.count(); -} - -//remove window-tab-iconset -void WndMgr::removeWindow(Window * mw) -{ - //find where it is - int n=pWin.indexOf(mw); - //remove them from list - pWin.removeAll(mw); - - if( pWin.count()==0 ) - { - nCurrentIndex = -1; - pFrame->enableMenuToolBar( false ); - } - - removed = true; - //remove from the Tabbar - pFrame->tabBar->removeTab(n); -} - -//avtive the tab when switch the window -void WndMgr::activateTheTab(Window * mw) -{ - //find where it is - int n=pWin.indexOf(mw); - - if( n==nCurrentIndex ) - return; - - mw->setFocus(); - mw->show(); - - nCurrentIndex = n; - - //set it seleted - - pFrame->tabBar->setCurrentIndex(n); - - pFrame->updateMenuToolBar(); -} - -//active the window when switch the tab -void WndMgr::activateTheWindow(int n) -{ - if( n==nCurrentIndex ) - return; - - nCurrentIndex = n; - - Window * mw=pWin.at(n); - - //set focus to it - mw->setFocus(); - mw->show(); - - pFrame->updateMenuToolBar(); -} - -//FIXME: how does this suppose to work? -//blink the tab when message come in -void WndMgr::blinkTheTab(Window * mw,bool bVisible) -{ -// //find where it is -// int n=pWin.indexOf(mw); -// QIcon* icon=pIcon.at(n); -// //FIXME: QIcon::Automatic -// if(bVisible) -// icon->addFile(pathLib+"pic/tabpad.png");//,QIcon::Automatic); -// else -// icon->addFile(pathLib+"pic/transp.png");//,QIcon::Automatic); -// -// pFrame->tabBar->update(); -} - -//return the number of connected window -int WndMgr::count() -{ - return pWin.count(); -} - -Window * WndMgr::activeWindow() -{ - if( nCurrentIndex == -1 ) - return NULL; - else - return pWin.at( nCurrentIndex ); -} - -void WndMgr::activeNextPrev(bool next) -{ - int n = nCurrentIndex; - - if(n==-1) - return; - if(next) - n = (n==pWin.count()-1)?0:n+1; - else - n = (n==0)?pWin.count()-1:n-1; - - nCurrentIndex = n; - - Window * mw=pWin.at(n); - mw->setFocus(); - - //set it seleted - pFrame->tabBar->setCurrentIndex(n); - pFrame->updateMenuToolBar(); - -} - -bool WndMgr::afterRemove() -{ - if(removed) - { - removed=false; - return true; - } - else - return false; -} - -} // namespace QTerm - -#include <qtermwndmgr.moc> Deleted: trunk/qterm-qt4/src/qtermwndmgr.h =================================================================== --- trunk/qterm-qt4/src/qtermwndmgr.h 2010-06-18 12:05:11 UTC (rev 1194) +++ trunk/qterm-qt4/src/qtermwndmgr.h 2010-06-18 14:16:57 UTC (rev 1195) @@ -1,47 +0,0 @@ -#ifndef QTERMWNDMGR_H -#define QTERMWNDMGR_H - -#include <QString> -#include <QObject> -#include <QList> - -//class QTab; -class QIcon; - -namespace QTerm -{ -class Frame; -class Window; - -class WndMgr: public QObject -{ - Q_OBJECT - -public: - WndMgr( QObject * parent=0, const char * name=0 ); - ~WndMgr(); - - int addWindow(Window *mw); - void removeWindow(Window *mw); - void activateTheTab(Window *mw); - void activateTheWindow(int n); - void blinkTheTab(Window *mw,bool bVisible); - int count(); - - bool afterRemove(); - - Window * activeWindow(); - void activeNextPrev(bool); - -protected: - QList<Window*> pWin; - Frame * pFrame; - int nCurrentIndex; - - bool removed; -}; - -} // namespace QTerm - -#endif //QTERMWNDMGR_H - Modified: trunk/qterm-qt4/src/ui/frame.ui =================================================================== --- trunk/qterm-qt4/src/ui/frame.ui 2010-06-18 12:05:11 UTC (rev 1194) +++ trunk/qterm-qt4/src/ui/frame.ui 2010-06-18 14:16:57 UTC (rev 1195) @@ -13,6 +13,7 @@ <property name="windowTitle"> <string>QTerm</string> </property> + <widget class="QMdiArea" name="mdiArea"/> <widget class="QMenuBar" name="menubar"> <property name="geometry"> <rect> @@ -24,13 +25,21 @@ </property> <widget class="QMenu" name="menuFile"> <property name="title"> - <string>&Terminal</string> + <string>&File</string> </property> <addaction name="actionConsole"/> + <addaction name="actionNew_ANSI"/> + <addaction name="actionOpen_ANSI"/> <addaction name="separator"/> + <addaction name="actionSave"/> + <addaction name="actionSave_As"/> + <addaction name="actionClose"/> + <addaction name="separator"/> <addaction name="actionQuick_Login"/> <addaction name="actionAddressBook"/> <addaction name="separator"/> + <addaction name="actionPrint_Preview"/> + <addaction name="actionPrint"/> <addaction name="actionQuit"/> </widget> <widget class="QMenu" name="menuView"> @@ -59,19 +68,6 @@ <addaction name="menuLanguage"/> <addaction name="menuTheme"/> </widget> - <widget class="QMenu" name="menuANSI"> - <property name="title"> - <string>&ANSI</string> - </property> - <addaction name="actionNew_ANSI"/> - <addaction name="actionOpen_ANSI"/> - <addaction name="separator"/> - <addaction name="actionSave"/> - <addaction name="actionSave_As"/> - <addaction name="separator"/> - <addaction name="actionPrint_Preview"/> - <addaction name="actionPrint"/> - </widget> <widget class="QMenu" name="menuEdit"> <property name="title"> <string>&Edit</string> @@ -151,78 +147,68 @@ <property name="title"> <string>Help</string> </property> + <addaction name="actionQTerm_Online"/> <addaction name="actionContents"/> <addaction name="actionWhat_s_this"/> <addaction name="separator"/> <addaction name="actionAbout_QTerm"/> <addaction name="actionAbout_Qt"/> </widget> + <widget class="QMenu" name="menuWindow"> + <property name="title"> + <string>Window</string> + </property> + </widget> <addaction name="menuFile"/> - <addaction name="menuANSI"/> + <addaction name="menuEdit"/> <addaction name="menuBBS"/> - <addaction name="menuEdit"/> <addaction name="menuView"/> <addaction name="menuFavatite"/> <addaction name="menuOptions"/> <addaction name="menuScript"/> + <addaction name="menuWindow"/> <addaction name="menuHelp"/> </widget> <widget class="QStatusBar" name="statusbar"/> - <widget class="QToolBar" name="TerminalBar"> + <widget class="QToolBar" name="terminalToolBar"> <property name="windowTitle"> <string>Terminal</string> </property> <property name="orientation"> - <enum>Qt::Vertical</enum> + <enum>Qt::Horizontal</enum> </property> <attribute name="toolBarArea"> - <enum>LeftToolBarArea</enum> + <enum>TopToolBarArea</enum> </attribute> <attribute name="toolBarBreak"> <bool>false</bool> </attribute> + <addaction name="actionDisconnect"/> </widget> - <widget class="QToolBar" name="EditBar"> + <widget class="QToolBar" name="mainToolBar"> <property name="windowTitle"> - <string>Edit</string> + <string>toolBar</string> </property> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> <attribute name="toolBarArea"> - <enum>RightToolBarArea</enum> - </attribute> - <attribute name="toolBarBreak"> - <bool>false</bool> - </attribute> - </widget> - <widget class="QToolBar" name="ANSIBar"> - <property name="windowTitle"> - <string>ANSI Edit</string> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <attribute name="toolBarArea"> <enum>TopToolBarArea</enum> </attribute> <attribute name="toolBarBreak"> <bool>false</bool> </attribute> + <addaction name="actionAddressBook"/> + <addaction name="actionQuick_Login"/> </widget> - <widget class="QToolBar" name="PagerBar"> + <widget class="QToolBar" name="keyToolBar"> <property name="windowTitle"> - <string>Pager</string> + <string>toolBar</string> </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> <attribute name="toolBarArea"> <enum>TopToolBarArea</enum> </attribute> <attribute name="toolBarBreak"> <bool>false</bool> </attribute> + <addaction name="actionKey_Setup"/> </widget> <action name="actionQuick_Login"> <property name="icon"> @@ -326,6 +312,9 @@ </property> </action> <action name="actionAuto_Copy"> + <property name="checkable"> + <bool>true</bool> + </property> <property name="text"> <string>&Auto Copy</string> </property> @@ -521,6 +510,10 @@ </property> </action> <action name="actionRefresh"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/refresh.png</normaloff>:/pic/refresh.png</iconset> + </property> <property name="text"> <string>Refresh</string> </property> @@ -606,6 +599,30 @@ <string>Traditional Chinese</string> </property> </action> + <action name="actionKey_Setup"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/keys.png</normaloff>:/pic/keys.png</iconset> + </property> + <property name="text"> + <string>Key Setup</string> + </property> + <property name="toolTip"> + <string>Key Setup</string> + </property> + </action> + <action name="actionDisconnect"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/disconnect.png</normaloff>:/pic/disconnect.png</iconset> + </property> + <property name="text"> + <string>Disconnect</string> + </property> + <property name="toolTip"> + <string>Disconnect</string> + </property> + </action> </widget> <resources> <include location="../frame.qrc"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-06-18 12:05:17
|
Revision: 1194 http://qterm.svn.sourceforge.net/qterm/?rev=1194&view=rev Author: sidos Date: 2010-06-18 12:05:11 +0000 (Fri, 18 Jun 2010) Log Message: ----------- shortcuts (open addressbook entries, switch windows) are not configurable Modified Paths: -------------- trunk/qterm-qt4/src/qtermframe.cpp Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2010-06-18 10:49:28 UTC (rev 1193) +++ trunk/qterm-qt4/src/qtermframe.cpp 2010-06-18 12:05:11 UTC (rev 1194) @@ -854,37 +854,36 @@ { int i = 0; QShortcut * shortcut = NULL; + + // shortcuts to addressbook entries QSignalMapper * addrMapper = new QSignalMapper(this); for (i = 0; i < 9; i++) { shortcut = new QShortcut(Qt::CTRL + Qt::ALT + 0x30 + 1 + i, this); + shortcut->setObjectName(QString("Open addressbook enetry %1").arg(i+1)); connect(shortcut, SIGNAL(activated()), addrMapper, SLOT(map())); addrMapper->setMapping(shortcut, i); } connect(addrMapper, SIGNAL(mapped(int)), this, SLOT(connectMenuActivated(int))); + + // shortcuts to swtch windows QSignalMapper * windowMapper = new QSignalMapper(this); - for (i = 0; i < 10; i++) { + for (i = 0; i < 9; i++) { shortcut = new QShortcut(Qt::ALT + 0x30 + 1 + i, this); + shortcut->setObjectName(QString("Switch to window %1").arg(i+1)); connect(shortcut, SIGNAL(activated()), windowMapper, SLOT(map())); windowMapper->setMapping(shortcut, i); } - shortcut = new QShortcut(QKeySequence::PreviousChild, this); - connect(shortcut, SIGNAL(activated()), windowMapper, SLOT(map())); - windowMapper->setMapping(shortcut, 200); + shortcut = new QShortcut(Qt::ALT + Qt::Key_Left, this); + shortcut->setObjectName("Previous window"); connect(shortcut, SIGNAL(activated()), windowMapper, SLOT(map())); windowMapper->setMapping(shortcut, 200); - shortcut = new QShortcut(Qt::ALT + Qt::Key_Up, this); - connect(shortcut, SIGNAL(activated()), windowMapper, SLOT(map())); - windowMapper->setMapping(shortcut, 200); - shortcut = new QShortcut(QKeySequence::NextChild, this); - connect(shortcut, SIGNAL(activated()), windowMapper, SLOT(map())); - windowMapper->setMapping(shortcut, 201); + shortcut = new QShortcut(Qt::ALT + Qt::Key_Right, this); + shortcut->setObjectName("Next window"); connect(shortcut, SIGNAL(activated()), windowMapper, SLOT(map())); windowMapper->setMapping(shortcut, 201); - shortcut = new QShortcut(Qt::ALT + Qt::Key_Down, this); - connect(shortcut, SIGNAL(activated()), windowMapper, SLOT(map())); - windowMapper->setMapping(shortcut, 201); + connect(windowMapper, SIGNAL(mapped(int)), this, SLOT(switchWin(int))); } @@ -1486,6 +1485,10 @@ foreach (QAction* action, actions) { conf->setItemValue("Shortcuts", action->objectName(), action->shortcut().toString()); } + QList<QShortcut*> shortcuts = findChildren<QShortcut*>(); + foreach (QShortcut* shortcut, shortcuts) { + conf->setItemValue("Shortcuts", shortcut->objectName(), shortcut->key().toString()); + } conf->save(); } @@ -1495,18 +1498,23 @@ QList<QAction*> actions = findChildren<QAction*>(QRegExp("action*")); foreach(QAction* action, actions) { - QString shortcut=conf->getItemValue("Shortcuts", action->objectName()).toString(); - if (!shortcut.isEmpty()) - action->setShortcut(QKeySequence(shortcut)); + QString keyseq=conf->getItemValue("Shortcuts", action->objectName()).toString(); + if (!keyseq.isEmpty()) + action->setShortcut(QKeySequence(keyseq)); } - + QList<QShortcut*> shortcuts = findChildren<QShortcut*>(); + foreach (QShortcut* shortcut, shortcuts) { + QString keyseq=conf->getItemValue("Shortcuts", shortcut->objectName()).toString(); + if (!keyseq.isEmpty()) + shortcut->setKey(QKeySequence(keyseq)); + } } void Frame::configShortcuts() { QList<QAction*> actions = findChildren<QAction*>(QRegExp("action*")); - QList<QShortcut*> shortcutsList; - ShortcutsDialog sd(this,actions,shortcutsList); + QList<QShortcut*> shortcuts = findChildren<QShortcut*>(); + ShortcutsDialog sd(this,actions,shortcuts); sd.exec(); saveShortcuts(); } @@ -1623,7 +1631,6 @@ tray->showMessage(title, message, QSystemTrayIcon::Information, millisecondsTimeoutHint); return true; } - } #include <qtermframe.moc> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-06-18 10:49:34
|
Revision: 1193 http://qterm.svn.sourceforge.net/qterm/?rev=1193&view=rev Author: sidos Date: 2010-06-18 10:49:28 +0000 (Fri, 18 Jun 2010) Log Message: ----------- rebase QTerm::Window on QMdiSubWindow Modified Paths: -------------- trunk/qterm-qt4/src/CMakeLists.txt trunk/qterm-qt4/src/qtermframe.cpp trunk/qterm-qt4/src/qtermwindow.cpp trunk/qterm-qt4/src/qtermwindow.h trunk/qterm-qt4/src/qtermwindowbase.h Added Paths: ----------- trunk/qterm-qt4/src/qtermwindowbase.cpp Modified: trunk/qterm-qt4/src/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/CMakeLists.txt 2010-06-17 08:26:40 UTC (rev 1192) +++ trunk/qterm-qt4/src/CMakeLists.txt 2010-06-18 10:49:28 UTC (rev 1193) @@ -146,6 +146,7 @@ qtermtextline.cpp qtermtoolbutton.cpp qtermwindow.cpp + qtermwindowbase.cpp qtermwndmgr.cpp qtermzmodem.cpp qtermglobal.cpp Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2010-06-17 08:26:40 UTC (rev 1192) +++ trunk/qterm-qt4/src/qtermframe.cpp 2010-06-18 10:49:28 UTC (rev 1193) @@ -252,9 +252,9 @@ QList<QMdiSubWindow *> windows = m_MdiArea->subWindowList(); QStringList titleList; for (int i = 0; i < int(windows.count()); ++i) { - if ((qobject_cast<Window *>(windows.at(i)->widget()))->isConnected()) { + if ((qobject_cast<Window *>(windows.at(i)))->isConnected()) { titleList << windows.at(i)->windowTitle(); - sites << qobject_cast<Window *>(windows.at(i)->widget())->index(); + sites << qobject_cast<Window *>(windows.at(i))->index(); } } if ((!titleList.isEmpty())&&(Global::instance()->m_pref.bWarn)) { @@ -278,9 +278,9 @@ QList<QMdiSubWindow *> windows = m_MdiArea->subWindowList(); QStringList titleList; for (int i = 0; i < int(windows.count()); ++i) { - if ((qobject_cast<Window *>(windows.at(i)->widget()))->isConnected()) { + if ((qobject_cast<Window *>(windows.at(i)))->isConnected()) { titleList << windows.at(i)->windowTitle(); - sites << qobject_cast<Window *>(windows.at(i)->widget())->index(); + sites << qobject_cast<Window *>(windows.at(i))->index(); } } @@ -385,7 +385,7 @@ return; } int id = qobject_cast<QAction *>(action)->data().toInt(); - Window * w = qobject_cast<Window *>(m_MdiArea->subWindowList().at(id)->widget()); + Window * w = qobject_cast<Window *>(m_MdiArea->subWindowList().at(id)); if (w) { w->setFocus(); w->showMaximized(); Modified: trunk/qterm-qt4/src/qtermwindow.cpp =================================================================== --- trunk/qterm-qt4/src/qtermwindow.cpp 2010-06-17 08:26:40 UTC (rev 1192) +++ trunk/qterm-qt4/src/qtermwindow.cpp 2010-06-18 10:49:28 UTC (rev 1193) @@ -241,7 +241,7 @@ //constructor Window::Window(Frame * frame, Param param, int addr, QWidget * parent, const char * name, Qt::WFlags wflags) - : QMainWindow(parent, wflags), m_strMessage(), location() + : WindowBase(parent, wflags), m_strMessage(), location() { m_pFrame = frame; @@ -296,7 +296,7 @@ m_pSound = NULL; setFocusProxy(m_pScreen); - setCentralWidget(m_pScreen); + setWidget(m_pScreen); connect(m_pFrame, SIGNAL(bossColor()), m_pScreen, SLOT(bossColor())); connect(m_pFrame, SIGNAL(scrollChanged()), m_pScreen, SLOT(updateScrollBar())); connect(m_pScreen, SIGNAL(inputEvent(const QString &)), this, SLOT(inputHandle(const QString &))); Modified: trunk/qterm-qt4/src/qtermwindow.h =================================================================== --- trunk/qterm-qt4/src/qtermwindow.h 2010-06-17 08:26:40 UTC (rev 1192) +++ trunk/qterm-qt4/src/qtermwindow.h 2010-06-18 10:49:28 UTC (rev 1193) @@ -5,6 +5,7 @@ #include <config.h> #endif +#include "qtermwindowbase.h" #include "qtermparam.h" #include "qtermconvert.h" #include "qtermsound.h" @@ -70,7 +71,7 @@ Window *pWin; }; -class Window: public QMainWindow +class Window: public WindowBase { Q_OBJECT public: Added: trunk/qterm-qt4/src/qtermwindowbase.cpp =================================================================== --- trunk/qterm-qt4/src/qtermwindowbase.cpp (rev 0) +++ trunk/qterm-qt4/src/qtermwindowbase.cpp 2010-06-18 10:49:28 UTC (rev 1193) @@ -0,0 +1,3 @@ +#include "qtermwindowbase.h" + +#include "qtermwindowbase.moc" Modified: trunk/qterm-qt4/src/qtermwindowbase.h =================================================================== --- trunk/qterm-qt4/src/qtermwindowbase.h 2010-06-17 08:26:40 UTC (rev 1192) +++ trunk/qterm-qt4/src/qtermwindowbase.h 2010-06-18 10:49:28 UTC (rev 1193) @@ -1,31 +1,26 @@ #ifndef QTERMWINDOWBASE_H #define QTERMWINDOWBASE_H -#include <QWidget> -class QTermWindowBase; +#include <QMdiSubWindow> -class QTermWindowBase : public QWidget +namespace QTerm { +class WindowBase : public QMdiSubWindow +{ Q_OBJECT public: - QTermWindowBase(QWidget *parent=0):QWidget(parent,Qt::Window) {} - virtual ~QTermWindowBase() {} + WindowBase(QWidget *parent=0, Qt::WindowFlags flags = 0):QMdiSubWindow(parent, flags) { + setAttribute(Qt::WA_DeleteOnClose); + } + virtual ~WindowBase() {} bool hasAction(const QString& act){return listActions.contains(act);} -signals: - void windowClosed(QTermWindowBase*); - - protected: - void closeEvent(QCloseEvent*e) - { - emit windowClosed(this); - } - QStringList listActions; }; +} // namespace QTerm #endif // QTERMWINDOWBASE_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-06-17 08:26:47
|
Revision: 1192 http://qterm.svn.sourceforge.net/qterm/?rev=1192&view=rev Author: sidos Date: 2010-06-17 08:26:40 +0000 (Thu, 17 Jun 2010) Log Message: ----------- use qt resource system for pic and cursor files Modified Paths: -------------- trunk/qterm-qt4/src/CMakeLists.txt trunk/qterm-qt4/src/aboutdialog.cpp trunk/qterm-qt4/src/imagelistviewer.cpp trunk/qterm-qt4/src/imagelistviewer.h trunk/qterm-qt4/src/imageviewer.cpp trunk/qterm-qt4/src/imageviewer.h trunk/qterm-qt4/src/main.cpp trunk/qterm-qt4/src/osdmessage.cpp trunk/qterm-qt4/src/popwidget.cpp trunk/qterm-qt4/src/progressBar.cpp trunk/qterm-qt4/src/qtermframe.cpp trunk/qterm-qt4/src/qtermglobal.cpp trunk/qterm-qt4/src/qtermwindow.cpp trunk/qterm-qt4/src/statusBar.cpp trunk/qterm-qt4/src/ui/aboutdialog.ui Added Paths: ----------- trunk/qterm-qt4/src/frame.qrc trunk/qterm-qt4/src/qtermwindowbase.h trunk/qterm-qt4/src/ui/frame.ui Modified: trunk/qterm-qt4/src/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/CMakeLists.txt 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/CMakeLists.txt 2010-06-17 08:26:40 UTC (rev 1192) @@ -181,6 +181,9 @@ address.cfg credits qterm.cfg) +set(qterm_RCCS + frame.qrc) + if(WIN32) if(MINGW) # resource compilation for mingw @@ -197,6 +200,7 @@ set(optionalLibs ${optionalLibs} ${WIN32_WS2_LIBRARY}) endif(WIN32_WS2_LIBRARY) endif(WIN32) +qt4_add_resources(qterm_RCCS_SRCS ${qterm_RCCS}) qt4_wrap_ui(qterm_UIS_H ${qterm_UIS}) qt4_automoc(${qterm_SRCS}) add_definitions( -DHAVE_CONFIG_H ) @@ -210,9 +214,9 @@ ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) if(WIN32) - add_executable(qterm WIN32 ${qterm_SRCS}) + add_executable(qterm WIN32 ${qterm_SRCS} ${qterm_RCCS_SRCS}) else(WIN32) - add_executable(qterm ${qterm_SRCS}) + add_executable(qterm ${qterm_SRCS} ${qterm_RCCS_SRCS}) endif(WIN32) target_link_libraries(qterm ${QT_LIBRARIES} @@ -226,8 +230,6 @@ install(TARGETS qterm DESTINATION bin) install(FILES ${qterm_MISC} DESTINATION share/qterm) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/qterm.desktop DESTINATION share/applications) -add_subdirectory(pic) -add_subdirectory(cursor) add_subdirectory(scheme) add_subdirectory(scripts) add_subdirectory(po) Modified: trunk/qterm-qt4/src/aboutdialog.cpp =================================================================== --- trunk/qterm-qt4/src/aboutdialog.cpp 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/aboutdialog.cpp 2010-06-17 08:26:40 UTC (rev 1192) @@ -43,9 +43,6 @@ file.close(); } - ui.pixmapLabel1->setPixmap( QPixmap(pathLib+"pic/qterm.png") ); - ui.pixmapLabel2->setPixmap( QPixmap(pathLib+"pic/qterm.png") ); - ui.pixmapLabel3->setPixmap( QPixmap(pathLib+"pic/qterm.png") ); ui.TextLabel->setText("QTerm "+QString(QTERM_VERSION)+" (Qt "+QT_VERSION_STR+" based)"); //connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(accept())); } Added: trunk/qterm-qt4/src/frame.qrc =================================================================== --- trunk/qterm-qt4/src/frame.qrc (rev 0) +++ trunk/qterm-qt4/src/frame.qrc 2010-06-17 08:26:40 UTC (rev 1192) @@ -0,0 +1,43 @@ +<RCC> + <qresource> + <file>cursor/prev.xpm</file> + <file>cursor/end.xpm</file> + <file>cursor/enter.xpm</file> + <file>cursor/exit.xpm</file> + <file>cursor/hand.xpm</file> + <file>cursor/home.xpm</file> + <file>cursor/next.xpm</file> + <file>cursor/pagedown.xpm</file> + <file>cursor/pageup.xpm</file> + <file>pic/addr.png</file> + <file>pic/anti-idle.png</file> + <file>pic/appearance.png</file> + <file>pic/article.png</file> + <file>pic/auto-reply.png</file> + <file>pic/color-copy.png</file> + <file>pic/connect.png</file> + <file>pic/copy.png</file> + <file>pic/disconnect.png</file> + <file>pic/fonts.png</file> + <file>pic/keys.png</file> + <file>pic/message.png</file> + <file>pic/messagebox_critical.png</file> + <file>pic/messagebox_info.png</file> + <file>pic/messagebox_warning.png</file> + <file>pic/mouse.png</file> + <file>pic/paste.png</file> + <file>pic/popwidget.png</file> + <file>pic/pref.png</file> + <file>pic/qterm.png</file> + <file>pic/qterm_32x32.png</file> + <file>pic/qterm_48x48.png</file> + <file>pic/qterm_tray.png</file> + <file>pic/quick.png</file> + <file>pic/reconnect.png</file> + <file>pic/rect.png</file> + <file>pic/refresh.png</file> + <file>pic/shadow.png</file> + <file>pic/sound.png</file> + <file>pic/tabpad.png</file> + </qresource> +</RCC> Modified: trunk/qterm-qt4/src/imagelistviewer.cpp =================================================================== --- trunk/qterm-qt4/src/imagelistviewer.cpp 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/imagelistviewer.cpp 2010-06-17 08:26:40 UTC (rev 1192) @@ -40,7 +40,6 @@ ImageDelegate::ImageDelegate(QObject *parent) : QStyledItemDelegate(parent) { - d_shadow = Global::instance()->pathPic() + "pic/shadow.png"; } QSize ImageDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index ) const { @@ -61,7 +60,7 @@ // scale original and shadow images QImage original(path+"/"+filename); original = original.scaled(thumbSize, thumbSize, Qt::KeepAspectRatio); - QImage shadow(d_shadow); + QImage shadow(":/pic/shadow.png"); uint shadowSize; if (original.width() > original.height()) shadowSize = static_cast<uint>(original.width()/100.0*6.0); Modified: trunk/qterm-qt4/src/imagelistviewer.h =================================================================== --- trunk/qterm-qt4/src/imagelistviewer.h 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/imagelistviewer.h 2010-06-17 08:26:40 UTC (rev 1192) @@ -36,7 +36,6 @@ void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; private: static const int thumbSize = 100; - QString d_shadow; }; class ImageListViewer : public QListView Modified: trunk/qterm-qt4/src/imageviewer.cpp =================================================================== --- trunk/qterm-qt4/src/imageviewer.cpp 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/imageviewer.cpp 2010-06-17 08:26:40 UTC (rev 1192) @@ -11,7 +11,7 @@ namespace QTerm { -Image::Image(const QString & image, const QString & path, QWidget * parent) +Image::Image(const QString & path, QWidget * parent) :QWidget(parent), d_index(0) { ui.setupUi(this); Modified: trunk/qterm-qt4/src/imageviewer.h =================================================================== --- trunk/qterm-qt4/src/imageviewer.h 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/imageviewer.h 2010-06-17 08:26:40 UTC (rev 1192) @@ -23,7 +23,7 @@ { Q_OBJECT public: - Image(const QString &, const QString &, QWidget * parent=0); + Image(const QString &, QWidget * parent=0); ~Image(); public slots: Modified: trunk/qterm-qt4/src/main.cpp =================================================================== --- trunk/qterm-qt4/src/main.cpp 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/main.cpp 2010-06-17 08:26:40 UTC (rev 1192) @@ -127,7 +127,6 @@ int main( int argc, char ** argv ) { - if ( strcmp( qVersion(), QT_MIN_VERSION ) < 0 ) { qFatal("QTerm requires Qt %s or above to run! Qt installed in your system is %s.", QT_MIN_VERSION, qVersion()); } @@ -150,7 +149,7 @@ QTerm::Frame * mw = new QTerm::Frame(); mw->setWindowTitle( "QTerm "+QString(QTERM_VERSION) ); - mw->setWindowIcon( QPixmap(Global::instance()->pathLib()+"pic/qterm.png") ); + mw->setWindowIcon( QIcon(":/pic/qterm.png") ); mw->show(); a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) ); a.connect( &a, SIGNAL(commitDataRequest(QSessionManager &)), mw, SLOT(saveAndDisconnect()), Qt::DirectConnection); Modified: trunk/qterm-qt4/src/osdmessage.cpp =================================================================== --- trunk/qterm-qt4/src/osdmessage.cpp 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/osdmessage.cpp 2010-06-17 08:26:40 UTC (rev 1192) @@ -86,20 +86,19 @@ // [QTerm], we don't have a icon at this time. QPixmap symbol; - QString pathPic = Global::instance()->pathPic(); if (icon != None) { switch (icon) { //case Find: //symbol = SmallIcon( "viewmag" ); //break; case Error: - symbol = QPixmap(pathPic + "pic/messagebox_critical.png"); + symbol = QPixmap(":/pic/messagebox_critical.png"); break; case Warning: - symbol = QPixmap(pathPic + "pic/messagebox_warning.png"); + symbol = QPixmap(":/pic/messagebox_warning.png"); break; default: - symbol = QPixmap(pathPic + "pic/messagebox_info.png"); + symbol = QPixmap(":/pic/messagebox_info.png"); break; } textXOffset = 2 + symbol.width(); Modified: trunk/qterm-qt4/src/popwidget.cpp =================================================================== --- trunk/qterm-qt4/src/popwidget.cpp 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/popwidget.cpp 2010-06-17 08:26:40 UTC (rev 1192) @@ -29,7 +29,7 @@ : QWidget(parent) { setWindowFlags(Qt::WindowStaysOnTopHint|Qt::X11BypassWindowManagerHint|Qt::Tool); - QPixmap pxm(QPixmap(Global::instance()->pathLib()+"pic/popwidget.png") ); + QPixmap pxm(":/pic/popwidget.png"); if(!pxm.isNull()) { resize(pxm.width(), pxm.height()); Modified: trunk/qterm-qt4/src/progressBar.cpp =================================================================== --- trunk/qterm-qt4/src/progressBar.cpp 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/progressBar.cpp 2010-06-17 08:26:40 UTC (rev 1192) @@ -39,7 +39,7 @@ m_abort->setObjectName("Abort"); m_abort->hide(); //m_abort->setText( tr("Abort") ); - m_abort->setIcon( QPixmap( Global::instance()->pathPic() + "pic/messagebox_critical.png" )); + m_abort->setIcon( QIcon( ":/pic/messagebox_critical.png" )); m_label->show(); show(); } Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/qtermframe.cpp 2010-06-17 08:26:40 UTC (rev 1192) @@ -307,21 +307,17 @@ { Window * window = new Window(this, param, index, m_MdiArea, 0); - QString pathLib = Global::instance()->pathLib(); QMdiSubWindow * w = m_MdiArea->addSubWindow(window); window->setWindowTitle(param.m_strName); - window->setWindowIcon(QPixmap(pathLib + "pic/tabpad.png")); + window->setWindowIcon(QIcon(":/pic/tabpad.png")); window->setAttribute(Qt::WA_DeleteOnClose); if (m_menuBarAction->isChecked()) { w->setWindowFlags(Qt::FramelessWindowHint); } - QIcon* icon = new QIcon(QPixmap(pathLib + "pic/tabpad.png")); - QString qtab = window->windowTitle(); - //add window-tab-icon to window manager wndmgr->addWindow(window); - tabBar->addTab(*icon, qtab); + tabBar->addTab(QIcon(":/pic/tabpad.png"),window->windowTitle()); window->setFocus(); window->showMaximized(); @@ -767,7 +763,7 @@ void Frame::viewImages() { - Image *pViewer = new Image(Global::instance()->pathPic() + "pic/shadow.png", Global::instance()->m_pref.strPoolPath); + Image *pViewer = new Image(Global::instance()->m_pref.strPoolPath); pViewer->show(); } @@ -831,7 +827,7 @@ mdiTools = addToolBar("Main ToolBar"); mdiTools->setObjectName("mainToolBar"); - QAction * connectAction = new QAction(QPixmap(Global::instance()->pathPic() + "pic/connect.png"), tr("&Connect"), this); + QAction * connectAction = new QAction(QIcon(":/pic/connect.png"), tr("&Connect"), this); connectAction->setObjectName("actionConnectButton"); mdiTools->addAction(connectAction); connectMenu = new QMenu(this); @@ -894,29 +890,27 @@ void Frame::initActions() { - QString pathLib = Global::instance()->pathPic(); - - m_connectAction = new QAction(QPixmap(pathLib + "pic/connect.png"), tr("&Connect"), this); + m_connectAction = new QAction(QIcon(":/pic/connect.png"), tr("&Connect"), this); m_connectAction->setObjectName("actionConnect"); - m_disconnectAction = new QAction(QPixmap(pathLib + "pic/disconnect.png"), tr("&Disconnect"), this); + m_disconnectAction = new QAction(QIcon(":/pic/disconnect.png"), tr("&Disconnect"), this); m_disconnectAction->setObjectName("actionDisconnect"); - m_addressAction = new QAction(QPixmap(pathLib + "pic/addr.png"), tr("&Address Book..."), this); + m_addressAction = new QAction(QIcon(":/pic/addr.png"), tr("&Address Book..."), this); m_addressAction->setObjectName("actionAddress"); - m_quickConnectAction = new QAction(QPixmap(pathLib + "pic/quick.png"), tr("&Quick Login..."), this); + m_quickConnectAction = new QAction(QIcon(":/pic/quick.png"), tr("&Quick Login..."), this); m_quickConnectAction->setObjectName("actionQuickConnect"); m_printAction = new QAction(tr("&Print..."), this); m_printAction->setObjectName("actionPrint"); m_exitAction = new QAction(tr("&Exit"), this); m_exitAction->setObjectName("actionExit"); - m_copyAction = new QAction(QPixmap(pathLib + "pic/copy.png"), tr("&Copy"), this); + m_copyAction = new QAction(QIcon(":/pic/copy.png"), tr("&Copy"), this); m_copyAction->setObjectName("actionCopy"); - m_pasteAction = new QAction(QPixmap(pathLib + "pic/paste.png"), tr("&Paste"), this); + m_pasteAction = new QAction(QIcon(":/pic/paste.png"), tr("&Paste"), this); m_pasteAction->setObjectName("actionPaste"); - m_colorCopyAction = new QAction(QPixmap(pathLib + "pic/color-copy.png"), tr("C&opy With Color"), this); + m_colorCopyAction = new QAction(QIcon(":/pic/color-copy.png"), tr("C&opy With Color"), this); m_colorCopyAction->setObjectName("actionColorCopy"); m_colorCopyAction->setCheckable(true); - m_rectAction = new QAction(QPixmap(pathLib + "pic/rect.png"), tr("&Rectangle Select"), this); + m_rectAction = new QAction(QIcon(":/pic/rect.png"), tr("&Rectangle Select"), this); m_rectAction->setObjectName("actionRect"); m_rectAction->setCheckable(true); m_autoCopyAction = new QAction(tr("Auto Copy &Select"), this); @@ -958,7 +952,7 @@ codecGroup->addAction(m_S2TAction); codecGroup->addAction(m_T2SAction); - m_refreshAction = new QAction(QPixmap(pathLib + "pic/refresh.png"), tr("&Refresh"), this); + m_refreshAction = new QAction(QIcon(":/pic/refresh.png"), tr("&Refresh"), this); m_refreshAction->setObjectName("actionRefresh"); QActionGroup * langGroup = new QActionGroup(this); @@ -1009,27 +1003,27 @@ m_switchAction->setObjectName("actionSwitch"); m_switchAction->setCheckable(true); - m_currentSessionAction = new QAction(QPixmap(pathLib + "pic/pref.png"), tr("&Setting For Currrent Session..."), this); + m_currentSessionAction = new QAction(QIcon(":/pic/pref.png"), tr("&Setting For Currrent Session..."), this); m_currentSessionAction->setObjectName("actionCurrentSession"); m_defaultAction = new QAction(tr("&Default Setting..."), this); m_defaultAction->setObjectName("actionDefault"); m_prefAction = new QAction(tr("&Preference..."), this); m_prefAction->setObjectName("actionPref"); - m_copyArticleAction = new QAction(QPixmap(pathLib + "pic/article.png"), tr("&Copy Article..."), this); + m_copyArticleAction = new QAction(QIcon(":/pic/article.png"), tr("&Copy Article..."), this); m_copyArticleAction->setObjectName("actionCopyArticle"); - m_antiIdleAction = new QAction(QPixmap(pathLib + "pic/anti-idle.png"), tr("Anti &Idle"), this); + m_antiIdleAction = new QAction(QIcon(":/pic/anti-idle.png"), tr("Anti &Idle"), this); m_antiIdleAction->setObjectName("actionAntiIdle"); m_antiIdleAction->setCheckable(true); - m_autoReplyAction = new QAction(QPixmap(pathLib + "pic/auto-reply.png"), tr("Auto &Reply"), this); + m_autoReplyAction = new QAction(QIcon(":/pic/auto-reply.png"), tr("Auto &Reply"), this); m_autoReplyAction->setObjectName("actionAutoReply"); m_autoReplyAction->setCheckable(true); - m_viewMessageAction = new QAction(QPixmap(pathLib + "pic/message.png"), tr("&View Messages..."), this); + m_viewMessageAction = new QAction(QIcon(":/pic/message.png"), tr("&View Messages..."), this); m_viewMessageAction->setObjectName("actionViewMessage"); - m_beepAction = new QAction(QPixmap(pathLib + "pic/sound.png"), tr("&Beep "), this); + m_beepAction = new QAction(QIcon(":/pic/sound.png"), tr("&Beep "), this); m_beepAction->setObjectName("actionBeep"); m_beepAction->setCheckable(true); - m_mouseAction = new QAction(QPixmap(pathLib + "pic/mouse.png"), tr("&Mouse Support"), this); + m_mouseAction = new QAction(QIcon(":/pic/mouse.png"), tr("&Mouse Support"), this); m_mouseAction->setObjectName("actionMouse"); m_mouseAction->setCheckable(true); m_viewImageAction = new QAction(tr("&Image Viewer..."), this); @@ -1053,7 +1047,7 @@ m_homepageAction = new QAction(tr("QTerm's &Homepage"), this); m_homepageAction->setObjectName("actionHomepage"); - m_reconnectAction = new QAction(QPixmap(Global::instance()->pathPic() + "pic/reconnect.png"), tr("Auto Reconnect"), this); + m_reconnectAction = new QAction(QIcon(":/pic/reconnect.png"), tr("Auto Reconnect"), this); m_reconnectAction->setObjectName("actionReconnect"); m_reconnectAction->setCheckable(true); @@ -1325,7 +1319,7 @@ void Frame::updateKeyToolBar() { key->clear(); - key->addAction(QPixmap(Global::instance()->pathPic() + "pic/keys.png"), tr("Key Setup"), this, SLOT(keySetup())); + key->addAction(QIcon(":/pic/keys.png"), tr("Key Setup"), this, SLOT(keySetup())); Config * conf = Global::instance()->fileCfg(); QString strItem, strTmp; @@ -1392,8 +1386,8 @@ connect(trayMenu, SIGNAL(aboutToShow()), SLOT(buildTrayMenu())); - tray = new QSystemTrayIcon(this); //pathLib+"pic/qterm_tray.png", "QTerm", trayMenu, this); - tray->setIcon(QPixmap(Global::instance()->pathPic() + "pic/qterm_tray.png")); + tray = new QSystemTrayIcon(this); + tray->setIcon(QIcon(":/pic/qterm_tray.png")); tray->setContextMenu(trayMenu); connect(tray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayActivated(QSystemTrayIcon::ActivationReason))); Modified: trunk/qterm-qt4/src/qtermglobal.cpp =================================================================== --- trunk/qterm-qt4/src/qtermglobal.cpp 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/qtermglobal.cpp 2010-06-17 08:26:40 UTC (rev 1192) @@ -59,7 +59,7 @@ } Global::Global() - : m_fileCfg("./qterm.cfg"), m_addrCfg("./address.cfg"), m_pathLib("./"), m_pathPic("./"), m_pathCfg("./"), m_windowState(), m_status(INIT_OK), m_style(), m_fullScreen(false), m_language(Global::English), m_showToolBar() + : m_fileCfg("./qterm.cfg"), m_addrCfg("./address.cfg"), m_pathLib("./"), m_pathCfg("./"), m_windowState(), m_status(INIT_OK), m_style(), m_fullScreen(false), m_language(Global::English), m_showToolBar() { if (!iniWorkingDir(qApp->arguments()[0])) { m_status = INIT_ERROR; @@ -105,11 +105,6 @@ return m_pathLib; } -const QString & Global::pathPic() -{ - return m_pathPic; -} - const QString & Global::pathCfg() { return m_pathCfg; @@ -459,7 +454,6 @@ } ExeNamePath[LastSlash+1] = '\0'; m_pathLib = QString::fromLocal8Bit(ExeNamePath); - m_pathPic = QString::fromLocal8Bit(ExeNamePath); m_pathCfg = QString::fromLocal8Bit(ExeNamePath); strcpy(_fileCfg, ExeNamePath); strcat(_fileCfg, "qterm.cfg"); @@ -495,7 +489,6 @@ if (conf.exists()) { QString path= QCoreApplication::applicationDirPath()+"/"; m_pathLib = path; - m_pathPic = path; m_pathCfg = path; return true; } @@ -531,14 +524,6 @@ return false; - // picPath --- $HOME/.qterm/pic prefered - m_pathPic = m_pathCfg + "pic"; - dir.setPath(m_pathPic); - if (!dir.exists()) - m_pathPic = m_pathLib; - else - m_pathPic = m_pathCfg; - // copy configuration files m_fileCfg = m_pathCfg + "qterm.cfg"; if (!createLocalFile(m_fileCfg, m_pathLib + "qterm.cfg")) Modified: trunk/qterm-qt4/src/qtermwindow.cpp =================================================================== --- trunk/qterm-qt4/src/qtermwindow.cpp 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/qtermwindow.cpp 2010-06-17 08:26:40 UTC (rev 1192) @@ -375,14 +375,14 @@ #endif m_bDoingLogin = false; - cursor[0] = QCursor(QPixmap(pathLib + "cursor/home.xpm")); - cursor[1] = QCursor(QPixmap(pathLib + "cursor/end.xpm")); - cursor[2] = QCursor(QPixmap(pathLib + "cursor/pageup.xpm")); - cursor[3] = QCursor(QPixmap(pathLib + "cursor/pagedown.xpm")); - cursor[4] = QCursor(QPixmap(pathLib + "cursor/prev.xpm")); - cursor[5] = QCursor(QPixmap(pathLib + "cursor/next.xpm")); - cursor[6] = QCursor(QPixmap(pathLib + "cursor/exit.xpm"), 0, 10); - cursor[7] = QCursor(QPixmap(pathLib + "cursor/hand.xpm")); + cursor[0] = QCursor(QPixmap(":/cursor/home.xpm")); + cursor[1] = QCursor(QPixmap(":/cursor/end.xpm")); + cursor[2] = QCursor(QPixmap(":/cursor/pageup.xpm")); + cursor[3] = QCursor(QPixmap(":/cursor/pagedown.xpm")); + cursor[4] = QCursor(QPixmap(":/cursor/prev.xpm")); + cursor[5] = QCursor(QPixmap(":/cursor/next.xpm")); + cursor[6] = QCursor(QPixmap(":/cursor/exit.xpm"), 0, 10); + cursor[7] = QCursor(QPixmap(":/cursor/hand.xpm")); cursor[8] = Qt::ArrowCursor; // the system wide script Copied: trunk/qterm-qt4/src/qtermwindowbase.h (from rev 1189, branches/frame/qtermwindowbase.h) =================================================================== --- trunk/qterm-qt4/src/qtermwindowbase.h (rev 0) +++ trunk/qterm-qt4/src/qtermwindowbase.h 2010-06-17 08:26:40 UTC (rev 1192) @@ -0,0 +1,31 @@ +#ifndef QTERMWINDOWBASE_H +#define QTERMWINDOWBASE_H + +#include <QWidget> +class QTermWindowBase; + +class QTermWindowBase : public QWidget +{ + Q_OBJECT + +public: + QTermWindowBase(QWidget *parent=0):QWidget(parent,Qt::Window) {} + virtual ~QTermWindowBase() {} + + bool hasAction(const QString& act){return listActions.contains(act);} + +signals: + void windowClosed(QTermWindowBase*); + + +protected: + void closeEvent(QCloseEvent*e) + { + emit windowClosed(this); + } + + QStringList listActions; +}; + + +#endif // QTERMWINDOWBASE_H Modified: trunk/qterm-qt4/src/statusBar.cpp =================================================================== --- trunk/qterm-qt4/src/statusBar.cpp 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/statusBar.cpp 2010-06-17 08:26:40 UTC (rev 1192) @@ -91,8 +91,8 @@ //b1->setIconSet( SmallIconSet( "cancel" ) ); //b2->setIconSet( SmallIconSet( "2uparrow") ); - b1->setIcon( QPixmap( Global::instance()->pathPic() + "pic/messagebox_critical.png" )); - b2->setIcon( QPixmap( Global::instance()->pathPic() + "pic/messagebox_info.png" )); + b1->setIcon( QIcon( ":/pic/messagebox_critical.png" )); + b2->setIcon( QIcon( ":/pic/messagebox_info.png" )); b2->setCheckable( true ); // QToolTip::add( b1, tr( "Abort all background-operations" ) ); // QToolTip::add( b2, tr( "Show progress detail" ) ); Modified: trunk/qterm-qt4/src/ui/aboutdialog.ui =================================================================== --- trunk/qterm-qt4/src/ui/aboutdialog.ui 2010-06-17 06:52:24 UTC (rev 1191) +++ trunk/qterm-qt4/src/ui/aboutdialog.ui 2010-06-17 08:26:40 UTC (rev 1192) @@ -52,6 +52,9 @@ <property name="text"> <string/> </property> + <property name="pixmap"> + <pixmap resource="../frame.qrc">:/pic/qterm_32x32.png</pixmap> + </property> <property name="scaledContents"> <bool>true</bool> </property> @@ -95,7 +98,7 @@ </rect> </property> <property name="currentIndex"> - <number>0</number> + <number>1</number> </property> <widget class="QWidget" name="tab1"> <attribute name="title"> @@ -134,6 +137,9 @@ <property name="text"> <string/> </property> + <property name="pixmap"> + <pixmap resource="../frame.qrc">:/pic/qterm.png</pixmap> + </property> <property name="scaledContents"> <bool>true</bool> </property> @@ -179,6 +185,9 @@ <property name="text"> <string/> </property> + <property name="pixmap"> + <pixmap resource="../frame.qrc">:/pic/qterm.png</pixmap> + </property> <property name="scaledContents"> <bool>true</bool> </property> @@ -219,7 +228,10 @@ <tabstop>closeButton</tabstop> <tabstop>mainTabWidget</tabstop> </tabstops> - <resources/> + <resources> + <include location="../frame.qrc"/> + <include location="../frame.qrc"/> + </resources> <connections> <connection> <sender>closeButton</sender> Copied: trunk/qterm-qt4/src/ui/frame.ui (from rev 1189, branches/frame/ui/frame.ui) =================================================================== --- trunk/qterm-qt4/src/ui/frame.ui (rev 0) +++ trunk/qterm-qt4/src/ui/frame.ui 2010-06-17 08:26:40 UTC (rev 1192) @@ -0,0 +1,614 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Frame</class> + <widget class="QMainWindow" name="Frame"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>674</width> + <height>393</height> + </rect> + </property> + <property name="windowTitle"> + <string>QTerm</string> + </property> + <widget class="QMenuBar" name="menubar"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>674</width> + <height>20</height> + </rect> + </property> + <widget class="QMenu" name="menuFile"> + <property name="title"> + <string>&Terminal</string> + </property> + <addaction name="actionConsole"/> + <addaction name="separator"/> + <addaction name="actionQuick_Login"/> + <addaction name="actionAddressBook"/> + <addaction name="separator"/> + <addaction name="actionQuit"/> + </widget> + <widget class="QMenu" name="menuView"> + <property name="title"> + <string>&View</string> + </property> + <widget class="QMenu" name="menuLanguage"> + <property name="title"> + <string>Language</string> + </property> + <addaction name="actionEnglish"/> + <addaction name="actionSimplified_Chinese"/> + <addaction name="actionTraditional_Chinese"/> + </widget> + <widget class="QMenu" name="menuTheme"> + <property name="title"> + <string>Theme</string> + </property> + </widget> + <addaction name="actionFont"/> + <addaction name="separator"/> + <addaction name="actionStatusbar"/> + <addaction name="actionRuler"/> + <addaction name="actionFullscreen"/> + <addaction name="actionRefresh"/> + <addaction name="menuLanguage"/> + <addaction name="menuTheme"/> + </widget> + <widget class="QMenu" name="menuANSI"> + <property name="title"> + <string>&ANSI</string> + </property> + <addaction name="actionNew_ANSI"/> + <addaction name="actionOpen_ANSI"/> + <addaction name="separator"/> + <addaction name="actionSave"/> + <addaction name="actionSave_As"/> + <addaction name="separator"/> + <addaction name="actionPrint_Preview"/> + <addaction name="actionPrint"/> + </widget> + <widget class="QMenu" name="menuEdit"> + <property name="title"> + <string>&Edit</string> + </property> + <widget class="QMenu" name="menuPaste_w_Color"> + <property name="title"> + <string>Paste w Color</string> + </property> + <addaction name="actionNone_Color"/> + <addaction name="actionESC_ESC"/> + <addaction name="actionCtrl_U"/> + <addaction name="actionCustom"/> + </widget> + <widget class="QMenu" name="menuClipboard_Conversion"> + <property name="title"> + <string>Clipboard Conversion</string> + </property> + <addaction name="actionNone"/> + <addaction name="actionCHS_CHT"/> + <addaction name="actionCHT_CHS"/> + </widget> + <addaction name="actionCut"/> + <addaction name="actionCopy"/> + <addaction name="actionPaste"/> + <addaction name="separator"/> + <addaction name="actionAuto_Copy"/> + <addaction name="actionRectangle_Selection"/> + <addaction name="actionPaste_w_Wordwrap"/> + <addaction name="separator"/> + <addaction name="actionCopy_w_Color"/> + <addaction name="menuPaste_w_Color"/> + <addaction name="separator"/> + <addaction name="actionSymbols"/> + <addaction name="menuClipboard_Conversion"/> + </widget> + <widget class="QMenu" name="menuFavatite"> + <property name="title"> + <string>&Favatite</string> + </property> + <addaction name="actionAdd_to_favarites"/> + <addaction name="actionManage_Favarites"/> + <addaction name="separator"/> + </widget> + <widget class="QMenu" name="menuBBS"> + <property name="title"> + <string>&BBS </string> + </property> + <addaction name="actionCopy_Article"/> + <addaction name="actionAnti_idle"/> + <addaction name="actionAuto_Reply"/> + <addaction name="actionSupport_Mouse"/> + <addaction name="actionBeep_on_message"/> + <addaction name="actionView_Message"/> + <addaction name="actionArticle_Manager"/> + <addaction name="actionImage_Viewer"/> + </widget> + <widget class="QMenu" name="menuOptions"> + <property name="title"> + <string>&Options</string> + </property> + <addaction name="actionDefault_Session_Setting"/> + <addaction name="actionPreference"/> + <addaction name="separator"/> + <addaction name="actionConfigure_Shortcuts"/> + <addaction name="actionConfigure_Toolbars"/> + </widget> + <widget class="QMenu" name="menuScript"> + <property name="title"> + <string>&Script</string> + </property> + <addaction name="actionRun"/> + <addaction name="actionStop"/> + <addaction name="actionDebug_Console"/> + <addaction name="actionReload_Script"/> + </widget> + <widget class="QMenu" name="menuHelp"> + <property name="title"> + <string>Help</string> + </property> + <addaction name="actionContents"/> + <addaction name="actionWhat_s_this"/> + <addaction name="separator"/> + <addaction name="actionAbout_QTerm"/> + <addaction name="actionAbout_Qt"/> + </widget> + <addaction name="menuFile"/> + <addaction name="menuANSI"/> + <addaction name="menuBBS"/> + <addaction name="menuEdit"/> + <addaction name="menuView"/> + <addaction name="menuFavatite"/> + <addaction name="menuOptions"/> + <addaction name="menuScript"/> + <addaction name="menuHelp"/> + </widget> + <widget class="QStatusBar" name="statusbar"/> + <widget class="QToolBar" name="TerminalBar"> + <property name="windowTitle"> + <string>Terminal</string> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <attribute name="toolBarArea"> + <enum>LeftToolBarArea</enum> + </attribute> + <attribute name="toolBarBreak"> + <bool>false</bool> + </attribute> + </widget> + <widget class="QToolBar" name="EditBar"> + <property name="windowTitle"> + <string>Edit</string> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <attribute name="toolBarArea"> + <enum>RightToolBarArea</enum> + </attribute> + <attribute name="toolBarBreak"> + <bool>false</bool> + </attribute> + </widget> + <widget class="QToolBar" name="ANSIBar"> + <property name="windowTitle"> + <string>ANSI Edit</string> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <attribute name="toolBarArea"> + <enum>TopToolBarArea</enum> + </attribute> + <attribute name="toolBarBreak"> + <bool>false</bool> + </attribute> + </widget> + <widget class="QToolBar" name="PagerBar"> + <property name="windowTitle"> + <string>Pager</string> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <attribute name="toolBarArea"> + <enum>TopToolBarArea</enum> + </attribute> + <attribute name="toolBarBreak"> + <bool>false</bool> + </attribute> + </widget> + <action name="actionQuick_Login"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/quick.png</normaloff>:/pic/quick.png</iconset> + </property> + <property name="text"> + <string>Quick Login</string> + </property> + <property name="whatsThis"> + <string>This provides an express way to connect.</string> + </property> + </action> + <action name="actionAddressBook"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/addr.png</normaloff>:/pic/addr.png</iconset> + </property> + <property name="text"> + <string>&AddressBook</string> + </property> + </action> + <action name="actionNew_ANSI"> + <property name="text"> + <string>New ANSI</string> + </property> + </action> + <action name="actionOpen_ANSI"> + <property name="text"> + <string>Open ANSI</string> + </property> + </action> + <action name="actionQuit"> + <property name="text"> + <string>&Quit</string> + </property> + <property name="iconText"> + <string>Quit</string> + </property> + <property name="toolTip"> + <string>Quit</string> + </property> + <property name="whatsThis"> + <string>This will close all windows. You will be prompted to confirm disconnent active sessions or save modified files.</string> + </property> + </action> + <action name="actionSave"> + <property name="text"> + <string>Save</string> + </property> + </action> + <action name="actionSave_As"> + <property name="text"> + <string>Save As...</string> + </property> + </action> + <action name="actionConsole"> + <property name="text"> + <string>New &Console</string> + </property> + </action> + <action name="actionCopy"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/copy.png</normaloff>:/pic/copy.png</iconset> + </property> + <property name="text"> + <string>&Copy</string> + </property> + </action> + <action name="actionPaste"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/paste.png</normaloff>:/pic/paste.png</iconset> + </property> + <property name="text"> + <string>&Paste</string> + </property> + </action> + <action name="actionCopy_w_Color"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/color-copy.png</normaloff>:/pic/color-copy.png</iconset> + </property> + <property name="text"> + <string>Copy w Color</string> + </property> + </action> + <action name="actionPaste_w_Wordwrap"> + <property name="text"> + <string>Paste w Wordwrap</string> + </property> + </action> + <action name="actionRectangle_Selection"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/rect.png</normaloff>:/pic/rect.png</iconset> + </property> + <property name="text"> + <string>Rectangle Selection</string> + </property> + </action> + <action name="actionAuto_Copy"> + <property name="text"> + <string>&Auto Copy</string> + </property> + </action> + <action name="actionSymbols"> + <property name="text"> + <string>Symbols</string> + </property> + <property name="toolTip"> + <string>Symbols</string> + </property> + </action> + <action name="actionFullscreen"> + <property name="text"> + <string>&Fullscreen</string> + </property> + </action> + <action name="actionDefault_Session_Setting"> + <property name="text"> + <string>Default Session Setting</string> + </property> + </action> + <action name="actionPreference"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/pref.png</normaloff>:/pic/pref.png</iconset> + </property> + <property name="text"> + <string>&Preference</string> + </property> + </action> + <action name="actionAdd_to_favarites"> + <property name="text"> + <string>Add to favarites</string> + </property> + </action> + <action name="actionManage_Favarites"> + <property name="text"> + <string>Manage Favarites ...</string> + </property> + </action> + <action name="actionCopy_Article"> + <property name="icon"> + <iconset> + <normaloff>:/pic/copyarticle.png</normaloff>:/pic/copyarticle.png</iconset> + </property> + <property name="text"> + <string>&Copy Article</string> + </property> + </action> + <action name="actionAuto_Reply"> + <property name="text"> + <string>&Auto Reply</string> + </property> + </action> + <action name="actionSupport_Mouse"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/mouse.png</normaloff>:/pic/mouse.png</iconset> + </property> + <property name="text"> + <string>Support &Mouse</string> + </property> + </action> + <action name="actionBeep_on_message"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/sound.png</normaloff>:/pic/sound.png</iconset> + </property> + <property name="text"> + <string>&Beep on message</string> + </property> + </action> + <action name="actionConfigure_Shortcuts"> + <property name="text"> + <string>Configure Shortcuts</string> + </property> + </action> + <action name="actionView_Message"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/message.png</normaloff>:/pic/message.png</iconset> + </property> + <property name="text"> + <string>&View Message </string> + </property> + </action> + <action name="actionRun"> + <property name="text"> + <string>Run...</string> + </property> + </action> + <action name="actionStop"> + <property name="text"> + <string>Stop</string> + </property> + </action> + <action name="actionContents"> + <property name="text"> + <string>Contents...</string> + </property> + </action> + <action name="actionAbout_QTerm"> + <property name="text"> + <string>About QTerm</string> + </property> + </action> + <action name="actionAbout_Qt"> + <property name="text"> + <string>About Qt</string> + </property> + </action> + <action name="actionPrint"> + <property name="text"> + <string>Print</string> + </property> + </action> + <action name="actionPrint_Preview"> + <property name="text"> + <string>Print Preview</string> + </property> + </action> + <action name="actionClose"> + <property name="text"> + <string>Close</string> + </property> + </action> + <action name="actionAnti_idle"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/anti-idle.png</normaloff>:/pic/anti-idle.png</iconset> + </property> + <property name="text"> + <string>Anti-&idle</string> + </property> + </action> + <action name="actionDebug_Console"> + <property name="text"> + <string>Debug Console</string> + </property> + </action> + <action name="actionWhat_s_this"> + <property name="text"> + <string>What's this?</string> + </property> + </action> + <action name="actionQTerm_Online"> + <property name="text"> + <string>QTerm Online</string> + </property> + </action> + <action name="actionConfigure_Toolbars"> + <property name="text"> + <string>Configure Toolbars</string> + </property> + </action> + <action name="actionCut"> + <property name="text"> + <string>Cu&t</string> + </property> + </action> + <action name="actionRuler"> + <property name="text"> + <string>Ruler</string> + </property> + </action> + <action name="actionFont"> + <property name="icon"> + <iconset resource="../frame.qrc"> + <normaloff>:/pic/fonts.png</normaloff>:/pic/fonts.png</iconset> + </property> + <property name="text"> + <string>Font</string> + </property> + </action> + <action name="actionStatusbar"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Statusbar</string> + </property> + <property name="toolTip"> + <string>Show/Hide Statusbar</string> + </property> + <property name="whatsThis"> + <string>Show/Hide Statusbar</string> + </property> + </action> + <action name="actionArticle_Manager"> + <property name="text"> + <string>Article Manager</string> + </property> + </action> + <action name="actionRefresh"> + <property name="text"> + <string>Refresh</string> + </property> + </action> + <action name="actionReload_Script"> + <property name="text"> + <string>Reload Script</string> + </property> + </action> + <action name="actionImage_Viewer"> + <property name="text"> + <string>Image Viewer</string> + </property> + </action> + <action name="actionNone"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>None</string> + </property> + </action> + <action name="actionCHS_CHT"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>CHS -> CHT</string> + </property> + </action> + <action name="actionCHT_CHS"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>CHT -> CHS</string> + </property> + </action> + <action name="actionEnglish"> + <property name="text"> + <string>English</string> + </property> + </action> + <action name="actionNone_Color"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>None</string> + </property> + </action> + <action name="actionESC_ESC"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>ESC ESC [</string> + </property> + </action> + <action name="actionCtrl_U"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Ctrl+U [</string> + </property> + </action> + <action name="actionCustom"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Custom ...</string> + </property> + </action> + <action name="actionSimplified_Chinese"> + <property name="text"> + <string>Simplified Chinese</string> + </property> + </action> + <action name="actionTraditional_Chinese"> + <property name="text"> + <string>Traditional Chinese</string> + </property> + </action> + </widget> + <resources> + <include location="../frame.qrc"/> + </resources> + <connections/> +</ui> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-06-17 06:52:30
|
Revision: 1191 http://qterm.svn.sourceforge.net/qterm/?rev=1191&view=rev Author: sidos Date: 2010-06-17 06:52:24 +0000 (Thu, 17 Jun 2010) Log Message: ----------- http redirect (found in mitbbs) supported Modified Paths: -------------- trunk/qterm-qt4/src/qtermhttp.cpp Modified: trunk/qterm-qt4/src/qtermhttp.cpp =================================================================== --- trunk/qterm-qt4/src/qtermhttp.cpp 2010-06-15 04:37:05 UTC (rev 1190) +++ trunk/qterm-qt4/src/qtermhttp.cpp 2010-06-17 06:52:24 UTC (rev 1191) @@ -76,6 +76,18 @@ void Http::httpResponse(const QHttpResponseHeader& hrh) { + int code = hrh.statusCode(); + + if (code >=300 && code < 400 && hrh.hasKey("Location")) { + m_httpDown.get(hrh.value("Location")); + return; + } + + if (code != 200) { + m_httpDown.abort(); + return; + } + QString ValueString; QString filename; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hep...@us...> - 2010-06-15 04:37:12
|
Revision: 1190 http://qterm.svn.sourceforge.net/qterm/?rev=1190&view=rev Author: hephooey Date: 2010-06-15 04:37:05 +0000 (Tue, 15 Jun 2010) Log Message: ----------- Reverse the modifications of the cfg files in the last commit Modified Paths: -------------- trunk/qterm-qt4/src/address.cfg trunk/qterm-qt4/src/qterm.cfg Modified: trunk/qterm-qt4/src/address.cfg =================================================================== --- trunk/qterm-qt4/src/address.cfg 2010-06-14 07:36:10 UTC (rev 1189) +++ trunk/qterm-qt4/src/address.cfg 2010-06-15 04:37:05 UTC (rev 1190) @@ -6,8 +6,8 @@ [bbs%200] name=NEWSMTH -addr=newsmth.net -port=22 +addr=bbs.newsmth.org +port=23 hosttype=0 autologin=0 prelogin= @@ -19,8 +19,8 @@ autofont=1 alwayshighlight=0 ansicolor=1 -asciifont=Courier New -generalfont=Constantia +asciifont=Monospace +generalfont=Monospace fontsize=14 termtype=vt102 keytype=0 @@ -35,7 +35,7 @@ proxyport=0 proxyuser= proxypassword= -protocol=1 +protocol=0 sshuser= sshpassword= maxidle=180 @@ -51,7 +51,6 @@ menucolor=#004184 schemefile= replykey= -keyboardprofile= [bbs%201] name=Unknown Space Modified: trunk/qterm-qt4/src/qterm.cfg =================================================================== --- trunk/qterm-qt4/src/qterm.cfg 2010-06-14 07:36:10 UTC (rev 1189) +++ trunk/qterm-qt4/src/qterm.cfg 2010-06-15 04:37:05 UTC (rev 1190) @@ -4,19 +4,16 @@ [global] max=1 font=Sans -pointsize=7 +pointsize=10 quickfont=Monospace fullscreen=0 -theme=WindowsXP +theme=0 language=eng clipcodec=0 -vscrollpos=2 +vscrollpos=0 statusbar=0 switchbar=1 pixelsize=12 -geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x1\0\0\0\0\0\x96\0\0\0^\0\0\x4\xe2\0\0\x3\x84\0\0\0\x9a\0\0\0|\0\0\x4\xde\0\0\x3\x80\0\0\0\0\0\0) -state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x4\x45\0\0\x2\xbf\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x3\0\0\0\x16\0m\0\x61\0i\0n\0T\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0 \0\x63\0u\0s\0t\0o\0m\0K\0\x65\0y\0T\0o\0o\0l\0\x42\0\x61\0r\0\0\0\0:\0\0\x3\xde\0\0\0\0\0\0\0\0\0\0\0(\0\x62\0\x62\0s\0O\0p\0\x65\0r\0\x61\0t\0i\0o\0n\0s\0T\0o\0o\0l\0\x42\0\x61\0r\0\0\0\0\x46\0\0\0/\0\0\0\0\0\0\0\0) -sites=@Invalid() [key] num=1 @@ -39,12 +36,6 @@ http=xdg-open antialias=1 tray=0 -wavefile= -externalplayer= -clearpool=0 -pool=C:/QTerm/trunk/qterm-qt4/src/pool/ -zmodem=C:/QTerm/trunk/qterm-qt4/src/zmodem/ -image= [quick%200] addr=debian @@ -63,49 +54,6 @@ actionBoss=F12 actionCopy=Ctrl+Ins actionPaste=Shift+Ins -actionConnect= -actionDisconnect= -actionExit= -actionColorCopy= -actionRect= -actionAutoCopy= -actionWordWrap= -actionNoESC= -actionESCESC= -actionUESC= -actionCustomESC= -actionGBK= -actionBig5= -actionFont= -actionColor= -actionEng= -actionChs= -actionCht= -actionUiFont= -actionHide= -actionLeft= -actionRight= -actionStatus= -actionSwitch= -actionCurrentSession= -actionDefault= -actionPref= -actionAntiIdle= -actionAutoReply= -actionBeep= -actionMouse= -actionViewImage= -actionHomepage= -actionReconnect= -actionShortcuts= -actionToolbars= -actionConnectButton= -actionPrint= -actionNoConversion= -actionS2T= -actionScriptReload= -actionMenuBar= -actionScriptDebug= [ToolBars] mainToolBar=actionQuickConnect This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-06-14 07:36:17
|
Revision: 1189 http://qterm.svn.sourceforge.net/qterm/?rev=1189&view=rev Author: sidos Date: 2010-06-14 07:36:10 +0000 (Mon, 14 Jun 2010) Log Message: ----------- fix various warnings Modified Paths: -------------- trunk/qterm-qt4/CMakeLists.txt trunk/qterm-qt4/src/address.cfg trunk/qterm-qt4/src/qterm.cfg trunk/qterm-qt4/src/qtermbbs.cpp trunk/qterm-qt4/src/qtermglobal.cpp trunk/qterm-qt4/src/qtermtelnet.cpp trunk/qterm-qt4/src/qtermtelnet.h trunk/qterm-qt4/src/ssh/channel.cpp Property Changed: ---------------- trunk/qterm-qt4/ trunk/qterm-qt4/src/ Property changes on: trunk/qterm-qt4 ___________________________________________________________________ Added: svn:ignore + *.vcxproj CMakeFiles *.filters Modified: trunk/qterm-qt4/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/CMakeLists.txt 2010-06-12 19:43:42 UTC (rev 1188) +++ trunk/qterm-qt4/CMakeLists.txt 2010-06-14 07:36:10 UTC (rev 1189) @@ -9,10 +9,16 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") find_package(Qt4 REQUIRED) find_package(KDE4) + +IF(WIN32 AND MSVC) + ADD_DEFINITIONS (/D _CRT_SECURE_NO_WARNINGS) +ENDIF(WIN32 AND MSVC) + add_subdirectory(src) add_subdirectory(icons) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) + configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" Property changes on: trunk/qterm-qt4/src ___________________________________________________________________ Added: svn:ignore + *.cfg *.rule Modified: trunk/qterm-qt4/src/address.cfg =================================================================== --- trunk/qterm-qt4/src/address.cfg 2010-06-12 19:43:42 UTC (rev 1188) +++ trunk/qterm-qt4/src/address.cfg 2010-06-14 07:36:10 UTC (rev 1189) @@ -6,8 +6,8 @@ [bbs%200] name=NEWSMTH -addr=bbs.newsmth.org -port=23 +addr=newsmth.net +port=22 hosttype=0 autologin=0 prelogin= @@ -19,8 +19,8 @@ autofont=1 alwayshighlight=0 ansicolor=1 -asciifont=Monospace -generalfont=Monospace +asciifont=Courier New +generalfont=Constantia fontsize=14 termtype=vt102 keytype=0 @@ -35,7 +35,7 @@ proxyport=0 proxyuser= proxypassword= -protocol=0 +protocol=1 sshuser= sshpassword= maxidle=180 @@ -51,6 +51,7 @@ menucolor=#004184 schemefile= replykey= +keyboardprofile= [bbs%201] name=Unknown Space Modified: trunk/qterm-qt4/src/qterm.cfg =================================================================== --- trunk/qterm-qt4/src/qterm.cfg 2010-06-12 19:43:42 UTC (rev 1188) +++ trunk/qterm-qt4/src/qterm.cfg 2010-06-14 07:36:10 UTC (rev 1189) @@ -4,16 +4,19 @@ [global] max=1 font=Sans -pointsize=10 +pointsize=7 quickfont=Monospace fullscreen=0 -theme=0 +theme=WindowsXP language=eng clipcodec=0 -vscrollpos=0 +vscrollpos=2 statusbar=0 switchbar=1 pixelsize=12 +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x1\0\0\0\0\0\x96\0\0\0^\0\0\x4\xe2\0\0\x3\x84\0\0\0\x9a\0\0\0|\0\0\x4\xde\0\0\x3\x80\0\0\0\0\0\0) +state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x4\x45\0\0\x2\xbf\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x3\0\0\0\x16\0m\0\x61\0i\0n\0T\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0 \0\x63\0u\0s\0t\0o\0m\0K\0\x65\0y\0T\0o\0o\0l\0\x42\0\x61\0r\0\0\0\0:\0\0\x3\xde\0\0\0\0\0\0\0\0\0\0\0(\0\x62\0\x62\0s\0O\0p\0\x65\0r\0\x61\0t\0i\0o\0n\0s\0T\0o\0o\0l\0\x42\0\x61\0r\0\0\0\0\x46\0\0\0/\0\0\0\0\0\0\0\0) +sites=@Invalid() [key] num=1 @@ -36,6 +39,12 @@ http=xdg-open antialias=1 tray=0 +wavefile= +externalplayer= +clearpool=0 +pool=C:/QTerm/trunk/qterm-qt4/src/pool/ +zmodem=C:/QTerm/trunk/qterm-qt4/src/zmodem/ +image= [quick%200] addr=debian @@ -54,6 +63,49 @@ actionBoss=F12 actionCopy=Ctrl+Ins actionPaste=Shift+Ins +actionConnect= +actionDisconnect= +actionExit= +actionColorCopy= +actionRect= +actionAutoCopy= +actionWordWrap= +actionNoESC= +actionESCESC= +actionUESC= +actionCustomESC= +actionGBK= +actionBig5= +actionFont= +actionColor= +actionEng= +actionChs= +actionCht= +actionUiFont= +actionHide= +actionLeft= +actionRight= +actionStatus= +actionSwitch= +actionCurrentSession= +actionDefault= +actionPref= +actionAntiIdle= +actionAutoReply= +actionBeep= +actionMouse= +actionViewImage= +actionHomepage= +actionReconnect= +actionShortcuts= +actionToolbars= +actionConnectButton= +actionPrint= +actionNoConversion= +actionS2T= +actionScriptReload= +actionMenuBar= +actionScriptDebug= [ToolBars] mainToolBar=actionQuickConnect Modified: trunk/qterm-qt4/src/qtermbbs.cpp =================================================================== --- trunk/qterm-qt4/src/qtermbbs.cpp 2010-06-12 19:43:42 UTC (rev 1188) +++ trunk/qterm-qt4/src/qtermbbs.cpp 2010-06-14 07:36:10 UTC (rev 1189) @@ -585,7 +585,7 @@ if ((ata = strText.indexOf('@', begin + 1)) == -1) host = url + (ata - begin) + 1; else - return -1; + return false; } else { host = url+urlRe.matchedLength(); } Modified: trunk/qterm-qt4/src/qtermglobal.cpp =================================================================== --- trunk/qterm-qt4/src/qtermglobal.cpp 2010-06-12 19:43:42 UTC (rev 1188) +++ trunk/qterm-qt4/src/qtermglobal.cpp 2010-06-14 07:36:10 UTC (rev 1189) @@ -31,11 +31,11 @@ #include <QtGui/QMessageBox> #if defined(_OS_WIN32_) || defined(Q_OS_WIN32) +#include <windows.h> +#include <shellapi.h> #ifndef MAX_PATH #define MAX_PATH 128 #endif -#include <windows.h> -#include <shellapi.h> #endif namespace QTerm Modified: trunk/qterm-qt4/src/qtermtelnet.cpp =================================================================== --- trunk/qterm-qt4/src/qtermtelnet.cpp 2010-06-12 19:43:42 UTC (rev 1188) +++ trunk/qterm-qt4/src/qtermtelnet.cpp 2010-06-14 07:36:10 UTC (rev 1189) @@ -560,7 +560,7 @@ void Telnet::putc_down(u_char c) { // check overflow - if ((wsize + 1) > to_socket.size()) { + if ((wsize + 1) > (uint) to_socket.size()) { qWarning("putc_down : to_socket buffer overflow"); return; } @@ -841,7 +841,7 @@ /*if (scrfp) (void) putc(ch, scrfp);*/ - if ((rsize + 1) > to_ansi.size()) { + if ((rsize + 1) > (uint) to_ansi.size()) { qWarning("xputc_up : Buffer to_ansi overflow"); return -1; } Modified: trunk/qterm-qt4/src/qtermtelnet.h =================================================================== --- trunk/qterm-qt4/src/qtermtelnet.h 2010-06-12 19:43:42 UTC (rev 1188) +++ trunk/qterm-qt4/src/qtermtelnet.h 2010-06-14 07:36:10 UTC (rev 1189) @@ -216,7 +216,7 @@ int done_naws; bool d_isSSH; bool bConnected; - int raw_size; + uint raw_size; }; } // namespace QTerm Modified: trunk/qterm-qt4/src/ssh/channel.cpp =================================================================== --- trunk/qterm-qt4/src/ssh/channel.cpp 2010-06-12 19:43:42 UTC (rev 1188) +++ trunk/qterm-qt4/src/ssh/channel.cpp 2010-06-14 07:36:10 UTC (rev 1189) @@ -89,8 +89,8 @@ qDebug() << "===remote ID " << target->remoteID << target->remoteWindow; #endif // TODO: wait for window adjust? - if (target->localWindow >= data.size()) - target->localWindow -= data.size(); + if (target->localWindow >= (size_t) data.size()) + target->localWindow -= (size_t) data.size(); else qDebug("local window size is too small"); #ifdef SSH_DEBUG @@ -107,7 +107,7 @@ void SSH2Channel::writeData(int id, const QByteArray & data) { - if (m_channelList.at(id)->remoteWindow < data.size()) { + if (m_channelList.at(id)->remoteWindow < (size_t) data.size()) { qDebug("remote window too small"); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hep...@us...> - 2010-06-12 19:43:48
|
Revision: 1188 http://qterm.svn.sourceforge.net/qterm/?rev=1188&view=rev Author: hephooey Date: 2010-06-12 19:43:42 +0000 (Sat, 12 Jun 2010) Log Message: ----------- QTerm 0.5.11 Added Paths: ----------- tags/0.5.11/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hep...@us...> - 2010-06-12 18:25:48
|
Revision: 1187 http://qterm.svn.sourceforge.net/qterm/?rev=1187&view=rev Author: hephooey Date: 2010-06-12 18:25:42 +0000 (Sat, 12 Jun 2010) Log Message: ----------- Bump the version number and update README Modified Paths: -------------- trunk/qterm-qt4/CMakeLists.txt trunk/qterm-qt4/README Modified: trunk/qterm-qt4/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/CMakeLists.txt 2010-06-12 18:25:38 UTC (rev 1186) +++ trunk/qterm-qt4/CMakeLists.txt 2010-06-12 18:25:42 UTC (rev 1187) @@ -4,7 +4,7 @@ set(QT_MIN_VERSION "4.5.0") set(QTERM_VERSION_MAJOR 0) set(QTERM_VERSION_MINOR 5) -set(QTERM_VERSION_RELEASE 10) +set(QTERM_VERSION_RELEASE 11) set(QTERM_VERSION "${QTERM_VERSION_MAJOR}.${QTERM_VERSION_MINOR}.${QTERM_VERSION_RELEASE}" ) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") find_package(Qt4 REQUIRED) Modified: trunk/qterm-qt4/README =================================================================== --- trunk/qterm-qt4/README 2010-06-12 18:25:38 UTC (rev 1186) +++ trunk/qterm-qt4/README 2010-06-12 18:25:42 UTC (rev 1187) @@ -1,9 +1,11 @@ -QTerm 0.5.10 +QTerm 0.5.11 =============== 这个版本添加/修正了下面一些功能: -1. 增强脚本支持 -2. 各种 Bug fixes +1. 支持 Unicode 补完计划 (UAO) +2. 重写了图片浏览器 +3. 增强脚本支持 +4. 各种 Bug fixes The QTerm Team http://www.qterm.org This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hep...@us...> - 2010-06-12 18:25:48
|
Revision: 1186 http://qterm.svn.sourceforge.net/qterm/?rev=1186&view=rev Author: hephooey Date: 2010-06-12 18:25:38 +0000 (Sat, 12 Jun 2010) Log Message: ----------- Update comments Modified Paths: -------------- trunk/qterm-qt4/src/uaocodec.h Modified: trunk/qterm-qt4/src/uaocodec.h =================================================================== --- trunk/qterm-qt4/src/uaocodec.h 2010-06-12 18:17:03 UTC (rev 1185) +++ trunk/qterm-qt4/src/uaocodec.h 2010-06-12 18:25:38 UTC (rev 1186) @@ -39,8 +39,8 @@ ** ****************************************************************************/ -// Most of the code here was originally written by UAO project (uao-051123-src.tar.gz) -// Ported to Qt by hooey <hep...@gm...> +// Most of the code here was originally written by UAO project (http://uao.cpatch.org/) +// Ported to Qt by hooey <hep...@gm...> (from uao-051123-src.tar.gz) #ifndef UAOCODEC_H #define UAOCODEC_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hep...@us...> - 2010-06-12 18:17:10
|
Revision: 1185 http://qterm.svn.sourceforge.net/qterm/?rev=1185&view=rev Author: hephooey Date: 2010-06-12 18:17:03 +0000 (Sat, 12 Jun 2010) Log Message: ----------- Update ts files Modified Paths: -------------- trunk/qterm-qt4/src/po/qterm_chs.ts trunk/qterm-qt4/src/po/qterm_cht.ts Modified: trunk/qterm-qt4/src/po/qterm_chs.ts =================================================================== --- trunk/qterm-qt4/src/po/qterm_chs.ts 2010-06-12 18:16:57 UTC (rev 1184) +++ trunk/qterm-qt4/src/po/qterm_chs.ts 2010-06-12 18:17:03 UTC (rev 1185) @@ -611,14 +611,25 @@ <name>QTerm::Image</name> <message> <source>Hide &Browser</source> - <translation>隐藏浏览窗口(&B)</translation> + <translation type="obsolete">隐藏浏览窗口(&B)</translation> </message> <message> <source>Show &Browser</source> - <translation>显示浏览窗口(&B)</translation> + <translation type="obsolete">显示浏览窗口(&B)</translation> </message> </context> <context> + <name>QTerm::ImageFileModel</name> + <message> + <source>Name: %1 +Type: %2 +Size: %3 KB</source> + <translation>名称: %1 +类型: %2 +大小: %3 KB</translation> + </message> +</context> +<context> <name>QTerm::ProgressBar</name> <message> <source>Done</source> @@ -779,6 +790,10 @@ <source>URL:</source> <translation>连接:</translation> </message> + <message> + <source>IP database not found</source> + <translation>找不到 IP 数据库</translation> + </message> </context> <context> <name>QTerm::addrDialog</name> @@ -1263,32 +1278,20 @@ <name>QTermImage</name> <message> <source>&Previous</source> - <translation>上一个(&P)</translation> + <translation type="obsolete">上一个(&P)</translation> </message> <message> <source>&Browser</source> - <translation>浏览窗口(&B)</translation> + <translation type="obsolete">浏览窗口(&B)</translation> </message> <message> <source>&Next</source> - <translation>下一个(&N)</translation> + <translation type="obsolete">下一个(&N)</translation> </message> <message> - <source>Form1</source> - <translation></translation> + <source>Image Viewer</source> + <translation>外置图片浏览器</translation> </message> - <message> - <source>Alt+P</source> - <translation></translation> - </message> - <message> - <source>Alt+B</source> - <translation></translation> - </message> - <message> - <source>Alt+N</source> - <translation></translation> - </message> </context> <context> <name>QTermWindow</name> @@ -2310,11 +2313,11 @@ </message> <message> <source>Execute Code</source> - <translation>执行代码</translation> + <translation type="obsolete">执行代码</translation> </message> <message> <source>QTerm Script Console</source> - <translation>QTerm 脚本终端</translation> + <translation type="obsolete">QTerm 脚本终端</translation> </message> <message> <source>The QTerm Script Console allows you to easily execute JavaScript with access to all functions @@ -2333,7 +2336,7 @@ Execute code: CTRL-Enter Back in code history: Page Up Forward in code history: Page Down</source> - <translation>QTerm 脚本终端允许你轻松运行 JavaScript 脚本并调用所有你需要的 QTerm 函数和方法。 + <translation type="obsolete">QTerm 脚本终端允许你轻松运行 JavaScript 脚本并调用所有你需要的 QTerm 函数和方法。 QTerm 脚本的相关文档可以在 QTerm 的源代码的 doc 目录下找到。 执行代码: CTRL-Enter 在代码历史中前进: Page Up @@ -2341,7 +2344,7 @@ </message> <message> <source>Script Console...</source> - <translation type="unfinished">脚本终端...</translation> + <translation type="obsolete">脚本终端...</translation> </message> </context> <context> @@ -2436,11 +2439,11 @@ <name>google</name> <message> <source>No text is selected to search for</source> - <translation>没有文字被选中</translation> + <translation type="obsolete">没有文字被选中</translation> </message> <message> <source>Search Selected Text in Google</source> - <translation>用 Google 搜索选中文字</translation> + <translation type="obsolete">用 Google 搜索选中文字</translation> </message> </context> <context> @@ -3188,14 +3191,14 @@ <name>senddelay</name> <message> <source>Send String With Delay...</source> - <translation>延迟发送字符串...</translation> + <translation type="obsolete">延迟发送字符串...</translation> </message> </context> <context> <name>smth</name> <message> <source>System script loaded</source> - <translation>系统脚本加载成功</translation> + <translation type="obsolete">系统脚本加载成功</translation> </message> <message> <source>No text is selected to search for</source> @@ -3207,7 +3210,7 @@ </message> <message> <source>No article to download</source> - <translation>没有文章可下载</translation> + <translation type="obsolete">没有文章可下载</translation> </message> <message> <source>You are using smth.js in QTerm %1 (C) 2009 QTerm Developers</source> @@ -3215,11 +3218,11 @@ </message> <message> <source>About This Script</source> - <translation>关于当前脚本</translation> + <translation type="obsolete">关于当前脚本</translation> </message> <message> <source>You are using smth.js in QTerm %1 (C) 2009-2010 QTerm Developers</source> - <translation>你当前使用 QTerm %1 中的 smth.js 脚本 (C) 2009-2010 QTerm Developers</translation> + <translation type="obsolete">你当前使用 QTerm %1 中的 smth.js 脚本 (C) 2009-2010 QTerm Developers</translation> </message> </context> <context> Modified: trunk/qterm-qt4/src/po/qterm_cht.ts =================================================================== --- trunk/qterm-qt4/src/po/qterm_cht.ts 2010-06-12 18:16:57 UTC (rev 1184) +++ trunk/qterm-qt4/src/po/qterm_cht.ts 2010-06-12 18:17:03 UTC (rev 1185) @@ -2,460 +2,482 @@ <!DOCTYPE TS> <TS version="2.0"> <context> - <name>QTerm::Canvas</name> + <name>Dialog</name> <message> - <location filename="../qtermcanvas.cpp" line="31"/> - <source>zoom 1:1</source> + <location filename="../scripts/ui/senddelay.ui" line="26"/> + <source>Send string with delay</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermcanvas.cpp" line="32"/> - <source>fit window</source> + <location filename="../scripts/ui/senddelay.ui" line="60"/> + <source>String:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermcanvas.cpp" line="34"/> - <source>zoom in</source> + <location filename="../scripts/ui/senddelay.ui" line="82"/> + <source>Repeating:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermcanvas.cpp" line="35"/> - <source>zoom out</source> + <location filename="../scripts/ui/senddelay.ui" line="104"/> + <source>Delay(s):</source> <translation type="unfinished"></translation> </message> +</context> +<context> + <name>QTerm::Canvas</name> <message> - <location filename="../qtermcanvas.cpp" line="37"/> - <source>fullscreen</source> + <location filename="../qtermcanvas.cpp" line="32"/> + <source>Original Size</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermcanvas.cpp" line="39"/> - <source>rotate CW 90</source> + <location filename="../qtermcanvas.cpp" line="33"/> + <source>Fit Window</source> <translation type="unfinished"></translation> </message> <message> <location filename="../qtermcanvas.cpp" line="40"/> - <source>rotate CCW 90</source> + <source>Zoom In</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermcanvas.cpp" line="44"/> - <source>save as</source> + <location filename="../qtermcanvas.cpp" line="41"/> + <source>Zoom Out</source> <translation type="unfinished"></translation> </message> <message> + <location filename="../qtermcanvas.cpp" line="43"/> + <source>Fullscreen</source> + <translation type="unfinished"></translation> + </message> + <message> <location filename="../qtermcanvas.cpp" line="45"/> - <source>copy to</source> + <source>Rotate CW 90</source> <translation type="unfinished"></translation> </message> <message> <location filename="../qtermcanvas.cpp" line="46"/> - <source>silent copy</source> + <source>Rotate CCW 90</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermcanvas.cpp" line="47"/> - <source>delete</source> + <location filename="../qtermcanvas.cpp" line="50"/> + <source>Save As...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermcanvas.cpp" line="50"/> - <source>exit</source> + <location filename="../qtermcanvas.cpp" line="51"/> + <source>Copy To...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermcanvas.cpp" line="255"/> + <location filename="../qtermcanvas.cpp" line="52"/> + <source>Silent Copy</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qtermcanvas.cpp" line="53"/> + <source>Delete</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qtermcanvas.cpp" line="56"/> + <source>Exit</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qtermcanvas.cpp" line="253"/> <source>Choose a filename to save under</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermcanvas.cpp" line="261"/> + <location filename="../qtermcanvas.cpp" line="259"/> <source>Failed to save file</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermcanvas.cpp" line="261"/> + <location filename="../qtermcanvas.cpp" line="259"/> <source>Cant save file, maybe format not supported</source> <translation type="unfinished"></translation> </message> </context> <context> + <name>QTerm::CloseDialog</name> + <message> + <location filename="../closedialog.cpp" line="42"/> + <source>QTerm will quit in %1 seconds</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>QTerm::Frame</name> <message> - <location filename="../qtermframe.cpp" line="321"/> + <location filename="../qtermframe.cpp" line="356"/> <source>&Cascade</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="322"/> + <location filename="../qtermframe.cpp" line="357"/> <source>&Tile</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="332"/> + <location filename="../qtermframe.cpp" line="367"/> <source>&Main Window</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="370"/> + <location filename="../qtermframe.cpp" line="405"/> <source>Quick Login</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="466"/> + <location filename="../qtermframe.cpp" line="483"/> <source>This will take effect after restart, please close all windows and restart.</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="713"/> + <location filename="../qtermframe.cpp" line="735"/> <source>Print Document</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="767"/> + <location filename="../qtermframe.cpp" line="789"/> <source>You need to enable the script engine debugger to use this feature. Please recompile QTerm with the debugger enabled (need Qt 4.5 or newer version)</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="877"/> + <location filename="../qtermframe.cpp" line="834"/> + <location filename="../qtermframe.cpp" line="899"/> <source>&Connect</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="879"/> + <location filename="../qtermframe.cpp" line="901"/> <source>&Disconnect</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="885"/> + <location filename="../qtermframe.cpp" line="907"/> <source>&Print...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="887"/> - <location filename="../qtermframe.cpp" line="1407"/> + <location filename="../qtermframe.cpp" line="909"/> + <location filename="../qtermframe.cpp" line="1416"/> <source>&Exit</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="890"/> + <location filename="../qtermframe.cpp" line="912"/> <source>&Copy</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="892"/> + <location filename="../qtermframe.cpp" line="914"/> <source>&Paste</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="894"/> + <location filename="../qtermframe.cpp" line="916"/> <source>C&opy With Color</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="897"/> + <location filename="../qtermframe.cpp" line="919"/> <source>&Rectangle Select</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="900"/> + <location filename="../qtermframe.cpp" line="922"/> <source>Auto Copy &Select</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="903"/> + <location filename="../qtermframe.cpp" line="925"/> <source>P&aste With Wordwrap</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="908"/> + <location filename="../qtermframe.cpp" line="930"/> <source>&None</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="911"/> + <location filename="../qtermframe.cpp" line="933"/> <source>&ESC ESC [</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="914"/> + <location filename="../qtermframe.cpp" line="936"/> <source>Ctrl+&U [</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="917"/> + <location filename="../qtermframe.cpp" line="939"/> <source>&Custom...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="926"/> + <location filename="../qtermframe.cpp" line="948"/> <source>&No Conversion</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="929"/> + <location filename="../qtermframe.cpp" line="951"/> <source>&Simplified to Traditional</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="932"/> + <location filename="../qtermframe.cpp" line="954"/> <source>&Traditional to Simplified</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="961"/> + <location filename="../qtermframe.cpp" line="981"/> <source>&UI Font...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="995"/> + <location filename="../qtermframe.cpp" line="1012"/> <source>&Setting For Currrent Session...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="997"/> + <location filename="../qtermframe.cpp" line="1014"/> <source>&Default Setting...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="999"/> + <location filename="../qtermframe.cpp" line="1016"/> <source>&Preference...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1002"/> + <location filename="../qtermframe.cpp" line="1019"/> <source>&Copy Article...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1010"/> + <location filename="../qtermframe.cpp" line="1027"/> <source>&View Messages...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1018"/> + <location filename="../qtermframe.cpp" line="1035"/> <source>&Image Viewer...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1110"/> + <location filename="../qtermframe.cpp" line="1125"/> <source>File</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1123"/> + <location filename="../qtermframe.cpp" line="1138"/> <source>Edit</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1148"/> + <location filename="../qtermframe.cpp" line="1163"/> <source>View</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1182"/> + <location filename="../qtermframe.cpp" line="1195"/> <source>Option</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1194"/> + <location filename="../qtermframe.cpp" line="1207"/> <source>Special</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1206"/> + <location filename="../qtermframe.cpp" line="1219"/> <source>Script</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1215"/> + <location filename="../qtermframe.cpp" line="1228"/> <source>Windows</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1223"/> + <location filename="../qtermframe.cpp" line="1236"/> <source>Help</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="941"/> + <location filename="../qtermframe.cpp" line="961"/> <source>&Refresh</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="881"/> + <location filename="../qtermframe.cpp" line="903"/> <source>&Address Book...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="883"/> + <location filename="../qtermframe.cpp" line="905"/> <source>&Quick Login...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="939"/> - <source>&Appearance...</source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../qtermframe.cpp" line="945"/> + <location filename="../qtermframe.cpp" line="965"/> <source>&English</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="949"/> + <location filename="../qtermframe.cpp" line="969"/> <source>&Simplified Chinese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="953"/> + <location filename="../qtermframe.cpp" line="973"/> <source>&Traditional Chinese</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="963"/> + <location filename="../qtermframe.cpp" line="983"/> <source>&Full Screen</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="967"/> + <location filename="../qtermframe.cpp" line="987"/> <source>&Hide Menu Bar</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="971"/> + <location filename="../qtermframe.cpp" line="991"/> <source>Boss &Color</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="975"/> - <location filename="../qtermframe.cpp" line="1404"/> + <location filename="../qtermframe.cpp" line="995"/> + <location filename="../qtermframe.cpp" line="1413"/> <source>&Hide</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="978"/> + <location filename="../qtermframe.cpp" line="998"/> <source>&Left</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="981"/> + <location filename="../qtermframe.cpp" line="1001"/> <source>&Right</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="988"/> - <source>Status &Bar</source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../qtermframe.cpp" line="991"/> + <location filename="../qtermframe.cpp" line="1008"/> <source>S&witch Bar</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1004"/> + <location filename="../qtermframe.cpp" line="1021"/> <source>Anti &Idle</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1007"/> + <location filename="../qtermframe.cpp" line="1024"/> <source>Auto &Reply</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1012"/> + <location filename="../qtermframe.cpp" line="1029"/> <source>&Beep </source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1015"/> + <location filename="../qtermframe.cpp" line="1032"/> <source>&Mouse Support</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1021"/> + <location filename="../qtermframe.cpp" line="1038"/> <source>&Reload System Script</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1024"/> + <location filename="../qtermframe.cpp" line="1041"/> <source>&Run...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1027"/> + <location filename="../qtermframe.cpp" line="1044"/> <source>&Stop</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1030"/> + <location filename="../qtermframe.cpp" line="1047"/> <source>&Debug...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1034"/> + <location filename="../qtermframe.cpp" line="1051"/> <source>About &QTerm</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1036"/> + <location filename="../qtermframe.cpp" line="1053"/> <source>QTerm's &Homepage</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1039"/> + <location filename="../qtermframe.cpp" line="1056"/> <source>Auto Reconnect</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1043"/> + <location filename="../qtermframe.cpp" line="1060"/> <source>&Configure Shortcuts...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1046"/> + <location filename="../qtermframe.cpp" line="1063"/> <source>Configure &Toolbars...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1134"/> + <location filename="../qtermframe.cpp" line="1149"/> <source>Paste &with color</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1141"/> + <location filename="../qtermframe.cpp" line="1156"/> <source>Clipboard Chinese &Conversion</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1156"/> + <location filename="../qtermframe.cpp" line="1170"/> <source>&Language</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1163"/> + <location filename="../qtermframe.cpp" line="1177"/> <source>&Themes</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1169"/> + <location filename="../qtermframe.cpp" line="1183"/> <source>&ScrollBar</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1318"/> + <location filename="../qtermframe.cpp" line="1328"/> <source>Key Setup</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1402"/> + <location filename="../qtermframe.cpp" line="1411"/> <source>&Show</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermframe.cpp" line="1406"/> + <location filename="../qtermframe.cpp" line="1415"/> <source>&About</source> <translation type="unfinished"></translation> </message> @@ -463,23 +485,23 @@ <context> <name>QTerm::Global</name> <message> - <location filename="../qtermglobal.cpp" line="419"/> - <location filename="../qtermglobal.cpp" line="428"/> + <location filename="../qtermglobal.cpp" line="420"/> + <location filename="../qtermglobal.cpp" line="429"/> <source>Choose a file to save under</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermglobal.cpp" line="425"/> + <location filename="../qtermglobal.cpp" line="426"/> <source>File exists. Overwrite?</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermglobal.cpp" line="425"/> + <location filename="../qtermglobal.cpp" line="426"/> <source>Yes</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermglobal.cpp" line="425"/> + <location filename="../qtermglobal.cpp" line="426"/> <source>No</source> <translation type="unfinished"></translation> </message> @@ -487,28 +509,25 @@ <context> <name>QTerm::Http</name> <message> - <location filename="../qtermhttp.cpp" line="176"/> + <location filename="../qtermhttp.cpp" line="177"/> <source>Download Error</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermhttp.cpp" line="177"/> + <location filename="../qtermhttp.cpp" line="178"/> <source>Failed to download file</source> <translation type="unfinished"></translation> </message> </context> <context> - <name>QTerm::Image</name> + <name>QTerm::ImageFileModel</name> <message> - <location filename="../imageviewer.cpp" line="200"/> - <source>Hide &Browser</source> + <location filename="../imagelistviewer.cpp" line="32"/> + <source>Name: %1 +Type: %2 +Size: %3 KB</source> <translation type="unfinished"></translation> </message> - <message> - <location filename="../imageviewer.cpp" line="202"/> - <source>Show &Browser</source> - <translation type="unfinished"></translation> - </message> </context> <context> <name>QTerm::ProgressBar</name> @@ -545,22 +564,22 @@ <context> <name>QTerm::StatusBar</name> <message> - <location filename="../statusBar.cpp" line="96"/> + <location filename="../statusBar.cpp" line="99"/> <source>Abort all background-operations</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../statusBar.cpp" line="97"/> + <location filename="../statusBar.cpp" line="100"/> <source>Show progress detail</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../statusBar.cpp" line="239"/> + <location filename="../statusBar.cpp" line="242"/> <source>Multiple background-tasks running</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../statusBar.cpp" line="396"/> + <location filename="../statusBar.cpp" line="399"/> <source>Aborting all jobs...</source> <translation type="unfinished"></translation> </message> @@ -573,162 +592,167 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="312"/> + <location filename="../qtermwindow.cpp" line="311"/> <source>Not Connected</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="331"/> + <location filename="../qtermwindow.cpp" line="324"/> <source>Preview image</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="332"/> + <location filename="../qtermwindow.cpp" line="325"/> <source>Open link</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="333"/> + <location filename="../qtermwindow.cpp" line="326"/> <source>Copy link address</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="445"/> + <location filename="../qtermwindow.cpp" line="432"/> <source>Connected,Do you still want to exit?</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="754"/> + <location filename="../qtermwindow.cpp" line="735"/> <source>Open URL</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1099"/> + <location filename="../qtermwindow.cpp" line="736"/> + <source>URL:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qtermwindow.cpp" line="1079"/> <source>resolving host name</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1103"/> + <location filename="../qtermwindow.cpp" line="1082"/> <source>host found</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1107"/> + <location filename="../qtermwindow.cpp" line="1085"/> <source>host not found</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1112"/> + <location filename="../qtermwindow.cpp" line="1089"/> <source>connecting...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1116"/> + <location filename="../qtermwindow.cpp" line="1092"/> <source>connected</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1124"/> + <location filename="../qtermwindow.cpp" line="1099"/> <source>connected to proxy</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1128"/> + <location filename="../qtermwindow.cpp" line="1102"/> <source>proxy authentation</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1132"/> + <location filename="../qtermwindow.cpp" line="1105"/> <source>proxy failed</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1137"/> + <location filename="../qtermwindow.cpp" line="1109"/> <source>connection refused</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1142"/> + <location filename="../qtermwindow.cpp" line="1113"/> <source>error when reading from server</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1147"/> - <location filename="../qtermwindow.cpp" line="1438"/> + <location filename="../qtermwindow.cpp" line="1117"/> + <location filename="../qtermwindow.cpp" line="1401"/> <source>connection closed</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1154"/> + <location filename="../qtermwindow.cpp" line="1123"/> <source>connection close finished</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1159"/> + <location filename="../qtermwindow.cpp" line="1127"/> <source>connect to host via proxy</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1163"/> + <location filename="../qtermwindow.cpp" line="1130"/> <source>error in gethostbyname</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1168"/> + <location filename="../qtermwindow.cpp" line="1134"/> <source>error in startup winsock</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1173"/> + <location filename="../qtermwindow.cpp" line="1138"/> <source>error in connection</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1178"/> + <location filename="../qtermwindow.cpp" line="1142"/> <source>error in proxy</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1582"/> - <source>You have messages</source> + <location filename="../qtermwindow.cpp" line="1305"/> + <source>IP database not found</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../qtermwindow.cpp" line="1591"/> - <source>Setting changed do you want to save it?</source> + <location filename="../qtermwindow.cpp" line="1546"/> + <source>You have messages</source> <translation type="unfinished"></translation> </message> </context> <context> <name>QTerm::addrDialog</name> <message> - <location filename="../addrdialog.cpp" line="54"/> + <location filename="../addrdialog.cpp" line="57"/> <source>Cancel</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../addrdialog.cpp" line="55"/> + <location filename="../addrdialog.cpp" line="58"/> <source>OK</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../addrdialog.cpp" line="63"/> + <location filename="../addrdialog.cpp" line="66"/> <source>Setting</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../addrdialog.cpp" line="68"/> + <location filename="../addrdialog.cpp" line="71"/> <source>AddressBook</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../addrdialog.cpp" line="137"/> - <location filename="../addrdialog.cpp" line="238"/> + <location filename="../addrdialog.cpp" line="141"/> + <location filename="../addrdialog.cpp" line="242"/> <source>Setting changed, do you want to save?</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../addrdialog.cpp" line="303"/> + <location filename="../addrdialog.cpp" line="307"/> <source>SSH support is not compiled, check your OpenSSL and try to recompile QTerm</source> <translation type="unfinished"></translation> </message> @@ -736,7 +760,7 @@ <context> <name>QTerm::quickDialog</name> <message> - <location filename="../quickdialog.cpp" line="189"/> + <location filename="../quickdialog.cpp" line="179"/> <source>Address can not be blank.</source> <translation type="unfinished"></translation> </message> @@ -797,40 +821,10 @@ <context> <name>QTermImage</name> <message> - <location filename="../ui/imageviewer.ui" line="24"/> - <source>Form1</source> + <location filename="../ui/imageviewer.ui" line="14"/> + <source>Image Viewer</source> <translation type="unfinished"></translation> </message> - <message> - <location filename="../ui/imageviewer.ui" line="68"/> - <source>&Previous</source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../ui/imageviewer.ui" line="71"/> - <source>Alt+P</source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../ui/imageviewer.ui" line="102"/> - <source>&Browser</source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../ui/imageviewer.ui" line="105"/> - <source>Alt+B</source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../ui/imageviewer.ui" line="136"/> - <source>&Next</source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../ui/imageviewer.ui" line="139"/> - <source>Alt+N</source> - <translation type="unfinished"></translation> - </message> </context> <context> <name>SSHLogin</name> @@ -916,102 +910,102 @@ <context> <name>ToolbarDialog</name> <message> - <location filename="../ui/toolbardialog.ui" line="31"/> + <location filename="../ui/toolbardialog.ui" line="32"/> <source>Configure Toolbars</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="43"/> + <location filename="../ui/toolbardialog.ui" line="44"/> <source>OK</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="57"/> + <location filename="../ui/toolbardialog.ui" line="58"/> <source>Icon Only</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="62"/> + <location filename="../ui/toolbardialog.ui" line="63"/> <source>Text Only</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="67"/> + <location filename="../ui/toolbardialog.ui" line="68"/> <source>Text beside Icon</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="72"/> + <location filename="../ui/toolbardialog.ui" line="73"/> <source>Text below Icon</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="87"/> + <location filename="../ui/toolbardialog.ui" line="88"/> <source>16x16</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="92"/> + <location filename="../ui/toolbardialog.ui" line="93"/> + <source>22x22</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../ui/toolbardialog.ui" line="98"/> <source>32x32</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="97"/> + <location filename="../ui/toolbardialog.ui" line="103"/> <source>48x48</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="111"/> + <location filename="../ui/toolbardialog.ui" line="117"/> <source>Text Position:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="127"/> + <location filename="../ui/toolbardialog.ui" line="133"/> <source>Icon Size:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="143"/> + <location filename="../ui/toolbardialog.ui" line="149"/> <source>Current Actions:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="156"/> + <location filename="../ui/toolbardialog.ui" line="162"/> <source>ToolBar:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="169"/> - <source>Cancel</source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../ui/toolbardialog.ui" line="182"/> + <location filename="../ui/toolbardialog.ui" line="175"/> <source>Default</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="220"/> + <location filename="../ui/toolbardialog.ui" line="213"/> <source><</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="245"/> + <location filename="../ui/toolbardialog.ui" line="238"/> <source>^</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="276"/> + <location filename="../ui/toolbardialog.ui" line="269"/> <source>V</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="307"/> + <location filename="../ui/toolbardialog.ui" line="300"/> <source>></source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/toolbardialog.ui" line="340"/> + <location filename="../ui/toolbardialog.ui" line="333"/> <source>Available Actions:</source> <translation type="unfinished"></translation> </message> @@ -1096,13 +1090,13 @@ </message> <message> <location filename="../ui/addrdialog.ui" line="108"/> - <location filename="../ui/addrdialog.ui" line="1426"/> + <location filename="../ui/addrdialog.ui" line="1422"/> <source>Address:</source> <translation type="unfinished"></translation> </message> <message> <location filename="../ui/addrdialog.ui" line="127"/> - <location filename="../ui/addrdialog.ui" line="1372"/> + <location filename="../ui/addrdialog.ui" line="1368"/> <source>Type:</source> <translation type="unfinished"></translation> </message> @@ -1113,7 +1107,7 @@ </message> <message> <location filename="../ui/addrdialog.ui" line="166"/> - <location filename="../ui/addrdialog.ui" line="1053"/> + <location filename="../ui/addrdialog.ui" line="1049"/> <source>BBS</source> <translation type="unfinished"></translation> </message> @@ -1124,7 +1118,7 @@ </message> <message> <location filename="../ui/addrdialog.ui" line="185"/> - <location filename="../ui/addrdialog.ui" line="1455"/> + <location filename="../ui/addrdialog.ui" line="1451"/> <source>Port:</source> <translation type="unfinished"></translation> </message> @@ -1199,284 +1193,275 @@ <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="468"/> - <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Bitstream Vera Sans'; font-size:12pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Auto Select Font Size When Resize Window</p></body></html></source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../ui/addrdialog.ui" line="478"/> + <location filename="../ui/addrdialog.ui" line="474"/> <source>Auto Select Font Size When Resize Window</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="491"/> + <location filename="../ui/addrdialog.ui" line="487"/> <source>ANSI Color</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="504"/> + <location filename="../ui/addrdialog.ui" line="500"/> <source>Always Highlight</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="517"/> + <location filename="../ui/addrdialog.ui" line="513"/> <source>Cursor Type:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="537"/> + <location filename="../ui/addrdialog.ui" line="533"/> <source>Block</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="542"/> - <location filename="../ui/addrdialog.ui" line="581"/> + <location filename="../ui/addrdialog.ui" line="538"/> + <location filename="../ui/addrdialog.ui" line="577"/> <source>Underline</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="547"/> + <location filename="../ui/addrdialog.ui" line="543"/> <source>I Type</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="561"/> + <location filename="../ui/addrdialog.ui" line="557"/> <source>Menu Type:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="586"/> + <location filename="../ui/addrdialog.ui" line="582"/> <source>Reverse</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="591"/> + <location filename="../ui/addrdialog.ui" line="587"/> <source>Custom Color</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="605"/> + <location filename="../ui/addrdialog.ui" line="601"/> <source>Color...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="627"/> + <location filename="../ui/addrdialog.ui" line="623"/> <source>Text and Color:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="668"/> + <location filename="../ui/addrdialog.ui" line="664"/> <source>Menu and Cursor:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="741"/> + <location filename="../ui/addrdialog.ui" line="737"/> <source>ASCII Font:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="760"/> + <location filename="../ui/addrdialog.ui" line="756"/> <source>General Font:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="779"/> + <location filename="../ui/addrdialog.ui" line="775"/> <source>Font Size:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="798"/> + <location filename="../ui/addrdialog.ui" line="794"/> <source>Color Scheme:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="827"/> + <location filename="../ui/addrdialog.ui" line="823"/> <source>Configure...</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="833"/> + <location filename="../ui/addrdialog.ui" line="829"/> <source>Terminal</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="855"/> + <location filename="../ui/addrdialog.ui" line="851"/> <source>Key Type:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="884"/> + <location filename="../ui/addrdialog.ui" line="880"/> <source>Term Type:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="903"/> + <location filename="../ui/addrdialog.ui" line="899"/> <source>Escape string (i.e. *[ ):</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="932"/> + <location filename="../ui/addrdialog.ui" line="928"/> <source>Rows:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="961"/> + <location filename="../ui/addrdialog.ui" line="947"/> <source>Columns:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="990"/> + <location filename="../ui/addrdialog.ui" line="966"/> <source>Scroll Lines:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="1028"/> + <location filename="../ui/addrdialog.ui" line="994"/> <source>Terminal Settings:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="1065"/> + <location filename="../ui/addrdialog.ui" line="1061"/> <source>Max Idle Time (sec):</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="1084"/> + <location filename="../ui/addrdialog.ui" line="1080"/> <source>Key to reply message:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="1123"/> + <location filename="../ui/addrdialog.ui" line="1119"/> <source>Auto Reply Message:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="1162"/> + <location filename="../ui/addrdialog.ui" line="1158"/> <source>Anti-idle String:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="1191"/> + <location filename="../ui/addrdialog.ui" line="1187"/> <source>Pre-login:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="1210"/> - <location filename="../ui/addrdialog.ui" line="1516"/> + <location filename="../ui/addrdialog.ui" line="1206"/> + <location filename="../ui/addrdialog.ui" line="1512"/> <source>Password:</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../ui/addrdialog.ui" line="1239"/> - <location filename="../ui/addrdialog.ui" line="1487"/> + <location filename="../ui/addrdialog.ui" line="1235"/> + <location filename="../ui/addrdialog.ui" line="1483"/> <source>User:</source> <... [truncated message content] |
From: <hep...@us...> - 2010-06-12 18:17:03
|
Revision: 1184 http://qterm.svn.sourceforge.net/qterm/?rev=1184&view=rev Author: hephooey Date: 2010-06-12 18:16:57 +0000 (Sat, 12 Jun 2010) Log Message: ----------- Translation Modified Paths: -------------- trunk/qterm-qt4/src/imagelistviewer.cpp Modified: trunk/qterm-qt4/src/imagelistviewer.cpp =================================================================== --- trunk/qterm-qt4/src/imagelistviewer.cpp 2010-06-12 18:16:53 UTC (rev 1183) +++ trunk/qterm-qt4/src/imagelistviewer.cpp 2010-06-12 18:16:57 UTC (rev 1184) @@ -29,7 +29,7 @@ return QVariant(); switch (role) { - case Qt::ToolTipRole: return QString("Name: %1\nType: %2\nSize: %3 KB") + case Qt::ToolTipRole: return QString(tr("Name: %1\nType: %2\nSize: %3 KB")) .arg(fileName(index)) .arg(type(index)) .arg(size(index)/1024); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |