Merge branch 'release-1.1.4'
This commit is contained in:
commit
c36a3be5cd
|
@ -7,7 +7,7 @@ SET (PROJECT_DESCRIPTION "LAview Desktop Application.")
|
||||||
|
|
||||||
SET (MAJOR 1)
|
SET (MAJOR 1)
|
||||||
SET (MINOR 1)
|
SET (MINOR 1)
|
||||||
SET (PATCH 3)
|
SET (PATCH 4)
|
||||||
|
|
||||||
LIST (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/backbone)
|
LIST (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/backbone)
|
||||||
|
|
||||||
|
|
|
@ -9,5 +9,8 @@ namespace LAview.Desktop {
|
||||||
settings = new AppSettings();
|
settings = new AppSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void terminate () {
|
||||||
|
core = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,5 +24,8 @@ namespace LAview.Desktop {
|
||||||
if (File.new_for_path(w32dhack_sdir+"/gschemas.compiled").query_exists ())
|
if (File.new_for_path(w32dhack_sdir+"/gschemas.compiled").query_exists ())
|
||||||
settings_dir = w32dhack_sdir;
|
settings_dir = w32dhack_sdir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void terminate () {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,7 +321,7 @@ namespace LAview.Desktop {
|
||||||
|
|
||||||
[CCode (instance_pos = -1)]
|
[CCode (instance_pos = -1)]
|
||||||
public void action_quit_activate (Gtk.Action action) {
|
public void action_quit_activate (Gtk.Action action) {
|
||||||
window.application.quit();
|
window.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace LAview.Desktop {
|
||||||
dialog = builder.get_object ("preferences_window") as Dialog;
|
dialog = builder.get_object ("preferences_window") as Dialog;
|
||||||
dialog.transient_for = parent;
|
dialog.transient_for = parent;
|
||||||
dialog.modal = true;
|
dialog.modal = true;
|
||||||
dialog.application = application;
|
//dialog.application = application;
|
||||||
dialog.delete_event.connect ((source) => {return true;});
|
dialog.delete_event.connect ((source) => {return true;});
|
||||||
liststore_data = builder.get_object ("liststore_data") as Gtk.ListStore;
|
liststore_data = builder.get_object ("liststore_data") as Gtk.ListStore;
|
||||||
liststore_protocols = builder.get_object ("liststore_protocols") as Gtk.ListStore;
|
liststore_protocols = builder.get_object ("liststore_protocols") as Gtk.ListStore;
|
||||||
|
|
|
@ -7,5 +7,8 @@ namespace LAview.Desktop {
|
||||||
resource = Resource.load (resource_file);
|
resource = Resource.load (resource_file);
|
||||||
resource._register();
|
resource._register();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void terminate () {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace LAview.Desktop {
|
||||||
dialog = builder.get_object ("subprocess_dialog") as Dialog;
|
dialog = builder.get_object ("subprocess_dialog") as Dialog;
|
||||||
dialog.transient_for = parent;
|
dialog.transient_for = parent;
|
||||||
dialog.modal = true;
|
dialog.modal = true;
|
||||||
dialog.application = application;
|
//dialog.application = application;
|
||||||
dialog.delete_event.connect ((source) => {return true;});
|
dialog.delete_event.connect ((source) => {return true;});
|
||||||
textview_stderrout = builder.get_object ("textview_stderrout") as TextView;
|
textview_stderrout = builder.get_object ("textview_stderrout") as TextView;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,43 +4,6 @@ namespace LAview.Desktop {
|
||||||
|
|
||||||
using Gtk;
|
using Gtk;
|
||||||
|
|
||||||
/**
|
|
||||||
* Resolve a path beginning with "~"
|
|
||||||
* Look at: https://github.com/ssokolow/gvrun/blob/master/process_runner.vala#L86
|
|
||||||
*/
|
|
||||||
#if (linux || UNIX || __unix__)
|
|
||||||
static string expand_tilde (string path) {
|
|
||||||
if (!path.has_prefix ("~")) return path; // Just pass paths through if they don't start with ~
|
|
||||||
|
|
||||||
// Split the ~user portion from the path (Use / for the path if not present)
|
|
||||||
string parts[2];
|
|
||||||
if (!(Path.DIR_SEPARATOR_S in path)) {
|
|
||||||
parts = { path.substring(1), Path.DIR_SEPARATOR_S };
|
|
||||||
} else {
|
|
||||||
string trimmed = path.substring(1);
|
|
||||||
parts = trimmed.split(Path.DIR_SEPARATOR_S, 2);
|
|
||||||
}
|
|
||||||
warn_if_fail(parts.length == 2);
|
|
||||||
|
|
||||||
// Handle both "~" and "~user" forms
|
|
||||||
string home_path;
|
|
||||||
if (parts[0] == "") {
|
|
||||||
home_path = Environment.get_variable("HOME") ?? Environment.get_home_dir();
|
|
||||||
} else {
|
|
||||||
unowned Posix.Passwd _pw = Posix.getpwnam(parts[0]);
|
|
||||||
home_path = (_pw == null) ? null : _pw.pw_dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fail safely if we couldn't look up a homedir
|
|
||||||
if (home_path == null) {
|
|
||||||
warning("Could not get homedir for user: %s", parts[0].length > 0 ? parts[0] : "<current user>");
|
|
||||||
return path;
|
|
||||||
} else {
|
|
||||||
return home_path + Path.DIR_SEPARATOR_S + parts[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open document.
|
* Open document.
|
||||||
* Idea borrowed from: https://github.com/ssokolow/gvrun/blob/master/process_runner.vala
|
* Idea borrowed from: https://github.com/ssokolow/gvrun/blob/master/process_runner.vala
|
||||||
|
@ -51,7 +14,7 @@ namespace LAview.Desktop {
|
||||||
foreach (var opener in OPENERS) {
|
foreach (var opener in OPENERS) {
|
||||||
if (Environment.find_program_in_path (opener) != null) {
|
if (Environment.find_program_in_path (opener) != null) {
|
||||||
try {
|
try {
|
||||||
string[] argv = { opener, expand_tilde (path) };
|
string[] argv = { opener, path };
|
||||||
Process.spawn_async(null, argv, null, SpawnFlags.SEARCH_PATH, null, null);
|
Process.spawn_async(null, argv, null, SpawnFlags.SEARCH_PATH, null, null);
|
||||||
} catch (SpawnError err) {
|
} catch (SpawnError err) {
|
||||||
var msg = new MessageDialog (parent_window, DialogFlags.MODAL, MessageType.ERROR,
|
var msg = new MessageDialog (parent_window, DialogFlags.MODAL, MessageType.ERROR,
|
||||||
|
|
|
@ -50,6 +50,13 @@ namespace LAview.Desktop {
|
||||||
flags: ApplicationFlags.FLAGS_NONE);
|
flags: ApplicationFlags.FLAGS_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~LAviewDesktopApp () {
|
||||||
|
print ("~LAviewDesktopApp()\n");
|
||||||
|
Resources.terminate ();
|
||||||
|
AppCore.terminate ();
|
||||||
|
AppDirs.terminate ();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void activate () {
|
protected override void activate () {
|
||||||
try {
|
try {
|
||||||
main_window = new MainWindow (this);
|
main_window = new MainWindow (this);
|
||||||
|
|
Loading…
Reference in New Issue