Skip to content

Commit ff5a5fa

Browse files
committed
there. The rest once home
1 parent a92f1ee commit ff5a5fa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Window.vala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class AppWindow : Gtk.Window {
5656
header.add_css_class (Granite.STYLE_CLASS_FLAT);
5757
header.pack_start (actions_box);
5858

59-
header_label = new Gtk.EditableLabel () {
59+
header_label = new Gtk.EditableLabel ("") {
6060
xalign = 0.5f,
6161
text = ""
6262
};
@@ -103,13 +103,13 @@ public class AppWindow : Gtk.Window {
103103
//
104104
file.bind_property ("file_name", this, "title");
105105
file.bind_property ("file_name", header_label, "text");
106-
bind_property ("is_unsaved_doc", header_label, "sensitive", Glib.BindingFlags.INVERT_BOOLEANS);
106+
bind_property ("is_unsaved_doc", header_label, "sensitive", BindingFlags.INVERT_BOOLEANS);
107107

108108
debug ("Success!");
109109

110110
// We want to open the file in a new window when people drop files on this
111111
var drop_target = new Gtk.DropTarget (typeof (Gdk.FileList), Gdk.DragAction.COPY);
112-
this.add_controller (drop_target);
112+
add_controller (drop_target);
113113

114114
//TODO: Proper handler
115115
drop_target.drop.connect ((target, value, x, y) => {
@@ -143,7 +143,7 @@ public class AppWindow : Gtk.Window {
143143
buf.set_text (contents);
144144
this.file = file;
145145
this.is_unsaved_doc = (Environment.get_user_data_dir () in this.file.get_path ());
146-
this.header_label.tooltip_markup.text = this.file.get_path ();
146+
this.header_label.tooltip_markup = this.file.get_path ();
147147
this.file_name = file.get_basename ();
148148

149149
} catch (Error err) {
@@ -181,7 +181,7 @@ public class AppWindow : Gtk.Window {
181181
/* ---------------- HANDLERS ---------------- */
182182
public void on_save_as () {
183183
debug ("Save event!");
184-
var save_dialog = new Gtk.FileDialog () { initial_name = this.file.basename () };
184+
var save_dialog = new Gtk.FileDialog () { initial_name = this.file.get_basename () };
185185
File oldfile = this.file;
186186

187187
save_dialog.save.begin (this, null, (obj, res) => {
@@ -194,7 +194,7 @@ public class AppWindow : Gtk.Window {
194194
this.file = file;
195195
this.file_name = file.get_basename ();
196196

197-
if ((unsaved_doc) && (oldfile != file)) {
197+
if ((this.unsaved_doc) && (oldfile != file)) {
198198
oldfile.delete ();
199199
}
200200
this.is_unsaved_doc = (Environment.get_user_data_dir () in this.file.get_path ());
@@ -248,7 +248,7 @@ public class AppWindow : Gtk.Window {
248248
debug ("Renaming event!");
249249

250250
try {
251-
this.file.move (header_label, File.CopyFlags.None);
251+
this.file.move (File.new_for_path (header_label.text), File.CopyFlags.None);
252252
this.file_name = this.file.get_basename ();
253253

254254
} catch (Error err) {

0 commit comments

Comments
 (0)