~korth/gens-gs-ii.git
8 years ago[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): Display the correct... gens-qt4-GeneralConfigWindow-v4
David Korth [Fri, 4 Feb 2011 09:18:07 +0000 (04:18 -0500)] 
[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): Display the correct warning on Unix if version information isn't available.

8 years ago[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): Display the correct...
David Korth [Fri, 4 Feb 2011 09:17:21 +0000 (04:17 -0500)] 
[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): Display the correct warning on Unix if the selected program is neither RAR nor UnRAR.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: s/_WIN32/Q_OS_WIN32/g
David Korth [Fri, 4 Feb 2011 09:16:28 +0000 (04:16 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: s/_WIN32/Q_OS_WIN32/g

8 years ago[libgens] Decompressor/DcRar_Unix.cpp::CheckExtPrg(): Return errors if the program...
David Korth [Fri, 4 Feb 2011 09:15:19 +0000 (04:15 -0500)] 
[libgens] Decompressor/DcRar_Unix.cpp::CheckExtPrg(): Return errors if the program isn't RAR or UnRAR, or if the version information isn't available.

Updated documentation for error code -7 in DcRar.hpp,
DcRar_Unix.cpp, and DcRar_Win32.cpp.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Set focus to the textbox after selecting a file...
David Korth [Fri, 4 Feb 2011 09:10:46 +0000 (04:10 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Set focus to the textbox after selecting a file from the Open File Dialog.

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Place the Sega CD Boot ROM and UnRAR program...
David Korth [Fri, 4 Feb 2011 09:04:53 +0000 (04:04 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Place the Sega CD Boot ROM and UnRAR program textboxes using Qt Designer promotion.

The QLineEdits are promoted to GensLineEdit in Qt Designer, which eliminates
the need to manually create the GensLineEdit widgets manually. [1]

GeneralConfigWindow.cpp: Removed GensLineEdit creation code.

Placeholder text is still created manually, since the Boot ROM text
is templated and the UnRAR text is OS-specific.

The GensLineEdit icon is set manually because Qt Designer doesn't know
about the GensLineEdit-specific properties. In order to get Qt Designer
to know about these properties, I'd have to subclass QDesignerCustomWidgetInterface,
which isn't worth bothering with. [2]

[1] http://doc.qt.nokia.com/4.7/designer-using-custom-widgets.html

[2] http://doc.qt.nokia.com/4.7/designer-creating-custom-widgets.html

8 years ago[gens-qt4] widgets/GensLineEdit.cpp: Mark the GensLineEdit icon as a Q_PROPERTY().
David Korth [Fri, 4 Feb 2011 08:48:50 +0000 (03:48 -0500)] 
[gens-qt4] widgets/GensLineEdit.cpp: Mark the GensLineEdit icon as a Q_PROPERTY().

GensLineEdit now stores the icon internally, which allows the GensLineEdit
parent to retrieve the icon at any time.

Q_PROPERTY() is used to declare the icon as a property.

8 years ago[gens-qt4] GensWindow.hpp: Added "void" to the setGensTitle() declaration.
David Korth [Fri, 4 Feb 2011 08:37:06 +0000 (03:37 -0500)] 
[gens-qt4] GensWindow.hpp: Added "void" to the setGensTitle() declaration.

8 years ago[gens-qt4] GensMenuBar.cpp: Moved menu definitions to another file, GensMenuBar_menus...
David Korth [Fri, 4 Feb 2011 08:32:49 +0000 (03:32 -0500)] 
[gens-qt4] GensMenuBar.cpp: Moved menu definitions to another file, GensMenuBar_menus.cpp.

- Menu definition structs and enums are now protected instead of public.

- Menu definition data structs were moved out of GensMenuBar::GensMenuBar()
  and into GensMenuBar.cpp.

- Menu definition #defines were moved out of GensMenuBar.hpp
  and into GensMenuBar_menus.hpp.

GensWindow.cpp: #include "GensMenuBar_menus.hpp"

8 years ago[gens-qt4] AboutWindow::GetDebugInfo(): Slight reworking of the Qt version strings.
David Korth [Thu, 3 Feb 2011 22:12:29 +0000 (17:12 -0500)] 
[gens-qt4] AboutWindow::GetDebugInfo(): Slight reworking of the Qt version strings.

Use QString::arg() to append the version strings to the
"Compiled using Qt" and "Using Qt" strings.

8 years ago[gens-qt4] Use QObject::tr() instead of QCoreApplication::translate() when possible.
David Korth [Thu, 3 Feb 2011 22:08:59 +0000 (17:08 -0500)] 
[gens-qt4] Use QObject::tr() instead of QCoreApplication::translate() when possible.

QObject::tr() is easier to deal with than QCoreApplication::translate(),
and it's available within all classes that inherit from QObject.

gqt4_main.cpp still uses QCoreApplication::translate(), since it doesn't
inherit from QObject.

8 years ago[gens-qt4] GensZipDirModel::insertZEntry(): Use QList::at() instead of QList::operato...
David Korth [Thu, 3 Feb 2011 19:29:33 +0000 (14:29 -0500)] 
[gens-qt4] GensZipDirModel::insertZEntry(): Use QList::at() instead of QList::operator[]().

QList::at() never performs a deep copy, so it's more efficient
than QList::operator[]() for read-only access.

8 years ago[gens-qt4] Disable implicit QString ASCII casts.
David Korth [Thu, 3 Feb 2011 19:23:58 +0000 (14:23 -0500)] 
[gens-qt4] Disable implicit QString ASCII casts.

The preprocessor macros QT_NO_CAST_FROM_ASCII and QT_NO_CAST_TO_ASCII
are now defined in CMakeLists.txt.

This helps to find incorrect text encoding conversions, e.g. converting
from ASCII when we're supposed to be converting from UTF-8. The only
downside is it makes a lot of the code more verbose.

Updated all of gens-qt4 to compile with disabled implicit QString ASCII casts.

8 years ago[libgens] Timing::GetTimingMethodName(): Clarify that the returned string is ASCII.
David Korth [Thu, 3 Feb 2011 18:07:14 +0000 (13:07 -0500)] 
[libgens] Timing::GetTimingMethodName(): Clarify that the returned string is ASCII.

8 years ago[libgens] lg_main.cpp: Clarify that version strings are ASCII.
David Korth [Thu, 3 Feb 2011 18:06:54 +0000 (13:06 -0500)] 
[libgens] lg_main.cpp: Clarify that version strings are ASCII.

8 years ago[libgens] macros/log_msg.c: Clarify that debug channel names are ASCII and messages...
David Korth [Thu, 3 Feb 2011 17:50:35 +0000 (12:50 -0500)] 
[libgens] macros/log_msg.c: Clarify that debug channel names are ASCII and messages are UTF-8.

8 years ago[gens-qt4] CMakeLists.txt: GLEW_STATIC should be in COMPILE_DEFINITIONS, not COMPILE_...
David Korth [Thu, 3 Feb 2011 17:38:06 +0000 (12:38 -0500)] 
[gens-qt4] CMakeLists.txt: GLEW_STATIC should be in COMPILE_DEFINITIONS, not COMPILE_FLAGS.

GLEW_STATIC is a preprocessor macro, so it should be treated as such.

8 years ago[gens-qt4] CMakeLists.txt: Use fast QString concatenation.
David Korth [Thu, 3 Feb 2011 17:35:21 +0000 (12:35 -0500)] 
[gens-qt4] CMakeLists.txt: Use fast QString concatenation.

Moved the preprocessor definitions from individual source code files to
COMPILE_DEFINITIONS in CMakeLists.txt. These optimizations apply to all
source code files and don't affect the output in any way, other than
improving performance.

8 years agoRevert "[gens-qt4] Use fast QString concatenation."
David Korth [Thu, 3 Feb 2011 17:28:27 +0000 (12:28 -0500)] 
Revert "[gens-qt4] Use fast QString concatenation."

This reverts commit e81a162e8e240c541dd52cabcbfd2f518926fbd6.

The macros for fast QString concatenation should be added to the build system,
since they're used for everything and don't actually affect functionality of
the program in any way other than performance

8 years ago[gens-qt4] GensMenuBar.cpp: Use m_hashActions.value() instead of m_hashActions.find().
David Korth [Thu, 3 Feb 2011 11:21:10 +0000 (06:21 -0500)] 
[gens-qt4] GensMenuBar.cpp: Use m_hashActions.value() instead of m_hashActions.find().

QMap::value() returns the value associated with the given key without
going through an iterator, so it's more efficient.o

8 years ago[gens-qt4] GensMenuBar.cpp: Use QHash instead of QMap for the QAction* and QMenu...
David Korth [Thu, 3 Feb 2011 11:16:33 +0000 (06:16 -0500)] 
[gens-qt4] GensMenuBar.cpp: Use QHash instead of QMap for the QAction* and QMenu* containers.

QHash is more efficient than using QMap, and we don't need to
preserve the ordering of these containers.

8 years ago[gens-qt4] GensMenuBar::clearMaps(): Cleaned up this function.
David Korth [Thu, 3 Feb 2011 11:11:30 +0000 (06:11 -0500)] 
[gens-qt4] GensMenuBar::clearMaps(): Cleaned up this function.

Use foreach() for the QMaps and QList::takeFirst() for the QLists.

8 years ago[gens-qt4] FindCdromUnix.cpp, FindCdromWin32.cpp: Removed some unnecessary Qt includes.
David Korth [Thu, 3 Feb 2011 10:57:22 +0000 (05:57 -0500)] 
[gens-qt4] FindCdromUnix.cpp, FindCdromWin32.cpp: Removed some unnecessary Qt includes.

8 years ago[gens-qt4] Use fast QString concatenation.
David Korth [Thu, 3 Feb 2011 10:35:10 +0000 (05:35 -0500)] 
[gens-qt4] Use fast QString concatenation.

Qt 4.6 introduced fast QString concatenation. Three methods are
available for enabling fast QString concatenation:

1. #include <QStringBuilder>; use % instead of +.

2. #define QT_USE_FAST_CONCATENATION; use % instead of +.

3. #define QT_USE_FAST_CONCATENATION
   #define QT_USE_FAST_OPERATOR_PLUS

We're using option #3, since that results in code that also compiles
on older versions of Qt.

Reference:

http://doc.qt.nokia.com/4.7/qstring.html#more-efficient-string-construction

8 years ago[gens-qt4] CMakeLists.txt: Require Qt-4.2.0 on Win32.
David Korth [Thu, 3 Feb 2011 07:33:17 +0000 (02:33 -0500)] 
[gens-qt4] CMakeLists.txt: Require Qt-4.2.0 on Win32.

Qt-4.2 is required for QString::fromWCharArray().

Qt-4.6 is required for QPixmap::fromWinHICON(), but fallbacks
are in place to use QPixmap::fromWinHBITMAP() if an older Qt
is detected at compile time.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Save/load most of the general settings.
David Korth [Thu, 3 Feb 2011 07:27:42 +0000 (02:27 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Save/load most of the general settings.

8 years ago[gens-qt4] GensConfig::GensConfig(): Don't use the set*() functions to initialize...
David Korth [Thu, 3 Feb 2011 07:23:48 +0000 (02:23 -0500)] 
[gens-qt4] GensConfig::GensConfig(): Don't use the set*() functions to initialize defaults.

The internal variables aren't initialized yet, so the comparisons
that determine if a signal should be emitted won't be defined.

Also, signals can't be connected before the constructor is finished
anyway, so there's no point in emitting them.

TODO: Don't use setExtPrgUnRAR().

TODO: Add a function to emit signals for all the configuration options,
e.g. a refresh() function.

8 years ago[gens-qt4] GensConfig: Added most of the General Settings.
David Korth [Thu, 3 Feb 2011 07:20:52 +0000 (02:20 -0500)] 
[gens-qt4] GensConfig: Added most of the General Settings.

TODO: Add Intro Effect settings.

8 years ago[gens-qt4] GensConfig.hpp: Marked accessor functions as const.
David Korth [Thu, 3 Feb 2011 07:07:34 +0000 (02:07 -0500)] 
[gens-qt4] GensConfig.hpp: Marked accessor functions as const.

8 years ago[gens-qt4] GensConfig.hpp: Added Q_PROPERTY macros for GensConfig's properties.
David Korth [Thu, 3 Feb 2011 07:06:21 +0000 (02:06 -0500)] 
[gens-qt4] GensConfig.hpp: Added Q_PROPERTY macros for GensConfig's properties.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Save/load most of the graphics settings.
David Korth [Thu, 3 Feb 2011 06:53:49 +0000 (01:53 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Save/load most of the graphics settings.

8 years ago[gens-qt4] GensConfig.cpp: s/constrainAspectRatio/aspectRatioConstraint/gi
David Korth [Thu, 3 Feb 2011 06:52:53 +0000 (01:52 -0500)] 
[gens-qt4] GensConfig.cpp: s/constrainAspectRatio/aspectRatioConstraint/gi

8 years ago[gens-qt4] GensConfig.cpp: Added values for most graphics settings.
David Korth [Thu, 3 Feb 2011 06:49:08 +0000 (01:49 -0500)] 
[gens-qt4] GensConfig.cpp: Added values for most graphics settings.

TODO: Add Color Scale Method.

TODO: What about GL filtering?

8 years ago[gens-qt4] GensConfig.cpp: Moved to the GensQt4 namespace.
David Korth [Thu, 3 Feb 2011 06:44:43 +0000 (01:44 -0500)] 
[gens-qt4] GensConfig.cpp: Moved to the GensQt4 namespace.

gqt4_main.cpp: Updated to work with the GensQt4::GensConfig namespace move.

8 years ago[gens-qt4] CMakeLists.txt: Disable compression in the Qt resource file.
David Korth [Thu, 3 Feb 2011 01:13:05 +0000 (20:13 -0500)] 
[gens-qt4] CMakeLists.txt: Disable compression in the Qt resource file.

The Qt resource file contains only PNG images, which are already compressed.
Compressing the PNG images anyway saves around 32 bytes at the expense of
reducing performance, so we're better off not compressing them.

8 years ago[gens-qt4] GensQGLWidget::showOsdPreview(): Make sure m_preview_img isn't a null...
David Korth [Thu, 3 Feb 2011 01:10:38 +0000 (20:10 -0500)] 
[gens-qt4] GensQGLWidget::showOsdPreview(): Make sure m_preview_img isn't a null image.

8 years ago[gens-qt4] VBackend/VBackend.cpp: Implemented preview image duration.
David Korth [Wed, 2 Feb 2011 23:44:12 +0000 (18:44 -0500)] 
[gens-qt4] VBackend/VBackend.cpp: Implemented preview image duration.

The preview image will disappear after the duration elapses.

GensQGLWidget::showOsdPreview(): Delete the preview image if the duration elapsed.

8 years ago[gens-qt4] VBackend/GensQGLWidget.cpp: Minor cleanups.
David Korth [Wed, 2 Feb 2011 23:29:36 +0000 (18:29 -0500)] 
[gens-qt4] VBackend/GensQGLWidget.cpp: Minor cleanups.

VBackend/VBackend.hpp: Moved font width/height to static class variables.

8 years ago[gens-qt4] VBackend/VBackend.cpp: Initial OSD recording status indicator.
David Korth [Wed, 2 Feb 2011 23:10:41 +0000 (18:10 -0500)] 
[gens-qt4] VBackend/VBackend.cpp: Initial OSD recording status indicator.

The recording status indicator will indicate if e.g. WAV or VGM
is being recorded to a file.

TODO:

- Remove stopped recording indicators after a given duration.

- Implement some recording method and use the OSD recording status indicator.

8 years ago[gens-qt4] McdControlWindow.cpp: Handle the FindCdromBase::driveRemoved() signal.
David Korth [Wed, 2 Feb 2011 15:28:32 +0000 (10:28 -0500)] 
[gens-qt4] McdControlWindow.cpp: Handle the FindCdromBase::driveRemoved() signal.

Also, fixed receipt of driveUpdated() when not querying devices if
no drives are present in the dropdown. (This happens if a drive is
added after the initial querying is finished.)

8 years ago[gens-qt4] FindCdromUDisks::deviceRemoved(): Handle the DeviceRemoved() signal from...
David Korth [Wed, 2 Feb 2011 15:27:24 +0000 (10:27 -0500)] 
[gens-qt4] FindCdromUDisks::deviceRemoved(): Handle the DeviceRemoved() signal from UDisks.

NOTE: The device file cannot be retrieved, since the object is deleted.
Assume the device file is _PATH_DEV + the last component of objectPath.

TODO: Store the device filenames locally.

TODO: Use QDir::separator()?

8 years ago[gens-qt4] FindCdromBase::driveRemoved(): New signal to indicate a drive was removed.
David Korth [Wed, 2 Feb 2011 15:26:35 +0000 (10:26 -0500)] 
[gens-qt4] FindCdromBase::driveRemoved(): New signal to indicate a drive was removed.

UDisks supports reporting that a drive was removed, so we should
forward this signal to McdControlWindow to remove the drive from
the dropdown box if a drive is removed.

8 years ago[gens-qt4] ui/resources/gens/vga-charset.png: Added some VCR symbols.
David Korth [Wed, 2 Feb 2011 14:31:28 +0000 (09:31 -0500)] 
[gens-qt4] ui/resources/gens/vga-charset.png: Added some VCR symbols.

Three new symbols:
- 0x80: Record
- 0x81: Pause
- 0x82: Stop

VBackend/GensQGLWidget.cpp: Added Unicode mappings for the VCR symbols.

NOTE: Unicode doesn't have anything that matches the Pause symbol,
so I'm using a Private Use Area character for Pause. (U+F8FE)

8 years ago[gens-qt4] FindCdromUnix::query_int(): Use _PATH_DEV instead of hard-coding "/dev/".
David Korth [Wed, 2 Feb 2011 09:42:36 +0000 (04:42 -0500)] 
[gens-qt4] FindCdromUnix::query_int(): Use _PATH_DEV instead of hard-coding "/dev/".

Apple's CD-ROM IOKit sample [1] uses _PATH_DEV, so I suppose
we should use it too.

_PATH_DEV is defined in paths.h.

[1] http://developer.apple.com/library/mac/#samplecode/CDROMSample/Listings/
CDROMSample_c.html%23//apple_ref/doc/uid/DTS10000423-CDROMSample_c-DontLinkElementID_3

8 years agoTAGS.txt: New tag: gens-qt4-McdControlWindow-v2
David Korth [Wed, 2 Feb 2011 09:20:49 +0000 (04:20 -0500)] 
TAGS.txt: New tag: gens-qt4-McdControlWindow-v2

8 years ago[gens-qt4] McdControlWindow.cpp: Don't use FindCdromUnix on Mac OS X. gens-qt4-McdControlWindow-v2
David Korth [Wed, 2 Feb 2011 09:20:22 +0000 (04:20 -0500)] 
[gens-qt4] McdControlWindow.cpp: Don't use FindCdromUnix on Mac OS X.

FindCdromUnix won't work on Mac OS X, since the device names
are the same as for hard disks (/dev/disk*, /dev/rdisk*), and
device files aren't created unless a disc is present.

I'll write a Mac-specific backend using IOKit later.

8 years ago[gens-qt4] McdControlWindow::addDriveEntry(): Added an index parameter for updating...
David Korth [Wed, 2 Feb 2011 09:15:12 +0000 (04:15 -0500)] 
[gens-qt4] McdControlWindow::addDriveEntry(): Added an index parameter for updating existing items.

If index is >= 0, the item with the given index is updated.
Otherwise, a new item is added.

McdControlWindow::driveUpdated(): If we're not querying for drives,
search cboCdDrives for a matching path. If a matching path is found,
specify that index when calling addDriveEntry().

CD-ROM drives are now dynamically updated when using FindCdromUDisks.

8 years ago[gens-qt4] FindCdromUdisks::queryUDisksDevice(): TODO: Determine if UDisks is checkin...
David Korth [Wed, 2 Feb 2011 09:08:15 +0000 (04:08 -0500)] 
[gens-qt4] FindCdromUdisks::queryUDisksDevice(): TODO: Determine if UDisks is checking what type of disc is present.

UDisks sends a DeviceChanged() signal when the drive tray is closed,
and also when it has determined what type of disc is present.

Figure out how to determine which signal is which.

8 years ago[gens-qt4] cdrom/FindCdromUDisks.cpp: Added support for UDisks' DeviceChanged() signal.
David Korth [Wed, 2 Feb 2011 09:02:29 +0000 (04:02 -0500)] 
[gens-qt4] cdrom/FindCdromUDisks.cpp: Added support for UDisks' DeviceChanged() signal.

This allows us to dynamically update the CD-ROM drive dropdown box
in McdControlWindow as drive status changes.

TODO:

- Fix McdControlWindow such that it updates existing entries instead
  of adding new entries every time DeviceChanged() is triggered.

- Add a status entry for when UDisks is checking what type of disc
  is present.

8 years ago[gens-qt4] FindCdromWin32::query_int(), FindCdromUnix::query_int(): Removed the TODOs...
David Korth [Wed, 2 Feb 2011 09:00:03 +0000 (04:00 -0500)] 
[gens-qt4] FindCdromWin32::query_int(), FindCdromUnix::query_int(): Removed the TODOs about implementing the driveQueryFinished() signal.

8 years ago[gens-qt4] McdControlWindow.cpp: Display status messages in cboCdDrives.
David Korth [Wed, 2 Feb 2011 08:36:06 +0000 (03:36 -0500)] 
[gens-qt4] McdControlWindow.cpp: Display status messages in cboCdDrives.

Status messages will indicate if:

- No CD-ROM drive handler is available.

- No CD-ROM drives are found.

- The FindCdromBase subclass is currently searching for CD-ROM drives.

Additionally, the mouse cursor is set to Qt::WaitCursor while
the FindCdromBase subclass is searching for CD-ROM drives.

8 years ago[gens-qt4] FindCdromBase::driveQueryFinished(): New signal that's emitted when drive...
David Korth [Wed, 2 Feb 2011 08:18:16 +0000 (03:18 -0500)] 
[gens-qt4] FindCdromBase::driveQueryFinished(): New signal that's emitted when drive scanning is finished.

Updated FindCdromUDisks, FindCdromWin32, and FindCdromUnix to emit
driveQueryFinished() when they're finished querying drives.

8 years ago[gens-qt4] FindCdromUnix::os_GetDiscLabel(): Get disc label.
David Korth [Wed, 2 Feb 2011 07:53:26 +0000 (02:53 -0500)] 
[gens-qt4] FindCdromUnix::os_GetDiscLabel(): Get disc label.

This function uses lseek() and read(), so it should work on
all Unix platforms.

TODO: Add support for Joliet, Rock Ridge, UDF, and HFS.

FindCdromUnix:query_int(): Call os_GetDiscLabel() to get the disc label.

8 years ago[gens-qt4] FindCdromUnix::os_GetDiscType(): Get disc type. (Linux version)
David Korth [Wed, 2 Feb 2011 07:36:06 +0000 (02:36 -0500)] 
[gens-qt4] FindCdromUnix::os_GetDiscType(): Get disc type. (Linux version)

TODO: This currently only determines if a disc is present.
Figure out some way to determine the type of disc later.

FindCdromUnix:query_int(): Call os_getDiscType() to get the disc type.

8 years ago[gens-qt4] cdrom/FindCdromUnix.cpp: Renamed OS-specific functions to have os_* prefixes.
David Korth [Wed, 2 Feb 2011 07:31:36 +0000 (02:31 -0500)] 
[gens-qt4] cdrom/FindCdromUnix.cpp: Renamed OS-specific functions to have os_* prefixes.

GetDriveType() exists in FindCdromBase, and is used to determine
the drive type from a set of supported media.

Rename all internal OS-specific functions to have an os_* prefix
for consistency.

8 years ago[cdrom] FindCdromUnix::GetDriveType(): Get drive type. (Linux version)
David Korth [Wed, 2 Feb 2011 07:25:39 +0000 (02:25 -0500)] 
[cdrom] FindCdromUnix::GetDriveType(): Get drive type. (Linux version)

Get the drive type using the CDROM_GET_CAPABILITY IOCTL.

FindCdromUnix::getDevIdentity(): Converted to a static function.

8 years ago[cdrom] FindCdromBase.cpp: Added MO drive type information.
David Korth [Wed, 2 Feb 2011 07:15:16 +0000 (02:15 -0500)] 
[cdrom] FindCdromBase.cpp: Added MO drive type information.

I don't think it's really needed, but whatever.

8 years ago[gens-qt4] FindCdromUnix::getDevIdentity(): Get device identity. (Linux version)
David Korth [Wed, 2 Feb 2011 07:05:51 +0000 (02:05 -0500)] 
[gens-qt4] FindCdromUnix::getDevIdentity(): Get device identity. (Linux version)

This function gets the device vendor, model, and firmware.
It's currently only implemented for Linux.

FindCdromUnix::query_int(): Open the device file.
If the open() is successful, call getDevIdentity() to get the
device identity information.

8 years ago[gens-qt4] McdControlWindow::McdControlWindow(): If FindCdromUDisks isn't usable...
David Korth [Wed, 2 Feb 2011 06:39:03 +0000 (01:39 -0500)] 
[gens-qt4] McdControlWindow::McdControlWindow(): If FindCdromUDisks isn't usable, fall back to FindCdromUnix.

8 years ago[gens-qt4] FindCdromBase::isUsable(): Added a function to determine if a CD-ROM detec...
David Korth [Wed, 2 Feb 2011 06:38:50 +0000 (01:38 -0500)] 
[gens-qt4] FindCdromBase::isUsable(): Added a function to determine if a CD-ROM detection class is usable.

This function returns true by default.

FindCdromUDisks::isUsable(): Check if D-BUS is usable and if
UDisks is running. If both conditions are met, return true.

8 years ago[gens-qt4] cdrom/FindCdromUnix.cpp: Initial Unix CD-ROM detection class.
David Korth [Wed, 2 Feb 2011 06:26:31 +0000 (01:26 -0500)] 
[gens-qt4] cdrom/FindCdromUnix.cpp: Initial Unix CD-ROM detection class.

This class will be used on Unix and Linux systems where UDisks
isn't available. It probably won't be used on Mac OS X, since
the device structure is completely different there.

TODO:

- Proper support for non-Linux systems (e.g. BSD).

- Get device information other than the pathname.

8 years ago[gens-gs-ii] TAGS.txt: New tags: gens-qt4-ZipSelectDialog-v1 and gens-qt4-ZipSelectDi...
David Korth [Wed, 2 Feb 2011 04:49:27 +0000 (23:49 -0500)] 
[gens-gs-ii] TAGS.txt: New tags: gens-qt4-ZipSelectDialog-v1 and gens-qt4-ZipSelectDialog-v0

The gens-qt4-ZipSelectDialog-v0 tag points to the initial commit of
ZipSelectDialog, which apparently hasn't been touched since it was
originally ported from Gens/GS.

8 years ago[gens-qt4] GensZipDirModel::setDirIconState(): Fixed a stupid compile error. gens-qt4-ZipSelectDialog-v1
David Korth [Wed, 2 Feb 2011 04:40:40 +0000 (23:40 -0500)] 
[gens-qt4] GensZipDirModel::setDirIconState(): Fixed a stupid compile error.

8 years ago[gens-qt4] ZipSelectDialog.cpp: Set the directory icon state whenever a directory...
David Korth [Wed, 2 Feb 2011 04:39:53 +0000 (23:39 -0500)] 
[gens-qt4] ZipSelectDialog.cpp: Set the directory icon state whenever a directory is expanded or collapsed.

8 years ago[gens-qt4] GensZipDirModel::setDirIconState(): Added a function to set the icon state...
David Korth [Wed, 2 Feb 2011 04:39:02 +0000 (23:39 -0500)] 
[gens-qt4] GensZipDirModel::setDirIconState(): Added a function to set the icon state for directory items.

The icon state can be closed (false) or open (true).

8 years ago[gens-qt4] ZipSelectDialog.cpp: Handle directories differently from files.
David Korth [Wed, 2 Feb 2011 04:28:35 +0000 (23:28 -0500)] 
[gens-qt4] ZipSelectDialog.cpp: Handle directories differently from files.

- accept(): Don't call QDialog::accept() if the item is a directory.

- on_treeView_clicked(): If the selected item is a directory, disable
  the "OK" button. Otherwise, if it's a file, enable the "OK" button.

8 years ago[gens-qt4] GensZipDirModel::hasChildren(): Added a function to determine if a given...
David Korth [Wed, 2 Feb 2011 04:28:08 +0000 (23:28 -0500)] 
[gens-qt4] GensZipDirModel::hasChildren(): Added a function to determine if a given item has children.

This will be used to determine if the selected item is
a directory or a file.

8 years ago[gens-qt4] GensZipDirModel::insertZEntry(): Set the icon for directories.
David Korth [Wed, 2 Feb 2011 04:21:58 +0000 (23:21 -0500)] 
[gens-qt4] GensZipDirModel::insertZEntry(): Set the icon for directories.

TODO: Set to QStyle::SP_DirOpenIcon when the directory is expanded.

8 years ago[gens-qt4] widgets/GensZipDirModel.cpp: Suppress "unused parameter" warnings for...
David Korth [Wed, 2 Feb 2011 04:18:05 +0000 (23:18 -0500)] 
[gens-qt4] widgets/GensZipDirModel.cpp: Suppress "unused parameter" warnings for various functions.

8 years ago[gens-qt4] ZipSelectDialog::setFileList(): Removed old TODOs.
David Korth [Wed, 2 Feb 2011 04:16:51 +0000 (23:16 -0500)] 
[gens-qt4] ZipSelectDialog::setFileList(): Removed old TODOs.

Both Model/View and hierarchical view are now implemented.

8 years ago[gens-qt4] ZipSelectDialog::setFileList(): Sort the tree model after adding all the...
David Korth [Wed, 2 Feb 2011 04:16:11 +0000 (23:16 -0500)] 
[gens-qt4] ZipSelectDialog::setFileList(): Sort the tree model after adding all the items.

8 years ago[gens-qt4] widgets/GensZipDirModel.cpp: Implemented QAbstractItemModel::sort().
David Korth [Wed, 2 Feb 2011 04:15:14 +0000 (23:15 -0500)] 
[gens-qt4] widgets/GensZipDirModel.cpp: Implemented QAbstractItemModel::sort().

GensZipDirItem::sort(): Internal sorting function.

The sort method sorts directories first, then files.

NOTE: The `column` parameter is currently ignored.
Column 0 (display filename) is always used.

8 years ago[gens-qt4] GensZipDirModel::insertZEntry(): Parse filenames and create a tree structure.
David Korth [Wed, 2 Feb 2011 03:37:29 +0000 (22:37 -0500)] 
[gens-qt4] GensZipDirModel::insertZEntry(): Parse filenames and create a tree structure.

ZipSelectDialog finally shows a tree structure instead of
a simple list of filenames. :)

TODO:

- Use '\\' on Win32?

- Get the directory icon from somewhere.

8 years ago[gens-qt4] ZipSelectDialog.cpp: Disable the "OK" button initially.
David Korth [Wed, 2 Feb 2011 02:24:32 +0000 (21:24 -0500)] 
[gens-qt4] ZipSelectDialog.cpp: Disable the "OK" button initially.

Re-enable the "OK" button when a filename is clicked.

TODO: Disable the "OK" button if a directory is clicked.

8 years ago[gens-qt4] Initial GensZipDirModel and GensZipDirItem.
David Korth [Wed, 2 Feb 2011 02:04:21 +0000 (21:04 -0500)] 
[gens-qt4] Initial GensZipDirModel and GensZipDirItem.

GensZipDirModel will be used to generate the TreeView for the
ZipSelectDialog.

ui/ZipSelectDialog.ui: Replaced the QTreeWidget with a QTreeView.

8 years ago[gens-qt4] cdrom/FindCdromBase.cpp: Added fallback icons for drives and discs.
David Korth [Mon, 31 Jan 2011 16:10:03 +0000 (11:10 -0500)] 
[gens-qt4] cdrom/FindCdromBase.cpp: Added fallback icons for drives and discs.

8 years ago[gens-qt4] ui/resources/: Added Oxygen 64x64 CD-ROM drive and media icons.
David Korth [Mon, 31 Jan 2011 16:06:02 +0000 (11:06 -0500)] 
[gens-qt4] ui/resources/: Added Oxygen 64x64 CD-ROM drive and media icons.

8 years agoTAGS.txt: New tag: gens-qt4-McdControlWindow-v1
David Korth [Mon, 31 Jan 2011 08:33:48 +0000 (03:33 -0500)] 
TAGS.txt: New tag: gens-qt4-McdControlWindow-v1

8 years ago[gens-qt4] FindCdromWin32::getDriveIcon(): Fixed the 64x64 icon size check. gens-qt4-McdControlWindow-v1
David Korth [Mon, 31 Jan 2011 08:30:28 +0000 (03:30 -0500)] 
[gens-qt4] FindCdromWin32::getDriveIcon(): Fixed the 64x64 icon size check.

The icon was only being resized if both dimensions were not 64,
so a 64x32 icon (if one existed) would not be resized.

8 years ago[gens-qt4] FindCdromWin32::getDriveIcon(): Use QPixmap::fromWinHICON() if it's available.
David Korth [Mon, 31 Jan 2011 08:29:19 +0000 (03:29 -0500)] 
[gens-qt4] FindCdromWin32::getDriveIcon(): Use QPixmap::fromWinHICON() if it's available.

Scaling the pixmap from QPixmap::fromWinHBITMAP() results in horrible
transparency artifacts. QPixmap::fromWinHICON()'s output is much better.

TODO: QPixmap::fromWinHICON() was added in Qt 4.6.
Perhaps I should copy the implementation from Qt's source code?

8 years ago[gens-qt4] FindCdromWin32::getShilIcon(): Removed some debugging code.
David Korth [Mon, 31 Jan 2011 08:28:32 +0000 (03:28 -0500)] 
[gens-qt4] FindCdromWin32::getShilIcon(): Removed some debugging code.

8 years ago[gens-qt4] FindCdromWin32::getDriveIcon(): Get the 48x48 icon from the shell, if...
David Korth [Mon, 31 Jan 2011 08:25:35 +0000 (03:25 -0500)] 
[gens-qt4] FindCdromWin32::getDriveIcon(): Get the 48x48 icon from the shell, if possible.

Larger icons are always better, especially since the dropdown box
in McdControlWindow expects 64x64.

8 years ago[gens-qt4] cdrom/FindCdromWin32.cpp: Initial getDriveIcon() implementation.
David Korth [Mon, 31 Jan 2011 05:38:05 +0000 (00:38 -0500)] 
[gens-qt4] cdrom/FindCdromWin32.cpp: Initial getDriveIcon() implementation.

TODO: Get large icons on XP and later.

TODO: Figure out why scaling the icon results in horrible transparency artifacts.

FindCdromBase::getDriveIcon(): Removed the Win32 comment, since this
commit implements a Win32-specific version of the function.

8 years ago[gens-qt4] cdrom/Spti.cpp: More reliable isMediumPresent() function.
David Korth [Mon, 31 Jan 2011 05:29:40 +0000 (00:29 -0500)] 
[gens-qt4] cdrom/Spti.cpp: More reliable isMediumPresent() function.

Use SCSI_RD_CAPAC to read the capacity of the disc.
If the block length is 0, assume no disc is present.

TODO: Verify that this works for CD-Rs and Audio CDs.

Also, reworked the return code system for scsiSendCdb().
It now returns the Win32 error code from GetLastError()
instead of the return value from DeviceIoControl().

TODO: Should we get the SCSI status code, e.g. SS_PENDING and SS_COMP?

8 years ago[gens-qt4] cdrom/FindCdromWin32::query_int(): Fixed inverted empty-label logic.
David Korth [Mon, 31 Jan 2011 04:31:37 +0000 (23:31 -0500)] 
[gens-qt4] cdrom/FindCdromWin32::query_int(): Fixed inverted empty-label logic.

8 years ago[gens-qt4] cdrom/FindCdromBase.hpp: Minor fix for the getDriveIcon() function comment.
David Korth [Mon, 31 Jan 2011 04:09:47 +0000 (23:09 -0500)] 
[gens-qt4] cdrom/FindCdromBase.hpp: Minor fix for the getDriveIcon() function comment.

s/GetDriveIcon()/getDriveIcon()/g

8 years ago[gens-qt4] cdrom/Spti.cpp: Moved the SPTI code from FindCdromWin32.cpp into a separat...
David Korth [Mon, 31 Jan 2011 04:05:06 +0000 (23:05 -0500)] 
[gens-qt4] cdrom/Spti.cpp: Moved the SPTI code from FindCdromWin32.cpp into a separate class.

Spti.cpp will be used by the Win32 McdReader class later on.

TODO: Fix Spti::isMediumPresent() so it works even if no other
SCSI requests were made previously.

8 years ago[gens-qt4] cdrom/FindCdromWin32.cpp: Initial disc presence detection.
David Korth [Mon, 31 Jan 2011 03:31:06 +0000 (22:31 -0500)] 
[gens-qt4] cdrom/FindCdromWin32.cpp: Initial disc presence detection.

TODO: SCSI_TST_U_RDY doesn't seem to work if e.g. START/STOP wasn't requested first.

8 years ago[gens-qt4] FindCdromUDisks::query_int(): Removed some debugging code.
David Korth [Mon, 31 Jan 2011 02:56:09 +0000 (21:56 -0500)] 
[gens-qt4] FindCdromUDisks::query_int(): Removed some debugging code.

8 years ago[gens-qt4] McdControlWindow.cpp: Use FindCdromWin32 on Win32.
David Korth [Mon, 31 Jan 2011 02:55:23 +0000 (21:55 -0500)] 
[gens-qt4] McdControlWindow.cpp: Use FindCdromWin32 on Win32.

8 years ago[gens-qt4] cdrom/FindCdromWin32.cpp: Initial FindCdromWin32 class.
David Korth [Mon, 31 Jan 2011 02:53:13 +0000 (21:53 -0500)] 
[gens-qt4] cdrom/FindCdromWin32.cpp: Initial FindCdromWin32 class.

FindCdromWin32 uses a combination of Win32 API and SPTI in order
to find and identify disc drives. Hence, it probably won't work
on Win9x right now. (Not that Qt will work on 9x, either; support
was dropped in Qt-4.6.)

TODO:

- Determine if a disc is inserted or not.

- Determine the types of media supported by the drive.

- Determine the media type of the disc and if it's blank or not.

- Get the drive icon from Win32 API.

8 years ago[gens-qt4] cdrom/FindCdromBase.cpp: Initial attempt at making CD-ROM scanning asynchr...
David Korth [Mon, 31 Jan 2011 00:47:51 +0000 (19:47 -0500)] 
[gens-qt4] cdrom/FindCdromBase.cpp: Initial attempt at making CD-ROM scanning asynchronous.

The CD-ROM scanning will be done in a background thread, and the main thread
will be notified of drive updates using the driveUpdated() signal.

FindCdromBase::drive_entry_t has been moved to CdromDriveEntry in order
to be registered as a Qt meta-type. The DriveType and DiscType enums
have also been moved out of the FindCdromBase class.

CdromDriveEntry no longer has a QIcon. Instead, the virtual function
FindCdromBase::getDriveIcon(const CdromDriveEntry& drive) should be called
to get the drive/disc icon.

NOTE: QDBusConnection is not thread-safe.
See http://bugreports.qt.nokia.com/browse/QTBUG-11413

Threading is disabled in FindCdromUDisks for now.

TODO:

- Show a message indicating "Scanning for drives..." when scanning.

- If no drives are found, show a message saying "No drives found."

8 years ago[gens-qt4] Call QCoreApplication::translate() instead of QApplication::translate().
David Korth [Mon, 31 Jan 2011 00:00:04 +0000 (19:00 -0500)] 
[gens-qt4] Call QCoreApplication::translate() instead of QApplication::translate().

They're effectively the same, but QCoreApplication::translate() doesn't require
the QtGui includes.

8 years ago[gens-qt4] cdrom/FindCdromUDisks.cpp: If the disc is blank, set the label to "Blank...
David Korth [Sun, 30 Jan 2011 23:56:45 +0000 (18:56 -0500)] 
[gens-qt4] cdrom/FindCdromUDisks.cpp: If the disc is blank, set the label to "Blank [disc_type]".

cdrom/FindCdromBase.hpp: Added a field disc_blank to drive_entry_t.

8 years ago[gens-qt4] FindCdromBase::query(): Return an error code if the query failed.
David Korth [Sun, 30 Jan 2011 23:49:54 +0000 (18:49 -0500)] 
[gens-qt4] FindCdromBase::query(): Return an error code if the query failed.

FindCdromUDisks::query(): Return an error code if the query failed.

If the system doesn't have UDisks, the query will fail, so we should
fall back to standard device name lookup.

8 years ago[gens-qt4] FindCdromBase.hpp: Moved icon generation from McdControlWindow to the...
David Korth [Sun, 30 Jan 2011 23:45:14 +0000 (18:45 -0500)] 
[gens-qt4] FindCdromBase.hpp: Moved icon generation from McdControlWindow to the FindCdromBase subclasses.

This will make it easier to handle icon generation on Win32, which retrieves
the icon from the operating system instead of using the medium type as a
reference to a system icon.

8 years ago[gens-qt4] CMakeLists.txt: Don't search for QtDBus on Mac OS X or non-Unix systems.
David Korth [Sat, 29 Jan 2011 20:44:44 +0000 (15:44 -0500)] 
[gens-qt4] CMakeLists.txt: Don't search for QtDBus on Mac OS X or non-Unix systems.

QtDBus is only available for Unix platforms, so we probably don't need to
bother with the Unix check, but I'm checking for it anyway.

QtDBus isn't available on Mac OS X in most cases, but it's possible to get
D-BUS compiled using MacPorts. We don't want to use D-BUS on Mac OS X anyway.
(UDisks isn't available for Mac OS X, and the IRC Reporter plugin will use
native IPC on Mac OS X and Win32.)

8 years ago[gens-qt4] CMakeLists.txt: s/gens-qt4_MOD_HEADERS/gens-qt4_MOC_HEADERS/
David Korth [Sat, 29 Jan 2011 20:41:31 +0000 (15:41 -0500)] 
[gens-qt4] CMakeLists.txt: s/gens-qt4_MOD_HEADERS/gens-qt4_MOC_HEADERS/

I think it worked with the typo before because I had FindCdromUdisks.cpp
in the main source code area, so the MOC file was generated previously
and didn't need to be updated. Running `make clean` deleted the generated
file, so I hit a compile failure.

8 years agoTAGS.txt: New tag: gens-qt4-McdControlWindow-v0
David Korth [Sat, 29 Jan 2011 11:14:59 +0000 (06:14 -0500)] 
TAGS.txt: New tag: gens-qt4-McdControlWindow-v0

8 years ago[gens-qt4] ui/McdControlWindow.ui: Forgot to add this in commit ad0094f9a7197c032bb83... gens-qt4-McdControlWindow-v0
David Korth [Sat, 29 Jan 2011 11:11:55 +0000 (06:11 -0500)] 
[gens-qt4] ui/McdControlWindow.ui: Forgot to add this in commit ad0094f9a7197c032bb834a1598a6309934f449b.

It's kind of important to have the UI file for a new window. =P