Commit 37c1da0b authored by Melroy van den Berg's avatar Melroy van den Berg

Update with master

parents 9be660a0 b1e7955f
Pipeline #2518 failed with stages
in 30 seconds
image: "danger89/gtk3-docker-cmake-ninja"
image: "danger89/gtk3-docker-cmake-ninja:1.0"
stages:
- test
......@@ -7,7 +7,8 @@ stages:
static_code_analysis:
stage: test
script: ./scripts/cpp_check.sh
script:
- ./scripts/cpp_check.sh
build:
stage: build
......@@ -16,10 +17,10 @@ build:
name: "Packages + Documentation"
expire_in: 1 week
paths:
- doc/doxygen/
- build_prod/WineGUI-*.deb
- build_prod/WineGUI-*.rpm
- build_prod/WineGUI-*.tar.gz
- doc/doxygen/
- build_prod/WineGUI-*.deb
- build_prod/WineGUI-*.rpm
- build_prod/WineGUI-*.tar.gz
cache:
key: "$CI_PIPELINE_ID"
paths:
......
......@@ -38,8 +38,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Production build
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
add_definitions(-DPRODUCTION=1)
# Include CPack packaging settings
include(packaging)
endif()
......
# Wine GUI
# WineGUI
Finally, a user-interface friendly [WINE](https://www.winehq.org/) (A compatibility layer capable of running Windows applications under Linux) Manager.
......@@ -16,10 +16,16 @@ Install the package and you are ready to go! WineGUI should be listed in your me
## Development
Development has been done in Visual Studio Code editor, using the following extensions:
Development has been done in VSCcodium, using the following extensions:
* C/C++
* CMake
* CMake Tools
* GitLab Workflow
### Documentation
See latest [WineGUI Docs](https://gitlab.melroy.org/melroy/winegui/-/jobs/artifacts/master/file/doc/doxygen/index.html?job=build).
### Requirements
......@@ -82,15 +88,28 @@ gdb -ex=run bin/winegui
For production build and DEB file package, you can run: `./scripts/build_prod.sh`
Or use the `cmake -DCMAKE_BUILD_TYPE=Release`.
Or use:
```sh
cmake -DCMAKE_BUILD_TYPE=Release
ninja
```
### Build Doxygen
Or build with generated doxygen files locally:
```sh
cmake -GNinja -Ddoc=ON
ninja
```
### Releasing
Before you can make a new release, align the version number in WineGUI with the version you want to release.
Then create a new tagged version in Gitlab with the same version name.
*Note:* Only the `master` branch will trigger the publish task.
*Note:* Only a `release tag` on the `master` branch will trigger the publish task.
## Coding standard
......
......@@ -27,12 +27,6 @@
// Use major.minor.patch syntax, don't forget to update CMakeLists.txt file as well!
static const std::string VERSION = "v1.6.0";
#if defined(PRODUCTION)
#define IMAGE_LOCATION "/usr/share/winegui/images/" /*!< Image location */
#else
#define IMAGE_LOCATION "../images/" /*!< Image location */
#endif
/**
* \class AboutDialog
* \brief The About dialog
......@@ -46,6 +40,9 @@ public:
void run_dialog();
void hide_dialog(int response);
void run_dialog();
void hide_dialog(int response);
static std::string GetVersion();
protected:
Gtk::Image logo; /*!< The logo of the app for the about window */
......
......@@ -24,12 +24,6 @@
#include <string>
#include "bottle_types.h"
#if defined(PRODUCTION)
#define IMAGE_LOCATION "/usr/share/winegui/images/" /*!< Image location */
#else
#define IMAGE_LOCATION "../images/" /*!< Image location */
#endif
/**
* \class BottleItem
* \brief Class object definition for a wine bottle item
......@@ -151,4 +145,4 @@ private:
void CreateUI();
static std::string str_tolower(std::string s);
};
\ No newline at end of file
};
......@@ -77,6 +77,7 @@ public:
static bool GetDLLOverride(const string prefix_path, const string dll_name, DLLOverride::LoadOrder load_order = DLLOverride::LoadOrder::Native);
static string GetUninstaller(const string prefix_path, const string uninstallerKey);
static string GetFontFilename(const string prefix_path, BottleTypes::Bit bit, const string fontName);
static string GetImageLocation(const string filename);
private:
Helper();
~Helper();
......
......@@ -32,12 +32,6 @@ using std::string;
using std::cout;
using std::endl;
#if defined(PRODUCTION)
#define IMAGE_LOCATION "/usr/share/winegui/images/" /*!< Image location */
#else
#define IMAGE_LOCATION "../images/" /*!< Image location */
#endif
/**
* \class MainWindow
* \brief Main GTK+ Window class
......
misc/winegui_screenshot.png

59.1 KB | W: | H:

misc/winegui_screenshot.png

56.3 KB | W: | H:

misc/winegui_screenshot.png
misc/winegui_screenshot.png
misc/winegui_screenshot.png
misc/winegui_screenshot.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -19,13 +19,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "about_dialog.h"
#include "helper.h"
/**
* \brief Contructor
*/
AboutDialog::AboutDialog(Gtk::Window& parent) {
// Set logo
logo.set(IMAGE_LOCATION "logo.png");
logo.set(Helper::GetImageLocation("logo.png"));
// Set version
std::vector<Glib::ustring> devs;
devs.push_back("Melroy van den Berg <melroy@melroy.org>");
......@@ -59,4 +60,4 @@ void AboutDialog::hide_dialog(__attribute__((unused)) int response)
*/
std::string AboutDialog::GetVersion() {
return VERSION;
}
\ No newline at end of file
}
......@@ -20,6 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "bottle_item.h"
#include "helper.h"
/**
* \brief Default contructor
......@@ -115,7 +116,7 @@ void BottleItem::CreateUI()
bool status = this->status();
// Set left side of the GUI
image.set(IMAGE_LOCATION "windows/" + filename);
image.set(Helper::GetImageLocation("windows/" + filename));
image.set_margin_top(8);
image.set_margin_end(8);
image.set_margin_bottom(8);
......@@ -126,10 +127,10 @@ void BottleItem::CreateUI()
Glib::ustring status_text = "Ready";
if (status) {
status_icon.set(IMAGE_LOCATION "ready.png");
status_icon.set(Helper::GetImageLocation("ready.png"));
} else {
status_text = "Not Ready";
status_icon.set(IMAGE_LOCATION "not_ready.png");
status_icon.set(Helper::GetImageLocation("not_ready.png"));
}
status_icon.set_size_request(2, -1);
status_icon.set_halign(Gtk::Align::ALIGN_START);
......
......@@ -701,26 +701,18 @@ std::list<BottleItem> BottleManager::CreateWineBottles(string wineVersion, std::
{
std::list<BottleItem> bottles;
string name = "";
string virtualDesktop = BottleTypes::VIRTUAL_DESKTOP_DISABLED;
BottleTypes::Windows windows = BottleTypes::Windows::WindowsXP;
BottleTypes::Bit bit = BottleTypes::Bit::win32;
string cDriveLocation = "";
string lastTimeWineUpdated = "";
BottleTypes::AudioDriver audioDriver = BottleTypes::AudioDriver::pulseaudio;
// Retrieve detailed info for each wine bottle prefix
for (const auto &[prefix, _]: bottleDirs ) {
std::ignore = _;
// Reset variables
name = "";
virtualDesktop = BottleTypes::VIRTUAL_DESKTOP_DISABLED;
string name = "";
string virtualDesktop = BottleTypes::VIRTUAL_DESKTOP_DISABLED;
bool status = false;
windows = BottleTypes::Windows::WindowsXP;
bit = BottleTypes::Bit::win32;
cDriveLocation = "- Unknown -";
lastTimeWineUpdated = "- Unknown -";
audioDriver = BottleTypes::AudioDriver::pulseaudio;
BottleTypes::Windows windows = BottleTypes::Windows::WindowsXP;
BottleTypes::Bit bit = BottleTypes::Bit::win32;
string cDriveLocation = "- Unknown -";
string lastTimeWineUpdated = "- Unknown -";
BottleTypes::AudioDriver audioDriver = BottleTypes::AudioDriver::pulseaudio;
try {
name = Helper::GetName(prefix);
......
......@@ -25,6 +25,7 @@
#include <iomanip>
#include <cstdio>
#include <memory>
#include <iostream>
#include <stdexcept>
#include <cstring>
#include <fcntl.h>
......@@ -387,8 +388,6 @@ BottleTypes::Windows Helper::GetWindowsOSVersion(const string prefix_path)
{
string filename = Glib::build_filename(prefix_path, SYSTEM_REG);
string version = "";
string version9x = "";
if (!(version = Helper::GetRegValue(filename, keyNameNT, nameNTVersion)).empty())
{
string buildNumberNT = Helper::GetRegValue(filename, keyNameNT, nameNTBuild);
......@@ -739,9 +738,10 @@ void Helper::SetVirtualDesktop(const string prefix_path, string resolution)
resolution = "640x480";
}
string result = Exec(("WINEPREFIX=\"" + prefix_path + "\" " + WINETRICKS_EXECUTABLE + " vd=" + resolution + ">/dev/null 2>&1; echo $?").c_str());
Exec(("WINEPREFIX=\"" + prefix_path + "\" " + WINETRICKS_EXECUTABLE + " vd=" + resolution + ">/dev/null 2>&1; echo $?").c_str());
// Something returns non-zero... winetricks on the command line, does return zero ..
/*
string result = Exec(..)
if (!result.empty()) {
result.erase(std::remove(result.begin(), result.end(), '\n'), result.end());
if (result.compare("0") != 0) {
......@@ -766,9 +766,11 @@ void Helper::DisableVirtualDesktop(const string prefix_path)
{
if (FileExists(WINETRICKS_EXECUTABLE))
{
string result = Exec(("WINEPREFIX=\"" + prefix_path + "\" " + WINETRICKS_EXECUTABLE + " vd=off>/dev/null 2>&1; echo $?").c_str());
Exec(("WINEPREFIX=\"" + prefix_path + "\" " + WINETRICKS_EXECUTABLE + " vd=off>/dev/null 2>&1; echo $?").c_str());
// Something returns non-zero... winetricks on the command line, does return zero ..
/*if (!result.empty()) {
/*
string result = Exec(...)
if (!result.empty()) {
result.erase(std::remove(result.begin(), result.end(), '\n'), result.end());
if (result.compare("0") != 0) {
throw std::runtime_error("Could not Disable Virtual Desktop");
......@@ -868,6 +870,37 @@ string Helper::GetFontFilename(const string prefix_path, BottleTypes::Bit bit, c
return Helper::GetRegValue(filename, keyName, fontName);
}
/**
* \brief Get path to an image resource located in a global data directory (like /usr/share)
* \param[in] filename - name of image
* \return Path to the requested image (or empty string if not found)
*/
string Helper::GetImageLocation(const string filename)
{
// Try absolute path first
for (string data_dir : Glib::get_system_data_dirs()) {
std::vector<std::string> path_builder{data_dir, "winegui", "images", filename};
string file_path = Glib::build_path(G_DIR_SEPARATOR_S, path_builder);
if (FileExists(file_path)) {
return file_path;
}
}
// Try local path if the images are not installed (yet)
// When working directory is in the build folder (relative path)
string file_path = Glib::build_filename("../images/", filename);
// When working directory is in the build/bin folder (relative path)
string file_path2 = Glib::build_filename("../../images/", filename);
if (FileExists(file_path)) {
return file_path;
}
else if(FileExists(file_path2)) {
return file_path2;
}
else {
return "";
}
}
/****************************************************************************
* Private methods *
......@@ -917,7 +950,8 @@ void Helper::ExecTracing(const char* cmd, bool enableTracing) {
}
if (enableTracing) {
// TODO: Dump result to log file.
// TODO: Dump result to log file instead.
std::cout << "\n=== Tracing output started ===\n\n" << result << "\n\n=== Tracing ended ===\n" << std::endl;
}
}
......
......@@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "main_window.h"
#include "helper.h"
#include "signal_dispatcher.h"
#include <locale>
......@@ -43,7 +43,7 @@ MainWindow::MainWindow(Menu& menu)
set_position(Gtk::WIN_POS_CENTER_ALWAYS);
try {
set_icon_from_file(IMAGE_LOCATION "logo.png");
set_icon_from_file(Helper::GetImageLocation("logo.png"));
}
catch (Glib::FileError& e) {
cout << "Catched " << e.what() << endl;
......@@ -260,6 +260,7 @@ void MainWindow::on_run_button_clicked()
filter_any->set_name("Any file");
filter_any->add_pattern("*");
dialog.add_filter(filter_any);
dialog.set_filename(c_drive_location.get_text().c_str());
//Show the dialog and wait for a user response:
int result = dialog.run();
......
......@@ -94,7 +94,11 @@ void SignalDispatcher::DispatchSignals()
menu.give_feedback.connect(sigc::mem_fun(*mainWindow, &MainWindow::on_give_feedback));
menu.show_about.connect(sigc::mem_fun(about, &AboutDialog::run_dialog));
about.signal_response().connect(sigc::mem_fun(about, &AboutDialog::hide_dialog));
<<<<<<< HEAD
=======
>>>>>>> master
// Distribute the active bottle signal
mainWindow->activeBottle.connect(sigc::mem_fun(manager, &BottleManager::SetActiveBottle));
mainWindow->activeBottle.connect(sigc::mem_fun(editWindow, &EditWindow::SetActiveBottle));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment