Skip to content

Commit

Permalink
Logger in GTK
Browse files Browse the repository at this point in the history
  • Loading branch information
yatima1460 committed Jun 13, 2019
1 parent b83fee9 commit 53039f4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Source/Frontend/GTK/Window.d
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import gio.Application : GioApplication = Application;
import API : DrillAPI;
import FileInfo : FileInfo;
import Utils : humanSize;
import Utils : logConsole;
import Logger : Logger;
import Utils : openFile;
import std.path : dirName, buildNormalizedPath, absolutePath, buildPath;
import std.array;
Expand Down Expand Up @@ -306,7 +306,7 @@ private:
// instead clearing the list in GTK uses a foreach
createNewList();

logConsole("Wrote input:" ~ ei.getChars(0, -1));
Logger.logTrace("Wrote input:" ~ ei.getChars(0, -1));

immutable(string) search_string = ei.getChars(0, -1);
if (search_string.length != 0)
Expand Down Expand Up @@ -342,7 +342,7 @@ private:
}
catch (std.file.FileException e)
{
logConsole("Error reading icons associations, not using icons" ~ e.toString());
Logger.logError("Error reading icons associations, not using icons" ~ e.toString());
}

}
Expand All @@ -357,7 +357,7 @@ private:
}
catch (GException ge)
{
logConsole("Can't find program icon, will fallback to default GTK one! " ~ ge.toString());
Logger.logError("Can't find program icon, will fallback to default GTK one! " ~ ge.toString());

//fallback to default GTK icon if it can't find its own
this.setIconName("search");
Expand Down Expand Up @@ -520,15 +520,15 @@ private:
gdk.Threads.threadsAddTimeout(10, &threadIdleProcess, cast(void*) this);

addOnDelete(delegate bool(Event event, Widget widget) {
logConsole("Window started to close, stopping crawlers");
Logger.logInfo("Window started to close, stopping crawlers");
drillapi.stopCrawlingSync();
return false;
});

addOnKeyPress(delegate bool(GdkEventKey* event, Widget widget) {
import gdk.Keysyms : GdkKeysyms;
if (event.keyval == GdkKeysyms.GDK_Escape) {
logConsole("ESC pressed, window is closing");
Logger.logInfo("ESC pressed, window is closing");
drillapi.stopCrawlingSync();
this.close();
return true;
Expand Down

0 comments on commit 53039f4

Please sign in to comment.