Skip to content

Commit

Permalink
read changes.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
AlfredoCubitos committed Apr 4, 2016
1 parent 6173ad5 commit 5edc746
Show file tree
Hide file tree
Showing 15 changed files with 321 additions and 625 deletions.
6 changes: 6 additions & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 2.1.0

- Sorting options from directory-config-Menu removed
- Translation files moved to resource system
- German translation added

Version 2.0.0

- Compatibility updates for flam3-3.1.1, Lua-5.2, Qt-5.5.
Expand Down
6 changes: 6 additions & 0 deletions qosmic/changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 2.1.0

- Sorting options from directory-config-Menu removed
- Translation files moved to resource system
- German translation added

Version 2.0.0

- Compatibility updates for flam3-3.1.1, Lua-5.2, Qt-5.5.
Expand Down
7 changes: 4 additions & 3 deletions qosmic/qosmic.pro
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ else {
## Adjust these variables to set paths and libs without using pkg-config.
## The PALETTESDIR must be set to the directory containing the
## flam3-palettes.xml file installed by the flam3 package.
PALETTESDIR = /usr/share/flam3
PALETTESDIR = /usr/share/flam3
INCLUDEPATH += /usr/include/libxml2
LIBS += -L/usr/lib/libxml2 -lflam3 -lm -ljpeg -lxml2 -llua
}

################################################################################
## Build style flags. Adding debug enables more verbose logging.
#CONFIG += release warn_off
#CONFIG += debug warn_on
CONFIG += debug warn_on


################################################################################
Expand Down Expand Up @@ -330,7 +330,8 @@ SOURCES += \

TRANSLATIONS += ts/qosmic_fr.ts \
ts/qosmic_cs.ts \
ts/qosmic_ru.ts
ts/qosmic_ru.ts \
ts/qosmic_de.ts

MOC_DIR = .moc
OBJECTS_DIR = .obj
Expand Down
4 changes: 4 additions & 0 deletions qosmic/qosmic.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,9 @@
<file>icons/silk/table.xpm</file>
<file>icons/silk/text_columns.xpm</file>
<file>icons/silk/wand.xpm</file>
<file>ts/qosmic_cs.qm</file>
<file>ts/qosmic_de.qm</file>
<file>ts/qosmic_fr.qm</file>
<file>ts/qosmic_ru.qm</file>
</qresource>
</RCC>
120 changes: 41 additions & 79 deletions qosmic/src/directoryviewwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ DirectoryViewWidget::DirectoryViewWidget(QWidget* parent)
{
setupUi(this);
QSettings s;
s.beginGroup("directoryview");
s.beginGroup(tr("directoryview"));
int icon_size = s.value("iconsize", 48).toInt();
path = s.value("lastdirectory", QDir::homePath()).toString();
path = s.value(tr("lastdirectory"), QDir::homePath()).toString();
histEntries = s.value("dirhistory", QStringList() << path).toStringList();
sort_type = (SortType)s.value("sorttype", NAME).toInt();
sort_order = (Qt::SortOrder)s.value("sortorder", Qt::AscendingOrder).toInt();
bool show_hidden = s.value("showhidden", false).toBool();
view_type = (ViewType)s.value("viewtype", SHORT).toInt();
sort_type = (SortType)s.value(tr("sorttype"), NAME).toInt();
sort_order = (Qt::SortOrder)s.value(tr("sortorder"), Qt::AscendingOrder).toInt();
bool show_hidden = s.value(tr("showhidden"), false).toBool();
view_type = (ViewType)s.value(tr("viewtype"), SHORT).toInt();

QStringList filters;
filters << "*.flam3" << "*.flam" << "*.flame" << "*.lua";
Expand Down Expand Up @@ -78,7 +78,7 @@ DirectoryViewWidget::DirectoryViewWidget(QWidget* parent)
connect(m_configButton, SIGNAL(clicked()), this, SLOT(configButtonClicked()));

showHiddenFiles(show_hidden);
sortBy(sort_type);
sortBy();
setViewType(view_type);
}

Expand Down Expand Up @@ -231,15 +231,15 @@ void DirectoryViewWidget::closeEvent(QCloseEvent* /*e*/)
{
logInfo("DirectoryViewWidget::closeEvent : saving settings");
QSettings s;
s.beginGroup("directoryview");
s.setValue("lastdirectory", path);
s.setValue("iconsize", m_dirListView->iconSize().width());
s.setValue("dirhistory", comboListModel->stringList());
s.setValue("sortorder", sort_order);
s.setValue("sorttype", sort_type);
s.setValue("viewtype", view_type);
s.setValue("showhidden", (model->filter() & QDir::Hidden) != 0);
s.setValue("detailedviewstate", m_treeView->header()->saveState());
s.beginGroup(tr("directoryview"));
s.setValue(tr("lastdirectory"), path);
s.setValue(tr("iconsize"), m_dirListView->iconSize().width());
s.setValue(tr("dirhistory"), comboListModel->stringList());
s.setValue(tr("sortorder"), sort_order);
s.setValue(tr("sorttype"), sort_type);
s.setValue(tr("viewtype"), view_type);
s.setValue(tr("showhidden"), (model->filter() & QDir::Hidden) != 0);
s.setValue(tr("detailedviewstate"), m_treeView->header()->saveState());
s.endGroup();
}

Expand Down Expand Up @@ -300,32 +300,10 @@ void DirectoryViewWidget::updateHistEntries(const QString& path)
void DirectoryViewWidget::configButtonClicked()
{
QMenu* popup = new QMenu(this);
QMenu* sortmenu = popup->addMenu("Sorting");
QAction* nameaction = sortmenu->addAction("By Name");
QAction* dateaction = sortmenu->addAction("By Date");
QAction* sizeaction = sortmenu->addAction("By Size");
QAction* typeaction = sortmenu->addAction("By Type");
nameaction->setCheckable(true);
dateaction->setCheckable(true);
sizeaction->setCheckable(true);
typeaction->setCheckable(true);
if (sort_type == NAME)
nameaction->setChecked(true);
else if (sort_type == DATE)
dateaction->setChecked(true);
else if (sort_type == TYPE)
typeaction->setChecked(true);
else
sizeaction->setChecked(true);

sortmenu->addSeparator();
QAction* orderaction = sortmenu->addAction("Descending");
orderaction->setCheckable(true);
orderaction->setChecked(sort_order == Qt::DescendingOrder);

QMenu* viewmenu = popup->addMenu("View");
QAction* shorttype = viewmenu->addAction("Short View");
QAction* detailtype = viewmenu->addAction("Detailed View");
QMenu* viewmenu = popup->addMenu(tr("View"));
QAction* shorttype = viewmenu->addAction(tr("Short View"));
QAction* detailtype = viewmenu->addAction(tr("Detailed View"));
shorttype->setCheckable(true);
detailtype->setCheckable(true);
if (view_type == SHORT)
Expand All @@ -334,50 +312,33 @@ void DirectoryViewWidget::configButtonClicked()
detailtype->setChecked(true);

popup->addSeparator();
QAction* hidden = popup->addAction("Show Hidden Files");
QAction* hidden = popup->addAction(tr("Show Hidden Files"));
hidden->setCheckable(true);
hidden->setChecked((model->filter() & QDir::Hidden) != 0);

connect(popup, SIGNAL(triggered(QAction*)), this, SLOT(configMenuTriggered(QAction*)));
connect(viewmenu, SIGNAL(triggered(QAction*)), this, SLOT(configMenuTriggered(QAction*)));
connect(sortmenu, SIGNAL(triggered(QAction*)), this, SLOT(configMenuTriggered(QAction*)));

connect(popup, SIGNAL(triggered(QAction*)), this, SLOT(hiddenAction(QAction*)));
connect(shorttype, SIGNAL(triggered(bool)), this, SLOT(shortViewAction()));
connect(detailtype, SIGNAL(triggered(bool)), this, SLOT(detailedViewAction()));
popup->exec(m_configButton->mapToGlobal(QPoint(0,0)));

delete popup;
}

void DirectoryViewWidget::configMenuTriggered(QAction* action)
void DirectoryViewWidget::hiddenAction(QAction* action)
{
bool showhidden = action->isChecked();
showHiddenFiles(showhidden);
sortBy();
}

void DirectoryViewWidget::shortViewAction()
{
setViewType(SHORT);
}

void DirectoryViewWidget::detailedViewAction()
{
if (action->text() == "Descending")
{
Qt::SortOrder order = Qt::AscendingOrder;
if (action->isChecked())
order = Qt::DescendingOrder;
setSortOrder(order);
}
else if (action->text() == "Show Hidden Files")
{
bool showhidden = action->isChecked();
showHiddenFiles(showhidden);
}
else if (action->text() == "Short View")
setViewType(SHORT);
else if (action->text() == "Detailed View")
setViewType(DETAILED);
else
{
SortType type;
if (action->text() == "By Date")
type = DATE;
else if (action->text() == "By Size")
type = SIZE;
else if (action->text() == "By Type")
type = TYPE;
else
type = NAME;
sortBy(type);
}
}

void DirectoryViewWidget::showHiddenFiles(bool flag)
Expand All @@ -391,9 +352,10 @@ void DirectoryViewWidget::showHiddenFiles(bool flag)
}
}

void DirectoryViewWidget::sortBy(SortType type)
void DirectoryViewWidget::sortBy()
{
sort_type = type;


if (view_type == DETAILED)
{
QString header;
Expand Down Expand Up @@ -435,7 +397,7 @@ Qt::SortOrder DirectoryViewWidget::sortOrder() const
void DirectoryViewWidget::setSortOrder(Qt::SortOrder order)
{
sort_order = order;
sortBy(sort_type);
sortBy();
}

void DirectoryViewWidget::setViewType(DirectoryViewWidget::ViewType type)
Expand All @@ -449,7 +411,7 @@ void DirectoryViewWidget::setViewType(DirectoryViewWidget::ViewType type)
m_dirListView->blockSignals(false);
m_treeView->setVisible(false);
m_treeView->blockSignals(true);
sortBy(sort_type);
sortBy();
break;
case DETAILED:
m_treeView->setVisible(true);
Expand Down
9 changes: 7 additions & 2 deletions qosmic/src/directoryviewwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,18 @@ class DirectoryViewWidget : public QWidget, private Ui::DirectoryViewWidget
void backButtonClicked();
void historyIndexChanged(const QString&);
void configButtonClicked();
void configMenuTriggered(QAction*);
void showHiddenFiles(bool);
void sortBy(SortType);
void sortBy();
void detailedViewSortTypeChanged(int, Qt::SortOrder);
void zoomInButtonClicked();
void zoomOutButtonClicked();

void hiddenAction(QAction *action);
void shortViewAction();
void detailedViewAction();



private:
QFileSystemModel* model;
QStringListModel* comboListModel;
Expand Down
11 changes: 7 additions & 4 deletions qosmic/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1653,19 +1653,22 @@ void MainWindow::runSheepLoop(bool flag)
{
static bool run_sequence; // signal this routine to start/stop sequence

if (!m_previewWidget->isVisible())
return;


if (!m_previewWidget->isVisible())
qobject_cast<QDockWidget*>(m_previewWidget->parentWidget())->show();
//return;

if (flag)
{
int dncp = 0;
flam3_genome* sheep = m_sheepLoopWidget->createSheepLoop(dncp);
flam3_genome* sheep = m_sheepLoopWidget->createSheepLoop(dncp);

if (sheep != NULL)
{
// resize the request list if neccessary
while (m_sheep_requests.size() > dncp)
delete m_sheep_requests.takeLast();
delete m_sheep_requests.takeLast();

run_sequence = true;
for (int i = 0 ; run_sequence && i < dncp ; i++)
Expand Down
32 changes: 13 additions & 19 deletions qosmic/src/qosmic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <QTranslator>
#include <QFileInfo>
#include <QLibraryInfo>
#include <QDebug>

#include "qosmic.h"
#include "logger.h"
Expand All @@ -43,32 +44,22 @@ int main(int argc, char* argv[])
logInfo(QString("main() : Qosmic (version %1)").arg(QOSMIC_VERSION));

// Load translations if necessary
QTranslator translator;
{
QString locale = QLocale::system().name();
logInfo("main() : system locale is %s", locale.toLatin1().constData());
QString qmDir(QOSMIC_TRANSDIR);
QString qmFile(QString("qosmic_") + locale);

if (translator.load(qmFile, qmDir))
{
logInfo(QString("main() : installing translations for %1").arg(locale));
app.installTranslator(&translator);
}
else
{
logInfo(QString("main() : no translations found for locale %1").arg(locale));
logInfo("main() : using default locale");
}
}
QTranslator translator;
QString locale = QLocale::system().name();
translator.load(QString(":ts/qosmic_") + locale);
app.installTranslator(&translator);


QTranslator qttranslator;
QTranslator qttranslator;
{
QString locale = QLocale::system().name();
logInfo("main() : system locale is %s", locale.toLatin1().constData());
QString qmDir(QLibraryInfo::location(QLibraryInfo::TranslationsPath));
QString qmFile(QString("qt_") + locale);



if (qttranslator.load(qmFile, qmDir))
{
logInfo(QString("main() : installing qt translations for %1").arg(locale));
Expand All @@ -79,7 +70,10 @@ int main(int argc, char* argv[])
logInfo(QString("main() : no qt translations found for locale %1").arg(locale));
logInfo("main() : using default locale");
}
}
}




if (!QFileInfo(getenv("flam3_palettes")).exists())
{
Expand Down
Binary file added qosmic/ts/qosmic_cs.qm
Binary file not shown.
Loading

0 comments on commit 5edc746

Please sign in to comment.