From 0ca9971460c64a0f8f91643ab32a44556af9a9be Mon Sep 17 00:00:00 2001 From: Alexander Shaduri Date: Sat, 16 Apr 2011 19:25:06 +0000 Subject: [PATCH] Some more UI tweaks. A new "Add Device" dialog - allows specifying type and additional smartctl parameters. Drive properties in preferences - allow specifying device type. --- gsmartcontrol/TODO | 2 - gsmartcontrol/configure.ac | 1 + gsmartcontrol/src/Makefile.am | 4 +- gsmartcontrol/src/applib/storage_settings.h | 16 +- gsmartcontrol/src/gsc_add_device_window.cpp | 173 +++++++++++++++ gsmartcontrol/src/gsc_add_device_window.h | 81 +++++++ gsmartcontrol/src/gsc_main_window.cpp | 70 +----- gsmartcontrol/src/gsc_preferences_window.cpp | 81 +++++-- gsmartcontrol/src/gsc_preferences_window.h | 4 +- gsmartcontrol/src/res/Makefile.am | 2 +- .../src/res/gsc_add_device_window.glade | 170 +++++++++++++++ .../src/res/gsc_preferences_window.glade | 201 +++++++++--------- gsmartcontrol/src/res/gsc_text_window.glade | 20 +- 13 files changed, 619 insertions(+), 206 deletions(-) create mode 100644 gsmartcontrol/src/gsc_add_device_window.cpp create mode 100644 gsmartcontrol/src/gsc_add_device_window.h create mode 100644 gsmartcontrol/src/res/gsc_add_device_window.glade diff --git a/gsmartcontrol/TODO b/gsmartcontrol/TODO index 33f708e..aa5d008 100644 --- a/gsmartcontrol/TODO +++ b/gsmartcontrol/TODO @@ -68,8 +68,6 @@ When adding device via GUI, have an option to specify "-d" type and other parame Rework drive properties UI: - add properties for each multi-drive (with type in a separate entry). - smartctl options use 48-bit or not or auto. Enable/disable/dont_touch SMART on startup for this drive. Enable/disable/dont_touch AODC on startup for this drive. diff --git a/gsmartcontrol/configure.ac b/gsmartcontrol/configure.ac index e2d8809..5e9c686 100644 --- a/gsmartcontrol/configure.ac +++ b/gsmartcontrol/configure.ac @@ -347,6 +347,7 @@ AC_SUBST(WINDOWS_ARCH) RES_FILES="src/res/gsc_about_dialog.glade \ + src/res/gsc_add_device_window.glade \ src/res/gsc_executor_log_window.glade \ src/res/gsc_help_window.glade \ src/res/gsc_info_window.glade \ diff --git a/gsmartcontrol/src/Makefile.am b/gsmartcontrol/src/Makefile.am index d622902..5db5c6d 100644 --- a/gsmartcontrol/src/Makefile.am +++ b/gsmartcontrol/src/Makefile.am @@ -30,10 +30,10 @@ gsmartcontrol_LDADD = $(top_builddir)/src/applib/libapplib.a \ $(top_builddir)/src/pcrecpp/libpcrecpp.a $(top_builddir)/src/libdebug/libdebug.a \ $(top_builddir)/src/res/libres.a $(WINRES_OBJ) -noinst_HEADERS = global_macros.h gsc_about_dialog.h gsc_executor_error_dialog.h \ +noinst_HEADERS = global_macros.h gsc_about_dialog.h gsc_add_device_window.h gsc_executor_error_dialog.h \ gsc_executor_log_window.h gsc_help_window.h gsc_info_window.h gsc_init.h gsc_main_window.h \ gsc_main_window_iconview.h gsc_preferences_window.h gsc_settings.h gsc_text_window.h -gsmartcontrol_SOURCES = $(WIN_MAIN_SRC) gsc_about_dialog.cpp \ +gsmartcontrol_SOURCES = $(WIN_MAIN_SRC) gsc_about_dialog.cpp gsc_add_device_window.cpp \ gsc_executor_error_dialog.cpp gsc_executor_log_window.cpp gsc_help_window.cpp gsc_info_window.cpp \ gsc_init.cpp gsc_main.cpp gsc_main_window.cpp gsc_preferences_window.cpp diff --git a/gsmartcontrol/src/applib/storage_settings.h b/gsmartcontrol/src/applib/storage_settings.h index 0859911..f62f0e5 100644 --- a/gsmartcontrol/src/applib/storage_settings.h +++ b/gsmartcontrol/src/applib/storage_settings.h @@ -27,16 +27,22 @@ inline device_option_map_t app_unserialize_device_option_map(const std::string& hz::Bin2AsciiEncoder enc; std::vector pairs; - hz::string_split(str, ';', pairs, true); + hz::string_split(str, ";", pairs, true); device_option_map_t option_map; for (std::vector::const_iterator iter = pairs.begin(); iter != pairs.end(); ++iter) { std::vector dev_entry; - hz::string_split(*iter, ':', dev_entry, true); + hz::string_split(*iter, ":", dev_entry, true, 2); + std::string dev, opt; if (dev_entry.size() == 2) { - std::string dev = hz::string_trim_copy(enc.decode(dev_entry[0])); - std::string opt = hz::string_trim_copy(enc.decode(dev_entry[1])); + dev = dev_entry.at(0); // includes type (separated by encoded "::") + opt = dev_entry.at(1); + } + + if (dev != "") { + dev = hz::string_trim_copy(enc.decode(dev)); + opt = hz::string_trim_copy(enc.decode(opt)); // ignore potentially harmful chars if (!dev.empty() && !opt.empty() @@ -62,7 +68,7 @@ inline std::string app_serialize_device_option_map(const device_option_map_t& op pairs.push_back(enc.encode(iter->first) + ":" + enc.encode(iter->second)); } - return hz::string_join(pairs, ';'); + return hz::string_join(pairs, ";"); } diff --git a/gsmartcontrol/src/gsc_add_device_window.cpp b/gsmartcontrol/src/gsc_add_device_window.cpp new file mode 100644 index 0000000..4a0c880 --- /dev/null +++ b/gsmartcontrol/src/gsc_add_device_window.cpp @@ -0,0 +1,173 @@ +/************************************************************************** + Copyright: + (C) 2011 Alexander Shaduri + License: See LICENSE_gsmartcontrol.txt +***************************************************************************/ + +#include +#include +#include +#include +#include // GDK_Escape + +#include "hz/fs_path.h" +#include "hz/string_sprintf.h" +#include "applib/app_gtkmm_utils.h" + +#include "gsc_add_device_window.h" +#include "gsc_main_window.h" + + + + +GscAddDeviceWindow::GscAddDeviceWindow(BaseObjectType* gtkcobj, const app_ui_res_ref_t& ref_ui) + : AppUIResWidget(gtkcobj, ref_ui), main_window_(0) +{ + // Connect callbacks + + APP_GTKMM_CONNECT_VIRTUAL(delete_event); // make sure the event handler is called + + Gtk::Button* window_cancel_button = 0; + APP_UI_RES_AUTO_CONNECT(window_cancel_button, clicked); + + Gtk::Button* window_ok_button = 0; + APP_UI_RES_AUTO_CONNECT(window_ok_button, clicked); + + Gtk::Button* device_name_browse_button = 0; + APP_UI_RES_AUTO_CONNECT(device_name_browse_button, clicked); + + + Glib::ustring device_name_tooltip = "Device name, e.g. %s."; +#ifdef _WIN32 + device_name_tooltip = hz::string_sprintf(device_name_tooltip.c_str(), "\"pd0\" for the first physical drive"); +#else + device_name_tooltip = hz::string_sprintf(device_name_tooltip.c_str(), "\"/dev/sda\" or \"/dev/twa0\""); +#endif + Gtk::Label* device_name_label = lookup_widget("device_name_label"); + app_gtkmm_set_widget_tooltip(*device_name_label, device_name_tooltip); + + + Gtk::Entry* device_name_entry = 0; + APP_UI_RES_AUTO_CONNECT(device_name_entry, changed); + + + // Accelerators + + Glib::RefPtr accel_group = this->get_accel_group(); + if (window_cancel_button) { + window_cancel_button->add_accelerator("clicked", accel_group, GDK_Escape, + Gdk::ModifierType(0), Gtk::AccelFlags(0)); + } + + +#ifndef _WIN32 + // "Browse" doesn't make sense in win32, hide it. + if (device_name_browse_button) { + device_name_browse_button->hide(); + } +#endif + + + // initial state of OK button + on_device_name_entry_changed(); + + // show(); +} + + + +void GscAddDeviceWindow::set_main_window(GscMainWindow* main_window) +{ + main_window_ = main_window; +} + + + +void GscAddDeviceWindow::on_window_cancel_button_clicked() +{ + destroy(this); +} + + + +void GscAddDeviceWindow::on_window_ok_button_clicked() +{ + std::string dev, type, params; + if (Gtk::Entry* entry = lookup_widget("device_name_entry")) { + dev = entry->get_text(); + } + if (Gtk::Entry* entry = lookup_widget("device_type_entry")) { + type = entry->get_text(); + } + if (Gtk::Entry* entry = lookup_widget("smartctl_params_entry")) { + params = entry->get_text(); + } + if (main_window_ && !dev.empty()) { + main_window_->add_device(dev, type, params); + } + + destroy(this); +} + + + +void GscAddDeviceWindow::on_device_name_browse_button_clicked() +{ + std::string default_file; + + Gtk::Entry* entry = this->lookup_widget("device_name_entry"); + if (!entry) + return; + + Gtk::FileChooserDialog dialog(*this, "Choose Device...", + Gtk::FILE_CHOOSER_ACTION_OPEN); + + // Add response buttons the the dialog + dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); + dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_ACCEPT); + + // Note: This works on absolute paths only (otherwise it's gtk warning). + hz::FsPath p(entry->get_text()); + if (p.is_absolute()) + dialog.set_filename(p.str()); // change to its dir and select it if exists. + + // Show the dialog and wait for a user response + int result = dialog.run(); // the main cycle blocks here + + // Handle the response + switch (result) { + case Gtk::RESPONSE_ACCEPT: + { + entry->set_text(std::string(dialog.get_filename())); + break; + } + + case Gtk::RESPONSE_CANCEL: case Gtk::RESPONSE_DELETE_EVENT: + // nothing, the dialog is closed already + break; + + default: + debug_out_error("app", DBG_FUNC_MSG << "Unknown dialog response code: " << result << ".\n"); + break; + } + +} + + + +void GscAddDeviceWindow::on_device_name_entry_changed() +{ + // Allow OK only if name is not empty + Gtk::Entry* entry = lookup_widget("device_name_entry"); + Gtk::Button* ok_button = lookup_widget("window_ok_button"); + if (entry && ok_button) { + ok_button->set_sensitive(!entry->get_text().empty()); + } +} + + + + + + + diff --git a/gsmartcontrol/src/gsc_add_device_window.h b/gsmartcontrol/src/gsc_add_device_window.h new file mode 100644 index 0000000..5fa828b --- /dev/null +++ b/gsmartcontrol/src/gsc_add_device_window.h @@ -0,0 +1,81 @@ +/************************************************************************** + Copyright: + (C) 2011 Alexander Shaduri + License: See LICENSE_gsmartcontrol.txt +***************************************************************************/ + +#ifndef GSC_ADD_DEVICE_WINDOW_H +#define GSC_ADD_DEVICE_WINDOW_H + +#include + +#include "applib/app_ui_res_utils.h" + + + +class GscMainWindow; + + +/// The "Add Device" window. +/// Use create() / destroy() with this class instead of new / delete! +class GscAddDeviceWindow : public AppUIResWidget { + + public: + + // name of glade/ui file without a .glade/.ui extension and quotes + APP_UI_RES_DATA_INIT(gsc_add_device_window); + + + /// glade/gtkbuilder needs this constructor + GscAddDeviceWindow(BaseObjectType* gtkcobj, const app_ui_res_ref_t& ref_ui); + + /// Compiler requirement + virtual ~GscAddDeviceWindow() + { } + + + /// On OK button click main_window->add_device() will be called. + void set_main_window(GscMainWindow* main_window); + + + protected: + + + // ---------- override virtual methods + + /// Destroy this object on delete event (by default it calls hide()). + bool on_delete_event_before(GdkEventAny* e) + { + destroy(this); // deletes this object and nullifies instance + return true; // event handled, don't call default virtual handler + } + + + // ---------- other callbacks + + /// Button click callback + void on_window_cancel_button_clicked(); + + /// Button click callback + void on_window_ok_button_clicked(); + + /// Button click callback + void on_device_name_browse_button_clicked(); + + /// Entry text change callback + void on_device_name_entry_changed(); + + + private: + + GscMainWindow* main_window_; ///< The main window that created us + + +}; + + + + + + +#endif diff --git a/gsmartcontrol/src/gsc_main_window.cpp b/gsmartcontrol/src/gsc_main_window.cpp index 64af132..d205e82 100644 --- a/gsmartcontrol/src/gsc_main_window.cpp +++ b/gsmartcontrol/src/gsc_main_window.cpp @@ -31,6 +31,7 @@ #include "gsc_main_window_iconview.h" #include "gsc_main_window.h" +#include "gsc_add_device_window.h" @@ -1195,71 +1196,10 @@ GscInfoWindow* GscMainWindow::show_device_info_window(StorageDeviceRefPtr drive) void GscMainWindow::show_add_device_chooser() { -#ifdef _WIN32 - - // A simple text entry dialog, since there are no device files on win32. - - static std::string last_str; - if (last_str.empty()) - last_str = "pd0"; - - std::string dev; - if (gui_show_text_entry_dialog("Add Device", "Enter a device name", - "For example, pd0 means the first physical drive", - dev, last_str, this, false)) { - last_str = dev; // safe for the future - std::string type_arg = ""; /// TODO - std::string extra_args = ""; /// TODO - // both the GUI and the API is in utf-8, no conversion is necessary. - this->add_device(dev, type_arg, extra_args); - } - - -#else // non-win32: - - // Show a file chooser - - static std::string last_dir; - if (last_dir.empty()) - last_dir = "/dev"; - - Gtk::FileChooserDialog dialog(*this, "Choose Device File...", - Gtk::FILE_CHOOSER_ACTION_OPEN); - - // Add response buttons the the dialog - dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_ACCEPT); - - if (!last_dir.empty()) - dialog.set_current_folder(last_dir); - - // Show the dialog and wait for a user response - int result = dialog.run(); // the main cycle blocks here - - // Handle the response - switch (result) { - case Gtk::RESPONSE_ACCEPT: - { - last_dir = dialog.get_current_folder(); // safe for the future - - std::string file = dialog.get_filename(); // in fs encoding - std::string type_arg = ""; /// TODO - std::string extra_args = ""; /// TODO - this->add_device(file, type_arg, extra_args); - break; - } - - case Gtk::RESPONSE_CANCEL: case Gtk::RESPONSE_DELETE_EVENT: - // nothing, the dialog is closed already - break; - - default: - debug_out_error("app", DBG_FUNC_MSG << "Unknown dialog response code: " << result << ".\n"); - break; - } - -#endif // non-win32 - + GscAddDeviceWindow* window = GscAddDeviceWindow::create(); + window->set_main_window(this); + window->set_transient_for(*this); + window->show(); } diff --git a/gsmartcontrol/src/gsc_preferences_window.cpp b/gsmartcontrol/src/gsc_preferences_window.cpp index 7e77133..f3b0d3a 100644 --- a/gsmartcontrol/src/gsc_preferences_window.cpp +++ b/gsmartcontrol/src/gsc_preferences_window.cpp @@ -38,16 +38,20 @@ class GscPreferencesDeviceOptionsTreeView : public Gtk::TreeView { { Gtk::TreeModelColumnRecord model_columns; - // Device, [Parameters], [Device Real]. + // Device, Type, [Parameters], [Device Real], [Type Real]. // Device may hold "", while Device Real is "". + // Type may hold "", while Type Real is "". model_columns.add(col_device); this->append_column("Device", col_device); this->set_search_column(col_device.index()); - model_columns.add(col_parameters); + model_columns.add(col_type); + this->append_column("Type", col_type); + model_columns.add(col_parameters); model_columns.add(col_device_real); + model_columns.add(col_type_real); // create a TreeModel (ListStore) @@ -78,12 +82,14 @@ class GscPreferencesDeviceOptionsTreeView : public Gtk::TreeView { } - void add_new_row(const std::string& device, const std::string& params, bool select = true) + void add_new_row(const std::string& device, const std::string& type, const std::string& params, bool select = true) { Gtk::TreeRow row = *(model->append()); row[col_device] = (device.empty() ? "" : device); + row[col_type] = (type.empty() ? "" : type); row[col_parameters] = params; row[col_device_real] = device; + row[col_type_real] = type; if (select) this->get_selection()->select(row); @@ -100,6 +106,16 @@ class GscPreferencesDeviceOptionsTreeView : public Gtk::TreeView { } + void update_selected_row_type(const std::string& type) + { + if (this->get_selection()->count_selected_rows()) { + Gtk::TreeRow row = *(this->get_selection()->get_selected()); + row[col_type] = (type.empty() ? "" : type); + row[col_type_real] = type; + } + } + + void update_selected_row_params(const std::string& params) { if (this->get_selection()->count_selected_rows()) { @@ -125,7 +141,12 @@ class GscPreferencesDeviceOptionsTreeView : public Gtk::TreeView { { clear_all(); for (device_option_map_t::const_iterator iter = devmap.begin(); iter != devmap.end(); ++iter) { - this->add_new_row(iter->first, iter->second, false); + std::vector parts; + hz::string_split(iter->first, "::", parts, 2); + std::string dev = (parts.size() > 0 ? parts.at(0) : ""); + std::string type = (parts.size() > 1 ? parts.at(1) : ""); + std::string params = iter->second; + this->add_new_row(dev, type, params, false); } } @@ -137,8 +158,16 @@ class GscPreferencesDeviceOptionsTreeView : public Gtk::TreeView { Gtk::TreeNodeChildren children = model->children(); for (Gtk::TreeNodeChildren::iterator iter = children.begin(); iter != children.end(); ++iter) { Gtk::TreeModel::Row row = *iter; - if (!row.get_value(col_device_real).empty() && devmap.find(row.get_value(col_device_real)) == devmap.end()) - devmap[row.get_value(col_device_real)] = row.get_value(col_parameters); + std::string dev = row.get_value(col_device_real); + if (!dev.empty()) { + std::string par = row.get_value(col_type_real); + if (!par.empty()) { + dev += "::" + par; + } + if (devmap.find(dev) == devmap.end()) { + devmap[dev] = row.get_value(col_parameters); + } + } } return devmap; @@ -149,10 +178,11 @@ class GscPreferencesDeviceOptionsTreeView : public Gtk::TreeView { // callback void on_selection_changed() { - std::string dev, par; + std::string dev, type, par; if (this->get_selection()->count_selected_rows()) { Gtk::TreeRow row = *(this->get_selection()->get_selected()); dev = row[col_device_real]; + type = row[col_type_real]; par = row[col_parameters]; preferences_window->device_widget_set_remove_possible(true); @@ -160,7 +190,7 @@ class GscPreferencesDeviceOptionsTreeView : public Gtk::TreeView { preferences_window->device_widget_set_remove_possible(false); } - preferences_window->update_device_widgets(dev, par); + preferences_window->update_device_widgets(dev, type, par); } @@ -168,8 +198,10 @@ class GscPreferencesDeviceOptionsTreeView : public Gtk::TreeView { Glib::RefPtr model; Gtk::TreeModelColumn col_device; + Gtk::TreeModelColumn col_type; Gtk::TreeModelColumn col_parameters; Gtk::TreeModelColumn col_device_real; + Gtk::TreeModelColumn col_type_real; GscPreferencesWindow* preferences_window; @@ -210,15 +242,17 @@ GscPreferencesWindow::GscPreferencesWindow(BaseObjectType* gtkcobj, const app_ui Gtk::Entry* device_options_device_entry = 0; APP_UI_RES_AUTO_CONNECT(device_options_device_entry, changed); - Glib::ustring device_options_tooltip = "Format: ::, where \"::\" part is optional. " - " An example of device name would be %s. Type is an argument of smartctl -d option and can be " - " used to specify a drive behind a RAID device, e.g. /dev/twa0::3ware,2"; + Glib::ustring device_options_tooltip = "Device name, e.g. %s."; #ifdef _WIN32 device_options_tooltip = hz::string_sprintf(device_options_tooltip.c_str(), "\"pd0\" for the first physical drive"); #else device_options_tooltip = hz::string_sprintf(device_options_tooltip.c_str(), "\"/dev/sda\""); #endif - app_gtkmm_set_widget_tooltip(*device_options_device_entry, device_options_tooltip); + Gtk::Label* device_options_device_label = lookup_widget("device_options_device_label"); + app_gtkmm_set_widget_tooltip(*device_options_device_label, device_options_tooltip); + + Gtk::Entry* device_options_type_entry = 0; + APP_UI_RES_AUTO_CONNECT(device_options_type_entry, changed); Gtk::Entry* device_options_parameter_entry = 0; APP_UI_RES_AUTO_CONNECT(device_options_parameter_entry, changed); @@ -258,13 +292,16 @@ GscPreferencesWindow::GscPreferencesWindow(BaseObjectType* gtkcobj, const app_ui -void GscPreferencesWindow::update_device_widgets(const std::string& device, const std::string& params) +void GscPreferencesWindow::update_device_widgets(const std::string& device, const std::string& type, const std::string& params) { Gtk::Entry* entry = 0; if ((entry = this->lookup_widget("device_options_device_entry"))) entry->set_text(device); + if ((entry = this->lookup_widget("device_options_type_entry"))) + entry->set_text(type); + if ((entry = this->lookup_widget("device_options_parameter_entry"))) entry->set_text(params); } @@ -480,18 +517,21 @@ void GscPreferencesWindow::on_device_options_remove_device_button_clicked() void GscPreferencesWindow::on_device_options_add_device_button_clicked() { Gtk::Entry* entry = 0; - std::string dev, par; + std::string dev, type, par; if ((entry = this->lookup_widget("device_options_device_entry"))) dev = entry->get_text(); + if ((entry = this->lookup_widget("device_options_type_entry"))) + type = entry->get_text(); + if ((entry = this->lookup_widget("device_options_parameter_entry"))) par = entry->get_text(); if (device_options_treeview->has_selected_row()) { - device_options_treeview->add_new_row("", ""); // without this it would clone the existing. + device_options_treeview->add_new_row("", "", ""); // without this it would clone the existing. } else { - device_options_treeview->add_new_row(dev, par); + device_options_treeview->add_new_row(dev, type, par); } } @@ -506,6 +546,15 @@ void GscPreferencesWindow::on_device_options_device_entry_changed() +void GscPreferencesWindow::on_device_options_type_entry_changed() +{ + Gtk::Entry* entry = 0; + if ((entry = this->lookup_widget("device_options_type_entry"))) + device_options_treeview->update_selected_row_type(entry->get_text()); +} + + + void GscPreferencesWindow::on_device_options_parameter_entry_changed() { Gtk::Entry* entry = 0; diff --git a/gsmartcontrol/src/gsc_preferences_window.h b/gsmartcontrol/src/gsc_preferences_window.h index 3437451..e92d214 100644 --- a/gsmartcontrol/src/gsc_preferences_window.h +++ b/gsmartcontrol/src/gsc_preferences_window.h @@ -35,7 +35,7 @@ class GscPreferencesWindow : public AppUIResWidget { { } - void update_device_widgets(const std::string& device, const std::string& params); + void update_device_widgets(const std::string& device, const std::string& type, const std::string& params); void device_widget_set_remove_possible(bool b); @@ -90,6 +90,8 @@ class GscPreferencesWindow : public AppUIResWidget { void on_device_options_device_entry_changed(); + void on_device_options_type_entry_changed(); + void on_device_options_parameter_entry_changed(); diff --git a/gsmartcontrol/src/res/Makefile.am b/gsmartcontrol/src/res/Makefile.am index f636647..5feb133 100644 --- a/gsmartcontrol/src/res/Makefile.am +++ b/gsmartcontrol/src/res/Makefile.am @@ -16,7 +16,7 @@ libres_a_SOURCES = # List _all_ sources that may be compiled. This is basically the same list as # in configure.ac, but with .cpp extensions and without paths. EXTRA_libres_a_SOURCES = gsc_about_dialog.glade.cpp gsc_about_dialog.ui.cpp \ - gsc_executor_log_window.glade.cpp gsc_executor_log_window.ui.cpp \ + gsc_add_device_window.glade.cpp gsc_add_drive_window.ui.cpp \ gsc_executor_log_window.glade.cpp gsc_executor_log_window.ui.cpp \ gsc_help_window.glade.cpp gsc_help_window.ui.cpp \ gsc_info_window.glade.cpp gsc_info_window.ui.cpp \ diff --git a/gsmartcontrol/src/res/gsc_add_device_window.glade b/gsmartcontrol/src/res/gsc_add_device_window.glade new file mode 100644 index 0000000..8710050 --- /dev/null +++ b/gsmartcontrol/src/res/gsc_add_device_window.glade @@ -0,0 +1,170 @@ + + + + + Add Device - GSmartControl + True + + + True + 12 + GTK_ORIENTATION_VERTICAL + 12 + GTK_ORIENTATION_VERTICAL + + + True + 3 + 2 + 12 + 6 + + + True + Device name, e.g. /dev/sda or /dev/twa0 + 0 + Device _name: + True + + + GTK_FILL + + + + + True + 6 + + + True + True + True + ● + + + + + True + True + True + _Browse... + True + 0 + + + False + 1 + + + + + 1 + 2 + + + + + True + Smartctl -d option, e.g. 3ware,2 for a third drive behind a 3ware RAID controller + Smartctl -d option, e.g. 3ware,2 for a third drive behind a 3ware RAID controller + 0 + Device _type: + True + + + 1 + 2 + GTK_FILL + + + + + True + Additional smartctl parameters + 0 + Smartctl parameters: + + + 2 + 3 + GTK_FILL + + + + + True + True + ● + + + 1 + 2 + 1 + 2 + + + + + True + True + ● + + + 1 + 2 + 2 + 3 + + + + + False + + + + + True + 6 + GTK_BUTTONBOX_END + + + True + True + True + gtk-cancel + True + 0 + + + False + False + + + + + True + True + True + True + True + gtk-ok + True + 0 + + + False + False + 1 + + + + + False + GTK_PACK_END + 1 + + + + + + diff --git a/gsmartcontrol/src/res/gsc_preferences_window.glade b/gsmartcontrol/src/res/gsc_preferences_window.glade index e34f579..0d8731e 100644 --- a/gsmartcontrol/src/res/gsc_preferences_window.glade +++ b/gsmartcontrol/src/res/gsc_preferences_window.glade @@ -123,47 +123,6 @@ 2 12 6 - - - True - A path to smartctl binary. If the path is not absolute, the binary will be looked for in user's $PATH. - A path to smartctl binary. If the path is not absolute, the binary will be looked for in user's $PATH. - 1 - S_martctl binary: - True - - - GTK_FILL - - - - - True - Global parameters for smartctl. These parameters will be used every time the progam invokes smartctl. - Global parameters for smartctl. These parameters will be used every time the progam invokes smartctl. - Smartctl parameters: - True - - - 1 - 2 - GTK_FILL - - - - - True - True - Global parameters for smartctl. These parameters will be used every time the progam invokes smartctl. Must be shell-escaped. - Global parameters for smartctl. These parameters will be used every time the progam invokes smartctl. Must be shell-escaped. - - - 1 - 2 - 1 - 2 - - True @@ -195,6 +154,47 @@ 2 + + + True + True + Global parameters for smartctl. These parameters will be used every time the progam invokes smartctl. Must be shell-escaped. + Global parameters for smartctl. These parameters will be used every time the progam invokes smartctl. Must be shell-escaped. + + + 1 + 2 + 1 + 2 + + + + + True + Global parameters for smartctl. These parameters will be used every time the progam invokes smartctl. + Global parameters for smartctl. These parameters will be used every time the progam invokes smartctl. + Smartctl parameters: + True + + + 1 + 2 + GTK_FILL + + + + + True + A path to smartctl binary. If the path is not absolute, the binary will be looked for in user's $PATH. + A path to smartctl binary. If the path is not absolute, the binary will be looked for in user's $PATH. + 1 + S_martctl binary: + True + + + GTK_FILL + + 1 @@ -341,8 +341,7 @@ True True Device list - False - True + False @@ -397,68 +396,15 @@ 12 6 - - True - 0 - <b>Drive Properties:</b> - True - - - 2 - - - - - True - Device name (for example, "/dev/sda") - Device name (for example, "/dev/sda") - 1 - De_vice: - True - - - 1 - 2 - - - - - True - Smartctl parameters for this device. For example, to use older smartctl versions with libata devices, use "-d ata". - Smartctl parameters for this device. For example, to use older smartctl versions with libata devices, use "-d ata". - 1 - _Type: - True - - - 2 - 3 - - - - + True True 1 2 - 1 - 2 - - - - - True - True - Smartctl parameters for this device. For example, to use older smartctl versions with libata devices, use "-d ata". Must be shell-escaped. - Smartctl parameters for this device. For example, to use older smartctl versions with libata devices, use "-d ata". Must be shell-escaped. - - - 1 - 2 - 2 - 3 + 3 + 4 @@ -476,17 +422,64 @@ - + True True - Smartctl parameters for this device. For example, to use older smartctl versions with libata devices, use "-d ata". Must be shell-escaped. - Smartctl parameters for this device. For example, to use older smartctl versions with libata devices, use "-d ata". Must be shell-escaped. 1 2 - 3 - 4 + 2 + 3 + + + + + True + True + + + 1 + 2 + 1 + 2 + + + + + True + Match only this type of device (as specified to -d smartctl parameter). Leave empty for all types. This can be used to specify a drive behind a RAID device, e.g. 3ware,2. + Match only this type of device (as specified to -d smartctl parameter). Leave empty for all types. This can be used to specify a drive behind a RAID device, e.g. 3ware,2. + 1 + _Type: + True + + + 2 + 3 + + + + + True + 1 + De_vice: + True + + + 1 + 2 + + + + + True + 0 + <b>Drive Properties:</b> + True + + + 2 diff --git a/gsmartcontrol/src/res/gsc_text_window.glade b/gsmartcontrol/src/res/gsc_text_window.glade index 7de901e..2525034 100644 --- a/gsmartcontrol/src/res/gsc_text_window.glade +++ b/gsmartcontrol/src/res/gsc_text_window.glade @@ -43,8 +43,16 @@ 6 True - + True + True + True + Saved displayed text as... + Saved displayed text as... + gtk-save-as + True + 0 + @@ -56,16 +64,8 @@ - + True - True - True - Saved displayed text as... - Saved displayed text as... - gtk-save-as - True - 0 - 2