Bugzilla – Attachment 56125 Details for
Bug 129679
Problem in runleveleditor at entry CRON
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
Patch fixing the speed problem
runlevel_patch_129679.diff (text/x-patch), 5.39 KB, created by
Lukas Ocilka
on 2005-11-01 14:05:44 UTC
(
hide
)
Description:
Patch fixing the speed problem
Filename:
MIME Type:
Creator:
Lukas Ocilka
Created:
2005-11-01 14:05:44 UTC
Size:
5.39 KB
patch
obsolete
>Index: ui.ycp >=================================================================== >--- ui.ycp (revision 26037) >+++ ui.ycp (working copy) >@@ -57,6 +57,8 @@ > // index into table column for each runlevel > map runlevel2tableindex = $[]; > >+ // map of services listed in table >+ map <string, boolean> service_ids_listed_in_table = $[]; > > /** > * Create term of checkboxes for runlevel selection. >@@ -133,17 +135,32 @@ > } > > /** >+ * Returns whether the service is listed in the table of services >+ * >+ * @param string service_name >+ */ >+ define boolean ServiceListedInTable (string service_name) { >+ return service_ids_listed_in_table[service_name]:false; >+ } >+ >+ /** > * Update run-time status column. > * @param service_name which line > * @param started status or -1 (unknown yet) > */ > define void updateStatusColumn (string service_name, integer started) ``{ > if (c_rstatus >= 0) { >- UI::ChangeWidget(`id(`table), `Item(service_name, c_rstatus), StartedText(started)); >+ // cannot change item which is not listed in the table >+ if (ServiceListedInTable(service_name)) >+ UI::ChangeWidget(`id(`table), `Item(service_name, c_rstatus), StartedText(started)); > } > if (c_bstatus >= 0) { >- boolean disabled = RunlevelEd::isDisabled(RunlevelEd::services[service_name]:$[]); >- UI::ChangeWidget(`id(`table), `Item(service_name, c_bstatus), BstatusText(disabled, started)); >+ >+ // cannot change item which is not listed in the table >+ if (ServiceListedInTable(service_name)) { >+ boolean disabled = RunlevelEd::isDisabled(RunlevelEd::services[service_name]:$[]); >+ UI::ChangeWidget(`id(`table), `Item(service_name, c_bstatus), BstatusText(disabled, started)); >+ } > } > } > /** >@@ -359,6 +376,7 @@ > return do_abort_now; > } > >+ > /** > * Create table items from services. > * For simple mode, also filter out critical services: boot ones. >@@ -415,6 +433,7 @@ > if (m_dirty) > { > // dirty >+ service_ids_listed_in_table[k] = true; > c_dirty = col; > item = add (item, v["dirty"]:false ? UI::Glyph(`CheckMark) : " "); > col = col + 1; >@@ -422,6 +441,7 @@ > if (m_bstatus) > { > // boot status >+ service_ids_listed_in_table[k] = true; > boolean disabled = RunlevelEd::isDisabled(v); > integer started = v["started"]:-1; > c_bstatus = col; >@@ -431,6 +451,7 @@ > if (m_rstatus) > { > // runtime status >+ service_ids_listed_in_table[k] = true; > integer started = v["started"]:-1; > c_rstatus = col; > item = add (item, StartedText (started)); >@@ -439,6 +460,7 @@ > if (m_runlevels) > { > // runlevels >+ service_ids_listed_in_table[k] = true; > list rl = v["start"]:[]; > c_runlevels = col; > foreach (string i, RunlevelEd::runlevels, ``{ >@@ -452,6 +474,7 @@ > // (short)description > // For the table, use the short description. > // The long one as a fallback. #20853 >+ service_ids_listed_in_table[k] = true; > string descr = v["shortdescription"]:""; > if (descr == "") > { >@@ -467,6 +490,8 @@ > return items; > } > >+ map <string, boolean> fetched_service_status = $[]; >+ > /** > * For each service, determines its status and calls a supplied function. > * @param func function to call >@@ -485,7 +510,14 @@ > string service_name = RunlevelEd::service_list[fetching_service_index]:""; > fetching_service_index = fetching_service_index + 1; > >- updateServiceStatus(use_func, service_name); >+ // every switch between `complex and `simple the fetching_service_index is changed to zero >+ // but only services which were not checked before are checked now >+ if (fetched_service_status[service_name]:false == false) { >+ if (ServiceListedInTable(service_name)) { >+ updateServiceStatus(use_func, service_name); >+ fetched_service_status[service_name] = true; >+ } >+ } > } > > /** >@@ -495,14 +527,12 @@ > */ > define void updateServiceStatus (boolean use_func, string service_name) ``{ > if (RunlevelEd::services[service_name, "started"]:-1 < 0) { >- integer started = Service::RunInitScript (service_name, "status"); >+ integer started = Service::RunInitScript (service_name, "status"); > >- RunlevelEd::services[service_name, "started"] = started; >+ RunlevelEd::services[service_name, "started"] = started; > >- if (use_func) >- { >- updateStatusInTable(service_name, RunlevelEd::services[service_name]:$[], started); >- } >+ if (use_func) >+ updateStatusInTable(service_name, RunlevelEd::services[service_name]:$[], started); > } > } > >@@ -1109,8 +1139,14 @@ > changeService1 (service); > > any ret = nil; >+ >+ // fetch service which were not checked before >+ fetching_service_status = true; >+ fetching_service_index = 0; >+ > while (`next != ret && `back != ret && `abort != ret && `simple != ret) > { >+ if (ret != nil) y2milestone("RET: %1", ret); > // Kludge, because a `Table still does not have a shortcut. > // #16116 > UI::SetFocus (`id (`table)); >@@ -1309,8 +1345,14 @@ > UI::SetFocus (`id (`table)); > any ret = nil; > boolean focustable = false; >+ >+ // fetch service which were not checked before >+ fetching_service_status = true; >+ fetching_service_index = 0; >+ > while (`next != ret && `back != ret && `abort != ret && `complex != ret) > { >+ if (ret != nil) y2milestone("RET: %1", ret); > if (focustable) { > // Kludge, because a `Table still does not have a shortcut. > // #16116
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 129679
: 56125 |
57005