Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 40 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,45 @@ compiler:

before_install:
# Mac OS X
- if [[ "$TRAVIS_OS_NAME" == osx ]]; then brew install qt5 ; fi
- if [[ "$TRAVIS_OS_NAME" == linux ]]; then sudo apt-get install --reinstall ca-certificates; sudo -E add-apt-repository ppa:beineri/opt-qt591-trusty -y; sudo apt-get update -qq; sudo apt-get install --force-yes -qq qt59base qt59tools; fi
- if [[ "$TRAVIS_OS_NAME" == osx ]]; then
brew install qt5;
fi
- if [[ "$TRAVIS_OS_NAME" == linux ]]; then
sudo apt-get install --reinstall ca-certificates;
sudo -E add-apt-repository ppa:beineri/opt-qt591-trusty -y;
sudo apt-get update -qq;
sudo apt-get install --force-yes -qq qt59base qt59tools;
fi
#/usr/local/Cellar/qt/5.9.1/bin/
script:
- if [[ "$TRAVIS_OS_NAME" == osx ]]; then wget https://sourceforge.net/projects/pyqt/files/QScintilla2/QScintilla-2.10.1/QScintilla_gpl-2.10.1.tar.gz; tar -xvzf QScintilla_gpl-2.10.1.tar.gz; cd QScintilla_gpl-2.10.1/Qt4Qt5; PATH=/usr/local/Cellar/qt/5.9.1/bin:$PATH; export PATH; qmake qscintilla.pro; make -j$(nproc); sudo make install; qmake --version; cd ../../src; python generate.py -v 2.1.12; qmake "CONFIG+=release silent"; make -j$(nproc); sudo make install; fi
- if [[ "$TRAVIS_OS_NAME" == linux ]]; then source /opt/qt59/bin/qt59-env.sh; wget https://sourceforge.net/projects/pyqt/files/QScintilla2/QScintilla-2.10.1/QScintilla_gpl-2.10.1.tar.gz; tar -xvzf QScintilla_gpl-2.10.1.tar.gz; cd QScintilla_gpl-2.10.1/Qt4Qt5; qmake "CONFIG+=release silent"; make -j$(nproc); sudo make install; qmake --version; cd ../../src; python generate.py -v 2.1.12; qmake "CONFIG+=release silent"; make -j$(nproc); sudo make install; fi
- if [[ "$TRAVIS_OS_NAME" == osx ]]; then
wget https://sourceforge.net/projects/pyqt/files/QScintilla2/QScintilla-2.10.1/QScintilla_gpl-2.10.1.tar.gz;
tar -xvzf QScintilla_gpl-2.10.1.tar.gz;
cd QScintilla_gpl-2.10.1/Qt4Qt5;
PATH=/usr/local/Cellar/qt/5.9.1/bin:$PATH;
export PATH;
qmake qscintilla.pro;
make -j$(nproc);
sudo make install;
qmake --version;
cd ../../src;
python generate.py -v 2.1.12;
qmake "CONFIG+=release silent";
make -j$(nproc);
sudo make install;
fi
- if [[ "$TRAVIS_OS_NAME" == linux ]]; then
source /opt/qt59/bin/qt59-env.sh;
wget https://sourceforge.net/projects/pyqt/files/QScintilla2/QScintilla-2.10.1/QScintilla_gpl-2.10.1.tar.gz;
tar -xvzf QScintilla_gpl-2.10.1.tar.gz;
cd QScintilla_gpl-2.10.1/Qt4Qt5;
qmake "CONFIG+=release silent";
make -j$(nproc);
sudo make install;
qmake --version;
cd ../../src;
python generate.py -v 2.1.12;
qmake "CONFIG+=release silent";
make -j$(nproc);
sudo make install;
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![GPLv3 https://opensource.org/licenses/gpl-3.0.html](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://opensource.org/licenses/gpl-3.0.html)
[![status](https://travis-ci.org/PLLUG/kuzya.svg)](https://travis-ci.org/PLLUG/kuzya)
[![Build status](https://ci.appveyor.com/api/projects/status/6fi6m0sy9asst006/branch/development?svg=true)](https://ci.appveyor.com/project/alexchmykhalo/kuzya/branch/development)
[![Stories in Ready](https://badge.waffle.io/PLLUG/kuzya.svg?label=ready&title=Tasks Ready)](http://waffle.io/PLLUG/kuzya)
[![Stories in Ready](https://badge.waffle.io/PLLUG/kuzya.svg?label=ready&title=Ready)](http://waffle.io/PLLUG/kuzya)
[![Join the chat at https://gitter.im/PLLUG/kuzya](https://badges.gitter.im/PLLUG/kuzya.svg)](https://gitter.im/PLLUG/kuzya?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

----
Expand Down
12 changes: 8 additions & 4 deletions src/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void Compiler::refreshSupported()
profilesPathList.clear();

#ifdef WIN32
QString path = QApplication::applicationDirPath();
QString path = QDir::cleanPath(QApplication::applicationDirPath() + "/../../profiles");
path.truncate(path.lastIndexOf("/", -1));
path = path+"/profiles";
#else
Expand Down Expand Up @@ -431,12 +431,16 @@ void Compiler::run(void)
if (programPath.isEmpty()) return;

QString prevPath = QDir::currentPath();
QDir::setCurrent(sourcePath);
QDir::setCurrent(sourcePath);

#ifdef Q_OS_WIN32
QStringList command;
command << "/C" << "title "+programPath+ "&&"+programPath;
startDetached("cmd", command);
// command << "C:/" << "title "+programPath+".exe"+ "&&"+programPath+".exe";
// startDetached("cmd", command);
command << "cmd /c";
command << "set PATH=C:\\kuzya\\msys64\\mingw64\\bin;%PATH%";
command << programPath;
system(command.join(" & ").toUtf8().data());
#endif /*Q_OS_WIN32*/

#ifdef Q_OS_UNIX
Expand Down
15 changes: 10 additions & 5 deletions src/kuzya.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ Kuzya::Kuzya(QWidget *parent)
textEditorShortcut->setKey(Qt::CTRL+Qt::Key_Up);
connect(textEditorShortcut, SIGNAL(activated()), textEditor, SLOT(setFocus()));

QString pathToCompiler = "C:/kuzya/msys64/mingw64/bin";
settings->setCompilerLocation(pathToCompiler);
// if (qApp->argc() > 1)
// {
// this->openFile(qApp->argv()[qApp->argc()-1]);
Expand Down Expand Up @@ -736,9 +738,12 @@ void Kuzya::refreshProfileSettings()
srcRecompiled = false;

#ifdef WIN32
QString path = QApplication::applicationDirPath();
path.truncate(path.lastIndexOf("/", -1));
path = path+"/profiles/";
QString path = QDir::cleanPath(QApplication::applicationDirPath() + "/../../profiles");
if (!QDir(path).exists())
{
path.truncate(path.lastIndexOf("/", -1));
path = path+"/profiles";
}
#else
// QString path = QDir::cleanPath(QApplication::applicationDirPath() + "/../../usr/share/kuzya/profiles/");
QString path = QDir::cleanPath(QApplication::applicationDirPath() + "/../../usr/share/kuzya/profiles");
Expand Down Expand Up @@ -767,7 +772,7 @@ void Kuzya::refreshProfileSettings()


#ifdef WIN32
QString path = QApplication::applicationDirPath();
QString path = QDir::cleanPath(QApplication::applicationDirPath() + "/../../resources");
path.truncate(path.lastIndexOf("/", -1));
path = path+"/resources/";
#else
Expand Down Expand Up @@ -1351,7 +1356,7 @@ void Kuzya::slotChangeTranslation(QString translation)
qDebug() << "TR CODE: " << translator->translatedCodeFile();

#ifdef WIN32
QString path = QApplication::applicationDirPath();
QString path = QDir::cleanPath(QApplication::applicationDirPath() + "/../../profiles");
path.truncate(path.lastIndexOf("/", -1));
path = path+"/profiles/";
#else
Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ int main(int argc, char ** argv)
a.setApplicationName("Kuzya");

Kuzya * mw = new Kuzya();

QSplashScreen *splash = new QSplashScreen();
splash->setPixmap(QPixmap(":/menu/images/SplashCukr.png"));
splash->show();
splash->finish(mw);

delete splash;
mw->show();

Expand Down
20 changes: 15 additions & 5 deletions src/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ OptionsDialog::OptionsDialog(QWidget *parent)


#ifdef WIN32
stylesDir=QDir(QApplication::applicationDirPath()+"/../resources/qss/");
localizationLanguageDir=QDir(QApplication::applicationDirPath()+"/../resources/translations/");
stylesDir=QDir::cleanPath(QApplication::applicationDirPath() + "/../../resources/qss/");
localizationLanguageDir=QDir::cleanPath(QApplication::applicationDirPath() + "/../../resources/translations/");
#else
stylesDir=QDir(QDir::cleanPath(QApplication::applicationDirPath() + "/../../usr/share/kuzya/resources/qss/"));
if (stylesDir.exists() == false)
Expand Down Expand Up @@ -141,7 +141,7 @@ void OptionsDialog::slotChangeStyle(int)
void OptionsDialog::slotChangeSkin(QString sheetName)
{
#ifdef WIN32
QFile file(QApplication::applicationDirPath()+"/../resources/qss/"+sheetName.toLower()+".qss");
QFile file(QApplication::applicationDirPath()+"/../../resources/qss/"+sheetName.toLower()+".qss");
#else
// QFile file(QDir::cleanPath(QApplication::applicationDirPath() + "/../../usr/share/kuzya/resources/qss/")+sheetName.toLower()+".qss");
QFile file(stylesDir.absolutePath()+"/"+sheetName.toLower()+".qss");
Expand Down Expand Up @@ -257,7 +257,7 @@ void OptionsDialog::readODWSettings()

}
#ifdef WIN32
translator.load(QApplication::applicationDirPath()+"/../resources/translations/"+settings->value("Language",QLocale::languageToString(QLocale::system().language())).toString()+".qm");
translator.load(QApplication::applicationDirPath()+"/../../resources/translations/"+settings->value("Language",QLocale::languageToString(QLocale::system().language())).toString()+".qm");

#else
// translator.load(QDir::cleanPath(QApplication::applicationDirPath() + "/../../usr/share/kuzya/resources/translations/") + settings->value("Language",QLocale::languageToString(QLocale::system().language())).toString()+".qm");
Expand Down Expand Up @@ -585,7 +585,7 @@ void OptionsDialog::readMainWindowState()
void OptionsDialog::slotChangsLocalizationLanguage(QString langName)
{
#ifdef WIN32
translator.load(QApplication::applicationDirPath()+"/../resources/translations/"+langName);
translator.load(QApplication::applicationDirPath()+"/../../resources/translations/"+langName);

#else
//translator.load(QDir::cleanPath(QApplication::applicationDirPath() + "/../../usr/share/kuzya/resources/translations/")+langName);
Expand All @@ -600,3 +600,13 @@ void OptionsDialog::slotChangeOptionPage(int pIndex)
{
mStackedWidget->setCurrentIndex(pIndex);
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------
void OptionsDialog::setCompilerLocation(QString &pathToCompiler)
{
if(languageComboBox->currentText() == "c++" && compilerComboBox->currentText() == "g++" && compilerDirLineEdit->text().isEmpty())
{
compilerDirLineEdit->setText(pathToCompiler);
mw->getCurrentCompiler()->setCompilerDir(compilerDirLineEdit->text());
}
slotApply();
}
1 change: 1 addition & 0 deletions src/optionsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class OptionsDialog : public QDialog, private Ui::optionsForm
QString readDefaultCompiler(QString lang);
QString readCompilerLocation(QString lang, QString comp);
QString readCompilerOptions(QString lang, QString comp);
void setCompilerLocation(QString &pathToCompiler);

public slots:
void slotCommOptions(void);
Expand Down
3 changes: 3 additions & 0 deletions src/optionsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,9 @@ p, li { white-space: pre-wrap; }
<bold>false</bold>
</font>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
Expand Down
4 changes: 2 additions & 2 deletions src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ win32 {
TARGET = ../bin/kuzya
LIBS += -L../3rdparty/QScintilla/2.10.1
INCLUDEPATH = ../3rdparty/QScintilla/2.10.1
CONFIG(debug, debug|release):LIBS += -lqscintilla2d
else: LIBS += -lqscintilla2
CONFIG(debug, debug|release):LIBS += -lqscintilla2_qt$${QT_MAJOR_VERSION}d
else: LIBS += -lqscintilla2_qt$${QT_MAJOR_VERSION}
}

mac {
Expand Down
4 changes: 2 additions & 2 deletions src/translator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Translator::~Translator()
QStringList Translator::getSupportedTranslations(QString lang)
{
#ifdef WIN32
QString path = QApplication::applicationDirPath();
QString path = QDir::cleanPath(QApplication::applicationDirPath() + "/../../profiles");
path.truncate(path.lastIndexOf("/", -1));
path = path+"/profiles/"+lang;
#else
Expand Down Expand Up @@ -107,7 +107,7 @@ void Translator::openFile(QString file, QString lang)
translatedFileName = file;

#ifdef WIN32
QString path = QApplication::applicationDirPath();
QString path = QDir::cleanPath(QApplication::applicationDirPath() + "/../../profiles");
path.truncate(path.lastIndexOf("/", -1));
translationsPath = path+"/profiles/"+lang+"/";
#else
Expand Down