Skip to content

Commit

Permalink
paste.ee expiration and syntax works now
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaex committed Oct 23, 2017
1 parent f5175e8 commit 8131eeb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
4 changes: 4 additions & 0 deletions ShareX.HelpersLib/ListViewColumnSorter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,13 @@ public int Compare(object x, object y)

// Compare the two items
if (SortByDate)
{
compareResult = DateTime.Compare((DateTime)listviewX.SubItems[ColumnToSort].Tag, (DateTime)listviewY.SubItems[ColumnToSort].Tag);
}
else
{
compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text, listviewY.SubItems[ColumnToSort].Text);
}

// Calculate correct return value based on object comparison
if (OrderOfSort == SortOrder.Ascending)
Expand Down
12 changes: 7 additions & 5 deletions ShareX.HistoryLib/HistoryForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,16 @@ private void lvHistory_ItemDrag(object sender, ItemDragEventArgs e)
{
HistoryItem hi = (HistoryItem)item.Tag;
if (File.Exists(hi.Filepath))
{
selection.Add(hi.Filepath);
}
}

if (selection.Count == 0)
return;

DataObject data = new DataObject(DataFormats.FileDrop, selection.ToArray());
DoDragDrop(data, DragDropEffects.Copy);
if (selection.Count > 0)
{
DataObject data = new DataObject(DataFormats.FileDrop, selection.ToArray());
DoDragDrop(data, DragDropEffects.Copy);
}
}

private void txtFilenameFilter_TextChanged(object sender, EventArgs e)
Expand Down
3 changes: 3 additions & 0 deletions ShareX.UploadersLib/Forms/OCRSpaceForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ private void txtResult_KeyDown(object sender, KeyEventArgs e)
if (e.Control && e.KeyCode == Keys.A)
{
if (sender != null)
{
((TextBox)sender).SelectAll();
}

e.SuppressKeyPress = true; // TextBox will beep if it gets the CTRL+A
e.Handled = true;
}
Expand Down
6 changes: 4 additions & 2 deletions ShareX.UploadersLib/TextUploaders/Paste_ee.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ public override UploadResult UploadText(string text, string fileName)
{
encrypted = false,
description = "",
expiration = "never",
sections = new Paste_eeSubmitRequestBodySection[]
{
new Paste_eeSubmitRequestBodySection()
{
name = "",
//syntax = "autodetect",
syntax = "autodetect",
contents = text
}
}
Expand Down Expand Up @@ -117,13 +118,14 @@ public class Paste_eeSubmitRequestBody
{
public bool encrypted { get; set; }
public string description { get; set; }
public string expiration { get; set; }
public Paste_eeSubmitRequestBodySection[] sections { get; set; }
}

public class Paste_eeSubmitRequestBodySection
{
public string name { get; set; }
//public string syntax { get; set; }
public string syntax { get; set; }
public string contents { get; set; }
}

Expand Down

0 comments on commit 8131eeb

Please sign in to comment.