Commit c89d3bcc authored by Melroy van den Berg's avatar Melroy van den Berg

Improved busy dialog layout. Improved docs

parent b3426caa
Pipeline #1756 passed with stages
in 2 minutes and 29 seconds
......@@ -39,13 +39,16 @@ class BottleItem : public Gtk::ListBoxRow
{
public:
BottleItem();
// Copy constructor
/// Copy constructor
BottleItem(const BottleItem& bottleItem);
// Copy-&-swap
/// Copy-&-swap equal overloader method
BottleItem& operator=(BottleItem tempBottleItem) {
this->swap(*this, tempBottleItem);
return *this;
}
/// swap helper method
void swap(BottleItem& a, BottleItem& b) {
using std::swap;
swap(a._name, b._name);
......
......@@ -25,7 +25,7 @@
using std::string;
/**
* \class SettingsWindow
* \class BusyDialog
* \brief GTK+ Window class for the settings
*/
class BusyDialog : public Gtk::Dialog
......@@ -39,8 +39,9 @@ public:
void SetMessage(const Glib::ustring& message);
protected:
Gtk::Label message_label;
Gtk::ProgressBar loading_bar;
Gtk::Label heading_label; /*!< Heading label */
Gtk::Label message_label; /*!< Message box label */
Gtk::ProgressBar loading_bar; /*!< Loading bar */
private:
sigc::connection timer; /*!< Timer connection */
......
......@@ -67,7 +67,6 @@ public:
static bool FileExists(const string& filer_path);
static void InstallOrUpdateWinetricks();
static void SelfUpdateWinetricks();
static void ShowWinetricksGUI(const string prefix_path);
static void SetWindowsVersion(const string prefix_path, BottleTypes::Windows windows);
static void SetVirtualDesktop(const string prefix_path, string resolution);
static void DisableVirtualDesktop(const string prefix_path);
......@@ -83,7 +82,7 @@ private:
static void ExecTracing(const char* cmd, bool enableTracing);
static int CloseFile(std::FILE* file);
static bool WriteFile(const string& filename, const gchar* contents, const gsize length);
static bool ReadFile(const string& filename, char* contents);
static bool ReadFile(const string& filename, gchar* contents);
static string GetWinetricksVersion();
static string GetRegValue(const string& filename, const string& keyName, const string& valueName);
static string GetRegMetaData(const string& filename, const string& metaValueName);
......
......@@ -52,12 +52,12 @@ public:
sigc::signal<void> showSettingsWindow; /*!< show Settings window signal */
sigc::signal<void, Glib::ustring&, Glib::ustring&, bool&, BottleTypes::Windows, BottleTypes::Bit, BottleTypes::AudioDriver> newBottle; /*!< Create new Wine Bottle Signal */
sigc::signal<void, string, bool> runProgram; /*!< Run an EXE or MSI application in Wine with provided filename */
sigc::signal<void> openDriveC;
sigc::signal<void> rebootBottle;
sigc::signal<void> updateBottle;
sigc::signal<void> killRunningProcesses;
sigc::signal<void> openDriveC; /*!< Open C: drive signal */
sigc::signal<void> rebootBottle; /*!< Emulate reboot signal */
sigc::signal<void> updateBottle; /*!< Update Wine bottle signal */
sigc::signal<void> killRunningProcesses; /*!< Kill all running processes signal */
sigc::signal<bool, GdkEventButton*> rightClickMenu;
sigc::signal<bool, GdkEventButton*> rightClickMenu; /*!< Right-mouse click in list box signal */
explicit MainWindow(Menu& menu);
virtual ~MainWindow();
......@@ -113,8 +113,7 @@ protected:
Gtk::ToolButton kill_processes_button; /*!< Kill processes toolbar button */
// Busy dialog
BusyDialog busyDialog;
BusyDialog busyDialog; /*!< Busy dialog, when the user should wait until install is finished */
private:
NewBottleAssistant newBottleAssistant; /*!< New bottle wizard (behind: new button toolbar) */
......
......@@ -55,18 +55,18 @@ public:
void ResetActiveBottle();
protected:
// Child widgets
Gtk::Grid settings_grid;
Gtk::Grid settings_grid; /*!< The overall settings GTK grid */
Gtk::Toolbar first_toolbar;
Gtk::Toolbar second_toolbar;
Gtk::Toolbar third_toolbar;
Gtk::Toolbar fourth_toolbar;
Gtk::Toolbar first_toolbar; /*!< 1st row toolbar */
Gtk::Toolbar second_toolbar; /*!< 2nd row toolbar */
Gtk::Toolbar third_toolbar; /*!< 3rd row toolbar */
Gtk::Toolbar fourth_toolbar; /*!< 4th row toolbar */
Gtk::Label first_row_label;
Gtk::Label hint_label;
Gtk::Label second_row_label;
Gtk::Label third_row_label;
Gtk::Label fourth_row_label;
Gtk::Label first_row_label; /*!< 1st row label */
Gtk::Label hint_label; /*!< Extra hint label info for user */
Gtk::Label second_row_label; /*!< 2nd row label */
Gtk::Label third_row_label; /*!< 3rd row label */
Gtk::Label fourth_row_label; /*!< 4th row label */
// Buttons First row (Gaming)
Gtk::ToolButton install_d3dx9_button; /*!< d3dx9 install button */
......
......@@ -25,8 +25,7 @@
* \param parent Reference to parent GTK+ Window
*/
BusyDialog::BusyDialog(Gtk::Window& parent)
: Gtk::Dialog("Busy, please wait until finished..."),
message_label("Jaja"),
: Gtk::Dialog("Applying Changes"),
defaultParent(parent)
{
set_transient_for(parent);
......@@ -34,10 +33,18 @@ BusyDialog::BusyDialog(Gtk::Window& parent)
set_modal(true);
set_deletable(false);
Gtk::Box* box = get_vbox();
heading_label.set_markup("<big><b>Installing software</b></big>");
heading_label.set_alignment(0.0);
message_label.set_alignment(0.0);
loading_bar.set_pulse_step(0.3);
loading_bar.set_hexpand(true);
Gtk::Box* box = get_vbox();
box->set_margin_top(10);
box->set_margin_right(10);
box->set_margin_bottom(10);
box->set_margin_left(10);
box->pack_start(heading_label, false, false);
box->pack_start(message_label, true, false);
box->pack_start(loading_bar, true, false);
......@@ -58,6 +65,9 @@ void BusyDialog::SetMessage(const Glib::ustring& message)
this->message_label.set_text(message + " Please wait...");
}
/**
* \brief Show the busy dialog (override the show(), calls parent show())
*/
void BusyDialog::show()
{
if (!timer.empty() && timer.connected()) {
......@@ -71,6 +81,9 @@ void BusyDialog::show()
Gtk::Dialog::show();
}
/**
* \brief Close the busy dialog (override the close(), calls parent close())
*/
void BusyDialog::close()
{
// Reset default parent
......@@ -83,6 +96,9 @@ void BusyDialog::close()
Gtk::Dialog::close();
}
/**
* \brief Trigger the loading bar, until timer is disconnected
*/
bool BusyDialog::Pulsing()
{
loading_bar.pulse();
......
......@@ -94,10 +94,15 @@ static const struct
{BottleTypes::Windows::Windows20, "2.0", "0", ""}
};
// Meyers Singleton
/// Meyers Singleton
Helper::Helper()= default;
/// Destructor
Helper::~Helper()= default;
/**
* \brief Get singleton instance
* \return Helper reference (singleton)
*/
Helper& Helper::getInstance() {
static Helper instance;
return instance;
......@@ -331,7 +336,7 @@ void Helper::RemoveWineBottle(const string prefix_path)
/**
* \brief Get Wine Bottle Name from configuration file (if possible)
* \param[in] prefix_path The prefix directory path to the bottle prefix
* \param[in] prefix_path - Bottle prefix
* \return Bottle name
*/
string Helper::GetName(const string prefix_path)
......@@ -359,7 +364,7 @@ string Helper::GetName(const string prefix_path)
/**
* \brief Get current Windows OS version
* \param[in] prefix_path The prefix directory path to the bottle prefix
* \param[in] prefix_path - Bottle prefix
* \return Return the Windows OS version
*/
BottleTypes::Windows Helper::GetWindowsOSVersion(const string prefix_path)
......@@ -431,7 +436,7 @@ BottleTypes::Windows Helper::GetWindowsOSVersion(const string prefix_path)
/**
* \brief Get system processor bit (32/64). *Throw runtime_error* when not found.
* \param[in] prefix_path The prefix directory path to the bottle prefix
* \param[in] prefix_path - Bottle prefix
* \return 32-bit or 64-bit
*/
BottleTypes::Bit Helper::GetSystemBit(const string prefix_path)
......@@ -459,7 +464,7 @@ BottleTypes::Bit Helper::GetSystemBit(const string prefix_path)
/**
* \brief Get Audio driver
* \param[in] prefix_path The prefix directory path to the bottle prefix
* \param[in] prefix_path - Bottle prefix
* \return Audio Driver (eg. alsa/coreaudio/oss/pulse)
*/
BottleTypes::AudioDriver Helper::GetAudioDriver(const string prefix_path)
......@@ -491,7 +496,7 @@ BottleTypes::AudioDriver Helper::GetAudioDriver(const string prefix_path)
/**
* \brief Get emulation resolution
* \param[in] prefix_path The prefix directory path to the bottle prefix
* \param[in] prefix_path - Bottle prefix
* \return Return the virtual desktop resolution or 'disabled' when disabled fully.
*/
string Helper::GetVirtualDesktop(const string prefix_path)
......@@ -518,7 +523,7 @@ string Helper::GetVirtualDesktop(const string prefix_path)
/**
* \brief Get the date/time of the last time the Wine Inf file was updated
* \param[in] prefix_path The prefix directory path to the bottle prefix
* \param[in] prefix_path - Bottle prefix
* \return Date/time of last update
*/
string Helper::GetLastWineUpdated(const string prefix_path)
......@@ -546,8 +551,8 @@ string Helper::GetLastWineUpdated(const string prefix_path)
/**
* \brief Get Bottle Status (is Bottle ready or not)
* \param[in] prefix_path The prefix directory path to the bottle prefix
* TODO: Maybe do not make this call blocking but async
* \param[in] prefix_path - Bottle prefix
* TODO: Maybe do not make this call blocking but async, using a thread & dispatcher signal
* \return True if everything is OK, otherwise false
*/
bool Helper::GetBottleStatus(const string prefix_path)
......@@ -575,7 +580,7 @@ bool Helper::GetBottleStatus(const string prefix_path)
/**
* \brief Get C:\ Drive location
* \param[in] prefix_path The prefix directory path to the bottle prefix
* \param[in] prefix_path - Bottle prefix
* \return Location of C:\ location under unix
*/
string Helper::GetCLetterDrive(const string prefix_path)
......@@ -672,6 +677,8 @@ void Helper::SelfUpdateWinetricks()
/**
* \brief Set Windows OS version by using Winetricks
* \param[in] prefix_path - Bottle prefix
* \param[in] windows - Windows version (enum)
*/
void Helper::SetWindowsVersion(const string prefix_path, BottleTypes::Windows windows)
{
......@@ -692,6 +699,8 @@ void Helper::SetWindowsVersion(const string prefix_path, BottleTypes::Windows wi
/**
* \brief Set custom virtual desktop resolution by using Winetricks
* \param[in] prefix_path - Bottle prefix
* \param[in] resolution - New screen resolution (eg. 1920x1080)
*/
void Helper::SetVirtualDesktop(const string prefix_path, string resolution)
{
......@@ -738,6 +747,7 @@ void Helper::SetVirtualDesktop(const string prefix_path, string resolution)
/**
* \brief Disable Virtual Desktop fully by using Winetricks
* \param[in] prefix_path - Bottle prefix
*/
void Helper::DisableVirtualDesktop(const string prefix_path)
{
......@@ -758,6 +768,7 @@ void Helper::DisableVirtualDesktop(const string prefix_path)
/**
* \brief Set Audio Driver by using Winetricks
* \param[in] prefix_path - Bottle prefix
* \param[in] audio_driver - Audio driver to be set
*/
void Helper::SetAudioDriver(const string prefix_path, BottleTypes::AudioDriver audio_driver)
......@@ -780,6 +791,7 @@ void Helper::SetAudioDriver(const string prefix_path, BottleTypes::AudioDriver a
/**
* \brief Get the Wine Mono GUID
* \param[in] prefix_path - Bottle prefix
* \param[in] application_name - Application name to search for
* \return GUID
*/
......
......@@ -191,7 +191,7 @@ bool MainWindow::ShowConfirmDialog(const Glib::ustring& message)
/**
* \brief Show busy indicator (like busy installing corefonts in Wine bottle)
* \param[in] message - Given the user more information what is going on
* \param[in] message Given the user more information what is going on
*/
void MainWindow::ShowBusyDialog(const Glib::ustring& message)
{
......@@ -201,7 +201,8 @@ void MainWindow::ShowBusyDialog(const Glib::ustring& message)
/**
* \brief Show busy indicator, with another parent
* \param[in] message - Given the user more information what is going on
* \param[in] parent Parent GTK Window (set to be the GTK transient for)
* \param[in] message Given the user more information what is going on
*/
void MainWindow::ShowBusyDialog(Gtk::Window& parent, const Glib::ustring& message)
{
......
......@@ -190,15 +190,15 @@ void NewBottleAssistant::createThirdPage()
}
/**
* \brief Retrieve the results (after the wizard is finished)
* And reset the values to default values again
* \brief Retrieve the results (after the wizard is finished).
* And reset the values to default values again.
* Idea: use one struct as in/out parameter
* \param[in/out] name - Bottle Name
* \param[in/out] virtual_desktop_resolution - Virtual desktop resolution (empty if disabled)
* \param[in/out] disable_gecko_mono - Enable/Disable Gecko/Mono during install
* \param[in/out] windows_version - Windows OS version
* \param[in/out] bit - Windows Bit (32/64-bit)
* \param[in/out] audio - Audio Driver type
* \param[inout] name Bottle Name
* \param[inout] virtual_desktop_resolution Virtual desktop resolution (empty if disabled)
* \param[inout] disable_gecko_mono Enable/Disable Gecko/Mono during install
* \param[inout] windows_version Windows OS version
* \param[inout] bit Windows Bit (32/64-bit)
* \param[inout] audio Audio Driver type
*/
void NewBottleAssistant::GetResult(
Glib::ustring& name,
......
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