Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
233aeb339a | ||
|
|
16f60c678b | ||
|
|
1b8f7bd886 | ||
|
|
31278654a0 | ||
|
|
80e87d7868 | ||
|
|
e21ccb9671 | ||
|
|
e6cdcc9ee2 | ||
|
|
4a579b5141 | ||
|
|
dc166364de | ||
|
|
4564fd2948 | ||
|
|
c591823c3e | ||
|
|
7a1904c1ef | ||
|
|
5c5466d6b2 | ||
|
|
6aaf467950 | ||
|
|
428abcb3e7 | ||
|
|
9dea31e3d7 | ||
|
|
154b609576 | ||
|
|
7bfb502aa0 | ||
|
|
ded7d3bc86 | ||
|
|
526c1f6a69 | ||
|
|
6fd501d553 | ||
|
|
11aa08354e | ||
|
|
0bfbebeb8b | ||
|
|
413ba1c1a9 | ||
|
|
fdec3e8151 | ||
|
|
0012f831a8 | ||
|
|
c8962a4e67 | ||
|
|
74d09cf879 | ||
|
|
afdb516386 | ||
|
|
9a1f28fe9a | ||
|
|
b4583a7cc6 | ||
|
|
9918b13214 | ||
|
|
3f9d830294 | ||
|
|
7b2627b236 | ||
|
|
c40d87b3ae | ||
|
|
99f707b6c6 | ||
|
|
a561d5fef6 | ||
|
|
1d305e7626 | ||
|
|
194fb51f75 | ||
|
|
e2dc39bff2 | ||
|
|
836aa73430 | ||
|
|
63f5b885a3 | ||
|
|
c68d017475 | ||
|
|
bbe3bac923 | ||
|
|
2293e357f4 | ||
|
|
85dbceb14d | ||
|
|
45cba39be7 | ||
|
|
a0b235dd8a | ||
|
|
7e3db9ec30 | ||
|
|
6cc8770599 | ||
|
|
462d465f3a | ||
|
|
6ac62cd0de | ||
|
|
1174b62b8f | ||
|
|
ef713900a0 | ||
|
|
c60f6815fa | ||
|
|
7ca709fcbb | ||
|
|
c3ce878376 | ||
|
|
a06ac42eff | ||
|
|
444eb6c211 | ||
|
|
eb6cbe1ee0 | ||
|
|
bcae9a2c37 | ||
|
|
d411b34dae | ||
|
|
a0fad4375a | ||
|
|
ffb02984fe | ||
|
|
b400df2565 | ||
|
|
b06607cc37 | ||
|
|
8881f42470 | ||
|
|
6558d31680 | ||
|
|
6e949677ec | ||
|
|
72f2d166b6 | ||
|
|
7b13cdf7b3 | ||
|
|
c7bdaad30a | ||
|
|
fd9fce25fc | ||
|
|
5ba7add5b5 | ||
|
|
68889d3804 | ||
|
|
8ab18d433a | ||
|
|
13d83949c4 | ||
|
|
daf98009d4 | ||
|
|
0cf5848772 | ||
|
|
0ecc4bd8d3 | ||
|
|
388a195794 | ||
|
|
0f89010225 | ||
|
|
42da49c5c1 | ||
|
|
0ffba26b1f | ||
|
|
b19b094aaa | ||
|
|
5cc1e898b9 | ||
|
|
a4aa68a085 | ||
|
|
c954101bd9 | ||
|
|
d20aeb4121 | ||
|
|
9440de5ca9 | ||
|
|
c2955b508c | ||
|
|
fbf70814f0 | ||
|
|
a823790926 | ||
|
|
14838b82ae | ||
|
|
e11347c005 | ||
|
|
98842f238e | ||
|
|
5ffc87ad9b | ||
|
|
fb5d139443 | ||
|
|
9d6ee05660 | ||
|
|
1ee97606aa | ||
|
|
b6f721c167 | ||
|
|
ede4933819 | ||
|
|
70ce4a6d06 | ||
|
|
213c26db3f | ||
|
|
8ae3c42100 | ||
|
|
ff466a1d2d | ||
|
|
5e46ed7cb6 | ||
|
|
c197ba76fa | ||
|
|
fa2b10f3ce | ||
|
|
7b523aa075 | ||
|
|
0ca9971460 | ||
|
|
b3f23abec0 | ||
|
|
a2d735fee5 | ||
|
|
fb801d8ebb | ||
|
|
9a92bfec45 | ||
|
|
6d50abb3cf | ||
|
|
778872363a | ||
|
|
6c404d57c9 | ||
|
|
449b645278 | ||
|
|
02428a26c0 | ||
|
|
90bbc19923 | ||
|
|
4f5690c89b | ||
|
|
4000fa1a2e | ||
|
|
ba7ffafa7f | ||
|
|
33b59d5723 | ||
|
|
28551a9666 | ||
|
|
c5478d6a0e |
@@ -8,9 +8,11 @@ config.guess
|
||||
config.sub
|
||||
aclocal.m4
|
||||
config.h.in
|
||||
compile
|
||||
ar-lib
|
||||
missing
|
||||
install-sh
|
||||
*.glade.cpp
|
||||
*.ui.cpp
|
||||
*.txt.cpp
|
||||
gsmartcontrol.spec
|
||||
.kdev4
|
||||
@@ -0,0 +1 @@
|
||||
svn propset svn:ignore -F .svnignore.txt .
|
||||
@@ -19,7 +19,7 @@ See LICENSE_gpl2.txt and LICENSE_gpl3.txt for details.
|
||||
|
||||
|
||||
All files which don't have any copyright notices, as well as tests and
|
||||
examples are covered under the Whatever License. See LICENSE_whatever.txt for
|
||||
examples are covered under the Unlicense. See LICENSE_unlicense.txt for
|
||||
details.
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ All original code (except for the tests) is licensed under the Zlib License.
|
||||
See LICENSE_zlib.txt for details.
|
||||
|
||||
|
||||
All tests and examples are covered under the Whatever License. See
|
||||
LICENSE_whatever.txt for details.
|
||||
All tests and examples are covered under the Unlicense. See
|
||||
LICENSE_unlicense.txt for details.
|
||||
|
||||
|
||||
Portions of this software are copyright Regents of the University of
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2005, Google Inc.
|
||||
Copyright (c) 2005 - 2010, Google Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <http://unlicense.org/>
|
||||
@@ -0,0 +1,231 @@
|
||||
|
||||
# Add autoconf.m4 directory to local macro search path
|
||||
ACLOCAL_AMFLAGS = -I autoconf.m4
|
||||
|
||||
SUBDIRS = data debian.dist src
|
||||
|
||||
|
||||
# These files are actually needed for compilation.
|
||||
noinst_DATA = AUTHORS.txt LICENSE_gsmartcontrol.txt README.txt
|
||||
|
||||
|
||||
# For the files to be bundled with the distribution, specify them in
|
||||
# one of the following.
|
||||
|
||||
# These will be installed into docdir.
|
||||
# Some of these files are actually needed for compilation (see src/res/Makefile.am).
|
||||
dist_doc_DATA = AUTHORS.txt ChangeLog NEWS README.txt \
|
||||
LICENSE_boost_1_0.txt \
|
||||
LICENSE_bsd-ac.txt \
|
||||
LICENSE_bsd-ucb.txt \
|
||||
LICENSE_gpl2.txt \
|
||||
LICENSE_gpl3.txt \
|
||||
LICENSE_gsmartcontrol.txt \
|
||||
LICENSE_hz.txt \
|
||||
LICENSE_pcrecpp.txt \
|
||||
LICENSE_unlicense.txt \
|
||||
LICENSE_zlib.txt
|
||||
|
||||
|
||||
# nobase_ preserves their directory names.
|
||||
nobase_dist_doc_DATA = contrib/cron-based_noadmin/README \
|
||||
contrib/cron-based_noadmin/cron_gather_smart.sh \
|
||||
contrib/cron-based_noadmin/crontab.example \
|
||||
contrib/cron-based_noadmin/smartctl_subst.sh
|
||||
|
||||
|
||||
# Extra files bundled with distribution.
|
||||
# file2csource.sh is needed for building but not installed.
|
||||
EXTRA_DIST = COPYING INSTALL configure autogen.sh \
|
||||
gsmartcontrol.kdev4 \
|
||||
file2csource.sh \
|
||||
gsmartcontrol.spec
|
||||
|
||||
|
||||
|
||||
# rpm support
|
||||
|
||||
src-rpm: dist
|
||||
rpmbuild -ts $(distdir).tar.bz2
|
||||
|
||||
|
||||
# NSIS installer support.
|
||||
# Requires installed NSIS, smartctl-nc.exe, smartctl.exe, update-smart-drivedb.exe.
|
||||
# Gtkmm dlls and pcre dlls are required if linking against them.
|
||||
# dos2unix on build machine.
|
||||
# Execute only with win32 build present.
|
||||
|
||||
WIN_ZIP_NAME = $(PACKAGE)-$(VERSION)-@WINDOWS_SUFFIX@
|
||||
|
||||
|
||||
win-dist: win-dist-nocleanup win-dist-cleanup
|
||||
|
||||
win-dist-nocleanup: win-dist-prepare nsis-dist-nocleanup win-zip-dist-nocleanup
|
||||
|
||||
win-dist-cleanup: win-zip-dist-cleanup nsis-dist-cleanup
|
||||
rm -rf win-dist
|
||||
|
||||
win-dist-clean: win-dist-cleanup
|
||||
rm -f gsmartcontrol-*.exe gsmartcontrol-*.zip
|
||||
|
||||
|
||||
win-dist-prepare-all: nsis-dist-prepare win-zip-dist-prepare
|
||||
|
||||
|
||||
# All of GTK+
|
||||
GTK_BIN_FILES = gdk-pixbuf-query-loaders.exe \
|
||||
gspawn-win32-helper-console.exe \
|
||||
gspawn-win32-helper.exe \
|
||||
gspawn-win64-helper-console.exe \
|
||||
gspawn-win64-helper.exe \
|
||||
gtk-query-immodules-3.0.exe \
|
||||
gtk-update-icon-cache-3.0.exe \
|
||||
libatk-1.*.dll \
|
||||
libatkmm-1.*.dll \
|
||||
libbz2-*.dll \
|
||||
libcairo-*.dll \
|
||||
libcairomm-1*.dll \
|
||||
libepoxy-*.dll \
|
||||
libffi-*.dll \
|
||||
libexpat-*.dll \
|
||||
libfontconfig-*.dll \
|
||||
libfreetype-*.dll \
|
||||
libgdk-3*.dll \
|
||||
libgdk_pixbuf-2.*.dll \
|
||||
libgdkmm-3.*.dll \
|
||||
libgio-2.*.dll \
|
||||
libgiomm-2.*.dll \
|
||||
libglib-2.*.dll \
|
||||
libglibmm*2.*.dll \
|
||||
libgmodule-2.*.dll \
|
||||
libgobject-2.*.dll \
|
||||
libgraphite*.dll \
|
||||
libgthread-2.*.dll \
|
||||
libgtk-3*.dll \
|
||||
libgtkmm-3*.dll \
|
||||
libharfbuzz*.dll \
|
||||
libiconv*.dll \
|
||||
libintl*.dll \
|
||||
libjasper*.dll \
|
||||
libjpeg*.dll \
|
||||
liblzma*.dll \
|
||||
libpango*-1.*.dll \
|
||||
libpixman*.dll \
|
||||
libpng16-*.dll \
|
||||
libsigc-2.*.dll \
|
||||
libstdc++-*.dll \
|
||||
libtiff-*.dll \
|
||||
libwinpthread-*.dll \
|
||||
libxml2-*.dll \
|
||||
zlib1.dll
|
||||
|
||||
|
||||
# Don't strip smartctl (it will only change the header), and
|
||||
# don't strip update-smart-drivedb (it will break its CRC check).
|
||||
win-dist-prepare: all
|
||||
$(MKDIR_P) win-dist
|
||||
cp $(top_srcdir)/data/icon_*.png win-dist/
|
||||
|
||||
$(MKDIR_P) win-dist/doc
|
||||
cp data/nsis/distribution.txt win-dist/doc/
|
||||
cp $(top_srcdir)/AUTHORS.txt $(top_srcdir)/LICENSE_* $(top_srcdir)/README.txt win-dist/doc/
|
||||
cp $(top_srcdir)/NEWS win-dist/doc/NEWS.txt
|
||||
|
||||
cp src/gsmartcontrol.exe src/gsmartcontrol.exe.manifest win-dist/
|
||||
|
||||
unix2dos win-dist/doc/*.txt
|
||||
|
||||
cp -p "@WINDOWS_SYSROOT@"/bin/drivedb.h win-dist/
|
||||
cp -p "@WINDOWS_SYSROOT@"/bin/smartctl-nc.exe win-dist/
|
||||
cp -p "@WINDOWS_SYSROOT@"/bin/smartctl.exe win-dist/
|
||||
cp -p "@WINDOWS_SYSROOT@"/bin/update-smart-drivedb.exe win-dist/
|
||||
|
||||
for file in $(GTK_BIN_FILES); do for f in "@WINDOWS_SYSROOT@/bin/"$$file; do if test -f "$${f}"; then cp -p "$${f}" win-dist/; fi; done; done
|
||||
|
||||
# <prefix>/etc should contain gtk-3.0/settings.ini
|
||||
$(MKDIR_P) win-dist/etc
|
||||
$(MKDIR_P) win-dist/etc/fonts
|
||||
cp -p "@WINDOWS_SYSROOT@"/etc/fonts/fonts.conf win-dist/etc/fonts
|
||||
cp -p -r "@WINDOWS_SYSROOT@"/etc/gtk-3.0 win-dist/etc
|
||||
|
||||
$(MKDIR_P) win-dist/share
|
||||
cp -p -r "@WINDOWS_SYSROOT@"/share/themes win-dist/share
|
||||
|
||||
# needed for file chooser
|
||||
$(MKDIR_P) win-dist/share/glib-2.0
|
||||
cp -p -r "@WINDOWS_SYSROOT@"/share/glib-2.0/schemas win-dist/share/glib-2.0
|
||||
|
||||
# $(MKDIR_P) win-dist/share/icons
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/hicolor win-dist/share/icons
|
||||
|
||||
# needed for window titlebar (if using client-side decorations)
|
||||
# $(MKDIR_P) win-dist/share/icons/Adwaita/16x16/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/16x16/actions/window-close-symbolic.symbolic.png win-dist/share/icons/Adwaita/16x16/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/16x16/actions/window-maximize-symbolic.symbolic.png win-dist/share/icons/Adwaita/16x16/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/16x16/actions/window-minimize-symbolic.symbolic.png win-dist/share/icons/Adwaita/16x16/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/16x16/actions/window-restore-symbolic.symbolic.png win-dist/share/icons/Adwaita/16x16/actions
|
||||
# $(MKDIR_P) win-dist/share/icons/Adwaita/24x24/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/24x24/actions/window-close-symbolic.symbolic.png win-dist/share/icons/Adwaita/24x24/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/24x24/actions/window-maximize-symbolic.symbolic.png win-dist/share/icons/Adwaita/24x24/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/24x24/actions/window-minimize-symbolic.symbolic.png win-dist/share/icons/Adwaita/24x24/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/24x24/actions/window-restore-symbolic.symbolic.png win-dist/share/icons/Adwaita/24x24/actions
|
||||
# $(MKDIR_P) win-dist/share/icons/Adwaita/32x32/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/32x32/actions/window-close-symbolic.symbolic.png win-dist/share/icons/Adwaita/32x32/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/32x32/actions/window-maximize-symbolic.symbolic.png win-dist/share/icons/Adwaita/32x32/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/32x32/actions/window-minimize-symbolic.symbolic.png win-dist/share/icons/Adwaita/32x32/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/32x32/actions/window-restore-symbolic.symbolic.png win-dist/share/icons/Adwaita/32x32/actions
|
||||
# $(MKDIR_P) win-dist/share/icons/Adwaita/48x48/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/48x48/actions/window-close-symbolic.symbolic.png win-dist/share/icons/Adwaita/48x48/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/48x48/actions/window-maximize-symbolic.symbolic.png win-dist/share/icons/Adwaita/48x48/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/48x48/actions/window-minimize-symbolic.symbolic.png win-dist/share/icons/Adwaita/48x48/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/48x48/actions/window-restore-symbolic.symbolic.png win-dist/share/icons/Adwaita/48x48/actions
|
||||
# $(MKDIR_P) win-dist/share/icons/Adwaita/64x64/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/64x64/actions/window-close-symbolic.symbolic.png win-dist/share/icons/Adwaita/64x64/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/64x64/actions/window-maximize-symbolic.symbolic.png win-dist/share/icons/Adwaita/64x64/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/64x64/actions/window-minimize-symbolic.symbolic.png win-dist/share/icons/Adwaita/64x64/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/64x64/actions/window-restore-symbolic.symbolic.png win-dist/share/icons/Adwaita/64x64/actions
|
||||
# $(MKDIR_P) win-dist/share/icons/Adwaita/96x96/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/96x96/actions/window-close-symbolic.symbolic.png win-dist/share/icons/Adwaita/96x96/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/96x96/actions/window-maximize-symbolic.symbolic.png win-dist/share/icons/Adwaita/96x96/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/96x96/actions/window-minimize-symbolic.symbolic.png win-dist/share/icons/Adwaita/96x96/actions
|
||||
# cp -p "@WINDOWS_SYSROOT@"/share/icons/Adwaita/96x96/actions/window-restore-symbolic.symbolic.png win-dist/share/icons/Adwaita/96x96/actions
|
||||
|
||||
# other
|
||||
cp -p "@WINDOWS_SYSROOT@"/bin/libgcc_s_*.dll win-dist/
|
||||
cp -p "@WINDOWS_SYSROOT@"/bin/libpcre-1.dll win-dist/
|
||||
|
||||
|
||||
nsis-dist-prepare: win-dist-prepare
|
||||
cp -a win-dist nsis-dist
|
||||
cp $(top_srcdir)/data/gsmartcontrol.ico nsis-dist/
|
||||
cp data/nsis/*.nsi $(top_srcdir)/data/nsis/nsi_* nsis-dist/
|
||||
unix2dos nsis-dist/*.nsi
|
||||
|
||||
nsis-dist-nocleanup: nsis-dist-prepare
|
||||
cd nsis-dist && @NSIS_EXEC@ gsmartcontrol.nsi
|
||||
mv nsis-dist/$(PACKAGE)-$(VERSION)-@WINDOWS_SUFFIX@.exe .
|
||||
|
||||
nsis-dist-cleanup:
|
||||
rm -rf nsis-dist
|
||||
|
||||
nsis-dist: nsis-dist-prepare nsis-dist-nocleanup nsis-dist-cleanup
|
||||
|
||||
|
||||
win-zip-dist-prepare: win-dist-prepare
|
||||
cp -a win-dist $(WIN_ZIP_NAME)
|
||||
|
||||
win-zip-dist-nocleanup: win-zip-dist-prepare
|
||||
zip -K -9r $(WIN_ZIP_NAME).zip $(WIN_ZIP_NAME)
|
||||
|
||||
win-zip-dist-cleanup:
|
||||
rm -rf $(WIN_ZIP_NAME)
|
||||
|
||||
win-zip-dist: win-zip-dist-prepare win-zip-dist-nocleanup win-zip-dist-cleanup
|
||||
|
||||
|
||||
|
||||
|
||||
distclean-local: win-dist-clean
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,80 @@
|
||||
|
||||
Version 1.0.0, released on xxxxxxx
|
||||
Ported to GTK+ 3.
|
||||
|
||||
Version 0.9.0, released on 2017-05-11
|
||||
Implemented (untested) support for Linux-based Areca controllers with
|
||||
enclosures.
|
||||
Implemented (untested) support for Windows-based Areca controllers (thanks
|
||||
to Richard Kagerer).
|
||||
Implemented (untested) support for Linux-based HP controllers with cciss
|
||||
and hpsa/hpahcisr drivers (thanks to Fabrice Bacchella).
|
||||
Changes in Preferences no longer fail silently until rescan/restart.
|
||||
Better drive detection under Windows after removable drives are detached.
|
||||
Windows version is no longer marked as "dpi aware" since it's not
|
||||
supported that well.
|
||||
Drive attribute descriptions have been updated (including clarifications
|
||||
for SSDs).
|
||||
Added support for SSD-only and HDD-only vendor attributes.
|
||||
Devices having only basic info can be displayed now in the info window.
|
||||
Fixed BDRW drive detection (it was detected as a HDD).
|
||||
Other minor improvements.
|
||||
A number of issues have been fixed (including a crash).
|
||||
|
||||
Version 0.8.7, released on 2012-08-11
|
||||
Implemented support for Adaptec RAID 5805 controller and possibly other
|
||||
Adaptec models as well (Linux).
|
||||
Implemented support for Areca RAID controller detection under Linux
|
||||
(untested).
|
||||
Implemented support for 3ware 3w-sas-supported (twl) RAID controller
|
||||
detection under Linux (untested).
|
||||
Implemented support for systems with several different 3ware controllers
|
||||
(twa/twe/twl).
|
||||
Fixed invalid parsing of tw_cli output which caused non-detection of
|
||||
drives and controllers with controller or port numbers greater than 9
|
||||
if tw_cli was found (3ware linux, windows).
|
||||
The duplicate drives are no longer shown for some Intel matrix controllers
|
||||
under Windows; Intel RAID controllers are fully supported under
|
||||
Windows now.
|
||||
Added options to show device name and serial number under drive icons.
|
||||
Updated SMART attribute definitions and added warnings for SSD lifetime
|
||||
attributes.
|
||||
gsmartcontrol-root has a new argument "--desktop=..." which replaces the
|
||||
old positional argument; compatibility with the old invocation syntax
|
||||
has been retained.
|
||||
Completely documented the source using doxygen tags.
|
||||
Added support for Fedora's consolehelper.
|
||||
Made GSmartControl DPI-aware under Windows.
|
||||
Fixed compilation issues with clang and gcc 4.7, as well as glib 2.31.x
|
||||
and newer.
|
||||
Fixed minor issues in NSIS installer.
|
||||
Fixed other minor bugs and made minor improvements.
|
||||
|
||||
Version 0.8.6, released on 2011-06-12
|
||||
Support detecting drives behind 3ware controllers (Linux, Windows),
|
||||
including tw_cli/cx/px mode in Windows. Having tw_cli is recommended
|
||||
but not required.
|
||||
Added support for specifying -d option and extra parameters via command
|
||||
line, "Add Device" and "Preferences" dialogs. This change effectively
|
||||
adds full support for multiple drives behind a single device name.
|
||||
Beesu and su-to-root are supported by gsmartcontrol-root script now.
|
||||
Completely revamped the attribute database and its handling, should be a
|
||||
lot more usable and forward-compatible now; SSD attributes are also
|
||||
included.
|
||||
In-program help has been expanded considerably.
|
||||
General improvements to user interface have been implemented (better GNOME
|
||||
HIG compliance, better tooltips, dialogs, etc...).
|
||||
Added ability to show smartctl output for devices whose info could not be
|
||||
parsed fully.
|
||||
Attributes in "brief" format are supported now.
|
||||
The parser has been updated to reflect the recent changes in smartctl.
|
||||
Quit and rescan operations are no longer denied without confirmation when
|
||||
tests are running.
|
||||
The Windows NSIS installer has been vastly improved.
|
||||
Better support for Windows Vista and 7.
|
||||
Changed copyright notices for files with Whatever License to use Unlicense.
|
||||
Added other minor features and fixed quite a few bugs.
|
||||
|
||||
Version 0.8.5, released on 2009-09-05
|
||||
GSmartControl now uses XDG config directory for per-user configuration on
|
||||
UNIX and CSIDL_PROFILE directory on Windows. Existing configuration is
|
||||
@@ -1,19 +1,20 @@
|
||||
|
||||
About GSmartControl
|
||||
|
||||
GSmartControl - Hard disk drive health inspection tool.
|
||||
GSmartControl - Hard disk drive and SSD health inspection tool.
|
||||
|
||||
GSmartControl is a graphical user interface for smartctl (from smartmontools
|
||||
package, see http://smartmontools.sourceforge.net), which is a tool for
|
||||
querying and controlling SMART (Self-Monitoring, Analysis, and Reporting
|
||||
Technology) data on modern hard disk drives. It allows you to inspect the
|
||||
drive's SMART data to determine its health, as well as run various tests on
|
||||
it.
|
||||
Technology) data on modern hard disk and solid-state drives. It allows you to
|
||||
inspect the drive's SMART data to determine its health, as well as run various
|
||||
tests on it.
|
||||
|
||||
Note: Only ATA drives (both PATA and SATA) and various USB to ATA bridges are
|
||||
supported for now.
|
||||
Note: GSmartControl supports ATA drives (both PATA and SATA), various USB to
|
||||
ATA bridges and drives behind some RAID controllers (selected models of
|
||||
3ware, Areca, Adaptec, Intel RAID controllers).
|
||||
|
||||
http://gsmartcontrol.berlios.de
|
||||
http://gsmartcontrol.sourceforge.net
|
||||
|
||||
|
||||
|
||||
@@ -51,15 +52,15 @@ methods to predict certain kinds of failures with certain chance of success.
|
||||
Long answer: read below.
|
||||
|
||||
Self-Monitoring, Analysis, and Reporting Technology, or SMART, is a
|
||||
monitoring system for hard drives to detect and report various indicators of
|
||||
reliability, in the hope of anticipating failures. It is implemented inside
|
||||
the drives SMART provides several ways of monitoring hard drive health. It
|
||||
may provide information about general health, various drive attributes (for
|
||||
example, number of unreadable sectors), error logs, and so on. It may also
|
||||
provide ways to instruct the drive to run various self-tests, which may report
|
||||
valuable information. It may even automatically scan the disk surface in when
|
||||
the drive is idle, and repair the defects, reallocating the data to more safe
|
||||
areas.
|
||||
monitoring system for hard drives and SSDs to detect and report various
|
||||
indicators of reliability, in the hope of anticipating failures. SMART is
|
||||
implemented inside the drives, providing several ways of monitoring the drive
|
||||
health. It may present information about general health, various drive
|
||||
attributes (for example, number of unreadable sectors), error logs, and so on.
|
||||
It may also provide ways to instruct the drive to run various self-tests,
|
||||
which may report valuable information. It may even automatically scan the disk
|
||||
surface in when the drive is idle, repairing the defects while reallocating
|
||||
the data to more safe areas.
|
||||
|
||||
While having SMART sounds really good, there are some nuances to consider. One
|
||||
of the common pitfalls is that it may create a false sense of security. That
|
||||
@@ -75,15 +76,15 @@ necessarily agree on precise attribute definitions and measurement units, the
|
||||
exact meaning of the attributes may vary greatly across different drive
|
||||
models.
|
||||
|
||||
At present SMART is implemented individually by manufacturers, and while some
|
||||
At present SMART is implemented individually by manufacturers. While some
|
||||
aspects are standardized for compatibility, others are not. In fact, most
|
||||
manufacturers refer the users to their own health monitoring utilities, and
|
||||
manufacturers refer the users to their own health monitoring utilities and
|
||||
advice against taking SMART data seriously. Nevertheless, SMART may prove an
|
||||
effective measure against data loss.
|
||||
|
||||
Yet another issue is that quite often the drives have bugs which prevent
|
||||
correct SMART usage. This is usually due to buggy firmware, or the
|
||||
manufacturer ignoring the standard. Luckily, smartmontools usually detects
|
||||
manufacturer ignoring the standards. Luckily, smartmontools usually detects
|
||||
these bugs and works around them.
|
||||
|
||||
|
||||
@@ -96,33 +97,22 @@ You need to have the following software installed:
|
||||
|
||||
* smartmontools - see http://smartmontools.sourceforge.net .
|
||||
|
||||
* GTK+, version 2.6 or higher - see http://www.gtk.org .
|
||||
* GTK+, version 3.4 or higher - see http://www.gtk.org .
|
||||
|
||||
* Gtkmm, version 2.6 or higher - see http://www.gtkmm.org .
|
||||
|
||||
* libglademm, version 2.4 or higher - see http://www.gtkmm.org .
|
||||
Note: libglademm is not needed when using GTK 2.12 and Gtkmm 2.12.
|
||||
|
||||
Note that having GTK+ 2.12 and Gtkmm 2.12 is HIGHLY recommended. While earlier
|
||||
versions may work, they may produce suboptimal results and buggy behavior.
|
||||
Libglademm is not needed when using GTK / Gtkmm 2.12.
|
||||
* Gtkmm, version 3.4 or higher - see http://www.gtkmm.org .
|
||||
|
||||
Most of these packages are probably already provided by your distribution.
|
||||
Here are the packages you need to have to build GSmartControl on some Linux
|
||||
distributions:
|
||||
|
||||
openSUSE, SLES, SLED:
|
||||
gcc-c++, pcre-devel, gtkmm2-devel, (possibly) libglademm-devel.
|
||||
gcc-c++, pcre-devel, gtkmm3-devel.
|
||||
|
||||
Fedora, CentOS, RHEL:
|
||||
gcc-c++, pcre-devel, gtkmm24-devel, (possibly) libglademm24-devel.
|
||||
|
||||
Mandriva:
|
||||
gcc-c++, gcc-cpp, libpcre-devel, gtkmm2.4-devel, (possibly)
|
||||
libglademm2.4-devel.
|
||||
gcc-c++, pcre-devel, gtkmm30-devel.
|
||||
|
||||
Ubuntu, Debian GNU/Linux:
|
||||
g++, libpcre3-dev, libgtkmm-2.4-dev, (possibly) libglademm-2.4-dev.
|
||||
g++, libpcre3-dev, libgtkmm-3.0-dev.
|
||||
|
||||
Note that usually you need to specify only these packages - the rest is
|
||||
installed automatically by the package manager's dependency resolver. Keep in
|
||||
@@ -132,31 +122,27 @@ Note: If using the official Windows package, the requirements are listed on
|
||||
GSmartControl's website.
|
||||
|
||||
|
||||
|
||||
The following operating systems are supported:
|
||||
|
||||
* Linux - All the popular configurations should work.
|
||||
|
||||
* FreeBSD - Tested with DesktopBSD 1.6 (FreeBSD 6.3) / x86.
|
||||
* FreeBSD - Tested with DesktopBSD / x86.
|
||||
|
||||
* NetBSD - Tested with NetBSD 4.0.1 / x86.
|
||||
* NetBSD - Tested with NetBSD / x86.
|
||||
|
||||
* OpenBSD - Tested with OpenBSD 4.3 / x86-64 / gcc-3.3.5.
|
||||
|
||||
* Windows (2000 SP4 or newer) - Tested with Windows 2000 SP4, XP SP2 and Vista
|
||||
SP1. The Windows port uses pd0, pd1, etc... for physical drives 0, 1, etc... .
|
||||
|
||||
* Solaris - Tested with Solaris 10 / x86 / gcc-3.4.3 / blastwave,
|
||||
Solaris 10 / x86 / sunstudio12 / sunfreeware. OpenSolaris should work but has
|
||||
not been tested yet. Note: smartctl doesn't seem to support ATA under Solaris,
|
||||
while GSmartControl doesn't support SCSI yet. This only leaves various USB to
|
||||
ATA bridges. See smartctl (5), -d option for details.
|
||||
|
||||
* Mac OS X - 3rd-party testing by Fink project.
|
||||
* OpenBSD - Tested with OpenBSD / x86-64.
|
||||
|
||||
* DragonFlyBSD - Code written but no testing has been performed yet. Expected
|
||||
to work without any issues.
|
||||
|
||||
* Windows Vista SP2 (32-bit and 64-bit), Windows 7 SP1, Windows Server 2008,
|
||||
Windows 8.1, Windows 10. The Windows port uses pd0, pd1, etc...
|
||||
for physical drives 0, 1, etc... .
|
||||
|
||||
* Solaris.
|
||||
|
||||
* Mac OS X - 3rd-party testing by the MacPorts and Fink projects.
|
||||
|
||||
* QNX - Code written but no testing has been performed yet.
|
||||
|
||||
|
||||
@@ -189,6 +175,18 @@ directly from the build directory.
|
||||
|
||||
|
||||
|
||||
Smartctl Options
|
||||
|
||||
GSmartControl tries its best to guard the user from having to specify smartctl
|
||||
options. However, this is not always possible due to drive firmware bugs,
|
||||
unimplemented features, and so on. The smartctl manual page contains all the
|
||||
information you may need when dealing with smartctl.
|
||||
See http://smartmontools.sourceforge.net/man/smartctl.8.html
|
||||
|
||||
Additional information is available at http://smartmontools.sourceforge.net
|
||||
|
||||
|
||||
|
||||
Command Line Options
|
||||
|
||||
GSmartControl inherits options from GTK+ and other libraries, so be sure to
|
||||
@@ -202,18 +200,24 @@ The most important parameters are:
|
||||
|
||||
-?, --help - Show help options.
|
||||
|
||||
-V, --version - Display version information.
|
||||
-l, --no-locale - Don't use system locale.
|
||||
|
||||
-l, --no-locale - Disable locale.
|
||||
-V, --version - Display version information.
|
||||
|
||||
--no-scan - Don't scan devices on startup.
|
||||
|
||||
--no-hide-tabs - Don't hide non-identity tabs when SMART is disabled.
|
||||
--no-hide-tabs - Don't hide non-identity tabs when SMART is disabled. Useful
|
||||
for debugging.
|
||||
|
||||
--add-virtual - Load smartctl data from file, creating a virtual drive.
|
||||
--add-virtual - Load smartctl data from file, creating a virtual drive. You
|
||||
can specify this option multiple times.
|
||||
|
||||
--add-device - Add this device to device list. Useful with --no-scan to list
|
||||
certain drives only.
|
||||
--add-device - Add this device to device list. The format of the device is
|
||||
"<device>::<type>::<extra_args>", where type and extra_args are optional. This
|
||||
option is useful with --no-scan to list certain drives only. You can specify
|
||||
this option multiple times.
|
||||
Example: --add-device /dev/sda --add-device /dev/twa0::3ware,2 --add-device
|
||||
'/dev/sdb::::-T permissive'.
|
||||
|
||||
-v, --verbose - Enable verbose logging; same as --verbosity-level 5.
|
||||
|
||||
@@ -281,8 +285,8 @@ For more information, see smartctl and smartd documentation.
|
||||
|
||||
Known Issues
|
||||
|
||||
Only ATA drives (both PATA and SATA) and various USB to ATA bridges are
|
||||
supported for now. The main reasons are:
|
||||
Only ATA drives (both PATA and SATA), various USB to ATA bridges and drives
|
||||
behind some RAID controllers are supported for now. The main reasons are:
|
||||
|
||||
* We can't support drives which don't work with smartmontools. This affects
|
||||
drives which don't support SMART or don't export SMART data correctly (e.g.
|
||||
@@ -292,7 +296,7 @@ some USB enclosures, RAIDs, etc...).
|
||||
Also, SCSI drives are rarely found in desktop systems and the servers rarely
|
||||
have X11 / Gtkmm running, so this is a low priority task.
|
||||
|
||||
* I only have ATA drives, so testing would be almost impossible.
|
||||
* I only have ATA drives, so testing anything else is very difficult.
|
||||
|
||||
Immediate Offline Tests are not supported. I haven't found a way to reliably
|
||||
monitor them yet. Besides, they run automatically anyway if Automatic Offline
|
||||
@@ -304,9 +308,6 @@ information in capabilities.
|
||||
Not all drives support disabling Automatic Offline Data Collection, even if
|
||||
they report otherwise. Unfortunately, there's no way to detect such drives.
|
||||
|
||||
Running on GTK+ / Gtkmm versions earlier than 2.12 may cause visual artifacts,
|
||||
usability issues (especially with tooltips and icons), instability, etc...
|
||||
|
||||
The texts probably contain a lot of grammatical errors, English being my third
|
||||
language and all.
|
||||
|
||||
@@ -329,11 +330,11 @@ If you still think it's a GSmartControl issue, please collect the following
|
||||
information about your system. Without it, it may be very hard or impossible
|
||||
to fix the bug.
|
||||
|
||||
* Which operating system you use (for example, openSUSE Linux 11.0).
|
||||
* Which operating system you use (for example, openSUSE Linux 11.4).
|
||||
|
||||
* Which version of GTK and Gtkmm you have installed. Finding this out is very
|
||||
distribution-specific. For example, on openSUSE it would be
|
||||
"rpm -q gtk2 gtkmm2". Some distributions have gtkmm24 instead. You may also
|
||||
"rpm -q gtk3 gtkmm3". Some distributions have gtkmm30 instead. You may also
|
||||
search them in your distribution's graphical package manager, if there is one.
|
||||
|
||||
* Execution log from the program, if possible. To obtain it, run the program
|
||||
@@ -0,0 +1,242 @@
|
||||
|
||||
|
||||
GTKMM Notes:
|
||||
|
||||
To transfer an ownership from your local code to a container, use
|
||||
Gtk::Button* pButton = Gtk::manage(new Gtk::Button("Test"));
|
||||
container->add(*pButton);
|
||||
(add() takes an object by reference).
|
||||
otherwise, you will need to delete() it.
|
||||
|
||||
local scope destruction also works if using stack variables.
|
||||
{
|
||||
Gtk::Button aButton;
|
||||
// destroyed here
|
||||
}
|
||||
|
||||
|
||||
A treeview (also iconview, combobox) from glade comes
|
||||
with existing model, which should be unset.
|
||||
|
||||
|
||||
Bugs / patches:
|
||||
Patch pangomm for Pango::strip_markup().
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------
|
||||
|
||||
TODO:
|
||||
|
||||
Don't rely on smartctl return code (2), parse the output instead.
|
||||
This will allow us to show the Info page.
|
||||
|
||||
?Fix not being able to quit while executing commands.
|
||||
Cannot reproduce.
|
||||
https://www.google.com/search?client=opera&q=IA__gtk_main_quit:+assertion+%60main_loops+!=+NULL'+failed&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest
|
||||
https://developer.gnome.org/gtk2/2.24/gtk2-General.html#gtk-main-quit
|
||||
https://www.google.com/search?num=50&hl=en&safe=off&client=opera&hs=Dr5&channel=suggest&q=calling+gtk_main_quit+during+gtk_main_iteration+warning&oq=calling+gtk_main_quit+during+gtk_main_iteration+warning&gs_l=serp.12...7064.8155.0.12753.8.8.0.0.0.0.216.935.0j6j1.7.0.les%3B..0.0...1c.1.4.serp.GUiDL5IM2U8
|
||||
https://developer.gnome.org/glib/2.34/glib-The-Main-Event-Loop.html#g-main-loop-quit
|
||||
|
||||
|
||||
In main window add multi-selection support and right-click menu with various
|
||||
tests, so that it's possible to run multiple tests in parallel from there.
|
||||
|
||||
|
||||
Areca detection
|
||||
Linux:
|
||||
Somehow differentiate between the cards with expanders (-d areca,N/E) and without (-d areca,N).
|
||||
The expander ones seem to have "ix" (case-insensitive) as their name suffixes.
|
||||
areca,N - N is [1,24].
|
||||
areca,N/E - N is [1,128], E is [1,8].
|
||||
We should limit these using some config key (36 for N and 4 for E seems ok).
|
||||
N/E syntax is since smartmontools 5.43.
|
||||
For older versions we get: /dev/<something>: Option -d areca,N requires N to be a non-negative integer
|
||||
|
||||
|
||||
|
||||
|
||||
Add ability (through ctrl-C?) to copy individual rows from attributes page,
|
||||
in tab-separated format (for easy pasting into libreoffice).
|
||||
|
||||
|
||||
Investiage the new "-l ssd" and "-l devstat" options (since 5.42)
|
||||
|
||||
Check also other options in 5.42 and 5.43.
|
||||
"-g all" looks promising alongside -i (shows APM and other stuff as well).
|
||||
|
||||
Add --identify option to context menu, for convenience.
|
||||
|
||||
Add menu item - "update drive database" (not sure about linux, should
|
||||
check if it's supported first; also need to run it in terminal).
|
||||
|
||||
|
||||
Testing:
|
||||
If ETA time has elapsed, but it's still only at 10% completion,
|
||||
ETA 0 is displayed. Fix.
|
||||
If smartctl -t ... returns an error, testing=true should not be set.
|
||||
Can't reproduce it?
|
||||
Detect running tests on launch (maybe ask the user too? some tests
|
||||
may be stuck due to bad firmware, e.g. 3ware/windows).
|
||||
|
||||
|
||||
|
||||
48-bit ATA command support:
|
||||
'-l xerror' -> Extended Comprehensive Error log: An multi-sector and
|
||||
LBA48 capable version of '-l error'. Output is similar, except more
|
||||
entries can exists and the high bytes of the registers are also printed.
|
||||
Some newer drives (Samsung) only write to this log.
|
||||
|
||||
'-l xselftest' -> Extended Self Test Log: An multi-sector and LBA48
|
||||
capable version of '-l selftest'. Output will be similar, except more
|
||||
entries can exists and the LBA values can be somewhat longer.
|
||||
|
||||
"smartctl -l this_wont_exist" gives the list of supported logs - this
|
||||
is needed to detect xerror / xselftest support in smartctl.
|
||||
|
||||
|
||||
Rework drive properties UI:
|
||||
use 48-bit or not or auto.
|
||||
Enable/disable/dont_touch SMART on startup for this drive.
|
||||
Enable/disable/dont_touch AODC on startup for this drive.
|
||||
Add --init-smart-only option to only apply the SMART/AODC enabling status
|
||||
from the drive properties.
|
||||
Add also --no-init-smart to avoid doing that on GUI startup.
|
||||
|
||||
Notifications:
|
||||
Tied to (drive::subdrive, notif_key, exact_value(optional)).
|
||||
If exact_value isn't specified when ignoring, notify on every value change.
|
||||
Ignore options:
|
||||
Per-drive: Ignore all notifications for this key, ignore only this value.
|
||||
Don't generate multiple notifications for the same drive/key combo.
|
||||
Clearing in preferences: Clear all ignored, clear ignored for this drive, clear individual.
|
||||
Soft-warnings require "-a" by default, tricky for scsi (maybe try -a, then -i?).
|
||||
|
||||
Monitor:
|
||||
Needs root access, so not gonna happen until the dbus/udisks stuff
|
||||
is finalized.
|
||||
Same program, add --tray option to start in tray only.
|
||||
Option to enable the tray icon.
|
||||
Option to continue running in the tray on window close.
|
||||
Use freedesktop notifications when notifications are generated
|
||||
and we're running in tray only.
|
||||
Don't generate the same notification at a single run time if it was
|
||||
ignored (untouched) by the user; Change the tray icon and
|
||||
show them in the main window instead.
|
||||
Periodically re-run smartctl to refresh the notifications.
|
||||
Periodically see if drives were added / removed (possibly use OS callbacks
|
||||
instead of polling?)
|
||||
|
||||
Win7 widget:
|
||||
Can be done in html/js.
|
||||
Shows temperature
|
||||
Detects drives
|
||||
Opens GSmartControl
|
||||
|
||||
If a drive is not recognized, suggest using -d (sat, sat,12, ...)
|
||||
Refer the user to
|
||||
http://sourceforge.net/apps/trac/smartmontools/wiki/Supported_USB-Devices
|
||||
|
||||
|
||||
|
||||
RAID:
|
||||
http://sourceforge.net/apps/trac/smartmontools/wiki/Supported_RAID-Controllers
|
||||
|
||||
Areca Windows:
|
||||
Detection not supported by smartctl --scan-open.
|
||||
|
||||
Areca FreeBSD: since 5.42.
|
||||
Call as: smartctl -a -d areca,[1-24] /dev/arcmsr1
|
||||
|
||||
3ware FreeBSD:
|
||||
Call as: smartctl -i -d 3ware,[0-127] /dev/twa0 (or twe0)
|
||||
Detection: unknown.
|
||||
|
||||
LSI MegaRAID (SCSI/SAS), Linux:
|
||||
Call as: smartctl -i -d megaraid,[0-?] /dev/sda
|
||||
We should differentiate between ordinary sda and RAID one (not sure if sda is detected).
|
||||
Detection: unknown.
|
||||
|
||||
HighPoint RocketRAID ((S)ATA) Linux:
|
||||
Call as: smartctl -i -d hpt,[1-8]/[1-8] /dev/sda
|
||||
Call as: smartctl -i -d hpt,[1-8]/[1-8]/[1-15] /dev/sda
|
||||
Note: /dev/sda should be derived from this controller.
|
||||
We should differentiate between ordinary sda and RAID one (not sure if sda is detected).
|
||||
Smartctl docs specify smaller limits, but the code says these are the ones.
|
||||
Detection: unknown.
|
||||
|
||||
HighPoint RocketRAID ((S)ATA) FreeBSD:
|
||||
Call as: smartctl -i -d hpt,[1-8]/[1-8] /dev/hptrr
|
||||
Call as: smartctl -i -d hpt,[1-8]/[1-8]/[1-15] /dev/hptrr
|
||||
Note: /dev/hptrr should be derived from this controller.
|
||||
Smartctl docs specify smaller limits, but the code says these are the ones.
|
||||
Detection: unknown.
|
||||
TODO: Analyze sent info.
|
||||
|
||||
CCISS (HP (Compaq) Smart Array Controller) FreeBSD:
|
||||
Seems to be the same as Linux (uses the same driver?).
|
||||
Detection: unknown.
|
||||
|
||||
|
||||
|
||||
|
||||
libdebug:
|
||||
per-channel disabling.
|
||||
per-channel formatting.
|
||||
all flags should be per-channel.
|
||||
bug: if -q is passed, Execution log doesn't contain libdebug log. (requires per-channel status control).
|
||||
use format_time() instead of ctime() and friends, with ISO formatting.
|
||||
|
||||
|
||||
|
||||
'-l sataphy' -> SATA Phy event counters: Non-SMART feature, useful to detect SATA cabling problems.
|
||||
|
||||
|
||||
SCT Temperatures
|
||||
-l scttemp prints temperature and history.
|
||||
-t scttempint,N[,p] (N - count, p - preserve across reset or not).
|
||||
This configures temperature logging interval (1 min by default) and clears the history.
|
||||
-l scterc[,...] to get/set the SCT Error Recovery Control time limit (5.40 and newer).
|
||||
|
||||
|
||||
Add detection for Interix (i586-pc-interix3), maybe with debian?
|
||||
|
||||
|
||||
|
||||
|
||||
----------- SMART stuff ----------
|
||||
|
||||
|
||||
Run one-time Immediate Offline test (-t offline).
|
||||
Offline tests only update Attributes, and if errors are found they will
|
||||
appear in SMART error log. Self-test logs are unaffected.
|
||||
Abort (-X). Abort works with Offline only if there's
|
||||
"Abort Offline collection upon new command" capability.
|
||||
If the drive has "Suspend Offline collection upon new command" capability,
|
||||
immediate offline test may be tracked through --capabilities (not on mine!).
|
||||
If it's "Abort Offline collection upon new command", then the test
|
||||
will abort on --capabilities or --abort.
|
||||
|
||||
|
||||
Polling time
|
||||
The self-test routine recommended polling time shall be equal to the number of minutes that is the minimum
|
||||
recommended time before which the host should first poll for test completion status. Actual test time could
|
||||
be several times this value. Polling before this time could extend the self-test execution time or abort the test
|
||||
depending on the state of bit 2 of the off-line data capability bits.
|
||||
|
||||
Autosave
|
||||
This command enables and disables the optional attribute autosave feature of the device. This command
|
||||
may either allow the device, after some vendor specified event, to save the device updated attribute values
|
||||
to non-volatile memory; or this command may cause the autosave feature to be disabled. The state of the
|
||||
attribute autosave feature (either enabled or disabled) shall be preserved by the device across power cycles.
|
||||
A value of zero written by the host into the device’s Sector Count register before issuing this command shall
|
||||
cause this feature to be disabled. Disabling this feature does not preclude the device from saving SMART
|
||||
data to non-volatile memory during some other normal operation such as during a power-on or power-off
|
||||
sequence or during an error recovery sequence.
|
||||
A value of F1h written by the host into the device’s Sector Count register before issuing this command shall
|
||||
cause this feature to be enabled. Any other meaning of this value or any other non-zero value written by the
|
||||
host into this register before issuing this command may differ from device to device. The meaning of any
|
||||
non-zero value written to this register at this time shall be preserved by the device across power cycles.
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ AC_DEFUN([APP_COMPILER_OPTIONS], [
|
||||
# ---- Common compiler options (warnings, etc...)
|
||||
|
||||
AC_ARG_ENABLE(common-options, AS_HELP_STRING([--enable-common-options=<compiler>|auto|none],
|
||||
[enable useful compilation options (warnings, mostly). Accepted values are auto, none, gnu, intel, sun. (Default: auto)]),
|
||||
[enable useful compilation options (warnings, mostly). Accepted values are auto, none, gnu, clang, intel, sun. (Default: auto)]),
|
||||
[app_cv_compiler_common_options=${enableval}], [app_cv_compiler_common_options=auto])
|
||||
|
||||
# the default value is "yes" (if no value given after =), treat it as auto.
|
||||
@@ -47,8 +47,8 @@ AC_DEFUN([APP_COMPILER_OPTIONS], [
|
||||
|
||||
if test "x$app_cv_compiler_common_options" != "xnone"; then
|
||||
|
||||
# gcc / gnu environment, mingw, cygwin.
|
||||
if test "x$app_cv_compiler_common_options" = "xgnu"; then
|
||||
# gcc (or clang) / gnu environment, mingw, cygwin.
|
||||
if test "x$app_cv_compiler_common_options" = "xgnu" || test "x$app_cv_compiler_common_options" = "xclang"; then
|
||||
|
||||
if test "x$app_cv_target_os_env" = "xmingw32" || test "x$app_cv_target_os_env" = "xmingw64" \
|
||||
|| test "x$app_cv_target_os_env" = "xcygwin"; then
|
||||
@@ -60,10 +60,13 @@ AC_DEFUN([APP_COMPILER_OPTIONS], [
|
||||
app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -mms-bitfields"
|
||||
fi
|
||||
|
||||
# Note: Disabled -Wconversion, it was causing lots of silly warnings under x86-64.
|
||||
app_cv_compiler_tmp_var="-Wall -Wcast-align -Wcast-qual -Wconversion \
|
||||
-Wctor-dtor-privacy -Wfloat-equal -Wnon-virtual-dtor -Woverloaded-virtual \
|
||||
-Wfloat-equal -Wnon-virtual-dtor -Woverloaded-virtual \
|
||||
-Wpointer-arith -Wshadow -Wsign-compare -Wsign-promo -Wundef -Wwrite-strings";
|
||||
if test "x$app_cv_compiler_common_options" = "xclang"; then
|
||||
# these are really annoying
|
||||
app_cv_compiler_tmp_var="$app_cv_compiler_tmp_var -Wno-sign-conversion -Wno-format-security"
|
||||
fi
|
||||
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags $app_cv_compiler_tmp_var";
|
||||
app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags $app_cv_compiler_tmp_var";
|
||||
|
||||
@@ -103,7 +106,7 @@ AC_DEFUN([APP_COMPILER_OPTIONS], [
|
||||
# ---- Compiler options for debug builds
|
||||
|
||||
AC_ARG_ENABLE(debug-options, AS_HELP_STRING([--enable-debug-options=<compiler>|auto|none],
|
||||
[enable debug build options. Accepted values are auto, none, gnu, intel, sun. (Default: none)]),
|
||||
[enable debug build options. Accepted values are auto, none, gnu, clang, intel, sun. (Default: none)]),
|
||||
[app_cv_compiler_debug_options=${enableval}], [app_cv_compiler_debug_options=none])
|
||||
|
||||
# the default value is "yes" (if no value given after =), treat it as auto.
|
||||
@@ -125,7 +128,7 @@ AC_DEFUN([APP_COMPILER_OPTIONS], [
|
||||
AC_DEFINE([DEBUG_BUILD], [1], [Defined for debug builds])
|
||||
|
||||
# gcc, mingw
|
||||
if test "x$app_cv_compiler_debug_options" = "xgnu"; then
|
||||
if test "x$app_cv_compiler_debug_options" = "xgnu" || test "x$app_cv_compiler_debug_options" = "xclang"; then
|
||||
# We could put libstdc++ debug options here, but it generates binary-incompatible
|
||||
# C++ code, which leads to runtime errors with e.g. libsigc++.
|
||||
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -g3 -O0";
|
||||
@@ -155,7 +158,7 @@ AC_DEFUN([APP_COMPILER_OPTIONS], [
|
||||
# ---- Compiler options for optimized builds
|
||||
|
||||
AC_ARG_ENABLE(optimize-options, AS_HELP_STRING([--enable-optimize-options=<compiler>|auto|none],
|
||||
[enable optimized build options. Accepted values are auto, none, gnu, intel, sun. (Default: none)]),
|
||||
[enable optimized build options. Accepted values are auto, none, gnu, clang, intel, sun. (Default: none)]),
|
||||
[app_cv_compiler_optimize_options=${enableval}], [app_cv_compiler_optimize_options=none])
|
||||
|
||||
# the default value is "yes" (if no value given after =), treat it as auto.
|
||||
@@ -173,7 +176,7 @@ AC_DEFUN([APP_COMPILER_OPTIONS], [
|
||||
if test "x$app_cv_compiler_optimize_options" != "xnone"; then
|
||||
|
||||
# gcc, mingw
|
||||
if test "x$app_cv_compiler_optimize_options" = "xgnu"; then
|
||||
if test "x$app_cv_compiler_optimize_options" = "xgnu" || test "x$app_cv_compiler_optimize_options" = "xclang"; then
|
||||
# -mtune=generic is since gcc 4.0 iirc
|
||||
if test "x$app_cv_target_os_env" = "xmingw32"; then
|
||||
app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -g0 -O3 -s -march=i686";
|
||||
@@ -69,6 +69,8 @@ AC_DEFUN([APP_DETECT_OS_KERNEL], [
|
||||
|
||||
x86_64-*-mingw* | x86_64-*-cygwin*)
|
||||
# mingw64 defines the same stuff as 32-bit one, plus _WIN64, __MINGW64__, etc... .
|
||||
# Keep in mind that if you're generating a 32-bit application, the kernel will
|
||||
# be windows32 even if you run it on 64-bit Windows.
|
||||
app_cv_[]$1[]_os_kernel="windows64";
|
||||
app_cv_[]$1[]_os_kernel_macro="WINDOWS64";
|
||||
;;
|
||||
@@ -55,8 +55,8 @@ AC_DEFUN([APP_GET_MT_FLAGS], [
|
||||
linux)
|
||||
# glibc manual says that defining either _REENTRANT or _THREAD_SAFE
|
||||
# enables some thread-safe implementations of glibc functions.
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "intel" \
|
||||
|| test "$ax_cv_cxx_compiler_vendor" = "pathscale"; then
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "clang" \
|
||||
|| test "$ax_cv_cxx_compiler_vendor" = "intel" || test "$ax_cv_cxx_compiler_vendor" = "pathscale"; then
|
||||
app_cv_target_thread_cflags="-pthread -D_MT -D_THREAD_SAFE"
|
||||
app_cv_target_thread_cxxflags="-pthread -D_MT -D_THREAD_SAFE"
|
||||
app_cv_target_thread_libs="-pthread"
|
||||
@@ -77,12 +77,12 @@ AC_DEFUN([APP_GET_MT_FLAGS], [
|
||||
;;
|
||||
|
||||
windows*)
|
||||
# NOTE: Not sure about cygwin.
|
||||
# NOTE: Not sure about cygwin or clang.
|
||||
# NOTE: This only enables multithreaded code generation. For linking
|
||||
# with pthreads-win32 you need additional flags.
|
||||
# gcc man page: -mthreads: Support thread-safe exception handling on Mingw32.
|
||||
# -mthreads defines -D_MT, and links with -lmingwthrd.
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu"; then
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "clang"; then
|
||||
app_cv_target_thread_cflags="-mthreads -D_THREAD_SAFE"
|
||||
app_cv_target_thread_cxxflags="-mthreads -D_THREAD_SAFE"
|
||||
app_cv_target_thread_libs="-mthreads"
|
||||
@@ -104,7 +104,7 @@ AC_DEFUN([APP_GET_MT_FLAGS], [
|
||||
# NOTE: Not sure about debian gnu/kfreebsd and gnu/netbsd.
|
||||
# Freebsd had -kthread, but it has been discontinued (afaik).
|
||||
# For freebsd -pthread replaces libc with libc_r.
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu"; then
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "clang"; then
|
||||
app_cv_target_thread_cflags="-pthread -D_MT -D_THREAD_SAFE"
|
||||
app_cv_target_thread_cxxflags="-pthread -D_MT -D_THREAD_SAFE"
|
||||
app_cv_target_thread_libs="-pthread"
|
||||
@@ -113,7 +113,7 @@ AC_DEFUN([APP_GET_MT_FLAGS], [
|
||||
;;
|
||||
|
||||
openbsd)
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu"; then
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "clang"; then
|
||||
app_cv_target_thread_cflags="-pthread -D_REENTRANT"
|
||||
app_cv_target_thread_cxxflags="-pthread -D_REENTRANT"
|
||||
app_cv_target_thread_libs="-pthread"
|
||||
@@ -123,7 +123,7 @@ AC_DEFUN([APP_GET_MT_FLAGS], [
|
||||
|
||||
netbsd)
|
||||
# See sys/featuretest.h
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu"; then
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "clang"; then
|
||||
app_cv_target_thread_cflags="-pthread -D_REENTRANT"
|
||||
app_cv_target_thread_cxxflags="-pthread -D_REENTRANT"
|
||||
app_cv_target_thread_libs="-pthread"
|
||||
@@ -132,7 +132,7 @@ AC_DEFUN([APP_GET_MT_FLAGS], [
|
||||
;;
|
||||
|
||||
solaris)
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu"; then
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "clang"; then
|
||||
# gnu documentation mentions -threads (and its aliases, -pthreads and -pthread).
|
||||
# _REENTRANT is needed to enable some thread-safe equivalents of standard
|
||||
# functions.
|
||||
@@ -159,14 +159,14 @@ AC_DEFUN([APP_GET_MT_FLAGS], [
|
||||
;;
|
||||
|
||||
darwin)
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu"; then
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "clang"; then
|
||||
# Darwin produces mt code by default, and -pthread is an error.
|
||||
app_cv_target_thread_found="yes"
|
||||
fi
|
||||
;;
|
||||
|
||||
qnx)
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu"; then
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "clang"; then
|
||||
# afaik, gcc/qnx produces mt code by default (at least on newer qnx releases),
|
||||
# so no flags are needed.
|
||||
app_cv_target_thread_found="yes"
|
||||
@@ -89,7 +89,7 @@ AC_DEFUN([APP_USE_SYSTEM_EXTENSIONS], [
|
||||
# See sys/featuretest.h
|
||||
;;
|
||||
|
||||
mingw32)
|
||||
mingw*)
|
||||
# This enables standards-compliant stdio behaviour (regarding printf and
|
||||
# friends), as opposed to msvc-compatible one. This is usually enabled
|
||||
# by default if one of the usual macros are encountered (_XOPEN_SOURCE,
|
||||
@@ -98,14 +98,8 @@ AC_DEFUN([APP_USE_SYSTEM_EXTENSIONS], [
|
||||
# Other things to consider: _NO_OLDNAMES (disable "deprecated"
|
||||
# non-underscored names like chdir (use _chdir), etc...).
|
||||
# See _mingw.h for details.
|
||||
app_cv_target_extension_cflags="-D__USE_MINGW_ANSI_STDIO=1 -DWINVER=0x0500"
|
||||
app_cv_target_extension_cxxflags="-D__USE_MINGW_ANSI_STDIO=1 -DWINVER=0x0500"
|
||||
;;
|
||||
|
||||
mingw64)
|
||||
# Same as ming32, but enable "from xp" mode, since there's no x86_64 2k.
|
||||
app_cv_target_extension_cflags="-D__USE_MINGW_ANSI_STDIO=1 -DWINVER=0x0501"
|
||||
app_cv_target_extension_cxxflags="-D__USE_MINGW_ANSI_STDIO=1 -DWINVER=0x0501"
|
||||
app_cv_target_extension_cflags="-D__USE_MINGW_ANSI_STDIO=1 -DWINVER=0x0600" # Since Vista
|
||||
app_cv_target_extension_cxxflags="-D__USE_MINGW_ANSI_STDIO=1 -DWINVER=0x0600"
|
||||
;;
|
||||
|
||||
interix)
|
||||
@@ -53,7 +53,7 @@ AC_DEFUN([AX_COMPILER_VENDOR],
|
||||
AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
|
||||
[ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown
|
||||
# note: don't check for gcc first since some other compilers define __GNUC__
|
||||
for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do
|
||||
for ventest in clang:__clang__ intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do
|
||||
vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
|
||||
#if !($vencpp)
|
||||
@@ -16,7 +16,7 @@
|
||||
# autoconf
|
||||
|
||||
|
||||
autoreconf --verbose --install -W all
|
||||
autoreconf --verbose --install -W all --force
|
||||
|
||||
|
||||
rm -f config.cache
|
||||
@@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Configure a build directory according to developer flags
|
||||
|
||||
type="$1";
|
||||
configure_script="$2";
|
||||
|
||||
if [ "$type" == "" ]; then
|
||||
echo "Usage: $0 <type> [<configure_script>]"
|
||||
echo "where <type> is one of:"
|
||||
echo "debug optimized icc clang win32 win32-debug win64-debug sun portland open64";
|
||||
echo "<configure_script> is ../configure by default"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ "$configure_script" == "" ]; then
|
||||
configure_script="../configure";
|
||||
fi
|
||||
|
||||
|
||||
flags="";
|
||||
|
||||
case $type in
|
||||
gcc)
|
||||
flags="--enable-optimize-options --enable-tests" ;;
|
||||
gcc-debug)
|
||||
flags="--enable-debug-options --enable-tests" ;;
|
||||
clang-debug)
|
||||
flags="CC=clang CXX=clang++ --enable-debug-options --enable-tests" ;;
|
||||
icc-debug)
|
||||
flags="CC=icc64 CXX=icpc64 --enable-debug-options --enable-tests" ;;
|
||||
sun)
|
||||
flags="CC=suncc CXX=sunCC CFLAGS=\"-errwarn=%all -I/opt/sun/target64/include\" \
|
||||
CXXFLAGS=\"-I/opt/sun/target64/include\" PATH=\"/opt/sun/sunstudio/bin:$PATH\" \
|
||||
LDFLAGS=\"-R/opt/sun/target64/lib64 -L/opt/sun/target64/lib64\" \
|
||||
PKG_CONFIG_PATH=\"/opt/sun/target64/lib64/pkgconfig:/usr/lib64/pkgconfig\" \
|
||||
PKG_CONFIG_LIBDIR=\"\" --enable-tests" ;;
|
||||
|
||||
win32-cross)
|
||||
flags="PATH=\"/usr/i686-w64-mingw32/bin:/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH\" \
|
||||
--with-nsis=/usr/bin/makensis --with-windows-sysroot=/usr/i686-w64-mingw32/sys-root/mingw \
|
||||
--enable-optimize-options --enable-tests --host=i686-w64-mingw32" ;;
|
||||
win32-cross-debug)
|
||||
flags="PATH=\"/usr/i686-w64-mingw32/bin:/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH\" \
|
||||
--enable-debug-options --enable-tests --host=i686-w64-mingw32" ;;
|
||||
win64-cross)
|
||||
flags="PATH=\"/usr/x86_64-w64-mingw32/bin:/usr/x86_64-w64-mingw32/sys-root/mingw/bin:$PATH\" \
|
||||
--with-nsis=/usr/bin/makensis --with-windows-sysroot=/usr/x86_64-w64-mingw32/sys-root/mingw \
|
||||
--enable-optimize-options --enable-tests --host=x86_64-w64-mingw32" ;;
|
||||
win64-cross-debug)
|
||||
flags="PATH=\"/usr/x86_64-w64-mingw32/bin:/usr/x86_64-w64-mingw32/sys-root/mingw/bin:$PATH\" \
|
||||
--enable-debug-options --enable-tests --host=x86_64-w64-mingw32" ;;
|
||||
|
||||
win32-msys)
|
||||
flags="PATH=\"/mingw32/i686-w64-mingw32:/mingw32/bin:$PATH\" \
|
||||
--with-nsis=/mingw32/bin/makensis.exe --with-windows-sysroot=/mingw32 \
|
||||
--enable-optimize-options --enable-tests --host=i686-w64-mingw32" ;;
|
||||
win32-msys-debug)
|
||||
flags="PATH=\"/mingw32/i686-w64-mingw32:/mingw32/bin:$PATH\" \
|
||||
--enable-debug-options --enable-tests --host=i686-w64-mingw32" ;;
|
||||
win64-msys)
|
||||
flags="PATH=\"/mingw64/x86_64-w64-mingw32:/mingw64/bin:$PATH\" \
|
||||
--with-nsis=/mingw64/bin/makensis.exe --with-windows-sysroot=/mingw64 \
|
||||
--enable-optimize-options --enable-tests --host=x86_64-w64-mingw32" ;;
|
||||
win64-msys-debug)
|
||||
flags="PATH=\"/mingw64/x86_64-w64-mingw32:/mingw64/bin:$PATH\" \
|
||||
--enable-debug-options --enable-tests --host=x86_64-w64-mingw32" ;;
|
||||
esac
|
||||
|
||||
|
||||
echo "Running:"
|
||||
echo $configure_script $flags;
|
||||
|
||||
$configure_script $flags
|
||||
|
||||
|
||||
exit $?
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
AC_INIT([GSmartControl],[0.8.5],[],[gsmartcontrol])
|
||||
AC_INIT([GSmartControl],[1.0.0],[],[gsmartcontrol])
|
||||
|
||||
AC_CONFIG_SRCDIR([configure.ac])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
@@ -22,6 +22,7 @@ AC_PROG_CXX
|
||||
#AC_PROG_CXXCPP
|
||||
|
||||
#AM_PROG_LIBTOOL
|
||||
AM_PROG_AR
|
||||
|
||||
# C++ support in checks
|
||||
#AC_LANG([C])
|
||||
@@ -175,8 +176,7 @@ AC_ARG_ENABLE(abort-if-no-gtkmm, AS_HELP_STRING([--disable-abort-if-no-gtkmm],
|
||||
|
||||
AC_MSG_NOTICE([Abort if no gtkmm is found: $app_cv_abort_if_no_gtkmm])
|
||||
|
||||
# iconview is available since 2.6.0. gthread is not enabled by default.
|
||||
pkg_modules="gtkmm-2.4 >= 2.6.0" # gthread-2.0 >= 2.0
|
||||
pkg_modules="gtkmm-3.0 >= 3.4.0"
|
||||
|
||||
# define ENABLE_GLIB and friends if it's found.
|
||||
gtkmm_found="no"
|
||||
@@ -201,24 +201,11 @@ if test "x$gtkmm_found" = "xno"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# GTK flags must be prepended, or glib_config.h conflict between
|
||||
# gtk 2.x and 1.2 may occur.
|
||||
|
||||
#CFLAGS="$GTKMM_CFLAGS $CFLAGS"
|
||||
CXXFLAGS="$GTKMM_CFLAGS $CXXFLAGS"
|
||||
LIBS="$GTKMM_LIBS $LIBS"
|
||||
|
||||
|
||||
# Detect libglade / gtkbuilder support
|
||||
|
||||
APP_CHOOSE_GLD_READER([C++], [LIBGLADE_])
|
||||
|
||||
if test "$app_cv_gld_reader" = "libglade"; then
|
||||
CFLAGS="$CFLAGS $LIBGLADE_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $LIBGLADE_CXXFLAGS"
|
||||
LIBS="$LIBS $LIBGLADE_LIBS"
|
||||
fi
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
@@ -253,66 +240,51 @@ LIBS="$LIBS $PCRE_LIBS"
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Test stuff here...
|
||||
# <nothing>
|
||||
|
||||
#SDL_VERSION=1.2.0
|
||||
#AM_PATH_SDL($SDL_VERSION, :,
|
||||
# AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) )
|
||||
#CFLAGS="$CFLAGS $SDL_CFLAGS"
|
||||
#CXXFLAGS="$CXXFLAGS $SDL_CFLAGS "
|
||||
#LIBS="$LIBS $SDL_LIBS"
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Win32 distribution support (NSIS, zip)
|
||||
|
||||
AC_ARG_WITH([nsis], [AS_HELP_STRING([--with-nsis=<location>|auto],
|
||||
[specify makensis.exe location to support making NSIS packages]
|
||||
[ (default: "C:\Program Files\NSIS\makensis.exe" for windows, ]
|
||||
["~/.wine/drive_c/Program Files/NSIS/makensis.exe" for others)])],
|
||||
["~/.wine/drive_c/Program Files/NSIS/Unicode/makensis.exe" for others)])],
|
||||
[with_nsis=${withval}], [with_nsis=auto])
|
||||
|
||||
AC_ARG_ENABLE([nsis-wine], [AS_HELP_STRING([--enable-nsis-wine=yes|no|auto],
|
||||
[use wine to run makensis.exe when making NSIS packages (default: auto, which is no for windows, yes for others)])],
|
||||
[with_nsis_wine=${enableval}], [with_nsis_wine=yes])
|
||||
AC_ARG_ENABLE([nsis-wine], [AS_HELP_STRING([--enable-nsis-wine=yes|no],
|
||||
[use wine to run makensis.exe when making NSIS packages (default: no)])],
|
||||
[with_nsis_wine=${enableval}], [with_nsis_wine=no])
|
||||
|
||||
AC_ARG_WITH([windows-bindir], [AS_HELP_STRING([--with-windows-bindir],
|
||||
[specify location of Windows dlls and executables when making Windows packages (default: /cross/w32/target/bin)])],
|
||||
[with_windows_bindir=${withval}], [with_windows_bindir=auto])
|
||||
AC_ARG_WITH([windows-sysroot], [AS_HELP_STRING([--with-windows-sysroot],
|
||||
[specify location of Windows system root directory when making Windows packages (default: /mingw32)])],
|
||||
[with_windows_sysroot=${withval}], [with_windows_sysroot=auto])
|
||||
|
||||
if test "x$with_nsis" = "xauto" || test "x$with_nsis" = "x"; then
|
||||
if test "x$app_cv_build_os_kernel" = "xwindows"; then
|
||||
with_nsis="~/\".wine/drive_c/Program Files/NSIS/makensis.exe\"";
|
||||
else
|
||||
# if building on windows, use native paths
|
||||
if test "x$app_cv_build_os_kernel" = "xwindows32" || test "x$app_cv_build_os_kernel" = "xwindows64"; then
|
||||
with_nsis="\"C:\\Program Files\\NSIS\\makensis.exe\"";
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$with_nsis_wine" = "xauto"; then
|
||||
if test "x$app_cv_build_os_kernel" = "xwindows"; then
|
||||
with_nsis_wine="no";
|
||||
else
|
||||
with_nsis_wine="yes";
|
||||
with_nsis="~/\".wine/drive_c/Program Files/NSIS/Unicode/makensis.exe\"";
|
||||
fi
|
||||
fi
|
||||
|
||||
NSIS_EXEC="$with_nsis";
|
||||
if test "x$with_nsis_wine" != "xno"; then
|
||||
if test "x$with_nsis_wine" = "xyes"; then
|
||||
NSIS_EXEC="wine $with_nsis";
|
||||
fi
|
||||
|
||||
if test "x$with_windows_bindir" = "xauto" || test "x$with_windows_bindir" = "x"; then
|
||||
with_windows_bindir="/cross/w32/target/bin"
|
||||
if test "x$with_windows_sysroot" = "xauto" || test "x$with_windows_sysroot" = "x"; then
|
||||
with_windows_sysroot="/mingw32"
|
||||
fi
|
||||
WINDOWS_SYSROOT="$with_windows_sysroot";
|
||||
|
||||
WINDOWS_SUFFIX="";
|
||||
if test "x$app_cv_target_os_kernel" = "xwindows32"; then
|
||||
WINDOWS_SUFFIX="win32"
|
||||
elif test "x$app_cv_target_os_kernel" = "xwindows64"; then
|
||||
WINDOWS_SUFFIX="win64"
|
||||
fi
|
||||
WINDOWS_BINDIR="$with_windows_bindir";
|
||||
|
||||
AC_SUBST(NSIS_EXEC)
|
||||
AC_SUBST(WINDOWS_BINDIR)
|
||||
AC_SUBST(WINDOWS_SYSROOT)
|
||||
AC_SUBST(WINDOWS_SUFFIX)
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------------------
|
||||
@@ -320,13 +292,31 @@ AC_SUBST(WINDOWS_BINDIR)
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
RES_FILES="src/res/gsc_about_dialog.glade \
|
||||
src/res/gsc_executor_log_window.glade \
|
||||
src/res/gsc_help_window.glade \
|
||||
src/res/gsc_info_window.glade \
|
||||
src/res/gsc_main_window.glade \
|
||||
src/res/gsc_preferences_window.glade \
|
||||
src/res/gsc_text_window.glade \
|
||||
# Win32 security manifest support
|
||||
|
||||
WINDOWS_ARCH=""
|
||||
if test "x$app_cv_target_os_kernel" = "xwindows32"; then
|
||||
WINDOWS_ARCH="x86"
|
||||
elif test "x$app_cv_target_os_kernel" = "xwindows64"; then
|
||||
WINDOWS_ARCH="amd64"
|
||||
fi
|
||||
|
||||
AC_SUBST(WINDOWS_ARCH)
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
RES_FILES="src/res/gsc_about_dialog.ui \
|
||||
src/res/gsc_add_device_window.ui \
|
||||
src/res/gsc_executor_log_window.ui \
|
||||
src/res/gsc_help_window.ui \
|
||||
src/res/gsc_info_window.ui \
|
||||
src/res/gsc_main_window.ui \
|
||||
src/res/gsc_preferences_window.ui \
|
||||
src/res/gsc_text_window.ui \
|
||||
AUTHORS.txt LICENSE_gsmartcontrol.txt README.txt"
|
||||
|
||||
# Unfortunately, _SOURCES can't contain substitutions, so we use LIBADD.
|
||||
@@ -334,11 +324,6 @@ RES_LIBADD="" # .o file to put into .a, libres_a_LIBADD, libres_a_DEPENDENCIES.
|
||||
RES_DIST="" # only files in "res" directory, EXTRA_DIST
|
||||
RES_TARGETS="" # entry for each file in makefile
|
||||
|
||||
RES_GLD_EXT="glade"
|
||||
if test "$app_cv_gld_reader" = "gtkbuilder"; then
|
||||
RES_GLD_EXT="ui"
|
||||
fi
|
||||
|
||||
for RES_FILE in $RES_FILES;
|
||||
do # on separate line for portability
|
||||
RES_BASE=`echo "$RES_FILE" | sed 's/.*\///'` # "a/b/c" -> "c", "c" -> "c"
|
||||
@@ -354,28 +339,14 @@ do # on separate line for portability
|
||||
RES_FILE_CANON="\$(srcdir)/$RES_BASE" # shorter path, better make behaviour
|
||||
fi
|
||||
|
||||
# We use separate source files for gtkbuilder and libglademm, because
|
||||
# make dist should be able to bundle both of them separately.
|
||||
|
||||
if test "$RES_BASE_EXT" = "glade"; then
|
||||
|
||||
RES_LIBADD="$RES_LIBADD $RES_BASE_NOEXT.$RES_GLD_EXT.$ac_objext" # file.ui.o or file.glade.o
|
||||
|
||||
# Output both glade and ui rules. This way make dist will be able
|
||||
# to build cpp files of both of them.
|
||||
|
||||
if test "$RES_BASE_EXT" = "ui"; then
|
||||
RES_LIBADD="$RES_LIBADD $RES_BASE_NOEXT.ui.$ac_objext" # file.ui.o or file.glade.o
|
||||
RES_TARGETS="$RES_TARGETS
|
||||
$RES_BASE_NOEXT.ui.cpp: $RES_FILE_CANON
|
||||
gtk-builder-convert \"$RES_FILE_CANON\" \"$RES_BASE_NOEXT\".tmp_ui
|
||||
\"\$(top_srcdir)/file2csource.sh\" \"$RES_BASE_NOEXT\".tmp_ui \"$RES_BASE_NOEXT.ui.cpp\" \"$RES_BASE_NOEXT\"_ui
|
||||
"
|
||||
RES_TARGETS="$RES_TARGETS
|
||||
$RES_BASE_NOEXT.glade.cpp: $RES_FILE_CANON
|
||||
\"\$(top_srcdir)/file2csource.sh\" \"$RES_FILE_CANON\" \"$RES_BASE_NOEXT.glade.cpp\" \"$RES_BASE_NOEXT\"_ui
|
||||
\"\$(top_srcdir)/file2csource.sh\" \"$RES_FILE_CANON\" \"$RES_BASE_NOEXT.ui.cpp\" \"$RES_BASE_NOEXT\"_ui
|
||||
"
|
||||
|
||||
else # txt, etc...
|
||||
|
||||
SRC_FILE="$RES_BASE.cpp"
|
||||
RES_LIBADD="$RES_LIBADD $RES_BASE.$ac_objext" # file.txt.o
|
||||
|
||||
@@ -407,7 +378,8 @@ _AM_SUBST_NOTMAKE([RES_TARGETS])
|
||||
|
||||
ADDITIONAL_FLAGS="-DPACKAGE_PKGDATA_DIR=\"\\\"\$(pkgdatadir)\\\"\" \
|
||||
-DPACKAGE_SYSCONF_DIR=\"\\\"\$(sysconfdir)\\\"\" \
|
||||
-DTOP_SRC_DIR=\"\\\"\$(top_srcdir)\\\"\""
|
||||
-DTOP_SRC_DIR=\"\\\"\$(top_srcdir)\\\"\" \
|
||||
-DHZ_USE_GLOBAL_MACROS=1"
|
||||
|
||||
#CFLAGS="$CFLAGS $ADDITIONAL_FLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $ADDITIONAL_FLAGS"
|
||||
@@ -424,14 +396,14 @@ ADDITIONAL_INCLUDES="-I\$(top_builddir) -I\$(top_srcdir)/src -I\$(top_srcdir)/sr
|
||||
# with pgi and older sunstudio (the one in solaris10, for example).
|
||||
# Note: some gcc-frontend-based compilers may have to be added here
|
||||
# (e.g. gccfss (gcc frontend / sun backend), etc...).
|
||||
if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "intel" \
|
||||
|| test "$ax_cv_cxx_compiler_vendor" = "pathscale"; then
|
||||
# This auto-includes this file when compiling any file. Benefits include pch support.
|
||||
ADDITIONAL_INCLUDES="$ADDITIONAL_INCLUDES -include global_macros.h"
|
||||
else # sun, pgi, others...
|
||||
# This forces the file to be included manually.
|
||||
ADDITIONAL_INCLUDES="$ADDITIONAL_INCLUDES -DHZ_NO_COMPILER_AUTOINCLUDE"
|
||||
fi
|
||||
# We use -include only when using pch.
|
||||
# if test "x$app_cv_compiler_gcc_pch" = "xyes"; then
|
||||
# if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "clang" \
|
||||
# || test "$ax_cv_cxx_compiler_vendor" = "intel" || test "$ax_cv_cxx_compiler_vendor" = "pathscale"; then
|
||||
# # This auto-includes this file when compiling any file. Benefits include pch support.
|
||||
# ADDITIONAL_INCLUDES="$ADDITIONAL_INCLUDES -include global_macros.h"
|
||||
# fi
|
||||
# fi
|
||||
|
||||
# our flags must be before all the others
|
||||
#CFLAGS="$ADDITIONAL_INCLUDES $CFLAGS"
|
||||
@@ -501,10 +473,10 @@ AC_SUBST(AUTODIRS)
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
AC_CONFIG_FILES([ data/gsmartcontrol.desktop \
|
||||
AC_CONFIG_FILES([ data/gsmartcontrol.desktop data/gsmartcontrol.appdata.xml \
|
||||
data/nsis/distribution.txt data/nsis/gsmartcontrol.nsi \
|
||||
debian.dist/changelog \
|
||||
src/gsc_winres.rc \
|
||||
src/gsc_winres.rc src/gsmartcontrol.exe.manifest \
|
||||
gsmartcontrol.spec version compilation_flags ])
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#!/bin/bash
|
||||
############################################################################
|
||||
# Copyright:
|
||||
# (C) 2008 - 2009 Alex Butcher <alex dot butcher 'at' assursys.co.uk>
|
||||
# (C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
# License: See LICENSE_whatever.txt file
|
||||
# (C) 2008 - 2010 Alex Butcher <alex dot butcher 'at' assursys.co.uk>
|
||||
# (C) 2008 - 2010 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
# License: See LICENSE_unlicense.txt file
|
||||
############################################################################
|
||||
|
||||
device="$1";
|
||||
@@ -1,9 +1,9 @@
|
||||
#!/bin/bash
|
||||
############################################################################
|
||||
# Copyright:
|
||||
# (C) 2008 - 2009 Alex Butcher <alex dot butcher 'at' assursys.co.uk>
|
||||
# (C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
# License: See LICENSE_whatever.txt file
|
||||
# (C) 2008 - 2010 Alex Butcher <alex dot butcher 'at' assursys.co.uk>
|
||||
# (C) 2008 - 2010 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
# License: See LICENSE_unlicense.txt file
|
||||
############################################################################
|
||||
|
||||
if [ "$1" = "-V" ]; then
|
||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
@@ -13,7 +13,7 @@ uninstall-extra-mans:
|
||||
|
||||
# This command is needed if installing with make install (the cache
|
||||
# file is ignored for rpms).
|
||||
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
|
||||
gtk_update_icon_cache = gtk-update-icon-cache-3.0 -f -t $(datadir)/icons/hicolor
|
||||
|
||||
install-data-hook: install-extra-mans update-icon-cache
|
||||
uninstall-hook: uninstall-extra-mans update-icon-cache
|
||||
@@ -40,6 +40,10 @@ appdata_DATA = icon_cddvd.png icon_hdd.png
|
||||
desktopdir = $(datadir)/applications
|
||||
desktop_DATA = gsmartcontrol.desktop
|
||||
|
||||
# Appdata files
|
||||
metainfodir = $(datadir)/metainfo
|
||||
metainfo_DATA = gsmartcontrol.appdata.xml
|
||||
|
||||
|
||||
# Application pixmap (fallback icon for desktop files).
|
||||
# Same as 48/gsmartcontrol.png.
|
||||
@@ -0,0 +1,161 @@
|
||||
#!/usr/bin/env bash
|
||||
############################################################################
|
||||
# Copyright:
|
||||
# (C) 2008 - 2014 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
# License: See LICENSE_zlib.txt file
|
||||
############################################################################
|
||||
|
||||
# Run gsmartcontrol with root, asking for root password first.
|
||||
# export GSMARTCONTROL_SU to override a su command (e.g. "kdesu -c").
|
||||
|
||||
EXEC_BIN="@prefix@/bin/gsmartcontrol";
|
||||
prog_name="gsmartcontrol"
|
||||
|
||||
|
||||
# Preserve quotes in arguments
|
||||
final_args_quoted="";
|
||||
for i in "$@";do
|
||||
final_args_quoted="$final_args_quoted \"${i//\"/\\\"}\"";
|
||||
done;
|
||||
|
||||
|
||||
DESKTOP="auto";
|
||||
|
||||
# Compatibility with old syntax:
|
||||
# gsmartcontrol-root [<desktop> [program_options]]
|
||||
if [ "$1" == "auto" ] || [ "$1" == "kde" ] || [ "$1" == "gnome" ] || [ "$1" == "other" ]; then
|
||||
DESKTOP="$1";
|
||||
shift; # remove $1
|
||||
else
|
||||
# New syntax:
|
||||
# gsmartcontrol-root [--desktop=<auto|kde|gnome|other>] [program_options]
|
||||
|
||||
for arg in $*; do
|
||||
case $arg in
|
||||
--desktop=*)
|
||||
DESKTOP="${arg#*=}";
|
||||
final_args_quoted="${final_args_quoted/\"$arg\"/}";
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$DESKTOP" != "auto" ] && [ "$DESKTOP" != "kde" ] && \
|
||||
[ "$DESKTOP" != "gnome" ] && [ "$DESKTOP" != "other" ]; then
|
||||
echo "Usage: $0 [--desktop=<auto|kde|gnome|other>] [<${prog_name}_options>]";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
# Auto-detect current desktop if auto was specified.
|
||||
if [ "$DESKTOP" = "auto" ]; then
|
||||
# KDE_SESSION_UID is present on kde3 and kde4.
|
||||
# Note that it may be empty (but still set)
|
||||
if [ "${KDE_SESSION_UID+set}" = "set" ]; then
|
||||
DESKTOP="kde";
|
||||
# same with gnome
|
||||
elif [ "${GNOME_DESKTOP_SESSION_ID+set}" = "set" ]; then
|
||||
DESKTOP="gnome";
|
||||
else
|
||||
DESKTOP="other";
|
||||
fi
|
||||
fi
|
||||
|
||||
# echo $DESKTOP;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# They're basically the same, only the order is different.
|
||||
# sux requires xterm to ask for the password.
|
||||
# xdg-su is basically like this script, except worse :)
|
||||
# su-to-root is a debian/ubuntu official method (although gksu is available).
|
||||
gnome_sus="su-to-root gnomesu gksu kdesu beesu xdg-su sux";
|
||||
kde_sus="su-to-root kdesu gnomesu gksu beesu xdg-su sux";
|
||||
other_sus="$gnome_sus";
|
||||
|
||||
|
||||
candidates="";
|
||||
found_su=""
|
||||
|
||||
if [ "$DESKTOP" = "gnome" ]; then
|
||||
candidates="$gnome_sus";
|
||||
elif [ "$DESKTOP" = "kde" ]; then
|
||||
candidates="$kde_sus";
|
||||
elif [ "$DESKTOP" = "other" ]; then
|
||||
candidates="$other_sus";
|
||||
fi
|
||||
|
||||
if [ "$GSMARTCONTROL_SU" = "" ]; then
|
||||
for subin in $candidates; do
|
||||
which $subin &>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
found_su="$subin";
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$found_su" = "" ]; then
|
||||
xmessage "Error launching ${prog_name}: No suitable su mechanism found.
|
||||
Try installing kdesu, gnomesu, gksu, beesu or sux first.";
|
||||
exit 1;
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# gnomesu and gksu (but not kdesu, not sure about others) fail to adopt
|
||||
# root's PATH. Since the user's PATH may not contain /usr/sbin (with smartctl)
|
||||
# on some distributions (e.g. mandriva), add it manually. We also add
|
||||
# /usr/local/sbin, since that's the default location of custom-compiled smartctl.
|
||||
# Add these directories _before_ existing PATH, so that the user is not
|
||||
# tricked into running it from some other path (we're running as root with
|
||||
# the user's env after all).
|
||||
# Add @prefix@/sbin as well (freebsd seems to require it).
|
||||
# Note that beesu won't show a GUI login box if /usr/sbin is before /usr/bin,
|
||||
# so add it first as well.
|
||||
EXTRA_PATHS="/usr/bin:/usr/sbin:/usr/local/sbin:@prefix@/sbin";
|
||||
export PATH="$EXTRA_PATHS:$PATH"
|
||||
|
||||
|
||||
# echo $found_su;
|
||||
|
||||
# Examples:
|
||||
# gnomesu -c 'gsmartcontrol --no-scan'
|
||||
# kdesu -c 'gsmartcontrol --no-scan'
|
||||
# beesu -P 'gsmartcontrol --no-scan'
|
||||
# su-to-root -X -c 'gsmartcontrol --no-scan'
|
||||
# xterm -e sux -c 'gsmartcontrol --no-scan' # sux asks for password in a terminal
|
||||
|
||||
|
||||
full_cmd="";
|
||||
|
||||
if [ "$GSMARTCONTROL_SU" != "" ]; then
|
||||
full_cmd="$GSMARTCONTROL_SU '$EXEC_BIN $final_args_quoted'";
|
||||
|
||||
elif [ "$found_su" = "sux" ]; then
|
||||
full_cmd="xterm -e sux -c '$EXEC_BIN $final_args_quoted'";
|
||||
|
||||
elif [ "$found_su" = "gksu" ]; then
|
||||
full_cmd="$found_su '$EXEC_BIN $final_args_quoted'";
|
||||
|
||||
elif [ "$found_su" = "beesu" ]; then
|
||||
full_cmd="$found_su -P '$EXEC_BIN $final_args_quoted'";
|
||||
|
||||
elif [ "$found_su" = "su-to-root" ]; then
|
||||
full_cmd="$found_su -X -c '$EXEC_BIN $final_args_quoted'";
|
||||
|
||||
else # gnomesu, kdesu, xdg-su
|
||||
full_cmd="$found_su -c '$EXEC_BIN $final_args_quoted'";
|
||||
fi
|
||||
|
||||
|
||||
# echo $full_cmd
|
||||
eval $full_cmd
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
.TH GSmartControl "1" "" "gsmartcontrol " "User Commands"
|
||||
.SH NAME
|
||||
GSmartControl \- Hard disk drive health inspection tool
|
||||
GSmartControl \- Hard disk drive and SSD health inspection tool
|
||||
.SH SYNOPSIS
|
||||
\fBgsmartcontrol\fP [OPTIONS]
|
||||
|
||||
\fBgsmartcontrol\-root\fP [\fI<desktop>\fP [OPTIONS]]
|
||||
\fBgsmartcontrol\-root\fP [--desktop=\fI<desktop>\fP] [OPTIONS]
|
||||
.SH DESCRIPTION
|
||||
\fBGSmartControl\fP is a graphical user interface for smartctl (from
|
||||
smartmontools), which is a tool for querying and controlling SMART
|
||||
(Self-Monitoring, Analysis, and Reporting Technology) data on modern hard disk
|
||||
drives. It allows you to inspect the drive's SMART data to determine its
|
||||
health, as well as run various tests on it.
|
||||
and solid-state drives. It allows you to inspect the drive's SMART data to
|
||||
determine its health, as well as run various tests on it.
|
||||
.PP
|
||||
This manual page documents briefly the \fBgsmartcontrol\fP and
|
||||
\fBgsmartcontrol\-root\fP commands.
|
||||
@@ -37,7 +37,7 @@ Show logging options
|
||||
.SS "Application Options:"
|
||||
.TP
|
||||
\fB\-l\fP, \fB\-\-no\-locale\fP
|
||||
Disable locale
|
||||
Don't use system locale
|
||||
.TP
|
||||
\fB\-V\fP, \fB\-\-version\fP
|
||||
Display version information
|
||||
@@ -49,10 +49,17 @@ Don't scan devices on startup
|
||||
Don't hide non\-identity tabs when SMART is disabled. Useful for debugging.
|
||||
.TP
|
||||
\fB\-\-add\-virtual\fP
|
||||
Load smartctl data from file, creating a virtual drive
|
||||
Load smartctl data from file, creating a virtual drive. You
|
||||
can specify this option multiple times.
|
||||
.TP
|
||||
\fB\-\-add\-device\fP
|
||||
Add this device to device list. Useful with \fB\-\-no\-scan\fP to list certain drives only.
|
||||
Add this device to device list. The format of the device is
|
||||
\fI<device>::<type>::<extra_args>\fP, where type and extra_args are optional.
|
||||
This option is useful with \fB\-\-no\-scan\fP to list certain drives only. You
|
||||
can specify this option multiple times. Example:\fR
|
||||
.nf
|
||||
\-\-add\-device /dev/sda \-\-add\-device /dev/twa0::3ware,2 \-\-add\-device '/dev/sdb::::-T permissive'
|
||||
.fi
|
||||
.TP
|
||||
\fB\-\-display\fP=\fIDISPLAY\fP
|
||||
X display to use
|
||||
@@ -67,8 +74,8 @@ Disable logging; same as \fB\-\-verbosity\-level\fP 0
|
||||
Set verbosity level [0\-5]
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 2008 \- 2009 Alexander Shaduri <ashaduri \'at\' gmail.com>
|
||||
Copyright \(co 2008 \- 2012 Alexander Shaduri <ashaduri \'at\' gmail.com>
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
This manual page was originally written by Giuseppe Iuculano
|
||||
<giuseppe@iuculano.it>, for the Debian project.
|
||||
<giuseppe@iuculano.it> for the Debian project.
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright 2017 GSmartControl developers -->
|
||||
<component type="desktop">
|
||||
<id>gsmartcontrol</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-2.0 and GPL-3.0</project_license>
|
||||
<name>GSmartControl</name>
|
||||
<summary>Hard Disk and SSD Health Inspection</summary>
|
||||
<description>
|
||||
<p>
|
||||
GSmartControl is a graphical user interface for smartctl, which is a tool for
|
||||
querying and controlling SMART (Self-Monitoring, Analysis, and Reporting
|
||||
Technology) data in hard disk and solid-state drives. It allows you to inspect
|
||||
the drive's SMART data to determine its health, as well as run various tests
|
||||
on it.
|
||||
</p>
|
||||
</description>
|
||||
<launchable type="desktop-id">gsmartcontrol.desktop</launchable>
|
||||
<url type="homepage">http://gsmartcontrol.sourceforge.net</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<caption>Main window</caption>
|
||||
<image>http://gsmartcontrol.sourceforge.net/home/images/main_ok.png</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<caption>Drive identity information</caption>
|
||||
<image>http://gsmartcontrol.sourceforge.net/home/images/info_identity.png</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<caption>Attribute list of a failing drive</caption>
|
||||
<image>http://gsmartcontrol.sourceforge.net/home/images/info_failing.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
</component>
|
||||
@@ -8,9 +8,9 @@ Categories=System;Monitor;
|
||||
|
||||
Name=GSmartControl
|
||||
# short description, usually shown in parentheses after Name
|
||||
GenericName=Hard Disk Health Inspection
|
||||
GenericName=Hard Disk and SSD Health Inspection
|
||||
# tooltip
|
||||
Comment=Monitor and control SMART data on hard disks
|
||||
Comment=Monitor and control SMART data on hard disk and solid-state drives
|
||||
|
||||
# If it's a name only, it looks for "name.[png|xpm]" file in
|
||||
# $XDG_DATA_DIRS/icons and /usr/share/pixmaps.
|
||||
@@ -24,6 +24,3 @@ Icon=gsmartcontrol
|
||||
|
||||
# Run with root permissions.
|
||||
Exec="@prefix@/bin/gsmartcontrol-root"
|
||||
|
||||
# Build service rpmlint gives errors without this
|
||||
X-SuSE-translate=false
|
||||
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
@@ -0,0 +1,24 @@
|
||||
|
||||
GSmartControl - Hard disk drive and SSD health inspection tool
|
||||
Version @VERSION@
|
||||
|
||||
The latest version of this distribution, as well as the source code of
|
||||
GSmartControl, can be found at
|
||||
http://gsmartcontrol.sourceforge.net
|
||||
and
|
||||
https://sourceforge.net/projects/gsmartcontrol/files/
|
||||
|
||||
|
||||
This distribution includes:
|
||||
|
||||
* GSmartControl binary (gsmartcontrol.exe) and associated resources.
|
||||
The binary was compiled against Gtkmm (http://www.gtkmm.org/), GTK+
|
||||
(http://gtk.org/) and related libraries, and PCRE (http://www.pcre.org/).
|
||||
|
||||
* Smartctl binaries (from smartmontools 6.5, http://smartmontools.sf.net/)
|
||||
- smartctl-nc.exe (compiled without console output), smartctl.exe (compiled
|
||||
with console output), update-smart-drivedb.exe (drive database updater).
|
||||
|
||||
|
||||
The combined distribution is multi-licensed under GNU GPL versions 2 and 3.
|
||||
See LICENSE_gpl2.txt and LICENSE_gpl3.txt for details.
|
||||
@@ -0,0 +1,319 @@
|
||||
|
||||
; NSIS2 Script
|
||||
; by Alexander Shaduri <ashaduri 'at' gmail.com>.
|
||||
; Compatible with NSIS Unicode 2.45.
|
||||
; Public Domain
|
||||
|
||||
!define PRODUCT_VERSION "@VERSION@"
|
||||
!define PRODUCT_NAME "GSmartControl"
|
||||
!define PRODUCT_NAME_SMALL "gsmartcontrol"
|
||||
!define PRODUCT_PUBLISHER "Alexander Shaduri"
|
||||
!define PRODUCT_WEB_SITE "http://gsmartcontrol.sourceforge.net"
|
||||
|
||||
;!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\AppMainExe.exe"
|
||||
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
||||
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
||||
|
||||
|
||||
!include "FileFunc.nsh" ; GetOptions
|
||||
|
||||
|
||||
|
||||
; --------------- General Settings
|
||||
|
||||
|
||||
; This is needed for proper start menu item manipulation (for all users) in vista
|
||||
RequestExecutionLevel admin
|
||||
|
||||
; This compressor gives us the best results
|
||||
SetCompressor /SOLID lzma
|
||||
|
||||
; Do a CRC check before installing
|
||||
CRCCheck On
|
||||
|
||||
; This is used in titles
|
||||
Name "${PRODUCT_NAME}" ; ${PRODUCT_VERSION}
|
||||
|
||||
; Output File Name
|
||||
OutFile "${PRODUCT_NAME_SMALL}-${PRODUCT_VERSION}-@WINDOWS_SUFFIX@.exe"
|
||||
|
||||
|
||||
; The Default Installation Directory:
|
||||
; Try to install to the same directory as runtime.
|
||||
InstallDir "$PROGRAMFILES64\${PRODUCT_NAME}"
|
||||
; If already installed, try here
|
||||
InstallDirRegKey HKLM "SOFTWARE\${PRODUCT_NAME}" "InstallationDirectory"
|
||||
|
||||
|
||||
ShowInstDetails show
|
||||
ShowUnInstDetails show
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; --------------------- MUI INTERFACE
|
||||
|
||||
; MUI 2.0 compatible install
|
||||
!include "MUI2.nsh"
|
||||
!include "InstallOptions.nsh" ; section description macros
|
||||
|
||||
; Backgound Colors. uncomment to enable fullscreen.
|
||||
; BGGradient 0000FF 000000 FFFFFF
|
||||
|
||||
; MUI Settings
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_ICON "nsi_install.ico"
|
||||
!define MUI_UNICON "nsi_uninstall.ico"
|
||||
|
||||
|
||||
; Things that need to be extracted on first (keep these lines before any File command!).
|
||||
; Only useful for BZIP2 compression.
|
||||
;!insertmacro MUI_RESERVEFILE_LANGDLL
|
||||
;!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
|
||||
|
||||
|
||||
; Language Selection Dialog Settings
|
||||
;!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
|
||||
;!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
|
||||
;!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
|
||||
|
||||
!define LICENSE_FILE "doc\distribution.txt"
|
||||
|
||||
; Pages to show during installation
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MUI_PAGE_LICENSE "${LICENSE_FILE}"
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
;!define MUI_FINISHPAGE_RUN "$INSTDIR\gsmartcontrol.exe"
|
||||
;!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Example.file"
|
||||
;!define MUI_FINISHPAGE_RUN_NOTCHECKED
|
||||
!define MUI_FINISHPAGE_NOAUTOCLOSE
|
||||
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
|
||||
|
||||
; Uninstaller page
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
|
||||
|
||||
|
||||
; Language files
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
|
||||
|
||||
; --------------- END MUI
|
||||
|
||||
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "GSmartControl"
|
||||
|
||||
|
||||
var install_option_removeold ; uninstall the old version first (if present): yes (default), no.
|
||||
|
||||
|
||||
|
||||
; ----------------- INSTALLATION TYPES
|
||||
|
||||
; InstType "Recommended"
|
||||
; InstType "Full"
|
||||
; InstType "Minimal"
|
||||
|
||||
|
||||
|
||||
|
||||
Section "!GSmartControl" SecMain
|
||||
SectionIn 1 RO
|
||||
SetShellVarContext all ; use all user variables as opposed to current user
|
||||
SetOutPath "$INSTDIR"
|
||||
|
||||
SetOverwrite Off ; don't overwrite the config file
|
||||
; File "gsmartcontrol.conf"
|
||||
|
||||
SetOverwrite On
|
||||
File *.exe
|
||||
File *.dll
|
||||
File gsmartcontrol.exe.manifest
|
||||
File gsmartcontrol.ico
|
||||
File icon_*.png
|
||||
File drivedb.h
|
||||
|
||||
; Include the "doc" directory completely.
|
||||
File /r doc
|
||||
|
||||
; GTK and stuff
|
||||
File /r etc
|
||||
File /r share
|
||||
|
||||
; Add Shortcuts (this inherits the exe's run permissions)
|
||||
CreateShortCut "$SMPROGRAMS\GSmartControl.lnk" "$INSTDIR\gsmartcontrol.exe" "" \
|
||||
"$INSTDIR\gsmartcontrol.ico" "" SW_SHOWNORMAL "" "GSmartControl - Hard disk drive and SSD health inspection tool"
|
||||
|
||||
SectionEnd
|
||||
|
||||
|
||||
|
||||
; Executed on installation start
|
||||
Function .onInit
|
||||
SetShellVarContext all ; use all user variables as opposed to current user
|
||||
|
||||
${GetOptions} "$CMDLINE" "/removeold=" $install_option_removeold
|
||||
|
||||
Call PreventMultipleInstances
|
||||
|
||||
Call DetectPrevInstallation
|
||||
FunctionEnd
|
||||
|
||||
|
||||
|
||||
; ------------------ POST INSTALL
|
||||
|
||||
|
||||
Section -post
|
||||
SetShellVarContext all ; use all user variables as opposed to current user
|
||||
|
||||
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "InstallationDirectory" "$INSTDIR"
|
||||
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "Vendor" "${PRODUCT_PUBLISHER}"
|
||||
|
||||
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME}"
|
||||
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\gsmartcontrol_uninst.exe"
|
||||
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
|
||||
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
|
||||
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\gsmartcontrol.ico"
|
||||
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
|
||||
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
|
||||
WriteRegDWORD HKLM "${PRODUCT_UNINST_KEY}" "NoModify" 1
|
||||
WriteRegDWORD HKLM "${PRODUCT_UNINST_KEY}" "NoRepair" 1
|
||||
|
||||
; We don't need this, MUI takes care for us
|
||||
; WriteRegStr HKCU "Software\${PRODUCT_NAME}" "Installer Language" $sUAGE
|
||||
|
||||
; write out uninstaller
|
||||
WriteUninstaller "$INSTDIR\gsmartcontrol_uninst.exe"
|
||||
|
||||
; uninstall shortcut
|
||||
;CreateDirectory "$SMPROGRAMS\GSmartControl"
|
||||
;CreateShortCut "$SMPROGRAMS\GSmartControl\Uninstall GSmartControl.lnk" "$INSTDIR\gsmartcontrol_uninst.exe" "" ""
|
||||
|
||||
SectionEnd ; post
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; ---------------- UNINSTALL
|
||||
|
||||
|
||||
|
||||
Function un.onUninstSuccess
|
||||
HideWindow
|
||||
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." /SD IDOK
|
||||
FunctionEnd
|
||||
|
||||
|
||||
|
||||
|
||||
Section Uninstall
|
||||
SetShellVarContext all ; use all user variables as opposed to current user
|
||||
SetAutoClose false
|
||||
|
||||
; add delete commands to delete whatever files/registry keys/etc you installed here.
|
||||
Delete "$INSTDIR\gsmartcontrol_uninst.exe"
|
||||
|
||||
DeleteRegKey HKLM "SOFTWARE\${PRODUCT_NAME}"
|
||||
DeleteRegKey HKLM "${PRODUCT_UNINST_KEY}"
|
||||
|
||||
Delete "$INSTDIR\*.exe"
|
||||
Delete "$INSTDIR\*.dll"
|
||||
Delete "$INSTDIR\gsmartcontrol.exe.manifest"
|
||||
Delete "$INSTDIR\gsmartcontrol.ico"
|
||||
Delete "$INSTDIR\icon_*.png"
|
||||
|
||||
; update-smart-drivedb may leave these
|
||||
Delete "$INSTDIR\drivedb.h"
|
||||
Delete "$INSTDIR\drivedb.h.*"
|
||||
|
||||
RMDir /r "$INSTDIR\doc"
|
||||
|
||||
; GTK and stuff
|
||||
RMDir /r "$INSTDIR\etc"
|
||||
RMDir /r "$INSTDIR\share"
|
||||
|
||||
; clean up generated stuff
|
||||
Delete "$INSTDIR\*stdout.txt"
|
||||
Delete "$INSTDIR\*stderr.txt"
|
||||
|
||||
RMDir "$INSTDIR" ; only if empty
|
||||
|
||||
Delete "$SMPROGRAMS\GSmartControl.lnk"
|
||||
;Delete "$SMPROGRAMS\GSmartControl\Uninstall GSmartControl.lnk"
|
||||
|
||||
SectionEnd ; end of uninstall section
|
||||
|
||||
|
||||
|
||||
; --------------- Helpers
|
||||
|
||||
; Detect previous installation
|
||||
Function DetectPrevInstallation
|
||||
; if /removeold=no option is given, don't check anything.
|
||||
StrCmp $install_option_removeold "no" old_detect_done
|
||||
|
||||
SetShellVarContext all ; use all user variables as opposed to current user
|
||||
push $R0
|
||||
|
||||
; detect previous installation
|
||||
ReadRegStr $R0 HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
|
||||
StrCmp $R0 "" old_detect_done
|
||||
|
||||
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
|
||||
"${PRODUCT_NAME} is already installed. $\n$\nClick `OK` to remove the \
|
||||
previous version or `Cancel` to continue anyway." \
|
||||
/SD IDOK IDOK old_uninst
|
||||
; Abort
|
||||
goto old_detect_done
|
||||
|
||||
; Run the old uninstaller
|
||||
old_uninst:
|
||||
ClearErrors
|
||||
IfSilent old_silent_uninst old_nosilent_uninst
|
||||
|
||||
old_nosilent_uninst:
|
||||
ExecWait '$R0'
|
||||
goto old_uninst_continue
|
||||
|
||||
old_silent_uninst:
|
||||
ExecWait '$R0 /S _?=$INSTDIR'
|
||||
|
||||
old_uninst_continue:
|
||||
|
||||
IfErrors old_no_remove_uninstaller
|
||||
|
||||
; You can either use Delete /REBOOTOK in the uninstaller or add some code
|
||||
; here to remove to remove the uninstaller. Use a registry key to check
|
||||
; whether the user has chosen to uninstall. If you are using an uninstaller
|
||||
; components page, make sure all sections are uninstalled.
|
||||
old_no_remove_uninstaller:
|
||||
|
||||
old_detect_done: ; old installation not found, all ok
|
||||
|
||||
pop $R0
|
||||
FunctionEnd
|
||||
|
||||
|
||||
|
||||
; Prevent running multiple instances of the installer
|
||||
Function PreventMultipleInstances
|
||||
Push $R0
|
||||
System::Call 'kernel32::CreateMutexA(i 0, i 0, t ${PRODUCT_NAME}) ?e'
|
||||
Pop $R0
|
||||
StrCmp $R0 0 +3
|
||||
MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running." /SD IDOK
|
||||
Abort
|
||||
Pop $R0
|
||||
FunctionEnd
|
||||
|
||||
|
||||
|
||||
; eof
|
||||
|
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 766 B |
|
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 766 B |
@@ -0,0 +1,19 @@
|
||||
Source: gsmartcontrol
|
||||
Section: utils
|
||||
Priority: extra
|
||||
Homepage: http://gsmartcontrol.sourceforge.net/
|
||||
Maintainer: Alexander Shaduri <ashaduriREMOVETHIS@gmail.com>
|
||||
Build-Depends: debhelper (>= 5), autotools-dev,
|
||||
libpcre3-dev, libgtkmm-3.0-dev (>= 3.4.0)
|
||||
Standards-Version: 3.7.3
|
||||
|
||||
Package: gsmartcontrol
|
||||
Architecture: any
|
||||
#Depends: ${shlibs:Depends}, ${misc:Depends}, smartmontools, menu
|
||||
Depends: ${shlibs:Depends}, smartmontools, menu
|
||||
Description: Hard disk drive and SSD health inspection tool
|
||||
GSmartControl is a graphical user interface for smartctl (from smartmontools
|
||||
package), which is a tool for querying and controlling SMART
|
||||
(Self-Monitoring, Analysis, and Reporting Technology) data on modern hard
|
||||
disk and solid-state drives. It allows you to inspect the drive's SMART data
|
||||
to determine its health, as well as run various tests on it.
|
||||
@@ -1,11 +1,11 @@
|
||||
This package was debianized by Alexander Shaduri <ashaduri 'at' gmail.com> on
|
||||
Sat, 15 Nov 2008 00:12:04 +0400.
|
||||
|
||||
It was downloaded from <http://gsmartcontrol.berlios.de/>
|
||||
It was downloaded from <http://gsmartcontrol.sourceforge.net/>
|
||||
|
||||
Copyright:
|
||||
|
||||
Copyright (C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
Copyright (C) 2008 - 2017 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
|
||||
License:
|
||||
|
||||
@@ -27,6 +27,6 @@ On Debian systems, the complete text of the GNU General
|
||||
Public Licenses can be found in `/usr/share/common-licenses/GPL-2' and
|
||||
`/usr/share/common-licenses/GPL-3'.
|
||||
|
||||
The Debian packaging is (C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com> and
|
||||
The Debian packaging is (C) 2008 - 2017 Alexander Shaduri <ashaduri 'at' gmail.com> and
|
||||
is licensed under the GPLv2 and GPLv3, see above.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
?package(gsmartcontrol):needs="X11" section="Applications/System/Hardware"\
|
||||
title="GSmartControl" command="/usr/bin/gsmartcontrol-root"\
|
||||
longtitle="Hard Disk Health Inspection"\
|
||||
longtitle="Hard Disk and SSD Health Inspection"\
|
||||
icon="/usr/share/pixmaps/gsmartcontrol.xpm"
|
||||
@@ -0,0 +1,35 @@
|
||||
/**************************************************************************
|
||||
Copyright:
|
||||
(C) 2012 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
License: See LICENSE_gsmartcontrol.txt
|
||||
***************************************************************************/
|
||||
|
||||
// This file is for generating documentation only. Do NOT include it.
|
||||
/// \file
|
||||
/// \author Alexander Shaduri
|
||||
|
||||
/**
|
||||
\mainpage GSmartControl Index
|
||||
|
||||
|
||||
\section intro_section Introduction
|
||||
This is GSmartControl internal documentation.
|
||||
*/
|
||||
|
||||
// Group definitions and titles.
|
||||
|
||||
/**
|
||||
\addtogroup applib Application-Specific Components
|
||||
\addtogroup applib_tests Tests of Application-Specific Components
|
||||
\addtogroup hz HZ Common System Components
|
||||
\addtogroup hz_tests Tests for HZ Common System Components
|
||||
\addtogroup libdebug LibDebug Flexible Debug Logging
|
||||
\addtogroup libdebug_tests Tests for LibDebug Flexible Debug Logging
|
||||
\addtogroup rmn Resource Manager
|
||||
\addtogroup rmn_tests Tests for Resource Manager
|
||||
\addtogroup rconfig Resource Manager-Based Configuration
|
||||
\addtogroup rconfig_tests Tests for Resource Manager-Based Configuration
|
||||
\addtogroup gsc GSmartControl Application
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
############################################################################
|
||||
# Copyright:
|
||||
# (C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
# (C) 2008 - 2012 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
# License: See LICENSE_zlib.txt file
|
||||
############################################################################
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
[Project]
|
||||
Manager=KDevCustomBuildSystem
|
||||
Name=gsmartcontrol
|
||||
@@ -15,14 +15,14 @@
|
||||
<projectname>gsmartcontrol</projectname>
|
||||
<projectdirectory>.</projectdirectory>
|
||||
<absoluteprojectpath>false</absoluteprojectpath>
|
||||
<description></description>
|
||||
<defaultencoding></defaultencoding>
|
||||
<description/>
|
||||
<defaultencoding/>
|
||||
<versioncontrol/>
|
||||
</general>
|
||||
<kdevautoproject>
|
||||
<general>
|
||||
<activetarget>src/gsmartcontrol</activetarget>
|
||||
<useconfiguration>suncc</useconfiguration>
|
||||
<useconfiguration>open64</useconfiguration>
|
||||
</general>
|
||||
<run>
|
||||
<mainprogram>/10/devel/projects/gsmartcontrol/current/gsmartcontrol/debuggy</mainprogram>
|
||||
@@ -81,16 +81,16 @@
|
||||
<ccompiler>kdevgccoptions</ccompiler>
|
||||
<cxxcompiler>kdevgppoptions</cxxcompiler>
|
||||
<f77compiler>kdevg77options</f77compiler>
|
||||
<cflags></cflags>
|
||||
<cxxflags></cxxflags>
|
||||
<cflags/>
|
||||
<cxxflags/>
|
||||
<envvars/>
|
||||
<topsourcedir></topsourcedir>
|
||||
<cppflags></cppflags>
|
||||
<ldflags></ldflags>
|
||||
<topsourcedir/>
|
||||
<cppflags/>
|
||||
<ldflags/>
|
||||
<ccompilerbinary>gcc-4.4</ccompilerbinary>
|
||||
<cxxcompilerbinary>g++-4.4</cxxcompilerbinary>
|
||||
<f77compilerbinary></f77compilerbinary>
|
||||
<f77flags></f77flags>
|
||||
<f77compilerbinary/>
|
||||
<f77flags/>
|
||||
</debuggy>
|
||||
<icc>
|
||||
<envvars/>
|
||||
@@ -111,7 +111,7 @@
|
||||
</icc>
|
||||
<win32>
|
||||
<envvars/>
|
||||
<configargs>--disable-user-flags --enable-optimize-options --enable-tests --build=i686-linux --host=i386-pc-mingw32 PKG_CONFIG_PATH=/cross/w32/target/lib/pkgconfig PKG_CONFIG_LIBDIR="" PATH="/cross/w32/gcc-bin:/cross/w32/target/bin:$PATH"</configargs>
|
||||
<configargs>--with-windows-gtk-name=gtk2-runtime-2.16.6-2010-02-24-ash --disable-user-flags --enable-optimize-options --enable-tests --build=i686-linux --host=i386-pc-mingw32 PKG_CONFIG_PATH=/cross/w32/target/lib/pkgconfig PKG_CONFIG_LIBDIR="" PATH="/cross/w32/gcc-bin:/cross/w32/target/bin:$PATH"</configargs>
|
||||
<builddir>win32</builddir>
|
||||
<topsourcedir/>
|
||||
<cppflags/>
|
||||
@@ -196,6 +196,40 @@
|
||||
<cxxflags/>
|
||||
<f77flags/>
|
||||
</win64-debug>
|
||||
<default>
|
||||
<envvars/>
|
||||
<configargs/>
|
||||
<builddir/>
|
||||
<topsourcedir/>
|
||||
<cppflags/>
|
||||
<ldflags/>
|
||||
<ccompiler>kdevgccoptions</ccompiler>
|
||||
<cxxcompiler>kdevgppoptions</cxxcompiler>
|
||||
<f77compiler>kdevg77options</f77compiler>
|
||||
<ccompilerbinary/>
|
||||
<cxxcompilerbinary/>
|
||||
<f77compilerbinary/>
|
||||
<cflags/>
|
||||
<cxxflags/>
|
||||
<f77flags/>
|
||||
</default>
|
||||
<open64>
|
||||
<envvars/>
|
||||
<configargs>--enable-tests</configargs>
|
||||
<builddir>open64</builddir>
|
||||
<topsourcedir/>
|
||||
<cppflags/>
|
||||
<ldflags/>
|
||||
<ccompiler>kdevgccoptions</ccompiler>
|
||||
<cxxcompiler>kdevgppoptions</cxxcompiler>
|
||||
<f77compiler>kdevg77options</f77compiler>
|
||||
<ccompilerbinary>/opt/open64/bin/opencc</ccompilerbinary>
|
||||
<cxxcompilerbinary>/opt/open64/bin/openCC</cxxcompilerbinary>
|
||||
<f77compilerbinary/>
|
||||
<cflags/>
|
||||
<cxxflags>-Wall</cxxflags>
|
||||
<f77flags/>
|
||||
</open64>
|
||||
</configurations>
|
||||
<make>
|
||||
<envvars>
|
||||
@@ -271,11 +305,11 @@
|
||||
</kdevdoctreeview>
|
||||
<kdevdebugger>
|
||||
<general>
|
||||
<dbgshell></dbgshell>
|
||||
<gdbpath></gdbpath>
|
||||
<configGdbScript></configGdbScript>
|
||||
<runShellScript></runShellScript>
|
||||
<runGdbScript></runGdbScript>
|
||||
<dbgshell/>
|
||||
<gdbpath/>
|
||||
<configGdbScript/>
|
||||
<runShellScript/>
|
||||
<runGdbScript/>
|
||||
<breakonloadinglibs>true</breakonloadinglibs>
|
||||
<separatetty>false</separatetty>
|
||||
<floatingtoolbar>false</floatingtoolbar>
|
||||
@@ -0,0 +1,169 @@
|
||||
Name: gsmartcontrol
|
||||
Version: @VERSION@
|
||||
Release: 1as
|
||||
License: GPL-2.0 AND GPL-3.0
|
||||
Url: http://gsmartcontrol.sourceforge.net/
|
||||
Vendor: Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
# Packager: Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
Source: http://sourceforge.net/projects/gsmartcontrol/files/%{version}/%{name}-%{version}.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Summary: GSmartControl - Hard Disk Drive and SSD Health Inspection Tool
|
||||
|
||||
%if 0%{?mandriva_version}
|
||||
Group: System/Kernel and hardware
|
||||
%else
|
||||
Group: Hardware/Other
|
||||
%endif
|
||||
|
||||
# Empty debug packages cause errors in new RPM. Disable them.
|
||||
%global debug_package %{nil}
|
||||
|
||||
|
||||
# Dependencies for various distributions. The actual deps are:
|
||||
# smartmontools, pcre, gtkmm3 >= 3.4.0
|
||||
# (with the respective -devel packages of the libraries for build requirements).
|
||||
# For non-specified distributions we don't specify any dependencies to avoid errors.
|
||||
|
||||
|
||||
# SUSE / OpenSUSE. SLES also defines the correct suse_version.
|
||||
%if 0%{?suse_version}
|
||||
|
||||
Requires: smartmontools
|
||||
BuildRequires: gcc-c++, libstdc++-devel, pcre-devel, gtkmm3-devel >= 3.4.0
|
||||
BuildRequires: update-desktop-files
|
||||
BuildRequires: fdupes
|
||||
|
||||
%endif
|
||||
|
||||
|
||||
# Fedora, CentOS, RHEL
|
||||
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
|
||||
|
||||
# I'm not sure about centos and rhel versions
|
||||
Requires: smartmontools
|
||||
BuildRequires: gcc-c++, pcre-devel, gtkmm30-devel >= 3.4.0
|
||||
|
||||
# Fedora with consolehelper.
|
||||
# usermode-gtk is for consolehelper-gtk.
|
||||
%if 0%{?fedora_version}
|
||||
Requires: usermode-gtk
|
||||
%endif
|
||||
|
||||
%endif
|
||||
|
||||
|
||||
%description
|
||||
GSmartControl is a graphical user interface for smartctl, which is a tool for
|
||||
querying and controlling SMART (Self-Monitoring, Analysis, and Reporting
|
||||
Technology) data in hard disk and solid-state drives. It allows you to inspect
|
||||
the drive's SMART data to determine its health, as well as run various tests
|
||||
on it.
|
||||
|
||||
%prep
|
||||
|
||||
%setup -q
|
||||
%configure
|
||||
|
||||
|
||||
%build
|
||||
make %{?_smp_mflags}
|
||||
|
||||
|
||||
%install
|
||||
|
||||
# %%makeinstall
|
||||
make DESTDIR=%buildroot install-strip
|
||||
# Remove the icon cache file "make install" generates, to avoid package conflicts.
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/icon-theme.cache
|
||||
|
||||
|
||||
%if 0%{?suse_version}
|
||||
|
||||
%suse_update_desktop_file -n %{name}
|
||||
|
||||
# There are some png file duplicates, hardlink them.
|
||||
%fdupes
|
||||
|
||||
# We install icons, so this is needed.
|
||||
%if 0%{?suse_version} >= 1140
|
||||
%post
|
||||
%icon_theme_cache_post
|
||||
|
||||
%postun
|
||||
%icon_theme_cache_postun
|
||||
%endif
|
||||
|
||||
# endif suse
|
||||
%endif
|
||||
|
||||
|
||||
%if 0%{?fedora_version}
|
||||
# We still retain gsmartcontrol-root for consistency with other distributions.
|
||||
|
||||
# Make the desktop file run gsmartcontrol instead of gsmartcontrol-root
|
||||
sed "s|gsmartcontrol-root|gsmartcontrol|g" %{buildroot}%{_datadir}/applications/gsmartcontrol.desktop > %{buildroot}%{_datadir}/applications/gsmartcontrol.desktop.new
|
||||
mv -f %{buildroot}%{_datadir}/applications/gsmartcontrol.desktop.new %{buildroot}%{_datadir}/applications/gsmartcontrol.desktop
|
||||
|
||||
# The rest is taken from the official fedora spec:
|
||||
# http://pkgs.fedoraproject.org/cgit/gsmartcontrol.git/tree/
|
||||
|
||||
# Set up for console-helper
|
||||
mkdir -p %{buildroot}%{_sbindir}
|
||||
# Add a copy as "gsmartcontrol-noroot", since gsmartcontrol will always
|
||||
# ask for root password.
|
||||
cp %{buildroot}%{_bindir}/%{name} %{buildroot}%{_bindir}/%{name}-noroot
|
||||
mv %{buildroot}%{_bindir}/%{name} %{buildroot}%{_sbindir}/%{name}
|
||||
ln -s consolehelper %{buildroot}%{_bindir}/%{name}
|
||||
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/pam.d
|
||||
cat <<EOF >%{buildroot}%{_sysconfdir}/pam.d/%{name}
|
||||
#%%PAM-1.0
|
||||
auth include config-util
|
||||
account include config-util
|
||||
session include config-util
|
||||
EOF
|
||||
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/security/console.apps
|
||||
cat <<EOF >%{buildroot}%{_sysconfdir}/security/console.apps/%{name}
|
||||
USER=root
|
||||
PROGRAM=/usr/sbin/gsmartcontrol
|
||||
SESSION=true
|
||||
EOF
|
||||
|
||||
# endif fedora
|
||||
%endif
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf %buildroot
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
|
||||
# In fedora /usr/bin/gsmartcontrol is linked to consolehelper, cannot set attrs on symlink.
|
||||
%if 0%{?fedora_version}
|
||||
%{_bindir}/*
|
||||
%else
|
||||
%attr(0755,root,root) %{_bindir}/*
|
||||
%endif
|
||||
|
||||
# %%attr(0644,root,root) %%config(noreplace) %%{_sysconfdir}/*
|
||||
|
||||
%doc %{_datadir}/doc/gsmartcontrol
|
||||
%doc %{_mandir}/man1/*
|
||||
|
||||
%{_datadir}/gsmartcontrol
|
||||
# %%{_datadir}/gsmartcontrol/*
|
||||
%{_datadir}/applications/*.desktop
|
||||
%{_datadir}/metainfo
|
||||
%{_datadir}/icons/*
|
||||
%{_datadir}/pixmaps/*
|
||||
|
||||
%if 0%{?fedora_version}
|
||||
%config(noreplace) %{_sysconfdir}/pam.d/%{name}
|
||||
%config(noreplace) %{_sysconfdir}/security/console.apps/%{name}
|
||||
%{_sbindir}/gsmartcontrol
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
@@ -1,12 +0,0 @@
|
||||
Whatever License
|
||||
|
||||
THIS SOFTWARE IS PROVIDED 'AS-IS', WITHOUT ANY EXPRESS OR IMPLIED
|
||||
WARRANTY. IN NO EVENT WILL THE AUTHORS BE HELD LIABLE FOR ANY DAMAGES
|
||||
ARISING FROM THE USE OF THIS SOFTWARE.
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely.
|
||||
@@ -1,132 +0,0 @@
|
||||
|
||||
# Add autoconf.m4 directory to local macro search path
|
||||
ACLOCAL_AMFLAGS = -I autoconf.m4
|
||||
|
||||
SUBDIRS = data debian.dist src
|
||||
|
||||
|
||||
# These files are actually needed for compilation.
|
||||
noinst_DATA = AUTHORS.txt LICENSE_gsmartcontrol.txt README.txt
|
||||
|
||||
|
||||
# For the files to be bundled with the distribution, specify them in
|
||||
# one of the following.
|
||||
|
||||
# These will be installed into docdir.
|
||||
# Some of these files are actually needed for compilation (see src/res/Makefile.am).
|
||||
dist_doc_DATA = AUTHORS.txt ChangeLog NEWS README.txt \
|
||||
LICENSE_boost_1_0.txt \
|
||||
LICENSE_bsd-ac.txt \
|
||||
LICENSE_bsd-ucb.txt \
|
||||
LICENSE_gpl2.txt \
|
||||
LICENSE_gpl3.txt \
|
||||
LICENSE_gsmartcontrol.txt \
|
||||
LICENSE_hz.txt \
|
||||
LICENSE_pcrecpp.txt \
|
||||
LICENSE_whatever.txt \
|
||||
LICENSE_zlib.txt
|
||||
|
||||
|
||||
# nobase_ preserves their directory names.
|
||||
nobase_dist_doc_DATA = contrib/cron-based_noadmin/README \
|
||||
contrib/cron-based_noadmin/cron_gather_smart.sh \
|
||||
contrib/cron-based_noadmin/crontab.example \
|
||||
contrib/cron-based_noadmin/smartctl_subst.sh
|
||||
|
||||
|
||||
# Extra files bundled with distribution.
|
||||
# file2csource.sh is needed for building but not installed.
|
||||
EXTRA_DIST = COPYING TODO INSTALL configure autogen.sh \
|
||||
baqup gsmartcontrol.kdevelop \
|
||||
templates \
|
||||
file2csource.sh \
|
||||
gsmartcontrol.spec
|
||||
|
||||
|
||||
|
||||
# PCH support
|
||||
|
||||
global_macros.h.gch: $(top_srcdir)/src/global_macros.h
|
||||
$(CXX) $(CXXFLAGS) $(DEFS) -x "c++-header" $(top_srcdir)/src/global_macros.h -o global_macros.h.gch
|
||||
|
||||
gch: global_macros.h.gch
|
||||
|
||||
gch-clean:
|
||||
rm -f global_macros.h.gch
|
||||
|
||||
|
||||
|
||||
# rpm support
|
||||
|
||||
src-rpm: dist
|
||||
rpmbuild -ts $(distdir).tar.bz2
|
||||
|
||||
|
||||
# Don't use this - it does something weird, and gcc errors out with "long long long" errors, etc...
|
||||
#rpm: dist
|
||||
# rpmbuild -ta $(distdir).tar.bz2
|
||||
|
||||
|
||||
|
||||
# NSIS installer support.
|
||||
# Requires wine, installed NSIS, smartctl-nc.exe, smartctl.exe.
|
||||
# Gtkmm dlls and pcre dlls are required if linking against them.
|
||||
# dos2unix on build machine.
|
||||
# Execute only with win32 build present.
|
||||
|
||||
WIN_ZIP_NAME = $(PACKAGE)-$(VERSION)-win32
|
||||
|
||||
win-dist: win-dist-prepare nsis-dist-nocleanup win-zip-dist
|
||||
|
||||
win-dist-clean:
|
||||
rm -rf gsmartcontrol-*.exe gsmartcontrol-*.zip nsis-dist $(WIN_ZIP_NAME)
|
||||
|
||||
|
||||
win-dist-prepare: all win-dist-clean
|
||||
$(MKDIR_P) nsis-dist
|
||||
|
||||
cp data/nsis/gsmartcontrol.nsi $(top_srcdir)/data/nsis/nsi_* nsis-dist/
|
||||
cp $(top_srcdir)/data/gsmartcontrol.ico $(top_srcdir)/data/icon_*.png nsis-dist/
|
||||
|
||||
$(MKDIR_P) nsis-dist/doc
|
||||
cp data/nsis/distribution.txt nsis-dist/doc/
|
||||
cp $(top_srcdir)/AUTHORS.txt $(top_srcdir)/LICENSE_* $(top_srcdir)/README.txt nsis-dist/doc/
|
||||
cp $(top_srcdir)/NEWS nsis-dist/doc/NEWS.txt
|
||||
|
||||
unix2dos nsis-dist/*.nsi nsis-dist/doc/*.txt
|
||||
|
||||
cp "@WINDOWS_BINDIR@"/smartctl-nc.exe nsis-dist/
|
||||
cp "@WINDOWS_BINDIR@"/smartctl.exe nsis-dist/
|
||||
|
||||
cp src/gsmartcontrol.exe nsis-dist/
|
||||
|
||||
$(STRIP) nsis-dist/*.exe
|
||||
|
||||
|
||||
nsis-dist: nsis-dist-nocleanup nsis-cleanup
|
||||
|
||||
nsis-dist-nocleanup: win-dist-prepare
|
||||
cd nsis-dist && @NSIS_EXEC@ gsmartcontrol.nsi
|
||||
mv nsis-dist/$(PACKAGE)-$(VERSION).exe .
|
||||
|
||||
nsis-cleanup:
|
||||
rm -rf nsis-dist
|
||||
|
||||
|
||||
win-zip-dist: win-zip-dist-nocleanup win-zip-dist-cleanup
|
||||
|
||||
win-zip-dist-nocleanup: win-dist-prepare
|
||||
mv nsis-dist $(WIN_ZIP_NAME)
|
||||
rm -rf $(WIN_ZIP_NAME)/gsmartcontrol.ico $(WIN_ZIP_NAME)/nsi_* $(WIN_ZIP_NAME)/*.nsi
|
||||
zip -9r $(WIN_ZIP_NAME).zip $(WIN_ZIP_NAME)
|
||||
|
||||
win-zip-dist-cleanup:
|
||||
rm -rf $(WIN_ZIP_NAME)
|
||||
|
||||
|
||||
|
||||
|
||||
distclean-local: gch-clean win-dist-clean
|
||||
|
||||
|
||||
|
||||
@@ -1,170 +0,0 @@
|
||||
|
||||
|
||||
GTKMM Notes:
|
||||
|
||||
To transfer an ownership from your local code to a container, use
|
||||
Gtk::Button* pButton = Gtk::manage(new Gtk::Button("Test"));
|
||||
container->add(*pButton);
|
||||
(add() takes an object by reference).
|
||||
otherwise, you will need to delete() it.
|
||||
|
||||
local scope destruction also works if using stack variables.
|
||||
{
|
||||
Gtk::Button aButton;
|
||||
// destroyed here
|
||||
}
|
||||
|
||||
|
||||
A treeview (also iconview, combobox) from glade comes
|
||||
with existing model, which should be unset.
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------
|
||||
|
||||
TODO:
|
||||
|
||||
|
||||
|
||||
Support Areca controller.
|
||||
|
||||
When adding device, have an option to specify "-d" type and other parameters.
|
||||
This is needed to support multi-disk devices.
|
||||
|
||||
|
||||
|
||||
Patch pangomm for Pango::strip_markup().
|
||||
|
||||
No Gtk::AboutDialog::set_logo(NULL);
|
||||
|
||||
|
||||
libdebug:
|
||||
per-channel disabling.
|
||||
per-channel formatting.
|
||||
all flags should be per-channel.
|
||||
bug: if -q is passed, Execution log doesn't contain libdebug log. (requires per-channel status control).
|
||||
use format_time() instead of ctime() and friends, with ISO formatting.
|
||||
|
||||
|
||||
|
||||
'-l sataphy' -> SATA Phy event counters: Non-SMART feature, useful to detect SATA cabling problems.
|
||||
|
||||
'-l xerror' -> Extended Comprehensive Error log: An multi-sector and
|
||||
LBA48 capable version of '-l error'. Output is similar, except more
|
||||
entries can exists and the high bytes of the registers are also printed.
|
||||
Some newer drives (Samsung) only write to this log.
|
||||
|
||||
'-l scttemp' -> SCT Temperature history table. See below.
|
||||
|
||||
'-l xselftest' -> Extended Self Test Log: An multi-sector and LBA48
|
||||
capable version of '-l selftest'. Output will be similar, except more
|
||||
entries can exists and the LBA values can be somewhat longer.
|
||||
|
||||
"smartctl -l this_wont_exist" gives the list of supported logs - this
|
||||
is needed to detect xerror / xselftest support in smartctl.
|
||||
|
||||
|
||||
Careful with GPL (xerror...) stuff until the jmicron situation clears up.
|
||||
|
||||
Add detection for Interix (i586-pc-interix3), maybe with debian?
|
||||
|
||||
Re-check long double printing - win32 libc doesn't support it, a cast
|
||||
to double is needed.
|
||||
The underlying problem is that in msvc, long double is the same size
|
||||
as double, so printf() has mingw-incompatible presentation of long double.
|
||||
|
||||
Support USB flash disks in CVS smartctl versions:
|
||||
Try smartctl -i /dev/sdc;
|
||||
If it returns "Smartctl: please specify device type with the -d option.",
|
||||
try "-d scsi", which should at least give us the name.
|
||||
|
||||
Maybe make it easier to specify "-d" (with a dropdown?)
|
||||
Not sure, "-l aaa /tmp" doesn't list all types.
|
||||
|
||||
|
||||
|
||||
----------- Feature List ----------
|
||||
|
||||
+Autodetect available devices
|
||||
|
||||
+Select current device (from autodetected list; manually whitelist devices).
|
||||
|
||||
+Smartctl binary (text entries in Options - binary, default command line options).
|
||||
+ Global command-line options for smartctl.
|
||||
+ Command-line options per-device in settings (e.g. -d ata).
|
||||
+ Search smartctl binary on startup (try to execute it with --version). If it's not there, alert the user.
|
||||
|
||||
+Indicate which of the devices has SMART supported / enabled.
|
||||
+ Enable / disable smart on devices.
|
||||
+ Indicate that this is until shutdown (but may be preserved on reboot).
|
||||
+ Direct them to smartd / smartctl documentation for permanent enabling.
|
||||
+ NOTE: SMART is sometimes preserved across power cycles.
|
||||
|
||||
+Enable / disable Automatic Offline Data Collection for devices. (-o on)
|
||||
+ Show its status in the main window.
|
||||
|
||||
+Show identity information for device (aka short info), --info.
|
||||
|
||||
+Show all SMART information for device (--all), includes:
|
||||
+ * Short info (--info)
|
||||
+ * SMART DATA
|
||||
+ * overall-health (-H, --health) - may check this automatically as well.
|
||||
+ * General SMART Values, aka Capabilities (-c, --capabilities)
|
||||
+ * Attributes (-A, --attributes). These need decoding.
|
||||
+ * Error Log (-l error)
|
||||
+ * Self-test log (-l selftest)
|
||||
+ * Selective self-test log and settings
|
||||
* SCT status and other stuff
|
||||
Display temperature somewhere (use SCT or Attr 194 for this).
|
||||
+ * Ability to save this information to a file.
|
||||
+ * On info window show: Ask to turn SMART on if it's disabled
|
||||
|
||||
+Program error reporting:
|
||||
+ invalid smartmontools version.
|
||||
+ cannot parse output - show log.
|
||||
+ smartctl exited with error - look it up in error map.
|
||||
|
||||
|
||||
SCT Temperatures
|
||||
-l scttemp prints temperature and history.
|
||||
-t scttempint,N[,p] (N - count, p - preserve across reset or not).
|
||||
This configures temperature logging interval (1 min by default) and clears the history.
|
||||
|
||||
|
||||
+Tests:
|
||||
Ability to detect a testing drive on boot, show its info with testing tab.
|
||||
|
||||
Run one-time Immediate Offline test (-t offline).
|
||||
Offline tests only update Attributes, and if errors are found they will
|
||||
appear in SMART error log. Self-test logs are unaffected.
|
||||
Abort (-X). Abort works with Offline only if there's
|
||||
"Abort Offline collection upon new command" capability.
|
||||
If the drive has "Suspend Offline collection upon new command" capability,
|
||||
immediate offline test may be tracked through --capabilities (not on mine!).
|
||||
If it's "Abort Offline collection upon new command", then the test
|
||||
will abort on --capabilities or --abort.
|
||||
|
||||
|
||||
Polling time
|
||||
The self-test routine recommended polling time shall be equal to the number of minutes that is the minimum
|
||||
recommended time before which the host should first poll for test completion status. Actual test time could
|
||||
be several times this value. Polling before this time could extend the self-test execution time or abort the test
|
||||
depending on the state of bit 2 of the off-line data capability bits.
|
||||
|
||||
Autosave
|
||||
This command enables and disables the optional attribute autosave feature of the device. This command
|
||||
may either allow the device, after some vendor specified event, to save the device updated attribute values
|
||||
to non-volatile memory; or this command may cause the autosave feature to be disabled. The state of the
|
||||
attribute autosave feature (either enabled or disabled) shall be preserved by the device across power cycles.
|
||||
A value of zero written by the host into the device’s Sector Count register before issuing this command shall
|
||||
cause this feature to be disabled. Disabling this feature does not preclude the device from saving SMART
|
||||
data to non-volatile memory during some other normal operation such as during a power-on or power-off
|
||||
sequence or during an error recovery sequence.
|
||||
A value of F1h written by the host into the device’s Sector Count register before issuing this command shall
|
||||
cause this feature to be enabled. Any other meaning of this value or any other non-zero value written by the
|
||||
host into this register before issuing this command may differ from device to device. The meaning of any
|
||||
non-zero value written to this register at this time shall be preserved by the device across power cycles.
|
||||
|
||||
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
|
||||
############################################################################
|
||||
# Copyright:
|
||||
# (C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
# License: See LICENSE_zlib.txt file
|
||||
############################################################################
|
||||
|
||||
|
||||
# APP_CHOOSE_GLD_READER([C|C++][, flags_prefix])
|
||||
# This macro detects whether GtkBuilder (from gtk >= 2.12) or libglade
|
||||
# are present. If the first parameter is C++, then gtkmm and libglademm
|
||||
# are searched for instead.
|
||||
# flags_prefixCFLAGS, flags_prefixCXXFLAGS and flags_prefixLIBS
|
||||
# will be initialized (or appended to) with the correct flags in case of libglade(mm).
|
||||
# app_cv_gld_reader will be set to none, libglade or gtkbuilder.
|
||||
|
||||
# ENABLE_LIBGLADE or ENABLE_GTKBUILDER will be exported to config.h
|
||||
|
||||
# You must call AX_COMPILER_VENDOR before using this macro.
|
||||
|
||||
AC_DEFUN([APP_CHOOSE_GLD_READER], [
|
||||
# These requirements check compile-time presence, not that they were called
|
||||
AC_REQUIRE([AX_COMPILER_VENDOR])
|
||||
|
||||
AC_ARG_ENABLE(abort-if-no-glade-reader, AS_HELP_STRING([--disable-abort-if-no-glade-reader],
|
||||
[disable abort if no glade file reader is found (default: configure aborts when glade file reader is not found)]),
|
||||
[app_cv_abort_if_no_glade_reader=${enableval}], [app_cv_abort_if_no_glade_reader=yes])
|
||||
|
||||
AC_MSG_NOTICE([Abort if no glade file reader is found: $app_cv_abort_if_no_glade_reader])
|
||||
|
||||
# This is just in case
|
||||
# PKG_PROG_PKG_CONFIG()
|
||||
|
||||
# this variable will have values "none", "libglade" or "gtkbuilder".
|
||||
app_cv_gld_reader="none";
|
||||
|
||||
# in case libglade(mm) is found, these will contain the flags.
|
||||
app_cv_gld_reader_CFLAGS="";
|
||||
app_cv_gld_reader_CXXFLAGS="";
|
||||
app_cv_gld_reader_LIBS="";
|
||||
|
||||
app_cv_gld_reader_libglade_name="libglade";
|
||||
app_cv_gld_reader_libglade_pkg_name="libglade-2.0";
|
||||
app_cv_gld_reader_gtk_name="gtk";
|
||||
app_cv_gld_reader_gtk_pkg_name="gtk+-2.0";
|
||||
if test "x$1" = "xC++"; then
|
||||
app_cv_gld_reader_libglade_name="libglademm";
|
||||
app_cv_gld_reader_libglade_pkg_name="libglademm-2.4";
|
||||
app_cv_gld_reader_gtk_name="gtkmm";
|
||||
app_cv_gld_reader_gtk_pkg_name="gtkmm-2.4";
|
||||
fi
|
||||
|
||||
|
||||
# Manual control. AC_ARG_ENABLE doesn't get bash variables, so we have
|
||||
# to do it this way. If put inside a shell conditional, it still shows up in configure help.
|
||||
|
||||
AC_ARG_ENABLE(libglade, AS_HELP_STRING([--enable-libglade],
|
||||
[use libglade(mm) instead of GtkBuilder (default: auto)]),
|
||||
[with_libglade=${enableval}], [with_libglade=auto])
|
||||
|
||||
|
||||
# Try gtkbuilder first
|
||||
if test "x$with_libglade" = "xno" || test "x$with_libglade" = "xauto"; then
|
||||
PKG_CHECK_EXISTS([$app_cv_gld_reader_gtk_pkg_name >= 2.12.0],
|
||||
[app_cv_gld_reader="gtkbuilder"])
|
||||
fi
|
||||
if test "$with_libglade" = "no" && test "$app_cv_gld_reader" = "none"; then
|
||||
AC_MSG_ERROR([GtkBuilder support not found (you need $app_cv_gld_reader_gtk_name version 2.12 or higher). Try using $app_cv_gld_reader_libglade_name instead.])
|
||||
fi
|
||||
|
||||
# libglade specified, or auto and no gtkbuilder. gtkmm2.4-compatible libglademm is >= 2.4.0.
|
||||
# (not sure about libglade version).
|
||||
if test "x$app_cv_gld_reader" = "xnone"; then
|
||||
if test "x$app_cv_gld_reader_libglade_name" = "xlibglade"; then
|
||||
# libglade
|
||||
PKG_CHECK_MODULES([LIBGLADE], [$app_cv_gld_reader_libglade_pkg_name >= 2.4.0],
|
||||
[app_cv_gld_reader="libglade"], [AC_MSG_WARN([$LIBGLADE_PKG_ERRORS])])
|
||||
app_cv_gld_reader_CFLAGS="$LIBGLADE_CFLAGS";
|
||||
app_cv_gld_reader_CXXFLAGS="$LIBGLADE_CFLAGS";
|
||||
app_cv_gld_reader_LIBS="$LIBGLADE_LIBS";
|
||||
else
|
||||
# libglademm
|
||||
PKG_CHECK_MODULES([LIBGLADEMM], [$app_cv_gld_reader_libglade_pkg_name >= 2.4.0],
|
||||
[app_cv_gld_reader="libglade"], [AC_MSG_WARN([$LIBGLADEMM_PKG_ERRORS])])
|
||||
app_cv_gld_reader_CFLAGS=""
|
||||
app_cv_gld_reader_CXXFLAGS="$LIBGLADEMM_CFLAGS";
|
||||
app_cv_gld_reader_LIBS="$LIBGLADEMM_LIBS";
|
||||
fi
|
||||
# reset them so they don't interfere later
|
||||
LIBGLADE_CFLAGS="";
|
||||
LIBGLADE_LIBS="";
|
||||
fi
|
||||
|
||||
if test "x$with_libglade" = "xyes" && test "x$app_cv_gld_reader" = "xnone"; then
|
||||
AC_MSG_ERROR([$app_cv_gld_reader_libglade_name not found. Try building with GtkBuilder support (you need $app_cv_gld_reader_gtk_name version 2.12 or higher).])
|
||||
fi
|
||||
|
||||
# still not found.
|
||||
if test "$app_cv_gld_reader" = "none"; then
|
||||
if test "x$app_cv_abort_if_no_glade_reader" = "xno"; then
|
||||
AC_MSG_WARN([$LIBGLADE_PKG_ERRORS])
|
||||
AC_MSG_WARN([Neither GtkBuilder nor $app_cv_gld_reader_libglade_name found. The program will be unable to compile fully.])
|
||||
else
|
||||
AC_MSG_WARN([Neither GtkBuilder nor $app_cv_gld_reader_libglade_name found.])
|
||||
AC_MSG_ERROR([$LIBGLADE_PKG_ERRORS])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# export the flags
|
||||
if test "x$2" != "x"; then
|
||||
if test "x$$2[]CFLAGS" = "x"; then
|
||||
$2[]CFLAGS="$app_cv_gld_reader_CFLAGS";
|
||||
else
|
||||
$2[]CFLAGS="$$2[]CFLAGS $app_cv_gld_reader_CFLAGS";
|
||||
fi
|
||||
if test "x$$2[]CXXFLAGS" = "x"; then
|
||||
$2[]CXXFLAGS="$app_cv_gld_reader_CXXFLAGS";
|
||||
else
|
||||
$2[]CXXFLAGS="$$2[]CXXFLAGS $app_cv_gld_reader_CXXFLAGS";
|
||||
fi
|
||||
if test "x$$2[]LIBS" = "x"; then
|
||||
$2[]LIBS="$app_cv_gld_reader_LIBS";
|
||||
else
|
||||
$2[]LIBS="$$2[]LIBS $app_cv_gld_reader_LIBS";
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# export to automake.am-s
|
||||
AM_CONDITIONAL([ENABLE_LIBGLADE], [test "$app_cv_gld_reader" = "libglade"])
|
||||
AM_CONDITIONAL([ENABLE_GTKBUILDER], [test "$app_cv_gld_reader" = "gtkbuilder"])
|
||||
|
||||
|
||||
# export to config.h
|
||||
if test "$app_cv_gld_reader" = "libglade"; then
|
||||
AC_DEFINE(ENABLE_LIBGLADE, 1, [Use libglade(mm) instead of GtkBuilder])
|
||||
else
|
||||
AC_DEFINE(ENABLE_LIBGLADE, 0, [Use libglade(mm) instead of GtkBuilder])
|
||||
fi
|
||||
if test "$app_cv_gld_reader" = "gtkbuilder"; then
|
||||
AC_DEFINE(ENABLE_GTKBUILDER, 1, [Use GtkBuilder instead of libglademm])
|
||||
else
|
||||
AC_DEFINE(ENABLE_GTKBUILDER, 1, [Use GtkBuilder instead of libglademm])
|
||||
fi
|
||||
|
||||
# If we move this to the start, some messages get in between, so we have to have it here.
|
||||
AC_MSG_CHECKING([for glade file support])
|
||||
|
||||
AC_MSG_RESULT([$app_cv_gld_reader])
|
||||
|
||||
])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
stamp="../gsmartcontrol-`date +%F`"
|
||||
echo $stamp
|
||||
|
||||
mkdir $stamp
|
||||
cp -dp * $stamp/
|
||||
|
||||
rm -f $stamp/*pcs # kdevelop persistent store files
|
||||
|
||||
cp -a autoconf.m4/ $stamp/
|
||||
cp -a data/ $stamp/
|
||||
cp -a src/ $stamp/
|
||||
cp -a templates/ $stamp/
|
||||
# cp -a test-data/ $stamp/
|
||||
|
||||
tar cvf $stamp.tar $stamp
|
||||
bzip2 -9 $stamp.tar
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
#!/bin/bash
|
||||
############################################################################
|
||||
# Copyright:
|
||||
# (C) 2008 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
# License: See LICENSE_zlib.txt file
|
||||
############################################################################
|
||||
|
||||
# Run gsmartcontrol with root, asking for root password first.
|
||||
|
||||
EXEC_BIN="@prefix@/bin/gsmartcontrol";
|
||||
prog_name="gsmartcontrol"
|
||||
|
||||
DESKTOP="$1";
|
||||
|
||||
# This works for --help too
|
||||
if [ "$DESKTOP" = "" ]; then
|
||||
DESKTOP="auto"; # default
|
||||
|
||||
elif [ "$DESKTOP" != "auto" ] && [ "$DESKTOP" != "kde" ] && \
|
||||
[ "$DESKTOP" != "gnome" ] && [ "$DESKTOP" != "other" ]; then
|
||||
echo "Usage: $0 [<auto|kde|gnome|other> [<${prog_name}_options>] ]";
|
||||
exit 1;
|
||||
fi
|
||||
shift; # remove $1
|
||||
|
||||
|
||||
# Auto-detect current desktop if auto was specified.
|
||||
if [ "$DESKTOP" = "auto" ]; then
|
||||
# KDE_SESSION_UID is present on kde3 and kde4.
|
||||
# Note that it may be empty (but still set)
|
||||
if [ "${KDE_SESSION_UID+set}" = "set" ]; then
|
||||
DESKTOP="kde";
|
||||
# same with gnome
|
||||
elif [ "${GNOME_DESKTOP_SESSION_ID+set}" = "set" ]; then
|
||||
DESKTOP="gnome";
|
||||
else
|
||||
DESKTOP="other";
|
||||
fi
|
||||
fi
|
||||
|
||||
# echo $DESKTOP;
|
||||
|
||||
|
||||
# They're basically the same, only the order is different.
|
||||
# sux requires xterm to ask for the password.
|
||||
# xdg-su is basically like this script, except worse :)
|
||||
gnome_sus="gnomesu gksu kdesu xdg-su sux";
|
||||
kde_sus="kdesu gnomesu gksu xdg-su sux";
|
||||
other_sus="$gnome_sus";
|
||||
|
||||
|
||||
candidates="";
|
||||
found_su=""
|
||||
|
||||
if [ "$DESKTOP" = "gnome" ]; then
|
||||
candidates="$gnome_sus";
|
||||
elif [ "$DESKTOP" = "kde" ]; then
|
||||
candidates="$kde_sus";
|
||||
elif [ "$DESKTOP" = "other" ]; then
|
||||
candidates="$other_sus";
|
||||
fi
|
||||
|
||||
for subin in $candidates; do
|
||||
which $subin &>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
found_su="$subin";
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$found_su" = "" ]; then
|
||||
xmessage "Error launching ${prog_name}: No suitable su mechanism found.
|
||||
Try installing kdesu, gnomesu, gksu or sux first.";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
# gnomesu and gksu (but not kdesu, not sure about others) fail to adopt
|
||||
# root's PATH. Since the user's PATH may not contain /usr/sbin (with smartctl)
|
||||
# on some distributions (e.g. mandriva), add it manually. We also add
|
||||
# /usr/local/sbin, since that's the default location of custom-compiled smartctl.
|
||||
# Add these directories _before_ existing PATH, so that the user is not
|
||||
# tricked into running it from some other path (we're running as root with
|
||||
# the user's env after all).
|
||||
export PATH="/usr/sbin:/usr/local/sbin:$PATH"
|
||||
|
||||
|
||||
# echo $found_su;
|
||||
|
||||
# Examples:
|
||||
# gnomesu -c 'gsmartcontrol --no-scan'
|
||||
# kdesu -c 'gsmartcontrol --no-scan'
|
||||
# xterm -e sux -c 'gsmartcontrol --no-scan' # sux asks for password in a terminal
|
||||
|
||||
full_cmd=""
|
||||
if [ "$found_su" = "sux" ]; then
|
||||
full_cmd="xterm -e sux -c '$EXEC_BIN $@'"
|
||||
|
||||
elif [ "$found_su" = "gksu" ]; then
|
||||
full_cmd="$found_su '$EXEC_BIN $@'"
|
||||
|
||||
else # gnomesu, kdesu, xdg-su
|
||||
full_cmd="$found_su -c '$EXEC_BIN $@'"
|
||||
fi
|
||||
|
||||
|
||||
eval $full_cmd
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
|
||||
GSmartControl - Hard disk drive health inspection tool
|
||||
Version @VERSION@
|
||||
|
||||
The latest version of this distribution, as well as the source code of
|
||||
GSmartControl, can be found at
|
||||
http://gsmartcontrol.berlios.de
|
||||
and
|
||||
http://developer.berlios.de/project/showfiles.php?group_id=10075
|
||||
|
||||
You need GTK+ for Windows Runtime package to use this program. You can get one
|
||||
at http://gtk-win.sf.net (you must download at least version 2.14.4-2008-11-11
|
||||
of gtk2-runtime).
|
||||
|
||||
|
||||
This distribution includes:
|
||||
|
||||
* GSmartControl binary (gsmartcontrol.exe) and associated resources. The
|
||||
binary was compiled for 32-bit Windows, and should work on both 32-bit and
|
||||
64-bit Windows. The binary was statically compiled against Gtkmm
|
||||
(http://www.gtkmm.org/) and related libraries, and PCRE (http://www.pcre.org/).
|
||||
|
||||
* Smartctl binaries (from smartmontools 5.39-0-20090826-r2878,
|
||||
http://smartmontools.sf.net/) - smartctl-nc.exe (compiled without console
|
||||
output), smartctl.exe (compiled with console output).
|
||||
|
||||
|
||||
The combined distribution is multi-licensed under GNU GPL versions 2 and 3.
|
||||
See LICENSE_gpl2.txt and LICENSE_gpl3.txt for details.
|
||||
@@ -1,293 +0,0 @@
|
||||
|
||||
; NSIS2 Script
|
||||
; Compatible with NSIS 2.40
|
||||
|
||||
|
||||
!define PRODUCT_VERSION "@VERSION@"
|
||||
!define PRODUCT_NAME "GSmartControl"
|
||||
!define PRODUCT_NAME_SMALL "gsmartcontrol"
|
||||
!define PRODUCT_PUBLISHER "Alexander Shaduri"
|
||||
!define PRODUCT_WEB_SITE "http://gsmartcontrol.berlios.de"
|
||||
|
||||
;!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\AppMainExe.exe"
|
||||
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
|
||||
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
||||
|
||||
!define REGISTRY_APP_PATHS "Software\Microsoft\Windows\CurrentVersion\App Paths"
|
||||
|
||||
|
||||
|
||||
|
||||
; --------------- General Settings
|
||||
|
||||
|
||||
; This compressor gives us the best results
|
||||
SetCompressor /SOLID lzma
|
||||
|
||||
; Do a CRC check before installing
|
||||
CRCCheck On
|
||||
|
||||
; This is used in titles
|
||||
Name "${PRODUCT_NAME}" ; ${PRODUCT_VERSION}
|
||||
|
||||
; Output File Name
|
||||
OutFile "${PRODUCT_NAME_SMALL}-${PRODUCT_VERSION}.exe"
|
||||
|
||||
|
||||
|
||||
;The Default Installation Directory
|
||||
; try to install to the same directory as runtime.
|
||||
InstallDir "$PROGRAMFILES\${PRODUCT_NAME_SMALL}"
|
||||
; If already installed, try here
|
||||
InstallDirRegKey HKLM "SOFTWARE\${PRODUCT_NAME}" "InstallationDirectory"
|
||||
|
||||
|
||||
ShowInstDetails show
|
||||
ShowUnInstDetails show
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; --------------------- MUI INTERFACE
|
||||
|
||||
; MUI 2.0 compatible install
|
||||
!include "MUI2.nsh"
|
||||
|
||||
;Backgound Colors. uncomment to enable fullscreen.
|
||||
; BGGradient 0000FF 000000 FFFFFF
|
||||
|
||||
; MUI Settings
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_ICON "nsi_install.ico"
|
||||
!define MUI_UNICON "nsi_uninstall.ico"
|
||||
|
||||
|
||||
;Things that need to be extracted on first (keep these lines before any File command!)
|
||||
;Only useful for BZIP2 compression
|
||||
!insertmacro MUI_RESERVEFILE_LANGDLL
|
||||
;!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
|
||||
|
||||
|
||||
; Language Selection Dialog Settings
|
||||
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
|
||||
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
|
||||
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
|
||||
|
||||
|
||||
; Pages to show during installation
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MUI_PAGE_LICENSE "doc\distribution.txt"
|
||||
;!insertmacro MUI_PAGE_COMPONENTS
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
;!define MUI_FINISHPAGE_RUN "$INSTDIR\gsmartcontrol.exe"
|
||||
;!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Example.file"
|
||||
;!define MUI_FINISHPAGE_RUN_NOTCHECKED
|
||||
!define MUI_FINISHPAGE_NOAUTOCLOSE
|
||||
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
|
||||
|
||||
; Uninstaller page
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
|
||||
|
||||
|
||||
; Language files
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
|
||||
|
||||
; --------------- END MUI
|
||||
|
||||
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "GSmartControl"
|
||||
|
||||
|
||||
|
||||
; --------------- START INSTALLATION
|
||||
|
||||
|
||||
Function .onInit
|
||||
|
||||
!insertmacro MUI_LANGDLL_DISPLAY
|
||||
|
||||
Push 2 ;F ;22 = number of languages, F = change font
|
||||
|
||||
;Language selection
|
||||
LangDLL::LangDialog "Installer Language" "Please select a language."
|
||||
|
||||
Pop $LANGUAGE
|
||||
StrCmp $LANGUAGE "cancel" 0 +2
|
||||
Abort
|
||||
|
||||
; detect previous installation
|
||||
ReadRegStr $R0 HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
|
||||
StrCmp $R0 "" no_prev
|
||||
|
||||
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
|
||||
"${PRODUCT_NAME} is already installed. $\n$\nClick 'OK' to remove the \
|
||||
previous version or 'Cancel' to continue anyway." \
|
||||
IDOK uninst_product
|
||||
; Abort
|
||||
goto no_prev ; if cancel was pressed, continue as if no old installation.
|
||||
|
||||
;Run the uninstaller
|
||||
uninst_product:
|
||||
ClearErrors
|
||||
ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
|
||||
|
||||
IfErrors cannot_uninst_product
|
||||
|
||||
;You can either use Delete /REBOOTOK in the uninstaller or add some code
|
||||
;here to remove the uninstaller. Use a registry key to check
|
||||
;whether the user has chosen to uninstall. If you are using an uninstaller
|
||||
;components page, make sure all sections are uninstalled.
|
||||
cannot_uninst_product:
|
||||
|
||||
no_prev: ; no old installation found, all ok
|
||||
|
||||
|
||||
|
||||
|
||||
; detect GTK installation (any of available versions)
|
||||
ReadRegStr $R0 HKLM "SOFTWARE\GTK\2.0" "DllPath"
|
||||
StrCmp $R0 "" no_gtk
|
||||
|
||||
goto have_gtk
|
||||
|
||||
no_gtk:
|
||||
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
|
||||
"GTK2-Runtime is not installed. This product needs it to function properly.$\n\
|
||||
Please install GTK2-Runtime from http://gtk-win.sf.net/ first.$\n$\n\
|
||||
Click 'Cancel' to abort the installation \
|
||||
or 'OK' to continue anyway." \
|
||||
IDOK have_gtk
|
||||
Abort
|
||||
|
||||
have_gtk:
|
||||
; do nothing
|
||||
|
||||
|
||||
|
||||
FunctionEnd
|
||||
|
||||
|
||||
|
||||
|
||||
; ----------------- INSTALLATION TYPES
|
||||
|
||||
; InstType "Recommended"
|
||||
InstType "Full"
|
||||
;InstType "Minimal"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Section "Main" SecMain
|
||||
SectionIn 1
|
||||
SetOutPath "$INSTDIR"
|
||||
|
||||
SetOverwrite Off ; don't overwrite the config file
|
||||
; File "gsmartcontrol.conf"
|
||||
|
||||
SetOverwrite On
|
||||
File gsmartcontrol.exe
|
||||
File gsmartcontrol.ico
|
||||
File icon_*.png
|
||||
; File *.dll
|
||||
File smartctl-nc.exe
|
||||
File smartctl.exe
|
||||
|
||||
File /r doc
|
||||
|
||||
; set a special path for this exe, as GTK may not be in a global path.
|
||||
ReadRegStr $R3 HKLM "SOFTWARE\GTK\2.0" "DllPath"
|
||||
WriteRegStr HKLM "${REGISTRY_APP_PATHS}\gsmartcontrol.exe" "Path" "$R3"
|
||||
|
||||
;Add Shortcuts
|
||||
CreateShortCut "$SMPROGRAMS\GSmartControl.lnk" "$INSTDIR\gsmartcontrol.exe" "" "$INSTDIR\gsmartcontrol.ico" 0
|
||||
|
||||
SectionEnd
|
||||
|
||||
|
||||
|
||||
; ------------------ POST INSTALL
|
||||
|
||||
|
||||
!define TEMP $R0
|
||||
|
||||
Section -post
|
||||
|
||||
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "InstallationDirectory" "$INSTDIR"
|
||||
WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "Vendor" "Alexander Shaduri"
|
||||
|
||||
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME}"
|
||||
WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\gsmartcontrol_uninst.exe"
|
||||
|
||||
; We don't need this, MUI takes care for us
|
||||
WriteRegStr HKCU "Software\${PRODUCT_NAME}" "Installer Language" $LANGUAGE
|
||||
|
||||
; uninstall shortcut
|
||||
; CreateDirectory "$SMPROGRAMS\GSmartControl"
|
||||
; CreateShortCut "$SMPROGRAMS\GSmartControl\Uninstall GSmartControl.lnk" "$INSTDIR\gsmartcontrol_uninst.exe" "" ""
|
||||
|
||||
|
||||
; write out uninstaller
|
||||
WriteUninstaller "$INSTDIR\gsmartcontrol_uninst.exe"
|
||||
|
||||
SectionEnd ; post
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; ---------------- UNINSTALL
|
||||
|
||||
|
||||
|
||||
Function un.onUninstSuccess
|
||||
HideWindow
|
||||
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
|
||||
FunctionEnd
|
||||
|
||||
|
||||
|
||||
|
||||
Section Uninstall
|
||||
|
||||
SetAutoClose false
|
||||
|
||||
; add delete commands to delete whatever files/registry keys/etc you installed here.
|
||||
Delete "$INSTDIR\gsmartcontrol_uninst.exe"
|
||||
|
||||
DeleteRegKey HKLM "SOFTWARE\${PRODUCT_NAME}"
|
||||
DeleteRegKey HKLM "${PRODUCT_UNINST_KEY}"
|
||||
|
||||
Delete "$INSTDIR\gsmartcontrol.exe"
|
||||
Delete "$INSTDIR\gsmartcontrol.ico"
|
||||
Delete "$INSTDIR\icon_*.png"
|
||||
; Delete "$INSTDIR\*.dll"
|
||||
Delete "$INSTDIR\smartctl-nc.exe"
|
||||
Delete "$INSTDIR\smartctl.exe"
|
||||
|
||||
RMDir /r "$INSTDIR\doc"
|
||||
|
||||
RMDir "$INSTDIR" ; only if empty
|
||||
|
||||
DeleteRegKey HKLM "${REGISTRY_APP_PATHS}\gsmartcontrol.exe"
|
||||
|
||||
Delete "$SMPROGRAMS\GSmartControl.lnk"
|
||||
; Delete "$SMPROGRAMS\GSmartControl\Uninstall GSmartControl.lnk"
|
||||
|
||||
|
||||
SectionEnd ; end of uninstall section
|
||||
|
||||
|
||||
|
||||
|
||||
; eof
|
||||
@@ -1,21 +0,0 @@
|
||||
Source: gsmartcontrol
|
||||
Section: utils
|
||||
Priority: extra
|
||||
Homepage: http://gsmartcontrol.berlios.de/
|
||||
Maintainer: Alexander Shaduri <ashaduriREMOVETHIS@gmail.com>
|
||||
# technically, we don't need libglademm if gtkmm >= 2.12, but it won't get
|
||||
# into Depends if it's not needed, so let's leave it here.
|
||||
Build-Depends: debhelper (>= 5), autotools-dev,
|
||||
libpcre3-dev, libgtkmm-2.4-dev (>= 2.6.0), libglademm-2.4-dev
|
||||
Standards-Version: 3.7.3
|
||||
|
||||
Package: gsmartcontrol
|
||||
Architecture: any
|
||||
#Depends: ${shlibs:Depends}, ${misc:Depends}, smartmontools
|
||||
Depends: ${shlibs:Depends}, smartmontools
|
||||
Description: Hard disk drive health inspection tool
|
||||
GSmartControl is a graphical user interface for smartctl (from smartmontools
|
||||
package), which is a tool for querying and controlling SMART
|
||||
(Self-Monitoring, Analysis, and Reporting Technology) data on modern hard
|
||||
disk drives. It allows you to inspect the drive's SMART data to determine its
|
||||
health, as well as run various tests on it.
|
||||
@@ -1,156 +0,0 @@
|
||||
Name: gsmartcontrol
|
||||
Version: @VERSION@
|
||||
Release: 1as
|
||||
License: GPLv2, GPLv3
|
||||
Url: http://gsmartcontrol.berlios.de
|
||||
Vendor: Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
Packager: Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
Source: gsmartcontrol-%{version}.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Summary: GSmartControl - Hard Disk Health Inspection Tool
|
||||
|
||||
%if 0%{?mandriva_version}
|
||||
Group: System/Kernel and hardware
|
||||
%else
|
||||
Group: Hardware/Other
|
||||
%endif
|
||||
|
||||
# Support build service rpmlint. Disabled - the build service
|
||||
# stopped recognizing the flag for some architectures.
|
||||
# %if 0%{?opensuse_bs} && 0%{?suse_version} >= 1010
|
||||
# Support: rpmlint-bs
|
||||
# %endif
|
||||
|
||||
|
||||
# Dependencies for various distributions. The actual deps are:
|
||||
# smartmontools, pcre, (gtkmm2 >= 2.12 || (gtkmm2 >= 2.6.0 && libglademm >= 2.4.0))
|
||||
# (with the respective -devel packages of the libraries for build requirements).
|
||||
# For non-specified distributions we don't specify any dependencies to avoid errors.
|
||||
|
||||
# For mandriva, these contain the su programs.
|
||||
# Suggests: libgnomesu, gksu, kdebase-progs
|
||||
|
||||
|
||||
# SUSE / OpenSUSE. SLES also defines the correct suse_version.
|
||||
%if 0%{?suse_version}
|
||||
|
||||
%if 0%{?%suse_version} >= 1030
|
||||
Requires: smartmontools, pcre, gtkmm2 >= 2.12.0
|
||||
BuildRequires: gcc-c++, libstdc++-devel, pcre-devel, gtkmm2-devel >= 2.12.0
|
||||
%else
|
||||
%if 0%{?%suse_version} == 1020
|
||||
Requires: smartmontools, pcre, gtkmm2 >= 2.6.0, libglademm >= 2.4.0
|
||||
BuildRequires: gcc-c++, libstdc++-devel, pcre-devel, gtkmm2-devel >= 2.6.0, libglademm-devel >= 2.4.0
|
||||
%else
|
||||
Requires: smartmontools, pcre, gtkmm24 >= 2.6.0, libglademm >= 2.4.0
|
||||
BuildRequires: gcc-c++, libstdc++-devel, pcre-devel, gtkmm24-devel >= 2.6.0, libglademm-devel >= 2.4.0
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%endif
|
||||
|
||||
|
||||
# Fedora, CentOS, RHEL
|
||||
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
|
||||
|
||||
# I'm not sure about centos and rhel versions
|
||||
%if 0%{?fedora_version} >= 8 || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
|
||||
Requires: smartmontools, pcre, gtkmm24 >= 2.12.0
|
||||
BuildRequires: gcc-c++, pcre-devel, gtkmm24-devel >= 2.12.0
|
||||
%else
|
||||
Requires: smartmontools, pcre, gtkmm24 >= 2.6.0, libglademm24 >= 2.4.0
|
||||
BuildRequires: gcc-c++, pcre-devel, gtkmm24-devel >= 2.6.0, libglademm24-devel >= 2.4.0
|
||||
%endif
|
||||
|
||||
%endif
|
||||
|
||||
|
||||
# Mandriva. Check the latest official spec file at
|
||||
# http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/gsmartcontrol/current/
|
||||
%if 0%{?mandriva_version}
|
||||
|
||||
%if 0%{?mandriva_version} >= 2008
|
||||
Requires: smartmontools, libpcre0, gtkmm2.4 >= 2.12.0
|
||||
BuildRequires: gcc-c++, gcc-cpp, pcre-devel, gtkmm2.4-devel >= 2.12.0, desktop-file-utils
|
||||
%else
|
||||
Requires: smartmontools, libpcre0, gtkmm2.4 >= 2.6.0, libglademm2.4 >= 2.4.0
|
||||
BuildRequires: gcc-c++, gcc-cpp, pcre-devel, gtkmm2.4-devel >= 2.6.0, libglademm2.4-devel >= 2.4.0, desktop-file-utils
|
||||
%endif
|
||||
|
||||
%endif
|
||||
|
||||
|
||||
%description
|
||||
GSmartControl is a graphical user interface for smartctl, which is a tool for
|
||||
querying and controlling SMART (Self-Monitoring, Analysis, and Reporting
|
||||
Technology) data in hard disk drives. It allows you to inspect the drive's
|
||||
SMART data to determine its health, as well as run various tests on it.
|
||||
|
||||
%prep
|
||||
|
||||
|
||||
%setup -q
|
||||
%if 0%{?mandriva_version} <= 2006
|
||||
%configure
|
||||
%else
|
||||
%configure --enable-optimize-options=auto
|
||||
%endif
|
||||
|
||||
%build
|
||||
# Set up for parallel builds
|
||||
numprocs=`egrep -c ^cpu[0-9]+ /proc/stat || :`
|
||||
if [ "$numprocs" = "0" ]; then
|
||||
numprocs=1
|
||||
fi
|
||||
|
||||
make -j$numprocs
|
||||
# make
|
||||
|
||||
|
||||
%install
|
||||
# %makeinstall
|
||||
make DESTDIR=%buildroot install-strip
|
||||
# Remove the icon cache file "make install" generates, to avoid package conflicts.
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/icon-theme.cache
|
||||
|
||||
|
||||
%if 0%{?mandriva_version}
|
||||
desktop-file-install --vendor="" \
|
||||
--remove-category="Application" \
|
||||
--add-category="System" \
|
||||
--add-category="X-MandrivaLinux-System-Configuration-Hardware;Settings;HardwareSettings" \
|
||||
--dir $RPM_BUILD_ROOT%{_datadir}/applications $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
|
||||
%endif
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf %buildroot
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
|
||||
%attr(0755,root,root) %{_bindir}/*
|
||||
# %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/*
|
||||
|
||||
%doc %{_datadir}/doc/gsmartcontrol
|
||||
%doc %{_mandir}/man1/*
|
||||
|
||||
%{_datadir}/gsmartcontrol
|
||||
# %{_datadir}/gsmartcontrol/*
|
||||
%{_datadir}/applications/*.desktop
|
||||
%{_datadir}/icons/*
|
||||
%{_datadir}/pixmaps/*
|
||||
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Nov 14 2008 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
- Updated .spec file to incorporate changes from the official Mandriva package.
|
||||
|
||||
* Mon Oct 06 2008 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
- Updated .spec file to support OpenSUSE < 10.3, Fedora and friends,
|
||||
Mandriva (for OpenSUSE Build Service).
|
||||
|
||||
* Mon Sep 15 2008 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
- Initial .spec file.
|
||||
@@ -1,212 +0,0 @@
|
||||
/**************************************************************************
|
||||
Copyright:
|
||||
(C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
License: See LICENSE_gsmartcontrol.txt
|
||||
***************************************************************************/
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include <gtk/gtk.h> // gtk_* stuff
|
||||
#include <vector>
|
||||
|
||||
#include "app_gtkmm_features.h" // APP_GTKMM_OLD_TOOLTIPS
|
||||
|
||||
#if defined APP_GTKMM_OLD_TOOLTIPS && APP_GTKMM_OLD_TOOLTIPS
|
||||
#include <gtk/gtk.h> // gtk_tooltips_*
|
||||
#endif
|
||||
|
||||
#include "app_pango_utils.h" // app_pango_strip_markup()
|
||||
#include "app_gtkmm_utils.h"
|
||||
|
||||
|
||||
|
||||
|
||||
// Note: This works only if the column has custom widget set.
|
||||
Gtk::Widget* app_gtkmm_get_column_header(Gtk::TreeViewColumn& column)
|
||||
{
|
||||
Gtk::Widget* w = column.get_widget();
|
||||
Gtk::Widget* p1 = 0;
|
||||
Gtk::Widget* p2 = 0;
|
||||
Gtk::Widget* p3 = 0;
|
||||
|
||||
// move up to GtkAlignment, then GtkHBox, then GtkButton.
|
||||
if (w && (p1 = w->get_parent()) && (p2 = p1->get_parent()) && (p3 = p2->get_parent()))
|
||||
return p3;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Read column header text and create a label with that text, set it as column's custom widget.
|
||||
Gtk::Widget* app_gtkmm_labelize_column(Gtk::TreeViewColumn& column)
|
||||
{
|
||||
Gtk::Label* label = Gtk::manage(new Gtk::Label(column.get_title()));
|
||||
label->show();
|
||||
column.set_widget(*label);
|
||||
return label;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// A wrapper around set_tooltip_*() for portability across different gtkmm versions.
|
||||
void app_gtkmm_set_widget_tooltip(Gtk::Widget& widget,
|
||||
const Glib::ustring& tooltip_text, bool use_markup)
|
||||
{
|
||||
// set_tooltip_* is available since 2.12
|
||||
#if !(defined APP_GTKMM_OLD_TOOLTIPS && APP_GTKMM_OLD_TOOLTIPS)
|
||||
if (use_markup) {
|
||||
widget.set_tooltip_markup(tooltip_text);
|
||||
} else {
|
||||
widget.set_tooltip_text(tooltip_text);
|
||||
}
|
||||
|
||||
#else // use the old tooltips api
|
||||
Gtk::Widget* toplevel = widget.get_toplevel();
|
||||
if (toplevel && toplevel->is_toplevel()) { // orphan widgets return themselves, so check toplevelness.
|
||||
GtkTooltips* tooltips = static_cast<GtkTooltips*>(toplevel->get_data("window_tooltips"));
|
||||
if (tooltips) {
|
||||
if (use_markup) {
|
||||
// strip markup
|
||||
Glib::ustring stripped;
|
||||
if (app_pango_strip_markup(tooltip_text, stripped)) {
|
||||
gtk_tooltips_set_tip(tooltips, widget.gobj(), stripped.c_str(), "");
|
||||
}
|
||||
|
||||
} else {
|
||||
gtk_tooltips_set_tip(tooltips, widget.gobj(), tooltip_text.c_str(), "");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
// unset model on treeview, cross-gtkmm-version.
|
||||
void app_gtkmm_treeview_unset_model(Gtk::TreeView* treeview)
|
||||
{
|
||||
// gtkmm's TreeView::unset_model() is since gtkmm 2.8
|
||||
// (and there's no version info in docs), so use this instead.
|
||||
if (treeview)
|
||||
gtk_tree_view_set_model(treeview->gobj(), 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// unset model on combobox, cross-gtkmm-version.
|
||||
void app_gtkmm_combobox_unset_model(Gtk::ComboBox* box)
|
||||
{
|
||||
// there's no ComboBox::unset_model() in gtkmm (huh?)
|
||||
if (box)
|
||||
gtk_combo_box_set_model(box->gobj(), 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined APP_GTKMM_OLD_TOOLTIPS && APP_GTKMM_OLD_TOOLTIPS
|
||||
|
||||
namespace {
|
||||
|
||||
// helper function for gtkmm_set_treeview_tooltip_column()
|
||||
inline bool app_on_treeview_motion_notify_event_tooltip(GdkEventMotion* event, Gtk::TreeView* treeview,
|
||||
Gtk::TreeModelColumn<Glib::ustring> tooltip_column)
|
||||
{
|
||||
// debug_out_dump("app", DBG_FUNC_MSG << "x=" << int(event->x) << ", y=" << int(event->y) << "\n");
|
||||
|
||||
Gtk::TreePath path;
|
||||
Gtk::TreeViewColumn* mouse_column = 0;
|
||||
int cell_x = 0, cell_y = 0;
|
||||
|
||||
if (treeview->get_path_at_pos(static_cast<int>(event->x), static_cast<int>(event->y),
|
||||
path, mouse_column, cell_x, cell_y)) { // returns true if we're on a cell
|
||||
app_gtkmm_set_widget_tooltip(*treeview, (*(treeview->get_model()->get_iter(path)))[tooltip_column], true);
|
||||
}
|
||||
|
||||
return false; // continue handling (no conflicts there?)
|
||||
}
|
||||
|
||||
|
||||
// helper function for gtkmm_set_iconview_tooltip_column()
|
||||
inline bool app_on_iconview_motion_notify_event_tooltip(GdkEventMotion* event, Gtk::IconView* iconview,
|
||||
Gtk::TreeModelColumn<Glib::ustring> tooltip_column, Glib::RefPtr<Gtk::ListStore> model)
|
||||
{
|
||||
// debug_out_dump("app", DBG_FUNC_MSG << "x=" << int(event->x) << ", y=" << int(event->y) << "\n");
|
||||
|
||||
// don't use get_item_at_pos() - it's not available in gtkmm < 2.8.
|
||||
Gtk::TreePath tpath = iconview->get_path_at_pos(static_cast<int>(event->x), static_cast<int>(event->y));
|
||||
if (tpath.gobj() && !tpath.empty()) { // without gobj() check gtkmm 2.6 (but not 2.12) prints lots of errors
|
||||
// somehow, getting model from iconview doesn't work (segfault).
|
||||
// Glib::RefPtr<Gtk::TreeModel> model = iconview->get_model();
|
||||
if (tpath.gobj())
|
||||
app_gtkmm_set_widget_tooltip(*iconview, (*(model->get_iter(tpath)))[tooltip_column], true);
|
||||
}
|
||||
|
||||
return false; // continue handling (no conflicts there?)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void gtkmm_set_treeview_tooltip_column(Gtk::TreeView* treeview,
|
||||
Gtk::TreeModelColumn<Glib::ustring>& col_tooltip)
|
||||
{
|
||||
if (!treeview)
|
||||
return;
|
||||
|
||||
#if !(defined APP_GTKMM_OLD_TOOLTIPS && APP_GTKMM_OLD_TOOLTIPS)
|
||||
treeview->set_tooltip_column(col_tooltip.index()); // gtkmm has only index-based api here
|
||||
|
||||
#else // manually set tooltips when hovering over cells
|
||||
treeview->signal_motion_notify_event().connect( // connect before other events, or we'll get some screwed event data
|
||||
sigc::bind(sigc::bind(sigc::ptr_fun(&app_on_treeview_motion_notify_event_tooltip), col_tooltip), treeview), false);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
void gtkmm_set_iconview_tooltip_column(Gtk::IconView* iconview,
|
||||
Gtk::TreeModelColumn<Glib::ustring>& col_tooltip, Glib::RefPtr<Gtk::ListStore> model)
|
||||
{
|
||||
if (!iconview)
|
||||
return;
|
||||
|
||||
#if !(defined APP_GTKMM_OLD_TOOLTIPS && APP_GTKMM_OLD_TOOLTIPS)
|
||||
iconview->set_tooltip_column(col_tooltip.index()); // gtkmm has only index-based api here
|
||||
|
||||
#else // manually set tooltips when hovering over cells
|
||||
iconview->signal_motion_notify_event().connect( // connect before other events, or we'll get some screwed event data
|
||||
sigc::bind(sigc::bind(sigc::bind(sigc::ptr_fun(&app_on_iconview_motion_notify_event_tooltip), model), col_tooltip), iconview), false);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool app_gtkmm_icon_theme_has_icon(Glib::RefPtr<Gtk::IconTheme> theme,
|
||||
const Glib::ustring& icon_name, int size)
|
||||
{
|
||||
if (!theme || !theme->has_icon(icon_name)) // check if it exists first, or exception may be thrown.
|
||||
return false;
|
||||
|
||||
std::vector<int> sizes = theme->get_icon_sizes(icon_name);
|
||||
|
||||
for (std::vector<int>::const_iterator iter = sizes.begin(); iter != sizes.end(); ++iter) {
|
||||
if (*iter == size || *iter == -1) // -1 means scalable
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
/**************************************************************************
|
||||
Copyright:
|
||||
(C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
License: See LICENSE_gsmartcontrol.txt
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef APP_GTKMM_UTILS_H
|
||||
#define APP_GTKMM_UTILS_H
|
||||
|
||||
#include <string>
|
||||
#include <gtkmm/widget.h>
|
||||
#include <gtkmm/treeviewcolumn.h>
|
||||
#include <gtkmm/treemodelcolumn.h>
|
||||
#include <gtkmm/treeview.h>
|
||||
#include <gtkmm/combobox.h>
|
||||
#include <gtkmm/cellrenderertext.h>
|
||||
#include <gtkmm/iconview.h>
|
||||
#include <gtkmm/liststore.h>
|
||||
#include <gtkmm/icontheme.h> // must include (even if gtkmm.h is included) for older gtkmm (at least 2.6, but not 2.12)
|
||||
|
||||
#include "hz/down_cast.h"
|
||||
|
||||
|
||||
|
||||
// Note: This works only if the column has custom widget set.
|
||||
Gtk::Widget* app_gtkmm_get_column_header(Gtk::TreeViewColumn& column);
|
||||
|
||||
|
||||
// Read column header text and create a label with that text, set it as column's custom widget.
|
||||
Gtk::Widget* app_gtkmm_labelize_column(Gtk::TreeViewColumn& column);
|
||||
|
||||
|
||||
// unset model on treeview, cross-gtkmm-version.
|
||||
void app_gtkmm_treeview_unset_model(Gtk::TreeView* treeview);
|
||||
|
||||
|
||||
// unset model on combobox (there's no straight way to do it in gtkmm, I think)
|
||||
void app_gtkmm_combobox_unset_model(Gtk::ComboBox* box);
|
||||
|
||||
|
||||
// A wrapper around set_tooltip_*() for portability across different gtkmm versions.
|
||||
void app_gtkmm_set_widget_tooltip(Gtk::Widget& widget,
|
||||
const Glib::ustring& tooltip_text, bool use_markup = false);
|
||||
|
||||
|
||||
// A portable wrapper around TreeView::set_tooltip_column().
|
||||
void gtkmm_set_treeview_tooltip_column(Gtk::TreeView* treeview,
|
||||
Gtk::TreeModelColumn<Glib::ustring>& col_tooltip);
|
||||
|
||||
// A portable wrapper around IconView::set_tooltip_column().
|
||||
void gtkmm_set_iconview_tooltip_column(Gtk::IconView* iconview,
|
||||
Gtk::TreeModelColumn<Glib::ustring>& col_tooltip, Glib::RefPtr<Gtk::ListStore> model);
|
||||
|
||||
|
||||
|
||||
// Convenience function for creating a TreeViewColumn .
|
||||
template<typename T> inline
|
||||
int app_gtkmm_create_tree_view_column(Gtk::TreeModelColumn<T>& mcol, Gtk::TreeView& treeview,
|
||||
const Glib::ustring& title, const Glib::ustring& tooltip_text, bool sortable = false, bool cell_markup = false)
|
||||
{
|
||||
int num_tree_cols = treeview.append_column(title, mcol);
|
||||
Gtk::TreeViewColumn* tcol = treeview.get_column(num_tree_cols - 1);
|
||||
if (tcol) {
|
||||
if (sortable)
|
||||
tcol->set_sort_column(mcol);
|
||||
|
||||
app_gtkmm_labelize_column(*tcol);
|
||||
tcol->set_reorderable(true);
|
||||
tcol->set_resizable(true);
|
||||
}
|
||||
|
||||
Gtk::Widget* header = app_gtkmm_get_column_header(*tcol);
|
||||
if (header)
|
||||
app_gtkmm_set_widget_tooltip(*header, tooltip_text);
|
||||
|
||||
if (cell_markup) {
|
||||
Gtk::CellRendererText* cr_type = hz::down_cast<Gtk::CellRendererText*>(treeview.get_column_cell_renderer(num_tree_cols - 1));
|
||||
if (cr_type) { // may not be true if it's not Text (unless static_cast is used, in which case we're screwed)
|
||||
treeview.get_column(num_tree_cols - 1)->clear_attributes(*cr_type); // clear "text" attribute. "markup" won't work without this.
|
||||
treeview.get_column(num_tree_cols - 1)->add_attribute(cr_type->property_markup(), mcol); // render col_type as markup.
|
||||
}
|
||||
}
|
||||
|
||||
return num_tree_cols;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool app_gtkmm_icon_theme_has_icon(Glib::RefPtr<Gtk::IconTheme> theme,
|
||||
const Glib::ustring& icon_name, int size);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,405 +0,0 @@
|
||||
/**************************************************************************
|
||||
Copyright:
|
||||
(C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
License: See LICENSE_gsmartcontrol.txt
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef APP_UI_RES_UTILS_H
|
||||
#define APP_UI_RES_UTILS_H
|
||||
|
||||
#include <string>
|
||||
#include <gtkmm/window.h>
|
||||
|
||||
#include "hz/hz_config.h" // feature test macros (ENABLE_*)
|
||||
|
||||
#if defined ENABLE_LIBGLADE && ENABLE_LIBGLADE
|
||||
#include <libglademm.h>
|
||||
#elif defined ENABLE_GTKBUILDER && ENABLE_GTKBUILDER
|
||||
#include <gtkmm/builder.h>
|
||||
#endif
|
||||
|
||||
// Old glibmm versions had exceptions but didn't define this at all.
|
||||
// New ones define it to 0 if there are no glibmm exceptions.
|
||||
#if !defined GLIBMM_EXCEPTIONS_ENABLED || GLIBMM_EXCEPTIONS_ENABLED
|
||||
#include <memory> // std::auto_ptr
|
||||
#endif
|
||||
|
||||
#include "app_gtkmm_features.h" // APP_GTKMM_OLD_TOOLTIPS
|
||||
|
||||
#if defined APP_GTKMM_OLD_TOOLTIPS && APP_GTKMM_OLD_TOOLTIPS
|
||||
#include <gtk/gtk.h> // gtk_tooltips_*
|
||||
#endif
|
||||
|
||||
#include "hz/debug.h"
|
||||
#include "hz/instance_manager.h"
|
||||
#include "hz/down_cast.h"
|
||||
#include "hz/res_data.h"
|
||||
|
||||
#include "gui_utils.h" // gui_show_error_dialog
|
||||
|
||||
|
||||
|
||||
// Use these in window class definitions to declare ui resources.
|
||||
// E.g. HZ_RES_DATA_INIT(main_window) will search for
|
||||
// main_window.glade or main_window.ui (depending on whether
|
||||
// you're using libglade or gtkbuilder) in data file search paths.
|
||||
// Or, if you're using compiled-in buffers, it will make them available.
|
||||
|
||||
|
||||
#if defined ENABLE_LIBGLADE && ENABLE_LIBGLADE
|
||||
|
||||
#define APP_UI_RES_DATA_INIT(res_name) \
|
||||
HZ_RES_DATA_INIT_NAMED(res_name##_ui, #res_name ".glade", UIResDataBase); \
|
||||
struct UIResData : public UIResDataBase { \
|
||||
UIResData() \
|
||||
{ \
|
||||
UIResDataBase::root_name = #res_name; /* we need original name here, not with _ui */ \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#elif defined ENABLE_GTKBUILDER && ENABLE_GTKBUILDER
|
||||
|
||||
#define APP_UI_RES_DATA_INIT(res_name) \
|
||||
HZ_RES_DATA_INIT_NAMED(res_name##_ui, #res_name ".ui", UIResDataBase); \
|
||||
struct UIResData : public UIResDataBase { \
|
||||
UIResData() \
|
||||
{ \
|
||||
UIResDataBase::root_name = #res_name; /* we need original name here, not with _ui */ \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#else // none, just avoid errors
|
||||
|
||||
#define APP_UI_RES_DATA_INIT(res_name) \
|
||||
HZ_RES_DATA_DUMMY_INIT_NAMED(res_name##_ui, 0, UIResDataBase); \
|
||||
struct UIResData : public UIResDataBase { \
|
||||
UIResData() \
|
||||
{ \
|
||||
UIResDataBase::root_name = #res_name; /* we need original name here, not with _ui */ \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined ENABLE_LIBGLADE && ENABLE_LIBGLADE
|
||||
|
||||
typedef Glib::RefPtr<Gnome::Glade::Xml> app_ui_res_ref_t;
|
||||
|
||||
|
||||
inline bool app_ui_res_create_from(app_ui_res_ref_t& ref,
|
||||
const unsigned char* buf, unsigned int buf_size, std::string& error_msg)
|
||||
{
|
||||
if (!buf_size || !buf || !buf[0]) {
|
||||
error_msg = "Cannot load data buffers.";
|
||||
return false;
|
||||
}
|
||||
|
||||
#if !defined GLIBMM_EXCEPTIONS_ENABLED || GLIBMM_EXCEPTIONS_ENABLED
|
||||
try {
|
||||
// Glib::RefPtr<Gnome::Glade::Xml> ref = Gnome::Glade::Xml::create("main_window.glade");
|
||||
ref = Gnome::Glade::Xml::create_from_buffer(reinterpret_cast<const char*>(buf),
|
||||
static_cast<int>(buf_size));
|
||||
}
|
||||
catch (Gnome::Glade::XmlError& ex) {
|
||||
error_msg = ex.what();
|
||||
return false;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
std::auto_ptr<Gnome::Glade::XmlError> error;
|
||||
ref = Gnome::Glade::Xml::create_from_buffer(reinterpret_cast<const char*>(buf),
|
||||
static_cast<int>(buf_size),"", "", error);
|
||||
|
||||
if (error.get()) {
|
||||
error_msg = error->what();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#elif defined ENABLE_GTKBUILDER && ENABLE_GTKBUILDER
|
||||
|
||||
typedef Glib::RefPtr<Gtk::Builder> app_ui_res_ref_t;
|
||||
|
||||
|
||||
inline bool app_ui_res_create_from(app_ui_res_ref_t& ref,
|
||||
const unsigned char* buf, unsigned int buf_size, std::string& error_msg)
|
||||
{
|
||||
if (!buf_size || !buf || !buf[0]) {
|
||||
error_msg = "Cannot load data buffers.";
|
||||
return false;
|
||||
}
|
||||
|
||||
#if !defined GLIBMM_EXCEPTIONS_ENABLED || GLIBMM_EXCEPTIONS_ENABLED
|
||||
try {
|
||||
// ref->add_from_file("main_window.ui");
|
||||
ref->add_from_string(reinterpret_cast<const char*>(buf), static_cast<gsize>(buf_size));
|
||||
}
|
||||
catch (Gtk::BuilderError& ex) { // the docs say Glib::MarkupError, but examples say otherwise.
|
||||
error_msg = ex.what();
|
||||
return false;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
std::auto_ptr<Glib::BuilderError> error;
|
||||
ref->add_from_string(reinterpret_cast<const char*>(buf), static_cast<gsize>(buf_size),"", "", error);
|
||||
|
||||
if (error.get()) {
|
||||
error_msg = error->what();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#else // none, just avoid compilation errors
|
||||
|
||||
struct AppUIResDummy {
|
||||
template<typename T>
|
||||
void get_widget_derived(const Glib::ustring& name, T*& widget)
|
||||
{ }
|
||||
template<typename T>
|
||||
void get_widget(const Glib::ustring& name, T*& widget)
|
||||
{ }
|
||||
};
|
||||
|
||||
typedef AppUIResDummy* app_ui_res_ref_t;
|
||||
|
||||
inline bool app_ui_res_create_from(app_ui_res_ref_t& ref,
|
||||
const unsigned char* buf, unsigned int buf_size, std::string& error_msg)
|
||||
{
|
||||
error_msg = "Neither Gtk::Builder (gtkmm >= 2.12) nor libglademm were present during compilation."
|
||||
" Recompile when either dependency is resolved.";
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
// These allow easy attaching of glade widget signals to member functions
|
||||
|
||||
// Connect member function (callback) to signal signal_name on widget
|
||||
// widget_name, where widget_name is the widget's glade/gtkbuilder name.
|
||||
#define APP_UI_RES_CONNECT(ui_element, signal_name, callback) \
|
||||
if (true) { \
|
||||
if (!ui_element) \
|
||||
this->lookup_object(#ui_element, ui_element); \
|
||||
if (ui_element) { \
|
||||
ui_element->signal_ ## signal_name ().connect(sigc::mem_fun(*this, &self_type::callback)); \
|
||||
} \
|
||||
} else (void)0
|
||||
|
||||
|
||||
// Same as above, but default callback name to on_<widget_name>_<signal_name>.
|
||||
#define APP_UI_RES_AUTO_CONNECT(ui_element, signal_name) \
|
||||
APP_UI_RES_CONNECT(ui_element, signal_name, on_ ## ui_element ## _ ## signal_name)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Inherit from this when using Glade-enabled windows (or any other objects).
|
||||
|
||||
template<class Child, bool MultiInstance, class WidgetType = Gtk::Window>
|
||||
class AppUIResWidget : public WidgetType, public hz::InstanceManager<Child, MultiInstance> {
|
||||
|
||||
public:
|
||||
|
||||
typedef hz::InstanceManager<Child, MultiInstance> instance_class;
|
||||
|
||||
#if defined ENABLE_LIBGLADE && ENABLE_LIBGLADE
|
||||
friend class Gnome::Glade::Xml; // allow construction through libglade
|
||||
#elif defined ENABLE_GTKBUILDER && ENABLE_GTKBUILDER
|
||||
friend class Gtk::Builder; // allow construction through gtkbuilder
|
||||
#endif
|
||||
friend class hz::InstanceManager<Child, MultiInstance>; // allow construction through instance class
|
||||
|
||||
|
||||
// overload parent's function because of non-trivial constructor
|
||||
static Child* create()
|
||||
{
|
||||
if (hz::InstanceManager<Child, MultiInstance>::has_single_instance()) // for single-instance objects
|
||||
return hz::InstanceManager<Child, MultiInstance>::get_single_instance();
|
||||
|
||||
std::string error;
|
||||
#if defined ENABLE_LIBGLADE && ENABLE_LIBGLADE
|
||||
app_ui_res_ref_t ui;
|
||||
#elif defined ENABLE_GTKBUILDER && ENABLE_GTKBUILDER
|
||||
app_ui_res_ref_t ui = Gtk::Builder::create();
|
||||
#else // none, just avoid compilation errors
|
||||
app_ui_res_ref_t ui = 0;
|
||||
#endif
|
||||
const typename Child::UIResData data; // this holds the glade data
|
||||
|
||||
// this does the actual object construction
|
||||
bool success = app_ui_res_create_from(ui, data.buf, data.size, error);
|
||||
|
||||
if (!success) {
|
||||
std::string msg = "Fatal error: Cannot create UI-resource widgets: " + error;
|
||||
debug_out_fatal("app", msg << "\n");
|
||||
gui_show_error_dialog(msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Child* o = 0;
|
||||
ui->get_widget_derived(data.root_name, o);
|
||||
|
||||
if (!o) {
|
||||
std::string msg = "Fatal error: Cannot get root widget from UI-resource-created hierarchy.";
|
||||
debug_out_fatal("app", msg << "\n");
|
||||
gui_show_error_dialog(msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
o->obj_create();
|
||||
|
||||
hz::InstanceManager<Child, MultiInstance>::set_single_instance(o); // for single-instance objects
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
|
||||
app_ui_res_ref_t get_ui()
|
||||
{
|
||||
return ref_ui_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Gtk::Widget* lookup_widget(const Glib::ustring& name)
|
||||
{
|
||||
return lookup_widget<Gtk::Widget*>(name);
|
||||
}
|
||||
|
||||
template<typename WidgetPtr>
|
||||
WidgetPtr lookup_widget(const Glib::ustring& name)
|
||||
{
|
||||
WidgetPtr w = 0;
|
||||
return lookup_widget(name, w);
|
||||
}
|
||||
|
||||
template<typename WidgetPtr>
|
||||
WidgetPtr lookup_widget(const Glib::ustring& name, WidgetPtr& w)
|
||||
{
|
||||
ref_ui_->get_widget(name, w);
|
||||
return w;
|
||||
}
|
||||
|
||||
|
||||
Glib::Object* lookup_object(const Glib::ustring& name)
|
||||
{
|
||||
#if defined ENABLE_LIBGLADE && ENABLE_LIBGLADE
|
||||
return static_cast<Glib::Object*>(lookup_widget(name)); // all glade objects are widgets, it's an upcast
|
||||
#elif defined ENABLE_GTKBUILDER && ENABLE_GTKBUILDER
|
||||
return ref_ui_->get_object(name).operator->(); // silly RefPtr doesn't have get().
|
||||
#else // none, just avoid compilation errors
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename ObjectPtr>
|
||||
ObjectPtr lookup_object(const Glib::ustring& name)
|
||||
{
|
||||
ObjectPtr obj = 0;
|
||||
return lookup_object(name, obj);
|
||||
}
|
||||
|
||||
template<typename ObjectPtr>
|
||||
ObjectPtr lookup_object(const Glib::ustring& name, ObjectPtr& obj)
|
||||
{
|
||||
return (obj = hz::down_cast<ObjectPtr>(lookup_object(name))); // up, then down
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// This is needed by APP_GLADE_ macros
|
||||
typedef Child self_type;
|
||||
typedef WidgetType widget_type;
|
||||
|
||||
|
||||
// protected constructor / destructor, use create() / destroy() instead of new / delete.
|
||||
|
||||
// glade needs this constructor in a child.
|
||||
// BaseObjectType is a C type, defined in specific Gtk:: widget class.
|
||||
AppUIResWidget(typename WidgetType::BaseObjectType* gtkcobj, const app_ui_res_ref_t& ref_ui)
|
||||
: WidgetType(gtkcobj), ref_ui_(ref_ui)
|
||||
{
|
||||
// if gtkmm is older than 2.12, use the old tooltips API
|
||||
#if defined APP_GTKMM_OLD_TOOLTIPS && APP_GTKMM_OLD_TOOLTIPS
|
||||
// attach it to the window
|
||||
this->create_tooltips_data(this);
|
||||
#endif
|
||||
|
||||
|
||||
// manually connecting signals:
|
||||
// this->signal_delete_event().connect(sigc::mem_fun(*this, &MainWindow::on_main_window_delete));
|
||||
|
||||
// signals of glade-created objects:
|
||||
// Gtk::ToolButton* rescan_devices_toolbutton = 0;
|
||||
// APP_UI_RES_AUTO_CONNECT(rescan_devices_toolbutton, clicked);
|
||||
|
||||
// show();
|
||||
}
|
||||
|
||||
|
||||
virtual ~AppUIResWidget()
|
||||
{ }
|
||||
|
||||
|
||||
#if defined APP_GTKMM_OLD_TOOLTIPS && APP_GTKMM_OLD_TOOLTIPS
|
||||
// differentiate Window and its children from other widgets through overloading
|
||||
|
||||
void create_tooltips_data(Gtk::Window* window)
|
||||
{
|
||||
if (window) {
|
||||
// gtkmm tooltips api is somewhat broken (no create?), so use gtk
|
||||
if (!window->get_data("window_tooltips")) {
|
||||
window->set_data("window_tooltips", gtk_tooltips_new());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void create_tooltips_data(Gtk::Object* o)
|
||||
{ }
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// void on_rescan_devices_toolbutton_clicked()
|
||||
// {
|
||||
// }
|
||||
|
||||
|
||||
private:
|
||||
|
||||
app_ui_res_ref_t ref_ui_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,582 +0,0 @@
|
||||
/**************************************************************************
|
||||
Copyright:
|
||||
(C) 2008 - 2009 Alexander Shaduri <ashaduri 'at' gmail.com>
|
||||
License: See LICENSE_whatever.txt
|
||||
***************************************************************************/
|
||||
|
||||
#include "hz/hz_config.h" // feature test macros (ENABLE_*)
|
||||
|
||||
|
||||
// A simple empty window definition
|
||||
|
||||
#if defined ENABLE_LIBGLADE && ENABLE_LIBGLADE
|
||||
|
||||
|
||||
extern const unsigned char app_ui_res_test_window_ui[] = {
|
||||
|
||||
0x3C,
|
||||
0x3F,
|
||||
0x78,
|
||||
0x6D,
|
||||
0x6C,
|
||||
0x20,
|
||||
0x76,
|
||||
0x65,
|
||||
0x72,
|
||||
0x73,
|
||||
0x69,
|
||||
0x6F,
|
||||
0x6E,
|
||||
0x3D,
|
||||
0x22,
|
||||
0x31,
|
||||
0x2E,
|
||||
0x30,
|
||||
0x22,
|
||||
0x20,
|
||||
0x65,
|
||||
0x6E,
|
||||
0x63,
|
||||
0x6F,
|
||||
0x64,
|
||||
0x69,
|
||||
0x6E,
|
||||
0x67,
|
||||
0x3D,
|
||||
0x22,
|
||||
0x55,
|
||||
0x54,
|
||||
0x46,
|
||||
0x2D,
|
||||
0x38,
|
||||
0x22,
|
||||
0x20,
|
||||
0x73,
|
||||
0x74,
|
||||
0x61,
|
||||
0x6E,
|
||||
0x64,
|
||||
0x61,
|
||||
0x6C,
|
||||
0x6F,
|
||||
0x6E,
|
||||
0x65,
|
||||
0x3D,
|
||||
0x22,
|
||||
0x6E,
|
||||
0x6F,
|
||||
0x22,
|
||||
0x3F,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x3C,
|
||||
0x21,
|
||||
0x44,
|
||||
0x4F,
|
||||
0x43,
|
||||
0x54,
|
||||
0x59,
|
||||
0x50,
|
||||
0x45,
|
||||
0x20,
|
||||
0x67,
|
||||
0x6C,
|
||||
0x61,
|
||||
0x64,
|
||||
0x65,
|
||||
0x2D,
|
||||
0x69,
|
||||
0x6E,
|
||||
0x74,
|
||||
0x65,
|
||||
0x72,
|
||||
0x66,
|
||||
0x61,
|
||||
0x63,
|
||||
0x65,
|
||||
0x20,
|
||||
0x53,
|
||||
0x59,
|
||||
0x53,
|
||||
0x54,
|
||||
0x45,
|
||||
0x4D,
|
||||
0x20,
|
||||
0x22,
|
||||
0x67,
|
||||
0x6C,
|
||||
0x61,
|
||||
0x64,
|
||||
0x65,
|
||||
0x2D,
|
||||
0x32,
|
||||
0x2E,
|
||||
0x30,
|
||||
0x2E,
|
||||
0x64,
|
||||
0x74,
|
||||
0x64,
|
||||
0x22,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x3C,
|
||||
0x67,
|
||||
0x6C,
|
||||
0x61,
|
||||
0x64,
|
||||
0x65,
|
||||
0x2D,
|
||||
0x69,
|
||||
0x6E,
|
||||
0x74,
|
||||
0x65,
|
||||
0x72,
|
||||
0x66,
|
||||
0x61,
|
||||
0x63,
|
||||
0x65,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x20,
|
||||
0x20,
|
||||
0x3C,
|
||||
0x77,
|
||||
0x69,
|
||||
0x64,
|
||||
0x67,
|
||||
0x65,
|
||||
0x74,
|
||||
0x20,
|
||||
0x63,
|
||||
0x6C,
|
||||
0x61,
|
||||
0x73,
|
||||
0x73,
|
||||
0x3D,
|
||||
0x22,
|
||||
0x47,
|
||||
0x74,
|
||||
0x6B,
|
||||
0x57,
|
||||
0x69,
|
||||
0x6E,
|
||||
0x64,
|
||||
0x6F,
|
||||
0x77,
|
||||
0x22,
|
||||
0x20,
|
||||
0x69,
|
||||
0x64,
|
||||
0x3D,
|
||||
0x22,
|
||||
0x61,
|
||||
0x70,
|
||||
0x70,
|
||||
0x5F,
|
||||
0x75,
|
||||
0x69,
|
||||
0x5F,
|
||||
0x72,
|
||||
0x65,
|
||||
0x73,
|
||||
0x5F,
|
||||
0x74,
|
||||
0x65,
|
||||
0x73,
|
||||
0x74,
|
||||
0x5F,
|
||||
0x77,
|
||||
0x69,
|
||||
0x6E,
|
||||
0x64,
|
||||
0x6F,
|
||||
0x77,
|
||||
0x22,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x3C,
|
||||
0x70,
|
||||
0x72,
|
||||
0x6F,
|
||||
0x70,
|
||||
0x65,
|
||||
0x72,
|
||||
0x74,
|
||||
0x79,
|
||||
0x20,
|
||||
0x6E,
|
||||
0x61,
|
||||
0x6D,
|
||||
0x65,
|
||||
0x3D,
|
||||
0x22,
|
||||
0x74,
|
||||
0x69,
|
||||
0x74,
|
||||
0x6C,
|
||||
0x65,
|
||||
0x22,
|
||||
0x20,
|
||||
0x74,
|
||||
0x72,
|
||||
0x61,
|
||||
0x6E,
|
||||
0x73,
|
||||
0x6C,
|
||||
0x61,
|
||||
0x74,
|
||||
0x61,
|
||||
0x62,
|
||||
0x6C,
|
||||
0x65,
|
||||
0x3D,
|
||||
0x22,
|
||||
0x79,
|
||||
0x65,
|
||||
0x73,
|
||||
0x22,
|
||||
0x3E,
|
||||
0x54,
|
||||
0x65,
|
||||
0x73,
|
||||
0x74,
|
||||
0x3C,
|
||||
0x2F,
|
||||
0x70,
|
||||
0x72,
|
||||
0x6F,
|
||||
0x70,
|
||||
0x65,
|
||||
0x72,
|
||||
0x74,
|
||||
0x79,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x3C,
|
||||
0x63,
|
||||
0x68,
|
||||
0x69,
|
||||
0x6C,
|
||||
0x64,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x3C,
|
||||
0x70,
|
||||
0x6C,
|
||||
0x61,
|
||||
0x63,
|
||||
0x65,
|
||||
0x68,
|
||||
0x6F,
|
||||
0x6C,
|
||||
0x64,
|
||||
0x65,
|
||||
0x72,
|
||||
0x2F,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x3C,
|
||||
0x2F,
|
||||
0x63,
|
||||
0x68,
|
||||
0x69,
|
||||
0x6C,
|
||||
0x64,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x20,
|
||||
0x20,
|
||||
0x3C,
|
||||
0x2F,
|
||||
0x77,
|
||||
0x69,
|
||||
0x64,
|
||||
0x67,
|
||||
0x65,
|
||||
0x74,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x3C,
|
||||
0x2F,
|
||||
0x67,
|
||||
0x6C,
|
||||
0x61,
|
||||
0x64,
|
||||
0x65,
|
||||
0x2D,
|
||||
0x69,
|
||||
0x6E,
|
||||
0x74,
|
||||
0x65,
|
||||
0x72,
|
||||
0x66,
|
||||
0x61,
|
||||
0x63,
|
||||
0x65,
|
||||
0x3E,
|
||||
0xA,
|
||||
|
||||
0x0 };
|
||||
|
||||
extern const unsigned int app_ui_res_test_window_ui_size = 319;
|
||||
|
||||
|
||||
|
||||
|
||||
#elif defined ENABLE_GTKBUILDER && ENABLE_GTKBUILDER
|
||||
|
||||
|
||||
extern const unsigned char app_ui_res_test_window_ui[] = {
|
||||
|
||||
0x3C,
|
||||
0x3F,
|
||||
0x78,
|
||||
0x6D,
|
||||
0x6C,
|
||||
0x20,
|
||||
0x76,
|
||||
0x65,
|
||||
0x72,
|
||||
0x73,
|
||||
0x69,
|
||||
0x6F,
|
||||
0x6E,
|
||||
0x3D,
|
||||
0x22,
|
||||
0x31,
|
||||
0x2E,
|
||||
0x30,
|
||||
0x22,
|
||||
0x3F,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x3C,
|
||||
0x69,
|
||||
0x6E,
|
||||
0x74,
|
||||
0x65,
|
||||
0x72,
|
||||
0x66,
|
||||
0x61,
|
||||
0x63,
|
||||
0x65,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x20,
|
||||
0x20,
|
||||
0x3C,
|
||||
0x6F,
|
||||
0x62,
|
||||
0x6A,
|
||||
0x65,
|
||||
0x63,
|
||||
0x74,
|
||||
0x20,
|
||||
0x63,
|
||||
0x6C,
|
||||
0x61,
|
||||
0x73,
|
||||
0x73,
|
||||
0x3D,
|
||||
0x22,
|
||||
0x47,
|
||||
0x74,
|
||||
0x6B,
|
||||
0x57,
|
||||
0x69,
|
||||
0x6E,
|
||||
0x64,
|
||||
0x6F,
|
||||
0x77,
|
||||
0x22,
|
||||
0x20,
|
||||
0x69,
|
||||
0x64,
|
||||
0x3D,
|
||||
0x22,
|
||||
0x61,
|
||||
0x70,
|
||||
0x70,
|
||||
0x5F,
|
||||
0x75,
|
||||
0x69,
|
||||
0x5F,
|
||||
0x72,
|
||||
0x65,
|
||||
0x73,
|
||||
0x5F,
|
||||
0x74,
|
||||
0x65,
|
||||
0x73,
|
||||
0x74,
|
||||
0x5F,
|
||||
0x77,
|
||||
0x69,
|
||||
0x6E,
|
||||
0x64,
|
||||
0x6F,
|
||||
0x77,
|
||||
0x22,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x3C,
|
||||
0x70,
|
||||
0x72,
|
||||
0x6F,
|
||||
0x70,
|
||||
0x65,
|
||||
0x72,
|
||||
0x74,
|
||||
0x79,
|
||||
0x20,
|
||||
0x6E,
|
||||
0x61,
|
||||
0x6D,
|
||||
0x65,
|
||||
0x3D,
|
||||
0x22,
|
||||
0x74,
|
||||
0x69,
|
||||
0x74,
|
||||
0x6C,
|
||||
0x65,
|
||||
0x22,
|
||||
0x20,
|
||||
0x74,
|
||||
0x72,
|
||||
0x61,
|
||||
0x6E,
|
||||
0x73,
|
||||
0x6C,
|
||||
0x61,
|
||||
0x74,
|
||||
0x61,
|
||||
0x62,
|
||||
0x6C,
|
||||
0x65,
|
||||
0x3D,
|
||||
0x22,
|
||||
0x79,
|
||||
0x65,
|
||||
0x73,
|
||||
0x22,
|
||||
0x3E,
|
||||
0x54,
|
||||
0x65,
|
||||
0x73,
|
||||
0x74,
|
||||
0x3C,
|
||||
0x2F,
|
||||
0x70,
|
||||
0x72,
|
||||
0x6F,
|
||||
0x70,
|
||||
0x65,
|
||||
0x72,
|
||||
0x74,
|
||||
0x79,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x3C,
|
||||
0x63,
|
||||
0x68,
|
||||
0x69,
|
||||
0x6C,
|
||||
0x64,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x3C,
|
||||
0x70,
|
||||
0x6C,
|
||||
0x61,
|
||||
0x63,
|
||||
0x65,
|
||||
0x68,
|
||||
0x6F,
|
||||
0x6C,
|
||||
0x64,
|
||||
0x65,
|
||||
0x72,
|
||||
0x2F,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x20,
|
||||
0x3C,
|
||||
0x2F,
|
||||
0x63,
|
||||
0x68,
|
||||
0x69,
|
||||
0x6C,
|
||||
0x64,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x20,
|
||||
0x20,
|
||||
0x3C,
|
||||
0x2F,
|
||||
0x6F,
|
||||
0x62,
|
||||
0x6A,
|
||||
0x65,
|
||||
0x63,
|
||||
0x74,
|
||||
0x3E,
|
||||
0xA,
|
||||
0x3C,
|
||||
0x2F,
|
||||
0x69,
|
||||
0x6E,
|
||||
0x74,
|
||||
0x65,
|
||||
0x72,
|
||||
0x66,
|
||||
0x61,
|
||||
0x63,
|
||||
0x65,
|
||||
0x3E,
|
||||
0xA,
|
||||
|
||||
0x0 };
|
||||
|
||||
extern const unsigned int app_ui_res_test_window_ui_size = 224;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||