"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Win_GParted.cc" between
gparted-1.3.0.tar.gz and gparted-1.3.1.tar.gz

About: GParted is a graphical partition editor for creating, reorganizing, and deleting disk partitions (using GNU libparted).

Win_GParted.cc  (gparted-1.3.0):Win_GParted.cc  (gparted-1.3.1)
skipping to change at line 1777 skipping to change at line 1777
Glib::ustring msg = _("The file system can not be resized while it is mou nted read-only."); Glib::ustring msg = _("The file system can not be resized while it is mou nted read-only.");
msg += "\n"; msg += "\n";
msg += _("Either unmount the file system or remount it read-write."); msg += _("Either unmount the file system or remount it read-write.");
dialog.set_secondary_text( msg ); dialog.set_secondary_text( msg );
dialog.run(); dialog.run();
} }
void Win_GParted::show_help(const Glib::ustring & filename /* E.g., "gparted" */ , void Win_GParted::show_help(const Glib::ustring & filename /* E.g., "gparted" */ ,
const Glib::ustring & link_id /* For context sensit ive help */) const Glib::ustring & link_id /* For context sensit ive help */)
{ {
GError *error1 = NULL; // Build uri string
GdkScreen *gscreen = NULL ;
Glib::ustring uri = "help:" + filename; Glib::ustring uri = "help:" + filename;
if (link_id.size() > 0) if (link_id.size() > 0)
uri = uri + "/" + link_id; uri = uri + "/" + link_id;
gscreen = get_window()->get_screen()->gobj(); // Check if yelp is available to provide a useful error message.
gtk_show_uri(gscreen, uri.c_str(), gtk_get_current_event_time(), &error1) // Missing yelp is the most common cause of failure to display help.
; //
if (error1 != NULL) // This early check is performed because failure of gtk_show_uri*()
// method only provides a generic "Operation not permitted" message.
if (Glib::find_program_in_path("yelp").empty())
{ {
//Try opening yelp application directly Gtk::MessageDialog errorDialog(*this,
_("Unable to open GParted Manual h
Glib::RefPtr<Gio::AppInfo> yelp elp file"),
= Gio::AppInfo::create_from_commandline("yelp", "", Gio:: false, Gtk::MESSAGE_ERROR, Gtk::BU
APP_INFO_CREATE_SUPPORTS_URIS); TTONS_OK, true);
Glib::ustring sec_text(_("Command yelp not found."));
Glib::RefPtr<Gdk::AppLaunchContext> context sec_text.append("\n");
= get_window()->get_display()->get_app_launch_context(); sec_text.append("\n");
sec_text.append(_("Install yelp and try again."));
errorDialog.set_secondary_text(sec_text, true);
errorDialog.run();
return;
}
context->set_timestamp(gtk_get_current_event_time()); GError *error = NULL;
bool launched = false;
Glib::ustring error2_msg;
try
{
launched = yelp->launch_uris(std::vector<std::string>(1,
uri), context);
}
catch (Glib::Error& e)
{
error2_msg = e.what();
}
if (!launched)
{
Gtk::MessageDialog dialog(*this,
_( "Unable to open GParted Manu
al help file" ),
false,
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_OK,
true);
dialog.set_secondary_text(error2_msg);
dialog.run();
}
g_clear_error(&error1); // Display help window
#if HAVE_GTK_SHOW_URI_ON_WINDOW
// NULL is provided for the gtk_show_uri_on_window() parent window
// so that failures to launch yelp are reported.
// https://gitlab.gnome.org/GNOME/gparted/-/merge_requests/82#note_110611
4
gtk_show_uri_on_window(NULL, uri.c_str(), gtk_get_current_event_time(), &
error);
#else
GdkScreen *gscreen = gscreen = gdk_screen_get_default();
gtk_show_uri(gscreen, uri.c_str(), gtk_get_current_event_time(), &error);
#endif
if (error != NULL)
{
Gtk::MessageDialog errorDialog(*this,
_("Failed to open GParted Manual h
elp file"),
false,
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_OK,
true);
errorDialog.set_secondary_text(error->message);
errorDialog.run();
} }
g_clear_error(&error);
} }
void Win_GParted::menu_help_contents() void Win_GParted::menu_help_contents()
{ {
#ifdef ENABLE_HELP_DOC #ifdef ENABLE_HELP_DOC
//GParted was built with help documentation //GParted was built with help documentation
show_help("gparted", ""); show_help("gparted", "");
#else #else
//GParted was built *without* help documentation using --disable-doc //GParted was built *without* help documentation using --disable-doc
Gtk::MessageDialog dialog( *this, Gtk::MessageDialog dialog( *this,
 End of changes. 6 change blocks. 
42 lines changed or deleted 46 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)