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: <go...@us...> - 2010-11-04 14:05:25
|
Revision: 1258 http://qterm.svn.sourceforge.net/qterm/?rev=1258&view=rev Author: gonwan Date: 2010-11-04 14:05:19 +0000 (Thu, 04 Nov 2010) Log Message: ----------- Fix copy function to return correct ANSI string. The fix only gives the basic fix. ANSI string is not compressed and one-char-two-color is not supported. Modified Paths: -------------- trunk/qterm-qt4/src/qtermtextline.cpp Modified: trunk/qterm-qt4/src/qtermtextline.cpp =================================================================== --- trunk/qterm-qt4/src/qtermtextline.cpp 2010-11-04 13:55:46 UTC (rev 1257) +++ trunk/qterm-qt4/src/qtermtextline.cpp 2010-11-04 14:05:19 UTC (rev 1258) @@ -231,7 +231,7 @@ if (index >= m_length) - return (char *)NULL; + return QString(); //qDebug("index=%d len=%d m_length=%d", index, len, m_length); @@ -248,9 +248,7 @@ int fg = GETFG(tempcp) + 30; int bg = GETBG(tempcp) + 40; - QString strAttr = QString("%1;%2").arg(fg).arg(bg).toLatin1();//QByteArray::setNum(fg)+';'+QByteArray::setNum(bg)+';'; -// cstrAttr.sprintf("%d;%d;", fg, bg ); - strAttr = escape + strAttr; + QString strAttr = escape; if (GETBOLD(tempea)) strAttr += "1;"; @@ -266,17 +264,15 @@ strAttr += "7;"; if (GETINVISIBLE(tempea)) strAttr += "8;"; - strAttr.remove(strAttr.length() - 1, 1); - strAttr += "m"; + strAttr += QString("%1;%2m").arg(fg).arg(bg); str += strAttr; // set attr + // the text str += getText(startx, i - startx); - // reset attr - strAttr = escape + "0m"; - str += strAttr; i--; } + str += escape + "m"; return str; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <go...@us...> - 2010-11-04 13:55:52
|
Revision: 1257 http://qterm.svn.sourceforge.net/qterm/?rev=1257&view=rev Author: gonwan Date: 2010-11-04 13:55:46 +0000 (Thu, 04 Nov 2010) Log Message: ----------- Fix display positions and paddings. Better support for one-char-two-color characters. Modified Paths: -------------- trunk/qterm-qt4/src/main.cpp trunk/qterm-qt4/src/qtermscreen.cpp Modified: trunk/qterm-qt4/src/main.cpp =================================================================== --- trunk/qterm-qt4/src/main.cpp 2010-11-04 13:18:19 UTC (rev 1256) +++ trunk/qterm-qt4/src/main.cpp 2010-11-04 13:55:46 UTC (rev 1257) @@ -130,7 +130,7 @@ 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()); } - QApplication::setGraphicsSystem("raster"); + //QApplication::setGraphicsSystem("raster"); QApplication a( argc, argv ); a.setApplicationName("QTerm"); Modified: trunk/qterm-qt4/src/qtermscreen.cpp =================================================================== --- trunk/qterm-qt4/src/qtermscreen.cpp 2010-11-04 13:18:19 UTC (rev 1256) +++ trunk/qterm-qt4/src/qtermscreen.cpp 2010-11-04 13:55:46 UTC (rev 1257) @@ -1004,12 +1004,21 @@ if (GETBG(cp) != 0 || m_ePaintState == Cursor) painter.fillRect(mapToRect(x, y, length, 1), QBrush(m_color[GETBG(cp)])); if (flags == RenderAll) { - painter.drawText(pt.x()+m_nCharDelta, pt.y(), m_nCharWidth*length, m_nCharHeight, Qt::AlignLeft|Qt::AlignBottom, str); - } else if (flags == RenderLeft) { - painter.drawText(pt.x()+m_nCharDelta, pt.y(), m_nCharWidth-m_nCharDelta, m_nCharHeight, Qt::AlignLeft|Qt::AlignBottom, str); - } else if (flags == RenderRight) { - int width = painter.fontMetrics().width(str[0])-m_nCharWidth+m_nCharDelta; - painter.drawText(pt.x(), pt.y(), width, m_nCharHeight, Qt::AlignRight|Qt::AlignBottom, str); + painter.drawText(pt.x(), pt.y(), m_nCharWidth*length, m_nCharHeight, Qt::AlignCenter, str); + } else { + QPixmap pm = QPixmap(m_nCharWidth*2, m_nCharHeight); + QPainter p(&pm); + p.fillRect(0, 0, pm.width(), pm.height(), m_color[GETBG(cp)]); + p.setPen(m_color[GETFG(cp)]); + p.setFont(painter.font()); + p.drawText(0, 0, m_nCharWidth*2, m_nCharHeight, Qt::AlignCenter, str); + p.end(); + if (flags == RenderLeft) { + painter.drawPixmap(pt.x(), pt.y(), pm, 0, 0, m_nCharWidth, m_nCharHeight); + } + if (flags == RenderRight) { + painter.drawPixmap(pt.x(), pt.y(), pm, m_nCharWidth, 0, m_nCharWidth, m_nCharHeight); + } } } painter.setBackground(QBrush(m_color[0])); @@ -1090,9 +1099,9 @@ QPoint pt = mapToPixel(QPoint(x, y)); if (width == -1) // to the end - return QRect(pt.x()+m_nCharDelta, pt.y(), size().width() , m_nCharHeight*height); + return QRect(pt.x(), pt.y(), size().width() , m_nCharHeight*height); else - return QRect(pt.x()+m_nCharDelta, pt.y(), width*m_nCharWidth, m_nCharHeight*height); + return QRect(pt.x(), pt.y(), width*m_nCharWidth, m_nCharHeight*height); } QRect Screen::mapToRect(const QRect& rect) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <go...@us...> - 2010-11-04 13:18:26
|
Revision: 1256 http://qterm.svn.sourceforge.net/qterm/?rev=1256&view=rev Author: gonwan Date: 2010-11-04 13:18:19 +0000 (Thu, 04 Nov 2010) Log Message: ----------- Fix potential bug which can cause inconsistent data. Modified Paths: -------------- trunk/qterm-qt4/src/qtermtextline.cpp Modified: trunk/qterm-qt4/src/qtermtextline.cpp =================================================================== --- trunk/qterm-qt4/src/qtermtextline.cpp 2010-10-05 09:27:18 UTC (rev 1255) +++ trunk/qterm-qt4/src/qtermtextline.cpp 2010-11-04 13:18:19 UTC (rev 1256) @@ -73,19 +73,19 @@ tmp.fill(NO_COLOR, index - m_length); m_color.append(tmp); tmp.fill(m_curColor, len); - m_color.insert(index, tmp.data()); + m_color.insert(index, tmp); tmp.fill(NO_ATTR, index - m_length); m_attr.append(tmp); tmp.fill(m_curAttr, len); - m_attr.insert(index, tmp.data()); + m_attr.insert(index, tmp); } else { m_text.insert(index, str); m_length = m_text.length(); tmp.fill(m_curColor, len); - m_color.insert(index, tmp.data()); + m_color.insert(index, tmp); tmp.fill(m_curAttr, len); - m_attr.insert(index, tmp.data()); + m_attr.insert(index, tmp); } start = index; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-10-05 09:27:24
|
Revision: 1255 http://qterm.svn.sourceforge.net/qterm/?rev=1255&view=rev Author: sidos Date: 2010-10-05 09:27:18 +0000 (Tue, 05 Oct 2010) Log Message: ----------- comment out work-in-progress Modified Paths: -------------- trunk/qterm-qt4/package.cmake Modified: trunk/qterm-qt4/package.cmake =================================================================== --- trunk/qterm-qt4/package.cmake 2010-09-27 10:38:58 UTC (rev 1254) +++ trunk/qterm-qt4/package.cmake 2010-10-05 09:27:18 UTC (rev 1255) @@ -21,6 +21,6 @@ ENDIF(WIN32 AND NOT UNIX) # Functions to install qt, ssl libraries -FUNCTION(install_libs, lib +#FUNCTION(install_libs, lib INCLUDE(CPack) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-09-27 10:39:05
|
Revision: 1254 http://qterm.svn.sourceforge.net/qterm/?rev=1254&view=rev Author: sidos Date: 2010-09-27 10:38:58 +0000 (Mon, 27 Sep 2010) Log Message: ----------- copyright info Added Paths: ----------- trunk/qterm-qt4/COPYRIGHT Added: trunk/qterm-qt4/COPYRIGHT =================================================================== --- trunk/qterm-qt4/COPYRIGHT (rev 0) +++ trunk/qterm-qt4/COPYRIGHT 2010-09-27 10:38:58 UTC (rev 1254) @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-09-27 10:32:13
|
Revision: 1253 http://qterm.svn.sourceforge.net/qterm/?rev=1253&view=rev Author: sidos Date: 2010-09-27 10:32:07 +0000 (Mon, 27 Sep 2010) Log Message: ----------- add CPACK package Modified Paths: -------------- trunk/qterm-qt4/CMakeLists.txt Added Paths: ----------- trunk/qterm-qt4/package.cmake Modified: trunk/qterm-qt4/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/CMakeLists.txt 2010-09-20 09:47:23 UTC (rev 1252) +++ trunk/qterm-qt4/CMakeLists.txt 2010-09-27 10:32:07 UTC (rev 1253) @@ -18,6 +18,7 @@ add_subdirectory(icons) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) +include("package.cmake") configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" Added: trunk/qterm-qt4/package.cmake =================================================================== --- trunk/qterm-qt4/package.cmake (rev 0) +++ trunk/qterm-qt4/package.cmake 2010-09-27 10:32:07 UTC (rev 1253) @@ -0,0 +1,26 @@ +INCLUDE(InstallRequiredSystemLibraries) + +SET(CPACK_PACKAGE_NAME "QTerm") +SET(CPACK_PACKAGE_VENDOR "The QTerm Project") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "QTerm - The BBS Client") +SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") +SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYRIGHT") +SET(CPACK_PACKAGE_VERSION_MAJOR ${QTERM_VERSION_MAJOR}) +SET(CPACK_PACKAGE_VERSION_MINOR ${QTERM_VERSION_MINOR}) +SET(CPACK_PACKAGE_VERSION_PATCH ${QTERM_VERSION_RELEASE}) +IF(WIN32 AND NOT UNIX) + # There is a bug in NSI that does not handle full unix paths properly. Make + # sure there is at least one set of four (4) backlasshes. + SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\qterm.exe") + SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.qterm.org") + SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.qterm.org") + SET(CPACK_NSIS_MODIFY_PATH ON) +ELSE(WIN32 AND NOT UNIX) + SET(CPACK_STRIP_FILES "bin/qterm") + SET(CPACK_SOURCE_STRIP_FILES "") +ENDIF(WIN32 AND NOT UNIX) + +# Functions to install qt, ssl libraries +FUNCTION(install_libs, lib +INCLUDE(CPack) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-09-20 09:47:29
|
Revision: 1252 http://qterm.svn.sourceforge.net/qterm/?rev=1252&view=rev Author: sidos Date: 2010-09-20 09:47:23 +0000 (Mon, 20 Sep 2010) Log Message: ----------- fix for mac os x Modified Paths: -------------- trunk/qterm-qt4/src/qtermframe.cpp Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2010-08-26 09:21:29 UTC (rev 1251) +++ trunk/qterm-qt4/src/qtermframe.cpp 2010-09-20 09:47:23 UTC (rev 1252) @@ -392,7 +392,7 @@ #ifdef Q_OS_MACX // used to dock the programe if (isHidden()) - windowsMenu->addAction(tr("&Main Window"), this, SLOT(trayShow())); + menuWindow->addAction(tr("&Main Window"), this, SLOT(trayShow())); #endif QList<QMdiSubWindow *> windows = mdiArea->subWindowList(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-26 09:21:35
|
Revision: 1251 http://qterm.svn.sourceforge.net/qterm/?rev=1251&view=rev Author: sidos Date: 2010-08-26 09:21:29 +0000 (Thu, 26 Aug 2010) Log Message: ----------- smaller size Modified Paths: -------------- trunk/qterm-qt4/src/ui/pallete.ui Modified: trunk/qterm-qt4/src/ui/pallete.ui =================================================================== --- trunk/qterm-qt4/src/ui/pallete.ui 2010-08-26 08:00:21 UTC (rev 1250) +++ trunk/qterm-qt4/src/ui/pallete.ui 2010-08-26 09:21:29 UTC (rev 1251) @@ -6,23 +6,23 @@ <rect> <x>0</x> <y>0</y> - <width>330</width> - <height>62</height> + <width>220</width> + <height>40</height> </rect> </property> <property name="minimumSize"> <size> - <width>330</width> - <height>62</height> + <width>220</width> + <height>40</height> </size> </property> <widget class="QFrame" name="clr0Frame"> <property name="geometry"> <rect> - <x>90</x> + <x>60</x> <y>0</y> - <width>31</width> - <height>31</height> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -32,10 +32,10 @@ <widget class="QFrame" name="clr1Frame"> <property name="geometry"> <rect> - <x>120</x> + <x>80</x> <y>0</y> - <width>31</width> - <height>31</height> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -45,10 +45,10 @@ <widget class="QFrame" name="clr2Frame"> <property name="geometry"> <rect> - <x>150</x> + <x>100</x> <y>0</y> - <width>31</width> - <height>31</height> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -58,10 +58,10 @@ <widget class="QFrame" name="clr3Frame"> <property name="geometry"> <rect> - <x>180</x> + <x>120</x> <y>0</y> - <width>31</width> - <height>31</height> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -71,10 +71,10 @@ <widget class="QFrame" name="clr6Frame"> <property name="geometry"> <rect> - <x>270</x> + <x>180</x> <y>0</y> - <width>31</width> - <height>31</height> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -84,10 +84,10 @@ <widget class="QFrame" name="clr4Frame"> <property name="geometry"> <rect> - <x>210</x> + <x>140</x> <y>0</y> - <width>31</width> - <height>31</height> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -97,10 +97,10 @@ <widget class="QFrame" name="clr5Frame"> <property name="geometry"> <rect> - <x>240</x> + <x>160</x> <y>0</y> - <width>31</width> - <height>31</height> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -110,10 +110,10 @@ <widget class="QFrame" name="clr7Frame"> <property name="geometry"> <rect> - <x>300</x> + <x>200</x> <y>0</y> - <width>31</width> - <height>31</height> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -123,10 +123,10 @@ <widget class="QFrame" name="clr13Frame"> <property name="geometry"> <rect> - <x>240</x> - <y>30</y> - <width>31</width> - <height>31</height> + <x>160</x> + <y>20</y> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -136,10 +136,10 @@ <widget class="QFrame" name="clr15Frame"> <property name="geometry"> <rect> - <x>300</x> - <y>30</y> - <width>31</width> - <height>31</height> + <x>200</x> + <y>20</y> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -149,10 +149,10 @@ <widget class="QFrame" name="clr14Frame"> <property name="geometry"> <rect> - <x>270</x> - <y>30</y> - <width>31</width> - <height>31</height> + <x>180</x> + <y>20</y> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -162,10 +162,10 @@ <widget class="QFrame" name="clr10Frame"> <property name="geometry"> <rect> - <x>150</x> - <y>30</y> - <width>31</width> - <height>31</height> + <x>100</x> + <y>20</y> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -175,10 +175,10 @@ <widget class="QFrame" name="clr8Frame"> <property name="geometry"> <rect> - <x>90</x> - <y>30</y> - <width>31</width> - <height>31</height> + <x>60</x> + <y>20</y> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -188,10 +188,10 @@ <widget class="QFrame" name="clr12Frame"> <property name="geometry"> <rect> - <x>210</x> - <y>30</y> - <width>31</width> - <height>31</height> + <x>140</x> + <y>20</y> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -201,10 +201,10 @@ <widget class="QFrame" name="clr9Frame"> <property name="geometry"> <rect> - <x>120</x> - <y>30</y> - <width>31</width> - <height>31</height> + <x>80</x> + <y>20</y> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -214,10 +214,10 @@ <widget class="QFrame" name="clr11Frame"> <property name="geometry"> <rect> - <x>180</x> - <y>30</y> - <width>31</width> - <height>31</height> + <x>120</x> + <y>20</y> + <width>20</width> + <height>20</height> </rect> </property> <property name="styleSheet"> @@ -227,10 +227,10 @@ <widget class="QLabel" name="fgLabel"> <property name="geometry"> <rect> - <x>10</x> + <x>0</x> <y>10</y> - <width>51</width> - <height>31</height> + <width>31</width> + <height>21</height> </rect> </property> <property name="styleSheet"> @@ -243,10 +243,10 @@ <widget class="QLabel" name="bgLabel"> <property name="geometry"> <rect> - <x>30</x> + <x>20</x> <y>20</y> - <width>51</width> - <height>31</height> + <width>31</width> + <height>21</height> </rect> </property> <property name="styleSheet"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-26 08:00:29
|
Revision: 1250 http://qterm.svn.sourceforge.net/qterm/?rev=1250&view=rev Author: sidos Date: 2010-08-26 08:00:21 +0000 (Thu, 26 Aug 2010) Log Message: ----------- nicer tabbed view, now with close button on tab Modified Paths: -------------- trunk/qterm-qt4/src/qtermframe.cpp trunk/qterm-qt4/src/qtermframe.h trunk/qterm-qt4/src/ui/mainframe.ui Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2010-08-26 06:58:06 UTC (rev 1249) +++ trunk/qterm-qt4/src/qtermframe.cpp 2010-08-26 08:00:21 UTC (rev 1250) @@ -91,7 +91,14 @@ setupUi(this); - mdiArea->setViewMode(QMdiArea::TabbedView); + foreach(QTabBar* tabBar, findChildren<QTabBar*>()) { + tabBar->setTabsClosable(true); + tabBar->setMovable(true); + tabBar->setExpanding(false); + connect(tabBar, SIGNAL(tabCloseRequested(int)), + this, SLOT(closeWindowByIndex(int))); + } + connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(windowActivated(QMdiSubWindow*)) ); setCentralWidget(mdiArea); @@ -454,6 +461,15 @@ /********************************************************* * Window Switch Management * *********************************************************/ +void Frame::closeWindowByIndex(int index) +{ + QList<QMdiSubWindow *> listWindow = mdiArea->subWindowList(); + if (index < listWindow.count()) { + QMdiSubWindow *window = listWindow.at(index); + window->close(); + } +} + void Frame::windowClosed(QObject*w) { QList<QMdiSubWindow *> listWindow = mdiArea->subWindowList(); Modified: trunk/qterm-qt4/src/qtermframe.h =================================================================== --- trunk/qterm-qt4/src/qtermframe.h 2010-08-26 06:58:06 UTC (rev 1249) +++ trunk/qterm-qt4/src/qtermframe.h 2010-08-26 08:00:21 UTC (rev 1250) @@ -95,6 +95,7 @@ void connectMenuAboutToShow(); void connectMenuActivated(const QString &uuid); + void closeWindowByIndex(int index); void windowActivated(QMdiSubWindow*); void windowClosed(QObject*); void actionsDispatcher(QAction*); @@ -156,4 +157,4 @@ } // namespace QTerm -#endif //QTERMFRAME_H \ No newline at end of file +#endif //QTERMFRAME_H Modified: trunk/qterm-qt4/src/ui/mainframe.ui =================================================================== --- trunk/qterm-qt4/src/ui/mainframe.ui 2010-08-26 06:58:06 UTC (rev 1249) +++ trunk/qterm-qt4/src/ui/mainframe.ui 2010-08-26 08:00:21 UTC (rev 1250) @@ -1,804 +1,811 @@ -<?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> - <widget class="QMenu" name="menuToolbar"> - <property name="title"> - <string>Toolbar</string> - </property> - </widget> - <widget class="QMenu" name="menuScrollbar"> - <property name="title"> - <string>Scrollbar</string> - </property> - <addaction name="actionScroll_Hide"/> - <addaction name="actionScroll_Left"/> - <addaction name="actionScroll_Right"/> - </widget> - <addaction name="actionFont"/> - <addaction name="menuLanguage"/> - <addaction name="menuTheme"/> - <addaction name="separator"/> - <addaction name="actionStatusbar"/> - <addaction name="menuToolbar"/> - <addaction name="menuScrollbar"/> - <addaction name="actionFullscreen"/> - <addaction name="actionRefresh"/> - <addaction name="actionBoss_Color"/> - </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="actionAuto_Reply"/> - <addaction name="actionAnti_idle"/> - <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="actionCurrent_Session_Setting"/> - <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="menuView"/> - <addaction name="menuBBS"/> - <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="actionConnect"/> - <addaction name="actionQuick_Login"/> - <addaction name="actionDisconnect"/> - </widget> - <widget class="QToolBar" name="mainToolBar"> - <property name="windowTitle"> - <string>Main</string> - </property> - <attribute name="toolBarArea"> - <enum>TopToolBarArea</enum> - </attribute> - <attribute name="toolBarBreak"> - <bool>false</bool> - </attribute> - </widget> - <widget class="QToolBar" name="keyToolBar"> - <property name="windowTitle"> - <string>Key Setup</string> - </property> - <attribute name="toolBarArea"> - <enum>TopToolBarArea</enum> - </attribute> - <attribute name="toolBarBreak"> - <bool>false</bool> - </attribute> - <addaction name="actionKey_Setup"/> - </widget> - <widget class="QToolBar" name="ansiToolBar"> - <property name="windowTitle"> - <string>ANSI Edit</string> - </property> - <attribute name="toolBarArea"> - <enum>TopToolBarArea</enum> - </attribute> - <attribute name="toolBarBreak"> - <bool>false</bool> - </attribute> - <addaction name="actionUnderline"/> - <addaction name="actionBlink"/> - </widget> - <widget class="QDockWidget" name="dockWidget"> - <property name="windowTitle"> - <string>ANSI Edit</string> - </property> - <attribute name="dockWidgetArea"> - <number>1</number> - </attribute> - <widget class="QWidget" name="dockWidgetContents"> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QScrollArea" name="scrollArea"> - <property name="widgetResizable"> - <bool>true</bool> - </property> - <widget class="QTerm::CharTable" name="scrollAreaWidgetContents"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>254</width> - <height>280</height> - </rect> - </property> - </widget> - </widget> - </item> - </layout> - </widget> - </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="checkable"> - <bool>true</bool> - </property> - <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="checkable"> - <bool>true</bool> - </property> - <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="checkable"> - <bool>true</bool> - </property> - <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="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>&Auto Reply</string> - </property> - </action> - <action name="actionSupport_Mouse"> - <property name="checkable"> - <bool>true</bool> - </property> - <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="checkable"> - <bool>true</bool> - </property> - <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="checkable"> - <bool>true</bool> - </property> - <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="actionFont"> - <property name="icon"> - <iconset resource="../qterm.qrc"> - <normaloff>:/pic/fonts.png</normaloff>:/pic/fonts.png</iconset> - </property> - <property name="text"> - <string>UI 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="checkable"> - <bool>true</bool> - </property> - <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="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Simplified Chinese</string> - </property> - </action> - <action name="actionTraditional_Chinese"> - <property name="checkable"> - <bool>true</bool> - </property> - <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> - <action name="actionConnect"> - <property name="icon"> - <iconset resource="../qterm.qrc"> - <normaloff>:/pic/connect.png</normaloff>:/pic/connect.png</iconset> - </property> - <property name="text"> - <string>Connect</string> - </property> - <property name="toolTip"> - <string>Connect</string> - </property> - </action> - <action name="actionScroll_Hide"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Hide</string> - </property> - <property name="toolTip"> - <string>Hide Scrollbar</string> - </property> - </action> - <action name="actionScroll_Left"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Left</string> - </property> - </action> - <action name="actionScroll_Right"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Right</string> - </property> - </action> - <action name="actionCurrent_Session_Setting"> - <property name="text"> - <string>Current Session Setting</string> - </property> - </action> - <action name="actionMenubar"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>MenuBar</string> - </property> - </action> - <action name="actionBoss_Color"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Boss Color</string> - </property> - </action> - <action name="actionUnderline"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Underline</string> - </property> - <property name="toolTip"> - <string>Underline</string> - </property> - </action> - <action name="actionBlink"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="text"> - <string>Blink</string> - </property> - <property name="toolTip"> - <string>Blink</string> - </property> - </action> - </widget> - <customwidgets> - <customwidget> - <class>QTerm::CharTable</class> - <extends>QWidget</extends> - <header>chartable.h</header> - <container>1</container> - </customwidget> - </customwidgets> - <resources> - <include location="../qterm.qrc"/> - </resources> - <connections/> -</ui> +<?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"> + <property name="viewMode"> + <enum>QMdiArea::TabbedView</enum> + </property> + <property name="documentMode"> + <bool>true</bool> + </property> + </widget> + <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> + <widget class="QMenu" name="menuToolbar"> + <property name="title"> + <string>Toolbar</string> + </property> + </widget> + <widget class="QMenu" name="menuScrollbar"> + <property name="title"> + <string>Scrollbar</string> + </property> + <addaction name="actionScroll_Hide"/> + <addaction name="actionScroll_Left"/> + <addaction name="actionScroll_Right"/> + </widget> + <addaction name="actionFont"/> + <addaction name="menuLanguage"/> + <addaction name="menuTheme"/> + <addaction name="separator"/> + <addaction name="actionStatusbar"/> + <addaction name="menuToolbar"/> + <addaction name="menuScrollbar"/> + <addaction name="actionFullscreen"/> + <addaction name="actionRefresh"/> + <addaction name="actionBoss_Color"/> + </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="actionAuto_Reply"/> + <addaction name="actionAnti_idle"/> + <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="actionCurrent_Session_Setting"/> + <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="menuView"/> + <addaction name="menuBBS"/> + <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="actionConnect"/> + <addaction name="actionQuick_Login"/> + <addaction name="actionDisconnect"/> + </widget> + <widget class="QToolBar" name="mainToolBar"> + <property name="windowTitle"> + <string>Main</string> + </property> + <attribute name="toolBarArea"> + <enum>TopToolBarArea</enum> + </attribute> + <attribute name="toolBarBreak"> + <bool>false</bool> + </attribute> + </widget> + <widget class="QToolBar" name="keyToolBar"> + <property name="windowTitle"> + <string>Key Setup</string> + </property> + <attribute name="toolBarArea"> + <enum>TopToolBarArea</enum> + </attribute> + <attribute name="toolBarBreak"> + <bool>false</bool> + </attribute> + <addaction name="actionKey_Setup"/> + </widget> + <widget class="QToolBar" name="ansiToolBar"> + <property name="windowTitle"> + <string>ANSI Edit</string> + </property> + <attribute name="toolBarArea"> + <enum>TopToolBarArea</enum> + </attribute> + <attribute name="toolBarBreak"> + <bool>false</bool> + </attribute> + <addaction name="actionUnderline"/> + <addaction name="actionBlink"/> + </widget> + <widget class="QDockWidget" name="dockWidget"> + <property name="windowTitle"> + <string>ANSI Edit</string> + </property> + <attribute name="dockWidgetArea"> + <number>1</number> + </attribute> + <widget class="QWidget" name="dockWidgetContents"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QScrollArea" name="scrollArea"> + <property name="widgetResizable"> + <bool>true</bool> + </property> + <widget class="QTerm::CharTable" name="scrollAreaWidgetContents"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>60</width> + <height>280</height> + </rect> + </property> + </widget> + </widget> + </item> + </layout> + </widget> + </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="checkable"> + <bool>true</bool> + </property> + <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="checkable"> + <bool>true</bool> + </property> + <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="checkable"> + <bool>true</bool> + </property> + <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="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>&Auto Reply</string> + </property> + </action> + <action name="actionSupport_Mouse"> + <property name="checkable"> + <bool>true</bool> + </property> + <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="checkable"> + <bool>true</bool> + </property> + <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="checkable"> + <bool>true</bool> + </property> + <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="actionFont"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/fonts.png</normaloff>:/pic/fonts.png</iconset> + </property> + <property name="text"> + <string>UI 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="checkable"> + <bool>true</bool> + </property> + <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="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Simplified Chinese</string> + </property> + </action> + <action name="actionTraditional_Chinese"> + <property name="checkable"> + <bool>true</bool> + </property> + <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> + <action name="actionConnect"> + <property name="icon"> + <iconset resource="../qterm.qrc"> + <normaloff>:/pic/connect.png</normaloff>:/pic/connect.png</iconset> + </property> + <property name="text"> + <string>Connect</string> + </property> + <property name="toolTip"> + <string>Connect</string> + </property> + </action> + <action name="actionScroll_Hide"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Hide</string> + </property> + <property name="toolTip"> + <string>Hide Scrollbar</string> + </property> + </action> + <action name="actionScroll_Left"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Left</string> + </property> + </action> + <action name="actionScroll_Right"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Right</string> + </property> + </action> + <action name="actionCurrent_Session_Setting"> + <property name="text"> + <string>Current Session Setting</string> + </property> + </action> + <action name="actionMenubar"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>MenuBar</string> + </property> + </action> + <action name="actionBoss_Color"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Boss Color</string> + </property> + </action> + <action name="actionUnderline"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Underline</string> + </property> + <property name="toolTip"> + <string>Underline</string> + </property> + </action> + <action name="actionBlink"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Blink</string> + </property> + <property name="toolTip"> + <string>Blink</string> + </property> + </action> + </widget> + <customwidgets> + <customwidget> + <class>QTerm::CharTable</class> + <extends>QWidget</extends> + <header>chartable.h</header> + <container>1</container> + </customwidget> + </customwidgets> + <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-08-26 06:58:13
|
Revision: 1249 http://qterm.svn.sourceforge.net/qterm/?rev=1249&view=rev Author: sidos Date: 2010-08-26 06:58:06 +0000 (Thu, 26 Aug 2010) Log Message: ----------- tab to space conversion Modified Paths: -------------- trunk/qterm-qt4/src/qtermframe.cpp Modified: trunk/qterm-qt4/src/qtermframe.cpp =================================================================== --- trunk/qterm-qt4/src/qtermframe.cpp 2010-08-19 12:41:24 UTC (rev 1248) +++ trunk/qterm-qt4/src/qtermframe.cpp 2010-08-26 06:58:06 UTC (rev 1249) @@ -89,7 +89,7 @@ s_instance = this; setAttribute(Qt::WA_DeleteOnClose); - setupUi(this); + setupUi(this); mdiArea->setViewMode(QMdiArea::TabbedView); connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), @@ -106,16 +106,16 @@ connect(DBus::instance(), SIGNAL(showQTerm()), this, SLOT(slotShowQTerm())); #endif //DBUS_ENABLED - // pallete box - Pallete * pallete = new Pallete(ansiToolBar); - actionPallete = ansiToolBar->addWidget(pallete); - actionPallete->setObjectName(QString::fromUtf8("actionPallete")); - connect(pallete, SIGNAL(colorChanged(int,int)), SLOT(palleteColorChanged(int,int))); + // pallete box + Pallete * pallete = new Pallete(ansiToolBar); + actionPallete = ansiToolBar->addWidget(pallete); + actionPallete->setObjectName(QString::fromUtf8("actionPallete")); + connect(pallete, SIGNAL(colorChanged(int,int)), SLOT(palleteColorChanged(int,int))); - // symbols table input - actionSymbols = new QAction(this); - actionSymbols->setObjectName(QString::fromUtf8("actionSymbols")); - connect(scrollArea->widget(), SIGNAL(characterSelected(QString)), SLOT(characterSelected(QString))); + // symbols table input + actionSymbols = new QAction(this); + actionSymbols->setObjectName(QString::fromUtf8("actionSymbols")); + connect(scrollArea->widget(), SIGNAL(characterSelected(QString)), SLOT(characterSelected(QString))); //create a progress bar to notify the download process m_pStatusBar = new QTerm::StatusBar(statusBar(), "mainStatusBar"); @@ -135,15 +135,15 @@ loadShortcuts(); initThemeMenu(); - initToolbarMenu(); + initToolbarMenu(); connect(menuWindow, SIGNAL(aboutToShow()), this, SLOT(windowsMenuAboutToShow())); - connect(actionQuit, SIGNAL(triggered()), - this, SLOT(confirmExitQTerm())); + connect(actionQuit, SIGNAL(triggered()), + this, SLOT(confirmExitQTerm())); - connectMenu = new QMenu(this); + connectMenu = new QMenu(this); QToolButton * connectButton = qobject_cast<QToolButton *> (terminalToolBar->widgetForAction(actionConnect)); connectButton->setObjectName("buttonConnect"); @@ -151,7 +151,7 @@ connectButton->setMenu(connectMenu); connectButton->setPopupMode(QToolButton::InstantPopup); - groupActions(); + groupActions(); installEventFilter(this); } @@ -163,9 +163,9 @@ QMenu * Frame::createPopupMenu() { - QMenu * menuContext = QMainWindow::createPopupMenu(); - menuContext->addAction(actionMenubar); - return menuContext; + QMenu * menuContext = QMainWindow::createPopupMenu(); + menuContext->addAction(actionMenubar); + return menuContext; } /********************************************************* @@ -223,11 +223,11 @@ } - actionStatusbar->setChecked(Global::instance()->showStatusBar()); - statusBar()->setVisible(Global::instance()->showStatusBar()); - - actionMenubar->setChecked(Global::instance()->showMenuBar()); - menuBar()->setVisible(Global::instance()->showMenuBar()); + 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); } @@ -247,15 +247,15 @@ // pallete box delegate void Frame::palleteColorChanged(int index, int role) { - actionPallete->setData((index << 4) + role); - actionPallete->trigger(); + actionPallete->setData((index << 4) + role); + actionPallete->trigger(); } // symbol table delegate void Frame::characterSelected(QString str) { - actionSymbols->setData(str); - actionSymbols->trigger(); + actionSymbols->setData(str); + actionSymbols->trigger(); } //addressbook @@ -273,7 +273,7 @@ { quickDialog quick(this); - Global::instance()->loadAddress(Global::instance()->addrXml(), QUuid().toString(), quick.param); + Global::instance()->loadAddress(Global::instance()->addrXml(), QUuid().toString(), quick.param); if (quick.exec() == 1) { newWindow(quick.param); @@ -332,13 +332,13 @@ void Frame::newWindow(const Param& param, const QString& uuid) { Window * window = new Window(this, param, uuid, mdiArea, 0); - window->setWindowTitle(param.m_mapParam["name"].toString()); + window->setWindowTitle(param.m_mapParam["name"].toString()); window->setWindowIcon(QIcon(":/pic/tabpad.png")); window->setAttribute(Qt::WA_DeleteOnClose); window->showMaximized(); - mdiArea->addSubWindow(window); - mdiArea->setActiveSubWindow(window); - connect(window, SIGNAL(destroyed(QObject*)), + mdiArea->addSubWindow(window); + mdiArea->setActiveSubWindow(window); + connect(window, SIGNAL(destroyed(QObject*)), this, SLOT(windowClosed(QObject*))); } @@ -352,7 +352,7 @@ //slot Help->About Qt void Frame::on_actionAbout_Qt_triggered() { - qApp->aboutQt(); + qApp->aboutQt(); } //slot Help->Homepage @@ -365,7 +365,7 @@ //slot Help->Contents void Frame::on_actionContents_triggered() { - QString errorMessage; + QString errorMessage; if (!m_assistant.showPage("qthelp://org.qterm/doc/index.html", &errorMessage)) QMessageBox::warning(this, tr("Assistant"), errorMessage); } @@ -426,19 +426,19 @@ connectMenu->addAction(actionQuick_Login); connectMenu->addSeparator(); - QMap<QString,QString> listSite = Global::instance()->loadFavoriteList( - Global::instance()->addrXml()); + QMap<QString,QString> listSite = Global::instance()->loadFavoriteList( + Global::instance()->addrXml()); QMapIterator<QString,QString> i(listSite); - QSignalMapper * connectMapper = new QSignalMapper(this); + QSignalMapper * connectMapper = new QSignalMapper(this); - while (i.hasNext()) { - i.next(); - QAction * idAction = new QAction(i.value(), connectMenu); + 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.key()); - } + connectMapper->setMapping(idAction, i.key()); + } connect(connectMapper, SIGNAL(mapped(QString)), this, SLOT(connectMenuActivated(QString))); } @@ -446,8 +446,8 @@ { Param param; if (Global::instance()->loadAddress( - Global::instance()->addrXml(), - uuid, param)) + Global::instance()->addrXml(), + uuid, param)) newWindow(param, uuid); } @@ -462,27 +462,27 @@ QList<QAction*> actions = findChildren<QAction*>(QRegExp("action*")); foreach(QAction* action, actions) action->setVisible(listBasicActions.contains(action->objectName()) - || action->actionGroup()!=actionsExtra); + || action->actionGroup()!=actionsExtra); } } void Frame::windowActivated(QMdiSubWindow * w) { - WindowBase * wb=qobject_cast<WindowBase*>(w); - if(wb==0) + 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())); - } + // 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) @@ -507,14 +507,14 @@ QString nameSlot="on_"+action->objectName()+"_triggered"; if(wb->hasAction(action->objectName())) { - bool ret = false; - QVariant data = action->data(); - if (data.isNull()) - ret=QMetaObject::invokeMethod(wb, - nameSlot.toLatin1().constData()); - else - ret=QMetaObject::invokeMethod(wb, - nameSlot.toLatin1().constData(), Q_ARG(QVariant, data)); + bool ret = false; + QVariant data = action->data(); + if (data.isNull()) + ret=QMetaObject::invokeMethod(wb, + nameSlot.toLatin1().constData()); + else + ret=QMetaObject::invokeMethod(wb, + nameSlot.toLatin1().constData(), Q_ARG(QVariant, data)); if(!ret) qWarning("Failed to execute %s", nameSlot.toLatin1().constData()); @@ -567,12 +567,12 @@ void Frame::updateLang(QAction * action) { - 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); + 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() @@ -633,8 +633,8 @@ void Frame::on_actionMenubar_toggled(bool show) { - Global::instance()->setMenuBar(show); - menuBar()->setVisible(show); + Global::instance()->setMenuBar(show); + menuBar()->setVisible(show); } void Frame::on_actionFullscreen_triggered(bool isFullScreen) @@ -662,9 +662,9 @@ void Frame::initToolbarMenu() { - menuToolbar->clear(); - foreach(QToolBar *toolbar, findChildren<QToolBar *>()) - menuToolbar->addAction(toolbar->toggleViewAction()); + menuToolbar->clear(); + foreach(QToolBar *toolbar, findChildren<QToolBar *>()) + menuToolbar->addAction(toolbar->toggleViewAction()); } void Frame::initThemeMenu() @@ -675,14 +675,14 @@ for (QStringList::ConstIterator it = styles.begin(); it != styles.end(); it++) themesGroup->addAction(insertThemeItem(*it)); connect(themesGroup, SIGNAL(triggered(QAction*)), - this, SLOT(themesMenuActivated(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( + idAction->setChecked( themeitem.compare(qApp->style()->objectName(), Qt::CaseInsensitive)==0); return idAction; } @@ -713,21 +713,21 @@ void Frame::on_actionStatusbar_toggled(bool isEnabled) { Global::instance()->setStatusBar(isEnabled); - statusBar()->setVisible(isEnabled); + statusBar()->setVisible(isEnabled); emit statusBarChanged(isEnabled); } void Frame::on_actionDefault_Session_Setting_triggered() { addrDialog set(this, true); - // load default - Global::instance()->loadAddress(Global::instance()->addrXml(),QUuid().toString(), set.param); + // load default + Global::instance()->loadAddress(Global::instance()->addrXml(),QUuid().toString(), set.param); set.updateData(false); if (set.exec() == 1) { - QDomDocument doc = Global::instance()->addrXml(); + QDomDocument doc = Global::instance()->addrXml(); Global::instance()->saveAddress(doc, QUuid().toString(), set.param); - Global::instance()->saveAddressXml(doc); - } + Global::instance()->saveAddressXml(doc); + } } void Frame::on_actionPreference_triggered() @@ -794,7 +794,7 @@ int i = 0; QShortcut * shortcut = NULL; - // FIXME: map number to favorite site list + // FIXME: map number to favorite site list // shortcuts to addressbook entries //QSignalMapper * addrMapper = new QSignalMapper(this); //for (i = 0; i < 9; i++) { @@ -1146,44 +1146,44 @@ void Frame::groupActions() { - // These are actions which are enabled without any subwindow - listBasicActions - << "actionNew_Console" << "actionConnect" - << "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*))); + // These are actions which are enabled without any subwindow + listBasicActions + << "actionNew_Console" << "actionConnect" + << "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*")); @@ -1191,14 +1191,14 @@ actionsExtra = new QActionGroup(this); actionsExtra->setExclusive(false); connect(actionsExtra, SIGNAL(triggered(QAction*)), - this, SLOT(actionsDispatcher(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); - } + action->setVisible(listBasicActions.contains(action->objectName()) + || action->actionGroup() != 0); + if (action->actionGroup() == 0) + actionsExtra->addAction(action); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-19 12:41:30
|
Revision: 1248 http://qterm.svn.sourceforge.net/qterm/?rev=1248&view=rev Author: sidos Date: 2010-08-19 12:41:24 +0000 (Thu, 19 Aug 2010) Log Message: ----------- bug fix Modified Paths: -------------- trunk/qterm-qt4/src/dommodel.cpp Modified: trunk/qterm-qt4/src/dommodel.cpp =================================================================== --- trunk/qterm-qt4/src/dommodel.cpp 2010-08-19 10:04:11 UTC (rev 1247) +++ trunk/qterm-qt4/src/dommodel.cpp 2010-08-19 12:41:24 UTC (rev 1248) @@ -195,7 +195,7 @@ defaultFlags |= Qt::ItemIsDragEnabled; if (itemType == Folder) return Qt::ItemIsDropEnabled | Qt::ItemIsEditable | defaultFlags; - else if (itemType == Site) + else if (itemType == Site || itemType == Favorite) return defaultFlags; else return Qt::ItemIsDropEnabled | defaultFlags; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-19 10:04:18
|
Revision: 1247 http://qterm.svn.sourceforge.net/qterm/?rev=1247&view=rev Author: sidos Date: 2010-08-19 10:04:11 +0000 (Thu, 19 Aug 2010) Log Message: ----------- tab->space Modified Paths: -------------- trunk/qterm-qt4/src/dommodel.cpp trunk/qterm-qt4/src/dommodel.h Modified: trunk/qterm-qt4/src/dommodel.cpp =================================================================== --- trunk/qterm-qt4/src/dommodel.cpp 2010-08-18 07:26:09 UTC (rev 1246) +++ trunk/qterm-qt4/src/dommodel.cpp 2010-08-19 10:04:11 UTC (rev 1247) @@ -14,10 +14,10 @@ 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++) { + 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; @@ -26,8 +26,8 @@ DomItem::~DomItem() { - foreach(DomItem *item, childItems) - delete item; + foreach(DomItem *item, childItems) + delete item; } QString DomItem::name() @@ -58,15 +58,15 @@ QString DomItem::uuid() { - return domElement.attribute("uuid"); + return domElement.attribute("uuid"); } bool DomItem::setUuid(const QString & uuid) { if (!domElement.hasAttribute("uuid")) return false; - domElement.setAttribute("uuid", uuid); - return true; + domElement.setAttribute("uuid", uuid); + return true; } bool DomItem::isSite() @@ -96,7 +96,7 @@ void DomItem::reparent(DomItem *parent) { - parentItem = parent; + parentItem = parent; } DomItem *DomItem::child(int i) @@ -111,32 +111,32 @@ if (i<0 || i>childItems.count()) return; - QDomNode node = domElement.childNodes().item(i); - if (node.isNull()) - domElement.appendChild(item->element()); - else - domElement.insertBefore(item->element(),node); - item->reparent(this); - childItems.insert(i, item); + QDomNode node = domElement.childNodes().item(i); + if (node.isNull()) + domElement.appendChild(item->element()); + else + domElement.insertBefore(item->element(),node); + item->reparent(this); + childItems.insert(i, item); } void DomItem::removeChild(int i) { - if (i<0 || i>=childItems.count()) - return; + if (i<0 || i>=childItems.count()) + return; - QDomNode node = domElement.childNodes().item(i); - domElement.removeChild(node); + QDomNode node = domElement.childNodes().item(i); + domElement.removeChild(node); - delete childItems.takeAt(i); + delete childItems.takeAt(i); } int DomItem::row() { - if (parentItem) - return parentItem->childItems.indexOf(this); + if (parentItem) + return parentItem->childItems.indexOf(this); - return 0; + return 0; } DomModel::DomModel(QDomDocument document, QObject *parent) @@ -162,24 +162,24 @@ 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::UserRole: + if (item->isFolder()) { + return item->name(); + } else { + return item->uuid(); + } + break; case Qt::DisplayRole: return item->name(); break; case Qt::DecorationRole: - switch (type(index)) { - case Folder: + switch (type(index)) { + case Folder: return QVariant(QIcon(":/pic/folder.png")); - case Favorite: + case Favorite: return QVariant(QIcon(":/pic/folder_favorite.png")); - case Site: - return QVariant(QIcon(":/pic/tabpad.png")); + case Site: + return QVariant(QIcon(":/pic/tabpad.png")); } default: return QVariant(); @@ -190,11 +190,11 @@ Qt::ItemFlags defaultFlags = QAbstractItemModel::flags(index); DomItem *item = static_cast<DomItem*>(index.internalPointer()); - ItemType itemType = type(index); + ItemType itemType = type(index); - defaultFlags |= Qt::ItemIsDragEnabled; + defaultFlags |= Qt::ItemIsDragEnabled; if (itemType == Folder) - return Qt::ItemIsDropEnabled | Qt::ItemIsEditable | defaultFlags; + return Qt::ItemIsDropEnabled | Qt::ItemIsEditable | defaultFlags; else if (itemType == Site) return defaultFlags; else @@ -245,26 +245,26 @@ DomModel::ItemType DomModel::type(const QModelIndex &index) const { - if (!index.isValid()) - return Unknown; + if (!index.isValid()) + return Unknown; DomItem *item = static_cast<DomItem*>(index.internalPointer()); - 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; + 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 @@ -286,7 +286,7 @@ bool DomModel::removeRows(int row, int count, const QModelIndex &parent) { - DomItem *parentItem; + DomItem *parentItem; if (!parent.isValid()) parentItem = rootItem; @@ -295,13 +295,13 @@ 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(); + + beginRemoveRows(parent, row, row+count-1); + for (int n=0; n<count; n++) + parentItem->removeChild(row); + endRemoveRows(); - return true; + return true; } bool DomModel::insertRow(int row, const QModelIndex &parent, DomItem *item) @@ -335,12 +335,12 @@ 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; + case Qt::UserRole: + if (item->isFolder()) + item->setName(value.toString()); + else if (item->isSiteReference()) + item->setUuid(value.toString()); + break; default: return false; } @@ -367,7 +367,7 @@ else // last of the root item beginRow = rowCount(QModelIndex()); - DomItem *parentItem; + DomItem *parentItem; if (!parent.isValid()) parentItem = rootItem; else @@ -382,16 +382,18 @@ stream >> p; newItems << static_cast<DomItem*>((void *)p); } - int count = newItems.count(); + 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); - insertRow(beginRow, parent, newItem); - } + if (parentItem == rootItem) + return false; + for (int i=0; i<count; i++) { + DomItem *item = newItems.at(i); + QDomElement node = item->element().cloneNode().toElement(); + DomItem *newItem = new DomItem(node); + insertRow(beginRow, parent, newItem); + } break; default: return false; @@ -426,101 +428,101 @@ 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); - insertRow(row, parentIndex, item); + // 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); + insertRow(row, parentIndex, item); } void DomModel::toggleFavorite(const QModelIndex &index) { - QString uuid = data(index, Qt::UserRole).toString(); - if (QUuid(uuid).isNull()) - return; - // 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); - } + QString uuid = data(index, Qt::UserRole).toString(); + if (QUuid(uuid).isNull()) + return; + // 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) { - QString newUuid = QUuid::createUuid().toString(); - // Clone current site or default site - QString uuid; + QString newUuid = QUuid::createUuid().toString(); + // Clone current site or default site + QString uuid; if (type(index) == Site || type(index) == Favorite) - uuid = data(index, Qt::UserRole).toString(); - else - uuid = QUuid().toString(); - QDomNodeList siteList = domDocument.elementsByTagName("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(); + QDomElement site = siteList.item(i).toElement(); if (site.attribute("uuid") == uuid) { - QDomElement newSite = site.cloneNode().toElement(); - newSite.setAttribute("uuid", newUuid); - QDomElement root = domDocument.documentElement(); - 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); - insertRow(row, parentIndex, item); + QDomElement newSite = site.cloneNode().toElement(); + newSite.setAttribute("uuid", newUuid); + QDomElement root = domDocument.documentElement(); + 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); + insertRow(row, parentIndex, item); } void DomModel::removeItem(const QModelIndex &index) { - if (type(index) == Folder) { - // recursively remove all children - for (int n=0; n<rowCount(index); n++) - removeItem(index.child(n,0)); - // remove folder itself, should be empty now - removeRows(index.row(), 1, index.parent()); - } - else { - QString uuid = data(index, Qt::UserRole).toString(); - QDomNodeList nodeList; - // remove the actual site + if (type(index) == Folder) { + // recursively remove all children + for (int n=0; n<rowCount(index); n++) + removeItem(index.child(n,0)); + // remove folder itself, should be empty now + removeRows(index.row(), 1, index.parent()); + } + else { + QString uuid = data(index, Qt::UserRole).toString(); + QDomNodeList nodeList; + // remove the actual site nodeList = domDocument.documentElement().elementsByTagName("site"); - for (int i=0; i<nodeList.count(); i++) { - QDomElement node = nodeList.at(i).toElement(); - if (uuid == node.attribute("uuid")) { + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + if (uuid == node.attribute("uuid")) { domDocument.documentElement().removeChild(node); - } - } - // and its reference in folder - removeRows(index.row(), 1, index.parent()); - } + } + } + // and its reference in folder + removeRows(index.row(), 1, index.parent()); + } } } //namespace QTerm Modified: trunk/qterm-qt4/src/dommodel.h =================================================================== --- trunk/qterm-qt4/src/dommodel.h 2010-08-18 07:26:09 UTC (rev 1246) +++ trunk/qterm-qt4/src/dommodel.h 2010-08-19 10:04:11 UTC (rev 1247) @@ -16,9 +16,9 @@ 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); + void insertChild(int i, DomItem *item); + void removeChild(int i); + void reparent(DomItem *parent); DomItem *parent(); QDomElement element() const; int row(); @@ -26,8 +26,8 @@ QString name(); bool setName(const QString& name); - QString uuid(); - bool setUuid(const QString& uuid); + QString uuid(); + bool setUuid(const QString& uuid); bool isFolder(); bool isSite(); @@ -43,7 +43,7 @@ { Q_OBJECT public: - enum ItemType {Unknown, Folder, Site, Favorite}; + enum ItemType {Unknown, Folder, Site, Favorite}; DomModel(QDomDocument document, QObject *parent = 0); ~DomModel(); @@ -58,7 +58,7 @@ int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; - bool removeRows(int row, int count, const QModelIndex &parent); + 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); @@ -69,14 +69,14 @@ QStringList mimeTypes() const; Qt::DropActions supportedDropActions() const; - ItemType type(const QModelIndex & index) const; + ItemType type(const QModelIndex & index) const; - void addSite(const QModelIndex &position); - void addFolder(const QModelIndex &position); - void toggleFavorite(const QModelIndex &position); - void removeItem(const QModelIndex &index); + void addSite(const QModelIndex &position); + void addFolder(const QModelIndex &position); + void toggleFavorite(const QModelIndex &position); + void removeItem(const QModelIndex &index); - QDomDocument document() { return domDocument; } + QDomDocument document() { return domDocument; } private: QDomDocument domDocument; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-18 07:26:15
|
Revision: 1246 http://qterm.svn.sourceforge.net/qterm/?rev=1246&view=rev Author: sidos Date: 2010-08-18 07:26:09 +0000 (Wed, 18 Aug 2010) Log Message: ----------- update global test with xml addressbook Modified Paths: -------------- trunk/qterm-qt4/src/test/global/testglobal.cpp Modified: trunk/qterm-qt4/src/test/global/testglobal.cpp =================================================================== --- trunk/qterm-qt4/src/test/global/testglobal.cpp 2010-08-13 14:00:58 UTC (rev 1245) +++ trunk/qterm-qt4/src/test/global/testglobal.cpp 2010-08-18 07:26:09 UTC (rev 1246) @@ -6,7 +6,8 @@ void TestGlobal::testGlobal() { - qDebug() << Global::instance()->loadNameList(); + QDomDocument doc = Global::instance()->addrXml(); + qDebug() << Global::instance()->loadFavoriteList(doc); } QTEST_MAIN(TestGlobal) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-13 14:01:04
|
Revision: 1245 http://qterm.svn.sourceforge.net/qterm/?rev=1245&view=rev Author: sidos Date: 2010-08-13 14:00:58 +0000 (Fri, 13 Aug 2010) Log Message: ----------- remove deprecated cfg address book interface Modified Paths: -------------- trunk/qterm-qt4/src/qtermglobal.cpp trunk/qterm-qt4/src/qtermglobal.h Modified: trunk/qterm-qt4/src/qtermglobal.cpp =================================================================== --- trunk/qterm-qt4/src/qtermglobal.cpp 2010-08-13 13:42:56 UTC (rev 1244) +++ trunk/qterm-qt4/src/qtermglobal.cpp 2010-08-13 14:00:58 UTC (rev 1245) @@ -83,7 +83,6 @@ m_translatorQTerm = new QTranslator(0); m_config = new Config(m_fileCfg); - m_address = new Config(m_addrCfg); m_converter = new Convert(); if (!iniSettings()) { m_status = INIT_ERROR; @@ -104,11 +103,6 @@ return m_config; } -Config * Global::addrCfg() -{ - return m_address; -} - QDomDocument Global::addrXml() { QDomDocument doc; @@ -155,22 +149,7 @@ return listSite; } -QStringList Global::loadNameList() -{ - QStringList listName; - QString strTmp = m_address->getItemValue("bbs list", "num").toString(); - - QString strSection; - - for (int i = 0; i < strTmp.toInt(); i++) { - strSection.sprintf("bbs %d", i); - listName.append(m_address->getItemValue(strSection, "name").toString()); - } - - return listName; -} - bool Global::loadAddress(QDomDocument doc, QString uuid, Param& param) { if (uuid.isEmpty()) @@ -185,10 +164,10 @@ return true; } -bool Global::loadAddress(int n, Param& param) +bool Global::loadAddress(Config& addrCfg, int n, Param& param) { QString strTmp, strSection; - strTmp = m_address->getItemValue("bbs list", "num").toString(); + strTmp = addrCfg.getItemValue("bbs list", "num").toString(); if ((n < 0 && strTmp.toInt() <= 0) || n < -1) strSection = "default"; else { @@ -197,7 +176,7 @@ } // check if larger than existence - strTmp = m_address->getItemValue("bbs list", "num").toString(); + strTmp = addrCfg.getItemValue("bbs list", "num").toString(); if (n >= strTmp.toInt()) return false; @@ -210,36 +189,12 @@ param.m_mapParam["user"].toString()); } else #endif // KWALLET_ENABLED - param.m_mapParam[key] = m_address->getItemValue(strSection,key); + param.m_mapParam[key] = addrCfg.getItemValue(strSection,key); } return true; } -void Global::saveAddress(int n, const Param& param) -{ - QString strTmp, strSection; - if (n < 0) - strSection = "default"; - else - strSection.sprintf("bbs %d", n); - - foreach(QString key,param.m_mapParam.keys()) { - #ifdef KWALLET_ENABLED - if (key == "password" && m_wallet != NULL) { - m_wallet->open(); - m_wallet->writePassword( - param.m_mapParam["name"].toString(), - param.m_mapParam["user"].toString(), - param.m_mapParam["password"].toString()); - } else - #endif - m_address->setItemValue(strSection, key, param.m_mapParam[key]); - } - m_address->save(); - -} - void Global::saveAddress(QDomDocument doc, QString uuid, const Param& param) { bool result = false; @@ -270,26 +225,6 @@ } -void Global::removeAddress(int n) -{ - if (n < 0) - return; - QString strSection = QString("bbs %1").arg(n); -#ifdef KWALLET_ENABLED - // check if larger than existence - QString strTmp = m_address->getItemValue("bbs list", "num").toString(); - if (n >= strTmp.toInt()) - return; - QString site = m_address->getItemValue(strSection, "name").toString(); - QString username = m_address->getItemValue(strSection, "user").toString(); - if (m_wallet != NULL) { - m_wallet->open(); - m_wallet->removePassword(site, username); - } -#endif // KWALLET_ENABLED - m_address->deleteSection(strSection); -} - void Global::removeAddress(QDomDocument doc, QString uuid) { QDomNodeList nodeList; @@ -327,8 +262,8 @@ doc.appendChild(addresses); } // Combine cfg address book - m_address = new Config(m_addrCfg); - int num = m_address->getItemValue("bbs list", "num").toInt(); + Config addrCfg(m_addrCfg); + int num = addrCfg.getItemValue("bbs list", "num").toInt(); QDomElement imported = doc.createElement("folder"); @@ -337,7 +272,7 @@ for (int i = -1; i < num; i++) { Param param; - loadAddress(i, param); + loadAddress(addrCfg, i, param); QDomElement site = doc.createElement("site"); if (i==-1) site.setAttribute("uuid", QUuid().toString()); @@ -355,7 +290,6 @@ addresses.appendChild(site); } saveAddressXml(doc); - delete m_address; return true; } Modified: trunk/qterm-qt4/src/qtermglobal.h =================================================================== --- trunk/qterm-qt4/src/qtermglobal.h 2010-08-13 13:42:56 UTC (rev 1244) +++ trunk/qterm-qt4/src/qtermglobal.h 2010-08-13 14:00:58 UTC (rev 1245) @@ -78,22 +78,21 @@ }; static Global * instance(); Config * fileCfg(); - Config * addrCfg(); QDomDocument addrXml(); const QString & pathLib(); const QString & pathPic(); const QString & pathCfg(); void clearDir(const QString & path); + // XML address book 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(); + // deprecated cfg address book, here only for conversion reason + bool loadAddress(Config &addrCfg, int n, Param & param); + QString getOpenFileName(const QString & filter, QWidget * widget); QString getSaveFileName(const QString & filename, QWidget * widget); bool isOK(); @@ -148,7 +147,6 @@ QString m_pathPic; QString m_pathCfg; Config * m_config; - Config * m_address; QByteArray * m_windowState; Status m_status; QString m_style; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-13 13:43:02
|
Revision: 1244 http://qterm.svn.sourceforge.net/qterm/?rev=1244&view=rev Author: sidos Date: 2010-08-13 13:42:56 +0000 (Fri, 13 Aug 2010) Log Message: ----------- fix a bug that system address.xml is never merged Modified Paths: -------------- trunk/qterm-qt4/src/qtermglobal.cpp Modified: trunk/qterm-qt4/src/qtermglobal.cpp =================================================================== --- trunk/qterm-qt4/src/qtermglobal.cpp 2010-08-13 13:25:43 UTC (rev 1243) +++ trunk/qterm-qt4/src/qtermglobal.cpp 2010-08-13 13:42:56 UTC (rev 1244) @@ -306,26 +306,26 @@ bool Global::convertAddressBook2XML() { QDir dir; - if (dir.exists(m_addrXml)) + if (dir.exists(m_addrXml))// do nothing if address.xml existed return true; else { - if (!dir.exists(m_addrCfg)) + if (!dir.exists(m_addrCfg)) // simply copy from system if even address.cfg not existed return createLocalFile(m_addrXml, m_pathLib + "address.xml"); } - // try import xml address book + // import system address.xml or create new one QDomDocument doc; QDomElement addresses; - QFile file(m_addrXml); - if (file.open(QIODevice::ReadOnly) && doc.setContent(&file)) { - addresses = doc.documentElement(); - } else { - QDomProcessingInstruction instr = + QFile file(m_pathLib + "address.xml"); + if (file.open(QIODevice::ReadOnly) && doc.setContent(&file)) { + addresses = doc.documentElement(); + } else { + QDomProcessingInstruction instr = doc.createProcessingInstruction("xml","version=\"1.0\" encoding=\"UTF-8\""); - doc.appendChild(instr); + doc.appendChild(instr); - addresses = doc.createElement("addresses"); - doc.appendChild(addresses); - } + addresses = doc.createElement("addresses"); + doc.appendChild(addresses); + } // Combine cfg address book m_address = new Config(m_addrCfg); int num = m_address->getItemValue("bbs list", "num").toInt(); @@ -354,13 +354,6 @@ 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(); saveAddressXml(doc); delete m_address; return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-13 13:25:50
|
Revision: 1243 http://qterm.svn.sourceforge.net/qterm/?rev=1243&view=rev Author: sidos Date: 2010-08-13 13:25:43 +0000 (Fri, 13 Aug 2010) Log Message: ----------- tab->space Modified Paths: -------------- trunk/qterm-qt4/src/qtermglobal.cpp trunk/qterm-qt4/src/qtermglobal.h Modified: trunk/qterm-qt4/src/qtermglobal.cpp =================================================================== --- trunk/qterm-qt4/src/qtermglobal.cpp 2010-08-13 12:47:11 UTC (rev 1242) +++ trunk/qterm-qt4/src/qtermglobal.cpp 2010-08-13 13:25:43 UTC (rev 1243) @@ -63,9 +63,9 @@ Global::Global() : 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) + m_pathLib("./"), m_pathCfg("./"), + m_windowState(), m_status(INIT_OK), m_style(), + m_fullScreen(false), m_language(Global::English) { #ifdef KWALLET_ENABLED if (Wallet::isWalletAvailable()) { @@ -79,10 +79,10 @@ m_status = INIT_ERROR; return; } - m_translatorQT = new QTranslator(0); - m_translatorQTerm = new QTranslator(0); + m_translatorQT = new QTranslator(0); + m_translatorQTerm = new QTranslator(0); - m_config = new Config(m_fileCfg); + m_config = new Config(m_fileCfg); m_address = new Config(m_addrCfg); m_converter = new Convert(); if (!iniSettings()) { @@ -111,13 +111,13 @@ QDomDocument Global::addrXml() { - QDomDocument doc; - QFile file(m_addrXml); - if (file.open(QIODevice::ReadOnly)) { - doc.setContent(&file); - file.close(); - } - return doc; + QDomDocument doc; + QFile file(m_addrXml); + if (file.open(QIODevice::ReadOnly)) { + doc.setContent(&file); + file.close(); + } + return doc; } const QString & Global::pathLib() @@ -144,16 +144,16 @@ QMap<QString,QString> Global::loadFavoriteList(QDomDocument doc) { - QMap<QString,QString> listSite; - // import xml address book - QDomNodeList nodeList = doc.elementsByTagName("site"); - for (int i=0; i<nodeList.count(); i++) { - QDomElement node = nodeList.at(i).toElement(); - if (node.attribute("favor") == "1") - listSite[node.attribute("uuid")] = node.attribute("name"); - } + QMap<QString,QString> listSite; + // import xml address book + QDomNodeList nodeList = doc.elementsByTagName("site"); + for (int i=0; i<nodeList.count(); i++) { + QDomElement node = nodeList.at(i).toElement(); + if (node.attribute("favor") == "1") + listSite[node.attribute("uuid")] = node.attribute("name"); + } - return listSite; + return listSite; } QStringList Global::loadNameList() { @@ -173,16 +173,16 @@ 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(); - if (uuid == node.attribute("uuid")) - foreach (QString key, param.m_mapParam.keys()) - param.m_mapParam[key] = node.attribute(key); - } - return true; + 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(); + 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) @@ -201,17 +201,17 @@ if (n >= strTmp.toInt()) return false; - 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"].toString(), - param.m_mapParam["user"].toString()); - } else - #endif // KWALLET_ENABLED - param.m_mapParam[key] = m_address->getItemValue(strSection,key); - } + 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"].toString(), + param.m_mapParam["user"].toString()); + } else + #endif // KWALLET_ENABLED + param.m_mapParam[key] = m_address->getItemValue(strSection,key); + } return true; } @@ -224,49 +224,49 @@ else strSection.sprintf("bbs %d", n); - foreach(QString key,param.m_mapParam.keys()) { - #ifdef KWALLET_ENABLED + foreach(QString key,param.m_mapParam.keys()) { + #ifdef KWALLET_ENABLED if (key == "password" && m_wallet != NULL) { m_wallet->open(); m_wallet->writePassword( - param.m_mapParam["name"].toString(), - param.m_mapParam["user"].toString(), - param.m_mapParam["password"].toString()); + param.m_mapParam["name"].toString(), + param.m_mapParam["user"].toString(), + param.m_mapParam["password"].toString()); } else - #endif - m_address->setItemValue(strSection, key, param.m_mapParam[key]); - } + #endif + m_address->setItemValue(strSection, key, param.m_mapParam[key]); + } m_address->save(); } 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.documentElement().appendChild(site); - result = true; - } + 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.documentElement().appendChild(site); + result = true; + } - if (!result) return; + if (!result) return; } @@ -292,30 +292,30 @@ 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); - } - } + 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); + } + } } 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"); - } + QDir dir; + if (dir.exists(m_addrXml)) + return true; + else { + if (!dir.exists(m_addrCfg)) + return createLocalFile(m_addrXml, m_pathLib + "address.xml"); + } // try import xml address book QDomDocument doc; QDomElement addresses; - QFile file(m_addrXml); + QFile file(m_addrXml); if (file.open(QIODevice::ReadOnly) && doc.setContent(&file)) { addresses = doc.documentElement(); } else { @@ -326,55 +326,55 @@ addresses = doc.createElement("addresses"); doc.appendChild(addresses); } - // Combine cfg address book - m_address = new Config(m_addrCfg); + // Combine cfg address book + m_address = new Config(m_addrCfg); int num = m_address->getItemValue("bbs list", "num").toInt(); - QDomElement imported = doc.createElement("folder"); - imported.setAttribute("name", tr("imported sites")); + QDomElement imported = doc.createElement("folder"); + imported.setAttribute("name", tr("imported sites")); addresses.insertBefore(imported, QDomNode()); 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); - imported.appendChild(addsite); - } - foreach(QString key,param.m_mapParam.keys()) - site.setAttribute(key, param.m_mapParam[key].toString()); + 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); + imported.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(); + 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(); saveAddressXml(doc); - delete m_address; - return true; + delete m_address; + 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(); - } + QFile ofile(m_addrXml); + if (ofile.open(QIODevice::WriteOnly)) { + QTextStream out(&ofile); + out.setCodec("UTF-8"); + out << doc.toString(); + ofile.close(); + } } void Global::loadPrefence() @@ -383,26 +383,26 @@ 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.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(); 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.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(); + m_pref.strImageViewer = m_config->getItemValue("preference", "image").toString(); + m_pref.bClearPool = m_config->getItemValue("preference", "clearpool").toBool(); 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('/'); @@ -481,10 +481,10 @@ 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; + strcat(_addrXml, "address.xml"); + m_addrXml = QString::fromLocal8Bit(_addrXml); + if (!convertAddressBook2XML()) + return false; QString pathScheme = m_pathCfg + "scheme"; if (!isPathExist(pathScheme)) @@ -555,12 +555,12 @@ m_addrCfg = m_pathCfg + "address.cfg"; //if (!createLocalFile(m_addrCfg, m_pathLib + "address.cfg")) // return false; - m_addrXml = m_pathCfg + "address.xml"; + m_addrXml = m_pathCfg + "address.xml"; //if (!createLocalFile(m_addrXml, m_pathLib + "address.xml")) // return false; - if (!convertAddressBook2XML()) - return false; + if (!convertAddressBook2XML()) + return false; return true; } #endif @@ -569,12 +569,12 @@ { //install the translator QString lang = m_config->getItemValue("global", "language").toString(); - Global::Language language = Global::English; + Global::Language language = Global::English; if (lang == "chs") language = Global::SimplifiedChinese; else if (lang == "cht") language = Global::TraditionalChinese; - setLanguage(language); + setLanguage(language); //set font QString family = m_config->getItemValue("global", "font").toString(); QString pointsize = m_config->getItemValue("global", "pointsize").toString(); @@ -712,7 +712,7 @@ void Global::setMenuBar(bool isShow) { - m_menuBar = isShow; + m_menuBar = isShow; } void Global::setBossColor(bool isBossColor) @@ -733,37 +733,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"; + // 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::TranslationsPath)+"/qt_zh_TW.qm"; - qterm_qm = m_pathCfg + "/po/qterm_cht.qm"; - if (!QFile::exists(qterm_qm)) - qterm_qm = m_pathLib + "po/qterm_cht.qm"; - break; - case Global::English: - return; - } - // load qt library translation - if (m_translatorQT->load(qt_qm)) - qApp->installTranslator(m_translatorQT); - // load qterm translation - if (m_translatorQTerm->load(qterm_qm)) - qApp->installTranslator(m_translatorQTerm); + break; + case Global::TraditionalChinese: + qt_qm = QLibraryInfo::location(QLibraryInfo::TranslationsPath)+"/qt_zh_TW.qm"; + qterm_qm = m_pathCfg + "/po/qterm_cht.qm"; + if (!QFile::exists(qterm_qm)) + qterm_qm = m_pathLib + "po/qterm_cht.qm"; + break; + case Global::English: + return; + } + // load qt library translation + if (m_translatorQT->load(qt_qm)) + qApp->installTranslator(m_translatorQT); + // load qterm translation + if (m_translatorQTerm->load(qterm_qm)) + qApp->installTranslator(m_translatorQTerm); } const QString & Global::style() const @@ -778,10 +778,10 @@ void Global::loadConfig() { - setFullScreen(m_config->getItemValue("global", "fullscreen").toBool()); + setFullScreen(m_config->getItemValue("global", "fullscreen").toBool()); setStyle(m_config->getItemValue("global", "theme").toString()); setClipConversion((Conversion)m_config->getItemValue("global", "clipcodec").toInt()); - setScrollPosition((Position)m_config->getItemValue("global", "vscrollpos").toInt()); + setScrollPosition((Position)m_config->getItemValue("global", "vscrollpos").toInt()); setMenuBar(m_config->getItemValue("global", "menubar").toBool()); setStatusBar(m_config->getItemValue("global", "statusbar").toBool()); setSwitchBar( m_config->getItemValue("global", "switchbar").toBool()); @@ -796,22 +796,22 @@ { QString lang; - //language - switch (m_language) - { - case English: lang = "eng"; break; - case SimplifiedChinese: lang = "chs"; break; - case TraditionalChinese: lang = "cht"; break; - } - m_config->setItemValue("global", "language", lang); + //language + switch (m_language) + { + case English: lang = "eng"; break; + case SimplifiedChinese: lang = "chs"; break; + case TraditionalChinese: lang = "cht"; break; + } + m_config->setItemValue("global", "language", lang); m_config->setItemValue("global", "font", qApp->font().family()); m_config->setItemValue("global", "pointsize", QFontInfo(qApp->font()).pointSize()); - m_config->setItemValue("global", "fullscreen", isFullScreen()); + m_config->setItemValue("global", "fullscreen", isFullScreen()); m_config->setItemValue("global", "theme", style()); m_config->setItemValue("global", "clipcodec", clipConversion()); m_config->setItemValue("global", "vscrollpos", scrollPosition()); - m_config->setItemValue("global", "menubar", showMenuBar()); - m_config->setItemValue("global", "statusbar", showStatusBar()); + m_config->setItemValue("global", "menubar", showMenuBar()); + m_config->setItemValue("global", "statusbar", showStatusBar()); m_config->setItemValue("global", "switchbar", showSwitchBar()); m_config->save(); Modified: trunk/qterm-qt4/src/qtermglobal.h =================================================================== --- trunk/qterm-qt4/src/qtermglobal.h 2010-08-13 12:47:11 UTC (rev 1242) +++ trunk/qterm-qt4/src/qtermglobal.h 2010-08-13 13:25:43 UTC (rev 1243) @@ -51,11 +51,11 @@ Traditional_To_Simplified }; - enum Position { - Hide = 0, - Left, - Right - }; + enum Position { + Hide = 0, + Left, + Right + }; struct Pref { Conversion XIM; @@ -79,21 +79,21 @@ static Global * instance(); Config * fileCfg(); Config * addrCfg(); - QDomDocument addrXml(); + QDomDocument addrXml(); const QString & pathLib(); const QString & pathPic(); const QString & pathCfg(); void clearDir(const QString & path); - QMap<QString,QString> loadFavoriteList(QDomDocument); + QMap<QString,QString> loadFavoriteList(QDomDocument); QStringList loadNameList(); - bool loadAddress(QDomDocument doc, QString uuid, Param & param); + 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(); + 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(); @@ -107,15 +107,15 @@ bool isFullScreen() const; bool showSwitchBar() const; bool showStatusBar() const; - bool showMenuBar() const; + bool showMenuBar() const; - const QString & style() 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 setMenuBar(bool isShow); void setBossColor(bool isBossColor); void setFullScreen(bool isFullscreen); void setSwitchBar(bool isShow); @@ -143,7 +143,7 @@ void closeNotification(uint id); QString m_fileCfg; QString m_addrCfg; - QString m_addrXml; + QString m_addrXml; QString m_pathLib; QString m_pathPic; QString m_pathCfg; @@ -160,10 +160,10 @@ Position m_scrollPos; bool m_fullScreen; bool m_switchBar; - bool m_menuBar; + bool m_menuBar; Language m_language; - QTranslator *m_translatorQT; - QTranslator *m_translatorQTerm; + QTranslator *m_translatorQT; + QTranslator *m_translatorQTerm; #ifdef KWALLET_ENABLED Wallet * m_wallet; #endif // KWALLET_ENABLED This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-13 12:47:17
|
Revision: 1242 http://qterm.svn.sourceforge.net/qterm/?rev=1242&view=rev Author: sidos Date: 2010-08-13 12:47:11 +0000 (Fri, 13 Aug 2010) Log Message: ----------- copy resource files to build tree, so that qterm can run from build tree Modified Paths: -------------- trunk/qterm-qt4/src/CMakeLists.txt trunk/qterm-qt4/src/keyboard_profiles/CMakeLists.txt trunk/qterm-qt4/src/scheme/CMakeLists.txt trunk/qterm-qt4/src/scripts/CMakeLists.txt trunk/qterm-qt4/src/scripts/ui/CMakeLists.txt Modified: trunk/qterm-qt4/src/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/CMakeLists.txt 2010-08-13 07:12:27 UTC (rev 1241) +++ trunk/qterm-qt4/src/CMakeLists.txt 2010-08-13 12:47:11 UTC (rev 1242) @@ -192,6 +192,8 @@ set(qterm_RCCS qterm.qrc) +file(COPY ${qterm_MISC} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + if(WIN32) if(MINGW) # resource compilation for mingw Modified: trunk/qterm-qt4/src/keyboard_profiles/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/keyboard_profiles/CMakeLists.txt 2010-08-13 07:12:27 UTC (rev 1241) +++ trunk/qterm-qt4/src/keyboard_profiles/CMakeLists.txt 2010-08-13 12:47:11 UTC (rev 1242) @@ -1,2 +1,3 @@ -file(GLOB cursorFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.keytab") -install(FILES ${cursorFiles} DESTINATION share/qterm/keyboard_profiles) +file(GLOB keyboardFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.keytab") +file(COPY ${keyboardFiles} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +install(FILES ${keyboardFiles} DESTINATION share/qterm/keyboard_profiles) Modified: trunk/qterm-qt4/src/scheme/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/scheme/CMakeLists.txt 2010-08-13 07:12:27 UTC (rev 1241) +++ trunk/qterm-qt4/src/scheme/CMakeLists.txt 2010-08-13 12:47:11 UTC (rev 1242) @@ -1,2 +1,3 @@ file(GLOB schemeFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.scheme") +file(COPY ${schemeFiles} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${schemeFiles} DESTINATION share/qterm/scheme) Modified: trunk/qterm-qt4/src/scripts/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/scripts/CMakeLists.txt 2010-08-13 07:12:27 UTC (rev 1241) +++ trunk/qterm-qt4/src/scripts/CMakeLists.txt 2010-08-13 12:47:11 UTC (rev 1242) @@ -1,3 +1,4 @@ file(GLOB scriptFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.js") +file(COPY ${scriptFiles} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${scriptFiles} DESTINATION share/qterm/scripts) add_subdirectory(ui) Modified: trunk/qterm-qt4/src/scripts/ui/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/scripts/ui/CMakeLists.txt 2010-08-13 07:12:27 UTC (rev 1241) +++ trunk/qterm-qt4/src/scripts/ui/CMakeLists.txt 2010-08-13 12:47:11 UTC (rev 1242) @@ -1,2 +1,3 @@ file(GLOB scriptFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.ui") +file(COPY ${scriptFiles} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${scriptFiles} DESTINATION share/qterm/scripts/ui) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-13 07:12:33
|
Revision: 1241 http://qterm.svn.sourceforge.net/qterm/?rev=1241&view=rev Author: sidos Date: 2010-08-13 07:12:27 +0000 (Fri, 13 Aug 2010) Log Message: ----------- because of QTermWindow rebased on QMdiSubWindow, the mouse event are properly handled by QTermWindow not necessary to be delegated by QTermScreen. Modified Paths: -------------- trunk/qterm-qt4/src/qtermscreen.cpp trunk/qterm-qt4/src/qtermscreen.h trunk/qterm-qt4/src/qtermwindow.cpp Modified: trunk/qterm-qt4/src/qtermscreen.cpp =================================================================== --- trunk/qterm-qt4/src/qtermscreen.cpp 2010-08-10 01:22:12 UTC (rev 1240) +++ trunk/qterm-qt4/src/qtermscreen.cpp 2010-08-13 07:12:27 UTC (rev 1241) @@ -216,10 +216,6 @@ } } -void Screen::moveEvent(QMoveEvent *) -{ -// setBgPxm( m_pxmBg, m_nPxmType ); -} void Screen::resizeEvent(QResizeEvent *) { updateScrollBar(); @@ -246,58 +242,6 @@ /* ------------------------------------------------------------------------ */ /* */ -/* Mouse */ -/* */ -/* ------------------------------------------------------------------------ */ -void Screen::enterEvent(QEvent * e) -{ - QApplication::sendEvent(m_pWindow, e); -} - -void Screen::leaveEvent(QEvent * e) -{ - QApplication::sendEvent(m_pWindow, e); -} - -void Screen::mousePressEvent(QMouseEvent * me) -{ - setFocus(); - - m_pWindow->mousePressEvent(me); - //QApplication::sendEvent(m_pWindow, me); - -} -void Screen::mouseMoveEvent(QMouseEvent * me) -{ -#ifdef Q_OS_MACX - m_pWindow->mouseMoveEvent(me); -#else - m_pWindow->mouseMoveEvent(me); - //QApplication::sendEvent(m_pWindow, me); -#endif -} - -void Screen::mouseReleaseEvent(QMouseEvent * me) -{ - m_pWindow->mouseReleaseEvent(me); - //QApplication::sendEvent(m_pWindow, me); -} - -void Screen::wheelEvent(QWheelEvent * we) -{ - if (Global::instance()->m_pref.bWheel) - QApplication::sendEvent(m_pWindow, we); - else { - int old_value = m_scrollBar->value(); - int step = m_scrollBar->singleStep()*we->delta()/8/15; - m_scrollBar->setValue(old_value-step); - we->accept(); - } -} - - -/* ------------------------------------------------------------------------ */ -/* */ /* Font */ /* */ /* ------------------------------------------------------------------------ */ @@ -512,29 +456,24 @@ void Screen::prevPage() { scrollLine(-m_pBuffer->line()); - m_ePaintState = NewData; - update(); } void Screen::nextPage() { scrollLine(m_pBuffer->line()); - m_ePaintState = NewData; - update(); + } void Screen::prevLine() { scrollLine(-1); - m_ePaintState = NewData; - update(); + } void Screen::nextLine() { scrollLine(1); - m_ePaintState = NewData; - update(); + } void Screen::scrollLine(int delta) @@ -559,6 +498,8 @@ for (int i = m_nStart; i <= m_nEnd; i++) m_pBuffer->at(i)->setChanged(-1, -1); + m_ePaintState = NewData; + update(); } void Screen::scrollChanged(int value) { Modified: trunk/qterm-qt4/src/qtermscreen.h =================================================================== --- trunk/qterm-qt4/src/qtermscreen.h 2010-08-10 01:22:12 UTC (rev 1240) +++ trunk/qterm-qt4/src/qtermscreen.h 2010-08-13 07:12:27 UTC (rev 1241) @@ -104,7 +104,6 @@ protected: void initFontMetrics(); - void moveEvent(QMoveEvent *); void resizeEvent(QResizeEvent *); void focusInEvent(QFocusEvent *); void focusOutEvent(QFocusEvent *); @@ -113,14 +112,6 @@ void paintEvent(QPaintEvent *); - // mouse - void enterEvent(QEvent *); - void leaveEvent(QEvent *); - void mousePressEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void wheelEvent(QWheelEvent *); - // display void eraseRect(QPainter& , int, int, int, int, short); void drawStr(QPainter&, const QString&, int, int, int, short, bool, CharFlags); Modified: trunk/qterm-qt4/src/qtermwindow.cpp =================================================================== --- trunk/qterm-qt4/src/qtermwindow.cpp 2010-08-10 01:22:12 UTC (rev 1240) +++ trunk/qterm-qt4/src/qtermwindow.cpp 2010-08-13 07:12:27 UTC (rev 1241) @@ -296,7 +296,6 @@ m_bCheckIP = m_pIPLocation->haveFile(); m_pSound = NULL; - setFocusProxy(m_pScreen); setWidget(m_pScreen); connect(m_pFrame, SIGNAL(scrollChanged()), m_pScreen, SLOT(updateScrollBar())); @@ -781,12 +780,16 @@ } } #endif - int j = we->delta() > 0 ? 4 : 5; - if (!(we->modifiers())) { - if (Global::instance()->m_pref.bWheel && m_bConnected) - m_pTelnet->write(direction[j], sizeof(direction[j])); - return; - } + if (Global::instance()->m_pref.bWheel) { + int j = we->delta() > 0 ? 4 : 5; + if (!(we->modifiers())) { + if (Global::instance()->m_pref.bWheel && m_bConnected) + m_pTelnet->write(direction[j], sizeof(direction[j])); + } + } + else { + m_pScreen->scrollLine(-we->delta()/8/15); + } } //keyboard input event This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hep...@us...> - 2010-08-10 01:22:18
|
Revision: 1240 http://qterm.svn.sourceforge.net/qterm/?rev=1240&view=rev Author: hephooey Date: 2010-08-10 01:22:12 +0000 (Tue, 10 Aug 2010) Log Message: ----------- Disable testing for ssh Modified Paths: -------------- trunk/qterm-qt4/src/test/CMakeLists.txt Modified: trunk/qterm-qt4/src/test/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/test/CMakeLists.txt 2010-08-10 01:22:06 UTC (rev 1239) +++ trunk/qterm-qt4/src/test/CMakeLists.txt 2010-08-10 01:22:12 UTC (rev 1240) @@ -2,4 +2,4 @@ add_subdirectory(config) add_subdirectory(global) add_subdirectory(hostinfo) -add_subdirectory(ssh) +#add_subdirectory(ssh) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hep...@us...> - 2010-08-10 01:22:13
|
Revision: 1239 http://qterm.svn.sourceforge.net/qterm/?rev=1239&view=rev Author: hephooey Date: 2010-08-10 01:22:06 +0000 (Tue, 10 Aug 2010) Log Message: ----------- Fix test Modified Paths: -------------- trunk/qterm-qt4/src/test/global/CMakeLists.txt Modified: trunk/qterm-qt4/src/test/global/CMakeLists.txt =================================================================== --- trunk/qterm-qt4/src/test/global/CMakeLists.txt 2010-08-09 10:03:20 UTC (rev 1238) +++ trunk/qterm-qt4/src/test/global/CMakeLists.txt 2010-08-10 01:22:06 UTC (rev 1239) @@ -2,8 +2,10 @@ testglobal.cpp ../../qtermconfig.cpp ../../qtermglobal.cpp + ../../qtermparam.cpp ../../qtermconvert.cpp) qt4_automoc(${global_SRCS}) +remove_definitions(-DKWALLET_ENABLED) include_directories( ${QT_INCLUDE_DIR} @@ -22,6 +24,7 @@ ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTTEST_LIBRARY} +${QT_QTXML_LIBRARY} ) add_test(global ${EXEC_DIR}/testglobal) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-09 10:03:26
|
Revision: 1238 http://qterm.svn.sourceforge.net/qterm/?rev=1238&view=rev Author: sidos Date: 2010-08-09 10:03:20 +0000 (Mon, 09 Aug 2010) Log Message: ----------- a test case for http redirection Added Paths: ----------- trunk/qterm-qt4/src/test/http/ trunk/qterm-qt4/src/test/http/http.pro trunk/qterm-qt4/src/test/http/main.cpp trunk/qterm-qt4/src/test/http/qnamredirect.cpp trunk/qterm-qt4/src/test/http/qnamredirect.h Added: trunk/qterm-qt4/src/test/http/http.pro =================================================================== --- trunk/qterm-qt4/src/test/http/http.pro (rev 0) +++ trunk/qterm-qt4/src/test/http/http.pro 2010-08-09 10:03:20 UTC (rev 1238) @@ -0,0 +1,12 @@ +###################################################################### +# Automatically generated by qmake (2.01a) Mon Jun 21 08:53:54 2010 +###################################################################### + +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . +QT += network +# Input +HEADERS += qnamredirect.h +SOURCES += main.cpp qnamredirect.cpp Added: trunk/qterm-qt4/src/test/http/main.cpp =================================================================== --- trunk/qterm-qt4/src/test/http/main.cpp (rev 0) +++ trunk/qterm-qt4/src/test/http/main.cpp 2010-08-09 10:03:20 UTC (rev 1238) @@ -0,0 +1,12 @@ +#include "qnamredirect.h" + +#include <QtGui> +#include <QApplication> + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + QNAMRedirect w; + w.show(); + return a.exec(); +} Added: trunk/qterm-qt4/src/test/http/qnamredirect.cpp =================================================================== --- trunk/qterm-qt4/src/test/http/qnamredirect.cpp (rev 0) +++ trunk/qterm-qt4/src/test/http/qnamredirect.cpp 2010-08-09 10:03:20 UTC (rev 1238) @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2009 Nokia Corporation + */ + +#include "qnamredirect.h" + +QNAMRedirect::QNAMRedirect(QWidget *parent) : QMainWindow(parent) { + _qnam = createQNAM(); + _originalUrl = "http://mitbbs.com/article2/PhotoForum/31264659_224.jpg"; + + QVBoxLayout* layout = new QVBoxLayout; + +#ifdef Q_OS_SYMBIAN + setStyleSheet("QLabel, QPushButton{ font: 5pt; }"); +#endif + + _textContainer = new QLabel("Click the button to test URL redirect!"); + _textContainer->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + _textContainer->setAlignment(Qt::AlignCenter); + _textContainer->setWordWrap(true); + layout->addWidget(_textContainer); + + QPushButton* testButton = new QPushButton("Click here!"); + /* If the button is clicked, we'll do a request. */ + connect(testButton, SIGNAL(clicked()), + this, SLOT(doRequest())); + layout->addWidget(testButton); + + QFrame* frame = new QFrame; + frame->setLayout(layout); + setCentralWidget(frame); +} + +QNAMRedirect::~QNAMRedirect() { + if(_qnam) { + _qnam->deleteLater(); + } + if(_textContainer) { + _textContainer->deleteLater(); + } +} + +QNetworkAccessManager* QNAMRedirect::createQNAM() { + QNetworkAccessManager* qnam = new QNetworkAccessManager(this); + /* We'll handle the finished reply in replyFinished */ + connect(qnam, SIGNAL(finished(QNetworkReply*)), + this, SLOT(replyFinished(QNetworkReply*))); + return qnam; +} + +void QNAMRedirect::doRequest() { + QString text = "QNAMRedirect::doRequest doing request to "; + text.append(this->_originalUrl.toString()); + this->_textContainer->setText(text); + /* Let's just create network request for this predifned URL... */ + QNetworkRequest request(this->_originalUrl); + /* ...and ask the manager to do the request. */ + QNetWorkReply reply = this->_qnam->get(request); + connect(reply, SIGNAL(finished()), this, SLOT(httpFinished())); + connect(reply, SIGNAL(readyRead()),this, SLOT(httpReadyRead())); + connect(reply, SIGNAL(downloadProgress(qint64,qint64)), + this, SLOT(updateDataReadProgress(qint64,qint64))); +} + +void QNAMRedirect::replyFinished(QNetworkReply* reply) { + /* + * Reply is finished! + * We'll ask for the reply about the Redirection attribute + * http://doc.trolltech.com/qnetworkrequest.html#Attribute-enum + */ + QVariant possibleRedirectUrl = + reply->attribute(QNetworkRequest::RedirectionTargetAttribute); + + /* We'll deduct if the redirection is valid in the redirectUrl function */ + _urlRedirectedTo = this->redirectUrl(possibleRedirectUrl.toUrl(), + _urlRedirectedTo); + + /* If the URL is not empty, we're being redirected. */ + if(!_urlRedirectedTo.isEmpty()) { + QString text = QString("QNAMRedirect::replyFinished: Redirected to ") + .append(_urlRedirectedTo.toString()); + this->_textContainer->setText(text); + + /* We'll do another request to the redirection url. */ + this->_qnam->get(QNetworkRequest(_urlRedirectedTo)); + } + else { + /* + * We weren't redirected anymore + * so we arrived to the final destination... + */ + QString text = QString("QNAMRedirect::replyFinished: Arrived to ") + .append(reply->url().toString()); + this->_textContainer->setText(text); + /* ...so this can be cleared. */ + _urlRedirectedTo.clear(); + } + /* Clean up. */ + reply->deleteLater(); +} + +QUrl QNAMRedirect::redirectUrl(const QUrl& possibleRedirectUrl, + const QUrl& oldRedirectUrl) const { + QUrl redirectUrl; + /* + * Check if the URL is empty and + * that we aren't being fooled into a infinite redirect loop. + * We could also keep track of how many redirects we have been to + * and set a limit to it, but we'll leave that to you. + */ + if(!possibleRedirectUrl.isEmpty() && + possibleRedirectUrl != oldRedirectUrl) { + redirectUrl = possibleRedirectUrl; + } + return redirectUrl; +} Added: trunk/qterm-qt4/src/test/http/qnamredirect.h =================================================================== --- trunk/qterm-qt4/src/test/http/qnamredirect.h (rev 0) +++ trunk/qterm-qt4/src/test/http/qnamredirect.h 2010-08-09 10:03:20 UTC (rev 1238) @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2009 Nokia Corporation + */ + +#ifndef QNAMREDIRECT_H +#define QNAMREDIRECT_H + +#include <QtGui/QMainWindow> +#include <QtGui/QFrame> +#include <QtGui/QVBoxLayout> +#include <QtGui/QLabel> +#include <QtGui/QPushButton> + +#include <QtNetwork/QNetworkAccessManager> +#include <QtNetwork/QNetworkRequest> +#include <QtNetwork/QNetworkReply> + +#include <QtCore/QPointer> +#include <QtCore/QUrl> + +class QNAMRedirect : public QMainWindow +{ + Q_OBJECT + +public: + QNAMRedirect(QWidget *parent = 0); + ~QNAMRedirect(); + +private slots: + void doRequest(); + void replyFinished(QNetworkReply* reply); + +private: + QPointer<QNetworkAccessManager> _qnam; + QUrl _originalUrl; + QUrl _urlRedirectedTo; + + QPointer<QLabel> _textContainer; + + QNetworkAccessManager* createQNAM(); + QUrl redirectUrl(const QUrl& possibleRedirectUrl, + const QUrl& oldRedirectUrl) const; +}; + +#endif // QNAMREDIRECT_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-09 10:01:35
|
Revision: 1237 http://qterm.svn.sourceforge.net/qterm/?rev=1237&view=rev Author: sidos Date: 2010-08-09 10:01:29 +0000 (Mon, 09 Aug 2010) Log Message: ----------- qterm logo Added Paths: ----------- trunk/qterm-qt4/src/doc/qterm.png Added: trunk/qterm-qt4/src/doc/qterm.png =================================================================== (Binary files differ) Property changes on: trunk/qterm-qt4/src/doc/qterm.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-09 10:00:20
|
Revision: 1236 http://qterm.svn.sourceforge.net/qterm/?rev=1236&view=rev Author: sidos Date: 2010-08-09 10:00:13 +0000 (Mon, 09 Aug 2010) Log Message: ----------- remove intermediate files Removed Paths: ------------- trunk/qterm-qt4/src/doc/CMakeFiles/ trunk/qterm-qt4/src/test/ssh/.testssh.cpp.swp Deleted: trunk/qterm-qt4/src/test/ssh/.testssh.cpp.swp =================================================================== --- trunk/qterm-qt4/src/test/ssh/.testssh.cpp.swp 2010-08-07 11:19:09 UTC (rev 1235) +++ trunk/qterm-qt4/src/test/ssh/.testssh.cpp.swp 2010-08-09 10:00:13 UTC (rev 1236) @@ -1,3 +0,0 @@ -b0VIM 7.1 |
From: <si...@us...> - 2010-08-07 11:19:15
|
Revision: 1235 http://qterm.svn.sourceforge.net/qterm/?rev=1235&view=rev Author: sidos Date: 2010-08-07 11:19:09 +0000 (Sat, 07 Aug 2010) Log Message: ----------- remove intermediate cmakefiles Removed Paths: ------------- trunk/qterm-qt4/src/po/CMakeFiles/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <si...@us...> - 2010-08-06 13:13:45
|
Revision: 1234 http://qterm.svn.sourceforge.net/qterm/?rev=1234&view=rev Author: sidos Date: 2010-08-06 13:13:38 +0000 (Fri, 06 Aug 2010) Log Message: ----------- chartable test Added Paths: ----------- branches/chartable/ branches/chartable/Makefile branches/chartable/chartable.cpp branches/chartable/chartable.h branches/chartable/chartable.pro branches/chartable/main.cpp Added: branches/chartable/Makefile =================================================================== --- branches/chartable/Makefile (rev 0) +++ branches/chartable/Makefile 2010-08-06 13:13:38 UTC (rev 1234) @@ -0,0 +1,154 @@ +############################################################################# +# Makefile for building: chartable +# Generated by qmake (2.01a) (Qt 4.6.3) on: Fri Aug 6 15:11:55 2010 +# Project: chartable.pro +# Template: app +# Command: c:\Qt\4.6.3\bin\qmake.exe -win32 -o Makefile chartable.pro +############################################################################# + +first: debug +install: debug-install +uninstall: debug-uninstall +MAKEFILE = Makefile +QMAKE = c:\Qt\4.6.3\bin\qmake.exe +DEL_FILE = del +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir +COPY = copy /y +COPY_FILE = $(COPY) +COPY_DIR = xcopy /s /q /y /i +INSTALL_FILE = $(COPY_FILE) +INSTALL_PROGRAM = $(COPY_FILE) +INSTALL_DIR = $(COPY_DIR) +DEL_FILE = del +SYMLINK = +DEL_DIR = rmdir +MOVE = move +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir +SUBTARGETS = \ + debug \ + release + +debug: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug +debug-make_default: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug +debug-make_first: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug first +debug-all: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug all +debug-clean: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug clean +debug-distclean: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug distclean +debug-install: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug install +debug-uninstall: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug uninstall +release: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release +release-make_default: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release +release-make_first: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release first +release-all: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release all +release-clean: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release clean +release-distclean: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release distclean +release-install: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release install +release-uninstall: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release uninstall + +Makefile: chartable.pro ..\..\..\Qt\4.6.3\mkspecs\win32-msvc\qmake.conf ..\..\..\Qt\4.6.3\mkspecs\qconfig.pri \ + ..\..\..\Qt\4.6.3\mkspecs\features\qt_functions.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\qt_config.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\exclusive_builds.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\default_pre.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\win32\default_pre.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\debug.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\debug_and_release.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\default_post.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\win32\default_post.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\win32\rtti.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\win32\exceptions.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\win32\stl.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\shared.prf \ + ..\..\..\Qt\4.6.3\mkspecs\win32-msvc\features\incremental.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\warn_on.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\qt.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\win32\thread.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\moc.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\win32\windows.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\resources.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\uic.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\yacc.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\lex.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\incredibuild_xge.prf \ + ..\..\..\Qt\4.6.3\mkspecs\features\include_source_dir.prf \ + c:\Qt\4.6.3\lib\qtmaind.prl + $(QMAKE) -win32 -o Makefile chartable.pro +..\..\..\Qt\4.6.3\mkspecs\qconfig.pri: +..\..\..\Qt\4.6.3\mkspecs\features\qt_functions.prf: +..\..\..\Qt\4.6.3\mkspecs\features\qt_config.prf: +..\..\..\Qt\4.6.3\mkspecs\features\exclusive_builds.prf: +..\..\..\Qt\4.6.3\mkspecs\features\default_pre.prf: +..\..\..\Qt\4.6.3\mkspecs\features\win32\default_pre.prf: +..\..\..\Qt\4.6.3\mkspecs\features\debug.prf: +..\..\..\Qt\4.6.3\mkspecs\features\debug_and_release.prf: +..\..\..\Qt\4.6.3\mkspecs\features\default_post.prf: +..\..\..\Qt\4.6.3\mkspecs\features\win32\default_post.prf: +..\..\..\Qt\4.6.3\mkspecs\features\win32\rtti.prf: +..\..\..\Qt\4.6.3\mkspecs\features\win32\exceptions.prf: +..\..\..\Qt\4.6.3\mkspecs\features\win32\stl.prf: +..\..\..\Qt\4.6.3\mkspecs\features\shared.prf: +..\..\..\Qt\4.6.3\mkspecs\win32-msvc\features\incremental.prf: +..\..\..\Qt\4.6.3\mkspecs\features\warn_on.prf: +..\..\..\Qt\4.6.3\mkspecs\features\qt.prf: +..\..\..\Qt\4.6.3\mkspecs\features\win32\thread.prf: +..\..\..\Qt\4.6.3\mkspecs\features\moc.prf: +..\..\..\Qt\4.6.3\mkspecs\features\win32\windows.prf: +..\..\..\Qt\4.6.3\mkspecs\features\resources.prf: +..\..\..\Qt\4.6.3\mkspecs\features\uic.prf: +..\..\..\Qt\4.6.3\mkspecs\features\yacc.prf: +..\..\..\Qt\4.6.3\mkspecs\features\lex.prf: +..\..\..\Qt\4.6.3\mkspecs\features\incredibuild_xge.prf: +..\..\..\Qt\4.6.3\mkspecs\features\include_source_dir.prf: +c:\Qt\4.6.3\lib\qtmaind.prl: +qmake: qmake_all FORCE + @$(QMAKE) -win32 -o Makefile chartable.pro + +qmake_all: FORCE + +make_default: debug-make_default release-make_default FORCE +make_first: debug-make_first release-make_first FORCE +all: debug-all release-all FORCE +clean: debug-clean release-clean FORCE + -$(DEL_FILE) chartable.exp + -$(DEL_FILE) chartable.pdb + -$(DEL_FILE) chartable.ilk + -$(DEL_FILE) vc*.pdb + -$(DEL_FILE) vc*.idb +distclean: debug-distclean release-distclean FORCE + -$(DEL_FILE) Makefile + +check: first + +debug-mocclean: $(MAKEFILE).Debug + $(MAKE) -f $(MAKEFILE).Debug mocclean +release-mocclean: $(MAKEFILE).Release + $(MAKE) -f $(MAKEFILE).Release mocclean +mocclean: debug-mocclean release-mocclean + +debug-mocables: $(MAKEFILE).Debug + $(MAKE) -f $(MAKEFILE).Debug mocables +release-mocables: $(MAKEFILE).Release + $(MAKE) -f $(MAKEFILE).Release mocables +mocables: debug-mocables release-mocables +FORCE: + +$(MAKEFILE).Debug: Makefile +$(MAKEFILE).Release: Makefile Added: branches/chartable/chartable.cpp =================================================================== --- branches/chartable/chartable.cpp (rev 0) +++ branches/chartable/chartable.cpp 2010-08-06 13:13:38 UTC (rev 1234) @@ -0,0 +1,119 @@ +#include "chartable.h" + +#include <QMouseEvent> +#include <QResizeEvent> +#include <QPainter> + +#include <QtDebug> + +namespace QTerm +{ + +CharTable :: CharTable(QWidget *parent) + : QWidget(parent) +{ + setMouseTracking(true); + maxColumn = 10; + square = 25; + symbols = QString::fromUtf8("+-×÷±∵∴∈≡∝" + "∑∏∪∩∫∮∶∧∨∷" + "≌≈∽\xE2\x89 ≮≯≤≥∞\xE2\x88 " + "〔〕()〈〉《》「」" + "『』〖〗【】[]{}" + "︵︶︹︺︿﹀︽︾﹁﹂" + "﹃﹄︻︼︷︸‘’“”" + "ΑΒΓΔΕΖΗΘΙΚ" + "ΛΜΝΞΟ\xCE ΡΣΤΥ" + "ΦΧΨΩαβγδεζ" + "ηθικλμνξοπ" + "ρστυφχψω㎎" + "℡㎏㎜㎝㎞㎡㏄〾⿰⿱" + "⿲⿳⿴⿵⿶⿷⿸⿹⿺⿻" + "▁▂▃▄▅▆▇█▉▊" + "▋▌▍▎▏▓╱╲╳※" + "─│┌┐└┘├┤┬┴" + "┼↖↗↘↙→←↑↓√" + "▼▽◢◣◥◤╭╮╯╰" + "♂♀☉⊕〇◎〓℉℃㊣" + "☆★◇◆□\xE2\x96 △▲○●" + "⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑" + "⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛" + "⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽" + "\xE2\x91 ②③④⑤⑥⑦⑧⑨⑩" + "\xE3\x88 ㈡㈢㈣㈤㈥㈦㈧㈨㈩" + "ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹ" + "\xE2\x85 ⅡⅢⅣⅤⅥⅦⅧⅨⅩ"); +} + +void CharTable ::resizeEvent(QResizeEvent *re) +{ + maxColumn = re->size().width()/square; + setMinimumHeight((symbols.length()/maxColumn + 1)*square); +} + +QSize CharTable :: sizeHint() const +{ + int x = maxColumn*square; + int y = (symbols.length()/maxColumn + 1)*square; + return QSize(x, y); +} + +void CharTable :: mouseMoveEvent(QMouseEvent *me) +{ + int column = me->x()/square; + int row = me->y()/square; + if (hovered == QPoint(column, row)) + return; + QRect oldRect(hovered.x()*square, hovered.y()*square, square, square); + hovered.setX(column); + hovered.setY(row); + QRect newRect(hovered.x()*square, hovered.y()*square, square, square); + update(oldRect.united(newRect)); +} + +void CharTable :: mouseReleaseEvent(QMouseEvent *me) +{ + if (me->button() == Qt::LeftButton) { + int n = (me->y()/square)*maxColumn + me->x()/square; + if (n<symbols.length()) + emit characterSelected(symbols.at(n)); + update(); + } +} + +void CharTable :: paintEvent(QPaintEvent *pe) +{ + QPainter painter(this); + painter.fillRect(pe->rect(), QBrush(Qt::white)); + QRect redrawRect = pe->rect(); + int beginRow = redrawRect.top()/square; + int endRow = redrawRect.bottom()/square; + int beginColumn = redrawRect.left()/square; + int endColumn = redrawRect.right()/square; + QFont font("SimSun",20); + + for (int row = beginRow; row <= endRow; ++row) { + for (int column = beginColumn; column <= endColumn; ++column) { + int n = row*maxColumn + column; + QString text; + if (n < symbols.length()) + text = symbols.at(n); + QRect textRect = QRect(column*square, row*square, square, square); + if (hovered == QPoint(column, row)) { + painter.fillRect(textRect, palette().highlight()); + painter.setPen(palette().highlightedText().color()); + } else { + painter.setPen(QPen(Qt::gray)); + painter.drawRect(textRect); + painter.setPen(QPen(Qt::black)); + } + if (!text.isEmpty()) { + painter.setFont(font); + painter.drawText(textRect, Qt::AlignCenter, text); + } + } + } +} + +} + Added: branches/chartable/chartable.h =================================================================== --- branches/chartable/chartable.h (rev 0) +++ branches/chartable/chartable.h 2010-08-06 13:13:38 UTC (rev 1234) @@ -0,0 +1,36 @@ +#ifndef CHARTABLE_H +#define CHARTABLE_H + +#include <QWidget> + +namespace QTerm +{ + +class CharTable : public QWidget +{ + Q_OBJECT +public: + CharTable (QWidget *parent = 0); + QSize sizeHint() const; + +signals: + void characterSelected(QString); + +protected: + void resizeEvent(QResizeEvent *re); + void mouseMoveEvent(QMouseEvent *me); + void mouseReleaseEvent(QMouseEvent *me); + void paintEvent(QPaintEvent *pe); + +private: + QString symbols; + int maxColumn; + int square; + QPoint hovered; +}; + + + +} + +#endif Added: branches/chartable/chartable.pro =================================================================== --- branches/chartable/chartable.pro (rev 0) +++ branches/chartable/chartable.pro 2010-08-06 13:13:38 UTC (rev 1234) @@ -0,0 +1,12 @@ +###################################################################### +# Automatically generated by qmake (2.01a) Fri Aug 6 15:11:51 2010 +###################################################################### + +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . + +# Input +HEADERS += chartable.h +SOURCES += chartable.cpp main.cpp Added: branches/chartable/main.cpp =================================================================== --- branches/chartable/main.cpp (rev 0) +++ branches/chartable/main.cpp 2010-08-06 13:13:38 UTC (rev 1234) @@ -0,0 +1,18 @@ +#include "chartable.h" + +#include <QScrollArea> +#include <QApplication> + +int main (int argc, char **argv) +{ + QApplication app(argc, argv); + + QScrollArea scroll; + scroll.setWidgetResizable(true); + QTerm::CharTable table; + scroll.setWidget(&table); + + scroll.show(); + + app.exec(); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |