Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
G
geany
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
geany
Commits
06e40e51
Kaydet (Commit)
06e40e51
authored
Eyl 03, 2014
tarafından
Nick Treleaven
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Confirm whether to save protected documents
(Reuses existing strings).
üst
7450a992
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletion
+43
-1
document.c
src/document.c
+43
-1
No files found.
src/document.c
Dosyayı görüntüle @
06e40e51
...
...
@@ -1588,6 +1588,7 @@ static void protect_document(GeanyDocument *doc)
sci_set_readonly
(
doc
->
editor
->
sci
,
TRUE
);
}
static
void
unprotect_document
(
GeanyDocument
*
doc
)
{
g_return_if_fail
(
doc
->
priv
->
protected
>
0
);
...
...
@@ -1846,6 +1847,41 @@ static gchar *save_doc(GeanyDocument *doc, const gchar *locale_filename,
return
NULL
;
}
static
gboolean
save_file_handle_infobars
(
GeanyDocument
*
doc
,
gboolean
force
)
{
GtkWidget
*
bar
=
NULL
;
document_show_tab
(
doc
);
if
(
doc
->
priv
->
info_bars
[
MSG_TYPE_RELOAD
])
{
if
(
!
dialogs_show_question_full
(
NULL
,
_
(
"_Overwrite"
),
GTK_STOCK_CANCEL
,
_
(
"Overwrite?"
),
_
(
"The file '%s' on the disk is more recent than the current buffer."
),
doc
->
file_name
))
return
FALSE
;
bar
=
doc
->
priv
->
info_bars
[
MSG_TYPE_RELOAD
];
}
else
if
(
doc
->
priv
->
info_bars
[
MSG_TYPE_RESAVE
])
{
if
(
!
dialogs_show_question_full
(
NULL
,
GTK_STOCK_SAVE
,
GTK_STOCK_CANCEL
,
_
(
"Try to resave the file?"
),
_
(
"File
\"
%s
\"
was not found on disk!"
),
doc
->
file_name
))
return
FALSE
;
bar
=
doc
->
priv
->
info_bars
[
MSG_TYPE_RESAVE
];
}
else
{
g_assert_not_reached
();
return
FALSE
;
}
gtk_info_bar_response
(
GTK_INFO_BAR
(
bar
),
RESPONSE_DOCUMENT_SAVE
);
return
TRUE
;
}
/**
* Saves the document.
* Also shows the Save As dialog if necessary.
...
...
@@ -1889,10 +1925,14 @@ gboolean document_save_file(GeanyDocument *doc, gboolean force)
}
/* the "changed" flag should exclude the "readonly" flag, but check it anyway for safety */
if
(
doc
->
readonly
||
doc
->
priv
->
protected
)
if
(
doc
->
readonly
)
return
FALSE
;
if
(
!
force
&&
!
doc
->
changed
)
return
FALSE
;
if
(
doc
->
priv
->
protected
)
{
return
save_file_handle_infobars
(
doc
,
force
);
}
fp
=
project_get_file_prefs
();
/* replaces tabs with spaces but only if the current file is not a Makefile */
...
...
@@ -3220,6 +3260,7 @@ static GtkWidget* document_show_message(GeanyDocument *doc, GtkMessageType msgty
return
info_widget
;
}
static
void
on_monitor_reload_file_response
(
GtkWidget
*
bar
,
gint
response_id
,
GeanyDocument
*
doc
)
{
unprotect_document
(
doc
);
...
...
@@ -3231,6 +3272,7 @@ static void on_monitor_reload_file_response(GtkWidget *bar, gint response_id, Ge
document_save_file
(
doc
,
FALSE
);
}
static
gboolean
on_sci_key
(
GtkWidget
*
widget
,
GdkEventKey
*
event
,
gpointer
data
)
{
GtkInfoBar
*
bar
=
GTK_INFO_BAR
(
data
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment