~korth/gens-gs-ii.git
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

8 years ago[gens-qt4] McdControlWindow.cpp: Initial Sega CD Control Panel.
David Korth [Sat, 29 Jan 2011 11:06:03 +0000 (06:06 -0500)] 
[gens-qt4] McdControlWindow.cpp: Initial Sega CD Control Panel.

The Sega CD Control Panel will be used to control what medium
is present in the virtual CD-ROM drive. It will eventually allow
the user to select between physical CD-ROM drives and disc images.

Currently, the Sega CD Control Panel displays a list of all CD-ROM
drives as detected by a FindCdromBase-derived class. The UDisks-based
detection class is the only one supported at the moment.

I spent 3-4 hours coding this and the FindCdromBase/FindCdromUDisks
classes, and I think it was well worth it. :) (Yeah, I know Sega CD
won't be reimplemented until 1.0_pre2, but meh, I was bored.)

8 years ago[gens-qt4] cdrom/: Initial CD-ROM drive detection classes.
David Korth [Sat, 29 Jan 2011 11:04:20 +0000 (06:04 -0500)] 
[gens-qt4] cdrom/: Initial CD-ROM drive detection classes.

FindCdromBase.cpp: CD-ROM drive detection base class.

FindCdromUDisks.cpp: UDisks-based CD-ROM drive detection class.

The UDisks-based CD-ROM drive detection class uses QtDBus for communication
with the UDisks daemon.

These classes detect things like supported media, drive model,
and disc type and label if a disc is inserted.

TODO:

- Add non-UDisks-based CD-ROM drive detection, similar to what's used
  in Gens/GS on Linux.

- Add CD-ROM drive detection for Windows and Mac OS X.

8 years ago[gens-qt4] GeneralConfigWindow.hpp: Removed #include <QtCore/QSignalMapper>.
David Korth [Sat, 29 Jan 2011 10:23:04 +0000 (05:23 -0500)] 
[gens-qt4] GeneralConfigWindow.hpp: Removed #include <QtCore/QSignalMapper>.

QSignalMapper is no longer used since commit df86ceb0eb9e03bde26de30c51e77904b926b4eb
replaced the Intro Effect Color buttons with a QComboBox.

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Added a new slot settingChanged().
David Korth [Sat, 29 Jan 2011 06:49:45 +0000 (01:49 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Added a new slot settingChanged().

This slot is linked to the toggled(), valueChanged(int), and
currentIndexChanged(int) signals of all the widgets in the window.

This allows us to remove simple one-line slots that were simply used for
enabling the "Apply" button when a setting was changed, since the
settingChanged() slot will enable the "Apply" button.

GeneralConfigWindow.cpp: Added the settingChanged() slot and removed
slots that did nothing but enable the "Apply" button.

The OSD text color buttons and GensLineEdit widgets still use the old
method, since the color buttons don't always enable the "Apply" button,
and the GensLineEdit widgets aren't shown in Qt Designer.

TODO: I disabled the tracking property on the horizontal sliders in
the Graphics tab. This prevents the valueChanged(int) signal from
being emitted while the slider is being dragged. (They will still
emit the sliderMoved(int) signal. Both signals are linked to the
buddy labels in order to make sure they're automatically updated.)

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Added a Graphics tab.
David Korth [Sat, 29 Jan 2011 06:27:56 +0000 (01:27 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Added a Graphics tab.

The Graphics tab contains settings for aspect ratio constraints,
Fast Blur, and the Color Adjustment settings.

None of these settings are functional yet.

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Updated tab ordering for the Intro Effect Color...
David Korth [Sat, 29 Jan 2011 04:28:48 +0000 (23:28 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Updated tab ordering for the Intro Effect Color dropdown box.

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Use a dropdown for the intro effect color inste...
David Korth [Sat, 29 Jan 2011 04:22:37 +0000 (23:22 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Use a dropdown for the intro effect color instead of color buttons.

The color buttons were overlapping on Mac OS X, and they looked out of place,
since Qt draws buttons with custom colors using its own Win9x-style theme
instead of the native styling.

TODO: Convert the OSD font color buttons to a dropdown, but with more colors
and a "Custom" item?

8 years ago[gens-qt4] Moved GensLineEdit.cpp to widgets/.
David Korth [Sat, 29 Jan 2011 03:19:14 +0000 (22:19 -0500)] 
[gens-qt4] Moved GensLineEdit.cpp to widgets/.

I may add some more custom widgets later, e.g. a color picker dropdown
similar to NSColorWell on Mac OS X, so we should separate all the widgets
from the rest of the code.

GensMenuBar is not going to be moved to widgets/, since it's only used
in one place (GensWindow), and it isn't exactly a reusable widget.

8 years ago[gens-qt4] GeneralConfigWindow::introEffectColor_selected(): Don't do anything if...
David Korth [Sat, 29 Jan 2011 02:21:43 +0000 (21:21 -0500)] 
[gens-qt4] GeneralConfigWindow::introEffectColor_selected(): Don't do anything if the color index is already selected.

GeneralConfigWindow::reload(): Set m_introEffectColor to the default value.
Calling optIntroColorW->setChecked(true) doesn't trigger the clicked() signal,
so we have to initialize m_introEffectColor manually.

8 years agoTAGS.txt: New tag: gens-qt4-GeneralConfigWindow-v3
David Korth [Sat, 29 Jan 2011 02:12:30 +0000 (21:12 -0500)] 
TAGS.txt: New tag: gens-qt4-GeneralConfigWindow-v3

8 years ago[gens-qt4] GensQApplication.cpp: Split some larger functions from GensQApplication... gens-qt4-GeneralConfigWindow-v3
David Korth [Sat, 29 Jan 2011 01:16:26 +0000 (20:16 -0500)] 
[gens-qt4] GensQApplication.cpp: Split some larger functions from GensQApplication.hpp into a cpp file.

GensQApplication.hpp was getting unwieldy, so splitting it into
two files makes sense. (I should have done this before.)

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Right-align labels for filename textboxes.
David Korth [Sat, 29 Jan 2011 01:02:57 +0000 (20:02 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Right-align labels for filename textboxes.

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Removed an incorrect tooltip on GeneralConfigWi...
David Korth [Sat, 29 Jan 2011 00:58:08 +0000 (19:58 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Removed an incorrect tooltip on GeneralConfigWindow.

The tooltip was a variant of the tooltip used for the
"Border Color Emulation" checkbox. For some reason, I
accidentally applied it to the whole window. Oops.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Added a QSignalMapper for the intro effect colors.
David Korth [Sat, 29 Jan 2011 00:55:37 +0000 (19:55 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Added a QSignalMapper for the intro effect colors.

This maps the 8 buttons to a single slot, which will make it
easier to handle changes.

introEffectColor_selected() currently prints the received color_index
from the QSignalMapper, and saves the index as m_introEffectColor.

TODO: Add an Intro Effect Color entry to GensConfig.

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Renamed the Intro Effect color buttons to opt*.
David Korth [Sat, 29 Jan 2011 00:51:50 +0000 (19:51 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Renamed the Intro Effect color buttons to opt*.

They're technically QPushButtons, but they're used as radio buttons,
so they should use the prefix opt instead of btn.

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Make sure the OSD frame stays at the top of...
David Korth [Sat, 29 Jan 2011 00:39:37 +0000 (19:39 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Make sure the OSD frame stays at the top of the dialog.

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Use the default layout spacing.
David Korth [Sat, 29 Jan 2011 00:32:22 +0000 (19:32 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Use the default layout spacing.

Doubling the layout spacing made things a bit too spaced out.

On WinXP, it's still a bit spaced out, but it seems that it's because
I'm using a larger font. (10pt instead of the default 8pt)

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Added "Emulation Options" and "Intro Effect...
David Korth [Sat, 29 Jan 2011 00:27:52 +0000 (19:27 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Added "Emulation Options" and "Intro Effect" configuration.

These aren't wired up to anything yet, so they don't do anything.

8 years ago[gens-qt4] GensQGLWidget::printOsdText(): Use the specified colors for the FPS counte...
David Korth [Fri, 28 Jan 2011 23:39:48 +0000 (18:39 -0500)] 
[gens-qt4] GensQGLWidget::printOsdText(): Use the specified colors for the FPS counter and messages.

TODO: Allow messages to have per-message colors?
(If not specified, it would fall back to the user-specified color.)

8 years ago[gens-qt4] Added OSD color configuration and notification support to VBackend and...
David Korth [Fri, 28 Jan 2011 23:36:10 +0000 (18:36 -0500)] 
[gens-qt4] Added OSD color configuration and notification support to VBackend and GensQGLWidget.

GensQGLWidget doesn't currently use the OSD colors, so the text
will always be drawn in white.

8 years ago[gens-qt4] VBackend/GensQGLWidget.cpp: Connect the OSD enabled signals from GensConfig.
David Korth [Fri, 28 Jan 2011 23:28:26 +0000 (18:28 -0500)] 
[gens-qt4] VBackend/GensQGLWidget.cpp: Connect the OSD enabled signals from GensConfig.

Enabling and disabling the OSD FPS counter and Message display works now.

8 years ago[gens-qt4] GensConfig.cpp: s/osd(Fps|Msg)Enable/osd(Fps|Msg)Enabled/g
David Korth [Fri, 28 Jan 2011 23:21:43 +0000 (18:21 -0500)] 
[gens-qt4] GensConfig.cpp: s/osd(Fps|Msg)Enable/osd(Fps|Msg)Enabled/g

8 years ago[gens-qt4] VBackend/VBackend.cpp: Fixed two signed/unsigned comparison errors.
David Korth [Fri, 28 Jan 2011 23:16:46 +0000 (18:16 -0500)] 
[gens-qt4] VBackend/VBackend.cpp: Fixed two signed/unsigned comparison errors.

resetFps(), pushFps(): Use size_t for the `for` loop counter variable
instead of int, since the comparison is of type size_t.

8 years ago[gens-qt4] VBackend/VBackend.cpp: Load the OSD enabled settings from GensConfig.
David Korth [Fri, 28 Jan 2011 23:14:01 +0000 (18:14 -0500)] 
[gens-qt4] VBackend/VBackend.cpp: Load the OSD enabled settings from GensConfig.

Renamed "showFps" to "osdFpsEnabled", and added "osdMsgEnabled".

Use osdFpsEnabled() instead of m_osdFpsEnabled directly except
in the osdFpsEnabled property setter function.

VBackend::osd_process(): Clear the message list if OSD messages are disabled.

VBackend.hpp: Mark property getters as inline.

GensQGLWidget.cpp: s/showFps/osdFpsEnabled/g; don't print messages
if osdMsgEnabled() == false.

8 years ago[gens-qt4] GensConfig.cpp: Set the OSD enable states to the specified value, not...
David Korth [Fri, 28 Jan 2011 19:46:29 +0000 (14:46 -0500)] 
[gens-qt4] GensConfig.cpp: Set the OSD enable states to the specified value, not just "true".

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Enable the "Apply" button if an OSD checkbox...
David Korth [Fri, 28 Jan 2011 19:46:02 +0000 (14:46 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Enable the "Apply" button if an OSD checkbox is changed.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Enable the "Apply" button if an OSD color is...
David Korth [Fri, 28 Jan 2011 19:39:05 +0000 (14:39 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Enable the "Apply" button if an OSD color is changed.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Added configuration for Onscreen Display settings.
David Korth [Fri, 28 Jan 2011 19:32:31 +0000 (14:32 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Added configuration for Onscreen Display settings.

FPS counter and Message visibility can now be configured,
along with the text color for each of them.

TODO: Apply the configuration to VBackend. Right now, the configuration
is stored in GensConfig, but it isn't actually applied to the OSD.

GensConfig.cpp: Added configuration settings for the OSD.

ui/GeneralConfigWindow.ui: Added OSD configuration widgets.

8 years ago[gens-qt4] ui/GeneralConfigWindow.ui: Fix up the tab order.
David Korth [Fri, 28 Jan 2011 18:54:01 +0000 (13:54 -0500)] 
[gens-qt4] ui/GeneralConfigWindow.ui: Fix up the tab order.

The tab order is still a bit awkward due to GensLineEdit, but it's
better than before. (The buttonBox is after everything else now,
instead of being immediately after tabWidget.)

8 years ago[extlib/lzma] Converted all files to have UNIX line-endings.
David Korth [Fri, 28 Jan 2011 08:54:40 +0000 (03:54 -0500)] 
[extlib/lzma] Converted all files to have UNIX line-endings.

The LZMA SDK uses Windows line-endings, so we need to make sure
we change them to UNIX line-endings via dos2unix whenever the
LZMA SDK is updated.

8 years ago[extlib/lzma] Updated LZMA SDK to version 9.20.
David Korth [Fri, 28 Jan 2011 08:54:19 +0000 (03:54 -0500)] 
[extlib/lzma] Updated LZMA SDK to version 9.20.

8 years ago[gens-qt4] Use our own WinMain() instead of depending on libqtmain.
David Korth [Thu, 27 Jan 2011 23:34:45 +0000 (18:34 -0500)] 
[gens-qt4] Use our own WinMain() instead of depending on libqtmain.

gqt4_win32.cpp::WinMain() is based on libqtmain, but it doesn't have
the Windows CE-specific code.

Other changes:

- gqt4_main.cpp::main() is now gqt4_main.cpp::gens_main().
  On Win32, it remains gens_main(), but on other platforms,
  it's #define'd to main().

- gens-qt4 no longer links to libmingw32. libmingw32 provided some
  main() redirection stuff that was required with libqtmain, but
  linking it now merely causes conflicts.

- -DQT_NEEDS_QMAIN is no longer needed, since we're implementing
  WinMain() and main() redirection ourselves instead of having
  Qt handle it.

With these changes, Gens/GS II now cross-compiles successfully with
i686-w64-mingw32 (mingw64) on Linux, with a few mior issues:

- The Starscream binaries are compiled as Win32 executables, so they
  have to be run with wine manually.

- Binaries created by mingw64 don't have dependencies on mingwm10.dll
  or libgcc_s_dw2-1.dll, but the precompiled Qt 4.7.1 DLLs do.
  I'll have to compile my own version of Qt/Win32 using mingw64
  in order to get rid of these dependencies.

8 years agoCMakeLists.txt: Include the zlib binary directory when using the bundled zlib.
David Korth [Thu, 27 Jan 2011 19:53:13 +0000 (14:53 -0500)] 
CMakeLists.txt: Include the zlib binary directory when using the bundled zlib.

This is needed in order to correctly #include "zconf.h" when cross-compiling
for Windows using mingw64.

8 years ago[gens-qt4] GensConfig::setExtPrgUnRAR(): Set the RAR binary in LibGens::DcRar.
David Korth [Thu, 27 Jan 2011 16:08:52 +0000 (11:08 -0500)] 
[gens-qt4] GensConfig::setExtPrgUnRAR(): Set the RAR binary in LibGens::DcRar.

TODO: Move this to something like GensConfigHandler.cpp.

TODO: If UnRAR isn't usable, display an error message when loading
a ROM instead of simply doing nothing.

8 years ago[libgens] Decompressor/DcRar.hpp: Added functions to set and get the external RAR...
David Korth [Thu, 27 Jan 2011 16:07:01 +0000 (11:07 -0500)] 
[libgens] Decompressor/DcRar.hpp: Added functions to set and get the external RAR program filename.

8 years agolibgens] lg_main.cpp: Updated the copyright date for 2011.
David Korth [Thu, 27 Jan 2011 10:22:56 +0000 (05:22 -0500)] 
libgens] lg_main.cpp: Updated the copyright date for 2011.

8 years agoTAGS.txt: New tag: gens-qt4-GeneralConfigWindow-v2
David Korth [Thu, 27 Jan 2011 09:58:46 +0000 (04:58 -0500)] 
TAGS.txt: New tag: gens-qt4-GeneralConfigWindow-v2

8 years ago[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): s/lstat/stat/g gens-qt4-GeneralConfigWindow-v2
David Korth [Thu, 27 Jan 2011 09:57:15 +0000 (04:57 -0500)] 
[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): s/lstat/stat/g

8 years ago[libgens] Decompressor/DcRar.hpp: Call stat(), not lstat().
David Korth [Thu, 27 Jan 2011 09:55:58 +0000 (04:55 -0500)] 
[libgens] Decompressor/DcRar.hpp: Call stat(), not lstat().

lstat() gets information about the symlink itself. We want information about
the file the symlink is pointing to. (For some reason, I was thinking it was
the other way around when I added this code.)

DcRar_Unix.cpp: Updated to use stat() instead of lstat().

DcRar_Win32.cpp: Removed references to lstat(). (We were using stat() anyway
because mingw doesn't currently provide an lstat() function.)

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Convert filenames to use native separators.
David Korth [Thu, 27 Jan 2011 09:54:18 +0000 (04:54 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Convert filenames to use native separators.

Qt4 uses '/' as directory separators, which is fine on Linux and Mac OS X.

On Windows, it gets confusing, since Windows uses '\\' as its directory separator.

Convert the filenames from QFileDialog::getOpenFileName() to use native
directory separators so they show up with backslashes on Win32.

Qt and MinGW both support use of both separators, so this isn't a problem
code-wise. It's just annoying visually.

8 years ago[gens-qt4] GeneralConfigWindow.cpp: Set the default filename in QFileDialog::getOpenF...
David Korth [Thu, 27 Jan 2011 09:47:17 +0000 (04:47 -0500)] 
[gens-qt4] GeneralConfigWindow.cpp: Set the default filename in QFileDialog::getOpenFileName() to the current filename.

On Win32, the directory was always reset to the application directory,
which is annoying

On Linux, the last selected directory was remembered, but it's still
more convenient to set the filename to the specified file in the textbox
to provide instant access to that directory.

8 years ago[libgens] DcRar_Win32.cpp::CheckExtPrg(): Check if the file is a regular file by...
David Korth [Thu, 27 Jan 2011 09:44:53 +0000 (04:44 -0500)] 
[libgens] DcRar_Win32.cpp::CheckExtPrg(): Check if the file is a regular file by calling stat().

NOTE: MinGW currently doesn't provide lstat().
Perhaps we should test for lstat() in CMake.

8 years ago[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): Added text for the...
David Korth [Thu, 27 Jan 2011 09:40:46 +0000 (04:40 -0500)] 
[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): Added text for the new error codes -6 and -7.

8 years ago[libgens] Decompressor/DcRar.hpp: Added two new error codes:
David Korth [Thu, 27 Jan 2011 09:40:23 +0000 (04:40 -0500)] 
[libgens] Decompressor/DcRar.hpp: Added two new error codes:

* -6: Version information not found.
* -7: Not UnRAR.dll. (Win32 only)

8 years ago[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): Updated to use RarEx...
David Korth [Thu, 27 Jan 2011 09:34:55 +0000 (04:34 -0500)] 
[gens-qt4] GeneralConfigWindow::on_txtExtPrgUnRAR_textChanged(): Updated to use RarExecType.