Quark: remove edit features

git-svn-id: svn://kolibrios.org@8749 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-05-27 22:58:17 +00:00
parent f4298f364a
commit 65dd3b758c
2 changed files with 32 additions and 96 deletions

View File

@ -8,15 +8,9 @@ char short_app_name[] = "Quark";
#ifdef LANG_RUS
char intro[] = "<EFBFBD>â® ¯à®á⮩ ¯à®á¬®âà騪 ¨ । ªâ®à ⥪áâ .
<EFBFBD>®¯à®¡ã©â¥ ®âªàëâì ⥪áâ®¢ë© ä ©«.";
char intro[] = " Quark - íâ® ¯à®á⮩ ¯à®á¬®âà騪 ⥪áâ .
<EFBFBD>®¯à®¡ã©â¥ ®âªàëâì ⥪áâ®¢ë© ä ©«.
char copied_chars[] = "%i ᨬ¢®«®¢ ᪮¯¨à®¢ ­®";
char chars_selected[] = "%i ᨬ¢®«®¢ ¢ë¤¥«¥­®";
char about[] = "Quark Text v0.95
¢â®à: Š¨à¨«« ¨¯ â®¢ aka Leency
 ©â: http://aspero.pro
ƒ®àï稥 ª« ¢¨è¨:
Ctrl+O - ®âªàëâì ä ©«
@ -25,20 +19,16 @@ Ctrl+
Ctrl+Œ¨­ãá - 㬥­ìè¨âì èà¨äâ
Ctrl+Tab - ¢ë¡à âì ª®¤¨à®¢ªã ⥪áâ 
Ctrl+E - ®âªàëâì ä ©« ¢ ¤à㣮© ¯à®£à ¬¬¥
<EFBFBD>®¨áª:
Ctrl+F - ®âªàëâì ¯ ­¥«ì ¯®¨áª 
F3 - ¨áª âì ¤ «¥¥
Esc - áªàëâì ¯ ­¥«ì ¯®¨áª ";
F3 - ¨áª âì ¤ «¥¥";
char copied_chars[] = "%i ᨬ¢®«®¢ ᪮¯¨à®¢ ­®";
char chars_selected[] = "%i ᨬ¢®«®¢ ¢ë¤¥«¥­®";
char color_scheme_names[] = "’¢®à®¦¥ª\nŠ®á¬®á ";
?define FILE_SAVED_WELL "'” ©« ãᯥ譮 á®åà ­¥­'O"
?define FILE_NOT_SAVED "'Žè¨¡ª  ¯à¨ á®åà ­¥­¨¨ ä ©« !'E"
char rmb_menu[] =
"‚ë१ âì|Ctrl+X
Š®¯¨à®¢ âì|Ctrl+C
áâ ¢¨âì|Ctrl+V
"Š®¯¨à®¢ âì|Ctrl+C
-
Žâªàëâì ¢ ¯ ¯ª¥
Š®¯¨à®¢ âì ¯ãâì ä ©« ";
@ -48,15 +38,8 @@ char rmb_menu[] =
#else
char intro[] = "Quark is a simple text viewer and editor.
Try to open some text file.";
char copied_chars[] = "%i characters copied";
char chars_selected[] = "%i characters selected";
char about[] = "Quark Text v0.95
Author: Kiril Lipatov aka Leency
Website: http://aspero.pro
char intro[] = " Quark is a simple text viewer.
Try to open some text file.
Hotkeys:
Ctrl+O - open file
@ -65,20 +48,16 @@ Ctrl+Plus - bigger font
Ctrl+Down - smaller font
Ctrl+Tab - select charset
Ctrl+E - reopen current file in another app
Search:
Ctrl+F - open search
F3 - search next
Esc - hide search bar";
F3 - search next";
char copied_chars[] = "%i characters copied";
char chars_selected[] = "%i characters selected";
char color_scheme_names[] = "Dairy\nCosmos ";
?define FILE_SAVED_WELL "'File saved'O"
?define FILE_NOT_SAVED "'Error saving file!'E"
char rmb_menu[] =
"Cut|Ctrl+X
Copy|Ctrl+C
Paste|Ctrl+V
"Copy|Ctrl+C
-
Reveal in folder
Copy file path";
@ -106,7 +85,7 @@ struct THEME
} theme;
char default_dir[] = "/rd/1";
od_filter filter2 = { 37, "TXT\0INI\0ASM\0HTM\0HTML\0C\0H\0C--\0H--\0CPP\0\0" };
od_filter filter2 = { 0, "" };
CANVAS canvas;

View File

@ -10,7 +10,7 @@
4. selection
*/
#define MEMSIZE 60*1024
#define MEMSIZE 50*1024
//===================================================//
// //
@ -182,9 +182,6 @@ void HandleKeyEvent()
switch (key_scancode)
{
case SCAN_CODE_F1:
EventShowInfo();
return;
case SCAN_CODE_ESC:
search.hide();
return;
@ -206,9 +203,9 @@ void HandleKeyEvent()
switch (key_scancode)
{
case SCAN_CODE_KEY_A: EventSelectAllText(); return;
case SCAN_CODE_KEY_X: EventCut(); return;
case SCAN_CODE_KEY_C: EventCopy(); return;
case SCAN_CODE_KEY_V: EventPaste(); return;
//case SCAN_CODE_KEY_X: EventCut(); return;
//case SCAN_CODE_KEY_V: EventPaste(); return;
case SCAN_CODE_UP: EventMagnifyPlus(); return;
case SCAN_CODE_DOWN: EventMagnifyMinus(); return;
case SCAN_CODE_TAB: EventShowCharsetsList(); return;
@ -219,7 +216,7 @@ void HandleKeyEvent()
if (key_modifier & KEY_LSHIFT) || (key_modifier & KEY_RSHIFT) {
selection.set_start();
} else {
EventInsertCharIntoText();
//EventInsertCharIntoText();
selection.cancel();
}
@ -302,11 +299,6 @@ bool EventSearchPrevious()
}
}
void EventNewFile()
{
RunProgram(#program_path, "-new");
}
void EventOpenDialog()
{
OpenDialog_start stdcall (#o_dialog);
@ -316,20 +308,6 @@ void EventOpenDialog()
}
}
void EventSave()
{
int res;
char backy_param[4096];
io.dir.make("/tmp0/1/quark_backups");
sprintf(#backy_param, "%s -o /tmp0/1/quark_backups", #file_path);
RunProgram("/sys/develop/backy", #backy_param);
if (! WriteFile(0, textbuf.len, textbuf.p, #file_path) ) {
notify(FILE_SAVED_WELL);
} else {
notify(FILE_NOT_SAVED);
}
}
void EventShowFileInfo()
{
char ss_param[4096];
@ -364,14 +342,14 @@ void EventShowCharsetsList()
void EventShowReopenMenu()
{
menu_id = REOPEN_IN_APP;
open_lmenu(reopenin_mx + 23, 29, MENU_TOP_RIGHT, NULL,
"Tinypad\nTextEdit\nWebView\nFB2Read\nHexView\nOther");
open_lmenu(reopenin_mx, 29, MENU_TOP_LEFT, NULL,
"Tinypad\nCodeEdit\nWebView\nFB2Read\nHexView\nOther");
}
void EventShowThemesList()
{
menu_id = COLOR_SCHEME;
open_lmenu(theme_mx + 23, 29, MENU_TOP_RIGHT,
open_lmenu(theme_mx, 29, MENU_TOP_LEFT,
curcol_scheme+1, #color_scheme_names);
}
@ -395,11 +373,6 @@ void EventSetColorScheme(dword _setn)
if (list.count) ParseAndPaint();
}
void EventShowInfo() {
notify(#about);
}
void EventChangeCharset(dword id)
{
if (file_path[0]=='\0') return;
@ -415,7 +388,7 @@ void EventOpenFileInOtherApp(dword _id)
byte open_param[4096];
switch(_id) {
case 0: app = "/sys/tinypad"; break;
case 1: app = "/sys/develop/t_edit"; break;
case 1: app = "/sys/develop/cedit"; break;
case 2: app = "/sys/network/webview"; break;
case 3: app = "/sys/fb2read"; break;
case 4: app = "/sys/develop/heed"; break;
@ -451,6 +424,7 @@ void EventClickSearch()
}
}
/*
void EventInsertCharIntoText()
{
dword i;
@ -503,27 +477,14 @@ void EventInsertCharIntoText()
DrawPage();
}
}
void EventOpenSysfuncs()
{
if (RunProgram("/sys/docpack", "f") <= 0) {
notify("'Can not open SysFunctions because\n/rd/1/docpack is not found!'E");
}
}
void EventOpenPipet()
{
RunProgram("/sys/develop/pipet", NULL);
}
*/
void EventRbmMenuClick(dword id)
{
switch(id) {
case 0: EventCut(); break;
case 1: EventCopy(); break;
case 2: EventPaste(); break;
case 3: EventRevealInFolder(); break;
case 4: EventCopyFilePath(); break;
case 0: EventCopy(); break;
case 1: EventRevealInFolder(); break;
case 2: EventCopyFilePath(); break;
}
}
@ -561,6 +522,7 @@ void EventCopy()
DrawStatusBar(#copy_status_text);
}
/*
void EventCut()
{
if (!selection.is_active()) {
@ -592,6 +554,7 @@ void EventDeleteSelectedText()
list.cur_y = math.min(selection.start_y, selection.end_y);
selection.cancel();
}
*/
void EventRevealInFolder()
{
@ -669,19 +632,13 @@ void DrawToolbar()
DrawBar(0, TOOLBAR_H - 1, Form.cwidth, 1, sc.work_graph);
x.set(-GAP_S+8);
TopBarBt(#EventNewFile, ECTRL+SCAN_CODE_KEY_N, 2, x.inc(GAP_S), false);
TopBarBt(#EventOpenDialog, ECTRL+SCAN_CODE_KEY_O, 0, x.inc(GAP_S), false);
TopBarBt(#EventSave, ECTRL+SCAN_CODE_KEY_S, 5, x.inc(GAP_S), false);
TopBarBt(#EventShowFileInfo, ECTRL+SCAN_CODE_KEY_I, 10, x.inc(GAP_S), false);
TopBarBt(#EventMagnifyMinus, ECTRL+SCAN_CODE_MINUS, 33, x.inc(GAP_B), false);
TopBarBt(#EventMagnifyPlus, ECTRL+SCAN_CODE_PLUS, 32, x.inc(GAP_S), false);
TopBarBt(#EventClickSearch, ECTRL+SCAN_CODE_KEY_F, 49, x.inc(GAP_B), search.visible); search_mx = EAX;
x.set(Form.cwidth-4);
TopBarBt(#EventShowInfo, NULL, -1, x.inc(-GAP_S), false); burger_mx = EAX;
TopBarBt(#EventShowThemesList, NULL, 40, x.inc(-GAP_B), thema); theme_mx = EAX;
TopBarBt(#EventShowReopenMenu, ECTRL+SCAN_CODE_KEY_E, 16, x.inc(-GAP_S), reopa); reopenin_mx = EAX;
TopBarBt(#EventOpenSysfuncs, NULL, 18, x.inc(-GAP_S), false);
TopBarBt(#EventOpenPipet, NULL, 39, x.inc(-GAP_S), false);
TopBarBt(#EventShowThemesList, NULL, 40, x.inc(GAP_B), thema); theme_mx = EAX;
TopBarBt(#EventShowReopenMenu, ECTRL+SCAN_CODE_KEY_E, 16, x.inc(GAP_S), reopa); reopenin_mx = EAX;
}
void DrawStatusBar(dword _in_text)