Compare commits

..

48 Commits

Author SHA1 Message Date
e8cbefe112 Update Standards-Version to 4.7.1, no changes needed. 2025-02-21 17:19:23 -06:00
0285a03eee No-change rebuild for lxqt-build-tools C++17 -> C++20. 2025-02-21 17:05:50 -06:00
42ba57a0f0 Upload to Plucky 2024-11-15 15:34:45 -06:00
d56368694a Make Lintian happy 2024-11-05 20:16:15 -06:00
e02de73378 Bump build dependencies, update VCS fields. 2024-11-05 19:57:01 -06:00
1cb40bb1d0 New upstream release. 2024-11-05 19:54:57 -06:00
943e9b8f83 Update Standards-Version to 4.7.0, no changes needed. 2024-10-20 17:07:19 -05:00
df2cee675d New upstream Git snapshot, for the Qt 6 port. 2024-10-20 16:59:45 -05:00
a9aeaac5f4 Sync with archive 2024-10-20 16:55:12 -05:00
d60c84af3b Bump build deps 2024-01-18 16:45:06 +00:00
4ada5b1fdd Update copyright file 2024-01-18 16:43:25 +00:00
f24bb23e0e Prepare for new upstream release 2024-01-18 16:41:51 +00:00
d5ac59d049 Overhauled copyright file 2023-11-08 17:49:40 -06:00
d30850a089 Bump version for new upstream release 2023-11-08 17:36:15 -06:00
Aaron Rainbolt
1136614a8f Bump version number 2023-02-12 17:41:33 -06:00
Aaron Rainbolt
5ee6f2414f Removed obsolete linker flag. 2023-02-10 13:02:58 -06:00
Aaron Rainbolt
7369099b9b Removed trailing whitespace from changelog. 2023-02-10 13:02:23 -06:00
Aaron Rainbolt
2c40c1d834 Removed Repository-Browser field frmo metadata. 2023-02-10 13:01:24 -06:00
Aaron Rainbolt
e9c05f6895 Get the watch file to work with GitHub. 2023-02-10 13:00:38 -06:00
Aaron Rainbolt
8c365c422f Updated terminology in lintian-overrides. 2023-02-10 13:00:36 -06:00
Aaron Rainbolt
e716f0b32a Added 'Rules-Requires-Root: no' 2023-02-09 23:26:07 -06:00
Aaron Rainbolt
4ce87dafbc Bumped Standards-Version 2023-02-09 23:25:34 -06:00
Aaron Rainbolt
2657bb053a Overhauled copyright file. 2023-02-09 23:20:28 -06:00
Aaron Rainbolt
178397c71b Revert a sync from Debian.
This reverts commit f4d40a1f5f164c92b8104d9b2eb5dea15a2d9d94.
2023-02-09 23:09:11 -06:00
Aaron Rainbolt
f4d40a1f5f Sync with archive. 2023-02-09 22:57:04 -06:00
0b3c98ff4a Release to Kinetic. 2022-06-02 10:06:25 -05:00
461ec1295e Drop old Breaks/Replaces, we're past the LTS. 2022-06-02 10:04:26 -05:00
0e0c00ad1b Bump build dependencies. 2022-06-02 10:03:58 -05:00
5ac8285ed4 New upstream release. 2022-06-02 10:03:29 -05:00
Raman Sarda
aa2ae9dafc New upstream version
Summary: New upstream version merged from debian unstable.

Test Plan: Test if it builds alright in all architectures.

Reviewers: rikmills, wxl

Differential Revision: https://phab.lubuntu.me/D106
2021-02-21 20:14:33 +05:30
9ecd348b0a Upload to Groovy. 2020-06-04 14:38:48 -05:00
bbe798cfc1 Run wrap-and-sort. 2020-04-30 23:53:22 -05:00
cf72be8008 Update upstream signing key. 2020-04-30 23:53:04 -05:00
86455ea002 Update LXQt build dependencies. 2020-04-30 23:52:44 -05:00
f313f393f9 Update Standards-version to 4.5.0, no changes needed. 2020-04-30 23:52:13 -05:00
7b1032108b New upstream release. 2020-04-30 23:51:52 -05:00
Simon Quigley
e12765ae4f Lubuntuify the package. 2019-03-30 16:37:38 -05:00
Alf Gaida
bde099b13b Cherry-picked upstream release 0.14.1. 2019-02-26 00:43:49 +01:00
Alf Gaida
0208cf4b60 Cherry-picked upstream release 0.14.0.
* Bumped Standards to 4.3.0, no changes needed
* Dropped d/compat, use debhelper-compat = 12, no changes needed
* Fixed years in d/copyright
* Bumped minimum version lxqt-build-tools (>= 0.6.0~)
* Removed obsolete PULL_TRANSLATIONS= OFF from dh_auto_configure
* Added l10n-package, moved from lxqt-l10n
* Added d/upstream/metadata
2019-01-27 15:14:50 +01:00
Alf Gaida
284445dcf4 Cherry-picked upstream release 0.13.0.
* Bump lxqt-build-tools to >= 0.5.0~
* Fixed watch file lxde -> lxqt

Adding upstream version 0.13.0.

Signed-off-by: Alf Gaida <agaida@siduction.org>
2018-05-23 20:16:16 +02:00
Alf Gaida
8f4d17284a Some updates in debian $foo
* Bumped compat to 11
* Bumped debhelper to >= 11~
* Bumped Standards to 4.1.4, no changes needed
* Changed VCS fields for salsa
* Changed Homepage, Source and watch to lxqt
* Bumped years in copyright
* Removed trailing whitespaces in changelog
2018-04-28 17:08:25 +02:00
Alf Gaida
cf61ed6eab Cleanup debian/*
* Bumped Standards to 4.1.2, no changes needed
* Removed branch from VCS fields
* Removed debian/gbp.conf
2017-12-14 23:44:28 +01:00
Alf Gaida
dd6628ba9d Transition to unstable
* Bumped Standards to 4.1.1 - no changes needed
2017-12-04 19:39:49 +01:00
Alf Gaida
61c1b7b25a Merge branch 'debian/experimental' into debian/sid 2017-12-04 19:35:08 +01:00
Alf Gaida
1936974c3e imported upstream version 0.12.0 2017-12-04 19:34:33 +01:00
Alf Gaida
9fa38b8e4e Cherry-picking upstream release 0.12.0.
* Switched to experimental
* Bumped minimum version of lxqt-build-tools to >= 0.4.0
* Bumped Standards to 4.1.0, no changes needed
2017-09-24 12:56:34 +02:00
Alf Gaida
b9e9fc2492 prepare upstream release 2017-09-24 12:41:39 +02:00
Alf Gaida
5d9f679a4d prepare upcoming release 2017-09-24 11:53:16 +02:00
52 changed files with 337 additions and 5393 deletions

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
/debian/*.debhelper
/debian/*.log
/debian/*.substvars
/debian/debhelper-build-stamp
/debian/files
/debian/obconf-qt/

13
AUTHORS
View File

@ -1,13 +0,0 @@
Copyright:
Copyright (c) 2012-2016 LXQt team
This program is based on source code from the ObConf project
<http://openbox.org/wiki/ObConf:About>
Original authors of obconf and copyright notice:
Copyright (c) 2003-2007 Dana Jansens <danakj@orodu.net>
Copyright (c) 2003 Tim Riley <tr@slackzone.org>
Copyright (c) 2007 Javeed Shaikh <syscrash2k@gmail.com>
License: GNU GPL-2
The full text of the licenses can be found in the 'COPYING' file.

123
CHANGELOG
View File

@ -1,123 +0,0 @@
obconf-qt-0.11.1 / 2016-12-11
=============================
* Create obconf-qt_fr.desktop
* Use the LXQtCompilerSettings
* Use lxqt-build-tools translation modules
* Use the new lxqt-build-tools package
* Remove cpack (#22)
* README.md: Update dependencies
0.11.0 / 2016-09-24
===================
* Release 0.11.0: Add changelog
* Bump version to 0.2.0 (#20)
* Extend README.md
* occured -> occurred
* build: Use external translations
* ts-files removal
* Bump year
* Work around grep 2.23 new behaviour
* Don't track $IDE settings
* Japanese translation update
* Reflect replacement README --> README.md in CMakeLists.txt
* Use markdown for README
* Update translations
* Fix license file
* Hungarian translations added
* src/CMakeLists.txt: do not completely overwrite CMAKE_CXX_FLAGS
* Use GNUInstallDirs
* Small build fix (themes dir path)
* Update German translation
* Update translations.
* Update the About dialog.
* Port missing "Dock" options from obconf gtk+ version.
* Support changing the name of desktops.
* German translation
* Default to Qt5
0.9.0 / 2015-02-25
==================
* Generate .desktop file again
* Enhance Portuguese translations
* Portuguese update with fixes
* Fix COPYING and AUTHORS information. The license should be GPL2, not LGPL. * Also update AUTHORS file to include more information of upstream obconf project.
* remove the old and outdated packaging stub
* lxqt_translate_desktop: pass -h instead of --no-filename to grep which is compatible with Busybox
* lxqt_translate_desktop: Updates code to cope with the cmake-policy CMP0054
* Adds .gitigore
* Fixes the app icon install location
* Adds .desktop translations support
* Update translations
* Makes it extract and compile and load translations
* Renames the translations files to their proper names
* Translate to Russian .desktop file
* Update Russian translation
* Commit from LXDE Pootle server by user andika.: 611 of 611 strings translated (0 need review).
* Commit from LXDE Pootle server by user rago1975.: 611 of 611 strings translated (0 need review).
* Support Qt5.
0.1.0 / 2014-05-07
==================
* Sync COPYING file with the actual used license
* Commit from LXDE Pootle server by user knedlyk.: 72 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user knedlyk.: 54 of 108 strings translated (1 fuzzy).
* Commit from LXDE Pootle server by user strebski.: 108 of 108 strings translated (0 fuzzy).
* Update AUTHORS and COPYING
* Do not re-generate *.ts files everytime
* Commit from LXDE Pootle server by user strebski.: 105 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user strebski.: 102 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user strebski.: 95 of 108 strings translated (1 fuzzy).
* Commit from LXDE Pootle server by user strebski.: 89 of 108 strings translated (1 fuzzy).
* Commit from LXDE Pootle server by user zvacet.: 73 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user hirkmt.: 108 of 108 strings translated (0 fuzzy).
* New files added from LXDE Pootle server based on templates
* Handle translations correctly.
* Commit from LXDE Pootle server by user zvacet.: 72 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user Fitoschido.: 107 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user strebski.: 83 of 108 strings translated (1 fuzzy).
* Commit from LXDE Pootle server by user Fitoschido.: 103 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user mbouzada.: 108 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user Fitoschido.: 98 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user zvacet.: 64 of 108 strings translated (0 fuzzy).
* New files added from LXDE Pootle server based on templates
* New files added from LXDE Pootle server based on templates
* Commit from LXDE Pootle server by user strebski.: 82 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user smarquespt.: 106 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user andika.: 108 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user andika.: 65 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user Fitoschido.: 87 of 108 strings translated (0 fuzzy).
* New files added from LXDE Pootle server based on templates
* Commit from LXDE Pootle server by user smarquespt.: 56 of 108 strings translated (0 fuzzy).
* New files added from LXDE Pootle server based on templates
* Commit from LXDE Pootle server by user strebski.: 63 of 108 strings translated (0 fuzzy).
* Commit from LXDE Pootle server by user strebski.: 54 of 108 strings translated (0 fuzzy).
* New files added from LXDE Pootle server based on templates
* New files added from LXDE Pootle server based on templates
* New files added from LXDE Pootle server based on templates
* New files added from LXDE Pootle server based on templates
* New files added from LXDE Pootle server based on templates
* New files added from LXDE Pootle server based on templates
* New files added from LXDE Pootle server based on templates
* New files added from LXDE Pootle server based on templates
* Commit from LXDE Pootle server by user brother.: 108 of 108 strings translated (0 fuzzy).
* New files added from LXDE Pootle server based on templates
* Implement changing font and remove unnecessary files. This commit is done in front of our presidential palace during a protest.
* Add a debian directory
* Fix signal/slot auto-connection problems. Add contents for README and AUTHORS.
* Remove unnecessary files.
* Remove unused files.
* Implement theme configuration.
* Fix text labels. Replace _ with & for keyboard shortcuts.
* Fix mouse page.
* Fix move & resize page.
* Ask openbox to reload confie file correctly. * Remove unnecessary files.
* Split different tab page into different *.cpp files.
* Partially handle combobox.
* Little UI polishing.
* Partially implement config options.
* Initial import into git repo.

View File

@ -1,52 +0,0 @@
project(obconf-qt)
# newer cmake is required for CMAKE_AUTOMOC Qt support
cmake_minimum_required(VERSION 2.8.12)
find_program(SED_PROGRAM sed)
include(GNUInstallDirs)
set(LXQTBT_MINIMUM_VERSION "0.1.0")
# Support Qt4 for the time being
option(USE_QT4 "Build with Qt4." $ENV{USE_QT4})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_AUTOMOC ON)
if(USE_QT4)
find_package(Qt4 REQUIRED QtCore QtGui) # Qt
include(${QT_USE_FILE})
message(STATUS "Building with Qt${QTVERSION}")
else()
cmake_minimum_required(VERSION 2.8.11)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5X11Extras REQUIRED)
find_package(Qt5LinguistTools REQUIRED QUIET)
message(STATUS "Building with Qt${Qt5Core_VERSION_STRING}")
endif()
find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
find_package(PkgConfig)
pkg_check_modules(GLIB REQUIRED
glib-2.0
)
pkg_check_modules(OPENBOX REQUIRED
obrender-3.5
obt-3.5
)
include(LXQtTranslateTs)
include(LXQtTranslateDesktop)
include(LXQtCompilerSettings)
# add src subdirectory
add_subdirectory(src)
# install an icon for the application
install(
FILES data/obconf-qt.png
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps"
)

280
COPYING
View File

@ -1,280 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) 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
this service 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 make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. 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.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the 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 a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE 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.
END OF TERMS AND CONDITIONS

View File

@ -1,23 +0,0 @@
# ObConf-Qt
## Overview
ObConf-Qt is a Qt port of [ObConf](http://openbox.org/wiki/ObConf:About), a configuration editor for window manager [OpenBox](http://openbox.org).
It is maintained by the LXQt project but can be used independently from this desktop environment.
## Installation
### Compiling source code
Runtime dependencies are Qt X11 Extras, gtk-update-icon-cache, hicolor-icon-theme and Openbox.
Additional build dependencies are CMake and [liblxqt](https://github.com/lxde/liblxqt), optionally Git to pull latest VCS checkouts. The localization files were outsourced to repository [lxqt-l10n](https://github.com/lxde/lxqt-l10n) so the corresponding dependencies are needed, too. Please refer to this repository's `README.md` for further information.
Code configuration is handled by CMake. CMake variable `CMAKE_INSTALL_PREFIX` has to be set to `/usr` on most operating systems.
To build run `make`, to install `make install` which accepts variable `DESTDIR` as usual.
### Binary packages
Official binary packages are available in Arch Linux and Debian (as of Debian stretch).
The tool is missing in Fedora so far. Same applies to openSUSE where it is about to be included, though.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

8
debian/.gitignore vendored
View File

@ -1,8 +0,0 @@
/*.debhelper
/*.log
/*.substvars
/debhelper-build-stamp
/files
/obconf-qt/
/obconf-qt5/

192
debian/changelog vendored
View File

@ -1,3 +1,195 @@
obconf-qt (0.16.5-0ubuntu3) plucky; urgency=medium
* Update Standards-Version to 4.7.1, no changes needed.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 21 Feb 2025 17:05:57 -0600
obconf-qt (0.16.5-0ubuntu2) plucky; urgency=medium
* No-change rebuild for lxqt-build-tools C++17 -> C++20.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 03 Jan 2025 04:00:12 -0600
obconf-qt (0.16.5-0ubuntu1) plucky; urgency=medium
* New upstream release.
- Bump build dependencies.
* Update VCS fields.
-- Simon Quigley <tsimonq2@ubuntu.com> Fri, 15 Nov 2024 15:33:25 -0600
obconf-qt (0.16.4-0ubuntu6) noble; urgency=high
* No change rebuild against libqt5core5t64, libqt5gui5t64,
libqt5widgets5t64.
-- Julian Andres Klode <juliank@ubuntu.com> Mon, 08 Apr 2024 16:46:32 +0200
obconf-qt (0.16.4-0ubuntu5) noble; urgency=medium
* No-change rebuild for CVE-2024-3094
-- Steve Langasek <steve.langasek@ubuntu.com> Sun, 31 Mar 2024 09:22:03 +0000
obconf-qt (0.16.4-0ubuntu4) noble; urgency=medium
* No-change rebuild against libqt5core5t64
-- Steve Langasek <steve.langasek@ubuntu.com> Fri, 15 Mar 2024 06:05:14 +0000
obconf-qt (0.16.4-0ubuntu3) noble; urgency=medium
* No-change rebuild against libglib2.0-0t64
-- Steve Langasek <steve.langasek@ubuntu.com> Mon, 11 Mar 2024 23:19:11 +0000
obconf-qt (0.16.4-0ubuntu2) noble; urgency=medium
* No-change rebuild against libglib2.0-0t64
-- Steve Langasek <steve.langasek@ubuntu.com> Fri, 08 Mar 2024 06:23:29 +0000
obconf-qt (0.16.4-0ubuntu1) noble; urgency=medium
* New upstream release.
* Updated copyright file.
* Bumped build dependency versions.
-- Aaron Rainbolt <arraybolt3@ubuntu.com> Thu, 18 Jan 2024 16:41:20 +0000
obconf-qt (0.16.3-0ubuntu1) noble; urgency=medium
* New upstream release.
* Overhauled copyright file.
-- Aaron Rainbolt <arraybolt3@gmail.com> Wed, 08 Nov 2023 17:35:38 -0600
obconf-qt (0.16.2-2ubuntu2) lunar; urgency=medium
* Revert sync from Debian.
* Overhauled copyright file.
* Bumped Standards-Version to 4.6.2, no changes necessary.
* Added 'Rules-Requires-Root: no' to debian/control.
* Changed binary-without-manpage to no-manual-page in lintian-overrides.
* Updated debian/watch file to work with GitHub again.
* Removed Repository-Browser field from debian/upstream/metadata.
* Removed trailing whitespace from changelog.
* Removed obsolete '-Wl,--as-needed' linker flag.
-- Aaron Rainbolt <arraybolt3@ubuntu.com> Sun, 12 Feb 2023 17:30:26 -0600
obconf-qt (0.16.2-0ubuntu1) kinetic; urgency=medium
* New upstream release.
* Bump build dependencies.
* Drop old Breaks/Replaces, we're past the LTS.
-- Simon Quigley <tsimonq2@ubuntu.com> Thu, 02 Jun 2022 10:06:15 -0500
obconf-qt (0.16.0-1ubuntu1) hirsute; urgency=medium
* New upstream version.
* Updated debhelper-compat requirement to 12.
-- Raman Sarda <theloudspeaker@ubuntu.com> Sun, 21 Feb 2021 19:24:37 +0530
obconf-qt (0.16.0-1) unstable; urgency=medium
[ Alf Gaida ]
* Switched to gbp
* Bumped Standards-Version to 4.4.0, no changes needed
[ Debian Janitor ]
* debian/copyright: use spaces rather than tabs to start continuation lines.
* Set upstream metadata fields: Repository, Repository-Browse.
* Remove obsolete field Name from debian/upstream/metadata (already present in
machine-readable debian/copyright).
* Update standards version to 4.5.0, no changes needed.
[ Andrew Lee (李健秋) ]
* New upstream release. (Closes: #978168)
-- Andrew Lee (李健秋) <ajqlee@debian.org> Thu, 07 Jan 2021 20:01:08 +0800
obconf-qt (0.15.0-0ubuntu1) groovy; urgency=medium
* New upstream release.
- Update upstream signing key.
- Update LXQt build dependencies.
* Update Standards-version to 4.5.0, no changes needed.
* Run wrap-and-sort.
-- Simon Quigley <tsimonq2@ubuntu.com> Thu, 04 Jun 2020 14:38:45 -0500
obconf-qt (0.14.1-1ubuntu1) disco; urgency=medium
* Lubuntuify the package.
-- Simon Quigley <tsimonq2@ubuntu.com> Sat, 09 Mar 2019 09:56:22 -0600
obconf-qt (0.14.1-1) unstable; urgency=medium
* Cherry-picked upstream release 0.14.1.
-- Alf Gaida <agaida@siduction.org> Tue, 26 Feb 2019 00:38:38 +0100
obconf-qt (0.14.0-1) unstable; urgency=medium
* Cherry-picked upstream release 0.14.0.
* Bumped Standards to 4.3.0, no changes needed
* Dropped d/compat, use debhelper-compat = 12, no changes needed
* Fixed years in d/copyright
* Bumped minimum version lxqt-build-tools (>= 0.6.0~)
* Removed obsolete PULL_TRANSLATIONS= OFF from dh_auto_configure
* Added l10n-package, moved from lxqt-l10n
* Added d/upstream/metadata
-- Alf Gaida <agaida@siduction.org> Sun, 27 Jan 2019 15:13:23 +0100
obconf-qt (0.13.0-1) unstable; urgency=medium
* Cherry-picked upstream release 0.13.0.
* Bump lxqt-build-tools to >= 0.5.0~
* Fixed watch file lxde -> lxqt
-- Alf Gaida <agaida@siduction.org> Wed, 23 May 2018 20:16:01 +0200
obconf-qt (0.12.0-4) unstable; urgency=medium
* Bumped compat to 11
* Bumped debhelper to >= 11~
* Bumped Standards to 4.1.4, no changes needed
* Changed VCS fields for salsa
* Changed Homepage, Source and watch to lxqt
* Bumped years in copyright
* Removed trailing whitespaces in changelog
-- Alf Gaida <agaida@siduction.org> Sat, 28 Apr 2018 17:07:46 +0200
obconf-qt (0.12.0-3) unstable; urgency=medium
* Bumped Standards to 4.1.2, no changes needed
* Removed branch from VCS fields
* Removed debian/gbp.conf
-- Alf Gaida <agaida@siduction.org> Thu, 14 Dec 2017 23:44:22 +0100
obconf-qt (0.12.0-2) unstable; urgency=medium
* Transition to unstable
* Bumped Standards to 4.1.1 - no changes needed
-- Alf Gaida <agaida@siduction.org> Mon, 04 Dec 2017 19:39:19 +0100
obconf-qt (0.12.0-1) experimental; urgency=medium
* Cherry-picking upstream release 0.12.0.
* Switched to experimental
* Bumped minimum version of lxqt-build-tools to >= 0.4.0
* Bumped Standards to 4.1.0, no changes needed
-- Alf Gaida <agaida@siduction.org> Sun, 24 Sep 2017 12:56:19 +0200
obconf-qt (0.11.1-2) unstable; urgency=medium
* Removed build dependency liblxqt0-dev - only translations

1
debian/compat vendored
View File

@ -1 +0,0 @@
10

40
debian/control vendored
View File

@ -1,28 +1,36 @@
Source: obconf-qt
Maintainer: LXQt Packaging Team <pkg-lxqt-devel@lists.alioth.debian.org>
Uploaders: Alf Gaida <agaida@siduction.org>,
ChangZhuo Chen (陳昌倬) <czchen@debian.org>,
Andrew Lee (李健秋) <ajqlee@debian.org>
Maintainer: Lubuntu Developers <lubuntu-devel@lists.ubuntu.com>
Original-Maintainer: LXQt Packaging Team <pkg-lxqt-devel@lists.alioth.debian.org>
Uploaders: Simon Quigley <tsimonq2@ubuntu.com>
Section: utils
Priority: optional
Build-Depends: debhelper (>= 10),
libkf5windowsystem-dev,
libqt5svg5-dev,
libqt5x11extras5-dev,
lxqt-build-tools (>= 0.3.0),
Build-Depends: debhelper-compat (= 13),
libkf6windowsystem-dev,
lxqt-build-tools (>= 2.1.0),
openbox-dev
Standards-Version: 3.9.8
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/obconf-qt.git/?h=debian/sid
Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/obconf-qt.git -b debian/sid
Homepage: https://github.com/lxde/obconf-qt
Standards-Version: 4.7.1
Vcs-Browser: https://git.lubuntu.me/Lubuntu/obconf-qt-packaging
Vcs-Git: https://git.lubuntu.me/Lubuntu/obconf-qt-packaging.git
Debian-Vcs-Browser: https://salsa.debian.org/lxqt-team/obconf-qt
Debian-Vcs-Git: https://salsa.debian.org/lxqt-team/obconf-qt.git
Homepage: https://github.com/lxqt/obconf-qt
Rules-Requires-Root: no
Package: obconf-qt
Architecture: any
Depends: ${misc:Depends},
${shlibs:Depends},
openbox
Depends: openbox, ${misc:Depends}, ${shlibs:Depends}
Recommends: obconf-qt-l10n
Description: Openbox configuration with a Qt interface
obconf-qt is an utility to configure openbox with a Qt interface.
.
This package contain the application files.
Package: obconf-qt-l10n
Architecture: all
Multi-Arch: foreign
Section: localization
Depends: qt6-translations-l10n, ${misc:Depends}
Description: Language package for obconf-qt
obconf-qt is an utility to configure openbox with a Qt interface.
.
This package contains the l10n files needed by the obconf-qt.

44
debian/copyright vendored
View File

@ -1,16 +1,54 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: obconf-qt
Source: https://github.com/lxde/obconf-qt
Source: https://github.com/lxqt/obconf-qt
Files: *
Copyright: 2012-2016 LXQt team
Copyright: 2012-2024 LXQt team
License: GPL-2.0
Files: src/appearance.cpp
src/desktops.cpp
src/dock.cpp
src/fontbutton.cpp
src/fontbutton.h
src/maindialog.cpp
src/maindialog.h
src/margins.cpp
src/mouse.cpp
src/moveresize.cpp
src/obconf-qt.cpp
src/obconf-qt.h
src/preview.c
src/preview.h
src/theme.cpp
src/tree.cpp
src/tree.h
src/windows.cpp
Copyright: 2003 Tim Riley
2007 Javeed Shaikh
2003-2008 Dana Jansens
2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
License: GPL-2.0+
Files: debian/*
Copyright: 2013-2016 Alf Gaida <agaida@siduction.org>
Copyright: 2013-2018 Alf Gaida <agaida@siduction.org>
2015 Andrew Lee (李健秋) <ajqlee@debian.org>
2023-2025 Lubuntu Developers <lubuntu-devel@lists.ubuntu.com>
License: GPL-2.0+
License: GPL-2.0
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; version 2 of the License.
.
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.
.
On Debian systems, the complete text of the GNU General Public License
version 2 can be found in "/usr/share/common-licenses/GPL-2".
License: GPL-2.0+
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

4
debian/gbp.conf vendored
View File

@ -2,7 +2,5 @@
debian-branch = debian/sid
upstream-branch = upstream/latest
pristine-tar = True
compression = xz
[import-orig]
# Use git cherrypick -n upstream instead.
merge = False

View File

@ -1,2 +1,2 @@
# there will be no manpage in a foreseable future
obconf-qt: binary-without-manpage usr/bin/obconf-qt
obconf-qt: no-manual-page [usr/bin/obconf-qt]

1
debian/obconf-qt-l10n.install vendored Normal file
View File

@ -0,0 +1 @@
usr/share/obconf-qt/translations/

3
debian/obconf-qt.install vendored Normal file
View File

@ -0,0 +1,3 @@
usr/bin/obconf-qt
usr/share/applications/obconf-qt.desktop
usr/share/icons/hicolor/48x48/apps/obconf-qt.png

3
debian/obconf-qt.lintian-overrides vendored Normal file
View File

@ -0,0 +1,3 @@
# This is expected
obconf-qt: desktop-entry-lacks-keywords-entry [usr/share/applications/*.desktop]
obconf-qt: no-manual-page [usr/bin/*]

5
debian/rules vendored
View File

@ -3,13 +3,14 @@
export LC_ALL=C.UTF-8
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh ${@} --buildsystem cmake
override_dh_missing:
dh_missing --fail-missing
override_dh_auto_configure:
dh_auto_configure -- \
-DPULL_TRANSLATIONS=OFF\
-DUPDATE_TRANSLATIONS=OFF\
-DCMAKE_BUILD_TYPE=RelWithDebInfo

5
debian/upstream/metadata vendored Normal file
View File

@ -0,0 +1,5 @@
Bug-Database: https://github.com/lxqt/obconf-qt/issues
Bug-Submit: https://github.com/lxqt/obconf-qt/issues/new
Changelog: https://github.com/lxqt/obconf-qt/blob/master/CHANGELOG
Repository: https://github.com/lxqt/obconf-qt.git
Repository-Browse: https://github.com/lxqt/obconf-qt

View File

@ -1,50 +1,52 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
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
=h7ww
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
sw==
=gSIv
-----END PGP PUBLIC KEY BLOCK-----

6
debian/watch vendored
View File

@ -1,3 +1,5 @@
version=4
opts="pgpsigurlmangle=s/$/.asc/" \
https://github.com/lxde/obconf-qt/releases .*/obconf-qt-([\d\.]+).tar.xz
opts="searchmode=plain, \
pgpsigurlmangle=s/$/.asc/, \
uversionmangle=s/(\d+\.\d+\.\d+).*/$1/" \
https://api.github.com/repos/lxqt/@PACKAGE@/releases https:\/\/github.com\/lxqt\/@PACKAGE@\/releases\/download\/@ANY_VERSION@\/@PACKAGE@-@ANY_VERSION@.tar.xz

View File

@ -1,109 +0,0 @@
# set visibility to hidden to hide symbols, unlesss they're exporeted manually in the code
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_KEYWORDS")
if(USE_QT4)
set(QTX_INCLUDE_DIRS ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTDBUS_DIR})
set(QTX_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTDBUS_LIBRARY})
else()
set(QTX_INCLUDE_DIRS "")
set(QTX_LIBRARIES Qt5::Widgets Qt5::X11Extras)
endif()
include_directories(
${QTX_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${OPENBOX_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
)
set(obconf-qt_SRCS
obconf-qt.cpp
maindialog.cpp
appearance.cpp
windows.cpp
mouse.cpp
moveresize.cpp
margins.cpp
desktops.cpp
dock.cpp
tree.cpp
archive.cpp
theme.cpp
fontbutton.cpp
)
set(obconf-qt_UIS
obconf.ui
)
if(USE_QT4)
qt4_wrap_ui(obconf-qt_UI_H ${obconf-qt_UIS})
else()
qt5_wrap_ui(obconf-qt_UI_H ${obconf-qt_UIS})
endif()
# The ui code generated by Qt uic contains QMetaObject::connectSlotsByName()
# but we don't want that. Fix it with sed.
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ui_obconf_fixed.h
COMMAND ${SED_PROGRAM}
ARGS "/connectSlotsByName/d" ${obconf-qt_UI_H} > ${CMAKE_CURRENT_BINARY_DIR}/ui_obconf_fixed.h
# DEPENDS
MAIN_DEPENDENCY ${obconf-qt_UI_H}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Fixing generated ui code"
VERBATIM
)
# add translation for obconf-qt
option (UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
lxqt_translate_ts(QM_FILES
USE_QT4
${USE_QT4}
UPDATE_TRANSLATIONS
${UPDATE_TRANSLATIONS}
SOURCES
${obconf-qt_SRCS}
${obconf-qt_UI_H}
INSTALL_DIR
"${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/translations"
PULL_TRANSLATIONS
${PULL_TRANSLATIONS}
CLEAN_TRANSLATIONS
${CLEAN_TRANSLATIONS}
TRANSLATIONS_REPO
${TRANSLATIONS_REPO}
TRANSLATIONS_REFSPEC
${TRANSLATIONS_REFSPEC}
)
# install a desktop entry file
lxqt_translate_desktop(DESKTOP_FILES
TRANSLATION_DIR "translations"
SOURCES obconf-qt.desktop.in
)
install(FILES ${DESKTOP_FILES} DESTINATION share/applications)
# prevent the generated files from being deleted during make clean
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM true)
add_executable(obconf-qt
${obconf-qt_SRCS}
${obconf-qt_UI_H}
${QM_FILES}
${DESKTOP_FILES}
)
add_definitions(
-DPACKAGE_DATA_DIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}/obconf-qt"
-DPIXMAPS_DIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}/pixmaps"
-DTHEME_DIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}/openbox/themes"
)
target_link_libraries(obconf-qt
${QTX_LIBRARIES}
${GLIB_LIBRARIES}
${OPENBOX_LIBRARIES}
)
install(TARGETS obconf-qt RUNTIME DESTINATION bin)

View File

@ -1,235 +0,0 @@
/*
Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
Part of the code in this file is taken from obconf:
Copyright (c) 2003-2007 Dana Jansens
Copyright (c) 2003 Tim Riley
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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "maindialog.h"
#include <obrender/render.h>
#include "tree.h"
#include <string.h>
using namespace Obconf;
extern RrInstance* rrinst; // defined in obconf-qt.cpp
static RrFont* read_font(Fm::FontButton* button, const gchar* place, gboolean def);
static RrFont* write_font(Fm::FontButton* button, const gchar* place);
void MainDialog::appearance_setup_tab() {
gchar* layout;
RrFont* f;
ui.window_border->setChecked(tree_get_bool("theme/keepBorder", TRUE));
ui.animate_iconify->setChecked(tree_get_bool("theme/animateIconify", TRUE));
layout = tree_get_string("theme/titleLayout", "NLIMC");
ui.title_layout->setText(layout);
// preview_update_set_title_layout(layout); // FIXME
g_free(layout);
f = read_font(ui.font_active, "ActiveWindow", TRUE);
// FIXME preview_update_set_active_font(f);
f = read_font(ui.font_inactive, "InactiveWindow", TRUE);
// FIXME preview_update_set_inactive_font(f);
f = read_font(ui.font_menu_header, "MenuHeader", TRUE);
// FIXME preview_update_set_menu_header_font(f);
f = read_font(ui.font_menu_item, "MenuItem", TRUE);
// FIXME preview_update_set_menu_item_font(f);
if(!(f = read_font(ui.font_active_display, "ActiveOnScreenDisplay", FALSE))) {
f = read_font(ui.font_active_display, "OnScreenDisplay", TRUE);
tree_delete_node("theme/font:place=OnScreenDisplay");
}
// FIXME preview_update_set_osd_active_font(f);
f = read_font(ui.font_inactive_display, "InactiveOnScreenDisplay", TRUE);
// FIXME preview_update_set_osd_inactive_font(f);
}
void MainDialog::on_window_border_toggled(bool checked) {
tree_set_bool("theme/keepBorder", checked);
}
void MainDialog::on_animate_iconify_toggled(bool checked) {
tree_set_bool("theme/animateIconify", checked);
}
void MainDialog::on_title_layout_textChanged(const QString& text) {
QByteArray layout;
// omit unknown chars
for(int i = 0; i < text.length(); ++i) {
char ch = text.at(i).toUpper().toLatin1();
if(strchr("NDSLIMC", ch))
layout += ch;
}
tree_set_string("theme/titleLayout", layout.constData());
// FIXME preview_update_set_title_layout(layout);
}
void MainDialog::on_font_active_changed() {
write_font(ui.font_active, "ActiveWindow");
// FIXME preview_update_set_active_font(write_font(w, "ActiveWindow"));
}
void MainDialog::on_font_inactive_changed() {
write_font(ui.font_inactive, "InactiveWindow");
// FIXME preview_update_set_inactive_font(write_font(w, "InactiveWindow"));
}
void MainDialog::on_font_menu_header_changed() {
write_font(ui.font_menu_header, "MenuHeader");
// FIXME preview_update_set_menu_header_font(write_font(w, "MenuHeader"));
}
void MainDialog::on_font_menu_item_changed() {
write_font(ui.font_menu_item, "MenuItem");
// FIXME preview_update_set_menu_item_font(write_font(w, "MenuItem"));
}
void MainDialog::on_font_active_display_changed() {
write_font(ui.font_active_display, "ActiveOnScreenDisplay");
// FIXME preview_update_set_osd_active_font(write_font(w, "ActiveOnScreenDisplay"));
}
void MainDialog::on_font_inactive_display_changed() {
write_font(ui.font_inactive_display, "InactiveOnScreenDisplay");
// FIXME preview_update_set_osd_inactive_font
// FIXME (write_font(w, "InactiveOnScreenDisplay"));
}
static RrFont* read_font(Fm::FontButton* button, const gchar* place,
gboolean use_default) {
RrFont* font;
gchar* fontstring, *node;
gchar* name, **names;
gchar* size;
gchar* weight;
gchar* slant;
RrFontWeight rr_weight = RR_FONTWEIGHT_NORMAL;
RrFontSlant rr_slant = RR_FONTSLANT_NORMAL;
node = g_strdup_printf("theme/font:place=%s/name", place);
name = tree_get_string(node, use_default ? "Sans" : NULL);
g_free(node);
if(name[0] == '\0') {
g_free(name);
return NULL;
}
node = g_strdup_printf("theme/font:place=%s/size", place);
size = tree_get_string(node, "8");
g_free(node);
node = g_strdup_printf("theme/font:place=%s/weight", place);
weight = tree_get_string(node, "");
g_free(node);
node = g_strdup_printf("theme/font:place=%s/slant", place);
slant = tree_get_string(node, "");
g_free(node);
/* get only the first font in the string */
names = g_strsplit(name, ",", 0);
g_free(name);
name = g_strdup(names[0]);
g_strfreev(names);
/* don't use "normal" in the gtk string */
if(!g_ascii_strcasecmp(weight, "normal")) {
g_free(weight); weight = g_strdup("");
}
if(!g_ascii_strcasecmp(slant, "normal")) {
g_free(slant); slant = g_strdup("");
}
QFont qfont;
qfont.setFamily(name);
// FIXME qfont.setWeight(weight);
qfont.setPointSize(atoi(size));
button->setFont(qfont);
if(!g_ascii_strcasecmp(weight, "Bold")) rr_weight = RR_FONTWEIGHT_BOLD;
if(!g_ascii_strcasecmp(slant, "Italic")) rr_slant = RR_FONTSLANT_ITALIC;
if(!g_ascii_strcasecmp(slant, "Oblique")) rr_slant = RR_FONTSLANT_OBLIQUE;
font = RrFontOpen(rrinst, name, atoi(size), rr_weight, rr_slant);
// g_free(fontstring);
g_free(slant);
g_free(weight);
g_free(size);
g_free(name);
return font;
}
static RrFont* write_font(Fm::FontButton* button, const gchar* place) {
gchar *c;
gchar *node;
RrFontWeight weight = RR_FONTWEIGHT_NORMAL;
RrFontSlant slant = RR_FONTSLANT_NORMAL;
QFont qfont = button->font();
if(qfont.bold())
weight = RR_FONTWEIGHT_BOLD;
QString size = QString("%1").arg(qfont.pointSize());
const char* slantStr = NULL;
switch(qfont.style()) {
case QFont::StyleItalic:
slant = RR_FONTSLANT_ITALIC;
slantStr = "Italic";
break;
case QFont::StyleOblique:
slant = RR_FONTSLANT_OBLIQUE;
slantStr = "Oblique";
break;
default:
slantStr = "Normal";
}
node = g_strdup_printf("theme/font:place=%s/name", place);
tree_set_string(node, qfont.family().toUtf8().constData());
g_free(node);
node = g_strdup_printf("theme/font:place=%s/size", place);
tree_set_string(node, size.toLatin1().constData());
g_free(node);
node = g_strdup_printf("theme/font:place=%s/weight", place);
tree_set_string(node, qfont.bold() ? "Bold" : "Normal");
g_free(node);
node = g_strdup_printf("theme/font:place=%s/slant", place);
tree_set_string(node, slantStr);
g_free(node);
return RrFontOpen(rrinst, qfont.family().toUtf8().constData(), qfont.pointSize(), weight, slant);
}

View File

@ -1,216 +0,0 @@
#include <QMessageBox>
#include <glib.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
static gchar *get_theme_dir();
static gboolean change_dir(const gchar *dir);
static gchar* name_from_dir(const gchar *dir);
static gchar* install_theme_to(const gchar *file, const gchar *to);
static gboolean create_theme_archive(const gchar *dir, const gchar *name,
const gchar *to);
gchar* archive_install(const gchar *path)
{
gchar *dest;
gchar *name;
if (!(dest = get_theme_dir()))
return NULL;
if ((name = install_theme_to(path, dest))) {
QMessageBox::information(NULL, QString(), QObject::tr("\"%1\" was installed to %1")
.arg(QString::fromUtf8(name))
.arg(QString::fromUtf8(dest)));
}
g_free(dest);
return name;
}
void archive_create(const gchar *path)
{
gchar *name;
gchar *dest;
if (!(name = name_from_dir(path)))
return;
{
gchar *file;
file = g_strdup_printf("%s.obt", name);
dest = g_build_path(G_DIR_SEPARATOR_S,
g_get_current_dir(), file, NULL);
g_free(file);
}
if (create_theme_archive(path, name, dest))
QMessageBox::information(NULL, QString(), QObject::tr("\"%1\" was successfully created")
.arg(QString::fromUtf8(dest)));
g_free(dest);
g_free(name);
}
static gboolean create_theme_archive(const gchar *dir, const gchar *name,
const gchar *to)
{
gchar *glob;
gchar **argv;
gchar *errtxt = NULL;
gchar *parentdir;
gint exitcode;
GError *e = NULL;
glob = g_strdup_printf("%s/openbox-3/", name);
parentdir = g_build_path(G_DIR_SEPARATOR_S, dir, "..", NULL);
argv = g_new(gchar*, 9);
argv[0] = g_strdup("tar");
argv[1] = g_strdup("-c");
argv[2] = g_strdup("-z");
argv[3] = g_strdup("-f");
argv[4] = g_strdup(to);
argv[5] = g_strdup("-C");
argv[6] = g_strdup(parentdir);
argv[7] = g_strdup(glob);
argv[8] = NULL;
if (g_spawn_sync(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL,
NULL, &errtxt, &exitcode, &e))
{
if (exitcode != EXIT_SUCCESS)
QMessageBox::critical(NULL, QString(),
QObject::tr("Unable to create the theme archive \"%1\".\nThe following errors were reported:\n%2")
.arg(QString::fromUtf8(to))
.arg(QString::fromUtf8(errtxt)));
}
else
QMessageBox::critical(NULL, QString(),QObject::tr("Unable to run the \"tar\" command: %1")
.arg(QString::fromUtf8(e->message)));
g_strfreev(argv);
if (e) g_error_free(e);
g_free(errtxt);
g_free(parentdir);
g_free(glob);
return exitcode == EXIT_SUCCESS;
}
static gchar *get_theme_dir()
{
gchar *dir;
gint r;
dir = g_build_path(G_DIR_SEPARATOR_S, g_get_home_dir(), ".themes", NULL);
r = mkdir(dir, 0777);
if (r == -1 && errno != EEXIST) {
QMessageBox::critical(NULL, QString(),
QObject::tr("Unable to create directory \"%1\": %2")
.arg(QString::fromUtf8(dir))
.arg(QString::fromUtf8(strerror(errno))));
g_free(dir);
dir = NULL;
}
return dir;
}
static gchar* name_from_dir(const gchar *dir)
{
gchar *rc;
struct stat st;
gboolean r;
rc = g_build_path(G_DIR_SEPARATOR_S, dir, "openbox-3", "themerc", NULL);
r = (stat(rc, &st) == 0 && S_ISREG(st.st_mode));
g_free(rc);
if (!r) {
QMessageBox::critical(NULL, QString(),
QObject::tr("\"%1\" does not appear to be a valid Openbox theme directory")
.arg(QString::fromUtf8(dir)));
return NULL;
}
return g_path_get_basename(dir);
}
static gboolean change_dir(const gchar *dir)
{
if (chdir(dir) == -1) {
QMessageBox::critical(NULL, QString(), QObject::tr("Unable to move to directory \"%1\": %2")
.arg(QString::fromUtf8(dir))
.arg(QString::fromUtf8(strerror(errno))));
return FALSE;
}
return TRUE;
}
static gchar* install_theme_to(const gchar *file, const gchar *to)
{
gchar **argv;
gchar *errtxt = NULL, *outtxt = NULL;
gint exitcode;
GError *e = NULL;
gchar *name = NULL;
argv = g_new(gchar*, 11);
argv[0] = g_strdup("tar");
argv[1] = g_strdup("-x");
argv[2] = g_strdup("-v");
argv[3] = g_strdup("-z");
argv[4] = g_strdup("--wildcards");
argv[5] = g_strdup("-f");
argv[6] = g_strdup(file);
argv[7] = g_strdup("-C");
argv[8] = g_strdup(to);
argv[9] = g_strdup("*/openbox-3/");
argv[10] = NULL;
if (!g_spawn_sync(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL,
&outtxt, &errtxt, &exitcode, &e))
QMessageBox::critical(NULL, QString(), QObject::tr("Unable to run the \"tar\" command: %1")
.arg(QString::fromUtf8(e->message)));
g_strfreev(argv);
if (e) g_error_free(e);
if (exitcode != EXIT_SUCCESS)
QMessageBox::critical(NULL, QString(),
QObject::tr("Unable to extract the file \"%1\".\nPlease ensure that \"%2\" is writable and that the file is a valid Openbox theme archive.\nThe following errors were reported:\n%3")
.arg(QString::fromUtf8(file))
.arg(QString::fromUtf8(to))
.arg(QString::fromUtf8(errtxt)));
if (exitcode == EXIT_SUCCESS) {
gchar **lines = g_strsplit(outtxt, "\n", 0);
gchar **it;
for (it = lines; *it; ++it) {
gchar *l = *it;
gboolean found = FALSE;
while (*l && !found) {
if (!strcmp(l, "/openbox-3/")) {
*l = '\0'; /* cut the string */
found = TRUE;
}
++l;
}
if (found) {
name = g_strdup(*it);
break;
}
}
g_strfreev(lines);
}
g_free(outtxt);
g_free(errtxt);
return name;
}

View File

@ -1,9 +0,0 @@
#ifndef __install_h
#define __install_h
#include <glib.h>
gchar* archive_install (const gchar *path);
void archive_create (const gchar *path);
#endif

View File

@ -1,163 +0,0 @@
/*
Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
Part of the code in this file is taken from obconf:
Copyright (c) 2003-2007 Dana Jansens
Copyright (c) 2003 Tim Riley
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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "maindialog.h"
#include <obrender/render.h>
#include "tree.h"
#include <QX11Info>
#include <X11/Xlib.h>
using namespace Obconf;
extern RrInstance* rrinst; // defined in obconf-qt.cpp
static int num_desktops;
static void desktops_read_names();
static void desktops_write_names();
static void desktops_write_number();
static void enable_stuff();
void MainDialog::desktops_setup_tab() {
num_desktops = tree_get_int("desktops/number", 4);
ui.desktop_num->setValue(num_desktops);
gint i;
desktops_read_names();
i = tree_get_int("desktops/popupTime", 875);
ui.desktop_popup->setChecked(i != 0);
ui.desktop_popup_time->setValue(i ? i : 875);
}
void MainDialog::on_desktop_num_valueChanged(int newValue) {
num_desktops = newValue;
desktops_write_number();
desktops_read_names();
}
void MainDialog::on_desktop_names_itemChanged(QListWidgetItem * item) {
QString new_text = item->text();
if(new_text.isEmpty())
item->setText(tr("(Unnamed desktop)"));
desktops_write_names();
}
void MainDialog::desktops_read_names() {
xmlNodePtr n;
gint i;
ui.desktop_names->clear();
i = 0;
n = tree_get_node("desktops/names", NULL)->children;
while(n) {
gchar* name;
if(!xmlStrcmp(n->name, (const xmlChar*)"name")) {
name = obt_xml_node_string(n);
QString desktop_name = QString::fromUtf8(name);
if(desktop_name.isEmpty())
desktop_name = tr("(Unnamed desktop)");
QListWidgetItem* item = new QListWidgetItem(desktop_name);
item->setFlags(item->flags() | Qt::ItemIsEditable);
ui.desktop_names->addItem(item);
++i;
}
n = n->next;
}
while(i < num_desktops) {
QListWidgetItem* item = new QListWidgetItem(tr("(Unnamed desktop)"));
item->setFlags(item->flags() | Qt::ItemIsEditable);
ui.desktop_names->addItem(item);
++i;
}
}
void MainDialog::desktops_write_names() {
gchar** s;
xmlNodePtr n, c;
gint num = 0, last = -1;
// delete all existing keys
n = tree_get_node("desktops/names", NULL);
while((c = n->children)) {
xmlUnlinkNode(c);
xmlFreeNode(c);
}
int i;
for(i = 0; i < ui.desktop_names->count(); ++i) {
QListWidgetItem* item = ui.desktop_names->item(i);
QString text = item->text();
xmlNewTextChild(n, NULL, (xmlChar*)"name", (xmlChar*)text.toUtf8().constData());
}
tree_apply();
/* make openbox re-set the property */
XDeleteProperty(QX11Info::display(), QX11Info::appRootWindow(),
XInternAtom(QX11Info::display(), "_NET_DESKTOP_NAMES", False));
}
void MainDialog::desktops_write_number() {
XEvent ce;
tree_set_int("desktops/number", num_desktops);
ce.xclient.type = ClientMessage;
ce.xclient.message_type =
XInternAtom(QX11Info::display(), "_NET_NUMBER_OF_DESKTOPS", False);
ce.xclient.display = QX11Info::display();
ce.xclient.window = QX11Info::appRootWindow();
ce.xclient.format = 32;
ce.xclient.data.l[0] = num_desktops;
ce.xclient.data.l[1] = 0;
ce.xclient.data.l[2] = 0;
ce.xclient.data.l[3] = 0;
ce.xclient.data.l[4] = 0;
XSendEvent(QX11Info::display(), QX11Info::appRootWindow(), FALSE,
SubstructureNotifyMask | SubstructureRedirectMask,
&ce);
}
void MainDialog::on_desktop_popup_toggled(bool checked) {
if(checked) {
tree_set_int("desktops/popupTime", ui.desktop_popup_time->value());
}
else
tree_set_int("desktops/popupTime", 0);
}
void MainDialog::on_desktop_popup_time_valueChanged(int newValue) {
tree_set_int("desktops/popupTime", newValue);
}

View File

@ -1,191 +0,0 @@
/*
Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
Part of the code in this file is taken from obconf:
Copyright (c) 2003-2007 Dana Jansens
Copyright (c) 2003 Tim Riley
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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "maindialog.h"
#include <obrender/render.h>
#include "tree.h"
#include <QX11Info>
// FIXME: how to support XCB or Wayland?
#include <X11/Xlib.h>
using namespace Obconf;
extern RrInstance* rrinst; // defined in obconf-qt.cpp
#define POSITION_TOPLEFT 0
#define POSITION_TOP 1
#define POSITION_TOPRIGHT 2
#define POSITION_LEFT 3
#define POSITION_RIGHT 4
#define POSITION_BOTTOMLEFT 5
#define POSITION_BOTTOM 6
#define POSITION_BOTTOMRIGHT 7
#define POSITION_FLOATING 8
#define DIRECTION_VERTICAL 0
#define DIRECTION_HORIZONTAL 1
static void dock_enable_stuff();
void MainDialog::dock_setup_tab() {
gchar* s;
gint pos;
s = tree_get_string("dock/position", "TopLeft");
if(!strcasecmp(s, "Top")) pos = POSITION_TOP;
else if(!strcasecmp(s, "TopRight")) pos = POSITION_TOPRIGHT;
else if(!strcasecmp(s, "Left")) pos = POSITION_LEFT;
else if(!strcasecmp(s, "Right")) pos = POSITION_RIGHT;
else if(!strcasecmp(s, "BottomLeft")) pos = POSITION_BOTTOMLEFT;
else if(!strcasecmp(s, "Bottom")) pos = POSITION_BOTTOM;
else if(!strcasecmp(s, "BottomRight")) pos = POSITION_BOTTOMRIGHT;
else if(!strcasecmp(s, "Floating")) pos = POSITION_FLOATING;
else pos = POSITION_TOPLEFT;
g_free(s);
ui.dock_position->setCurrentIndex(pos);
bool is_floating = (pos == POSITION_FLOATING);
ui.dock_float_x->setEnabled(is_floating);
ui.dock_float_y->setEnabled(is_floating);
ui.dock_float_x->setValue(tree_get_int("dock/floatingX", 0));
ui.dock_float_y->setValue(tree_get_int("dock/floatingY", 0));
s = tree_get_string("dock/stacking", "Above");
if(!strcasecmp(s, "Normal"))
ui.dock_stack_normal->setChecked(true);
else if(!strcasecmp(s, "Below"))
ui.dock_stack_bottom->setChecked(true);
else
ui.dock_stack_top->setChecked(true);
g_free(s);
s = tree_get_string("dock/direction", "Vertical");
if(!strcasecmp(s, "Horizontal")) pos = DIRECTION_HORIZONTAL;
else pos = DIRECTION_VERTICAL;
g_free(s);
ui.dock_direction->setCurrentIndex(pos);
ui.dock_nostrut->setChecked(tree_get_bool("dock/noStrut", FALSE));
bool auto_hide = tree_get_bool("dock/autoHide", FALSE);
ui.dock_hide->setChecked(auto_hide);
ui.dock_hide_delay->setEnabled(auto_hide);
ui.dock_hide_delay->setValue(tree_get_int("dock/hideDelay", 300));
ui.dock_show_delay->setEnabled(auto_hide);
ui.dock_show_delay->setValue(tree_get_int("dock/showDelay", 300));
}
void MainDialog::on_dock_position_currentIndexChanged(int index) {
const char* val;
bool is_floating = false;
switch(index) {
case POSITION_TOPLEFT:
default:
val = "TopLeft";
break;
case POSITION_TOP:
val = "Top";
break;
case POSITION_TOPRIGHT:
val = "TopRight";
break;
case POSITION_LEFT:
val = "Left";
break;
case POSITION_RIGHT:
val = "Right";
break;
case POSITION_BOTTOMLEFT:
val = "BottomLeft";
break;
case POSITION_BOTTOM:
val = "Bottom";
break;
case POSITION_BOTTOMRIGHT:
val = "BottomRight";
break;
case POSITION_FLOATING:
val = "Floating";
is_floating = true;
break;
}
tree_set_string("dock/position", val);
ui.dock_float_x->setEnabled(is_floating);
ui.dock_float_y->setEnabled(is_floating);
}
void MainDialog::on_dock_float_x_valueChanged(int newValue) {
tree_set_int("dock/floatingX", newValue);
}
void MainDialog::on_dock_float_y_valueChanged(int newValue) {
tree_set_int("dock/floatingY", newValue);
}
void MainDialog::on_dock_stack_top_toggled(bool checked) {
if(checked)
tree_set_string("dock/stacking", "Above");
}
void MainDialog::on_dock_stack_normal_toggled(bool checked) {
if(checked)
tree_set_string("dock/stacking", "Normal");
}
void MainDialog::on_dock_stack_bottom_toggled(bool checked) {
if(checked)
tree_set_string("dock/stacking", "Below");
}
void MainDialog::on_dock_direction_currentIndexChanged(int index) {
const char* val = (index == DIRECTION_VERTICAL ? "Vertical" : "Horizontal");
tree_set_string("dock/direction", val);
}
void MainDialog::on_dock_nostrut_toggled(bool checked) {
tree_set_bool("dock/noStrut", checked);
}
void MainDialog::on_dock_hide_toggled(bool checked) {
tree_set_bool("dock/autoHide", checked);
}
void MainDialog::on_dock_hide_delay_valueChanged(int newValue) {
tree_set_int("dock/hideDelay", newValue);
}
void MainDialog::on_dock_show_delay_valueChanged(int newValue) {
tree_set_int("dock/showDelay", newValue);
}

View File

@ -1,55 +0,0 @@
/*
Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "fontbutton.h"
#include <QFontDialog>
#include <X11/X.h>
using namespace Fm;
FontButton::FontButton(QWidget* parent): QPushButton(parent) {
connect(this, SIGNAL(clicked(bool)), SLOT(onClicked()));
}
FontButton::~FontButton() {
}
void FontButton::onClicked() {
QFontDialog dlg(font_);
if(dlg.exec() == QDialog::Accepted) {
setFont(dlg.selectedFont());
}
}
void FontButton::setFont(QFont font) {
font_ = font;
QString text = font.family();
if(font.bold()) {
text += " ";
text += tr("Bold");
}
if(font.italic()) {
text += " ";
text += tr("Italic");
}
text += QString(" %1").arg(font.pointSize());
setText(text);
Q_EMIT changed();
}

View File

@ -1,53 +0,0 @@
/*
Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef FM_FONTBUTTON_H
#define FM_FONTBUTTON_H
#include <QPushButton>
namespace Fm {
class FontButton : public QPushButton {
Q_OBJECT
public:
explicit FontButton(QWidget* parent = 0);
virtual ~FontButton();
QFont font() {
return font_;
}
void setFont(QFont font);
Q_SIGNALS:
void changed();
private Q_SLOTS:
void onClicked();
private:
QFont font_;
};
}
#endif // FM_FONTBUTTON_H

View File

@ -1,86 +0,0 @@
/*
Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
Part of the code in this file is taken from obconf:
Copyright (c) 2003-2007 Dana Jansens
Copyright (c) 2003 Tim Riley
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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "maindialog.h"
#include <QMessageBox>
#include <QStandardItemModel>
using namespace Obconf;
MainDialog::MainDialog():
themes(NULL),
themes_model(new QStandardItemModel()),
QDialog() {
ui.setupUi(this);
setWindowIcon(QIcon(PIXMAPS_DIR "/obconf-qt.png"));
// resize the list widget according to the width of its content.
ui.listWidget->setMaximumWidth(ui.listWidget->sizeHintForColumn(0) + ui.listWidget->frameWidth() * 2 + 2);
ui.theme_names->setModel(themes_model);
theme_setup_tab();
appearance_setup_tab();
windows_setup_tab();
mouse_setup_tab();
moveresize_setup_tab();
margins_setup_tab();
desktops_setup_tab();
dock_setup_tab();
// Normally, this is called in ui.setupUi(), but this is not desired behavior.
// So we edited the generated ui header file with "sed" and generated a fixed version.
// Then, we need to call it here.
QMetaObject::connectSlotsByName(this);
}
MainDialog::~MainDialog() {
if(themes) {
g_list_foreach(themes, (GFunc)g_free, NULL);
g_list_free(themes);
}
delete themes_model;
}
void MainDialog::accept() {
QDialog::accept();
}
void MainDialog::reject() {
/* restore to original settings */
QDialog::reject();
}
void MainDialog::on_about_clicked() {
QMessageBox::about(this, tr("About ObConf-Qt"),
tr("A preferences manager for Openbox\n\n"
"Copyright (c) 2014-2015\n\n"
"Authors:\n"
"* Hong Jen Yee (PCMan) <pcman.tw@gmail.com>\n\n"
"The program is based on ObConf developed by the following developers.\n"
"* Dana Jansens <danakj@orodu.net>\n"
"* Tim Riley <tr@slackzone.org>\n"
"* Javeed Shaikh <syscrash2k@gmail.com>")
);
}

View File

@ -1,167 +0,0 @@
/*
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 2013 <copyright holder> <email>
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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef OBCONF_MAINDIALOG_H
#define OBCONF_MAINDIALOG_H
#include <QDialog>
#include <glib.h>
// We include a fixed version rather than the originally generated one.
#include "ui_obconf_fixed.h"
class QStandardItemModel;
class QItemSelection;
namespace Obconf {
class MainDialog : public QDialog {
Q_OBJECT
public:
MainDialog();
virtual ~MainDialog();
virtual void accept();
virtual void reject();
void theme_install(const char* path);
void theme_load_all();
private:
void theme_setup_tab();
void appearance_setup_tab();
void windows_setup_tab();
void mouse_setup_tab();
void moveresize_setup_tab();
void margins_setup_tab();
void desktops_setup_tab();
void dock_setup_tab();
// theme
void add_theme_dir(const char* dirname);
// windows
void windows_enable_stuff();
// move & resize
void moveresize_enable_stuff();
void write_fixed_position(const char* coord);
// mouse
void mouse_enable_stuff();
int read_doubleclick_action();
void write_doubleclick_action(int a);
// desktops
void desktops_read_names();
void desktops_write_names();
void desktops_write_number();
private Q_SLOTS:
void on_about_clicked();
// theme
void onThemeNamesSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
void on_install_theme_clicked();
void on_theme_archive_clicked();
//apearance
void on_window_border_toggled(bool checked);
void on_animate_iconify_toggled(bool checked);
void on_title_layout_textChanged(const QString& text);
// font
void on_font_active_changed();
void on_font_inactive_changed();
void on_font_menu_header_changed();
void on_font_menu_item_changed();
void on_font_active_display_changed();
void on_font_inactive_display_changed();
// windows
void on_fixed_monitor_valueChanged(int newValue);
void on_focus_new_toggled(bool checked);
void on_place_mouse_toggled(bool checked);
void on_place_active_popup_currentIndexChanged(int index);
void on_primary_monitor_popup_currentIndexChanged(int index);
// move & resize
void on_resist_window_valueChanged(int newValue);
void on_resist_edge_valueChanged(int newValue);
void on_resize_contents_toggled(bool checked);
void on_resize_popup_currentIndexChanged(int index);
void on_resize_position_currentIndexChanged(int index);
void on_fixed_x_popup_currentIndexChanged(int index);
void on_fixed_y_popup_currentIndexChanged(int index);
void on_drag_threshold_valueChanged(int newValue);
void on_fixed_x_pos_valueChanged(int newValue);
void on_fixed_y_pos_valueChanged(int newValue);
void on_warp_edge_toggled(bool checked);
void on_warp_edge_time_valueChanged(int newValue);
// margins
void on_margins_left_valueChanged(int newValue);
void on_margins_right_valueChanged(int newValue);
void on_margins_top_valueChanged(int newValue);
void on_margins_bottom_valueChanged(int newValue);
// mouse
void on_focus_mouse_toggled(bool checked);
void on_focus_delay_valueChanged(int newValue);
void on_focus_raise_toggled(bool checked);
void on_focus_notlast_toggled(bool checked);
void on_focus_under_mouse_toggled(bool checked);
void on_doubleclick_time_valueChanged(int newValue);
void on_titlebar_doubleclick_currentIndexChanged(int index);
// desktop
void on_desktop_num_valueChanged(int newValue);
void on_desktop_popup_toggled(bool checked);
void on_desktop_popup_time_valueChanged(int newValue);
void on_desktop_names_itemChanged(QListWidgetItem * item);
// docks
void on_dock_float_x_valueChanged(int newValue);
void on_dock_float_y_valueChanged(int newValue);
void on_dock_stack_top_toggled(bool checked);
void on_dock_stack_normal_toggled(bool checked);
void on_dock_stack_bottom_toggled(bool checked);
void on_dock_nostrut_toggled(bool checked);
void on_dock_hide_toggled(bool checked);
void on_dock_hide_delay_valueChanged(int newValue);
void on_dock_show_delay_valueChanged(int newValue);
void on_dock_position_currentIndexChanged(int index);
void on_dock_direction_currentIndexChanged(int index);
private:
Ui::MainDialog ui;
GList* themes;
QStandardItemModel* themes_model;
};
}
#endif // OBCONF_MAINDIALOG_H

View File

@ -1,57 +0,0 @@
/*
Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
Part of the code in this file is taken from obconf:
Copyright (c) 2003-2007 Dana Jansens
Copyright (c) 2003 Tim Riley
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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "maindialog.h"
#include <obrender/render.h>
#include "tree.h"
#include <QX11Info>
// FIXME: how to support XCB or Wayland?
#include <X11/Xlib.h>
using namespace Obconf;
extern RrInstance* rrinst; // defined in obconf-qt.cpp
void MainDialog::margins_setup_tab() {
ui.margins_left->setValue(tree_get_int("margins/left", 0));
ui.margins_right->setValue(tree_get_int("margins/right", 0));
ui.margins_top->setValue(tree_get_int("margins/top", 0));
ui.margins_bottom->setValue(tree_get_int("margins/bottom", 0));
}
void MainDialog::on_margins_left_valueChanged(int newValue) {
tree_set_int("margins/left", newValue);
}
void MainDialog::on_margins_right_valueChanged(int newValue) {
tree_set_int("margins/right", newValue);
}
void MainDialog::on_margins_top_valueChanged(int newValue) {
tree_set_int("margins/top", newValue);
}
void MainDialog::on_margins_bottom_valueChanged(int newValue) {
tree_set_int("margins/bottom", newValue);
}

View File

@ -1,196 +0,0 @@
/*
Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
Part of the code in this file is taken from obconf:
Copyright (c) 2003-2007 Dana Jansens
Copyright (c) 2003 Tim Riley
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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "maindialog.h"
#include <obrender/render.h>
#include "tree.h"
#include <QX11Info>
// FIXME: how to support XCB or Wayland?
#include <X11/Xlib.h>
using namespace Obconf;
extern RrInstance* rrinst; // defined in obconf-qt.cpp
static xmlNodePtr saved_custom = NULL;
#define TITLEBAR_MAXIMIZE 0
#define TITLEBAR_SHADE 1
#define TITLEBAR_CUSTOM 2
//static void MainDialog::on_titlebar_doubleclick_custom_activate(GtkMenuItem* w,
// gpointer data);
void MainDialog::mouse_setup_tab() {
gint a;
ui.focus_mouse->setChecked(tree_get_bool("focus/followMouse", FALSE));
ui.focus_delay->setValue(tree_get_int("focus/focusDelay", 0));
ui.focus_raise->setChecked(tree_get_bool("focus/raiseOnFocus", FALSE));
ui.focus_notlast->setChecked(!tree_get_bool("focus/focusLast", TRUE));
ui.focus_under_mouse->setChecked(tree_get_bool("focus/underMouse", FALSE));
ui.doubleclick_time->setValue(tree_get_int("mouse/doubleClickTime", 200));
// w = get_widget("titlebar_doubleclick");
a = read_doubleclick_action();
if(a == TITLEBAR_CUSTOM) {
ui.titlebar_doubleclick->addItem(tr("Custom actions"));
/*
* GtkWidget* i = gtk_menu_item_new_with_label(_());
* g_signal_connect(i, "activate",
* G_CALLBACK(on_titlebar_doubleclick_custom_activate),
* NULL);
* gtk_menu_shell_append
* (GTK_MENU_SHELL
* (gtk_option_menu_get_menu
* (GTK_OPTION_MENU(w))), i);
*/
}
ui.titlebar_doubleclick->setCurrentIndex(a);
mouse_enable_stuff();
}
void MainDialog::mouse_enable_stuff() {
bool b = ui.focus_mouse->isChecked();
ui.focus_delay->setEnabled(b);
ui.focus_delay_label->setEnabled(b);
// ui.focus_delay_label_units->setEnabled(b);
ui.focus_raise->setEnabled(b);
ui.focus_notlast->setEnabled(b);
ui.focus_under_mouse->setEnabled(b);
}
void MainDialog::on_focus_mouse_toggled(bool checked) {
tree_set_bool("focus/followMouse", checked);
mouse_enable_stuff();
}
void MainDialog::on_focus_delay_valueChanged(int newValue) {
tree_set_int("focus/focusDelay", newValue);
}
void MainDialog::on_focus_raise_toggled(bool checked) {
tree_set_bool("focus/raiseOnFocus", checked);
}
void MainDialog::on_focus_notlast_toggled(bool checked) {
tree_set_bool("focus/focusLast", !checked);
}
void MainDialog::on_focus_under_mouse_toggled(bool checked) {
tree_set_bool("focus/underMouse", checked);
}
void MainDialog::on_titlebar_doubleclick_currentIndexChanged(int index) {
write_doubleclick_action(index);
}
void MainDialog::on_doubleclick_time_valueChanged(int newValue) {
tree_set_int("mouse/doubleClickTime", newValue);
}
int MainDialog::read_doubleclick_action() {
xmlNodePtr n, top, c;
gint max = 0, shade = 0, other = 0;
top = tree_get_node("mouse/context:name=Titlebar"
"/mousebind:button=Left:action=DoubleClick", NULL);
n = top->children;
/* save the current state */
saved_custom = xmlCopyNode(top, 1);
/* remove the namespace from all the nodes under saved_custom..
* without recursion! */
c = saved_custom;
while(c) {
xmlSetNs(c, NULL);
if(c->children)
c = c->children;
else if(c->next)
c = c->next;
while(c->parent && !c->parent->next)
c = c->parent;
if(!c->parent)
c = NULL;
}
while(n) {
if(!xmlStrcmp(n->name, (const xmlChar*)"action")) {
if(obt_xml_attr_contains(n, "name", "ToggleMaximizeFull"))
++max;
else if(obt_xml_attr_contains(n, "name", "ToggleShade"))
++shade;
else
++other;
}
n = n->next;
}
if(max == 1 && shade == 0 && other == 0)
return TITLEBAR_MAXIMIZE;
if(max == 0 && shade == 1 && other == 0)
return TITLEBAR_SHADE;
return TITLEBAR_CUSTOM;
}
void MainDialog::write_doubleclick_action(int a) {
xmlNodePtr n;
n = tree_get_node("mouse/context:name=Titlebar"
"/mousebind:button=Left:action=DoubleClick", NULL);
/* remove all children */
while(n->children) {
xmlUnlinkNode(n->children);
xmlFreeNode(n->children);
}
if(a == TITLEBAR_MAXIMIZE) {
n = xmlNewChild(n, NULL, (xmlChar*)"action", NULL);
xmlSetProp(n, (xmlChar*)"name", (xmlChar*)"ToggleMaximizeFull");
}
else if(a == TITLEBAR_SHADE) {
n = xmlNewChild(n, NULL, (xmlChar*)"action", NULL);
xmlSetProp(n, (xmlChar*)"name", (xmlChar*)"ToggleShade");
}
else {
xmlNodePtr c = saved_custom->children;
while(c) {
xmlAddChild(n, xmlCopyNode(c, 1));
c = c->next;
}
}
tree_apply();
}

View File

@ -1,245 +0,0 @@
/*
Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
Part of the code in this file is taken from obconf:
Copyright (c) 2003-2007 Dana Jansens
Copyright (c) 2003 Tim Riley
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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "maindialog.h"
#include <obrender/render.h>
#include "tree.h"
#include <QX11Info>
// FIXME: how to support XCB or Wayland?
#include <X11/Xlib.h>
using namespace Obconf;
extern RrInstance* rrinst; // defined in obconf-qt.cpp
#define POPUP_NONPIXEL 0
#define POPUP_ALWAYS 1
#define POPUP_NEVER 2
#define POSITION_CENTER 0
#define POSITION_TOP 1
#define POSITION_FIXED 2
#define EDGE_CENTER 0
#define EDGE_LEFT 1
#define EDGE_RIGHT 2
void MainDialog::moveresize_setup_tab() {
gchar* s;
gint pos, i;
gboolean opp;
ui.resize_contents->setChecked(tree_get_bool("resize/drawContents", TRUE));
ui.resist_window->setValue(tree_get_int("resistance/strength", 10));
ui.resist_edge->setValue(tree_get_int("resistance/screen_edge_strength", 20));
s = tree_get_string("resize/popupShow", "NonPixel");
if(!strcasecmp(s, "Always")) pos = POPUP_ALWAYS;
else if(!strcasecmp(s, "Never")) pos = POPUP_NEVER;
else pos = POPUP_NONPIXEL;
g_free(s);
ui.resize_popup->setCurrentIndex(pos);
ui.drag_threshold->setValue(tree_get_int("mouse/dragThreshold", 8));
s = tree_get_string("resize/popupPosition", "Center");
if(!strcasecmp(s, "Top")) pos = POSITION_TOP;
if(!strcasecmp(s, "Fixed")) pos = POSITION_FIXED;
else pos = POSITION_CENTER;
g_free(s);
ui.resize_position->setCurrentIndex(pos);
s = tree_get_string("resize/popupFixedPosition/x", "0");
char* fixed_pos = s;
opp = fixed_pos[0] == '-';
if(fixed_pos[0] == '-' || fixed_pos[0] == '+')
++fixed_pos;
if(!strcasecmp(fixed_pos, "Center")) pos = EDGE_CENTER;
else if(opp) pos = EDGE_RIGHT;
else pos = EDGE_LEFT;
ui.fixed_x_popup->setCurrentIndex(pos);
ui.fixed_x_pos->setValue(MAX(atoi(fixed_pos), 0));
g_free(s);
s = tree_get_string("resize/popupFixedPosition/y", "0");
opp = s[0] == '-';
if(!strcasecmp(s, "Center")) pos = EDGE_CENTER;
else if(opp) pos = EDGE_RIGHT;
else pos = EDGE_LEFT;
g_free(s);
ui.fixed_y_popup->setCurrentIndex(pos);
ui.fixed_y_pos->setValue(MAX(atoi(s), 0));
i = tree_get_int("mouse/screenEdgeWarpTime", 400);
ui.warp_edge->setChecked(i != 0);
ui.warp_edge_time->setValue(i ? i : 400);
moveresize_enable_stuff();
}
void MainDialog::moveresize_enable_stuff() {
bool enabled;
enabled = (ui.resize_popup->currentIndex() != POPUP_NEVER);
ui.resize_position->setEnabled(enabled);
enabled = ui.warp_edge->isChecked();
ui.warp_edge_time->setEnabled(enabled);
enabled = (ui.resize_position->currentIndex() == POSITION_FIXED);
ui.fixed_x_popup->setEnabled(enabled);
ui.fixed_y_popup->setEnabled(enabled);
if(!enabled) {
ui.fixed_x_pos->setEnabled(false);
ui.fixed_y_pos->setEnabled(false);
}
else {
enabled = (ui.fixed_x_popup->currentIndex() != EDGE_CENTER);
ui.fixed_x_pos->setEnabled(enabled);
enabled = (ui.fixed_y_popup->currentIndex() != EDGE_CENTER);
ui.fixed_y_pos->setEnabled(enabled);
}
}
void MainDialog::on_resist_window_valueChanged(int newValue) {
tree_set_int("resistance/strength", newValue);
}
void MainDialog::on_resist_edge_valueChanged(int newValue) {
tree_set_int("resistance/screen_edge_strength", newValue);
}
void MainDialog::on_resize_contents_toggled(bool checked) {
tree_set_bool("resize/drawContents", checked);
}
void MainDialog::on_resize_popup_currentIndexChanged(int index) {
switch(index) {
case POPUP_NONPIXEL:
tree_set_string("resize/popupShow", "NonPixel");
break;
case POPUP_ALWAYS:
tree_set_string("resize/popupShow", "Always");
break;
case POPUP_NEVER:
tree_set_string("resize/popupShow", "Never");
break;
}
moveresize_enable_stuff();
}
void MainDialog::on_drag_threshold_valueChanged(int newValue) {
tree_set_int("mouse/dragThreshold", newValue);
}
void MainDialog::on_resize_position_currentIndexChanged(int index) {
/*
#define POSITION_CENTER 0
#define POSITION_TOP 1
#define POSITION_FIXED 2
*/
const char* strs[] = {
"Center",
"Top",
"Fixed"
};
if(index >= 0 && index < G_N_ELEMENTS(strs)) {
tree_set_string("resize/popupPosition", strs[index]);
moveresize_enable_stuff();
}
}
void MainDialog::on_fixed_x_popup_currentIndexChanged(int index) {
write_fixed_position("x");
moveresize_enable_stuff();
}
void MainDialog::on_fixed_y_popup_currentIndexChanged(int index) {
write_fixed_position("y");
moveresize_enable_stuff();
}
void MainDialog::write_fixed_position(const char* coord) {
g_assert(!strcmp(coord, "x") || !strcmp(coord, "y"));
QComboBox* popup = (*coord == 'x' ? ui.fixed_x_popup : ui.fixed_y_popup);
int edge = popup->currentIndex();
g_assert(edge == EDGE_CENTER || edge == EDGE_LEFT || edge == EDGE_RIGHT);
char* val;
if(edge == EDGE_CENTER)
val = g_strdup("center");
else {
QSpinBox* spin = (*coord == 'x' ? ui.fixed_x_pos : ui.fixed_y_pos) ;
int i = spin->value();
if(edge == EDGE_LEFT)
val = g_strdup_printf("%d", i);
else
val = g_strdup_printf("-%d", i);
}
char* valname = g_strdup_printf("resize/popupFixedPosition/%s", coord);
tree_set_string(valname, val);
g_free(valname);
g_free(val);
}
void MainDialog::on_fixed_x_pos_valueChanged(int newValue) {
write_fixed_position("x");
}
void MainDialog::on_fixed_y_pos_valueChanged(int newValue) {
write_fixed_position("y");
}
void MainDialog::on_warp_edge_toggled(bool checked) {
if(checked) {
tree_set_int("mouse/screenEdgeWarpTime", ui.warp_edge_time->value());
}
else
tree_set_int("mouse/screenEdgeWarpTime", 0);
moveresize_enable_stuff();
}
void MainDialog::on_warp_edge_time_valueChanged(int newValue) {
tree_set_int("mouse/screenEdgeWarpTime", newValue);
}

View File

@ -1,266 +0,0 @@
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
*
* main.c for ObConf, the configuration tool for Openbox
* Copyright (c) 2003-2008 Dana Jansens
* Copyright (c) 2003 Tim Riley
* Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
*
* 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 2 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.
*
* See the COPYING file for a copy of the GNU General Public License.
*/
#include <glib.h>
#include <QApplication>
#include <QTranslator>
#include <QLibraryInfo>
#include <QLocale>
#include <QX11Info>
#include <QMessageBox>
#include "maindialog.h"
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include "obconf-qt.h"
#include "archive.h"
#include "preview_update.h"
#include <stdlib.h>
#include <iostream>
using namespace Obconf;
xmlDocPtr doc;
xmlNodePtr root;
RrInstance* rrinst;
gchar* obc_config_file = NULL;
ObtPaths* paths;
ObtXmlInst* parse_i;
static gchar* obc_theme_install = NULL;
static gchar* obc_theme_archive = NULL;
void obconf_error(gchar* msg, gboolean modal) {
// FIXME: we did not handle modal
QMessageBox::critical(NULL, QObject::tr("ObConf Error"), QString::fromUtf8(msg));
}
static void print_version() {
// g_print("ObConf %s\n", PACKAGE_VERSION);
QString output = QObject::tr(
"Copyright (c) 2003-2008 Dana Jansens\n"
"Copyright (c) 2003 Tim Riley\n"
"Copyright (c) 2007 Javeed Shaikh\n"
"Copyright (c) 2013 Hong Jen Yee (PCMan)\n\n"
"This program comes with ABSOLUTELY NO WARRANTY.\n"
"This is free software, and you are welcome to redistribute it\n"
"under certain conditions. See the file COPYING for details.\n\n"
);
std::cout << output.toUtf8().constData();
exit(EXIT_SUCCESS);
}
static void print_help() {
QString output = QObject::tr(
"Syntax: obconf [options] [ARCHIVE.obt]\n"
"\nOptions:\n"
" --help Display this help and exit\n"
" --version Display the version and exit\n"
" --install ARCHIVE.obt Install the given theme archive and select it\n"
" --archive THEME Create a theme archive from the given theme directory\n"
" --config-file FILE Specify the path to the config file to use\n"
);
std::cout << output.toUtf8().constData();
exit(EXIT_SUCCESS);
}
static void parse_args(int argc, char** argv) {
int i;
for(i = 1; i < argc; ++i) {
if(!strcmp(argv[i], "--help"))
print_help();
if(!strcmp(argv[i], "--version"))
print_version();
else if(!strcmp(argv[i], "--install")) {
if(i == argc - 1) /* no args left */
std::cerr << QObject::tr("--install requires an argument\n").toUtf8().constData();
else
obc_theme_install = argv[++i];
}
else if(!strcmp(argv[i], "--archive")) {
if(i == argc - 1) /* no args left */
std::cerr << QObject::tr("--archive requires an argument\n").toUtf8().constData();
else
obc_theme_archive = argv[++i];
}
else if(!strcmp(argv[i], "--config-file")) {
if(i == argc - 1) /* no args left */
std::cerr << QObject::tr("--config-file requires an argument\n").toUtf8().constData();
else
obc_config_file = argv[++i];
}
else
obc_theme_install = argv[i];
}
}
static gboolean get_all(Window win, Atom prop, Atom type, gint size,
guchar** data, guint* num) {
gboolean ret = FALSE;
gint res;
guchar* xdata = NULL;
Atom ret_type;
gint ret_size;
gulong ret_items, bytes_left;
res = XGetWindowProperty(QX11Info::display(), win, prop, 0l, G_MAXLONG,
FALSE, type, &ret_type, &ret_size,
&ret_items, &bytes_left, &xdata);
if(res == Success) {
if(ret_size == size && ret_items > 0) {
guint i;
*data = (guchar*)g_malloc(ret_items * (size / 8));
for(i = 0; i < ret_items; ++i)
switch(size) {
case 8:
(*data)[i] = xdata[i];
break;
case 16:
((guint16*)*data)[i] = ((gushort*)xdata)[i];
break;
case 32:
((guint32*)*data)[i] = ((gulong*)xdata)[i];
break;
default:
g_assert_not_reached(); /* unhandled size */
}
*num = ret_items;
ret = TRUE;
}
XFree(xdata);
}
return ret;
}
static gboolean prop_get_string_utf8(Window win, Atom prop, gchar** ret) {
gchar* raw;
gchar* str;
guint num;
if(get_all(win, prop, XInternAtom(QX11Info::display(), "UTF8_STRING", 0), 8, (guchar**)&raw, &num)) {
str = g_strndup(raw, num); /* grab the first string from the list */
g_free(raw);
if(g_utf8_validate(str, -1, NULL)) {
*ret = str;
return TRUE;
}
g_free(str);
}
return FALSE;
}
int main(int argc, char** argv) {
QApplication app(argc, argv);
// load translations
QTranslator qtTranslator, translator;
// install the translations built-into Qt itself
qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&qtTranslator);
// install our own tranlations
translator.load("obconf-qt_" + QLocale::system().name(), PACKAGE_DATA_DIR "/translations");
app.installTranslator(&translator);
// load configurations
gchar* p;
gboolean exit_with_error = FALSE;
parse_args(argc, argv);
if(obc_theme_archive) {
archive_create(obc_theme_archive);
return 0;
}
paths = obt_paths_new();
parse_i = obt_xml_instance_new();
int screen = QX11Info::appScreen();
rrinst = RrInstanceNew(QX11Info::display(), screen);
if(!obc_config_file) {
gchar* p;
if(prop_get_string_utf8(QX11Info::appRootWindow(screen),
XInternAtom(QX11Info::display(), "_OB_CONFIG_FILE", 0), &p)) {
obc_config_file = g_filename_from_utf8(p, -1, NULL, NULL, NULL);
g_free(p);
}
}
xmlIndentTreeOutput = 1;
if(!((obc_config_file &&
obt_xml_load_file(parse_i, obc_config_file, "openbox_config")) ||
obt_xml_load_config_file(parse_i, "openbox", "rc.xml",
"openbox_config"))) {
QMessageBox::critical(NULL, QObject::tr("Error"),
QObject::tr("Failed to load an rc.xml. You have probably failed to install Openbox properly."));
exit_with_error = TRUE;
}
else {
doc = obt_xml_doc(parse_i);
root = obt_xml_root(parse_i);
}
/* look for parsing errors */
{
xmlErrorPtr e = xmlGetLastError();
if(e) {
QString message = QObject::tr("Error while parsing the Openbox configuration file. Your configuration file is not valid XML.\n\nMessage: %1")
.arg(QString::fromUtf8(e->message));
QMessageBox::critical(NULL, QObject::tr("Error"), message);
exit_with_error = TRUE;
}
}
// build our GUI
MainDialog dlg;
if(obc_theme_install)
dlg.theme_install(obc_theme_install);
else
dlg.theme_load_all();
dlg.exec();
/*
preview_update_set_active_font(NULL);
preview_update_set_inactive_font(NULL);
preview_update_set_menu_header_font(NULL);
preview_update_set_menu_item_font(NULL);
preview_update_set_osd_active_font(NULL);
preview_update_set_osd_inactive_font(NULL);
preview_update_set_title_layout(NULL);
*/
RrInstanceFree(rrinst);
obt_xml_instance_unref(parse_i);
obt_paths_unref(paths);
xmlFreeDoc(doc);
return 0;
}

View File

@ -1,11 +0,0 @@
[Desktop Entry]
Type=Application
Name=Openbox Settings
GenericName=Window Manager Settings
Comment=Configure the Openbox window manager
Exec=obconf-qt
Categories=Qt;Settings;DesktopSettings;
Icon=obconf-qt
StartupNotify=true
#TRANSLATIONS_DIR=translations

View File

@ -1,32 +0,0 @@
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
*
* main.h for ObConf, the configuration tool for Openbox
* Copyright (c) 2003 Dana Jansens
*
* 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 2 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.
*
* See the COPYING file for a copy of the GNU General Public License.
*/
#ifndef obconf_qt_H
#define obconf_qt_H
#include <obrender/render.h>
#include <obrender/instance.h>
#include <obt/xml.h>
#include <obt/paths.h>
extern RrInstance *rrinst;
extern gchar *obc_config_file;
extern ObtPaths *paths;
extern ObtXmlInst *parse_i;
#endif // obconf_qt_H

File diff suppressed because it is too large Load Diff

View File

@ -1,543 +0,0 @@
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
preview.c for ObConf, the configuration tool for Openbox
Copyright (c) 2007 Javeed Shaikh
Copyright (c) 2007 Dana Jansens
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 2 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.
See the COPYING file for a copy of the GNU General Public License.
*/
#include "theme.h"
#include "main.h"
#include "tree.h"
#include <string.h>
#include <obrender/theme.h>
#define PADDING 2 /* openbox does it :/ */
static void theme_pixmap_paint(RrAppearance *a, gint w, gint h)
{
Pixmap out = RrPaintPixmap(a, w, h);
if (out) XFreePixmap(RrDisplay(a->inst), out);
}
static guint32 rr_color_pixel(const RrColor *c)
{
return (guint32)((RrColorRed(c) << 24) + (RrColorGreen(c) << 16) +
+ (RrColorBlue(c) << 8) + 0xff);
}
/* XXX: Make this more general */
static GdkPixbuf* preview_menu(RrTheme *theme)
{
RrAppearance *title;
RrAppearance *title_text;
RrAppearance *menu;
RrAppearance *background;
RrAppearance *normal;
RrAppearance *disabled;
RrAppearance *selected;
RrAppearance *bullet; /* for submenu */
GdkPixmap *pixmap;
GdkPixbuf *pixbuf;
/* width and height of the whole menu */
gint width, height;
gint x, y;
gint title_h;
gint tw, th;
gint bw, bh;
gint unused;
/* set up appearances */
title = theme->a_menu_title;
title_text = theme->a_menu_text_title;
title_text->surface.parent = title;
title_text->texture[0].data.text.string = "Menu";
normal = theme->a_menu_text_normal;
normal->texture[0].data.text.string = "Normal";
disabled = theme->a_menu_text_disabled;
disabled->texture[0].data.text.string = "Disabled";
selected = theme->a_menu_text_selected;
selected->texture[0].data.text.string = "Selected";
bullet = theme->a_menu_bullet_normal;
/* determine window size */
RrMinSize(normal, &width, &th);
width += th + PADDING; /* make space for the bullet */
//height = th;
width += 2*theme->mbwidth + 2*PADDING;
/* get minimum title size */
RrMinSize(title, &tw, &title_h);
/* size of background behind each text line */
bw = width - 2*theme->mbwidth;
//title_h += 2*PADDING;
title_h = theme->menu_title_height;
RrMinSize(normal, &unused, &th);
bh = th + 2*PADDING;
height = title_h + 3*bh + 3*theme->mbwidth;
//height += 3*th + 3*theme->mbwidth + 5*PADDING;
/* set border */
pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, width, height);
gdk_pixbuf_fill(pixbuf, rr_color_pixel(theme->menu_border_color));
/* draw title */
x = y = theme->mbwidth;
theme_pixmap_paint(title, bw, title_h);
/* draw title text */
title_text->surface.parentx = 0;
title_text->surface.parenty = 0;
theme_pixmap_paint(title_text, bw, title_h);
pixmap = gdk_pixmap_foreign_new(title_text->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x, y, bw, title_h);
/* menu appears after title */
y += theme->mbwidth + title_h;
/* fill in menu appearance, used as the parent to every menu item's bg */
menu = theme->a_menu;
th = height - 3*theme->mbwidth - title_h;
theme_pixmap_paint(menu, bw, th);
pixmap = gdk_pixmap_foreign_new(menu->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x, y, bw, th);
/* fill in background appearance, used as the parent to text items */
background = theme->a_menu_normal;
background->surface.parent = menu;
background->surface.parentx = 0;
background->surface.parenty = 0;
/* draw background for normal entry */
theme_pixmap_paint(background, bw, bh);
pixmap = gdk_pixmap_foreign_new(background->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x, y, bw, bh);
/* draw normal entry */
normal->surface.parent = background;
normal->surface.parentx = PADDING;
normal->surface.parenty = PADDING;
x += PADDING;
y += PADDING;
RrMinSize(normal, &tw, &th);
theme_pixmap_paint(normal, tw, th);
pixmap = gdk_pixmap_foreign_new(normal->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x, y, tw, th);
/* draw bullet */
RrMinSize(normal, &tw, &th);
bullet->surface.parent = background;
bullet->surface.parentx = bw - th;
bullet->surface.parenty = PADDING;
theme_pixmap_paint(bullet, th, th);
pixmap = gdk_pixmap_foreign_new(bullet->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, width - theme->mbwidth - th, y,
th, th);
y += th + 2*PADDING;
/* draw background for disabled entry */
background->surface.parenty = bh;
theme_pixmap_paint(background, bw, bh);
pixmap = gdk_pixmap_foreign_new(background->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x - PADDING, y - PADDING,
bw, bh);
/* draw disabled entry */
RrMinSize(disabled, &tw, &th);
disabled->surface.parent = background;
disabled->surface.parentx = PADDING;
disabled->surface.parenty = PADDING;
theme_pixmap_paint(disabled, tw, th);
pixmap = gdk_pixmap_foreign_new(disabled->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x, y, tw, th);
y += th + 2*PADDING;
/* draw background for selected entry */
background = theme->a_menu_selected;
background->surface.parent = menu;
background->surface.parentx = 2*bh;
theme_pixmap_paint(background, bw, bh);
pixmap = gdk_pixmap_foreign_new(background->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x - PADDING, y - PADDING,
bw, bh);
/* draw selected entry */
RrMinSize(selected, &tw, &th);
selected->surface.parent = background;
selected->surface.parentx = PADDING;
selected->surface.parenty = PADDING;
theme_pixmap_paint(selected, tw, th);
pixmap = gdk_pixmap_foreign_new(selected->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x, y, tw, th);
return pixbuf;
}
static GdkPixbuf* preview_window(RrTheme *theme, const gchar *titlelayout,
gboolean focus, gint width, gint height)
{
RrAppearance *title;
RrAppearance *handle;
RrAppearance *a;
GdkPixmap *pixmap;
GdkPixbuf *pixbuf = NULL;
GdkPixbuf *scratch;
gint w, label_w, h, x, y;
const gchar *layout;
title = focus ? theme->a_focused_title : theme->a_unfocused_title;
/* set border */
pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height);
gdk_pixbuf_fill(pixbuf,
rr_color_pixel(focus ?
theme->frame_focused_border_color :
theme->frame_unfocused_border_color));
/* title */
w = width - 2*theme->fbwidth;
h = theme->title_height;
theme_pixmap_paint(title, w, h);
x = y = theme->fbwidth;
pixmap = gdk_pixmap_foreign_new(title->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x, y, w, h);
/* calculate label width */
label_w = width - (theme->paddingx + theme->fbwidth + 1) * 2;
for (layout = titlelayout; *layout; layout++) {
switch (*layout) {
case 'N':
label_w -= theme->button_size + 2 + theme->paddingx + 1;
break;
case 'D':
case 'S':
case 'I':
case 'M':
case 'C':
label_w -= theme->button_size + theme->paddingx + 1;
break;
default:
break;
}
}
x = theme->paddingx + theme->fbwidth + 1;
y += theme->paddingy;
for (layout = titlelayout; *layout; layout++) {
/* icon */
if (*layout == 'N') {
a = theme->a_icon;
/* set default icon */
a->texture[0].type = RR_TEXTURE_RGBA;
a->texture[0].data.rgba.width = 48;
a->texture[0].data.rgba.height = 48;
a->texture[0].data.rgba.alpha = 0xff;
a->texture[0].data.rgba.data = theme->def_win_icon;
a->surface.parent = title;
a->surface.parentx = x - theme->fbwidth;
a->surface.parenty = theme->paddingy;
w = h = theme->button_size + 2;
theme_pixmap_paint(a, w, h);
pixmap = gdk_pixmap_foreign_new(a->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x, y, w, h);
x += theme->button_size + 2 + theme->paddingx + 1;
} else if (*layout == 'L') { /* label */
a = focus ? theme->a_focused_label : theme->a_unfocused_label;
a->texture[0].data.text.string = focus ? "Active" : "Inactive";
a->surface.parent = title;
a->surface.parentx = x - theme->fbwidth;
a->surface.parenty = theme->paddingy;
w = label_w;
h = theme->label_height;
theme_pixmap_paint(a, w, h);
pixmap = gdk_pixmap_foreign_new(a->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x, y, w, h);
x += w + theme->paddingx + 1;
} else {
/* buttons */
switch (*layout) {
case 'D':
a = focus ?
theme->btn_desk->a_focused_unpressed :
theme->btn_desk->a_unfocused_unpressed;
break;
case 'S':
a = focus ?
theme->btn_shade->a_focused_unpressed :
theme->btn_shade->a_unfocused_unpressed;
break;
case 'I':
a = focus ?
theme->btn_iconify->a_focused_unpressed :
theme->btn_iconify->a_unfocused_unpressed;
break;
case 'M':
a = focus ?
theme->btn_max->a_focused_unpressed :
theme->btn_max->a_unfocused_unpressed;
break;
case 'C':
a = focus ?
theme->btn_close->a_focused_unpressed :
theme->btn_close->a_unfocused_unpressed;
break;
default:
continue;
}
a->surface.parent = title;
a->surface.parentx = x - theme->fbwidth;
a->surface.parenty = theme->paddingy + 1;
w = theme->button_size;
h = theme->button_size;
theme_pixmap_paint(a, w, h);
pixmap = gdk_pixmap_foreign_new(a->pixmap);
/* use y + 1 because these buttons should be centered wrt the label
*/
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x, y + 1, w, h);
x += theme->button_size + theme->paddingx + 1;
}
}
if (theme->handle_height) {
/* handle */
handle = focus ? theme->a_focused_handle : theme->a_unfocused_handle;
x = 2*theme->fbwidth + theme->grip_width;
y = height - theme->fbwidth - theme->handle_height;
w = width - 4*theme->fbwidth - 2*theme->grip_width;
h = theme->handle_height;
theme_pixmap_paint(handle, w, h);
pixmap = gdk_pixmap_foreign_new(handle->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x, y, w, h);
/* openbox handles this drawing stuff differently (it fills the bottom
* of the window with the handle), so it avoids this bug where
* parentrelative grips are not fully filled. i'm avoiding it slightly
* differently. */
theme_pixmap_paint(handle, width, h);
/* grips */
a = focus ? theme->a_focused_grip : theme->a_unfocused_grip;
a->surface.parent = handle;
x = theme->fbwidth;
/* same y and h as handle */
w = theme->grip_width;
theme_pixmap_paint(a, w, h);
pixmap = gdk_pixmap_foreign_new(a->pixmap);
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x, y, w, h);
/* right grip */
x = width - theme->fbwidth - theme->grip_width;
pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap,
gdk_colormap_get_system(),
0, 0, x, y, w, h);
}
/* title separator colour */
x = theme->fbwidth;
y = theme->fbwidth + theme->title_height;
w = width - 2*theme->fbwidth;
h = theme->fbwidth;
scratch = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, w, h);
gdk_pixbuf_fill(scratch, rr_color_pixel(focus ?
theme->title_separator_focused_color :
theme->title_separator_unfocused_color));
gdk_pixbuf_copy_area(scratch, 0, 0, w, h, pixbuf, x, y);
/* retarded way of adding client colour */
x = theme->fbwidth;
y = theme->title_height + 2*theme->fbwidth;
w = width - 2*theme->fbwidth;
h = height - theme->title_height - 3*theme->fbwidth -
(theme->handle_height ? (theme->fbwidth + theme->handle_height) : 0);
scratch = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, w, h);
gdk_pixbuf_fill(scratch, rr_color_pixel(focus ?
theme->cb_focused_color :
theme->cb_unfocused_color));
gdk_pixbuf_copy_area(scratch, 0, 0, w, h, pixbuf, x, y);
/* clear (no alpha!) the area where the client resides */
gdk_pixbuf_fill(scratch, 0xffffffff);
gdk_pixbuf_copy_area(scratch, 0, 0,
w - 2*theme->cbwidthx,
h - 2*theme->cbwidthy,
pixbuf,
x + theme->cbwidthx,
y + theme->cbwidthy);
return pixbuf;
}
static gint theme_label_width(RrTheme *theme, gboolean active)
{
gint w, h;
RrAppearance *label;
if (active) {
label = theme->a_focused_label;
label->texture[0].data.text.string = "Active";
} else {
label = theme->a_unfocused_label;
label->texture[0].data.text.string = "Inactive";
}
return RrMinWidth(label);
}
static gint theme_window_min_width(RrTheme *theme, const gchar *titlelayout)
{
gint numbuttons = strlen(titlelayout);
gint w = 2 * theme->fbwidth + (numbuttons + 3) * (theme->paddingx + 1);
if (g_strrstr(titlelayout, "L")) {
numbuttons--;
w += MAX(theme_label_width(theme, TRUE),
theme_label_width(theme, FALSE));
}
w += theme->button_size * numbuttons;
return w;
}
GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout,
RrFont *active_window_font,
RrFont *inactive_window_font,
RrFont *menu_title_font,
RrFont *menu_item_font,
RrFont *osd_active_font,
RrFont *osd_inactive_font)
{
GdkPixbuf *preview;
GdkPixbuf *menu;
GdkPixbuf *window;
gint window_w;
gint menu_w;
gint w, h;
RrTheme *theme = RrThemeNew(rrinst, name, FALSE,
active_window_font, inactive_window_font,
menu_title_font, menu_item_font,
osd_active_font, osd_inactive_font);
if (!theme)
return NULL;
menu = preview_menu(theme);
window_w = theme_window_min_width(theme, titlelayout);
menu_w = gdk_pixbuf_get_width(menu);
h = gdk_pixbuf_get_height(menu);
w = MAX(window_w, menu_w) + 20;
/* we don't want windows disappearing on us */
if (!window_w) window_w = menu_w;
preview = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8,
w, h + 2*(theme->title_height +5) + 1);
gdk_pixbuf_fill(preview, 0); /* clear */
window = preview_window(theme, titlelayout, FALSE, window_w, h);
gdk_pixbuf_copy_area(window, 0, 0, window_w, h, preview, 20, 0);
window = preview_window(theme, titlelayout, TRUE, window_w, h);
gdk_pixbuf_copy_area(window, 0, 0, window_w, h,
preview, 10, theme->title_height + 5);
gdk_pixbuf_copy_area(menu, 0, 0, menu_w, h,
preview, 0, 2 * (theme->title_height + 5));
RrThemeFree(theme);
return preview;
}

View File

@ -1,35 +0,0 @@
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
preview.h for ObConf, the configuration tool for Openbox
Copyright (c) 2007 Javeed Shaikh
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 2 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.
See the COPYING file for a copy of the GNU General Public License.
*/
#ifndef obconf__preview_h
#define obconf__preview_h
#include <glib.h>
#include <obrender/font.h>
/*
QPixmap preview_theme(const gchar *name, const gchar *titlelayout,
RrFont *active_window_font,
RrFont *inactive_window_font,
RrFont *menu_title_font,
RrFont *menu_item_font,
RrFont *osd_active_font,
RrFont *osd_inactive_font);
*/
#endif

View File

@ -1,143 +0,0 @@
#include "preview_update.h"
#include "preview.h"
#include "main.h"
static gboolean restart_theme_preview_update = TRUE;
static GtkTreeView *tree_view = NULL;
static GtkListStore *list_store = NULL;
static gchar *title_layout = NULL;
static RrFont *active_window_font = NULL;
static RrFont *inactive_window_font = NULL;
static RrFont *menu_title_font = NULL;
static RrFont *menu_item_font = NULL;
static RrFont *osd_active_font = NULL;
static RrFont *osd_inactive_font = NULL;
static gboolean update_theme_preview_iterate(gpointer data);
void preview_update_all()
{
if (!list_store) return;
if (!RR_CHECK_VERSION(3,5,0)) return;
g_idle_remove_by_data(list_store);
if (!(title_layout && active_window_font && inactive_window_font &&
menu_title_font && menu_item_font &&
osd_active_font && osd_inactive_font))
return; /* not set up */
restart_theme_preview_update = TRUE;
g_idle_add_full(G_PRIORITY_LOW,
update_theme_preview_iterate,
list_store, NULL);
}
void preview_update_set_tree_view(GtkTreeView *tr, GtkListStore *ls)
{
g_assert(!!tr == !!ls);
if (list_store) g_idle_remove_by_data(list_store);
tree_view = tr;
list_store = ls;
if (list_store) preview_update_all();
}
void preview_update_set_active_font(RrFont *f)
{
RrFontClose(active_window_font);
active_window_font = f;
preview_update_all();
}
void preview_update_set_inactive_font(RrFont *f)
{
RrFontClose(inactive_window_font);
inactive_window_font = f;
preview_update_all();
}
void preview_update_set_menu_header_font(RrFont *f)
{
RrFontClose(menu_title_font);
menu_title_font = f;
preview_update_all();
}
void preview_update_set_menu_item_font(RrFont *f)
{
RrFontClose(menu_item_font);
menu_item_font = f;
preview_update_all();
}
void preview_update_set_osd_active_font(RrFont *f)
{
RrFontClose(osd_active_font);
osd_active_font = f;
preview_update_all();
}
void preview_update_set_osd_inactive_font(RrFont *f)
{
RrFontClose(osd_inactive_font);
osd_inactive_font = f;
preview_update_all();
}
void preview_update_set_title_layout(const gchar *layout)
{
g_free(title_layout);
title_layout = g_strdup(layout);
preview_update_all();
}
static gboolean update_theme_preview_iterate(gpointer data)
{
GtkListStore *ls = data;
GdkPixbuf *preview;
static GtkTreeIter iter;
gchar *name;
if (restart_theme_preview_update) {
/* get the first iterator position if there is such a thing */
if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(ls), &iter)) {
/* nothing to show */
obconf_show_main();
return FALSE;
}
restart_theme_preview_update = FALSE;
} else {
/* get the next iterator position if there is such a thing */
if (!gtk_tree_model_iter_next(GTK_TREE_MODEL(ls), &iter)) {
GtkTreePath *path;
restart_theme_preview_update = TRUE;
gtk_tree_view_get_cursor(tree_view, &path, NULL);
if (path) {
gtk_tree_view_scroll_to_cell(tree_view, path, NULL,
FALSE, 0, 0);
gtk_tree_path_free(path);
}
obconf_show_main();
return FALSE;
}
}
gtk_tree_model_get(GTK_TREE_MODEL(ls), &iter, 0, &name, -1);
preview = preview_theme(name, title_layout, active_window_font,
inactive_window_font, menu_title_font,
menu_item_font, osd_active_font,
osd_inactive_font);
if (preview)
gtk_list_store_set(GTK_LIST_STORE(ls), &iter, 1, preview, -1);
return TRUE;
}

View File

@ -1,18 +0,0 @@
#ifndef obconf__preview_update_h
#define obconf__preview_update_h
#include <obrender/render.h>
// #include <gtk/gtk.h>
void preview_update_all();
// void preview_update_set_tree_view (GtkTreeView *tr, GtkListStore *ls);
void preview_update_set_active_font (RrFont *f);
void preview_update_set_inactive_font (RrFont *f);
void preview_update_set_menu_header_font (RrFont *f);
void preview_update_set_menu_item_font (RrFont *f);
void preview_update_set_osd_active_font (RrFont *f);
void preview_update_set_osd_inactive_font(RrFont *f);
void preview_update_set_title_layout (const gchar *layout);
#endif

View File

@ -1,166 +0,0 @@
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
theme.h for ObConf, the configuration tool for Openbox
Copyright (c) 2003-2007 Dana Jansens
Copyright (c) 2003 Tim Riley
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 2 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.
See the COPYING file for a copy of the GNU General Public License.
*/
#include "maindialog.h"
#include <QStandardItem>
#include <QStandardItemModel>
#include <QItemSelection>
#include <QFileDialog>
#include "obconf-qt.h"
#include "tree.h"
#include "preview_update.h"
#include "archive.h"
#include "preview.h"
using namespace Obconf;
void MainDialog::theme_install(const char* path) {
gchar* name;
if((name = archive_install(path)))
tree_set_string("theme/name", name);
g_free(name);
theme_load_all();
}
void MainDialog::theme_load_all() {
gchar* name;
gchar* p;
GList* it, *next;
gint i;
RrFont* active, *inactive, *menu_t, *menu_i, *osd;
QModelIndex currentItemIndex;
name = tree_get_string("theme/name", "TheBear");
if(themes) {
g_list_foreach(themes, (GFunc)g_free, NULL);
g_list_free(themes);
themes = NULL;
}
p = g_build_filename(g_get_home_dir(), ".themes", NULL);
add_theme_dir(p);
g_free(p);
{
GSList* it;
for(it = obt_paths_data_dirs(paths); it; it = g_slist_next(it)) {
p = g_build_filename((char*)it->data, "themes", NULL);
add_theme_dir(p);
g_free(p);
}
}
add_theme_dir(THEME_DIR);
themes = g_list_sort(themes, (GCompareFunc) strcasecmp);
themes_model->clear();
/* return to regular scheduled programming */
i = 0;
for(it = themes; it; it = next) {
next = g_list_next(it);
/* remove duplicates */
if(next && !strcmp((char*)it->data, (char*)next->data)) {
g_free(it->data);
themes = g_list_delete_link(themes, it);
continue;
}
QStandardItem* item = new QStandardItem(QString::fromUtf8((char*)it->data));
themes_model->appendRow(item);
if(!strcmp(name, (char*)it->data)) {
currentItemIndex = item->index();
ui.theme_names->selectionModel()->select(currentItemIndex, QItemSelectionModel::Select);
}
++i;
}
// FIXME: preview_update_all();
g_free(name);
if(currentItemIndex.isValid())
ui.theme_names->scrollTo(currentItemIndex, QAbstractItemView::PositionAtCenter);
}
void MainDialog::add_theme_dir(const char* dirname) {
GDir* dir;
const gchar* n;
if((dir = g_dir_open(dirname, 0, NULL))) {
while((n = g_dir_read_name(dir))) {
{
gchar* full;
full = g_build_filename(dirname, n, "openbox-3",
"themerc", NULL);
if(!g_file_test(full, GFileTest(G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_SYMLINK)))
n = NULL;
g_free(full);
}
if(n) {
themes = g_list_append(themes, g_strdup(n));
}
}
g_dir_close(dir);
}
}
void MainDialog::theme_setup_tab() {
QItemSelectionModel* selModel = ui.theme_names->selectionModel();
connect(selModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
SLOT(onThemeNamesSelectionChanged(QItemSelection,QItemSelection)));
}
void MainDialog::onThemeNamesSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected) {
QModelIndex sel = selected.indexes().first();
if(sel.isValid()) {
QStandardItem* item = themes_model->itemFromIndex(sel);
QVariant val = item->data(Qt::DisplayRole);
if(val.isValid()) {
QString name = val.toString();
tree_set_string("theme/name", name.toUtf8().constData());
}
}
}
void MainDialog::on_install_theme_clicked() {
QString filename = QFileDialog::getOpenFileName(this,
tr("Choose an Openbox theme"),
QString(),
"Openbox theme archives (*.obt);;");
if(!filename.isEmpty()) {
theme_install(filename.toLocal8Bit().constData());
}
}
void MainDialog::on_theme_archive_clicked() {
QString filename = QFileDialog::getSaveFileName(this,
tr("Choose an Openbox theme"),
QString(),
"Openbox theme archives (*.obt);;");
if(!filename.isEmpty()) {
archive_create(filename.toLocal8Bit().constData());
}
}

View File

@ -1,3 +0,0 @@
Name[de]=Fenstermanager Openbox
GenericName[de]=Openbox Einstellungen
Comment[de]=Konfiguration des Fenstermanagers Openbox (Qt-Version)

View File

@ -1,3 +0,0 @@
Name[fr]=Gestionnaire de fenêtres Openbox
GenericName[fr]=Paramétrage de Openbox
Comment[fr]=Paramétrage du gestionnaire de fenêtres Openbox (Version Qt)

View File

@ -1,3 +0,0 @@
Name[hu]=Openbox beállítása
GenericName[hu]=Openbox beállítások
Comment[hu]=Az Openbox ablakkezelő beállítása (Qt-Verzió)

View File

@ -1,3 +0,0 @@
Name[ja]=Openbox (Qt)
GenericName[ja]=Obconf-qt
Comment[ja]=Openbox

View File

@ -1,3 +0,0 @@
Name[pt]=Definições do Openbox
GenericName[pt]=Definições do gestor de janelas
Comment[pt]=Configurar o gestor de janelas Openbox

View File

@ -1,5 +0,0 @@
# Translations
Name[ru]=Настройки Openbox
GenericName[ru]=Настройки менеджера окон
Comment[ru]=Настроить оконный менеджер Openbox

View File

@ -1,195 +0,0 @@
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
tree.c for ObConf, the configuration tool for Openbox
Copyright (c) 2003-2007 Dana Jansens
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 2 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.
See the COPYING file for a copy of the GNU General Public License.
*/
#include <QX11Info>
#include <QMessageBox>
#include "tree.h"
#include "obconf-qt.h"
#include <obt/xml.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
xmlNodePtr tree_get_node(const gchar *path, const gchar *def)
{
xmlNodePtr n, c;
gchar **nodes;
gchar **it, **next;
n = obt_xml_root(parse_i);
nodes = g_strsplit(path, "/", 0);
for (it = nodes; *it; it = next) {
gchar **attrs;
gboolean ok = FALSE;
attrs = g_strsplit(*it, ":", 0);
next = it + 1;
/* match attributes */
c = obt_xml_find_node(n->children, attrs[0]);
while (c && !ok) {
gint i;
ok = TRUE;
for (i = 1; attrs[i]; ++i) {
gchar **eq = g_strsplit(attrs[i], "=", 2);
if (eq[1] && !obt_xml_attr_contains(c, eq[0], eq[1]))
ok = FALSE;
g_strfreev(eq);
}
if (!ok)
c = obt_xml_find_node(c->next, attrs[0]);
}
if (!c) {
gint i;
c = xmlNewTextChild(n, NULL, (xmlChar*)attrs[0], (xmlChar*)(*next ? NULL : def));
for (i = 1; attrs[i]; ++i) {
gchar **eq = g_strsplit(attrs[i], "=", 2);
if (eq[1])
xmlNewProp(c, (xmlChar*)eq[0], (xmlChar*)eq[1]);
g_strfreev(eq);
}
}
n = c;
g_strfreev(attrs);
}
g_strfreev(nodes);
return n;
}
void tree_delete_node(const gchar *path)
{
xmlNodePtr n;
n = tree_get_node(path, NULL);
xmlUnlinkNode(n);
xmlFreeNode(n);
}
void tree_apply()
{
gchar *p, *d;
gboolean err = FALSE;
if (obc_config_file)
p = g_strdup(obc_config_file);
else
p = g_build_filename(obt_paths_config_home(paths), "openbox",
"rc.xml", NULL);
d = g_path_get_dirname(p);
obt_paths_mkdir_path(d, 0700);
g_free(d);
if (!obt_xml_save_file(parse_i, p, TRUE)) {
gchar *s;
s = g_strdup_printf("An error occurred while saving the "
"config file '%s'", p);
// obconf_error(s, FALSE);
QMessageBox::critical(NULL, QString(), QString::fromUtf8(s));
g_free(s);
}
g_free(p);
if (!err) {
XEvent ce;
ce.xclient.type = ClientMessage;
ce.xclient.display = QX11Info::display();
ce.xclient.message_type = XInternAtom(ce.xclient.display, "_OB_CONTROL", false);
Window root = QX11Info::appRootWindow();
ce.xclient.window = root;
ce.xclient.format = 32;
ce.xclient.data.l[0] = 1; /* reconfigure */
ce.xclient.data.l[1] = 0;
ce.xclient.data.l[2] = 0;
ce.xclient.data.l[3] = 0;
ce.xclient.data.l[4] = 0;
XSendEvent(ce.xclient.display, root, FALSE,
SubstructureNotifyMask | SubstructureRedirectMask,
&ce);
}
}
void tree_set_string(const gchar *node, const gchar *value)
{
xmlNodePtr n;
n = tree_get_node(node, NULL);
xmlNodeSetContent(n, (const xmlChar*) value);
tree_apply();
}
void tree_set_int(const gchar *node, const gint value)
{
xmlNodePtr n;
gchar *s;
n = tree_get_node(node, NULL);
s = g_strdup_printf("%d", value);
xmlNodeSetContent(n, (const xmlChar*) s);
g_free(s);
tree_apply();
}
void tree_set_bool(const gchar *node, const gboolean value)
{
xmlNodePtr n;
n = tree_get_node(node, NULL);
xmlNodeSetContent(n, (const xmlChar*) (value ? "yes" : "no"));
tree_apply();
}
gchar* tree_get_string(const gchar *node, const gchar *def)
{
xmlNodePtr n;
n = tree_get_node(node, def);
return obt_xml_node_string(n);
}
gint tree_get_int(const gchar *node, gint def)
{
xmlNodePtr n;
gchar *d;
d = g_strdup_printf("%d", def);
n = tree_get_node(node, d);
g_free(d);
return obt_xml_node_int(n);
}
gboolean tree_get_bool(const gchar *node, gboolean def)
{
xmlNodePtr n;
n = tree_get_node(node, (def ? "yes" : "no"));
return obt_xml_node_bool(n);
}

View File

@ -1,38 +0,0 @@
/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
tree.h for ObConf, the configuration tool for Openbox
Copyright (c) 2003 Dana Jansens
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 2 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.
See the COPYING file for a copy of the GNU General Public License.
*/
#ifndef obconf__tree_h
#define obconf__tree_h
#include <obt/xml.h>
xmlNodePtr tree_get_node(const gchar *path, const gchar *def);
void tree_delete_node(const gchar *path);
gchar* tree_get_string(const gchar *node, const gchar *def);
gint tree_get_int(const gchar *node, gint def);
gboolean tree_get_bool(const gchar *node, gboolean def);
void tree_set_string(const gchar *node, const gchar *value);
void tree_set_int(const gchar *node, const gint value);
void tree_set_bool(const gchar *node, const gboolean value);
void tree_apply(); /* save the rc.xml and force reconfigure from Openbox */
#endif

View File

@ -1,137 +0,0 @@
/*
Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
Part of the code in this file is taken from obconf:
Copyright (c) 2003-2007 Dana Jansens
Copyright (c) 2003 Tim Riley
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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "maindialog.h"
#include <obrender/render.h>
#include "tree.h"
#include <QX11Info>
// FIXME: how to support XCB or Wayland?
#include <X11/Xlib.h>
using namespace Obconf;
extern RrInstance* rrinst; // defined in obconf-qt.cpp
#define PLACE_ON_FIXED 0
#define PLACE_ON_ALL 0
#define PLACE_ON_ACTIVE 1
#define PLACE_ON_MOUSE 2
#define PLACE_ON_PRIMARY 3
void MainDialog::windows_setup_tab() {
gchar* s;
ui.focus_new->setChecked(tree_get_bool("focus/focusNew", TRUE));
s = tree_get_string("placement/policy", "Smart");
ui.place_mouse->setChecked(!g_ascii_strcasecmp(s, "UnderMouse"));
g_free(s);
int index;
s = tree_get_string("placement/monitor", "Any");
if(!g_ascii_strcasecmp(s, "Active"))
index = PLACE_ON_ACTIVE;
else if(!g_ascii_strcasecmp(s, "Mouse"))
index = PLACE_ON_MOUSE;
else if(!g_ascii_strcasecmp(s, "Primary"))
index = PLACE_ON_PRIMARY;
else
index = PLACE_ON_ALL;
g_free(s);
ui.place_active_popup->setCurrentIndex(index);
s = tree_get_string("placement/primaryMonitor", "");
if(!g_ascii_strcasecmp(s, "Active"))
index = PLACE_ON_ACTIVE;
else if(!g_ascii_strcasecmp(s, "Mouse"))
index = PLACE_ON_MOUSE;
else {
index = PLACE_ON_FIXED;
ui.fixed_monitor->setValue(tree_get_int("placement/primaryMonitor", 1));
}
g_free(s);
ui.primary_monitor_popup->setCurrentIndex(index);
windows_enable_stuff();
}
void MainDialog::windows_enable_stuff() {
bool enabled = (ui.primary_monitor_popup->currentIndex() == PLACE_ON_FIXED);
ui.fixed_monitor->setEnabled(enabled);
}
void MainDialog::on_primary_monitor_popup_currentIndexChanged(int index) {
/*
#define PLACE_ON_FIXED 0
#define PLACE_ON_ACTIVE 1
#define PLACE_ON_MOUSE 2
#define PLACE_ON_PRIMARY 3
*/
const char* strs[] = {
NULL,
"Active",
"Mouse"
};
if(index < G_N_ELEMENTS(strs) && index >= 0) {
if(index == PLACE_ON_FIXED) {
tree_set_int("placement/primaryMonitor", ui.fixed_monitor->value());
}
else {
tree_set_string("placement/primaryMonitor", strs[index]);
}
windows_enable_stuff();
}
}
void MainDialog::on_fixed_monitor_valueChanged(int newValue) {
tree_set_int("placement/primaryMonitor", newValue);
}
void MainDialog::on_focus_new_toggled(bool checked) {
tree_set_bool("focus/focusNew", checked);
}
void MainDialog::on_place_mouse_toggled(bool checked) {
tree_set_string("placement/policy",
(checked ?
"UnderMouse" : "Smart"));
windows_enable_stuff();
}
void MainDialog::on_place_active_popup_currentIndexChanged(int index) {
/*
* #define PLACE_ON_ALL 0
* #define PLACE_ON_ACTIVE 1
* #define PLACE_ON_MOUSE 2
* #define PLACE_ON_PRIMARY 3
*/
const char* strs[] = {
"Any",
"Active",
"Mouse",
"Primary"
};
if(index < G_N_ELEMENTS(strs) && index >= 0)
tree_set_string("placement/monitor", strs[index]);
}