mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-30 11:27:19 +02:00
Deprecation
- Removed deprecated 'fg:' and 'bg:' attributes, which involves code, documentation and tests. - Cleaned out NEWS file. - Cleaned out config import synonyms, which should have been deleted a while ago. - Removed unused localized strings, but left the 'deprecated' one behind, because it will be needed.
This commit is contained in:
parent
1d99260cb9
commit
d89d51e7e1
15 changed files with 14 additions and 400 deletions
|
@ -6,14 +6,12 @@ include_directories (${CMAKE_SOURCE_DIR}
|
|||
${TASK_INCLUDE_DIRS})
|
||||
|
||||
set (columns_SRCS Column.cpp Column.h
|
||||
ColBg.cpp ColBg.h
|
||||
ColDate.cpp ColDate.h
|
||||
ColDepends.cpp ColDepends.h
|
||||
ColDescription.cpp ColDescription.h
|
||||
ColDue.cpp ColDue.h
|
||||
ColEnd.cpp ColEnd.h
|
||||
ColEntry.cpp ColEntry.h
|
||||
ColFg.cpp ColFg.h
|
||||
ColID.cpp ColID.h
|
||||
ColIMask.cpp ColIMask.h
|
||||
ColMask.cpp ColMask.h
|
||||
|
|
|
@ -1,88 +0,0 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// taskwarrior - a command line task list manager.
|
||||
//
|
||||
// Copyright 2006-2012, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// http://www.opensource.org/licenses/mit-license.php
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define L10N // Localization complete.
|
||||
|
||||
#include <Context.h>
|
||||
#include <ColBg.h>
|
||||
#include <text.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
ColumnBg::ColumnBg ()
|
||||
{
|
||||
_name = "bg";
|
||||
_type = "string";
|
||||
_style = "default";
|
||||
_label = STRING_COLUMN_LABEL_BG;
|
||||
|
||||
_styles.push_back ("default");
|
||||
|
||||
_examples.push_back ("'on red'");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
ColumnBg::~ColumnBg ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool ColumnBg::validate (std::string& value)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Set the minimum and maximum widths for the value.
|
||||
void ColumnBg::measure (Task& task, int& minimum, int& maximum)
|
||||
{
|
||||
std::string bg = task.get (_name);
|
||||
|
||||
minimum = longestWord (bg);
|
||||
maximum = bg.length ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ColumnBg::render (
|
||||
std::vector <std::string>& lines,
|
||||
Task& task,
|
||||
int width,
|
||||
Color& color)
|
||||
{
|
||||
std::string bg = task.get (_name);
|
||||
|
||||
std::vector <std::string> raw;
|
||||
wrapText (raw, bg, width, _hyphenate);
|
||||
|
||||
std::vector <std::string>::iterator i;
|
||||
for (i = raw.begin (); i != raw.end (); ++i)
|
||||
lines.push_back (color.colorize (leftJustify (*i, width)));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,53 +0,0 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// taskwarrior - a command line task list manager.
|
||||
//
|
||||
// Copyright 2006-2012, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// http://www.opensource.org/licenses/mit-license.php
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDED_COLBG
|
||||
#define INCLUDED_COLBG
|
||||
#define L10N // Localization complete.
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <Column.h>
|
||||
#include <Color.h>
|
||||
#include <Task.h>
|
||||
|
||||
class ColumnBg : public Column
|
||||
{
|
||||
public:
|
||||
ColumnBg ();
|
||||
~ColumnBg ();
|
||||
|
||||
bool validate (std::string&);
|
||||
void measure (Task&, int&, int&);
|
||||
void render (std::vector <std::string>&, Task&, int, Color&);
|
||||
|
||||
private:
|
||||
bool _hyphenate;
|
||||
};
|
||||
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,88 +0,0 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// taskwarrior - a command line task list manager.
|
||||
//
|
||||
// Copyright 2006-2012, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// http://www.opensource.org/licenses/mit-license.php
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define L10N // Localization complete.
|
||||
|
||||
#include <Context.h>
|
||||
#include <ColFg.h>
|
||||
#include <text.h>
|
||||
#include <i18n.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
ColumnFg::ColumnFg ()
|
||||
{
|
||||
_name = "fg";
|
||||
_type = "string";
|
||||
_style = "default";
|
||||
_label = STRING_COLUMN_LABEL_FG;
|
||||
|
||||
_styles.push_back ("default");
|
||||
|
||||
_examples.push_back ("red");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
ColumnFg::~ColumnFg ()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool ColumnFg::validate (std::string& value)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Set the minimum and maximum widths for the value.
|
||||
void ColumnFg::measure (Task& task, int& minimum, int& maximum)
|
||||
{
|
||||
std::string fg = task.get (_name);
|
||||
|
||||
minimum = longestWord (fg);
|
||||
maximum = fg.length ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void ColumnFg::render (
|
||||
std::vector <std::string>& lines,
|
||||
Task& task,
|
||||
int width,
|
||||
Color& color)
|
||||
{
|
||||
std::string fg = task.get (_name);
|
||||
|
||||
std::vector <std::string> raw;
|
||||
wrapText (raw, fg, width, _hyphenate);
|
||||
|
||||
std::vector <std::string>::iterator i;
|
||||
for (i = raw.begin (); i != raw.end (); ++i)
|
||||
lines.push_back (color.colorize (leftJustify (*i, width)));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,53 +0,0 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// taskwarrior - a command line task list manager.
|
||||
//
|
||||
// Copyright 2006-2012, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// http://www.opensource.org/licenses/mit-license.php
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef INCLUDED_COLFG
|
||||
#define INCLUDED_COLFG
|
||||
#define L10N // Localization complete.
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <Column.h>
|
||||
#include <Color.h>
|
||||
#include <Task.h>
|
||||
|
||||
class ColumnFg : public Column
|
||||
{
|
||||
public:
|
||||
ColumnFg ();
|
||||
~ColumnFg ();
|
||||
|
||||
bool validate (std::string&);
|
||||
void measure (Task&, int&, int&);
|
||||
void render (std::vector <std::string>&, Task&, int, Color&);
|
||||
|
||||
private:
|
||||
bool _hyphenate;
|
||||
};
|
||||
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////////
|
|
@ -29,13 +29,11 @@
|
|||
|
||||
#include <Context.h>
|
||||
#include <Column.h>
|
||||
#include <ColBg.h>
|
||||
#include <ColDepends.h>
|
||||
#include <ColDescription.h>
|
||||
#include <ColDue.h>
|
||||
#include <ColEnd.h>
|
||||
#include <ColEntry.h>
|
||||
#include <ColFg.h>
|
||||
#include <ColID.h>
|
||||
#include <ColIMask.h>
|
||||
#include <ColMask.h>
|
||||
|
@ -81,13 +79,11 @@ Column* Column::factory (const std::string& name, const std::string& report)
|
|||
}
|
||||
|
||||
Column* c;
|
||||
if (column_name == "bg") c = new ColumnBg ();
|
||||
else if (column_name == "depends") c = new ColumnDepends ();
|
||||
if (column_name == "depends") c = new ColumnDepends ();
|
||||
else if (column_name == "description") c = new ColumnDescription ();
|
||||
else if (column_name == "due") c = new ColumnDue ();
|
||||
else if (column_name == "end") c = new ColumnEnd ();
|
||||
else if (column_name == "entry") c = new ColumnEntry ();
|
||||
else if (column_name == "fg") c = new ColumnFg ();
|
||||
else if (column_name == "id") c = new ColumnID ();
|
||||
else if (column_name == "imask") c = new ColumnIMask ();
|
||||
else if (column_name == "mask") c = new ColumnMask ();
|
||||
|
@ -125,13 +121,11 @@ void Column::factory (std::map <std::string, Column*>& all)
|
|||
{
|
||||
Column* c;
|
||||
|
||||
c = new ColumnBg (); all[c->_name] = c;
|
||||
c = new ColumnDepends (); all[c->_name] = c;
|
||||
c = new ColumnDescription (); all[c->_name] = c;
|
||||
c = new ColumnDue (); all[c->_name] = c;
|
||||
c = new ColumnEnd (); all[c->_name] = c;
|
||||
c = new ColumnEntry (); all[c->_name] = c;
|
||||
c = new ColumnFg (); all[c->_name] = c;
|
||||
c = new ColumnID (); all[c->_name] = c;
|
||||
c = new ColumnIMask (); all[c->_name] = c;
|
||||
c = new ColumnMask (); all[c->_name] = c;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue