Skip to content

Commit

Permalink
GUI: Remove 'preview more types feature' because it's unrelated to th…
Browse files Browse the repository at this point in the history
…e Qt branch
  • Loading branch information
fdde authored and DrMcCoy committed Dec 29, 2017
1 parent 5997023 commit 3d81015
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 252 deletions.
31 changes: 0 additions & 31 deletions src/gui/config.cpp

This file was deleted.

32 changes: 0 additions & 32 deletions src/gui/config.h

This file was deleted.

32 changes: 2 additions & 30 deletions src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,10 @@
#include "src/common/system.h"
#include "src/common/ustring.h"
#include "src/common/writefile.h"
#include "src/gui/config.h"
#include "src/gui/mainwindow.h"
#include "src/gui/panelpreviewempty.h"
#include "src/gui/panelpreviewimage.h"
#include "src/gui/panelpreviewsound.h"
#include "src/gui/panelpreviewtext.h"
#include "src/gui/panelresourceinfo.h"
#include "src/gui/resourcetree.h"
#include "src/gui/resourcetreeitem.h"
Expand Down Expand Up @@ -77,8 +75,6 @@ MainWindow::MainWindow(QWidget *parent, const char *title, const QSize &size, co
_panelPreviewEmpty = new PanelPreviewEmpty();
_panelPreviewImage = new PanelPreviewImage();
_panelPreviewSound = new PanelPreviewSound();
if (kPreviewMoreTypes)
_panelPreviewText = new PanelPreviewText();
_panelResourceInfo = new PanelResourceInfo();

_treeView = new QTreeView(_splitterLeftRight);
Expand Down Expand Up @@ -212,8 +208,6 @@ MainWindow::MainWindow(QWidget *parent, const char *title, const QSize &size, co
QObject::connect(_panelResourceInfo, &PanelResourceInfo::exportBMUMP3Clicked, this, &MainWindow::exportBMUMP3);
QObject::connect(_panelResourceInfo, &PanelResourceInfo::exportWAVClicked, this, &MainWindow::exportWAV);
QObject::connect(_actionAbout, &QAction::triggered, this, &MainWindow::slotAbout);
if (kPreviewMoreTypes)
QObject::connect(_panelPreviewText, &PanelPreviewText::log, this, &MainWindow::slotLog);

_actionAbout->setShortcut(QKeySequence(tr("F1")));

Expand All @@ -236,10 +230,6 @@ MainWindow::~MainWindow() {
if (_panelPreviewEmpty)
delete _panelPreviewEmpty;

if (kPreviewMoreTypes)
if (_panelPreviewText)
delete _panelPreviewText;

if (_panelPreviewSound)
delete _panelPreviewSound;

Expand Down Expand Up @@ -354,24 +344,8 @@ void MainWindow::showPreviewPanel() {
break;

default:
{
switch (_currentItem->getFileType()) {
case Aurora::FileType::kFileTypeICO:
if (kPreviewMoreTypes)
showPreviewPanel(_panelPreviewImage);
break;

case Aurora::FileType::kFileTypeINI:
case Aurora::FileType::kFileTypeTXT:
if (kPreviewMoreTypes)
showPreviewPanel(_panelPreviewText);
break;

default:
showPreviewPanel(_panelPreviewEmpty);
break;
}
}
showPreviewPanel(_panelPreviewEmpty);
break;
}
}

Expand All @@ -382,8 +356,6 @@ void MainWindow::resourceSelect(const QItemSelection &selected, const QItemSelec
_panelResourceInfo->update(_currentItem);

_panelPreviewImage->setItem(_currentItem);
if (kPreviewMoreTypes)
_panelPreviewText->setItem(_currentItem);
_panelPreviewSound->setItem(_currentItem);

showPreviewPanel();
Expand Down
2 changes: 0 additions & 2 deletions src/gui/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ namespace GUI {
class PanelPreviewEmpty;
class PanelPreviewImage;
class PanelPreviewSound;
class PanelPreviewText;
class PanelResourceInfo;
class ResourceTreeItem;
class ResourceTree;
Expand Down Expand Up @@ -124,7 +123,6 @@ private /*slots*/:
PanelPreviewEmpty *_panelPreviewEmpty;
PanelPreviewImage *_panelPreviewImage;
PanelPreviewSound *_panelPreviewSound;
PanelPreviewText *_panelPreviewText;
PanelResourceInfo *_panelResourceInfo;
};

Expand Down
18 changes: 0 additions & 18 deletions src/gui/panelpreviewimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include "verdigris/wobjectimpl.h"

#include "src/gui/config.h"
#include "src/gui/panelpreviewimage.h"
#include "src/gui/resourcetreeitem.h"

Expand Down Expand Up @@ -123,23 +122,6 @@ void PanelPreviewImage::setItem(const ResourceTreeItem *item) {
}

void PanelPreviewImage::loadImage() {
if (kPreviewMoreTypes) {
if (_currentItem->getFileType() == Aurora::FileType::kFileTypeICO) {
QImageReader reader(_currentItem->getPath());
reader.setAutoTransform(true);
const QImage newImage = reader.read();

_originalPixmap = QPixmap::fromImage(newImage);
_originalSize = _originalPixmap.size();
_labelImage->setPixmap(_originalPixmap);
_labelImage->setFixedSize(_originalSize);

_labelDimensions->setText(QString("(%1x%2)").arg(_originalPixmap.width()).arg(_originalPixmap.height()));
_scrollAreaImage->show();
return;
}
}

QScopedPointer<Images::Decoder> image(_currentItem->getImage());

if ((image->getMipMapCount() == 0) || (image->getLayerCount() == 0)) {
Expand Down
73 changes: 0 additions & 73 deletions src/gui/panelpreviewtext.cpp

This file was deleted.

62 changes: 0 additions & 62 deletions src/gui/panelpreviewtext.h

This file was deleted.

4 changes: 0 additions & 4 deletions src/gui/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ src_gui_libgui_la_SOURCES += \
src/gui/panelpreviewempty.h \
src/gui/panelpreviewsound.h \
src/gui/panelpreviewimage.h \
src/gui/panelpreviewtext.h \
src/gui/proxymodel.h \
src/gui/statusbar.h \
src/gui/config.h \
$(EMPTY)

src_gui_libgui_la_SOURCES += \
Expand All @@ -45,8 +43,6 @@ src_gui_libgui_la_SOURCES += \
src/gui/panelpreviewempty.cpp \
src/gui/panelpreviewsound.cpp \
src/gui/panelpreviewimage.cpp \
src/gui/panelpreviewtext.cpp \
src/gui/proxymodel.cpp \
src/gui/statusbar.cpp \
src/gui/config.cpp \
$(EMPTY)

0 comments on commit 3d81015

Please sign in to comment.