forked from picotorrent/picotorrent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request picotorrent#1180 from vktr/feature/export-torrents
Add context menu actions to export torrent
- Loading branch information
Showing
7 changed files
with
139 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "textoutputdialog.hpp" | ||
|
||
#include "../translator.hpp" | ||
|
||
using pt::UI::Dialogs::TextOutputDialog; | ||
|
||
TextOutputDialog::TextOutputDialog(wxWindow* parent, wxWindowID id, std::wstring const& title, std::wstring const& desc) | ||
: wxDialog(parent, id, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), | ||
m_outputText(new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL | wxTE_MULTILINE)) | ||
{ | ||
auto buttonsSizer = new wxBoxSizer(wxHORIZONTAL); | ||
wxButton* ok = new wxButton(this, wxID_OK); | ||
ok->SetDefault(); | ||
|
||
buttonsSizer->Add(ok); | ||
|
||
auto mainSizer = new wxBoxSizer(wxVERTICAL); | ||
mainSizer->AddSpacer(FromDIP(11)); | ||
mainSizer->Add(new wxStaticText(this, wxID_ANY, desc), 0, wxLEFT | wxRIGHT, FromDIP(11)); | ||
mainSizer->AddSpacer(FromDIP(5)); | ||
mainSizer->Add(m_outputText, 1, wxLEFT | wxRIGHT | wxEXPAND, FromDIP(11)); | ||
mainSizer->AddSpacer(FromDIP(7)); | ||
mainSizer->Add(buttonsSizer, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_RIGHT, FromDIP(11)); | ||
|
||
this->SetSizerAndFit(mainSizer); | ||
this->SetSize(FromDIP(wxSize(400, 250))); | ||
|
||
m_outputText->SetFocus(); | ||
m_outputText->SetFont( | ||
wxFont(9, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("Consolas"))); | ||
} | ||
|
||
TextOutputDialog::~TextOutputDialog() | ||
{ | ||
} | ||
|
||
void TextOutputDialog::SetOutputText(std::string const& text) | ||
{ | ||
m_outputText->SetValue(text); | ||
m_outputText->SetInsertionPointEnd(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
|
||
#include <wx/wxprec.h> | ||
#ifndef WX_PRECOMP | ||
#include <wx/wx.h> | ||
#endif | ||
|
||
#include <string> | ||
|
||
namespace pt | ||
{ | ||
namespace UI | ||
{ | ||
namespace Dialogs | ||
{ | ||
class TextOutputDialog : public wxDialog | ||
{ | ||
public: | ||
TextOutputDialog(wxWindow* parent, wxWindowID id, std::wstring const& title, std::wstring const& desc); | ||
virtual ~TextOutputDialog(); | ||
|
||
void SetOutputText(std::string const& text); | ||
|
||
private: | ||
wxTextCtrl* m_outputText; | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters