be able to double click on ubx files (WIP)

preferencesAboutTextFull
Clément Fauconnier 5 years ago
parent 40c334c144
commit adb884c8c9
  1. 2
      release_scripts/linux/package.sh
  2. 8
      resources/linux/openboard-ubx.xml
  3. 7
      src/core/UBApplication.cpp
  4. 21
      src/core/UBApplicationController.cpp
  5. 1
      src/core/UBApplicationController.h

@ -181,6 +181,7 @@ chown -R root:root $PACKAGE_DIRECTORY
cp -R resources/customizations $PACKAGE_DIRECTORY/
cp resources/linux/openboard-ubz.xml $PACKAGE_DIRECTORY/etc/
cp resources/linux/openboard-ubx.xml $PACKAGE_DIRECTORY/etc/
if $BUNDLE_QT; then
cp -R resources/linux/run.sh $PACKAGE_DIRECTORY/
@ -284,6 +285,7 @@ cat > "$BASE_WORKING_DIR/DEBIAN/postinst" << EOF
xdg-desktop-menu install --novendor /usr/share/applications/${APPLICATION_CODE}.desktop
xdg-mime install --mode system /$APPLICATION_PATH/$APPLICATION_CODE/etc/openboard-ubz.xml
xdg-mime install --mode system /$APPLICATION_PATH/$APPLICATION_CODE/etc/openboard-ubx.xml
xdg-mime default /usr/share/applications/${APPLICATION_CODE}.desktop application/ubz
ln -s $SYMLINK_TARGET /usr/bin/$APPLICATION_CODE

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/ubx">
<comment>OpenBoard documents set</comment>
<comment xml:lang="fr">Ensemble de documents OpenBoard</comment>
<glob pattern="*.ubx"/>
</mime-type>
</mime-info>

@ -349,7 +349,12 @@ int UBApplication::exec(const QString& pFileToImport)
boardController->setupLayout();
if (pFileToImport.length() > 0)
UBApplication::applicationController->importFile(pFileToImport);
{
if (pFileToImport.endsWith(".ubx"))
UBApplication::applicationController->importUbx(pFileToImport);
else
UBApplication::applicationController->importFile(pFileToImport);
}
if (UBSettings::settings()->appStartMode->get().toInt())
applicationController->showDesktop();

@ -675,7 +675,6 @@ void UBApplicationController::showMessage(const QString& message, bool showSpinn
}
}
void UBApplicationController::importFile(const QString& pFilePath)
{
const QFile fileToOpen(pFilePath);
@ -709,6 +708,26 @@ void UBApplicationController::importFile(const QString& pFilePath)
}
}
void UBApplicationController::importUbx(const QString& pFilePath)
{
bool success = false;
QFileInfoList list = UBDocumentManager::documentManager()->importUbx(pFilePath, UBSettings::userDocumentDirectory());
success = (list.length() != 0);
if (success)
{
if (mMainMode == Board || mMainMode == Internet)
{
if (UBApplication::boardController)
{
showBoard();
}
}
}
}
void UBApplicationController::useMultiScreen(bool use)
{
if (use && !mMirror)

@ -93,6 +93,7 @@ class UBApplicationController : public QObject
void showMessage(const QString& message, bool showSpinningWheel);
void importFile(const QString& pFilePath);
void importUbx(const QString& pFilePath);
UBDisplayManager* displayManager()
{

Loading…
Cancel
Save