Skip to content

Commit

Permalink
Wine stock icons to be organised through Q4Wine [BUG-117];
Browse files Browse the repository at this point in the history
  • Loading branch information
brezerk committed Nov 13, 2017
1 parent 4920bc1 commit 597a0e8
Show file tree
Hide file tree
Showing 5 changed files with 608 additions and 59 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
Version 1.3.7
Updated:
- Wine stock icons to be organised through Q4Wine [BUG-117];

Version 1.3.6
Updated:
- Added indication of applications which was installed through winetricks [BUG-106][BUG-111];
Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Expand Up @@ -24,12 +24,14 @@
#include <QTextStream>

#ifdef DEBUG

#include <QDebug>
#endif

#include <QString>
#include <QLibrary>


#include "mainwindow.h"

#include <stdlib.h>
Expand Down
14 changes: 13 additions & 1 deletion src/plugins/sysmenu.cpp
Expand Up @@ -254,7 +254,7 @@ bool system_menu::create_dir_info(const QString prefix_name, const QString dir_n
}

bool system_menu::writeXMLSystemMenu(){

bool export_sysdir = CoreLib->getSetting("Plugins", "ExportSystemFolder", false, false).toBool();
menu_xml = QDomDocument("Menu PUBLIC \"-//freedesktop//DTD Menu 1.0//EN\" \"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd\"");
QDomElement root = menu_xml.createElement("Menu");
menu_xml.appendChild(root);
Expand All @@ -273,6 +273,9 @@ bool system_menu::writeXMLSystemMenu(){
this->add_dom_icons(menu_xml, root_l1, list.at(i), "", iconsList);
QStringList subresult = db_dir.getDirList(list.at(i));
for (int j = 0; j < subresult.size(); ++j) {
if ((!export_sysdir) && (subresult.at(j) == "system")) {
continue;
}
QDomElement root_l2 = this->create_dom_menu(menu_xml, root_l1, list.at(i), subresult.at(j));
QStringList iconsList=db_icon.getIconsList(list.at(i), subresult.at(j), "");
this->add_dom_icons(menu_xml, root_l2, list.at(i), subresult.at(j), iconsList);
Expand All @@ -292,6 +295,10 @@ bool system_menu::writeXMLSystemMenu(){
}

bool system_menu::generateSystemMenu(const QString prefix_name, const QString dir_name){
//if ((prefix_name.isEmpty()) && (dir_name.isEmpty())) {
// this->wipeSystemMenu();
//}

QStringList prefixes;
QStringList subdirs;

Expand All @@ -301,6 +308,8 @@ bool system_menu::generateSystemMenu(const QString prefix_name, const QString di
prefixes << prefix_name;
}

bool export_sysdir = CoreLib->getSetting("Plugins", "ExportSystemFolder", false, false).toBool();

for (int i = 0; i < prefixes.size(); ++i) {
this->create_dir_info(prefixes.at(i));
QStringList iconsList=db_icon.getIconsList(prefixes.at(i), "", "");
Expand All @@ -315,6 +324,9 @@ bool system_menu::generateSystemMenu(const QString prefix_name, const QString di
}

for (int j = 0; j < subdirs.size(); ++j) {
if ((!export_sysdir) && (subdirs.at(j) == "system")) {
continue;
}
this->create_dir_info(prefixes.at(i), subdirs.at(j));
QStringList iconsList=db_icon.getIconsList(prefixes.at(i), subdirs.at(j), "");
for (int z = 0; z < iconsList.size(); ++z) {
Expand Down
11 changes: 11 additions & 0 deletions src/q4wine-gui/appsettings.cpp
Expand Up @@ -274,6 +274,12 @@ AppSettings::AppSettings(QWidget * parent, Qt::WindowFlags f) : QDialog(parent,
} else {
cbEnableDesktopMenu->setChecked(false);
}
if (settings.value("ExportSystemFolder", 0).toInt()==1){
cbExportSystemFolder->setChecked(true);
} else {
cbExportSystemFolder->setChecked(false);
}

settings.endGroup();
connect(cmdDesktopMenu_Regen, SIGNAL(clicked()), this, SLOT(cmdDesktopMenu_Regen_Click()));
connect(cmdDesktopMenu_Remove, SIGNAL(clicked()), this, SLOT(cmdDesktopMenu_Remove_Click()));
Expand Down Expand Up @@ -702,6 +708,11 @@ void AppSettings::cmdOk_Click(){
} else {
settings.setValue("enableMenuDesktop", 0);
}
if (cbExportSystemFolder->isChecked()){
settings.setValue("ExportSystemFolder", 1);
} else {
settings.setValue("ExportSystemFolder", 0);
}
settings.endGroup();
#endif

Expand Down

0 comments on commit 597a0e8

Please sign in to comment.