[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Review Request 114315: Warn kate user of opening large files
From:       "Dominik Haumann" <dhaumann () kde ! org>
Date:       2013-12-05 14:44:17
Message-ID: 20131205144417.16067.7198 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On Dec. 5, 2013, 1:41 p.m., Dominik Haumann wrote:
> > kate/app/kateviewmanager.cpp, line 261
> > <http://git.reviewboard.kde.org/r/114315/diff/2/?file=222686#file222686line261>
> > 
> > This gives one MessageBox for each file.
> > 
> > Another approach would be to open one dialog listing all the files that are too \
> > big. This is also how the externally-modified-files-dialog works. 
> > What do you think?
> 
> Michal Humpula wrote:
> that would probably be better, but... is there a simple way to make the list not \
> look awful in the message box? Found KateModOnHdPrompt and a similar KMessageBox in \
> the Document class, but those are serving a single file at the time. Can you please \
> point me to the "externally-modified-files-dialog"?

Afaik, it seems they are serving a single file, but in fact, if the dialog is already \
shown, it just adds the other files to the already visible dialog (through \
KateMwModOnHdDialog::addDocument).

This is not required here, so just using a dialog that takes a list of docs in the \
constructor will do. This dialog just shows the files in a list box, where each item \
is checkable or similar. That would already be ok.

Does that make sense?

(with externally-modified-files-dialog I meant KateMwModOnHdDialog, sorry for the bad \
wording)

Btw: We have to merge all changes into the frameworks branch. That gets harder with \
increasing code changes in the frameworks branch. So while it would be nice to have \
this patch in KDE 4.13, it at some point will cost a lot of time for us to do the \
merge. But currently it's still ok in master, I guess.


- Dominik


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/114315/#review45195
-----------------------------------------------------------


On Dec. 5, 2013, 1:35 p.m., Michal Humpula wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/114315/
> -----------------------------------------------------------
> 
> (Updated Dec. 5, 2013, 1:35 p.m.)
> 
> 
> Review request for Kate.
> 
> 
> Repository: kate
> 
> 
> Description
> -------
> 
> Warn kate user of opening large files, which could lead to unresponsive kate and \
> potential loss of unsaved changes, due to the "killall -9 kate" action, that would \
> most likely come after 1min of waiting. 
> The very likely usecase goes like this:
> "Have you ever accidentaly openned large mkv file instead of srt one in the same \
> folder?" 
> Limit of 10MB seems enought to not bother the user with regular files. Does anyone \
> know anyone, who is opening larger files in kate and considers it to be normal? 
> Thanks Sven Brauch and Gerald Senarclens de Grancy for suggesting the correct \
> solution. 
> 
> Diffs
> -----
> 
> kate/app/kateviewmanager.cpp 2dbd1f9 
> 
> Diff: http://git.reviewboard.kde.org/r/114315/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Michal Humpula
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/114315/">http://git.reviewboard.kde.org/r/114315/</a>
  </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On December 5th, 2013, 1:41 p.m. UTC, <b>Dominik \
Haumann</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/114315/diff/2/?file=222686#file222686line261" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kate/app/kateviewmanager.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void \
KateViewManager::slotDocumentOpen ()</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">259</font></th>  <td bgcolor="#ffffff" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">for</span> \
<span class="p">(</span><span class="n">KUrl</span><span class="o">::</span><span \
class="n">List</span><span class="o">::</span><span class="n">Iterator</span> <span \
class="n">i</span> <span class="o">=</span> <span class="n">r</span><span \
class="p">.</span><span class="n">URLs</span><span class="p">.</span><span \
class="n">begin</span><span class="p">();</span> <span class="n">i</span> <span \
class="o">!=</span> <span class="n">r</span><span class="p">.</span><span \
class="n">URLs</span><span class="p">.</span><span class="n">end</span><span \
class="p">();</span> <span class="o">++</span><span class="n">i</span><span \
class="p">)</span></pre></td>  <th bgcolor="#f0f0f0" style="border-left: 1px solid \
#C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">261</font></th>  <td bgcolor="#ffffff" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">    <span class="k">for</span> <span \
class="p">(</span><span class="n">KUrl</span><span class="o">::</span><span \
class="n">List</span><span class="o">::</span><span class="n">Iterator</span> <span \
class="n">i</span> <span class="o">=</span> <span class="n">r</span><span \
class="p">.</span><span class="n">URLs</span><span class="p">.</span><span \
class="n">begin</span><span class="p">();</span> <span class="n">i</span> <span \
class="o">!=</span> <span class="n">r</span><span class="p">.</span><span \
class="n">URLs</span><span class="p">.</span><span class="n">end</span><span \
class="p">();</span> <span class="o">++</span><span class="n">i</span><span \
class="p">)</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This gives one \
MessageBox for each file.

Another approach would be to open one dialog listing all the files that are too big. \
This is also how the externally-modified-files-dialog works.

What do you think?</pre>
 </blockquote>



 <p>On December 5th, 2013, 1:53 p.m. UTC, <b>Michal Humpula</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">that would probably be \
better, but... is there a simple way to make the list not look awful in the message \
box? Found KateModOnHdPrompt and a similar KMessageBox in the Document class, but \
those are serving a single file at the time. Can you please point me to the \
&quot;externally-modified-files-dialog&quot;?</pre>  </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Afaik, it \
seems they are serving a single file, but in fact, if the dialog is already shown, it \
just adds the other files to the already visible dialog (through \
KateMwModOnHdDialog::addDocument).

This is not required here, so just using a dialog that takes a list of docs in the \
constructor will do. This dialog just shows the files in a list box, where each item \
is checkable or similar. That would already be ok.

Does that make sense?

(with externally-modified-files-dialog I meant KateMwModOnHdDialog, sorry for the bad \
wording)

Btw: We have to merge all changes into the frameworks branch. That gets harder with \
increasing code changes in the frameworks branch. So while it would be nice to have \
this patch in KDE 4.13, it at some point will cost a lot of time for us to do the \
merge. But currently it&#39;s still ok in master, I guess.</pre> <br />




<p>- Dominik</p>


<br />
<p>On December 5th, 2013, 1:35 p.m. UTC, Michal Humpula wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Kate.</div>
<div>By Michal Humpula.</div>


<p style="color: grey;"><i>Updated Dec. 5, 2013, 1:35 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kate
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Warn kate user of opening large files, which could lead to unresponsive \
kate and potential loss of unsaved changes, due to the &quot;killall -9 kate&quot; \
action, that would most likely come after 1min of waiting.

The very likely usecase goes like this:
&quot;Have you ever accidentaly openned large mkv file instead of srt one in the same \
folder?&quot;

Limit of 10MB seems enought to not bother the user with regular files. Does anyone \
know anyone, who is opening larger files in kate and considers it to be normal?

Thanks Sven Brauch and Gerald Senarclens de Grancy for suggesting the correct \
solution.</pre>  </td>
 </tr>
</table>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>kate/app/kateviewmanager.cpp <span style="color: grey">(2dbd1f9)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/114315/diff/" style="margin-left: \
3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic